/* USA Polls HQ -- static dashboard, FiveThirtyEight-style.
   Light by default; body.dark-mode swaps the tokens. Charts read the same
   tokens (app.js themeColors), so a theme switch redraws them to match. */

/* Public Sans, served from vendor/fonts so the page needs no internet. One
   variable file per style covers every weight; latin-ext only loads for the
   accented names that need it (Hungarian, Norwegian, Spanish parties). */
@font-face {
  font-family: 'Public Sans'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('vendor/fonts/public-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Public Sans'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('vendor/fonts/public-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Public Sans'; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url('vendor/fonts/public-sans-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Public Sans'; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url('vendor/fonts/public-sans-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #ffffff;
  --fg: #111111;
  --approve: #24823d;
  --disapprove: #E24894;
  --dem: #2563eb;
  --rep: #dc2626;
  --unsure: #888888;
  --grid: #e6e6e6;
  --soft: #f4f4f4;
  --card-bg: #ffffff;
  --sub-text: #555555;
  --faint: #6b7280;
  --border: #dddddd;
  --accent: #007bff;
  --warn: #b45309;
  --shadow: 0 10px 25px rgba(0, 0, 0, .12);
}

body.dark-mode {
  --bg: #121212;
  --fg: #f5f5f5;
  --approve: #4ade80;
  --disapprove: #E24894;
  --dem: #60a5fa;
  --rep: #f87171;
  --unsure: #9ca3af;
  --grid: #262626;
  --soft: #1a1a1a;
  --card-bg: #1e1e1e;
  --sub-text: #a3a3a3;
  --faint: #9ca3af;
  --border: #333333;
  --accent: #3b9cff;
  --warn: #fbbf24;
  --shadow: 0 10px 25px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Public Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.4;
  transition: background .3s, color .3s;
}

a { color: inherit; }

button, select, input { font-family: inherit; -webkit-tap-highlight-color: transparent; }
button, select, label[for] { cursor: pointer; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--approve); outline-offset: 2px;
}
button:focus:not(:focus-visible), select:focus:not(:focus-visible), input:focus:not(:focus-visible) { outline: none; }

main.container { max-width: 1240px; margin: 1.5em auto 0; padding: 0 16px; width: 100%; }

/* ---------- the bar across the top: brand, countries, More, theme ---------- */
.top-bar { background: var(--soft); border-bottom: 1px solid var(--border); }
.top-bar-inner { max-width: 1240px; margin: 0 auto; padding: 0 16px; height: 48px; display: flex; align-items: center; gap: 18px; }
.brand { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--fg); text-decoration: none; white-space: nowrap; flex: none; }
/* The countries, and an arrow at whichever end has more beyond it. */
.top-scroller { position: relative; display: flex; align-self: stretch; flex: 1 1 auto; min-width: 0; }
.top-countries {
  position: relative; display: flex; align-self: stretch; flex: 1 1 auto; min-width: 0;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.top-countries::-webkit-scrollbar { display: none; }
.strip-arrow {
  position: absolute; top: 0; bottom: 0; z-index: 2; width: 34px; padding: 0; border: 0; cursor: pointer;
  display: flex; align-items: center; color: var(--fg);
}
.strip-arrow[hidden] { display: none; }
.strip-arrow.prev { left: 0; justify-content: flex-start; padding-left: 4px; background: linear-gradient(to right, var(--soft) 45%, transparent); }
.strip-arrow.next { right: 0; justify-content: flex-end; padding-right: 4px; background: linear-gradient(to left, var(--soft) 45%, transparent); }
.strip-arrow svg { width: 13px; height: 13px; }
.strip-arrow.prev svg { transform: rotate(90deg); }
.strip-arrow.next svg { transform: rotate(-90deg); }
.strip-arrow:hover svg, .strip-arrow:focus-visible svg { stroke-width: 4; }
/* A country: the pill menu's small caps, lit by a rule along the bar's foot. */
.top-link {
  display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 10px; flex: none;
  font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
  color: var(--sub-text); text-decoration: none; background: transparent;
  border: 0; border-top: 2px solid transparent; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.top-link:hover { color: var(--fg); }
.top-link.active { color: var(--fg); border-bottom-color: var(--fg); }
.top-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.top-more .nav-dropdown { position: absolute; top: 100%; left: auto; right: 0; }
/* Under the width the twelve countries need, they take a row of their own
   beneath the brand, scrolling sideways where even that is too narrow. */
@media (max-width: 1199px) {
  .top-bar-inner { flex-wrap: wrap; height: auto; justify-content: space-between; gap: 0 12px; }
  .top-tools .top-link { height: 44px; }
  .top-scroller { order: 2; flex-basis: calc(100% + 20px); margin: 0 -10px; }
  .top-countries .top-link { height: 38px; }
}

/* ---------- header ---------- */
.site-head { margin-bottom: 1.5rem; }
.eyebrow {
  font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--sub-text); margin: 0 0 .35rem;
}
h1.headline { margin: 0 0 .5rem; font-weight: 700; font-size: clamp(1.6rem, 1.1rem + 2vw, 2.2rem); letter-spacing: -0.02em; line-height: 1.15; }
.headline .tone-approve { color: var(--approve); }
.headline .tone-disapprove { color: var(--disapprove); }
.headline .tone-dem { color: var(--dem); }
.headline .tone-rep { color: var(--rep); }
.sub { margin: 0; color: var(--sub-text); font-size: 1rem; max-width: 720px; }
.note-chip {
  display: inline-block; margin-top: .6rem; font-size: .68rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 4px; background: var(--grid); color: var(--sub-text);
}
/* New since your last visit: a dot on a menu entry, pill or country, a chip on the page. */
.new-dot { display: inline-block; flex: none; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--warn); vertical-align: middle; }
.note-chip.new-chip { background: rgba(245, 158, 11, .16); color: var(--warn); }
.note-chip + .note-chip { margin-left: 6px; }
.fresh-line { margin: -4px 0 18px; font-size: .85rem; color: var(--sub-text); }
.fresh-line a { color: var(--fg); font-weight: 700; text-decoration: none; white-space: nowrap; }
.fresh-line a:hover { text-decoration: underline; }
.fresh-line b { color: var(--warn); }
.theme-toggle {
  background: transparent; border: 1.5px solid transparent; border-radius: 6px; padding: 6px;
  color: var(--sub-text); display: inline-flex; align-items: center; justify-content: center; line-height: 0;
}
.theme-toggle:hover { color: var(--fg); background: var(--grid); }

/* ---------- navigation: the grey pill bar ---------- */
.main-nav {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  margin: 1.25rem auto 1.5rem; padding: 4px; background: var(--grid); border-radius: 8px; width: fit-content; max-width: 100%;
}
.nav-item { position: relative; }
.nav-pill {
  padding: 8px 14px; font-size: .78rem; font-weight: 800; color: var(--sub-text); background: transparent;
  border: 1.5px solid transparent; border-radius: 6px; text-transform: uppercase; letter-spacing: .05em;
  display: flex; align-items: center; gap: 4px; text-decoration: none; transition: all .2s ease; white-space: nowrap;
}
.nav-pill:hover { color: var(--fg); }
.nav-pill.active { color: var(--fg); background: var(--card-bg); border-color: var(--border); box-shadow: 0 2px 4px rgba(0, 0, 0, .05); }
.nav-pill svg { flex: none; }
.nav-dropdown {
  position: absolute; top: 100%; left: 0; z-index: 1000; display: none; min-width: 210px; overflow: hidden;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
}
.nav-item:hover .nav-dropdown, .nav-item:focus-within .nav-dropdown, .nav-item.open .nav-dropdown { display: block; animation: dropdownIn .14s ease; }
/* A tab of many pages (World's countries): the pill bar in rows, All
   countries set off from the rest by a rule; where they would take more than
   two rows (a phone), one row scrolling sideways under the same arrows as the
   top menu, faded into the bar (app.js sets .scrolls). */
.main-nav.nav-strip { position: relative; display: block; max-width: min(100%, 980px); }
.nav-strip-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.nav-strip-first { padding-right: 6px; margin-right: 0; border-right: 1px solid var(--border); }
.nav-strip .nav-pill { padding: 7px 11px; }
/* Who leads in each country, in that party's colour (its name on hover). */
.lead-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-right: 2px; }
/* Read out, not shown. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* ...and blinking where there are new polls since the last visit. */
.lead-dot.blink { animation: leadBlink 1.4s ease-in-out infinite; }
@keyframes leadBlink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .2; transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) {
  .lead-dot.blink { animation: none; box-shadow: 0 0 0 2px var(--grid), 0 0 0 3.5px var(--warn); }
}
.nav-strip .strip-arrow { border-radius: 8px; }
.nav-strip .strip-arrow.prev { background: linear-gradient(to right, var(--grid) 50%, transparent); }
.nav-strip .strip-arrow.next { background: linear-gradient(to left, var(--grid) 50%, transparent); }
.main-nav.nav-strip.scrolls { width: 100%; max-width: 100%; }
.nav-strip.scrolls .nav-strip-row { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.nav-strip.scrolls .nav-strip-row::-webkit-scrollbar { display: none; }
.nav-strip.scrolls .nav-item { flex: none; }
.nav-strip:not(.scrolls) .strip-arrow { display: none; }
@keyframes dropdownIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown-item {
  display: block; padding: 10px 16px; font-size: .74rem; font-weight: 700; color: var(--sub-text);
  text-transform: uppercase; letter-spacing: .02em; text-decoration: none; white-space: nowrap; transition: all .15s;
}
.dropdown-item:hover { background: var(--grid); color: var(--fg); }
/* A section label in a long menu: the eyebrow's small caps, a rule above all but the first. */
.dropdown-label {
  padding: 10px 16px 4px; font-size: .62rem; font-weight: 800; color: var(--sub-text); opacity: .7;
  text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
}
.dropdown-label + .dropdown-item { padding-top: 6px; }
.dropdown-item + .dropdown-label { border-top: 1px solid var(--border); margin-top: 4px; }
.dropdown-item.active { color: var(--approve); background: rgba(74, 222, 128, .1); }

/* ---------- meta line under the header ---------- */
.header-meta {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid var(--border); padding-top: .55rem; margin: 0 0 1.25rem;
}
.day-counter { font-size: .8rem; font-weight: 700; color: var(--sub-text); text-transform: uppercase; letter-spacing: .05em; }
.day-counter.stale { color: var(--warn); }
.momentum-badge { font-size: .7rem; font-weight: 800; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .03em; }
.momentum-badge:empty { display: none; }
.momentum-up { background: rgba(74, 222, 128, .15); color: var(--approve); }
.momentum-down { background: rgba(226, 72, 148, .15); color: var(--disapprove); }
.momentum-neutral { background: var(--grid); color: var(--sub-text); }

.section-head { margin: 2.75rem 0 .75rem; }
.section-head h2 { margin: 0 0 .2rem; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.section-head p { margin: 0; color: var(--sub-text); font-size: .92rem; }
.section-break { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0 0; }

/* ---------- stat tiles ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 1rem; }
.stat-row.per-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-row.per-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-row.per-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1000px) { .stat-row.per-5, .stat-row.per-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .stat-row, .stat-row.per-4, .stat-row.per-5, .stat-row.per-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat[hidden] { display: none; }
.stat {
  position: relative; border: 1px solid var(--border); background: var(--card-bg); border-radius: 10px;
  padding: 12px 14px; min-width: 0; display: flex; flex-direction: column;
}
/* Long labels wrap; the value sits at the bottom so a row's numbers line up. */
.stat .lbl {
  font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sub-text);
  line-height: 1.3; overflow-wrap: anywhere; display: flex; align-items: flex-start; gap: 6px; margin-bottom: auto;
}
.stat .lbl i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--tone, var(--faint)); margin-top: 1px; }
.stat b { display: block; font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 4px; color: var(--value, var(--fg)); letter-spacing: -0.02em; }
/* A long name in a card ("Beacon Research/Shaw & Co. Research") breaks rather than push the page wider. */
.stat b { overflow-wrap: anywhere; }
.stat .cap { color: var(--sub-text); font-size: .76rem; margin-top: 2px; }
.stat .cap:empty { display: none; }
.trend-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: .68rem; font-weight: 800; letter-spacing: .03em; color: var(--faint); font-variant-numeric: tabular-nums; text-transform: uppercase; }
.trend-strip:empty { display: none; }
.trend-strip .up { color: var(--approve); }
/* On a phone the cards sit two to a row: a smaller figure, and the 7-day and
   30-day moves on one line (the 1-day one, the least telling, left to wider
   screens), so the chart is in view without a full screen of scrolling. */
