/* ==========================================================================
   Mwelekeo Insights - public design system
   Principles: instant feedback on press, translucent layered chrome, size-specific
   tracking, light & dark themes selected (not flipped), reduced motion/transparency honoured.
   ========================================================================== */

:root {
  color-scheme: light;
  --navy: #173a6b; --navy-2: #2160b0; --green: #0fa650; --orange: #f07d1a; --yellow: #fdc50c; --slate: #5e7380;
  --bg: #f5f7fa; --surface: #ffffff; --surface-2: #eef2f7; --surface-3: #e4e9f0;
  --ink: #0f1b2d; --ink-2: #33435a; --muted: #617086; --line: rgba(15, 27, 45, .09); --line-2: rgba(15, 27, 45, .16);
  --link: #1d5bb0; --focus: rgba(33, 96, 176, .35);
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --s1: #0fa650; --s2: #2160b0; --s3: #f07d1a; --s4: #8e5bd0; --s5: #e0a100; --s6: #1aa3b5; --s7: #d64545; --s8: #5b6ee0;
  --glass: rgba(255, 255, 255, .72); --glass-strong: rgba(255, 255, 255, .86); --glass-edge: rgba(255, 255, 255, .6);
  --shadow-1: 0 1px 2px rgba(15, 27, 45, .05), 0 1px 1px rgba(15, 27, 45, .03);
  --shadow-2: 0 1px 2px rgba(15, 27, 45, .05), 0 8px 24px rgba(15, 27, 45, .07);
  --shadow-3: 0 2px 6px rgba(15, 27, 45, .06), 0 24px 60px rgba(15, 27, 45, .14);
  --r-sm: 10px; --r: 16px; --r-lg: 22px; --r-xl: 28px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --container: 1200px;
  --nav-h: 64px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.64, 0, .78, 0);
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0a111e; --surface: #111a2b; --surface-2: #17223a; --surface-3: #1f2c47;
    --ink: #edf1f7; --ink-2: #c4cdda; --muted: #8e9cb2; --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .15);
    --link: #7fb0f5; --focus: rgba(127, 176, 245, .45);
    --s1: #0f9a4a; --s2: #3a7bd5; --s3: #e0701a; --s4: #9a72e0; --s5: #b08200; --s6: #1a96a8; --s7: #e05a5a; --s8: #7085ea;
    --glass: rgba(17, 26, 43, .72); --glass-strong: rgba(17, 26, 43, .9); --glass-edge: rgba(255, 255, 255, .06);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35); --shadow-3: 0 30px 80px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a111e; --surface: #111a2b; --surface-2: #17223a; --surface-3: #1f2c47;
  --ink: #edf1f7; --ink-2: #c4cdda; --muted: #8e9cb2; --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .15);
  --link: #7fb0f5; --focus: rgba(127, 176, 245, .45);
  --s1: #0f9a4a; --s2: #3a7bd5; --s3: #e0701a; --s4: #9a72e0; --s5: #b08200; --s6: #1a96a8; --s7: #e05a5a; --s8: #7085ea;
  --glass: rgba(17, 26, 43, .72); --glass-strong: rgba(17, 26, 43, .9); --glass-edge: rgba(255, 255, 255, .06);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35); --shadow-3: 0 30px 80px rgba(0, 0, 0, .55);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body { margin: 0; font: 400 1rem/1.6 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; transition: background-color .3s ease, color .3s ease; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; text-underline-offset: .18em; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(33, 96, 176, .2); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.05; letter-spacing: -.028em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.35rem); line-height: 1.12; letter-spacing: -.022em; }
