@font-face { font-family: "Source Serif 4"; src: url("/assets/elections/fonts/SourceSerif4-Italic-cyrillic-ext.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/elections/fonts/SourceSerif4-Italic-cyrillic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/elections/fonts/SourceSerif4-Italic-latin-ext.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; 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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/elections/fonts/SourceSerif4-Italic-latin.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; 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: "Source Serif 4"; src: url("/assets/elections/fonts/SourceSerif4-Bold-cyrillic-ext.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/elections/fonts/SourceSerif4-Bold-cyrillic.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/elections/fonts/SourceSerif4-Bold-latin-ext.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; 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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/elections/fonts/SourceSerif4-Bold-latin.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; 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: "Heebo"; src: url("/assets/elections/fonts/Heebo-400-hebrew.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Heebo"; src: url("/assets/elections/fonts/Heebo-400-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; 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: "Heebo"; src: url("/assets/elections/fonts/Heebo-500-hebrew.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Heebo"; src: url("/assets/elections/fonts/Heebo-500-latin.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; 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: "Heebo"; src: url("/assets/elections/fonts/Heebo-700-hebrew.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Heebo"; src: url("/assets/elections/fonts/Heebo-700-latin.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; 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: "Heebo"; src: url("/assets/elections/fonts/Heebo-800-hebrew.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Heebo"; src: url("/assets/elections/fonts/Heebo-800-latin.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; 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: "IBM Plex Sans Arabic"; src: url("/assets/elections/fonts/IBMPlexSansArabic-400-arabic.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/assets/elections/fonts/IBMPlexSansArabic-400-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; 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: "IBM Plex Sans Arabic"; src: url("/assets/elections/fonts/IBMPlexSansArabic-500-arabic.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/assets/elections/fonts/IBMPlexSansArabic-500-latin.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; 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: "IBM Plex Sans Arabic"; src: url("/assets/elections/fonts/IBMPlexSansArabic-700-arabic.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("/assets/elections/fonts/IBMPlexSansArabic-700-latin.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; 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: "Inter"; src: url("/assets/elections/fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/elections/fonts/JetBrainsMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/elections/fonts/JetBrainsMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/elections/fonts/JetBrainsMono-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* ------------------------------------------------------------------------
   yaroslavmar.com/elections — light editorial dashboard (v2).
   Standalone: does not load styles.css. No inline styles in the markup
   (CSP style-src 'self'); JS sets widths/colours through the CSSOM only.
   ------------------------------------------------------------------------ */

:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --card: #ffffff;
  --line: rgba(15, 23, 42, 0.07);
  --line-2: rgba(15, 23, 42, 0.14);
  --tint: rgba(15, 23, 42, 0.04);
  --ink: #1e293b;
  --ink-2: #334155;
  --muted: #475569;
  --faint: #64748b;
  --accent: #1f3a5f;
  --accent-hover: #2b4f7f;
  --live: #ef4444;
  --ok: #15803d;
  --warn: #b45309;
  --c-coalition: #2563eb;
  --c-opposition: #ea580c;
  --c-between: #16a34a;
  --c-unaligned: #94a3b8;
  --sh-1: 0 1px 2px rgba(15, 23, 42, 0.06);
  --sh-2: 0 2px 8px rgba(15, 23, 42, 0.08);
  --sh-3: 0 8px 24px rgba(15, 23, 42, 0.10);
  --r-sm: 4px;
  --r: 8px;
  --r-lg: 12px;
  --pill: 999px;
  --max-w: 1200px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --focus: 0 0 0 3px rgba(31, 58, 95, 0.25);
}
html[lang="he"] { --serif: "Heebo", "Arial Hebrew", system-ui, Arial, sans-serif; --sans: "Heebo", "Arial Hebrew", system-ui, Arial, sans-serif; }
html[lang="he"] h1, html[lang="he"] h2, html[lang="he"] h3, html[lang="he"] .h1, html[lang="he"] .card__title,
html[lang="he"] .race__name, html[lang="he"] .scen__t, html[lang="he"] .dialog__title, html[lang="he"] .brand__name { font-weight: 800; letter-spacing: -0.02em; }
html[lang="he"] .headline { font-weight: 700; }
html[lang="ar"] { --serif: "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, Arial, sans-serif; --sans: "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, Arial, sans-serif; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] .h1, html[lang="ar"] .card__title,
html[lang="ar"] .race__name, html[lang="ar"] .scen__t, html[lang="ar"] .dialog__title, html[lang="ar"] .brand__name { font-weight: 700; letter-spacing: 0; }
html[lang="ar"] .headline { font-weight: 700; }
html[lang="ar"] .tagline { font-style: normal; }
html[lang="ar"] body, html[lang="ar"] { line-height: 1.7; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 700; line-height: 1.15; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0 0 0.75rem; text-wrap: pretty; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }
img { max-width: 100%; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.fine { font-size: 0.8rem; color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; top: -100px; inset-inline-start: 12px; padding: 8px 14px; background: var(--accent); color: #fff; border-radius: var(--pill); z-index: 999; }
.skip-link:focus { top: 12px; }
.wrap { max-width: var(--max-w); margin: 0 auto; padding-inline: 1.5rem; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 8px; vertical-align: -1px; background: var(--c-unaligned); flex: none; }
.up { color: var(--ok); }
.down { color: var(--live); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }

/* ---------- Top bar ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--sh-1); }
.topbar::after { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--c-coalition) 0 45%, var(--c-between) 45% 55%, var(--c-opposition) 55%); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: baseline; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark { width: 22px; height: 22px; align-self: center; }
.brand__name { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.brand__by { font-size: 0.8rem; color: var(--faint); }
.topbar__end { display: flex; align-items: center; gap: 10px; }
.langs { display: flex; gap: 2px; padding: 3px; background: var(--tint); border-radius: var(--pill); }
.langs a { padding: 5px 10px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; border-radius: var(--pill); color: var(--muted); }
.langs a:hover { text-decoration: none; color: var(--ink); }
.langs a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: var(--sh-1); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); }
.iconbtn:hover { background: var(--tint); }
.iconbtn svg { width: 18px; height: 18px; }

/* ---------- Buttons, chips, controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--pill); font-weight: 600; font-size: 0.95rem; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); box-shadow: var(--sh-1); transition: background .15s, border-color .15s; }
.btn:hover { background: #f8fafc; text-decoration: none; color: var(--ink); }
.btn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--primary:hover { background: #0f172a; color: #fff; }
.btn--support { padding-inline: 16px 12px; border-color: var(--line-2); color: var(--ink); }
.btn--support .heart { color: var(--live); font-size: 1.05em; line-height: 1; }
.btn--support .btn__logo { height: 17px; width: auto; display: block; }
.btn__logos { display: inline-flex; align-items: center; gap: 8px; }
.btn__logo--bit { height: 15px; width: 15px; border-radius: 4px; }
.btn--primary .btn__logo { filter: brightness(0) invert(1); }
.btn--support:hover { background: #fef2f2; border-color: var(--live); color: var(--ink); }
.btn--sm { padding: 6px 12px; font-size: 0.85rem; }
.chip { padding: 6px 12px; border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); font-size: 0.85rem; font-weight: 500; line-height: 1.2; transition: background .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip--party { --party: var(--c-unaligned); }
.chip--party::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--party); margin-inline-end: 7px; vertical-align: 0; }
.chip--party.is-on { background: var(--party); border-color: var(--party); color: #fff; }
.chip--party.is-on.is-light { color: var(--ink); }
.chip--party.is-on::before { background: rgba(255,255,255,0.85); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.select { padding: 7px 30px 7px 12px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); color: var(--ink); }
.ctl { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); }
details.settings { margin-top: 12px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); }
details.settings summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }
details.settings summary:hover { color: var(--accent); }
.settings__body { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 12px; }

/* ---------- Banners ---------- */
.banner { margin: 12px 0 0; padding: 10px 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line-2); font-size: 0.95rem; box-shadow: var(--sh-1); }
.banner--warn { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.banner--action { cursor: pointer; border-color: #93c5fd; background: #eff6ff; color: var(--accent); width: 100%; text-align: start; }
.loading { margin: 24px 0; color: var(--muted); }

/* ---------- Page head ---------- */
main { padding-block: 22px 56px; }
.tagline { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--muted); text-align: center; margin: 4px 0 6px; }
html[lang="he"] .tagline { font-style: normal; }
.h1 { text-align: center; font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 6px; }
.meta { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 0 0 20px; }
.meta .dot { margin-inline: 6px; color: var(--faint); }

/* ---------- Race header ---------- */
.race { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-2); padding: 24px 24px 20px; margin-bottom: 8px; }
.race__grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px 24px; align-items: start; }
.race__side { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; }
.race__side--b { grid-template-columns: 1fr auto; text-align: end; }
.race__side--b .ring { grid-column: 2; grid-row: 1 / span 3; }
.race__side--b > :not(.ring) { grid-column: 1; }
.ring { --p: 0; --bloc: var(--c-unaligned); position: relative; width: 92px; height: 92px; border-radius: 50%; background: conic-gradient(var(--bloc) calc(var(--p) * 1%), #e2e8f0 0); display: grid; place-items: center; grid-row: span 3; }
.ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--card); }
.ring__num { position: relative; font-family: var(--mono); font-weight: 600; font-size: 2.1rem; color: var(--ink); line-height: 1; direction: ltr; }
.race__name { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; line-height: 1.1; align-self: end; }
.race__sub { font-size: 0.9rem; color: var(--muted); }
.race__sub strong { color: var(--ink); font-weight: 600; }
.delta { display: inline-block; margin-inline-start: 8px; font-family: var(--mono); font-size: 0.8rem; white-space: nowrap; }
.race__mid { align-self: center; min-width: 200px; padding: 10px 14px; background: var(--bg); border-radius: var(--r-lg); border: 1px solid var(--line); font-size: 0.9rem; }
.race__midlabel { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.race__midrow { display: flex; align-items: baseline; gap: 6px; padding: 3px 0; }
.race__midrow b { font-family: var(--mono); font-weight: 600; }
.race__note { color: var(--faint); font-size: 0.8rem; }
.race__bar { margin: 18px 0 8px; }
.race__ends { display: flex; justify-content: space-between; gap: 12px; font-size: 0.85rem; color: var(--muted); }
.race__ends .num { font-weight: 600; color: var(--ink); }
.headline { font-family: var(--serif); font-size: 1.2rem; line-height: 1.4; text-align: center; max-width: 64ch; margin: 18px auto 6px; color: var(--ink); }
.race__foot { text-align: center; font-size: 0.8rem; color: var(--faint); margin: 0; }

/* Live badge + progress (election night, inside the race header) */
.live-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: var(--pill); background: #fef2f2; color: #b91c1c; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(239,68,68,0.5); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); } 70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }
.live-badge.is-final { background: #f0fdf4; color: #166534; }
.live-badge.is-final .live-dot { background: var(--ok); animation: none; box-shadow: none; }
.live-badge.is-replay { background: #fffbeb; color: #92400e; }
.live-badge.is-replay .live-dot { background: #f59e0b; animation: none; box-shadow: none; }
.race__top { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; margin-bottom: 14px; color: var(--muted); font-size: 0.9rem; }
.progress { height: 8px; border-radius: var(--pill); background: var(--tint); overflow: hidden; margin: 0 0 18px; }
.progress__fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #60a5fa); transition: width .4s; }

/* ---------- Seat bars ---------- */
.bar { position: relative; display: flex; height: 16px; border-radius: var(--pill); background: var(--tint); overflow: visible; }
.bar--lg { height: 26px; }
.bar__seg { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; height: 100%; }
.bar__seg:first-child { border-start-start-radius: var(--pill); border-end-start-radius: var(--pill); }
.bar__seg:last-of-type { border-start-end-radius: var(--pill); border-end-end-radius: var(--pill); }
.bar__seg + .bar__seg { border-inline-start: 1px solid rgba(255,255,255,0.7); }
.bar__lbl { font-size: 0.72rem; font-weight: 600; white-space: nowrap; padding-inline: 4px; }
/* Grouped bar: one pill per camp, a gap between them, and a bracket legend underneath */
.bar--groups { gap: 6px; background: transparent; }
.bar__group { display: flex; height: 100%; min-width: 0; border-radius: var(--pill); overflow: hidden; background: var(--tint); }
.bar__legend { display: flex; gap: 6px; margin-top: 7px; }
.bar__legend-item { --camp: var(--c-unaligned); flex: 0 1 auto; min-width: 0; border-top: 3px solid var(--camp); padding-top: 5px; text-align: center; font-size: 0.82rem; color: var(--muted); white-space: nowrap; line-height: 1.2; }
.bar__legend-item b { color: var(--ink); font-weight: 600; }
.bar__legend-item--between { color: var(--faint); }
.bar__mark { --mark: var(--ink); position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--mark); opacity: 0.9; transform: translateX(-1px); pointer-events: none; }
.bar__marklbl { position: absolute; top: -17px; inset-inline-start: 50%; transform: translateX(-50%); font: 600 0.7rem var(--mono); color: var(--mark); white-space: nowrap; }
html[dir="rtl"] .bar__marklbl { transform: translateX(50%); }
.bar__mark--b .bar__marklbl { top: auto; bottom: -17px; }
/* The "61" label is absolutely positioned above the bar; without this it lands on the text above. */
.bar--marklbl { margin-top: 20px; }

/* ---------- Horizontal list bars ---------- */
#avg-groups, .hbars, .live-rows, .ranges { display: grid; grid-template-columns: minmax(190px, 1.4fr) 2.6fr auto; column-gap: 12px; align-items: center; }
/* The whole card is one grid, so every bar in every group starts and ends on the same line. */
#avg-groups .group, #avg-groups .hbars { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; }
#avg-groups .group__head { grid-column: 1 / -1; }
.hbar, .range { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: center; row-gap: 10px; }
.hbar { padding: 8px 0; border-bottom: 1px solid var(--line); }
.live-rows > p, .hbars > p { grid-column: 1 / -1; }
/* Browsers without subgrid: keep the rows independent but pin the value column so they still line up. */
@supports not (grid-template-columns: subgrid) {
  #avg-groups, #avg-groups .group, #avg-groups .hbars, .hbars, .live-rows, .ranges { display: block; }
  .hbar, .range { grid-template-columns: minmax(190px, 1.4fr) 2.6fr minmax(9ch, 20ch); column-gap: 12px; }
}
.hbar:last-child { border-bottom: 0; }
.hbar__name { display: flex; flex-wrap: wrap; align-items: center; gap: 0; font-weight: 600; min-width: 0; line-height: 1.25; }
.hbar__name > span:nth-child(2) { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.hbar__tag { flex-basis: 100%; margin: 1px 0 0; padding-inline-start: 20px; font-size: 0.75rem; font-weight: 500; color: var(--faint); }
.hbar__track { height: 12px; background: var(--tint); border-radius: var(--pill); overflow: hidden; }
.hbar__fill { display: block; height: 100%; border-radius: var(--pill); transition: width .3s; }
.hbar--below .hbar__fill { opacity: 0.45; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.5) 0 4px, transparent 4px 8px); }
.hbar__val { display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; min-width: 6ch; }
.hbar__val .num { font-weight: 600; font-size: 1.05rem; }
.hbar__extra { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.group { margin-top: 14px; }
.group__head { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 2px solid var(--line-2); margin-bottom: 2px; }
.group__title { font-weight: 700; font-size: 0.95rem; }
.group__title::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--group-colour, var(--c-unaligned)); margin-inline-end: 8px; }
.group__total { font-family: var(--mono); font-weight: 600; }

/* ---------- Tabs ---------- */
.tabs-anchor { display: block; height: 0; }
.tabs { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 10px 0; margin: 16px 0 20px; background: rgba(245, 247, 250, 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.tab { padding: 8px 16px; border-radius: var(--pill); font-weight: 600; font-size: 0.9rem; color: var(--ink-2); white-space: nowrap; }
.tab:hover { background: var(--card); text-decoration: none; color: var(--ink); box-shadow: var(--sh-1); }
.tab.is-active { background: var(--accent); color: #fff; box-shadow: var(--sh-1); }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-2); padding: 1.5rem; margin-block-end: 1.5rem; }
.card__title { font-size: 1.5rem; margin: 0 0 4px; }
.card__sub { color: var(--muted); font-size: 0.95rem; margin: 0 0 1rem; }
.card__foot { font-size: 0.8rem; color: var(--faint); margin: 12px 0 0; }
.card h3 { font-family: var(--sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin: 18px 0 8px; }
.chart-wrap { position: relative; height: 380px; margin-top: 12px; }
.chart-wrap--short { height: 260px; }
.chart-wrap canvas { width: 100% !important; }

/* ---------- Forecast ---------- */
.scen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.scen__card { --party: var(--c-unaligned); position: relative; padding: 16px 18px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); overflow: hidden; }
.scen__card::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; background: var(--party); }
.scen__p { font-family: var(--mono); font-size: 2rem; font-weight: 600; line-height: 1; color: var(--ink); }
.scen__t { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; margin: 6px 0 4px; }
.scen__why { font-size: 0.9rem; color: var(--muted); margin: 0 0 10px; }
.scen__bar { height: 6px; border-radius: var(--pill); background: var(--tint); overflow: hidden; }
.scen__fill { display: block; height: 100%; background: var(--party); }
.whatif { margin-top: 16px; display: grid; gap: 6px; }
.whatif__row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--bg); border-radius: var(--r); font-size: 0.95rem; }
.whatif__row .num { font-weight: 600; }
.range { padding: 7px 0; border-bottom: 1px solid var(--line); }
.range:last-child { border-bottom: 0; }
.range__track { --party: var(--c-unaligned); position: relative; height: 14px; background: var(--tint); border-radius: var(--pill); }
.range__band, .range__core { position: absolute; top: 0; bottom: 0; border-radius: var(--pill); }
.range__band { background: color-mix(in srgb, var(--party) 28%, white); }
.range__core { background: color-mix(in srgb, var(--party) 70%, white); }
.range__med { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); transform: translateX(-1px); }
.range__val { display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; }
.range__val .num { font-weight: 600; font-size: 1.05rem; }
.range__val small { font-family: var(--mono); color: var(--muted); font-size: 0.78rem; }
.range__thr { font-size: 0.78rem; color: var(--warn); }
details.more { margin-top: 14px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--accent); }

/* ---------- Coalition builder ---------- */
.coal__total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 8px; }
.coal__num { font-family: var(--mono); font-size: 2.4rem; font-weight: 600; line-height: 1; }
.coal__num.is-majority { color: var(--ok); }
.coal__verdict { font-weight: 600; color: var(--warn); }
.coal__verdict.is-majority { color: var(--ok); }
.coal__groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.coal__hint { font-size: 0.75rem; color: var(--faint); margin-inline-start: 6px; }

/* ---------- Polls list ---------- */
.polls-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 8px; font-size: 0.9rem; color: var(--muted); }
.polls-tools label { display: inline-flex; align-items: center; gap: 6px; }
.poll { padding: 12px 0; border-bottom: 1px solid var(--line); }
.poll:last-child { border-bottom: 0; }
.poll__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.poll__date { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.poll__pub { font-weight: 600; }
.poll__who { color: var(--muted); font-size: 0.9rem; }
.poll__totals { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 600; font-size: 0.95rem; }
.poll__totals .swatch { width: 10px; height: 10px; margin-inline-end: 4px; }
.poll__bar { margin-top: 8px; }
.poll__detail { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 14px; margin-top: 12px; font-size: 0.9rem; }
.poll__cell { display: flex; align-items: center; gap: 4px; }
.poll__cell .num { margin-inline-start: auto; font-weight: 600; }
.poll__cell.below { color: var(--muted); }
.poll__badge { display: inline-block; padding: 2px 8px; border-radius: var(--pill); font-size: 0.72rem; font-weight: 600; background: #fef3c7; color: #92400e; }
.poll--invalid { opacity: 0.6; }
.poll--event { padding: 8px 0; color: var(--muted); font-size: 0.9rem; font-style: italic; }
.poll--event .poll__date { font-style: normal; }
.poll__head { cursor: pointer; }
.poll__src { font-size: 0.78rem; color: var(--accent); white-space: nowrap; }
.poll__cell--wide { grid-column: 1 / -1; }
.poll__more { margin-inline-start: 4px; padding: 3px 10px; border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--card); color: var(--muted); font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.poll__more::after { content: " ▾"; }
.poll__more[aria-expanded="true"]::after { content: " ▴"; }
.poll:hover .poll__more, .poll__more:hover { border-color: var(--accent); color: var(--accent); }
.showmore { display: flex; justify-content: center; margin-top: 14px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ranges { margin-top: 4px; }
.range .hbar__name { flex-wrap: wrap; }
.range__thr { flex-basis: 100%; font-weight: 400; margin-inline-start: 20px; }
.range.hbar--below .range__track { opacity: 0.55; }
.coal__presets { margin: 12px 0 4px; }
.exit-table tr.lead td { font-weight: 700; border-top: 2px solid var(--line-2); }

/* ---------- Method, support ---------- */
.prose { font-size: 1rem; color: var(--ink-2); }
.prose h3 { font-family: var(--serif); text-transform: none; letter-spacing: 0; font-size: 1.15rem; color: var(--ink); margin: 20px 0 6px; }
.prose p, .prose li { max-width: 72ch; }
.prose ul { padding-inline-start: 20px; margin: 0 0 12px; }
.support-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.support-grid p { max-width: 52ch; }
.support__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.support__actions .btn__logo { height: 18px; width: auto; }
.qr { display: grid; justify-items: center; gap: 8px; text-align: center; font-size: 0.85rem; color: var(--muted); }
.qr img:not(.qr__logo) { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; padding: 8px; }
.qr__logo { height: 22px; width: auto; vertical-align: middle; }
.btn__logo { height: 18px; width: auto; }

/* ---------- Dialog ---------- */
dialog.dialog { border: 0; border-radius: 16px; padding: 0; width: min(420px, calc(100% - 32px)); box-shadow: var(--sh-3); color: var(--ink); background: var(--card); }
dialog.dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.dialog__body { padding: 24px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.dialog__title { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; }
.dialog__close { position: absolute; top: 10px; inset-inline-end: 10px; }
.dialog__or { display: flex; align-items: center; gap: 10px; width: 100%; color: var(--faint); font-size: 0.85rem; }
.dialog__or::before, .dialog__or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

/* ---------- Election night widgets ---------- */
.inplay { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.inplay__num { font-family: var(--mono); font-size: 2rem; font-weight: 600; margin-inline-end: 8px; }
.inplay__verdict { font-weight: 600; color: var(--warn); }
.inplay .fine { flex-basis: 100%; margin: 0; }
.inplay__verdict.is-decided { color: var(--ok); }
.watch { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.watch__card { --party: var(--c-unaligned); padding: 12px 14px; border: 1px solid var(--line); border-inline-start: 5px solid var(--party); border-radius: var(--r); background: var(--bg); }
.watch__name { font-weight: 600; }
.watch__share { font-family: var(--mono); font-size: 1.4rem; font-weight: 600; }
.watch__track { position: relative; height: 8px; background: var(--tint); border-radius: var(--pill); margin: 6px 0; overflow: visible; }
.watch__fill { display: block; height: 100%; background: var(--party); border-radius: var(--pill); }
.watch__thr { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); inset-inline-start: 50%; }
.watch__gap { font-size: 0.85rem; color: var(--muted); }
.exit-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.exit-table th, .exit-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: start; }
.exit-table th.num, .exit-table td.num { text-align: end; }
.exit-table .lead { font-weight: 700; }
.scrub { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 12px 0 4px; }
.scrub input[type="range"] { flex: 1 1 240px; accent-color: var(--accent); }
.scrub__label { font-family: var(--mono); font-size: 0.85rem; color: var(--ink-2); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.share__title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-inline-end: 4px; }
.live-rows .hbar__name small { color: var(--faint); font-weight: 400; margin-inline-start: 6px; }

/* ---------- Footer, toast ---------- */
.foot { border-top: 1px solid var(--line); padding: 22px 0 32px; font-size: 0.85rem; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; justify-content: space-between; }
.foot__social { display: inline-flex; align-items: center; gap: 10px; }
.foot__social a { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--muted); background: var(--card); }
.foot__social a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.foot__social svg { width: 17px; height: 17px; }
.toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%) translateY(100%); opacity: 0; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--pill); font-size: 0.9rem; font-weight: 500; z-index: 200; pointer-events: none; transition: opacity .2s, transform .2s; }
html[dir="rtl"] .toast { transform: translateX(50%) translateY(100%); }
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
html[dir="rtl"] .toast.is-visible { transform: translateX(50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .race__grid { grid-template-columns: 1fr 1fr; }
  .race__mid { grid-column: 1 / -1; min-width: 0; }
  .race__ends { font-size: 0.8rem; }
  .coal__groups { grid-template-columns: 1fr; }
  .support-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .topbar__inner { row-gap: 6px; }
  .brand { order: 1; }
  .topbar__end { order: 2; margin-inline-start: auto; }
  .btn--support { order: 3; flex: 1 0 100%; }
  .race__grid { grid-template-columns: 1fr; }
  .race__side, .race__side--b { grid-template-columns: auto 1fr; text-align: start; }
  .race__side--b .ring { grid-column: 1; grid-row: 1 / span 3; }
  .race__side--b > :not(.ring) { grid-column: 2; }
  .race__mid { grid-column: auto; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .wrap { padding-inline: 1rem; }
  .race { padding: 18px 14px 16px; }
  .race__grid { gap: 12px; }
  .race__side, .race__side--b { grid-template-columns: auto 1fr; gap: 4px 10px; }
  .ring { width: 72px; height: 72px; }
  .ring__num { font-size: 1.6rem; }
  .race__name { font-size: 1.2rem; }
  .scen { grid-template-columns: 1fr; }
  #avg-groups, .hbars, .live-rows, .ranges { grid-template-columns: 1fr auto; column-gap: 10px; }
  .hbar, .range { row-gap: 4px; }
  @supports not (grid-template-columns: subgrid) { .hbar, .range { grid-template-columns: 1fr auto; } }
  .hbar__name, .range .hbar__name { grid-column: 1 / -1; }
  .hbar__track, .range__track { grid-column: 1; }
  .hbar__val, .range__val { grid-column: 2; }
  .chart-wrap { height: 300px; }
  .chart-wrap--short { height: 220px; }
  .card { padding: 1rem; }
  .card__title { font-size: 1.3rem; }
  .brand__by { display: none; }
  .qr img:not(.qr__logo) { width: 160px; height: 160px; }
  .tab { padding: 7px 12px; font-size: 0.85rem; }
  .bar__lbl { display: none; }
  .bar--lg .bar__seg--m .bar__lbl, .bar--lg .bar__seg--l .bar__lbl { display: inline; }
  .bar--groups, .bar__legend { gap: 4px; }
  .bar__legend-item { font-size: 0.72rem; }
  .bar__legend-item--between .bar__legend-name { display: none; }
  .bar--lg .bar__seg--m .bar__name { display: none; }
}
@media print { .topbar, .tabs, .toast, .btn, .chips, details.settings { display: none !important; } .card, .race { box-shadow: none; } }
