/* Nijinn elections tracker v2.0.1. Tokens mirror nijinn.io (css/style.css). */
/* Fonts are self-hosted: scripts/fetch-fonts.mjs vendors the files from Google Fonts, and
   scripts/check-fonts.js verifies them against src/lib/fonts.lock.json. The build rewrites the
   URLs below with a content hash, so the preload in the head and this stylesheet ask for the same
   URL. Never edit a face by hand: edit src/lib/fonts.js, then run npm run fonts:fetch. */
/* fonts:start */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/Inter-Variable.woff2?v=3100e775e8') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('fonts/JetBrainsMono-Variable.woff2?v=18be452724') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 100 1000; font-display: swap; src: url('fonts/DMSans-Variable.woff2?v=9fea608a94') format('woff2'); }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 200 700; font-display: swap; src: url('fonts/Oswald-Variable.woff2?v=bd73278ee0') format('woff2'); }
/* fonts:end */

:root {
  color-scheme: light;
  --bg-primary: #FFFFFF;
  --bg-surface: #FAFAFA;
  --bg-raised: #F3F4F6;
  --text-primary: #1A1A1A;
  --text-secondary: #6B7280;
  --text-tertiary: #6B7280;
  --border-default: #E5E7EB;
  --green-25: #F5FCF8;
  --green-50: #E6F9F0;
  --green-100: #A7F3D0;
  --green-500: #059669;
  --green-600: #047857;
  --green-700: #065F46;
  --chart-ti: #059669;
  --chart-poly: #6366F1;
  --chart-kalshi: #F59E0B;
  --party-d: #2F5FD0;
  --party-r: #C8363B;
  --tile-even: #ECEDEF;
  --tile-none: #F3F4F6;
  --font-ui: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, monospace;
  --font-display: 'DM Sans', system-ui, sans-serif;
  --content-max: 1280px;
  --nav-height: 56px;
  --radius-card: 6px;
  --radius-chip: 4px;
  --hair: 0.5px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: var(--nav-height); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-ui); font-size: 14px; line-height: 1.6;
  color: var(--text-primary); background: var(--bg-primary);
  font-feature-settings: "ss01", "cv05", "cv11";
}
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }

/* Header (dark frame, as nijinn.io) */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; height: var(--nav-height);
  background: rgba(10, 10, 10, 0.97);
  border-bottom: var(--hair) solid rgba(255, 255, 255, 0.12);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; flex: none; }
.brand img { height: 26px; width: auto; display: block; }
.brand .sect { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.62); border-left: 1px solid rgba(255,255,255,0.2); padding-left: 12px; }
.site-nav { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { color: rgba(255,255,255,0.62); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; padding: 6px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--green-500); }

/* Layout */
main { display: block; }
.wrap { max-width: var(--content-max); margin: 0 auto; padding-inline: 24px; }
.band { padding-block: 40px; border-top: var(--hair) solid var(--border-default); }
.band.tint { background: var(--green-25); }
.band:first-child { border-top: 0; }
.eyebrow { display: inline-block; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-tertiary); margin: 0 0 12px; }
.eyebrow.tag { background: var(--green-50); color: var(--green-700); padding: 3px 8px; border-radius: var(--radius-chip); }
h1 { font-family: var(--font-ui); font-size: clamp(28px, 4.4vw, 44px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.12; margin: 0 0 12px; text-wrap: balance; }
h2 { font-size: clamp(19px, 2.4vw, 24px); font-weight: 500; letter-spacing: -0.012em; line-height: 1.25; margin: 0 0 16px; text-wrap: balance; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.lede { font-size: 16px; line-height: 1.6; color: var(--text-secondary); max-width: 64ch; margin: 0; }
.muted { color: var(--text-secondary); }
.small { font-size: 12px; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.crumbs { font-size: 12px; color: var(--text-secondary); margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 32px; }
.stamp { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); letter-spacing: 0.02em; }

/* Countdown */
.countdown { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-mono); }
.countdown .n { font-size: 40px; font-weight: 500; color: var(--text-primary); line-height: 1; }
.countdown .u { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .grid-3, .split { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } .wrap { padding-inline: 16px; } .site-header { padding: 0 16px; } .brand .sect { display: none; } }

/* Cards */
.card { border: var(--hair) solid var(--border-default); border-radius: var(--radius-card); background: var(--bg-primary); padding: 20px; display: grid; gap: 12px; align-content: start; }
.card a.more { font-size: 13px; color: var(--green-600); text-decoration: none; font-weight: 500; }
.card a.more:hover { text-decoration: underline; }

/* Control card */
.ctl-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ctl-title h3 { margin: 0; font-size: 14px; font-weight: 600; }
.ctl-bar { display: flex; height: 10px; border-radius: 2px; overflow: hidden; background: var(--tile-even); }
.ctl-bar .d { background: var(--party-d); }
.ctl-bar .r { background: var(--party-r); }
.ctl-sides { display: flex; justify-content: space-between; gap: 12px; }
.side .who { font-size: 12px; color: var(--text-secondary); }
.side .val { font-family: var(--font-mono); font-size: 30px; line-height: 1.1; font-weight: 500; }
.side.d .val { color: var(--party-d); }
.side.r .val { color: var(--party-r); text-align: right; }
.side.r { text-align: right; }
.venue-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-secondary); }
.venue-row .mono { color: var(--text-primary); }

/* Headline probability on race pages */
.headline-prob { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; }
.headline-prob .big { font-family: var(--font-mono); font-size: clamp(40px, 6vw, 56px); font-weight: 500; line-height: 1; }
.headline-prob .who { font-size: 18px; font-weight: 500; }
.ti-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green-700); background: var(--green-50); border-radius: var(--radius-chip); padding: 3px 8px; text-decoration: none; }
.kv { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.kv div { display: grid; gap: 2px; }
.kv dt { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-mono); }
.kv dd { margin: 0; font-family: var(--font-mono); font-size: 15px; font-variant-numeric: tabular-nums; }

