/* PollBoard styles. Dark is the default theme; light is selected via [data-theme=light]. */
:root {
  color-scheme: dark;
  --bg: #111113; --surface: #1a1a1d; --surface-2: #222226; --border: #2c2c31; --border-2: #3a3a40;
  --text: #f0efec; --text-2: #b5b4ad; --text-3: #7d7c76;
  --dem: #3987e5; --rep: #e66767; --ind: #c98500; --neutral: #383835;
  --dem-soft: rgba(57,135,229,.18); --rep-soft: rgba(230,103,103,.18);
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --accent: #9085e9;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --radius: 12px; --rail: 180px; --top: 56px; --bottom-nav: 0px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f6f4; --surface: #fcfcfb; --surface-2: #f0efec; --border: #e3e2dd; --border-2: #cfcec8;
  --text: #0b0b0b; --text-2: #52514e; --text-3: #8a8983;
  --dem: #2a78d6; --rep: #e34948; --ind: #eda100; --neutral: #e4e3de;
  --dem-soft: rgba(42,120,214,.14); --rep-soft: rgba(227,73,72,.14);
  --accent: #6250d6;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.num, .tbl td, .tbl th, .axis text { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hero-num { font-family: var(--mono); font-variant-numeric: proportional-nums; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); } .small { font-size: 12.5px; }
.d { color: var(--dem); } .r { color: var(--rep); } .i { color: var(--ind); }

/* ---------- shell ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--rail) 1fr; grid-template-rows: var(--top) 1fr; grid-template-areas: "top top" "rail main"; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; min-width: calc(var(--rail) - 16px); }
.logo { display: inline-flex; align-items: flex-end; gap: 2px; height: 20px; }
.logo i { display: block; width: 6px; border-radius: 2px; } .logo .d { height: 10px; background: var(--dem); } .logo .n { height: 18px; background: var(--text-3); } .logo .r { height: 14px; background: var(--rep); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.updated { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; display: inline-grid; place-items: center; font-size: 16px; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.active { color: var(--accent); background: var(--surface-2); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg button[aria-selected="true"], .seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.rail { grid-area: rail; border-right: 1px solid var(--border); padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: var(--top); height: calc(100vh - var(--top)); background: var(--bg); }
.rail a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: 14px; }
.rail a .ic { width: 18px; text-align: center; opacity: .8; }
.rail a:hover { background: var(--surface-2); color: var(--text); }
.rail a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.main { grid-area: main; padding: 20px 22px calc(24px + var(--bottom-nav)); max-width: 1400px; width: 100%; min-width: 0; }

/* ---------- common blocks ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); max-width: 70ch; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card h3 { margin-bottom: 10px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } .grid.four { grid-template-columns: repeat(4, 1fr); }
.grid.board { grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .label { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 26px; font-weight: 650; line-height: 1.1; }
.stat .sub { font-size: 12.5px; color: var(--text-3); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border-2); color: var(--text-2); white-space: nowrap; vertical-align: middle; }
.chip.d { background: var(--dem-soft); color: var(--dem); border-color: transparent; }
.chip.r { background: var(--rep-soft); color: var(--rep); border-color: transparent; }
.chip.i { color: var(--ind); }
.chip.warn { color: var(--warn); border-color: var(--warn); }
.chip.grade { font-family: var(--mono); }
.chip.tossup { background: var(--surface-2); color: var(--text); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.toolbar label { font-size: 12.5px; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
select, input[type="search"] { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.btn { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-2); font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface); }
.btn:hover { color: var(--text); border-color: var(--text-3); } .btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.empty { padding: 30px; text-align: center; color: var(--text-3); }

/* margin bar used in lists */
.mbar { position: relative; height: 10px; background: var(--neutral); border-radius: 3px; overflow: hidden; width: 100%; }
.mbar::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--border-2); }
.mbar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.mbar i.d { right: 50%; background: var(--dem); } .mbar i.r { left: 50%; background: var(--rep); }
.wbar { height: 6px; background: var(--neutral); border-radius: 3px; width: 70px; overflow: hidden; }
.wbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
.tbl th.sortable { cursor: pointer; } .tbl th.sorted { color: var(--text); }
.tbl td { padding: 8px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.link { cursor: pointer; } .tbl tbody tr.link:hover td { background: var(--surface-2); }
.tbl td.name { font-family: var(--sans); font-weight: 600; }
.tbl td.m-summary { display: none; }
.tbl td.sub, .tbl td .sub { font-family: var(--sans); color: var(--text-3); font-size: 12px; }
.tbl .right, .tbl td.num { text-align: right; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
tr.outlier td { background: color-mix(in oklab, var(--warn) 7%, transparent); }

/* ---------- tile map ---------- */
.tilemap svg { width: 100%; height: auto; display: block; }
.tilemap .tile rect { stroke: var(--bg); stroke-width: 2; rx: 4; transition: opacity .15s; cursor: pointer; }
.tilemap .tile text { font-family: var(--mono); font-size: 12.5px; font-weight: 600; pointer-events: none; }
.tilemap .tile.norace rect { fill: var(--surface-2); cursor: default; }
.tilemap .tile.norace text { fill: var(--text-3); }
.tilemap .tile.pulse rect { animation: pulse 1.6s ease-out 1; }
@keyframes pulse { 0% { stroke: var(--accent); stroke-width: 6; } 100% { stroke: var(--bg); stroke-width: 2; } }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); margin-top: 8px; flex-wrap: wrap; }
.legend .ramp { width: 160px; height: 10px; border-radius: 3px; }