@media (max-width: 560px) {
  .stat-row { gap: 8px; margin-bottom: .75rem; }
  .stat { padding: 9px 11px; border-radius: 9px; }
  .stat .lbl { font-size: .62rem; }
  .stat b { font-size: 1.45rem; margin-top: 2px; }
  .stat .cap { font-size: .72rem; }
  .trend-strip { flex-wrap: nowrap; gap: 6px; margin-top: 4px; font-size: .62rem; letter-spacing: .01em; }
  .trend-strip span:first-child:not(:only-child) { display: none; }
}
.trend-strip .down { color: var(--disapprove); }
.stat[tabindex] { cursor: help; }
.stat .tip {
  display: none; position: absolute; left: 0; top: calc(100% + 8px); width: min(22rem, 90vw); z-index: 30; text-align: left;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
  padding: 10px 12px; font-size: .82rem; color: var(--fg);
}
.stat:hover .tip, .stat:focus .tip, .stat:focus-within .tip { display: block; }
/* A card whose note has more on hover (UI.cardNote): the note underlined as a hint. */
.stat.has-tip .cap { text-decoration: underline dotted; text-decoration-color: var(--faint); text-underline-offset: 3px; cursor: help; }
.tip .standing { font-weight: 700; margin-bottom: 4px; }
.tip .spectrum { color: var(--sub-text); margin-bottom: 4px; }
.tip .spectrum.lead { color: var(--fg); font-weight: 700; }
.tip ul { margin: 0; padding-left: 1.1rem; }
.tip li { margin-bottom: 3px; }

