/* ===========================================================
 * GHANA POLLS — Design System v2
 * Brand: Ghana Polls · Street Parliament
 * Operator: Xinc Labs
 * Stack: Single CSS file, custom-property driven, dark-mode aware.
 * Type: Space Grotesk
 * ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&display=swap');

/* ── 1. Tokens ─────────────────────────────────────────── */
:root {
  /* Brand neutrals (light mode) */
  --cream:        #F4F1EB;
  --surface:      #FFFFFF;
  --surface-2:    #EDE9E1;
  --surface-3:    #E1DCD2;
  --border:       #D6D0C4;
  --border-2:     #C2BBAD;

  /* Ink */
  --ink:          #141414;
  --ink-2:        #3B3B3B;
  --ink-3:        #6F6F6F;
  --ink-4:        #9C9A93;

  /* Brand accents */
  --accent:       #C97B2A;     /* Ghana amber */
  --accent-2:     #B36821;     /* darker hover */
  --accent-soft:  #F4E0C2;     /* tinted background */

  /* Semantic palette */
  --green:        #1F9D5C;
  --green-soft:   rgba(31,157,92,.12);
  --amber:        #E2A11A;
  --amber-soft:   rgba(226,161,26,.14);
  --red:          #C9342B;
  --red-soft:     rgba(201,52,43,.10);

  /* Typography */
  --font:         'Space Grotesk', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Merriweather', ui-serif, Georgia, serif;

  /* Spacing — 4px grid */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-8:  32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;

  /* Radius */
  --r-1:    4px;
  --r-2:    8px;
  --r-3:   12px;
  --r-4:   16px;
  --r-5:   24px;
  --r-full: 999px;

  /* Elevation (single warm shadow scale) */
  --elev-1: 0 1px 2px rgba(20,20,20,.06);
  --elev-2: 0 2px 8px rgba(20,20,20,.08);
  --elev-3: 0 8px 24px rgba(20,20,20,.10);
  --elev-4: 0 18px 40px rgba(20,20,20,.14);

  /* Motion */
  --ease:        cubic-bezier(.2,.7,.2,1);
  --ease-spring: cubic-bezier(.22,1.2,.36,1);
  --d-fast:  140ms;
  --d-base:  220ms;
  --d-slow:  420ms;

  /* Layout */
  --container: 1200px;
  --topbar-h:  64px;

  /* Compatibility aliases (legacy names used inline) */
  --black:        var(--ink);
  --gray:         var(--ink-3);
  --gray-mid:     var(--ink-2);
  --gray-light:   var(--ink-4);
  --surface-dark: var(--surface-2);
  --available:    var(--green);
  --warning:      var(--amber);
  --error:        var(--red);
  --accent-light: var(--accent-soft);
  --r-sm: var(--r-1);
  --r-md: var(--r-2);
  --r-lg: var(--r-4);
  --r-xl: var(--r-5);
  --shadow-xs: var(--elev-1);
  --shadow-sm: var(--elev-2);
  --shadow-md: var(--elev-3);
  --shadow-lg: var(--elev-4);
  --shadow-cta:0 8px 18px rgba(20,20,20,.16);
}

/* ── 2. Dark theme ─────────────────────────────────────── */
body.dark, body.theme-dark {
  --cream:        #0F1216;
  --surface:      #161A20;
  --surface-2:    #1E232B;
  --surface-3:    #2A303A;
  --border:       #2C323B;
  --border-2:     #3B414B;

  --ink:          #F2EFE7;
  --ink-2:        #C9C5BA;
  --ink-3:        #8C8A82;
  --ink-4:        #5E5C56;

  --accent-soft:  rgba(201,123,42,.18);

  --elev-1: 0 1px 2px rgba(0,0,0,.30);
  --elev-2: 0 2px 8px rgba(0,0,0,.36);
  --elev-3: 0 8px 24px rgba(0,0,0,.42);
  --elev-4: 0 18px 40px rgba(0,0,0,.48);
}

/* ── 3. Reset / base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02";
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── 4. Typography helpers ─────────────────────────────── */
.h-display {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1.05;
}
.h-title {
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.12;
}
.h-section {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.h-card {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--accent);
}
.muted {
  color: var(--ink-3);
}
.lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
}