/* Party marks */
.pty { display: inline-block; min-width: 18px; text-align: center; font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: #fff; border-radius: 2px; padding: 1px 4px; margin-right: 6px; vertical-align: 1px; background: var(--text-tertiary); }
.pty.D { background: var(--party-d); }
.pty.R { background: var(--party-r); }
.pty.I, .pty.L, .pty.G { background: #6B7280; }

/* Tables */
.table-wrap { overflow-x: auto; border: var(--hair) solid var(--border-default); border-radius: var(--radius-card); background: var(--bg-primary); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: var(--hair) solid var(--border-default); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); background: var(--bg-surface); white-space: nowrap; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--text-primary); }
th[aria-sort="ascending"]::after { content: " ▲"; }
th[aria-sort="descending"]::after { content: " ▼"; }
td.n, th.n { text-align: right; white-space: nowrap; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
td.ti { font-weight: 600; color: var(--text-primary); }
td a { text-decoration: none; font-weight: 500; }
td a:hover { text-decoration: underline; }
tbody tr:hover { background: var(--green-25); }
.up, .down { color: var(--text-primary); }
/* Movement is shown with an arrow in neutral ink: red and blue stay for the parties */
.up::before, .down::before { font-size: 0.8em; margin-right: 2px; color: var(--text-tertiary); }
.up::before { content: "▲"; } .down::before { content: "▼"; }
.bar-cell { width: 120px; }
.pbar { position: relative; height: 8px; border-radius: 2px; background: var(--tile-even); overflow: hidden; min-width: 90px; }
.pbar i { position: absolute; top: 0; bottom: 0; left: 0; }
.pbar i.D { background: var(--party-d); }
.pbar i.R { background: var(--party-r); }
.pbar i.N { background: var(--text-secondary); }
.spark { display: block; }
.spark polyline { fill: none; stroke: var(--chart-ti); stroke-width: 1.5; }
.single { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); letter-spacing: 0.04em; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin: 0 0 14px; }
.filters label { display: grid; gap: 4px; font-size: 11px; color: var(--text-secondary); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.filters input, .filters select { font: 13px var(--font-ui); color: var(--text-primary); background: var(--bg-primary); border: var(--hair) solid #D1D5DB; border-radius: var(--radius-chip); padding: 7px 10px; min-width: 0; }
.filters input[type="search"] { width: 240px; max-width: 100%; }
.filters .count { font-size: 12px; color: var(--text-secondary); padding-bottom: 8px; }

/* Charts */
.chart { margin: 0; max-width: 980px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border-default); stroke-width: 1; }
.chart .tick { fill: var(--text-tertiary); font: 10px var(--font-mono); }
.chart path { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart .l-ti { stroke: var(--chart-ti); stroke-width: 2.5; }
.chart .l-poly { stroke: var(--chart-poly); stroke-width: 1.25; opacity: 0.85; }
.chart .l-kalshi { stroke: var(--chart-kalshi); stroke-width: 1.25; opacity: 0.9; }
.chart .dot-ti { fill: var(--chart-ti); stroke: #fff; stroke-width: 1.5; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.legend .k::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }
.legend .k-ti::before { background: var(--chart-ti); height: 4px; }
.legend .k-poly::before { background: var(--chart-poly); }
.legend .k-kalshi::before { background: var(--chart-kalshi); }
.chart-empty { color: var(--text-secondary); font-size: 13px; margin: 0; }

/* Tile map */
.tilemap { margin: 0; max-width: 560px; }
.tilemap svg { width: 100%; height: auto; display: block; }
.tile rect { stroke: var(--bg-primary); stroke-width: 1; }
.tile.off rect { fill: var(--tile-none); }
.tile text { font: 600 11px var(--font-mono); text-anchor: middle; fill: var(--text-primary); pointer-events: none; }
.tile .v { font-weight: 400; font-size: 9.5px; }
.tile.off text { fill: #C4C8CE; font-weight: 500; }
.tile.strong text { fill: #fff; }
a:hover .tile.on rect, a:focus-visible .tile.on rect { stroke: var(--text-primary); stroke-width: 2; }
.scale { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text-secondary); margin-top: 8px; }
.scale .bar { flex: 1; max-width: 200px; height: 6px; border-radius: 2px; background: linear-gradient(90deg, var(--party-r), var(--tile-even), var(--party-d)); }

/* Venue panels and rules */
.venue h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.venue .rules { font-size: 13px; color: var(--text-secondary); line-height: 1.55; max-height: 12.5em; overflow: auto; border-left: 2px solid var(--border-default); padding-left: 12px; margin: 0; }
.btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; text-decoration: none; border-radius: var(--radius-chip); padding: 8px 14px; border: var(--hair) solid #D1D5DB; color: var(--text-primary); background: var(--bg-primary); cursor: pointer; font-family: var(--font-ui); }
.btn:hover { border-color: var(--text-primary); }
.btn.primary { background: #0A0A0A; color: #fff; border-color: #0A0A0A; }
.btn.primary:hover { background: #262626; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Lists */
.rank { list-style: none; margin: 0; padding: 0; display: grid; }
.rank li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-bottom: var(--hair) solid var(--border-default); }
.rank li:last-child { border-bottom: 0; }
.rank a { text-decoration: none; font-weight: 500; }
.rank a:hover { text-decoration: underline; }
.rank .meta { grid-column: 1 / -1; font-size: 12px; color: var(--text-secondary); font-family: var(--font-mono); }

.prose { max-width: 70ch; }
.prose p, .prose li { font-size: 15px; line-height: 1.7; }
.prose h2 { margin-top: 32px; }
.formula { font-family: var(--font-mono); font-size: 14px; background: var(--bg-surface); border: var(--hair) solid var(--border-default); border-radius: var(--radius-card); padding: 14px 16px; overflow-x: auto; white-space: nowrap; }
.cite { font-family: var(--font-mono); font-size: 12.5px; background: var(--bg-surface); border: var(--hair) solid var(--border-default); border-radius: var(--radius-card); padding: 12px 14px; overflow-wrap: anywhere; }

/* Footer */
.site-footer { border-top: var(--hair) solid var(--border-default); padding-block: 40px 56px; margin-top: 24px; }
.site-footer .cols { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; }
.site-footer img { height: 28px; width: auto; display: block; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; }
.site-footer nav a { text-decoration: none; color: var(--text-secondary); }
.site-footer nav a:hover { color: var(--text-primary); }
.site-footer .fine { font-size: 12px; color: var(--text-tertiary); margin: 16px 0 0; max-width: 80ch; }
.site-footer .fine-asof { margin-top: 8px; }

/* Live board */
.live-state { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; }
.live-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); }
.live-state.stale::before { background: var(--text-tertiary); }
tr.flash td { animation: flash 1.4s ease-out; }
@keyframes flash { from { background: var(--green-50); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { tr.flash td { animation: none; } }

/* Venue not counted in the TruthIndex for this outcome */
.nc { color: var(--text-tertiary); text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
/* Spread emphasis */
.th-spread { color: var(--green-700) !important; }
.spread { font-weight: 600; }
.spread.gap { background: var(--green-50); color: var(--green-700); border-radius: var(--radius-chip); padding: 2px 6px; }
.explainer { font-size: 14px; line-height: 1.6; color: var(--text-secondary); max-width: 70ch; margin: 12px 0 0; }
.explainer a { color: var(--green-600); }
.brandline { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; font-weight: 500; }
.brandline img { height: 20px; width: auto; display: block; }
.ti-chip.muted-chip { background: var(--bg-raised); color: var(--text-secondary); }

/* Product names keep their authored casing */
.keep { text-transform: none; letter-spacing: 0.02em; }
.ti-chip { text-transform: none; letter-spacing: 0.02em; }

/* Geographic map */
:root { --map-none: #F1F2F4; }
.usmap { margin: 0; max-width: 980px; }
.usmap svg { width: 100%; height: auto; display: block; }
.usmap .st path, .usmap .st rect { stroke: #FFFFFF; stroke-width: 0.8; transition: filter 120ms ease; }
.usmap .borders { fill: none; stroke: #FFFFFF; stroke-width: 1; stroke-linejoin: round; pointer-events: none; }
.usmap a.st:hover path, .usmap a.st:hover rect, .usmap a.st:focus-visible path, .usmap a.st:focus-visible rect { filter: brightness(0.9); stroke: var(--text-primary); stroke-width: 1.5; }
.usmap .lb { font: 700 12px var(--font-mono); text-anchor: middle; fill: var(--text-primary); pointer-events: none; }
.usmap .lb.v { font-weight: 500; font-size: 10.5px; }
.usmap .lb.off { fill: #6B7280; font-weight: 600; font-size: 11px; }
.usmap .lb.strong { fill: #FFFFFF; }
.usmap .lb.bx { text-anchor: start; font-size: 11.5px; }
.usmap .lb.bx.v { text-anchor: end; font-size: 10.5px; }
.scale .none-key { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; }
.scale .none-key i { width: 12px; height: 12px; border-radius: 2px; background: var(--map-none); border: 0.5px solid var(--border-default); display: inline-block; }
.map-split { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 1000px) { .map-split { grid-template-columns: 1fr; } }
:root { --party-o: #7A5AC8; }
.scale .none-key i.o { background: var(--party-o); border-color: var(--party-o); }

/* Race ratings */
:root {
  --r-safe-D: #163A9A; --r-likely-D: #3B66C4; --r-lean-D: #B7C9F2; --r-lean-D-line: #7F9FE6;
  --r-tossup: #F2C14E;
  --r-lean-R: #F2BDBD; --r-lean-R-line: #E58A8A; --r-likely-R: #C0444A; --r-safe-R: #8E1B21;
  --r-other: #7A5AC8;
}
.ratings-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-secondary); margin-top: 10px; }
.ratings-key .rk { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ratings-key .rk i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; border: 0.5px solid rgba(0,0,0,0.06); }
.ratings-key .rk b { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }

/* Headline sentence */
.headline { font-size: clamp(22px, 3vw, 30px); font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; margin: 10px 0 2px; text-wrap: balance; }
.headline .hp.D { color: var(--party-d); }
.headline .hp.R { color: var(--party-r); }
.headline-sub { font-size: 12px; color: var(--text-secondary); margin: 0 0 6px; }

/* Rating chip */
.rchip { display: inline-block; font-size: 11px; font-weight: 600; border-radius: var(--radius-chip); padding: 2px 7px; white-space: nowrap; vertical-align: 1px; margin-left: 6px; }
td .rchip { margin-left: 0; }
.rchip.r-safe-D { background: var(--r-safe-D); color: #fff; }
.rchip.r-likely-D { background: var(--r-likely-D); color: #fff; }
.rchip.r-lean-D { background: var(--r-lean-D); color: #1E3A8A; }
.rchip.r-tossup { background: var(--r-tossup); color: #5C4300; }
.rchip.r-lean-R { background: var(--r-lean-R); color: #7F1D1D; }
.rchip.r-likely-R { background: var(--r-likely-R); color: #fff; }
.rchip.r-safe-R { background: var(--r-safe-R); color: #fff; }
.rchip.r-other { background: var(--r-other); color: #fff; }

/* Seat projection bar */
.seatbar { display: grid; gap: 8px; }
.sb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sb-n { font-family: var(--font-mono); font-size: 30px; font-weight: 500; line-height: 1; }
.sb-n.D { color: var(--party-d); } .sb-n.R { color: var(--party-r); }
.sb-who { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-mono); }
.sb-mid { font-size: 12px; color: #8A6500; font-family: var(--font-mono); }
.sb-bar { position: relative; display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: var(--tile-even); }
.sb-seg { display: block; height: 100%; }
.s-not-D { background: #102E78; } .s-not-R { background: #6E1218; }
.s-safe-D { background: var(--r-safe-D); } .s-likely-D { background: var(--r-likely-D); } .s-lean-D { background: var(--r-lean-D); }
.s-tossup { background: var(--r-tossup); } .s-other { background: var(--r-other); } .s-none { background: var(--map-none); }
.s-lean-R { background: var(--r-lean-R); } .s-likely-R { background: var(--r-likely-R); } .s-safe-R { background: var(--r-safe-R); }
.sb-maj { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text-primary); }
.sb-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Seat dots */
.seatdots { margin: 14px 0 0; }
.seatdots svg { width: 100%; height: auto; display: block; }
.seatdots .dot { stroke: none; }
.seatdots a:hover .dot { stroke: var(--text-primary); stroke-width: 2; }
.d-not-D { fill: #102E78; opacity: 0.45; } .d-not-R { fill: #6E1218; opacity: 0.45; }
.d-safe-D { fill: var(--r-safe-D); } .d-likely-D { fill: var(--r-likely-D); } .d-lean-D { fill: var(--r-lean-D); }
.d-tossup { fill: var(--r-tossup); } .d-other { fill: var(--r-other); } .d-none { fill: var(--map-none); }
.d-lean-R { fill: var(--r-lean-R); } .d-likely-R { fill: var(--r-likely-R); } .d-safe-R { fill: var(--r-safe-R); }
.seatdots .maj { stroke: var(--text-primary); stroke-width: 1.5; stroke-dasharray: 3 3; }
.seatdots .maj-t { font: 600 10px var(--font-mono); fill: var(--text-primary); text-anchor: middle; }

/* Race cards */
a.racecard { text-decoration: none; color: inherit; transition: border-color 120ms ease; }
a.racecard:hover { border-color: var(--text-primary); }
.rc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rc-title { font-weight: 600; font-size: 14px; }
.rc-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rc-k { font: 500 10px var(--font-mono); letter-spacing: 0.06em; color: var(--text-tertiary); margin: 8px 0 -6px; }
.rc-side.r { text-align: right; }
.rc-name { font-size: 13px; }
.rc-p { font-family: var(--font-mono); font-size: 26px; font-weight: 500; line-height: 1.1; }
.rc-p.D { color: var(--party-d); } .rc-p.R { color: var(--party-r); }
.rc-bar { display: flex; height: 6px; border-radius: 2px; overflow: hidden; background: var(--tile-even); }
.rc-bar span.D { background: var(--party-d); } .rc-bar span.R { background: var(--party-r); } .rc-bar span.N, .rc-bar span.I { background: var(--text-secondary); }
.rc-bar span:last-child { margin-left: auto; }
.rc-foot { color: var(--text-secondary); }
.rc-foot b { color: var(--green-700); }

/* Search */
.searchbox { position: relative; max-width: 560px; margin: 18px 0 0; }
.searchbox input { width: 100%; font: 15px var(--font-ui); padding: 11px 14px; border: var(--hair) solid #C9CDD3; border-radius: var(--radius-card); background: var(--bg-primary); color: var(--text-primary); }
.sr-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sb-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 4px 0; background: var(--bg-primary); border: var(--hair) solid var(--border-default); border-radius: var(--radius-card); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.sb-results a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; text-decoration: none; }
.sb-results a:hover, .sb-results a:focus { background: var(--green-25); }

/* Venue market tables */
.vmk h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; }
.vmk-t { font-size: 13px; }
.vmk-t td { padding: 6px 8px; }
.vmk-t .bar-cell { width: 40%; }

/* Map timeline */
.timeline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 12px; }
.tl-src { display: inline-flex; border: var(--hair) solid #C9CDD3; border-radius: var(--radius-chip); overflow: hidden; }
.tl-btn { font: 12px var(--font-ui); padding: 6px 10px; border: 0; background: var(--bg-primary); color: var(--text-secondary); cursor: pointer; }
.tl-btn.on { background: #0A0A0A; color: #fff; }
.tl-range { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; }
.tl-range input { flex: 1; accent-color: var(--green-500); }
.tl-label { font-family: var(--font-mono); font-size: 12px; min-width: 52px; }

/* States */
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
a.state-card { text-decoration: none; color: inherit; gap: 4px; }
a.state-card:hover { border-color: var(--text-primary); }
.st-ab { font-size: 11px; color: var(--text-tertiary); }
.st-name { font-weight: 600; font-size: 15px; }

.timeline[hidden] { display: none; }

/* TruthIndex™ branding */
.truthindex {
  font-family: var(--font-display);
  font-weight: 700;
}
.tm {
  text-decoration: underline;
  text-decoration-color: #00FF00;
  text-underline-offset: -4px;
  text-decoration-thickness: 2px;
}

/* ==========================================================================
   Candidate & State Editorial Integration (Sanity)
   ========================================================================== */

/* Candidate Avatars */
.cand-avatar {
  display: inline-block;
  width: 44px;
  height: 44px;
  max-width: 44px;
  max-height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-raised);
  border: 2px solid var(--border-default);
  flex-shrink: 0;
}
.cand-avatar.sm { width: 26px; height: 26px; max-width: 26px; max-height: 26px; border-width: 1.5px; vertical-align: middle; margin-right: 6px; }
.cand-avatar.lg { width: 72px; height: 72px; max-width: 72px; max-height: 72px; border-width: 2.5px; }
.cand-avatar.xl { width: 110px; height: 110px; max-width: 110px; max-height: 110px; border-width: 3px; }
.cand-avatar.D { border-color: var(--party-d); }
.cand-avatar.R { border-color: var(--party-r); }
.cand-avatar.I, .cand-avatar.L, .cand-avatar.G { border-color: #8B5CF6; }

.cand-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-raised);
  border-radius: 50%;
  border: 2px solid var(--border-default);
  flex-shrink: 0;
}
.cand-initials.sm { width: 26px; height: 26px; font-size: 10px; border-width: 1.5px; vertical-align: middle; margin-right: 6px; }
.cand-initials.lg { width: 72px; height: 72px; font-size: 22px; border-width: 2.5px; }
.cand-initials.xl { width: 110px; height: 110px; font-size: 32px; border-width: 3px; }
.cand-initials.D { color: var(--party-d); background: rgba(47, 95, 208, 0.08); border-color: var(--party-d); }
.cand-initials.R { color: var(--party-r); background: rgba(200, 54, 59, 0.08); border-color: var(--party-r); }
.cand-initials.I, .cand-initials.L, .cand-initials.G { color: #8B5CF6; background: rgba(139, 92, 246, 0.08); border-color: #8B5CF6; }

/* Race Page: Candidates Cards */
.cand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.cand-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: var(--bg-primary);
  border: var(--hair) solid var(--border-default);
  border-radius: var(--radius-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cand-card:hover {
  border-color: #9CA3AF;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.cand-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.cand-card-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.cand-card-role {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.cand-card-summary {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  flex-grow: 1;
  margin: 0 0 12px;
}
.cand-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
  padding-top: 10px;
  border-top: var(--hair) solid var(--border-default);
}

/* State Factsheet & Civic Identity */
.state-header-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.state-flag-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.state-flag-img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  border: var(--hair) solid rgba(0,0,0,0.15);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.state-flag-mini {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  border: var(--hair) solid rgba(0,0,0,0.15);
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
.state-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px 20px;
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: var(--hair) solid var(--border-default);
  border-radius: var(--radius-card);
}
.state-stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin: 0; }
.state-stats dd { font-size: 15px; font-weight: 600; margin: 2px 0 0; color: var(--text-primary); font-feature-settings: "tnum"; }

.officeholder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.officeholder-card {
  padding: 16px;
  background: var(--bg-primary);
  border: var(--hair) solid var(--border-default);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.officeholder-card .office-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}
.officeholder-card .office-name {
  font-size: 15px;
  font-weight: 600;
}

/* Candidate Profile Page */
.cand-profile-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 8px;
}
.cand-profile-info h1 { margin: 0 0 6px; font-size: 32px; }
.cand-profile-role { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }
.cand-races-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

/* Portable Text formatting */
.portable-prose {
  font-size: 15px;
  line-height: 1.7;
  color: #262626;
  max-width: 760px;
}
.portable-prose h2 { font-size: 20px; font-weight: 700; margin: 28px 0 12px; color: var(--text-primary); }
.portable-prose h3 { font-size: 16px; font-weight: 600; margin: 20px 0 8px; color: var(--text-primary); }
.portable-prose p { margin: 0 0 14px; }
.portable-prose ul.portable-list, .portable-prose ol.portable-list { margin: 0 0 16px 22px; padding: 0; }
.portable-prose li { margin-bottom: 6px; }
.portable-prose blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--green-500);
  background: var(--green-25);
  border-radius: 0 var(--radius-chip) var(--radius-chip) 0;
  font-style: italic;
}
.portable-prose a { color: var(--green-700); text-decoration: underline; text-underline-offset: 2px; }
.portable-prose a:hover { color: var(--green-500); }

@media (max-width: 640px) {
  .cand-profile-hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .state-header-wrap { flex-direction: column-reverse; }
  .state-flag-badge { align-items: flex-start; }
}

/* Share block on race pages: the social card preview and its downloads */
.share { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: 20px; align-items: center; }
.share img { width: 100%; height: auto; border-radius: var(--radius-card); border: var(--hair) solid var(--border-default); }
@media (max-width: 900px) { .share { grid-template-columns: 1fr; } }
.embed { display: grid; grid-template-columns: minmax(0, 680px) minmax(0, 1fr); gap: 20px; align-items: start; }
.embed iframe { display: block; }
.embed-code { margin: 0 0 10px; padding: 12px; max-height: 9.5em; overflow: auto; white-space: pre-wrap; word-break: break-all; background: var(--bg-surface); border: var(--hair) solid var(--border-default); border-radius: var(--radius-card); font: 12px/1.5 var(--font-mono); }
@media (max-width: 1100px) { .embed { grid-template-columns: 1fr; } }

/* Election-season theme: navy frame, flag stripe, poster headlines, countdown.
   Party red and blue stay reserved for parties; flag colors appear only in the frame. */
:root {
  --navy: #0B1F3A;
  --navy-2: #132B4F;
  --flag-red: #B22234;
  --font-poster: 'Oswald', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 1.5l3.1 6.9 7.4.7-5.6 5 1.7 7.4L12 17.6l-6.6 3.9 1.7-7.4-5.6-5 7.4-.7z'/%3E%3C/svg%3E");
}

/* Navy header with a thin star field and a flag stripe along the bottom edge */
.site-header {
  background-color: var(--navy);
  background-image: radial-gradient(rgba(255,255,255,0.10) 1px, transparent 1.2px);
  background-size: 18px 18px;
  border-bottom: 0; justify-content: flex-start;
}
.site-nav { margin-left: auto; }
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 5px; pointer-events: none;
  background: linear-gradient(to bottom, #fff 0 2px, var(--flag-red) 2px 5px);
}
.brand .sect { color: rgba(255,255,255,0.78); border-left-color: rgba(255,255,255,0.28); }
.site-nav a { color: rgba(255,255,255,0.72); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 #fff; }

/* Countdown pill in the header, added by elections.js */
.eday {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-family: var(--font-poster); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: #fff; background: var(--navy-2); border: 1px solid rgba(255,255,255,0.22); border-radius: 999px; padding: 3px 10px 3px 8px; white-space: nowrap;
}
.eday::before { content: ""; width: 10px; height: 10px; background: var(--star) center / contain no-repeat; }
.eday b { font-weight: 700; font-size: 14px; letter-spacing: 0.02em; }
@media (max-width: 640px) { .eday .long { display: none; } }

/* Mid widths: tighter section links and no section label beside the logo */
@media (max-width: 1420px) { .site-nav { gap: 14px; } .brand .sect { display: none; } }
/* Narrow screens: the sections move into a menu opened from the right end of the header */
.menu-btn { display: none; }
@media (max-width: 1180px) {
  .js .menu-btn {
    display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex: none;
    min-height: 44px; padding: 0 12px; border: 1px solid rgba(255,255,255,0.28); border-radius: 6px;
    background: transparent; color: #fff; cursor: pointer;
    font-family: var(--font-poster); font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  }
  .js .menu-btn .bars, .js .menu-btn .bars::before, .js .menu-btn .bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px; transition: transform .2s, opacity .2s; }
  .js .menu-btn .bars { position: relative; }
  .js .menu-btn .bars::before, .js .menu-btn .bars::after { content: ""; position: absolute; left: 0; }
  .js .menu-btn .bars::before { top: -6px; }
  .js .menu-btn .bars::after { top: 6px; }
  .js .menu-open .menu-btn .bars { background: transparent; }
  .js .menu-open .menu-btn .bars::before { transform: translateY(6px) rotate(45deg); }
  .js .menu-open .menu-btn .bars::after { transform: translateY(-6px) rotate(-45deg); }
  .js .site-nav {
    display: none; position: absolute; top: calc(100% + 5px); right: 0; left: 0;
    flex-direction: column; gap: 0; margin: 0; padding: 6px 0 10px; overflow-y: auto; max-height: calc(100vh - var(--nav-height) - 5px);
    background: var(--navy); border-bottom: 3px solid var(--flag-red); box-shadow: 0 12px 24px rgba(11,31,58,0.28);
  }
  .js .menu-open .site-nav { display: flex; }
  .js .site-nav a { padding: 13px 24px; font-size: 16px; color: rgba(255,255,255,0.86); border-top: 1px solid rgba(255,255,255,0.08); }
  .js .site-nav a:first-child { border-top: 0; }
  .js .site-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 #fff; color: #fff; font-weight: 600; }
}
@media (max-width: 640px) { .js .site-nav a { padding-inline: 16px; } }

/* Poster-style headlines */
h1 {
  font-family: var(--font-poster); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.01em; line-height: 1.04; font-size: clamp(32px, 5.4vw, 58px); color: var(--navy);
}
h2 { font-family: var(--font-poster); font-weight: 500; text-transform: uppercase; letter-spacing: 0.02em; color: var(--navy); }
.headline { font-family: var(--font-poster); font-weight: 500; letter-spacing: 0; text-transform: none; }

/* Eyebrow tag as a navy ribbon with a star either side */
.eyebrow.tag {
  background: var(--navy); color: #fff; display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 2px;
}
.eyebrow.tag::before, .eyebrow.tag::after { content: ""; width: 9px; height: 9px; background: var(--star) center / contain no-repeat; }

/* Homepage countdown in poster type */
.countdown .n { font-family: var(--font-poster); font-weight: 600; font-size: 64px; color: var(--navy); }
.countdown .u { color: var(--navy); font-weight: 600; }

/* Row of stars between page sections */
.band + .band { position: relative; }
.band + .band::after {
  content: ""; position: absolute; top: -7px; left: 50%; width: 76px; height: 14px; transform: translateX(-50%);
  background: var(--bg-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 12'%3E%3Cg fill='%230B1F3A'%3E%3Cpath id='s' d='M6 0.6l1.6 3.5 3.8.4-2.9 2.6.9 3.8L6 9 2.6 10.9l.9-3.8L.6 4.5l3.8-.4z'/%3E%3Cuse href='%23s' x='24'/%3E%3Cuse href='%23s' x='48'/%3E%3C/g%3E%3C/svg%3E") center / 52px 10px no-repeat;
}

/* Footer framed by the same stripe */
.site-footer { border-top: 0; position: relative; }
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: linear-gradient(to bottom, var(--flag-red) 0 3px, #fff 3px 4px, var(--navy) 4px 5px);
}

/* Tinted sections in a cool flag-white in place of green */
:root { --tint: #F2F5FA; }
.band.tint { background: var(--tint); }
.band.tint::after { background-color: var(--tint); }

/* Flag behind the opening section of each page, faded toward the text */
/* Sits above the sections that follow, so the homepage search results can open over them */
main > section.band:first-of-type { position: relative; isolation: isolate; z-index: 2; }
main > section.band:first-of-type::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: min(64%, 820px); z-index: -1; pointer-events: none;
  background: url("img/flag-us.svg") right center / cover no-repeat;
  opacity: 0.10;
  -webkit-mask-image: linear-gradient(to left, #000 30%, transparent 95%);
          mask-image: linear-gradient(to left, #000 30%, transparent 95%);
}
@media (max-width: 640px) { main > section.band:first-of-type::before { width: 100%; opacity: 0.07; } }

/* Seat chart (half-circle) */
.seatarc { margin: 8px 0 0; display: grid; gap: 10px; }
.seatarc .arc { width: 100%; height: auto; display: block; overflow: visible; }
.seatarc .dot { stroke: none; }
.seatarc .d-none { stroke: #C9CED6; stroke-width: 0.75; }
.seatarc a:hover .dot, .seatarc a:focus-visible .dot { stroke: var(--navy, #0B1F3A); stroke-width: 2; }
.seatarc .maj { stroke: var(--navy, #0B1F3A); stroke-width: 1.5; stroke-dasharray: 4 3; fill: none; }
.seatarc .maj-t { font-family: var(--font-mono); font-size: 12px; fill: var(--text-secondary); letter-spacing: 0.04em; }
.seatarc .arc-n { font-family: var(--font-poster, var(--font-ui)); font-size: 46px; font-weight: 600; }
.seatarc .arc-n.D { fill: var(--party-d); } .seatarc .arc-n.R { fill: var(--party-r); }
.seatarc .arc-l { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; fill: var(--text-secondary); }
.seatarc .arc-t { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; fill: #5C4300; }
.arc-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 12px; color: var(--text-secondary); }
.arc-key li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.arc-key b { color: var(--text-primary); font-family: var(--font-mono); font-weight: 500; }
.arc-key .sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.arc-key .sw.d-not-D { background: #102E78; opacity: 0.45; } .arc-key .sw.d-not-R { background: #6E1218; opacity: 0.45; }
.arc-key .sw.d-safe-D { background: var(--r-safe-D); } .arc-key .sw.d-likely-D { background: var(--r-likely-D); } .arc-key .sw.d-lean-D { background: var(--r-lean-D); }
.arc-key .sw.d-tossup { background: var(--r-tossup); } .arc-key .sw.d-other { background: var(--r-other); } .arc-key .sw.d-none { background: var(--map-none); border: 0.75px solid #C9CED6; }
.arc-key .sw.d-lean-R { background: var(--r-lean-R); } .arc-key .sw.d-likely-R { background: var(--r-likely-R); } .arc-key .sw.d-safe-R { background: var(--r-safe-R); }
.seatarc figcaption { text-align: center; }
.arc-solo .seatarc { max-width: 720px; margin-inline: auto; width: 100%; }

/* State outline behind the opening section of state and race pages (in place of the flag) */
main > section.band.has-outline::before { display: none; }
.has-outline { position: relative; isolation: isolate; overflow: hidden; }
.has-outline > .st-outline {
  position: absolute; z-index: -1; pointer-events: none;
  top: 16px; bottom: 16px; right: max(24px, calc((100% - var(--content-max)) / 2 + 24px));
  width: min(46%, 520px); height: calc(100% - 32px);
}
.st-outline path { fill: var(--navy, #0B1F3A); fill-opacity: 0.06; stroke: var(--navy, #0B1F3A); stroke-opacity: 0.30; stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
@media (max-width: 640px) { .has-outline > .st-outline { top: 8px; bottom: auto; height: 120px; width: 36%; right: 12px; opacity: 0.45; } }

/* Opening section of state pages that show the state flag: no background picture */
main > section.band.no-bg::before { display: none; }

/* Outlook page */
.otiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
@media (max-width: 900px) { .otiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .otiles { gap: 8px; } .otile { padding: 10px 12px; } .otile .tl-h { font-size: 16px; } .otile .tl-v { font-size: 11px; } .otile .tl-v b { font-size: 13.5px; } }
.otile { display: grid; gap: 4px; align-content: start; padding: 14px 16px; border: var(--hair) solid var(--border-default); border-top: 3px solid var(--navy, #0B1F3A); border-radius: var(--radius-card); background: rgba(255,255,255,0.92); text-decoration: none; color: inherit; }
.otile:hover { border-color: var(--navy, #0B1F3A); }
.otile.t-DD { border-top-color: var(--party-d); } .otile.t-RR { border-top-color: var(--party-r); }
.otile .tl-k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.otile .tl-h { font-family: var(--font-poster, var(--font-ui)); font-size: 20px; font-weight: 500; color: var(--navy, #0B1F3A); line-height: 1.15; margin-bottom: 4px; }
.otile .tl-v { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.otile .tl-v b { font-size: 16px; font-weight: 600; color: var(--text-primary); }

.otabs { position: sticky; top: calc(var(--nav-height) + 5px); z-index: 50; background: rgba(255,255,255,0.96); border-bottom: var(--hair) solid var(--border-default); backdrop-filter: blur(6px); }
.otabs .wrap { display: flex; gap: 8px; overflow-x: auto; padding-block: 10px; scrollbar-width: none; }
.otabs .wrap::-webkit-scrollbar { display: none; }
.otabs a { flex: none; font-size: 12.5px; font-weight: 500; text-decoration: none; color: var(--navy, #0B1F3A); border: 1px solid #C9D3E3; border-radius: 999px; padding: 5px 12px; white-space: nowrap; background: #fff; }
.otabs a:hover { background: var(--navy, #0B1F3A); color: #fff; border-color: var(--navy, #0B1F3A); }
main > .otabs + .band::after { display: none; }
#balance-of-power, #senate-seats, #house-seats, #governors, #popular-vote, #waves { scroll-margin-top: calc(var(--nav-height) + 60px); }

/* Balance of power grid */
.bp { display: grid; grid-template-columns: minmax(90px, auto) 1fr 1fr; gap: 8px; max-width: 860px; }
.bp-col, .bp-row { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); display: flex; align-items: center; }
.bp-col { justify-content: center; padding-bottom: 2px; }
.bp-row { padding-right: 6px; }
.bp-cell { border-radius: var(--radius-card); padding: 14px 16px; display: grid; gap: 10px; background: #fff; border: var(--hair) solid var(--border-default); }
.bp-DD { background: #E8EEFB; border-color: #B7C9F2; } .bp-RR { background: #FBEAEA; border-color: #F2BDBD; }
.bp-cell.lead { box-shadow: 0 0 0 2px var(--navy, #0B1F3A); }
.bp-name { font-weight: 600; font-size: 14px; }
.bp-DD .bp-name { color: var(--r-safe-D); } .bp-RR .bp-name { color: var(--r-safe-R); }
.bp-vals { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.bp-vals a { display: grid; text-decoration: none; color: inherit; }
.bp-v { font-size: 26px; font-weight: 500; line-height: 1.1; }
.bp-src { font-size: 11px; color: var(--text-secondary); }
@media (max-width: 640px) { .bp { grid-template-columns: 1fr 1fr; } .bp-corner, .bp-col { display: none; } .bp-row { grid-column: 1 / -1; padding-top: 6px; } .bp-v { font-size: 20px; } .bp-cell { padding: 10px 12px; } .bp-name { font-size: 12.5px; } }

/* Range charts */
.rcard .rmed { margin: 2px 0 0; font-size: 13px; }
.rcard .rmed b { font-family: var(--font-mono); font-size: 18px; color: var(--navy, #0B1F3A); margin: 0 2px; }
.rchart { width: 100%; height: auto; display: block; overflow: visible; }
.rchart .base { stroke: #C9CED6; stroke-width: 1; }
.rchart .thr { stroke: var(--navy, #0B1F3A); stroke-width: 1.5; stroke-dasharray: 4 3; }
.rchart .thr-t { font-family: var(--font-mono); font-size: 10.5px; fill: var(--navy, #0B1F3A); }
.rchart .rv { font-family: var(--font-mono); font-size: 10px; fill: var(--text-secondary); }
.rchart .rl { font-family: var(--font-mono); font-size: 10px; fill: var(--text-secondary); }
.rchart .med .rv, .rchart .med .rl { fill: var(--navy, #0B1F3A); font-weight: 700; }
.rchart .med rect { stroke: var(--navy, #0B1F3A); stroke-width: 2; }
.b-D { fill: var(--r-safe-D); background: var(--r-safe-D); } .b-R { fill: var(--r-likely-R); background: var(--r-likely-R); }
.b-Dl { fill: var(--r-lean-D); background: var(--r-lean-D); } .b-Rl { fill: var(--r-lean-R); background: var(--r-lean-R); }
.b-tie { fill: var(--r-tossup); background: var(--r-tossup); } .b-mix { fill: #C9CED6; background: #C9CED6; } .b-N { fill: #5B6B85; background: #5B6B85; }
.rkey { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--text-secondary); }
.rkey li { display: inline-flex; align-items: center; gap: 6px; }
.rkey i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.rkey i.medk { background: #fff; border: 2px solid var(--navy, #0B1F3A); }
details.more-mk { margin-top: 16px; }
details.more-mk > summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--navy, #0B1F3A); padding: 6px 0; }
details.more-mk > .grid-2 { margin-top: 10px; }

/* Waves table */
table.waves td:first-child { font-weight: 500; }
table.waves .wv { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; background: #5B6B85; }
table.waves .wv.D { background: var(--party-d); } table.waves .wv.R { background: var(--party-r); }
table.waves td.n a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-mono); font-size: 14px; }
table.waves td.n a:hover { text-decoration: underline; }
.wbar { width: 90px; height: 8px; background: var(--tile-even); border-radius: 2px; overflow: hidden; display: inline-block; }
.wbar i { display: block; height: 100%; background: #5B6B85; } .wbar i.D { background: var(--party-d); } .wbar i.R { background: var(--party-r); }
@media (max-width: 640px) { .wbar { width: 44px; } }
.rcard h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; }

/* Ballot measure ratings: teal for Yes, slate for No, neither party colour */
:root { --m-yes-safe: #0E6E7E; --m-yes-likely: #2A9DB0; --m-yes-lean: #A9DCE5; --m-no-lean: #CDD5E0; --m-no-likely: #74839A; --m-no-safe: #3F4B5E; }
.rchip.r-yes-safe { background: var(--m-yes-safe); color: #fff; }
.rchip.r-yes-likely { background: var(--m-yes-likely); color: #fff; }
.rchip.r-yes-lean { background: var(--m-yes-lean); color: #0B4650; }
.rchip.r-no-lean { background: var(--m-no-lean); color: #2B3546; }
.rchip.r-no-likely { background: var(--m-no-likely); color: #fff; }
.rchip.r-no-safe { background: var(--m-no-safe); color: #fff; }

/* Ballot measures page */
.mstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
@media (max-width: 900px) { .mstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mstat { display: grid; gap: 2px; align-content: start; padding: 12px 16px; border: var(--hair) solid var(--border-default); border-top: 3px solid var(--navy, #0B1F3A); border-radius: var(--radius-card); background: rgba(255,255,255,0.92); text-decoration: none; color: inherit; }
.mstat .tl-k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.mstat b { font-family: var(--font-poster, var(--font-ui)); font-size: 32px; font-weight: 600; color: var(--navy, #0B1F3A); line-height: 1.1; }
a.mstat:hover { border-color: var(--navy, #0B1F3A); }
.mscale { display: flex; height: 14px; border-radius: 3px; overflow: hidden; margin-top: 20px; gap: 1px; background: #fff; }
.mscale span, .mkey i, .mdot i { background: var(--map-none); }
.mkey { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-secondary); }
.mkey li { display: inline-flex; align-items: center; gap: 6px; }
.mkey b { color: var(--text-primary); font-family: var(--font-mono); font-weight: 500; }
.mkey i, .mdot i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.r-yes-safe { background: var(--m-yes-safe) !important; } .r-yes-likely { background: var(--m-yes-likely) !important; } .r-yes-lean { background: var(--m-yes-lean) !important; }
.r-no-lean { background: var(--m-no-lean) !important; } .r-no-likely { background: var(--m-no-likely) !important; } .r-no-safe { background: var(--m-no-safe) !important; }
.mscale .r-tossup, .mkey .r-tossup, .mdot .r-tossup { background: var(--r-tossup); }
.rchip.r-yes-safe, .rchip.r-yes-likely, .rchip.r-no-likely, .rchip.r-no-safe { color: #fff; }

.mcard { text-decoration: none; color: inherit; }
.mcard:hover { border-color: var(--navy, #0B1F3A); }
.mcard .rc-title { display: grid; }
.mcard .mc-st { font-weight: 400; }
.mc-sides { display: flex; justify-content: space-between; }
.mc-sides .r { text-align: right; }
.mc-k { font-size: 12px; color: var(--text-secondary); }
.mc-p { font-family: var(--font-mono); font-size: 28px; font-weight: 500; line-height: 1.1; }
.mc-p.y { color: var(--m-yes-safe); } .mc-p.n { color: var(--m-no-safe); }
.mc-bar { display: flex; height: 8px; border-radius: 2px; overflow: hidden; background: var(--tile-even); }
.mc-bar .y { background: var(--m-yes-likely); } .mc-bar .n { background: var(--m-no-lean); }

.mfilters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; }
.mtoggle { display: inline-flex; gap: 6px; }
.mtoggle .btn { padding: 6px 10px; font-size: 12px; }
.mstates { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 14px; }
details.mstate { min-width: 0; }
details.mstate { border: var(--hair) solid var(--border-default); border-radius: var(--radius-card); background: #fff; }
details.mstate > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
details.mstate > summary::-webkit-details-marker { display: none; }
details.mstate > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--navy, #0B1F3A); border-bottom: 2px solid var(--navy, #0B1F3A); transform: rotate(-45deg); transition: transform 0.15s; flex: none; }
details.mstate[open] > summary::before { transform: rotate(45deg); }
details.mstate > summary:hover { background: var(--bg-surface); }
.ms-name { font-weight: 600; font-size: 15px; min-width: 9em; }
.ms-n { font-size: 12px; color: var(--text-secondary); min-width: 7em; }
.ms-dots { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; margin-left: auto; }
.mdot { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
details.mstate .table-wrap { border: 0; border-top: var(--hair) solid var(--border-default); border-radius: 0 0 var(--radius-card) var(--radius-card); }
.ybar { height: 8px; width: 100%; min-width: 60px; background: var(--tile-even); border-radius: 2px; overflow: hidden; }
.ybar i { display: block; height: 100%; background: var(--m-yes-likely); }
/* Eleven columns per measure row: the table scrolls inside its wrap rather than squeezing the
   numbers, and the measure name keeps a readable width. */
table.mtable { min-width: 900px; }
table.mtable th:first-child, table.mtable td:first-child { min-width: 240px; }
table.mtable .bar-cell { width: 150px; }
@media (max-width: 640px) { .ms-name { min-width: 0; } .ms-n { min-width: 0; } .ms-dots { display: none; } .mstat b { font-size: 26px; } }

/* Divergence page */
.dstats { margin-top: 22px; }
.dhist-wrap { display: grid; gap: 8px; margin-top: 18px; max-width: 520px; }
.dhist-wrap .tl-k, .dkey { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.dhist { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; }
.dh-col { display: grid; justify-items: center; gap: 4px; }
.dh-n { font-size: 12px; color: var(--text-primary); }
.dh-bar { width: 100%; background: #9AA8BF; border-radius: 2px 2px 0 0; }
.dh-col.wide .dh-bar { background: var(--navy, #0B1F3A); }
.dh-l { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.dkey { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; text-transform: none; letter-spacing: 0; font-family: var(--font-ui); font-size: 12px; }
.dkey .db-dot { position: static; transform: none; display: inline-block; }

.dumb { display: grid; gap: 2px; margin-top: 14px; background: #fff; border: var(--hair) solid var(--border-default); border-radius: var(--radius-card); padding: 8px 16px 10px; }
.db-axis, .db-row { display: grid; grid-template-columns: minmax(180px, 32%) 1fr 64px; gap: 16px; align-items: center; }
.db-axis { height: 26px; }
.db-axis .db-track { height: 100%; }
.db-axis .db-track i { position: absolute; top: 4px; transform: translateX(-50%); font-style: normal; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-secondary); }
.db-axis .db-g { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); text-align: right; }
.db-row { min-height: 40px; padding: 4px 0; border-top: var(--hair) solid var(--border-default); text-decoration: none; color: inherit; }
.db-row:hover { background: var(--bg-surface); }
.db-l { display: grid; line-height: 1.25; min-width: 0; }
.db-l b { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-l span { font-size: 11.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-track { position: relative; height: 22px; background: repeating-linear-gradient(to right, #E5E7EB 0 1px, transparent 1px 25%); background-size: calc(100% - 1px) 100%; }
.db-row .db-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #E5E7EB; }
.db-bar { position: absolute; top: 50%; height: 4px; transform: translateY(-50%); background: #C9CED6; border-radius: 2px; }
.db-dot { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.08); }
.db-dot.poly { background: var(--chart-poly); } .db-dot.kalshi { background: var(--chart-kalshi); }
.db-row .db-g { text-align: right; font-size: 14px; font-weight: 600; color: var(--navy, #0B1F3A); }
.db-g { white-space: nowrap; }
.dhist-wrap + .brandline { margin-top: 18px; }

.dfilter { display: grid; gap: 12px; margin-bottom: 12px; }
.dchips { display: flex; flex-wrap: wrap; gap: 6px; }
.dchips button { font: inherit; font-size: 12.5px; font-weight: 500; color: var(--navy, #0B1F3A); background: #fff; border: 1px solid #C9D3E3; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.dchips button span { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); margin-left: 4px; }
.dchips button.on { background: var(--navy, #0B1F3A); border-color: var(--navy, #0B1F3A); color: #fff; }
.dchips button.on span { color: rgba(255,255,255,0.75); }

@media (max-width: 640px) {
  .db-axis, .db-row { grid-template-columns: 1fr 64px; gap: 4px 10px; }
  .db-axis > span:first-child { display: none; }
  .db-l { grid-column: 1 / -1; }
  .db-row .db-track { grid-column: 1; }
  .dhist .dh-l { font-size: 10px; }
}

/* Election night page */
.lctls { margin-top: 22px; }
.lctl { background: rgba(255,255,255,0.94); border-top: 3px solid var(--navy, #0B1F3A); }
.lctl .side .val { font-family: var(--font-poster, var(--font-mono)); font-size: 44px; font-weight: 600; }
.lctl .ctl-bar { height: 12px; }
.pc-list { list-style: none; margin: 0; padding: 0; display: grid; }
.pc-list li a { display: grid; grid-template-columns: 148px 1fr auto; gap: 10px; align-items: baseline; padding: 7px 0; border-top: var(--hair) solid var(--border-default); text-decoration: none; color: inherit; font-size: 13px; }
.pc-list li:first-child a { border-top: 0; }
.pc-list li a:hover .pc-s { text-decoration: underline; }
.pc-t { font-weight: 600; color: var(--navy, #0B1F3A); white-space: nowrap; }
.pc-s { color: var(--text-secondary); }
.pc-tag { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.closed .pc-tag { color: var(--text-secondary); }
.next .pc-tag { color: #fff; background: var(--flag-red, #B22234); border-radius: 3px; padding: 2px 6px; }
.pc-list li.closed .pc-t { color: var(--text-secondary); }
.pc-group { margin-top: 26px; scroll-margin-top: calc(var(--nav-height) + 16px); }
.pc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 10px; }
.pc-head h2 { margin: 0; }
.pc-head .pc-s { font-size: 13px; }
.pc-group.next .pc-head h2 { color: var(--flag-red, #B22234); }
.pc-group.closed .pc-head h2::after { content: "  ✓"; color: var(--text-secondary); font-size: 0.7em; }
@media (max-width: 640px) { .lctl .side .val { font-size: 34px; } .pc-list li a { grid-template-columns: 1fr auto; gap: 2px 10px; } .pc-list .pc-s { grid-column: 1 / -1; grid-row: 2; } }

/* States page */
.countmap .cq { stroke: none; }
.cq.q-1, .cq-k.q-1 { fill: var(--map-none); background: var(--map-none); }
.cq.q0, .cq-k.q0 { fill: #EEF2F8; background: #EEF2F8; } .cq.q1, .cq-k.q1 { fill: #C9D5E8; background: #C9D5E8; }
.cq.q2, .cq-k.q2 { fill: #93A9CD; background: #93A9CD; } .cq.q3, .cq-k.q3 { fill: #5C79AE; background: #5C79AE; }
.cq.q4, .cq-k.q4 { fill: #2F4D85; background: #2F4D85; } .cq.q5, .cq-k.q5 { fill: #0B1F3A; background: #0B1F3A; }
.countmap .st.on:hover .cq { stroke: var(--flag-red, #B22234); stroke-width: 2; }
.countmap .cl { font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-anchor: middle; fill: #1F2A3D; pointer-events: none; }
.countmap .cl.bx { text-anchor: start; }
.countmap .cl.v { font-weight: 500; font-size: 10.5px; }
.countmap .cl.q3, .countmap .cl.q4, .countmap .cl.q5 { fill: #fff; }
.countmap .cl.q-1 { fill: #9AA3B2; }
.cq-k { width: 12px; height: 12px; border-radius: 2px; display: inline-block; border: 0.5px solid var(--border-default); }

.sc-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; }
.state-card { position: relative; display: grid; gap: 8px; align-content: start; }
.sc-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.sc-top > span:first-child { display: grid; }
.sc-mini { width: 54px; height: 44px; flex: none; }
.sc-mini .st-mini { width: 100%; height: 100%; display: block; }
.st-mini path { fill: var(--navy, #0B1F3A); fill-opacity: 0.08; stroke: var(--navy, #0B1F3A); stroke-opacity: 0.45; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.state-card:hover .st-mini path { fill-opacity: 0.18; }
.sc-race { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; padding-top: 8px; border-top: var(--hair) solid var(--border-default); }
.sc-race .rchip { margin-left: 0; }
.sc-k { font-weight: 600; }
.sc-who { color: var(--text-secondary); }
.sc-ti { font: 500 10px var(--font-mono); letter-spacing: 0.04em; color: var(--text-tertiary); white-space: nowrap; }
.sc-comp { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--navy, #0B1F3A); }
.sc-comp.none { color: var(--text-tertiary); }

/* Methodology page */
.mtoc { margin: 22px 0 6px; padding: 14px 18px; border: var(--hair) solid var(--border-default); border-left: 3px solid var(--navy, #0B1F3A); border-radius: var(--radius-card); background: rgba(255,255,255,0.92); }
.mtoc .tl-k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.mtoc ol { margin: 8px 0 0; padding-left: 20px; columns: 2; column-gap: 28px; font-size: 13.5px; }
.mtoc li { break-inside: avoid; padding: 2px 0; }
.mtoc a { color: var(--navy, #0B1F3A); text-decoration: none; }
.mtoc a:hover { text-decoration: underline; }
@media (max-width: 520px) { .mtoc ol { columns: 1; } }
.prose h2[id] { scroll-margin-top: calc(var(--nav-height) + 16px); }

.txfig { margin: 18px 0 8px; padding: 16px 18px; border: var(--hair) solid var(--border-default); border-radius: var(--radius-card); background: #fff; display: grid; gap: 10px; max-width: none; }
.txfig figcaption { font-size: 13px; color: var(--text-secondary); }
.txfig figcaption b { color: var(--text-primary); }
.txd { width: 100%; height: auto; display: block; overflow: visible; }
.txd .tx-grid { stroke: #EEF0F3; }
.txd .tx-band { opacity: 0.16; }
.txd .tx-p .tx-band, .txd .tx-p .tx-mid { fill: var(--chart-poly); }
.txd .tx-k .tx-band, .txd .tx-k .tx-mid { fill: var(--chart-kalshi); }
.txd .tx-mid { stroke: #fff; stroke-width: 2; }
.txd .tx-q { stroke: #4B5563; stroke-width: 2; }
.txd .tx-link { stroke: #9CA3AF; stroke-dasharray: 3 3; }
.txd .tx-ti { fill: var(--chart-ti); stroke: #fff; stroke-width: 2; }
.txd .tx-name { font-family: var(--font-ui); font-size: 13px; font-weight: 600; fill: var(--text-primary); }
.txd .tx-sub, .txd .tx-l { font-family: var(--font-mono); font-size: 11px; fill: var(--text-secondary); }
.txd .tx-m { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; fill: var(--text-primary); }
.txfig .formula { margin: 0; white-space: normal; }

.rscales { display: grid; gap: 18px; margin: 14px 0 6px; }
.rs-h { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.rs-bar { display: flex; height: 30px; border-radius: 4px; overflow: hidden; gap: 1px; }
.rs-seg { display: flex; align-items: center; justify-content: center; font-size: 11px; white-space: nowrap; overflow: hidden; margin: 0 !important; border-radius: 0 !important; padding: 0 2px !important; }
.rs-seg b { font-weight: 600; }
.rq.r-safe-D { background: var(--r-safe-D); color: #fff; } .rq.r-likely-D { background: var(--r-likely-D); color: #fff; } .rq.r-lean-D { background: var(--r-lean-D); color: #1E3A8A; }
.rq.r-safe-R { background: var(--r-safe-R); color: #fff; } .rq.r-likely-R { background: var(--r-likely-R); color: #fff; } .rq.r-lean-R { background: var(--r-lean-R); color: #7F1D1D; }
.rs-seg.r-tossup { background: var(--r-tossup); color: #5C4300; }
.rs-axis { position: relative; height: 16px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-secondary); margin-top: 4px; }
.rs-axis span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.rs-axis span:first-child { transform: none; } .rs-axis span:last-child { transform: translateX(-100%); }
.vtable td:first-child { width: 38%; white-space: normal; }
@media (max-width: 640px) { .rs-seg b { font-size: 9.5px; } }

.vt { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.vt.ok { color: var(--green-700); }

.txd .tx-name { font-size: 15px; } .txd .tx-sub, .txd .tx-l { font-size: 12.5px; } .txd .tx-m { font-size: 14.5px; }
.tx-scroll { overflow-x: auto; }
.tx-scroll .txd { min-width: 540px; }

/* Race section pages: opening figures, rating bar, tables that keep the TruthIndex in view */
.mstat b .D { color: var(--party-d); } .mstat b .R { color: var(--party-r); }
.mstat b .sep { color: var(--border-default); font-weight: 400; }
.rscale > span, .rkey-s i { background: var(--map-none); }
.rscale > .s-safe-D, .rkey-s .s-safe-D { background: var(--r-safe-D); }
.rscale > .s-likely-D, .rkey-s .s-likely-D { background: var(--r-likely-D); }
.rscale > .s-lean-D, .rkey-s .s-lean-D { background: var(--r-lean-D); }
.rscale > .s-tossup, .rkey-s .s-tossup { background: var(--r-tossup); }
.rscale > .s-lean-R, .rkey-s .s-lean-R { background: var(--r-lean-R); }
.rscale > .s-likely-R, .rkey-s .s-likely-R { background: var(--r-likely-R); }
.rscale > .s-safe-R, .rkey-s .s-safe-R { background: var(--r-safe-R); }
.rscale > .s-other, .rkey-s .s-other { background: var(--r-other); }
.more-list { margin-top: 6px; }
.more-list > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--navy, #0B1F3A); padding: 6px 0; }
.c-lead { display: none; }
table.rt tr.og th { background: var(--bg-surface); color: var(--text-secondary); text-transform: none; letter-spacing: 0.02em; font-size: 11.5px; }
/* Race tables on phones: every row becomes a card. The race and its TruthIndex™ on the first line,
   then the rating and each venue figure as small labelled values, so nothing scrolls sideways and
   no column (spread included) is dropped. Cells name themselves with data-label. */
@media (max-width: 700px) {
  table.rt { min-width: 0; font-size: 13px; }
  table.rt thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.rt, table.rt tbody { display: block; width: 100%; }
  table.rt tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 12px 14px; border-bottom: var(--hair) solid var(--border-default); }
  table.rt tr[hidden] { display: none; }
  table.rt td, table.rt td:first-child { display: block; padding: 0; border: 0; min-width: 0; }
  table.rt .rt-hide { display: none; }
  table.rt .rt-name { order: 1; flex: 1 1 calc(100% - 134px); font-weight: 600; overflow-wrap: break-word; }
  table.rt .rt-name .c-lead { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--text-secondary); }
  table.rt .rt-ti { order: 2; flex: 0 0 120px; text-align: right; font-size: 18px; line-height: 1.15; }
  table.rt .rt-ti::before { content: attr(data-label); display: block; font: 500 9.5px var(--font-mono); letter-spacing: 0.06em; color: var(--text-tertiary); }
  table.rt .rt-ti .single { font-size: 10px; }
  table.rt .rt-rating, table.rt .rt-lead { order: 3; flex: 0 0 auto; }
  table.rt td[data-label]:not(.rt-ti) { order: 4; flex: 0 0 auto; text-align: left; font-size: 12px; color: var(--text-secondary); }
  table.rt td[data-label]:not(.rt-ti)::before { content: attr(data-label) " "; font: 500 10px var(--font-mono); letter-spacing: 0.04em; color: var(--text-tertiary); }
  table.rt tr.og { display: block; padding: 10px 14px 6px; background: var(--bg-surface); }
  table.rt tr.og th { display: block; padding: 0; border: 0; }
}
/* The seat chart is drawn at half size on phones: its labels are set larger so they stay readable */
@media (max-width: 600px) {
  .seatarc .maj-t { font-size: 21px; }
  .seatarc svg { overflow: visible; }
  .seatarc .arc-l, .seatarc .arc-t { font-size: 17px; letter-spacing: 0.02em; }
  .seatarc .arc-n { font-size: 58px; }
}
.ms-seats { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.ms-seats .D { color: var(--party-d); } .ms-seats .R { color: var(--party-r); }
.mdot.rkey-s i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.gov-after { align-items: start; }
.flips .fl-move { display: inline-flex; align-items: center; gap: 6px; }
.flips .meta { grid-column: 1 / -1; font-size: 12px; color: var(--text-secondary); }
/* Grouped race tables share one set of column widths, so the groups line up */
@media (min-width: 701px) {
  details.mstate .ctable { table-layout: fixed; width: 100%; }
  details.mstate .ctable th:nth-child(1) { width: 13%; } details.mstate .ctable th:nth-child(2) { width: 14%; }
  details.mstate .ctable th:nth-child(3) { width: 8%; } details.mstate .ctable th:nth-child(4) { width: 9%; }
  details.mstate .ctable th:nth-child(5) { width: 7%; } details.mstate .ctable th:nth-child(6) { width: 9%; }
  details.mstate .ctable th:nth-child(7) { width: 7%; } details.mstate .ctable th:nth-child(8) { width: 7%; }
  details.mstate .ctable th:nth-child(9) { width: 6%; } details.mstate .ctable th:nth-child(10) { width: 6%; }
  details.mstate .ctable th:nth-child(11) { width: 6%; } details.mstate .ctable th:nth-child(12) { width: 8%; }
  details.mstate .ctable td { overflow: hidden; text-overflow: ellipsis; }
  details.mstate .ctable td svg { max-width: 100%; height: auto; }
}
/* Leaders without a party label: tiers in a purple scale no party uses */
.rchip.r-other.t-lean { background: #DCD2F5; color: #3B2A73; }
.rchip.r-other.t-likely { background: #9C82DE; color: #fff; }
.rchip.r-other.t-safe { background: #5B3FA8; color: #fff; }
.rscale > .s-other.t-lean, .rkey-s .s-other.t-lean { background: #DCD2F5; }
.rscale > .s-other.t-likely, .rkey-s .s-other.t-likely { background: #9C82DE; }
.rscale > .s-other.t-safe, .rkey-s .s-other.t-safe { background: #5B3FA8; }
.rc-note { color: var(--navy, #0B1F3A); font-weight: 500; margin-top: -4px; }
.rc-vol { margin-top: -2px; }
.c-note { margin-top: 2px; }
.grp-h { font-family: var(--font-poster, var(--font-ui)); font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; color: var(--navy, #0B1F3A); margin: 24px 0 10px; font-size: 18px; }
.grp-h:first-of-type { margin-top: 8px; }
.table-view { margin-top: 24px; }
/* Overview */
.otiles.explore { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .otiles.explore { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.map-tabs { align-self: end; }
.arcs .headline { font-size: clamp(20px, 2.2vw, 26px); margin: 4px 0 2px; }
.ti-strip { margin-top: 24px; padding-top: 16px; border-top: var(--hair) solid var(--border-default); }
.ti-strip .explainer { margin: 0; }

/* Price history chart (assets/price-chart.js) */
.pchart { position: relative; outline: none; }
.pchart:focus-visible { box-shadow: 0 0 0 2px var(--navy, #0B1F3A); border-radius: 4px; }
.pc-range { display: inline-flex; border: var(--hair) solid #C9CDD3; border-radius: var(--radius-chip); overflow: hidden; margin: 0 0 10px; }
.pc-range[hidden] { display: none; }
.pc-range .tl-btn.on { background: var(--navy, #0B1F3A); }
.pc-plot { touch-action: pan-y; cursor: crosshair; -webkit-user-select: none; user-select: none; }
.pc-plot svg { width: 100%; height: auto; display: block; overflow: visible; }
.pc-tick { fill: var(--text-tertiary); font: 10.5px var(--font-mono); }
.pc-grid { stroke: var(--border-default); stroke-width: 1; }
.pc-half { stroke: var(--navy, #0B1F3A); stroke-width: 1; stroke-dasharray: 4 3; opacity: 0.55; }
/* Rating zones in one neutral grey that darkens from Lean to Safe; Toss-up stays clear. The label
   names the side, so the only colours on the chart are the three lines and the TruthIndex™ fill. */
.pc-z { fill: #64748B; opacity: 0.045; }
.pc-z.z-lean { opacity: 0.045; } .pc-z.z-likely { opacity: 0.08; } .pc-z.z-safe { opacity: 0.12; }
.pc-z.z-tossup { opacity: 0; }
.pc-zl { font: 600 9.5px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; fill: var(--text-secondary); opacity: 0.8; }
.pchart .pc-band { fill: #64748B; opacity: 0.14; stroke: none; }
.pc-g0 { stop-color: var(--chart-ti); stop-opacity: 0.22; } .pc-g1 { stop-color: var(--chart-ti); stop-opacity: 0.02; }
.pchart .pc-area { stroke: none; }
.pc-l { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.pc-l.l-ti { stroke: var(--chart-ti); stroke-width: 3; }
.pc-l.l-pm { stroke: var(--chart-poly); stroke-width: 1.2; opacity: 0.65; }
.pc-l.l-ks { stroke: var(--chart-kalshi); stroke-width: 1.2; opacity: 0.75; }
.pc-dot { fill: var(--chart-ti); stroke: #fff; stroke-width: 2; }
.pc-end { font: 600 11.5px var(--font-mono); }
.pc-end.e-ti { fill: var(--chart-ti); font-size: 13px; } .pc-end.e-pm { fill: var(--chart-poly); } .pc-end.e-ks { fill: #C27803; }
.pc-on .pc-ends, .pc-on .pc-dot { opacity: 0; }
.pc-fade { fill: #fff; opacity: 0.78; }
.pc-cross { stroke: var(--navy, #0B1F3A); stroke-width: 1; opacity: 0.55; }
.pc-hd { stroke: #fff; stroke-width: 2; } .pc-hd.h-ti { fill: var(--chart-ti); } .pc-hd.h-pm { fill: var(--chart-poly); } .pc-hd.h-ks { fill: var(--chart-kalshi); }
.pc-hl { font: 600 12px var(--font-ui); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.pc-hl.h-ti { fill: var(--chart-ti); font-size: 13px; } .pc-hl.h-pm { fill: var(--chart-poly); } .pc-hl.h-ks { fill: #C27803; }
.pc-pill { fill: var(--navy, #0B1F3A); }
.pc-pt { fill: #fff; font: 600 10.5px var(--font-mono); }
.legend .k-band::before { background: #64748B; opacity: 0.3; height: 8px; vertical-align: 1px; }
.legend .k-zone::before { background: linear-gradient(90deg, rgba(100,116,139,0.06), rgba(100,116,139,0.14), rgba(100,116,139,0.24)); height: 8px; vertical-align: 1px; }

/* Post on X, on race pages */
.xshare { margin-top: 22px; padding-top: 18px; border-top: var(--hair) solid var(--border-default); display: grid; gap: 6px; max-width: 560px; }
.xshare h3 { margin: 0 0 4px; }
.x-l { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.xshare textarea, .xshare input { width: 100%; box-sizing: border-box; font: 14px/1.45 var(--font-ui); color: var(--text-primary); background: var(--bg-primary); border: var(--hair) solid #C9CDD3; border-radius: var(--radius-chip); padding: 10px 12px; }
.xshare textarea { resize: vertical; min-height: 104px; }
.xshare textarea:focus, .xshare input:focus { outline: 2px solid var(--navy, #0B1F3A); outline-offset: 0; border-color: transparent; }
.x-count { margin: 0; text-align: right; }
.x-count.over { color: var(--party-r); font-weight: 600; }
.x-reply { margin-top: 8px; }
.x-reply > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--navy, #0B1F3A); padding: 4px 0; }
.x-reply[open] { display: grid; gap: 6px; }
.x-err { margin: 0; color: var(--party-r); }
.btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.share { align-items: start; }

/* Outlook: Share button beside each section heading, and its menu */
.sh-h { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sh-h h2 { margin: 0; }
.sh-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: var(--hair) solid #D1D5DB; border-radius: 999px; background: var(--bg-primary); color: var(--navy, #0B1F3A); font: 600 12.5px var(--font-ui); cursor: pointer; }
.sh-btn svg { width: 15px; height: 15px; }
.sh-btn:hover, .sh-btn[aria-expanded="true"] { border-color: var(--navy, #0B1F3A); }
.sh-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: min(440px, 100%); display: grid; gap: 14px; padding: 16px; background: var(--bg-primary); border: var(--hair) solid #D9DEE7; border-radius: 10px; box-shadow: 0 18px 40px rgba(11,31,58,0.18); max-height: min(80vh, 760px); overflow-y: auto; }
.sh-pop[hidden] { display: none; }
.sh-head { display: flex; justify-content: space-between; align-items: center; }
.sh-head b { font: 600 15px var(--font-ui); color: var(--navy, #0B1F3A); }
.sh-x { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--text-secondary); cursor: pointer; padding: 0 4px; }
.sh-thumb { width: 100%; height: auto; border-radius: 6px; border: var(--hair) solid var(--border-default); }
.sh-row { display: grid; gap: 8px; }
.sh-k { font: 500 10.5px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.sh-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sh-link code { flex: 1 1 200px; min-width: 0; font: 12px var(--font-mono); background: var(--bg-surface); border: var(--hair) solid var(--border-default); border-radius: 6px; padding: 8px 10px; overflow-wrap: anywhere; }
.sh-pop .xshare { margin: 0; padding: 0; border: 0; max-width: none; }
.sh-h.sh-sec { align-items: flex-end; }
.sh-h.sh-sec > div > h2 { margin: 0 0 16px; }
.sh-h.sh-sec > .sh-btn { margin-bottom: 16px; }
.sh-pair { display: inline-flex; align-items: center; gap: 10px; }
.sh-foot { margin-top: 16px; justify-content: flex-start; }
.ctl-title.sh-h { align-items: center; }
@media (max-width: 640px) {
  .sh-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 85vh; border-radius: 14px 14px 0 0; padding: 18px max(16px, env(safe-area-inset-left, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)); }
}

/* ==========================================================================
   News Feed & AI Analysis Integration
   ========================================================================== */

.news-band {
  border-top: var(--hair) solid var(--border-default);
}
.news-section-header {
  margin-bottom: 20px;
}
.news-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.news-card {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background: var(--bg-primary);
  border: var(--hair) solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.news-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.news-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.news-card-candidates {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Avatar stack for multiple candidates */
.news-avatar-stack {
  display: inline-flex;
  align-items: center;
}
.news-avatar-stack .cand-avatar,
.news-avatar-stack .cand-initials {
  margin-right: -8px;
  box-shadow: 0 0 0 2px var(--bg-primary);
  transition: transform 0.15s ease, z-index 0.15s ease;
  position: relative;
}
.news-avatar-stack .cand-avatar:hover,
.news-avatar-stack .cand-initials:hover {
  transform: translateY(-2px) scale(1.1);
  z-index: 10;
}

.news-avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  vertical-align: middle;
}

.news-cand-names {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.news-cand-link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.news-cand-link:hover .news-cand-name {
  color: var(--navy, #0B1F3A);
  text-decoration: underline;
}
.news-cand-sep {
  color: var(--text-tertiary);
  opacity: 0.6;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.news-source-tag {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 2px 7px;
  border-radius: 3px;
  border: var(--hair) solid var(--border-default);
}
.news-date {
  color: var(--text-secondary);
}

.news-card-title {
  margin: 0 0 10px;
  font-size: 15.5px;
  line-height: 1.45;
  font-weight: 600;
}
.news-card-title a {
  color: var(--text-primary);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}
.news-card-title a:hover {
  color: var(--navy, #0B1F3A);
  text-decoration: underline;
}

/* Discreet Summary Accordion */
.news-summary-details {
  margin: 2px 0 10px;
}

.news-summary-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 2px 0;
  list-style: none;
  transition: color 0.15s ease;
}
.news-summary-toggle::-webkit-details-marker {
  display: none;
}
.news-summary-toggle::after {
  content: '▾';
  font-size: 10px;
  color: var(--text-tertiary);
  transition: transform 0.2s ease, color 0.15s ease;
}
.news-summary-details[open] > .news-summary-toggle::after {
  transform: rotate(180deg);
}
.news-summary-toggle:hover {
  color: var(--text-primary);
}
.news-summary-toggle:hover::after {
  color: var(--text-primary);
}

.news-summary-content {
  margin-top: 6px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: var(--hair) solid var(--border-default);
  border-radius: var(--radius-chip);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-primary);
}
.news-summary-content p {
  margin: 0 0 6px;
}
.news-summary-content p:last-child {
  margin-bottom: 0;
}
.news-summary-list {
  margin: 4px 0 6px 18px;
  padding: 0;
}
.news-summary-list li {
  margin-bottom: 3px;
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 2px;
}
.news-source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}
.news-source-link:hover {
  color: var(--navy, #0B1F3A);
  text-decoration: underline;
}
.news-ext-arrow {
  font-size: 13px;
  transition: transform 0.15s ease;
}
.news-source-link:hover .news-ext-arrow {
  transform: translateX(2px);
}

/* Outlook: the TruthIndex leads where both venues price the same outcome; the venues' own prices sit underneath in small type */
.otile .tl-big { font: 600 40px/1 var(--font-poster, var(--font-ui)); color: var(--navy, #0B1F3A); margin: 2px 0; }
.otile .tl-big.D { color: var(--party-d); } .otile .tl-big.R { color: var(--party-r); }
.otile .tl-venues { font: 12px var(--font-mono); color: var(--text-secondary); }
.bp-ti { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.bp-tv { font: 600 44px/1 var(--font-poster, var(--font-ui)); color: var(--navy, #0B1F3A); }
.bp-DD .bp-tv { color: var(--party-d); } .bp-RR .bp-tv { color: var(--party-r); }
.bp-tl { font-size: 13px; color: var(--text-secondary); }
.bp-src { margin-top: 8px; font: 12.5px var(--font-mono); color: var(--text-secondary); }
.bp-src a { color: inherit; text-decoration: none; }
.bp-src a:hover { color: var(--text-primary); text-decoration: underline; }
@media (max-width: 640px) {
  .otile .tl-big { font-size: 34px; }
  .bp-tv { font-size: 28px; }
  .bp-ti { flex-wrap: wrap; gap: 2px 8px; }
  .bp-src { font-size: 11px; overflow-wrap: anywhere; }
  .bp-cell { min-width: 0; }
}

/* Source links to the venues: quiet text, set apart from the page's own actions */
.src-link { display: inline-block; margin-top: 10px; font-size: 12.5px; color: var(--text-secondary); text-decoration: none; }
.src-link:hover { color: var(--text-primary); text-decoration: underline; }

/* Site search: the header button and the dialog it opens */
.gs-btn { display: inline-flex; align-items: center; gap: 7px; flex: none; margin-left: 18px; min-height: 36px; padding: 0 12px; border: 1px solid rgba(255,255,255,0.28); border-radius: 6px; background: transparent; color: #fff; font: 600 13px var(--font-ui); cursor: pointer; }
.gs-btn svg { width: 16px; height: 16px; }
.gs-btn:hover, .gs-btn:focus-visible { border-color: #fff; }
@media (max-width: 1180px) {
  .js .gs-btn { margin-left: auto; order: 5; min-height: 44px; }
  .js .site-header .menu-btn { margin-left: 8px; order: 6; }
}
/* Icon only wherever the full navigation needs the room */
@media (max-width: 1600px) { .gs-btn .lbl { display: none; } .gs-btn { padding: 0 10px; margin-left: 14px; } }
@media (max-width: 1180px) { .gs-btn .lbl { display: inline; } }
@media (max-width: 480px) { .gs-btn .lbl { display: none; } .js .gs-btn { padding: 0 11px; } }
html.gs-on { overflow: hidden; }
.gs { position: fixed; inset: 0; z-index: 100; background: rgba(11,31,58,0.55); display: flex; justify-content: center; align-items: flex-start; padding: max(8vh, 16px) 16px 16px; }
.gs-panel { width: min(640px, 100%); max-height: min(78vh, 680px); display: flex; flex-direction: column; background: var(--bg-primary); border-radius: 12px; box-shadow: 0 24px 60px rgba(11,31,58,0.35); overflow: hidden; }
.gs-bar { display: flex; gap: 8px; align-items: center; padding: 12px; border-bottom: var(--hair) solid var(--border-default); }
.gs-bar input { flex: 1 1 auto; min-width: 0; font: 16px var(--font-ui); padding: 10px 12px; border: var(--hair) solid #C9CDD3; border-radius: 8px; background: var(--bg-primary); color: var(--text-primary); }
.gs-bar input:focus { outline: 2px solid var(--green-600, #059669); outline-offset: 0; }
.gs-x { flex: none; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--text-secondary); font: 600 13px var(--font-ui); cursor: pointer; }
.gs-list { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; }
.gs-list:empty { display: none; }
.gs-list a { display: grid; grid-template-columns: 78px minmax(0, 1fr); column-gap: 10px; padding: 9px 14px; text-decoration: none; color: var(--text-primary); }
.gs-list [aria-selected="true"] a { background: var(--tint, #F2F5FA); box-shadow: inset 3px 0 0 var(--navy, #0B1F3A); }
.gs-list a:hover { background: var(--tint, #F2F5FA); }
.gs-g { grid-row: span 2; font: 500 10px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); padding-top: 3px; }
.gs-t { font-weight: 600; }
.gs-m { font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-msg { margin: 0; padding: 12px 14px 14px; }

/* Table fixes: headers that stay in view on long desktop tables, one set of column widths for every
   Election night block, the message under an emptied search, and the sort menu on phones */
@media (min-width: 1100px) {
  .table-wrap:has(> table.rt) { overflow: visible; }
  table.rt thead th { position: sticky; top: calc(var(--nav-height) + env(safe-area-inset-top, 0px)); z-index: 3; }
  table.live-t { table-layout: fixed; }
  table.live-t th:nth-child(1) { width: 26%; } table.live-t th:nth-child(2) { width: 18%; } table.live-t th:nth-child(3) { width: 11%; }
  table.live-t th:nth-child(4) { width: 11%; } table.live-t th:nth-child(5) { width: 9%; } table.live-t th:nth-child(6) { width: 8%; }
  table.live-t th:nth-child(7) { width: 7%; } table.live-t th:nth-child(8) { width: 5%; } table.live-t th:nth-child(9) { width: 5%; }
  table.live-t td { overflow: hidden; text-overflow: ellipsis; }
}
.t-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; padding: 14px 16px; border: var(--hair) dashed var(--border-default); border-radius: var(--radius-card); color: var(--text-secondary); font-size: 14px; }
.t-empty[hidden] { display: none; }
.m-sort { display: none; }
@media (max-width: 700px) {
  .m-sort { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 500 12px var(--font-mono); letter-spacing: 0.04em; color: var(--text-secondary); }
  .m-sort select { font: 14px var(--font-ui); min-height: 40px; padding: 0 10px; border: var(--hair) solid #C9CDD3; border-radius: 6px; background: var(--bg-primary); color: var(--text-primary); }
}
/* House: each state's districts by rating in one bar, and the toss-ups beside the party counts */
.ms-bar { display: inline-flex; width: 140px; max-width: 30vw; height: 10px; border-radius: 3px; overflow: hidden; gap: 1px; background: var(--bg-surface); vertical-align: middle; }
.ms-bar i { display: block; min-width: 3px; }
.ms-bar .s-safe-D { background: var(--r-safe-D); } .ms-bar .s-likely-D { background: var(--r-likely-D); } .ms-bar .s-lean-D { background: var(--r-lean-D); }
.ms-bar .s-tossup { background: var(--r-tossup); } .ms-bar .s-other { background: var(--r-other); } .ms-bar .s-none { background: var(--map-none); }
.ms-bar .s-lean-R { background: var(--r-lean-R); } .ms-bar .s-likely-R { background: var(--r-likely-R); } .ms-bar .s-safe-R { background: var(--r-safe-R); }
.ms-seats .T { color: #7A5C00; }
.rc-move { margin-top: 6px; color: var(--text-secondary); }
/* House map: a tile per state, a square per district */
.housemap .hm-tile { fill: var(--bg-surface, #F4F6FA); stroke: var(--border-default, #E2E6EE); stroke-width: 1; }
.housemap .hm-st.off .hm-tile { fill: transparent; stroke-dasharray: 3 3; }
.housemap .hm-lb { font: 700 11px var(--font-mono); fill: var(--text-primary); }
.housemap .hm-n { font: 500 10px var(--font-mono); fill: var(--text-tertiary); text-anchor: end; }
.housemap a rect { stroke: #fff; stroke-width: 0.5; }
.housemap a:hover rect, .housemap a:focus-visible rect { stroke: var(--navy, #0B1F3A); stroke-width: 1.5; }
@media (max-width: 640px) { .ms-dots:has(> .ms-bar) { display: inline-flex; margin-left: auto; } .ms-bar { width: 64px; } }
.housemap .hm-strips { display: none; list-style: none; margin: 0; padding: 0; }
@media (max-width: 640px) {
  .housemap .hm-grid { display: none; }
  .housemap .hm-strips { display: grid; gap: 6px; }
  .hm-strips li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: start; }
  .hm-ab { font: 700 11px var(--font-mono); color: var(--text-primary); padding-top: 1px; }
  .hm-sqs { display: flex; flex-wrap: wrap; gap: 3px; }
  .hm-sq { width: 13px; height: 13px; border-radius: 2px; background: var(--map-none); }
  .hm-sq.s-safe-D { background: var(--r-safe-D); } .hm-sq.s-likely-D { background: var(--r-likely-D); }
  .hm-sq.s-lean-D { background: repeating-linear-gradient(45deg, var(--r-lean-D-line) 0 2px, var(--r-lean-D) 2px 5px); }
  .hm-sq.s-tossup { background: var(--r-tossup); } .hm-sq.s-other { background: var(--r-other); }
  .hm-sq.s-lean-R { background: repeating-linear-gradient(45deg, var(--r-lean-R-line) 0 2px, var(--r-lean-R) 2px 5px); }
  .hm-sq.s-likely-R { background: var(--r-likely-R); } .hm-sq.s-safe-R { background: var(--r-safe-R); }
}
/* Candidate names and state pages linked from tables */
a.cand-link { color: inherit; font-weight: inherit; text-decoration: underline; text-decoration-color: var(--border-default, #CBD2DC); text-underline-offset: 2px; }
a.cand-link:hover { text-decoration-color: currentColor; }
.ms-st-link { margin: 10px 16px 6px; font-size: 13px; }
.housemap a .hm-lb { text-decoration: underline; }
/* Candidate profile: the party as a small chip in the tag, the subject first and highlighted in the
   race card with their own TruthIndex™ line, a clear heading scale and citations that wrap */
.cand-profile-info .eyebrow.tag .pty { background: transparent; color: inherit; padding: 0; font: inherit; letter-spacing: inherit; }
.cand-profile-info .eyebrow.tag .pty::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; background: var(--text-tertiary); }
.cand-profile-info .eyebrow.tag .pty.D::before { background: var(--party-d); } .cand-profile-info .eyebrow.tag .pty.R::before { background: var(--party-r); }
.rc-side.rc-me .rc-name { font-weight: 700; }
.rc-side.rc-me .rc-p { font-size: 1.25em; }
.rc-trend { display: grid; gap: 4px; margin-top: 12px; }
.rc-trend svg { width: 100%; max-width: 360px; height: 40px; }
.cand-bio > h2 { margin-bottom: 18px; }
.cand-bio h3 { font: 600 13px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary); margin: 28px 0 10px; }
.cand-bio h4 { font-size: 15px; margin: 20px 0 8px; }
.cand-bio p { max-width: 68ch; margin: 0 0 14px; }
.cand-sources a { overflow-wrap: anywhere; word-break: break-word; }

/* News: a short front page. A lead story with its picture beside a dated list, the rest behind
   "More coverage"; outlets in small caps, candidates as small chips, a seven-day pulse in the header */
.nw .nw-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.nw .nw-head h2 { margin-bottom: 0; }
.nw-pulse { margin: 0; display: flex; align-items: flex-end; gap: 10px; flex: 0 0 auto; }
.nw-bars { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.nw-bars span { width: 7px; background: var(--navy, #0B1F3A); border-radius: 1.5px 1.5px 0 0; opacity: .85; }
.nw-bars span.z { background: var(--border-default); opacity: 1; }
.nw-pulse figcaption { font: 12px/1.3 var(--font-mono); color: var(--text-secondary); max-width: 92px; }
.nw-pulse figcaption b { display: block; font: 600 22px/1 var(--font-poster, var(--font-ui)); color: var(--text-primary); }
.nw-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.nw-filter button { font: 500 13px var(--font-ui); padding: 5px 10px; border: var(--hair) solid var(--border-default); border-radius: 999px; background: var(--bg-primary); color: var(--text-primary); cursor: pointer; }
.nw-filter button b { font: 500 11px var(--font-mono); color: var(--text-secondary); margin-left: 4px; }
.nw-filter button.D { box-shadow: inset 3px 0 0 var(--party-d); } .nw-filter button.R { box-shadow: inset 3px 0 0 var(--party-r); }
.nw-filter button.on { background: var(--navy, #0B1F3A); border-color: var(--navy, #0B1F3A); color: #fff; }
.nw-filter button.on b { color: rgba(255,255,255,.75); }
.nw-filter button:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }
.nw-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: start; }
.nw-grid.solo { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.nw-lead { background: var(--bg-primary); border: var(--hair) solid var(--border-default); border-radius: var(--radius-card); overflow: hidden; }
.nw-img { display: block; aspect-ratio: 16 / 9; background: var(--bg-raised); }
.nw-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nw-lead-body { padding: 18px 20px 20px; border-top: 3px solid var(--navy, #0B1F3A); }
.nw-lead.has-img .nw-lead-body { border-top: 0; }
.nw-flag { font: 600 10.5px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--green-600); }
.nw-lead h3 { font: 600 22px/1.22 var(--font-ui); letter-spacing: -0.01em; margin: 6px 0 10px; text-wrap: balance; }
.nw-lead h3 a, .nw-title { color: var(--text-primary); text-decoration: none; }
.nw-lead h3 a:hover, .nw-title:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.nw-deck { margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nw-list { list-style: none; margin: 0; padding: 0; }
.nw-day { font: 600 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); padding: 14px 0 6px; border-bottom: var(--hair) solid var(--border-default); }
.nw-list > .nw-day:first-child { padding-top: 0; }
.nw-item { padding: 12px 0 12px 14px; border-bottom: var(--hair) solid var(--border-default); position: relative; }
.nw-item::before { content: ''; position: absolute; left: 0; top: 19px; width: 5px; height: 5px; border-radius: 50%; background: var(--border-default); }
.nw-item:hover::before { background: var(--navy, #0B1F3A); }
.nw-title { display: block; font: 600 15.5px/1.35 var(--font-ui); margin-bottom: 4px; }
.nw-item .nw-deck { -webkit-line-clamp: 2; font-size: 13.5px; margin-bottom: 6px; }
.nw-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--text-secondary); }
.nw-outlet { font: 600 11px var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--text-primary); }
.nw-kind { font: 500 10.5px var(--font-mono); padding: 1px 6px; border-radius: var(--radius-chip); background: var(--bg-raised); color: var(--text-secondary); }
.nw-meta time { font-family: var(--font-mono); }
.nw-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.nw-chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 1px; border-radius: 999px; background: var(--bg-surface); border: var(--hair) solid var(--border-default); color: var(--text-primary); text-decoration: none; font-size: 12px; }
.nw-chip img, .nw-ini { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: 0 0 20px; }
.nw-ini { display: inline-grid; place-items: center; font: 600 8.5px var(--font-ui); background: var(--bg-raised); color: var(--text-secondary); }
.nw-chip.D img, .nw-ini.D { box-shadow: 0 0 0 1.5px var(--party-d); } .nw-chip.R img, .nw-ini.R { box-shadow: 0 0 0 1.5px var(--party-r); }
a.nw-chip:hover { border-color: var(--text-secondary); }
.nw-also { flex-basis: 100%; font-size: 12px; }
.nw-also a { color: var(--text-secondary); }
.nw-more { margin-top: 4px; }
.nw-more > summary { cursor: pointer; list-style: none; padding: 12px 0; font: 600 13px var(--font-ui); color: var(--text-primary); }
.nw-more > summary::-webkit-details-marker { display: none; }
.nw-more > summary::after { content: ' +'; font-family: var(--font-mono); color: var(--text-secondary); }
.nw-more[open] > summary::after { content: ' \2212'; }
.nw-more > summary b { font: 500 11px var(--font-mono); color: var(--text-secondary); margin-left: 4px; }
.nw [data-nw-hidden] { display: none !important; }
@media (max-width: 860px) {
  .nw-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 640px) {
  .nw .nw-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .nw-lead h3 { font-size: 19px; }
  .nw-lead-body { padding: 14px 16px 16px; }
  .nw-filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .nw-filter button { flex: 0 0 auto; }
}

/* Divergence: gap of the day, centred dumbbells, gap radar and convergence */
.dstats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.dthin { margin: 10px 0 0; }
.gotd { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 0; background: var(--bg-primary); border: var(--hair) solid var(--border-default); border-radius: var(--radius-card); overflow: hidden; }
.gotd-main { padding: 22px 24px; border-top: 3px solid var(--navy, #0B1F3A); }
.gotd .eyebrow { color: var(--green-600); }
.gotd h3 { font: 600 26px/1.15 var(--font-poster, var(--font-ui)); text-transform: uppercase; letter-spacing: .01em; margin: 6px 0 2px; }
.gotd h3 a { color: var(--navy, #0B1F3A); text-decoration: none; }
.gotd h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.gotd-o { margin: 0 0 14px; color: var(--text-secondary); font-size: 14px; }
.gotd-nums { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: end; }
.gv span { display: block; font: 600 10.5px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); }
.gv b { display: block; font: 600 40px/1 var(--font-poster, var(--font-ui)); margin-top: 4px; }
.gv.poly b { color: var(--chart-poly); } .gv.kalshi b { color: #B45309; } .gv.kalshi { text-align: right; }
.gv.gap { text-align: center; padding: 0 6px 2px; }
.gv.gap b { font-size: 22px; color: var(--text-primary); }
.gv.gap em { display: block; font: 500 10.5px var(--font-mono); font-style: normal; color: var(--text-secondary); margin-top: 4px; max-width: 120px; }
.gotd-chart { margin: 16px 0 0; }
.gotd-chart svg { width: 100%; height: auto; display: block; }
.gotd-chart polyline { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.gotd-chart polyline.poly { stroke: var(--chart-poly); } .gotd-chart polyline.kalshi { stroke: var(--chart-kalshi); }
.gotd-chart polygon.gap { fill: var(--bg-raised); }
.gotd-chart text { font: 10px var(--font-mono); fill: var(--text-secondary); }
.gotd-rules { padding: 22px 24px; background: var(--bg-surface); border-left: var(--hair) solid var(--border-default); display: grid; gap: 14px; align-content: start; }
.gotd-rules h4 { margin: 0; font: 600 10.5px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); }
.gr { padding-left: 12px; border-left: 3px solid var(--border-default); }
.gr.poly { border-color: var(--chart-poly); } .gr.kalshi { border-color: var(--chart-kalshi); }
.gr-v { font: 600 12px var(--font-ui); }
.gr p { margin: 4px 0 6px; font-size: 13px; line-height: 1.5; color: var(--text-primary); }
.gr a { font-size: 12px; color: var(--text-secondary); }
.db-track.c { background: repeating-linear-gradient(to right, #E5E7EB 0 1px, transparent 1px 25%); background-size: calc(100% - 1px) 100%; }
.db-track .db-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--green-500); opacity: .55; }
.db-axis .db-track i:nth-child(3) { color: var(--text-primary); }
.db-held { display: block; width: max-content; margin: 3px 0 0 auto; font: 600 9.5px var(--font-mono); font-style: normal; padding: 1px 5px; border-radius: var(--radius-chip); background: var(--navy, #0B1F3A); color: #fff; vertical-align: 2px; }
.db-note { margin: 8px 0 0; }
.dcharts { gap: 28px; align-items: start; }
.dradar, .dconv { margin: 0; }
.dradar svg, .dconv svg { width: 100%; height: auto; display: block; background: var(--bg-primary); border: var(--hair) solid var(--border-default); border-radius: var(--radius-card); }
.dradar .g, .dconv .g { stroke: var(--border-default); stroke-width: 1; }
.dradar .t, .dconv .t { font: 10px var(--font-mono); fill: var(--text-secondary); }
.dradar .thr, .dconv .thr { stroke: #D97706; stroke-width: 1.2; stroke-dasharray: 4 3; }
.dradar .thr-t, .dconv .thr-t { fill: #B45309; }
.dradar .zone { fill: #FEF6E0; }
.dradar circle { stroke-width: 1; transition: opacity .15s; }
.dradar circle.n { fill: #94A3B8; fill-opacity: .25; stroke: #94A3B8; stroke-opacity: .5; }
.dradar circle.w-D { fill: var(--party-d); fill-opacity: .6; stroke: var(--party-d); stroke-opacity: .9; }
.dradar circle.w-R { fill: var(--party-r); fill-opacity: .6; stroke: var(--party-r); stroke-opacity: .9; }
.dradar circle.w-N { fill: #64748B; fill-opacity: .6; stroke: #64748B; stroke-opacity: .9; }
.dradar circle.thin { fill: none; }
.dradar circle.thin.n { stroke: #9CA3AF; stroke-opacity: .8; }
.dradar circle.over { stroke-dasharray: 2 2; }
.dradar a:hover circle, .dradar a:focus circle { fill: var(--green-500); fill-opacity: .9; stroke: var(--green-700); stroke-opacity: 1; }
.dradar .mbar { stroke: var(--navy, #0B1F3A); stroke-width: 2; }
.dradar .mlb, .dconv .lv { font: 600 10px var(--font-mono); fill: var(--navy, #0B1F3A); paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.dradar .lb { font: 600 10px var(--font-ui); fill: var(--text-primary); paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.dradar figcaption, .dconv figcaption { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; }
.dk { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.dk i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dk i.k-wD { background: rgba(47, 95, 208, .6); border: 1px solid var(--party-d); }
.dk i.k-wR { background: rgba(200, 54, 59, .6); border: 1px solid var(--party-r); }
.dk i.k-wN { background: rgba(100, 116, 139, .6); border: 1px solid #64748B; }
.dk i.k-n { background: rgba(148, 163, 184, .25); border: 1px solid rgba(148, 163, 184, .7); }
.dk i.k-liq { background: rgba(11, 31, 58, .45); border: 1px solid var(--navy, #0B1F3A); }
.dk i.k-thin { border: 1px solid #9CA3AF; }
.dk i.k-thr { width: 16px; height: 0; border-radius: 0; border-top: 1.5px dashed #D97706; }
.dk i.k-mbar, .dk i.k-med { width: 16px; height: 2px; border-radius: 0; background: var(--navy, #0B1F3A); }
.dk i.k-band { width: 16px; height: 10px; border-radius: 2px; background: var(--green-50); }
.dconv { position: relative; outline: none; }
.dconv:focus-visible svg { outline: 2px solid var(--green-500); outline-offset: 2px; }
.dconv .band { fill: var(--green-50); }
.dconv .med { fill: none; stroke: var(--navy, #0B1F3A); stroke-width: 2; stroke-linejoin: round; }
.dconv .end { fill: var(--navy, #0B1F3A); }
.dconv .chg { font: 600 13px var(--font-mono); fill: var(--navy, #0B1F3A); paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.dconv .xh { stroke: var(--navy, #0B1F3A); stroke-opacity: .35; }
.dconv .xd { fill: #fff; stroke: var(--navy, #0B1F3A); stroke-width: 2; }
.dc-tip { position: absolute; z-index: 2; pointer-events: none; transform: translate(-50%, -100%); margin-top: -10px; background: var(--navy, #0B1F3A); color: #fff; font: 12px/1.45 var(--font-ui); padding: 7px 9px; border-radius: 6px; white-space: nowrap; }
.dc-tip b { font-family: var(--font-mono); font-weight: 600; }
.dtake { margin: 10px 0 0; font-size: 14px; }
.dtake b { font-family: var(--font-mono); }

/* How to read this chart: a collapsed guide under a chart's title */
.howto { margin: 6px 0 10px; font-size: 13.5px; }
.howto > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; color: var(--green-700); font-weight: 600; font-size: 12.5px; }
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary::before { content: "?"; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; font: 700 10px/1 var(--font-ui); }
.howto > summary:hover { text-decoration: underline; }
.howto > summary:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; border-radius: 3px; }
.howto[open] > summary { margin-bottom: 6px; }
.howto-body { max-width: 72ch; padding: 10px 14px; background: var(--bg-primary, #fff); border: var(--hair, 1px) solid var(--border-default); border-left: 3px solid var(--green-500); border-radius: 0 var(--radius-card) var(--radius-card) 0; color: var(--text-primary); }
.howto-body p { margin: 0 0 8px; line-height: 1.55; }
.howto-body .howto-more { font-size: 12.5px; font-weight: 600; }
@media (max-width: 860px) {
  .gotd { grid-template-columns: minmax(0, 1fr); }
  .gotd-rules { border-left: 0; border-top: var(--hair) solid var(--border-default); }
}
@media (max-width: 640px) {
  .gotd-main, .gotd-rules { padding: 16px; }
  .gotd h3 { font-size: 22px; }
  .gv b { font-size: 30px; }
  .gv.gap b { font-size: 18px; }
}

/* Map time machine: play button beside the date slider */
.tl-play { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--navy, #0B1F3A); color: #fff; display: inline-grid; place-items: center; cursor: pointer; }
.tl-play svg { width: 14px; height: 14px; fill: currentColor; }
.tl-play .i-pause, .tl-play[aria-pressed="true"] .i-play { display: none; }
.tl-play[aria-pressed="true"] .i-pause { display: inline; }
.tl-play:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }
.timeline.playing .tl-label { font-weight: 600; color: var(--text-primary); }
.usmap .shapes path, .usmap .callouts rect { transition: fill .12s linear; }
@media (prefers-reduced-motion: reduce) { .usmap .shapes path, .usmap .callouts rect { transition: none; } }

/* Path to 51 and Path to 218 */
.p51 { margin-top: 20px; }
.p51-tabs { display: inline-flex; align-self: start; border: var(--hair) solid #C9CDD3; border-radius: var(--radius-chip); overflow: hidden; }
.p51-tabs .tl-btn.on { background: var(--navy, #0B1F3A); }
.p51-box { display: grid; gap: 0; }
.p51-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.p51-head h3 { margin: 4px 0 4px; font: 600 22px/1.1 var(--font-poster, var(--font-ui)); text-transform: uppercase; color: var(--navy, #0B1F3A); }
.p51-head p { margin: 0; max-width: 520px; }
.p51 .eyebrow { color: var(--green-600); }
.p51-tally { display: flex; gap: 22px; align-items: flex-end; }
.p51-n { display: grid; justify-items: center; }
.p51-n b { font: 600 40px/1 var(--font-poster, var(--font-ui)); transition: transform .15s; }
.p51-n span { font: 600 10.5px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); margin-top: 4px; }
.p51-n.D b { color: var(--party-d); } .p51-n.R b { color: var(--party-r); } .p51-n.T b { color: #8A6A00; font-size: 26px; }
.p51-box.won-D .p51-n.D b, .p51-box.won-R .p51-n.R b { transform: scale(1.12); }
.p51-strip { position: relative; display: grid; grid-template-columns: repeat(100, 1fr); gap: 2px; margin: 18px 0 8px; height: 26px; }
.p51-strip i { border-radius: 2px; transition: background-color .2s; }
.p51-strip .b-D, .p51-bar .b-D { background: var(--r-safe-D); } .p51-strip .b-R, .p51-bar .b-R { background: var(--r-safe-R); }
.p51-strip .b-Dp { background: var(--party-d); box-shadow: inset 0 0 0 2px #fff; outline: 1.5px solid var(--party-d); }
.p51-strip .b-Rp { background: var(--party-r); box-shadow: inset 0 0 0 2px #fff; outline: 1.5px solid var(--party-r); }
.p51-strip .b-T, .p51-bar .b-T { background: var(--r-tossup); } .p51-strip .b-O, .p51-bar .b-O { background: var(--r-other, #9CA3AF); }
.p51-bar { position: relative; display: flex; gap: 2px; margin: 18px 0 8px; height: 26px; }
.p51-bar i { flex: 0 0 auto; flex-basis: 0; min-width: 0; border-radius: 2px; transition: flex-grow .25s; }
.p51-bar .b-Dp { background: var(--party-d); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 2px, transparent 2px 6px); }
.p51-bar .b-Rp { background: var(--party-r); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 2px, transparent 2px 6px); }
.p51-maj { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--text-primary); }
.p51-maj em { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font: 600 10px var(--font-mono); font-style: normal; white-space: nowrap; color: var(--text-primary); }
.p51-status { margin: 14px 0 14px; font-size: 15px; }
.p51-status b.D { color: var(--party-d); } .p51-status b.R { color: var(--party-r); }
.p51-seats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.p51-seat { border: var(--hair) solid var(--border-default); border-radius: var(--radius-card); padding: 10px 12px 12px; background: var(--bg-primary); border-top: 3px solid var(--r-tossup); transition: border-color .2s; }
.p51-seat.r-lean-D { border-top-color: var(--r-lean-D-line); } .p51-seat.r-lean-R { border-top-color: var(--r-lean-R-line); }
.p51-seat.called { border-top-color: var(--border-default); }
.p51-seat.changed { box-shadow: inset 0 0 0 1px var(--navy, #0B1F3A); }
.p51-group { display: grid; gap: 8px; margin-top: 6px; }
.p51-group + .p51-group { margin-top: 16px; }
.p51-group h4 { margin: 0; display: flex; align-items: center; gap: 8px; font: 600 13px var(--font-ui); color: var(--text-primary); }
.p51-group h4 .muted { font: 500 12px var(--font-mono); }
details.p51-group > summary { cursor: pointer; list-style: none; }
details.p51-group > summary::-webkit-details-marker { display: none; }
details.p51-group > summary h4::after { content: 'Show'; margin-left: auto; font: 500 12px var(--font-ui); color: var(--text-secondary); text-decoration: underline; }
details.p51-group[open] > summary h4::after { content: 'Hide'; }
.p51-seat.r-likely-D { border-top-color: var(--r-likely-D); } .p51-seat.r-likely-R { border-top-color: var(--r-likely-R); }
.p51-race { font: 600 13.5px var(--font-ui); color: var(--text-primary); text-decoration: none; }
.p51-race:hover { text-decoration: underline; }
.p51-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.p51-pick button { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border-radius: var(--radius-chip); border: 1px solid var(--border-default); background: var(--bg-surface); cursor: pointer; font: 500 13px var(--font-ui); color: var(--text-primary); min-height: 44px; }
.p51-pick button b { font-size: 11px; font-weight: 500; color: var(--text-secondary); }
.p51-pick button.D { border-left: 3px solid var(--party-d); } .p51-pick button.R { border-left: 3px solid var(--party-r); } .p51-pick button.O { border-left: 3px solid var(--r-other); }
.p51-pick button.D.on { background: var(--party-d); border-color: var(--party-d); color: #fff; }
.p51-pick button.R.on { background: var(--party-r); border-color: var(--party-r); color: #fff; }
.p51-pick button.O.on { background: var(--r-other); border-color: var(--r-other); color: #fff; }
.p51-pick button.on b { color: rgba(255,255,255,.8); }
.p51-pick button:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }
.p51-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.seatarc circle.p51-D { fill: var(--party-d); stroke: #fff; stroke-width: 1.5; }
.seatarc circle.p51-R { fill: var(--party-r); stroke: #fff; stroke-width: 1.5; }
.seatarc circle.p51-U { fill: var(--r-tossup); stroke: #fff; stroke-width: 1.5; }
.seatarc circle.p51-O { fill: var(--r-other); stroke: #fff; stroke-width: 1.5; }
.p51 .p51-tabs { justify-self: start; }
.p51-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 2px 0 0; font-size: 12px; color: var(--text-secondary); }
.p51-key i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -2px; margin-right: 5px; }
.p51-key .k-fix { background: var(--r-safe-D); } .p51-key .k-call { background: #fff; box-shadow: inset 0 0 0 2px var(--party-d); } .p51-key .k-open { background: var(--r-tossup); }
.p51-key .k-call-bar { background: var(--party-d) repeating-linear-gradient(45deg, rgba(255,255,255,.4) 0 2px, transparent 2px 5px); }
@media (max-width: 640px) {
  .p51-tally { width: 100%; justify-content: space-between; }
  .p51-n b { font-size: 32px; }
  .p51-strip { height: 20px; gap: 1px; }
}

/* Share menus: the embed codes, folded under one line */
.sh-embed { display: grid; gap: 8px; border-top: var(--hair) solid var(--border-default); padding-top: 12px; }
.sh-embed > summary { cursor: pointer; list-style: none; }
.sh-embed > summary::-webkit-details-marker { display: none; }
.sh-embed > summary::before { content: '\25B8'; display: inline-block; margin-right: 6px; transition: transform .15s; }
.sh-embed[open] > summary::before { transform: rotate(90deg); }
.sh-embed[open] { gap: 8px; }
.sh-embed .embed-code { margin: 0; max-height: 7em; }
.sh-embed p { margin: 0; }

/* Rating names: in full where there is room, the short form on phones */
.rn-s { display: none; }
@media (max-width: 640px) { .rn-l { display: none; } .rn-s { display: inline; } }

/* Freshness pill beside the breadcrumb: green when the prices are recent, amber after 15 minutes, red after an hour */
.crumb-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.crumb-row .crumbs { margin-bottom: 16px; }
.fresh { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 16px auto; font: 500 11.5px var(--font-mono); color: var(--text-secondary); white-space: nowrap; }
.fresh i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 3px rgba(5,150,105,0.15); }
.fresh b { font-weight: 600; color: var(--text-primary); }
.fresh.late i { background: #D99A0B; box-shadow: 0 0 0 3px rgba(217,154,11,0.18); }
.fresh.old i { background: #C8363B; box-shadow: 0 0 0 3px rgba(200,54,59,0.15); }
.fresh.old b { color: #A12A2F; }
@media (prefers-reduced-motion: no-preference) { .fresh:not(.late):not(.old) i { animation: fresh-pulse 2.4s ease-in-out infinite; } }
@keyframes fresh-pulse { 50% { box-shadow: 0 0 0 5px rgba(5,150,105,0.04); } }

/* TruthIndex™: always DM Sans Bold in its own case, the ™ underlined in green, whatever the text around it */
.truthindex { font-family: var(--font-display); font-weight: 700; text-transform: none; letter-spacing: 0.005em; white-space: nowrap; font-style: normal; }
h1 .truthindex, h2 .truthindex, h3 .truthindex, .tl-h .truthindex { letter-spacing: -0.005em; }
.truthindex .tm { text-decoration: underline; text-decoration-color: #00FF00; text-underline-offset: -4px; text-decoration-thickness: 2px; }
/* Inside charts (SVG text) */
.pc-ti { font-family: var(--font-display); font-weight: 700; text-transform: none; letter-spacing: 0; }
.pc-tm { text-decoration: underline; text-decoration-color: #00FF00; text-decoration-thickness: 2px; }
/* Phone table cards, where the label comes from the cell's data-label */
@media (max-width: 700px) { table.rt .rt-ti[data-label="TruthIndex™"]::before { font: 700 10.5px var(--font-display); letter-spacing: 0; text-transform: none; color: var(--text-secondary); } }
