
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; } img { max-width: 100%; } [hidden] { display: none !important; }
ul > li.empty { display: block; }

/* Layout: a wire-desk board — sticky live strip, three chamber bars, then the feed beside the poll-close clock, then the race board. */
:root {
  --bg: #eef1f5; --surface: #ffffff; --ink: #121821; --muted: #586377; --line: #d6dce6; --line-soft: #e6eaf0;
  --dem: #1d5bbf; --dem-tint: #a9c2ea; --rep: #c2352a; --rep-tint: #ecb2ab; --ind: #7656bd; --open: #c9d0db;
  --live: #c46a00; --ok: #19734a; --ok-bg: #e2f2ea; --single: #8f5d00; --single-bg: #f8edd5;
  --conflict: #9b2f72; --conflict-bg: #f6e1ee; --quar: #3f4a5c; --quar-bg: #e3e7ee;
  --crit: #b23c0a; --crit-bg: #fbe4d7;
  --dem-mid: #6f97da; --rep-mid: #de7d73; --map-none: #e3e7ed; --map-closed: #a9b2c0;
  --f-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0d1219; --surface: #151c26; --ink: #e5eaf1; --muted: #97a2b4; --line: #2a3443; --line-soft: #1f2833;
  --dem: #5e95ee; --dem-tint: #2c4670; --rep: #ee6c60; --rep-tint: #6e3530; --ind: #a88cea; --open: #3a4556;
  --live: #f2a541; --ok: #52c78b; --ok-bg: #143324; --single: #e6b04a; --single-bg: #3a2e12;
  --conflict: #e682c2; --conflict-bg: #3b1d30; --quar: #b5bfce; --quar-bg: #262f3c; --crit: #ff8d52; --crit-bg: #3e2215; --dem-mid: #3d68ad; --rep-mid: #a64a42; --map-none: #19202a; --map-closed: #4c5869; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0d1219; --surface: #151c26; --ink: #e5eaf1; --muted: #97a2b4; --line: #2a3443; --line-soft: #1f2833;
  --dem: #5e95ee; --dem-tint: #2c4670; --rep: #ee6c60; --rep-tint: #6e3530; --ind: #a88cea; --open: #3a4556;
  --live: #f2a541; --ok: #52c78b; --ok-bg: #143324; --single: #e6b04a; --single-bg: #3a2e12;
  --conflict: #e682c2; --conflict-bg: #3b1d30; --quar: #b5bfce; --quar-bg: #262f3c; --crit: #ff8d52; --crit-bg: #3e2215; --dem-mid: #3d68ad; --rep-mid: #a64a42; --map-none: #19202a; --map-closed: #4c5869; color-scheme: dark; }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.eyebrow { font: 600 11px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; }

/* sticky live strip */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-block: 12px; }
h1 { font-size: 26px; font-weight: 800; font-stretch: 78%; letter-spacing: -.01em; line-height: 1.05; }
.livebox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 600 12px/1.4 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; border: 1px solid transparent; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-live { color: var(--ok); background: var(--ok-bg); }
.st-live .dot { animation: pulse 1.6s ease-in-out infinite; }
.st-stale { color: var(--single); background: var(--single-bg); }
.st-off { color: var(--quar); background: var(--quar-bg); }
.phase { color: var(--live); border-color: var(--live); }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .st-live .dot { animation: none; } }

.headline { padding-block: 16px 4px; display: grid; gap: 6px; }
.headline p { margin: 0; font: 600 clamp(18px, 2.4vw, 22px)/1.3 var(--f-display); font-stretch: 92%; max-width: 70ch; }
.banner { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 14px; }

/* race map */
.mapwrap { margin-top: 16px; }
.maplegend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); align-items: center;
  min-height: 34px; padding: 8px 16px; border-bottom: 1px solid var(--line-soft); }