/* ---------- controls: one compact 538 row ---------- */
.controls-538 { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 22px; margin: 0 0 .75rem; }
.ctl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ctl[hidden] { display: none; }
.ctl > label, .ctl > .ctl-label { font-size: .65rem; font-weight: 800; color: var(--faint); letter-spacing: .05em; text-transform: uppercase; }
.button-group { display: flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; width: fit-content; }
.button-group button {
  padding: 6px 12px; font-size: .7rem; font-weight: 700; background: var(--card-bg); color: var(--fg);
  border: none; text-transform: uppercase; transition: all .2s;
}
.button-group button:not(:last-child) { border-right: 1px solid var(--border); }
.button-group button[hidden] { display: none; }
.button-group button.active { background: var(--fg); color: var(--bg); }
.button-group button:active, .mini-btn:active, .nav-pill:active { transform: translateY(1px); }
.mini-btn {
  font-size: .68rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 4px; background: var(--card-bg); color: var(--sub-text); line-height: 1.2;
}
.mini-btn:disabled, .mini-btn:disabled:hover { opacity: .45; cursor: default; color: var(--sub-text); border-color: var(--border); }
.mini-btn:hover { color: var(--fg); border-color: var(--fg); }
.mini-btn.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.span-input { display: flex; align-items: center; gap: 6px; font-size: .68rem; font-weight: 800; color: var(--faint); }
.span-input input, .ctl select, .ctl input[type="date"], .ctl input[type="search"], .ctl input[type="text"], .pop-panel input[type="search"] {
  background: var(--soft); border: 1px solid var(--border); border-radius: 4px; padding: 5px 8px;
  font-size: .78rem; font-weight: 700; color: var(--fg); color-scheme: light;
}
body.dark-mode .span-input input, body.dark-mode .ctl select, body.dark-mode .ctl input, body.dark-mode .pop-panel input { color-scheme: dark; }
.span-input input { width: 64px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.check { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--sub-text); }
.check input { accent-color: var(--fg); margin: 0; }
.check.strong { color: var(--fg); font-weight: 800; }

/* date range: two-handle slider with the dates at each end */
.range-slider { margin: .25rem 0 1.25rem; padding: 0 8px; }
/* Options: the controls past the range, folded under one button. */
.options-panel[hidden] { display: none; }
.options-panel { border-top: 1px dashed var(--border); padding-top: .75rem; }
.options-toggle { display: inline-flex; align-items: center; gap: 5px; }
.options-toggle .chev { display: inline-flex; transition: transform .15s; }
.options-toggle.open .chev { transform: rotate(180deg); }
.options-toggle .changed-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.range-labels { display: flex; justify-content: space-between; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--sub-text); margin-bottom: 4px; }
.double-slider { position: relative; width: 100%; height: 20px; }
.double-slider input[type="range"] {
  position: absolute; width: 100%; pointer-events: none; -webkit-appearance: none; appearance: none;
  background: transparent; z-index: 2; top: 0; margin: 0; height: 16px;
}
.double-slider input[type="range"]::-webkit-slider-thumb {
  pointer-events: all; width: 16px; height: 16px; -webkit-appearance: none; background: var(--card-bg);
  border: 2px solid var(--fg); border-radius: 50%; margin-top: -6px;
}
.double-slider input[type="range"]::-webkit-slider-runnable-track { -webkit-appearance: none; background: transparent; height: 4px; }
.double-slider input[type="range"]::-moz-range-thumb { pointer-events: all; width: 14px; height: 14px; background: var(--card-bg); border: 2px solid var(--fg); border-radius: 50%; }
.double-slider input[type="range"]::-moz-range-track { background: transparent; }
.double-slider .slider-track { position: absolute; top: 6px; left: 0; right: 0; height: 4px; background: var(--border); border-radius: 2px; z-index: 1; }
.double-slider .slider-fill { position: absolute; top: 6px; height: 4px; background: var(--accent); border-radius: 2px; z-index: 1; }

