/* Electoral Meridian. Ivory paper, navy ink, gold rules. Party colors appear only on marks and data. */
:root {
  --paper: #FAF8F3;
  --paper-2: #F3EFE6;
  --white: #FFFFFF;
  --rule: #E4E0D5;
  --rule-strong: #CCC6B6;
  --ink: #0B2538;
  --text: #182B38;
  --muted: #526471;
  --gold: #B08A42;
  --gold-text: #7E6228;
  --d: #2A5C99;
  --r: #B8382F;
  --o: #0F8A70;
  --d-soft: #AFC4DE;
  --r-soft: #E6B7B2;
  --none: #E7E3D8;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 12px; }
body { margin: 0; background: var(--paper); color: var(--text); font: 16px/1.55 var(--sans); border-top: 3px solid var(--gold); }
img, svg { display: block; max-width: 100%; }
a { color: var(--ink); text-decoration-color: var(--rule-strong); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--gold); color: var(--gold-text); }
:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 2px; }
main:focus { outline: none; }
h1, h2, h3, h4 { color: var(--ink); font-family: var(--serif); font-weight: 400; margin: 0; }
h1 { font-size: clamp(2.05rem, 4.4vw, 3.1rem); line-height: 1.1; letter-spacing: -.012em; }
h2 { font-size: 1.5rem; line-height: 1.2; }
h3 { font-size: 1.12rem; line-height: 1.3; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
li { margin-bottom: .4em; }
[hidden] { display: none !important; }

.wrap { width: min(100%, 1240px); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: .86em; font-weight: 400; }
.block { display: block; }
.nw { white-space: nowrap; }

/* Masthead */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 18px; }
.identity { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.identity:hover { color: var(--ink); }
.identity img { flex: none; }
.identity-text { display: flex; flex-direction: column; gap: 4px; }
.wordmark { font-family: var(--serif); font-size: 1.85rem; line-height: 1.05; letter-spacing: -.012em; }
.descriptor { font-size: .63rem; letter-spacing: .21em; text-transform: uppercase; color: var(--ink); }
.tagline { margin: 0; font: italic 1rem var(--serif); color: var(--muted); }
.site-nav { border-block: 1px solid var(--rule); }
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav li { margin: 0; flex: none; }
.site-nav a { display: block; padding: 12px 0 10px; font-size: .9rem; text-decoration: none; border-bottom: 2px solid transparent; }
.site-nav a[aria-current] { font-weight: 700; border-bottom-color: var(--gold); }
.freshness { margin: 0; font-size: .78rem; color: var(--muted); white-space: nowrap; flex: none; }
.freshness.is-live::before, .freshness.is-late::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--gold); }
.freshness.is-late { color: var(--r); font-weight: 600; }
.freshness.is-late::before { background: var(--r); }

/* Page opening */
.lead { padding-block: 34px 22px; max-width: 1240px; }
.lead h1 { max-width: 22ch; }
.lead-race h1 { max-width: none; }
.dateline, .crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .55em; }
.standfirst { font-size: 1.12rem; line-height: 1.5; color: var(--text); max-width: 68ch; margin: .75em 0 0; }
.page-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; font-size: .88rem; }

/* Sections */
main > section, main > .columns-2-1, main > .columns-1-2, main > div.wrap:not(.lead) { margin-bottom: 44px; }
.section-head { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 1px solid var(--rule-strong); padding-top: 12px; margin: 0 0 12px; }
.section-head::before { content: ""; position: absolute; top: -2px; left: 0; width: 44px; height: 3px; background: var(--gold); }
.more { font-size: .85rem; white-space: nowrap; }
.section-intro { max-width: 76ch; }
.note { font-size: .84rem; color: var(--muted); line-height: 1.5; margin-top: .7em; }
.columns-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px 44px; align-items: start; }
.columns-1-2 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px 44px; align-items: start; }
.columns-2-1 > * > .section-head:not(:first-child), aside .section-head:not(:first-child), section .section-head:not(:first-child) { margin-top: 34px; }
.flush { margin-bottom: 0; }
.panel { background: var(--white); border: 1px solid var(--rule); border-top: 3px solid var(--gold); }

