/* US Midterms 2026 — one stylesheet, tokens first. */

/* Bulletin: a short, read-only election-night briefing. */
.night-bulletin-page main.wrap { max-width: none; }
.bulletin-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.bulletin-page-head h1 { font-size: 1.5rem; }
.bulletin-page-head p { color: var(--text-2); font-size: .83rem; }
.bulletin-content { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.bulletin-tabs { display: flex; flex: none; gap: 5px; padding-bottom: 8px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.bulletin-tabs button { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text-2); font: inherit; font-size: .78rem; cursor: pointer; white-space: nowrap; }
.bulletin-tabs button:hover { background: var(--surface-2); color: var(--text); }
.bulletin-tabs button[aria-selected='true'] { background: var(--surface-2); color: var(--text); border-color: var(--line); font-weight: 700; }
.bulletin-tabs button > span { font-size: .65rem; color: var(--text-2); }
.bulletin-panel { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.bulletin-totals.is-category { grid-template-columns: minmax(0,1fr); }
.bulletin-totals.is-category .bulletin-total { display: grid; grid-template-columns: minmax(0,1fr) minmax(240px,1fr) minmax(0,1fr); gap: 8px 20px; align-items: center; }
.bulletin-totals.is-category .bulletin-total > header { grid-column: 1; grid-row: 1; }
.bulletin-totals.is-category .bulletin-numbers { grid-column: 2; grid-row: 1; margin: 0; }
.bulletin-totals.is-category .bulletin-party > b { font-size: 2.2rem; }
.bulletin-totals.is-category .bulletin-total-foot { grid-column: 3; grid-row: 1; display: grid; justify-content: end; text-align: right; margin: 0; }
.bulletin-totals.is-category .bulletin-seat-bar { grid-column: 1 / -1; grid-row: 2; }
.bulletin-totals.is-category .bulletin-total-note { grid-column: 1 / -1; grid-row: 3; margin: 0; }
.bulletin-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.bulletin-total { padding: 16px; }
.bulletin-total > header { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.bulletin-total h2 { font-size: 1rem; }
.bulletin-total header > div > span, .bulletin-progress { font-size: .72rem; color: var(--text-2); }
.bulletin-progress { white-space: nowrap; }
.bulletin-numbers { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 14px 0; }
.bulletin-party { display: grid; gap: 2px; border-left: 3px solid var(--bulletin-party); padding-left: 10px; }
.bulletin-party > span { font-size: .75rem; color: var(--text-2); }
.bulletin-party > b { font-size: 2.8rem; line-height: 1.1; font-weight: 750; color: var(--bulletin-party); font-variant-numeric: tabular-nums; }
.bulletin-party > small { color: var(--text-2); font-size: .7rem; }
.bulletin-seat-bar { display: flex; height: 5px; gap: 2px; border-radius: 3px; overflow: hidden; background: var(--uncalled); }
.bulletin-seat-bar > span { min-width: 0; }
.bulletin-total-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; margin-top: 9px; color: var(--text-2); font-size: .72rem; }
.bulletin-control { color: var(--text); font-weight: 600; }
.bulletin-total-note { margin-top: 7px; font-size: .67rem; color: var(--text-3); }
.bulletin-board { min-height: 180px; padding: 16px; }
.bulletin-board > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.bulletin-board h2 { font-size: 1.05rem; }
.bulletin-board header p { color: var(--text-2); font-size: .76rem; }
.bulletin-board-summary { font-size: .75rem; color: var(--text-2); text-align: right; }
.bulletin-headlines { display: flex; flex-direction: column; gap: 0; }
.bulletin-headline { flex: none; display: grid; grid-template-columns: 40px minmax(0,1fr) 90px 165px; align-items: center; gap: 14px; min-width: 0; min-height: 65px; padding: 9px 2px; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.bulletin-headline:last-child { border-bottom: 0; }
.bulletin-result-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--surface-2); color: var(--bulletin-accent); border: 1px solid var(--line); font-size: 1rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.bulletin-headline.is-majority .bulletin-result-mark { border-color: var(--bulletin-accent); }
.bulletin-result-copy { min-width: 0; }
.bulletin-result-change { display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--text-2); font-size: .75rem; }
.bulletin-result-change > b { color: var(--bulletin-accent); }
.bulletin-result-meta { display: flex; flex-direction: column; align-items: end; gap: 5px; }
.bulletin-kind { display: inline-block; padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); font-size: .63rem; font-weight: 650; letter-spacing: .02em; color: var(--text); white-space: nowrap; }
.bulletin-headline[data-bulletin-kind='flip'] .bulletin-kind, .bulletin-headline[data-bulletin-kind='control-flip'] .bulletin-kind { border-color: var(--bulletin-accent); }
.bulletin-headline time { color: var(--text-2); font-size: .64rem; }
.bulletin-headline h3 { font-size: .88rem; line-height: 1.3; }
.bulletin-headline h3 a { color: var(--text); text-decoration: none; }
.bulletin-headline h3 a:hover { text-decoration: underline; }
.bulletin-headline p { margin-top: 3px; font-size: .75rem; color: var(--text-2); }
.bulletin-empty { grid-column: 1 / -1; text-align: center; padding: 45px 20px; color: var(--text-2); }
.bulletin-empty b { font-size: 1rem; color: var(--text); }
.bulletin-empty p { margin-top: 7px; font-size: .8rem; }
@media (min-width: 961px) {
 html.night-bulletin-page, .night-bulletin-page body { height: 100dvh; overflow: hidden; }
 .night-bulletin-page main.wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding-top: 12px; padding-bottom: 12px; }
 .night-bulletin-page .bulletin-page-head, .night-bulletin-page .bulletin-totals { flex: none; }
 .night-bulletin-page .bulletin-content { flex: 1 1 auto; }
 .night-bulletin-page .bulletin-panel { flex: 1 1 auto; }
 .night-bulletin-page .bulletin-board { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
 .night-bulletin-page .bulletin-board > header { flex: none; }
 .night-bulletin-page .bulletin-headlines { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
 .night-bulletin-page .bulletin-headlines:has(.bulletin-empty) { justify-content: center; }
}
@media (max-width: 760px) {
 .bulletin-page-head { align-items: start; }
 .bulletin-page-head h1 { font-size: 1.2rem; }
 .bulletin-page-head p { font-size: .75rem; }
 .bulletin-totals, .bulletin-headlines { grid-template-columns: minmax(0,1fr); }
 .bulletin-total { display: grid; grid-template-columns: minmax(95px,1fr) minmax(0,1.5fr); gap: 7px 10px; padding: 12px; }
 .bulletin-total > header { display: block; }
 .bulletin-progress { display: block; margin-top: 3px; }
 .bulletin-numbers { margin: 0; gap: 9px; }
 .bulletin-party { padding-left: 7px; }
 .bulletin-party > span { font-size: .65rem; }
 .bulletin-party > b { font-size: 1.6rem; }
 .bulletin-party > small { font-size: .6rem; }
 .bulletin-seat-bar, .bulletin-total-foot { grid-column: 1 / -1; }
 .bulletin-total-foot { margin-top: 0; }
 .bulletin-total-note { display: none; }
 .bulletin-totals.is-category .bulletin-total { grid-template-columns: minmax(95px,1fr) minmax(0,1.5fr); gap: 7px 10px; }
 .bulletin-totals.is-category .bulletin-total-foot { grid-column: 1 / -1; grid-row: 3; display: flex; justify-content: space-between; text-align: left; }
 .bulletin-totals.is-category .bulletin-party > b { font-size: 1.6rem; }
 .bulletin-board { padding: 12px; }
 .bulletin-headline { grid-template-columns: 32px minmax(0,1fr) 112px; gap: 9px; padding: 10px 0; }
 .bulletin-result-mark { width: 30px; height: 32px; font-size: .85rem; border-radius: 6px; }
 .bulletin-result-change { display: none; }
 .bulletin-result-meta { grid-column: 3; grid-row: 1; }
 .bulletin-headline h3 { font-size: .8rem; }
 .bulletin-headline p { font-size: .7rem; }
 .bulletin-kind { font-size: .58rem; padding: 3px 5px; }
 .bulletin-headline time { font-size: .58rem; text-align: right; }
 .night-bulletin-page.election-window-page main.wrap { overflow-y: auto; }
}

/* Personal race tools share the site's existing cards and controls. */
.call-status-tools, .prediction-race-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prediction-score-link { display: inline-block; margin: 0 0 10px; font-size: .8rem; font-weight: 600; }
.personal-summary { display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 14px; }
.personal-summary > span { display: flex; align-items: baseline; gap: 7px; color: var(--text-2); font-size: .8rem; }
.personal-summary b { color: var(--text); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.personal-filters { display: grid; grid-template-columns: minmax(160px,2fr) repeat(3,minmax(110px,1fr)); gap: 8px; margin: 12px 0; }
.personal-filters label, .personal-filters .dd, .personal-filters .dd-trigger { min-width: 0; width: 100%; }
.personal-filters input { height: 36px; min-width: 0; width: 100%; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--text); background: var(--surface); font: inherit; font-size: .8rem; }
.personal-empty { grid-column: 1 / -1; padding: 24px 12px; color: var(--text-2); text-align: center; }
.personal-empty p { margin-top: 6px; font-size: .82rem; }
.score-breakdowns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 14px; }
.score-breakdowns > .card { padding: 16px; min-width: 0; }
.score-breakdowns h2 { margin-bottom: 12px; font-size: 1rem; }
.score-breakdown-row { display: grid; grid-template-columns: minmax(90px,1fr) 65px minmax(60px,1fr) 52px; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: .78rem; }
.score-breakdown-row > span, .score-breakdown-row > strong { text-align: right; font-variant-numeric: tabular-nums; }
.score-meter { height: 6px; background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.score-meter i { display: block; height: 100%; background: var(--accent); }
.score-results { padding: 16px; }
.score-table-wrap { overflow-x: auto; }
.score-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .8rem; }
.score-table th { color: var(--text-3); font-size: .7rem; }
.score-table td, .score-table th { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.score-table td:first-child { min-width: 165px; }
.score-table td small { display: block; color: var(--text-3); font-size: .69rem; margin-top: 3px; }
.score-outcome { display: inline-block; padding: 3px 7px; border-radius: 5px; font-size: .71rem; font-weight: 650; color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
.score-outcome.correct { color: #167347; background: #e3f3eb; }
.score-outcome.miss { color: #a12d26; background: #fce8e6; }
:root[data-theme='dark'] .score-outcome.correct { color: #8cd3ad; background: #163d2c; }
:root[data-theme='dark'] .score-outcome.miss { color: #f0aaa5; background: #482726; }
.score-method { margin-top: 12px; }
@media (min-width: 961px) {
 html.prediction-scorecard-page, .prediction-scorecard-page body { height: 100dvh; overflow: hidden; }
 .prediction-scorecard-page main.wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding-top: 10px; padding-bottom: 12px; }
 .prediction-scorecard-page main > .page-head, .prediction-scorecard-page .score-summary, .prediction-scorecard-page .score-method { flex: none; }
 .prediction-scorecard-page .score-summary { padding: 10px 14px; margin-bottom: 10px; }
 .prediction-scorecard-page .score-breakdowns { flex: none; height: clamp(160px,22dvh,232px); margin-bottom: 10px; }
 .prediction-scorecard-page .score-breakdowns > .card { display: flex; flex-direction: column; min-height: 0; padding: 12px; overflow: hidden; }
 .prediction-scorecard-page .score-breakdowns h2 { flex: none; margin-bottom: 8px; }
 .prediction-scorecard-page [data-score-confidence], .prediction-scorecard-page [data-score-groups] { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
 .prediction-scorecard-page .score-breakdown-row { padding: 5px 0; }
 .prediction-scorecard-page .score-results { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 12px; overflow: hidden; }
 .prediction-scorecard-page .score-results > :not(.score-table-wrap) { flex: none; }
 .prediction-scorecard-page .score-results .personal-filters { margin: 4px 0 10px; }
 .prediction-scorecard-page .score-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
 .prediction-scorecard-page .score-table th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
 .prediction-scorecard-page .score-method { margin-top: 8px; font-size: .68rem; line-height: 1.35; }
}
.help-timeline-link { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; margin-bottom: 14px; text-decoration: none; color: var(--text); }
.help-timeline-link:hover { background: var(--surface-2); text-decoration: none; }
.help-timeline-link b, .help-timeline-link small { display: block; }
.help-timeline-link small { margin-top: 3px; font-size: .78rem; color: var(--text-2); }
.poll-timeline-controls { display: flex; align-items: end; gap: 14px; padding: 14px 16px; }
.poll-timeline-controls > label { display: grid; gap: 4px; min-width: 180px; font-size: .75rem; color: var(--text-2); }
.poll-timeline-controls .dd, .poll-timeline-controls .dd-trigger { width: 100%; }
.poll-next { display: grid; gap: 2px; margin-left: auto; text-align: right; }
.poll-next > span, .poll-next small { font-size: .73rem; color: var(--text-3); }
.poll-timeline-note { margin: 12px 0 16px; }
.poll-closing-group { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 12px; margin: 10px 0; }
.poll-time { padding: 7px 0; border-top: 2px solid var(--accent); }
.poll-time h2 { font-size: .84rem; }
.poll-time > span { font-size: .72rem; color: var(--text-3); }
.poll-closing-places { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; align-items: start; }
.card.poll-closing-place { padding: 9px 10px; min-width: 0; border-radius: 8px; }
.poll-closing-place header { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 5px; }
.poll-closing-place header b { font-size: .8rem; }
.poll-closing-place small { display: block; font-size: .68rem; color: var(--text-3); }
.closing-status { padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; font-size: .62rem; color: var(--text-3); white-space: nowrap; }
.closing-status.is-local { color: var(--text-2); }
.poll-closing-place > .poll-closing-detail { margin-top: 5px; font-size: .68rem; color: var(--text-2); }
.poll-closing-detail summary { cursor: pointer; }
.poll-closing-detail p { margin-top: 5px; }
.card.poll-no-election { padding: 10px; }
.poll-timeline-sources { padding: 16px; margin-top: 20px; }
.poll-timeline-sources > div { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; font-size: .76rem; }
.poll-timeline-widget { padding: 12px; min-width: 0; }
.poll-timeline-widget > h2 { font-size: 1rem; margin-bottom: 8px; }
@media (min-width: 961px) {
 html.poll-closing-page, .poll-closing-page body { height: 100dvh; overflow: hidden; }
 .poll-closing-page main.wrap { max-width: none; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 10px 24px 12px; }
 .poll-closing-page .section-nav-wrap { max-width: none; }
 .poll-closing-page main > :not(.poll-timeline-widget) { flex: none; }
 .poll-closing-page .poll-timeline-widget { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
 .poll-closing-page .poll-timeline-widget > h2 { flex: none; }
 .poll-closing-page .poll-timeline { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; padding-right: 5px; }
 .poll-closing-page .poll-closing-group:first-child { margin-top: 0; }
 .poll-closing-page .poll-closing-group:last-child { margin-bottom: 0; }
 .poll-closing-page .poll-time { position: sticky; top: 0; align-self: start; background: var(--surface); }
 .poll-closing-page .poll-timeline-note { margin: 8px 0 10px; font-size: .72rem; }
 .poll-closing-page .poll-timeline-sources { padding: 10px 12px; margin-top: 10px; }
 .poll-closing-page .poll-timeline-sources h2 { font-size: .85rem; margin-bottom: 4px; }
 .poll-closing-page .poll-timeline-sources > p { font-size: .7rem; }
 .poll-closing-page .poll-timeline-sources > div { margin-top: 5px; font-size: .7rem; }
}
@media (max-width:1100px) { .personal-filters { grid-template-columns: repeat(2,minmax(0,1fr)); } .poll-closing-places { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) { .score-breakdowns { grid-template-columns: minmax(0,1fr); } .score-table { min-width: 650px; } .poll-timeline-controls { flex-wrap: wrap; align-items: center; } .poll-timeline-controls > label { flex: 1 1 100%; min-width: 0; } .poll-next { margin-left: 0; text-align: left; } .poll-closing-group { grid-template-columns: minmax(0,1fr); gap: 6px; } .poll-closing-places { grid-template-columns: minmax(0,1fr); } .score-breakdown-row { grid-template-columns: minmax(80px,1fr) 55px minmax(40px,1fr) 45px; gap: 7px; } }

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --line: #dde1e7;
  --line-strong: #c3c9d2;
  --text: #171b22;
  --text-2: #4a5260;
  --text-3: #5d6470;
  --accent: #1f5fbf;
  --focus: #1f5fbf;

  --dem: #2f66c9;
  --dem-2: #7fa3e3;
  --dem-3: #bccdf0;
  --dem-4: #dde6f7;
  --rep: #cf3d36;
  --rep-2: #e58a85;
  --rep-3: #f1c0bd;
  --rep-4: #f8e1df;
  --ind: #7d55b8;
  --ind-2: #b8a0dc;
  --oth: #7b8494;
  --tossup: #c9a94b;
  --tossup-2: #ead9a6;
  /* Rating colours: one scale for every badge, map, key and prediction. */
  --rate-D-safe: #2f66c9; --rate-D-likely: #6f97e0; --rate-D-lean: #a9c2ef; --rate-D-tilt: #c3d4f4;
  --rate-R-safe: #cf3d36; --rate-R-likely: #e2766f; --rate-R-lean: #eeaaa5; --rate-R-tilt: #f3c6c2;
  --rate-I-safe: #7d55b8; --rate-I-likely: #a283d3; --rate-I-lean: #c4b0e6; --rate-I-tilt: #d9cbef;
  --rate-tossup: #c9a94b; --rate-on-safe: #ffffff; --rate-on-likely: #171b22; --rate-on-soft: #171b22;
  --uncalled: #cfd4db;
  --notup: #e7eaee;
  --map-stroke: #ffffff;
  --map-empty: #e4e7ec;
  --on-party: #ffffff;
  --on-mid: #171b22;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1218; --surface: #171b23; --surface-2: #1f242e; --line: #2a303b; --line-strong: #3a4250;
    --text: #e8ebf1; --text-2: #b4bbc7; --text-3: #8d95a3; --accent: #7aa7ff; --focus: #7aa7ff;
    --dem: #5b8ef0; --dem-2: #3f68b4; --dem-3: #2c4677; --dem-4: #1f2c47;
    --rep: #ec5f57; --rep-2: #b44a45; --rep-3: #763634; --rep-4: #3f2324;
    --ind: #a07ce0; --ind-2: #5f4a86; --oth: #8d95a3; --tossup: #d6b85a; --tossup-2: #5e5232;
    --uncalled: #3a414d; --notup: #262c36; --map-stroke: #0b0e13; --map-empty: #2a303b; --on-party: #0b0e13; --on-mid: #ffffff;
    --rate-D-safe: #5b8ef0; --rate-D-likely: #4a78cc; --rate-D-lean: #3a5f9e; --rate-D-tilt: #2e4a78;
    --rate-R-safe: #ec5f57; --rate-R-likely: #c94f49; --rate-R-lean: #a0413c; --rate-R-tilt: #763331;
    --rate-I-safe: #a07ce0; --rate-I-likely: #8668bd; --rate-I-lean: #6c5598; --rate-I-tilt: #544374;
    --rate-tossup: #d6b85a; --rate-on-safe: #0b0e13; --rate-on-likely: #ffffff; --rate-on-soft: #e8ebf1;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0f1218; --surface: #171b23; --surface-2: #1f242e; --line: #2a303b; --line-strong: #3a4250;
  --text: #e8ebf1; --text-2: #b4bbc7; --text-3: #8d95a3; --accent: #7aa7ff; --focus: #7aa7ff;
  --dem: #5b8ef0; --dem-2: #3f68b4; --dem-3: #2c4677; --dem-4: #1f2c47;
  --rep: #ec5f57; --rep-2: #b44a45; --rep-3: #763634; --rep-4: #3f2324;
  --ind: #a07ce0; --ind-2: #5f4a86; --oth: #8d95a3; --tossup: #d6b85a; --tossup-2: #5e5232;
  --uncalled: #3a414d; --notup: #262c36; --map-stroke: #0b0e13; --map-empty: #2a303b; --on-party: #0b0e13; --on-mid: #ffffff;
  --rate-D-safe: #5b8ef0; --rate-D-likely: #4a78cc; --rate-D-lean: #3a5f9e; --rate-D-tilt: #2e4a78;
  --rate-R-safe: #ec5f57; --rate-R-likely: #c94f49; --rate-R-lean: #a0413c; --rate-R-tilt: #763331;
  --rate-I-safe: #a07ce0; --rate-I-likely: #8668bd; --rate-I-lean: #6c5598; --rate-I-tilt: #544374;
  --rate-tossup: #d6b85a; --rate-on-safe: #0b0e13; --rate-on-likely: #ffffff; --rate-on-soft: #e8ebf1;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
p { margin: 0; }
.sr { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 1080px) { .wrap { padding: 0 16px; } }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.small { font-size: .85rem; }

/* ---- Header: full width, sticky ---- */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.head-row { display: flex; align-items: center; gap: 20px; height: 56px; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 1.05rem; white-space: nowrap; flex: none; }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 2px; align-self: stretch; }
.nav a { display: flex; align-items: center; padding: 0 12px; color: var(--text-2); white-space: nowrap; border-bottom: 2px solid transparent; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a[aria-current='page'] { color: var(--text); border-bottom-color: var(--accent); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); color: var(--text-2); cursor: pointer; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
@media (max-width: 1080px) {
  .head-row { gap: 10px; padding: 0 16px; }
  .menu-btn { display: grid; }
  .nav { display: none; position: absolute; top: 56px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 10px 24px rgba(0,0,0,.12); padding: 6px 0; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 16px; border-bottom: 0; border-left: 3px solid transparent; }
  .nav a[aria-current='page'] { border-left-color: var(--accent); background: var(--surface-2); }
}
@media (max-width: 520px) { .brand span { display: none; } }
/* Sandbox copy of the site: always visible, so nobody mistakes it for live. */
.sandbox-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; background: #dfe9fb; color: #17325e; padding: 8px 16px; font-weight: 600; border-bottom: 1px solid #b7c9ea; text-align: center; }
.sandbox-banner[hidden] { display: none; }
.sandbox-reset { font: inherit; font-weight: 600; font-size: .9em; padding: 4px 12px; border-radius: 6px; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; }
.sandbox-reset:disabled { opacity: .6; cursor: progress; }
html:not([data-user-role='editor']):not([data-user-role='admin']) .sandbox-reset { display: none; }
:root[data-theme='dark'] .sandbox-banner { background: #1b2a45; color: #cfe0ff; border-color: #2f4670; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .sandbox-banner { background: #1b2a45; color: #cfe0ff; border-color: #2f4670; } }
.sample-banner { background: #fff3c4; color: #5c4700; text-align: center; padding: 8px 16px; font-weight: 600; border-bottom: 1px solid #e6d18a; }
:root[data-theme='dark'] .sample-banner { background: #3d3418; color: #f3e2a6; border-color: #5e5232; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .sample-banner { background: #3d3418; color: #f3e2a6; border-color: #5e5232; } }

/* Regular pages end at their content; dedicated map/window views fill the screen. */
body { display: flex; flex-direction: column; }
main { flex: none; width: 100%; }
/* main is also .wrap, whose side padding would otherwise reset the top and bottom. */
main.wrap { padding-top: 32px; padding-bottom: 12px; }
main:focus { outline: none; }
.loading { color: var(--text-3); padding: 40px 0; }

/* ---- Layout ---- */
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.page-head p { color: var(--text-2); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 960px) { .grid-2, .grid-main { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card > h2 { margin-bottom: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card > h2 .aside { font-size: .8rem; font-weight: 500; color: var(--text-3); }
.stack > * + * { margin-top: 16px; }

/* ---- Control cards ---- */
.control h2 { font-size: 1.15rem; }
.hemi { display: block; width: 100%; height: auto; max-height: 220px; margin: 4px auto 0; }
.hemi circle { stroke: none; }
.tally { display: flex; justify-content: space-between; align-items: end; margin-top: 8px; gap: 8px; }
.tally .side { display: flex; flex-direction: column; }
.tally .side.r { align-items: flex-end; text-align: right; }
.tally .big { font-size: 2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tally .lbl { font-size: .8rem; color: var(--text-2); font-weight: 600; }
.tally .mid { text-align: center; font-size: .8rem; color: var(--text-3); }
.seatbar { position: relative; display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--uncalled); margin-top: 10px; }
.seatbar > span { height: 100%; }
.seatbar .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); left: 50%; }
.seatbar-wrap { position: relative; padding-top: 6px; }
.seatbar-wrap .mark-lbl { position: absolute; top: -12px; transform: translateX(-50%); font-size: .72rem; color: var(--text-2); white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.stats div { min-width: 0; }
.stats b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stats span { font-size: .76rem; color: var(--text-3); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--text-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.note { font-size: .8rem; color: var(--text-3); margin-top: 8px; }

/* ---- Party colours ---- */
.p-D { --pc: var(--dem); --pc-soft: var(--dem-4); }
.p-R { --pc: var(--rep); --pc-soft: var(--rep-4); }
.p-I { --pc: var(--ind); --pc-soft: color-mix(in srgb, var(--ind) 18%, var(--surface)); }
.p-L, .p-G, .p-O { --pc: var(--oth); --pc-soft: var(--surface-2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--pc, var(--oth)); flex: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; border: 1px solid var(--line); }
.tag.call { background: var(--pc); color: var(--on-party); border-color: transparent; }
.tag.flip { background: transparent; color: var(--pc); border-color: currentColor; }

/* Ratings */
.rating { display: inline-block; min-width: 72px; text-align: center; padding: 2px 8px; border-radius: 6px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.r-safe-D { background: var(--rate-D-safe); color: var(--rate-on-safe); }
.r-likely-D { background: var(--rate-D-likely); color: var(--rate-on-likely); }
.r-lean-D { background: var(--rate-D-lean); color: var(--rate-on-soft); }
.r-tilt-D { background: var(--rate-D-tilt); color: var(--rate-on-soft); }
.r-safe-R { background: var(--rate-R-safe); color: var(--rate-on-safe); }
.r-likely-R { background: var(--rate-R-likely); color: var(--rate-on-likely); }
.r-lean-R { background: var(--rate-R-lean); color: var(--rate-on-soft); }
.r-tilt-R { background: var(--rate-R-tilt); color: var(--rate-on-soft); }
.r-safe-I { background: var(--rate-I-safe); color: var(--rate-on-safe); }
.r-likely-I { background: var(--rate-I-likely); color: var(--rate-on-likely); }
.r-lean-I { background: var(--rate-I-lean); color: var(--rate-on-soft); }
.r-tilt-I { background: var(--rate-I-tilt); color: var(--rate-on-soft); }
.r-tossup { background: var(--rate-tossup); color: #171b22; }
.r-none { background: var(--surface-2); color: var(--text-3); }

/* ---- Race list / rows ---- */
.race-list { list-style: none; margin: 0; padding: 0; }
.race-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.race-row:last-child { border-bottom: 0; }
.race-row a.title { font-weight: 600; color: var(--text); }
.race-row .cands { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; color: var(--text-2); }
.race-row .cands span { display: inline-flex; align-items: center; gap: 6px; }
.race-row .cands .lead { color: var(--text); font-weight: 600; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 600; background: var(--surface); }
.scroll-y th { position: sticky; top: 0; z-index: 1; }
th button { all: unset; cursor: pointer; }
th button:focus-visible { outline: 2px solid var(--focus); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--surface-2); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters select, .filters input { max-width: 100%; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); padding: 0 10px; font: inherit; font-size: .9rem; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--text-2); padding: 6px 12px; font: inherit; font-size: .88rem; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed='true'] { background: var(--text); color: var(--surface); }

/* ---- Map ---- */
.map-card { position: relative; }
.map-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.map-svg { display: block; width: 100%; height: auto; touch-action: manipulation; }
/* Suppress the browser ring around the whole SVG; paths have their own focus highlight. */
.map-svg:focus { outline: none; }
.map-svg path.fill { stroke-width: .5; vector-effect: non-scaling-stroke; }
.map-svg path.mesh { fill: none; stroke: var(--map-stroke); stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-svg path.hover-outline { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-svg [data-race] { cursor: pointer; }
.map-svg [data-race]:focus { outline: none; }
.map-svg .empty { fill: var(--map-empty); }
.map-svg text { font-size: 11px; fill: var(--text-2); pointer-events: none; }
.insets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.inset { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: .8rem; cursor: pointer; }
.inset svg { width: 26px; height: 26px; }
.inset svg path { stroke: var(--map-stroke); stroke-width: 1; }
.map-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font-size: .82rem; box-shadow: 0 6px 18px rgba(0,0,0,.18); max-width: 260px; z-index: 5; }
.map-tip b { display: block; margin-bottom: 2px; }
.map-back { margin-left: auto; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 12px; font: inherit; font-size: .88rem; cursor: pointer; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--on-party); border-color: var(--accent); }

/* ---- Race page ---- */
.race-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.crumbs { font-size: .85rem; color: var(--text-3); margin-bottom: 6px; }
.status-line { color: var(--text-2); margin-bottom: 16px; }
.cand { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cand:last-child { border-bottom: 0; }
.cand .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cand .who b { overflow-wrap: anywhere; }
.cand .fig { text-align: right; font-variant-numeric: tabular-nums; }
.cand .fig b { font-size: 1.1rem; }
.cand .bar { grid-column: 1 / -1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.cand .bar span { display: block; height: 100%; background: var(--pc, var(--oth)); }
.cand.winner .who b::after { content: ' \2713'; color: var(--pc); }
.reporting { font-size: .85rem; color: var(--text-2); margin-top: 10px; }
.callbox { border-left: 4px solid var(--pc, var(--line-strong)); background: var(--pc-soft, var(--surface-2)); padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; }
.callbox b { color: var(--text); }
.sources { font-size: .82rem; color: var(--text-2); padding-left: 18px; margin: 0; }
.sources li + li { margin-top: 4px; }
.empty-state { color: var(--text-3); padding: 12px 0; }

/* ---- Call feed ---- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 4px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .stripe { background: var(--pc, var(--oth)); border-radius: 2px; }
.feed .t { font-size: .78rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.feed .what { font-weight: 600; }
.feed .by { font-size: .82rem; color: var(--text-2); }
.feed li.retracted .what { text-decoration: line-through; color: var(--text-3); }

.countdown { display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap; }
.countdown b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }

.admin form { display: grid; gap: 10px; max-width: 520px; }
.admin label { display: grid; gap: 4px; font-size: .88rem; font-weight: 600; }
.admin input, .admin select, .admin textarea { height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--surface); color: var(--text); font: inherit; }
.admin textarea { height: 70px; padding: 8px 10px; }
.msg { padding: 8px 12px; border-radius: 8px; background: var(--surface-2); }

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  h1 { font-size: 1.35rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tally .big { font-size: 1.6rem; }
  .hide-sm { display: none; }
  th, td { padding: 8px 6px; }
}
@media (prefers-reduced-motion: no-preference) {
  .map-svg { transition: none; }
}

.race-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 28px; }
.race-grid .race-row:last-child { border-bottom: 1px solid var(--line); }
.scroll-y { max-height: 520px; overflow-y: auto; }
td.n { white-space: nowrap; }
.inset { padding: 4px 10px 4px 6px; }
.inset .sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
p a, .note a, .sources a, .callbox a { text-decoration: underline; text-underline-offset: 2px; }
.card > h2 .aside a { text-decoration: none; }
.r-none { color: var(--text-2); }
.county-map { max-width: 560px; margin: 0 auto 12px; }


/* ---- Results console ---- */
.console kbd { font: 600 .72rem var(--mono); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface-2); }
.con-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; margin-bottom: 16px; }
.con-bar label, .con-row label { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.console input, .console select { height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; min-width: 0; }
.con-bar #c-undo { margin-left: auto; }
.con-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.con-list { position: sticky; top: 112px; display: grid; gap: 10px; max-height: calc(100vh - 130px); }
.con-list input { width: 100%; }
.con-tabs { width: 100%; }
.con-tabs button { flex: 1; }
.con-races { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; }
.con-races li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.con-races li[aria-selected='true'] { background: var(--surface-2); outline: 1px solid var(--line-strong); }
.con-races li.open { box-shadow: inset 3px 0 0 var(--accent); }
.con-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 12px; }
.con-edit fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 0 0 12px; }
.con-edit legend { font-weight: 700; padding: 0 6px; }
.con-cand { display: grid; grid-template-columns: minmax(0, 1fr) 160px 56px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.con-cand input { text-align: right; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.con-cand output { text-align: right; }
.con-row { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; align-items: end; }
.con-row label input[type='time'] { width: 130px; }
.con-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.con-actions .btn.primary { font-size: 1rem; padding: 10px 18px; }
.con-h3 { margin: 18px 0 8px; }
.con-history { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.con-history li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.con-history li.undone { opacity: .6; text-decoration: line-through; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 8px; font-weight: 600; z-index: 40; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--rep); color: var(--on-party); }
@media (max-width: 860px) {
  .con-grid { grid-template-columns: minmax(0, 1fr); }
  .con-list { position: static; max-height: 46vh; }
  .con-bar #c-undo { margin-left: 0; }
  .con-cand { grid-template-columns: minmax(0, 1fr) 120px 48px; }
}
[hidden] { display: none !important; }

/* ---- Race page ---- */
.stack > .callbox { margin: 0; }
.race-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); padding: 0; }
.race-top .pane { padding: 16px; min-width: 0; }
.race-top .pane > h2 { margin-bottom: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.race-top .pane > h2 .aside { font-size: .8rem; font-weight: 500; color: var(--text-3); }
.race-top .glance { border-left: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); border-radius: 0 var(--radius) var(--radius) 0; }
.glance dl { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 12px 16px; align-items: start; }
.glance dt { font-size: .78rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; padding-top: 3px; }
.glance dd { margin: 0; min-width: 0; }
.poll-line { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .9rem; margin-top: 2px; }
.poll-line span { display: inline-flex; align-items: center; gap: 5px; }
.rating-grid { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1080px) { .rating-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.rating-cell { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.county-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.county-wrap > .scroll-y:only-child { grid-column: 1 / -1; }
.county-wrap .county-map { margin: 0; max-width: none; }
.county-wrap .scroll-y { max-height: 470px; }
@media (max-width: 860px) {
  .race-top, .county-wrap { grid-template-columns: minmax(0, 1fr); }
  .race-top .glance { border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
}

/* Side-by-side cards end level: the longer list scrolls inside its card
   rather than leaving a hole beside the shorter one. */
@media (min-width: 961px) {
  .grid-main.level { align-items: stretch; }
  .card.fill { display: flex; flex-direction: column; }
  .card.fill > .race-list, .card.fill > .feed { flex: 1 1 0; min-height: 0; overflow-y: auto; }
}

/* ---- Predictions ---- */
.pred-lock { margin-bottom: 16px; }
.pred-lock .con-row { margin-top: 0; }
.pred-table select, .pred-table input { height: 32px; font-size: .88rem; max-width: 190px; }
.pred-table td { padding: 6px; }
.verdict { font-size: .78rem; font-weight: 700; }
.verdict.right { color: #1f7a3d; }
.verdict.wrong { color: var(--rep); }
:root[data-theme='dark'] .verdict.right { color: #5fd38a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .verdict.right { color: #5fd38a; } }
.stats.acc { margin-top: 0; border-top: 0; padding-top: 0; }
@media (max-width: 520px) {
  .glance dl { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .glance dd { margin-bottom: 10px; }
  .rating-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rating-cell { flex-direction: column; align-items: flex-start; }
  .cand .who .muted { display: none; }
}
@media (min-width: 961px) { .grid-main.pred-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.pred-table select[data-f='rating'] { width: 110px; }
.pred-table select[data-f='winner'] { width: 100%; max-width: 220px; }
.pred-table input[data-f='margin'] { width: 64px; text-align: right; }
#p-q { flex: 1; min-width: 140px; }

/* ---- Party and incumbent tags ---- */
:root {
  --ptag-D-bg: #dde6f7; --ptag-D-fg: #1c4a96;
  --ptag-R-bg: #f8e1df; --ptag-R-fg: #9e2620;
  --ptag-I-bg: #ebe2f7; --ptag-I-fg: #5a3791;
  --ptag-L-bg: #f5ecc9; --ptag-L-fg: #6b5400;
  --ptag-G-bg: #dcefdf; --ptag-G-fg: #1f6a33;
  --ptag-O-bg: #e8ebef; --ptag-O-fg: #4a5260;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ptag-D-bg: #1f2e4d; --ptag-D-fg: #a9c4ff;
    --ptag-R-bg: #44252a; --ptag-R-fg: #ffaaa4;
    --ptag-I-bg: #32284a; --ptag-I-fg: #d2bdf5;
    --ptag-L-bg: #3b3420; --ptag-L-fg: #f0d98a;
    --ptag-G-bg: #1f3a28; --ptag-G-fg: #9fe0b0;
    --ptag-O-bg: #2a303b; --ptag-O-fg: #c3c9d2;
  }
}
:root[data-theme='dark'] {
  --ptag-D-bg: #1f2e4d; --ptag-D-fg: #a9c4ff;
  --ptag-R-bg: #44252a; --ptag-R-fg: #ffaaa4;
  --ptag-I-bg: #32284a; --ptag-I-fg: #d2bdf5;
  --ptag-L-bg: #3b3420; --ptag-L-fg: #f0d98a;
  --ptag-G-bg: #1f3a28; --ptag-G-fg: #9fe0b0;
  --ptag-O-bg: #2a303b; --ptag-O-fg: #c3c9d2;
}
.ptag, .itag, .otag {
  display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 6px; border-radius: 999px;
  font: 700 .66rem/1 var(--font); letter-spacing: .04em; white-space: nowrap; vertical-align: 1px; flex: none;
}
.ptag-D { background: var(--ptag-D-bg); color: var(--ptag-D-fg); }
.ptag-R { background: var(--ptag-R-bg); color: var(--ptag-R-fg); }
.ptag-I { background: var(--ptag-I-bg); color: var(--ptag-I-fg); }
.ptag-L { background: var(--ptag-L-bg); color: var(--ptag-L-fg); }
.ptag-G { background: var(--ptag-G-bg); color: var(--ptag-G-fg); }
.ptag-O { background: var(--ptag-O-bg); color: var(--ptag-O-fg); }
.itag { border: 1px solid var(--line-strong); color: var(--text-2); background: transparent; text-transform: uppercase; }
.itag svg { width: 9px; height: 9px; }
.otag { border: 1px dashed var(--line-strong); color: var(--text-2); text-transform: uppercase; }
.cl { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cand .who { gap: 6px; flex-wrap: wrap; }
.race-row .cands { gap: 6px 16px; }
.race-row .cands .cl { color: var(--text-2); }
.race-row .cands .cl.lead { color: var(--text); font-weight: 600; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.feed .what .ptag { margin: 0 2px; }
td .cands { display: inline-flex; flex-wrap: wrap; gap: 4px 16px; }
.stag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; font: 600 .66rem/1 var(--font); white-space: nowrap; flex: none; }
.rdate { font-size: .72rem; color: var(--text-3); white-space: nowrap; margin-left: 4px; }
.nowrap { white-space: nowrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- State races ---- */
.filters-card { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cat-seg { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.cat-seg button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .86rem; cursor: pointer; }
.cat-seg button[aria-pressed='true'] { background: var(--text); color: var(--surface); border-color: var(--text); }
.cat-seg button[aria-pressed='true'] .muted { color: inherit; opacity: .7; }
.filters-card select { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); padding: 0 10px; font: inherit; }
.chamber-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.chamber h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .95rem; }
.chamber h3 a { color: var(--text); }
.chamber .seatbar { margin: 0 0 8px; }
.measure-summary { margin-bottom: 12px; color: var(--text-2); }
/* Cards in a race grid share one height per row and keep their parts aligned. */
.race-grid { align-items: stretch; }
.race-grid .race-row { grid-template-rows: auto 1fr; align-content: start; }
.race-grid .race-row .cands { align-self: start; }
.cands .extra { display: contents; }
.cands .extra[hidden] { display: none; }
.more-btn { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 0 9px; height: 22px; font: 600 .74rem var(--font); cursor: pointer; }
.more-btn:hover { color: var(--text); background: var(--surface-2); }
.mate { flex-basis: 100%; font-size: .76rem; color: var(--text-3); font-weight: 400; }
.cand .who .mate { flex-basis: 100%; margin-top: -2px; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip-list a { display: inline-block; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text); font-size: .86rem; }

/* ---- Candidate chip: name, party segment and incumbent star in one pill ---- */
.cchip { display: inline-flex; align-items: stretch; height: 22px; border-radius: 999px; overflow: hidden; font-size: .82rem; line-height: 1; white-space: nowrap; max-width: 100%; flex: none; }
.cchip .nm { display: inline-flex; align-items: center; padding: 0 8px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cchip .seg { display: inline-flex; align-items: center; padding: 0 7px; font: 700 .64rem/1 var(--font); letter-spacing: .04em; border-left: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.cchip .star { width: 10px; height: 10px; margin-left: 4px; flex: none; }
.cchip.is-lead { box-shadow: inset 0 0 0 1.5px currentColor; }
.cand .who .cchip { font-size: .92rem; height: 26px; }
.race-row .cands .cl { color: inherit; }

/* ---- Governor / lieutenant governor arrangements ---- */
:root { --arr-joint: #2c666c; --arr-joint-bg: #e0f0f1; --arr-separate: #8a5a12; --arr-separate-bg: #f6ead6; --arr-none: #5d6470; --arr-none-bg: #eceef1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --arr-joint: #8fd0d6; --arr-joint-bg: #1d3537; --arr-separate: #f0c67e; --arr-separate-bg: #3a2e19; --arr-none: #c3c9d2; --arr-none-bg: #2a303b; } }
:root[data-theme='dark'] { --arr-joint: #8fd0d6; --arr-joint-bg: #1d3537; --arr-separate: #f0c67e; --arr-separate-bg: #3a2e19; --arr-none: #c3c9d2; --arr-none-bg: #2a303b; }
.arr-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 6px; font: 700 .72rem/1 var(--font); letter-spacing: .02em; white-space: nowrap; }
.arr-joint { background: var(--arr-joint-bg); color: var(--arr-joint); }
.arr-separate { background: var(--arr-separate-bg); color: var(--arr-separate); }
.arr-none, .arr-unknown { background: var(--arr-none-bg); color: var(--arr-none); }
.arr-banner { padding: 10px 12px; border-radius: 8px; margin: 0 0 12px; font-size: .9rem; }
.ticket { display: inline-flex; flex-direction: column; gap: 4px; padding: 4px 0 4px 8px; border-left: 3px solid var(--tk, var(--oth)); }
.ticket.is-lead { background: color-mix(in srgb, var(--tk) 8%, transparent); border-radius: 0 6px 6px 0; }
.ptag-bar-D { --tk: var(--dem); } .ptag-bar-R { --tk: var(--rep); } .ptag-bar-I { --tk: var(--ind); } .ptag-bar-L, .ptag-bar-G, .ptag-bar-O { --tk: var(--oth); }
.tk-row { display: flex; align-items: center; gap: 6px; }
.tk-role { width: 44px; flex: none; font: 700 .62rem/1 var(--font); text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.con-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.con-pair .con-form-wrap { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
@media (max-width: 1200px) { .con-pair { grid-template-columns: minmax(0, 1fr); } }
.con-cand .ticket { padding-top: 2px; padding-bottom: 2px; }
:root { --arr-joint-map: #5aa3aa; --arr-separate-map: #d9a441; --arr-none-map: #a3abb6; }
.gov-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 28px; }
.gov-grid.wide { grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); }
.gov-card { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.gov-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gov-head .title { font-weight: 700; color: var(--text); }
.pane-label { display: flex; align-items: center; gap: 8px; font: 700 .7rem/1.2 var(--font); text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 6px; }
.pane-label a { color: var(--text-2); }
.sep-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.sep-pair > div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.cands.tickets { flex-direction: column; align-items: flex-start; gap: 8px; }
.cands { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.split-note { font-size: .82rem; font-weight: 600; padding: 4px 8px; border-radius: 6px; background: var(--tossup-2); color: var(--text); margin: 0; }
@media (max-width: 520px) { .sep-pair { grid-template-columns: minmax(0, 1fr); } .gov-grid.wide { grid-template-columns: minmax(0, 1fr); } }
.head-tags { display: flex; gap: 8px; align-items: center; }
.pair-card .sep-pair > div.here { border-color: var(--line-strong); background: var(--surface-2); }
.pair-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; }
.stack > .arr-banner { margin: 0; }
.cchip { flex: 0 1 auto; min-width: 0; }
.cchip .nm { min-width: 0; }
.ticket, .tk-row { max-width: 100%; min-width: 0; }

/* ---- Lieutenant governor tables: one row per state, all rows one height ---- */
.lg-explain { color: var(--text-2); font-size: .9rem; margin: -4px 0 10px; }
.lg-table { display: grid; }
.lg-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 130px 130px; gap: 12px; align-items: center; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.lg-row:last-child { border-bottom: 0; }
.lg-headrow { min-height: 0; padding: 0 0 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 600; }
.lg-state { font-weight: 700; color: var(--text); }
.lg-row > span:last-child { text-align: right; }
.cands.one-line { flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.cands.one-line:has(.more-btn[aria-expanded='true']) { flex-wrap: wrap; }
.lg-note { line-height: 1.35; }
@media (max-width: 760px) {
  .lg-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .lg-headrow { display: none; }
  .lg-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .lg-row > :nth-child(3) { grid-column: 2; grid-row: 1; justify-self: end; }
  .lg-row > :nth-child(4) { grid-column: 1 / -1; grid-row: 3; text-align: left; }
  .cands.one-line { gap: 6px; }
}
/* On a one-line list the names shorten (with an ellipsis) before "+N" is pushed out of view. */
.cands.one-line > .cl { min-width: 0; flex: 0 1 auto; flex-wrap: nowrap; }
.cands.one-line .more-btn { flex: none; }
.cchip { align-items: center; }
.cchip .nm { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 22px; }
.cchip .nm .star { display: inline-block; vertical-align: -1px; }
.cchip .seg { flex: none; align-self: stretch; }
.cand .who .cchip .nm { line-height: 26px; }
/* Phones: one chip per line (D, then R), "+N" beside the second, so every
   row is the same two lines and no name is cut short. */
@media (max-width: 760px) {
  .lg-row .cands.one-line { display: grid; grid-template-columns: minmax(0, max-content) auto; justify-content: start; gap: 4px 8px; }
  .lg-row .cands.one-line > .cl { grid-column: 1; }
  .lg-row .cands.one-line > .more-btn { grid-column: 2; grid-row: 2; align-self: center; }
  .lg-row .cands.one-line > .extra:not([hidden]) { display: contents; }
}
/* Column sets for the shared table */
.lg-table.t-rated .lg-row { grid-template-columns: 170px minmax(0, 1fr) 150px 120px 120px; }
.lg-table.t-two .lg-row:not(.lg-headrow) { min-height: 64px; }
.lg-table.t-judicial .lg-row { grid-template-columns: 200px minmax(0, 1fr) 120px 120px; }
.lg-table.t-measure .lg-row { grid-template-columns: 220px minmax(0, 1fr) 200px 110px; min-height: 52px; }
.lg-group { padding: 14px 0 6px; font-weight: 700; font-size: .85rem; color: var(--text-2); border-bottom: 1px solid var(--line-strong); }
.two-line { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.two-line .ln { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ln-role { width: 42px; flex: none; font: 700 .6rem/1 var(--font); text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.split-tag { font: 700 .66rem/1 var(--font); padding: 3px 6px; border-radius: 4px; background: var(--tossup-2); color: var(--text); flex: none; }
.jtag, .pos { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; font: 600 .68rem/1 var(--font); white-space: nowrap; flex: none; }
.lg-table.t-measure .clamp { -webkit-line-clamp: 2; }
@media (max-width: 760px) {
  .lg-table.t-rated .lg-row, .lg-table.t-judicial .lg-row, .lg-table.t-measure .lg-row { grid-template-columns: minmax(0, 1fr) auto; }
  .lg-table .lg-row > :nth-child(5) { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 760px) {
  .lg-table.t-rated .lg-row > :nth-child(1), .lg-table.t-judicial .lg-row > :nth-child(1), .lg-table.t-measure .lg-row > :nth-child(1) { grid-column: 1; grid-row: 1; }
  .lg-table.t-rated .lg-row > :nth-child(4), .lg-table.t-judicial .lg-row > :nth-child(4), .lg-table.t-measure .lg-row > :nth-child(4) { grid-column: 2; grid-row: 1; justify-self: end; text-align: right; }
  .lg-table.t-rated .lg-row > :nth-child(2), .lg-table.t-judicial .lg-row > :nth-child(2), .lg-table.t-measure .lg-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .lg-table.t-rated .lg-row > :nth-child(3), .lg-table.t-judicial .lg-row > :nth-child(3) { grid-column: 1; grid-row: 3; }
  .lg-table.t-measure .lg-row > :nth-child(3) { grid-column: 1 / -1; grid-row: 3; }
  .lg-table.t-rated .lg-row > :nth-child(5) { grid-column: 2; grid-row: 3; justify-self: end; text-align: right; }
}
.lg-table .lg-state.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.pos-sources { margin: 6px 0 0; padding-left: 16px; } .pos-sources li + li { margin-top: 2px; }
.lg-table.t-measure .cands.one-line .muted { white-space: nowrap; flex: none; }
.pos-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.leg { gap: 4px !important; }
.leg-label { font: 700 .62rem/1 var(--font); text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); white-space: nowrap; flex: none; }
.legv { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; font: 600 .66rem/1 var(--font); white-space: nowrap; flex: none; background: transparent !important; border: 1px solid currentColor; }
@media (min-width: 761px) { .lg-table.t-measure .lg-row { grid-template-columns: 240px minmax(0, 1fr) 250px 100px; min-height: 58px; } }
@media (max-width: 760px) {
  .lg-table.t-measure .lg-row > :nth-child(3), .lg-table.t-rated .lg-row > :nth-child(3), .lg-table.t-judicial .lg-row > :nth-child(3) { justify-self: start; text-align: left; }
}
@media (max-width: 760px) { .lg-row .pos-cell .cands.one-line { display: flex; flex-wrap: nowrap; } }
.signin { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.signin b { flex-basis: 100%; }
.signin label { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.signin input { height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--surface); color: var(--text); font: inherit; }
.linkbtn { all: unset; color: var(--accent); cursor: pointer; text-decoration: underline; } .linkbtn:focus-visible { outline: 2px solid var(--focus); }

/* Candidate chip, square-cornered, with the party tag as a small inset box. */
.cchip { border-radius: 4px; height: 24px; padding-right: 3px; }
.cchip .seg { align-self: center; height: 15px; padding: 0 4px; margin-left: 1px; border-left: 0; border-radius: 3px; font-size: .56rem; letter-spacing: .03em; background: color-mix(in srgb, currentColor 14%, transparent); }
.cchip .nm { padding: 0 6px 0 8px; line-height: 24px; }
.cand .who .cchip { height: 28px; }
.cand .who .cchip .nm { line-height: 28px; }
.cand .who .cchip .seg { height: 17px; font-size: .6rem; }

/* ---- Election night ---- */
.night-filters { align-items: center; }
.night-filters input[type='search'] { flex: 1; min-width: 160px; }
.night-table .night-row { grid-template-columns: 190px minmax(0, 1fr) 90px; min-height: 52px; }
.night-row.called { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.cb-set { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.callbtn { all: unset; cursor: pointer; border-radius: 6px; padding: 2px; border: 2px solid transparent; display: inline-flex; }
.callbtn:hover { border-color: var(--line-strong); }
.callbtn:focus-visible { outline: 2px solid var(--focus); }
.callbtn.on { border-color: var(--text); }
.callbtn .cb-label { padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 4px; font-size: .82rem; font-weight: 600; }
.callbtn.on .cb-label { background: var(--text); color: var(--surface); }
.cb-other, .night-filters select, .night-filters input { height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); padding: 0 8px; font: inherit; font-size: .86rem; }
.small-btn { padding: 4px 10px; font-size: .8rem; }
.feed-card .filters { margin-bottom: 4px; }
@media (max-width: 760px) {
  .night-table .night-row { grid-template-columns: minmax(0, 1fr) auto; }
  .night-table .night-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .night-table .night-row > :nth-child(3) { grid-column: 2; grid-row: 1; }
}
/* Election night: the feed is as tall as its calls and follows the scroll. */
.night-grid { align-items: start; }
@media (min-width: 961px) { .night-feed { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow-y: auto; } }
.cb-other { width: 130px; flex: none; }
.night-table .night-row { grid-template-columns: 190px minmax(0, 1fr) 130px 90px; }
@media (max-width: 760px) {
  .night-table .night-row { grid-template-columns: minmax(0, 1fr) auto; }
  .night-table .night-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .night-table .night-row > :nth-child(3) { grid-column: 1; grid-row: 3; }
  .night-table .night-row > :nth-child(4) { grid-column: 2; grid-row: 1; }
}
@media (max-width: 760px) { .night-filters .seg { flex-wrap: wrap; max-width: 100%; } .night-filters .seg button { flex: 1 0 auto; } }
.signin-note { flex-basis: 100%; margin: 0; }
.auth-slot { display: flex; align-items: center; gap: 8px; font-size: .85rem; white-space: nowrap; flex: none; }
.auth-in { font-weight: 600; }

/* ---- Race dialog for "+N more" ---- */
html { scrollbar-gutter: stable; }
html.rd-open { overflow: hidden; }
.rd-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(10, 14, 20, .5); opacity: 0; transition: opacity .18s ease; }
.rd-backdrop.in { opacity: 1; }
.rd-panel { width: min(520px, 100%); max-height: min(80vh, 640px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); padding: 18px; transform: translateY(14px) scale(.97); transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.rd-backdrop.in .rd-panel { transform: none; }
.rd-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.rd-head h2 { font-size: 1.15rem; }
.rd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; }
.rd-count { margin: 6px 0 8px; }
.rd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rd-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.rd-list li:last-child { border-bottom: 0; }
.rd-foot { margin-top: 14px; display: flex; justify-content: flex-end; }
@media (prefers-reduced-motion: reduce) { .rd-backdrop, .rd-panel { transition: none; } }
/* Sign-in: a compact centred card whose fields fill its width. */
#signin-card, #pred-signin, #c-signin { max-width: 460px; margin-left: auto; margin-right: auto; width: 100%; }
.signin { flex-direction: column; align-items: stretch; gap: 12px; max-width: 460px; margin: 0 auto; }
.signin label, .signin input, .signin .btn.primary { width: 100%; }
.signin .btn.primary { justify-content: center; height: 40px; }
.signin .linkbtn { align-self: center; }
.signin [data-msg] { text-align: center; }
.page-head:has(+ #signin-card) { justify-content: center; text-align: center; }

/* ---- Custom dropdown (assets/dropdown.js) ---- */
.dd { position: relative; display: inline-flex; max-width: 100%; vertical-align: middle; }
.dd-native { position: absolute !important; inset: 0; opacity: 0; pointer-events: none; width: 100% !important; height: 100% !important; }
.dd-trigger { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-width: 0; height: 34px; padding: 0 10px 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; text-align: left; transition: border-color .12s, box-shadow .12s; }
.dd-trigger:hover { border-color: var(--text-3); }
.dd-trigger:focus-visible, .dd-trigger[aria-expanded='true'] { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.dd-trigger:disabled { opacity: .55; cursor: not-allowed; }
.dd-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chev { width: 12px; height: 12px; flex: none; color: var(--text-3); transition: transform .15s; }
.dd-trigger[aria-expanded='true'] .dd-chev { transform: rotate(180deg); }
.dd-panel { position: fixed; z-index: 70; max-width: min(360px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(10, 14, 20, .18), 0 2px 6px rgba(10, 14, 20, .08); padding: 6px; opacity: 0; transform: translateY(-4px); transition: opacity .12s ease, transform .14s ease; }
.dd-panel.in { opacity: 1; transform: none; }
.dd-search { width: 100%; height: 32px; margin-bottom: 6px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 0 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .88rem; }
.dd-search:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.dd-list { list-style: none; margin: 0; padding: 0; max-height: 270px; overflow-y: auto; outline: none; }
.dd-list li { padding: 7px 10px; border-radius: 6px; font-size: .9rem; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-list li.active { background: var(--surface-2); }
.dd-list li.selected { font-weight: 700; color: var(--accent); }
.dd-list li.selected::after { content: ' ✓'; }
.dd-list li[aria-disabled='true'] { opacity: .5; cursor: default; }
.dd-list .dd-empty { color: var(--text-3); cursor: default; }
.dd-panel.sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; max-width: none; width: auto; border-radius: 14px 14px 0 0; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); transform: translateY(30px); }
.dd-panel.sheet.in { transform: none; }
.dd-panel.sheet .dd-list { max-height: 55vh; }
.dd-panel.sheet .dd-list li { padding: 11px 10px; font-size: 1rem; }
.dd-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dd-x { border: 0; background: none; color: var(--text-2); font-size: 1rem; padding: 6px; cursor: pointer; }
.dd-back { position: fixed; inset: 0; z-index: 69; background: rgba(10, 14, 20, .4); }
@media (prefers-reduced-motion: reduce) { .dd-panel, .dd-chev, .dd-trigger { transition: none; } }
/* Places that sized their selects */
.dd-from-cb-other { width: 130px; flex: none; }
.pred-table .dd { width: 100%; max-width: 220px; }
.con-row .dd, .console .dd { width: 100%; }
.console .dd-trigger, .con-row .dd-trigger { height: 38px; font-size: 1rem; }
.filters .dd { min-width: 140px; }

/* ---- Scrollbars: thin, rounded, in the theme ---- */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--text-3); }
::-webkit-scrollbar-corner { background: transparent; }
/* ---- Help ---- */
.help-grid { align-items: stretch; }
.help-grid > .card { display: flex; flex-direction: column; min-height: 0; }
.help-grid > .card > h2 { font-size: 1rem; margin-bottom: 10px; }
.help-closing-filters { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; margin-bottom: 8px; }
.help-closing-filters label, .help-closing-filters .dd, .help-closing-filters .dd-trigger { width: 100%; min-width: 0; }
.help-closing-filters .dd-trigger { height: 36px; font-size: .8rem; }
.help-polls { container-type: inline-size; }
.help-polls .poll-closing-group { grid-template-columns: 112px minmax(0,1fr); gap: 12px; }
.help-polls .poll-closing-group:first-child { margin-top: 0; }
.help-polls .poll-closing-group:last-child { margin-bottom: 0; }
.help-polls .poll-time { position: sticky; top: 0; align-self: start; background: var(--surface); }
.help-polls .poll-time h2 { font-size: .84rem; display: grid; gap: 1px; }
.help-polls .poll-date { color: var(--text-2); font-size: .65rem; font-weight: 500; }
.help-polls .poll-time h2 > b { font-size: .8rem; }
.help-polls .poll-closing-places { grid-template-columns: repeat(auto-fill, var(--closing-block-width,198px)); justify-content: start; }
.help-polls .card.poll-closing-place { height: 28px; padding: 3px 6px; display: flex; align-items: center; }
.help-polls .poll-closing-place header b { white-space: nowrap; font-size: .76rem; }
.help-polls .poll-closing-place header { width: 100%; }
.help-closing-next { margin: 0 0 9px; padding: 7px 10px; text-align: left; background: var(--surface-2); border-radius: 8px; grid-template-columns: 1fr auto; align-items: center; }
.help-closing-next > small { grid-column: 2; grid-row: 1 / 3; }
.help-closing-next > b { font-size: .85rem; }
.help-closing-toolbar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: center; gap: 10px; margin-bottom: 8px; }
.help-closing-toolbar .help-closing-filters { margin: 0; height: 44px; }
.help-closing-toolbar .help-closing-filters .dd-trigger { height: 44px; }
.help-closing-toolbar .help-closing-next { margin: 0; padding: 4px 8px; height: 44px; min-width: 0; border: 1px solid var(--line-strong); }
.help-closing-toolbar .poll-next > span, .help-closing-toolbar .poll-next small { font-size: .65rem; }
.help-closing-toolbar .poll-next > b { font-size: .75rem; }
.help-state-list { list-style: none; margin: 0; padding: 0; }
.help-state-group + .help-state-group { margin-top: 18px; }
.help-state-group h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; font-size: .75rem; color: var(--text-2); }
.help-state-group h3 > span { font-size: .68rem; font-weight: 400; color: var(--text-3); }
.help-state-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.help-state-row[hidden] { display: none; }
.help-state-row:last-child { border-bottom: 0; }
.help-state-row abbr { width: 34px; height: 28px; display: grid; place-items: center; flex: none; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--accent); font-size: .72rem; font-weight: 700; text-decoration: none; }
.help-state-row > span { min-width: 0; }
.help-state-row b { display: block; font-size: .78rem; font-weight: 550; }
.help-state-row small { display: block; font-size: .66rem; color: var(--text-3); }
@container (max-width: 680px) { .help-polls .poll-closing-group { grid-template-columns: minmax(0,1fr); gap: 6px; } .help-polls .poll-time { z-index: 1; padding: 8px 0; } }
.help-closing-sources { flex: none; margin-top: 8px; font-size: .72rem; }
.help-closing-sources p { margin: 6px 0; }
.help-closing-sources > div { display: flex; flex-wrap: wrap; gap: 5px 12px; }
.help-closing-sources[open] { max-height: 28dvh; overflow-y: auto; }
.help-closing-sources > .help-closing-notes { display: block; }
.help-closing-notes p { color: var(--text-2); }
@media (min-width: 961px) {
 html.help-overview-page, .help-overview-page body { height: 100dvh; overflow: hidden; }
 .help-overview-page main.wrap { max-width: none; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding-top: 10px; padding-bottom: 12px; }
 .help-overview-page .section-nav-wrap { max-width: none; }
 .help-overview-page .page-head { flex: none; }
 .help-overview-page .page-head { margin-bottom: 8px; }
 .help-overview-page .page-head h1 { font-size: 1.25rem; line-height: 1.2; }
 .help-overview-page .page-head p { font-size: .75rem; line-height: 1.4; }
 .help-overview-page .help-grid { flex: 1 1 auto; min-height: 0; grid-template-columns: minmax(0,1fr) 220px; grid-template-rows: minmax(0,1fr); }
 .help-overview-page .help-grid > .card { overflow: hidden; }
 .help-overview-page .help-grid > .card > :not(.scroll-y) { flex: none; }
 .help-overview-page .help-grid .scroll-y { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
 .help-overview-page .help-polls .poll-timeline { flex: 1 1 0; display: flex; flex-direction: column; justify-content: space-between; overflow: visible; scrollbar-gutter: auto; }
 .help-overview-page .poll-closing-group { flex: none; }
 .help-overview-page .poll-closing-group { display: grid; padding: 3px 0; margin: 0; border-bottom: 1px solid var(--line); }
 .help-overview-page .poll-closing-group:last-child { border-bottom: 0; }
 .help-overview-page .help-polls .poll-time { position: static; padding: 0; margin: 0; border: 0; }
 .help-overview-page .help-polls .poll-time h2 { display: grid; gap: 1px; line-height: 1.1; }
 .help-overview-page .poll-date { color: var(--text-2); font-size: .65rem; font-weight: 500; }
 .help-overview-page .poll-time h2 > b { font-size: .8rem; }
 .help-overview-page .help-polls .poll-closing-places { gap: 4px; }
}
@media (min-width: 961px) and (max-height: 800px) {
 .help-overview-page .page-head p { display: none; }
 .help-overview-page .help-polls .card.poll-closing-place { height: 22px; padding: 0 6px; }
 .help-overview-page .help-polls .poll-closing-place header { line-height: 1.2; }
 .help-overview-page .help-polls .poll-closing-place header b { font-size: .72rem; }
 .help-overview-page .poll-closing-group { padding: 1px 0; }
 .help-overview-page .poll-date { font-size: .6rem; }
 .help-overview-page .poll-time h2 > b { font-size: .73rem; }
 .help-overview-page .help-polls .poll-closing-places { gap: 3px; }
 .help-overview-page .help-polls .poll-closing-group { grid-template-columns: 104px minmax(0,1fr); gap: 10px; }
}
@media (min-width: 961px) and (max-height: 700px), (min-width: 961px) and (max-width: 1100px) {
 .help-overview-page .help-polls .poll-closing-place header b { font-size: .64rem; }
 .help-overview-page .help-polls .poll-closing-group { grid-template-columns: 86px minmax(0,1fr); gap: 10px; }
}
@media (max-width: 760px) { .help-closing-toolbar { grid-template-columns: minmax(0,1fr); } }
@media (min-width: 961px) and (max-width: 1100px) { .help-overview-page .help-grid { grid-template-columns: minmax(0,1fr) 180px; } }
.help-search { width: 100%; height: 36px; margin-bottom: 10px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px; background: var(--surface-2); color: var(--text); font: inherit; }
.help-search:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.abbr-table td, .abbr-table th { padding: 7px 10px; }
.help-grid .scroll-y { max-height: 640px; }
/* Rating dates are no longer drawn beside the pill; every pill is one width. */
.rdate { display: none !important; }
.rating { width: 88px; min-width: 0; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Nine sections: tighter nav spacing on mid-width screens. */
@media (max-width: 1500px) { .nav a { padding: 0 9px; } .head-row { gap: 14px; } }
@media (max-width: 1280px) { .head-row .brand span { display: none; } }
.terr-note { margin-top: 10px; }
/* Race and status never wrap, so every row of a race table is one line tall. */
@media (min-width: 1200px) { .race-table td:first-child, .race-table td:last-child { white-space: nowrap; } }

/* ---- Sub-tabs (Territories: Races | Legislatures) ---- */
.subtabs { display: flex; gap: 6px; margin: -4px 0 14px; }
.subtabs a { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 5px 14px; font-size: .88rem; text-decoration: none; }
.subtabs a:hover { color: var(--text); }
.subtabs a[aria-current='page'] { background: var(--text); color: var(--surface); border-color: var(--text); }

/* ---- Legislatures: expandable chamber rows ---- */
.leg-toggle { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font: inherit; }
.leg-toggle:hover span { text-decoration: underline; text-underline-offset: 2px; }
.leg-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.leg-chev { width: 12px; height: 12px; flex: none; color: var(--text-3); transition: transform .2s ease; }
.open > td .leg-chev, .leg-item.open .leg-chev { transform: rotate(90deg); }
.leg-row { cursor: pointer; }
.leg-row:hover > td { background: var(--surface-2, rgba(127,127,127,.05)); }
.leg-row.open > td { border-bottom-color: transparent; }
.leg-detail > td { padding: 0; border-bottom: 0; }
.leg-row.open + .leg-detail > td { border-bottom: 1px solid var(--line); }
.leg-drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .24s ease; }
.leg-drawer.open { grid-template-rows: 1fr; }
.leg-drawer-clip { overflow: hidden; min-height: 0; }
.leg-drawer:not(.open) .leg-drawer-clip { visibility: hidden; transition: visibility 0s .24s; }
.leg-drawer-in { padding: 4px 10px 14px 28px; }
.leg-msg { margin: 6px 0 2px; color: var(--text-2); font-size: .9rem; }
.leg-meta { margin: 4px 0 6px; }
.leg-meta a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.seat-table { font-size: .86rem; }
.seat-table th { background: transparent; padding: 6px 10px; }
.seat-table td { padding: 6px 10px; }
.seat-table tr:last-child td { border-bottom: 0; }
.seat-table td:first-child { white-space: nowrap; color: var(--text-2); width: 1%; }
.seat-table td:nth-child(2) { white-space: nowrap; width: 1%; }
.leg-item { cursor: pointer; }
.leg-item > .leg-drawer { grid-column: 1 / -1; cursor: default; }
.leg-item .leg-drawer-in { padding: 2px 0 4px 18px; }
.seat-list { list-style: none; margin: 0; padding: 0; }
.seat-list li { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .86rem; }
.seat-list .seat-name { color: var(--text-2); font-weight: 600; }
.seat-list .cands { display: flex; flex-wrap: wrap; gap: 6px 12px; }
@media (prefers-reduced-motion: reduce) { .leg-drawer, .leg-chev { transition: none; } }
.seat-called { color: var(--text-2); }
.seat-table td:last-child { white-space: nowrap; width: 1%; }
.seat-list .seat-name .tag { margin-left: 6px; font-weight: 600; }

/* ---- Collapsible call feeds ---- */
.feed-group { border-top: 1px solid var(--line); margin-top: 12px; }
.card > .feed-group:first-child { border-top: 0; margin-top: 0; }
.feed-group > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer; font-weight: 700; }
.feed-group > summary::-webkit-details-marker { display: none; }
.feed-group > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.feed-group .fg-count { font-weight: 400; font-size: .86rem; }
.feed-group .fg-chev { width: 14px; height: 14px; margin-left: auto; color: var(--text-3); transition: transform .2s ease; }
.feed-group[open] .fg-chev { transform: rotate(180deg); }
.feed-group .fg-body { padding-bottom: 8px; }
.card > .feed-group > summary { font-size: 1.05rem; padding: 0; }
.card > .feed-group[open] > summary { margin-bottom: 12px; }
.fg-more { margin: 12px 0 0; }
@media (prefers-reduced-motion: reduce) { .feed-group .fg-chev { transition: none; } }

/* ---- Election night: map and charts on top, undo in feeds ---- */
.night-top { margin-bottom: 16px; }
/* The feed beside the map is exactly as tall as the map and scrolls inside. */
@media (min-width: 961px) {
  .night-top.grid-main { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .night-feed-slot { position: relative; min-height: 320px; }
  .night-feed.fit { position: absolute; inset: 0; overflow-y: auto; max-height: none; }
}
.feed li.has-undo { position: relative; }
.feed li.has-undo .t { padding-right: 58px; }
.feed-undo { position: absolute; top: 9px; right: 0; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 0 9px; font: inherit; font-size: .74rem; line-height: 20px; cursor: pointer; }
.feed-undo:hover { color: var(--text); border-color: var(--text-2); }
.feed-undo:disabled { opacity: .5; cursor: default; }
.toast-act { margin-left: 10px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
#df-leg > .feed-group, #cf-state > .feed-group:first-child:only-child { margin-top: 0; }
#df-leg > .feed-group { border-top: 0; }
.feed-withdrawn { margin: 8px 0 0; font-size: .82rem; }

/* Call log: separate race, outcome and attribution, with explicit history. */
.call-log { min-width: 0; }
.call-filters { display: grid; gap: 10px; margin: 12px 0; }
.call-search { display: block; }
.call-search input, .call-selects select { width: 100%; min-width: 0; height: 38px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--text); padding: 0 10px; font: inherit; font-size: .83rem; }
.call-selects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.call-selects .dd { min-width: 0; width: 100%; }
.call-selects .dd-trigger { width: 100%; }
.call-status-tabs { display: flex; padding: 3px; gap: 3px; border-radius: 8px; background: var(--surface-2); }
.call-status-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 5px 7px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font: 600 .77rem var(--font); cursor: pointer; white-space: nowrap; }
.call-status-tabs button[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.call-status-tabs button span { font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--text-3); }
.call-log-count { color: var(--text-3); font-size: .76rem; margin-bottom: 10px; }
.call-timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.call-day { display: flex; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: .73rem; font-weight: 600; padding: 8px 0 2px; }
.call-day span { font-weight: 400; color: var(--text-3); }
.call-entry { --party-color: var(--oth); border: 1px solid var(--line); border-left: 3px solid var(--party-color); border-radius: 8px; padding: 12px; background: var(--surface); display: grid; gap: 9px; }
.call-entry.p-D, .candidate-call.p-D { --party-color: var(--dem); }
.call-entry.p-R, .candidate-call.p-R { --party-color: var(--rep); }
.call-entry.p-I, .candidate-call.p-I { --party-color: var(--ind); }
.call-entry-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.call-entry-top time { margin-left: auto; font-size: .71rem; font-variant-numeric: tabular-nums; color: var(--text-3); }
.call-status { width: fit-content; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; color: var(--text-2); background: var(--surface-2); font-size: .68rem; font-weight: 600; white-space: nowrap; }
.call-status.withdrawn { border-style: dashed; }
.call-gain { font-size: .68rem; color: var(--text-2); }
.call-race { color: var(--text); font-size: .94rem; font-weight: 650; line-height: 1.3; }
.call-winner { font-weight: 600; font-size: .85rem; }
.call-entry-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.call-attribution { color: var(--text-3); font-size: .74rem; line-height: 1.4; overflow-wrap: anywhere; }
.call-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.call-actions a, .call-actions button, .call-withdraw { font: 500 .75rem var(--font); color: var(--text-2); background: transparent; border: 0; padding: 5px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.call-actions button:hover, .call-withdraw:hover { color: var(--rep); }
.call-actions button:disabled { opacity: .5; cursor: wait; }
.call-entry.is-withdrawn { background: var(--surface-2); border-left-color: var(--line-strong); }
.call-entry.is-withdrawn .call-winner { color: var(--text-2); }
.call-empty { display: grid; justify-items: center; gap: 8px; padding: 32px 16px; border: 1px dashed var(--line-strong); border-radius: 8px; text-align: center; }
.call-empty > span { font-size: 1.6rem; color: var(--text-3); }
.call-empty b { font-size: .9rem; }
.call-empty p { font-size: .8rem; color: var(--text-3); }
.call-load-more { width: 100%; justify-content: center; margin-top: 12px; }
.call-race-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.call-race-card { border: 1px solid var(--line); border-radius: 9px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); min-width: 0; scroll-margin-top: 90px; }
.call-race-card.is-called { background: color-mix(in srgb, var(--surface-2) 30%, var(--surface)); }
.call-race-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.call-race-head > a { color: var(--text); font-weight: 650; line-height: 1.3; }
.call-current { color: var(--text-2); font-size: .76rem; }
.call-current span { display: block; color: var(--text-3); }
.call-picks { display: grid; gap: 7px; }
.candidate-call { --party-color: var(--oth); display: grid; gap: 2px; text-align: left; width: 100%; min-height: 54px; border: 1px solid var(--line-strong); border-left: 3px solid var(--party-color); border-radius: 6px; background: var(--surface); color: var(--text); padding: 9px 11px; cursor: pointer; font: inherit; transition: background .12s, border-color .12s; }
.candidate-call:hover:not(:disabled) { background: color-mix(in srgb, var(--party-color) 10%, var(--surface)); border-color: var(--party-color); }
.candidate-call[aria-pressed='true'] { background: color-mix(in srgb, var(--party-color) 10%, var(--surface)); border-color: var(--party-color); cursor: default; }
.candidate-call:disabled:not([aria-pressed='true']) { opacity: .6; cursor: wait; }
.candidate-call-name { font-weight: 600; font-size: .85rem; }
.candidate-call-party { font-size: .7rem; color: var(--text-2); }
.call-race-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--text-3); font-size: .74rem; margin-top: auto; }
#mark > .signin { padding: 12px 0; }
@media (max-width: 1080px) { .call-race-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .call-race-grid { grid-template-columns: minmax(0, 1fr); }
  .call-selects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .call-entry-top time { flex-basis: 100%; margin-left: 0; }
  .call-race-card { padding: 12px; }
  .call-status-tabs button { font-size: .73rem; }
}
@media (prefers-reduced-motion: reduce) { .candidate-call { transition: none; } }

/* Four independent browsing sections with their own page navigation. */
.section-nav-wrap { padding-top: 14px; }
.section-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; padding: 9px 0 13px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.section-label { font-size: .76rem; font-weight: 700; color: var(--text-3); padding-right: 12px; }
.section-nav a { padding: 6px 10px; border-radius: 6px; font-size: .81rem; color: var(--text-2); }
.section-nav a[aria-current='page'] { background: var(--surface-2); color: var(--text); font-weight: 650; }
.section-stats { display: flex; flex-wrap: wrap; gap: 1px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--line); }
.section-stats > div { flex: 1; min-width: 150px; display: grid; gap: 3px; background: var(--surface); padding: 18px 22px; }
.section-stats b { font-size: 1.8rem; }
.section-stats span { font-size: .78rem; color: var(--text-2); }
.section-intro { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.section-intro p { margin-top: 7px; color: var(--text-2); }
.section-field { display: grid; gap: 5px; font-size: .78rem; font-weight: 600; margin: 12px 0; color: var(--text-2); max-width: 480px; min-width: 0; }
.section-field input, .section-field select { width: 100%; min-width: 0; height: 38px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--text); background: var(--surface); padding: 0 10px; font: 400 .86rem var(--font); }
.section-field .dd, .section-field .dd-trigger { width: 100%; min-width: 0; }
.section-list-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.section-list-filters .section-field { flex: 1; min-width: 160px; margin: 0; }
.section-list-filters .section-field:first-child { flex: 2; min-width: 220px; }
.section-count { margin-bottom: 12px; }
.section-table-wrap { overflow-x: auto; }
.section-table { width: 100%; border-collapse: collapse; }
.section-table td { vertical-align: top; padding: 14px 10px; border-bottom: 1px solid var(--line); }
.section-table th { padding: 9px 10px; text-align: left; font-size: .72rem; color: var(--text-2); border-bottom: 1px solid var(--line-strong); }
.section-table td:first-child { width: 28%; }
.section-table td > .muted, .section-table td > span:not(.cchip):not(.rating):not(.arr-badge) { display: block; margin-top: 5px; }
.section-race-name { font-weight: 650; color: var(--text); line-height: 1.35; display: block; }
.section-candidates { display: flex; flex-wrap: wrap; gap: 7px; align-items: start; }
.section-poll-score { font-size: .8rem; display: block; margin-top: 5px; }
.section-race-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 10px; margin-top: 14px; }
.section-race-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 7px; padding: 12px; color: var(--text); }
.section-race-summary b { font-size: .84rem; }
.section-race-summary > span { font-size: .77rem; }
.place-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin-top: 14px; }
.place-grid a { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; font-size: .83rem; color: var(--text); }
.place-grid a[hidden] { display: none; }
.place-grid b { min-width: 28px; color: var(--text-3); }
.provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 9px; margin-top: 14px; }
.provider-card { display: grid; gap: 7px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); font-size: .86rem; }
.provider-card > span { color: var(--text-2); font-size: .73rem; }
.provider-search { margin-bottom: 20px; }
.provider-poll { margin-top: 15px; }
.poll-records { display: grid; gap: 10px; margin: 14px 0; }
.poll-record { border: 1px solid var(--line); padding: 13px; border-radius: 7px; display: grid; gap: 10px; }
.poll-record[hidden] { display: none; }
.poll-record-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .82rem; }
.poll-record-head > span { color: var(--text-2); font-size: .75rem; }
.poll-record-results { display: flex; flex-wrap: wrap; gap: 12px 18px; margin: 5px 0; }
.poll-record-results > span { display: inline-flex; align-items: center; gap: 8px; }
.forecast-rating-list { display: grid; margin-top: 14px; }
.forecast-rating-list > div { display: grid; grid-template-columns: minmax(0, 1fr) 95px 120px; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .84rem; }
.forecast-rating-list time { text-align: right; color: var(--text-2); font-size: .75rem; }
.ballot-list { display: grid; gap: 9px; margin-top: 14px; }
.ballot-card { display: grid; align-content: start; gap: 10px; border: 1px solid var(--line); padding: 14px; border-radius: 7px; }
.ballot-card .cchip { justify-self: start; }
.result-rows { margin-top: 14px; display: grid; gap: 13px; }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 14px; }
.result-row > span { color: var(--text-2); font-size: .78rem; }
.result-row > .cchip { justify-self: start; }
.result-row > i { grid-column: 1 / -1; height: 5px; background: linear-gradient(to right, var(--accent) var(--result-width), var(--surface-2) var(--result-width)); border-radius: 3px; }
.section-show-more { margin-top: 14px; }
@media (max-width: 760px) {
  .section-label { flex-basis: 100%; padding: 0 8px 4px; }
  .section-nav { gap: 3px; }
  .section-nav a { padding: 6px 8px; }
  .section-intro { align-items: start; flex-direction: column; gap: 12px; }
  .section-table thead { display: none; }
  .section-table tbody, .section-table tr, .section-table td { display: block; width: 100% !important; }
  .section-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .section-table td { border: 0; padding: 8px 0; }
  .section-table td[data-label]::before { content: attr(data-label); display: block; color: var(--text-3); font-size: .7rem; font-weight: 600; margin-bottom: 5px; }
  .forecast-rating-list > div { grid-template-columns: minmax(0, 1fr) 95px; }
  .forecast-rating-list time { grid-column: 1 / -1; text-align: left; }
  .poll-record-head { align-items: start; flex-direction: column; gap: 6px; }
  .result-row { grid-template-columns: minmax(0, 1fr) auto; }
  .result-row > span { grid-column: 1 / -1; }
}
.facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px 20px; margin: 16px 0 0; }
.facts dt { color: var(--text-2); font-size: .82rem; }
.facts dd { margin: 0; font-size: .86rem; }
@media (max-width: 520px) { .facts { grid-template-columns: minmax(0, 1fr); gap: 5px; } .facts dd { margin-bottom: 10px; } }
.console .section-field { max-width: none; margin: 10px 0; }
.pred-grid .filters .section-field { margin: 0; min-width: 160px; flex: 1; }
:root { --map-election: #9ba8ba; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --map-election: #64758d; } }
:root[data-theme='dark'] { --map-election: #64758d; }
.map-inspector .map-tip { width: 340px; max-width: min(340px, calc(100vw - 48px)); max-height: min(420px, 44vh); overflow-y: auto; pointer-events: auto; padding: 15px; }
.map-inspector .map-tip h3 { padding-right: 22px; margin-bottom: 12px; }
.map-preview-close { position: absolute; right: 7px; top: 5px; border: 0; background: none; color: var(--text-2); padding: 2px 6px; font: 22px var(--font); cursor: pointer; }
.map-candidate-group + .map-candidate-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.map-candidate-group h4 { font-size: .78rem; color: var(--text-2); margin: 0 0 8px; }
.map-candidate-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.map-candidate-group li { display: flex; }
.map-inspector button.inset { font: inherit; background: var(--surface); color: var(--text); cursor: pointer; }

/* Race browsing: clear hierarchy, independent cards and readable people. */
body { font-size: 15px; }
.card { border-radius: 12px; }
.section-nav { justify-content: flex-start; gap: 4px; }
.section-nav .section-label { display: none; }
.section-nav a { padding: 8px 12px; font-size: .85rem; }
.section-page-head { margin-bottom: 25px; }
.section-page-head h1 { font-size: clamp(1.65rem, 2.4vw, 2.15rem); letter-spacing: -.035em; line-height: 1.15; }
.section-page-head p { margin-top: 10px; max-width: 730px; color: var(--text-2); line-height: 1.5; font-size: .92rem; }
.page-eyebrow { display: block; margin-bottom: 9px; color: var(--text-3); font-size: .7rem; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.catalogue-shell { border: 0; padding: 0; background: transparent; }
.catalogue-shell > .section-list-filters { padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); gap: 12px; margin-bottom: 0; }
.section-list-filters .section-field { font-size: .76rem; gap: 7px; }
.section-list-filters .section-field input { height: 42px; border-radius: 8px; background: var(--bg); }
.section-list-filters .dd-trigger { min-height: 42px; border-radius: 8px; background: var(--bg); padding-left: 12px; font-size: .85rem; font-weight: 500; }
.catalogue-status { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 2px; }
.catalogue-status .section-count { margin: 0; font-size: .8rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.filter-reset { border: 0; background: none; color: var(--accent); font: 500 .8rem var(--font); cursor: pointer; padding: 4px 0; }
.race-group + .race-group { margin-top: 30px; }
.race-group-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 14px; padding: 0 2px; }
.race-group-head h2 { font-size: 1.12rem; letter-spacing: -.015em; }
.race-group-head > span { color: var(--text-3); font-size: .75rem; }
.race-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.race-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .025); }
.race-card-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.race-card-location { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: .74rem; }
.race-card-location > span { display: inline-flex; justify-content: center; align-items: center; width: 29px; height: 24px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--text-2); font-size: .67rem; font-weight: 600; }
.race-card-head > .race-label { margin-left: auto; }
.race-card-head .section-race-name { flex-basis: 100%; color: var(--text); font-size: 1.1rem; font-weight: 650; line-height: 1.35; letter-spacing: -.015em; }
.race-card-head .section-race-name:hover { color: var(--accent); }
.race-label { display: inline-flex; width: fit-content; align-items: center; background: var(--surface-2); border: 1px solid var(--line); padding: 4px 7px; border-radius: 5px; font-size: .67rem; font-weight: 500; color: var(--text-2); }
.race-context { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; font-size: .77rem; color: var(--text-2); padding-bottom: 15px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.context-label { display: block; color: var(--text-3); font-size: .69rem; font-weight: 500; }
.race-context .context-label { flex: none; }
.race-context .race-label { margin-left: auto; }
.candidate-preview { display: grid; padding: 2px 0; }
.race-person { --person-color: var(--oth); padding: 13px 0; min-width: 0; color: var(--text); }
.race-person.p-D { --person-color: var(--dem); }
.race-person.p-R { --person-color: var(--rep); }
.race-person.p-I { --person-color: var(--ind); }
.race-person.p-L { --person-color: #b79839; }
.race-person.p-G { --person-color: #478c61; }
.race-person + .race-person { border-top: 1px solid var(--line); }
.person-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.person-identity { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; }
.person-name { font-size: .93rem; font-weight: 550; line-height: 1.4; overflow-wrap: anywhere; }
.person-party { display: inline-flex; flex: none; width: fit-content; max-width: 45%; padding: 3px 7px; border: 0; border-radius: 5px; font: 500 .65rem/1.35 var(--font); color: var(--text-2); background: var(--surface-2); text-align: right; white-space: normal; }
.person-party.ptag-D { color: var(--dem); background: color-mix(in srgb, var(--dem) 11%, var(--surface)); }
.person-party.ptag-R { color: var(--rep); background: color-mix(in srgb, var(--rep) 11%, var(--surface)); }
.person-party.ptag-I { color: var(--ind); background: color-mix(in srgb, var(--ind) 11%, var(--surface)); }
.person-incumbent { color: var(--text-3); font-size: .64rem; font-weight: 400; }
.person-mate { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 8px; margin-top: 5px; }
.person-mate > span { color: var(--text-3); font-size: .65rem; }
.person-mate > b { color: var(--text-2); font-size: .78rem; font-weight: 450; }
.candidate-overflow { border-top: 1px solid var(--line); }
.candidate-overflow > summary { width: fit-content; padding: 11px 0 5px; color: var(--accent); font-size: .76rem; cursor: pointer; }
.candidate-overflow > div { margin-top: 7px; }
.race-card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 13px; margin-top: 11px; }
.race-card-foot > span { color: var(--text-3); font-size: .71rem; }
.race-card-foot > a, .race-card-link { color: var(--accent); font-size: .76rem; font-weight: 500; }
.race-card-foot a > span, .race-card-link > span { margin-left: 5px; }
.race-chamber-info, .race-measure-info { padding: 15px 0 4px; display: grid; gap: 13px; }
.race-chamber-info p, .race-measure-info p { font-size: .86rem; line-height: 1.5; color: var(--text-2); margin: 0; }
.race-measure-info > span { font-size: .72rem; color: var(--text-3); }
.race-forecast-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 15px 0; border-top: 1px solid var(--line); }
.race-forecast-metrics > div { display: grid; align-content: start; justify-items: start; gap: 9px; }
.race-forecast-metrics b { font-size: 1.32rem; line-height: 1.2; }
.metric-note { color: var(--text-3); font-size: .7rem; }
.race-latest-poll { border-top: 1px solid var(--line); padding-top: 15px; }
.race-latest-poll > div { display: flex; justify-content: space-between; gap: 14px; font-size: .79rem; margin-top: 9px; }
.race-latest-poll b { font-weight: 550; }
.race-result-summary { display: grid; gap: 10px; padding: 3px 0 16px; }
.race-result-summary h3 { font-size: 1.05rem; font-weight: 550; line-height: 1.4; }
.race-result-summary p { color: var(--text-3); font-size: .74rem; }
.race-reporting { display: flex; align-items: baseline; gap: 9px; }
.race-reporting b { font-size: 1.6rem; }
.race-reporting > span, .race-seat-calls { font-size: .75rem; color: var(--text-3); }
.section-show-more { display: flex; justify-content: center; align-items: center; gap: 12px; width: 100%; min-height: 46px; margin-top: 22px; border-radius: 9px; }
.section-show-more > span { font-size: .74rem; font-weight: 400; color: var(--text-3); }
.catalogue-empty { border: 1px dashed var(--line-strong); padding: 50px 24px; text-align: center; border-radius: 12px; background: var(--surface); }
.catalogue-empty h2 { font-size: 1.05rem; }
.catalogue-empty p { color: var(--text-3); font-size: .85rem; margin-top: 10px; }
.ballot-person-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ballot-person-grid .ballot-card { padding: 5px 16px; background: var(--surface); }
.ballot-person-grid .race-person { width: 100%; }
.section-race-grid .ballot-card .section-candidates { display: grid; width: 100%; gap: 0; }
.section-race-grid .ballot-card .race-person { padding-bottom: 9px; }
.section-page-head + .stack > .card, .section-page-head ~ .stack > .card { padding: 22px; }
.provider-card { padding: 18px; border-radius: 9px; min-height: 94px; }
.provider-card > b { font-size: .93rem; font-weight: 600; }
.poll-record { padding: 17px; border-radius: 9px; }
@media (max-width: 760px) {
  .race-card-grid, .ballot-person-grid { grid-template-columns: minmax(0, 1fr); }
  .race-card { padding: 18px; }
  .catalogue-shell > .section-list-filters { padding: 16px; }
  .section-list-filters .section-field, .section-list-filters .section-field:first-child { flex: 1 1 100%; min-width: 0; max-width: none; }
  .section-page-head { margin-bottom: 20px; }
  .section-page-head h1 { font-size: 1.75rem; }
  .section-page-head p { font-size: .86rem; }
  .race-context .race-label { margin-left: 0; }
  .person-party { max-width: 40%; }
  .section-nav { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; padding-bottom: 12px; }
  .section-nav a { flex: none; padding: 8px 10px; }
  .section-page-head + .stack > .card, .section-page-head ~ .stack > .card { padding: 18px; }
}
.person-party { font-size: .7rem; }
.person-party.ptag-D { color: var(--ptag-D-fg); background: var(--ptag-D-bg); }
.person-party.ptag-R { color: var(--ptag-R-fg); background: var(--ptag-R-bg); }
.person-party.ptag-I { color: var(--ptag-I-fg); background: var(--ptag-I-bg); }
.person-party.ptag-L { color: var(--ptag-L-fg); background: var(--ptag-L-bg); }
.person-party.ptag-G { color: var(--ptag-G-fg); background: var(--ptag-G-bg); }
.fact-person { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.section-nav-wrap { width: 100%; min-width: 0; }
.section-nav { min-width: 0; }

/* Uniform browsing cards: four across on desktop, content scrolls within. */
.race-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; }
.race-card { height: 440px; display: flex; flex-direction: column; padding: 18px; }
.race-card-head { flex-shrink: 0; }
.race-card-head .section-race-name { font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.race-card-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.race-card-body .candidate-preview { display: block; }
.race-card-foot { flex-shrink: 0; margin-top: auto; padding-top: 13px; }
@media (max-width: 1100px) { .race-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .race-card-grid { grid-template-columns: minmax(0, 1fr); } }
.race-card-head h3.section-race-name { margin: 0; cursor: default; }
.race-card-head h3.section-race-name:hover { color: var(--text); }
.seat-toggle { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; font-family: inherit; }
.inline-seat-list { margin-top: 3px; }
.inline-seat-list[hidden] { display: none; }
.inline-seat { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.inline-seat h4 { color: var(--text-2); font-size: .8rem; margin: 0; }
.inline-seat .race-person { padding: 9px 0; }

.state-type-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 22px; }
.state-type-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text-2); font-size: .8rem; text-decoration: none; }
.state-type-tabs a span { font-size: .68rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.state-type-tabs a[aria-current='page'] { background: var(--text); border-color: var(--text); color: var(--surface); font-weight: 600; }
.state-type-tabs a[aria-current='page'] span { color: inherit; opacity: .8; }
@media (max-width: 760px) { .state-type-tabs { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; min-width: 0; padding-bottom: 5px; } .state-type-tabs a { flex: none; } }
/* Only the candidate map is a fixed viewport; other pages scroll normally. */
html.candidate-map-page, .candidate-map-page body { height: 100dvh; overflow: hidden; overscroll-behavior: none; }
.candidate-map-page .section-nav-wrap { padding-top: 4px; flex: none; }
.candidate-map-page .section-nav { margin-bottom: 0; padding: 6px 0; }
.candidate-map-page main.wrap { flex: 1 1 auto; min-height: 0; overflow: hidden; padding-top: 10px; padding-bottom: 10px; display: flex; flex-direction: column; }
.candidate-map-page .section-page-head { height: 0; margin: 0; flex: none; }
.candidate-map-page .section-page-head .page-eyebrow, .candidate-map-page .section-page-head p { display: none; }
.candidate-map-page .section-page-head h1 { position: absolute; width: 1px; height: 1px; clip: rect(0, 0, 0, 0); overflow: hidden; }
.candidate-map-page .map-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 12px; }
.candidate-map-page .map-card > .section-list-filters { flex: none; margin: 0 0 8px; padding: 0; }
.candidate-map-page .map-card .section-field { display: flex; flex-direction: row; align-items: center; gap: 12px; margin: 0; min-width: 0; max-width: 460px; }
.candidate-map-page .section-field .dd { width: min(250px, 65vw); }
.candidate-map-page .section-field .dd-trigger { min-height: 34px; }
.candidate-map-page #section-map { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.candidate-map-page .map-tools { flex: none; }
.candidate-map-page .map-holder { flex: 1 1 auto; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.candidate-map-page .map-svg { width: 100%; height: 100%; touch-action: none; user-select: none; cursor: grab; }
.candidate-map-page .map-svg[data-map-dragging] { cursor: grabbing; }
.candidate-map-page .map-svg [data-race] { cursor: inherit; }
.candidate-map-page #section-map > .note { display: none; }
.candidate-map-page .legend { flex: none; margin-top: 8px; font-size: .68rem; max-height: 50px; overflow-y: auto; }
.candidate-map-page .insets { flex: none; gap: 5px; }
.candidate-map-page .inset { font-size: .65rem; }
.map-camera-controls { display: flex; align-items: center; gap: 5px; }
.map-camera-controls button { min-width: 32px; height: 32px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--text); font: 600 .86rem var(--font); cursor: pointer; }
.map-camera-controls button:disabled { opacity: .45; cursor: default; }
.map-camera-controls output { min-width: 40px; text-align: center; color: var(--text-2); font-size: .7rem; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .candidate-map-page main.wrap { padding: 8px; } .candidate-map-page .map-card { padding: 8px; } .candidate-map-page .map-tools { gap: 5px; } .candidate-map-page .map-card .section-field { font-size: .7rem; } }
.candidate-map-page .map-inspector .map-tip { max-height: min(420px, 44vh, calc(100% - 16px)); }
.candidate-map-page .map-inspector button.inset { font-size: .65rem; line-height: 1.15; padding: 3px 6px; }
@media (max-height: 550px) {
  .candidate-map-page .section-nav-wrap { padding-top: 0; }
  .candidate-map-page .section-nav { padding: 3px 0; }
  .candidate-map-page .section-nav a { padding: 4px 9px; }
  .candidate-map-page main.wrap { padding-top: 6px; padding-bottom: 6px; }
  .candidate-map-page .map-card { padding: 8px; }
  .candidate-map-page .legend { max-height: 24px; margin-top: 4px; }
}
.call-race-head .call-race-name { margin: 0; color: var(--text); font-size: .95rem; font-weight: 650; line-height: 1.3; }

/* Map selections open a focused race picker; the page stays on the map. */
.map-mode-tabs { flex-wrap: wrap; }
.night-map-search { display: block; margin: 10px 0 8px; }
.night-map-search input { width: 100%; min-width: 0; height: 38px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--text); padding: 0 10px; font: inherit; font-size: .83rem; }
.night-map-results { display: grid; gap: 4px; margin-bottom: 10px; }
.night-map-results[hidden] { display: none; }
.night-map-results button { text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.night-map-results button:hover { border-color: var(--accent); }
.call-picker { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); box-sizing: border-box; padding: 20px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 20px 70px rgb(0 0 0 / .4); overflow-y: auto; }
.call-picker::backdrop { background: rgb(0 0 0 / .6); }
.call-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.call-picker-head h2 { margin: 0; }
.call-picker-head .icon-btn { font-size: 1.5rem; flex: none; }
.call-picker .call-race-card { min-height: 0; margin-top: 12px; }
.call-picker-candidate { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--party-color); border-radius: 7px; }
.call-picker-candidate span { color: var(--text-2); font-size: .75rem; }
@media (max-width: 640px) { .call-picker { padding: 14px; } }

/* Separate election-night screens share the same live data. */
.widget-links { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 12px; }
.night-window-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; flex: none; }
.night-window-toolbar h1 { font-size: 1.35rem; }
.night-window-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .8rem; }
.night-window-actions .btn { font-size: .8rem; }
.live-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); font-size: .72rem; white-space: nowrap; }
.live-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #b98920; }
.live-status[data-state='live']::before { background: #39a866; }
html.night-map-page, .night-map-page body, html.election-window-page, .election-window-page body { height: 100dvh; overflow: hidden; }
.night-map-page main.wrap { max-width: none; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-top: 12px; padding-bottom: 12px; overflow: hidden; }
.night-map-page .section-nav { padding: 6px 0; margin-bottom: 0; }
.night-map-page .map-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 12px; }
.night-map-page .map-card > h2 { display: none; }
.night-map-page .map-card .section-field { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 12px; max-width: none; margin: 0; }
.night-map-page .map-card .section-field .dd { width: 230px; }
.night-map-page .night-map-search { flex: none; margin: 8px 0 0; }
.night-map-page .map-card > .note { margin-top: 6px; }
.night-map-page #en-map { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.night-map-page .map-tools { flex: none; margin: 8px 0; }
.night-map-page .map-holder { flex: 1 1 auto; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.night-map-page .map-svg { width: 100%; height: 100%; touch-action: none; user-select: none; cursor: grab; }
.night-map-page .map-svg[data-map-dragging] { cursor: grabbing; }
.night-map-page .map-svg [data-race] { cursor: inherit; }
.night-map-page #en-map > .note { display: none; }
.night-map-page .legend, .night-map-page .insets { flex: none; font-size: .7rem; }
.election-window-page .site-head, .election-window-page .section-nav-wrap { display: none; }
.election-window-page main.wrap { max-width: none; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 16px; overflow: hidden; }
.election-window-page #feed.card { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
@media (max-width: 640px) {
  .election-window-page main.wrap { padding: 10px; }
  .night-window-toolbar h1 { font-size: 1.1rem; }
  .night-map-page .map-card { padding: 8px; }
  .night-map-page .map-mode-tabs button { padding: 5px 8px; font-size: .78rem; }
  .night-map-page .map-camera-controls { gap: 3px; }
}

/* Territory calls use race selectors instead of a mainland map. */
.territory-selector { min-height: 0; margin-top: 4px; }
.territory-call-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 12px; }
.territory-call-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.territory-call-card header { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.territory-call-card h3 { color: var(--text); font-size: 1rem; }
.territory-place-code { flex: none; border: 1px solid var(--line-strong); border-radius: 5px; padding: 3px 6px; font-size: .7rem; color: var(--text-2); }
.territory-place-count { color: var(--text-3); font-size: .75rem; margin-bottom: 14px; }
.territory-call-races { display: grid; gap: 8px; }
.territory-call-race { width: 100%; min-width: 0; padding: 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.territory-call-race.is-called, .territory-call-race.is-leading { border-left: 3px solid var(--party-color); }
.territory-call-race:hover { border-color: var(--accent); }
.territory-race-top { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 6px 8px; font-size: .83rem; }
.territory-race-status { flex: none; color: var(--text-2); font-size: .65rem; border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }
.territory-call-race small { display: block; margin-top: 7px; color: var(--text-3); font-size: .72rem; line-height: 1.5; overflow-wrap: anywhere; }
.territory-place-empty { color: var(--text-3); font-size: .85rem; padding: 14px 0; }
.night-map-page .territory-selector { flex: 1 1 auto; overflow-y: auto; padding-right: 3px; scrollbar-gutter: stable; }
@media (max-width: 1100px) { .territory-call-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .territory-call-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; } }

/* Account administration and predictions built around race selection. */
.account-admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-bottom: 16px; }
.account-form { display: grid; gap: 12px; }
.account-form .section-field { margin: 0; max-width: none; }
.account-form .btn { width: fit-content; }
.account-users { margin-top: 16px; }
.account-user-card { display: grid; grid-template-columns: minmax(140px,1fr) minmax(0,2fr) minmax(0,1fr); gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); }
.account-user-card .tag { margin-left: 8px; }
.account-update { grid-template-columns: minmax(0,1fr) minmax(120px,1fr); align-content: start; }
.account-password { max-width: 520px; }
.permission-explanation b { display: block; margin: 16px 0 4px; }
.permission-explanation p { color: var(--text-2); font-size: .88rem; }
.prediction-summary { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: .83rem; color: var(--text-2); }
.prediction-summary b { color: var(--text); }
.prediction-workspace { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); align-items: start; gap: 16px; }
.prediction-search-field { max-width: none; }
.prediction-search-results { display: grid; gap: 4px; max-height: 300px; overflow: auto; }
.prediction-search-results[hidden] { display: none; }
.prediction-search-results button,.prediction-saved-row { padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.prediction-search-results button:hover,.prediction-saved-row:hover { border-color: var(--accent); }
.prediction-list-search { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; font-size: .83rem; margin-bottom: 12px; }
[data-saved-list] { display: grid; gap: 8px; max-height: 620px; overflow-y: auto; }
.prediction-saved-row { display: grid; gap: 5px; font-size: .84rem; }
.prediction-saved-row span { color: var(--text-2); font-size: .77rem; }
.prediction-choice-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.prediction-current { margin: 10px 0; color: var(--text-2); }
.prediction-picker .call-picks { margin-top: 12px; }
.prediction-picker-actions { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
.prediction-workspace .territory-call-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
@media (max-width: 960px) { .prediction-workspace,.account-admin-grid { grid-template-columns: minmax(0,1fr); } .account-user-card { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 640px) { .prediction-workspace .territory-call-grid { grid-template-columns: minmax(0,1fr); } .account-update { grid-template-columns: minmax(0,1fr); } }

/* A single account control keeps the header clear. */
.auth-slot { position: relative; margin-left: auto; }
.account-trigger { display: inline-flex; align-items: center; gap: 9px; height: 38px; max-width: 220px; padding: 4px 10px 4px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--text); font: 600 .85rem var(--font); cursor: pointer; }
.account-trigger:hover, .account-trigger[aria-expanded='true'] { border-color: var(--line-strong); background: var(--surface); }
.account-avatar { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb,var(--accent) 18%,var(--surface)); color: var(--accent); font-size: .78rem; }
.account-trigger-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chevron { flex: none; width: 12px; height: 12px; color: var(--text-3); }
.account-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 260px; max-width: calc(100vw - 32px); padding: 8px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgb(0 0 0 / .24); z-index: 40; white-space: normal; }
.account-panel[hidden] { display: none; }
.account-panel-identity { display: grid; gap: 3px; padding: 10px 12px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; overflow-wrap: anywhere; }
.account-panel-identity b { color: var(--text); font-size: .94rem; }
.account-username { color: var(--text-3); font-size: .77rem; }
.account-role { width: fit-content; margin-top: 5px; padding: 2px 7px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); font-size: .67rem; font-weight: 600; }
.account-panel nav { display: grid; }
.account-panel nav a, .account-signout { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 7px; color: var(--text-2); font: 500 .84rem var(--font); text-align: left; }
.account-panel nav a:hover, .account-signout:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.account-panel nav a span { color: var(--text-3); font-size: .68rem; }
.account-signout { margin-top: 6px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; background: transparent; cursor: pointer; }
.account-signin { padding: 7px 13px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text); font-size: .84rem; font-weight: 600; }
.account-signin:hover { background: var(--surface-2); text-decoration: none; }
@media (max-width: 640px) { .account-trigger { max-width: 150px; height: 36px; gap: 6px; } .account-avatar { width: 26px; height: 26px; } }
@media (max-width: 640px) { .account-panel { position: fixed; top: 64px; right: 12px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 76px); overflow-y: auto; } }

.nav[data-navigation-pending] { visibility: hidden; }
.section-nav-wrap[hidden] { display: none; }

.subtabs[hidden] { display: none; }

.map-mode-field { display: grid; gap: 5px; width: 220px; max-width: 100%; font-size: .75rem; font-weight: 600; color: var(--text-2); }
.map-mode-field .dd { width: 100%; }
.map-mode-field select { width: 100%; min-height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }

/* Reveal the Election Night dashboard together once its initial data is ready. */
main.wrap { position: relative; }
.page-loading { min-height: min(65vh,620px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 32px; color: var(--text-2); }
.page-loading h1 { font-size: 1.3rem; color: var(--text); }
.page-loading p { font-size: .9rem; }
.loading-ring { width: 38px; height: 38px; border: 3px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: loading-turn .9s linear infinite; }
@keyframes loading-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-ring { animation: none; } }
.night-content.is-preparing { position: absolute; inset: 0; visibility: hidden; pointer-events: none; }
.night-map-page .night-content { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.night-map-page .page-loading { flex: 1 1 auto; }
.election-page main.wrap, .election-page .section-nav-wrap { max-width: none; padding-left: 24px; padding-right: 24px; }
.night-dashboard-grid .map-card > h2 { flex-wrap: wrap; }
.night-dashboard-grid .night-feed-slot[hidden] { display: none; }
.night-dashboard-grid .night-feed.fit { position: relative; inset: auto; max-height: none; overflow: visible; }
.night-dashboard-grid .call-filters { margin-top: 8px; gap: 8px; }
.call-filter-drawer { border: 1px solid var(--line); border-radius: 7px; }
.call-filter-drawer > summary { cursor: pointer; padding: 9px 10px; color: var(--text-2); font-size: .78rem; font-weight: 600; }
.call-filter-fields { display: grid; gap: 8px; padding: 0 10px 10px; }
.night-dashboard-grid .call-selects { grid-template-columns: minmax(0,1fr); }
.night-dashboard-grid .call-entry { padding: 10px; gap: 6px; }
.night-dashboard-grid .call-entry-top time { font-size: .65rem; }
.night-dashboard-grid .call-race { font-size: .85rem; }
.night-dashboard-grid .call-winner { font-size: .8rem; }
.night-dashboard-grid .call-status-tabs button { font-size: .7rem; gap: 4px; padding: 5px; }
.night-dashboard-grid .widget-links { gap: 5px 10px; font-size: .72rem; }
@media (min-width: 961px) {
 .night-top.night-dashboard-grid { grid-template-columns: minmax(0,1fr) 340px; align-items: start; }
 .night-dashboard-grid .night-feed-slot { position: sticky; top: 72px; min-height: 0; }
 .night-dashboard-grid .night-feed.fit { max-height: calc(100dvh - 90px); overflow-y: auto; }
}
@media (max-width: 960px) { .election-page main.wrap, .election-page .section-nav-wrap { padding-left: 12px; padding-right: 12px; } }

/* Equal chamber cards share a row on larger screens. */
#en-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
#en-control > .control { margin-top: 0; }
@media (max-width: 960px) { #en-control { grid-template-columns: minmax(0, 1fr); } }

/* Dense call records keep the race, winner and actions in three compact rows. */
.call-timeline { gap: 6px; }
.call-day { padding-top: 5px; }
.call-entry, .night-dashboard-grid .call-entry { padding: 7px 9px; gap: 3px; border-radius: 6px; }
.call-entry-top { align-items: baseline; gap: 3px 8px; }
.call-entry .call-race, .night-dashboard-grid .call-entry .call-race { font-size: .82rem; line-height: 1.3; }
.call-entry-top time, .night-dashboard-grid .call-entry-top time { font-size: .63rem; white-space: nowrap; }
.call-entry .call-winner { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .77rem; }
.call-winner-name { min-width: 0; max-width: 100%; }
.call-entry .cchip { height: 19px; font-size: .74rem; }
.call-entry .cchip .nm { line-height: 19px; padding-left: 6px; padding-right: 4px; }
.call-entry .cchip .seg { height: 13px; font-size: .52rem; padding: 0 3px; }
.call-entry .call-status { padding: 1px 4px; font-size: .6rem; }
.call-entry .call-gain { font-size: .62rem; }
.call-entry-bottom { gap: 3px 8px; align-items: center; }
.call-entry .call-attribution { font-size: .66rem; line-height: 1.3; }
.call-entry .call-actions { gap: 9px; }
.call-entry .call-actions a, .call-entry .call-actions button { padding: 3px 0; min-height: 24px; font-size: .69rem; }
@media (max-width: 640px) { .call-entry-top time { flex-basis: auto; margin-left: auto; } }

/* Bright winner-party flips and darker holds replace redundant call labels. */
:root {
  --call-D-flip: var(--dem); --call-D-hold: color-mix(in srgb,var(--dem) 38%,#0b0e13); --call-D-called: var(--call-D-flip); --call-D-leading: var(--dem-2);
  --call-R-flip: var(--rep); --call-R-hold: color-mix(in srgb,var(--rep) 38%,#0b0e13); --call-R-called: var(--call-R-flip); --call-R-leading: var(--rep-2);
  --call-I-flip: var(--ind); --call-I-hold: color-mix(in srgb,var(--ind) 38%,#0b0e13); --call-I-called: var(--call-I-flip); --call-I-leading: var(--ind-2);
  --call-L-flip: #e2b640; --call-L-hold: color-mix(in srgb,#e2b640 38%,#0b0e13); --call-L-called: var(--call-L-flip); --call-L-leading: var(--oth);
  --call-G-flip: #58be75; --call-G-hold: color-mix(in srgb,#58be75 38%,#0b0e13); --call-G-called: var(--call-G-flip); --call-G-leading: var(--oth);
  --call-O-flip: var(--oth); --call-O-hold: color-mix(in srgb,var(--oth) 38%,#0b0e13); --call-O-called: var(--call-O-flip); --call-O-leading: var(--oth);
}
.call-result-banner { --result-flip: var(--call-O-flip); --result-hold: var(--call-O-hold); --result-text: #0b0e13; display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 4px; font-size: .62rem; font-weight: 750; line-height: 1.2; white-space: nowrap; }
.call-result-banner.p-D { --result-flip: var(--call-D-flip); --result-hold: var(--call-D-hold); --result-text: var(--on-party); }
.call-result-banner.p-R { --result-flip: var(--call-R-flip); --result-hold: var(--call-R-hold); --result-text: var(--on-party); }
.call-result-banner.p-I { --result-flip: var(--call-I-flip); --result-hold: var(--call-I-hold); --result-text: var(--on-party); }
.call-result-banner.p-L { --result-flip: var(--call-L-flip); --result-hold: var(--call-L-hold); }
.call-result-banner.p-G { --result-flip: var(--call-G-flip); --result-hold: var(--call-G-hold); }
.call-result-banner.p-O { --result-flip: var(--call-O-flip); --result-hold: var(--call-O-hold); }
.call-result-banner.flip { background: var(--result-flip); color: var(--result-text); }
.call-result-banner.hold { background: var(--result-hold); color: #ffffff; }

/* Call actions open above the log instead of using an extra row in every card. */
.has-call-menu .call-entry-top { flex-wrap: nowrap; align-items: center; gap: 6px; }
.has-call-menu .call-race { flex: 1; min-width: 0; }
.call-menu-trigger { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 24px; width: 24px; height: 24px; padding: 3px; border: 0; border-radius: 5px; background: transparent; color: var(--text-3); cursor: pointer; transition: color .15s, background .15s; }
.call-menu-trigger svg { width: 18px; height: 18px; fill: currentColor; }
.call-menu-trigger:hover, .call-menu-trigger[aria-expanded='true'] { color: var(--text); background: var(--surface-2); }
.call-action-menu { position: fixed; inset: auto; margin: 0; width: 184px; max-width: calc(100vw - 16px); padding: 6px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--text); box-shadow: 0 10px 32px #0005; overflow: visible; }
.call-action-menu:popover-open { display: grid; gap: 3px; transform-origin: top right; animation: call-menu-in .16s ease-out both; }
.call-action-menu[data-side='above']:popover-open { transform-origin: bottom right; }
.call-menu-action { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px; padding: 8px 10px; border: 0; border-radius: 5px; background: var(--surface-2); color: var(--text); font: 600 .76rem var(--font); line-height: 1.2; text-align: left; text-decoration: none; cursor: pointer; transition: background .12s; }
.call-menu-action svg { flex: 0 0 15px; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.call-menu-action:hover { background: color-mix(in srgb, var(--text) 10%, var(--surface-2)); color: var(--text); text-decoration: none; }
.call-menu-withdraw { color: color-mix(in srgb, var(--rep) 65%, var(--text)); background: color-mix(in srgb, var(--rep) 10%, var(--surface)); }
.call-menu-withdraw:hover { color: color-mix(in srgb, var(--rep) 65%, var(--text)); background: color-mix(in srgb, var(--rep) 18%, var(--surface)); }
.call-menu-withdraw:disabled { opacity: .5; cursor: wait; }
@keyframes call-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .call-action-menu:popover-open { animation: none; } .call-menu-trigger, .call-menu-action { transition: none; } }

/* A dedicated live display pairs the Senate and House on another screen. */
.chamber-window-links { display: flex; flex-wrap: wrap; justify-content: flex-end; margin: 0 0 10px; font-size: .78rem; }
.chamber-page { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.chamber-page #en-control { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.chamber-page .control { display: flex; flex-direction: column; }
.chamber-page .hemi { flex: 1 1 auto; min-height: 180px; max-height: clamp(220px, 40dvh, 420px); }
.chamber-page .control .note { margin-top: auto; padding-top: 10px; }
.election-window-page .chamber-page #en-control { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
@media (max-width: 700px) {
  .chamber-page #en-control { grid-template-columns: minmax(0, 1fr); }
  .chamber-page .hemi { flex: none; min-height: 0; max-height: 220px; }
  .election-window-page .chamber-page #en-control { align-content: start; }
}

/* The third party shade is reserved for Senate seats not up this cycle. */
:root { --call-D-notup: color-mix(in srgb,var(--call-D-hold) 55%,var(--uncalled)); --call-R-notup: color-mix(in srgb,var(--call-R-hold) 55%,var(--uncalled)); --call-I-notup: color-mix(in srgb,var(--call-I-hold) 55%,var(--uncalled)); }

/* Readable seat totals pair the secured count with its starting reference. */
.seat-tally { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; gap: 10px; margin-top: 12px; }
.seat-tally .side { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-top: 2px solid var(--pc); border-radius: 8px; background: var(--surface-2); }
.seat-party-label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: .73rem; font-weight: 650; }
.seat-party-dot { display: inline-block; flex: 0 0 7px; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--pc,var(--oth)); }
.seat-party-label .seat-party-dot { margin-right: 0; }
.seat-tally-number { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; }
.seat-tally .big { color: var(--pc); font-size: clamp(1.8rem,2.5vw,2.5rem); letter-spacing: -.04em; }
.seat-tally .lbl { font-weight: 500; font-size: .7rem; }
.seat-independent { font-size: .65rem; color: var(--text-2); }
.seat-tally-baseline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px; color: var(--text-3); font-size: .65rem; }
.seat-tally-baseline b { font-weight: 650; }
.seat-net { display: inline-flex; align-items: baseline; gap: 3px; padding: 3px 6px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.seat-tally-baseline .seat-net { background: var(--surface); }
.seat-tracker-widget { margin-top: 14px; margin-bottom: 12px; }
.seat-tracker-widget h2 { flex-wrap: wrap; margin-bottom: 8px; }
.seat-tracker-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.seat-tracker-card { min-width: 0; }
.seat-tracker-card h2 { flex-wrap: wrap; }
.seat-tracker-progress { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; color: var(--text-3); font-size: .74rem; }
.seat-tracker-progress b { color: var(--text-2); }
.seat-tracker-progress-bar { height: 5px; margin: 10px 0 16px; border-radius: 4px; background: var(--line); overflow: hidden; }
.seat-tracker-progress-bar span { display: block; height: 100%; background: var(--accent); }
.seat-tracker-page { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.election-window-page .seat-tracker-display { min-height: 0; overflow-y: auto; flex: 1 1 auto; }
.seat-tracker-page .seat-tracker-grid { min-height: 100%; align-content: start; }
.seat-number-updated { animation: seat-number-update 1.2s ease-out; }
@keyframes seat-number-update { from { background: color-mix(in srgb,var(--accent) 28%,transparent); box-shadow: 0 0 0 4px color-mix(in srgb,var(--accent) 28%,transparent); } to { background: transparent; box-shadow: 0 0 0 4px transparent; } }
@media (max-width:700px) {
 .seat-tracker-grid { grid-template-columns: minmax(0,1fr); }
 .seat-tracker-widget .seat-tracker-card { padding: 12px; }
 .seat-tally .side { padding: 8px; }
}
@media (prefers-reduced-motion:reduce) { .seat-number-updated { animation: none; } }

/* Compact party scores keep the live tracker readable beside maps and logs. */
.seat-tracker-widget { flex: none; padding: 12px; margin: 0 0 12px; }
#en-control + .seat-tracker-widget { margin-top: 12px; }
.seat-tracker-widget > h2 { font-size: .95rem; margin-bottom: 10px; align-items: center; }
.seat-tracker-widget > h2 .widget-links { font-size: .7rem; gap: 6px; }
.widget-links .widget-window-link, .night-window-actions .widget-window-link { font-size: .7rem; font-weight: 500; padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--text-2); line-height: 1.2; text-decoration: none; }
.tracker-link-narrow { display: none; }
.widget-window-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.seat-tracker-grid.is-compact { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.is-compact .seat-tracker-card { padding: 0; border: 0; background: transparent; box-shadow: none; }
.is-compact .seat-tracker-card > h2 { margin-bottom: 8px; gap: 6px; font-size: .83rem; }
.is-compact .seat-tracker-card > h2 .aside { font-size: .66rem; color: var(--text-3); white-space: nowrap; }
.seat-party-scores { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.seat-party-score { min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.seat-score-heading { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.seat-score-party { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: .67rem; font-weight: 650; text-transform: uppercase; }
.seat-score-party .seat-party-dot { margin: 0; width: 6px; height: 6px; }
.seat-score-net { display: inline-flex; padding: 2px 5px; border-radius: 4px; color: var(--text-2); font-size: .65rem; line-height: 1.2; }
.seat-score-net.is-positive { color: var(--pc); background: color-mix(in srgb,var(--pc) 10%,var(--surface)); }
.seat-score-net.is-negative { color: var(--text); background: var(--surface); }
.seat-score-net.is-even { color: var(--text-3); }
.seat-score-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.seat-score-total strong { color: var(--pc); font-size: 1.9rem; font-weight: 720; letter-spacing: -.045em; line-height: 1; }
.seat-score-unit { font-size: .65rem; color: var(--text-3); }
.seat-score-start { margin-top: 5px; font-size: .67rem; color: var(--text-3); }
.seat-score-start b { color: var(--text-2); font-weight: 600; }
@media (max-width:900px) {
 .seat-tracker-grid.is-compact { gap: 12px; }
 .seat-party-score { padding: 8px; }
 .seat-score-total strong { font-size: 1.65rem; }
 .seat-score-unit { font-size: .6rem; }
}
@media (max-width:600px) {
 .seat-tracker-widget { padding: 10px; }
 .seat-tracker-widget > h2 { font-size: .85rem; }
 .seat-tracker-widget > h2 .widget-links { font-size: .62rem; }
 .widget-links .widget-window-link { font-size: .62rem; padding: 3px 5px; }
 .tracker-link-wide { display: none; }
 .tracker-link-narrow { display: inline; }
 .seat-tracker-grid.is-compact { gap: 10px; }
 .is-compact .seat-tracker-card > h2 { font-size: .76rem; gap: 4px; }
 .is-compact .seat-tracker-card > h2 .aside { font-size: .56rem; }
 .seat-party-scores { grid-template-columns: minmax(0,1fr); gap: 5px; }
 .seat-party-score { display: grid; grid-template-columns: minmax(0,1fr) auto auto; column-gap: 5px; row-gap: 2px; padding: 3px 6px; }
 .seat-score-heading { display: contents; }
 .seat-score-party { grid-row: 1; grid-column: 1; font-size: .63rem; gap: 4px; }
 .seat-score-net { grid-row: 1; grid-column: 3; font-size: .6rem; padding: 1px 3px; align-self: center; }
 .seat-score-total { grid-row: 1; grid-column: 2; margin: 0; }
 .seat-score-total strong { font-size: 1.25rem; }
 .seat-score-unit { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
 .seat-score-start { grid-row: 2; grid-column: 1 / -1; margin: 0; font-size: .6rem; line-height: 1.1; }
}

/* Detached trackers use the same score tiles at a larger display size. */
.widget-links a:hover { text-decoration: none; }
.seat-tracker-page .seat-score-total strong { font-size: clamp(2rem,4vw,3.5rem); }
.seat-tracker-page .seat-party-score { padding: 12px; }
.seat-tracker-page .seat-score-party { font-size: .75rem; }
.seat-tracker-page .seat-score-net { font-size: .75rem; }
.seat-tracker-page .seat-score-start { font-size: .75rem; margin-top: 8px; }

/* Closed native disclosures must not add invisible overflow below the page. */
details:not([open]) > :not(summary) { display: none; }
.page-head p.election-updated { margin-top: 8px; max-width: 100%; color: var(--text-3); font-size: .75rem; line-height: 1.5; }
.election-updated[hidden] { display: none; }

/* Keep individual page navigation and titles close to the site header. */
.section-nav-wrap { padding-top: 4px; }
.section-nav { padding: 4px 0 6px; margin-bottom: 0; gap: 4px; }
.section-nav a { padding: 5px 9px; font-size: .8rem; }
main.wrap { padding-top: 12px; }
.page-head { margin-bottom: 10px; }
.section-page-head { margin-bottom: 16px; }
.section-page-head p { margin-top: 6px; }
.election-page-heading { align-items: flex-start; gap: 6px 16px; }
.election-heading-copy { flex: 1 1 420px; min-width: 0; }
.election-page-heading h1 { font-size: 1.45rem; }
.election-page-heading p { font-size: .85rem; line-height: 1.4; }
.election-page-heading p.election-updated { margin-top: 4px; font-size: .72rem; line-height: 1.4; }
@media (max-width:760px) {
 .election-heading-copy { flex-basis: 100%; }
 .section-nav { padding-bottom: 6px; }
}

/* Independent predictions use four distinct confidence shades. */
:root { --ind-3: color-mix(in srgb,var(--ind) 38%,var(--bg)); --ind-4: color-mix(in srgb,var(--ind) 16%,var(--bg)); }


/* Prediction tools share one row; matching panels keep the workspace balanced. */
.prediction-workspace { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; }
.prediction-workspace > .card { position: relative; display: flex; flex-direction: column; min-height: 0; }
.prediction-controls { position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.25fr); align-items: end; gap: 12px; margin-bottom: 12px; }
.prediction-controls .section-field { margin: 0; max-width: none; }
.prediction-controls .section-field input { height: 34px; }
.prediction-controls .prediction-search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 12; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 24px #0003; }
#prediction-map { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#prediction-map .map-tools, #prediction-map .insets, #prediction-map > .note { flex: none; }
#prediction-map .map-holder { flex: 1 1 auto; min-height: 300px; }
#prediction-map .map-svg { width: 100%; height: 100%; }
.prediction-saved [data-saved-list] { position: relative; flex: 1 1 auto; min-height: 0; max-height: none; align-content: start; }
.prediction-key { position: absolute; right: 8px; bottom: 10px; width: 132px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 3px 12px #0002; z-index: 4; }
.prediction-key h3 { margin: 0 0 6px; font-size: .75rem; }
.prediction-key table { width: 100%; border-collapse: collapse; }
.prediction-key th, .prediction-key td { padding: 3px 2px; border: 0; text-align: center; background: transparent; position: static; }
.prediction-key thead th { font-size: .5rem; color: var(--text-3); font-weight: 650; }
.prediction-key tbody th { font-size: .61rem; color: var(--text-2); text-align: left; font-weight: 500; text-transform: none; letter-spacing: normal; }
.prediction-key abbr { text-decoration: none; }
.prediction-key-swatch { display: block; width: 13px; height: 13px; border-radius: 3px; margin: auto; }
.prediction-key-other { display: grid; gap: 5px; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); font-size: .58rem; color: var(--text-2); }
.prediction-key-other span { display: flex; align-items: center; gap: 6px; }
.prediction-key-other i { width: 10px; height: 10px; border-radius: 3px; }
@media (min-width:961px) { .prediction-workspace { height: clamp(560px,calc(100dvh - 220px),740px); } }
@media (max-width:960px) { .prediction-workspace { grid-template-columns: minmax(0,1fr); } .prediction-workspace > .card { height: 640px; } }
@media (max-width:520px) { .prediction-controls { grid-template-columns: minmax(0,1fr); gap: 8px; } .prediction-key { width: 116px; right: 4px; bottom: 6px; padding: 6px; } }
#prediction-map .territory-selector { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
@media (max-width:520px) { #prediction-map .map-holder { min-height: 230px; } }

.prediction-page main.wrap, .prediction-page .section-nav-wrap { max-width: none; padding-left: 24px; padding-right: 24px; }
@media (max-width:960px) { .prediction-page main.wrap, .prediction-page .section-nav-wrap { padding-left: 12px; padding-right: 12px; } }

.prediction-map-frame { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.prediction-key[hidden] { display: none; }

/* A compact state-filtered saved list gives the prediction map more room. */
.prediction-workspace { grid-template-columns: minmax(0,1fr) 240px; }
.prediction-saved { padding: 12px; }
.prediction-saved > h2 { font-size: .95rem; gap: 6px; margin-bottom: 10px; }
.prediction-saved > h2 .aside { font-size: .7rem; white-space: nowrap; }
.prediction-saved-state { margin: 0 0 12px; gap: 5px; font-size: .72rem; }
.prediction-saved-state .dd-trigger { font-size: .8rem; }
.prediction-saved [data-saved-list] { gap: 7px; }
.prediction-saved-row { display: grid; gap: 6px; padding: 9px 10px; border-left: 3px solid var(--saved-pred-color,var(--pc)); border-radius: 6px; background: var(--surface-2); }
.prediction-saved-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; min-width: 0; }
.prediction-saved-head b { min-width: 0; color: var(--text); font-size: .78rem; line-height: 1.35; overflow-wrap: anywhere; }
.prediction-saved-row .prediction-saved-rating { flex: none; padding: 2px 4px; border-radius: 4px; background: var(--surface); color: var(--text-2); font-size: .6rem; font-weight: 650; line-height: 1.3; white-space: nowrap; }
.prediction-saved-row .prediction-saved-detail { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px; font-size: .73rem; line-height: 1.35; }
.prediction-saved-detail small { color: var(--text-3); font-size: .65rem; white-space: nowrap; }
@media (max-width:960px) { .prediction-workspace { grid-template-columns: minmax(0,1fr); } }

/* Detached call log: two full-height federal feeds and a stacked side column. */
.call-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, .8fr); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 12px; flex: 1 1 auto; min-height: 0; }
.call-panel-house { grid-column: 1; grid-row: 1 / 3; }
.call-panel-senate { grid-column: 2; grid-row: 1 / 3; }
.call-panel-legislature { grid-column: 3; grid-row: 1; }
.call-panel-statewide { grid-column: 3; grid-row: 2; }
.call-board .call-panel { min-width: 0; min-height: 0; padding: 12px; display: flex; flex-direction: column; overflow: hidden; }
.call-panel > h2 { flex: none; align-items: center; margin-bottom: 8px; font-size: 1rem; }
.call-panel-total { font-size: .7rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.call-panel-feed { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.call-panel-feed .call-filters { flex: none; margin: 0 0 8px; gap: 7px; }
.call-panel-feed .call-selects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.call-panel-feed .call-log-count { flex: none; margin-bottom: 5px; font-size: .7rem; }
.call-panel-feed .call-log-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; padding-right: 4px; }
.call-panel-feed .call-timeline { gap: 6px; }
.call-panel-feed .call-day { padding-top: 3px; font-size: .68rem; }
.call-panel-feed .call-status-tabs button { font-size: .68rem; padding: 4px 3px; min-height: 30px; gap: 4px; }
.call-panel-feed .call-status-tabs button span { font-size: .65rem; }
.call-panel-feed .call-empty { padding: 16px 10px; gap: 5px; }
.call-panel-feed .call-empty > span { display: none; }
.call-panel-feed .call-empty b { font-size: .8rem; }
.call-panel-feed .call-empty p { font-size: .72rem; }
.call-panel-feed .call-entry-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 2px 6px; }
.call-panel-feed .call-entry-top time { grid-column: 1; grid-row: 2; margin-left: 0; }
.call-panel-feed .call-menu-trigger { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.call-panel-feed .call-action-menu { display: block; }
.call-panel-feed .call-action-menu:not(:popover-open) { display: none; }
.call-board-loading { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
@media (min-width: 1001px) and (max-height: 760px) {
 .call-log-window-page .seat-tracker-widget { padding: 8px; margin-bottom: 8px; }
 .call-log-window-page .seat-tracker-widget > h2 { margin-bottom: 6px; }
 .call-log-window-page .seat-party-score { padding: 7px 9px; }
 .call-log-window-page .seat-score-total strong { font-size: 1.45rem; }
}
@media (max-width: 1000px), (max-height: 620px) {
 html.call-log-window-page, .call-log-window-page body { height: auto; min-height: 100dvh; overflow: auto; }
 .call-log-window-page main.wrap { overflow: visible; flex: none; }
 .call-board { flex: none; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 520px 360px; }
 .call-panel-house { grid-column: 1; grid-row: 1; }
 .call-panel-senate { grid-column: 2; grid-row: 1; }
 .call-panel-legislature { grid-column: 1; grid-row: 2; }
 .call-panel-statewide { grid-column: 2; grid-row: 2; }
}
@media (max-width: 640px) {
 .call-board { grid-template-columns: minmax(0, 1fr); grid-template-rows: 480px 480px 340px 340px; gap: 10px; }
 .call-board .call-panel { grid-column: 1; grid-row: auto; padding: 10px; }
 .call-log-window-page .night-window-toolbar { gap: 6px; }
 .call-log-window-page .night-window-actions { gap: 6px; }
}
.call-log-window-page .seat-party-score:is(.p-L, .p-G, .p-O) .seat-score-net.is-positive { color: var(--text); }
@media (min-width: 1200px) {
 .call-panel-house .call-entry-top, .call-panel-senate .call-entry-top { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
 .call-panel-house .call-entry-top time, .call-panel-senate .call-entry-top time { grid-column: 2; grid-row: 1; font-size: .59rem; }
 .call-panel-house .call-menu-trigger, .call-panel-senate .call-menu-trigger { grid-column: 3; grid-row: 1; }
}

/* Candidates overview: a compact directory with direct race and place browsing. */
.candidate-overview-page main.wrap, .candidate-overview-page .section-nav-wrap { max-width: none; padding-left: 24px; padding-right: 24px; }
.candidate-hub { display: grid; gap: 18px; }
.candidate-hub-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.candidate-hub-eyebrow { display: block; color: var(--accent); font-size: .7rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 4px; }
.candidate-hub-heading h1 { font-size: clamp(1.65rem, 2.2vw, 2rem); letter-spacing: -.035em; }
.candidate-hub-heading p { margin-top: 5px; color: var(--text-2); font-size: .87rem; }
.candidate-hub-totals { display: grid; grid-template-columns: minmax(120px, .9fr) minmax(170px, 1.1fr); gap: 8px; width: 350px; flex: none; margin: 0; }
.candidate-total-card { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 10px 12px; min-width: 0; }
.candidate-total-card dt { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: .72rem; font-weight: 600; }
.candidate-total-card dt svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.candidate-total-card dd { margin: 6px 0 0; }
.candidate-total-card b { display: block; color: var(--text); font-size: 1.45rem; font-weight: 720; line-height: 1.15; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.candidate-total-card dd span { display: block; margin-top: 4px; color: var(--text-3); font-size: .64rem; line-height: 1.3; }
.candidate-hub-tools { display: flex; align-items: end; gap: 12px; }
.candidate-hub-search { flex: 1; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.candidate-hub-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent); }
.candidate-hub-search > svg { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--text-3); stroke-width: 1.7; }
.candidate-hub-search input { flex: 1; width: 100%; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--text); font: .88rem var(--font); outline: none; padding: 0; }
.candidate-hub-search input::-webkit-search-cancel-button { display: none; }
.candidate-hub-search > button { flex: none; border: 0; background: var(--surface-2); color: var(--text-2); border-radius: 5px; width: 26px; height: 26px; font-size: 1.1rem; cursor: pointer; }
.candidate-hub-tools > .section-field { width: 240px; margin: 0; flex: none; font-size: .7rem; }
.candidate-hub-tools .dd-trigger { height: 44px; border-radius: 8px; }
.candidate-browse-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.candidate-browse-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 16px; color: var(--text); transition: background .15s, border-color .15s; min-width: 0; }
.candidate-browse-card:hover { background: var(--surface-2); border-color: var(--line-strong); text-decoration: none; }
.candidate-category-icon { width: 40px; height: 40px; border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-radius: 9px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); flex: none; }
.candidate-category-icon svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.candidate-browse-card > div { flex: 1; min-width: 0; }
.candidate-browse-card h2 { font-size: .95rem; }
.candidate-browse-card p { color: var(--text-3); font-size: .72rem; margin-top: 3px; }
.candidate-category-count { display: block; color: var(--text-2); font-size: .73rem; margin-top: 8px; }
.candidate-category-count b { color: var(--text); font-weight: 700; font-size: .94rem; font-variant-numeric: tabular-nums; }
.candidate-link-arrow { width: 17px; height: 17px; flex: none; stroke: var(--text-3); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.candidate-browse-card:hover .candidate-link-arrow { stroke: var(--accent); }
.candidate-hub-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(350px, 1fr); gap: 14px; }
.candidate-hub-grid > .card { padding: 16px; min-width: 0; height: clamp(420px, calc(100dvh - 390px), 560px); display: flex; flex-direction: column; }
.candidate-panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; flex: none; margin-bottom: 12px; }
.candidate-panel-heading h2 { font-size: 1rem; }
.candidate-panel-heading p { color: var(--text-3); font-size: .75rem; margin-top: 5px; }
.candidate-panel-heading .widget-window-link { display: inline-flex; flex: none; font-size: .72rem; color: var(--text-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; text-decoration: none; }
.candidate-panel-heading .widget-window-link:hover { color: var(--text); background: var(--surface-2); }
.candidate-overview-map { min-height: 0; flex: 1; display: grid; place-items: center; border-radius: 8px; background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); overflow: hidden; padding: 8px; }
.candidate-overview-map svg { width: 100%; height: 100%; min-height: 0; }
.candidate-map-state { fill: color-mix(in srgb, var(--accent) 25%, var(--surface-2)); stroke: color-mix(in srgb, var(--accent) 25%, var(--surface-2)); stroke-width: .5; transition: fill .13s; }
.candidate-overview-map a:hover .candidate-map-state, .candidate-overview-map a:focus-visible .candidate-map-state { fill: var(--accent); stroke: var(--text); stroke-width: 2; }
.candidate-map-unlisted { fill: var(--map-empty); }
.candidate-map-mesh { fill: none; stroke: var(--bg); stroke-width: 1; pointer-events: none; }
.candidate-map-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: .68rem; color: var(--text-3); padding-top: 10px; flex: none; }
.candidate-map-caption [data-state-preview] { color: var(--text-2); }
.candidate-directory-count { color: var(--text-3); font-size: .7rem; white-space: nowrap; }
.candidate-place-tabs { display: flex; gap: 3px; padding: 3px; border-radius: 7px; background: var(--surface-2); margin-bottom: 12px; flex: none; }
.candidate-place-tabs button { border: 0; flex: 1; background: transparent; color: var(--text-2); border-radius: 5px; padding: 6px 3px; font: 500 .72rem var(--font); white-space: nowrap; cursor: pointer; }
.candidate-place-tabs button[aria-pressed='true'] { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.candidate-place-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 6px; overflow-y: auto; scrollbar-gutter: stable; min-height: 0; flex: 1; padding-right: 4px; }
.candidate-place-list > a { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); padding: 9px 8px; min-width: 0; transition: background .15s; }
.candidate-place-list > a:hover { text-decoration: none; background: var(--surface-2); }
.candidate-place-code { width: 26px; flex: none; color: var(--text-3); font-size: .7rem; font-weight: 650; }
.candidate-place-list > a > span:nth-child(2) { min-width: 0; flex: 1; }
.candidate-place-list b { font-size: .74rem; display: block; font-weight: 600; line-height: 1.3; }
.candidate-place-list small { color: var(--text-3); font-size: .65rem; display: block; margin-top: 3px; }
.candidate-place-list .candidate-link-arrow { width: 13px; }
.candidate-search-results { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding-right: 4px; }
.candidate-result-list { display: grid; gap: 7px; }
.candidate-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; }
.candidate-result:hover { background: var(--surface-2); text-decoration: none; }
.candidate-result-place { color: var(--text-3); font-size: .65rem; }
.candidate-result h3 { font-size: .86rem; margin: 2px 0 6px; }
.candidate-result-people { display: flex; flex-wrap: wrap; gap: 4px 6px; color: var(--text-2); font-size: .73rem; }
.candidate-result-people .cchip { font-size: .72rem; }
.candidate-reset-search { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text-2); font: .72rem var(--font); padding: 6px 9px; cursor: pointer; }
.candidate-results-more { width: 100%; margin-top: 10px; }
.candidate-hub-empty { grid-column: 1 / -1; padding: 24px 12px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--text-2); }
.candidate-hub-empty b { font-size: .86rem; }
.candidate-hub-empty p { color: var(--text-3); font-size: .76rem; margin-top: 6px; }
@media (max-width: 1100px) {
 .candidate-browse-card { padding: 12px; gap: 9px; }
 .candidate-category-icon { width: 32px; height: 32px; }
 .candidate-browse-card > .candidate-link-arrow { display: none; }
 .candidate-place-list { grid-template-columns: minmax(0, 1fr); }
 .candidate-hub-grid { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
}
@media (max-width: 760px) {
 .candidate-overview-page main.wrap, .candidate-overview-page .section-nav-wrap { padding-left: 12px; padding-right: 12px; }
 .candidate-hub { gap: 14px; }
 .candidate-hub-heading { align-items: start; flex-direction: column; gap: 10px; }
 .candidate-hub-totals { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .candidate-total-card { padding: 9px 10px; }
 .candidate-total-card b { font-size: 1.3rem; }
 .candidate-total-card dd span { font-size: .62rem; }
 .candidate-hub-tools { flex-wrap: wrap; gap: 8px; }
 .candidate-hub-search { flex-basis: 100%; }
 .candidate-hub-tools > .section-field { width: 100%; }
 .candidate-browse-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
 .candidate-browse-card { align-items: start; padding: 12px 10px; }
 .candidate-category-icon { width: 27px; height: 27px; border-radius: 6px; }
 .candidate-category-icon svg { width: 18px; height: 18px; }
 .candidate-browse-card h2 { font-size: .83rem; }
 .candidate-browse-card p { font-size: .65rem; }
 .candidate-hub-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
 .candidate-hub-grid > .card { padding: 12px; height: 390px; }
 .candidate-hub-grid > .candidate-explore { height: 340px; }
 .candidate-place-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .candidate-panel-heading h2 { font-size: .9rem; }
 .candidate-panel-heading p { max-width: 240px; font-size: .7rem; }
 .candidate-map-caption { font-size: .62rem; }
 .candidate-hub-search input { font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) { .candidate-browse-card, .candidate-map-state, .candidate-place-list > a { transition: none; } }

/* Legislature calls: select a place and chamber before calling control or districts. */
.leg-workspace { display: grid; gap: 14px; }
.leg-workspace .page-head { margin-bottom: 0; align-items: center; }
.leg-selectors { display: flex; align-items: end; gap: 12px; padding: 12px 14px; }
.leg-selectors > label { display: grid; gap: 5px; color: var(--text-2); font-size: .73rem; font-weight: 600; flex: 1; max-width: 360px; min-width: 0; }
.leg-selectors .dd, .leg-selectors .dd-trigger { width: 100%; min-width: 0; }
.leg-reset { margin-left: auto; font-size: .78rem; min-height: 38px; }
.leg-workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 14px; align-items: start; }
.leg-main, .leg-published { padding: 16px; min-width: 0; }
.leg-help { color: var(--text-2); font-size: .8rem; margin-top: 7px; line-height: 1.5; }
.leg-place-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; max-height: 610px; overflow-y: auto; padding-right: 4px; scrollbar-gutter: stable; }
.leg-place-grid button { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px; text-align: left; background: var(--surface); color: var(--text); cursor: pointer; min-width: 0; font: inherit; }
.leg-place-grid button:hover { background: var(--surface-2); border-color: var(--line-strong); }
.leg-place-grid button > span:nth-child(2) { flex: 1; min-width: 0; }
.leg-place-code { color: var(--text-3); font-size: .71rem; font-weight: 650; flex: none; width: 24px; }
.leg-place-grid b { display: block; font-size: .81rem; line-height: 1.3; }
.leg-place-grid small { display: block; margin-top: 4px; color: var(--text-3); font-size: .66rem; }
.leg-place-grid button > span:last-child { color: var(--text-3); font-size: .85rem; }
.leg-chamber-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.leg-place-name { display: block; color: var(--accent); font-size: .73rem; font-weight: 600; margin-bottom: 3px; }
.leg-chamber-heading h2 { font-size: 1.15rem; }
.leg-tally { display: grid; gap: 2px; text-align: right; }
.leg-tally b { font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.leg-tally span, .leg-coverage { color: var(--text-3); font-size: .7rem; }
.leg-coverage { margin-top: 8px; }
.leg-control-card { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); padding: 12px; margin: 14px 0; }
.leg-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.leg-section-heading h2 { font-size: 1rem; }
.leg-section-heading h3 { font-size: .88rem; }
.leg-section-heading > span { color: var(--text-3); font-size: .72rem; }
.leg-control-card .leg-help { margin: 0; font-size: .75rem; }
.leg-control-card .call-race-card { border: 0; background: transparent; padding: 0; margin-top: 9px; gap: 9px; }
.leg-control-card .call-race-head { display: none; }
.leg-control-card .call-current { font-size: .74rem; }
.leg-control-card .call-picks { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.leg-control-card .candidate-call { min-height: 42px; padding: 8px 10px; }
.leg-control-card .candidate-call-name { font-size: .8rem; }
.leg-control-card .candidate-call-party, .leg-control-card .call-race-foot > span { display: none; }
.leg-control-card .call-race-foot:not(:has([data-uncall])) { display: none; }
.leg-district-filters { display: grid; grid-template-columns: minmax(0, 1fr) 170px 140px; align-items: center; gap: 8px; margin-bottom: 12px; }
.leg-district-search { min-width: 0; }
.leg-district-search input { width: 100%; min-width: 0; height: 38px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--text); padding: 0 10px; font: .82rem var(--font); }
.leg-district-filters .dd, .leg-district-filters .dd-trigger { min-width: 0; width: 100%; }
.leg-district-scroll { overflow-y: auto; max-height: 650px; scrollbar-gutter: stable; padding-right: 4px; }
.leg-district-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; gap: 10px; }
.leg-district-grid .call-race-card { padding: 11px; gap: 9px; }
.leg-district-grid .call-race-name { font-size: .86rem; }
.leg-district-grid .call-current { font-size: .73rem; }
.leg-district-grid .candidate-call { min-height: 46px; padding: 7px 9px; }
.leg-district-grid .candidate-call-name { font-size: .79rem; }
.leg-district-grid .candidate-call-party { font-size: .65rem; }
.leg-empty { grid-column: 1 / -1; padding: 20px 12px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--text-2); text-align: center; }
.leg-empty b { font-size: .86rem; }
.leg-empty p { color: var(--text-3); margin-top: 5px; font-size: .76rem; }
.leg-more { width: 100%; margin-top: 12px; }
.leg-published { position: sticky; top: 68px; }
.leg-log-scope { color: var(--text-3); font-size: .73rem; margin-bottom: 8px; }
.leg-all-log { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: .72rem; margin: 6px 0 10px; }
.leg-published .call-log-body { max-height: 600px; overflow-y: auto; padding-right: 3px; scrollbar-gutter: stable; }
.leg-published .call-selects { grid-template-columns: repeat(2,minmax(0,1fr)); }
.leg-published .call-status-tabs button { font-size: .68rem; padding: 4px; gap: 4px; }
.leg-published .call-timeline { gap: 6px; }
.leg-published .call-entry-top { align-items: start; }
.leg-workspace.is-readonly .leg-workspace-grid { grid-template-columns: minmax(0,1fr); }
.leg-workspace.is-readonly .leg-published { position: static; }
.leg-workspace.is-readonly .leg-place-grid { grid-template-columns: repeat(4,minmax(0,1fr)); max-height: 350px; }
@media (max-width: 1200px) { .leg-district-grid, .leg-place-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .leg-district-filters { grid-template-columns: minmax(0,1fr) 150px; } .leg-district-search { grid-column: 1 / -1; } }
@media (max-width: 960px) { .leg-workspace-grid { grid-template-columns: minmax(0,1fr); } .leg-published { position: static; } .leg-workspace.is-readonly .leg-place-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 640px) {
 .leg-selectors { flex-wrap: wrap; gap: 8px; padding: 10px; }
 .leg-selectors > label { flex: 1 1 100%; max-width: none; }
 .leg-reset { margin-left: 0; width: 100%; }
 .leg-main, .leg-published { padding: 12px; }
 .leg-district-grid { grid-template-columns: minmax(0,1fr); }
 .leg-workspace.is-readonly .leg-place-grid, .leg-place-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .leg-place-grid button { padding: 8px; gap: 6px; }
 .leg-place-code { width: 20px; font-size: .65rem; }
 .leg-place-grid b { font-size: .75rem; }
 .leg-place-grid small { font-size: .61rem; }
 .leg-tally { text-align: left; }
 .leg-district-filters { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
 .leg-control-card .call-picks { grid-template-columns: minmax(0,1fr); }
 .leg-workspace .page-head { align-items: start; }
}
.leg-control-card .call-race-card:not(.is-called) .call-current { display: none; }

/* A screen-sized legislature workspace with equally sized main panels. */
@media (min-width: 961px) {
 html.night-legislature-page, .night-legislature-page body { height: 100dvh; overflow: hidden; }
 .night-legislature-page main.wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding-top: 10px; padding-bottom: 12px; }
 .night-legislature-page .night-content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
 .night-legislature-page .page-loading { flex: 1 1 auto; }
 .night-legislature-page .leg-workspace { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
 .night-legislature-page .leg-workspace > .page-head, .night-legislature-page .leg-selectors { flex: none; }
 .night-legislature-page .leg-selectors { padding: 8px 12px; gap: 10px; }
 .night-legislature-page .leg-selectors > label { gap: 3px; }
 .night-legislature-page .leg-reset { min-height: 34px; }
 .night-legislature-page .leg-workspace-grid, .night-legislature-page .leg-workspace.is-readonly .leg-workspace-grid { flex: 1 1 auto; min-height: 0; grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: minmax(0,1fr); gap: 12px; align-items: stretch; }
 .night-legislature-page .leg-main, .night-legislature-page .leg-published { position: static; padding: 12px; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
 .night-legislature-page [data-leg-summary], .night-legislature-page [data-leg-control], .night-legislature-page .leg-published > :not(#feed) { flex: none; }
 .night-legislature-page .leg-help { margin-top: 5px; font-size: .75rem; }
 .night-legislature-page .leg-state-overview:not([hidden]) { display: flex; flex: 1 1 auto; min-height: 0; }
 .night-legislature-page .leg-place-grid, .night-legislature-page .leg-workspace.is-readonly .leg-place-grid { flex: 1 1 auto; min-height: 0; max-height: 560px; grid-template-columns: repeat(4,minmax(0,1fr)); grid-auto-rows: minmax(0,1fr); gap: 5px; margin-top: 10px; overflow: visible; padding-right: 0; scrollbar-gutter: auto; }
 .night-legislature-page .leg-place-grid button { padding: 4px 6px; gap: 5px; border-radius: 6px; }
 .night-legislature-page .leg-place-code { width: 19px; font-size: .62rem; }
 .night-legislature-page .leg-place-grid b { font-size: .74rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
 .night-legislature-page .leg-place-grid small { font-size: .62rem; margin-top: 1px; line-height: 1.2; }
 .night-legislature-page .leg-place-grid button > span:last-child { display: none; }
 .night-legislature-page .leg-district-section:not([hidden]) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
 .night-legislature-page .leg-district-section > :not(.leg-district-scroll) { flex: none; }
 .night-legislature-page .leg-district-scroll { flex: 1 1 auto; min-height: 0; max-height: none; overscroll-behavior-y: contain; }
 .night-legislature-page .leg-control-card { margin: 10px 0; padding: 10px; }
 .night-legislature-page .leg-district-filters { grid-template-columns: minmax(0,1fr) 140px 120px; gap: 6px; margin-bottom: 8px; }
 .night-legislature-page .leg-district-search { grid-column: auto; }
 .night-legislature-page #feed { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
 .night-legislature-page #feed > :not(.call-log-body) { flex: none; }
 .night-legislature-page .leg-published .call-log-body { flex: 1 1 auto; min-height: 0; max-height: none; overscroll-behavior-y: contain; }
}
@media (min-width: 961px) and (max-width: 1200px) {
 .night-legislature-page .leg-place-code { display: none; }
 .night-legislature-page .leg-district-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .night-legislature-page .leg-district-search { grid-column: 1 / -1; }
}
@media (min-width: 961px) and (max-height: 740px) {
 .night-legislature-page .leg-place-grid small { display: none; }
 .night-legislature-page .leg-workspace > .page-head p { display: none; }
 .night-legislature-page .leg-workspace.is-overview [data-leg-summary] .leg-help { display: none; }
 .night-legislature-page .leg-control-card .leg-help { display: none; }
}
@media (min-width: 961px) and (max-height: 740px) {
 .night-legislature-page .leg-place-grid, .night-legislature-page .leg-workspace.is-readonly .leg-place-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
}

/* Keep the dashboard's map controls in one row without moving their event targets. */
.night-dashboard-grid .map-card { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; align-content: start; }
.night-dashboard-grid .map-card:has(#zoom-st) { grid-template-columns: repeat(4,minmax(0,1fr)); }
.night-dashboard-grid .map-card > h2 { grid-column: 1 / -1; margin: 0; }
.night-dashboard-grid .map-card .night-map-party { grid-column: 1; grid-row: 2; margin: 0; max-width: none; min-width: 0; gap: 0; }
.night-dashboard-grid .night-map-search { grid-column: 2; grid-row: 2; margin: 0; min-width: 0; }
.night-dashboard-grid #en-map, .night-dashboard-grid #en-map > .map-tools { display: contents; }
.night-dashboard-grid #en-map > :not(.map-tools):not(.map-tip), .night-dashboard-grid .night-map-results { grid-column: 1 / -1; min-width: 0; margin: 0; }
.night-dashboard-grid .map-mode-field { grid-column: 3; grid-row: 2; width: auto; max-width: none; min-width: 0; gap: 0; }
.night-dashboard-grid .map-mode-field > span:not(.dd) { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.night-dashboard-grid .map-tools > #zoom-st, .night-dashboard-grid .map-tools > .dd:has(#zoom-st) { grid-column: 4; grid-row: 2; min-width: 0; width: 100%; }
.night-dashboard-grid .map-card .night-map-party .dd, .night-dashboard-grid .map-card .map-mode-field .dd { width: 100%; min-width: 0; }
.night-dashboard-grid .map-card .night-map-party .dd-trigger, .night-dashboard-grid .map-card .map-mode-field .dd-trigger, .night-dashboard-grid .map-card .dd:has(#zoom-st) .dd-trigger, .night-dashboard-grid .map-card .night-map-search input { height: 38px; min-height: 38px; width: 100%; border-radius: 7px; font-size: .83rem; }
.night-dashboard-grid .map-card .dd:has(#zoom-st) .dd-trigger { padding: 0 10px; background: var(--surface); }
@media (max-width: 760px) {
 .night-dashboard-grid .map-card, .night-dashboard-grid .map-card:has(#zoom-st) { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
 .night-dashboard-grid .map-mode-field { grid-column: 1; grid-row: 3; }
 .night-dashboard-grid .map-tools > #zoom-st, .night-dashboard-grid .map-tools > .dd:has(#zoom-st) { grid-column: 2; grid-row: 3; }
}
@media (max-width: 480px) {
 .night-dashboard-grid .map-card, .night-dashboard-grid .map-card:has(#zoom-st) { grid-template-columns: minmax(0,1fr); }
 .night-dashboard-grid .night-map-search { grid-column: 1; grid-row: 3; }
 .night-dashboard-grid .map-mode-field { grid-column: 1; grid-row: 4; }
 .night-dashboard-grid .map-tools > #zoom-st, .night-dashboard-grid .map-tools > .dd:has(#zoom-st) { grid-column: 1; grid-row: 5; }
}

/* One live totals group; map and call log belong to their own subtab. */
.chamber-summary-group { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.chamber-group-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 0; }
.chamber-group-toolbar h2 { font-size: .9rem; color: var(--text-2); }
.chamber-group-toolbar .widget-window-link { font-size: .7rem; font-weight: 500; padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--text-2); line-height: 1.2; text-decoration: none; }
.chamber-group-toolbar .widget-window-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.chamber-summary-group .seat-tracker-widget { margin: 0; }
.election-window-page .chamber-summary-group { flex: 1 1 auto; }
.election-window-page .chamber-summary-group > #en-control { flex: 1 1 auto; min-height: 0; }
.dashboard-summary .election-page-heading { margin-bottom: 12px; }
.chamber-summary-group .hemi { flex: none; min-height: 0; max-height: 220px; }
.election-window-page .chamber-summary-group .hemi { max-height: clamp(160px, calc(100dvh - 600px), 340px); }

/* The map fills the screen beside a compact call log. */
html.night-map-calls-page, .night-map-calls-page body { height: 100dvh; overflow: hidden; }
.night-map-calls-page main.wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding-top: 10px; padding-bottom: 12px; }
.night-map-calls-page .night-content { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.night-map-calls-page .page-loading { flex: 1 1 auto; }
.night-map-calls-page .election-page-heading { flex: none; align-items: center; margin-bottom: 10px; }
.night-map-calls-page .election-page-heading .night-window-actions { flex: none; }
.night-map-calls-page .night-dashboard-grid { flex: 1 1 auto; min-height: 0; grid-template-columns: minmax(0,1fr) 340px; grid-template-rows: minmax(0,1fr); align-items: stretch; gap: 14px; margin: 0; }
.night-map-calls-page .night-dashboard-grid .night-feed-slot { position: static; display: flex; min-height: 0; min-width: 0; }
.night-map-calls-page .night-dashboard-grid .night-feed.fit { position: static; height: 100%; flex: 1 1 auto; min-height: 0; max-height: none; overflow: hidden; display: flex; flex-direction: column; }
.night-map-calls-page .night-feed > h2 { flex: none; margin-bottom: 8px; }
.night-map-calls-page #feed { min-height: 0; overflow-y: auto; flex: 1 1 auto; scrollbar-gutter: stable; padding-right: 4px; }
.night-map-calls-page .night-dashboard-grid .map-card { min-height: 0; position: relative; padding: 12px; overflow: hidden; grid-template-rows: auto auto minmax(0,1fr) auto auto auto; align-content: stretch; gap: 8px; }
.night-map-calls-page .night-dashboard-grid .map-card > h2 { grid-row: 1; }
.night-map-calls-page .night-dashboard-grid .map-holder, .night-map-calls-page .night-dashboard-grid .territory-selector { grid-column: 1 / -1; grid-row: 3; min-height: 0; overflow: hidden; }
.night-map-calls-page .map-holder .map-svg { width: 100%; height: 100%; min-height: 0; }
.night-map-calls-page .night-dashboard-grid .insets { grid-row: 4; font-size: .65rem; gap: 4px; }
.night-map-calls-page .night-dashboard-grid .legend { grid-row: 5; font-size: .65rem; gap: 4px 9px; }
.night-map-calls-page .night-dashboard-grid #en-map > .note { grid-row: 6; font-size: .65rem; line-height: 1.35; }
.night-map-calls-page .night-dashboard-grid .territory-selector { overflow-y: auto; }
/* Keep the six territory cards compact enough to fit the map panel. */
.night-map-calls-page .territory-call-grid { grid-auto-rows:auto; gap:8px; }
.night-map-calls-page .territory-call-card { padding:10px; }
.night-map-calls-page .territory-call-card header { gap:7px; margin-bottom:4px; }
.night-map-calls-page .territory-call-card h3 { font-size:.9rem; }
.night-map-calls-page .territory-place-count { margin-bottom:8px; font-size:.7rem; }
.night-map-calls-page .territory-call-races { gap:6px; }
.night-map-calls-page .territory-call-race { padding:8px; }
.night-map-calls-page .territory-race-top { gap:4px 6px; font-size:.78rem; }
.night-map-calls-page .territory-call-race small { margin-top:4px; font-size:.7rem; line-height:1.35; }

.night-map-calls-page .night-map-results { position: absolute; top: 90px; left: 12px; right: 12px; z-index: 20; max-height: min(340px, 55dvh); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 6px; box-shadow: var(--shadow); }
.night-map-calls-page .night-dashboard-grid .call-selects { grid-template-columns: minmax(0,1fr); }
.night-map-calls-page .night-feed { padding: 12px; }
@media (max-width: 760px) {
 .night-map-calls-page .night-dashboard-grid { grid-template-columns: minmax(0,1fr); grid-template-rows: repeat(2,minmax(0,1fr)); gap: 10px; }
 .night-map-calls-page .night-dashboard-grid .map-card, .night-map-calls-page .night-dashboard-grid .map-card:has(#zoom-st) { grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: auto auto auto minmax(80px,1fr) auto auto auto; padding: 9px; overflow-y: auto; }
 .night-map-calls-page .night-dashboard-grid .night-map-search { grid-column: 2; grid-row: 2; }
 .night-map-calls-page .night-dashboard-grid .map-mode-field { grid-column: 1; grid-row: 3; }
 .night-map-calls-page .night-dashboard-grid .map-tools > .dd:has(#zoom-st) { grid-column: 2; grid-row: 3; }
 .night-map-calls-page .night-dashboard-grid .map-holder, .night-map-calls-page .night-dashboard-grid .territory-selector { grid-row: 4; }
 .night-map-calls-page .night-dashboard-grid .insets { grid-row: 5; }
 .night-map-calls-page .night-dashboard-grid .legend { grid-row: 6; }
 .night-map-calls-page .night-dashboard-grid #en-map > .note { grid-row: 7; }
 .night-map-calls-page .election-page-heading h1 { font-size: 1.15rem; }
 .night-map-calls-page .election-page-heading > .election-heading-copy > p:not(.election-updated) { display: none; }
 .night-map-calls-page .election-updated { max-height: 2.8em; overflow-y: auto; }
 .night-map-calls-page .election-page-heading .night-window-actions { gap: 6px; }
 .night-map-calls-page .night-map-results { top: 140px; }
 .night-map-calls-page .night-dashboard-grid .call-selects { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* An optional editorial highlight beside call controls. */
.call-key-result{display:flex;align-items:center;gap:7px;margin:0;font-size:12px;cursor:pointer;width:fit-content;color:var(--text)}
.call-key-result input{width:15px;height:15px;margin:0;accent-color:var(--accent)}
.call-key-result span{white-space:nowrap}
.con-call .call-key-result{margin:8px 0}
.call-key-result:has(input:checked) span{font-weight:700}

/* Completed statewide poll closures stay visible without changing tile sizes. */
.help-polls .card.poll-closing-place.is-closed {
  background: color-mix(in srgb, #22c55e 20%, var(--surface));
  border-color: #22a957;
}

/* Compact early-race widgets open a focused candidate guide. */
.help-grid > .card[hidden] { display: none; }
.help-topic-tabs { flex: none; }
.help-topic-tabs button { font-size: .76rem; }
.help-topic-tabs button[aria-selected='true'] { background: var(--text); color: var(--surface); }
.help-early-intro { font-size: .78rem; color: var(--text-2); line-height: 1.5; margin-bottom: 14px; }
.help-early-scroll { min-height: 0; padding-right: 6px; }
.help-early-wave { margin-bottom: 20px; }
.help-early-wave:last-child { margin-bottom: 0; }
.help-early-wave-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 9px; }
.help-early-wave-heading time { display: flex; align-items: baseline; gap: 9px; font-variant-numeric: tabular-nums; }
.help-early-wave-heading time b { font-size: .85rem; }
.help-early-wave-heading time span { font-size: .68rem; color: var(--text-3); }
.help-early-wave-heading h3 { font-size: .76rem; font-weight: 500; color: var(--text-2); }
.help-early-tiles { display: grid; grid-template-columns: repeat(auto-fill,minmax(215px,1fr)); gap: 8px; }
.help-early-tile { display: flex; flex-direction: column; align-items: stretch; gap: 5px; width: 100%; height: 108px; min-width: 0; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; text-align: left; color: var(--text); font: inherit; cursor: pointer; transition: border-color .12s,background .12s; }
.help-early-tile:hover:not(:disabled) { border-color: var(--accent); background: color-mix(in srgb,var(--accent) 7%,var(--surface-2)); }
.help-early-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.help-early-tile-name { font-size: .82rem; font-weight: 700; line-height: 1.3; }
.help-early-tile-tag { font-size: .67rem; color: var(--text-2); }
.help-early-tile-foot { display: flex; justify-content: space-between; align-items: center; gap: 7px; margin-top: auto; font-size: .65rem; }
.help-early-tile-foot > b { font-weight: 600; }
.help-early-tile-foot > span { color: var(--text-3); }
.help-early-tile-foot > span > span { font-size: 1rem; margin-left: 4px; line-height: .8; }
html.help-race-open { overflow: hidden; }
.help-race-dialog { width: min(620px,calc(100vw - 28px)); max-height: calc(100dvh - 40px); margin: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px rgb(0 0 0 / .45); }
.help-race-dialog[open] { display: flex; flex-direction: column; }
.help-race-dialog::backdrop { background: rgb(0 0 0 / .65); }
.help-race-dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); flex: none; }
.help-race-dialog-head > div > span { display: block; font-size: .7rem; color: var(--text-2); margin-bottom: 4px; }
.help-race-dialog-head h2 { font-size: 1.15rem; line-height: 1.3; }
.help-race-dialog-head .icon-btn { flex: none; font-size: 1.3rem; }
.help-race-dialog-body { overflow-y: auto; min-height: 0; padding: 18px 20px; overscroll-behavior: contain; }
.help-race-facts { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 12px; margin-bottom: 20px; }
.help-race-facts > div { display: grid; align-content: start; gap: 4px; }
.help-race-facts small { color: var(--text-3); font-size: .7rem; }
.help-race-facts b { font-size: .82rem; line-height: 1.4; }
.help-race-facts span { color: var(--text-2); font-size: .7rem; }
.help-race-dialog-body h3 { font-size: .86rem; margin-bottom: 7px; }
.help-race-explanation { border-left: 2px solid var(--text-3); padding-left: 12px; margin-bottom: 20px; }
.help-race-explanation p { font-size: .83rem; line-height: 1.6; }
.help-race-candidates h3 { display: flex; align-items: baseline; gap: 8px; }
.help-race-candidates h3 > span { color: var(--text-3); font-weight: 400; font-size: .72rem; }
.help-race-candidates ul { margin: 0 0 20px; padding: 0; list-style: none; }
.help-race-candidates li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.help-race-party-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pc,var(--oth)); flex: none; }
.help-race-candidates li > div { min-width: 0; flex: 1; }
.help-race-candidates li b { display: block; font-size: .82rem; }
.help-race-candidates li small { display: block; color: var(--text-2); font-size: .7rem; margin-top: 2px; }
.help-race-candidate-status { font-size: .67rem; color: var(--text-2); }
.help-race-current { display: grid; gap: 3px; padding: 10px 12px; background: var(--surface-2); border-radius: 6px; margin-bottom: 16px; font-size: .8rem; }
.help-race-current > span { font-size: .7rem; color: var(--text-2); }
.help-race-dialog-foot { border-top: 1px solid var(--line); padding: 12px 20px; display: flex; justify-content: end; flex: none; }
.help-race-dialog-foot a { font-size: .76rem; }
@media (max-width: 760px) {
 .help-topic-tabs { max-width: 100%; }
 .help-topic-tabs button { padding: 7px 9px; }
 .help-early-tiles { grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); }
 .help-race-dialog { max-height: calc(100dvh - 24px); }
 .help-race-dialog-head { padding: 15px; }
 .help-race-dialog-body { padding: 15px; }
 .help-race-facts { grid-template-columns: minmax(0,1fr); gap: 12px; }
}

/* Published early-race calls use the map and call log's party/result palette. */
.help-early-tile.is-called {
 background: var(--early-result-colour);
 border-color: var(--early-result-colour);
 color: var(--early-result-text);
}
.help-early-tile.is-called:hover:not(:disabled) {
 background: var(--early-result-colour);
 border-color: var(--early-result-text);
}
.help-early-tile.is-called .help-early-tile-tag,
.help-early-tile.is-called .help-early-tile-foot > span { color: inherit; }
.help-early-result-marker { padding: 2px 5px; border: 1px solid currentColor; border-radius: 4px; font-size: .62rem; line-height: 1.25; white-space: nowrap; }

.help-battleground-filters { display: grid; grid-template-columns: minmax(180px,2fr) repeat(3,minmax(130px,1fr)); gap: 8px; margin-bottom: 14px; }
.help-battleground-filters label { min-width: 0; }
.help-battleground-filters input, .help-battleground-filters select, .help-battleground-filters .dd { width: 100%; min-width: 0; }
.help-battleground-filters input { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); padding: 0 10px; font: inherit; font-size: .78rem; }
.help-battleground-filters .dd-trigger { font-size: .75rem; }
@media (max-width: 1200px) { .help-battleground-filters { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 760px) { .help-battleground-filters label:first-child { grid-column: 1 / -1; } }

.help-race-call-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.help-race-call-tools p { font-size: .72rem; color: var(--text-2); }
.help-race-call-tools .call-key-result { font-size: .72rem; }
.help-race-candidates li.has-call-choice { display: block; padding: 4px 0; border: 0; }
.help-race-call-choice.candidate-call { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 10px; }
.help-race-call-choice > div { min-width: 0; flex: 1; }
.help-race-call-choice .help-race-candidate-status { flex: none; }
.help-race-withdraw { font-size: .75rem; }

.help-race-call-action { flex: none; padding: 5px 12px; border: 1px solid var(--text); border-radius: 6px; background: var(--text); color: var(--surface); font-size: .76rem; font-weight: 700; }
.help-race-access-note { margin: 0 0 10px; font-size: .75rem; color: var(--text-2); }
.help-race-dialog-foot.is-editing .btn { padding: 0; border: 0; background: transparent; color: var(--text-2); font-size: .7rem; }

/* All calls: separate, equal panels with their own scrolling lists. */
html.night-all-calls-page, .night-all-calls-page body { height:100dvh; overflow:hidden; }
.night-all-calls-page body { display:flex; flex-direction:column; }
.night-all-calls-page main.wrap { flex:1; min-height:0; max-width:none; width:100%; display:flex; flex-direction:column; padding:12px 24px; }
.all-calls-page { display:flex; flex-direction:column; flex:1; min-height:0; }
.all-calls-page > .page-head { flex:none; margin-bottom:12px; }
.all-calls-board { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); grid-template-rows:minmax(0,1fr); gap:12px; flex:1; min-height:0; }
.all-calls-board .call-panel { min-width:0; min-height:0; padding:12px; display:flex; flex-direction:column; overflow:hidden; }
.all-calls-board h2 { display:flex; justify-content:space-between; align-items:center; gap:6px; font-size:.95rem; flex:none; margin-bottom:8px; }
.all-calls-board .call-panel-total { font-size:.68rem; font-weight:400; white-space:nowrap; }
.all-calls-board .call-panel-feed { overflow:hidden; }
.all-calls-board .call-panel-feed > .call-filters { max-height:65%; overflow-y:auto; }
.all-calls-board .call-filter-drawer { flex:none; }
.all-calls-pagination { display:flex; gap:6px; }
.all-calls-pagination .btn { font-size:.78rem; padding:7px 12px; }
.all-calls-pagination .btn[aria-current="page"] { background:var(--text); color:var(--surface); border-color:var(--text); }
@media(max-width:640px) {
 .night-all-calls-page main.wrap { padding:10px; }
 .all-calls-board { grid-template-columns:minmax(0,1fr); grid-template-rows:none; grid-auto-rows:380px; overflow-y:auto; align-content:start; gap:10px; }
}

.election-window-dialog { width:min(520px,calc(100vw - 32px)); max-height:85dvh; overflow-y:auto; border:1px solid var(--line); border-radius:12px; padding:22px; background:var(--surface); color:var(--text); box-shadow:var(--shadow); }
.election-window-dialog::backdrop { background:rgb(0 0 0 / .6); }
.election-window-dialog h2 { margin-bottom:8px; }
.election-window-dialog p { color:var(--text-2); font-size:.85rem; }
.election-window-dialog ul { display:grid; gap:8px; list-style:none; padding:0; margin:16px 0; }
.election-window-dialog li .btn { display:flex; width:100%; justify-content:space-between; }
@media(max-width:960px) { .help-overview-page.election-window-page main.wrap { overflow-y:auto; } }

/* The shareable bulletin page: the site header without navigation or account. */
.public-bulletin-spacer { flex: 1 1 auto; }
button.widget-window-link { background: none; font: inherit; cursor: pointer; }
.night-window-actions button.widget-window-link { font-size: .7rem; font-weight: 500; }
.public-bulletin-page .head-row .brand span { display: inline; }

/* ---- Phones ----
   Narrow screens, and phones held sideways. Full-window layouts built for a
   desktop screen scroll as ordinary pages here, and maps keep the map's own
   shape instead of stretching to fill a fixed box. Nothing in this block
   reaches a desktop browser. */
@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  .race-card { height: auto; }
  .race-card-body { overflow: visible; }
  .race-card-foot { margin-top: 11px; }
  .help-early-tile { height: auto; min-height: 92px; }

  html.candidate-map-page, .candidate-map-page body,
  html.night-map-page, .night-map-page body,
  html.night-map-calls-page, .night-map-calls-page body,
  html.night-all-calls-page, .night-all-calls-page body { height: auto; overflow: visible; }
  .candidate-map-page main.wrap, .night-map-page main.wrap, .night-map-calls-page main.wrap, .night-all-calls-page main.wrap { flex: none; overflow: visible; }
  .candidate-map-page .map-card, .night-map-page .map-card { flex: none; }
  .candidate-map-page #section-map, .night-map-page #en-map, .night-map-page .night-content, .night-map-calls-page .night-content { flex: none; }
  .candidate-map-page .legend { max-height: none; overflow: visible; }

  .map-holder, .candidate-map-page .map-holder, .night-map-page .map-holder, .night-map-calls-page .night-dashboard-grid .map-holder, #prediction-map .map-holder {
    flex: none; width: 100%; height: auto; min-height: 0; aspect-ratio: 975 / 610; max-height: calc(100dvh - 72px);
  }
  .map-holder > .map-svg { width: 100%; height: 100%; }
  .night-map-page .territory-selector, .night-map-calls-page .night-dashboard-grid .territory-selector { max-height: 60dvh; }

  .night-map-calls-page .night-dashboard-grid { flex: none; grid-template-columns: minmax(0,1fr); grid-template-rows: none; grid-auto-rows: auto; }
  .night-map-calls-page .night-dashboard-grid .map-card, .night-map-calls-page .night-dashboard-grid .map-card:has(#zoom-st) { grid-template-rows: none; grid-auto-rows: auto; overflow: visible; }
  .night-map-calls-page .night-dashboard-grid .night-feed.fit { height: auto; overflow: visible; }
  .night-map-calls-page #feed { flex: none; max-height: 75dvh; }

  .all-calls-page { flex: none; }
  .all-calls-board { flex: none; grid-template-columns: minmax(0,1fr); grid-template-rows: none; grid-auto-rows: auto; overflow: visible; }
  .all-calls-board .call-panel { overflow: visible; }
  .all-calls-board .call-panel-feed .call-log-body { flex: none; max-height: 70dvh; }
  .all-calls-board .call-panel-feed > .call-filters { max-height: none; }

  .prediction-workspace { height: auto; }
  .prediction-workspace > .card { height: auto; }
  .prediction-map-frame, #prediction-map { flex: none; }
  .prediction-key { position: static; width: auto; margin-top: 10px; box-shadow: none; }
  .prediction-key table { max-width: 260px; }
  .prediction-saved [data-saved-list] { flex: none; max-height: 60dvh; overflow-y: auto; }

  .con-list { display: flex; flex-direction: column; }
  .con-list > * { flex: none; }
  .con-list > .con-races { flex: 1 1 auto; }

  .bulletin-page-head { flex-wrap: wrap; }
  .bulletin-page-head > div:first-child { flex: 1 1 100%; }
}

/* Asks a phone held upright to turn sideways on map pages. */
.rotate-hint { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(10, 14, 20, .5); }
.rotate-hint-panel { width: min(300px, 100%); padding: 22px 20px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); text-align: center; }
.rotate-hint-panel svg { width: 52px; height: 52px; color: var(--accent); margin-bottom: 10px; animation: rotate-hint-turn 1.6s ease-in-out infinite; }
.rotate-hint-panel h2 { font-size: 1.05rem; }
.rotate-hint-panel p { margin-top: 6px; color: var(--text-2); font-size: .85rem; line-height: 1.45; }
.rotate-hint-panel .btn { margin-top: 16px; width: 100%; justify-content: center; }
@keyframes rotate-hint-turn { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
@media (prefers-reduced-motion: reduce) { .rotate-hint-panel svg { animation: none; } }
