/* National page — reuse V1 visual language from app.css */
.page-national .shell { max-width: 1180px; }
.page-national .mobile-select { display: none !important; }

/* Compact situation overview hero */
.nat-hero { padding: 8px 0 20px; }
.nat-hero__top {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}
.nat-hero__lead h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.02em;
  line-height: 1.25;
}
.nat-hero__updated {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}
.nat-hero__hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Disclaimer notice card — not sticky/fixed */
.nat-notice {
  background: #FFF1F2;
  border: 1px solid #FDA4AF;
  border-radius: 16px;
  padding: 14px 16px;
  max-width: 100%;
}
.nat-notice__title {
  display: block;
  color: #BE123C;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px;
}
.nat-notice__body {
  margin: 0;
  color: #881337;
  font-size: 13px;
  line-height: 1.55;
}

/* 3 situation KPIs only */
.nat-sit-kpis {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.nat-sit-kpis__item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.nat-sit-kpis__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
}
.nat-sit-kpis__item.is-crit .nat-sit-kpis__dot { background: #C9152B; }
.nat-sit-kpis__item.is-watch .nat-sit-kpis__dot { background: #E67E22; }
.nat-sit-kpis__item.is-none .nat-sit-kpis__dot { background: #94a3b8; }
.nat-sit-kpis__label {
  color: var(--muted);
  font-size: 14px;
}
.nat-sit-kpis__num {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
}
.nat-sit-kpis__item.is-crit .nat-sit-kpis__num { color: #C9152B; }
.nat-sit-kpis__item.is-watch .nat-sit-kpis__num { color: #C45C12; }

.nat-find { margin: 0 0 22px; }
.map-legend-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  max-width: 72ch;
}

.nat-detail-stats {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
.nat-detail-stats li {
  padding: 10px 12px;
  background: var(--ice);
  border-radius: 12px;
}
.nat-detail-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.nat-detail-stats strong {
  display: block;
  margin-top: 2px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 18px;
  color: var(--navy);
}
.nat-detail-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

#nat-risk-map .leaflet-overlay-pane {
  mix-blend-mode: multiply;
}

/* Region chips — do NOT use V1 .horizon (hidden on mobile in app.css) */
.nat-regions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.nat-regions button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.nat-regions button.on {
  background: var(--navy);
  color: #fff;
}
.nat-regions button em {
  font-style: normal;
  margin-left: 4px;
  font-size: 11px;
  opacity: .85;
  font-family: "IBM Plex Sans", sans-serif;
}

/* Map — must have explicit height (Leaflet collapses to 0 otherwise) */
.page-national .map-canvas {
  position: relative;
  background: #dceef8;
  border-radius: 16px;
  min-height: 420px;
  height: 420px;
  overflow: hidden;
}
#nat-risk-map,
#nat-risk-map.leaflet-container {
  width: 100% !important;
  height: 100% !important;
  min-height: 420px !important;
  display: block;
  z-index: 1;
  background: #dceef8;
}
#nat-risk-map .leaflet-control-zoom { border: 0; box-shadow: var(--shadow); }

.risk-chip.tone-none {
  color: var(--muted);
  background: #eef2f5;
}

.search-wrap { position: relative; }
#nat-search-hits {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 40; margin: 4px 0 0; padding: 6px;
  list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); max-height: 240px; overflow: auto;
}
#nat-search-hits button {
  width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px;
  font: inherit; cursor: pointer; border-radius: 8px; color: var(--text);
}
#nat-search-hits button:hover { background: var(--ice); }