.chip[aria-disabled="true"] { opacity: .35; cursor: not-allowed; }
.maplegend .sw.up { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
#usmapSvg .st.up, #usmapSvg .box.up { stroke: var(--ink); stroke-width: 1.5; }
.maplegend .sw { width: 11px; height: 11px; margin-right: 2px; }
.maplegend .sw + .sw { margin-left: -1px; }
.maplegend .mk { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; margin-right: 4px;
  font: 700 10px/1 var(--f-mono); font-style: normal; background: var(--single); color: var(--surface); }
.mapbody { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 0; }
#usmapSvg { display: block; width: 100%; height: auto; max-height: 560px; padding: 8px 8px 4px; }
#usmapSvg .st { stroke: var(--surface); stroke-width: 0.9; cursor: pointer; transition: fill .4s ease; }
#usmapSvg .st:hover, #usmapSvg .st:focus-visible, #usmapSvg .st.sel { stroke: var(--ink); stroke-width: 1.6; outline: none; }
#usmapSvg .lbl { font: 600 10.5px var(--f-mono); fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 2.5px; stroke-linejoin: round; }
#usmapSvg .box { stroke: var(--surface); stroke-width: 0.9; cursor: pointer; }
#usmapSvg .box:hover, #usmapSvg .box:focus-visible, #usmapSvg .box.sel { stroke: var(--ink); stroke-width: 1.4; outline: none; }
#usmapSvg .lead { stroke: var(--muted); stroke-width: 0.6; }
#usmapSvg .cty { stroke: var(--surface); stroke-width: 0.3; cursor: pointer; transition: fill .4s ease; }
#usmapSvg .cty:hover, #usmapSvg .cty:focus-visible, #usmapSvg .cty.sel { stroke: var(--ink); stroke-width: 1; outline: none; }
#usmapSvg .st.host { fill: none; }
#usmapSvg .mk circle { stroke: var(--surface); stroke-width: 1.5; }
#usmapSvg .mk text { font: 700 10px var(--f-mono); fill: var(--surface); text-anchor: middle; pointer-events: none; }
#usmapSvg .mk.critical circle { fill: var(--crit); } #usmapSvg .mk.warning circle { fill: var(--single); }
.m-none { fill: var(--map-none); background: var(--map-none); }
.m-voting { fill: var(--open); background: var(--open); }
.m-closed { fill: var(--map-closed); background: var(--map-closed); }
.m-lead-D { fill: var(--dem-tint); background: var(--dem-tint); } .m-lead-R { fill: var(--rep-tint); background: var(--rep-tint); }
.m-proj-D { fill: var(--dem-mid); background: var(--dem-mid); } .m-proj-R { fill: var(--rep-mid); background: var(--rep-mid); }
.m-called-D { fill: var(--dem); background: var(--dem); } .m-called-R { fill: var(--rep); background: var(--rep); }
.m-called-I, .m-proj-I, .m-lead-I { fill: var(--ind); background: var(--ind); }
.m-split { fill: var(--conflict-bg); background: var(--conflict-bg); }
.mapinfo { border-left: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 8px; align-content: start; font-size: 13.5px; min-width: 0; }
.mapinfo h3 { font: 700 18px/1.2 var(--f-display); font-stretch: 85%; margin: 0; }
.mapinfo .tally-row { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line-soft); padding-block: 4px; }
.mapinfo .tally-row:last-child { border-bottom: 0; }
.mapinfo .muted { color: var(--muted); font-size: 12.5px; }
@media (max-width: 900px) { .mapbody { grid-template-columns: minmax(0, 1fr); } .mapinfo { border-left: 0; border-top: 1px solid var(--line); } }

/* county coverage */
.coverage { border-top: 1px solid var(--line); padding: 12px 16px 14px; font-size: 13.5px; display: grid; gap: 8px; }
.coverage p { margin: 0; max-width: 90ch; }
.coverage .muted { color: var(--muted); font-size: 12.5px; }
.coverage summary { cursor: pointer; font-weight: 600; }
.coverage summary:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; }
.covgroups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 20px; margin-top: 10px; }
.covgroups h4 { margin: 0 0 4px; font: 600 12.5px/1.3 var(--f-body); }
.covgroups ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.covgroups a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }

