/* Election Night 2026 — standalone page styles. Shares the homepage's type
   (Archivo / Newsreader / JetBrains Mono) and accent; adds a dark theme. */

:root {
  --paper: oklch(97% 0.003 250);
  --panel: oklch(100% 0 0);
  --panel-2: oklch(95% 0.004 250);
  --ink: oklch(19% 0.014 260);
  --ink-2: oklch(36% 0.012 260);
  --mute: oklch(50% 0.01 260);
  --rule: oklch(88% 0.005 260);
  --rule-strong: oklch(78% 0.006 260);
  --accent: oklch(55% 0.19 30);
  --map-surface: oklch(93% 0.004 250);
  --map-stroke: oklch(99% 0 0);
  --nodata: oklch(88% 0.004 260);
  --nodata-hatch: oklch(78% 0.006 260);
  --party-d: #2f6fb3;
  --party-r: #c8372d;
  --party-o: #7b5ea7;
  --status-good: oklch(52% 0.13 150);
  --status-warn: oklch(62% 0.14 75);
  --status-bad: oklch(55% 0.19 28);
  --demo: oklch(80% 0.16 85);
  --demo-ink: oklch(25% 0.05 85);
  --focus: oklch(60% 0.17 250);
  --seq: oklch(52% 0.11 195);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 28px rgb(0 0 0 / 0.06);
  --sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --serif: "Newsreader", ui-serif, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(1rem, 3.5vw, 2.5rem);
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: oklch(17% 0.01 260);
    --panel: oklch(21% 0.012 260);
    --panel-2: oklch(25% 0.012 260);
    --ink: oklch(95% 0.005 260);
    --ink-2: oklch(82% 0.008 260);
    --mute: oklch(68% 0.01 260);
    --rule: oklch(31% 0.012 260);
    --rule-strong: oklch(40% 0.012 260);
    --map-surface: oklch(24% 0.012 260);
    --map-stroke: oklch(17% 0.01 260);
    --nodata: oklch(28% 0.01 260);
    --nodata-hatch: oklch(37% 0.012 260);
    --party-d: #4a89d0;
    --party-r: #dc5446;
    --party-o: #8f73c4;
    --seq: oklch(72% 0.11 195);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 28px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: oklch(17% 0.01 260);
  --panel: oklch(21% 0.012 260);
  --panel-2: oklch(25% 0.012 260);
  --ink: oklch(95% 0.005 260);
  --ink-2: oklch(82% 0.008 260);
  --mute: oklch(68% 0.01 260);
  --rule: oklch(31% 0.012 260);
  --rule-strong: oklch(40% 0.012 260);
  --map-surface: oklch(24% 0.012 260);
  --map-stroke: oklch(17% 0.01 260);
  --nodata: oklch(28% 0.01 260);
  --nodata-hatch: oklch(37% 0.012 260);
  --party-d: #4a89d0;
  --party-r: #dc5446;
  --party-o: #8f73c4;
  --seq: oklch(72% 0.11 195);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 28px rgb(0 0 0 / 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
}
a { color: inherit; text-underline-offset: 3px; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--panel); padding: .5rem 1rem; }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem var(--pad); border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: .85rem;
}
.topbar a { text-decoration: none; font-weight: 700; letter-spacing: .02em; }
.topbar .tools { display: flex; gap: .5rem; align-items: center; }
.icon-btn {
  border: 1px solid var(--rule-strong); background: transparent; border-radius: 999px;
  padding: .3rem .7rem; cursor: pointer; font-family: var(--sans); font-size: .8rem;
}
.icon-btn:hover { border-color: var(--ink); }

/* Demo banner */
.demo-banner {
  display: none; background: var(--demo); color: var(--demo-ink);
  font-family: var(--sans); font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  text-align: center; padding: .6rem var(--pad); font-size: .9rem;
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgb(0 0 0 / .06) 14px 28px);
}
body[data-dataset="demo"] .demo-banner { display: block; position: sticky; top: 0; z-index: 30; }
.historical-banner {
  display: none; background: var(--panel-2); border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: .85rem; text-align: center; padding: .5rem var(--pad);
}
body[data-dataset="2024"] .historical-banner { display: block; }

