/* Geist Sans, Mono and Serif (Vercel, SIL OFL 1.1: fonts/GEIST-OFL.txt), served from this site. */
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Serif"; src: url("/fonts/GeistSerif-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

/* Baseline — design tokens. Every color is defined here, light then dark. */
:root {
  --bg: #f6f5f1;
  --surface: #fcfcfb;
  --surface-2: #efede7;
  --ink: #0e0e0d;
  --ink-2: #4a4945;
  --ink-3: #807e77;
  --rule: #dcd9d0;
  --rule-2: #e9e6de;
  --dem: #2b63d9;
  --rep: #d7402b;
  --dem-soft: #dfe7f9;
  --rep-soft: #f9e1dc;
  --npa: #8a877e;
  --neutral: #d9d6cd;
  --accent: #0e0e0d;
  --live: #d7402b;
  --good: #1f8a5b;
  --focus: #2b63d9;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.12);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 10px;
  /* Type roles. Skins below swap these; C keeps the original Newsreader + Inter Tight. */
  --display: var(--serif); --display-wt: 500; --display-track: -0.02em;
  --big: var(--serif); --big-wt: 500; --big-track: -0.03em;
  --prose: var(--serif); --prose-size: 19px;
  --card-border: var(--rule); --card-shadow: var(--shadow);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111110; --surface: #1a1a19; --surface-2: #232321; --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #8d8b83;
    --rule: #34332f; --rule-2: #2a2927; --dem: #4f86ec; --rep: #e85a43; --dem-soft: #1d2a45; --rep-soft: #3d221d;
    --npa: #8d8b83; --neutral: #3a3936; --accent: #f0efec; --live: #e85a43; --good: #3fb07c; --focus: #4f86ec;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111110; --surface: #1a1a19; --surface-2: #232321; --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #8d8b83;
  --rule: #34332f; --rule-2: #2a2927; --dem: #4f86ec; --rep: #e85a43; --dem-soft: #1d2a45; --rep-soft: #3d221d;
  --npa: #8d8b83; --neutral: #3a3936; --accent: #f0efec; --live: #e85a43; --good: #3fb07c; --focus: #4f86ec;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans);
  font-feature-settings: "tnum" 1, "ss01" 1; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.d { color: var(--dem); } .r { color: var(--rep); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.bar .wrap { display: flex; align-items: center; gap: 16px; height: 56px; }
.mark { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; font-size: 17px; text-decoration: none; }
.mark svg { width: 22px; height: 22px; }
.mark small { font-weight: 500; color: var(--ink-3); font-size: 13px; letter-spacing: 0; }
.bar nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.bar nav a { padding: 6px 10px; border-radius: 999px; font-size: 13px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.bar nav a:hover { background: var(--surface-2); color: var(--ink); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border: 1px solid var(--rule); border-radius: 999px; white-space: nowrap; background: var(--surface); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.status.live i { background: var(--live); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .status.live i { animation: none; } }
.theme-btn { border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; flex: none; }
@media (max-width: 860px) { .bar nav { display: none; } .bar .status { margin-left: auto; } }

/* Hero */
.hero { padding: 40px 0 8px; }
.eyebrow { font: 600 12px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
h1 { font: var(--display-wt) clamp(34px, 5vw, 60px)/1.02 var(--display); letter-spacing: var(--display-track); margin: 12px 0 14px; max-width: 18ch; }
h1 em { font-style: italic; }
.lede { font: 400 var(--prose-size)/1.5 var(--prose); color: var(--ink-2); max-width: 62ch; margin: 0; }
h2 { font: var(--display-wt) clamp(26px, 3vw, 34px)/1.1 var(--display); letter-spacing: var(--display-track); margin: 0; }
h3 { font: 650 15px/1.3 var(--sans); margin: 0; letter-spacing: -0.005em; }
.sub { color: var(--ink-2); margin: 6px 0 0; max-width: 70ch; }
.fine { font-size: 12.5px; color: var(--ink-3); }

section { padding: 44px 0; border-top: 1px solid var(--rule); scroll-margin-top: 64px; }
section.first { border-top: 0; padding-top: 20px; }
.head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }

.card { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--r); box-shadow: var(--card-shadow); }
.pad { padding: 20px; }

/* Main layout: model + controls */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .stage { grid-template-columns: minmax(0, 1fr); } }
.controls { position: sticky; top: 72px; }
@media (max-width: 1000px) { .controls { position: static; } }

.result { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 0; }
@media (max-width: 760px) { .result { grid-template-columns: 1fr; } }
.result .read { padding: 24px; border-right: 1px solid var(--rule-2); display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 760px) { .result .read { border-right: 0; border-bottom: 1px solid var(--rule-2); } }
.big { font: var(--big-wt) clamp(52px, 7vw, 84px)/1 var(--big); letter-spacing: var(--big-track); margin-top: 10px; }
.big small { display: block; font: 600 13px/1.4 var(--sans); letter-spacing: 0; color: var(--ink-3); margin-top: 10px; }
.cands { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cand .nm { font-weight: 650; font-size: 15px; }
.cand .pt { font-size: 12.5px; color: var(--ink-3); }
.cand .pc { font: var(--big-wt) 30px/1 var(--big); letter-spacing: var(--big-track); margin-top: 4px; }
.cand.rr { text-align: right; }
.split { height: 12px; border-radius: 999px; overflow: hidden; display: flex; gap: 2px; background: var(--surface); }
.split b { display: block; height: 100%; }
.split .sd { background: var(--dem); border-radius: 999px 2px 2px 999px; }
.split .sr2 { background: var(--rep); border-radius: 2px 999px 999px 2px; }
.split-wrap { position: relative; }
.split-wrap .mid { position: absolute; left: 50%; top: -5px; bottom: -5px; width: 1px; background: var(--ink); opacity: 0.5; }
.tip { border-top: 1px dashed var(--rule); padding-top: 14px; font-size: 14px; color: var(--ink-2); }
.tip strong { color: var(--ink); }
.livebox { border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; font-size: 13.5px; background: var(--surface-2); display: none; }
.livebox.on { display: block; }
.livebox .row { display: flex; justify-content: space-between; gap: 8px; }

.racebar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--rule-2); }
.race-tabs { flex-wrap: wrap; }
.race-tabs button { white-space: nowrap; }
.sel.pick { width: auto; max-width: 100%; padding: 6px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.sel.pick.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (max-width: 640px) { .racebar { padding: 10px; } .race-tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-radius: 999px; } .race-tabs::-webkit-scrollbar { display: none; } .race-tabs button { flex: none; } .sel.pick { flex: 1; min-width: 0; } }
#map-alt { padding: 6px 4px 0; }
#map path.dist { stroke-width: 0.6; }
#map path.dist.held { opacity: 0.45; }
#map path.dist.sel { stroke: var(--ink); stroke-width: 2.4; }
.race-tabs .sep { width: 1px; align-self: stretch; background: var(--rule); margin: 4px 2px; }
#map-alt .seats { margin-top: 10px; }
#map-alt .seat.sel { outline: 3px solid var(--ink); outline-offset: 2px; z-index: 1; }
.map { padding: 14px; position: relative; }
.map svg { width: 100%; height: auto; display: block; }
.map path { stroke: var(--surface); stroke-width: 0.8; transition: fill 0.25s; cursor: pointer; }
.map path:hover, .map path.hl { stroke: var(--ink); stroke-width: 1.6; }
.map .lg, .ev-map-card .lg, .seat-map-card .lg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-3); justify-content: center; margin-top: 6px; }
.map .lg .ramp, .ev-map-card .lg .ramp, .seat-map-card .lg .ramp { display: flex; gap: 2px; }
.map .lg .ramp i, .ev-map-card .lg .ramp i, .seat-map-card .lg .ramp i { width: 18px; height: 8px; border-radius: 2px; }
.seat-grid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .seat-grid { grid-template-columns: minmax(0, 1fr); } }
.seat-map-card { position: sticky; top: 72px; }
@media (max-width: 900px) { .seat-map-card { position: static; } }
#seat-map { width: 100%; height: auto; display: block; margin-top: 8px; }
#seat-map path { stroke: var(--surface); stroke-width: 0.6; cursor: pointer; }
#seat-map path:hover { stroke: var(--ink); stroke-width: 1.6; }
#seat-map path.held { opacity: 0.45; cursor: default; }
.map-tabs { display: inline-flex; gap: 4px; margin-bottom: 8px; }