h3 { font-size: 1.22rem; line-height: 1.3; letter-spacing: -.012em; }
h4 { font-size: 1.02rem; line-height: 1.35; letter-spacing: -.005em; }
p { margin: 0 0 1em; }
small, .small { font-size: .8125rem; letter-spacing: .005em; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--navy-2); }
:root[data-theme="dark"] .eyebrow { color: #7fb0f5; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); line-height: 1.55; color: var(--ink-2); letter-spacing: -.004em; }
.muted { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 1000; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip:focus { left: 8px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 820px; }
.section { padding: clamp(48px, 8vw, 96px) 0; }
.section-tight { padding: clamp(32px, 5vw, 56px) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: .3rem 0 0; }
.section-head p { margin: .4rem 0 0; color: var(--muted); max-width: 60ch; }
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.g-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.split { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 1fr) 360px; } .split-even { grid-template-columns: 1fr 1fr; } }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ------------------------------------------------------------------ buttons (feedback on press, not release) */
.btn { --b: var(--navy); display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  background: var(--b); color: #fff; font-weight: 600; font-size: .95rem; letter-spacing: -.003em; cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: transform .1s ease-out, background-color .2s ease, box-shadow .2s ease, opacity .2s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn:hover { box-shadow: 0 6px 18px rgba(23, 58, 107, .22); }
.btn:active { transform: scale(.97); transition-duration: .06s; }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: progress; }
.btn-green { --b: #0b8f44; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-light { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-1); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .86rem; }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color .15s, transform .1s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ chrome: topbar + translucent nav */
.demo-banner { background: linear-gradient(90deg, #fff4d6, #ffe9b8); color: #6b4a00; font-size: .82rem; text-align: center; padding: 7px 16px; font-weight: 500; }
:root[data-theme="dark"] .demo-banner { background: #3a2c08; color: #ffd98a; }
.topbar { background: var(--navy); color: rgba(255, 255, 255, .86); font-size: .8rem; }
.topbar .container { display: flex; gap: 20px; align-items: center; height: 36px; }
.topbar a { color: #fff; }
.topbar .lang a { opacity: .7; padding: 2px 6px; border-radius: 6px; }
.topbar .lang a.on { opacity: 1; background: rgba(255, 255, 255, .14); }
@media (max-width: 760px) { .topbar .hide-m { display: none; } }

.nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent; transition: border-color .25s, box-shadow .25s, background-color .25s; }
.nav.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px rgba(15, 27, 45, .05); }
.nav-inner { display: flex; align-items: center; gap: 18px; height: 100%; }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 38px; width: auto; }
:root[data-theme="dark"] .brand img, .dark-logo { filter: brightness(0) invert(1) contrast(.9); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .brand img { filter: brightness(0) invert(1) contrast(.9); } }
.nav-links { display: none; gap: 2px; align-items: center; margin-left: 8px; }
.nav-links > a, .nav-drop > button { color: var(--ink-2); font-weight: 550; font-size: .92rem; padding: 8px 11px; border-radius: 10px; letter-spacing: -.005em; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.nav-links > a:hover, .nav-drop > button:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav-links > a.is-active { color: var(--navy-2); background: rgba(33, 96, 176, .09); }
:root[data-theme="dark"] .nav-links > a.is-active { color: #9cc3ff; }
.nav-drop { position: relative; }
.nav-menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px; padding: 8px; background: var(--glass-strong); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-3); opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top left;
  transition: opacity .18s var(--ease-out), transform .22s var(--ease-out), visibility 0s .22s; }
.nav-drop:hover .nav-menu, .nav-drop:focus-within .nav-menu, .nav-drop.open .nav-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.nav-menu a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 550; font-size: .92rem; }
.nav-menu a span { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.nav-menu a:hover { background: var(--surface-2); text-decoration: none; }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav-actions .btn { display: none; }
.menu-btn { display: inline-grid; }
@media (min-width: 1120px) { .nav-links { display: flex; } .menu-btn { display: none; } .nav-actions .btn { display: inline-flex; } }
@media (min-width: 640px) and (max-width: 1119px) { .nav-actions .btn-vote { display: inline-flex; } }

/* Mobile sheet: drag to dismiss with velocity projection (see app.js) */
.scrim { position: fixed; inset: 0; background: rgba(8, 14, 26, .42); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; max-height: 88vh; background: var(--glass-strong); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  border-radius: 24px 24px 0 0; border-top: 1px solid var(--glass-edge); box-shadow: var(--shadow-3); transform: translateY(110%); will-change: transform; overflow: hidden; touch-action: none; visibility: hidden; }
.sheet.ready { visibility: visible; }
.sheet .grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 10px auto 6px; }
.sheet .sheet-body { overflow-y: auto; max-height: calc(88vh - 30px); padding: 6px 16px calc(24px + env(safe-area-inset-bottom)); touch-action: pan-y; }
.sheet nav a { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px; border-radius: 12px; color: var(--ink); font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; }
.sheet nav a:active { background: var(--surface-2); }
.sheet nav a.is-active { color: var(--navy-2); }
.sheet .sheet-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 16px 12px 4px; font-weight: 700; }