/* Hero */
.hero { padding: clamp(1rem, 3vw, 2.25rem) var(--pad) 1rem; max-width: 1360px; margin: 0 auto; }
.kicker { font-family: var(--mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 .5rem; }
.hero h1 {
  font-family: var(--sans); font-weight: 900; letter-spacing: -.03em; line-height: .95;
  font-size: clamp(2.3rem, 6.5vw, 4.4rem); margin: 0;
}
.hero .sub { font-size: clamp(1.05rem, 2.2vw, 1.35rem); color: var(--ink-2); margin: .4rem 0 1rem; font-style: italic; }
.status-strip {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center;
  font-family: var(--sans); font-size: .85rem; color: var(--ink-2);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: .7rem 0;
}
.status-strip dt { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--mute); }
.status-strip dd { margin: 0; font-weight: 600; color: var(--ink); }
.status-strip > div { display: flex; flex-direction: column; gap: .1rem; }
.pill {
  display: inline-flex; align-items: center; gap: .4rem; font-family: var(--sans); font-size: .78rem;
  font-weight: 700; border-radius: 999px; padding: .15rem .6rem; border: 1px solid var(--rule-strong);
}
.pill .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--mute); }
.pill[data-state="live"] .dot { background: var(--status-good); box-shadow: 0 0 0 3px color-mix(in oklab, var(--status-good) 25%, transparent); }
.pill[data-state="stale"] .dot, .pill[data-state="results"] .dot { background: var(--status-warn); }
.pill[data-state="failing"] .dot { background: var(--status-bad); }
.pill[data-state="demo"] { background: var(--demo); color: var(--demo-ink); border-color: transparent; }
.pill[data-state="demo"] .dot { background: var(--demo-ink); }
@media (prefers-reduced-motion: no-preference) {
  .pill[data-state="live"] .dot { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--status-good) 0%, transparent); } }
}
.disclosure { font-size: .85rem; color: var(--ink-2); margin: .6rem 0 0; max-width: 90ch; }

.dataset-switch { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 2px; gap: 2px; }
.dataset-switch button {
  border: 0; background: transparent; border-radius: 999px; padding: .25rem .75rem; cursor: pointer;
  font-family: var(--sans); font-size: .8rem; font-weight: 600; color: var(--ink-2);
}
.dataset-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Tabs */
.tabs {
  position: sticky; top: 0; z-index: 20; background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule);
}
body[data-dataset="demo"] .tabs { top: 2.6rem; }
.tabs-inner { max-width: 1360px; margin: 0 auto; padding: 0 var(--pad); display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.tabs-inner::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: none; padding: .85rem .8rem .75rem; cursor: pointer; white-space: nowrap;
  font-family: var(--sans); font-weight: 700; font-size: .9rem; color: var(--mute);
  border-bottom: 3px solid transparent;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab:hover { color: var(--ink); }

main { max-width: 1360px; margin: 0 auto; padding: 1.25rem var(--pad) 4rem; }

/* Pre-election / empty state */
.empty-state {
  border: 1px dashed var(--rule-strong); border-radius: var(--radius); padding: 1.25rem 1.5rem;
  background: var(--panel); margin-bottom: 1.25rem; display: none;
}
.empty-state[data-show="true"] { display: block; }
.empty-state h2 { font-family: var(--sans); font-size: 1.15rem; margin: 0 0 .35rem; }
.empty-state p { margin: .25rem 0; color: var(--ink-2); }
.empty-state .actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.btn {
  font-family: var(--sans); font-weight: 700; font-size: .85rem; border-radius: 999px; padding: .45rem 1rem;
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--ink); }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.stat { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: .85rem 1rem; }
.stat .label { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.stat .value { font-family: var(--sans); font-weight: 800; font-size: 1.7rem; letter-spacing: -.02em; line-height: 1.1; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.stat .note { font-family: var(--sans); font-size: .75rem; color: var(--mute); margin-top: .15rem; }

/* Layout */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
@media (max-width: 1000px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding: .85rem 1rem .5rem; }
.panel-head h2 { font-family: var(--sans); font-weight: 800; font-size: 1.05rem; margin: 0; letter-spacing: -.01em; }
.panel-head .hint { font-family: var(--sans); font-size: .78rem; color: var(--mute); }

.segmented { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 8px; overflow: hidden; }
.segmented button {
  border: 0; background: transparent; padding: .3rem .65rem; font-family: var(--sans); font-size: .78rem; font-weight: 600;
  color: var(--ink-2); cursor: pointer; border-right: 1px solid var(--rule);
}
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.segmented button:disabled { opacity: .4; cursor: not-allowed; }

/* Map */
.map-wrap { position: relative; padding: 0 .5rem .5rem; }
.map-svg { width: 100%; height: auto; display: block; touch-action: manipulation; }
.map-svg .state {
  stroke: var(--map-stroke); stroke-width: .9; stroke-linejoin: round; cursor: pointer;
  transition: fill .45s ease, opacity .3s ease;
}
.map-svg .state:hover, .map-svg .state:focus-visible { stroke: var(--ink); stroke-width: 1.8; outline: none; }
.map-svg .state[aria-pressed="true"] { stroke: var(--ink); stroke-width: 2.4; }
.map-svg.has-selection .state:not([aria-pressed="true"]) { opacity: .55; }
.map-svg .state-label { font-family: var(--sans); font-size: 10px; font-weight: 700; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--map-surface); stroke-width: 2.5px; opacity: .8; }
.map-svg .pulse { fill: none; stroke: var(--accent); stroke-width: 2; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .map-svg .state { transition: none; } }
.map-reset { position: absolute; right: 1rem; top: .25rem; }

.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding: .25rem 1rem 1rem; font-family: var(--sans); font-size: .75rem; color: var(--ink-2); align-items: center; }
.legend .ramp { display: inline-flex; align-items: center; gap: 2px; }
.legend .ramp i { width: 18px; height: 10px; border-radius: 2px; display: inline-block; }
.legend .chip { display: inline-flex; align-items: center; gap: .35rem; }
.legend .chip i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--rule-strong); }
.legend .scale-ends { font-family: var(--mono); font-size: .65rem; color: var(--mute); }
.legend-def { padding: 0 1rem 1rem; margin: 0; font-family: var(--sans); font-size: .75rem; color: var(--mute); }

