/* KLAL Media · Election Night 2026 · "Your community first", Decision Desk style */
@font-face { font-family: "SG"; src: url(../klal-media/fonts/SpaceGrotesk-var.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "FT"; src: url(../klal-media/fonts/Figtree-var.woff2) format("woff2"); font-weight: 300 800; font-display: swap; }

:root {
  --bg: #0b1b36; --card: #13264a; --card2: #1a3059; --line: #1f3358; --track: #2a3a5c;
  --tx: #f4f6fa; --mut: #a9b4c8; --mut2: #c7cfdd;
  --dem: #1f5fbf; --dem-t: #8fb6ff; --dem-l: #6f9be0;
  --rep: #c8102e; --rep-t: #ff9a9d; --rep-l: #e37b86;
  --oth: #8a94a8; --oth-t: #c7cfdd;
  --lime: #cdde61; --live: #d2232a;
  --fd: "SG", "Space Grotesk", system-ui, sans-serif; --fb: "FT", Figtree, system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1); --ease-o: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 400 16px/1.45 var(--fb); -webkit-font-smoothing: antialiased; }
a { color: var(--lime); }
a:hover { color: #e6f09b; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--fd); margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1440px; margin: 0 auto; padding-inline: clamp(16px, 2.4vw, 32px); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* demo banner */
.demo { background: var(--lime); color: var(--bg); font: 700 13px/1 var(--fb); text-align: center; padding: 8px 16px; }

/* ---------- header ---------- */
.hd { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); transition: box-shadow 0.3s; }
.is-scrolled .hd { box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.7); }
.hd__in { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding-block: 14px; }
.hd__logo { display: inline-flex; border-radius: 10px; }
.hd__logo img { width: 40px; height: 40px; display: block; }
.hd__t { display: flex; flex-direction: column; gap: 1px; }
.hd__t b { font: 700 20px/1.1 var(--fd); }
.hd__t span { font-size: 13px; color: var(--mut); }
.pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 7px 12px; font: 700 12px/1 var(--fb); letter-spacing: 0.08em; text-transform: uppercase; background: var(--card2); color: var(--tx); }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.pill.is-live { background: var(--live); color: #fff; }
.pill.is-live i { background: #fff; animation: ping 1.6s ease-out infinite; }
.pill.is-demo { background: var(--lime); color: var(--bg); }
.pill.is-demo i { background: var(--bg); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); } 100% { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); } }
.hd__upd { font-size: 14px; color: var(--mut); border-radius: 6px; padding: 2px 4px; }
.hd__sp { flex: 1 1 10px; }
.hd__nat { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; color: var(--mut2); }
.hd__nat b { font: 700 17px/1 var(--fd); }
.d-t { color: var(--dem-t); } .r-t { color: var(--rep-t); } .o-t { color: var(--oth-t); }