/* pollster exclusions: a popover off a mini button */
.pop { position: relative; }
.pop-panel {
  display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 50; width: min(420px, 92vw);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 10px;
}
.pop.open .pop-panel { display: block; animation: dropdownIn .14s ease; }
.pop-panel input[type="search"] { width: 100%; margin-bottom: 6px; }
.pollster-list { max-height: 260px; overflow-y: auto; overflow-x: hidden; columns: 2 170px; column-gap: 12px; }
.pollster-list label { display: flex; gap: 6px; align-items: center; font-size: .78rem; color: var(--sub-text); padding: 3px 0; break-inside: avoid; }
.pollster-list label.checked span:first-of-type { color: var(--disapprove); text-decoration: line-through; }
.pollster-list input { accent-color: var(--disapprove); margin: 0; flex: none; }
.pollster-list .count { color: var(--faint); margin-left: auto; font-variant-numeric: tabular-nums; font-size: .7rem; }
.pop-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: .72rem; color: var(--sub-text); }

/* ---------- charts ---------- */
.chart-block { margin: 0 0 1.25rem; }
/* Where a page's polls come from, set small under its first chart. */
.credit { margin: -.5rem 0 1.25rem; font-size: .74rem; line-height: 1.45; color: var(--faint); max-width: 900px; }
.credit b { margin-right: 6px; font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sub-text); }
.chart-title { font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--sub-text); margin: 0 0 2px; line-height: 1.35; }
/* The plot, the cursor layer over it, and the callout that rides the cursor.
   touch-action keeps vertical page scrolling while a finger scrubs sideways. */
.chart-wrap { position: relative; touch-action: pan-y; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.chart-wrap > canvas { display: block; }
.chart-overlay { position: absolute; left: 0; top: 0; pointer-events: none; }

.callout-538 {
  position: absolute; top: 0; left: 0; transform: translateX(-50%); display: none; flex-direction: column; align-items: center;
  pointer-events: none; z-index: 10; white-space: nowrap; text-align: center;
}
.callout-538.on { display: flex; }
.callout-538 .c-date {
  font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--sub-text);
  padding: 1px 5px; background: var(--bg); border-radius: 3px;
}
.callout-538 .c-name { font-size: 1.05rem; font-weight: 700; line-height: 1.2; margin-top: 1px; padding: 0 4px; background: var(--bg); border-radius: 3px; }
.callout-538 .c-pill {
  font-size: 1.02rem; font-weight: 800; padding: 1px 9px; margin-top: 3px; border: 1.5px solid; border-radius: 4px;
  font-variant-numeric: tabular-nums; background: var(--card-bg);
}
.callout-538 .c-note { font-size: .64rem; font-weight: 800; color: var(--sub-text); text-transform: uppercase; letter-spacing: .02em; margin-top: 4px; background: var(--bg); padding: 1px 4px; border-radius: 3px; }

/* Hover card for scatter points and bars. */
.chart-tip {
  position: absolute; display: none; pointer-events: none; z-index: 12; max-width: 260px; font-size: .78rem; line-height: 1.4;
  background: var(--card-bg); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; box-shadow: var(--shadow);
}
.chart-tip.on { display: block; }
.chart-tip b { font-weight: 700; }

/* The daily net strip under a two-sided chart. */
.net-strip { margin: 6px 0 0; }
.net-strip[hidden] { display: none; }
.ns-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .7rem; font-weight: 800;
  letter-spacing: .06em; color: var(--sub-text); text-transform: uppercase; margin: 0 0 2px;
}
.ns-read { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.ns-read b { font-size: .95rem; letter-spacing: 0; }
.ns-chart { position: relative; height: 150px; touch-action: pan-y; cursor: crosshair; }
@media (max-width: 600px) { .ns-chart { height: 110px; } }


.chart-legend {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 20px; margin: .5rem 0 0;
  font-size: .7rem; color: var(--sub-text); text-transform: uppercase; font-weight: 700; letter-spacing: .05em;
}
.legend-item { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; padding: 2px 0; }
.legend-item.off { opacity: .35; }
.legend-line { width: 22px; height: 3px; border-radius: 2px; background: currentColor; }
.legend-line.dash { background: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 8px); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; opacity: .45; }
.legend-diamond { width: 8px; height: 8px; margin: 0 1px; border-radius: 1px; transform: rotate(45deg); }
.legend-box { width: 22px; height: 12px; }