.tooltip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 300px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 8px;
  box-shadow: var(--shadow); padding: .6rem .75rem; font-family: var(--sans); font-size: .8rem; line-height: 1.35;
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tooltip[data-show="true"] { opacity: 1; transform: none; }
.tooltip strong { display: block; font-size: .9rem; margin-bottom: .15rem; }
.tooltip .row { display: flex; justify-content: space-between; gap: 1rem; font-variant-numeric: tabular-nums; }
.tooltip .muted { color: var(--mute); }

/* Activity feed */
.feed { list-style: none; margin: 0; padding: 0 .25rem .5rem; max-height: 640px; overflow: auto; }
.feed li { display: grid; grid-template-columns: 4.2rem 1fr; gap: .5rem; padding: .6rem .75rem; border-top: 1px solid var(--rule); font-size: .88rem; }
.feed li:first-child { border-top: 0; }
.feed time { font-family: var(--mono); font-size: .7rem; color: var(--mute); padding-top: .15rem; }
.feed .tag { font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); display: block; }
.feed .tag[data-type="lead_change"] { color: var(--accent); }
.feed .tag[data-type="votes_corrected"], .feed .tag[data-type="call_retracted"], .feed .tag[data-type="provider_stale"] { color: var(--status-bad); }
.feed .tag[data-type="race_called"], .feed .tag[data-type="call_corrected"] { color: var(--ink); }
.feed a { text-decoration: none; }
.feed a:hover { text-decoration: underline; }
.feed li.feed-empty { display: block; padding: 1rem; color: var(--mute); font-size: .9rem; }
.feed-filters { display: flex; gap: .4rem; padding: 0 1rem .6rem; flex-wrap: wrap; }
.feed-filters select { font-family: var(--sans); font-size: .78rem; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--panel); padding: .2rem .4rem; }