/* ---------- just called / countdown strip ---------- */
.called { background: var(--card); border-bottom: 1px solid var(--line); }
.called__in { display: flex; align-items: stretch; min-height: 48px; }
.called__k { display: inline-flex; align-items: center; background: var(--live); color: #fff; font: 700 12px/1.1 var(--fb); letter-spacing: 0.1em; text-transform: uppercase; padding: 10px 16px; flex: none; }
.called__list { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; }
.called__i { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; font-size: 15px; border-right: 1px solid var(--line); }
.called__i:last-child { border-right: 0; }
.called__i.is-new { animation: slidein 0.7s var(--ease) both; }
@keyframes slidein { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.clock { font: 700 22px/1 var(--fd); font-variant-numeric: tabular-nums; padding: 10px 18px; letter-spacing: 0.02em; display: inline-flex; align-items: baseline; gap: 4px; }
.clock small { font: 500 12px/1 var(--fb); color: var(--mut); margin-right: 8px; }
.clock__note { font-size: 14px; color: var(--mut); padding: 10px 18px 10px 0; align-self: center; }

/* ---------- layout ---------- */
main.wrap { padding-block: 34px 64px; display: flex; flex-direction: column; gap: 44px; }
.card { background: var(--card); border-radius: 16px; padding: 20px; }
.card--light { background: var(--tx); color: var(--bg); }
.sec-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; }
.sec-h h1 { font: 700 clamp(32px, 4.4vw, 48px)/1.05 var(--fd); letter-spacing: -0.02em; }
.sec-h h2 { font: 700 clamp(24px, 2.6vw, 30px)/1.1 var(--fd); }
.sec-h span, .sec-h p { font-size: 14px; color: var(--mut); margin: 0; }

/* ---------- community tiles ---------- */
.comm { display: flex; flex-direction: column; gap: 16px; }
.allbtn { border: 1px solid #2f4570; background: transparent; border-radius: 999px; padding: 10px 16px; min-height: 44px; font-weight: 600; font-size: 14px; cursor: pointer; transition: background 0.2s, color 0.2s, transform 0.14s var(--ease-o); }
.allbtn[aria-pressed="true"] { background: var(--tx); color: var(--bg); border-color: var(--tx); }
.allbtn:active { transform: scale(0.96); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 14px; }
.tile { text-align: left; border: 0; cursor: pointer; background: var(--card); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; outline: 3px solid transparent; outline-offset: -3px; transition: transform 0.3s var(--ease-o), outline-color 0.25s, background 0.25s, box-shadow 0.3s var(--ease-o); }
.tile:hover { transform: translateY(-3px); background: var(--card2); box-shadow: 0 18px 36px -24px rgba(0, 0, 0, 0.7); }
.tile:active { transform: scale(0.985); }
.tile[aria-pressed="true"] { outline-color: var(--lime); }
.tile__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile__logo { background: #fff; border-radius: 8px; padding: 6px 10px; display: inline-flex; }
.tile__logo img { height: 22px; width: auto; display: block; }
.tile__place { font-size: 13px; color: var(--mut); text-align: right; }
.tile__race { font: 600 14px/1.2 var(--fb); color: var(--mut2); }
.tile__lead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tile__lead b { font: 700 20px/1.15 var(--fd); }
.tile__pct { font: 700 26px/1 var(--fd); font-variant-numeric: tabular-nums; }
.tile__note { font-size: 13px; color: var(--mut); }

/* split bar: Dem from the left, Rep from the right */
.sbar { position: relative; height: 8px; border-radius: 999px; background: var(--track); display: flex; overflow: hidden; }
.sbar .d { background: var(--dem); } .sbar .r { background: var(--rep); } .sbar .o { background: var(--oth); }
.sbar span { display: block; height: 100%; transition: width 1.1s var(--ease); }
.sbar .gap { flex: 1; }
.sbar--mid::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--tx); }

/* ---------- races ---------- */
.split { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.races { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.rail { flex: 1 1 320px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 96px; }
.group { display: flex; flex-direction: column; gap: 12px; }
.group__h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.group__h h2 { font: 700 clamp(22px, 2.4vw, 30px)/1.1 var(--fd); display: flex; align-items: center; gap: 12px; }
.group__h h2 img { height: 22px; background: #fff; border-radius: 6px; padding: 4px 8px; box-sizing: content-box; }
.group__h span { font-size: 14px; color: var(--mut); }
.race { position: relative; background: var(--card); border-radius: 14px; padding: 18px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px 24px; align-items: center; transition: transform 0.3s var(--ease-o), box-shadow 0.3s var(--ease-o), background 0.25s; }
@media (hover: hover) { .race:hover { background: var(--card2); } }
.race__h { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.race__h h3 { font: 600 18px/1.2 var(--fd); }
.race__rep { font-size: 13px; color: var(--mut); }
.flag { font-weight: 700; font-size: 12px; padding: 5px 9px; border-radius: 999px; margin-top: 4px; background: var(--track); color: var(--mut2); }
.flag--called { background: var(--lime); color: var(--bg); }
.flag--close { background: #fff3c4; color: #5a4300; }
.flag--wait { background: transparent; border: 1px solid #2f4570; color: var(--mut); }
.race__c { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cand { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; position: relative; }
.cand__n { font-weight: 600; font-size: 15px; min-width: 0; }
.cand__n i { font-style: normal; font-weight: 700; margin-left: 4px; }
.cand__n em { font-style: normal; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--lime); color: var(--bg); font-size: 12px; font-weight: 800; margin-left: 6px; vertical-align: 1px; }
.cand__p { font: 700 18px/1 var(--fd); text-align: right; font-variant-numeric: tabular-nums; min-width: 64px; }
.cand__bar { height: 7px; border-radius: 999px; background: var(--track); display: block; overflow: hidden; }
.cand__bar b { display: block; height: 100%; border-radius: 999px; background: var(--oth); transition: width 1.1s var(--ease); }
.cand__v { font-size: 12px; color: var(--mut); text-align: right; font-variant-numeric: tabular-nums; }
.p-D .cand__n i { color: var(--dem-t); } .p-D .cand__bar b { background: var(--dem); }
.p-R .cand__n i { color: var(--rep-t); } .p-R .cand__bar b { background: var(--rep); }
.p-O .cand__n i { color: var(--oth-t); }
.cand--pre .cand__p { color: var(--mut); }
.race__whole { font-size: 13px; color: var(--mut); }
.unc { background: var(--card); border-radius: 14px; padding: 14px 20px; font-size: 14px; color: var(--mut2); }
.unc b { color: var(--tx); font-weight: 600; }
.empty { background: var(--card); border-radius: 14px; padding: 22px; color: var(--mut2); }

/* rail: balance of power + governor */
.rail h2 { font: 600 19px/1.2 var(--fd); }
.bop { display: flex; flex-direction: column; gap: 18px; }
.bop__h { display: flex; justify-content: space-between; align-items: baseline; }
.bop__h span { font-size: 13px; color: var(--mut); }
.bop__row { display: flex; flex-direction: column; gap: 8px; }
.bop__lab { display: flex; justify-content: space-between; font-size: 14px; }
.bop__lab span { color: var(--mut); }
.bop .sbar { height: 14px; }
.bop__nums { display: flex; justify-content: space-between; align-items: baseline; font: 700 22px/1 var(--fd); font-variant-numeric: tabular-nums; }
.bop__nums small { font: 500 13px/1 var(--fb); color: var(--mut); }
.gov { display: flex; flex-direction: column; gap: 12px; }
.gov__row { display: flex; flex-direction: column; gap: 6px; }
.gov__row b { font-size: 14px; font-weight: 600; }
.gov .sbar { height: 12px; background: #dfe4ee; }
.gov__nums { display: flex; justify-content: space-between; font-size: 13px; }
.gov__wait { font-size: 13px; color: #4a5875; }

/* ---------- New York State ---------- */
.ny { display: flex; flex-direction: column; gap: 14px; }
.ny__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.ny__grid .race { grid-template-columns: 1fr; }
.cham { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Across America ---------- */
.usa { background: var(--card); border-radius: 20px; padding: clamp(18px, 2.4vw, 28px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 24px 32px; align-items: start; }
.usa__side { display: flex; flex-direction: column; gap: 14px; }
.usa__side h2 { font: 700 clamp(24px, 2.6vw, 30px)/1.1 var(--fd); }
.usa__side p { margin: 0; color: var(--mut2); max-width: 46ch; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { border: 1px solid #2f4570; background: transparent; border-radius: 999px; padding: 10px 16px; min-height: 44px; font-weight: 600; font-size: 14px; cursor: pointer; transition: background 0.2s, color 0.2s, transform 0.14s var(--ease-o); }
.tabs button[aria-pressed="true"] { background: var(--tx); color: var(--bg); border-color: var(--tx); }
.tabs button:active { transform: scale(0.96); }
.usa__count { font-size: 14px; color: var(--mut); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--mut); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.k-wD { background: var(--dem); } .k-lD { background: var(--dem-l); } .k-wR { background: var(--rep); } .k-lR { background: var(--rep-l); } .k-O { background: var(--oth); } .k-pend { background: #3d4f75; } .k-none { background: var(--track); }
.map { width: 100%; height: auto; display: block; }
.map path { stroke: var(--card); stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; fill: var(--track); cursor: pointer; transition: fill 0.7s ease, filter 0.2s, opacity 0.6s ease; }
.map path:hover, .map path:focus-visible { filter: brightness(1.18); outline: none; }
.map path.s-none { cursor: default; }
.map path.s-pend { fill: #3d4f75; }
.map path.s-wD { fill: var(--dem); } .map path.s-lD { fill: var(--dem-l); }
.map path.s-wR { fill: var(--rep); } .map path.s-lR { fill: var(--rep-l); }
.map path.s-wO, .map path.s-lO { fill: var(--oth); } .map path.s-lT { fill: #8c7fb0; }
.map path.sel { stroke: var(--lime); stroke-width: 3; }
.map .ny-ring { fill: none; stroke: var(--lime); stroke-width: 2.5; pointer-events: none; vector-effect: non-scaling-stroke; }
.map path.flip { animation: flip 1.4s var(--ease-o); }
@keyframes flip { 0% { filter: brightness(1.9) saturate(1.3); } 100% { filter: none; } }
.map.is-wave path { opacity: 0; }
.map.is-wave-in path { opacity: 1; transition-delay: var(--d, 0ms); }
.usa__det { grid-column: 1 / -1; }
.det { background: var(--card2); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; animation: rise 0.5s var(--ease) both; }
.det__h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.det__h h3 { font: 700 22px/1.1 var(--fd); }
.det__x { border: 1px solid #2f4570; background: transparent; border-radius: 999px; padding: 8px 14px; min-height: 40px; cursor: pointer; font-weight: 600; font-size: 14px; }
.det__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.det__r { background: var(--card); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.det__r h4 { margin: 0; font: 600 15px/1.2 var(--fd); }
.det__r .line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.det__r .line b { font-variant-numeric: tabular-nums; }
.det__r .note { font-size: 12px; color: var(--mut); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

footer.foot { color: var(--mut); font-size: 14px; border-top: 1px solid var(--line); padding-top: 20px; display: flex; flex-direction: column; gap: 6px; }
footer.foot p { margin: 0; }

/* ---------- live motion ---------- */
.m-pre { opacity: 0; transform: translateY(20px); }
.m-in { opacity: 1; transform: none; transition: opacity 0.55s var(--ease), transform 0.65s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }
.upd { animation: upd 1.6s var(--ease-o); }
@keyframes upd { 0% { box-shadow: 0 0 0 0 rgba(205, 222, 97, 0); } 18% { box-shadow: 0 0 0 4px rgba(205, 222, 97, 0.55); } 100% { box-shadow: 0 0 0 0 rgba(205, 222, 97, 0); } }
.just-called { animation: called 2.2s var(--ease-o); }
@keyframes called { 0% { box-shadow: 0 0 0 0 rgba(205, 222, 97, 0); } 15% { box-shadow: 0 0 0 6px rgba(205, 222, 97, 0.75); } 100% { box-shadow: 0 0 0 0 rgba(205, 222, 97, 0); } }
.just-called em { animation: stamp 0.8s var(--ease-o) both; }
@keyframes stamp { 0% { transform: scale(1.8) rotate(-12deg); opacity: 0; } 60% { transform: scale(0.92); opacity: 1; } 100% { transform: none; } }
.moving { transition: transform 0.75s var(--ease); }
.flash { animation: flashbg 0.9s var(--ease-o); }
@keyframes flashbg { 0% { background: rgba(205, 222, 97, 0.5); } 100% { background: transparent; } }
.tick { animation: tick 0.45s var(--ease-o); display: inline-block; }
@keyframes tick { 0% { transform: translateY(40%); opacity: 0; } 100% { transform: none; opacity: 1; } }

.refresh { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.refresh i { display: block; height: 100%; background: var(--lime); transform-origin: left center; transform: scaleX(0); }
.refresh.is-loading i { animation: load 1.2s ease-in-out infinite; }
@keyframes load { 0% { transform: scaleX(0); transform-origin: left; } 50% { transform: scaleX(1); transform-origin: left; } 50.01% { transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 70; display: flex; align-items: center; gap: 10px; padding: 11px 18px 11px 14px; border-radius: 999px; background: var(--tx); color: var(--bg); font: 600 14px/1.2 var(--fb); box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.6); transform: translate(-50%, 160%); opacity: 0; transition: transform 0.55s var(--ease), opacity 0.3s; pointer-events: none; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.toast i { width: 8px; height: 8px; border-radius: 50%; background: var(--rep); }

/* skeleton until the first results */
.skel { background: var(--card); border-radius: 14px; height: 120px; position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.06) 50%, transparent 80%); transform: translateX(-100%); animation: shimmer 1.3s ease-in-out infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- phone ---------- */
@media (max-width: 720px) {
  .hd__in { gap: 8px 12px; padding-block: 10px; }
  .hd__logo img { width: 34px; height: 34px; }
  .hd__t span, .hd__upd { display: none; }
  .hd__t b { font-size: 18px; }
  .hd__nat { order: 9; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-align: center; }
  .hd__nat > span { background: var(--card); border-radius: 10px; padding: 7px 4px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
  .called__k { padding: 8px 10px; font-size: 11px; }
  .called__i { padding: 8px 12px; font-size: 14px; }
  .clock { font-size: 18px; padding: 8px 12px; }
  .clock__note { display: none; }
  main.wrap { padding-block: 22px 48px; gap: 32px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 12px; gap: 6px; }
  .tile__place, .tile__note { display: none; }
  .tile__logo img { height: 18px; }
  .tile__lead b { font-size: 15px; }
  .tile__pct { font-size: 18px; }
  .rail { position: static; }
  .race { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .m-pre { opacity: 1; transform: none; }
  .map.is-wave path { opacity: 1; }
  html { scroll-behavior: auto; }
}
[hidden] { display: none !important; }
#groups { display: flex; flex-direction: column; gap: 36px; }
.group__list { display: flex; flex-direction: column; gap: 10px; }
.group__unc:empty { display: none; }
.group__unc .allbtn { align-self: flex-start; }
/* sponsors */
.spon { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mut); }
.spon a { display: inline-flex; border-radius: 8px; }
.spon img { display: block; height: 30px; width: auto; max-width: 140px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px 8px; box-sizing: content-box; }
.tile__spon:empty, .group__spon:empty { display: none; }
.tile__spon { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; }
.tile__spon .spon img { height: 22px; max-width: 110px; }
.group__spon { margin-left: auto; }
.group__h .group__s { order: 0; }
@media (max-width: 720px) {
  .tile__spon .spon { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 11px; }
  .tile__spon .spon img { height: 18px; max-width: 100%; }
  .group__spon { margin-left: 0; width: 100%; }
}

/* tiles: area selector only (logo, place, race count, sponsor) */
.tile { align-items: flex-start; justify-content: flex-start; gap: 8px; }
.tile__logo { padding: 8px 12px; }
.tile__logo img { height: 28px; }
.tile__place { text-align: left; font: 600 16px/1.2 var(--fd); color: var(--tx); }
.tile__note { font-size: 13px; color: var(--mut); }
.tile__spon { width: 100%; }
@media (max-width: 720px) {
  .tile__place, .tile__note { display: block; }
  .tile__place { font-size: 14px; }
  .tile__note { font-size: 12px; }
  .tile__logo { padding: 6px 10px; }
  .tile__logo img { height: 20px; max-width: 100%; }
}
/* sponsor logos made for dark backgrounds ("bg": "none" in sponsors.json) */
.spon img.is-bare { background: transparent; padding: 0; max-width: 190px; }
.tile__spon .spon img.is-bare { max-width: 150px; }

/* ---------- light theme (default); dark = html[data-theme="dark"] ---------- */
html:not([data-theme="dark"]) { --bg: #f3f5f9; --card: #ffffff; --card2: #f7f9fc; --line: #dde3ec; --track: #e4e9f1;
  --tx: #0b1b36; --mut: #5a6680; --mut2: #36435e;
  --dem: #1d5bc4; --dem-t: #1d5bc4; --dem-l: #8fb0e8; --rep: #c8102e; --rep-t: #c8102e; --rep-l: #eb9aa4;
  --oth: #8a94a8; --oth-t: #5a6680; --navy: #0b1b36; color-scheme: light; }
html:not([data-theme="dark"]) a { color: var(--dem); }
html:not([data-theme="dark"]) a:hover { color: #123f8c; }
html:not([data-theme="dark"]) :focus-visible { outline-color: var(--dem); }
/* navy brand band with a thin red / blue line */
html:not([data-theme="dark"]) .hd { --tx: #f4f6fa; --mut: #a9b4c8; --mut2: #c7cfdd; --dem-t: #8fb6ff; --rep-t: #ff9a9d; --card: #13264a; --card2: #1a3059; --line: #1f3358;
  background: var(--navy); color: var(--tx); border-bottom: 0; }
html:not([data-theme="dark"]) .hd::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: linear-gradient(90deg, var(--rep) 0 50%, var(--dem) 50% 100%); }
html:not([data-theme="dark"]) .is-scrolled .hd { box-shadow: 0 8px 24px -16px rgba(11, 27, 54, 0.5); }
html:not([data-theme="dark"]) .called { background: var(--card); border-bottom: 1px solid var(--line); margin-top: 3px; }
/* white cards with a hairline border */
html:not([data-theme="dark"]) .card, html:not([data-theme="dark"]) .tile, html:not([data-theme="dark"]) .race, html:not([data-theme="dark"]) .unc, html:not([data-theme="dark"]) .empty, html:not([data-theme="dark"]) .usa, html:not([data-theme="dark"]) .skel { border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(11, 27, 54, 0.04); }
html:not([data-theme="dark"]) .tile { outline-offset: -2px; }
html:not([data-theme="dark"]) .tile[aria-pressed="true"] { outline-color: var(--navy); }
html:not([data-theme="dark"]) .tile:hover { box-shadow: 0 14px 30px -20px rgba(11, 27, 54, 0.35); }
html:not([data-theme="dark"]) .tile__logo, html:not([data-theme="dark"]) .group__h h2 img, html:not([data-theme="dark"]) .spon img { box-shadow: inset 0 0 0 1px var(--line); }
html:not([data-theme="dark"]) .spon img.is-bare { background: var(--navy); padding: 4px 10px; box-shadow: none; }
html:not([data-theme="dark"]) .allbtn, html:not([data-theme="dark"]) .tabs button, html:not([data-theme="dark"]) .det__x { border-color: #c5cedc; }
html:not([data-theme="dark"]) .flag--called { background: var(--navy); color: #fff; }
html:not([data-theme="dark"]) .flag--called::before { content: "✓ "; }
html:not([data-theme="dark"]) .flag--wait { border-color: #c5cedc; }
html:not([data-theme="dark"]) .flag--close { background: #fff1b8; color: #5a4300; }
html:not([data-theme="dark"]) .cand__n em { background: var(--navy); color: #fff; }
html:not([data-theme="dark"]) .card--light { background: var(--card); color: var(--tx); }
html:not([data-theme="dark"]) .gov .sbar { background: var(--track); }
html:not([data-theme="dark"]) .gov__wait { color: var(--mut); }
html:not([data-theme="dark"]) .usa__det .det { background: var(--card2); border: 1px solid var(--line); }
html:not([data-theme="dark"]) .det__r { border: 1px solid var(--line); }
html:not([data-theme="dark"]) .map path.s-pend, html:not([data-theme="dark"]) .k-pend { fill: #b4c0d4; background: #b4c0d4; }
html:not([data-theme="dark"]) .map path.sel { stroke: var(--navy); }
html:not([data-theme="dark"]) .map .ny-ring { stroke: var(--navy); }
html:not([data-theme="dark"]) .skel::after { background: linear-gradient(100deg, transparent 20%, rgba(11, 27, 54, 0.05) 50%, transparent 80%); }
@keyframes upd-l { 0% { box-shadow: 0 0 0 0 rgba(29, 91, 196, 0); } 18% { box-shadow: 0 0 0 4px rgba(29, 91, 196, 0.35); } 100% { box-shadow: 0 0 0 0 rgba(29, 91, 196, 0); } }
@keyframes called-l { 0% { box-shadow: 0 0 0 0 rgba(11, 27, 54, 0); } 15% { box-shadow: 0 0 0 6px rgba(11, 27, 54, 0.35); } 100% { box-shadow: 0 0 0 0 rgba(11, 27, 54, 0); } }
html:not([data-theme="dark"]) .upd { animation-name: upd-l; }
html:not([data-theme="dark"]) .just-called { animation-name: called-l; }
html:not([data-theme="dark"]) .flash { animation: none; }
/* theme switch */
.themebtn { border: 1px solid #2f4570; background: transparent; color: inherit; border-radius: 999px; padding: 7px 12px; min-height: 36px; font: 600 13px/1 var(--fb); cursor: pointer; }
.themebtn:hover { background: rgba(255, 255, 255, 0.08); }
@media (max-width: 720px) { .themebtn { padding: 6px 10px; } }
@media (max-width: 720px) {
  .hd__in { flex-wrap: wrap; }
  .hd__t b { font-size: 16px; }
  .pill { padding: 6px 9px; font-size: 11px; }
  .themebtn { margin-left: auto; padding: 6px 9px; min-height: 32px; font-size: 12px; }
}
@media (max-width: 720px) {
  .hd__in { gap: 8px 8px; }
  .hd__sp { display: none; }
  .hd__t b { font-size: 15px; }
  .themebtn { width: 32px; height: 32px; min-height: 32px; padding: 0; font-size: 0; display: inline-flex; align-items: center; justify-content: center; }
  .themebtn::before { content: "◐"; font-size: 16px; line-height: 1; }
}
@media (max-width: 380px) {
  .hd__logo img { width: 30px; height: 30px; }
  .hd__t b { font-size: 14px; }
  .pill { letter-spacing: 0.04em; padding: 6px 8px; gap: 6px; }
}

/* one area selected: the section title already names it */
#groups.is-one .group__n { display: none; }
#groups.is-one .group__h h2 img { height: 28px; }

/* squarish sponsor logos ("tall": true in sponsors.json) */
.spon img.is-tall { height: 46px; max-width: 160px; }
.tile__spon .spon img.is-tall { height: 38px; }
@media (max-width: 720px) { .tile__spon .spon img.is-tall { height: 32px; } }

/* wide sponsor logos get a little more room */
.spon img { max-width: 180px; }
.tile__spon .spon img { max-width: 160px; }
.group__h h2 .group__n { font-size: inherit; color: inherit; }

/* ---------- polish: slimmer blocks, calmer spacing, consistent motion and cursor feedback ---------- */
/* spacing rhythm */
main.wrap { padding-block: 28px 56px; gap: 34px; }
#groups { gap: 28px; }
.group { gap: 10px; }
.group__list { gap: 8px; }
.ny, .comm { gap: 12px; }
.sec-h h1 { font-size: clamp(28px, 3.4vw, 40px); }
.sec-h h2 { font-size: clamp(21px, 2.1vw, 26px); }

/* area tiles: smaller logos, tighter text, sponsor on one slim line */
.tiles { gap: 12px; }
.tile { padding: 14px 16px; gap: 4px; border-radius: 14px; }
.tile__logo { padding: 5px 8px; border-radius: 7px; margin-bottom: 4px; }
.tile__logo img { height: 20px; }
.tile__place { font-size: 15px; }
.tile__note { font-size: 12.5px; }
.tile__spon { padding-top: 8px; margin-top: 6px; }
.tile__spon .spon { gap: 8px; font-size: 11.5px; }
.tile__spon .spon img { height: 18px; max-width: 120px; padding: 3px 6px; border-radius: 6px; }
.tile__spon .spon img.is-tall { height: 26px; }
.tile__spon .spon img.is-bare { padding: 3px 8px; }

/* section headers: smaller brand chip and sponsor */
.group__h { gap: 6px 14px; }
.group__h h2 { font-size: clamp(19px, 1.9vw, 23px); gap: 10px; }
.group__h h2 img { height: 16px; padding: 3px 6px; border-radius: 5px; }
.group__h .group__s { font-size: 13px; }
.group__spon .spon { font-size: 12px; }
.group__spon .spon img { height: 22px; max-width: 150px; padding: 3px 7px; border-radius: 6px; }
.group__spon .spon img.is-tall { height: 32px; }
#groups.is-one .group__h h2 img { height: 18px; }

/* race cards: one-line header meta, votes on the name line, slimmer bars */
.race { padding: 14px 18px; gap: 10px 24px; border-radius: 12px; }
.race__h { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.race__h h3 { flex-basis: 100%; font-size: 16.5px; }
.race__rep { font-size: 12.5px; }
.flag { margin-top: 0; font-size: 11px; padding: 3px 8px; letter-spacing: .01em; }
.race__c { gap: 7px; }
.cand { grid-template-columns: minmax(0, 1fr) auto auto; gap: 3px 10px; }
.cand__n { grid-column: 1; grid-row: 1; font-size: 14.5px; }
.cand__v { grid-column: 2 !important; grid-row: 1; font-size: 12px; align-self: center; }
.cand__p { grid-column: 3; grid-row: 1; font-size: 16px; min-width: 56px; }
.cand__bar { grid-column: 1 / -1 !important; grid-row: 2; height: 5px; }
.race__whole { font-size: 12.5px; }
.unc { padding: 12px 16px; font-size: 13.5px; }

/* rail + NY + map: lighter */
.card { padding: 16px 18px; border-radius: 14px; }
.rail { gap: 12px; }
.rail h2 { font-size: 17px; }
.bop { gap: 14px; }
.bop .sbar { height: 10px; }
.bop__nums { font-size: 19px; }
.gov .sbar { height: 9px; }
.usa { padding: clamp(16px, 2vw, 24px); border-radius: 16px; gap: 18px 28px; }
.tabs button, .allbtn { min-height: 38px; padding: 8px 14px; font-size: 13.5px; }

/* header + just-called strip: slimmer, one line on phones */
.called__in { min-height: 42px; }
.called__k { padding: 8px 14px; font-size: 11px; }
.called__i { padding: 8px 16px; font-size: 14px; }
.clock { font-size: 19px; padding: 8px 16px; }

/* motion: shorter, softer, consistent */
.m-pre { opacity: 0; transform: translateY(10px); }
.m-in { transition: opacity .4s var(--ease), transform .5s var(--ease); transition-delay: calc(var(--i, 0) * 35ms); }
.tile { transition: transform .25s var(--ease-o), box-shadow .25s var(--ease-o), border-color .2s, background .2s, outline-color .2s; }
.tile:hover { transform: translateY(-2px); }
.tile:active { transform: translateY(0) scale(.99); }

/* cursor + feedback: only things you can click look clickable */
.race, .race:hover { cursor: default; }
@media (hover: hover) { .race:hover { background: var(--card); } }
button, .tile, .tabs button, .allbtn, .det__x, .themebtn, [data-more], .map path:not(.s-none) { cursor: pointer; }
.allbtn, .tabs button, .det__x, .themebtn { transition: background .18s, color .18s, border-color .18s, transform .12s var(--ease-o); }
.allbtn:hover, .tabs button:hover, .det__x:hover { border-color: var(--tx); }
.allbtn:active, .tabs button:active, .det__x:active, .themebtn:active { transform: scale(.96); }
.spon a { transition: transform .2s var(--ease-o), box-shadow .2s; border-radius: 8px; }
.spon a:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -10px rgba(11, 27, 54, .45); }
.map path:not(.s-none):hover { filter: brightness(1.08) saturate(1.1); }

/* colours: clearer status pills */
html:not([data-theme="dark"]) .flag--count { background: #e8eefb; color: #23468f; }
html:not([data-theme="dark"]) .flag--wait { color: #5a6680; }

@media (max-width: 720px) {
  main.wrap { padding-block: 20px 44px; gap: 26px; }
  .hd__nat > span { padding: 5px 4px; font-size: 11px; gap: 2px; border-radius: 8px; }
  .hd__nat b { font-size: 15px; }
  .called__list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .called__list::-webkit-scrollbar { display: none; }
  .called__i { white-space: nowrap; padding: 8px 12px; font-size: 13px; }
  .called__k { padding: 6px 10px; font-size: 10.5px; }
  .clock { font-size: 17px; padding: 6px 12px; }
  .tiles { gap: 8px; }
  .tile { padding: 11px 12px; }
  .tile__logo img { height: 16px; }
  .tile__place { font-size: 13.5px; }
  .tile__spon .spon { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 10.5px; }
  .tile__spon .spon img { height: 16px; max-width: 86px; }
  .tile__spon .spon img.is-tall { height: 22px; }
  .race { padding: 12px 14px; }
  .group__spon { width: auto; margin-left: 0; }
  .group__spon .spon img { height: 18px; }
  .group__spon .spon img.is-tall { height: 26px; }
  .card { padding: 14px; }
}

/* just-called ticker: Senate and Governor calls first and bolder, constant scroll */
.called__list.is-tick { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 40px), transparent); }
.tick { display: flex; width: max-content; }
.tick.is-run { animation: tick linear infinite; will-change: transform; }
.tick__run { display: flex; align-items: center; flex: none; }
.called__list.is-tick .called__i { white-space: nowrap; border-right: 1px solid var(--line); }
.called__list.is-tick:hover .tick, .called__list.is-tick:focus-within .tick { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }
.called__i--big { gap: 10px; font-size: 15.5px; color: var(--tx); }
.called__i--big strong { font-weight: 800; }
.called__tag { display: inline-flex; align-items: center; font: 700 11px/1 var(--fb); letter-spacing: .07em; text-transform: uppercase; color: #fff; padding: 6px 10px; border-radius: 999px; background: var(--mut); }
.called__tag--d { background: var(--dem); }
.called__tag--r { background: var(--rep); }
.called__list.is-tick .called__i:not(.called__i--big) { font-size: 13.5px; color: var(--mut); }
.called__list.is-tick .called__i:not(.called__i--big) b { font-weight: 600; }
@media (max-width: 720px) { .called__i--big { font-size: 14px; gap: 8px; } .called__tag { font-size: 10px; padding: 5px 8px; } }
@media (prefers-reduced-motion: reduce) { .tick.is-run { animation: none; } .called__list.is-tick { overflow-x: auto; -webkit-mask-image: none; mask-image: none; } }