/* Station rows under map / highlights */
.nat-hit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  color: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  font: inherit;
  margin: 0 0 10px;
}
.nat-hit:hover { border-color: #b9d0e0; }
.nat-hit__name { display: block; font-size: 16px; color: var(--navy); font-weight: 600; }
.nat-hit__meta { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.nat-hit__cols {
  display: grid;
  gap: 10px;
}
.nat-hit__col .label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.nat-hit__col strong {
  display: block;
  font-size: 18px;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--navy);
}
.nat-hit__col .hint {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--ice);
  color: var(--navy);
}
.tag.live { background: #e7f6ee; color: var(--ok); }
.tag.delayed { background: #fff4e5; color: var(--amber); }
.tag.none { background: #eef2f5; color: var(--muted); }

.nat-hl {
  margin: 16px 0 0;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.nat-hl--crit { border-color: #f0b6be; background: #fff8f9; }
.nat-hl--near { border-color: #f0d2a8; background: #fffaf3; }
.nat-hl--rise { border-color: #b9d0e0; background: #f7fbfe; }
.nat-hl--rain { border-color: #a8c8e0; background: #f4f9fc; }
.nat-hl--delay { border-color: #e0d6c4; background: #fcfaf6; }
.nat-hl__head h3 {
  margin: 0;
  font-size: 17px;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nat-hl__count {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(8, 43, 73, .08);
  font-size: 12px;
  font-weight: 700;
  font-family: "IBM Plex Sans", sans-serif;
}
.nat-hl__head p { margin: 4px 0 12px; color: var(--muted); font-size: 13px; }
.nat-hl__list { display: grid; gap: 0; }
.nat-hl__more {
  margin-top: 8px;
  width: 100%;
  border: 1px dashed #b9d0e0;
  background: transparent;
  border-radius: 12px;
  padding: 10px;
  color: var(--blue);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.nat-basin-select {
  width: 100%;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
}
.nat-basin-compact {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.nat-basin-compact li + li { border-top: 1px solid var(--line); }
.nat-basin-compact a {
  display: block;
  padding: 12px 14px;
  color: inherit;
}
.nat-basin-compact a:hover { background: var(--ice); }
.nat-basin-compact__name { display: block; font-weight: 600; color: var(--navy); }
.nat-basin-compact__meta { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

.nat-district-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}
.nat-district-btn {
  border: 1px solid var(--line);
  background: var(--ice);
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--navy);
}
.nat-district-btn.is-active {
  border-color: var(--blue);
  background: #e8f3fb;
}
.nat-district-btn span { color: var(--muted); font-weight: 600; }

.nat-search__results {
  margin-top: 12px;
  display: grid;
  gap: 0;
  max-height: 360px;
  overflow: auto;
}
.nat-search__empty { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.nat-back { margin: 0 0 12px; }

/* Glass detail on national map — taller scroll for stations */
#nat-glass-detail {
  max-height: min(70vh, 520px);
  overflow: auto;
  width: min(320px, 90%);
}
#nat-glass-detail .nat-hit { box-shadow: none; }

/* Drawer */
body.nat-drawer-open { overflow: hidden; }
.nat-drawer { position: fixed; inset: 0; z-index: 80; }
.nat-drawer__backdrop {
  position: absolute; inset: 0; background: rgba(8, 43, 73, .45);
}
.nat-drawer__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: min(88vh, 720px); overflow: auto;
  background: #fff; border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 32px rgba(8, 43, 73, .18);
}
.nat-drawer__panel--wide { max-height: min(92vh, 820px); }
.nat-drawer__head {
  position: sticky; top: 0; display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: #fff; border-bottom: 1px solid var(--line); z-index: 1;
}
.nat-drawer__head h2 { margin: 0; font-size: 17px; color: var(--navy); }
.nat-drawer__close {
  border: 0; background: var(--ice); width: 36px; height: 36px;
  border-radius: 50%; font-size: 22px; cursor: pointer; color: var(--navy);
}
.nat-drawer__body { padding: 14px 16px; }
.nat-hl-panel-list { display: grid; gap: 0; }
.nat-detail-grid { display: grid; gap: 12px; }
.nat-detail-block {
  padding: 12px; border-radius: 12px; background: var(--ice);
}
.nat-detail-block .label {
  display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px;
}
.nat-detail-block .hint {
  display: block; margin-top: 4px; color: var(--muted); font-size: 12px;
}
.nat-hit__level-lg {
  display: block;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 28px;
  color: var(--navy);
}
.nat-code { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

@media (min-width: 700px) {
  .nat-hit__cols { grid-template-columns: 1.1fr 1.3fr 0.9fr; align-items: start; }
  .nat-drawer__panel {
    left: auto; right: 0; top: 0; bottom: 0;
    width: min(440px, 100%); max-height: none; border-radius: 0;
  }
  .nat-drawer__panel--wide { width: min(560px, 100%); }
  .nat-sit-kpis { grid-template-columns: repeat(3, 1fr); }
  .nat-detail-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .page-national .nav { display: flex; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; }
  .nat-hero__top {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
  }
  .nat-hero__lead { flex: 1; min-width: 0; }
  .nat-hero__lead h1 { font-size: 34px; }
  .nat-notice {
    flex: 0 0 340px;
    width: 340px;
    max-width: 360px;
  }
  .page-national .map-canvas {
    min-height: 560px;
    height: 560px;
  }
}
@media (max-width: 899px) {
  .page-national .nav { display: none; }
  .page-national .map-canvas {
    min-height: 380px;
    height: 380px;
  }
  .place-bar { grid-template-columns: 1fr; }
  .nat-hero__lead h1 { font-size: 26px; }
}
