/* Layout: a plain newspaper page. One clear answer at the top, a big map in the middle, details on tap. */
:root {
  --bg: #ffffff;
  --bg-soft: #f4f5f7;
  --line: #dfe2e7;
  --ink: #15171c;
  --ink-2: #464b55;
  --ink-3: #6f7480;
  --focus: #1f5fd1;

  /* party colors, strongest to lightest */
  --d1: #1f5fd1; --d2: #5f8fe4; --d3: #b3c9f2;
  --r1: #cf3131; --r2: #e5736b; --r3: #f3b8b2;
  --i1: #7b4fc2; --i2: #a487d9; --i3: #d6c8ef;
  --toss: #d8c793;
  --none: #eceef1;
  --none-line: #ffffff;

  --font: "Libre Franklin", "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
  --radius: 10px;
  --maxw: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121418; --bg-soft: #1b1e24; --line: #2c3039; --ink: #eff1f5; --ink-2: #bfc4ce; --ink-3: #8e94a0; --focus: #7aa2f0;
    --d1: #4d84ef; --d2: #6f9be9; --d3: #3a5487; --r1: #ec5a55; --r2: #e5807a; --r3: #8a4744;
    --i1: #9a72dd; --i2: #b39be0; --i3: #554373; --toss: #b3a26c; --none: #22252c; --none-line: #121418;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121418; --bg-soft: #1b1e24; --line: #2c3039; --ink: #eff1f5; --ink-2: #bfc4ce; --ink-3: #8e94a0; --focus: #7aa2f0;
  --d1: #4d84ef; --d2: #6f9be9; --d3: #3a5487; --r1: #ec5a55; --r2: #e5807a; --r3: #8a4744;
  --i1: #9a72dd; --i2: #b39be0; --i3: #554373; --toss: #b3a26c; --none: #22252c; --none-line: #121418;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--font); }
img { max-width: 100%; }
a { color: inherit; }
button, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: max(16px, 4vw); }
@media (min-width: 1200px) { .wrap { padding-inline: 40px; } }
.num { font-variant-numeric: tabular-nums; }
.dem { color: var(--d1); } .rep { color: var(--r1); } .ind { color: var(--i1); }

/* header */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; }
.site-name { font-weight: 800; font-size: 18px; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.flag { width: 22px; height: 16px; border-radius: 2px; background: linear-gradient(90deg, var(--d1) 50%, var(--r1) 50%); }
.site-nav { display: flex; gap: 22px; font-size: 16px; }
.site-nav a { text-decoration: none; color: var(--ink-2); }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 640px) { .site-nav { display: none; } }