/* ------------------------------------------------------------------ cards & surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 22px; position: relative; }
.card-pad-lg { padding: clamp(22px, 3vw, 34px); }
.card-link { display: block; color: inherit; text-decoration: none !important; transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .2s; }
.card-link:hover { box-shadow: var(--shadow-2); border-color: var(--line-2); transform: translateY(-2px); }
.card-link:active { transform: scale(.99); transition-duration: .08s; }
.glass { background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border: 1px solid var(--glass-edge); }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-title h3 { margin: 0; font-size: 1.05rem; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge-live { background: rgba(15, 166, 80, .12); color: #0a7a3b; }
:root[data-theme="dark"] .badge-live { color: #52d58b; }
.badge-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2s ease-in-out infinite; }
.badge-closed { background: var(--surface-2); color: var(--muted); }
.badge-upcoming { background: rgba(240, 125, 26, .14); color: #a34f05; }
:root[data-theme="dark"] .badge-upcoming { color: #f6a35c; }
.badge-sci { background: rgba(33, 96, 176, .12); color: #1d4f91; }
:root[data-theme="dark"] .badge-sci { color: #9cc3ff; }
.badge-open { background: rgba(97, 112, 134, .12); color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: .86rem; font-weight: 550; cursor: pointer; text-decoration: none !important; transition: background-color .15s, transform .1s, color .15s; }
.chip:hover { background: var(--surface-2); }
.chip:active { transform: scale(.97); }
.chip.on, .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .n { color: var(--muted); font-weight: 500; }
.chip.on .n { color: inherit; opacity: .7; }
.party-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; box-shadow: 0 0 0 2px var(--surface); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto -10%; height: 140%; z-index: -1;
  background: radial-gradient(48% 42% at 12% 18%, rgba(15, 166, 80, .13), transparent 70%), radial-gradient(40% 40% at 88% 10%, rgba(33, 96, 176, .16), transparent 70%), radial-gradient(36% 34% at 70% 90%, rgba(253, 197, 12, .14), transparent 70%); }
.hero-grid { display: grid; gap: 40px; align-items: center; grid-template-columns: minmax(0, 1fr); }
.hero-grid > *, .grid > *, .split > * { min-width: 0; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.05fr .95fr; } }
@media (max-width: 520px) { .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero-cta .btn { flex: 1 1 auto; } }
@media (max-width: 420px) {
  .brand img { height: 30px; }
  .nav-inner { gap: 10px; }
  .nav-actions { gap: 2px; }
  .nav-actions .icon-btn { width: 36px; height: 36px; }
  .nav-actions [data-theme-toggle] { display: none; }
  .container { padding: 0 16px; }
}
.hero h1 { margin: 14px 0 16px; max-width: 15ch; }
.hero .lead { max-width: 52ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 30px; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; max-width: 560px; }
.hero-stats .num { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.hero-stats .lbl { font-size: .8rem; color: var(--muted); }
.hero-card { border-radius: var(--r-xl); padding: 24px; box-shadow: var(--shadow-3); }
.hero-card h3 { font-size: 1.15rem; margin: 10px 0 4px; }

/* ------------------------------------------------------------------ poll cards & results */
.poll-card { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.poll-card h3 { margin: 0; font-size: 1.08rem; line-height: 1.32; }
.poll-card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--muted); margin-top: auto; }
.poll-card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.poll-card .meta .icon { width: 15px; height: 15px; }
.poll-cover { height: 140px; margin: -22px -22px 4px; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--surface-2) center/cover no-repeat; }
.mini-results { display: grid; gap: 8px; }

