/* Midterms 2026 — forecast & live results */

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f1efea;
  --ink: #121417;
  --ink-2: #33383f;
  --muted: #646b75;
  --line: #e4e1db;
  --line-2: #d4d0c8;
  --focus: #2b6cdf;

  --dem: #1f5fd1;
  --dem-2: #6e9ae6;
  --dem-3: #c4d6f6;
  --dem-4: #e8effc;
  --rep: #d0312d;
  --rep-2: #ea8580;
  --rep-3: #f6cdca;
  --rep-4: #fdeceb;
  --ind: #7b4fc4;
  --ind-2: #ad91e0;
  --ind-3: #ddd0f3;
  --ind-4: #f1ecfa;
  --oth: #8d8a84;
  --toss: #d8d1e2;
  --none: #e9e6e0;
  --live: #e0322b;
  --gold: #b88a12;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(17, 20, 23, .05), 0 2px 8px rgba(17, 20, 23, .04);
  --max: 1220px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1013; --surface: #16191e; --surface-2: #1d2127; --ink: #eceef1; --ink-2: #c9ced5; --muted: #98a1ac;
    --line: #272c33; --line-2: #343a43; --focus: #6ea2ff;
    --dem: #4580ea; --dem-2: #86a8ef; --dem-3: #c2d4f7; --dem-4: #17243a;
    --rep: #e8504a; --rep-2: #f08f8a; --rep-3: #f7cbc8; --rep-4: #3a1b1b;
    --ind: #9b74e8; --ind-2: #bba5f0; --ind-3: #ddd2f7; --ind-4: #261f38;
    --oth: #8e939a; --toss: #cbc4d8; --none: #1f2329; --gold: #d9a92c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 10px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1013; --surface: #16191e; --surface-2: #1d2127; --ink: #eceef1; --ink-2: #c9ced5; --muted: #98a1ac;
  --line: #272c33; --line-2: #343a43; --focus: #6ea2ff;
  --dem: #4580ea; --dem-2: #86a8ef; --dem-3: #c2d4f7; --dem-4: #17243a;
  --rep: #e8504a; --rep-2: #f08f8a; --rep-3: #f7cbc8; --rep-4: #3a1b1b;
  --ind: #9b74e8; --ind-2: #bba5f0; --ind-3: #ddd2f7; --ind-4: #261f38;
  --oth: #8e939a; --toss: #cbc4d8; --none: #1f2329; --gold: #d9a92c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 10px rgba(0, 0, 0, .25);
  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: "cv11", "ss01"; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.num, table td.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { max-width: var(--max); margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 18px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 30px; height: 30px; display: block; flex-shrink: 0; }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font: 700 16px/1.1 var(--serif); letter-spacing: -.01em; }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.nav { display: flex; gap: 2px; align-items: center; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; padding: 7px 11px; border-radius: 8px; font-weight: 550; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--ink); color: var(--bg); }
.nav a.live-link { display: inline-flex; align-items: center; gap: 6px; }
.header-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn svg { width: 17px; height: 17px; }

.status-bar { border-bottom: 1px solid var(--line); background: var(--surface); }
.status-inner { max-width: var(--max); margin: 0 auto; padding: 7px 16px; display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.status-inner b { color: var(--ink); font-weight: 650; }
.status-inner .sep { width: 1px; height: 14px; background: var(--line-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); display: inline-block; box-shadow: 0 0 0 0 rgba(224, 50, 43, .6); animation: pulse 1.8s infinite; flex-shrink: 0; }
.live-dot.off { background: var(--muted); animation: none; box-shadow: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(224, 50, 43, .55); } 70% { box-shadow: 0 0 0 7px rgba(224, 50, 43, 0); } 100% { box-shadow: 0 0 0 0 rgba(224, 50, 43, 0); } }