/* ---------- balance bar ---------- */
.bop { position: relative; margin-top: 22px; }
.bop .bar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--bg); }
.bop .bar span { display: block; height: 100%; min-width: 0; }
.bop .needle { position: absolute; top: -6px; bottom: -6px; left: 50%; width: 2px; background: var(--text); transform: translateX(-1px); }
.bop .needle::after { content: "50"; position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font: 600 11px var(--mono); color: var(--text-2); }
.bop .ends { display: flex; justify-content: space-between; margin-top: 6px; font: 600 13px var(--mono); }
.bop-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.bop-legend span i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------- ribbon ---------- */
.ribbon svg { width: 100%; height: auto; display: block; }
.axis line, .axis path { stroke: var(--border); } .axis text { fill: var(--text-3); font-size: 11px; }
.grid-line { stroke: var(--border); stroke-width: 1; }
.zero-line { stroke: var(--text-3); stroke-width: 1; }
.baseline-line { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 4 4; }
.band { fill: var(--accent); opacity: .16; }
.trend { fill: none; stroke: var(--accent); stroke-width: 2; }
.dot { stroke: var(--surface); stroke-width: 2; cursor: pointer; }
.dot.outlier { stroke: var(--warn); }
.cross { stroke: var(--text-3); stroke-width: 1; }
.spark { width: 110px; height: 28px; display: block; } .spark path { fill: none; stroke: var(--text-2); stroke-width: 1.5; } .spark .zero { stroke: var(--border-2); }
.spark .dot { fill: var(--accent); stroke: none; }

