@font-face {
  font-family: "Noto Sans Thai";
  src: url("/fonts/NotoSansThai-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans Thai";
  src: url("/fonts/NotoSansThai-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #2c2c2c;
  --gold: #ffd700;
  --red: #dc143c;
  --ok: #15803d;
  --ok-line: #16a34a;
  --watch: #b45309;
  --warn: #c2410c;
  --danger: #b91c1c;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f3f4f6;
  --card: #fff;
  --appbar-h: 108px;
  --stats-h: 54px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100%;
}
button, input, select { font-family: inherit; }
a { color: #1d4ed8; }

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.92);
  color: #16324f;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 12px;
  min-height: 56px;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(22,50,79,.06);
}
.brand { font-weight: 700; font-size: 18px; color: #16324f; letter-spacing: 0.01em; text-decoration: none; }
.brand span { color: #3b82c4; font-weight: 700; }
.appbar-side { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.appbar-meta { font-size: 12px; color: #5b7088; text-align: right; }
.refresh {
  border: 1px solid #d5e2ef;
  background: white;
  color: #16324f;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.pillnav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  background: #eef4f8;
  border-radius: 999px;
  padding: 4px;
  flex: 1 1 100%;
  scrollbar-width: none;
}
.pillnav::-webkit-scrollbar { display: none; }
.pillnav button {
  border: 0;
  background: transparent;
  color: #3d5166;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.pillnav button.active {
  background: white;
  color: #16324f;
  box-shadow: 0 1px 3px rgba(22,50,79,.12);
}
.pillnav button.pill-help {
  background: #e11d48;
  color: #fff;
}
.pillnav button.pill-help.active {
  background: #be123c;
  color: #fff;
}
@media (min-width: 900px) {
  .brand { order: 1; }
  .pillnav { order: 2; flex: 1 1 auto; }
  .appbar-side { order: 3; margin-left: auto; }
}

.view {
  padding: 14px 14px 28px;
  max-width: 980px;
  margin: 0 auto;
}
.loading-page, .empty, .error-box {
  background: white;
  border-radius: 16px;
  padding: 28px 18px;
  text-align: center;
  font-size: 18px;
}
.error-box button, .text-btn {
  margin-top: 12px;
  background: var(--ink);
  color: var(--gold);
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.stale {
  margin: 10px 14px 0;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 700;
}
body.route-map .stale { display: none; }

.hero, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
  overflow-x: auto;
}
.hero.tone-ok { background: linear-gradient(180deg, #ecfdf3 0%, #fff 46%); }
.hero.tone-watch { background: linear-gradient(180deg, #fffbeb 0%, #fff 46%); }
.hero.tone-warn { background: linear-gradient(180deg, #fff7ed 0%, #fff 46%); }
.hero.tone-danger { background: linear-gradient(180deg, #fef2f2 0%, #fff 46%); }
.kicker { margin: 0; font-size: 15px; color: var(--muted); }
.hero-status {
  display: inline-block;
  margin: 8px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
}
.tone-ok .hero-status { background: #dcfce7; color: var(--ok); }
.tone-watch .hero-status { background: #fef3c7; color: var(--watch); }
.tone-warn .hero-status { background: #ffedd5; color: var(--warn); }
.tone-danger .hero-status { background: #fee2e2; color: var(--danger); }
.tone-muted .hero-status { background: #f3f4f6; color: var(--muted); }
.hero-num {
  margin: 4px 0 0;
  font-size: 76px;
  line-height: 0.95;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.hero-num small { font-size: 28px; margin-left: 4px; font-weight: 700; }
.hero-bank { margin: 6px 0 0; font-size: 22px; font-weight: 700; }
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 0;
}
.facts div {
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
}
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; }
h2 { font-size: 20px; margin: 0 0 8px; }
h3 { font-size: 17px; margin: 0 0 6px; }
.lead { font-size: 16px; line-height: 1.55; margin: 0 0 8px; }
.note { font-size: 14px; color: #374151; line-height: 1.5; }
.disclaimer {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 14px;
  padding: 12px;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.risk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #374151;
}
.risk-legend .swatch { margin-right: 4px; }
.risk-cards { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 4px; }
.risk-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px 8px;
}
.risk-card.tone-green { background: #ecfdf3; border-color: #86efac; }
.risk-card.tone-yellow { background: #fef9c3; border-color: #facc15; }
.risk-card.tone-red { background: #fee2e2; border-color: #f87171; }
.risk-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.risk-level {
  margin: 0;
  font-size: 42px;
  line-height: 0.95;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.risk-level small { font-size: 18px; margin-left: 2px; }
.risk-gap { margin: 0; font-size: 18px; font-weight: 700; text-align: right; }
.risk-names { margin: 8px 0 0; font-size: 16px; line-height: 1.45; }
.risk-prob { margin: 4px 0 0; font-size: 15px; font-weight: 700; }
.risk-extra { margin: 2px 0 0; font-size: 12px; color: #374151; }
.quiet-h { margin-top: 16px; font-size: 15px; color: #374151; }
.demo-banner {
  margin: 10px 14px 0;
  background: #111827;
  color: var(--gold);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.src-fold { margin-top: 6px; }
.src-fold summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.sources { margin-top: 6px; }
.src { margin: 0 0 4px; font-size: 12px; line-height: 1.4; color: #4b5563; }
.src a { color: #1e3a8a; }
.kind {
  display: inline-block;
  margin-right: 4px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  vertical-align: 1px;
}
.kind-official { background: #dcfce7; color: #166534; }
.kind-news { background: #fef3c7; color: #92400e; }
.kind-analysis { background: #fef9c3; color: #854d0e; border: 1px solid var(--gold); }
.src-detail { display: block; color: var(--muted); }

.page-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.page-tabs button {
  border: none;
  background: transparent;
  color: #6b7280;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
}
.page-tabs button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.dash-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.dash-card {
  background: white;
  border: 1px solid #e8eaed;
  border-radius: 16px;
  padding: 16px 16px 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.metric { display: flex; gap: 12px; align-items: center; }
.metric-icon { width: 64px; height: 64px; flex: none; }
.metric-icon svg { width: 64px; height: 64px; display: block; }
.dash-kicker { margin: 0; color: #6b7280; font-size: 14px; }
.dash-num {
  margin: 2px 0 0;
  font-size: 52px;
  line-height: .95;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.dash-num small { font-size: 16px; margin-left: 4px; font-weight: 600; }
.trend-arrow { font-size: .7em; font-weight: 700; line-height: 1; }
.up-code .trend-arrow { font-size: 22px; }
.trend-arrow.up { color: #dc2626; }
.trend-arrow.down { color: #2563eb; }
.trend-arrow.flat, .trend-arrow.unknown { color: #6b7280; }
.dash-strong { margin: 8px 0 0; font-size: 18px; font-weight: 700; }
.dash-meta { margin: 4px 0 0; font-size: 13px; color: #4b5563; line-height: 1.4; }
.band-word { margin: 8px 0 0; font-size: 44px; font-weight: 700; line-height: 1.05; }
.band-normal { color: #15803d; }
.band-watch { color: #b45309; }
.band-risk { color: #c2410c; }
.band-flood { color: #b91c1c; }
.band-unknown { color: #6b7280; }
.up-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.up-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
}
.up-row:last-child { border-bottom: none; padding-bottom: 0; }
.up-code { font-weight: 700; font-size: 16px; }
.up-lvl { text-align: right; font-weight: 700; font-size: 14px; }
.up-lvl span { display: block; font-weight: 400; color: #4b5563; font-size: 12px; }
.donut-layout { display: flex; gap: 8px 16px; align-items: center; margin-top: 8px; }
.donut { width: 148px; height: 148px; flex: none; }
.donut-n { font-family: "Noto Sans Thai", sans-serif; font-size: 22px; font-weight: 700; fill: #111827; }
.donut-s { font-family: "Noto Sans Thai", sans-serif; font-size: 11px; fill: #6b7280; }
.legend-rows { flex: 1; min-width: 0; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.legend-dot { width: 12px; height: 12px; border-radius: 99px; flex: none; }
.legend-row .cnt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.legend-row .unit { color: #6b7280; font-size: 12px; width: 36px; }
.risk-names-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.risk-names-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.section-head { margin: 4px 0 8px; }
.row-2 { display: grid; gap: 12px; }
.risk-cards { margin-bottom: 12px; }
.forecast-card, .weir-card { margin-bottom: 12px; }
.self-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
}
.outlook { margin-top: 10px; }
.outlook-svg { width: 100%; height: 92px; display: block; }
.outlook-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.outlook-num { background: #f8fafc; border-radius: 8px; padding: 6px 2px; text-align: center; }
.outlook-h { font-size: 11px; color: #6b7280; }
.outlook-v { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.outlook-band { font-size: 10px; color: #4b5563; font-variant-numeric: tabular-nums; }
.flow-panel { overflow: hidden; }
.flow-summary { margin: 8px 0 4px; font-size: 18px; font-weight: 700; line-height: 1.45; }
.flow-svg { width: 100%; height: auto; display: block; font-family: "Noto Sans Thai", Tahoma, sans-serif; }
.flow-key { margin: 8px 0 0; font-size: 12px; color: #4b5563; line-height: 1.7; }
.flow-key i { display: inline-block; width: 9px; height: 9px; border-radius: 99px; margin: 0 3px 0 8px; }
.flow-key i:first-child { margin-left: 0; }
.forecast-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.forecast-day { background: #f8fafc; border-radius: 10px; padding: 8px 4px; text-align: center; }
.forecast-date { font-size: 11px; color: #6b7280; line-height: 1.3; }
.forecast-mm { font-weight: 700; font-size: 18px; line-height: 1.2; }
.forecast-unit, .forecast-text { font-size: 11px; color: #4b5563; }
@media (min-width: 800px) {
  .dash-grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .dash-span-2 { grid-column: span 2; }
  .forecast-row { grid-template-columns: repeat(7, 1fr); }
  .dash-grid.cols-3 { grid-template-columns: 1.25fr .85fr 1fr; }
  .dash-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .row-2 { grid-template-columns: 1.15fr .85fr; align-items: start; }
  .hero-num { font-size: 92px; }
  .risk-cards { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .view { max-width: 1180px; }
  .dash-grid.cols-4 { grid-template-columns: 1fr 1fr 1.4fr 1.4fr; }
  .risk-cards { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 640px) {
  .donut-layout { flex-direction: column; align-items: stretch; }
  .donut { align-self: center; }
  .dash-num { font-size: 46px; }
  .page-tabs button { font-size: 14px; padding: 8px 10px; }
}

.station-mini, .chain {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.station-mini article, .chain article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.station-mini .lvl, .chain .lvl { font-size: 22px; font-weight: 700; }
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}
.tag-ok { background: #dcfce7; color: #166534; }
.tag-near { background: #ffedd5; color: #9a3412; }
.tag-over { background: #fee2e2; color: #991b1b; }
.tag-none, .tag-flat, .tag-unknown { background: #f3f4f6; color: #374151; }
.tag-up { background: #fee2e2; color: #991b1b; }
.tag-down { background: #dbeafe; color: #1e40af; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 700; }
.chart { width: 100%; height: auto; display: block; background: #fff; }
.chart .line { fill: none; stroke: #1d4ed8; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.chart .line-normal { stroke: #16a34a; }
.chart .line-watch { stroke: #eab308; }
.chart .line-bankfull { stroke: #dc2626; }
.chart .line-overflow { stroke: #7f0000; }
.chart .band { stroke: none; }
.chart .bank-line { stroke: #7f1d1d; stroke-dasharray: 5 4; stroke-width: 1.6; }
.chart .axis { fill: #6b7280; font-size: 12px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 12px; color: #16324f; }
.chart-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.status-timeline { margin-top: 12px; }
.status-timeline h3 { margin: 0 0 6px; font-size: 16px; }
.status-timeline p, .status-timeline li { margin: 0 0 4px; font-size: 14px; line-height: 1.45; }
.status-now { font-weight: 700; }
.status-timeline ul { margin: 6px 0 0; padding-left: 18px; }
path.river-hit { pointer-events: none; }
path.river-hit.is-live { pointer-events: stroke; }
.river-pop .leaflet-popup-content { margin: 10px 12px; }
.river-tip { color: #16324f; font-size: 14px; line-height: 1.45; }
.river-tip p { margin: 0 0 4px; }
.river-tip-title { font-weight: 800; }
.bars rect.over { fill: #dc2626; }
.bars rect.ok { fill: #16a34a; }
.bars rect.partial { opacity: .55; }

.controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.controls select, .seg button {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: white;
  padding: 0 12px;
  font-size: 15px;
}
.seg button.active { background: var(--ink); color: var(--gold); border-color: var(--ink); font-weight: 700; }

/* Map fills the space under the shared light header; the stats strip is the bottom edge */
body.route-map { overflow: hidden; height: 100%; background: #f4f7fb; }
body.route-map .appbar { background: #fff; z-index: 40; }
body.route-map #view, body.route-map #banner { display: none; }
#mapShell { display: none; }
body.route-map #mapShell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) var(--stats-h);
  grid-template-columns: minmax(0, 1fr);
  position: fixed;
  top: var(--appbar-h);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  overflow: hidden;
  background: #e7edf2;
}
.map-chrome {
  min-width: 0;
  background: #fff;
  border-bottom: 1px solid rgba(22,50,79,.08);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}
.topbar-filters {
  display: flex; gap: 6px; min-width: 0; max-width: 100%;
  overflow-x: auto; scrollbar-width: none; align-items: center;
}
.topbar-filters::-webkit-scrollbar { display: none; }
.filter-btn {
  padding: 6px 12px; border-radius: 999px;
  border: 0;
  background: #e8edf2; color: #3d5166;
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; min-height: 32px;
}
.filter-btn.active { background: #16324f; color: #fff; }
.flow-toggle {
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #16324f;
  background: #fff;
  color: #16324f;
  font-size: 13px;
  font-weight: 800;
  min-height: 32px;
  cursor: pointer;
}
.flow-toggle.is-on { background: #16324f; color: #fff; }
.flow-sheet {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 6;
  max-height: min(72vh, 640px);
  overflow: auto;
}
.flow-sheet[hidden] { display: none; }
.flow-sheet-card {
  background: #fff;
  border: 1px solid #d5e2ef;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(22, 50, 79, .16);
  padding: 8px 12px 12px;
}
.flow-sheet-card > summary {
  font-weight: 800;
  color: #16324f;
  cursor: pointer;
  padding: 6px 0;
}
.flow-node {
  border: 1px solid #d5e2ef;
  border-left: 6px solid var(--flow-color, #9ca3af);
  border-radius: 12px;
  padding: 8px 10px;
  background: #fff;
}
.flow-node.is-stale { background: #f3f4f6; color: #6b7280; }
.flow-node p { margin: 0 0 3px; font-size: 14px; line-height: 1.35; }
.flow-code { font-weight: 800; color: #16324f; }
.flow-node.is-stale .flow-code { color: #6b7280; }
.flow-status { font-weight: 700; color: var(--flow-color, #16324f); }
.flow-old { font-weight: 800; color: #6b7280; }
.flow-when, .flow-trend { color: #5b6b7c; font-size: 12px; }
.flow-arrow { text-align: center; color: #16324f; font-size: 18px; line-height: 1; margin: 2px 0; }
.flow-branch { margin-left: 18px; }
.flow-join { margin: 4px 0 0; font-size: 12px; color: #5b6b7c; }
.flow-open {
  margin-top: 6px;
  border: 0;
  border-radius: 999px;
  background: #16324f;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
}
.flow-foot { margin: 10px 0 0; font-size: 14px; }
.flow-foot a { font-weight: 700; }
.searchbar {
  display: flex; gap: 8px; align-items: center;
}
.search-input {
  flex: 1; height: 36px; border: 1px solid #d5e2ef; border-radius: 999px;
  padding: 0 14px; font-size: 14px; outline: none; background: #f3f4f6; color: #16324f;
}
.search-input:focus { background: #fff; border-color: #9eb6cc; }
.search-clear {
  width: 32px; height: 32px; border: 1px solid #d5e2ef; background: #fff; color: #3d5166;
  border-radius: 50%; cursor: pointer; display: none; align-items: center; justify-content: center;
}
.search-clear.show { display: flex; }
.map-stage { position: relative; min-width: 0; min-height: 0; }
#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #e7edf2;
}
.map-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.btn-locate {
  width: 34px; height: 34px; background: #fff; color: #16324f;
  border: 1px solid #d5e2ef; border-radius: 10px; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(22,50,79,.14);
}
.count-badge { display: none; }
@media (min-width: 720px) {
  .map-chrome { flex-direction: row; align-items: center; }
  .topbar-filters { flex: 1; min-width: 0; }
  .searchbar { flex: 0 0 280px; }
}
.leaflet-container { background: #e7edf2; }
.province-shape { filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.18)); }
.neighbour-shape { filter: none; }
.leaflet-div-icon.neighbour-label {
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  color: #8b97a6;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 1px 0 #fff, -1px 0 #fff, 0 1px #fff, 0 -1px #fff;
}
.leaflet-div-icon.river-label,
.leaflet-div-icon.district-label {
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}
.river-name {
  display: block;
  color: #1a4f86;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  white-space: nowrap;
  text-shadow:
    0 0 2px #fff, 0 0 3px #fff,
    1px 0 #fff, -1px 0 #fff, 0 1px #fff, 0 -1px #fff,
    1px 1px #fff, -1px -1px #fff, 1px -1px #fff, -1px 1px #fff;
}
.leaflet-div-icon.district-label {
  color: #8b97a6;
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 1px 0 #fff, -1px 0 #fff, 0 1px #fff, 0 -1px #fff;
}
#map.zoom-city .river-label,
#map.zoom-city .district-label,
#map.zoom-city .neighbour-label { display: none; }
.res-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: #1d4ed8; color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; box-shadow: 0 0 0 2px #fff;
  position: relative;
}
.res-name {
  position: absolute; left: 24px; top: 2px;
  color: #1e3a8a; font-size: 11px; font-weight: 700; white-space: nowrap;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
body.route-map .leaflet-top.leaflet-right { top: 88px; }
body.route-map .leaflet-control-attribution {
  font-size: 10px;
  background: rgba(255,255,255,.88);
  max-width: 46vw;
}
.leaflet-container { font-family: "Noto Sans Thai", Tahoma, sans-serif; }
.pin-wrap, .leaflet-div-icon.pin-wrap { background: transparent; border: none; }
.pin {
  position: relative;
  height: 100%; width: 100%; padding: 4px 8px; box-sizing: border-box;
  border-radius: 14px; background: white; border: 3px solid #9ca3af;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--ink); line-height: 1.15;
}
.pin-place, .pin-line { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pin-place { font-size: 12px; }
.pin-line { font-size: 11px; }
.pin.ms-normal { border-color: #16a34a; }
.pin.ms-watch { border-color: #eab308; }
.pin.ms-bankfull { border-color: #dc2626; }
.pin.ms-overflow { border-color: #7f0000; }
.pin.ms-none { border-color: #9ca3af; color: #6b7280; }
.pin-symbol {
  position: relative;
  width: 100%; height: 100%; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; line-height: 1; color: #fff;
  border: 2px solid transparent;
  box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0,0,0,.35);
}
.pin-symbol.ms-normal { background: #16a34a; }
.pin-symbol.ms-watch { background: #eab308; color: #1f2937; }
.pin-symbol.ms-bankfull { background: #dc2626; }
.pin-symbol.ms-overflow { background: #7f0000; }
.pin-symbol.ms-none {
  background: #fff; color: #6b7280; border-color: #9ca3af;
}
.pin-city { box-shadow: 0 0 0 3px var(--gold), 0 2px 8px rgba(0,0,0,.3); }
.pin-symbol.pin-city { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gold); }
.pin-row { display: flex; align-items: center; height: 28px; width: max-content; }
.pin-row .pin-symbol { width: 28px; height: 28px; flex: none; }
.pin-delta {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  white-space: nowrap;
  color: #4b5563;
  box-shadow: 0 1px 2px rgba(15,23,42,.18);
  font-variant-numeric: tabular-nums;
}
.pin-row.is-left .pin-delta { margin-left: 0; margin-right: 6px; }
.pin-row.is-below { flex-direction: column; height: auto; align-items: center; }
.pin-row.is-below .pin-delta { margin: 4px 0 0; }
.pin-delta.up { color: #b91c1c; }
.pin-delta.down { color: #1d4ed8; }
.pin-delta.flat { color: #4b5563; }
.pin-cam {
  position: absolute; top: -5px; right: -5px; width: 16px; height: 16px;
  filter: drop-shadow(0 0 0 #fff);
}
.leaflet-div-icon.cam-wrap { background: transparent; border: none; }
.cam-pin {
  width: 22px; height: 22px; border-radius: 50%;
  background: #16324f; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(15, 23, 42, .45);
}
.cam-pin svg { width: 14px; height: 14px; display: block; }
.cam-pin.is-stale { background: #9aa3ad; opacity: 0.55; }
.cam-modal-shot { position: relative; }
.cam-modal-shot.is-stale img { opacity: 0.45; filter: grayscale(0.45); }
.cam-shot-date {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(15, 23, 42, .78); color: #fff;
  font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px;
}
.map-stats > div { flex: 1; min-width: 0; }
.map-stats {
  position: relative; min-width: 0; height: var(--stats-h);
  background: #fff; display: flex; align-items: center; justify-content: space-around;
  border-top: 1px solid #e3ebf3;
  z-index: 800;
}
.map-stats .stat-value { font-size: 17px; font-weight: 700; color: #16324f; line-height: 1; text-align: center; }
.map-stats .stat-value.tone-overflow::before,
.map-stats .stat-value.tone-bankfull::before,
.map-stats .stat-value.tone-watch::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 4px;
  border-radius: 99px;
  vertical-align: 1px;
  background: #7f0000;
}
.map-stats .stat-value.tone-bankfull::before { background: #dc2626; }
.map-stats .stat-value.tone-watch::before { background: #eab308; }
.map-stats .stat-label { font-size: 11px; color: #5b7088; margin-top: 3px; text-align: center; }
.legend {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 700;
  background: #fff;
  color: #16324f;
  border: 1px solid #d5e2ef;
  border-radius: 10px;
  padding: 0 10px 0;
  font-size: 13px;
  box-shadow: 0 1px 4px rgba(22,50,79,.14);
  max-width: min(196px, 62vw);
}
.legend summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #16324f;
  min-height: 34px;
  display: flex;
  align-items: center;
  list-style: none;
}
.legend summary::-webkit-details-marker { display: none; }
.legend[open] { max-height: 42vh; overflow: auto; padding-bottom: 8px; }
body.route-map .leaflet-bottom.leaflet-right { margin-bottom: 8px; }
body.route-map .leaflet-bar {
  border: none;
  box-shadow: none;
}
body.route-map .leaflet-bar a,
body.route-map .leaflet-bar a:hover,
body.route-map .leaflet-bar a:focus {
  width: 34px;
  height: 34px;
  line-height: 32px;
  background: #fff;
  color: #16324f;
  border: 1px solid #d5e2ef;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(22,50,79,.14);
}
body.route-map .leaflet-bar a:first-child { border-bottom: 1px solid #d5e2ef; }
body.route-map .leaflet-bar a:last-child {
  border-bottom: 1px solid #d5e2ef;
  margin-top: 6px;
}
body.route-map .leaflet-touch .leaflet-bar a,
body.route-map .leaflet-touch .leaflet-bar a:first-child,
body.route-map .leaflet-touch .leaflet-bar a:last-child {
  width: 34px;
  height: 34px;
  line-height: 32px;
  border-radius: 10px;
}
.legend div { display: flex; align-items: center; gap: 6px; margin: 1px 0; }
.swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 2px solid; background: white; }
.swatch.ok { border-color: #32BF71; background: #32BF71; }
.swatch.high { border-color: #6179B9; background: #6179B9; }
.swatch.overflow { border-color: #F04B4F; background: #F04B4F; }
.swatch.low { border-color: #F8C744; background: #F8C744; }
.swatch.critical { border-color: #E29955; background: #E29955; }
.swatch.none { border-color: #9ca3af; }
.swatch.watch { border-color: #a16207; background: #fde047; }
.swatch.ms-normal { border-color: #16a34a; background: #16a34a; }
.swatch.ms-watch { border-color: #eab308; background: #eab308; }
.swatch.ms-bankfull { border-color: #dc2626; background: #dc2626; }
.swatch.ms-overflow { border-color: #7f0000; background: #7f0000; }
.swatch.ms-none { border-color: #9ca3af; background: #fff; }
.risk-legend .swatch.ok { background: #86efac; }
.risk-legend .swatch.over { background: #fca5a5; }
.legend-note { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.legend-flow { margin-top: 4px; }
.flow-key {
  display: inline-block; width: 18px; height: 0; margin: 0 2px 2px 0;
  border-top: 4px solid #0369a1; vertical-align: middle;
}
.flow-key.tone-watch { border-top-color: #ca8a04; }
.flow-key.tone-rise { border-top-color: #dc2626; }
.flow-arrows {
  position: absolute;
  pointer-events: none;
  z-index: 4;
}
.river-flow {
  animation-name: river-dash;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.river-flow.speed-fast { animation-duration: 1.1s; }
.river-flow.speed-rise { animation-duration: 1.9s; }
.river-flow.speed-steady { animation-duration: 3.6s; }
.river-flow.speed-fall { animation-duration: 5.6s; }
@keyframes river-dash { to { stroke-dashoffset: -36; } }
@media (prefers-reduced-motion: reduce) {
  .river-flow { animation: none; }
}
.map-banner {
  position: absolute;
  top: 10px;
  left: 10px; right: 56px;
  z-index: 750;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.leaflet-popup-content { margin: 10px 12px; }
.st-popup { min-width: 200px; }
.popup-name { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.popup-meta { font-size: 12px; color: var(--muted); margin: 2px 0 7px; }
.popup-late {
  background: #fef2f2; color: #dc2626; padding: 4px 7px; border-radius: 6px;
  font-size: 12px; font-weight: 700; margin-bottom: 6px; text-align: center;
}
.fuel-row {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 4px 7px; border-radius: 6px; margin-bottom: 3px; background: #f8fafc; border: 1px solid #e2e8f0;
}
.fuel-row-label { font-size: 12px; font-weight: 700; color: #374151; }
.popup-time {
  font-size: 14px; font-weight: 700; color: #111827; text-align: center;
  margin: 6px 0; background: #f1f5f9; border-radius: 6px; padding: 6px 8px;
}
.popup-actions { display: flex; gap: 6px; }
.popup-btn {
  flex: 1; padding: 8px 4px; border: none; border-radius: 7px;
  font-size: 13px; font-weight: 700; cursor: pointer; text-align: center;
  text-decoration: none; display: block; min-height: 36px; line-height: 20px;
}
.popup-btn-nav { background: #16a34a; color: white; }
.popup-btn-info { background: var(--ink); color: var(--gold); }

.detail-panel {
  position: absolute;
  left: 0; right: 0;
  bottom: var(--stats-h);
  z-index: 900;
  background: white;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.18);
  transform: translateY(calc(100% + var(--stats-h)));
  transition: transform .28s ease;
  max-height: 68%;
  overflow-y: auto;
}
.detail-panel.open { transform: translateY(0); }
.detail-drag { width: 36px; height: 4px; background: var(--line); border-radius: 2px; margin: 10px auto 0; }
.detail-header {
  padding: 10px 14px 8px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: white;
}
.detail-title { font-size: 16px; font-weight: 700; }
.detail-close {
  background: none; border: none; font-size: 26px; cursor: pointer; color: var(--muted); width: 36px; height: 36px;
}
.detail-body { padding: 12px 14px 28px; }
.d-nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 13px; background: #16a34a; color: white;
  border-radius: 10px; font-size: 15px; font-weight: 700; text-decoration: none; margin-top: 8px;
}
@media (min-width: 600px) {
  .detail-panel {
    left: auto; right: 12px;
    bottom: calc(var(--stats-h) + 8px);
    width: 360px; border-radius: 14px; max-height: 75%;
  }
}
.loading-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.45); z-index: 1500;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px;
}
.loading-overlay.hidden { display: none; }
.spinner {
  width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.3);
  border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: white; font-size: 14px; }

.event-list { display: flex; flex-direction: column; gap: 8px; }
.event-list article { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.year { font-weight: 700; color: var(--red); }

.pdpa-note {
  margin: 8px 16px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.about-foot {
  margin: 18px 16px 8px;
  text-align: center;
  font-size: 12px;
}
.about-foot a {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}
.about { color: #16324f; }
.about-hero { text-align: center; }
.about-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.about-logos img {
  height: 56px;
  width: auto;
  max-width: 34%;
  object-fit: contain;
}
.about h1 { margin: 0; font-size: 26px; line-height: 1.3; }
.about h2 {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.about-lead, .about p { margin: 8px 0 0; line-height: 1.55; }
.about-lead { color: #5b7088; font-size: 14px; }
.about ul { margin: 8px 0 0; padding-left: 18px; }
.about li { margin: 6px 0; line-height: 1.5; }
.about-note { color: #5b7088; font-size: 13px; }
.about-fb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #16324f;
  color: #fff;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}
.about-fb span { min-width: 0; }
body.route-about {
  background: linear-gradient(180deg, #d7eefc 0, #e8f5fc 320px, #f4f7fb 640px);
}

body.route-home, body.route-help, body.route-capacity {
  background: linear-gradient(180deg, #d7eefc 0, #e8f5fc 320px, #f4f7fb 640px);
}
body.route-home .view {
  max-width: none;
  padding: 0 0 96px;
  background: transparent;
}
@media (min-width: 960px) {
  body:not(.route-map) .view { padding-bottom: 36px; }
  body.route-home .view { padding-bottom: 96px; }
}

.pop-home { color: #16324f; }
.pop-hero, .pop-wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.pop-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 12px;
  align-items: end;
}
@media (min-width: 900px) {
  .pop-hero { grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr); min-height: 540px; }
}
.pop-fresh, .pop-meta, .pop-notes, .pop-share-note { margin: 6px 0 0; color: #3d5166; font-size: 14px; }
.pop-title {
  margin: 6px 0 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.12;
  font-weight: 700;
  color: #10283f;
}
.trend-word { font-weight: 700; }
.tw-flat { color: #1d4ed8; }
.tw-up { color: #dc2626; }
.tw-down { color: #15803d; }
.tw-unknown { color: #64748b; }
.pop-summary { margin: 10px 0 0; font-size: 17px; line-height: 1.45; max-width: 40rem; }
.pop-search { position: relative; display: block; margin-top: 14px; }
.pop-search svg { position: absolute; left: 14px; top: 15px; }
.pop-search input {
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: white;
  padding: 14px 16px 14px 42px;
  font-size: 16px;
  color: #16324f;
  box-shadow: 0 8px 24px rgba(30, 80, 130, .08);
}
.pop-suggest {
  position: absolute;
  z-index: 6;
  left: 0; right: 0;
  top: calc(100% + 6px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(22,50,79,.14);
  overflow: hidden;
}
.pop-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: white;
  padding: 10px 14px;
  border-bottom: 1px solid #eef2f6;
  cursor: pointer;
  font-size: 15px;
}
.pop-suggest button small, .near-row small { display: block; color: #5b7088; font-size: 12px; }
.pop-empty { margin: 0; padding: 12px 14px; color: #5b7088; }
.pop-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.pop-primary {
  background: #16324f;
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.pop-share, .pop-ghost, .pop-timebar button {
  border: 0;
  cursor: pointer;
  font-weight: 700;
}
.pop-share {
  width: 46px; height: 46px; border-radius: 50%;
  background: white;
  box-shadow: 0 6px 16px rgba(22,50,79,.08);
  display: grid; place-items: center;
}
.pop-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pop-chip {
  background: rgba(255,255,255,.88);
  color: #1e3a5f;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(22,50,79,.06);
}
.pop-hero-art { position: relative; container-type: inline-size; min-height: 280px; }
.skyline { width: 100%; height: auto; display: block; }
.pop-gauge-float { position: absolute; left: 4%; bottom: 7%; z-index: 2; pointer-events: none; }
.pop-gauge-kicker { font-size: 13px; font-weight: 700; color: #3d5166; }
.pop-gauge-val {
  margin: 0;
  font-size: clamp(56px, 22cqw, 104px);
  font-weight: 700;
  line-height: .85;
  letter-spacing: -0.04em;
  color: #10283f;
}
.pop-gauge-val small { font-size: .34em; margin-left: .08em; }
.pop-gauge-pct { margin: 4px 0 0; font-size: clamp(16px, 4.5cqw, 22px); font-weight: 700; }
.pop-waves { animation: pop-drift 8s linear infinite; }
@keyframes pop-drift { from { transform: translateX(0); } to { transform: translateX(-140px); } }
@media (prefers-reduced-motion: reduce) { .pop-waves { animation: none; } }

.pop-wrap { padding-top: 8px; padding-bottom: 12px; }
.pop-disclaimer, .pop-card {
  background: white;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(30, 70, 110, .06);
}
.pop-disclaimer { padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.pop-section { margin: 22px 0; }
.pop-home h2 { margin: 0 0 8px; font-size: clamp(24px, 4vw, 32px); color: #10283f; }
.pop-lead { margin: 0 0 8px; color: #3d5166; line-height: 1.5; }
.pop-split { display: grid; gap: 12px; }
@media (min-width: 800px) { .pop-split { grid-template-columns: 1.05fr .95fr; } }
.pop-card { padding: 16px; }
.pop-card select, .name-chips button {
  font: inherit;
}
.pop-card select {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  background: white;
  margin: 6px 0 10px;
}
.pop-kicker { font-size: 13px; font-weight: 700; color: #5b7088; }
.name-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.name-chips button {
  border: 0;
  background: #eef4f8;
  color: #16324f;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.name-chips button.is-on { background: #16324f; color: white; }
.schematic { width: 100%; height: auto; display: block; }
.blob { cursor: pointer; }
.blob.is-on circle { stroke: #16324f; stroke-width: 4px; }
.tone-pill {
  display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center;
  border-radius: 999px; padding: 6px 12px; font-weight: 700; margin-bottom: 8px;
}
.tone-pill span { font-weight: 500; }
.tone-pill.tone-green { background: #dcfce7; color: #166534; }
.tone-pill.tone-yellow { background: #fef9c3; color: #854d0e; }
.tone-pill.tone-red { background: #fee2e2; color: #991b1b; }
.tone-pill.tone-grey { background: #f3f4f6; color: #374151; }
.near-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pop-ghost {
  background: #eef4f8; color: #16324f; border-radius: 999px; padding: 8px 12px; font-size: 14px;
}
.near-row {
  display: flex; width: 100%; text-align: left; gap: 10px; align-items: center;
  border: 0; background: #f7fafc; border-radius: 16px; padding: 10px 12px; margin-top: 8px; cursor: pointer;
}
.near-dot { width: 12px; height: 12px; border-radius: 99px; flex: none; }
.near-lvl { margin-left: auto; text-align: right; font-weight: 700; white-space: nowrap; }
.flow-teaser { display: flex; gap: 6px; align-items: center; overflow-x: auto; padding: 8px 0 12px; }
.flow-pill {
  display: inline-flex; align-items: center; gap: 6px; background: #f4f8fb;
  border-radius: 14px; padding: 8px 10px; white-space: nowrap; font-size: 13px;
}
.flow-hop { color: #94a3b8; font-weight: 700; }
.pop-home .dash-card, .pop-home .forecast-card, .pop-home .weir-card {
  border: 0;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(30, 70, 110, .06);
}
.alt-card h2 { font-size: 22px; }
.pop-timebar {
  position: fixed;
  z-index: 25;
  left: 10px; right: 10px;
  bottom: 8px;
  background: rgba(255,255,255,.96);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(22,50,79,.16);
}
.pop-timebar button {
  width: 36px; height: 36px; border-radius: 50%; background: #eef4f8; color: #16324f; font-size: 22px; line-height: 1;
}
.pop-time-label { min-width: 92px; }
.pop-time-label span { display: block; font-size: 11px; color: #64748b; }
.pop-time-label strong { font-size: 14px; }
.pop-timebar input[type="range"] { flex: 1; min-width: 70px; accent-color: #16324f; }
.zone-map { height: 340px; border-radius: 16px; overflow: hidden; background: #e7f3fb; }
@media (min-width: 800px) { .zone-map { height: 420px; } }
.zone-note { margin: 8px 0 0; font-size: 13px; font-weight: 700; color: #16324f; }
.leaflet-tooltip.tambon-label {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #16324f;
  font-weight: 700;
  font-size: 11px;
  padding: 0;
  pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 1px 1px 0 #fff, -1px -1px 0 #fff;
}
.leaflet-tooltip.tambon-label::before { display: none; }
path.tambon-estimate { stroke-linecap: butt; }
.depth-scale { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 4px; }
.depth-band { border: 2px solid #e5e7eb; border-radius: 12px; padding: 6px 4px 8px; text-align: center; background: #fff; }
.depth-band.is-on { border-width: 3px; }
.depth-fig { width: 52px; height: 78px; display: block; margin: 0 auto; }
.community-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 800px) { .community-grid { grid-template-columns: repeat(3, 1fr); } }
.community-card {
  display: flex; flex-direction: column; min-width: 0;
  border: 2px solid #86efac; border-radius: 16px; background: #f0fdf4;
}
.community-card.tone-yellow { border-color: #facc15; background: #fefce8; }
.community-card.tone-red { border-color: #f87171; background: #fef2f2; }
.community-open {
  display: block; width: 100%; text-align: left; background: transparent; border: 0;
  padding: 10px 10px 0; color: #10283f; cursor: pointer; font: inherit;
}
.community-top { display: flex; gap: 6px; align-items: flex-start; }
.community-card .depth-fig { width: 32px; height: 48px; margin: 0; flex: none; }
.community-open strong { display: block; font-size: 14px; line-height: 1.25; }
.community-open .meta { display: block; font-size: 12px; line-height: 1.35; color: #16324f; }
.community-card .push-btn { margin: 8px; width: auto; min-height: 36px; font-size: 13px; }
.community-card.is-on { border-color: #10283f; box-shadow: 0 0 0 3px #10283f; }
.community-stage { scroll-margin-top: 112px; margin-bottom: 12px; }
.scene-frame { position: relative; border-radius: 16px; overflow: hidden; background: #e7f3fb; }
.scene-name {
  position: absolute; z-index: 2; left: 8px; top: 8px; margin: 0;
  max-width: 58%; background: rgba(255,255,255,.95);
  border-radius: 10px; padding: 4px 8px;
  font-size: 16px; font-weight: 700; line-height: 1.25; color: #10283f;
}
.scene-tag {
  position: absolute; z-index: 2; right: 27%;
  transform: translateY(-50%);
  background: #fff; color: #10283f;
  border: 1px solid #dbe3ec; border-radius: 10px; padding: 4px 8px;
  font-size: 15px; font-weight: 700; line-height: 1.15;
  box-shadow: 0 1px 4px rgba(16,40,63,.16);
  white-space: nowrap;
}
.scene-tag b { font-size: 18px; }
.scene-tag.is-flood, .scene-tag.is-over { color: #b91c1c; border-color: #fecaca; }
#communityModal.station-modal { align-items: center; }
.community-modal-card { max-height: 94vh; }
.community-scene { width: 100%; height: auto; display: block; background: #e7f3fb; }
.scene-summary { margin: 10px 0 8px; font-size: 15px; line-height: 1.45; color: #10283f; }
.scene-which { margin: 0 0 8px; font-size: 13px; line-height: 1.4; color: #475569; }
.scene-bands { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.scene-band { margin: 0; padding: 4px 2px; text-align: center; border: 2px solid #e5e7eb; border-radius: 10px; background: white; }
.scene-band.is-on { background: #f8fafc; }
.scene-band .depth-fig { width: 28px; height: 42px; }
.scene-band strong { display: block; font-size: 10px; line-height: 1.2; }
.alert-confirm { z-index: 1600; }
.alert-steps { margin: 8px 0; padding-left: 20px; }
.alert-steps li { margin: 6px 0; line-height: 1.4; }
.depth-band strong { display: block; font-size: 12px; line-height: 1.25; margin-top: 2px; }
.depth-band span { display: block; font-size: 11px; color: #64748b; }
.push-btn { margin-top: 8px; width: 100%; }
.push-note { margin: 6px 0 0; font-size: 12px; color: #64748b; line-height: 1.4; }
.push-check { display: grid; gap: 6px; margin-top: 8px; }
.community-card .push-check { margin: 0 8px 8px; }
.push-check p { margin: 0; font-size: 13px; line-height: 1.4; }
.push-selftest { width: 100%; }
.push-tips {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 12px;
  padding: 8px 10px;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.45;
}
.push-tips p { margin: 0; font-weight: 700; }
.push-tips ul { margin: 6px 0 0; padding-left: 18px; }
.zone-missing { margin-top: 8px; }
.zone-missing ul { margin: 6px 0 0; padding-left: 18px; }
.zone-missing li { margin: 4px 0; font-size: 14px; line-height: 1.4; }
.station-modal {
  position: fixed; inset: 0; z-index: 1400;
  background: rgba(15, 23, 42, .48);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 10px;
}
.station-modal[hidden] { display: none; }
.station-modal-card {
  position: relative;
  background: white;
  width: min(560px, 100%);
  max-height: min(72vh, 780px);
  overflow: auto;
  border-radius: 20px;
  padding: 16px 16px 20px;
}
.station-modal-close {
  position: absolute; top: 8px; right: 8px;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: #eef4f8; color: #16324f; font-size: 24px; cursor: pointer;
}
.station-modal h2 { margin: 0 36px 8px 0; font-size: 24px; }
.cctv-block { margin: 10px 0 4px; }
.cctv-block h3 { margin: 0 0 8px; font-size: 16px; }
.cctv-card { margin: 0 0 10px; }
.cctv-shot {
  display: block; width: 100%; padding: 0; border: 0; background: #0f172a;
  border-radius: 12px; overflow: hidden; cursor: zoom-in;
}
.cctv-shot img { display: block; width: 100%; height: auto; }
.cctv-name { margin: 6px 0 0; font-size: 14px; font-weight: 700; }
.cctv-note, .cctv-time, .cctv-stale { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.cctv-zoom {
  position: fixed; inset: 0; z-index: 1600;
  background: rgba(0, 0, 0, .9);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px;
}
.cctv-zoom[hidden] { display: none; }
.cctv-zoom img { max-width: 100%; max-height: 84vh; object-fit: contain; }
.cctv-zoom-cap { color: #fff; width: min(100%, 520px); text-align: center; margin-top: 8px; }
.cctv-zoom-cap p { color: #fff; margin: 4px 0 0; font-size: 14px; }
.cctv-zoom-name { font-size: 16px; font-weight: 700; }
.cctv-zoom-cap .src-fold, .cctv-zoom-cap .src-fold summary, .cctv-zoom-cap .src a { color: #fff; }
.cctv-zoom-cap .kind { color: #16324f; }
.cctv-map-btn {
  margin-top: 8px; border: 0; border-radius: 999px; background: #fff; color: #16324f;
  font-weight: 700; font-size: 14px; padding: 8px 16px; cursor: pointer;
}
.cctv-page h2 { margin-bottom: 4px; }
.cctv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.cctv-grid .empty { grid-column: 1 / -1; }
.cctv-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.cctv-tile .cctv-shot { border-radius: 0; }
.cctv-tile .cctv-shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #e8eef3;
}
.cctv-missing {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 10; color: #6b7280; background: #e8eef3; font-size: 13px;
}
.cctv-tile .cctv-name {
  margin: 6px 8px 0;
  font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.cctv-tile .cctv-time, .cctv-tile .cctv-stale { margin: 2px 8px 0; }
.cctv-tile .cctv-time:last-child, .cctv-tile .cctv-stale:last-child { margin-bottom: 8px; }
.cctv-tile.is-stale img { opacity: 0.45; filter: grayscale(0.35); }
.cctv-tile.is-stale .cctv-name { color: var(--muted); }
@media (min-width: 800px) {
  .cctv-grid { grid-template-columns: repeat(3, 1fr); }
}
.cctv-zoom-close {
  position: absolute; top: 10px; right: 10px;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: #fff; color: #16324f; font-size: 26px; cursor: pointer;
}
@media (min-width: 800px) {
  .station-modal { align-items: center; }
}
@media (min-width: 960px) {
  .pop-timebar { bottom: 16px; left: 50%; right: auto; width: min(680px, calc(100% - 32px)); transform: translateX(-50%); }
}

.sim { padding: 4px 0 8px; }
.sim h1 { margin: 0 0 6px; font-size: 28px; color: #16324f; }
.sim-presets { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.sim-preset {
  border: 0; background: #e8edf2; color: #3d5166; border-radius: 999px;
  padding: 7px 12px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.sim-preset.is-on { background: #16324f; color: #fff; }
.sim-slider {
  display: block; background: #fff; border-radius: 16px; padding: 12px; margin: 8px 0;
  border: 1px solid #e3ebf3;
}
.sim-slider-top, .sim-metrics { display: flex; justify-content: space-between; gap: 8px; }
.sim-slider-top strong, .sim h1, .sim-card strong { color: #16324f; }
.sim-hint, .sim-note, .sim-metrics { color: #5b7088; font-size: 13px; }
.sim-slider input { width: 100%; accent-color: #16324f; margin: 8px 0; }
.sim-actions { display: flex; gap: 8px; margin: 10px 0; }
.sim-go, .sim-ghost {
  border-radius: 999px; padding: 10px 14px; font-weight: 700; cursor: pointer;
}
.sim-go { background: #16324f; color: #fff; border: 0; }
.sim-ghost { background: #fff; color: #16324f; border: 1px solid #d5e2ef; }
.sim-cards { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 12px 0; }
@media (min-width: 640px) { .sim-cards { grid-template-columns: 1fr 1fr; } }
.sim-card { background: #fff; border-radius: 16px; padding: 12px; border: 1px solid #e3ebf3; }
.sim-card p { margin: 0; color: #5b7088; }
.sim-card strong { display: block; font-size: 22px; margin-top: 4px; }
.sim-map { height: min(68vh, 520px); min-height: 280px; border-radius: 16px; }
.sim-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 12px; color: #16324f; }
.sim-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.sim-table-wrap { overflow-x: auto; }
.sim-person { width: 28px; height: 48px; vertical-align: middle; }
.sim-disclaimer { background: #fff7ed; color: #9a3412; border-radius: 12px; padding: 10px 12px; font-weight: 700; }
.sim-status { min-height: 1.2em; color: #16324f; font-weight: 700; }
.sim-actions { flex-wrap: wrap; }
.sim-go, .sim-ghost { min-height: 44px; }
#simRefresh {
  flex: 1 1 100%;
  min-height: 36px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: #5b7088;
  font-size: 13px;
  font-weight: 700;
}
.sim-guide { overflow-x: hidden; }
.sim-guide h2 { margin: 16px 0 8px; font-size: 20px; color: #16324f; }
.sim-guide h2:first-child { margin-top: 0; }
.sim-levels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.sim-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 8px 2px;
  border-radius: 12px;
  background: #f4f7fa;
  color: #6b7c8d;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}
.sim-level i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c5d0db;
}
.sim-level.is-on {
  background: color-mix(in srgb, var(--tone) 18%, #fff);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--tone);
}
.sim-level.is-on i { background: var(--tone); }
.sim-guide-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #8b98a6;
  font-weight: 700;
}
.sim-flow { list-style: none; margin: 14px 0 0; padding: 0; }
.sim-step {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  column-gap: 10px;
  margin: 0;
  position: relative;
}
.sim-step::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}
.sim-step:last-child::before { display: none; }
.sim-dot {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--tone, #9ca3af);
  position: relative;
  z-index: 1;
}
.sim-step > div { min-width: 0; padding-bottom: 12px; }
.sim-step strong {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  color: #8b98a6;
}
.sim-step.is-on > div > strong { color: #16324f; }
.sim-tile {
  border: 1px solid color-mix(in srgb, var(--tone, #d5e2ef) 45%, #e3ebf3);
  border-radius: 14px;
  background: #fff;
  margin: 0 0 6px;
}
.sim-tile summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 10px;
  list-style: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  color: #16324f;
}
.sim-tile summary::-webkit-details-marker { display: none; }
.sim-tile summary span { min-width: 0; }
.sim-tile summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid #8aa0b5;
  border-bottom: 2px solid #8aa0b5;
  transform: rotate(45deg) translateY(-2px);
  flex: 0 0 auto;
}
.sim-tile[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.sim-tile:not([open]) > :not(summary),
.src-fold:not([open]) > :not(summary) { display: none; }
.sim-ico {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 8px;
  border-radius: 12px;
  color: var(--ink, #16324f);
  background: color-mix(in srgb, var(--tone, #16324f) 16%, #fff);
}
.sim-tile p {
  margin: 0;
  padding: 0 12px 10px 60px;
  font-size: 13px;
  line-height: 1.45;
  color: #3d5166;
}
.sim-skip { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: #9aa8b6; }
.sim-agencies { display: grid; gap: 8px; }
.sim-agency {
  background: #f7fafc;
  border-radius: 16px;
  padding: 10px;
}
.sim-agency-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sim-agency-top .sim-ico {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  color: #16324f;
  background: #fff;
}
.sim-agency-top div { min-width: 0; }
.sim-agency-top strong { display: block; font-size: 16px; color: #16324f; line-height: 1.3; }
.sim-agency-top p { margin: 2px 0 0; font-size: 13px; line-height: 1.35; color: #5b7088; }
.sim-call {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
  border-radius: 999px;
  background: #16324f;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}
.sim-agency .src-fold p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: #3d5166; }
@media (min-width: 800px) {
  .sim-cards { grid-template-columns: repeat(3, 1fr); }
  .sim { max-width: 980px; margin: 0 auto; }
}
.help { color: #16324f; }
.help h1 { margin: 0 0 8px; font-size: 28px; }
.help-official {
  background: #fff7ed;
  color: #9a3412;
  border-radius: 14px;
  padding: 12px;
  font-weight: 700;
  line-height: 1.45;
}
.help-official a { color: #9a3412; }
.help-form, .help-done {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.help label, .help fieldset {
  display: grid;
  gap: 6px;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  border: 0;
  box-shadow: 0 8px 24px rgba(22, 50, 79, .06);
}
.help input, .help select, .help textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d5e2ef;
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}
.help textarea { min-height: 110px; }
.help-counts { grid-template-columns: 1fr 1fr; }
.help-counts label { box-shadow: none; padding: 0; background: transparent; }
.help-loc, .help-photos, .help-urgent { display: grid; gap: 8px; }
.help-loc-top, .help-calls { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.help-gps, .help-send, .help-calls a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  border: 0;
  background: #16324f;
  color: #fff;
  font-weight: 700;
  padding: 0 14px;
  text-decoration: none;
  cursor: pointer;
}
.help-map { height: 220px; border-radius: 14px; }
.help-tambon { margin: 0; color: #3d5166; }
.help-cards, .help-types { display: grid; gap: 8px; }
.help-card, .help-type span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 64px;
  border-radius: 14px;
  border: 2px solid #d5e2ef;
  background: #fff;
  text-align: left;
  padding: 10px 12px;
  font: inherit;
  color: #16324f;
  cursor: pointer;
}
.help-type { position: relative; box-shadow: none; padding: 0; background: transparent; }
.help-type input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.help-type span { flex-direction: row; align-items: center; gap: 8px; }
.help-type i { font-style: normal; font-size: 22px; }
.help-card.is-on, .help-type input:checked + span { border-color: #e11d48; background: #fff1f2; }
.help-card[data-urgency="critical"].is-on { background: #ffe4e6; }
.help-banner {
  background: #e11d48;
  color: #fff;
  border-radius: 16px;
  padding: 12px;
}
.help-banner a { background: #fff; color: #be123c; }
.help-consent { grid-template-columns: auto 1fr; align-items: start; }
.help-consent input { width: 22px; min-height: 22px; margin-top: 4px; }
.help-preview { display: flex; gap: 8px; flex-wrap: wrap; }
.help-preview figure { margin: 0; width: 92px; }
.help-preview img { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; }
.help-preview button { width: 100%; min-height: 36px; border: 0; border-radius: 999px; background: #fee2e2; color: #9f1239; }
.help-send { width: 100%; background: #e11d48; font-size: 18px; }
.help-status { min-height: 1.3em; font-weight: 700; }
.help-ref { font-size: 28px; font-weight: 800; letter-spacing: .02em; }
.help-honey { position: absolute; left: -9999px; height: 0; opacity: 0; }
@media (min-width: 720px) {
  .help-cards { grid-template-columns: repeat(3, 1fr); }
  .help-types { grid-template-columns: repeat(3, 1fr); }
}

.cap-page { color: #16324f; overflow-x: hidden; }
.cap-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cap-head h1 { margin: 0; font-size: 26px; line-height: 1.25; }
.cap-when, .cap-quiet, .cap-age, .cap-place, .cap-line, .cap-note, .cap-foot { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: #5b7088; }
.cap-quiet { font-size: 12px; }
.cap-refresh, .pillnav button { font-family: inherit; }
.cap-refresh {
  border: 1px solid #d5e2ef;
  background: #fff;
  color: #16324f;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}
.cap-chips, .cap-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cap-chips span, .cap-tabs button {
  border-radius: 999px;
  background: #fff;
  color: #16324f;
  border: 1px solid #d5e2ef;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}
.cap-tabs button.is-on { background: #16324f; color: #fff; border-color: #16324f; }
.cap-card, .cap-home-link {
  display: block;
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  margin-top: 10px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 24px rgba(22, 50, 79, .06);
}
.cap-card.is-stale { background: #eef1f4; color: #5c6b7a; }
.cap-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cap-code { margin: 0; font-weight: 800; }
.cap-q { margin: 6px 0 0; font-size: 32px; font-weight: 800; line-height: 1.1; }
.cap-q small { font-size: 13px; font-weight: 700; color: #5b7088; }
.cap-old {
  display: inline-block;
  background: #d9dee3;
  color: #3d4b59;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}
.cap-meter { height: 8px; background: #e7eef5; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.cap-meter span { display: block; height: 100%; background: #16324f; border-radius: inherit; }
.cap-est { display: inline-block; margin-left: 4px; font-size: 11px; color: #7b8794; font-weight: 700; }
.cap-src { margin-top: 6px; }
.cap-src summary { cursor: pointer; font-size: 12px; color: #8b98a6; font-weight: 700; }
.cap-src p { margin: 4px 0 0; font-size: 12px; color: #6b7785; word-break: break-word; }
.cap-arrow { text-align: center; color: #8aa0b5; font-size: 18px; line-height: 1; margin: 2px 0; }
.cap-group { margin: 16px 0 0; font-size: 16px; }
.cap-fact { margin: 6px 0 0; font-size: 13px; font-weight: 800; }
.cap-warn { margin: 6px 0 0; font-size: 13px; color: #7a4b12; }
.cap-missing { margin: 6px 0 0; }
.cap-links { display: flex; gap: 12px; margin: 8px 0 0; font-size: 13px; font-weight: 700; }
.cap-links a { color: #1d4ed8; }
.cap-leaves { display: flex; gap: 14px; align-items: flex-end; margin-top: 8px; }
.cap-leaf { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 44px; }
.cap-leaf span { display: block; width: 16px; background: #16324f; border-radius: 6px 6px 2px 2px; }
.cap-leaf b { font-size: 13px; }
.cap-leaf small { color: #5b7088; font-size: 11px; }
.cap-error { background: #fff7ed; color: #9a3412; border-radius: 12px; padding: 8px 10px; font-size: 13px; }
.cap-archive { margin-top: 12px; }
.cap-archive summary { font-weight: 800; color: #16324f; cursor: pointer; }
.cap-home-link h2 { margin: 2px 0 0; font-size: 18px; }
.cap-home-kicker { margin: 0; font-size: 13px; font-weight: 800; color: #3b82c4; }
.cap-home-sum { margin: 6px 0 0; color: #5b7088; font-size: 14px; }
.cap-foot { margin-top: 18px; }
.cap-tone { font-weight: 800; }

@media print {
  .appbar-side, .pillnav, .sim-actions, .sim-presets, .no-print, .pdpa-note { display: none !important; }
  .sim-map { height: 420px; }
  body { background: #fff; }
}