/* ── 5. Topbar ─────────────────────────────────────────── */
.topbar-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--green) 0%, #FFC83A 50%, var(--red) 100%);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 0 var(--s-6);
  background: color-mix(in oklab, var(--cream) 90%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-shrink: 0;
}
.topbar-brand .flag {
  width: 30px;
  height: 22px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: var(--elev-1);
}
.topbar-wordmark {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink);
}
.topbar-wordmark span {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--ink-3);
  margin-top: 3px;
}
.topbar-spacer { flex: 1; }
.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--ink);
  color: var(--cream);
}
.topbar-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}
.topbar-disclaimer {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: right;
  line-height: 1.3;
}
.topbar-disclaimer strong {
  display: block;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1.5px;
}
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center; justify-content: center;
  color: var(--ink);
  transition: background var(--d-fast) var(--ease), transform var(--d-base) var(--ease);
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--surface-2); transform: rotate(15deg); }
.theme-toggle svg { width: 16px; height: 16px; }

/* ── 6. Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: transform var(--d-fast) var(--ease),
              background var(--d-fast) var(--ease),
              box-shadow var(--d-fast) var(--ease),
              border-color var(--d-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--ink);
  color: var(--cream);
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--elev-3);
}
.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-cta);
}
.btn-accent:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-2);
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--ink);
}
.btn-sm { padding: 8px 16px; font-size: 11px; letter-spacing: 1.1px; }
.btn-lg { padding: 14px 28px; font-size: 14px; }
.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-loading .spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

body.dark .btn-primary { background: var(--accent); }
body.dark .btn-primary:hover { background: var(--accent-2); }

/* ── 7. Surfaces / cards ───────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  box-shadow: var(--elev-1);
}
.card-pad {
  padding: var(--s-6);
}

/* ── 8. Forms ──────────────────────────────────────────── */
.form-group { margin-bottom: var(--s-5); }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s-2);
}
.form-input,
.form-select {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-2);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: border-color var(--d-fast) var(--ease),
              box-shadow var(--d-fast) var(--ease);
  appearance: none;
}
.form-input:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.form-select-wrap { position: relative; }
.form-select-wrap::after {
  content: '';
  position: absolute;
  right: 16px; top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* ── 9. Footer ─────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--s-6) var(--s-8);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: 13px;
  color: var(--ink-3);
}
.site-footer-left strong {
  color: var(--accent);
  font-weight: 600;
}
.site-footer-nav {
  display: flex;
  gap: var(--s-5);
}
.site-footer-nav a {
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: .3px;
  transition: color var(--d-fast) var(--ease);
}
.site-footer-nav a:hover { color: var(--accent); }

/* ── 10. Toast ─────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column;
  gap: 8px;
}
.toast {
  min-width: 240px; max-width: 320px;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--r-2);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--elev-3);
  animation: toastIn 220ms var(--ease-spring) forwards;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--amber); }
@keyframes toastIn {
  from { opacity:0; transform: translateY(-8px); }
  to   { opacity:1; transform: translateY(0); }
}

/* ── 11. Spinner / utility ─────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .6; transform: scale(1.3); }
}
.hidden { display: none !important; }
.divider {
  border: 0;
  height: 1px;
  background: var(--border);
}

/* ── 12. Mobile breakpoints ────────────────────────────── */
@media (max-width: 900px) {
  .topbar-disclaimer { display: none; }
}
@media (max-width: 700px) {
  .topbar { padding: 0 var(--s-4); gap: var(--s-3); }
  .topbar-pill { display: none; }
  .topbar-wordmark span { display: none; }
}
@media (max-width: 480px) {
  .site-footer { flex-direction: column; align-items: flex-start; }
}

/* ── 13. Live PHP application pages ───────────────────── */
:root {
  --accent-primary: var(--accent);
  --accent-secondary: var(--amber);
  --accent-success: var(--green);
  --accent-danger: var(--red);
  --accent-warning: var(--amber);
  --text-tertiary: var(--ink-4);
  --radius-sm: var(--r-1);
  --radius-md: var(--r-2);
  --radius-lg: var(--r-4);
  --radius-xl: var(--r-5);
  --radius-pill: var(--r-full);
}

body.theme-light { background: var(--cream); color: var(--ink); }
body.theme-dark { background: var(--cream); color: var(--ink); }

.topbar-link {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color var(--d-fast) var(--ease);
}
.topbar-link:hover,
.topbar-link.active { color: var(--accent); }

/* Flow navigation (Welcome → Info → Vote → Results) */
.flow-nav {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-6) var(--s-8) 0;
}
.flow-nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}
.flow-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2px;
  transition: transform var(--d-fast) var(--ease), background var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}