/* Marks and tags */
.mark { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: 0; flex: none; }
.side-right .mark { margin: 0 0 0 6px; }
.mark-d { background: var(--d); } .mark-r { background: var(--r); } .mark-o { background: var(--o); }
.mark-d-soft { background: var(--d-soft); } .mark-r-soft { background: var(--r-soft); } .mark-none { background: var(--none); }
.key .mark + .mark { margin-left: -3px; }
.tag { color: var(--muted); font-size: .76em; }
.flag { display: inline-block; font-size: .72rem; font-weight: 400; color: var(--gold-text); border: 1px solid var(--rule-strong); border-radius: 2px; padding: 0 .35em; line-height: 1.45; white-space: nowrap; }
.won { color: var(--gold-text); font-weight: 700; font-size: .8em; }

/* Balance of power */
.chambers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chamber { padding: 20px 24px 18px; border-left: 1px solid var(--rule); min-width: 0; }
.chamber:first-child { border-left: 0; }
.chamber-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.chamber-head h2 { font-size: 1.4rem; }
.chamber-head h2 a { text-decoration: none; }
.chamber-head p { margin: 0; font-size: .8rem; color: var(--muted); text-align: right; }
.seat-totals { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.side { display: flex; flex-direction: column; gap: 2px; }
.side-right { align-items: flex-end; text-align: right; }
.party-name { font-size: .82rem; color: var(--muted); }
.figure { font: 600 clamp(2.3rem, 4vw, 3rem)/1 var(--sans); color: var(--ink); letter-spacing: -.02em; }
.seatbar { width: 100%; height: 20px; }
.seg-d { fill: var(--d); } .seg-r { fill: var(--r); } .seg-o { fill: var(--o); }
.seg-d-soft { fill: var(--d-soft); } .seg-r-soft { fill: var(--r-soft); } .seg-none { fill: var(--none); }
.seat-line { stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chamber-status { font-size: .88rem; margin: 10px 0 6px; }
.chamber-status strong { color: var(--ink); }
.chamber-forecast { font-size: .84rem; color: var(--muted); margin: 0; }
.range { white-space: nowrap; }
.key { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: .78rem; color: var(--muted); margin: 10px 0 0; }
.key-line::before { content: ""; display: inline-block; width: 2px; height: 11px; background: var(--ink); margin-right: 7px; vertical-align: -1px; }
.mini-chamber { margin-bottom: 18px; }
.mini-chamber p { font-size: .88rem; margin: 2px 0 6px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data th, .data td { padding: .5rem .6rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; font-weight: 400; }
.data th:first-child, .data td:first-child { padding-left: 0; }
.data th:last-child, .data td:last-child { padding-right: 0; }
.data thead th { font-size: .78rem; font-weight: 600; color: var(--muted); border-bottom-color: var(--rule-strong); vertical-align: bottom; white-space: nowrap; }
.data tbody th { font-weight: 600; color: var(--ink); }
.data tbody th a { text-decoration: none; }
.data tbody th a:hover { text-decoration: underline; }
.data tfoot th, .data tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--rule-strong); }
.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data.compact { font-size: .86rem; }
.data.compact th, .data.compact td { padding-block: .34rem; }
.data tbody tr:hover > * { background: var(--paper-2); }
.panel .data tbody tr:hover > * { background: transparent; }
.row-won th { color: var(--ink); }
.row-leading th { font-weight: 600; }
.row-flagged th, .row-flagged td { color: var(--muted); }
.data thead th .sort { all: unset; cursor: pointer; display: inline-block; }
.data thead th .sort:hover { color: var(--ink); }
.data thead th .sort:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 2px; }
.data thead th[aria-sort] { color: var(--ink); }
.data thead th[aria-sort="ascending"] .sort::after { content: " ▲"; font-size: .7em; }
.data thead th[aria-sort="descending"] .sort::after { content: " ▼"; font-size: .7em; }
.people { min-width: 200px; }
.person { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.person .mark { align-self: center; margin-right: 4px; }
.person-name { overflow: hidden; text-overflow: ellipsis; }
.person-won .person-name { font-weight: 600; }
.person-share { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.person-won .person-share { color: var(--ink); }
.candidates th { font-weight: 400 !important; }
.candidates .row-won th { font-weight: 600 !important; }
.bar-col { width: 34%; vertical-align: middle !important; }
.chart-col { width: 130px; }
.sharebar { width: 100%; height: 6px; }
.share-track { fill: var(--paper-2); }
.fill-d { fill: var(--d); } .fill-r { fill: var(--r); } .fill-o { fill: var(--o); } .fill-yes { fill: var(--ink); } .fill-none { fill: none; }
.link-button { all: unset; cursor: pointer; font-size: .86rem; text-decoration: underline; text-decoration-color: var(--rule-strong); margin-top: 8px; display: inline-block; }
.link-button:hover { color: var(--gold-text); }
.link-button:focus-visible { outline: 2px solid var(--gold-text); }
.updates { list-style: none; padding: 0; font-size: .86rem; }
.updates li { display: flow-root; padding: .3rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.updates time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; }
.chip-list a { text-decoration: none; white-space: nowrap; }
.chip-list a:hover { text-decoration: underline; }
.sub-head { margin: 22px 0 8px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin: 0 0 14px; font-size: .8rem; color: var(--muted); }
.filters label { display: flex; flex-direction: column; gap: 3px; }
.filters-inline label { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; }
.filter-grow { flex: 1 1 220px; }
.filters select, .filters input[type=search] { font: inherit; font-size: .9rem; color: var(--text); background: var(--white); border: 1px solid var(--rule-strong); border-radius: 2px; padding: .4rem .5rem; min-height: 36px; width: 100%; }
.filter-count { font-size: .84rem; padding-bottom: 8px; white-space: nowrap; }

/* Race page */
.forecast-lead { font-size: 1.05rem; margin: 0 0 .3em; }
.forecast-chance { font: 600 1.6rem/1 var(--sans); margin-left: 6px; color: var(--ink); }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 14px; font-size: .88rem; margin: 10px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.market-chart { margin: 12px 0 0; }
.market-chart svg { width: 100%; height: auto; }
.market-chart figcaption { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.key-swatch { display: inline-block; width: 14px; height: 2px; vertical-align: 3px; margin-right: 5px; }
.key-polymarket { background: #6B4FA0; } .key-kalshi { background: #B5832F; }
.line-polymarket, .line-kalshi { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.line-polymarket { stroke: #6B4FA0; } .line-kalshi { stroke: #B5832F; }
.line-polymarket-end { fill: #6B4FA0; stroke: var(--paper); stroke-width: 2; } .line-kalshi-end { fill: #B5832F; stroke: var(--paper); stroke-width: 2; }
.grid { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tick { font: 12px var(--sans); fill: var(--muted); }
.axis-title { font: 12px var(--sans); fill: var(--text); }
.axis-zero { stroke: var(--rule-strong); stroke-width: 1; }
.axis-center { stroke: var(--rule-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.diagonal { stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.scatter { width: 100%; height: auto; }
.dot { fill-opacity: .62; stroke: var(--paper); stroke-width: 1; }
.dot-d { fill: var(--d); } .dot-r { fill: var(--r); }
.scatter a:hover .dot, .scatter a:focus .dot { fill-opacity: 1; stroke: var(--ink); }
.spark { width: 120px; height: 28px; }
.spark polyline { fill: none; stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spark circle { fill: var(--ink); }
.compare { margin-bottom: 20px; }
.compare h3 { margin-bottom: 4px; }
.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--paper); font-size: .8rem; line-height: 1.35; padding: 5px 8px; border-radius: 2px; max-width: 280px; }

/* Forecast page */
.methods th.group { text-align: center; border-bottom: 1px solid var(--rule); color: var(--ink); }
.methods tbody th { font-weight: 600; min-width: 260px; }
.methods .sub.block { max-width: 40ch; }
.threshold { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
.threshold button { font: inherit; font-size: .78rem; min-width: 34px; min-height: 30px; background: var(--white); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 2px; cursor: pointer; }
.threshold button:hover { border-color: var(--gold); }
.threshold input { flex: 1 1 110px; accent-color: var(--gold-text); min-width: 110px; }

/* Arizona */
.contest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 26px 40px; }
.contest h3 { margin-bottom: 10px; }
.contest-person { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-bottom: 9px; }
.contest-name { font-size: .92rem; line-height: 1.25; margin-bottom: 4px; }
.is-called .contest-name, .is-leading .contest-name { font-weight: 600; }
.contest-num { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; font-size: .92rem; line-height: 1.25; }
.contest-num strong { font-weight: 600; }
.contest-num .sub { font-size: .76rem; }
.portrait { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--paper-2); }
.portrait-none { display: flex; align-items: center; justify-content: center; font: 1.05rem var(--serif); color: var(--muted); border: 1px solid var(--rule); }
.portrait-small { width: 28px; height: 28px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.district-list { border-top: 1px solid var(--rule); }
.district { border-bottom: 1px solid var(--rule); }
.district:target, .district.is-focus { background: var(--paper-2); }
.district summary { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) minmax(0, 1.5fr) 3em; gap: 10px; padding: .55rem .2rem; cursor: pointer; font-size: .9rem; align-items: baseline; list-style: none; }
.district summary::-webkit-details-marker { display: none; }
.district summary:hover { background: var(--paper-2); }
.district-n { font: 1.05rem var(--serif); color: var(--ink); }
.district-pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .84rem; }
.district-line .mark { margin-left: 2px; margin-right: 4px; }
.district-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; padding: 6px .2rem 14px; }
.district-contest h4 { margin-bottom: 4px; }
.shift-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px 40px; }
.shift-chart { margin: 0; }
.shift-chart figcaption { font-weight: 600; font-size: .88rem; color: var(--ink); margin-bottom: 8px; }
.diverging { list-style: none; padding: 0; margin: 0; font-size: .82rem; }
.diverging li { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) 6.5em; gap: 10px; align-items: center; margin: 0; padding: 2px 0; }
.diverging a { text-decoration: none; }
.diverging a:hover { text-decoration: underline; }
.diverging svg { width: 100%; height: 12px; }
.diverging span { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.az-map { padding: 14px; }
.az-map svg { width: 100%; height: auto; }
.az-district { stroke: var(--white); stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
.az-district:hover, .az-district.is-on { stroke: var(--ink); stroke-width: 2; }
.az-d { fill: var(--d); } .az-r { fill: var(--r); } .az-o { fill: var(--o); } .az-open { fill: var(--none); } .az-even { fill: #EFEBE1; }
.az-split { fill: url(#az-split-pattern); } .az-part { fill: url(#az-part-pattern); }
.az-sd1 { fill: #BCD0E6; } .az-sd2 { fill: #6F97C6; } .az-sd3 { fill: #2A5C99; }
.az-sr1 { fill: #F0C4BE; } .az-sr2 { fill: #D9786E; } .az-sr3 { fill: #B8382F; }
.az-label { font-family: var(--sans); font-weight: 600; fill: var(--white); pointer-events: none; text-anchor: middle; }
.az-label-open { fill: var(--ink); stroke: none; }
.az-controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; margin-bottom: 10px; font-size: .8rem; color: var(--muted); }
.az-controls label { display: flex; flex-direction: column; gap: 3px; }
.az-controls select { font: inherit; font-size: .88rem; color: var(--text); background: var(--white); border: 1px solid var(--rule-strong); border-radius: 2px; padding: .35rem .45rem; min-height: 34px; }
.az-readout { font-size: .86rem; margin-top: 10px; min-height: 5.2em; }
.az-readout strong { display: block; color: var(--ink); }

/* Maricopa */
.ballot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px 40px; margin-bottom: 30px; }
.ballot-item h3 { font-family: var(--sans); font-size: .92rem; font-weight: 600; margin-bottom: 4px; }

/* Written pages */
.prose { max-width: 800px; }
.prose-narrow { max-width: 860px; margin-inline: auto; }
.prose h2:not(.section-head h2) { margin: 1.4em 0 .4em; }
.prose section { margin-bottom: 34px; }
.terms { margin: 0 0 1em; }
.terms dt { font-weight: 600; color: var(--ink); margin-top: .7em; }
.terms dd { margin: 0; }
.status-col { white-space: nowrap; font-variant-numeric: tabular-nums; }
.about { display: flex; gap: 40px; align-items: flex-start; justify-content: space-between; }
.about-logo { flex: none; width: min(320px, 40%); height: auto; }

/* County map */
.panel-map { padding: 18px 20px 16px; }
.county-map { min-height: 280px; }
.cm-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; margin-bottom: 12px; font-size: .8rem; color: var(--muted); }
.cm-controls label { display: flex; flex-direction: column; gap: 3px; }
.cm-controls select { font: inherit; font-size: .9rem; color: var(--text); background: var(--white); border: 1px solid var(--rule-strong); border-radius: 2px; padding: .35rem .45rem; min-height: 36px; }
.cm-controls input[type=range] { accent-color: var(--gold-text); width: 160px; margin: 8px 0 7px; }
.cm-back { font: inherit; font-size: .85rem; background: var(--white); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 2px; padding: .35rem .7rem; min-height: 36px; cursor: pointer; }
.cm-back:hover, .cm-reset:hover { border-color: var(--gold); }
.cm-reset { font: inherit; font-size: .85rem; background: var(--white); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 2px; padding: .35rem .7rem; min-height: 36px; cursor: pointer; }
.cm-range-line { display: flex; align-items: center; gap: 8px; }
.cm-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px 24px; align-items: start; }
.cm-stage { position: relative; }
.cm-stage svg { width: 100%; height: auto; display: block; touch-action: manipulation; }
.cm-county { stroke: rgba(255, 255, 255, .55); stroke-width: .6; vector-effect: non-scaling-stroke; cursor: pointer; }
.cm-county.is-dim { opacity: .13; }
.cm-county.is-on { stroke: var(--ink); stroke-width: 2; }
.cm-states { fill: none; stroke: #fff; stroke-width: 1.3; vector-effect: non-scaling-stroke; pointer-events: none; }
.cm-aside h3 { margin-bottom: 4px; }
.cm-aside .note { margin-top: .4em; }
.cm-legend { margin-top: 12px; font-size: .76rem; color: var(--muted); }
.cm-scale { display: flex; height: 10px; }
.cm-scale span { flex: 1; }
.cm-scale-labels { display: flex; justify-content: space-between; margin-top: 3px; }
.cm-keys { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 8px; }
.cm-keys i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; }
.cm-key-none { background: #ECE8DE; border: 1px solid var(--rule); }
.cm-key-hatch { background: repeating-linear-gradient(45deg, #DDD8CB 0 2px, #F1EEE5 2px 4px); }
.cm-key-count { background: #D5D0C2; }
.cm-key-other { background: var(--o); }
.cm-big { font: 600 2rem/1.1 var(--sans); color: var(--ink); letter-spacing: -.01em; }
.cm-stat { margin: 4px 0 10px; font-size: .86rem; }
.cm-play { font: inherit; font-size: .85rem; min-width: 64px; min-height: 36px; background: var(--white); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 2px; cursor: pointer; }
.cm-play:hover { border-color: var(--gold); }
.cm-years { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); }
.cm-history { flex: 1 1 280px; }
.cm-history-row { align-items: center; }
.cm-history input[type=range] { width: 100%; margin: 6px 0 2px; }
.cm-county-table { max-height: 340px; overflow-y: auto; margin-top: 10px; }
.cm-candidates { margin-top: 6px; }

/* Footer */
.site-foot { border-top: 1px solid var(--rule-strong); padding-block: 26px 34px; margin-top: 20px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1.3fr); gap: 20px 40px; }
.identity-small .wordmark { font-size: 1.35rem; }
.identity-small .descriptor { font-size: .54rem; }
.founder { font: italic .86rem var(--serif); color: var(--muted); margin: 10px 0 0; }
.foot-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 18px; list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.foot-links li { margin: 0; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.foot-note { font-size: .8rem; color: var(--muted); margin: 0; }

/* Narrower screens */
@media (max-width: 1100px) {
  .hide-md { display: none; }
  .cm-body { grid-template-columns: minmax(0, 1fr); }
  .columns-2-1, .columns-1-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1101px) {
  .races thead th { position: sticky; top: 0; background: var(--paper); z-index: 1; box-shadow: 0 1px 0 var(--rule-strong); }
  .table-wrap:has(.races) { overflow: visible; }
}
@media (max-width: 900px) {
  .chambers { grid-template-columns: minmax(0, 1fr); }
  .chamber { border-left: 0; border-top: 1px solid var(--rule); }
  .chamber:first-child { border-top: 0; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .tagline { display: none; }
  .nav-row { flex-wrap: wrap; gap: 0; }
  .freshness { width: 100%; padding-bottom: 8px; }
}
@media (max-width: 480px) {
  .hide-xs { display: none; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  body { font-size: 15px; }
  .masthead { padding-block: 12px; }
  .identity img { width: 46px; height: 46px; }
  .wordmark { font-size: 1.45rem; }
  .descriptor { font-size: .54rem; letter-spacing: .17em; }
  .site-nav ul { flex-wrap: wrap; gap: 0 18px; overflow: visible; }
  .site-nav a { padding: 8px 0 6px; }
  .lead { padding-block: 24px 16px; }
  .standfirst { font-size: 1.02rem; }
  .data { font-size: .88rem; }
  .data th, .data td { padding: .45rem .32rem; }
  .data .tag { display: none; }
  .person .tag { display: inline; }
  .people { min-width: 150px; }
  .contest-grid, .ballot-list { grid-template-columns: minmax(0, 1fr); }
  .district summary { grid-template-columns: 1.8em minmax(0, 1fr) 2.8em; }
  .district-body { grid-template-columns: minmax(0, 1fr); }
  .diverging li { grid-template-columns: 4.9em minmax(0, 1fr) 6.6em; gap: 6px; }
  .about { flex-direction: column-reverse; }
  .about-logo { width: 200px; }
  .panel-map { padding: 12px; }
  .chamber { padding: 16px; }
  .filters label { flex: 1 1 42%; min-width: 0; }
  .filters select, .filters input[type=search] { min-width: 0; }
  .az-controls label { flex: 1 1 30%; min-width: 0; }
  .az-controls select { width: 100%; }
}
@media (forced-colors: active) {
  .mark, .seg-d, .seg-r { forced-color-adjust: none; }
}
@media print {
  .site-nav, .filters, .site-foot { display: none; }
  body { background: #fff; border: 0; }
}

/* Chart gallery: two charts in view on a wide screen, one and a bit on a phone. */
.gallery-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.gallery-tabs { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .84rem; }
.gallery-tabs a { color: var(--muted); text-decoration: none; padding: 3px 0; border-bottom: 2px solid transparent; }
.gallery-tabs a:hover { color: var(--ink); }
.gallery-tabs a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.gallery-arrows { display: flex; gap: 6px; flex: none; }
.gallery-arrows[hidden] { display: none; }
.gallery-arrows button { width: 36px; height: 36px; font-size: 1.3rem; line-height: 1; color: var(--ink); background: var(--white); border: 1px solid var(--rule-strong); border-radius: 50%; cursor: pointer; }
.gallery-arrows button:hover { border-color: var(--ink); }
.gallery-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc(50% - 16px); gap: 32px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-bottom: 10px; }
.slide { margin: 0; min-width: 0; scroll-snap-align: start; }
.slide figcaption h3 { margin-bottom: 3px; }
.slide figcaption p { font-size: .88rem; color: var(--muted); margin: 0 0 8px; min-height: 2.6em; }
.chart { display: block; width: 100%; height: auto; background: var(--white); border: 1px solid var(--rule); }
.fit { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; }
.chart a:hover .dot, .chart a:focus .dot { fill-opacity: 1; stroke: var(--ink); }
.dot-open { fill-opacity: .08; stroke-width: 1.5; }
.dot-open.dot-d { stroke: var(--d); } .dot-open.dot-r { stroke: var(--r); }
.dot-flag { fill-opacity: .95; stroke: var(--ink); stroke-width: 1.5; }
.dot-label { font: 600 13px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--white); stroke-width: 3px; pointer-events: none; }
.panel-title { font: 600 13px var(--sans); fill: var(--text); }
.cell { fill: var(--ink); } .cell-1 { fill-opacity: .1; } .cell-2 { fill-opacity: .22; } .cell-3 { fill-opacity: .38; } .cell-4 { fill-opacity: .58; } .cell-5 { fill-opacity: .8; }
.chart-key { display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: .78rem; color: var(--muted); margin: 7px 0 0; }
.chart-key span { display: inline-flex; align-items: center; }
.key-fit::before { content: ""; width: 20px; margin-right: 6px; border-top: 2px dashed var(--gold); }
.key-open::before { content: ""; width: 10px; height: 10px; margin-right: 6px; border: 1.5px solid var(--muted); border-radius: 50%; }
.key-flag::before { content: ""; width: 12px; height: 12px; margin-right: 6px; background: var(--muted); border: 1.5px solid var(--ink); border-radius: 50%; }
.outliers { margin-top: 8px; font-size: .86rem; }
.outliers summary { cursor: pointer; color: var(--ink); }
.outliers ul { list-style: none; margin: 6px 0 0; padding: 0; }
.outliers li { padding: 2px 0; }
.compare-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 8px 36px; }
.flush { padding: 0; }
.measure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 26px 40px; }
.measure h3 { margin-bottom: 6px; }
.measure-summary { font-size: .92rem; margin: 0 0 8px; }
.measure-means { font-size: .86rem; margin: 0 0 10px; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 10px; }
.measure-means dt { font-weight: 600; color: var(--ink); }
.measure-means dd { margin: 0; }
.measure-count { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .9rem; font-variant-numeric: tabular-nums; }
.district-line .portrait-small { margin-right: 4px; }
.district-pct .block { display: block; font-size: .72rem; }
.district summary { grid-template-columns: 2.2em minmax(0, 1fr) 4em; align-items: center; }
.district-contest .contest-person { margin-bottom: 7px; }
@media (max-width: 900px) {
  .gallery-track { grid-auto-columns: 92%; gap: 18px; }
  .slide figcaption p { min-height: 0; }
}
@media (max-width: 640px) {
  .chart .tick, .chart .axis-title { font-size: 19px; }
  .chart .dot-label, .chart .panel-title { font-size: 20px; }
  .gallery-tabs { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; max-width: calc(100vw - 110px); }
  .district summary { grid-template-columns: 1.6em minmax(0, 1fr) 3.4em; gap: 6px; }
}
.section-head { flex-wrap: wrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.contact-form { display: grid; gap: 14px; max-width: 34rem; }
.contact-form label { display: grid; gap: 4px; font-size: .9rem; color: var(--ink); }
.contact-form input, .contact-form textarea { font: inherit; color: var(--text); background: var(--white); border: 1px solid var(--rule-strong); border-radius: 3px; padding: .5rem .6rem; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.contact-form button { justify-self: start; font: inherit; font-weight: 600; color: var(--white); background: var(--ink); border: 0; border-radius: 3px; padding: .6rem 1.2rem; cursor: pointer; }
.contact-form button:hover { background: var(--text); }
.contact-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.quad-d { fill: var(--d); fill-opacity: .05; } .quad-d-strong { fill: var(--d); fill-opacity: .14; }
.quad-r { fill: var(--r); fill-opacity: .05; } .quad-r-strong { fill: var(--r); fill-opacity: .14; }
.quad-label { font: 600 12px var(--sans); fill: var(--text); paint-order: stroke; stroke: var(--white); stroke-width: 3px; pointer-events: none; }
.chart-reading { font-size: .84rem; line-height: 1.45; color: var(--text); margin: 8px 0 0; }
.count-note { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px 40px; align-items: start; }
.count-note p { margin: 0; font-size: .95rem; }
@media (max-width: 760px) { .count-note { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .chart .quad-label { font-size: 17px; } }
.count-note .note { margin-top: .7em; }
.forecast-headline { font-size: 1rem; color: var(--ink); margin: .6em 0 .8em; padding: .5rem .8rem; background: var(--white); border-left: 3px solid var(--gold); }
.measure-forecast { font-size: .9rem; color: var(--ink); margin: 8px 0 0; }
.district-link { margin: 2px .2rem 0; }
.local-forecast { font-size: .9rem; color: var(--ink); margin: 6px 0 0; }
.counted-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 12px; font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.counted-bar svg { display: block; width: 100%; height: 8px; }
.counted-track { fill: var(--rule); } .counted-fill { fill: var(--ink); }
.counted-head { max-width: 34rem; margin: 2px 0 10px; }
.chance { font-size: .82em; font-weight: 600; color: var(--gold-text); white-space: nowrap; }
.stats-heading { margin: 22px 0 8px; }
.stats-table { max-width: 22rem; }
.judge-review { font-size: .86rem; margin: 2px 0 10px; color: var(--text); }
.review-verdict { font-weight: 600; color: var(--ink); }
.judge h3 { margin-bottom: 2px; }
.judge .sub { display: block; }
.district-lines { display: grid; gap: 4px; min-width: 0; }
.district-line { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); gap: 6px; align-items: center; }
.district-line .mark { margin-left: 0; }
.district-people { display: flex; flex-wrap: wrap; gap: 3px 18px; min-width: 0; }
.district-person { display: inline-flex; align-items: center; gap: 0 4px; white-space: nowrap; }
.district-person .portrait-small { margin-right: 2px; }
.district-person .mark { margin-right: 2px; }
.district-body { grid-template-columns: minmax(0, 1fr); }
.contest-name { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