.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; padding: 2px; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Controls */
.ctl { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.ctl h3 { display: flex; justify-content: space-between; align-items: baseline; }
.knob label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; gap: 8px; }
.knob label output { font: 600 15px var(--mono); color: var(--ink); }
.knob .hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.gapknob output { font-size: 22px !important; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--track, var(--surface-2)); border: 1px solid var(--rule); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--track, var(--surface-2)); border: 1px solid var(--rule); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); margin-top: -9px; box-shadow: var(--shadow); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); }
.gaptrack { --track: linear-gradient(90deg, var(--dem) 0%, var(--neutral) 33%, var(--rep) 100%); }
.ticks { position: relative; height: 34px; margin: 2px 11px 0; }
.ticks button { position: absolute; transform: translateX(-50%); border: 0; background: none; padding: 0; cursor: pointer; font-size: 10.5px; color: var(--ink-3); text-align: center; line-height: 1.15; white-space: nowrap; }
.ticks button::before { content: ""; display: block; width: 1px; height: var(--stem, 6px); background: var(--ink-3); margin: 0 auto 3px; }
.ticks button:hover { color: var(--ink); }
.ticks button.ev { color: var(--ink); font-weight: 700; }
.ticks button.ev::before { background: var(--ink); width: 2px; }
/* How each party votes: always open, one row per party, the split written out. */
.stage-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.vbp-card { padding: 18px 20px; }
.vbp { display: flex; flex-direction: column; gap: 12px; }
.vbp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.vbp-rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
@media (max-width: 760px) { .vbp-rows { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
.party-row label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 650; margin-bottom: 4px; }
.party-row .who { display: inline-flex; align-items: center; gap: 7px; }
.party-row .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.d-bg { background: var(--dem); } .r-bg { background: var(--rep); } .n-bg { background: var(--npa); }
.party-row .psplit { font: 500 12.5px/1.4 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.party-row label { line-height: 1.4; }
.vbp .hint { font-size: 12px; color: var(--ink-3); margin-top: 2px; line-height: 1.45; }
.vbp .hint b { color: var(--ink-2); }
.party-row .psplit b { font-weight: 700; }
.dtrack { --track: linear-gradient(90deg, var(--rep) 0%, var(--neutral) 30%, var(--dem) 100%); }
.rtrack { --track: linear-gradient(90deg, var(--dem) 0%, var(--neutral) 30%, var(--rep) 100%); }
.npatrack { --track: linear-gradient(90deg, var(--rep) 0%, var(--neutral) 50%, var(--dem) 100%); }
/* Poll splits on one line: a dot per poll, under the slider, aligned to the track. */
.dots { position: relative; height: 14px; margin: 2px 11px 0; }
.dots button { position: absolute; top: 2px; transform: translateX(-50%); width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface); background: var(--ink); padding: 0; cursor: pointer; }
.dots button.sid { background: transparent; border: 1.5px solid var(--ink-3); }
.dots button:hover, .dots button:focus-visible { transform: translateX(-50%) scale(1.35); }
/* What flips: one row per chamber, live with the sliders. */
.flips { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--rule-2); }
.flip-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; padding: 9px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); cursor: pointer; text-align: left; width: 100%; }
.flip-row:hover { border-color: var(--ink-3); }
.flip-row .ch { font-weight: 650; font-size: 13px; }
.flip-row .net { font: 650 13px var(--mono); text-align: right; }
.flip-row .detail { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }
.flip-row .bar { grid-column: 1 / -1; display: flex; height: 5px; gap: 2px; margin-top: 4px; position: relative; }
.flip-row .bar b { height: 100%; }
.flip-row .bar b:first-child { border-radius: 3px 0 0 3px; } .flip-row .bar b:last-child { border-radius: 0 3px 3px 0; }
.flip-row .bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
details.more summary { cursor: pointer; font-size: 13px; font-weight: 650; color: var(--ink-2); list-style: none; display: flex; justify-content: space-between; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; font-weight: 400; }
details.more[open] summary::after { content: "−"; }
details.more > div { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.row2 { display: flex; gap: 8px; }
.btn { flex: 1; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); padding: 10px 12px; border-radius: 8px; font-weight: 650; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn:hover { opacity: 0.9; }
select.sel { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--rule); background: var(--surface); font-size: 13.5px; }