/* Race cards */
.section-title { font-family: var(--sans); font-weight: 800; font-size: 1.2rem; margin: 2rem 0 .75rem; letter-spacing: -.01em; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.section-title small { font-weight: 500; font-size: .8rem; color: var(--mute); }
.race-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .9rem; }
.race-card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: .9rem 1rem .8rem; display: flex; flex-direction: column; gap: .55rem; }
.race-card header { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.race-card h3 { font-family: var(--sans); font-size: .98rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.race-card h3 a { text-decoration: none; }
.race-card .where { font-family: var(--mono); font-size: .66rem; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; }
.race-card .badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.badge { font-family: var(--sans); font-size: .68rem; font-weight: 700; border-radius: 4px; padding: .08rem .4rem; border: 1px solid var(--rule-strong); color: var(--ink-2); white-space: nowrap; }
.badge.call { border-color: var(--ink); color: var(--ink); }
.badge.sim { border-style: dashed; }
.badge.retracted { text-decoration: line-through; color: var(--mute); }
.cands { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.cand { display: grid; grid-template-columns: 1fr auto auto; gap: .2rem .75rem; align-items: baseline; font-family: var(--sans); font-size: .85rem; }
.cand .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand .party { font-family: var(--mono); font-size: .66rem; color: var(--mute); margin-left: .25rem; }
.cand .votes { font-variant-numeric: tabular-nums; text-align: right; }
.cand .pct { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; min-width: 3.4rem; }
.cand .bar { grid-column: 1 / -1; height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.cand .bar i { display: block; height: 100%; border-radius: 3px; background: var(--party-o); width: 0; transition: width .6s ease; }
.cand[data-party="D"] .bar i { background: var(--party-d); }
.cand[data-party="R"] .bar i { background: var(--party-r); }
.cand .lead-tag { font-family: var(--mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin-left: .35rem; }
.cand .delta { font-family: var(--mono); font-size: .66rem; color: var(--mute); }
.cand .delta.down { color: var(--status-bad); }
@media (prefers-reduced-motion: reduce) { .cand .bar i { transition: none; } }
.race-meta { font-family: var(--sans); font-size: .74rem; color: var(--mute); display: flex; flex-wrap: wrap; gap: .2rem .8rem; border-top: 1px solid var(--rule); padding-top: .5rem; }
.race-meta a { color: var(--ink-2); }
.race-card.awaiting .cands { color: var(--mute); font-style: italic; font-family: var(--serif); }
.race-card[data-flash="true"] { box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 60%, transparent); transition: box-shadow 1.2s ease; }

/* District grid (House) */
.district-grid { display: grid; grid-template-columns: 3.2rem 1fr; gap: 4px 10px; align-items: center; padding: .5rem 1rem 1rem; font-family: var(--sans); font-size: .75rem; }
.district-grid .st { font-weight: 700; color: var(--ink-2); text-align: right; }
.district-grid .tiles { display: flex; flex-wrap: wrap; gap: 3px; }
.tile { width: 15px; height: 15px; border-radius: 3px; border: 0; padding: 0; cursor: pointer; background: var(--nodata); }
.tile.nodata { background-image: repeating-linear-gradient(135deg, var(--nodata) 0 3px, var(--nodata-hatch) 3px 4.5px); }
.tile:hover, .tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* State detail drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-backdrop[data-open="true"] { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 45; background: var(--paper);
  border-left: 1px solid var(--rule); box-shadow: var(--shadow); overflow-y: auto; transform: translateX(100%);
  transition: transform .28s cubic-bezier(.2, .7, .2, 1); padding: 0 0 3rem;
}
.drawer[data-open="true"] { transform: none; }
@media (max-width: 700px) {
  .drawer { top: auto; width: 100vw; max-height: 88vh; border-left: 0; border-top: 1px solid var(--rule); border-radius: 16px 16px 0 0; transform: translateY(100%); }
}
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-backdrop { transition: none; } }
.drawer-head { position: sticky; top: 0; background: var(--paper); z-index: 2; padding: 1rem 1.25rem .75rem; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.drawer-head h2 { font-family: var(--sans); font-weight: 900; font-size: 1.6rem; margin: 0; letter-spacing: -.02em; }
.drawer-head .meta { font-family: var(--sans); font-size: .8rem; color: var(--mute); margin-top: .2rem; }
.drawer-body { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.drawer-body > h3 { font-family: var(--sans); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin: .5rem 0 0; }
.cov-list { display: grid; grid-template-columns: auto 1fr; gap: .3rem .75rem; font-family: var(--sans); font-size: .82rem; margin: 0; }
.cov-list dt { font-weight: 700; }
.cov-list dd { margin: 0; color: var(--ink-2); }
.district-map svg { width: 100%; height: auto; max-height: 360px; }
.district-map path { stroke: var(--map-stroke); stroke-width: .6; cursor: pointer; vector-effect: non-scaling-stroke; }
.district-map path:hover, .district-map path:focus-visible { stroke: var(--ink); stroke-width: 1.6; outline: none; }

/* Timeline */
.timeline { padding: 0 1rem .75rem; display: flex; flex-direction: column; gap: .5rem; }
.tl-note { margin: 0; font-family: var(--sans); font-size: .74rem; color: var(--mute); }
/* Pinned under the sticky tabs so Play and the map it drives share one
   screen. --tl-top / --tl-bottom are measured in app.js (syncDockOffset). */
.timeline-dock {
  position: sticky; top: var(--tl-top, 3.1rem); z-index: 15;
  background: var(--paper); margin: -.5rem calc(-1 * var(--pad)) .25rem; padding: .5rem var(--pad) .75rem;
}
.timeline-dock .panel-head { padding: .6rem 1rem .35rem; }
/* Size the map to the space left under the dock (panel head + legend ≈ 7rem). */
body[data-view="timeline"] .map-svg { max-height: max(220px, calc(100dvh - var(--tl-bottom, 18rem) - 7rem)); }
/* Below ~1000px the stat tiles wrap into a varying number of rows as the
   replay advances, which shifts the dock and map mid-playback. The dock's
   clock, the map and the feed already carry the replayed moment there. */
@media (max-width: 1000px) { body[data-view="timeline"] .stats { display: none; } }
/* Too short to pin without hiding the map (phone landscape): scroll normally. */
@media (max-height: 560px) {
  .timeline-dock { position: static; }
  body[data-view="timeline"] .map-svg { max-height: none; }
}
.timeline-controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.timeline-controls .now { font-family: var(--mono); font-size: .9rem; font-weight: 600; margin-left: auto; font-variant-numeric: tabular-nums; }
.scrub { width: 100%; accent-color: var(--accent); }
.spark { width: 100%; height: 48px; display: block; }
.spark rect { fill: var(--rule-strong); }
.spark rect.on { fill: var(--accent); }
.replay-flag { font-family: var(--sans); font-weight: 800; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--paper); border-radius: 4px; padding: .15rem .5rem; }
.diff-list { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.diff-list li { padding: .4rem 0; border-top: 1px solid var(--rule); }

/* Coverage */
.cov-table-wrap { overflow-x: auto; padding: 0 1rem 1rem; }
.cov-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .82rem; }
.cov-table th, .cov-table td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.cov-table th { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); font-weight: 600; }
.status-chip { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; font-size: .75rem; }
.status-chip::before { content: ""; width: .6rem; height: .6rem; border-radius: 2px; background: var(--nodata); border: 1px solid var(--rule-strong); }
.status-chip[data-s="reporting"]::before { background: var(--status-good); border-color: transparent; }
.status-chip[data-s="awaiting"]::before { background: transparent; border: 2px solid var(--status-good); }
.status-chip[data-s="stale"]::before { background: var(--status-warn); border-color: transparent; }
.status-chip[data-s="unavailable"]::before { background-image: repeating-linear-gradient(135deg, var(--nodata) 0 2px, var(--nodata-hatch) 2px 3px); }
.status-chip[data-s="none"] { color: var(--mute); font-weight: 400; }
.status-chip[data-s="none"]::before { visibility: hidden; }
.providers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; padding: 0 1rem 1rem; }
.provider { border: 1px solid var(--rule); border-radius: 8px; padding: .75rem; font-family: var(--sans); font-size: .82rem; }
.provider h3 { margin: 0 0 .25rem; font-size: .95rem; }
.provider p { margin: .2rem 0; color: var(--ink-2); }

/* About (static, readable without JS) */
.about { max-width: 76ch; margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.about h2 { font-family: var(--sans); font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; }
.about h3 { font-family: var(--sans); font-size: 1rem; margin-bottom: .25rem; }
.about li { margin: .3rem 0; }
footer.site { border-top: 1px solid var(--rule); padding: 1.5rem var(--pad); font-family: var(--sans); font-size: .8rem; color: var(--mute); text-align: center; }

[hidden] { display: none !important; }
.loading { color: var(--mute); font-family: var(--sans); font-size: .85rem; padding: 1rem; }
.error-note { color: var(--status-bad); font-family: var(--sans); font-size: .85rem; padding: .5rem 1rem; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .status-strip { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1rem; }
  .status-strip > div:nth-child(2) { grid-column: 1 / -1; order: 5; }
  .hero .kicker { display: none; }
  .disclosure { font-size: .8rem; }
  .topbar { padding: .5rem var(--pad); }
  .topbar > a { font-size: .8rem; }
  .dataset-switch button { padding: .2rem .55rem; }
  .race-grid { grid-template-columns: 1fr; }
  .feed li { grid-template-columns: 3.6rem 1fr; }
  .stat .value { font-size: 1.4rem; }
  .panel-head { padding: .75rem .75rem .4rem; }
  .district-grid { grid-template-columns: 2.2rem 1fr; padding: .5rem .5rem 1rem; }
  .timeline { padding: 0 .75rem .6rem; gap: .4rem; }
  .timeline-controls { gap: .35rem; }
  .timeline-controls .icon-btn, .timeline-controls .btn { padding-left: .55rem; padding-right: .55rem; }
  .timeline-controls .now { margin-left: 0; width: 100%; order: -1; font-size: .82rem; }
  .tl-note { display: none; }
}
