:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6d68;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --focus: #2a78d6;

  /* party scales, light -> dark: tilt / lean / likely / safe (same in both themes: darker = surer) */
  --d-1: #c4defa; --d-2: #81b9f3; --d-3: #0077cd; --d-4: #00477e;
  --r-1: #ffcdc5; --r-2: #ff9081; --r-3: #e61d16; --r-4: #950001;
  --i-1: #eccff3; --i-2: #d79ae6; --i-3: #a848bf; --i-4: #6f1682;
  --d-bar: #0077cd; --r-bar: #e61d16; --i-bar: #a848bf;
  --norace: #ecebe6;
  --d-ink: #0077cd; --r-ink: #e61d16; --i-ink: #a848bf;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232322;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #a3a197;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --focus: #3987e5;
    --norace: #262625;
    --d-ink: #0077cd; --r-ink: #e61d16; --i-ink: #a848bf;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232322;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #a3a197;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --focus: #3987e5;
  --norace: #262625;
  --d-ink: #0077cd; --r-ink: #e61d16; --i-ink: #a848bf;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

/* brand typeface for headings and big numbers (SIL OFL, see fonts/) */
@font-face { font-family: "Archivo"; src: url("fonts/archivo.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("fonts/archivo-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
:root { --display: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* map shapes: the outline is for keyboard focus only (a tap must never leave one), and no grey tap flash */
#map [data-race], #hexmap .hex { -webkit-tap-highlight-color: transparent; }
#map [data-race]:focus:not(:focus-visible), #hexmap .hex:focus:not(:focus-visible) { outline: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 14px; flex-wrap: wrap; }
.brandbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; padding-top: 14px; }
/* the logo's frame and slash use the text color; its slits use --logo-bg, the color behind it */
.brandbar .logo { display: inline-flex; color: var(--ink); --logo-bg: var(--surface); }
.brandbar .logo svg { height: 32px; width: auto; display: block; }
.site-nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
/* light/dark toggle (theme.js); the site opens in dark mode */
.theme-toggle { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--axis, var(--border)); background: none; color: var(--ink-2); display: inline-grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.theme-toggle:hover { color: var(--ink); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="light"] .theme-toggle .i-sun, :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
.site-nav a { color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav a[aria-current] { color: var(--ink); font-weight: 600; }
h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; word-spacing: 0.06em; }
h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.3; }
.sub { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.top-nav { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.top-nav a { color: var(--ink-2); text-decoration: none; }
.top-nav a:hover { color: var(--ink); text-decoration: underline; }

/* hero */
.hero { padding: 24px 0 8px; }
.hero-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hero-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.hero-label { font-size: 13px; color: var(--ink-2); }
.hero-num { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1.1; margin-top: 2px; }
.hero-stat[data-party="D"] .hero-num { color: var(--d-ink); }
.hero-stat[data-party="R"] .hero-num { color: var(--r-ink); }
.hero-stat[data-party="I"] .hero-num { color: var(--i-ink); }
.hero-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.control-bar { display: flex; height: 14px; border-radius: 4px; overflow: hidden; margin-top: 14px; gap: 2px; background: var(--surface); }
.control-bar span { display: block; height: 100%; transition: width .35s ease; }
.hero-foot { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }

/* controls */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 14px 16px; margin: 16px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.control { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.control-label { font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.control-val { font-size: 13px; font-variant-numeric: tabular-nums; min-width: 3.5em; color: var(--ink); }
.info { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--axis); background: none; color: var(--ink-2); font-size: 11px; line-height: 1; cursor: help; padding: 0; }
.seg { display: inline-flex; border: 1px solid var(--axis); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: none; color: var(--ink-2); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--axis); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--surface); }
.seg.small button { padding: 4px 10px; }
/* election night: the map's view switch, on its own row under the map's title so it never pushes the other tools */
.view-seg { margin: 0 0 10px; }
.view-seg[hidden] { display: none; }
.view-seg button { white-space: nowrap; }
.view-seg button:disabled { color: var(--muted); opacity: .5; cursor: not-allowed; }
@media (max-width: 560px) {
  /* four equal buttons across the card; a label may take two lines, but every button keeps the same height */
  .view-seg { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .view-seg button { white-space: normal; min-height: 42px; padding: 4px 6px; font-size: 12.5px; line-height: 1.2; }
}
input[type="range"] { width: 160px; accent-color: var(--ink); }
.reset { margin-left: auto; font: inherit; font-size: 13px; background: none; border: 1px solid var(--axis); color: var(--ink-2); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.reset:hover { color: var(--ink); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin: 16px 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.card-sub { font-size: 13px; color: var(--ink-2); }
.card-intro { font-size: 13px; color: var(--ink-2); margin: 0 0 10px; max-width: 80ch; }
.hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.check { font-size: 13px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
select { font: inherit; font-size: 13px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--ink); max-width: 100%; }

/* map */
.map-wrap { width: 100%; }
#map { width: 100%; height: auto; display: block; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#map .state { stroke: var(--surface); stroke-width: calc(1px / var(--zk, 1)); cursor: default; transition: fill .3s; }
#map .state.race { cursor: pointer; }
#map .ring { fill: none; stroke: var(--ink); stroke-width: calc(2.5px / var(--zk, 1)); stroke-linejoin: round; pointer-events: none; }
#map .zl { font-size: calc(12px / var(--zk, 1)); }
/* map zoom buttons (Senate and House maps) */
.map-tools { display: flex; gap: 10px; align-items: center; }
.zoom-ctl { display: inline-flex; border: 1px solid var(--axis); border-radius: 8px; overflow: hidden; }
.zoom-ctl button { border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 13px; padding: 4px 10px; cursor: pointer; min-width: 30px; }
.zoom-ctl button + button { border-left: 1px solid var(--axis); }
.zoom-ctl button:hover { color: var(--ink); }
.zoom-ctl[hidden] { display: none; }
/* the tile grid fills its box more than the map does, so it is drawn smaller to look the same size */
#map.tiles { max-width: 80%; margin-inline: auto; }
#map .tile rect { stroke: var(--surface); stroke-width: 2; transition: fill .3s; }
#map .tile.race { cursor: pointer; }
#map .tile.race:hover rect, #map .tile.race.hl rect { stroke: var(--ink); }
#map text { transition: fill .3s; pointer-events: none; font-size: 12px; font-weight: 600; text-anchor: middle; dominant-baseline: central; }
#map .lbl-dark { fill: #0b0b0b; }
#map .lbl-light { fill: #ffffff; }
#map .lbl-muted { fill: var(--muted); font-weight: 500; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; align-items: center; }
.legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.legend .grp { display: inline-flex; gap: 2px; align-items: center; margin-right: 4px; }
.legend .grp .sw { margin-right: 0; }
/* election night: the map's "vs. results" view */
.legend .acc-grp .sw { width: 18px; }
.legend .acc-sum { flex-basis: 100%; color: var(--ink); }
.tt-live .acc-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }

/* tooltip */
.tooltip { position: fixed; z-index: 30; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 10px; padding: 12px 14px; width: 300px; max-width: calc(100vw - 24px); font-size: 13px; }
.tt-title { font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.tt-rating { font-weight: 600; font-size: 12px; }
.tt-cands { margin: 8px 0 6px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.tt-cands .pct { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.tt-bar { display: flex; height: 8px; border-radius: 3px; overflow: hidden; gap: 2px; margin: 4px 0 8px; }
.tt-row { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-2); font-size: 12.5px; }
.tt-row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.tt-news { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--ink-2); font-size: 12px; }
.tt-foot { margin-top: 6px; color: var(--muted); font-size: 11.5px; }
/* a tapped tooltip stays open with a button for the detail panel */
.tooltip.pinned { pointer-events: auto; }
.tt-more { display: block; width: 100%; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.tt-more::after { content: " →"; }

/* tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-2); padding: 6px 8px; border-bottom: 1px solid var(--axis); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.race-table tbody tr { cursor: pointer; }
.race-table tbody tr:hover { background: var(--surface-2); }
.race-table td:first-child { font-weight: 600; white-space: nowrap; }
.matchup { white-space: nowrap; }
.matchup .vs { color: var(--muted); margin: 0 4px; }
.w-bar { min-width: 170px; }
.pbar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; gap: 2px; position: relative; min-width: 150px; }
.pbar span { display: flex; align-items: center; font-size: 11.5px; font-weight: 700; padding: 0 5px; white-space: nowrap; overflow: hidden; }
.pbar .l { justify-content: flex-start; }
.pbar .r { justify-content: flex-end; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 10px; white-space: nowrap; border: 1px solid currentColor; }
.d-ink { color: var(--d-ink); } .r-ink { color: var(--r-ink); } .i-ink { color: var(--i-ink); } .t-ink { color: var(--ink-2); }
.latest-table tbody tr { cursor: pointer; }
.latest-table tbody tr:hover { background: var(--surface-2); }
.latest-table td { white-space: nowrap; }
.new-badge { font-size: 10.5px; font-weight: 700; color: var(--surface); background: var(--ink); border-radius: 4px; padding: 1px 5px; margin-left: 6px; }
.m-lab { display: none; }   /* labels the phone layouts of the tables show in place of column headers */
.pollster-table th[data-k] { cursor: pointer; user-select: none; }
.pollster-table th[aria-sort="ascending"]::after { content: " ▲"; font-size: 9px; }
.pollster-table th[aria-sort="descending"]::after { content: " ▼"; font-size: 9px; }
.grade { font-weight: 700; }

/* charts */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--axis); }
.chart .tick-label { fill: var(--muted); font-size: 11px; }
.chart .annot { fill: var(--ink-2); font-size: 11.5px; }
.chart-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.chart-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* dialog */
/* dvh = the height actually visible right now (phone browsers' address bars grow and shrink; vh ignores that) */
dialog { border: 0; padding: 0; border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; }
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.detail-inner { padding: 20px; position: relative; }
/* the close button stays pinned at the top of the panel while its content scrolls */
.close { position: sticky; top: 10px; float: right; margin: -10px -8px 0 8px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--axis); background: var(--surface); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.d-head { padding-right: 40px; }
.d-head h2 { font-size: 22px; }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.d-box { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.d-box h3 { margin: 0 0 8px; font-size: 14px; }
/* detail panel: the projected margin, the panel's headline number */
.proj { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.proj-k { width: 100%; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.proj-v { font-family: var(--display); font-weight: 800; font-size: 38px; line-height: 1.05; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.proj-r { font-size: 12.5px; color: var(--muted); }
.steps { width: 100%; font-size: 13px; }
.steps td { padding: 5px 6px; }
.steps td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.steps tr.total td { border-top: 1px solid var(--axis); font-weight: 700; }
.steps .why { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; background: var(--surface-2); }
.chip b { font-weight: 600; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { padding: 6px 0; border-bottom: 1px solid var(--grid); font-size: 13px; }
.news-list .src { color: var(--muted); font-size: 11.5px; display: block; }
.polls-table td, .polls-table th { padding: 5px 6px; font-size: 12.5px; }
.tag { font-size: 10.5px; color: var(--muted); border: 1px solid var(--axis); border-radius: 4px; padding: 0 3px; margin-left: 4px; }
.wbar { display: inline-block; height: 8px; background: var(--ink-2); border-radius: 2px; vertical-align: middle; margin-right: 6px; opacity: .7; }

.method { font-size: 14px; }
.method h3 { font-size: 15px; margin: 18px 0 6px; }
.method p, .method li { color: var(--ink-2); max-width: 82ch; }
.method .stat-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.method .stat { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; min-width: 140px; }
.method .stat .v { font-size: 20px; font-weight: 700; color: var(--ink); }
.method .stat .k { font-size: 12px; color: var(--muted); }

.site-footer { font-size: 12px; color: var(--muted); padding-top: 8px; padding-bottom: 32px; }

@media (max-width: 720px) {
  h1 { font-size: 22px; }
  #map.tiles { max-width: 100%; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
  .hero-num { font-size: 30px; }
  .hero-note { width: 100%; }
  .reset { margin-left: 0; }
  .d-grid { grid-template-columns: 1fr; }
  input[type="range"] { width: 130px; }
  /* the market-weight slider: label on its own line, then the slider across the card with its value */
  .control:has(input[type="range"]) { width: 100%; }
  .control:has(input[type="range"]) .control-label { flex-basis: 100%; }
  .control input[type="range"] { flex: 1; width: auto; min-width: 0; }
  .detail-inner { padding: 16px; }
  /* latest polls on a phone: three short lines per poll, no sideways scrolling
     1: race · result · adjusted margin (right)   2: pollster · raw margin (right)   3: dates · sample · added */
  .latest-table, .latest-table tbody { display: block; }
  .latest-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .latest-table tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 3px; padding: 10px 2px; border-bottom: 1px solid var(--grid); }
  .latest-table tbody tr::before, .latest-table tbody tr::after { content: ""; flex-basis: 100%; height: 0; }
  .latest-table tbody tr::before { order: 4; }
  .latest-table tbody tr::after { order: 7; }
  .latest-table td { display: block; padding: 0; border: 0; white-space: nowrap; text-align: left; }
  .latest-table td[colspan] { flex-basis: 100%; white-space: normal; }
  .latest-table .lp-race { order: 1; }
  .latest-table .lp-race .tag { display: none; }   /* 2026's specials are each their state's only race */
  .latest-table .lp-res { order: 2; }
  .latest-table .lp-adj { order: 3; margin-left: auto; font-weight: 700; font-size: 14.5px; }
  .latest-table .lp-adj .m-lab { font-weight: 400; }
  .latest-table .lp-poll, .latest-table .lp-dates, .latest-table .lp-n, .latest-table .lp-raw, .latest-table .lp-added { font-size: 12px; color: var(--muted); }
  .latest-table .lp-poll { order: 5; flex: 1 1 0; min-width: 0; white-space: normal; color: var(--ink-2); }
  .latest-table .lp-raw { order: 6; margin-left: auto; }
  .latest-table .lp-dates { order: 8; }
  .latest-table .lp-n { order: 9; }
  .latest-table .lp-added { order: 10; }
  .latest-table .lp-empty { display: none; }
  .latest-table .m-lab { display: inline; color: var(--muted); font-size: 12px; }
  .latest-table .lp-n::before, .latest-table .lp-added::before { content: "·"; margin-right: 10px; }

  /* races and pollsters on a phone: the same idea, three short lines each */
  .race-table, .race-table tbody, .pollster-table, .pollster-table tbody { display: block; }
  .race-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .race-table tbody tr, .pollster-table tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 5px; padding: 10px 2px; border-bottom: 1px solid var(--grid); }
  .race-table td, .pollster-table td { display: block; padding: 0; border: 0; white-space: nowrap; text-align: left; }
  .race-table td[colspan], .pollster-table td[colspan] { flex-basis: 100%; white-space: normal; }
  .race-table .m-lab, .pollster-table .m-lab { display: inline; color: var(--muted); font-size: 12px; }
  /* race: 1 state · matchup · rating (right)   2 chance bar   3 projected · polls · markets (· experts) */
  .race-table .rt-st { order: 1; font-weight: 600; }
  .race-table .rt-st .who { display: inline; margin-left: 6px; }
  .race-table .rt-st .tag { display: none; }   /* 2026's specials are each their state's only race */
  .race-table .rt-mu { order: 2; flex: 1 1 0; min-width: 0; white-space: normal; }
  .race-table .rt-mu > span { display: inline-block; }   /* the names have no spaces between them: let each wrap as a unit */
  .race-table .rt-rate { order: 3; margin-left: auto; }
  .race-table .rt-bar { order: 4; flex-basis: 100%; }
  .race-table .rt-bar .pbar { min-width: 0; }
  .race-table .rt-proj, .race-table .rt-poll, .race-table .rt-mkt, .race-table .rt-exp { font-size: 12.5px; color: var(--ink-2); }
  .race-table .rt-proj { order: 5; }
  .race-table .rt-poll { order: 6; }
  .race-table .rt-mkt { order: 7; }
  .race-table .rt-exp { order: 8; flex-basis: 100%; white-space: normal; }
  .race-table .rt-poll::before, .race-table .rt-mkt::before { content: "·"; margin-right: 8px; color: var(--muted); }
  .race-table .rt-proj, .race-table .rt-poll, .race-table .rt-mkt { margin-right: -2px; }
  /* pollster: 1 name · grade · weight (right)   2 polls rated · avg. error · vs field   3 past lean · 2026 lean · 2026 polls */
  .pollster-table tbody tr::before, .pollster-table tbody tr::after { content: ""; flex-basis: 100%; height: 0; }
  .pollster-table tbody tr::before { order: 4; }
  .pollster-table tbody tr::after { order: 8; }
  .pollster-table .pt-name { order: 1; flex: 1 1 0; min-width: 0; white-space: normal; font-weight: 600; }
  .pollster-table .pt-grade { order: 2; }
  .pollster-table .pt-w { order: 3; margin-left: auto; font-weight: 600; }
  .pollster-table .pt-n, .pollster-table .pt-err, .pollster-table .pt-pm, .pollster-table .pt-hh, .pollster-table .pt-h26, .pollster-table .pt-n26 { font-size: 12.5px; color: var(--ink-2); }
  .pollster-table .pt-n { order: 5; } .pollster-table .pt-err { order: 6; } .pollster-table .pt-pm { order: 7; }
  .pollster-table .pt-hh { order: 9; } .pollster-table .pt-h26 { order: 10; } .pollster-table .pt-n26 { order: 11; }
  .pollster-table .pt-n26 { margin-left: -6px; }   /* "(17 polls)" sits right after the 2026 lean */
  .pollster-table .pt-err::before, .pollster-table .pt-pm::before, .pollster-table .pt-h26::before { content: "·"; margin-right: 10px; color: var(--muted); }
  /* the column headers stay as a row of sort buttons */
  .pollster-table thead { display: block; }
  .pollster-table thead tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--axis); }
  .pollster-table thead tr::before { content: "Sort by"; font-size: 12px; color: var(--muted); margin-right: 2px; }
  .pollster-table th { display: block; border: 1px solid var(--axis); border-radius: 14px; padding: 4px 10px; font-size: 12px; }
  .pollster-table th[aria-sort] { background: var(--surface-2); color: var(--ink); }
}
@media (max-width: 720px) {
  /* a race's polls (and House fundraising) in the detail panel, phone layout
     polls   1: pollster · grade · adjusted margin (right)   2: end date · sample · result (raw margin) · weight (right)
     money   1: candidate · through (right)                   2: raised · cash on hand · self-funded */
  .polls-table, .polls-table tbody { display: block; }
  .polls-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .polls-table tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 7px; row-gap: 3px; padding: 9px 2px; border-bottom: 1px solid var(--grid); }
  .polls-table tbody tr::before { content: ""; flex-basis: 100%; height: 0; order: 4; }
  .polls-table td { display: block; padding: 0; border: 0; white-space: nowrap; text-align: left; }
  .polls-table .m-lab { display: inline; color: var(--muted); font-size: 12px; font-weight: 400; }
  .polls-table .dp-poll { order: 1; flex: 1 1 0; min-width: 0; white-space: normal; font-weight: 600; }
  .polls-table .dp-grade { order: 2; font-size: 12.5px; }
  .polls-table .dp-adj { order: 3; margin-left: auto; font-weight: 700; font-size: 14px; }
  .polls-table .dp-end, .polls-table .dp-n, .polls-table .dp-res, .polls-table .dp-w { font-size: 12px; color: var(--muted); }
  .polls-table .dp-end { order: 5; } .polls-table .dp-n { order: 6; } .polls-table .dp-res { order: 7; } .polls-table .dp-w { order: 9; margin-left: auto; }
  .polls-table .dp-raw { order: 8; font-size: 12px; color: var(--muted); margin-left: -3px; }
  .polls-table .dp-raw::before { content: "("; } .polls-table .dp-raw::after { content: ")"; }
  .polls-table .dp-n::before, .polls-table .dp-res::before { content: "·"; margin-right: 7px; }
  .polls-table .wbar { max-width: 24px; margin-right: 4px; }
  .money-table .mt-name { order: 1; flex: 1 1 0; min-width: 0; white-space: normal; font-weight: 600; }
  .money-table .mt-thru { order: 2; margin-left: auto; font-size: 12px; color: var(--muted); }
  .money-table .mt-raised, .money-table .mt-cash, .money-table .mt-self { font-size: 13px; }
  .money-table .mt-raised { order: 5; } .money-table .mt-cash { order: 6; } .money-table .mt-self { order: 7; }
  .money-table .mt-none { display: none; }
  .money-table .mt-cash::before, .money-table .mt-self::before { content: "·"; margin-right: 7px; color: var(--muted); }
}

/* election night: a pulsing red dot while results are coming in (shared/web/live.js) */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e61d16; vertical-align: 1px; animation: live-pulse 1.4s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(230, 29, 22, .55); } 50% { opacity: .55; box-shadow: 0 0 0 5px rgba(230, 29, 22, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
/* the "Live results" strip under each forecast page's title, and results in tables, tooltips and the detail panel */
.live-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.live-bar b { color: #e61d16; }
/* election night: a slim bar above the map while the first batch of results loads */
.live-loading { margin: 0 0 10px; }
.live-loading[hidden] { display: none; }
.ll-track { position: relative; height: 3px; border-radius: 2px; background: var(--grid); overflow: hidden; }
.ll-track span { position: absolute; top: 0; left: -35%; width: 35%; height: 100%; border-radius: 2px; background: #e61d16; animation: ll-slide 1.3s ease-in-out infinite; }
@keyframes ll-slide { to { left: 100%; } }
.ll-text { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .ll-track span { animation: none; left: 0; width: 100%; opacity: .5; } }
.live-dot.is-waiting { background: none; border: 2px solid #e61d16; animation: none; box-sizing: border-box; }
.live-bar .live-src { color: var(--muted); }
.live-bar .live-src a { color: inherit; }
.live-bar .live-err { color: var(--r-ink); }
.live-res { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; white-space: nowrap; }
.live-res b { font-weight: 600; }
.live-box { margin-bottom: 16px; }
.live-box table { width: 100%; font-size: 14px; }
.live-box td { padding: 5px 6px; }
.live-box td.num { text-align: right; font-variant-numeric: tabular-nums; }
.live-box .won { font-weight: 700; }
.won-mark { color: var(--ink); font-weight: 800; }
.tt-live { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--grid); font-size: 12.5px; }
/* the hover card's vote count: candidate · votes · share, then the total and margin */
.tt-live-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.tt-live-head span { color: var(--ink-2); }
.tt-vote { display: grid; grid-template-columns: 1fr auto 3.4em; gap: 10px; align-items: baseline; font-size: 14px; line-height: 1.5; }
.tt-vote > b, .tt-vote > span:last-child { font-variant-numeric: tabular-nums; text-align: right; }
.tt-vote > span:last-child { color: var(--ink-2); font-size: 12.5px; }
/* the total row's margin ("D+12") in its party's color */
.tt-vote.tt-vtot > span:last-child { font-size: 13px; font-weight: 700; color: var(--ink); }
.tt-vtot { font-size: 12.5px; color: var(--muted); }
.tt-vote.tt-vtot b { font-weight: 600; }
/* results sit at the top of the hover card on election night; the chances get a label below them */
.tt-title + .tt-live { margin-top: 2px; }
.tt-sub { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--grid); font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Line breaks: headings and short text split into even lines; paragraphs avoid a lone last word (STANDARDS: line breaks) */
h1, h2, h3, h4, .kicker, .intro, .lede, .sub, .view-caption, figcaption, dt, th, button, .callout b { text-wrap: balance; }
p, li, dd, td, .note { text-wrap: pretty; }
.intro, .lede, .view-caption { text-wrap: balance; }