.flow-step:hover { transform: translateY(-1px); border-color: var(--ink-3); }
.flow-step.is-active {
  background: var(--accent-soft);
  border-color: rgba(201, 52, 43, .25);
  color: var(--accent);
}
body.dark .flow-step.is-active,
body.theme-dark .flow-step.is-active {
  border-color: rgba(228, 96, 77, .35);
}
.flow-step.is-done {
  background: rgba(28, 184, 124, .10);
  border-color: rgba(28, 184, 124, .30);
  color: var(--green);
}
.flow-step.is-disabled { opacity: .55; pointer-events: none; }
.flow-sep {
  color: var(--ink-4);
  font-weight: 900;
  padding: 0 2px;
}
.flow-note {
  margin-top: var(--s-3);
  font-size: 12px;
  color: var(--ink-3);
}
.flow-context {
  margin-top: var(--s-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}


.page-shell {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-10) var(--s-8) var(--s-16);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  margin-bottom: var(--s-8);
}
.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-3);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}
.page-title {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  color: var(--ink);
}
.page-subtitle {
  margin-top: var(--s-3);
  max-width: 720px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
}

/* Poll page */
.poll-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: var(--s-6);
  align-items: start;
  max-width: 1180px;
  margin: var(--s-8) auto 0;
  padding: 0 var(--s-8) var(--s-12);
}
.poll-card,
.comments-section,
.center-card,
.dashboard-panel,
.content-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  box-shadow: var(--elev-1);
}
.poll-card {
  position: sticky;
  top: calc(var(--topbar-h) + var(--s-4));
  padding: var(--s-10);
  box-shadow: var(--elev-2);
}
.poll-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}
.poll-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}
.poll-label .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}
.poll-headline {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.18;
  color: var(--ink);
  margin-bottom: var(--s-6);
}
.poll-context {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
}
.context-chip,
.results-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.context-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--d-fast) var(--ease), background var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
}
.context-link:hover{ transform: translateY(-1px); border-color: var(--ink-3); }
.poll-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.pill.vote-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 16px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-3);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform var(--d-base) var(--ease),
              box-shadow var(--d-base) var(--ease),
              border-color var(--d-base) var(--ease),
              background var(--d-base) var(--ease),
              opacity var(--d-fast) var(--ease);
}
.pill.vote-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--elev-2);
  border-color: var(--ink-3);
}
.pill.vote-btn:disabled {
  cursor: not-allowed;
}
.vote-btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.icon-yes { background: var(--green); }
.icon-neutral { background: var(--amber); }
.icon-no { background: var(--red); }
.vote-btn-text { flex: 1; min-width: 0; }
.vote-btn-label { font-size: 16px; font-weight: 700; }
.vote-btn-sub {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
  text-transform: none;
  letter-spacing: 0;
}
.confirm-box {
  margin-bottom: var(--s-4);
  padding: var(--s-5);
  background: var(--surface-2);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-3);
  animation: slideDown 220ms var(--ease);
}
body.dark .confirm-box,
body.theme-dark .confirm-box { border-color: var(--accent); }
.confirm-header {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}
.confirm-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.confirm-choice {
  color: var(--accent);
  font-weight: 700;
}
.confirm-note {
  margin: var(--s-2) 0 var(--s-4);
  color: var(--ink-3);
  font-size: 12px;
}
.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.vote-success {
  text-align: center;
  padding: var(--s-5);
}
.vote-success h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: var(--s-2);
}
.vote-success p { color: var(--ink-3); }
.view-results-wrap.simple {
  display: flex;
  justify-content: center;
  margin-top: var(--s-4);
}
.view-results-btn-simple,
.view-full {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}
.mini-results {
  margin-top: var(--s-6);
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
}
.mini-results-title,
.results-panel-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s-4);
}

