/* =====================================================================================
   Student Government Election System — design system
   Brand colours are injected at runtime (js/core/brand.js) from the school settings.
   ===================================================================================== */
:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;

  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef1f7;
  --line: #e3e7ef;
  --line-2: #cfd6e3;
  --ink: #0b1220;
  --ink-2: #334155;
  --muted: #5b6b82;
  --faint: #94a3b8;

  --ok: #15803d;   --ok-bg: #dcfce7;   --ok-line: #86efac;
  --warn: #b45309; --warn-bg: #fef3c7; --warn-line: #fcd34d;
  --danger: #b91c1c; --danger-bg: #fee2e2; --danger-line: #fca5a5;
  --info: #1d4ed8; --info-bg: #dbeafe; --info-line: #93c5fd;
  --demo: #c2410c; --demo-bg: #fff1e6; --demo-strong: #ea580c;

  /* brand defaults (overwritten by brand.js) */
  --brand: #1d4ed8; --brand-hover: #1a44be; --brand-strong: #143697; --brand-soft: #e8edfb; --brand-softer: #f4f6fd;
  --brand-line: #a5b8f0; --brand-text: #1d4ed8; --on-brand: #ffffff;
  --brand-2: #0f172a; --on-brand-2: #ffffff;
  --accent: #f59e0b; --accent-soft: #fdecce; --on-accent: #0b1220;
  --bc-bg: #0f172a; --bc-bg-2: #13265a; --bc-bar: #3b6cf0;
  --brand-glow: rgba(29, 78, 216, .35); --accent-glow: rgba(245, 158, 11, .4);

  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 28px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --sh-2: 0 6px 16px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
  --sh-3: 0 24px 60px rgba(15, 23, 42, .18), 0 6px 16px rgba(15, 23, 42, .08);
  --ease: cubic-bezier(.2, .75, .2, 1);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.015em; }
p { margin: 0 0 .8em; }
a { color: var(--brand-text); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-3); padding: .1em .4em; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
#app { outline: none; }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.help { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.opt { color: var(--muted); font-weight: 500; font-size: 12px; }
.prewrap { white-space: pre-wrap; }
.spacer { flex: 1; }
.noscript { padding: 40px; text-align: center; font-weight: 700; }
.icon { flex-shrink: 0; vertical-align: middle; }
[hidden] { display: none !important; }

.boot, .page-center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.boot { grid-auto-flow: column; gap: 14px; place-content: center; color: var(--muted); font-weight: 600; }

/* ------------------------------------------------------------------ buttons */
.btn {
  --spin: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; position: relative;
  padding: 10px 16px; min-height: 42px; border-radius: 12px; border: 1.5px solid transparent;
  font-size: 15px; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; background: transparent; color: var(--ink);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { --spin: var(--on-brand); background: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px var(--brand-glow); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand-line); background: var(--brand-softer); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn-ghost.danger:hover:not(:disabled) { color: var(--danger); background: var(--danger-bg); }
.btn-success { --spin: #fff; background: #16a34a; color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-warn { --spin: #fff; background: #d97706; color: #fff; }
.btn-warn:hover:not(:disabled) { background: #b45309; }
.btn-danger { --spin: #fff; background: #dc2626; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-danger-outline { background: var(--surface); border-color: var(--danger-line); color: var(--danger); }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-bg); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 13px 22px; font-size: 17px; border-radius: 14px; }
.btn-xl { min-height: 66px; padding: 18px 34px; font-size: 20px; border-radius: 18px; letter-spacing: -.005em; }
.btn-icon { min-height: 40px; width: 40px; padding: 0; }
.btn-block { width: 100%; }
.btn.is-busy { color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--spin); border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn-link { background: none; border: 0; padding: 4px; color: var(--brand-text); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ forms */
.form .field, .field { margin-bottom: 16px; }
.label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--ink-2); }
.input {
  display: block; width: 100%; padding: 11px 14px; border: 1.5px solid var(--line-2); border-radius: 12px;
  background: var(--surface); font-size: 15px; transition: border-color .15s, box-shadow .15s; min-height: 44px;
}
.input:hover:not(:disabled) { border-color: var(--faint); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg); }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.5; }
select.input { appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.input-lg { font-size: 17px; padding: 14px 16px; min-height: 52px; }
.input-sm { width: auto; min-height: 36px; padding: 6px 10px; font-size: 14px; border-radius: 10px; }
select.input-sm { padding-right: 32px; background-position: right 6px center; }
.input.mono { font-family: var(--mono); letter-spacing: .06em; }
.field-error { color: var(--danger); font-size: 13px; font-weight: 600; margin: 6px 0 0; }
.form-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line); border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: 14px; margin: 8px 0 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); z-index: 4; }
.narrow { max-width: 320px; }

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; font-size: 15px; margin: 4px 0 12px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 46px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; flex-shrink: 0; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .2s var(--ease); }
.switch input:checked + .switch-ui { background: var(--brand); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--brand); outline-offset: 2px; }
.switch input:disabled + .switch-ui { opacity: .5; }