/* intro */
.intro { padding-block: 36px 8px; }
h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.08; font-weight: 800; letter-spacing: -0.015em; margin: 0 0 10px; text-wrap: balance; }
.lede { font-size: 19px; color: var(--ink-2); margin: 0 0 26px; max-width: 60ch; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px 20px; background: var(--bg); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card-title { font-size: 17px; font-weight: 700; color: var(--ink-2); margin: 0; }
.card-say { font-size: clamp(22px, 2.6vw, 27px); font-weight: 800; line-height: 1.2; margin: 6px 0 14px; text-wrap: balance; }
.chance { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.chance .big { font-size: clamp(56px, 7vw, 76px); font-weight: 900; line-height: .9; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.chance .big small { font-size: .45em; font-weight: 800; letter-spacing: 0; }
.chance .lbl { font-size: 16px; color: var(--ink-2); margin-top: 6px; }
.chance .other { text-align: right; }
.chance .other .mid { font-size: 30px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.card-foot { font-size: 15px; color: var(--ink-3); margin: 14px 0 0; }
.updated { font-size: 15px; color: var(--ink-3); margin: 16px 0 0; }

/* seat bar (cards + build mode) */
.seatbar { position: relative; padding-top: 26px; }
.seatbar .bar { display: flex; height: 26px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--bg-soft); }
.seatbar .bar > div { min-width: 0; transition: flex .45s ease; }
.seatbar .mark { position: absolute; top: 4px; bottom: 30px; width: 2px; background: var(--ink); transform: translateX(-1px); }
.seatbar .mark span { position: absolute; top: -2px; left: 50%; transform: translate(-50%, 0); white-space: nowrap; font-size: 13px; font-weight: 700; background: var(--bg); padding: 0 6px; line-height: 1; }
.seatbar .keys { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 15px; margin-top: 8px; }
.seatbar .keys b { font-weight: 800; font-variant-numeric: tabular-nums; }

/* sections */
.block { padding-block: 56px 0; scroll-margin-top: 64px; }
h2 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.15; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.01em; text-wrap: balance; }
h3 { font-size: 20px; font-weight: 800; margin: 0 0 10px; }
.section-note { color: var(--ink-2); margin: 0 0 18px; max-width: 64ch; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

/* buttons */
.btn { border: 1px solid var(--ink-3); background: var(--bg); border-radius: 8px; padding: 10px 16px; font-size: 16px; font-weight: 600; cursor: pointer; min-height: 44px; }
.btn:hover { border-color: var(--ink); background: var(--bg-soft); }
.btn-dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-dark:hover { background: var(--ink-2); border-color: var(--ink-2); }
.tabs { display: inline-flex; border: 1px solid var(--ink-3); border-radius: 8px; overflow: hidden; }
.tabs button { border: 0; background: var(--bg); padding: 10px 18px; font-size: 16px; font-weight: 700; cursor: pointer; min-height: 44px; color: var(--ink-2); }
.tabs button + button { border-left: 1px solid var(--ink-3); }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* map */
.map-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 16px 0 14px; }
.picker select { min-height: 44px; border: 1px solid var(--ink-3); border-radius: 8px; padding: 8px 12px; background: var(--bg); font-size: 16px; max-width: 100%; }
.build-btn[aria-pressed="true"] { background: #ffe9a8; border-color: #b8901c; color: #3d2f05; }
.map-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--bg); }
.map { width: 100%; height: auto; display: block; }
.map .st { stroke: var(--none-line); stroke-width: 1.2; cursor: pointer; }
.map .st.none { cursor: default; }
.map .st:not(.none):hover, .map .st:focus-visible { stroke: var(--ink); stroke-width: 2.2; outline: none; }
.map .st.sel { stroke: var(--ink); stroke-width: 3; }
.map .st.picked { stroke: #ffd24a; stroke-width: 3; }
.map .lbl { font: 700 12px var(--font); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 15px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 16px; height: 16px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.08); }
.small-states { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; font-size: 15px; color: var(--ink-2); }
.small-states button { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: 15px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 38px; }
.small-states button i { width: 12px; height: 12px; border-radius: 3px; }
.small-states button:hover { border-color: var(--ink); }
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 15px; box-shadow: 0 6px 24px rgba(0,0,0,.14); max-width: 280px; transform: translate(-50%, calc(-100% - 14px)); }
.tip b { font-weight: 800; }
.tip .row { display: flex; justify-content: space-between; gap: 16px; }
.tip .hint { color: var(--ink-3); font-size: 13px; margin-top: 4px; }