/* Results bars shared by main.js and results pages */
.results-area { margin-top: var(--s-4); }
.result-row { margin-bottom: var(--s-4); }
.result-meta,
.result-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: 6px;
  color: var(--ink-3);
  font-size: 13px;
}
.result-meta .choice,
.result-row-head span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 700;
}
.result-meta .stats,
.result-row-pct {
  color: var(--ink-3);
  font-weight: 700;
}
.bar,
.bar-track,
.mini-bar-track {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
}
.bar {
  height: 26px;
}
.bar-track {
  height: 8px;
}
.mini-bar-track {
  height: 22px;
  border-radius: var(--r-1);
}
.bar-fill,
.mini-bar-fill {
  height: 100%;
  display: flex;
  align-items: center;
  border-radius: inherit;
  font-size: 11px;
  font-weight: 700;
  transition: width 1s var(--ease);
}
.bar-fill {
  padding: 0 12px;
  color: #fff;
}
.bar-fill.yes,
.bar-yes,
.mini-yes { background: var(--green); }
.bar-fill.neutral,
.bar-neutral,
.mini-neutral { background: var(--amber); color: rgba(0,0,0,.85); }
.bar-fill.no,
.bar-no,
.mini-no { background: var(--red); }
.results-total {
  margin-top: var(--s-3);
  color: var(--ink-3);
  font-size: 12px;
  text-align: right;
}

/* Comments */
.comments-section {
  position: sticky;
  top: calc(var(--topbar-h) + var(--s-4));
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - var(--s-12));
  overflow: hidden;
}
.comments-header {
  padding: var(--s-5) var(--s-5) var(--s-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-shrink: 0;
}
.comments-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.comment-count,
.comment-total-count {
  font-size: 11px;
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-weight: 700;
}
.comments-canvas {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.comment-input-area {
  padding: var(--s-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.input-wrapper,
.reply-input-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.user-avatar,
.comment-avatar { flex-shrink: 0; }
.avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
body.dark .avatar-placeholder,
body.theme-dark .avatar-placeholder {
  background: var(--accent);
  color: #fff;
}
.comments-section textarea,
.reply-input-wrapper textarea {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: var(--r-2);
  color: var(--ink);
  font-size: 14px;
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: border-color var(--d-fast) var(--ease), background var(--d-fast) var(--ease);
}
.comments-section textarea:focus,
.reply-input-wrapper textarea:focus {
  background: var(--surface);
  border-color: var(--accent);
}
.comments-section textarea::placeholder,
.reply-input-wrapper textarea::placeholder { color: var(--ink-4); }
.input-actions,
.reply-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
  padding-left: 42px;
}
.char-count {
  color: var(--ink-4);
  font-size: 11px;
}
.comment-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.comment-item {
  display: flex;
  gap: 10px;
  padding: var(--s-4);
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: background var(--d-fast) var(--ease);
}
.comment-item:hover { background: var(--surface-2); }
.comment-item.reply {
  margin-left: 42px;
  padding: var(--s-3) var(--s-4);
  border-bottom-color: transparent;
  border-top: 1px dashed var(--border);
}
.comment-item.reply::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.comment-avatar .avatar-placeholder {
  width: 28px;
  height: 28px;
  font-size: 11px;
}
.comment-content {
  flex: 1;
  min-width: 0;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.comment-username {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.comment-badge {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-full);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
}
.comment-badge.diaspora {
  background: var(--green-soft);
  color: var(--green);
}
.comment-time {
  color: var(--ink-4);
  font-size: 11px;
}
.comment-text {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  margin-bottom: var(--s-2);
}
.comment-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.comment-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: transparent;
  border: none;
  border-radius: var(--r-1);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  transition: background var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}
.comment-action:hover {
  background: var(--surface-2);
  color: var(--accent);
}
.comment-action.liked { color: var(--red); }
.comment-action svg {
  width: 14px;
  height: 14px;
}
.reply-form {
  margin-top: var(--s-3);
  padding: var(--s-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.reply-actions {
  justify-content: flex-end;
  padding-left: 0;
}
.loading-comments,
.no-comments,
.error-state {
  text-align: center;
  padding: var(--s-10) var(--s-5);
  color: var(--ink-3);
}
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto var(--s-3);
}

/* Results pages */
.results {
  max-width: 1080px;
  margin: var(--s-10) auto 0;
  padding: 0 var(--s-8) var(--s-16);
}
.results-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--s-5);
  margin-bottom: var(--s-8);
}
.results-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-3);
}
.results-title {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: var(--s-2);
}
.results-question {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.5;
}
.results-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.results-refresh {
  font-size: 11px;
  color: var(--ink-3);
}
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
  margin-bottom: var(--s-8);
}
.summary-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  padding: var(--s-6);
  transition: box-shadow var(--d-base) var(--ease), transform var(--d-base) var(--ease);
}
.summary-card:hover {
  box-shadow: var(--elev-2);
  transform: translateY(-2px);
}
.summary-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.ac-yes { background: var(--green); }
.ac-neutral { background: var(--amber); }
.ac-no { background: var(--red); }
.summary-label {
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: var(--s-2);
}
.summary-pct {
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}
.pct-yes { color: var(--green); }
.pct-neutral { color: var(--amber); }
.pct-no { color: var(--red); }
.summary-votes {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
}
.results-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  padding: var(--s-8);
  margin-bottom: var(--s-6);
  box-shadow: var(--elev-1);
}
.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 60px;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}
.bar-row:last-child { margin-bottom: 0; }
.bar-choice {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.bar-votes {
  color: var(--ink-3);
  font-size: 11px;
  margin-top: 2px;
}
.bar-track-lg {
  height: 40px;
  background: var(--surface-2);
  border-radius: var(--r-2);
  overflow: hidden;
}
.bar-fill-lg {
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: var(--s-4);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--r-2);
  transition: width 1s var(--ease);
}
.bar-fill-lg.yes { background: var(--green); }
.bar-fill-lg.neutral { background: var(--amber); color: rgba(0,0,0,.85); }
.bar-fill-lg.no { background: var(--red); }
.bar-pct {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  text-align: right;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
  margin-bottom: var(--s-8);
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-5);
  text-align: center;
}
.stat-num {
  color: var(--ink);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.breakdown-tabs {
  display: inline-flex;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--r-2);
  margin-bottom: var(--s-5);
}
.breakdown-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
}
.breakdown-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--elev-1);
}
.breakdown-panel { display: none; }
.breakdown-panel.active { display: block; }
.breakdown-head-row,
.breakdown-row {
  display: grid;
  grid-template-columns: 140px 1fr 1fr 1fr;
  gap: var(--s-3);
  align-items: center;
}
.breakdown-head-row {
  padding: 0 var(--s-4) var(--s-2);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-2);
}
.breakdown-row {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-2);
  margin-bottom: 4px;
}
.breakdown-row:hover { background: var(--surface-2); }
.breakdown-head-cell {
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  text-align: center;
}
.breakdown-head-cell:first-child { text-align: left; }
.breakdown-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.mini-bar-fill {
  padding-left: 8px;
  color: #fff;
}
.action-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-8);
}