.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 14px; }
.radio-card { position: relative; display: block; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card > span { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1.5px solid var(--line-2); border-radius: 14px; background: var(--surface); transition: .15s; height: 100%; }
.radio-card small { color: var(--muted); font-size: 13px; }
.radio-card input:checked + span { border-color: var(--brand); background: var(--brand-softer); box-shadow: 0 0 0 3px var(--brand-soft); }
.radio-card input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.radio-card input:disabled + span { opacity: .6; cursor: not-allowed; }
.radio-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; flex-wrap: wrap; }
.radio-row input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ------------------------------------------------------------------ layout */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 20px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-2.tight, .grid-3.tight, .grid-4.tight { gap: 14px; margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-pad { padding: 24px; }
.card + .card, .card + .grid-2, .grid-2 + .card, .stat-grid + .card, .callout + .card, .card + .callout { margin-top: 20px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; margin-bottom: 14px; }

/* ------------------------------------------------------------------ stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: var(--sh-1); min-width: 0; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.stat-value { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat-card.tone-brand { border-color: var(--brand-line); background: linear-gradient(180deg, var(--brand-softer), var(--surface)); }
.stat-card.tone-brand .stat-value { color: var(--brand-text); }
.stat-card.tone-ok .stat-value { color: var(--ok); }
.stat-card.tone-ok .stat-icon { background: var(--ok-bg); color: var(--ok); }
.stat-status { font-size: 22px; }
.stat-status.tone-ok { color: var(--ok); } .stat-status.tone-warn { color: var(--warn); } .stat-status.tone-danger { color: var(--danger); } .stat-status.tone-info { color: var(--info); } .stat-status.tone-muted { color: var(--muted); }

/* ------------------------------------------------------------------ badges, pills, chips */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge.tone-ok { background: var(--ok-bg); color: var(--ok); }
.badge.tone-warn { background: var(--warn-bg); color: var(--warn); }
.badge.tone-danger { background: var(--danger-bg); color: var(--danger); }
.badge.tone-info { background: var(--info-bg); color: var(--info); }

.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-pill.tone-ok { background: var(--ok-bg); color: var(--ok); }
.status-pill.tone-ok .dot { animation: pulse 1.8s infinite; }
.status-pill.tone-warn { background: var(--warn-bg); color: var(--warn); }
.status-pill.tone-danger { background: var(--danger-bg); color: var(--danger); }
.status-pill.tone-info { background: var(--info-bg); color: var(--info); }

.rule-pill { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-weight: 800; font-size: 14px; white-space: nowrap; }

.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface); font-size: 14px; font-weight: 700; cursor: pointer; color: var(--ink-2); transition: .15s; }
.chip:hover { border-color: var(--brand-line); background: var(--brand-softer); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip-strong { border-style: dashed; color: var(--brand-text); }
.chip-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 12px; font-weight: 800; }
.chip.done { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.chip.done .chip-n { background: var(--ok); color: #fff; }
.chip-count { font-size: 12px; opacity: .7; }
.filter-chips, .preset-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.state-empty .preset-chips { justify-content: center; margin-top: 8px; }

.flag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.flag.win { background: var(--accent-soft); color: #7a4a03; }
.flag.tie { background: var(--warn-bg); color: var(--warn); }
.flag.lead { background: var(--brand-soft); color: var(--brand-text); }

/* ------------------------------------------------------------------ callouts & states */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); border-left-width: 4px; background: var(--surface); margin: 0 0 16px; font-size: 14px; }
.callout strong { display: block; font-size: 15px; margin-bottom: 2px; }
.callout.tone-info { border-color: var(--info-line); border-left-color: var(--info); background: #f2f7ff; }
.callout.tone-info > .icon { color: var(--info); }
.callout.tone-warn { border-color: var(--warn-line); border-left-color: #d97706; background: #fffbeb; }
.callout.tone-warn > .icon { color: #d97706; }
.callout.tone-danger { border-color: var(--danger-line); border-left-color: var(--danger); background: #fff5f5; }
.callout.tone-danger > .icon { color: var(--danger); }
.callout.tone-ok { border-color: var(--ok-line); border-left-color: var(--ok); background: #f0fdf4; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--brand); animation: spin .8s linear infinite; display: inline-block; }
.state-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px 16px; color: var(--muted); font-weight: 600; }
.state-empty, .state-error { text-align: center; padding: 52px 24px; max-width: 560px; margin: 0 auto; }
.state-empty h3, .state-error h3 { font-size: 22px; font-weight: 800; }
.state-empty p, .state-error p { color: var(--muted); }
.state-icon { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 16px; background: var(--brand-soft); color: var(--brand-text); }
.state-error .state-icon { background: var(--danger-bg); color: var(--danger); }
.state-error.fatal { background: var(--surface); border: 2px solid var(--danger-line); border-radius: var(--r-lg); }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.skeleton { border-radius: 18px; background: linear-gradient(90deg, var(--surface-3), #f7f9fc, var(--surface-3)); background-size: 200% 100%; animation: shimmer-bg 1.3s infinite; }
.skeleton-card { height: 120px; }

.progress { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-hover)); transition: width .9s var(--ease); }
.progress-lg { height: 16px; }
.inline-bar { display: flex; align-items: center; gap: 12px; }
.inline-bar .progress { flex: 1; }
.inline-bar span { width: 56px; text-align: right; font-weight: 700; font-size: 14px; }

/* ------------------------------------------------------------------ avatar & logo */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--surface-3); display: block; }
.avatar-initials { display: grid; place-items: center; color: #fff; font-weight: 800; letter-spacing: .02em;
  background: linear-gradient(135deg, hsl(var(--h) 62% 50%), hsl(calc(var(--h) + 35) 60% 38%)); }
.logo { display: block; width: auto; object-fit: contain; flex-shrink: 0; }
.logo-crest { display: grid; place-items: center; border-radius: 28%; font-weight: 800; letter-spacing: .02em;
  background: linear-gradient(140deg, var(--brand), var(--brand-strong)); color: var(--on-brand); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }

/* ------------------------------------------------------------------ toasts */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--sh-3); font-size: 14px; font-weight: 600; animation: toast-in .25s var(--ease); }
.toast.leaving { animation: toast-out .2s forwards; }
.toast-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0; }
.toast-ok .toast-icon { background: #16a34a; }
.toast-error .toast-icon { background: #dc2626; }
.toast-warn .toast-icon { background: #d97706; }
.toast-info .toast-icon { background: var(--brand); }
.toast-msg { flex: 1; padding-top: 3px; }
.toast-close { background: none; border: 0; color: rgba(255, 255, 255, .6); cursor: pointer; padding: 3px; border-radius: 6px; }
.toast-close:hover { color: #fff; }

/* ------------------------------------------------------------------ modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(11, 18, 32, .55); backdrop-filter: blur(3px); animation: fade-in .18s; }
.modal-backdrop.leaving { animation: fade-out .18s forwards; }
.modal { width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 22px; box-shadow: var(--sh-3); animation: pop-in .22s var(--ease); }
.modal-sm { max-width: 460px; } .modal-md { max-width: 580px; } .modal-lg { max-width: 860px; } .modal-xl { max-width: 1100px; }
.modal-header { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 6px; }
.modal-title { flex: 1; font-size: 21px; font-weight: 800; margin: 0; }
.modal-x { margin: -6px -8px 0 0; }
.modal-body { padding: 8px 24px 20px; overflow: auto; }
.modal-footer { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 22px 22px; }
.modal-danger .modal-title { color: var(--danger); }
.modal-warn .modal-title { color: var(--warn); }
.confirm-msg { color: var(--ink-2); }
.confirm-msg p:last-child { margin-bottom: 0; }
.confirm-big { font-size: 19px; }
.phrase { font-family: var(--mono); background: var(--danger-bg); color: var(--danger); padding: 1px 8px; border-radius: 6px; }
.problem-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.problem-list li { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); color: #7c3d03; font-weight: 800; font-size: 17px; }

/* =====================================================================================
   LANDING
   ===================================================================================== */
.landing { min-height: 100vh; display: flex; flex-direction: column; background:
  radial-gradient(1200px 600px at 50% -10%, var(--brand-soft), transparent 70%), var(--bg); }
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(16px, 4vw, 40px); }
.lt-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 17px; }
.lt-nav { display: flex; gap: 6px; }
.hero { flex: 1; position: relative; display: grid; place-items: center; text-align: center; padding: clamp(24px, 5vh, 56px) 20px clamp(40px, 8vh, 80px); overflow: hidden; }
.hero-glow { position: absolute; width: 60vw; height: 60vw; max-width: 900px; max-height: 900px; border-radius: 50%; top: 10%; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, var(--brand-glow), transparent 65%); opacity: .35; filter: blur(40px); pointer-events: none; }
.hero-banner { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .16; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent); mask-image: linear-gradient(180deg, #000 30%, transparent); }
.hero-inner { position: relative; max-width: 900px; animation: rise-in .6s var(--ease); }
.hero-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.hero-logo .logo { filter: drop-shadow(0 10px 24px rgba(15, 23, 42, .18)); }
.hero-school { font-size: clamp(14px, 1.6vw, 18px); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-text); }
.hero-motto { color: var(--muted); font-style: italic; margin-top: 4px; }
.hero-title { font-size: clamp(38px, 6.4vw, 80px); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; margin: 18px 0 10px; }
.hero-year { display: block; font-size: .62em; letter-spacing: -.01em; background: linear-gradient(90deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 18px; color: var(--muted); }
.hero-tag { font-size: clamp(20px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.01em; margin: 14px 0 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 .45em; }
.hero-tag span:nth-child(2) { color: var(--brand-text); }
.hero-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-bottom: 30px; }
.big-status { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; font-weight: 800; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; background: var(--surface); border: 1.5px solid var(--line-2); }
.big-status .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--faint); }
.big-status.tone-ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.big-status.tone-ok .dot { background: #16a34a; animation: pulse 1.8s infinite; }
.big-status.tone-warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.big-status.tone-warn .dot { background: #f59e0b; }
.big-status.tone-danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
.big-status.tone-danger .dot { background: #dc2626; }
.hero-window { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.hero-actions .btn-xl { min-width: 270px; }
.hero-note { max-width: 620px; margin: 24px auto 0; color: var(--muted); }
.landing-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px 36px; }
.ls-item { display: flex; gap: 14px; align-items: flex-start; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-1); }
.ls-item > .icon { color: var(--brand-text); padding: 10px; width: 46px; height: 46px; background: var(--brand-soft); border-radius: 14px; }
.ls-item h3 { font-size: 16px; font-weight: 800; margin: 2px 0 4px; }
.ls-item p { margin: 0; color: var(--muted); font-size: 14px; }
.landing-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; align-items: center; padding: 18px 20px 26px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.landing-foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; }

/* =====================================================================================
   VOTING STATION
   ===================================================================================== */
body.mode-station { background: linear-gradient(180deg, var(--brand-softer), var(--bg) 360px) fixed; }
.station { min-height: 100vh; display: flex; flex-direction: column; }
.demo-ribbon { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px; font-weight: 800; letter-spacing: .14em; font-size: 14px; color: #fff;
  background: repeating-linear-gradient(-45deg, var(--demo-strong), var(--demo-strong) 18px, #f97316 18px, #f97316 36px); }
.station-bar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px;
  padding: 12px clamp(16px, 3vw, 32px); background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.sb-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sb-text { min-width: 0; }
.sb-school { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.steps { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 14px; }
.steps li + li::before { content: ''; width: 18px; height: 2px; background: var(--line-2); margin: 0 4px 0 -8px; border-radius: 2px; }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); font-size: 13px; font-weight: 800; background: var(--surface); }
.steps li.current { color: var(--brand-text); background: var(--brand-soft); }
.steps li.current .step-n { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.steps li.done { color: var(--ok); }
.steps li.done .step-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.station-main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: clamp(24px, 4vh, 44px) clamp(16px, 3vw, 32px) 140px; outline: none; }
.station-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px clamp(16px, 3vw, 32px); font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface); }
.sf-secret { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.station-id { font-family: var(--mono); font-size: 12px; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 10px; }
.eyebrow.ok { color: var(--ok); }
.display { font-size: clamp(32px, 4.4vw, 54px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.display-sm { font-size: clamp(26px, 3vw, 36px); font-weight: 800; letter-spacing: -.02em; }
.lead { font-size: clamp(17px, 1.6vw, 21px); color: var(--muted); }
.lead.strong { color: var(--ink); font-weight: 800; }

/* code entry */
.code-entry { max-width: 700px; margin: clamp(10px, 6vh, 70px) auto 0; text-align: center; padding: clamp(28px, 5vw, 56px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-2); animation: rise-in .45s var(--ease); }
.code-form { display: flex; gap: 12px; margin: 28px 0 10px; }
.code-input { flex: 1; min-width: 0; font-family: var(--mono); font-size: clamp(28px, 4vw, 44px); font-weight: 700; letter-spacing: .14em; text-align: center; text-transform: uppercase;
  padding: 14px 16px; border: 2.5px solid var(--line-2); border-radius: 18px; background: var(--surface-2); transition: border-color .15s, box-shadow .15s, background .15s; }
.code-input::placeholder { color: #c4cbd8; letter-spacing: .14em; }
.code-input:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 6px var(--brand-soft); }
.code-input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 6px var(--danger-bg); }
.code-input.shake { animation: shake .4s; }
.code-error { display: none; text-align: left; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--danger-bg); border: 1px solid var(--danger-line); color: #7f1d1d; margin: 6px 0 4px; }
.code-error.show { display: flex; animation: rise-in .25s var(--ease); }
.code-error > .icon { color: var(--danger); margin-top: 2px; }
.code-error strong { display: block; font-size: 17px; }

.station-state, .success, .failure { max-width: 760px; margin: clamp(10px, 7vh, 80px) auto 0; text-align: center; padding: clamp(28px, 5vw, 56px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-2); animation: rise-in .45s var(--ease); }
.ss-icon { width: 104px; height: 104px; border-radius: 32px; display: grid; place-items: center; margin: 0 auto 22px; background: var(--brand-soft); color: var(--brand-text); }
.station-state.tone-warn .ss-icon { background: var(--warn-bg); color: #d97706; }
.station-state.tone-danger .ss-icon { background: var(--danger-bg); color: var(--danger); }
.station-state.tone-muted .ss-icon { background: var(--surface-3); color: var(--muted); }
.failure { border: 2px solid var(--danger-line); }
.failure .ss-icon { background: var(--danger-bg); color: var(--danger); }
.failure h1 { color: var(--danger); }
.failure-detail { background: var(--surface-2); border-radius: 12px; padding: 12px 16px; color: var(--ink-2); }
.big-spinner { width: 84px; height: 84px; margin: 0 auto 26px; border-radius: 50%; border: 7px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .9s linear infinite; }

/* ballot */
.ballot { animation: rise-in .4s var(--ease); }
.ballot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; }
.ballot-instructions { font-size: 18px; color: var(--ink-2); max-width: 760px; margin: 6px 0 0; }
.ballot-chips { position: sticky; top: 72px; z-index: 10; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; margin: 0 0 6px;
  background: linear-gradient(var(--bg) 70%, transparent); }
.ballot-chips .chip { font-size: 15px; padding: 8px 16px 8px 8px; }
.ballot-section { margin-top: 22px; padding: clamp(18px, 2.4vw, 30px); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-1); scroll-margin-top: 150px; transition: border-color .3s, box-shadow .3s; }
.ballot-section.is-complete { border-color: var(--ok-line); }
.ballot-section.flash { animation: flash 1.4s; }
.bs-head h2 { font-size: clamp(26px, 2.8vw, 36px); font-weight: 800; margin-bottom: 6px; }
.bs-desc { color: var(--muted); font-size: 16px; max-width: 760px; }
.bs-rule { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bs-count { font-weight: 800; color: var(--muted); font-size: 15px; }
.ballot-section.is-complete .bs-count { color: var(--ok); }
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-top: 22px; }
.cand-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 20px 20px; border-radius: 22px; background: var(--surface);
  border: 2px solid var(--line); cursor: pointer; transition: border-color .18s, box-shadow .18s, transform .18s, background .18s, opacity .18s; user-select: none; }