.result { display: grid; gap: 6px; }
.result + .result { margin-top: 14px; }
.result-head { display: flex; align-items: center; gap: 10px; }
.result-head .who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.result-head .name { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-head .party { font-size: .74rem; color: var(--muted); font-weight: 600; }
.result-head .val { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .98rem; }
.result-head .cnt { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 6px; font-weight: 500; }
.bar { position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 0 4px 4px 0; background: var(--c, var(--s2)); will-change: width; }
.bar .ci { position: absolute; top: 2px; bottom: 2px; border-left: 2px solid rgba(15, 27, 45, .45); border-right: 2px solid rgba(15, 27, 45, .45); }
.result.is-lead .bar > i { box-shadow: 0 0 0 2px var(--surface) inset; }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--surface-2) center/cover; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 96px; height: 96px; font-size: 1.8rem; }
.result-note { font-size: .8rem; color: var(--muted); margin-top: 12px; }
.disclaimer { display: flex; gap: 10px; font-size: .84rem; color: var(--ink-2); background: var(--surface-2); padding: 12px 14px; border-radius: 12px; }
.disclaimer .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }

/* ------------------------------------------------------------------ vote form */
.q { border: 0; padding: 0; margin: 0 0 26px; }
.q legend { font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; margin-bottom: 4px; line-height: 1.35; }
.q .help { font-size: .86rem; color: var(--muted); margin-bottom: 12px; }
.opt-list { display: grid; gap: 10px; margin-top: 12px; }
.opt { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 14px; cursor: pointer; background: var(--surface);
  transition: border-color .15s, background-color .15s, transform .1s ease-out, box-shadow .15s; -webkit-tap-highlight-color: transparent; min-height: 56px; }