/* Advanced dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--s-6);
}
.dashboard-panel {
  padding: var(--s-6);
}
.dashboard-control {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}
.dashboard-control label {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.metric-list {
  display: grid;
  gap: var(--s-3);
}
.dashboard-metrics {
  margin-top: var(--s-6);
}
.metric-item {
  padding: var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.metric-value {
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.metric-label {
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

/* Content pages */
.center-card {
  max-width: 760px;
  margin: var(--s-10) auto var(--s-16);
  padding: var(--s-8);
}
.content-panel {
  padding: var(--s-6);
}
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
  margin-top: var(--s-8);
}
.content-panel h3,
.privacy-section h3 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--s-3);
}
.content-panel p,
.privacy-section p,
.privacy-section li {
  color: var(--ink-2);
  line-height: 1.65;
}
.content-panel strong,
.privacy-section strong { color: var(--ink); }
.privacy-section {
  display: grid;
  gap: var(--s-6);
  margin-top: var(--s-8);
}
.privacy-section ul {
  margin-top: var(--s-3);
  padding-left: var(--s-6);
}

.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-error { border-left: 3px solid var(--red); }
.toast.toast-warning { border-left: 3px solid var(--amber); }
.toast-content {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.toast-message { flex: 1; }
.toast-close {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 16px;
  line-height: 1;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .poll-wrap,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .poll-card,
  .comments-section {
    position: static;
  }
  .comments-section { max-height: 72vh; }
}
@media (max-width: 800px) {
  .page-shell,
  .results {
    padding: var(--s-6) var(--s-5) var(--s-12);
    margin-top: 0;
  }
  .poll-wrap {
    padding: var(--s-5) var(--s-5) var(--s-10);
    margin-top: 0;
  }
  .poll-card,
  .center-card,
  .results-panel {
    padding: var(--s-6);
  }
  .page-head,
  .results-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .results-meta { align-items: flex-start; }
  .summary-cards { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .bar-row { grid-template-columns: 70px 1fr 50px; }
  .breakdown-head-row,
  .breakdown-row {
    grid-template-columns: 96px 1fr 1fr 1fr;
    gap: var(--s-2);
    padding-left: var(--s-2);
    padding-right: var(--s-2);
  }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .topbar-link { display: none; }
  .poll-card-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .poll-headline { font-size: 24px; }
  .poll-card,
  .center-card,
  .results-panel {
    border-radius: var(--r-4);
  }
  .pill.vote-btn {
    align-items: flex-start;
    padding: 14px;
  }
  .breakdown-head-row,
  .breakdown-row {
    grid-template-columns: 80px 1fr 1fr 1fr;
  }
  .breakdown-label { font-size: 11px; }
  .mini-bar-fill { font-size: 0; padding-left: 0; }
  .comment-item.reply { margin-left: 24px; }
  .comment-item.reply::before { left: -12px; }
}

/* ── Pro redesign: Home, Gate, Vote ───────────────────── */
.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: .85em;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 4px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100% { opacity:1 } 50% { opacity:0 } }

.home-shell {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-10) var(--s-8) var(--s-16);
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
}
.hero-pro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: var(--s-12);
  align-items: start;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ink-2);
}
.hero-badge-flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; }
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero-title {
  margin-top: var(--s-4);
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1.05;
  color: var(--ink);
}
.hero-lead {
  margin-top: var(--s-5);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 560px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

/* Home inline gate (old-design inspired) */
.quick-gate{
  margin-top: var(--s-6);
  max-width: 720px;
  padding: var(--s-6);
  border-radius: var(--r-5);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface) 60%, var(--surface-2) 100%);
  box-shadow: var(--elev-2);
}