/* build-your-own */
.build { border: 2px solid #e2b93b; background: #fff8e1; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; color: #2a2208; }
.build-how { margin: 0 0 10px; font-weight: 600; }
.build-result .result-say { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.build-result .result-sub { margin: 0 0 6px; color: #5c5132; font-size: 15px; }
.build .seatbar .mark span { background: #fff8e1; }
.build .seatbar .bar { background: #efe3bb; }
.build-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.build .btn { background: #fffdf5; border-color: #8a7838; color: #2a2208; }
.build .btn-dark { background: #2a2208; color: #fff8e1; border-color: #2a2208; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .build { background: #2b2614; border-color: #8a7230; color: #f5ecd0; }
  :root:not([data-theme="light"]) .build-result .result-sub { color: #cdbf95; }
  :root:not([data-theme="light"]) .build .btn { background: #1f1b0e; color: #f5ecd0; border-color: #8a7230; }
  :root:not([data-theme="light"]) .build .btn-dark { background: #f5ecd0; color: #1f1b0e; }
  :root:not([data-theme="light"]) .build .seatbar .mark span { background: #2b2614; }
  :root:not([data-theme="light"]) .build .seatbar .bar { background: #3a3420; }
}
:root[data-theme="dark"] .build { background: #2b2614; border-color: #8a7230; color: #f5ecd0; }
:root[data-theme="dark"] .build-result .result-sub { color: #cdbf95; }
:root[data-theme="dark"] .build .btn { background: #1f1b0e; color: #f5ecd0; border-color: #8a7230; }
:root[data-theme="dark"] .build .btn-dark { background: #f5ecd0; color: #1f1b0e; }
:root[data-theme="dark"] .build .seatbar .mark span { background: #2b2614; }
:root[data-theme="dark"] .build .seatbar .bar { background: #3a3420; }

/* closest races */
.race-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.race-list button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.race-list button:hover { border-color: var(--ink-3); background: var(--bg-soft); }
.race-list button:focus-visible { outline: 3px solid var(--focus); }
.race-list .where { font-weight: 800; font-size: 17px; }
.race-list .who { color: var(--ink-2); font-size: 15px; grid-column: 1; }
.race-list .odds { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.race-list .odds small { display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.race-list .split { grid-column: 1 / -1; height: 8px; border-radius: 99px; overflow: hidden; display: flex; background: var(--bg-soft); }

/* charts */
.trend { margin: 0; }
.trend figcaption { font-size: 17px; color: var(--ink-2); margin-bottom: 8px; }
.chart-box { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart text { font: 13px var(--font); fill: var(--ink-3); }
.chart-tip { position: absolute; pointer-events: none; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 14px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: 0 4px 16px rgba(0,0,0,.12); }

/* how it works */
.sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 820px) { .sources { grid-template-columns: 1fr; } }
.source { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.source h3 { font-size: 18px; margin: 0 0 4px; display: flex; justify-content: space-between; gap: 10px; }
.source h3 span { color: var(--ink-3); font-weight: 600; font-size: 15px; }
.source p { margin: 0; color: var(--ink-2); font-size: 15px; }
.source .vals { margin-top: 10px; font-size: 15px; display: grid; gap: 2px; }
.math { margin: 18px 0 8px; display: grid; gap: 8px; font-size: 16px; }
.math p { margin: 0; padding: 12px 14px; background: var(--bg-soft); border-radius: 8px; }
.math b { font-weight: 800; }
.more { border-top: 1px solid var(--line); padding: 4px 0; }
.more:last-of-type { border-bottom: 1px solid var(--line); }
.more summary { cursor: pointer; font-weight: 800; font-size: 19px; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "+"; font-size: 26px; font-weight: 400; line-height: 1; color: var(--ink-3); }
.more[open] summary::after { content: "−"; }
.more > :not(summary) { margin-bottom: 18px; }
.steps { padding-left: 22px; margin: 0; display: grid; gap: 8px; color: var(--ink-2); max-width: 70ch; }
.fine { padding-left: 20px; margin: 0; color: var(--ink-2); display: grid; gap: 6px; font-size: 15px; }
.table-scroll { overflow-x: auto; }
.simple-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.simple-table th { text-align: left; font-weight: 700; color: var(--ink-3); padding: 8px 10px 8px 0; border-bottom: 2px solid var(--line); white-space: nowrap; }
.simple-table td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.simple-table .r { text-align: right; }
.simple-table a { color: inherit; }
.stars { color: #b8860b; letter-spacing: 1px; white-space: nowrap; }
.site-foot { margin-top: 64px; border-top: 1px solid var(--line); padding-block: 24px 40px; color: var(--ink-3); font-size: 14px; }

/* state panel */
.scrim { position: fixed; inset: 0; background: rgba(10, 12, 16, .45); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.panel { position: fixed; z-index: 80; top: 0; right: 0; bottom: 0; width: min(600px, 100vw); background: var(--bg); box-shadow: -10px 0 40px rgba(0,0,0,.2); transform: translateX(105%); transition: transform .28s ease; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.panel.open { transform: none; }
@media (prefers-reduced-motion: reduce) { .panel, .scrim, .seatbar .bar > div { transition: none; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 28px; }
.panel-body { overflow-y: auto; padding: 20px 20px 48px; overscroll-behavior: contain; }
.panel-body section + section { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.panel-body h3 { font-size: 22px; }
.status { display: inline-block; font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 99px; margin-bottom: 14px; }
.faceoff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.person { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 10px; border-radius: var(--radius); background: var(--bg-soft); min-width: 0; }
.photo { width: 104px; height: 104px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: #fff; flex-shrink: 0; border: 4px solid var(--ring, var(--line)); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.D { --ring: var(--d1); background: var(--d2); } .photo.R { --ring: var(--r1); background: var(--r2); } .photo.I, .photo.O { --ring: var(--i1); background: var(--i2); }
.photo.sm { width: 46px; height: 46px; font-size: 16px; border-width: 3px; }
.person .name { font-size: 18px; font-weight: 800; line-height: 1.2; }
.person .meta { font-size: 14px; color: var(--ink-2); }
.person .pct { font-size: 38px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.person .pct small { display: block; font-size: 14px; font-weight: 600; color: var(--ink-3); margin-top: 4px; }
.say { font-size: 18px; margin: 16px 0 0; }
.facts { margin-top: 18px; border-top: 1px solid var(--line); }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.facts .k { color: var(--ink-2); }
.facts .v { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.polls { list-style: none; margin: 10px 0 0; padding: 0; }
.polls li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; }
.polls .pollster { font-weight: 700; }
.polls .pollster a { text-decoration: none; }
.polls .pollster a:hover { text-decoration: underline; }
.polls .res { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.polls .sub { grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tag { font-weight: 700; }
.tag.paidR { color: var(--r1); } .tag.paidD { color: var(--d1); }
.districts { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.district { border: 1px solid var(--line); border-radius: var(--radius); }
.district.hl { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.district > button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; }
.district > button:focus-visible { outline: 3px solid var(--focus); }
.district .dn { font-weight: 800; }
.district .who { font-size: 15px; color: var(--ink-2); grid-column: 1; }
.district .odds { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.district .odds small { display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.district .detail { padding: 0 14px 14px; }
.district .faceoff .photo { width: 76px; height: 76px; font-size: 26px; }
.district .faceoff .pct { font-size: 30px; }
.link-row { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 16px; }
.link-row a { font-size: 15px; font-weight: 600; }
.muted { color: var(--ink-3); }
@media (max-width: 480px) {
  body { font-size: 16px; }
  .card { padding: 18px 16px; }
  .photo { width: 84px; height: 84px; font-size: 28px; }
  .person .pct { font-size: 32px; }
  .panel-body { padding-inline: 16px; }
}
.split i { display: block; height: 100%; }
.seatbar .mark { top: 20px; bottom: auto; height: 38px; }
.seatbar .mark span { top: -18px; }
@media (max-width: 480px) {
  .legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); font-size: 14px; gap: 6px 12px; }
  .seatbar .keys { font-size: 14px; }
}

/* ---------- search ---------- */
.search { position: relative; margin-top: 14px; max-width: 720px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input { width: 100%; min-height: 54px; border: 2px solid var(--ink-3); border-radius: 10px; padding: 12px 16px 12px 44px; font: 18px var(--font); background: var(--bg); color: var(--ink); }
.search input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.search-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.16); max-height: min(420px, 60vh); overflow-y: auto; }
.search-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.search-list li[aria-selected="true"], .search-list li:hover { background: var(--bg-soft); }
.search-list .s-label { font-weight: 700; font-size: 17px; }
.search-list .s-sub { grid-column: 1; font-size: 14px; color: var(--ink-2); }
.search-list .s-type { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.search-list .s-odds { grid-row: 1 / span 2; grid-column: 2; align-self: center; text-align: right; font-weight: 800; font-size: 15px; }
.search-list .s-empty { color: var(--ink-2); cursor: default; }
.search-hint { margin: 8px 0 0; font-size: 15px; color: var(--ink-3); }
.search-hint .eg { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--ink-2); text-decoration: underline; cursor: pointer; }
.region-card { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--bg-soft); }
.region-card h3 { margin: 0 0 4px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.region-card p { margin: 0 0 10px; color: var(--ink-2); }
.region-card .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.region-card .chips button { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 6px 10px; font: 600 15px var(--font); cursor: pointer; }
.region-card .chips button:hover { border-color: var(--ink); }
.region-card .chips b { font-weight: 800; }

/* ---------- rating bar (like a seat tally) ---------- */
.rating-bar { margin: 4px 0 14px; }
.rating-bar .segs { display: flex; height: 34px; border-radius: 6px; overflow: hidden; }
.rating-bar .segs > div { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.rating-bar .under { position: relative; height: 28px; }
.rating-bar .tri { position: absolute; top: 2px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-size: 13px; font-weight: 700; white-space: nowrap; }
.rating-bar .tri::before { content: ""; border: 7px solid transparent; border-bottom-color: var(--ink); border-top: 0; margin-bottom: 2px; }
.rating-bar .ends { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; margin-bottom: 6px; }

/* ---------- zoomable map ---------- */
.map-box { position: relative; }
.zoom { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 8px; }
.zbtn { width: 44px; padding: 0; font-size: 22px; line-height: 1; }
.map-frame { position: relative; overflow: hidden; border-radius: 6px; touch-action: pan-y; }
.map-frame.zoomed { touch-action: none; cursor: grab; }
.map-frame.dragging { cursor: grabbing; }
.map-note { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(21, 23, 28, .85); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 16px; font-weight: 600; pointer-events: none; text-align: center; }
.map .dist { stroke: var(--bg); stroke-width: .6; vector-effect: non-scaling-stroke; cursor: pointer; }
.map .dist:hover, .map .dist:focus-visible { stroke: var(--ink); stroke-width: 2; outline: none; }
.map .dist.sel { stroke: var(--ink); stroke-width: 3; }
.map .dist.picked { stroke: #ffd24a; stroke-width: 2.4; }
.map .st { vector-effect: non-scaling-stroke; }
.map .dim { opacity: .28; }
.map .borders { fill: none; stroke: var(--bg); stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.map .nation { fill: none; stroke: var(--ink-3); stroke-width: .8; vector-effect: non-scaling-stroke; pointer-events: none; opacity: .5; }
.map .dlbl { font-family: var(--font); font-weight: 800; text-anchor: middle; dominant-baseline: central; pointer-events: none; paint-order: stroke; stroke-linejoin: round; }

/* polls vs bettors */
.gap-list .gap-bars { grid-column: 1 / -1; display: grid; grid-template-columns: 76px minmax(0, 1fr) 44px; gap: 6px 10px; align-items: center; font-size: 14px; margin-top: 4px; }
.gap-list .gap-bars .track { height: 10px; border-radius: 99px; background: var(--bg-soft); position: relative; overflow: hidden; }
.gap-list .gap-bars .track i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; }
.gap-list .gap-bars .track::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--ink-3); }
.gap-list .gap-bars b { text-align: right; font-variant-numeric: tabular-nums; }
.gap-list .gap-say { grid-column: 1 / -1; font-size: 15px; color: var(--ink-2); margin-top: 4px; }

/* map source switch */
.src-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 8px; }
.src-label { font-weight: 700; color: var(--ink-2); }
.src-say { margin: 0 0 14px; font-size: 16px; }
@media (max-width: 480px) { .src-row .tabs button { padding: 10px 12px; font-size: 15px; } }
