/* ElectionUltra design system. Brand: Ballot Blue (trust) → Verified Green (a counted vote). */

/* ------------------------------------------------------------------ tokens */
:root {
  --blue-50: #EEF2FF;
  --blue-100: #DCE3FF;
  --blue-200: #B9C7FF;
  --blue-500: #4A68FF;
  --blue-600: #2B4EFF;   /* primary: 5.8:1 on white */
  --blue-700: #1E3BD6;
  --green-50: #E8F7F1;
  --green-100: #C9EEDF;
  --green-500: #16A37F;  /* fills and icons */
  --green-700: #0B7A5E;  /* text-safe green: 5.3:1 on white */
  --navy-900: #0F1A4A;
  --navy-800: #18245E;
  --amber-50: #FFF6E5;
  --amber-600: #B45309;
  --red-50: #FDECEC;
  --red-600: #C62828;

  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #5B6478;      /* 5.9:1 on white */
  --line: #E3E7EF;
  --line-2: #EEF1F6;
  --surface: #FFFFFF;
  --bg: #F6F8FC;

  --brand-gradient: linear-gradient(135deg, var(--blue-600) 0%, var(--green-500) 100%);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 26, 74, .06);
  --shadow: 0 1px 2px rgba(15, 26, 74, .05), 0 6px 20px rgba(15, 26, 74, .07);
  --shadow-lg: 0 20px 50px rgba(15, 26, 74, .18);
  --focus: 0 0 0 3px rgba(43, 78, 255, .35);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar: 260px;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; color: var(--navy-900); letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 800; }