.quick-gate-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}

.quick-gate-kicker{
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.9px;
  text-transform: uppercase;
  color: var(--accent);
}

.quick-gate-title{
  margin-top: 6px;
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
}

.quick-gate-sub{
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.55;
}

.quick-gate-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-6);
}

.quick-gate-block{ min-width: 0; }
.quick-gate-hint{ margin-top: var(--s-3); font-size: 12px; color: var(--ink-3); }

.quick-gate-actions{
  margin-top: var(--s-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* Segmented (radio) options */
.seg{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-2);
}

.seg-opt{
  position: relative;
  display: block;
}

.seg-opt input{
  position: absolute;
  inset: 0;
  opacity: 0;
}

.seg-opt span{
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .2px;
  cursor: pointer;
  transition: transform var(--d-fast) var(--ease), background var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}

.seg-opt span:hover{ transform: translateY(-1px); border-color: var(--accent); background: var(--accent-soft); }
.seg-opt input:focus-visible + span{ outline: 2px solid rgba(201,123,42,.45); outline-offset: 2px; }

.seg-opt input:checked + span{
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
body.dark .seg-opt input:checked + span{ background: var(--accent); border-color: var(--accent); color: #fff; }
.hero-metrics {
  margin-top: var(--s-8);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-6);
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
}
.hero-metrics .metric-num {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--ink);
}
.hero-metrics .metric-label {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
}
.hero-panel { display: grid; gap: var(--s-5); }
.hero-card-pro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  padding: var(--s-6);
  box-shadow: var(--elev-3);
}
.hero-card-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-3);
}
.hero-question {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: var(--s-5);
}
.hero-bars { display: grid; gap: var(--s-3); }
.hero-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.hero-bar-track {
  height: 7px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}
.hero-bar-fill { height: 100%; border-radius: var(--r-full); transition: width 1.2s var(--ease); }

.hero-brief {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  padding: var(--s-5);
}
.hero-brief-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--s-3);
}
.hero-brief ul { padding-left: var(--s-6); color: var(--ink-2); line-height: 1.6; }

.section-slab {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  padding: var(--s-10);
  box-shadow: var(--elev-1);
}
.section-slab.slab-alt { background: var(--surface-2); }
.slab-head { max-width: 680px; }
.slab-title {
  margin-top: var(--s-2);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  color: var(--ink);
}
.slab-sub {
  margin-top: var(--s-3);
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.6;
}
.flow-steps {
  margin-top: var(--s-8);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
}
.flow-step {
  padding: var(--s-6);
  border-radius: var(--r-4);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--elev-1);
}
.flow-step-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--s-3);
}
.flow-step h3 { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: var(--s-2); }
.flow-step p { color: var(--ink-2); line-height: 1.6; }