/* irregularities */
.alerts { margin-top: 16px; scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 110px); }
.alert-pill { cursor: pointer; text-decoration: none; }
.alert-pill.sev-critical { color: var(--crit); background: var(--crit-bg); }
.alert-pill.sev-warning { color: var(--single); background: var(--single-bg); }
.alert-pill.sev-none { color: var(--muted); border-color: var(--line); }
.alist { list-style: none; margin: 0; padding: 0; }
.alist > li { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.alist > li:last-child { border-bottom: 0; }
.alist > li.resolved { opacity: .62; }
.sev { display: grid; gap: 4px; align-content: start; }
.sev .lvl { font: 700 12px/1.2 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 4px; justify-self: start; }
.lvl-critical { color: var(--crit); background: var(--crit-bg); }
.lvl-warning { color: var(--single); background: var(--single-bg); }
.lvl-info { color: var(--quar); background: var(--quar-bg); }
.sev .stt { font: 600 11px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sev time { font: 600 12px/1.3 var(--f-mono); color: var(--muted); }
.alist h3 { font: 650 16px/1.3 var(--f-body); margin: 4px 0 2px; }
.alist p { margin: 4px 0 0; font-size: 14px; max-width: 70ch; }
.alist dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 10px; margin: 8px 0 0; font-size: 13.5px; }
.alist dt { font: 600 11px/1.7 var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.alist dd { margin: 0; max-width: 64ch; }
.unconf { padding: 12px 16px 14px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.unconf ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.unconf b { color: var(--ink); font-weight: 600; }
@media (max-width: 480px) { .alist > li { grid-template-columns: minmax(0, 1fr); gap: 6px; } .sev { grid-auto-flow: column; justify-content: start; align-items: center; gap: 8px; } }

/* chamber bars */
.chambers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-block: 16px; }
.chamber { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: grid; gap: 10px; min-width: 0; }
.chamber-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chamber h2 { font-size: 20px; font-weight: 750; font-stretch: 85%; }
.tally { display: flex; justify-content: space-between; align-items: baseline; }
.tally .n { font: 800 40px/1 var(--f-display); font-stretch: 70%; font-variant-numeric: tabular-nums; }
.tally .d { color: var(--dem); } .tally .r { color: var(--rep); }
.tally .mid { text-align: center; font-size: 12px; color: var(--muted); }
.bar { position: relative; display: flex; height: 22px; border-radius: 3px; overflow: hidden; background: var(--open); }
.bar span { display: block; height: 100%; transition: width .5s ease; }
.bar .tick { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); transform: translateX(-1px); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.chamber .note { font-size: 12.5px; color: var(--muted); margin: 0; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 4px; font: 600 11px/1.6 var(--f-mono); letter-spacing: .03em; white-space: nowrap; }
.v-verified { color: var(--ok); background: var(--ok-bg); }
.v-single-source { color: var(--single); background: var(--single-bg); }
.v-conflict, .v-corrected { color: var(--conflict); background: var(--conflict-bg); }
.v-quarantined { color: var(--quar); background: var(--quar-bg); }
.tag { font: 600 11px/1.6 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }
.p-D { color: var(--dem); } .p-R { color: var(--rep); } .p-I, .p-L, .p-G { color: var(--ind); }

/* main grid */
.grid2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 19px; font-weight: 750; font-stretch: 85%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { font: 600 12px/1 var(--f-body); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.feed li:last-child { border-bottom: 0; }
.feed li.fresh { animation: flash 2.4s ease-out; }
@keyframes flash { from { background: var(--single-bg); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .feed li.fresh { animation: none; } }
.feed time { font: 600 13px/1.35 var(--f-mono); color: var(--muted); }
.feed h3 { font: 650 16px/1.3 var(--f-body); margin: 4px 0 2px; }
.feed p { margin: 4px 0 0; font-size: 14px; max-width: 68ch; }
.feed .fnote { color: var(--muted); font-style: italic; font-size: 13px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.srcs { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 12.5px; }
.srcs a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.srcs a:hover { color: var(--ink); }
.empty { padding: 24px 16px; color: var(--muted); font-size: 14px; }

/* closings clock */
.closings { list-style: none; margin: 0; padding: 4px 0; }
.closings li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 9px 16px; border-bottom: 1px solid var(--line-soft); }
.closings li:last-child { border-bottom: 0; }
.closings .hr { font: 700 14px/1.2 var(--f-mono); }
.closings .sts { font-size: 13px; }
.closings .cd { font: 600 12px/1.2 var(--f-mono); color: var(--muted); white-space: nowrap; }
.closings li.past { opacity: .55; }
.closings li.next .hr, .closings li.next .cd { color: var(--live); }

/* race board */
.board { margin-block: 16px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
th { text-align: left; font: 600 11px/1.2 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.stcell b { font: 700 15px/1.2 var(--f-display); font-stretch: 85%; display: block; }
.stcell small { color: var(--muted); font-size: 12px; }
.cands { display: grid; gap: 5px; min-width: 240px; }
.cand { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 8px; align-items: center; }
.cand .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand .nm .win { font-weight: 700; }
.cand .pc { text-align: right; font: 600 13px/1 var(--f-mono); }
.cand .pbar { grid-column: 1 / -1; height: 4px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.cand .pbar i { display: block; height: 100%; }
.status { font: 600 12px/1.3 var(--f-mono); white-space: nowrap; }
.s-voting, .s-too-early { color: var(--muted); } .s-closed, .s-counting, .s-projected { color: var(--live); } .s-too-close, .s-split { color: var(--conflict); } .s-called { color: var(--ok); }
.proj { display: grid; gap: 2px; margin-top: 5px; font-size: 12px; }
.proj .need { color: var(--muted); }
.cand .ptag { font: 600 10px/1 var(--f-mono); letter-spacing: .05em; color: var(--live); border: 1px solid var(--live); border-radius: 3px; padding: 1px 4px; margin-left: 4px; vertical-align: 1px; }
.chproj { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 13px; padding: 7px 9px; border-radius: 5px; background: var(--line-soft); }
.chproj b { font-weight: 700; }
.chproj.none { color: var(--muted); }
.rating { font: 600 12px/1.4 var(--f-mono); white-space: nowrap; }
.rnote { color: var(--muted); font-size: 12.5px; margin-top: 4px; max-width: 46ch; }

/* lower panels */
.lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.plain { list-style: none; margin: 0; padding: 4px 0; }
.plain li { padding: 9px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; display: grid; gap: 2px; }
.plain li:last-child { border-bottom: 0; }
.plain .muted { color: var(--muted); font-size: 12.5px; }
.quote { font-family: var(--f-mono); font-size: 12px; background: var(--quar-bg); color: var(--quar); padding: 6px 8px; border-radius: 4px; overflow-wrap: anywhere; }
.method { padding: 14px 16px; font-size: 13.5px; color: var(--muted); display: grid; gap: 8px; }
.method p { margin: 0; max-width: 72ch; }
.key { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
footer { padding-block: 8px 28px; color: var(--muted); font-size: 12.5px; }

@media (max-width: 900px) {
  .chambers { grid-template-columns: minmax(0, 1fr); }
  .grid2, .lower { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  h1 { font-size: 22px; }
  .feed li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tally .n { font-size: 34px; }
}