/* Early vote */
.ev-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 900px) { .ev-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ev-tile { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.ev-tile .k { font-size: 12px; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.ev-tile .v { font: var(--big-wt) 30px/1 var(--big); letter-spacing: var(--big-track); }
.ev-tile .g { font: 650 14px var(--mono); }
.ev-tile .s { font-size: 12.5px; color: var(--ink-2); }
.ev-tile .mini { display: flex; height: 6px; gap: 2px; margin-top: 4px; }
.ev-tile .mini b { height: 100%; }
.ev-tile .mini b:first-child { border-radius: 3px 0 0 3px; } .ev-tile .mini b:last-child { border-radius: 0 3px 3px 0; }
.ev-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 20px; align-items: start; }
.ev-grid .ev-map-card { order: 2; }
@media (max-width: 900px) { .ev-grid { grid-template-columns: minmax(0, 1fr); } .ev-grid .ev-map-card { order: 0; } }
#ev-map { width: 100%; height: auto; display: block; }
#ev-map path { stroke: var(--surface); stroke-width: 0.8; cursor: pointer; }
#ev-map path:hover { stroke: var(--ink); stroke-width: 1.6; }

/* Electorate bars */
.mixes { display: flex; flex-direction: column; gap: 10px; }
.mix { display: grid; grid-template-columns: 112px minmax(0, 1fr) 70px; align-items: center; gap: 12px; font-size: 13px; }
.mix .lbl { font-weight: 650; }
.mix .lbl small { display: block; font-weight: 500; color: var(--ink-3); font-size: 11.5px; }
.mix .bars { display: flex; height: 22px; gap: 2px; }
.mix .bars b { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 650; color: #fff; overflow: hidden; white-space: nowrap; }
.mix .bars b:first-child { border-radius: 4px 0 0 4px; } .mix .bars b:last-child { border-radius: 0 4px 4px 0; }
.mix .bars .bd { background: var(--dem); } .mix .bars .br { background: var(--rep); } .mix .bars .bn { background: var(--npa); }
.mix .g { font: 650 13px var(--mono); text-align: right; }
.mix.now .lbl { color: var(--ink); }
.mix.scen { opacity: 0.95; }
.mix.scen .bars { outline: 2px dashed var(--ink-3); outline-offset: 2px; border-radius: 4px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }

/* Race cards */
.races { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.race { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.race .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.race .office { font-size: 12px; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.race .m { font: 600 15px var(--mono); }
.race .names { display: flex; justify-content: space-between; font-size: 13.5px; gap: 8px; }
.race .names span:last-child { text-align: right; }
.race .basis { font-size: 11.5px; color: var(--ink-3); }
.pickable { cursor: pointer; transition: border-color 0.15s; }
.pickable:hover { border-color: var(--ink-3); }
.pickable.picked { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.big.good { color: var(--good); }
.map-tabs button:disabled { opacity: 0.35; cursor: not-allowed; }
.pill { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.live { background: var(--rep-soft); color: var(--live); }

.amend .thresh { position: relative; height: 14px; background: var(--surface-2); border-radius: 4px; overflow: visible; }
.amend .thresh b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink-2); border-radius: 4px; }
.amend .thresh b.pass { background: var(--good); }
.amend .thresh i { position: absolute; left: 60%; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.amend .thresh span { position: absolute; left: 60%; top: -18px; transform: translateX(-50%); font-size: 10.5px; color: var(--ink-3); }

/* Seat ladders */
.ladder-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tally { display: flex; gap: 14px; font: 600 14px var(--sans); }
.tally b { font: var(--big-wt) 26px/1 var(--big); letter-spacing: var(--big-track); }
.seats { display: flex; flex-wrap: wrap; gap: 3px; }
.seat { width: 22px; height: 22px; border-radius: 4px; font: 600 9px/22px var(--mono); text-align: center; color: #fff; cursor: pointer; position: relative; border: 0; padding: 0; }
.seat.unc { background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(255, 255, 255, 0.35) 3px 5px); }
.seat.flip::after { content: ""; position: absolute; inset: -3px; border: 2px solid var(--ink); border-radius: 6px; }
.seats.big .seat { width: 34px; height: 34px; font-size: 11px; line-height: 34px; border-radius: 6px; }
.majority { font-size: 12px; color: var(--ink-3); }
.ladder { margin-bottom: 28px; }

/* Tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 650; color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 12px; border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--surface); cursor: pointer; white-space: nowrap; }
td { padding: 8px 12px; border-bottom: 1px solid var(--rule-2); white-space: nowrap; }
td.n, th.n { text-align: right; font-family: var(--mono); font-size: 12.5px; }
tr:hover td { background: var(--surface-2); }
.tbl-wrap.tall { max-height: 520px; }

/* Polls */
.polls-strip { position: relative; height: 150px; }
.poll-list { font-size: 13px; }
.ratings { display: flex; flex-wrap: wrap; gap: 8px; }
.rating { border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; background: var(--surface); }
.rating b { display: block; font-size: 13.5px; }

/* Tooltip */
.tt { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--bg); padding: 9px 11px; border-radius: 8px; font-size: 12.5px; line-height: 1.45; max-width: 260px; box-shadow: var(--shadow); opacity: 0; transition: opacity 0.12s; }
.tt.on { opacity: 1; }
.tt b { font-weight: 700; }
.tt .k { opacity: 0.7; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; opacity: 0; transition: all 0.2s; z-index: 60; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

footer { border-top: 1px solid var(--rule); padding: 36px 0 60px; color: var(--ink-2); font-size: 13.5px; }
.method { columns: 2 320px; column-gap: 32px; }
.method p { margin: 0 0 12px; break-inside: avoid; }
.empty { padding: 18px; color: var(--ink-3); font-size: 13.5px; border: 1px dashed var(--rule); border-radius: var(--r); }

/* ---------- Design options (preview picker; production ships one) ----------
   A "Geist": NYT-clean. White paper, near-black ink, hairline rules, no card shadows;
     Geist Sans for everything, Geist Mono for figures.
   B "Geist Serif": A's paper and UI, with Geist Serif for headlines and the big numbers.
   C: the original Newsreader + Inter Tight look. */
:root[data-skin="a"], :root[data-skin="b"] {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f3f3f2; --ink: #121212; --ink-2: #4d4d4b; --ink-3: #7a7a77;
  --rule: #dfdfdc; --rule-2: #ececea; --neutral: #d6d6d3; --npa: #8a8a86;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --prose: var(--sans); --prose-size: 18px;
  --card-shadow: none; --r: 6px;
}
:root[data-skin="a"] {
  --display: var(--sans); --display-wt: 700; --display-track: -0.035em;
  --big: var(--sans); --big-wt: 650; --big-track: -0.045em;
}
:root[data-skin="b"] {
  --display: "Geist Serif", "Iowan Old Style", Georgia, serif; --display-wt: 400; --display-track: -0.01em;
  --big: "Geist Serif", "Iowan Old Style", Georgia, serif; --big-wt: 400; --big-track: -0.02em;
}
@media (prefers-color-scheme: dark) {
  :root[data-skin="a"]:not([data-theme="light"]), :root[data-skin="b"]:not([data-theme="light"]) {
    --bg: #0f0f0f; --surface: #161616; --surface-2: #1f1f1f; --ink: #ededec; --ink-2: #bdbdba; --ink-3: #8a8a86;
    --rule: #2c2c2b; --rule-2: #232322; --neutral: #3a3a38; --npa: #8a8a86;
  }
}
:root[data-skin="a"][data-theme="dark"], :root[data-skin="b"][data-theme="dark"] {
  --bg: #0f0f0f; --surface: #161616; --surface-2: #1f1f1f; --ink: #ededec; --ink-2: #bdbdba; --ink-3: #8a8a86;
  --rule: #2c2c2b; --rule-2: #232322; --neutral: #3a3a38; --npa: #8a8a86;
}
/* Geist Serif has no italic yet, so B marks the emphasised word with weight-free ink instead of a fake slant. */
:root[data-skin="b"] h1 em { font-style: normal; color: var(--ink-3); }
:root[data-skin="a"] h1 em { font-style: normal; color: var(--ink-3); }
:root[data-skin="a"] .big, :root[data-skin="a"] .cand .pc, :root[data-skin="a"] .tally b { font-feature-settings: "tnum" 1; }

.skin-pick { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); padding: 6px 6px 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow); }
.skin-pick button { border: 0; background: transparent; color: inherit; opacity: 0.6; padding: 6px 10px; border-radius: 999px; cursor: pointer; font-weight: 700; }
.skin-pick button[aria-pressed="true"] { background: var(--bg); color: var(--ink); opacity: 1; }

@media (max-width: 420px) { .mark small { display: none; } .status { font-size: 11.5px; padding: 4px 8px; gap: 6px; } .bar .wrap { gap: 10px; } }

/* Under the map the three parties sit side by side: name over its split, then the slider. */
.vbp-rows .party-row label { flex-direction: column; align-items: flex-start; gap: 2px; }

footer .credit { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--rule-2); font-size: 13px; font-weight: 600; color: var(--ink-2); }
footer .credit a { color: var(--ink); text-decoration-color: var(--rule); }
footer .credit a:hover { text-decoration-color: currentColor; }

.lede-2 { margin: 10px 0 0; max-width: 62ch; color: var(--ink-2); font-size: 15px; }
.features { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.features a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--rule); border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; background: var(--surface); }
.features a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.features a:hover { border-color: var(--ink-3); color: var(--ink); }

.poll-blocks { display: flex; flex-direction: column; gap: 32px; }
.poll-block-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.poll-block-head h3 { font-size: 18px; }
.poll-block-head .m { font: 650 15px var(--mono); }
.lede-2 b { color: var(--ink); font-weight: 650; }
.poll-block td:first-child { white-space: normal; min-width: 9em; }
.poll-block td, .poll-block th { padding-left: 8px; padding-right: 8px; }

.lede { max-width: 68ch; }
.poll-note { margin: -6px 0 22px; max-width: 78ch; font-size: 14px; color: var(--ink-2); padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); }
.poll-note b { color: var(--ink); }