.slab-grid {
  margin-top: var(--s-8);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
}
.slab-card {
  padding: var(--s-6);
  border-radius: var(--r-4);
  border: 1px solid var(--border);
  background: var(--surface);
}
.slab-card h4 { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: var(--s-2); }
.slab-card p { color: var(--ink-2); line-height: 1.6; }

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
  padding: var(--s-8);
  border-radius: var(--r-5);
  background: var(--ink);
  color: var(--cream);
}
.cta-title { font-size: 22px; font-weight: 700; }
.cta-sub { margin-top: var(--s-2); color: rgba(255,255,255,.8); }
.cta-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.cta-band .btn { box-shadow: none; }
.cta-band .btn-primary {
  background: #fff;
  color: #111;
  border-color: transparent;
}
.cta-band .btn-primary:hover {
  background: #f2f2f2;
}
.cta-band .btn-ghost {
  color: #fff;
  border-color: rgba(255,255,255,.4);
}
.cta-band .btn-ghost:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.7);
}

/* Gate page */
.gate-shell{
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-10) var(--s-8) var(--s-16);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: var(--s-10);
  align-items: start;
}

.gate-aside{ display: grid; gap: var(--s-6); }

.gate-aside-card{
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface) 65%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  padding: var(--s-8);
  box-shadow: var(--elev-2);
}

.gate-mini-steps{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gate-mini-step{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.gate-mini-step.is-active{
  background: var(--accent);
  border-color: var(--accent);
}

.gate-mini-step.is-done{
  background: var(--ink);
  border-color: var(--ink);
}
body.dark .gate-mini-step.is-done{ background: var(--accent); border-color: var(--accent); }

.gate-mini-label{
  margin-left: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-3);
}

.gate-kicker{
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--accent);
}

.gate-title{
  margin-top: var(--s-2);
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.9px;
  line-height: 1.1;
  color: var(--ink);
}

.gate-lead{
  margin-top: var(--s-4);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
}

.gate-rail{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  padding: var(--s-6);
  box-shadow: var(--elev-1);
  display: grid;
  gap: var(--s-3);
}

.gate-rail-item{
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: var(--s-3);
  align-items: start;
  padding: 10px;
  border-radius: var(--r-3);
}

.gate-rail-dot{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-2);
}

.gate-rail-title{ font-weight: 800; color: var(--ink); font-size: 13px; letter-spacing: .2px; }
.gate-rail-sub{ color: var(--ink-3); font-size: 12px; margin-top: 2px; line-height: 1.5; }

.gate-rail-item.is-active{
  background: var(--accent-soft);
  border: 1px solid rgba(0,0,0,.06);
}
body.dark .gate-rail-item.is-active{ border-color: rgba(255,255,255,.10); }

.gate-rail-item.is-active .gate-rail-dot{
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.gate-rail-item.is-done .gate-rail-dot{
  border-color: rgba(0,0,0,.10);
  background: var(--ink);
  color: var(--cream);
}
body.dark .gate-rail-item.is-done .gate-rail-dot{ background: var(--accent); color: #fff; border-color: var(--accent); }

.gate-preview{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  padding: var(--s-7);
  box-shadow: var(--elev-2);
}

.gate-preview-label{
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.9px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-3);
}

.gate-preview-question{
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: var(--s-4);
}

.gate-preview-options{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-2);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-3);
}

.gate-preview-options span{
  padding: 10px;
  border-radius: var(--r-2);
  border: 1px dashed var(--border);
  text-align: center;
  background: var(--surface-2);
}

.gate-aside-links{
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-top: var(--s-4);
}

.gate-link{
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.gate-link:hover{ color: var(--ink); border-bottom-color: var(--border); }

.gate-highlights{ display: grid; gap: var(--s-3); }

.gate-highlight{
  padding: var(--s-5);
  background: var(--surface-2);
  border-radius: var(--r-4);
  border: 1px solid var(--border);
}

.gate-highlight strong{ display:block; font-size: 14px; font-weight: 900; color: var(--ink); margin-bottom: 4px; }
.gate-highlight span{ font-size: 13px; color: var(--ink-2); line-height: 1.55; }

.gate-main{ min-width: 0; }

.gate-panel{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-6);
  padding: var(--s-10) var(--s-8);
  box-shadow: var(--elev-3);
}

.gate-panel-head{
  display: grid;
  grid-template-columns: 1fr minmax(0, 240px);
  gap: var(--s-6);
  align-items: start;
  margin-bottom: var(--s-6);
}

.gate-stepper-label{
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.9px;
  text-transform: uppercase;
  color: var(--accent);
}

.gate-stepper-title{ font-size: 26px; font-weight: 900; color: var(--ink); margin-top: var(--s-2); letter-spacing: -0.6px; }
.gate-stepper-sub{ font-size: 14px; color: var(--ink-3); margin-top: var(--s-2); line-height: 1.6; }

.gate-hint{
  margin-top: var(--s-3);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.55;
}