.cand-card:hover { border-color: var(--brand-line); box-shadow: var(--sh-2); transform: translateY(-2px); }
.cand-card.is-selected { border-color: var(--brand); background: var(--brand-softer); box-shadow: 0 0 0 5px var(--brand-soft), var(--sh-2); }
.cand-card.is-dimmed { opacity: .62; }
.cand-check { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); transform: scale(0); transition: transform .25s var(--ease); box-shadow: 0 4px 12px var(--brand-glow); }
.cand-card.is-selected .cand-check { transform: scale(1); }
.cand-photo .avatar { border: 4px solid #fff; box-shadow: 0 6px 18px rgba(15, 23, 42, .15); }
.cand-body { margin-top: 14px; }
.cand-name { font-size: 21px; font-weight: 800; margin: 0 0 2px; letter-spacing: -.01em; }
.cand-meta { color: var(--muted); font-weight: 600; font-size: 14px; }
.cand-slogan { font-style: italic; color: var(--ink-2); font-size: 15px; margin: 8px 0 0; }
.cand-actions { margin-top: auto; padding-top: 18px; width: 100%; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.btn-select { width: 100%; min-height: 56px; border-radius: 16px; border: 2px solid var(--brand); background: var(--surface); color: var(--brand-text); font-size: 17px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; transition: .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-select:hover { background: var(--brand-soft); }
.btn-select .sel-on { display: none; align-items: center; gap: 8px; }
.cand-card.is-selected .btn-select { background: var(--brand); color: var(--on-brand); }
.cand-card.is-selected .sel-on { display: inline-flex; }
.cand-card.is-selected .sel-off { display: none; }
.ballot-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(15, 23, 42, .07); }
.bf-inner { max-width: 1280px; margin: 0 auto; padding: 14px clamp(16px, 3vw, 32px); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.bf-status { display: flex; flex-direction: column; gap: 8px; min-width: 200px; flex: 0 1 360px; font-size: 16px; color: var(--muted); }
.bf-status strong { color: var(--ink); }

.manifesto { display: grid; grid-template-columns: 190px 1fr; gap: 28px; }
.mf-side { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mf-slogan { font-size: 22px; font-weight: 800; font-style: italic; color: var(--brand-text); }
.mf-main h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 18px; }
.mf-main .prewrap, .mf-main p { font-size: 17px; line-height: 1.6; }

/* review */
.review { max-width: 900px; margin: 0 auto; animation: rise-in .4s var(--ease); }
.review-list { list-style: none; margin: 26px 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-1); overflow: hidden; }
.review-item { display: grid; grid-template-columns: minmax(150px, 230px) 1fr auto; align-items: center; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.review-item:last-child { border-bottom: 0; }
.rv-pos { font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rv-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.rv-choice { display: inline-flex; align-items: center; gap: 10px; padding: 5px 18px 5px 5px; border-radius: 999px; background: var(--ok-bg); border: 1.5px solid var(--ok-line); }
.rv-tick { color: var(--ok); display: inline-flex; }
.rv-name { font-weight: 800; font-size: 19px; }
.rv-none { color: var(--muted); font-style: italic; }
.review-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.failure .review-actions, .station-state .review-actions { justify-content: center; }

/* success */
.success { border: 2px solid var(--ok-line); }
.success-mark { width: 128px; height: 128px; margin: 0 auto 18px; }
.success-mark svg { width: 100%; height: 100%; }
.success-mark circle { fill: var(--ok-bg); stroke: #16a34a; stroke-width: 5; stroke-dasharray: 340; stroke-dashoffset: 340; animation: draw .7s .05s var(--ease) forwards; }
.success-mark path { fill: none; stroke: #16a34a; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 90; stroke-dashoffset: 90; animation: draw .45s .55s var(--ease) forwards; }
.success-note { background: var(--surface-2); border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.leave { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 22px; font-weight: 800; margin: 10px 0 22px; color: var(--ink); }
.countdown { color: var(--muted); margin-top: 16px; font-weight: 600; }

/* =====================================================================================
   LIVE RESULTS — broadcast screen
   ===================================================================================== */
body.mode-broadcast { background: var(--bc-bg); overflow: hidden; }
.bc { position: relative; height: 100vh; min-height: 480px; display: flex; flex-direction: column; color: #fff; overflow: hidden;
  background: linear-gradient(160deg, var(--bc-bg) 0%, var(--bc-bg-2) 100%); font-size: clamp(14px, 1.05vw, 22px); }
.bc-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bc-bg i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35; }
.bc-bg i:nth-child(1) { width: 55vw; height: 55vw; left: -15vw; top: -25vw; background: var(--brand); }
.bc-bg i:nth-child(2) { width: 40vw; height: 40vw; right: -12vw; bottom: -20vw; background: var(--accent); opacity: .16; }
.bc > *:not(.bc-bg):not(.bc-toolbar) { position: relative; }
.bc-head, .bc-ribbon, .bc-progress, .bc-ticker { flex-shrink: 0; }
.bc.idle { cursor: none; }
.bc-head { display: flex; align-items: center; justify-content: space-between; gap: 2vw; padding: 2.4vh 3vw 1.4vh; }
.bc-brand { display: flex; align-items: center; gap: 1.4vw; min-width: 0; }
.bc-logo { height: clamp(48px, 6.5vh, 96px) !important; width: auto; }
.bc .logo-crest { width: clamp(48px, 6.5vh, 96px) !important; height: clamp(48px, 6.5vh, 96px) !important; font-size: clamp(18px, 2.4vh, 34px) !important; }
.bc-school { font-size: clamp(13px, 1.1vw, 22px); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; opacity: .78; }
.bc-title { font-size: clamp(22px, 2.5vw, 50px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.bc-badge { display: flex; gap: .8vw; flex-wrap: wrap; justify-content: flex-end; }
.bc-pill { display: inline-flex; align-items: center; gap: .6em; padding: .55em 1.1em; border-radius: 999px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: clamp(12px, 1vw, 20px);
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); white-space: nowrap; }
.bc-pill.final { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 0 40px var(--accent-glow); }
.bc-pill.muted { opacity: .8; }
.live-dot { width: .7em; height: .7em; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, .7); animation: live 1.6s infinite; }
.bc-ribbon { letter-spacing: .2em; }
.bc-progress { height: 4px; background: rgba(255, 255, 255, .08); opacity: 0; transition: opacity .3s; margin: 0 3vw; border-radius: 4px; overflow: hidden; }
.bc-progress.on { opacity: 1; }
.bc-progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; }
.bc-main { flex: 1; min-height: 0; padding: 1.8vh 3vw 1.6vh; overflow: hidden; }
.ov-card .flag.lead { display: none; }

/* overview */
.ov-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 1.4vw; align-content: start; height: 100%; }
.ov-grid.dense { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ov-card { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: clamp(14px, 1.4vw, 28px); padding: 1.4vw 1.5vw; backdrop-filter: blur(6px); min-width: 0; animation: rise-in .5s var(--ease) both; }
.ov-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 1vw; margin-bottom: 1vh; }
.ov-card h2 { font-size: clamp(16px, 1.45vw, 30px); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-note { opacity: .7; font-weight: 700; white-space: nowrap; font-size: .9em; }
.pos-note.tie { opacity: 1; color: var(--accent); }
.ov-more { opacity: .6; font-weight: 700; margin-top: .8vh; font-size: .9em; }

/* result rows */
.rows { display: flex; flex-direction: column; gap: .6vh; }
.r { display: grid; grid-template-columns: 1.6em auto minmax(0, 1fr) auto; align-items: center; gap: .9vw; padding: .7vh .7vw; border-radius: 14px; transition: transform .7s var(--ease), background .4s; }
.r.is-leading { background: rgba(255, 255, 255, .07); }
.r.is-winner { background: linear-gradient(90deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03)); }
.r.bump { animation: bump 1.2s var(--ease); }
.r-rank { font-weight: 800; opacity: .55; text-align: center; }
.r-avatar { border: 2px solid rgba(255, 255, 255, .35); }
.r-body { min-width: 0; }
.r-top { display: flex; align-items: center; gap: .7em; min-width: 0; }
.r-name { font-weight: 800; font-size: clamp(14px, 1.25vw, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-class { opacity: .6; font-weight: 600; white-space: nowrap; }
.r-flags { display: inline-flex; }
.bc .flag { font-size: clamp(10px, .75vw, 15px); }
.bc .flag.win { background: var(--accent); color: var(--on-accent); }
.bc .flag.lead { background: rgba(255, 255, 255, .16); color: #fff; }
.bc .flag.tie { background: #f59e0b; color: #1f1300; }
.r-track { height: clamp(8px, 1.1vh, 16px); border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-top: .55vh; }
.r-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--bc-bar), color-mix(in srgb, var(--bc-bar) 60%, #ffffff)); background-color: var(--bc-bar); transition: width 1.1s var(--ease); }
.r.is-leading .r-fill, .r.is-winner .r-fill { background: linear-gradient(90deg, var(--accent), #ffe8a3); background-color: var(--accent); }
.r-nums { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; min-width: 4.2em; }
.r-votes { font-weight: 800; font-size: clamp(17px, 1.7vw, 36px); }
.r-pct { opacity: .72; font-weight: 700; font-size: .9em; }
.rows.big { gap: 1.2vh; }
.rows.big .r { padding: 1.3vh 1.2vw; gap: 1.6vw; background: rgba(255, 255, 255, .05); border-radius: clamp(14px, 1.4vw, 26px); }
.rows.big .r.is-leading { background: rgba(255, 255, 255, .11); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.rows.big .r-rank { font-size: clamp(20px, 2vw, 40px); }
.rows.big .r-avatar { width: clamp(56px, 8vh, 110px) !important; height: clamp(56px, 8vh, 110px) !important; border-width: 3px; }
.rows.big .avatar-initials.r-avatar { font-size: clamp(20px, 3vh, 40px) !important; }
.rows.big .r-name { font-size: clamp(22px, 2.5vw, 54px); letter-spacing: -.01em; }
.rows.big .r-class { font-size: clamp(14px, 1.1vw, 22px); }
.rows.big .r-track { height: clamp(14px, 2.3vh, 30px); margin-top: 1vh; }
.rows.big .r-votes { font-size: clamp(30px, 3.5vw, 76px); }
.rows.big .r-pct { font-size: clamp(16px, 1.5vw, 30px); }

/* position focus */
.fx { height: 100%; max-width: 1560px; margin: 0 auto; display: flex; flex-direction: column; }
.fx-head { text-align: center; margin-bottom: 2.4vh; }
.fx-eyebrow { font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); font-size: clamp(13px, 1vw, 20px); }
.fx-name { font-size: clamp(38px, 5vw, 104px); font-weight: 800; letter-spacing: -.03em; line-height: 1; margin: .6vh 0 .6vh; text-transform: uppercase; }
.fx-head .pos-note { font-size: clamp(14px, 1.2vw, 24px); }
.enter { animation: rise-in .6s var(--ease) both; }
.pos-dots { display: flex; justify-content: center; gap: 8px; margin-top: auto; padding-top: 2vh; }
.pos-dots i { width: 9px; height: 9px; border-radius: 9px; background: rgba(255, 255, 255, .28); transition: width .4s var(--ease), background .4s; }
.pos-dots i.on { width: 34px; background: var(--accent); }

/* splash */
.bc-splash { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1.6vh; padding: 2vh 2vw; }
.splash-icon { width: clamp(90px, 13vh, 160px); height: clamp(90px, 13vh, 160px); border-radius: 30%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); }
.bc-splash h1 { font-size: clamp(28px, 3.4vw, 70px); font-weight: 800; letter-spacing: -.02em; max-width: 22ch; }
.bc-splash p { opacity: .75; font-size: clamp(16px, 1.4vw, 28px); max-width: 46ch; }
.bc-splash .state-error { color: var(--ink); background: var(--surface); border-radius: var(--r-lg); }

/* winners */
.win { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: safe center; text-align: center; overflow: hidden; }
.win-eyebrow { display: inline-flex; align-items: center; gap: .6em; color: var(--accent); font-weight: 800; letter-spacing: .24em; text-transform: uppercase; font-size: clamp(15px, 1.4vw, 28px); }
.win-pos { font-size: clamp(28px, 3.4vw, 76px); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; margin: .4vh 0 1.8vh; line-height: 1.05; }
.win-one { display: flex; flex-direction: column; align-items: center; }
.win-photo .avatar { width: clamp(110px, 20vh, 280px) !important; height: clamp(110px, 20vh, 280px) !important; border: 6px solid var(--accent); box-shadow: 0 0 0 12px var(--accent-glow), 0 0 90px var(--accent-glow); animation: pop-big .9s var(--ease) both; }
.win-photo .avatar-initials { font-size: clamp(48px, 9vh, 110px) !important; }
.win-name { margin-top: 2vh; font-size: clamp(36px, min(5vw, 9vh), 110px); font-weight: 800; letter-spacing: -.03em; line-height: 1.02;
  background: linear-gradient(100deg, #ffffff 30%, var(--accent) 50%, #ffffff 70%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise-in .8s .25s var(--ease) both, shine 4.5s 1.2s ease-in-out infinite; }
.win-class { opacity: .7; font-weight: 700; font-size: clamp(16px, 1.4vw, 28px); margin-top: .6vh; }
.win-stats { display: flex; align-items: center; justify-content: center; gap: 1.4vw; margin-top: 1.8vh; font-size: clamp(20px, 2.1vw, 44px); font-weight: 700; animation: rise-in .8s .45s var(--ease) both; }
.win-stats b { color: var(--accent); font-weight: 800; }
.win-stats .sep { width: 3px; height: 1em; background: rgba(255, 255, 255, .3); border-radius: 3px; }
.win-congrats { margin-top: 2vh; font-weight: 800; letter-spacing: .45em; text-transform: uppercase; color: var(--accent); font-size: clamp(15px, 1.5vw, 30px); animation: rise-in .8s .7s var(--ease) both; }
.win-many { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.8vw; }
.win-card { padding: 2.4vh 2vw; border-radius: clamp(16px, 1.6vw, 30px); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); min-width: 15vw; display: flex; flex-direction: column; align-items: center; gap: 1vh; animation: pop-big .8s var(--ease) both; }
.win-card .avatar { width: clamp(90px, 15vh, 180px) !important; height: clamp(90px, 15vh, 180px) !important; border: 5px solid var(--accent); box-shadow: 0 0 40px var(--accent-glow); }
.win-card.tie .avatar { border-color: rgba(255, 255, 255, .55); box-shadow: none; }
.wc-name { font-size: clamp(20px, 2vw, 42px); font-weight: 800; }
.wc-stats { opacity: .8; font-weight: 700; }
.win-tie { display: flex; flex-direction: column; align-items: center; gap: 2vh; }
.tie-word { font-size: clamp(54px, 7vw, 150px); font-weight: 800; letter-spacing: .25em; color: var(--accent); line-height: 1; }
.win-tie p { max-width: 56ch; opacity: .8; font-size: clamp(15px, 1.3vw, 26px); }
.win-none { font-size: clamp(22px, 2.4vw, 46px); opacity: .7; }
.win-others { display: flex; flex-wrap: wrap; justify-content: center; gap: .6vh 2.4vw; margin-top: 2.4vh; opacity: .7; font-size: clamp(14px, 1.1vw, 22px); }
.sparkles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.sparkles i { position: absolute; bottom: -20px; left: var(--x); width: 10px; height: 10px; border-radius: 2px; background: var(--accent); opacity: 0; transform: rotate(45deg) scale(var(--s));
  animation: rise-spark 7s var(--d) ease-in infinite; box-shadow: 0 0 12px var(--accent-glow); }

/* ticker */
.bc-ticker { display: grid; grid-template-columns: repeat(3, auto) minmax(180px, 1.6fr) auto; align-items: center; gap: 3vw; padding: 1.8vh 3vw 2vh; background: rgba(0, 0, 0, .28); border-top: 1px solid rgba(255, 255, 255, .1); }
.tk { display: flex; flex-direction: column; min-width: 0; }
.tk-l { font-size: clamp(11px, .85vw, 17px); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .6; white-space: nowrap; }
.tk-v { font-size: clamp(22px, 2.4vw, 50px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.tk-turnout .tk-v { color: var(--accent); }
.tk-bar { height: 8px; background: rgba(255, 255, 255, .12); border-radius: 999px; overflow: hidden; margin-top: .6vh; }
.tk-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 1.1s var(--ease); }
.tk-status { justify-self: end; display: inline-flex; align-items: center; gap: .7em; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .9; white-space: nowrap; font-size: clamp(11px, .9vw, 18px); }
.tk-status .dot { width: .75em; height: .75em; border-radius: 50%; }
.tk-status .dot.live { background: #22c55e; animation: live-green 1.8s infinite; }
.tk-status .dot.warn { background: #f59e0b; animation: pulse 1s infinite; }

/* toolbar */
.bc-toolbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; gap: 6px; padding: 6px; border-radius: 16px; background: rgba(5, 10, 20, .7); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .14); transition: opacity .35s, transform .35s; font-size: 13px; }
.bc.idle .bc-toolbar { opacity: 0; pointer-events: none; transform: translate(-50%, -10px); }
.seg { display: flex; align-items: center; gap: 2px; background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 3px; }
.seg button, .seg a, .seg select { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; color: #fff; padding: 7px 11px; border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; }
.seg button:hover, .seg a:hover { background: rgba(255, 255, 255, .12); }
.seg button.on { background: #fff; color: var(--ink); }
.seg select { background: rgba(255, 255, 255, .1); max-width: 200px; }
.seg select option { color: var(--ink); }
.seg-label { padding-left: 9px; color: rgba(255, 255, 255, .8); }

/* =====================================================================================
   ADMIN
   ===================================================================================== */
.admin { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); z-index: 40; }
.sb-head { display: flex; align-items: center; gap: 12px; padding: 18px 16px 14px; }
.sb-head-t { min-width: 0; flex: 1; }
.sb-school { font-weight: 800; font-size: 15px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sb-app { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sb-close { display: none; }
.ws { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 2px 14px 12px; padding: 4px; border-radius: 14px; background: var(--surface-3); }
.ws-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; cursor: pointer; transition: .15s; }
.ws-btn:hover { color: var(--ink); }
.ws-btn.on { background: var(--surface); color: var(--ok); box-shadow: var(--sh-1); }
.ws-btn.demo.on { background: var(--demo-strong); color: #fff; }
.nav { flex: 1; overflow: auto; padding: 4px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--ink-2); font-weight: 600; font-size: 15px; text-decoration: none; transition: background .12s, color .12s; }
.nav-link .icon { color: var(--faint); }
.nav-link:hover { background: var(--surface-3); color: var(--ink); }
.nav-link.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 800; }
.nav-link.active .icon { color: var(--brand-text); }
.nav-link.subtle { margin-top: 10px; border-top: 1px dashed var(--line); border-radius: 0 0 11px 11px; padding-top: 14px; }
.sb-foot { padding: 14px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; min-width: 0; }
.me-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); font-weight: 800; font-size: 13px; flex-shrink: 0; }
.me-t { min-width: 0; }
.me-email { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { font-size: 12px; color: var(--muted); }
.sb-mode { font-size: 11px; color: var(--faint); text-align: center; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: rgba(243, 245, 250, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.tb-title { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-election { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-actions { display: flex; gap: 8px; }
.mode-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.mode-badge.live { background: var(--ok-bg); color: var(--ok); }
.mode-badge.live .dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; animation: pulse 1.8s infinite; }
.mode-badge.demo { background: var(--demo-strong); color: #fff; }
.demo-banner { display: none; align-items: center; gap: 10px; padding: 10px 28px; font-size: 14px; color: #7c2d12; border-bottom: 1px solid #fdba74;
  background: repeating-linear-gradient(-45deg, #fff7ed, #fff7ed 14px, #ffedd5 14px, #ffedd5 28px); }
.admin.is-demo .demo-banner { display: flex; }
.admin.is-demo .sidebar { border-right: 4px solid var(--demo-strong); }
.admin.is-demo .topbar { background: rgba(255, 247, 237, .92); }
.page { width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px 32px 72px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(26px, 2.4vw, 32px); font-weight: 800; letter-spacing: -.025em; margin: 0; }
.page-sub { color: var(--muted); margin: 6px 0 0; max-width: 760px; }
.ph-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.scrim { display: none; }

/* dashboard */
.readiness { margin-bottom: 20px; border-color: var(--warn-line); }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; }
.checklist li { display: grid; grid-template-columns: 22px minmax(120px, 170px) 1fr; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.checklist li:last-child { border-bottom: 0; }
.checklist li span { color: var(--muted); }
.checklist li.ok > .icon { color: var(--ok); }
.checklist li.todo > .icon { color: #d97706; }
.checklist.compact li { grid-template-columns: 22px 1fr; }
.turnout-card { margin-bottom: 0; }
.tc-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.tc-top .card-title { margin-bottom: 2px; }
.tc-big { font-size: 46px; font-weight: 800; letter-spacing: -.03em; color: var(--brand-text); line-height: 1; }
.tc-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 16px; color: var(--muted); font-size: 14px; }
.tc-meta span { display: inline-flex; align-items: center; gap: 6px; }
.tc-meta b { color: var(--ink); }
.quick { display: grid; gap: 10px; }
.quick-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; transition: .15s; }
.quick-item > .icon:first-child { color: var(--brand-text); }
.quick-item:hover { border-color: var(--brand-line); background: var(--brand-softer); }
.quick-item div { flex: 1; display: flex; flex-direction: column; }
.quick-item span { color: var(--muted); font-size: 13px; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: 0; }
.act-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 7px; flex-shrink: 0; }
.activity li div { display: flex; flex-direction: column; font-size: 14px; }
.activity li span { color: var(--muted); font-size: 13px; }

/* monitor */
.monitor-hero { display: grid; grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.monitor-hero > div { background: var(--surface); padding: 22px; }
.mh-status { display: flex; align-items: center; gap: 14px; }
.mh-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.monitor-hero.tone-ok .mh-dot { background: #16a34a; animation: live-green 1.8s infinite; }
.monitor-hero.tone-warn .mh-dot { background: #f59e0b; }
.monitor-hero.tone-danger .mh-dot { background: #dc2626; }
.mh-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mh-value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.hour-chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 8px 0 0; overflow-x: auto; }
.hc-col { flex: 1; min-width: 34px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.hc-bar { width: 100%; max-width: 52px; min-height: 3px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--brand), var(--brand-hover)); transition: height .8s var(--ease); }
.hc-n { font-size: 12px; font-weight: 800; }
.hc-l { font-size: 11px; color: var(--muted); }
.stations { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow: auto; }
.stations li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.stations li .muted { margin-left: auto; font-size: 13px; }
.st-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.st-dot.on { background: #16a34a; box-shadow: 0 0 0 4px var(--ok-bg); }

/* election page */
.status-timeline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; }
.tl-step { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 13px; border: 1px solid var(--line); }
.tl-step.on { background: var(--brand-soft); color: var(--brand-text); border-color: var(--brand-line); }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.tl-dot.tone-ok { background: #16a34a; } .tl-dot.tone-warn { background: #f59e0b; } .tl-dot.tone-danger { background: #dc2626; } .tl-dot.tone-info { background: var(--info); }
.tl-meta { margin-left: auto; display: flex; gap: 22px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.tl-meta b { color: var(--ink); }
.settings-form > .card { margin-bottom: 20px; }
.danger-zone { border-color: var(--danger-line); margin-top: 24px; }
.danger-zone .card-title { color: var(--danger); }

/* positions */
.pos-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pos-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-1); transition: box-shadow .15s, opacity .15s; }
.pos-row.inactive { opacity: .62; }
.pos-row.dragging, .g-card.dragging { opacity: .45; outline: 2px dashed var(--brand); }
.pos-row[draggable="true"]:hover { box-shadow: var(--sh-2); }
.grip { color: var(--faint); cursor: grab; display: inline-flex; }
.pos-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 800; font-size: 14px; flex-shrink: 0; }
.pos-main { flex: 1; min-width: 0; }
.pos-name { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pos-desc { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-cands { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: 13px; white-space: nowrap; }
.pos-cands.warn { color: #d97706; }
.row-actions { display: flex; gap: 2px; }
.pos-list.compact .pos-row { padding: 10px 14px; box-shadow: none; }

/* candidates gallery */
.gallery-group { margin-top: 26px; }
.gallery-group header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.gallery-group h2 { font-size: 20px; font-weight: 800; margin: 0; }
.gallery-group header .btn { margin-left: auto; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.g-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 22px 18px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--sh-1); transition: box-shadow .15s, transform .15s; }
.g-card:hover { box-shadow: var(--sh-2); }
.g-card.inactive { opacity: .6; }
.g-card .grip { position: absolute; top: 12px; left: 12px; }
.g-photo .avatar { border: 4px solid #fff; box-shadow: 0 6px 16px rgba(15, 23, 42, .14); }
.g-name { font-size: 17px; font-weight: 800; margin: 12px 0 2px; }
.g-meta { color: var(--muted); font-size: 13px; font-weight: 600; }
.g-slogan { font-style: italic; color: var(--ink-2); font-size: 14px; margin: 8px 0 0; }
.g-foot { margin-top: auto; padding-top: 12px; width: 100%; display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); margin-top: 14px; }
.cand-form { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; }
.photo-field { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.photo-field .avatar { border: 4px solid #fff; box-shadow: var(--sh-2); }

/* voters & codes */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px; border-bottom: 1px solid var(--line); }
.toolbar .input { width: auto; min-width: 160px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { width: 100%; padding-left: 40px; }
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: var(--surface-2); }
.table.compact th, .table.compact td { padding: 8px 12px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.actions-col { text-align: right; white-space: nowrap; }
.voted { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.voted.yes { color: var(--ok); font-weight: 800; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 12px 16px; }
.pager .muted { margin-right: auto; font-size: 14px; }
.code-cell { font-size: 16px; font-weight: 700; letter-spacing: .08em; }
.codes-preview { border: 1px solid var(--line); border-radius: 14px; margin: 6px 0; }
.how-codes { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 0; }
.how-codes p { margin: 0; color: var(--ink-2); }
.hc-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); flex-shrink: 0; }
.code-chip { font-weight: 700; background: var(--surface-3); padding: 2px 8px; border-radius: 6px; letter-spacing: .06em; }
.vault { list-style: none; padding: 0; margin: 0 0 10px; }
.vault li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.vault li div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pc-sample { display: flex; justify-content: center; padding: 22px; background: var(--surface-2); border-radius: 16px; }
.pc-card { width: 320px; max-width: 100%; padding: 14px 16px; background: #fff; border: 2px dashed var(--line-2); border-radius: 14px; text-align: center; color: #0b1220; }
.pc-top { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #475569; }
.pc-top .logo-crest { font-size: 9px !important; }
.pc-label { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-top: 10px; }
.pc-code { font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: .1em; margin: 4px 0; }
.pc-note { font-size: 12px; color: #475569; }
.pc-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: #475569; margin-top: 10px; padding-top: 8px; border-top: 1px dashed #cbd5e1; }
.pc-demo { color: var(--demo); }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px; border: 2px dashed var(--line-2); border-radius: 18px; background: var(--surface-2); cursor: pointer; text-align: center; color: var(--muted); transition: .15s; margin: 12px 0; }
.dropzone b { color: var(--ink); font-size: 16px; }
.dropzone > .icon { color: var(--brand-text); margin-bottom: 4px; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-softer); }
.dropzone:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }
details.paste { margin: 6px 0 14px; }
details summary { cursor: pointer; font-weight: 700; color: var(--brand-text); padding: 4px 0; }
details.paste .input { margin-top: 8px; }
.import-summary { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.problems ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); max-height: 160px; overflow: auto; }

/* results (admin) */
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 20px; }
.res-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.res-head h2 { font-size: 20px; font-weight: 800; margin: 0; }
.res-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.res-rows li { display: grid; grid-template-columns: 24px 40px minmax(0, 1fr); gap: 12px; align-items: center; }
.rr-rank { font-weight: 800; color: var(--muted); text-align: center; }
.rr-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rr-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-votes { font-weight: 800; }
.rr-pct { width: 58px; text-align: right; font-size: 14px; }
.rr-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.rr-track i { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .9s var(--ease); }
.res-rows li.win .rr-track i { background: linear-gradient(90deg, var(--accent), #fcd34d); }
.res-rows li.tie .rr-track i { background: #f59e0b; }

/* reports */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; margin-bottom: 20px; }
.report-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-1); }
.report-card .btn { align-self: flex-start; margin-top: auto; }
.rc-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.rc-body h3 { font-size: 16px; font-weight: 800; margin: 0 0 4px; }
.rc-body p { margin: 0; color: var(--muted); font-size: 14px; }
.archive-list { list-style: none; padding: 0; margin: 0; }
.archive-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.archive-list li div { flex: 1; display: flex; flex-direction: column; min-width: 180px; }

/* settings */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: transparent; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--brand-text); border-bottom-color: var(--brand); }
.brand-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr); gap: 28px; }
.brand-preview { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; }
.bp-label { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bp-hero-in { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px; border-radius: 14px; border: 1px solid var(--line); text-align: center; }
.bp-school { font-weight: 800; }
.bp-title { font-size: 13px; font-weight: 700; color: var(--muted); }
.bp-btn { padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 800; margin-top: 6px; }
.bp-bc-in { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; color: #fff; }
.bp-bc-t { font-size: 12px; font-weight: 800; letter-spacing: .16em; opacity: .85; }
.bp-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.bp-bar i { display: block; height: 100%; border-radius: 999px; }
.bp-acc { align-self: flex-start; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-prev { min-width: 56px; min-height: 56px; display: grid; place-items: center; }
.banner-prev { width: 100px; height: 56px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; color: var(--faint); }
.banner-prev img { width: 100%; height: 100%; object-fit: cover; }
.color-row { display: flex; gap: 12px; flex-wrap: wrap; }
.color-field { display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--surface); font-weight: 700; font-size: 14px; cursor: pointer; }
.color-field input { width: 42px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 8px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.preset { display: inline-flex; align-items: center; gap: 3px; padding: 6px 12px 6px 8px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 700; cursor: pointer; }
.preset:hover { border-color: var(--brand-line); }
.preset i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.preset span { margin-left: 5px; }
.roles-help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.roles-help div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.roles-help span { color: var(--muted); font-size: 13px; }
.demo-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.demo-head h2 { font-size: 20px; font-weight: 800; margin: 0; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.howto { padding-left: 20px; margin: 0; }
.howto li { margin: 6px 0; }

/* wizard */
.wizard { max-width: 1040px; margin: 0 auto; }
.wz-head { margin-bottom: 18px; }
.wz-head h1 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 800; letter-spacing: -.025em; margin: 0; }
.wz-steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.wz-steps li { position: relative; }
.wz-steps li + li::before { content: ''; position: absolute; top: 24px; left: calc(-50% + 22px); width: calc(100% - 44px); height: 2px; background: var(--line-2); }
.wz-steps li.done + li::before, .wz-steps li.done + li.current::before { background: var(--ok-line); }
.wz-steps button { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px; background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; border-radius: 12px; position: relative; z-index: 1; }
.wz-steps button:hover:not(:disabled) { color: var(--ink); }
.wz-steps button:disabled { opacity: .45; cursor: not-allowed; }
.wz-n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); background: var(--surface); font-weight: 800; font-size: 13px; }
.wz-steps li.current button { color: var(--brand-text); }
.wz-steps li.current .wz-n { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 0 0 5px var(--brand-soft); }
.wz-steps li.done .wz-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.wz-card { overflow: hidden; }
.wz-body { padding: 28px; }
.wz-title { margin-bottom: 22px; }
.wz-count { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-text); }
.wz-title h2 { font-size: 24px; font-weight: 800; margin: 4px 0 4px; }
.wz-title p { margin: 0; }
.wz-card .form-error { margin: 0 28px 16px; }
.wz-nav { display: flex; align-items: center; gap: 10px; padding: 16px 28px; border-top: 1px solid var(--line); background: var(--surface-2); }
.wz-empty { padding: 20px; text-align: center; background: var(--surface-2); border-radius: 14px; }
.wz-cands { display: flex; flex-direction: column; gap: 12px; }
.wz-pos { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.wz-pos.needs { border-color: var(--warn-line); background: #fffdf5; }
.wz-pos header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.wz-pos h3 { font-size: 16px; font-weight: 800; margin: 0; }
.wz-pos header .btn { margin-left: auto; }
.wz-pos p { margin: 0; }
.mini-cands { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-cand { display: inline-flex; align-items: center; gap: 10px; padding: 5px 16px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; text-align: left; }
.mini-cand:hover { border-color: var(--brand-line); background: var(--brand-softer); }
.mini-cand span { display: flex; flex-direction: column; line-height: 1.2; }
.mini-cand small { color: var(--muted); }
.big-count { text-align: center; margin-bottom: 18px; }
.big-count span { display: block; font-size: 56px; font-weight: 800; letter-spacing: -.03em; color: var(--brand-text); line-height: 1; }
.big-count small { color: var(--muted); font-weight: 700; }
.wz-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.wz-options.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.option-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.option-card h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; margin: 0; }
.option-card h3 .icon { color: var(--brand-text); }
.option-card p { margin: 0; }
.option-card .btn { align-self: flex-start; margin-top: auto; }
.rules-table .input-sm { width: 80px; }
.ready-card { border: 2px solid var(--line); border-radius: 20px; padding: 22px; margin-bottom: 18px; }
.ready-card.ok { border-color: var(--ok-line); background: linear-gradient(180deg, #f0fdf4, var(--surface)); }
.ready-card.todo { border-color: var(--warn-line); background: linear-gradient(180deg, #fffbeb, var(--surface)); }
.rc-title { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 800; margin-bottom: 16px; letter-spacing: .02em; text-transform: uppercase; }
.ready-card.ok .rc-title { color: var(--ok); }
.ready-card.todo .rc-title { color: var(--warn); }
.ready-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.ready-grid div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.ready-grid dt { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ready-grid dd { margin: 2px 0 0; font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 560px) minmax(0, 1fr); }
.auth-card { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(24px, 5vw, 64px); background: var(--surface); }
.auth-card h1 { font-size: 30px; font-weight: 800; letter-spacing: -.025em; margin: 12px 0 4px; }
.auth-card .form { margin: 22px 0 18px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none; margin-bottom: 28px; }
.back-link:hover { color: var(--ink); }
.auth-side { position: relative; display: grid; place-items: center; padding: 48px; overflow: hidden; color: var(--on-brand);
  background: radial-gradient(800px 500px at 80% 10%, rgba(255, 255, 255, .18), transparent 60%), linear-gradient(145deg, var(--brand), var(--brand-strong)); }
.as-inner { max-width: 520px; }
.as-mark { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); margin-bottom: 28px; }
.as-line { font-size: clamp(26px, 2.8vw, 44px); font-weight: 800; letter-spacing: -.025em; line-height: 1.12; margin: 0 0 10px; }
.as-line:nth-child(3) { opacity: .85; } .as-line:nth-child(4) { opacity: .7; }

/* =====================================================================================
   PRINT
   ===================================================================================== */
#print-root { display: none; }
@media print {
  @page { margin: 10mm; }
  body { background: #fff !important; }
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block !important; }
  .print-codes { display: grid; grid-template-columns: repeat(3, 1fr); }
  .print-codes .pc-card { width: auto; min-height: 44mm; border: 1px dashed #94a3b8; border-radius: 0; display: flex; flex-direction: column; justify-content: center; break-inside: avoid; page-break-inside: avoid; padding: 3mm 4mm; overflow: hidden; min-width: 0; }
  .print-codes .pc-top span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .print-codes .pc-label { margin-top: 2mm; font-size: 8pt; }
  .print-codes .pc-code { font-size: 21pt; margin: 1mm 0; white-space: nowrap; }
  .print-codes .pc-note { font-size: 8pt; }
  .print-codes .pc-foot { font-size: 7.5pt; margin-top: 2mm; padding-top: 1.5mm; }
  .print-report { color: #000; font-size: 11pt; }
  .pr-head { display: flex; align-items: center; gap: 14px; padding-bottom: 10px; border-bottom: 3px solid var(--brand); }
  .pr-school { font-size: 20pt; font-weight: 800; }
  .pr-motto { font-style: italic; color: #444; }
  .pr-title { font-size: 20pt; font-weight: 800; text-align: center; margin: 16px 0 4px; }
  .pr-kind { text-align: center; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; color: var(--brand-text); margin-bottom: 14px; }
  .pr-kind.is-provisional { color: #b45309; }
  .pr-summary { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
  .pr-summary th { text-align: left; background: #f1f5f9; }
  .pr-summary th, .pr-summary td { border: 1px solid #cbd5e1; padding: 5px 9px; }
  .pr-pos { break-inside: avoid; page-break-inside: avoid; margin-bottom: 16px; }
  .pr-pos h2 { font-size: 14pt; margin: 0 0 6px; }
  .pr-pos h2 small { font-size: 9.5pt; color: #555; font-weight: 600; }
  .pr-table { width: 100%; border-collapse: collapse; }
  .pr-table th { background: #f1f5f9; text-align: left; }
  .pr-table th, .pr-table td { border: 1px solid #cbd5e1; padding: 4px 8px; }
  .pr-table .num { text-align: right; }
  .pr-table tr.is-winner td { font-weight: 800; background: #fef9c3; }
  .pr-tie { font-style: italic; color: #b45309; margin: 6px 0 0; }
  .pr-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; break-inside: avoid; }
  .pr-sign span { display: block; height: 40px; border-bottom: 1px solid #000; margin-bottom: 4px; }
  .pr-meta { grid-column: 1 / -1; font-size: 8.5pt; color: #555; }
}

/* =====================================================================================
   ANIMATION
   ===================================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes pop-big { from { opacity: 0; transform: scale(.7); } 60% { transform: scale(1.04); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .7); } 70% { box-shadow: 0 0 0 .7em rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
@keyframes live-green { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@keyframes flash { 0%, 100% { box-shadow: var(--sh-1); } 25%, 75% { box-shadow: 0 0 0 6px var(--warn-line); border-color: #f59e0b; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes shimmer-bg { to { background-position: -200% 0; } }
@keyframes shine { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@keyframes bump { 0% { background: rgba(255, 255, 255, .22); } 100% { background: transparent; } }
@keyframes rise-spark { 0% { opacity: 0; transform: translateY(0) rotate(45deg) scale(var(--s)); } 15% { opacity: .9; } 100% { opacity: 0; transform: translateY(-85vh) rotate(225deg) scale(var(--s)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .sparkles { display: none; }
}

/* =====================================================================================
   RESPONSIVE
   ===================================================================================== */
@media (max-width: 1180px) {
  .monitor-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .monitor-hero .mh-status { grid-column: 1 / -1; }
  .ready-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps .step-l { display: none; }
  .steps li { padding: 4px; }
}
@media (max-width: 1024px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 284px; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--sh-3); }
  .admin.nav-open .sidebar { transform: none; }
  .admin.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(11, 18, 32, .45); z-index: 35; }
  .sb-close, .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .tb-actions .btn span { display: none; }
  .page { padding: 22px 18px 64px; }
  .stat-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-layout { grid-template-columns: minmax(0, 1fr); }
  .brand-preview { position: static; }
  .bc-ticker { grid-template-columns: repeat(3, auto) minmax(140px, 1fr); }
  .tk-status { grid-column: 1 / -1; justify-self: start; }
  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-4.tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing-strip { grid-template-columns: minmax(0, 1fr); }
  .station-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .station-bar .steps { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .ballot-chips { top: 118px; }
  .review-item { grid-template-columns: minmax(0, 1fr) auto; }
  .review-item .rv-choices { grid-column: 1 / -1; grid-row: 2; }
  .manifesto, .cand-form { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .wz-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 8px; }
  .wz-steps li::before { display: none; }
  .wz-options, .wz-options.three, .roles-help { grid-template-columns: minmax(0, 1fr); }
  .monitor-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checklist li { grid-template-columns: 22px minmax(0, 1fr); }
  .checklist li span { grid-column: 2; }
  .tl-meta { margin-left: 0; width: 100%; }
  .bc { height: auto; min-height: 100vh; }
  body.mode-broadcast { overflow: auto; }
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
  .bc-head { flex-direction: column; align-items: flex-start; }
  .bc-toolbar { position: fixed; top: auto; bottom: 10px; flex-wrap: wrap; justify-content: center; width: calc(100% - 24px); }
}
@media (max-width: 560px) {
  .code-form { flex-direction: column; }
  .code-form .btn { width: 100%; }
  .hero-actions .btn-xl { min-width: 0; width: 100%; }
  .lt-nav .btn span { display: none; }
  .stat-grid, .stat-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 26px; }
  .bf-inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .bf-status { flex-basis: auto; }
  .ballot-head { flex-direction: column; }
  .pos-row { flex-wrap: wrap; }
  .pos-row .rule-pill, .pos-row .pos-cands { order: 5; }
  .ready-grid { grid-template-columns: minmax(0, 1fr); }
  .sb-brand .logo, .sb-brand .logo-crest { width: 36px !important; height: 36px !important; }
  .sb-title { font-size: 15px; }
  .station-bar .status-pill { display: none; }
  .modal-footer .btn { flex: 1 1 auto; }
  .toolbar .input { min-width: 0; flex: 1 1 140px; }
  .tb-election { display: none; }
}
@media (max-width: 980px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
}
/* very large displays: Smartboards and projectors */
@media (min-width: 1800px) {
  body { font-size: 18px; }
  .station-main { max-width: 1560px; }
  .cand-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .bf-inner { max-width: 1560px; }
}

/* create codes for a class */
.create-codes { margin-bottom: 20px; border-color: var(--brand-line); }
.create-codes-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.create-codes-form .field { margin-bottom: 0; }
.empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 640px) { .create-codes-form { grid-template-columns: minmax(0, 1fr); } }