.chart-tools { display: flex; justify-content: flex-end; gap: 8px; margin: 6px 0 10px; }
.chart-tools button {
  font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 4px; background: var(--card-bg); color: var(--sub-text);
}
.chart-tools button:hover { color: var(--fg); border-color: var(--fg); }
.chart-table { max-height: 400px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 18px; }
.chart-table[hidden] { display: none; }
.chart-table table, table.data { width: 100%; border-collapse: collapse; font-size: .8rem; font-variant-numeric: tabular-nums; }
.chart-table th, table.data th {
  position: sticky; top: 0; background: var(--card-bg); text-align: right; padding: 7px 12px; border-bottom: 1px solid var(--border);
  font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--sub-text); white-space: nowrap;
}
.chart-table th:first-child, .chart-table td:first-child, table.data th:first-child, table.data td:first-child { text-align: left; }
.chart-table td, table.data td { text-align: right; padding: 5px 12px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.chart-table tr:hover td { background: var(--soft); }
td.txt { text-align: left !important; }
td.dem, td.harris, td.lean-d { color: var(--dem); font-weight: 700; }
td.rep, td.trump, td.lean-r { color: var(--rep); font-weight: 700; }
table.data td a { font-weight: 700; text-decoration: none; }
table.data td a:hover { text-decoration: underline; }

/* ---------- panels and boards ---------- */
.panel { border: 1px solid var(--border); background: var(--card-bg); border-radius: 10px; padding: 14px 16px; margin: 0 0 18px; }
.panel h3 { margin: 0 0 2px; font-size: 1rem; }
.panel .panel-sub { color: var(--sub-text); font-size: .8rem; margin: 0 0 12px; }
.board { display: grid; grid-template-columns: 170px 1fr 70px; align-items: center; row-gap: 7px; column-gap: 12px; font-size: .84rem; }
.board .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 7px; }
.board .nm small { font-weight: 500; color: var(--sub-text); font-size: .72rem; }
.board .nm i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.track { position: relative; height: 16px; background: var(--grid); border-radius: 4px; }
.track .bar { position: absolute; top: 3px; bottom: 3px; left: 0; border-radius: 3px; }
.track .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--fg); opacity: .4; }
.board .v { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.board .v small { display: block; font-weight: 600; font-size: .68rem; color: var(--sub-text); }
@media (max-width: 640px) { .board { grid-template-columns: 110px 1fr 58px; } }
/* Coalitions: a name with its partners' seats under it, the partners stacked
   along the House, and the total against the majority. */
.board.coalitions { grid-template-columns: 240px 1fr 96px; row-gap: 10px; }
.board.coalitions .nm { display: block; white-space: normal; }
.board.coalitions .nm small { display: block; margin-top: 1px; }
.board.coalitions .track { height: 18px; }
.board.coalitions .track .seg { border-radius: 0; }
.board.coalitions .track .seg:first-child { border-radius: 3px 0 0 3px; }
.board.coalitions .v small { white-space: nowrap; }
.board.coalitions .v.ok, .board.coalitions .v.ok small { color: var(--approve); }
/* Phones: the bar takes its own row, the total backfills beside the name. */
@media (max-width: 640px) { .board.coalitions { grid-template-columns: 1fr 74px; grid-auto-flow: row dense; row-gap: 6px; } .board.coalitions .track { grid-column: 1 / -1; } }

.info { border-left: 3px solid var(--approve); background: var(--soft); border-radius: 0 6px 6px 0; padding: 10px 12px; font-size: .86rem; color: var(--sub-text); margin: 0 0 1.25rem; }
.info strong { color: var(--fg); }
.alert { border-left: 3px solid var(--disapprove); background: var(--soft); border-radius: 0 6px 6px 0; padding: 10px 12px; font-size: .88rem; margin: 0 0 1rem; color: var(--fg); }
.alert[hidden] { display: none; }

/* ---------- overview race cards ---------- */
.hero { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
@media (max-width: 720px) { .hero { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.race-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.race-card {
  display: block; text-decoration: none; color: inherit; border: 1px solid var(--border); background: var(--card-bg);
  border-radius: 10px; padding: 14px 16px; transition: box-shadow .2s, border-color .2s;
}
a.race-card:hover { border-color: var(--fg); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.race-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.race-card h3 { margin: 0; font-size: 1.02rem; }
.race-rate { flex: none; font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; border: 1px solid currentColor; }
.race-avg { display: flex; align-items: baseline; gap: 10px; margin: 8px 0; }
.race-avg b { font-size: 1.7rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.race-avg span { color: var(--sub-text); font-size: .78rem; }
.h2h .row { display: flex; justify-content: space-between; font-size: .74rem; margin-bottom: 3px; font-weight: 600; }
.h2h .row b { font-variant-numeric: tabular-nums; }
.h2h .stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--grid); gap: 2px; }
.h2h .stack i { display: block; height: 100%; }
.spark { height: 64px; margin: 8px 0 4px; }
.race-foot { color: var(--sub-text); font-size: .72rem; margin-top: 4px; }
.race-foot.stale { color: var(--warn); font-weight: 700; }
.race-card.broken b { color: var(--sub-text); }

/* The overview's calendar: a row per year of each country's next election. */
.cal-head { margin-top: 1.75rem; }
.cal { display: flex; flex-direction: column; gap: 10px; margin-bottom: .5rem; }
.cal-year { display: flex; gap: 12px; align-items: stretch; }
.cal-y {
  flex: none; width: 52px; padding-top: 10px; font-size: .9rem; font-weight: 800; color: var(--faint);
  font-variant-numeric: tabular-nums; border-top: 2px solid var(--border);
}
.cal-tiles { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cal-tile {
  display: block; text-decoration: none; color: inherit; border: 1px solid var(--border); background: var(--card-bg);
  border-radius: 8px; padding: 9px 12px 10px; transition: box-shadow .2s, border-color .2s; min-width: 0;
}
a.cal-tile:hover { border-color: var(--fg); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.cal-country { font-size: .8rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-tile b { display: block; font-size: 1.3rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 2px 0 1px; }
.cal-when { font-size: .74rem; color: var(--fg); font-variant-numeric: tabular-nums; }
.cal-what { font-size: .68rem; color: var(--sub-text); margin-top: 1px; }
.cal-tile.soon { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.cal-tile.soon b { color: var(--accent); }
.cal-tile.held b { color: var(--sub-text); }
@media (max-width: 560px) {
  .cal-year { flex-direction: column; gap: 6px; }
  .cal-y { width: auto; padding-top: 6px; }
  .cal-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.footer { color: var(--sub-text); font-size: .76rem; padding: 2.5rem 16px 3rem; text-align: center; border-top: 1px solid var(--border); margin-top: 2.5rem; }
.footer code { color: var(--fg); font-size: .74rem; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--sub-text); }
.muted { color: var(--sub-text); }
.small { font-size: .82rem; }
.pad { padding: 10px 12px; }

@media (max-width: 640px) {
  main.container { margin-top: 1em; }
  .main-nav { width: 100%; justify-content: flex-start; }
  .nav-pill { padding: 7px 10px; font-size: .72rem; }
  /* Pinned under its pill, a long menu (the Senate's 14 states) scrolls inside rather than off the screen. */
  .nav-dropdown { position: fixed; left: 16px; right: 16px; top: auto; max-height: 55vh; overflow-y: auto; }
  .controls-538 { gap: 12px 14px; }
  .chart-tools { justify-content: flex-start; }
  .callout .box { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

/* The midterm map (pages/racemap.js). */
.map-panel .controls-538 { margin: 4px 0 8px; }
.map-summary { margin: 0 0 6px; font-size: .84rem; color: var(--sub-text); }
.map-wrap { position: relative; }
.race-map { display: block; width: 100%; height: auto; }
.race-map path.st { stroke: var(--card-bg); stroke-width: .9; stroke-linejoin: round; transition: opacity .12s; }
.race-map path.tracked { cursor: pointer; outline: none; }
.race-map.dim path.tracked:not(.hot) { opacity: .62; }
.race-map .hover-ring { fill: none; stroke: var(--fg); stroke-width: 2; stroke-linejoin: round; pointer-events: none; }
.race-map .wrong { fill: none; stroke: var(--fg); stroke-width: 1.4; stroke-dasharray: 5 3; pointer-events: none; }
.race-map text { pointer-events: none; text-anchor: middle; font-family: inherit; font-variant-numeric: tabular-nums; }
.race-map .lbl-abbr { font-size: 13px; font-weight: 800; }
.race-map .lbl-val { font-size: 11.5px; font-weight: 700; }
.race-map .lbl-faint { font-size: 10px; font-weight: 700; fill: var(--faint); }
.race-map .lbl-callout { text-anchor: start; font-size: 12px; font-weight: 800; fill: var(--fg); }
.race-map .leader { stroke: var(--sub-text); stroke-width: .8; }
.race-map .callout-sw { stroke: var(--border); stroke-width: .6; }
/* The 2028 forecast's callouts are touch targets: the swatch, its label and a clear box round them. */
.race-map .callout-hit { cursor: pointer; }
.race-map .callout-pad { fill: transparent; }
.race-map .callout-hit:focus { outline: none; }
.race-map .callout-hit:focus .callout-sw { stroke: var(--fg); stroke-width: 1.5; }
@media (max-width: 640px) {
  .race-map .lbl-val, .race-map .lbl-faint, .race-map .lbl-callout .cv { display: none; }
  .race-map .lbl-abbr { font-size: 20px; }
  .race-map .lbl-callout { font-size: 18px; }
}
.map-tip {
  position: absolute; display: none; z-index: 12; width: 320px; max-width: calc(100% - 4px); pointer-events: none;
  font-size: .78rem; line-height: 1.35; background: var(--card-bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; box-shadow: var(--shadow);
}
.map-tip.on { display: block; }
.map-tip.pinned { pointer-events: auto; }
/* Under the map (no hover), the card is part of the page and its links are tapped. */
.map-tip.below { position: static; width: auto; max-width: none; margin-top: 8px; box-shadow: none; pointer-events: auto; }
.map-tip .mt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .86rem; }
.map-tip .mt-badge { margin-left: auto; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 2px 6px; border-radius: 4px; background: var(--soft); color: var(--sub-text); }
/* The 2028 forecast's rating pill sits left of the electoral votes, which then need no push of their own. */
.map-tip .mt-badge.mt-rating + .mt-badge { margin-left: 0; }
.map-tip .mt-badge.wrong { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.map-tip .mt-names { color: var(--sub-text); font-size: .74rem; margin-top: 2px; }
.map-tip table { width: 100%; border-collapse: collapse; margin: 7px 0 5px; font-variant-numeric: tabular-nums; }
.map-tip th { font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--faint); text-align: right; padding: 0 0 3px 6px; }
.map-tip td { text-align: right; padding: 2px 0 2px 6px; white-space: nowrap; }
.map-tip th:first-child, .map-tip td:first-child { text-align: left; padding-left: 0; }
/* A long note (a result, a holder) wraps inside the card rather than running past its edge. */
.map-tip tr.mt-m td:last-child { white-space: normal; overflow-wrap: anywhere; }
.map-tip tr.mt-m td:first-child { vertical-align: top; }
.map-tip tr.won td { font-weight: 700; }
.map-tip tr.mt-m td { border-top: 1px solid var(--grid); color: var(--sub-text); font-size: .74rem; padding-top: 4px; }
.map-tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.map-tip .mt-lean { margin: 2px 0 7px; }
.map-tip .mt-cap { font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--faint); margin-bottom: 2px; }
.map-tip .mt-spark { display: block; width: 100%; height: auto; }
.map-tip .mt-zone { font-size: 9px; font-weight: 700; fill: var(--sub-text); }
.map-tip .mt-foot { color: var(--sub-text); margin-top: 6px; font-size: .72rem; }
.map-tip .mt-seats { display: flex; flex-wrap: wrap; gap: 2px; margin: 8px 0 3px; }
.map-tip .seat { --c: var(--faint); width: 11px; height: 11px; border-radius: 2px; background: var(--c); position: relative; }
.map-tip .seat.open { background: color-mix(in srgb, var(--c) 35%, var(--card-bg)); box-shadow: inset 0 0 0 1px var(--c); }
.map-tip .seat.flip::after { content: ''; position: absolute; left: 3.5px; top: 3.5px; width: 4px; height: 4px; border-radius: 50%; background: var(--card-bg); }
.map-tip .mt-list { margin: 5px 0 0; font-size: .74rem; color: var(--sub-text); }
.map-tip .mt-list b { color: var(--fg); }
.map-tip .mt-foot a { font-weight: 800; color: var(--fg); }
.map-legend { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 22px; margin-top: 10px; font-size: .74rem; color: var(--sub-text); }
.map-legend .ramp-title { display: block; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin-bottom: 3px; }
.map-legend .steps { display: flex; gap: 2px; }
.map-legend .steps > div { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .66rem; }
.map-legend .steps .sw { width: 30px; height: 12px; border-radius: 2px; display: block; }
.map-legend .key { display: flex; align-items: center; gap: 6px; }
.map-legend .key .sw { width: 14px; height: 12px; border-radius: 2px; display: inline-block; }
.map-legend .sw.hatch { background: repeating-linear-gradient(45deg, var(--faint) 0 2px, var(--soft) 2px 5px); }
.map-legend .sw.dashed { border: 1.5px dashed var(--fg); background: transparent; }

/* The 2028 head-to-heads' picker: a Democrat on the left, a Republican on
   the right, the chosen pairing drawn below. */
.matchup-picker {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 14px;
  margin: 0 0 1.1rem; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg);
}
.matchup-picker .ctl { flex: 1 1 0; max-width: 360px; }
.matchup-picker .pick-r { align-items: flex-end; text-align: right; }
.matchup-picker .ctl select { width: 100%; font-size: .9rem; padding: 8px 10px; }
.matchup-picker .pick-d select { border-left: 4px solid var(--dem); }
.matchup-picker .pick-r select { border-right: 4px solid var(--rep); text-align: right; }
.matchup-picker option.unpolled { color: #9aa0a6; }
.pick-vs { font-size: .8rem; font-weight: 800; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 10px; }
@media (max-width: 560px) {
  .matchup-picker { flex-direction: column; align-items: stretch; }
  .matchup-picker .ctl { max-width: none; }
  .matchup-picker .pick-r { align-items: stretch; text-align: left; }
  .matchup-picker .pick-r select { text-align: left; }
  .pick-vs { padding: 0; text-align: center; }
}

/* The generic ballot's record: the election picker sits under its heading. */
.gb-record .section-head .ctl { margin-top: 10px; width: fit-content; min-width: 140px; }

/* The House district map (districtmap.js): thin district lines, the states'
 * outlines over them, both the same width at any zoom. */
.district-map path.dm-d { stroke: var(--card-bg); stroke-width: .5; vector-effect: non-scaling-stroke; }
.district-map path.dm-d.dm-counting { stroke: var(--fg); stroke-width: 1; stroke-dasharray: 3 2; }
.district-map .dm-states path { fill: none; stroke: var(--card-bg); stroke-width: 1.6; vector-effect: non-scaling-stroke; pointer-events: none; }
.district-map .dm-ring { vector-effect: non-scaling-stroke; }
.dm-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 4px 0 8px; }
.dm-bar .dm-back { font: inherit; font-size: .78rem; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--card-bg); color: var(--fg); cursor: pointer; }

/* Long explanations open at two lines (app.js clampText), "More" for the rest. */
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.info.clamp { margin-bottom: 4px; }
.more-btn { display: inline-block; font: inherit; font-size: .76rem; font-weight: 700; color: var(--sub-text); background: none; border: 0; padding: 2px 0; margin: 0 0 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.more-btn:hover { color: var(--fg); }
.section-head .more-btn { margin: 2px 0 0; }

/* The page finder (press /). */
.find-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; font: inherit; }
.find-btn .find-key { font-size: .66rem; font-weight: 800; border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; color: var(--faint); }
.finder { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .35); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 0; }
.finder[hidden] { display: none; }
.finder-box { width: 100%; max-width: 560px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); overflow: hidden; }
.finder-box input { width: 100%; box-sizing: border-box; border: 0; border-bottom: 1px solid var(--border); padding: 14px 16px; font: inherit; font-size: 1rem; background: transparent; color: var(--fg); outline: none; }
.finder-list { max-height: 60vh; overflow-y: auto; padding: 6px; }
.finder-hit { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 6px; color: var(--fg); text-decoration: none; font-size: .9rem; }
.finder-hit.on, .finder-hit:hover { background: var(--soft); }
.finder-where { color: var(--faint); font-size: .76rem; white-space: nowrap; }
.finder-none { padding: 12px 10px; color: var(--sub-text); font-size: .86rem; }

/* A tab with many pages picks one from a list (Favorability, World). */
.picker-wrap { position: relative; display: inline-flex; align-items: center; }
.nav-picker { appearance: none; -webkit-appearance: none; font: inherit; font-size: .8rem; font-weight: 700; color: var(--fg); background: var(--card-bg); border: 1px solid var(--border); border-radius: 999px; padding: 7px 32px 7px 14px; cursor: pointer; box-shadow: 0 2px 4px rgba(0, 0, 0, .05); }
.picker-chev { position: absolute; right: 13px; pointer-events: none; display: inline-flex; color: var(--sub-text); }

/* The footer's links to the pages no tab holds. */
.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px 48px; margin-bottom: 18px; text-align: left; }
.foot-col { display: flex; flex-direction: column; gap: 5px; }
.foot-col b { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.foot-col a { color: var(--sub-text); text-decoration: none; font-size: .8rem; }
.foot-col a:hover { color: var(--fg); text-decoration: underline; }

/* Latest polls (pages/latest.js). */
.latest-panel .controls-538 { margin-bottom: 6px; }
.latest-panel input[type=search] { font: inherit; font-size: .84rem; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--fg); min-width: 200px; }
.latest-count { color: var(--sub-text); font-size: .8rem; margin: 4px 0 8px; }
.latest-table { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
.latest-table th { text-align: left; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); padding: 0 10px 6px 0; border-bottom: 1px solid var(--border); }
.latest-table td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--grid, var(--border)); vertical-align: top; }
.latest-table tr { cursor: pointer; }
.latest-table tr:hover td { background: var(--soft); }
.latest-table tr.day-start td { border-top: 1px solid var(--border); }
.latest-table .l-date { white-space: nowrap; color: var(--sub-text); font-weight: 700; width: 4.5em; }
.latest-table .l-race a { color: var(--fg); font-weight: 700; text-decoration: none; }
.latest-table .l-race a:hover { text-decoration: underline; }
.latest-table .l-sample, .latest-table .l-sep { color: var(--faint); }
.latest-table .l-lead { white-space: nowrap; }
.latest-more { margin-top: 10px; }
@media (max-width: 640px) {
  .latest-table .l-pollster { display: none; }
  .latest-panel input[type=search] { min-width: 0; width: 100%; }
}
.latest-panel { min-width: 0; }
.latest-panel .table-scroll { overflow-x: auto; max-width: 100%; }
.latest-panel .button-group { flex-wrap: wrap; }
@media (max-width: 640px) {
  .latest-table { font-size: .78rem; }
  .latest-table .l-result { white-space: normal; }
  .latest-table .l-lead { white-space: normal; }
}

/* The home page's glance row: a tile per headline figure. */
.glance { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0 0 1.75rem; }
.glance-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 12px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--fg); transition: border-color .12s, transform .12s; }
.glance-tile:hover { border-color: var(--fg); transform: translateY(-1px); }
.glance-label { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.glance-tile b { font-size: 1.9rem; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.glance-note { font-size: .74rem; color: var(--sub-text); }
@media (max-width: 960px) { .glance { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } .glance-tile b { font-size: 1.5rem; } }
.home-latest { padding-top: 8px; }
.picker-news { display: inline-flex; align-items: center; gap: 2px; margin-left: 10px; font-size: .74rem; color: var(--sub-text); white-space: nowrap; }
.picker-news .new-dot { margin: 0 4px 0 0; }
/* The range in force when it was picked under Adjust. */
.range-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.range-now { font-size: .74rem; font-weight: 700; padding: 5px 10px; border-radius: 6px; background: var(--fg); color: var(--card-bg); white-space: nowrap; }
.range-now[hidden] { display: none; }
.map-tip .seat-detail { font-size: .76rem; font-weight: 700; min-height: 1.1em; margin: 2px 0 4px; }
.map-tip .mt-seats .seat { cursor: pointer; }

/* Flips: pale diagonal stripes over a shape's own colour (UI.flipPattern). */
.flip-hatch { pointer-events: none; stroke: none; }
.flip-stripe { fill: var(--card-bg); fill-opacity: .72; }
.map-legend .sw.flip { background: repeating-linear-gradient(45deg, var(--card-bg) 0 2px, var(--faint) 2px 5px); }
/* The flip pill: the gaining party's colour, striped like the map. */
.map-tip .mt-badge.mt-flip { color: #fff; background: repeating-linear-gradient(45deg, var(--c) 0 4px, color-mix(in srgb, var(--c) 72%, #fff) 4px 7px); }
.map-tip .mt-badge.mt-flip + .mt-badge { margin-left: 0; }

/* A House district's page: where it is in its state. */
.locator-panel .locator { max-height: 340px; }
.locator .locator-outline { fill: none; stroke: var(--fg); stroke-width: 1.2; vector-effect: non-scaling-stroke; pointer-events: none; }
.locator path.dm-d { cursor: default; }

/* The 2026 forecast replay (pages/replay26.js). */
.replay-slider { width: 100%; margin: 6px 0 8px; accent-color: var(--fg); }
.replay-when { font-size: .84rem; color: var(--sub-text); margin-bottom: 10px; }
.replay-when b { color: var(--fg); }
.replay-table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.replay-table th { text-align: left; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); padding: 0 12px 6px 0; border-bottom: 1px solid var(--border); }
.replay-table td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--grid, var(--border)); }
.replay-table .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }
.replay-table tr.replay-result td { font-weight: 800; }
.date-replay-panel { padding: 14px 18px; }
.date-bar-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 6px; }
.date-bar-head h3 { margin: 0; font-size: .95rem; }
.date-bar-status { margin-bottom: 0; }
.date-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.date-bar-row .replay-slider { flex: 1 1 auto; margin: 0; }
.date-play-btn { min-width: 78px; white-space: nowrap; }

/* 2006-2026 accuracy calibration & reversion plots (pages/cycles.js). */
.cycle-svg-wrap { position: relative; width: 100%; }
.cycle-svg { display: block; width: 100%; height: auto; max-height: 360px; font-family: inherit; }

/* Methodology page (pages/methodology.js). */
.meth-toc { padding: 12px 16px; margin-bottom: 1.5rem; }
.meth-toc-lbl { font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sub-text); margin-bottom: 8px; }
.meth-toc-links { display: flex; flex-wrap: wrap; gap: 6px; }
.meth-sec { scroll-margin-top: 20px; }
.meth-card p { margin: 0 0 .65rem; font-size: .92rem; line-height: 1.55; color: var(--fg); }
.meth-card p:last-child { margin-bottom: 0; }
.meth-formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; padding: 9px 12px; margin: 8px 0 10px;
  border-radius: 6px; background: var(--soft); border: 1px solid var(--border);
  color: var(--fg); overflow-x: auto;
}