.gate-inline-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-2);
}

.gate-inline-tools{ flex: 1 1 220px; max-width: 420px; }
.gate-search{ height: 42px; }

.gate-summary{
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  padding: 12px 14px;
}

.gate-summary-label{ font-size: 10px; font-weight: 900; letter-spacing: 1.7px; text-transform: uppercase; color: var(--ink-3); }
.gate-summary-value{ margin-top: 6px; font-size: 13px; font-weight: 800; color: var(--ink); line-height: 1.4; }

/* Keep existing hooks (chips/tabs) but polish them */
.location-tabs{ display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); padding: 4px; border-radius: var(--r-3); margin-bottom: var(--s-5); border: 1px solid var(--border); }
.loc-tab{ padding: 10px 12px; border: none; background: transparent; border-radius: 10px; font-size: 13px; font-weight: 800; color: var(--ink-3); letter-spacing: .2px; transition: background var(--d-fast) var(--ease), color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease); }
.loc-tab.active{ background: var(--surface); color: var(--ink); box-shadow: var(--elev-1); }

.location-panel{ display: none; }
.location-panel.active{ display: block; }

.region-grid{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.region-chip{ padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 700; text-align: left; cursor: pointer; transition: border-color var(--d-fast) var(--ease), background var(--d-fast) var(--ease), color var(--d-fast) var(--ease), transform var(--d-fast) var(--ease); }
.region-chip:hover{ border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.region-chip.selected{ border-color: var(--ink); background: var(--ink); color: var(--cream); }
body.dark .region-chip.selected{ border-color: var(--accent); background: var(--accent); color: #fff; }

.age-row{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.age-chip{ padding: 12px 10px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 900; cursor: pointer; transition: border-color var(--d-fast) var(--ease), background var(--d-fast) var(--ease), color var(--d-fast) var(--ease), transform var(--d-fast) var(--ease); }
.age-chip:hover{ border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.age-chip.selected{ border-color: var(--ink); background: var(--ink); color: var(--cream); }
body.dark .age-chip.selected{ border-color: var(--accent); background: var(--accent); color: #fff; }

.error-msg{ background: var(--red-soft); border: 1px solid rgba(201,52,43,.30); border-radius: var(--r-3); padding: 10px 14px; font-size: 13px; color: var(--red); margin-bottom: var(--s-4); }
.privacy-note{ margin-top: var(--s-4); padding: var(--s-3) var(--s-4); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-3); font-size: 12px; color: var(--ink-3); line-height: 1.55; text-align: center; }
.btn-block{ width: 100%; margin-top: var(--s-2); }

/* Vote page */
.vote-shell {
  max-width: var(--container);
  margin: var(--s-8) auto 0;
  padding: 0 var(--s-8) var(--s-12);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: var(--s-6);
  align-items: start;
}
.vote-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  padding: var(--s-10);
  box-shadow: var(--elev-2);
}
.vote-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}
.vote-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}
.vote-title {
  margin-top: var(--s-3);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.vote-choices { display: grid; gap: var(--s-3); margin-bottom: var(--s-6); }
.vote-live { margin-top: var(--s-6); }
.vote-live-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: var(--s-3); }
.vote-comments { position: sticky; top: calc(var(--topbar-h) + var(--s-4)); }

@media (max-width: 1100px) {
  .hero-pro { grid-template-columns: 1fr; }
  .flow-steps, .slab-grid { grid-template-columns: 1fr; }
  .gate-shell { grid-template-columns: 1fr; }
  .vote-shell { grid-template-columns: 1fr; }
  .vote-comments { position: static; }
}
@media (max-width: 800px) {
  .home-shell { padding: var(--s-6) var(--s-5) var(--s-12); }
  .section-slab { padding: var(--s-6); }
  .cta-band { flex-direction: column; align-items: flex-start; }
  .gate-shell { padding: var(--s-6) var(--s-5) var(--s-12); }
  .gate-panel { padding: var(--s-7) var(--s-5); }
  .vote-panel { padding: var(--s-6); }
  .quick-gate { padding: var(--s-5); }
  .quick-gate-grid { grid-template-columns: 1fr; }
  .flow-nav { padding: var(--s-5) var(--s-5) 0; }
}
@media (max-width: 520px) {
  .hero-metrics { grid-template-columns: 1fr; }
  .gate-panel-head { grid-template-columns: 1fr; }
  .region-grid { grid-template-columns: 1fr; }
  .age-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
