:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --wash: rgba(11, 11, 11, 0.04);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --context: #898781;
  /* Station dots sit on the light basemap in both themes, so this ramp does not flip. */
  --seq-1: #cde2fb;
  --seq-2: #86b6ef;
  --seq-3: #3987e5;
  --seq-4: #1c5cab;
  --seq-5: #0d366b;
  --warning: #fab219;
  --critical: #d03b3b;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --wash: rgba(255, 255, 255, 0.06);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --context: #898781;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1, h2, h3, p { margin: 0; }
h2 { font-size: 22px; font-weight: 600; text-wrap: balance; }
h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1120px; margin: 0 auto; padding: 16px;
}
.brand { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.tabs { display: flex; gap: 4px; }
.tabs a {
  padding: 6px 14px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-weight: 500;
}
.tabs a:hover { background: var(--wash); }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }
.view { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--border); padding: 16px; min-width: 0; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }

.search { display: flex; gap: 8px; }
.search-box { position: relative; flex: 1; }
input[type="search"], select, button {
  font: inherit; color: var(--text); background: var(--surface);
  border: 0; box-shadow: 0 0 0 1px var(--border); border-radius: 8px; padding: 9px 12px;
}
input[type="search"] { width: 100%; }
button { cursor: pointer; font-weight: 500; white-space: nowrap; }
button:hover { background: var(--wash); }
:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.suggestions {
  position: absolute; z-index: 1000; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border-radius: 8px; box-shadow: 0 0 0 1px var(--border), 0 8px 24px rgba(0, 0, 0, 0.12);
}
.suggestions li { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.suggestions li:hover, .suggestions li[aria-selected="true"] { background: var(--wash); }
.suggestions small { color: var(--muted); display: block; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 760px) { .hero-grid { grid-template-columns: 1fr; } }
.hero { display: flex; flex-direction: column; gap: 12px; }
.place h2 { overflow-wrap: anywhere; }
.when { color: var(--text-2); font-weight: 500; }
.hero-row { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.hero-figure { font-size: 64px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.hero-range { color: var(--text-2); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.tile { background: var(--wash); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.tile .label { color: var(--text-2); font-size: 13px; }
.tile .value { font-size: 22px; font-weight: 600; line-height: 1.25; }
.tile .note { color: var(--muted); font-size: 12px; }
.kpi .tile { background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.slider { display: grid; gap: 2px; font-size: 13px; }
.slider input { width: 100%; accent-color: var(--series-1); }
.slider-ends { display: flex; justify-content: space-between; font-size: 12px; }
.now { font-size: 13px; }
.map-card { padding: 0; overflow: hidden; min-height: 300px; }
#map, #site-map { height: 100%; min-height: 300px; border-radius: 12px; z-index: 0; }
#site-map { height: 380px; }
.notice { background: var(--wash); border-radius: 8px; padding: 10px 12px; color: var(--text-2); }

.sub { color: var(--text-2); font-size: 13px; margin: 2px 0 8px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font: 12px system-ui, -apple-system, "Segoe UI", sans-serif; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .end-label { fill: var(--text-2); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 4px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key-line { width: 14px; height: 2px; border-radius: 1px; }
.key-box { width: 12px; height: 10px; border-radius: 2px; }
.tooltip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 120px; max-width: 260px;
  background: var(--surface); border-radius: 8px; padding: 8px 10px; font-size: 13px;
  box-shadow: 0 0 0 1px var(--border), 0 6px 20px rgba(0, 0, 0, 0.14);
}
.tooltip .t-head { color: var(--text-2); margin-bottom: 4px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; }
.tooltip .t-row b { font-weight: 600; margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.tooltip .t-row span { color: var(--text-2); }
details.table-view { margin-top: 8px; font-size: 13px; }
details.table-view summary { cursor: pointer; color: var(--text-2); width: fit-content; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }

.table-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--grid); }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { color: var(--text-2); font-weight: 500; }
table.data tr:last-child td { border-bottom: 0; }
table.data td small { color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.filters label { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.intro { display: grid; gap: 4px; max-width: 70ch; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .name { color: var(--text-2); overflow-wrap: anywhere; }
.bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-fill { height: 12px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
.bar-row b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scale { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.scale i { width: 28px; height: 10px; display: inline-block; }
.footnote { font-size: 13px; max-width: 80ch; }
.leaflet-container { font: inherit; background: var(--page); }