.opt:active { transform: scale(.985); }
.opt:hover { border-color: rgba(33, 96, 176, .45); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; transition: all .15s; }
.opt input[type=checkbox] ~ .tick { border-radius: 7px; }
.opt .tick::after { content: ""; width: 10px; height: 10px; border-radius: inherit; background: #fff; transform: scale(0); transition: transform .18s var(--ease-out); }
.opt input:checked ~ .tick { background: var(--navy-2); border-color: var(--navy-2); }
.opt input:checked ~ .tick::after { transform: scale(1); }
.opt:has(input:checked) { border-color: var(--navy-2); background: rgba(33, 96, 176, .06); box-shadow: 0 0 0 3px rgba(33, 96, 176, .12); }
.opt input:focus-visible ~ .tick { outline: 3px solid var(--focus); outline-offset: 2px; }
.opt .lbl { flex: 1; font-weight: 550; }
.opt .sub { display: block; font-size: .78rem; color: var(--muted); font-weight: 500; }
.rating { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rating label { position: relative; }
.rating input { position: absolute; opacity: 0; }
.rating span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; border: 1.5px solid var(--line-2); font-weight: 700; cursor: pointer; transition: all .12s; background: var(--surface); }
.rating span:active { transform: scale(.95); }
.rating input:checked + span { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.rating input:focus-visible + span { outline: 3px solid var(--focus); }
.rating-scale { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); max-width: 300px; margin-top: 6px; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.vote-status { display: flex; align-items: center; gap: 10px; font-size: .86rem; color: var(--muted); min-height: 24px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--navy-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.thanks { text-align: center; padding: 10px 0 18px; }
.thanks .tick-big { width: 60px; height: 60px; border-radius: 50%; background: rgba(15, 166, 80, .12); color: #0a7a3b; display: grid; place-items: center; margin: 0 auto 12px; }

/* ------------------------------------------------------------------ forms */
.field { margin-bottom: 16px; }
.field label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink); }
.input, .select, .textarea { width: 100%; max-width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--navy-2); box-shadow: 0 0 0 4px var(--focus); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 38px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.error-text { font-size: .82rem; color: var(--critical); margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--navy-2); flex: none; }
.form-row { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } .form-row-3 { grid-template-columns: 1fr 1fr 1fr; } }
.search-box { position: relative; }
.search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { padding-left: 42px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.filters .select, .filters .input { width: auto; min-width: 150px; min-height: 42px; }
.filters .search-box { flex: 1; min-width: 220px; }

/* ------------------------------------------------------------------ alerts / toasts */
.alert { padding: 13px 16px; border-radius: 14px; margin-bottom: 16px; font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; border: 1px solid transparent; }
.alert-success { background: rgba(12, 163, 12, .1); color: #0b5d16; border-color: rgba(12, 163, 12, .2); }
.alert-error { background: rgba(208, 59, 59, .1); color: #8b1f1f; border-color: rgba(208, 59, 59, .22); }
.alert-info { background: rgba(33, 96, 176, .08); color: #173a6b; border-color: rgba(33, 96, 176, .18); }
.alert-warning { background: rgba(250, 178, 25, .14); color: #6b4a00; border-color: rgba(250, 178, 25, .3); }
:root[data-theme="dark"] .alert-success { color: #7fe39a; } :root[data-theme="dark"] .alert-error { color: #ff9c9c; } :root[data-theme="dark"] .alert-info { color: #a9c9ff; } :root[data-theme="dark"] .alert-warning { color: #ffd98a; }
.toasts { position: fixed; z-index: 200; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid var(--line); box-shadow: var(--shadow-3); border-radius: 14px; padding: 12px 16px; font-size: .9rem; font-weight: 550; display: flex; gap: 10px; align-items: center; }

/* ------------------------------------------------------------------ tabs / segmented */
.segmented { position: relative; display: inline-flex; padding: 4px; background: var(--surface-2); border-radius: 12px; gap: 2px; }
.segmented button, .segmented a { position: relative; z-index: 1; border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: .86rem; color: var(--ink-2); cursor: pointer; text-decoration: none !important; transition: color .15s; }
.segmented .on, .segmented [aria-selected="true"] { color: var(--ink); }
.segmented .seg-thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-1); will-change: transform, width; }
.tabpanel[hidden] { display: none; }

/* ------------------------------------------------------------------ map */
.map-wrap { position: relative; border-radius: var(--r-lg); background: var(--surface-2); overflow: hidden; touch-action: none; }
.map-wrap svg { width: 100%; height: auto; display: block; aspect-ratio: 8100 / 9800; max-height: 640px; margin: 0 auto; cursor: grab; }
.map-wrap svg:active { cursor: grabbing; }
.map-wrap path.area { stroke: var(--surface); stroke-width: 1.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: fill .3s ease, opacity .2s; cursor: pointer; }
.map-wrap path.area:hover, .map-wrap path.area:focus { stroke: var(--ink); stroke-width: 2; outline: none; }
.map-wrap path.area.dim { opacity: .35; }
.map-wrap path.area.sel { stroke: var(--ink); stroke-width: 2.5; }
.map-wrap path.ctx { fill: var(--surface-3); stroke: var(--surface); stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-tools { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.map-tools button { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass-strong); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); cursor: pointer; font-size: 1.1rem; font-weight: 700; color: var(--ink); display: grid; place-items: center; }
.map-tools button:active { transform: scale(.94); }
.map-crumb { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; gap: 6px; align-items: center; }
.map-crumb button { border: 1px solid var(--line); background: var(--glass-strong); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-radius: 999px; padding: 7px 12px; font-weight: 600; font-size: .82rem; cursor: pointer; color: var(--ink); }
.map-tip { position: fixed; z-index: 120; pointer-events: none; min-width: 180px; max-width: 260px; padding: 10px 12px; border-radius: 12px; background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid var(--line); box-shadow: var(--shadow-3); font-size: .82rem; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.map-tip.on { opacity: 1; transform: none; }
.map-tip strong { display: block; font-size: .9rem; margin-bottom: 4px; }
.map-tip .tr { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .82rem; color: var(--ink-2); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.legend-ramp { height: 10px; border-radius: 6px; width: 180px; background: linear-gradient(90deg, #dbe7f7, #9ec5f4, #3987e5, #1c5cab, #0d366b); }
.map-side { display: grid; gap: 14px; align-content: start; }
.area-panel h3 { margin: 0 0 4px; }

/* ------------------------------------------------------------------ charts */
.chart-box { position: relative; height: 320px; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 400px; }
.table-toggle { font-size: .82rem; }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { padding: 18px; }
.kpi .lbl { font-size: .8rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .num { font-size: 1.85rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.delta-up { color: #0a7a3b; } .delta-down { color: var(--critical); }
:root[data-theme="dark"] .delta-up { color: #52d58b; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ content */
.prose { font-size: 1.04rem; line-height: 1.75; color: var(--ink-2); max-width: 72ch; }
.prose h2, .prose h3 { color: var(--ink); margin-top: 1.8em; }
.prose img { border-radius: var(--r); margin: 1.5em 0; }
.prose blockquote { margin: 1.5em 0; padding: .4em 1.2em; border-left: 4px solid var(--green); color: var(--ink); font-style: italic; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--r); height: auto; }
.page-head { padding: clamp(36px, 6vw, 64px) 0 clamp(20px, 3vw, 32px); background: linear-gradient(180deg, rgba(33, 96, 176, .06), transparent); }
.page-head h1 { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 22ch; margin-top: 10px; }
.crumbs { font-size: .82rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.post-card .cover { aspect-ratio: 16/9; border-radius: var(--r); background: var(--surface-2) center/cover; margin-bottom: 14px; overflow: hidden; display: grid; place-items: center; }
.post-card .cover.ph { background: linear-gradient(135deg, #173a6b, #2160b0 55%, #0fa650); color: rgba(255, 255, 255, .9); font-weight: 700; letter-spacing: -.01em; padding: 18px; text-align: center; font-size: .95rem; }
.post-card h3 { font-size: 1.06rem; margin: 6px 0 8px; }
.post-card p { color: var(--muted); font-size: .92rem; margin: 0; }
.methodology-box { border-left: 4px solid var(--navy-2); }
.methodology-box dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: .9rem; }
.methodology-box dt { color: var(--muted); font-weight: 600; }
.methodology-box dd { margin: 0; }
.pillar .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px; color: #fff; }
.service-card ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .88rem; color: var(--ink-2); }
.service-card li::before { content: "✓"; color: var(--green); font-weight: 800; margin-right: 8px; }
details.faq { border-bottom: 1px solid var(--line); padding: 4px 0; }
details.faq summary { cursor: pointer; list-style: none; padding: 16px 36px 16px 0; font-weight: 650; font-size: 1.04rem; position: relative; letter-spacing: -.01em; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.5rem; font-weight: 400; color: var(--muted); transition: transform .25s var(--ease-out); }
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq .ans { padding: 0 0 18px; color: var(--ink-2); line-height: 1.7; }
.video-card .thumb { aspect-ratio: 16/9; border-radius: var(--r); background: linear-gradient(135deg, #0f1b2d, #173a6b); display: grid; place-items: center; color: #fff; margin-bottom: 12px; position: relative; overflow: hidden; }
.video-card .thumb .play { width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: grid; place-items: center; }
.video-card .src { position: absolute; left: 12px; bottom: 10px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.share { display: flex; flex-wrap: wrap; gap: 8px; }
.share a, .share button { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: transform .1s, background-color .15s; }
.share a:hover, .share button:hover { background: var(--surface-2); text-decoration: none; }
.share a:active, .share button:active { transform: scale(.94); }
.share svg { width: 19px; height: 19px; }
.comment { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment .who { font-weight: 650; font-size: .92rem; }
.comment .when { font-size: .78rem; color: var(--muted); margin-left: 8px; }
.comment p { margin: 6px 0 0; color: var(--ink-2); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto 12px; opacity: .5; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .9rem; padding: 0 12px; color: var(--ink); }
.pagination .on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cta-band { border-radius: var(--r-xl); padding: clamp(28px, 5vw, 56px); background: radial-gradient(60% 120% at 0% 0%, rgba(15, 166, 80, .35), transparent 60%), linear-gradient(135deg, #0f2a52, #173a6b 50%, #1d4f91); color: #fff; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, .82); }
.cta-band .input { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.cta-band .input::placeholder { color: rgba(255, 255, 255, .6); }
.countdown { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ------------------------------------------------------------------ footer */
.footer { background: #0b1628; color: rgba(255, 255, 255, .78); padding: 64px 0 28px; margin-top: 40px; font-size: .92rem; }
.footer a { color: rgba(255, 255, 255, .86); }
.footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; } }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer .brand img { filter: brightness(0) invert(1); height: 40px; margin-bottom: 16px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 40px; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: .8rem; color: rgba(255, 255, 255, .55); }
.socials { display: flex; gap: 8px; margin-top: 16px; }
.socials a { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); }
.socials svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ account */
.auth-wrap { min-height: calc(100vh - 200px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.8rem; }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ reveal on scroll (opacity + small translate; disabled for reduced motion) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ accessibility preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card-link:hover { transform: none; }
  .badge-live::before { animation: none; }
  .nav-menu { transition: opacity .15s ease, visibility 0s .15s; transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav, .sheet, .nav-menu, .glass, .toast, .map-tip, .map-tools button, .map-crumb button { background: var(--surface) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(15, 27, 45, .3); --line-2: rgba(15, 27, 45, .5); --muted: #3c4a5d; }
  .card, .btn-ghost, .chip, .opt { border-width: 2px; }
}
@media (forced-colors: active) {
  .bar > i { forced-color-adjust: none; }
  .opt:has(input:checked) { outline: 3px solid Highlight; }
}

/* ------------------------------------------------------------------ print (reports & results print cleanly to PDF) */
@media print {
  .topbar, .nav, .footer, .sheet, .scrim, .no-print, .share, .demo-banner, .map-tools, .toasts { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .section { padding: 16px 0; }
  a { color: #000; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* Same dark overrides when the theme follows the device (auto) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .eyebrow { color: #7fb0f5; }
  :root:not([data-theme="light"]) .demo-banner { background: #3a2c08; color: #ffd98a; }
  :root:not([data-theme="light"]) .brand img, .dark-logo { filter: brightness(0) invert(1) contrast(.9); }
  :root:not([data-theme="light"]) .nav-links > a.is-active { color: #9cc3ff; }
  :root:not([data-theme="light"]) .badge-live { color: #52d58b; }
  :root:not([data-theme="light"]) .badge-upcoming { color: #f6a35c; }
  :root:not([data-theme="light"]) .badge-sci { color: #9cc3ff; }
  :root:not([data-theme="light"]) .alert-success { color: #7fe39a; }
  :root:not([data-theme="light"]) .alert-error { color: #ff9c9c; }
  :root:not([data-theme="light"]) .alert-info { color: #a9c9ff; }
  :root:not([data-theme="light"]) .alert-warning { color: #ffd98a; }
  :root:not([data-theme="light"]) .delta-up { color: #52d58b; }
}

/* ------------------------------------------------------------------ party tags beside contestants */
.party-tag { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 650; color: var(--ink-2, var(--muted)); letter-spacing: .01em; white-space: nowrap; }
.party-tag i { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.opt .sub .party-tag, .result-head .party .party-tag { font-size: inherit; }
.mini-results .party-tag { margin-left: 6px; font-size: .7rem; }

/* ------------------------------------------------------------------ required "About you" fields on the ballot */
.req { color: var(--critical, #b42318); font-weight: 700; }
.field.has-error .select, .field.has-error .input { border-color: var(--critical, #b42318); box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical, #b42318) 18%, transparent); }
.field.has-error label { color: var(--critical, #b42318); }

/* ------------------------------------------------------------------ Insights menu arrow */
.nav-drop > button .nav-chev { width: 14px; height: 14px; flex: none; margin-left: 2px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.nav-drop:hover > button .nav-chev, .nav-drop.open > button .nav-chev, .nav-drop > button[aria-expanded="true"] .nav-chev { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .nav-drop > button .nav-chev { transition: none; } }

/* ------------------------------------------------------------------ total under each question's results */
.result-total { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: .88rem; font-weight: 650; color: var(--ink-2, var(--ink)); text-align: right; }