/* ------------------------------------------------------------------ layout */
main { max-width: var(--max); margin: 0 auto; padding: 22px 16px 60px; min-height: 70vh; }
.page-head { margin: 6px 0 22px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
h1, h2, h3 { font-family: var(--serif); letter-spacing: -.012em; margin: 0; }
h1 { font-size: clamp(28px, 4.2vw, 44px); line-height: 1.08; font-weight: 700; }
h2 { font-size: 23px; line-height: 1.2; font-weight: 700; }
h3 { font-size: 18px; line-height: 1.25; font-weight: 650; }
.dek { font-size: 17px; color: var(--ink-2); max-width: 760px; margin-top: 10px; line-height: 1.5; }
.section { margin-top: 34px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 980px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span2 { grid-column: auto; } }
@media (max-width: 680px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.card-title { font: 650 13px/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.card a.more { font-size: 13px; font-weight: 600; text-decoration: none; color: var(--focus); text-transform: none; letter-spacing: 0; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* ------------------------------------------------------------------ chamber cards */
.chamber-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; transition: border-color .15s, transform .15s; }
a.chamber-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.chamber-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.chamber-name { font: 700 20px/1.1 var(--serif); }
.chamber-sub { font-size: 13px; color: var(--muted); }
.odds-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.odds { display: flex; flex-direction: column; }
.odds .pct { font: 800 40px/1 var(--sans); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.odds .who { font-size: 13px; font-weight: 600; margin-top: 4px; }
.odds.right { text-align: right; align-items: flex-end; }
.odds.dem .pct, .c-dem { color: var(--dem); }
.odds.rep .pct, .c-rep { color: var(--rep); }
.c-ind { color: var(--ind); }
.c-oth { color: var(--oth); }
.split-bar { height: 12px; border-radius: 999px; overflow: hidden; display: flex; background: var(--none); }
.split-bar span { display: block; height: 100%; }
.compare-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); gap: 8px; flex-wrap: wrap; }
.compare-line b { color: var(--ink); font-weight: 650; }

/* ------------------------------------------------------------------ pills & tags */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; border: 1px solid transparent; }
.pill.live { background: var(--rep-4); color: var(--live); }
.pill.called { background: var(--ink); color: var(--bg); }
.pill.flip { background: var(--surface); border-color: currentColor; }
.party-chip { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; font: 750 11px/1 var(--sans); color: #fff; flex-shrink: 0; }
.party-chip.D { background: var(--dem); } .party-chip.R { background: var(--rep); } .party-chip.I { background: var(--ind); }
.party-chip.L, .party-chip.G, .party-chip.O, .party-chip.C { background: var(--oth); }
.rating-chip { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 650; white-space: nowrap; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; white-space: nowrap; cursor: default; user-select: none; }
table.data th.sortable { cursor: pointer; }
table.data th.sortable:hover { color: var(--ink); }
table.data th.sorted::after { content: " ↓"; }
table.data th.sorted.asc::after { content: " ↑"; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .1s; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; }
.race-name { font-weight: 650; text-decoration: none; }
.cand-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cand-line .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inc-star { font-size: 10px; color: var(--muted); font-weight: 700; letter-spacing: .02em; }

/* probability mini bar */
.pbar { position: relative; width: 120px; height: 8px; border-radius: 999px; background: var(--none); overflow: hidden; display: inline-block; vertical-align: middle; }
.pbar i { position: absolute; top: 0; bottom: 0; }
.pbar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--surface); }
.prob-cell { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.prob-cell .v { min-width: 64px; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ controls */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: var(--surface); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--ink); color: var(--bg); }
.search { flex: 1; min-width: 180px; max-width: 340px; position: relative; }
.search input, select.input { width: 100%; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
select.input { width: auto; padding-right: 28px; }
.search input:focus, select.input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }

/* ------------------------------------------------------------------ race cards */
.race-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; }
.race-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; text-decoration: none; display: flex; flex-direction: column; gap: 9px; transition: border-color .15s, box-shadow .15s; position: relative; min-width: 0; }
.race-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.race-card .rc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.race-card .rc-title { font-weight: 700; font-size: 14px; }
.race-card .rc-type { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.rc-cands { display: flex; flex-direction: column; gap: 5px; }
.rc-cand { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rc-cand .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-cand .pv { font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-cand.lead .nm { font-weight: 650; }
.rc-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); gap: 6px; }
.eevp-bar { height: 4px; background: var(--none); border-radius: 99px; overflow: hidden; }
.eevp-bar i { display: block; height: 100%; background: var(--ink-2); }

/* ------------------------------------------------------------------ charts */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--sans); fill: var(--muted); font-size: 11px; }
.chart .axis line, .chart .axis path { stroke: var(--line-2); }
.chart .grid line { stroke: var(--line); }
.chart .label-strong { fill: var(--ink); font-weight: 700; }
.map-wrap { position: relative; max-width: 820px; margin: 0 auto; }
.map-wrap svg path.state { stroke: var(--surface); stroke-width: 1; cursor: pointer; transition: opacity .12s; }
.map-wrap svg path.state:hover { opacity: .82; }
.map-wrap svg path.state.inactive { cursor: default; }
.map-wrap svg path.state.inactive:hover { opacity: 1; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.tooltip { position: fixed; z-index: 100; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); font-size: 13px; max-width: 280px; opacity: 0; transition: opacity .1s; }
.tooltip.on { opacity: 1; }
.tooltip .tt-title { font-weight: 700; margin-bottom: 6px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; }

.seat-strip { display: flex; gap: 2px; align-items: stretch; position: relative; }
.seat-strip a { flex: 1; min-width: 0; display: block; border-radius: 2px; text-decoration: none; transition: transform .1s; }
.seat-strip a:hover { transform: scaleY(1.18); }
.strip-wrap { position: relative; padding-top: 20px; }
.strip-mark { position: absolute; top: 0; bottom: -6px; width: 2px; background: var(--ink); }
.strip-mark span { position: absolute; top: 0; left: 6px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.strip-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; gap: 8px; }

.map-toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.map-frame { position: relative; }
.map-frame svg { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.map-frame svg.zoomed { cursor: grab; touch-action: none; }
.map-frame svg.zoomed:active { cursor: grabbing; }
.map-skeleton { border-radius: var(--radius); }
.district-map .district { stroke: var(--surface); stroke-width: .5; vector-effect: non-scaling-stroke; cursor: pointer; transition: opacity .12s; }
.district-map .district:hover { opacity: .78; }
.district-map .state-borders { fill: none; stroke: var(--surface); stroke-width: 1.7; vector-effect: non-scaling-stroke; pointer-events: none; }
.district-map .coast { fill: none; stroke: var(--line-2); stroke-width: .6; vector-effect: non-scaling-stroke; pointer-events: none; }
.district-labels text { font-family: var(--sans); font-weight: 700; fill: var(--ink); text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: var(--surface); stroke-width: 2.6px; stroke-linejoin: round; pointer-events: none; }
.state-labels text { font-size: 12px; dominant-baseline: auto; }
.state-map .district { stroke-width: .9; }
.locator .district { cursor: pointer; }
.locator .district.target { cursor: default; }
.locator .target-outline { fill: none; stroke: var(--ink); stroke-width: 2.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.state-labels text.target { font-size: 14px; }
.zoom-ctrls { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; }
.zoom-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: var(--shadow); display: grid; place-items: center; }
.zoom-btn:hover { border-color: var(--line-2); }
.zoom-select { position: absolute; left: 8px; top: 8px; max-width: 190px; font-size: 13px; padding: 6px 8px; box-shadow: var(--shadow); }
.hex-map .hex { cursor: pointer; transition: opacity .12s; }
.hex-map .hex:hover { opacity: .75; }
.hex-map .hex-borders { fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; opacity: .8; pointer-events: none; }
.hex-labels text { font-family: var(--sans); font-weight: 750; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--surface); stroke-width: 2.4px; stroke-linejoin: round; pointer-events: none; letter-spacing: .02em; }
@media (max-width: 680px) { .zoom-select { position: static; margin-bottom: 8px; max-width: none; width: 100%; } .zoom-btn { width: 30px; height: 30px; } }