h3 { font-size: 1.125rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[v-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--navy-900); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ layout */
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 560px; }
.container-md { max-width: 820px; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 28px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-center { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
.text-muted { color: var(--muted); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .78rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.hide-sm { display: none !important; }
@media (min-width: 720px) { .hide-sm { display: revert !important; } .btn.hide-sm { display: inline-flex !important; } .show-sm-only { display: none !important; } }

/* ------------------------------------------------------------------ brand */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy-900); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand b { color: var(--blue-600); font-weight: 800; }
.brand-light { color: #fff; }
.brand-light b { color: #9BE7CD; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 10px;
  font: inherit; font-weight: 700; font-size: .92rem; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: 0 6px 16px rgba(43, 78, 255, .25); }
.btn-primary:hover:not(:disabled) { background: var(--blue-700); }
.btn-success { background: var(--green-700); color: #fff; }
.btn-success:hover:not(:disabled) { background: #08654E; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: #C9D0DD; background: #FAFBFD; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--line-2); }
.btn-danger { background: var(--surface); color: var(--red-600); border-color: #F3C6C6; }
.btn-danger:hover:not(:disabled) { background: var(--red-50); }
.btn-light { background: #fff; color: var(--navy-900); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .85rem; border-radius: 8px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { min-height: 36px; width: 36px; padding: 0; }
.spinner { display: inline-block; flex-shrink: 0; vertical-align: middle; width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.empty > .spinner { width: 28px; height: 28px; border-width: 3px; color: var(--blue-600); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ forms */
.field { display: block; }
.field + .field { margin-top: 14px; }
.label { display: block; margin-bottom: 6px; font-weight: 700; font-size: .875rem; color: var(--ink-2); }
.hint { margin-top: 6px; font-size: .8rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  font: inherit; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: #98A1B3; }
.input[readonly] { background: var(--line-2); color: var(--ink-2); cursor: default; }
.input-group { display: flex; align-items: stretch; }
.input-group .prefix { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: var(--line-2); color: var(--muted); font-size: .85rem; white-space: nowrap; }
.input-group .input { border-radius: 0 10px 10px 0; }
.password-field { position: relative; }
.password-field .input { padding-right: 48px; }
.password-toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.password-toggle:hover { color: var(--ink); background: var(--line-2); }
.password-toggle:focus-visible { outline: none; box-shadow: var(--focus); }
.password-toggle svg { width: 20px; height: 20px; }
.otp-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Authenticator app setup: white behind the QR code so phones can scan it in dark mode too */
.qr-code { display: block; width: 240px; height: 240px; margin: 0 auto; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.setup-steps { margin: 0; padding-left: 20px; color: var(--muted); }
.setup-steps li + li { margin-top: 6px; }
/* Voter list: how their voting key or setup link email is doing */
.mail-line { color: var(--muted); }
.mail-failed { color: var(--red-600); font-weight: 600; }
.mail-waiting, .mail-none { color: var(--amber-700); }
.setup-key {font-size: 1rem; letter-spacing: .05em; word-break: break-all; color: var(--ink); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--blue-600); }
.form-error { padding: 10px 12px; border-radius: 10px; background: var(--red-50); color: var(--red-600); font-weight: 600; font-size: .9rem; }

/* ------------------------------------------------------------------ cards & surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
@media (min-width: 720px) { .card-body { padding: 24px; } }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-header h3 { margin: 0; }
.card-hover { transition: box-shadow .15s, transform .15s, border-color .15s; }
.card-hover:hover { box-shadow: var(--shadow); border-color: var(--blue-200); transform: translateY(-1px); }
.panel { padding: 16px; border-radius: var(--radius); background: var(--line-2); }
.divider { height: 1px; background: var(--line); border: 0; margin: 20px 0; }

/* ------------------------------------------------------------------ badges & alerts */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-plain::before { display: none; }
.badge-blue { background: var(--blue-50); color: var(--blue-700); }
.badge-green { background: var(--green-50); color: var(--green-700); }
.badge-amber { background: var(--amber-50); color: var(--amber-600); }
.badge-red { background: var(--red-50); color: var(--red-600); }
.badge-navy { background: var(--navy-900); color: #fff; }
.badge-live::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid; font-size: .92rem; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert-info { background: var(--blue-50); border-color: var(--blue-100); color: var(--navy-800); }
.alert-success { background: var(--green-50); border-color: var(--green-100); color: #075842; }
.alert-warning { background: var(--amber-50); border-color: #F8DDB0; color: #7C3A06; }
.alert-danger { background: var(--red-50); border-color: #F3C6C6; color: #8E1C1C; }

/* ------------------------------------------------------------------ tables */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBFE; }

/* ------------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 12px 14px; border: 0; background: none; font: inherit; font-weight: 700; font-size: .9rem; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tab svg { width: 17px; height: 17px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--blue-600); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue-600); }
.segmented { display: inline-flex; max-width: 100%; overflow-x: auto; padding: 4px; background: var(--line-2); border-radius: 12px; gap: 4px; }
.segmented button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font: inherit; font-weight: 700; font-size: .85rem; color: var(--muted); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--navy-900); box-shadow: var(--shadow-sm); }

/* ------------------------------------------------------------------ stats & progress */
.stat { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--navy-900); font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 4px; }
.progress { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--brand-gradient); transition: width .5s ease; }

/* results bars */
.result-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; }
.result-row + .result-row { border-top: 1px solid var(--line-2); }
.result-bar { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin-top: 6px; }
.result-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--blue-200); transition: width .6s ease; }
.result-row.leading .result-bar > span { background: var(--brand-gradient); }
.result-count { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ avatars */
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--blue-50); flex: none; }
.avatar-lg { width: 88px; height: 88px; }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--blue-700); }

/* ------------------------------------------------------------------ empty state */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--blue-50); color: var(--blue-600); }
.empty-icon svg { width: 26px; height: 26px; }
.empty h3 { color: var(--navy-900); }

/* ------------------------------------------------------------------ modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 26, 74, .45); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 24px; } }
.modal { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg); }
@media (min-width: 640px) { .modal { border-radius: 20px; } }
.modal-wide { max-width: 720px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.modal-header h3 { margin: 0; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }

/* ------------------------------------------------------------------ toasts */
.toasts { position: fixed; z-index: 80; right: 16px; left: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
@media (min-width: 640px) { .toasts { left: auto; align-items: flex-end; } }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; max-width: 420px; width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--navy-900); color: #fff; box-shadow: var(--shadow-lg); font-weight: 600; font-size: .9rem; animation: toast-in .2s ease-out; }
.toast svg { width: 20px; height: 20px; flex: none; }
.toast-success svg { color: #6EE7B7; }
.toast-error { background: #7F1D1D; }
.toast-info svg { color: #A5B4FC; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------ site header & footer */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .88); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line-2); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 12px; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-footer { padding: 32px 0; color: var(--muted); font-size: .875rem; border-top: 1px solid var(--line); background: var(--surface); }

/* ------------------------------------------------------------------ marketing */
.hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(1200px 500px at 85% -10%, rgba(22, 163, 127, .55), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(43, 78, 255, .65), transparent 60%), var(--navy-900); }
.hero .container { padding-top: 72px; padding-bottom: 80px; }
.hero h1 { color: #fff; font-size: clamp(2rem, 6vw, 3.4rem); max-width: 14ch; }
.hero .lead { font-size: clamp(1.02rem, 2vw, 1.2rem); color: #C9D3F5; max-width: 52ch; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.1fr .9fr; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #D8E0FF; font-size: .8rem; font-weight: 700; margin-bottom: 18px; }
.eyebrow-dark { background: var(--blue-50); color: var(--blue-700); }
.hero-card { background: rgba(255, 255, 255, .97); color: var(--ink); border-radius: 22px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.section { padding: 72px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.feature { padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--brand-gradient); color: #fff; margin-bottom: 14px; }
.feature-icon svg { width: 22px; height: 22px; }
.step-num { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--blue-50); color: var(--blue-700); font-weight: 800; margin-bottom: 10px; }
.price-card { position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.price-card.featured { border: 2px solid var(--blue-600); box-shadow: var(--shadow); }
.price { font-size: 2rem; font-weight: 800; color: var(--navy-900); letter-spacing: -.02em; }
.price small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 16px 0 20px; }
.ticks li { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-size: .92rem; }
.ticks svg { width: 18px; height: 18px; color: var(--green-500); flex: none; margin-top: 2px; }
.cta-band { border-radius: 24px; padding: 40px 24px; text-align: center; color: #fff; background: var(--brand-gradient); }
.cta-band h2 { color: #fff; }

/* ------------------------------------------------------------------ auth pages */
.auth { min-height: 100vh; display: grid; }
@media (min-width: 960px) { .auth { grid-template-columns: 1fr 1fr; } }
.auth-aside { display: none; position: relative; overflow: hidden; color: #fff; padding: 48px; background: radial-gradient(800px 400px at 100% 0%, rgba(22, 163, 127, .55), transparent 60%), var(--navy-900); }
@media (min-width: 960px) { .auth-aside { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-aside h2 { color: #fff; font-size: 2rem; max-width: 16ch; }
.auth-aside p { color: #C9D3F5; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 32px 16px; }
.auth-form { width: 100%; max-width: 420px; margin: 0 auto; }

/* ------------------------------------------------------------------ voter pages */
.voter-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.voter-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.org-mark { display: flex; align-items: center; gap: 12px; min-width: 0; }
.org-mark .initial { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--brand-gradient); color: #fff; font-weight: 800; flex: none; }
.org-mark .logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; flex: none; }
.org-mark strong { display: block; color: var(--navy-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voter-hero { padding: 36px 0 8px; }
.election-card { display: flex; flex-direction: column; height: 100%; }
.election-card .card-body { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.countdown { display: flex; gap: 8px; }
.phase-countdown { max-width: 420px; }
.countdown div { flex: 1; text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--line-2); }
.countdown b { display: block; font-size: 1.25rem; font-weight: 800; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.countdown span { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.steps { display: flex; gap: 8px; margin-bottom: 24px; }
.steps li { flex: 1; list-style: none; height: 6px; border-radius: 99px; background: var(--line); }
.steps li.done { background: var(--brand-gradient); }
.steps { padding: 0; }
.candidate-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .candidate-grid { grid-template-columns: repeat(2, 1fr); } }
.candidate { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.candidate:hover { border-color: var(--blue-200); }
.candidate input { position: absolute; opacity: 0; pointer-events: none; }
.candidate:has(input:focus-visible) { box-shadow: var(--focus); }
.candidate.selected { border-color: var(--blue-600); background: var(--blue-50); }
.candidate .tick { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.candidate.selected .tick { background: var(--blue-600); border-color: var(--blue-600); }
.candidate .tick svg { width: 16px; height: 16px; }
.success-mark { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; background: var(--brand-gradient); color: #fff; box-shadow: 0 12px 30px rgba(22, 163, 127, .35); }
.success-mark svg { width: 38px; height: 38px; }
.review-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.review-row + .review-row { border-top: 1px solid var(--line-2); }

/* ------------------------------------------------------------------ app shell */
.shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; background: var(--navy-900); color: #C9D3F5; transform: translateX(-100%); transition: transform .2s ease; }
.sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
@media (min-width: 1024px) { .sidebar { transform: none; } }
.sidebar-top { padding: 18px 18px 12px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.nav-label { padding: 14px 10px 6px; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8190C4; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #C9D3F5; font-weight: 600; font-size: .92rem; }
.nav-link svg { width: 19px; height: 19px; opacity: .9; }
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(255, 255, 255, .12); color: #fff; }
.nav-link.active svg { color: #6EE7B7; }
.sidebar-bottom { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.org-switch { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); color: #fff; font: inherit; text-align: left; cursor: pointer; }
.org-switch:hover { background: rgba(255, 255, 255, .09); }
.org-switch .initial { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-gradient); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.org-switch .logo { width: 32px; height: 32px; border-radius: 9px; object-fit: contain; background: #fff; padding: 2px; flex: none; }
.org-switch small { display: block; color: #8190C4; font-size: .75rem; }
.org-menu { margin-top: 8px; padding: 6px; border-radius: 12px; background: var(--navy-800); }
.org-menu a { display: block; padding: 8px 10px; border-radius: 8px; color: #E2E8FF; font-size: .9rem; }
.org-menu a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; }
.user-chip .avatar-initials { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: .85rem; }
.user-chip strong { display: block; color: #fff; font-size: .88rem; }
.user-chip small { color: #8190C4; font-size: .75rem; }
.scrim { position: fixed; inset: 0; z-index: 45; background: rgba(15, 26, 74, .4); }
.main { min-height: 100vh; }
@media (min-width: 1024px) { .main { margin-left: var(--sidebar); } }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 16px; background: rgba(246, 248, 252, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
@media (min-width: 1024px) { .topbar .menu-btn { display: none; } }
.page { padding: 24px 16px 64px; max-width: 1180px; margin: 0 auto; }
@media (min-width: 720px) { .page { padding: 32px 32px 72px; } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin-bottom: 4px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb svg { width: 14px; height: 14px; }
.link-box { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px dashed var(--blue-200); border-radius: 10px; background: var(--blue-50); }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; color: var(--navy-800); }
.position-block + .position-block { margin-top: 16px; }
.candidate-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.candidate-row + .candidate-row { border-top: 1px solid var(--line-2); }
.timeline { display: grid; gap: 12px; }
.timeline-item { display: flex; gap: 12px; align-items: flex-start; }
.timeline-dot { width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: var(--line); flex: none; }
.timeline-dot.on { background: var(--green-500); box-shadow: 0 0 0 4px var(--green-50); }
.file-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px; border: 2px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); cursor: pointer; }
.file-drop:hover { border-color: var(--blue-200); background: var(--blue-50); }
/* organisation settings: logo and brand colour */
.logo-field { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-preview { width: 88px; height: 88px; border-radius: var(--radius); border: 1px solid var(--line); object-fit: contain; background: #fff; flex: none; }
.logo-empty { display: flex; align-items: center; justify-content: center; background: var(--brand-gradient); color: #fff; font-size: 1.75rem; font-weight: 800; border: 0; }
.color-input { width: 48px; height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; flex: none; }
.swatches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch:focus-visible { box-shadow: var(--focus); outline: none; }
.brand-preview { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.file-drop.dragging { border-color: var(--blue-600); background: var(--blue-50); }
.file-drop svg { width: 28px; height: 28px; color: var(--blue-600); }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* ------------------------------------------------------------------ helpers used by pages */
.mt-auto { margin-top: auto; }
.text-ink { color: var(--navy-900); }
.text-lg { font-size: 1.15rem; }
.inline-icon { display: inline-block; width: 15px; height: 15px; vertical-align: -2px; flex: none; }
.eyebrow svg { width: 14px; height: 14px; }
.hero-note { color: #9FB0E8; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.org-mark .grow > span { display: block; }
.card-hover { color: inherit; }
.card-hover:hover { text-decoration: none; }
.feature-icon.mb-0 { margin-bottom: 0; flex: none; }
.candidate[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.input-seats { width: 76px; }
blockquote.panel { margin: 0; white-space: pre-wrap; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; background: var(--line-2); padding: 1px 5px; border-radius: 5px; }
.link-box code { background: none; padding: 0; }
.voter-header + main, .voter-header ~ main { min-height: calc(100vh - 64px); }
.org-switch svg { width: 18px; height: 18px; flex: none; color: #8190C4; }
.org-switch .grow, .user-chip .grow { min-width: 0; }
.org-switch strong, .user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .btn svg { width: 18px; height: 18px; }
.election-card .badge { align-self: flex-start; }

/* ------------------------------------------------------------------ help centre */
.help-layout { display: grid; gap: 28px; }
@media (min-width: 960px) { .help-layout { grid-template-columns: 240px 1fr; align-items: start; } }
.help-toc { position: sticky; top: 84px; display: none; }
@media (min-width: 960px) { .help-toc { display: block; } }
.help-toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); font-size: .9rem; font-weight: 600; }
.help-toc a:hover { background: var(--line-2); text-decoration: none; }
.help-toc .nav-label { color: var(--muted); padding-left: 10px; }
.help-hero { padding: 40px 0 24px; }
.help-search { position: relative; max-width: 560px; }
.help-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.help-search .input { padding-left: 42px; min-height: 50px; border-radius: 14px; }
.article { scroll-margin-top: 84px; }
.article details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.article details + details { margin-top: 10px; }
.article summary { display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; font-weight: 700; color: var(--navy-900); list-style: none; }
.article summary::-webkit-details-marker { display: none; }
.article summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; color: var(--muted); font-weight: 600; }
.article details[open] summary::after { content: "–"; }
.article .answer { padding: 0 18px 18px; color: var(--ink-2); }
.article .answer ol, .article .answer ul { padding-left: 20px; margin: 0 0 1em; }
.article .answer li { margin: 4px 0; }
.audience { font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }

/* flow diagrams: horizontal on wide screens, vertical on phones */
.flow { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 8px 0 16px; }
@media (min-width: 720px) { .flow { flex-direction: row; align-items: stretch; } }
.flow-step { flex: 1; min-width: 0; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.flow-step .flow-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; background: var(--blue-50); color: var(--blue-600); }
.flow-step .flow-icon svg { width: 18px; height: 18px; }
.flow-step strong { display: block; color: var(--navy-900); font-size: .92rem; }
.flow-step span { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.flow-step.tone-green .flow-icon { background: var(--green-50); color: var(--green-700); }
.flow-step.tone-amber .flow-icon { background: var(--amber-50); color: var(--amber-600); }
.flow-step.tone-navy { background: var(--navy-900); border-color: var(--navy-900); }
.flow-step.tone-navy strong { color: #fff; }
.flow-step.tone-navy span { color: #C9D3F5; }
.flow-step.tone-navy .flow-icon { background: rgba(255, 255, 255, .12); color: #6EE7B7; }
.flow-step.gate { border: 2px dashed var(--amber-600); background: var(--amber-50); box-shadow: none; }
.flow-arrow { flex: none; display: flex; align-items: center; justify-content: center; color: var(--blue-500); }
.flow-arrow svg { width: 20px; height: 20px; transform: rotate(90deg); }
@media (min-width: 720px) { .flow-arrow svg { transform: none; } }
.converge { display: grid; gap: 10px; align-items: center; margin: 8px 0 16px; }
@media (min-width: 720px) { .converge { grid-template-columns: 1fr auto 1fr; } }
.converge-sources { display: grid; gap: 8px; }
.diagram-caption { font-size: .8rem; color: var(--muted); margin: -6px 0 14px; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix .yes { color: var(--green-700); }
.matrix .yes svg { width: 18px; height: 18px; margin: 0 auto; }
.matrix .no { color: #B5BCCB; }

/* ------------------------------------------------------------------ illustrations (decorative) */
.illustration { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto 16px; }
.illustration-left { margin-left: 0; }
.illustration-sm { max-width: 180px; }
.auth-aside .illustration { max-width: 300px; margin-bottom: 24px; }
.help-hero-grid { display: grid; gap: 24px; align-items: center; }
@media (min-width: 960px) { .help-hero-grid { grid-template-columns: 1fr 300px; } .help-hero-grid .illustration { margin: 0; } }
.row > .segmented, .help-hero-grid > *, .help-layout > * { min-width: 0; }
.user-link:hover { text-decoration: none; }
.user-link:hover strong { text-decoration: underline; }

/* ------------------------------------------------------------------ bulk selection */
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; background: var(--blue-50); border-bottom: 1px solid var(--line-2); }
.col-check { width: 44px; }
.col-check input { width: 18px; height: 18px; accent-color: var(--blue-600); vertical-align: middle; cursor: pointer; }
.row-selected td { background: var(--blue-50); }
.link-btn { padding: 0; border: 0; background: none; color: var(--blue-600); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