/* ---------- heat grid ---------- */
.heat { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.heat table { border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.heat th { font-weight: 600; color: var(--text-2); font-size: 11px; padding: 2px 6px; white-space: nowrap; }
.heat th.race { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 2; font-family: var(--sans); font-size: 12.5px; color: var(--text); padding-right: 12px; cursor: pointer; }
.heat th.race small { color: var(--text-3); font-weight: 500; margin-left: 4px; }
.heat td { width: 58px; min-width: 58px; height: 34px; line-height: 1; padding: 0; vertical-align: middle; border-radius: 6px; text-align: center; font-family: var(--mono); font-size: 11.5px; font-weight: 600; position: relative; cursor: pointer; color: var(--text); }
.heat td.empty { background: transparent; box-shadow: inset 0 0 0 1px var(--border); cursor: default; }
.heat td.empty::after { content: "·"; color: var(--text-3); }
.heat td.thin { opacity: .6; box-shadow: inset 0 0 0 1px var(--border-2); }
.heat td .chev { position: absolute; top: 2px; right: 4px; font-size: 9px; opacity: .9; }
.heat td:hover { outline: 2px solid var(--text); outline-offset: -1px; }

/* ---------- movers ---------- */
.dumb { display: grid; grid-template-columns: 150px 1fr 90px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.dumb:last-child { border-bottom: 0; }
.dumb svg { width: 100%; height: 22px; display: block; overflow: visible; }
.tiers { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; overflow-x: auto; }
.tiers .col { background: var(--surface-2); border-radius: 10px; padding: 8px; min-height: 90px; }
.tiers .col h4 { margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); display: flex; justify-content: space-between; }
.tiers .pill { display: flex; justify-content: space-between; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px; margin-bottom: 5px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tiers .pill .num { font-size: 11.5px; color: var(--text-2); }
.tiers .pill.moved { border-color: var(--accent); }

/* ---------- pollster drawer ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); border-left: 1px solid var(--border); z-index: 50; transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.drawer-body { padding: 14px 16px; overflow: auto; flex: 1; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.plist { display: flex; flex-direction: column; gap: 2px; }
.plist label { display: grid; grid-template-columns: 18px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 6px; border-radius: 7px; font-size: 13px; }
.plist label:hover { background: var(--surface-2); }
.plist .cnt { color: var(--text-3); font-size: 11.5px; font-family: var(--mono); }
.toggle-row { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; font-size: 13.5px; }
.toggle-row label { display: flex; gap: 8px; align-items: center; }

/* ---------- race detail ---------- */
.race-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.cand { display: flex; flex-direction: column; gap: 2px; }
.cand.right { text-align: right; }
.cand .nm { font-weight: 700; font-size: 20px; }
.cand .pct { font-size: 30px; font-weight: 650; line-height: 1; }
.headline { text-align: center; }
.headline .big { font-size: 40px; font-weight: 700; line-height: 1; }
.headline .sub { color: var(--text-2); font-size: 12.5px; margin-top: 4px; }
.raters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.factors { display: inline-flex; gap: 4px; }
.factors b { font-weight: 500; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.meter { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--warn), var(--good) 45%, var(--good) 70%, var(--text-3)); position: relative; }
.meter i { position: absolute; top: -4px; width: 3px; height: 16px; background: var(--text); border-radius: 2px; transform: translateX(-1px); }

/* ---------- tooltip ---------- */
.tip { position: fixed; z-index: 60; background: var(--surface); color: var(--text); border: 1px solid var(--border-2); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; max-width: 280px; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.tip b { display: block; margin-bottom: 2px; } .tip .num { color: var(--text-2); }

/* feed */
.feed { display: flex; flex-direction: column; }
.feed a { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.feed a:last-child { border-bottom: 0; }
.feed .who { color: var(--text-2); font-size: 12px; grid-column: 1 / -1; }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .grid.board { grid-template-columns: 1fr; }
  .grid.four { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 639px) {
  :root { --rail: 0px; --bottom-nav: 64px; }
  .shell { grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
  .brand span:last-child { display: none; } .brand { min-width: 0; }
  .updated { display: none; }
  .topbar { padding: 0 10px; gap: 8px; }
  .seg.office button { padding: 5px 9px; font-size: 12.5px; }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: var(--bottom-nav); flex-direction: row; border-right: 0; border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); z-index: 30; }
  .rail a { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 4px 0; font-size: 10px; justify-content: center; white-space: nowrap; }
  .rail a.active { box-shadow: none; color: var(--accent); }
  .rail a .ic { font-size: 16px; }
  .main { padding: 14px 12px calc(20px + var(--bottom-nav)); }
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr 1fr; }
  .stat .value { font-size: 20px; }
  .race-head { grid-template-columns: 1fr 1fr; }
  .race-head .headline { grid-column: 1 / -1; order: -1; }
  .cand .nm { font-size: 16px; } .cand .pct { font-size: 24px; }
  .tbl.cards thead { display: none; }
  .tbl.cards tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .tbl.cards td { border: 0; padding: 0; }
  .tbl.cards td.name { grid-column: 1; } .tbl.cards td.spark-cell { grid-column: 1 / -1; }
  .tbl.cards td.hide-m { display: none; }
  .tbl.cards td.m-summary { display: block; grid-column: 1 / -1; color: var(--text-2); font-size: 12px; }
  .tbl.cards td.m-only-hide { display: none; }
  .dumb { grid-template-columns: 110px 1fr 70px; gap: 8px; }
  .tiers { grid-template-columns: repeat(7, 140px); }
  .heat td { width: 50px; min-width: 50px; }
}
@media (prefers-reduced-motion: reduce) { .tilemap .tile.pulse rect { animation: none; } .drawer, .scrim { transition: none; } }

/* ---------- TV mode ---------- */
body.tv-mode { overflow: hidden; }
body.tv-mode .topbar, body.tv-mode .rail { display: none; }
body.tv-mode .shell { grid-template-columns: 1fr; grid-template-rows: 1fr; grid-template-areas: "main"; }
body.tv-mode .main { padding: 0; max-width: none; height: 100vh; height: 100dvh; }
.tv { height: 100%; display: grid; grid-template-rows: auto 1fr auto; background: var(--bg); font-size: clamp(14px, 1.35vw, 28px); }
.tv-top { display: flex; align-items: center; gap: 2vw; padding: 1.2vh 2vw; border-bottom: 1px solid var(--border); }
.tv-brand { font-weight: 800; font-size: 1.3em; display: flex; align-items: center; gap: .6em; } .tv-sub { font-weight: 500; color: var(--text-2); }
.tv-status { margin-left: auto; color: var(--text-2); font-size: .85em; }
.tv-clock { font-family: var(--mono); font-size: 1.2em; font-weight: 600; }
.pill { display: inline-block; padding: .1em .6em; border-radius: 999px; font-weight: 800; font-size: .8em; letter-spacing: .06em; }
.pill.live { background: var(--critical); color: #fff; animation: blink 2s infinite; } .pill.replay { background: var(--warn); color: #000; } .pill.wait { background: var(--surface-2); color: var(--text-2); }
@keyframes blink { 50% { opacity: .55; } }
.tv-stage { padding: 2vh 2vw; min-height: 0; overflow: hidden; }
.tv-foot { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5vw; padding: 1vh 2vw; border-top: 1px solid var(--border); background: var(--surface); }
.tv-dots { display: flex; gap: .5em; } .tv-dots button { width: .7em; height: .7em; border-radius: 50%; background: var(--border-2); padding: 0; } .tv-dots button.on { background: var(--accent); }
.tv-ticker { overflow: hidden; white-space: nowrap; min-width: 0; padding: 0 1.5vw; mask-image: linear-gradient(90deg, transparent, #000 5%, #000 92%, transparent); }
.tv-track { display: inline-block; animation: ticker linear infinite; padding-left: 100%; font-size: .95em; }
.tv-track span { margin-right: 2.5em; } .tv-track .sep { color: var(--text-3); } .tv-track i { font-style: normal; color: var(--text-3); } .tv-track em { font-style: normal; color: var(--good); font-weight: 700; } .tv-track .call { color: var(--good); font-weight: 700; } .tv-track .lead { color: var(--warn); font-weight: 700; }
@keyframes ticker { to { transform: translateX(-100%); } }
.tv-ctl { display: flex; gap: .6em; } .tv-ctl button, .tv-ctl a { color: var(--text-3); font-size: 1em; opacity: .5; } .tv-ctl button:hover, .tv-ctl a:hover { opacity: 1; }
.tv-wait { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--text-2); gap: .5em; }
.tv-wait .big { font-size: 5em; font-weight: 800; color: var(--text); font-family: var(--mono); line-height: 1; } .tv-wait .k { font-size: 1.1em; }
.tv-wait code { background: var(--surface-2); padding: .1em .4em; border-radius: .3em; }
.closings-mini { display: grid; grid-template-columns: repeat(4, auto); gap: .4em 2em; margin-top: 2vh; font-size: .85em; text-align: left; } .closings-mini b { font-family: var(--mono); color: var(--text); margin-right: .5em; }
.panel { height: 100%; display: flex; flex-direction: column; gap: 1.5vh; min-height: 0; }
.panel h2 { font-size: 1.5em; font-weight: 800; } .panel h2 small { font-weight: 500; color: var(--text-2); font-size: .6em; margin-left: .8em; }
.legend-row { display: flex; gap: 2em; color: var(--text-2); font-size: .8em; margin-top: auto; } .sw { display: inline-block; width: 1em; height: 1em; border-radius: .2em; vertical-align: -.15em; margin-right: .4em; }
.sw.d, .bop-big .bar .d { background: var(--dem); } .sw.r, .bop-big .bar .r { background: var(--rep); }
.sw.d.base, .bop-big .bar .d.base { background: color-mix(in oklab, var(--dem) 55%, var(--bg)); } .sw.r.base, .bop-big .bar .r.base { background: color-mix(in oklab, var(--rep) 55%, var(--bg)); }
.sw.d.lead, .bop-big .bar .d.lead { background: repeating-linear-gradient(135deg, var(--dem) 0 .5em, color-mix(in oklab, var(--dem) 40%, var(--bg)) .5em 1em); }
.sw.r.lead, .bop-big .bar .r.lead { background: repeating-linear-gradient(135deg, var(--rep) 0 .5em, color-mix(in oklab, var(--rep) 40%, var(--bg)) .5em 1em); }
.sw.open, .bop-big .bar .open { background: var(--surface-2); }
.bop-big { position: relative; padding: 1vh 0 2.5vh; }
.bop-big .nums { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: .6vh; }
.bop-big .n b { font-size: 3.2em; font-weight: 800; font-family: var(--mono); line-height: 1; } .bop-big .n span { display: block; font-size: .85em; color: var(--text-2); } .bop-big .n.r { text-align: right; }
.bop-big .mid { color: var(--text-2); font-size: .95em; align-self: center; } .bop-big .mid i { font-style: normal; font-weight: 700; }
.bop-big .bar { display: flex; height: 3.2vh; border-radius: .5em; overflow: hidden; gap: 2px; background: var(--bg); } .bop-big .bar span { display: block; }
.bop-big .barwrap { position: relative; }
.bop-big .needle { position: absolute; top: -1vh; width: 3px; height: 5.2vh; background: var(--text); transform: translateX(-1px); }
.bop-big .strip { display: flex; flex-wrap: wrap; align-items: center; gap: .5em; margin-top: 1.6vh; font-size: .85em; } .bop-big .strip .lbl { color: var(--text-2); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .75em; }
.chip-tv { background: var(--surface); border: 1px solid var(--border-2); border-radius: .4em; padding: .15em .55em; font-family: var(--mono); font-weight: 700; } .chip-tv.d { border-color: var(--dem); color: var(--dem); } .chip-tv.r { border-color: var(--rep); color: var(--rep); } .chip-tv i { font-style: normal; color: var(--text-3); font-weight: 500; }
.race-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 1.2vh 1vw; flex: 1; min-height: 0; }
.rc { background: var(--surface); border: 1px solid var(--border); border-radius: .7em; padding: .7em .9em; display: flex; flex-direction: column; gap: .25em; min-height: 0; }
.rc.called.d { border-color: var(--dem); box-shadow: inset 0 0 0 1px var(--dem); } .rc.called.r { border-color: var(--rep); box-shadow: inset 0 0 0 1px var(--rep); }
.rc-h { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: .95em; }
.badge { font-size: .65em; font-weight: 800; letter-spacing: .05em; padding: .15em .5em; border-radius: .3em; background: var(--surface-2); color: var(--text-2); }
.badge.d { background: var(--dem); color: #fff; } .badge.r { background: var(--rep); color: #fff; } .badge.flip { background: var(--warn); color: #000; } .badge.wait { opacity: .6; }
.rc-row { display: grid; grid-template-columns: 1fr auto auto; gap: .6em; align-items: baseline; font-size: 1.05em; }
.rc-row .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .rc-row.d .nm { color: var(--dem); } .rc-row.r .nm { color: var(--rep); }
.rc-row .pct { font-family: var(--mono); font-weight: 800; font-size: 1.35em; } .rc-row .pct small { font-size: .55em; color: var(--text-3); } .rc-row .vt { font-family: var(--mono); color: var(--text-3); font-size: .75em; min-width: 3.5em; text-align: right; }
.rc-row.win .nm::after { content: " ✔"; }
.rc-f { margin-top: auto; display: flex; align-items: center; gap: .6em; font-size: .72em; color: var(--text-2); font-family: var(--mono); }
.rc-off { font-size: .68em; color: var(--good); font-family: var(--mono); }
.prog { flex: 1; height: .45em; background: var(--surface-2); border-radius: .3em; overflow: hidden; } .prog i { display: block; height: 100%; background: var(--text-3); }
.maps { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; gap: 2vw; } .maps .legend-row { grid-column: 1 / -1; } .mapbox { min-height: 0; display: flex; flex-direction: column; } .mapbox .tilemap { flex: 1; min-height: 0; display: flex; align-items: center; } .mapbox .tilemap svg { max-height: 100%; }
.calls table { width: 100%; border-collapse: collapse; font-size: 1em; } .calls th { text-align: left; color: var(--text-2); font-weight: 600; font-size: .75em; text-transform: uppercase; letter-spacing: .05em; padding: .3em .6em; border-bottom: 1px solid var(--border); } .calls td { padding: .35em .6em; border-bottom: 1px solid var(--border); font-family: var(--mono); } .calls td:nth-child(2), .calls td:nth-child(3) { font-family: var(--sans); }
.close-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1vh 1vw; flex: 1; }
.cg { background: var(--surface); border: 1px solid var(--border); border-radius: .7em; padding: .8em 1em; } .cg.done { opacity: .55; }
.cg .t { font-weight: 800; font-size: 1.4em; font-family: var(--mono); } .cg .cd { color: var(--text-2); font-size: .85em; margin-bottom: .4em; }
.cg .sts { display: flex; flex-wrap: wrap; gap: .3em; } .cg .sts span { font-family: var(--mono); font-size: .8em; padding: .1em .4em; border-radius: .3em; background: var(--surface-2); color: var(--text-3); } .cg .sts span.r { color: var(--text); } .cg .sts span.c { background: var(--accent); color: #fff; }
@media (max-width: 900px) { .race-grid { grid-template-columns: repeat(2, 1fr); } .maps { grid-template-columns: 1fr; } .close-grid { grid-template-columns: repeat(2, 1fr); } .closings-mini { grid-template-columns: repeat(2, auto); } }