/* ------------------------------------------------------------------ race page */
.race-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 880px) { .race-hero { grid-template-columns: minmax(0, 1fr); } }
.matchup { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }
.cand { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cand.right { align-items: flex-end; text-align: right; }
.cand .avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font: 750 18px/1 var(--sans); color: #fff; margin-bottom: 4px; }
.cand .cname { font: 700 19px/1.15 var(--serif); }
.cand .cmeta { font-size: 13px; color: var(--muted); }
.cand .cprob { font: 800 38px/1 var(--sans); letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.vs { font: 700 13px/1 var(--sans); color: var(--muted); letter-spacing: .1em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; }
.signal-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.signal-row:last-child { border-bottom: 0; }
.signal-row .sig-bar { position: relative; height: 18px; background: var(--surface-2); border-radius: 4px; }
.signal-row .sig-bar .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-2); }
.signal-row .sig-bar .dot { position: absolute; top: 3px; width: 12px; height: 12px; border-radius: 50%; transform: translateX(-50%); border: 2px solid var(--surface); }
.signal-row .w { font-size: 12px; color: var(--muted); text-align: right; }
.results-table td.votes { text-align: right; font-variant-numeric: tabular-nums; }
.vote-bar { height: 6px; border-radius: 99px; background: var(--none); overflow: hidden; margin-top: 4px; }
.vote-bar i { display: block; height: 100%; }
.winner-check { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 800; }

/* ------------------------------------------------------------------ banners */
.banner { border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); background: var(--surface); margin-bottom: 18px; flex-wrap: wrap; }
.banner.live { border-color: color-mix(in srgb, var(--live) 40%, var(--line)); background: color-mix(in srgb, var(--live) 6%, var(--surface)); }
.banner .grow { flex: 1; min-width: 200px; }
.countdown { display: flex; gap: 10px; }
.countdown div { text-align: center; min-width: 44px; }
.countdown b { display: block; font: 800 24px/1 var(--sans); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.notice { font-size: 13px; color: var(--muted); border-left: 3px solid var(--line-2); padding: 4px 0 4px 12px; margin: 12px 0; }

/* ------------------------------------------------------------------ states index */
.state-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.state-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; font-weight: 600; font-size: 14px; }
.state-link:hover { border-color: var(--line-2); }
.state-link .badges { display: flex; gap: 3px; }
.state-link .badges i { width: 9px; height: 9px; border-radius: 2px; display: block; }

.timeline { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tl-row:last-child { border-bottom: 0; }
.tl-row .t { font-weight: 750; font-variant-numeric: tabular-nums; }
.tl-row.past .t { color: var(--muted); text-decoration: line-through; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips a { font-size: 12px; font-weight: 650; padding: 2px 7px; border-radius: 5px; background: var(--surface-2); text-decoration: none; }

.measure { padding: 12px 0; border-bottom: 1px solid var(--line); }
.measure:last-child { border-bottom: 0; }
.measure h4 { margin: 0 0 4px; font-size: 15px; }
.measure p { margin: 0; color: var(--ink-2); font-size: 14px; }

.prose { max-width: 760px; font-size: 16px; line-height: 1.65; }
.prose h2 { margin: 30px 0 10px; }
.prose h3 { margin: 22px 0 8px; }
.prose code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 14px; }
.prose li { margin: 4px 0; }

.empty { padding: 28px; text-align: center; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

footer.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 26px 16px 40px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; font-size: 13px; color: var(--muted); }
.footer-inner p { margin: 0 0 8px; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } }

@media (max-width: 760px) {
  .header-inner { gap: 6px 10px; flex-wrap: wrap; height: auto; padding: 9px 16px 0; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -16px; padding: 0 12px 8px; }
  .header-tools { margin-left: auto; }
  .brand-text span { display: none; }
  main { padding-top: 16px; }
  .odds .pct { font-size: 34px; }
  .cand .cprob { font-size: 30px; }
  .pbar { width: 64px; }
  .hide-sm { display: none !important; }
  table.data td, table.data th { padding: 9px 9px; }
}
@media (min-width: 761px) { .show-sm { display: none !important; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------------ simulator */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 650; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .1s, border-color .15s, background .15s; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .9; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.sim-controls { margin-bottom: 18px; }
.sim-control-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.sim-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.err-custom { margin-top: 14px; }
.err-scale { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 13px; max-width: 560px; margin: 0 auto 6px; }
.err-slider, .sim-range { flex: 1; accent-color: var(--ink); min-width: 0; }
.sim-headline h2 { font-size: clamp(22px, 3vw, 30px); }
.linkish { border: 0; background: none; color: var(--focus); font-weight: 600; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 13px; padding: 0; }

#simbar:empty { display: none; }
#simbar { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.simbar-inner { max-width: var(--max); margin: 0 auto; padding: 7px 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sim-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.sim-badge .live-dot { background: var(--gold); box-shadow: none; animation: none; }
.sim-clock { font-variant-numeric: tabular-nums; min-width: 92px; font-size: 14px; }
.sim-btn { width: 32px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.sim-btn:hover { border-color: var(--ink-2); }
.sim-speeds button { padding: 4px 8px; font-size: 12px; }
.sim-track { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.sim-range { width: 100%; margin: 0; }
.sim-ticks { position: relative; height: 13px; font-size: 10px; color: var(--muted); margin: 0 8px; }
.sim-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.sim-ticks span:first-child { transform: none; }
.sim-ticks span:last-child { transform: translateX(-100%); }
.sim-link { font-size: 13px; font-weight: 650; text-decoration: none; color: var(--focus); }
.sim-exit { color: var(--muted); }
@media (max-width: 760px) {
  .simbar-inner { gap: 8px; padding: 6px 12px; }
  .sim-track { order: 5; flex-basis: 100%; }
  .sim-link { display: none; }
}

.feed-list { list-style: none; margin: 0; padding: 0; }
.feed-item { display: grid; grid-template-columns: 74px 26px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item.big .feed-text { font-weight: 650; }
.feed-item.control .feed-text { font-weight: 800; font-size: 15px; }
.feed-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 2px; white-space: nowrap; }
.feed-icon { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--surface-2); color: var(--ink-2); }
.feed-icon.control { background: var(--gold) !important; color: #fff; }
.feed-icon.final { background: var(--ink); color: var(--bg); }
.feed-text a { text-decoration: none; }
.feed-text a:hover { text-decoration: underline; }
.sim-cta { display: flex; align-items: center; gap: 14px; margin-top: 16px; text-decoration: none; flex-wrap: wrap; }
.sim-cta .grow { flex: 1; min-width: 220px; }
.sim-cta-icon { font-size: 26px; }
/* map states on election night: no race < polls still open < polls closed but nothing counted */
:root { --norace: #f4f2ee; --await: #e4e0d8; --novotes: #c9c4ba; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --norace: #191c21; --await: #2a2f37; --novotes: #424954; } }
:root[data-theme="dark"] { --norace: #191c21; --await: #2a2f37; --novotes: #424954; }

/* ------------------------------------------------------------------ election-night maps */
.hero-map .map-wrap { max-width: 980px; }
.bg-row { align-items: start; }
.bg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 680px) { .bg-grid { grid-template-columns: minmax(0, 1fr); } }
.bg-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; background: var(--surface); transition: border-color .15s; min-width: 0; }
.bg-card:hover { border-color: var(--line-2); }
.bg-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.bg-cands { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.bg-cand { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.bg-cand .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.county-map .county { stroke: var(--surface); stroke-width: .35; vector-effect: non-scaling-stroke; }
.county-map .county:hover { stroke: var(--ink); stroke-width: 1.2; }
.county-map.compact .county { stroke-width: .25; }
.county-map .state-outline { stroke: var(--ink-2); stroke-width: .9; opacity: .5; }
.feed { max-height: 980px; overflow: auto; }

.map-tag { position: absolute; left: 4px; bottom: 4px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 2px 6px; border-radius: 4px; pointer-events: none; }
