/* i-vote prototype. Colour, type and button language follow Kuza Ndoto
   (frontend/app/globals.css): navy, warm yellow, emerald, paper. */
:root {
  --navy: #1f2d42;
  --navy-2: #34465f;
  --navy-deep: #0f1b28;
  --ink: #243247;
  --muted: #66758a;
  --line: #dfe6e1;
  --mist: #f2f5f1;
  --paper: #f8f9f5;
  --yellow: #ffc107;
  --yellow-hover: #f0b400;
  --yellow-ink: #8a6400;
  --yellow-soft: #fff6d6;
  --emerald: #005a36;
  --emerald-soft: #e8f3ec;
  --red: #9b3424;
  --red-soft: #fbefed;
  --sans: "Trebuchet MS", Arial, Helvetica, sans-serif;
  --label: Arial, Helvetica, sans-serif;
  --mono: Consolas, "Courier New", monospace;
  --shadow: 0 1px 2px #0f1b280a, 0 12px 32px -18px #0f1b2840;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, p, ol, ul, dl, dd, fieldset, legend { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 10px; background: var(--yellow); color: var(--navy); padding: 8px 14px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 10px; }
.wrap { width: min(1120px, calc(100% - 52px)); margin-inline: auto; }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

.label { font: 800 10px var(--label); letter-spacing: 0.14em; text-transform: uppercase; }
.label.muted { color: var(--muted); }
.label.gold { color: var(--yellow); }
.label.gold-ink { color: var(--yellow-ink); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); }
.brand svg { width: 38px; height: 38px; transition: transform 0.25s; }
.brand:hover svg { transform: rotate(-6deg) scale(1.08); }
.login-art .brand svg { width: 52px; height: 52px; }
.login-art .brand .brand-word { font-size: 28px; }
.brand-word { font-size: 21px; font-weight: 700; letter-spacing: -0.04em; }
.brand-word i { font-style: normal; color: var(--yellow-ink); }
.brand.on-dark { color: #fff; }
.brand.on-dark i { color: var(--yellow); }

/* Buttons (Kuza pill buttons) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 26px; border-radius: 999px; font: 800 11px var(--label); letter-spacing: 0.13em; text-transform: uppercase; transition: transform 0.2s, background 0.2s, border-color 0.2s; }
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--yellow); color: var(--navy-deep); }
.btn.primary:hover { background: var(--yellow-hover); }
.btn.ghost { border: 1px solid #1f2d4240; color: var(--navy); background: #fff; }
.btn.ghost:hover { border-color: var(--navy); background: var(--yellow-soft); }
.btn.wide { width: 100%; }
.btn .ico { font-size: 14px; }
.link-btn { font-size: 14px; font-weight: 700; color: var(--yellow-ink); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--navy); }
.link-btn.on-dark { color: #c9d3e0; font-weight: 400; }
.link-btn.on-dark:hover { color: var(--yellow); }

/* ---------- Sign in ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.login-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px clamp(28px, 5vw, 72px) 44px; color: #d5deea; background-color: var(--navy-deep);
  /* Solid navy with a faint tech/election pattern (bg.svg), kept calm behind the text and livelier towards the right */
  background-image: linear-gradient(90deg, #0f1b28 0%, #0f1b28e0 38%, #0f1b2873 72%, #0f1b2840 100%), url("bg.svg"), linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 70%);
  background-size: auto, 360px 360px, auto; }
.login-copy { position: relative; display: grid; gap: 28px; margin-block: auto 0; }
.login-pitch { max-width: 470px; }
.login-pitch h1 { margin: 16px 0 20px; color: #fff; font-size: clamp(36px, 4.4vw, 56px); line-height: 1.04; letter-spacing: -0.045em; font-weight: 700; }
.login-pitch h1 em { font-style: normal; color: var(--yellow); }
.login-pitch p:last-child { font-size: 17px; line-height: 1.65; color: #e3eaf3; }
.assure { position: relative; z-index: 1; display: grid; gap: 14px; max-width: 470px; padding-top: 24px; border-top: 1px solid #ffffff1f; }
.assure li { display: flex; gap: 14px; font-size: 14px; line-height: 1.5; color: #d5deea; }
.assure .ico { font-size: 18px; color: var(--yellow); margin-top: 1px; }
.assure b { display: block; color: #fff; font-size: 15px; }
.login-form { display: grid; place-items: center; padding: 48px clamp(24px, 5vw, 72px); }
.login-form form { width: min(400px, 100%); }
.login-form h2 { margin: 10px 0 6px; font-size: 34px; letter-spacing: -0.04em; color: var(--navy); line-height: 1.1; }

.sub { color: var(--muted); font-size: 16px; max-width: 62ch; }
.field { display: block; margin-top: 20px; }
.field span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; color: var(--navy); }
.field input { width: 100%; height: 50px; padding: 0 15px; border: 1px solid #c7d1cb; border-radius: 8px; background: #fff; font-size: 16px; transition: border-color 0.15s, box-shadow 0.15s; }
.field input::placeholder { color: #9aa6b4; }
.field input:hover { border-color: var(--navy-2); }
.field input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px #ffc10766; }
.login-form .btn { margin-top: 26px; }
.hint { margin-top: 12px; font-size: 13px; color: var(--muted); }
.hint.center, .actions.center { text-align: center; justify-content: center; }
.hint b { color: var(--ink); }

.guide { margin-top: 28px; padding: 14px 16px; border: 1px dashed #b8c6be; border-radius: 8px; background: var(--paper); font-size: 13.5px; color: var(--muted); }
.guide .label { color: var(--navy-2); margin-bottom: 5px; }
.guide .link-btn { margin-top: 6px; font-size: 13.5px; }
.guide b { color: var(--navy); }

.msg { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: 8px; font-size: 14.5px; line-height: 1.45; }
.msg .ico { margin-top: 2px; font-size: 16px; }
.msg.bad { background: var(--red-soft); color: var(--red); }
.msg.good { background: var(--emerald-soft); color: var(--emerald); font-weight: 700; }
.msg.warn { background: var(--yellow-soft); color: var(--yellow-ink); font-weight: 700; }
.msg.block p { margin-top: 4px; color: #6d3a31; }

/* ---------- Shell ---------- */
.top { background: linear-gradient(120deg, var(--navy) 0%, var(--navy-deep) 100%); color: #fff; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }
.steps { display: flex; gap: 6px; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 0; font: 800 10px var(--label); letter-spacing: 0.12em; text-transform: uppercase; color: #8fa0b6; }
.steps li + li::before { content: ""; width: 22px; height: 1px; background: #ffffff2e; margin-right: 6px; }
.steps .dot { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid #ffffff3d; font-size: 10px; letter-spacing: 0; }
.steps .is-now { color: #fff; }
.steps .is-now .dot { background: var(--yellow); border-color: var(--yellow); color: var(--navy-deep); }
.steps .is-done { color: #c9d3e0; }
.steps .is-done .dot { background: #ffffff1f; border-color: transparent; color: var(--yellow); }
.steps .dot .ico { width: 12px; height: 12px; stroke-width: 3; vertical-align: 0; }
.steps-mini { display: none; font: 800 10px var(--label); letter-spacing: 0.12em; text-transform: uppercase; color: #c9d3e0; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.who-mail { color: #c9d3e0; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: #ffffff1f; color: #fff; font: 800 12px var(--label); }
.avatar.lg { width: 54px; height: 54px; font-size: 17px; background: var(--navy); }

.page { padding: 40px 0 72px; min-height: calc(100vh - 68px - 62px); }
.head { margin-bottom: 28px; }
.head.tight { margin: 28px 0 22px; }
h1 { margin: 8px 0 10px; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -0.04em; color: var(--navy); font-weight: 700; }
.foot { border-top: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 62px; padding: 12px 0; }
.foot b { color: var(--navy); }
.foot-in > p:first-child { margin-right: auto; }
.powered { font: 800 10px var(--label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.powered b { color: var(--yellow-ink); }
.login-art .powered { position: relative; z-index: 1; color: #a9b8cb; }
.login-art .powered b { color: var(--yellow); }
.ticket-foot { padding: 11px 24px; border-top: 1px solid var(--line); background: var(--paper); text-align: center; font: 800 9px var(--label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.foot .link-btn { font-size: 13px; white-space: nowrap; }

/* ---------- Institutions ---------- */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-bottom: 24px; }
.search { position: relative; flex: 1 1 280px; max-width: 380px; }
.search .ico { position: absolute; left: 15px; top: 50%; margin-top: -9px; font-size: 16px; color: var(--muted); }
.search input { width: 100%; height: 46px; padding: 0 16px 0 42px; border: 1px solid #c7d1cb; border-radius: 999px; background: #fff; font-size: 15px; }
.search input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px #ffc10766; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: 800 10px var(--label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--navy-2); }
.filters button:hover { border-color: var(--navy); }
.filters button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; width: 100%; height: 100%; padding: 22px 22px 20px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
button.card:hover { transform: translateY(-3px); border-color: var(--navy); box-shadow: 0 1px 2px #0f1b280a, 0 22px 40px -22px #0f1b2866; }
.card.is-off { background: transparent; box-shadow: none; color: var(--muted); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-name { margin-top: 16px; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; color: var(--navy); }
.is-off .card-name { color: var(--navy-2); }
.card-elec { margin-top: 4px; font-size: 14.5px; color: var(--muted); }
.card .meter { margin-top: 20px; }
.card-foot { margin-top: 8px; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.card-when { font-size: 13px; color: var(--muted); }
.card-go { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 18px; font: 800 10px var(--label); letter-spacing: 0.13em; text-transform: uppercase; color: var(--navy); }
.card-go .ico { transition: transform 0.2s; }
button.card:hover .card-go .ico { transform: translateX(4px); }
.meter { display: block; height: 5px; border-radius: 99px; background: var(--mist); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--navy); }
.is-off .meter i { background: #b4bfcc; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--mist); color: var(--navy-2); font: 800 9px var(--label); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.chip.live { background: var(--emerald-soft); color: var(--emerald); }
.chip.live i { width: 6px; height: 6px; border-radius: 50%; background: #1c9a5e; animation: pulse 1.8s infinite; }
.chip.ok { background: var(--emerald); color: #fff; }
.chip.ok .ico { width: 11px; height: 11px; stroke-width: 3.5; }
.chip.dim { color: var(--muted); }
.empty { padding: 36px; border: 1px dashed #b8c6be; border-radius: 12px; text-align: center; color: var(--muted); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 #1c9a5e80; } 70%, 100% { box-shadow: 0 0 0 7px #1c9a5e00; } }

/* ---------- Banner, panels ---------- */
.back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; font: 800 10px var(--label); letter-spacing: 0.13em; text-transform: uppercase; color: var(--navy-2); }
.back:hover { color: var(--navy); }
.banner { display: flex; align-items: center; gap: 18px; padding: 18px 22px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.crest { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 12px; background: var(--navy); color: var(--yellow); font: 800 15px var(--label); letter-spacing: 0.04em; }
.banner-name { margin-top: 3px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); line-height: 1.25; }
.banner-elec { font-size: 14px; color: var(--muted); }
.banner-when { margin-left: auto; padding-left: 16px; font-size: 13px; color: var(--muted); text-align: right; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; margin-top: 24px; }
.panel { padding: 34px 36px 36px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.panel form { max-width: 440px; }
.panel form .btn { margin-top: 20px; }
.aside { padding: 26px 26px 28px; border-radius: 12px; background: var(--mist); border: 1px solid var(--line); }
.aside h2 { font: 800 10px var(--label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-2); margin-bottom: 16px; }
.how { counter-reset: how; display: grid; gap: 16px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.how li { counter-increment: how; position: relative; padding-left: 38px; }
.how li::before { content: counter(how); position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: var(--yellow); font: 800 11px var(--label); }
.how b { display: block; color: var(--navy); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Register record */
.record { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.record > div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 20px; font-size: 14.5px; }
.record > div + div { border-top: 1px solid var(--line); }
.record dt { color: var(--muted); }
.record dd { color: var(--navy); font-weight: 700; text-align: right; }
.record .record-who { justify-content: flex-start; align-items: center; gap: 16px; padding: 20px; background: var(--paper); }
.record-who dd { text-align: left; }
.record-who .record-name { font-size: 21px; letter-spacing: -0.02em; }
.record-who .mono { font-weight: 400; color: var(--muted); font-size: 14px; }

/* Checking / sealing */
.checking { margin-top: 26px; padding: 30px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.checking.solo { max-width: 520px; margin: 60px auto; background: #fff; text-align: center; box-shadow: var(--shadow); padding: 44px 36px; }
.checking h2, .checking h1 { margin: 16px 0 14px; font-size: 22px; letter-spacing: -0.03em; color: var(--navy); }
.checking ol { display: grid; gap: 8px; font-size: 14.5px; color: var(--muted); }
.checking li { opacity: 0; animation: rise 0.4s forwards; }
.checking li:nth-child(2) { animation-delay: 0.5s; }
.checking li:nth-child(3) { animation-delay: 1s; }
.spinner { display: inline-block; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--yellow); border-right-color: var(--navy); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Ballot ---------- */
.positions { display: grid; gap: 20px; }
.pos { padding: 26px 28px 28px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); scroll-margin-top: 20px; }
.pos.is-missing { border-color: var(--red); box-shadow: 0 0 0 3px #9b342422; }
.pos legend { float: left; width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.pos legend + * { clear: both; }
.pos-n { width: 100%; font: 800 10px var(--label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--yellow-ink); }
.pos-title { font-size: 24px; font-weight: 700; letter-spacing: -0.035em; color: var(--navy); line-height: 1.2; margin-right: auto; }
.pos-note { padding-top: 6px; font-size: 14.5px; color: var(--muted); }
.cands { display: grid; gap: 10px; margin-top: 18px; }
.cands.two { grid-template-columns: 1fr 1fr; }
.cands.two .abstain { grid-column: 1 / -1; }
.cand { position: relative; display: flex; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.cand:hover { border-color: var(--navy-2); }
.cand input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cand:has(input:focus-visible) { outline: 2px solid var(--yellow); outline-offset: 2px; }
.cand:has(input:checked) { border-color: var(--navy); background: var(--yellow-soft); box-shadow: inset 0 0 0 1px var(--navy); }
.cand:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.cand-av { width: 44px; height: 44px; font-size: 14px; background: #e6ebf2; color: var(--navy); }
.cand:has(input:checked) .cand-av { background: var(--navy); color: var(--yellow); }
.cand-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.cand-name { font-size: 17px; font-weight: 700; color: var(--navy); letter-spacing: -0.015em; }
.cand-line { font-size: 13.5px; color: var(--muted); }
.cand.abstain { border-style: dashed; padding-block: 11px; }
.cand.abstain .cand-name { font-size: 15px; color: var(--navy-2); }
.tick { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #b4bfcc; color: transparent; transition: all 0.15s; }
.cand input[type="checkbox"] ~ .tick { border-radius: 7px; }
.tick .ico { width: 14px; height: 14px; stroke-width: 3.2; vertical-align: 0; }
.cand:has(input:checked) .tick { background: var(--navy); border-color: var(--navy); color: var(--yellow); }
.sticky { position: sticky; top: 20px; }
.sum { display: grid; gap: 4px; margin-bottom: 20px; }
.sum a { display: flex; gap: 12px; padding: 9px 8px; border-radius: 8px; text-decoration: none; color: inherit; }
.sum a:hover { background: #fff; }
.sum .dot { display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 1.5px dashed #a9b5c2; }
.sum .is-done .dot { border: 0; background: var(--emerald); color: #fff; }
.sum .dot .ico { width: 12px; height: 12px; stroke-width: 3.4; vertical-align: 0; }
.sum b { display: block; font-size: 13.5px; color: var(--navy); }
.sum b + span { font-size: 13px; color: var(--muted); }
.sum .is-done b + span { color: var(--ink); }
.aside .msg { margin: 0 0 14px; font-size: 13.5px; }
.aside .hint { font-size: 12.5px; }

/* Review */
.review { margin-top: 24px; border: 1px solid var(--line); border-radius: 12px; }
.review li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; }
.review li + li { border-top: 1px solid var(--line); }
.rev-pick { margin-top: 3px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); }
.rev-pick.abst { color: var(--muted); font-weight: 400; font-style: italic; }
.panel #f-cast { max-width: none; }
.declare { display: flex; gap: 14px; align-items: flex-start; margin-top: 22px; padding: 16px 18px; border-radius: 10px; background: var(--yellow-soft); font-size: 14.5px; cursor: pointer; }
.declare input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--navy); }
.panel #f-cast .btn { margin-top: 0; }

/* ---------- Receipt ---------- */
.receipt { max-width: 640px; margin: 12px auto 0; text-align: center; }
.receipt .sub { margin-inline: auto; }
.seal { display: inline-grid; place-items: center; width: 76px; height: 76px; margin-bottom: 18px; border-radius: 50%; background: var(--emerald); color: #fff; box-shadow: 0 0 0 10px var(--emerald-soft); animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
.seal .ico { width: 36px; height: 36px; stroke-width: 2.6; }
@keyframes pop { from { transform: scale(0.5); opacity: 0; } to { transform: none; opacity: 1; } }
.ticket { margin-top: 30px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; text-align: left; }
.ticket-main { padding: 28px 28px 24px; text-align: center; background: linear-gradient(160deg, var(--navy), var(--navy-deep)); color: #fff; }
.ticket-main .label { color: #9fb0c6; }
.code { margin: 10px 0 12px; font-size: clamp(24px, 5vw, 34px); font-weight: 700; letter-spacing: 0.08em; color: var(--yellow); }
.ticket-main .link-btn { color: #c9d3e0; font-weight: 400; font-size: 13.5px; }
.ticket-main .link-btn:hover { color: #fff; }
.ticket-meta { display: grid; grid-template-columns: 1fr 1fr; border-top: 2px dashed var(--line); }
.ticket-meta div { padding: 16px 24px; border-bottom: 1px solid var(--line); }
.ticket-meta div:nth-child(odd) { border-right: 1px solid var(--line); }
.ticket-meta div:nth-last-child(-n + 2) { border-bottom: 0; }
.ticket-meta dt { font: 800 9px var(--label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ticket-meta dd { font-size: 14.5px; font-weight: 700; color: var(--navy); }
.turnout { margin-top: 26px; padding: 20px 24px; border-radius: 12px; background: var(--mist); text-align: left; font-size: 14.5px; }
.turnout b { font-size: 18px; color: var(--navy); }
.turnout .meter { margin: 10px 0 2px; background: #fff; }
.turnout .meter i { background: var(--emerald); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .steps { display: none; }
  .steps-mini { display: block; }
  .split { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-art { padding-block: 26px 30px; gap: 28px; }
  .assure { display: none; }
  .login-form { padding-block: 36px 48px; place-items: start center; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 34px); }
  .page { padding-top: 26px; }
  .who-mail, .who .avatar { display: none; }
  .banner { flex-wrap: wrap; gap: 12px 14px; padding: 16px; }
  .banner-when { width: 100%; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); text-align: left; }
  .panel, .pos { padding: 22px 18px 24px; }
  .inst-grid { grid-template-columns: 1fr; }
  .cands.two { grid-template-columns: 1fr; }
  .cand { gap: 12px; padding: 12px; }
  .record > div:not(.record-who) { flex-direction: column; gap: 2px; }
  .record dd { text-align: left; }
  .ticket-meta { grid-template-columns: 1fr; }
  .ticket-meta div { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .ticket-meta div:last-child { border-bottom: 0 !important; }
  .foot-in { flex-direction: column; align-items: flex-start; gap: 6px; }
  .actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-delay: 0s !important; }
}
@media print {
  .top, .foot, .no-print, .turnout { display: none !important; }
  body { background: #fff; }
  .ticket-main, .seal { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Sign-in fits the window ----------
   The page is exactly one screen tall, and its type and spacing scale with the
   window height, so nothing needs scrolling on a laptop or a phone. */
.login { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.login-art, .login-form { min-height: 0; }
.login-art { gap: clamp(10px, 3vh, 40px); padding-block: clamp(14px, 5vh, 40px) clamp(14px, 5vh, 44px); }
.login-art .brand svg { width: clamp(34px, 6.500vh, 52px); height: clamp(34px, 6.500vh, 52px); }
.login-art .brand .brand-word { font-size: clamp(21px, 3.500vh, 28px); }
.login-copy { gap: clamp(10px, 3.200vh, 28px); }
.login-pitch h1 { margin: clamp(6px, 2vh, 16px) 0 clamp(8px, 2.400vh, 20px); font-size: clamp(26px, min(4.400vw, 7vh), 56px); }
.login-pitch p:last-child { font-size: clamp(14px, 2.200vh, 17px); line-height: 1.55; }
.assure { gap: clamp(6px, 1.700vh, 14px); padding-top: clamp(10px, 3vh, 24px); }
.assure li { font-size: clamp(12.500px, 1.800vh, 14px); line-height: 1.45; }
.assure b { font-size: clamp(13.500px, 1.900vh, 15px); }
.login-form { padding-block: clamp(12px, 5vh, 48px); }
.login-form h2 { margin: clamp(6px, 1.300vh, 10px) 0 clamp(3px, 0.800vh, 6px); font-size: clamp(24px, 4.400vh, 34px); }
.login-form .sub { font-size: clamp(14px, 2vh, 16px); }
.login-form .msg { margin-top: clamp(8px, 2.200vh, 18px); padding-block: clamp(7px, 1.500vh, 12px); }
.login-form .field { margin-top: clamp(9px, 2.500vh, 20px); }
.login-form .field span { margin-bottom: clamp(4px, 0.900vh, 7px); }
.login-form .field input { height: clamp(40px, 6.200vh, 50px); }
.login-form .btn { margin-top: clamp(12px, 3.200vh, 26px); min-height: clamp(40px, 5.800vh, 46px); }
.login-form .guide { margin-top: clamp(10px, 3.400vh, 28px); padding-block: clamp(8px, 1.700vh, 14px); }
@media (max-height: 640px) {
  .login-pitch p:last-child { display: none; }
}
@media (max-height: 540px) {
  .assure { display: none; }
  .login-form .guide p:not(.label) { display: none; }
}
@media (max-width: 860px) {
  /* Phone: a compact brand band on top, the form filling the rest */
  .login { grid-template-rows: auto minmax(0, 1fr); }
  .login-art { gap: clamp(8px, 1.800vh, 16px); padding-block: clamp(12px, 2.600vh, 22px); }
  .login-art .brand svg { width: 38px; height: 38px; }
  .login-art .brand .brand-word { font-size: 22px; }
  .login-copy { gap: clamp(8px, 1.600vh, 14px); margin: 0; }
  .login-pitch > .label, .login-pitch p:last-child, .login-pitch h1 br { display: none; }
  .login-pitch h1 { margin: 0; font-size: clamp(22px, 3.600vh, 30px); line-height: 1.12; }
  .login-form { place-items: center; padding-block: clamp(10px, 2.400vh, 28px); }
  .login-form .guide p:not(.label) { display: none; }
  .login-form .guide .link-btn { margin-top: 0; }
}
@media (max-width: 860px) and (max-height: 620px) {
  /* Small phones: drop the secondary lines and flatten the guide to a single link */
  .login-form .sub, .login-form form > .label, .login-form .guide .label { display: none; }
  .login-form h2 { margin-top: 0; }
  .login-form .guide { margin-top: 10px; padding: 0; border: 0; background: none; text-align: center; }
}
/* Windows too short for even the compact layout scroll instead of cutting content off */
@media (max-height: 430px) {
  .login { height: auto; min-height: 100vh; overflow: visible; }
}

/* Security indicators on the sign-in page */
.login-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.secure { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 1px solid #3ecf8e66; background: #1c9a5e2e; color: #8ff0bf; font: 800 10px var(--label); letter-spacing: 0.13em; text-transform: uppercase; white-space: nowrap; }
.secure .ico { width: 13px; height: 13px; stroke-width: 2.400; vertical-align: 0; }
.secure-note { display: flex; align-items: flex-start; justify-content: center; gap: 8px; margin-top: clamp(8px, 1.800vh, 14px); font-size: 13px; line-height: 1.4; color: var(--muted); }
.secure-note .ico { font-size: 15px; color: var(--emerald); margin-top: 1px; }
.secure-note b { color: var(--emerald); }
@media (max-height: 540px) { .secure-note { display: none; } }
@media (max-width: 860px) and (max-height: 720px) { .secure-note { display: none; } }
.brand { flex: none; }
.brand-word { white-space: nowrap; }
@media (max-width: 400px) {
  .login-top { gap: 8px; }
  .login-top .brand { gap: 8px; }
  .login-art .login-top .brand svg { width: 32px; height: 32px; }
  .login-art .login-top .brand-word { font-size: 19px; }
  .secure { gap: 5px; padding: 6px 9px; font-size: 9px; letter-spacing: 0.050em; }
}

/* Ballot: one position at a time */
.pills { display: flex; flex-wrap: wrap; gap: 8px; scroll-margin-top: 16px; }
.pill { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid #c7d1cb; background: #fff; color: var(--navy-2); font: 800 12px var(--label); transition: border-color 0.15s, background 0.15s, transform 0.15s; }
.pill:hover { border-color: var(--navy); transform: translateY(-1px); }
.pill .ico { display: none; width: 15px; height: 15px; stroke-width: 3.2; vertical-align: 0; }
.pill.is-done { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.pill.is-done span { display: none; }
.pill.is-done .ico { display: block; }
.pill.is-now { background: var(--yellow); border-color: var(--yellow); color: var(--navy-deep); box-shadow: 0 0 0 4px #ffc10740; }
.pill.is-now span { display: block; }
.pill.is-now .ico { display: none; }
.pos-title:focus { outline: none; }
.pos .msg { margin-top: 16px; }
.pos-nav { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.sum button { display: flex; gap: 12px; width: 100%; padding: 9px 8px; border-radius: 8px; text-align: left; }
.sum button:hover { background: #fff; }
.sum .is-now button { background: #fff; box-shadow: inset 3px 0 0 var(--yellow); }
.sum .is-now:not(.is-done) .dot { border-style: solid; border-color: var(--yellow-ink); }
#sum-count { color: var(--yellow-ink); }

/* ---------- Real system additions ---------- */
/* If a form cannot fit a very short window, its column scrolls instead of being cut off */
.login-form { overflow-y: auto; align-items: safe center; }
.invitee { margin-top: clamp(8px, 2vh, 16px); border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 13.5px; }
.invitee div { display: flex; justify-content: space-between; gap: 14px; padding: clamp(5px, 1vh, 8px) 14px; }
.invitee div + div { border-top: 1px solid var(--line); }
.invitee dt { color: var(--muted); white-space: nowrap; }
.invitee dd { color: var(--navy); font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.foot .ico { color: var(--emerald); }
.receipt-check { margin-top: 36px; padding: 24px 26px; border: 1px solid var(--line); border-radius: 12px; background: #fff; max-width: 620px; }
.receipt-check h2 { font-size: 18px; letter-spacing: -0.02em; color: var(--navy); }
.receipt-check > p { margin-top: 4px; font-size: 14px; color: var(--muted); }
.receipt-check form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.receipt-check input { flex: 1 1 220px; height: 46px; padding: 0 15px; border: 1px solid #c7d1cb; border-radius: 8px; font-size: 15px; text-transform: uppercase; }
.receipt-check input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px #ffc10766; }
.receipt .msg { text-align: left; }
.v-loading .checking { margin-top: 20vh; }

/* ---------- Admin pane (/manage/) ---------- */
.brand img { width: 38px; height: 38px; }
a.brand { text-decoration: none; }
.mnav { display: flex; gap: 4px; margin-right: auto; margin-left: 12px; }
.mnav button { padding: 8px 14px; border-radius: 999px; color: #c9d3e0; font: 800 10px var(--label); letter-spacing: 0.13em; text-transform: uppercase; }
.mnav button:hover { color: #fff; background: #ffffff14; }
.mnav button[aria-current="page"] { background: var(--yellow); color: var(--navy-deep); }
.chip.role { background: #ffffff1f; color: #fff; }
.manage .page > .msg { margin: 0 0 20px; }
.manage .msg.block p { color: inherit; font-weight: 400; }
.manage .msg.block ul { margin: 6px 0 0 18px; list-style: disc; font-weight: 400; font-size: 13.5px; }
.wrapany { overflow-wrap: anywhere; font-size: 13px; }
.head.row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.h2 { font-size: 24px; letter-spacing: -0.035em; color: var(--navy); }
.btn.sm { min-height: 36px; padding: 0 16px; font-size: 10px; gap: 7px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.link-btn.danger { color: var(--red); font-size: 13px; }
.manage .panel { margin-bottom: 20px; }
.manage .panel form { max-width: none; }
.manage .panel form .btn { margin-top: 0; }
.panel.narrow { max-width: 640px; }
.panel.tight { padding: 24px 26px 26px; }
.panel h2 { font-size: 19px; letter-spacing: -0.025em; color: var(--navy); }
.panel h3 { margin: 22px 0 10px; font: 800 10px var(--label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-2); }
.panel .actions { margin-top: 18px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid2.top, .grid3 { align-items: start; gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-pos { display: grid; grid-template-columns: 1fr 170px; gap: 0 16px; }
.manage .field { margin-top: 14px; }
.manage .field input, .field select { height: 44px; font-size: 15px; }
.field select { width: 100%; padding: 0 12px; border: 1px solid #c7d1cb; border-radius: 8px; background: #fff; font: inherit; color: inherit; }
.field select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px #ffc10766; }
.panel input[type="file"] { display: block; width: 100%; margin: 14px 0; font-size: 14px; }
.big { margin: 12px 0 14px; font-size: 38px; font-weight: 700; letter-spacing: -0.04em; color: var(--navy); line-height: 1.1; }
.big small { font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.inst-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 18px; margin-bottom: 18px; }
.inst-head > div:nth-child(2) { flex: 1 1 320px; }
.inst-head h2 { font-size: 22px; margin: 3px 0; }
.inst-head .sub { font-size: 14px; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }
td.acts { justify-content: flex-end; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { padding: 11px 16px; text-align: left; background: var(--mist); color: var(--navy-2); font: 800 9px var(--label); letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
.tbl td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl td b { color: var(--navy); }
.tbl small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.tbl td .chip + small { display: inline; margin-left: 6px; }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.searchbar { display: flex; gap: 10px; margin-bottom: 16px; }
.searchbar input { flex: 1; height: 40px; padding: 0 14px; border: 1px solid #c7d1cb; border-radius: 999px; font: inherit; font-size: 14.5px; }
.manage .filters { margin-bottom: 16px; }
.cand-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; margin-top: 8px; }
.cand-row input { height: 40px; padding: 0 12px; border: 1px solid #c7d1cb; border-radius: 8px; font: inherit; font-size: 14.5px; min-width: 0; }
.cand-row input:focus, .searchbar input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px #ffc10766; }
.cand-row.new { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #b8c6be; }
.pos-edit.new { border-style: dashed; box-shadow: none; background: var(--paper); }
.res-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 16px; }
.res-head p { font-size: 13.5px; color: var(--muted); }
.bar-row + .bar-row { margin-top: 14px; }
.bar-top { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 6px; font-size: 15px; }
.bar-top b { color: var(--navy); }
.bar-top span { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-row .meter { height: 10px; }
.bar-row .meter i { background: #9fb0c6; }
.bar-row.lead .meter i { background: var(--emerald); }
.bar-row.lead .bar-top span { color: var(--emerald); font-weight: 700; }
.turnout-box .meter { height: 8px; }
.turnout-box .meter i { background: var(--navy); }
.roles { display: grid; gap: 12px; margin-top: 14px; font-size: 14px; }
.roles dt { font-weight: 700; color: var(--navy); }
.roles dd { color: var(--muted); }
@media (max-width: 1000px) {
  .grid3, .grid2.top { grid-template-columns: 1fr; }
  .mnav { order: 3; width: 100%; margin: 0 0 10px; }
  .manage .top-in { flex-wrap: wrap; padding-top: 10px; }
}
@media (max-width: 640px) {
  .grid2, .grid-pos { grid-template-columns: 1fr; }
  .cand-row { grid-template-columns: 1fr; }
}
@media print {
  .manage .back, .manage .mnav { display: none !important; }
}
.v-results .panel.res { margin-top: 18px; }
.v-results .panel h2 { font-size: 19px; letter-spacing: -0.025em; color: var(--navy); }

/* Open ballot, stats and votes-by-voter */
.chip.open { background: var(--yellow-soft); color: var(--yellow-ink); }
.manage .panel > .msg { margin: 12px 0 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
.tiles div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.tiles dt { font: 800 9px var(--label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.tiles dd { margin-top: 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; color: var(--navy); font-variant-numeric: tabular-nums; }
.hours { display: grid; gap: 8px; }
.hours li { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 12px; font-size: 13.5px; }
.hours .hour-label { color: var(--muted); white-space: nowrap; }
.hours .meter { height: 10px; }
.hours .meter i { background: var(--navy); }
.hours b { text-align: right; color: var(--navy); font-variant-numeric: tabular-nums; }
.vote-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 16px; }
.vote-col { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.vote-head { display: flex; justify-content: space-between; gap: 10px; padding: 11px 14px; background: var(--mist); font-size: 14.5px; }
.vote-head b { color: var(--navy); }
.vote-head span { font-weight: 700; color: var(--emerald); font-variant-numeric: tabular-nums; }
.vote-col.abst { border-style: dashed; }
.vote-col ul { padding: 6px 14px 10px; font-size: 14px; }
.vote-col li { padding: 6px 0; }
.vote-col li + li { border-top: 1px solid var(--line); }
.vote-col small { display: block; font-size: 12px; color: var(--muted); }
.vote-col .hint { margin: 0; padding: 12px 14px; }

/* ================= Admin dashboard ================= */
body.manage { background: #f3f5f2; }
a.btn { text-decoration: none; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover { background: #812a1c; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Layout: fixed sidebar, sticky top bar, scrolling content */
.dash { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px 16px; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%); color: #c9d3e0; z-index: 30; }
.side .brand { padding: 2px 8px 24px; }
.side .brand img { width: 36px; height: 36px; }
.side nav { display: grid; gap: 4px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #c9d3e0; text-decoration: none; font-size: 14.5px; font-weight: 700; transition: background 0.15s, color 0.15s; }
.side nav a .ico { font-size: 17px; }
.side nav a:hover { background: #ffffff12; color: #fff; }
.side nav a[aria-current="page"] { background: var(--yellow); color: var(--navy-deep); }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 6px 0; border-top: 1px solid #ffffff1f; }
.side-user div { min-width: 0; }
.side-user b { display: block; color: #fff; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { display: block; font-size: 12px; color: #9fb0c6; }
.side-user button { margin-left: auto; padding: 8px; border-radius: 8px; color: #c9d3e0; font-size: 17px; }
.side-user button:hover { background: #ffffff1a; color: var(--yellow); }
.scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 0 clamp(16px, 3vw, 36px); background: #ffffffee; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; place-items: center; width: 40px; height: 40px; margin-left: -8px; border-radius: 8px; font-size: 20px; color: var(--navy); }
.menu-btn:hover { background: var(--mist); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13.5px; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: #b4bfcc; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--navy); text-decoration: underline; }
.crumbs [aria-current] { color: var(--navy); font-weight: 700; }
.bar-secure { margin-left: auto; border-color: transparent; background: var(--emerald-soft); color: var(--emerald); }
.content { width: 100%; max-width: 1280px; padding: 28px clamp(16px, 3vw, 36px) 36px; transition: opacity 0.15s; }
.content.is-loading { opacity: 0.5; pointer-events: none; }
.content > .msg { margin: 0 0 18px; }
.content-foot { margin-top: 34px; font-size: 12.5px; color: var(--muted); }
.content-foot b { color: var(--navy-2); }
.notice { position: relative; padding-right: 46px; }
.notice > button { position: absolute; top: 8px; right: 8px; padding: 6px; border-radius: 6px; color: inherit; }
.notice > button:hover { background: #005a361a; }
.notice p { margin-top: 4px; font-weight: 400; color: inherit; }
.notice ul { margin: 6px 0 0 18px; list-style: disc; font-weight: 400; font-size: 13.5px; }

/* Page heading and tabs */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: 22px; }
.page-head h1 { margin: 6px 0; font-size: clamp(26px, 2.6vw, 34px); }
.page-head .sub { font-size: 15px; }
.sub.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; }
.with-crest { display: flex; align-items: center; gap: 16px; }
.head-ring { display: flex; align-items: center; gap: 12px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.head-ring b { font-size: 16px; color: var(--navy); }
.tabs { display: flex; gap: 2px; margin-bottom: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { margin-bottom: -1px; padding: 11px 14px; border-bottom: 3px solid transparent; color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--navy); }
.tabs a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--yellow); }
.section-head { margin: 30px 0 14px; }
.section-head h2 { font-size: 22px; letter-spacing: -0.03em; color: var(--navy); }
.section-head .msg { margin-top: 10px; }

/* Cards */
.card { margin-bottom: 20px; padding: 22px 24px 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .tbl-wrap { border: 0; border-radius: 0; }
.card.narrow { max-width: 680px; }
.card h2 { font-size: 17px; letter-spacing: -0.02em; color: var(--navy); }
.card h3 { margin: 22px 0 10px; font: 800 10px var(--label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-2); }
.card > .hint:first-of-type, .card h2 + .hint { margin-top: 6px; }
.card .actions { margin-top: 18px; align-items: center; }
.card > .msg { margin: 12px 0 0; }
.card input[type="file"] { display: block; width: 100%; margin: 14px 0; font-size: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 17px; letter-spacing: -0.02em; color: var(--navy); }
.card-head a { font-size: 13px; font-weight: 700; color: var(--yellow-ink); text-decoration: none; }
.card-head a:hover { text-decoration: underline; }
.pad { padding: 18px 24px; }
.card-head.pad { margin: 0; }
.hint.pad { margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 26px; }
.kpi { position: relative; padding: 20px 22px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.kpi dt { padding-right: 44px; font: 800 10px var(--label); letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.kpi dd { margin-top: 10px; font-size: 36px; font-weight: 700; line-height: 1; letter-spacing: -0.04em; color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi p { margin-top: 8px; font-size: 13px; color: var(--muted); }
.kpi-ico { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--yellow-soft); color: var(--yellow-ink); font-size: 17px; }

/* Election and institution cards */
.ecards, .icards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ecard { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); transition: border-color 0.15s, transform 0.15s; }
.ecard:hover { border-color: var(--navy-2); transform: translateY(-2px); }
.ecard-top, .icard-top { display: flex; justify-content: space-between; gap: 14px; }
.icard-top { justify-content: flex-start; align-items: center; }
.ecard h3, .icard h3 { margin: 4px 0 2px; font: 700 18px/1.25 var(--sans); letter-spacing: -0.025em; text-transform: none; color: var(--navy); }
.ecard h3 a, .icard h3 a { color: inherit; text-decoration: none; }
.ecard h3 a:hover, .icard h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ecard-when { font-size: 13px; color: var(--muted); }
.ecard-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ecard-stat { font-size: 13.5px; color: var(--muted); }
.ecard-stat b { color: var(--navy); }
.ecard-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.icard { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini dt { font: 800 9px var(--label); letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.mini dd { margin-top: 4px; font-size: 22px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.ring { position: relative; flex: none; width: 64px; height: 64px; }
.ring circle { fill: none; stroke-width: 7; }
.ring-bg { stroke: var(--mist); }
.ring-fg { stroke: var(--emerald); stroke-linecap: round; transition: stroke-dasharray 0.4s; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--navy); font-variant-numeric: tabular-nums; }

/* Needs attention and activity feed */
.todo li { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; padding: 12px 0; font-size: 14px; line-height: 1.45; }
.todo li + li, .feed li + li { border-top: 1px solid var(--line); }
.todo .ico { margin-top: 2px; color: var(--yellow-ink); }
.todo a { grid-column: 2; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--yellow-ink); text-decoration: none; }
.todo a:hover { color: var(--navy); }
.all-clear { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--emerald); }
.feed li { padding: 10px 0; font-size: 13.5px; line-height: 1.4; }
.feed small { font-size: 12px; color: var(--muted); }

/* Toolbars, live notes, results, charts */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.toolbar .msg { flex: 1 1 320px; margin: 0; }
.toolbar .filters, .toolbar .live-note { margin: 0; }
.live-note { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13.5px; font-weight: 700; color: var(--yellow-ink); }
.live-note.done { color: var(--emerald); }
.quick { height: 38px; min-width: 220px; padding: 0 14px; border: 1px solid #c7d1cb; border-radius: 999px; background: #fff; font: inherit; font-size: 14px; }
.quick:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px #ffc10766; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
.res-grid .card { margin: 0; }
.cols-chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; margin-top: 14px; overflow-x: auto; }
.cols-chart li { flex: 1 0 46px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; height: 100%; }
.cols-chart .col { width: 100%; max-width: 48px; min-height: 4px; border-radius: 6px 6px 0 0; background: var(--navy); }
.cols-chart b { font-size: 12.5px; color: var(--navy); font-variant-numeric: tabular-nums; }
.cols-chart small { font-size: 10.5px; line-height: 1.2; color: var(--muted); text-align: center; }
.row-link { color: inherit; text-decoration: none; }
.row-link:hover b { text-decoration: underline; text-underline-offset: 3px; }
.tbl tbody tr:hover td { background: #fafbf8; }
.tbl .none { padding: 30px; text-align: center; color: var(--muted); }
.card.flush .searchbar { margin: 0; border-bottom: 1px solid var(--line); }

/* Empty state, toasts, confirm dialog, standalone pages */
.empty-state { padding: 46px 24px; border: 1px dashed #b8c6be; border-radius: 14px; background: #fff; text-align: center; color: var(--muted); }
.empty-title { margin-bottom: 6px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); }
.empty-state .btn { margin-top: 18px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 360px; padding: 13px 18px; border-radius: 10px; background: var(--navy-deep); color: #fff; font-size: 14px; box-shadow: 0 18px 40px -16px #0f1b28aa; animation: rise 0.25s; transition: opacity 0.3s, transform 0.3s; }
.toast .ico { color: #6fe3a8; font-size: 17px; }
.toast.bye { opacity: 0; transform: translateY(6px); }
.modal { width: min(440px, calc(100% - 40px)); padding: 26px 28px; border: 0; border-radius: 14px; box-shadow: 0 30px 80px -20px #0f1b28cc; color: var(--ink); }
.modal::backdrop { background: #0f1b2899; }
.modal h2 { font-size: 20px; letter-spacing: -0.025em; color: var(--navy); }
.modal p { margin-top: 8px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.modal .actions { justify-content: flex-end; margin-top: 24px; }
.solo-page { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 24px; color: var(--muted); }
.solo-page .card { width: min(480px, calc(100vw - 48px)); margin: 0; }
.solo-page h1 { font-size: 28px; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .cols.even, .cols.three { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: 264px; transform: translateX(-100%); transition: transform 0.2s; }
  .nav-open .side { transform: none; box-shadow: 0 0 60px #0f1b2899; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: #0f1b2880; }
  .menu-btn { display: grid; }
}
@media (max-width: 640px) {
  .bar-secure { display: none; }
  .kpis { grid-template-columns: 1fr; }
  .kpi dd { font-size: 30px; }
  .head-ring { width: 100%; }
  .res-grid { grid-template-columns: 1fr; }
  .toasts { left: 16px; right: 16px; }
  .quick { width: 100%; }
}
@media print {
  .side, .bar, .tabs, .toasts, .content-foot, .manage .no-print { display: none !important; }
  .dash { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
  .content { padding: 0; max-width: none; }
}

/* Dashboard fixes: the voter app's ".card" is a full-height flex tile; dashboard cards are plain blocks */
.manage .card { display: block; width: auto; height: auto; text-align: left; transition: none; }
.manage .icard { display: flex; }
.tabs { overflow-y: hidden; }
.ring-bg { stroke: #dfe6e1; }
.ring-fg[stroke-dasharray^="0.0 "] { display: none; }
.manage h2.plain, .cols > section > .card-head h2 { font-size: 17px; letter-spacing: -0.02em; color: var(--navy); }
.with-crest .crest, .icard-top .crest { width: auto; min-width: 52px; padding: 0 10px; font-size: 13px; }
.with-crest { min-width: 0; }
.with-crest > div { min-width: 0; }

/* Default profile pictures: a person icon for people, a building icon for institutions */
.avatar .ico { width: 17px; height: 17px; vertical-align: 0; }
.avatar.lg .ico { width: 28px; height: 28px; color: var(--yellow); }
.cand-av .ico { width: 22px; height: 22px; }
.avatar.soft { background: #e6ebf2; color: var(--navy-2); }
.crest .ico { width: 26px; height: 26px; vertical-align: 0; stroke-width: 1.8; }
.with-crest .crest, .icard-top .crest { width: 52px; min-width: 52px; padding: 0; }
.person { display: flex; align-items: center; gap: 12px; }
.person small { display: block; }

/* Institution cards */
.icards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.icard { gap: 18px; padding: 24px; }
.icard-top { gap: 16px; }
.icard h3 { font-size: 19px; }
.mini { padding: 14px 0; border-block: 1px solid var(--line); }
.mini dt { white-space: nowrap; }
.mini dd { font-size: 24px; }
.rules { display: flex; flex-wrap: wrap; gap: 6px; }
.rules .chip { text-transform: none; letter-spacing: 0.02em; font-size: 11px; }
.icard .ecard-acts { flex-wrap: nowrap; padding-top: 0; }
.icard .ecard-acts .btn { flex: 1; min-width: 0; padding: 0 12px; white-space: nowrap; }

/* =====================================================================
   Executive theme. Overrides the earlier look for the whole system:
   modern type, midnight navy with gold, glassy depth, dark hero headers.
   ===================================================================== */
:root {
  --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --label: "Cascadia Mono", "SF Mono", ui-monospace, "Roboto Mono", Consolas, monospace;
  --navy: #16233a;
  --navy-2: #34455f;
  --navy-deep: #0b1422;
  --ink: #1c2738;
  --muted: #64748b;
  --line: #e2e8ef;
  --mist: #eef2f6;
  --paper: #f7f9fb;
  --yellow: #f7b500;
  --yellow-hover: #e8a900;
  --gold-hi: #ffd45e;
  --shadow: 0 1px 2px #0b14220a, 0 10px 30px -18px #0b142240;
}
body { font: 15.5px/1.55 var(--sans); color: var(--ink); }
h1, h2, h3, .brand-word, .card-name, .banner-name, .pos-title, .cand-name, .rev-pick, .record-name { font-family: var(--display); }
h1 { font-weight: 650; letter-spacing: -0.028em; }
.label { font: 600 10.5px var(--label); letter-spacing: 0.14em; }
.brand-word { font-weight: 650; letter-spacing: -0.03em; }

/* Buttons: squared-off, sentence case, with depth */
.btn { min-height: 44px; padding: 0 22px; border-radius: 11px; font: 600 14px var(--sans); letter-spacing: 0.005em; text-transform: none; }
.btn.sm { min-height: 36px; padding: 0 14px; border-radius: 9px; font-size: 13px; }
.btn.primary { background: linear-gradient(180deg, var(--gold-hi) 0%, var(--yellow) 100%); color: var(--navy-deep); box-shadow: inset 0 1px 0 #ffffff8c, 0 1px 2px #0b142238, 0 10px 22px -12px #f7b500cc; }
.btn.primary:hover { background: linear-gradient(180deg, #ffdc78 0%, #f9bd14 100%); }
.btn.ghost { border: 1px solid #cdd6e1; background: #fff; color: var(--navy); box-shadow: 0 1px 2px #0b14220d; }
.btn.ghost:hover { border-color: var(--navy-2); background: #fff; box-shadow: 0 6px 16px -10px #0b142266; }
.btn.danger { background: linear-gradient(180deg, #c5422f 0%, #a23323 100%); color: #fff; box-shadow: inset 0 1px 0 #ffffff33, 0 10px 22px -12px #a23323cc; }
.btn:hover { transform: translateY(-1px); }
.link-btn { font-weight: 600; }
.chip { padding: 4px 9px; font: 600 10px var(--label); letter-spacing: 0.1em; }
.back, .card-go, .filters button, .mnav button, .steps li, .steps-mini, .powered, .secure, .pos-n, .ticket-foot, .ticket-meta dt, .aside h2, .tbl th, .tiles dt, .kpi dt, .mini dt, .card h3, .panel h3 { font-family: var(--label); font-weight: 600; }
.filters button { border-radius: 9px; }
.field span { font-weight: 600; }
.field input, .field select { border-radius: 10px; border-color: #cdd6e1; }
.login-pitch h1 { font-weight: 700; letter-spacing: -0.035em; }
.login-form h2 { font-weight: 650; letter-spacing: -0.03em; }
.top { background: linear-gradient(120deg, var(--navy) 0%, var(--navy-deep) 100%); }
.panel, .pos, .aside, .banner, button.card, .card.inst, .ticket, .receipt-check { border-radius: 16px; }
.cand { border-radius: 12px; }

/* ---------- Dashboard ---------- */
body.manage { background: #f1f4f8 radial-gradient(1100px 480px at 85% -8%, #e3eaf6 0%, transparent 62%) no-repeat; }
.side { padding: 22px 14px 14px; background-color: var(--navy-deep);
  background-image: radial-gradient(420px 260px at 0% 0%, #f7b5001f, transparent 70%), linear-gradient(#ffffff07 1px, transparent 1px), linear-gradient(90deg, #ffffff07 1px, transparent 1px);
  background-size: auto, 26px 26px, 26px 26px; border-right: 1px solid #ffffff12; }
.side nav::before { content: "Menu"; display: block; padding: 0 12px 8px; font: 600 10px var(--label); letter-spacing: 0.16em; text-transform: uppercase; color: #6f8098; }
.side nav a { font-weight: 500; font-size: 14px; color: #a9b6c9; }
.side nav a[aria-current="page"] { background: linear-gradient(90deg, #f7b5002e 0%, #f7b5000a 100%); color: var(--gold-hi); box-shadow: inset 2px 0 0 var(--yellow); }
.side-user { margin-top: auto; padding: 10px; border: 1px solid #ffffff14; border-radius: 14px; background: #ffffff0a; }
.side-user .avatar { background: linear-gradient(145deg, var(--gold-hi), var(--yellow)); color: var(--navy-deep); }
.bar { min-height: 60px; background: #ffffffd9; backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid #e2e8efcc; }
.bar-secure { padding: 6px 12px 6px 10px; border: 1px solid #1c9a5e33; background: #e9f7f0; color: #0a6b43; font-size: 9.5px; }
.crumbs { font-family: var(--sans); }
.content { padding-top: 24px; }

/* Hero header: a dark, glowing band at the top of every page */
.manage .page-head { position: relative; overflow: hidden; align-items: center; margin-bottom: 20px; padding: 28px 30px; border-radius: 20px; color: #aab7c9;
  background: radial-gradient(560px 260px at 100% 0%, #f7b50038, transparent 62%), radial-gradient(520px 300px at 0% 130%, #1c9a5e33, transparent 62%), linear-gradient(135deg, #1a2a45 0%, var(--navy-deep) 70%);
  box-shadow: inset 0 1px 0 #ffffff1a, 0 30px 60px -34px #0b1422cc; }
.manage .page-head::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background-image: linear-gradient(#ffffff0d 1px, transparent 1px), linear-gradient(90deg, #ffffff0d 1px, transparent 1px); background-size: 30px 30px;
  -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000 100%); mask-image: linear-gradient(90deg, transparent 20%, #000 100%); }
.manage .page-head > * { position: relative; }
.manage .page-head h1 { margin: 8px 0 6px; color: #fff; font-size: clamp(22px, 2.1vw, 30px); line-height: 1.18; }
.manage .page-head .label { color: var(--gold-hi); }
.manage .page-head .sub { color: #aab7c9; font-size: 14.5px; }
.manage .page-head .chip { background: #ffffff17; color: #dbe4f0; }
.manage .page-head .chip.live { background: #1c9a5e38; color: #86f2bb; }
.manage .page-head .chip.live i { background: #4fe39a; }
.manage .page-head .chip.open { background: #f7b5002e; color: var(--gold-hi); }
.manage .page-head .chip.ok { background: #1c9a5e; color: #fff; }
.manage .page-head .chip.dim { color: #9fb0c6; }
.manage .page-head .crest { width: 58px; min-width: 58px; height: 58px; border-radius: 16px; background: linear-gradient(145deg, var(--gold-hi), var(--yellow)); color: var(--navy-deep); box-shadow: 0 0 0 6px #f7b5001f, 0 14px 30px -12px #f7b500aa; }
.manage .page-head .crest .ico { width: 28px; height: 28px; }
.manage .page-head .ring-bg { stroke: #ffffff24; }
.manage .page-head .ring-fg { stroke: #45e09a; }
.manage .page-head .ring b { color: #fff; }
.manage .page-head .head-ring { padding: 10px 18px 10px 12px; border: 1px solid #ffffff1f; border-radius: 16px; background: #ffffff0d; color: #aab7c9; }
.manage .page-head .head-ring p b { color: #fff; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stats div { min-width: 104px; padding: 11px 16px 12px; border: 1px solid #ffffff1f; border-radius: 14px; background: #ffffff0d; backdrop-filter: blur(6px); }
.hero-stats dt { font: 600 9.5px var(--label); letter-spacing: 0.14em; text-transform: uppercase; color: #9fb0c6; }
.hero-stats dd { margin-top: 4px; font: 650 24px/1.1 var(--display); letter-spacing: -0.02em; color: #fff; font-variant-numeric: tabular-nums; }

/* Tabs: a segmented control */
.tabs { display: inline-flex; max-width: 100%; gap: 3px; margin-bottom: 20px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: #e7ecf3; }
.tabs a { margin: 0; padding: 8px 15px; border: 0; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.tabs a[aria-current="page"] { background: #fff; color: var(--navy); box-shadow: 0 1px 2px #0b142226, 0 6px 14px -10px #0b142266; }

/* Cards, KPI tiles, tables */
.manage .card, .ecard, .kpi { border-color: #e2e8ef; border-radius: 18px; box-shadow: 0 1px 2px #0b14220a, 0 18px 40px -28px #0b142259; }
.card h2, .card-head h2, .cols > section > .card-head h2 { font: 650 16px var(--display); letter-spacing: -0.015em; }
.kpis { gap: 18px; }
.kpi { overflow: hidden; padding: 22px 22px 20px; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--yellow), #f7b50000 70%); }
.kpi dt { font-size: 10px; letter-spacing: 0.14em; }
.kpi dd { margin-top: 12px; font: 650 40px/1 var(--display); letter-spacing: -0.04em; }
.kpi-ico { top: 18px; right: 18px; width: 38px; height: 38px; border-radius: 12px; background: var(--navy-deep); color: var(--gold-hi); }
.ecard:hover { border-color: #f7b50099; box-shadow: 0 1px 2px #0b14220a, 0 24px 46px -26px #0b142280; }
.ecard h3, .icard h3 { font-family: var(--display); font-weight: 650; }
.tiles div { border-radius: 14px; background: linear-gradient(180deg, #fff, var(--paper)); }
.tiles dd { font: 650 28px var(--display); }
.mini dd { font-family: var(--display); font-weight: 650; }
.tbl th { background: var(--paper); font-size: 10px; letter-spacing: 0.12em; color: var(--muted); border-bottom: 1px solid var(--line); }
.tbl td { border-top-color: #edf1f5; }
.cols-chart .col { background: linear-gradient(180deg, #34507f, var(--navy-deep)); }
.bar-row.lead .meter i, .turnout-box .meter i { background: linear-gradient(90deg, #0f8f5a, #2fd08a); }
.ring-fg { stroke: #14a568; }
.empty-state { border-radius: 18px; }
.modal { border-radius: 18px; }
.toast { border: 1px solid #ffffff1f; border-radius: 12px; }
.live-note { font-weight: 600; }
.icard .crest, .banner .crest { background: var(--navy-deep); color: var(--gold-hi); border-radius: 14px; }

/* A gentle entrance when a page opens (not on saves or live refreshes) */
.fresh .content > * { animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.fresh .content > *:nth-child(2) { animation-delay: 0.05s; }
.fresh .content > *:nth-child(3) { animation-delay: 0.1s; }
.fresh .content > *:nth-child(4) { animation-delay: 0.15s; }
.fresh .content > *:nth-child(n + 5) { animation-delay: 0.2s; }

@media (max-width: 640px) {
  .manage .page-head { padding: 22px 20px; border-radius: 16px; }
  .hero-stats { width: 100%; }
  .hero-stats div { flex: 1; min-width: 0; padding-inline: 12px; }
  .tabs { display: flex; }
}
@media print {
  .manage .page-head { background: none; box-shadow: none; padding: 0; color: #000; }
  .manage .page-head h1, .manage .page-head .ring b, .manage .page-head .head-ring p b { color: #000; }
}
.manage .page-head .with-crest { flex: 1 1 380px; }

/* =====================================================================
   Textured "paper" background, after the Elite Studio site: warm cream
   with a fine dot grid on light areas, and a faint line grid on dark ones.
   ===================================================================== */
:root {
  --paper: #fbf7ef;
  --mist: #f0e9dc;
  --line: #e3dccd;
  --cream: #f5efe4;
  --card: #fffdf8;
  --dots: radial-gradient(rgba(22, 35, 58, 0.14) 1px, transparent 1.5px);
}
body, body.manage { background: var(--cream) var(--dots) 0 0 / 22px 22px; }
.login, .login-form { background: var(--cream) var(--dots) 0 0 / 22px 22px; }
.login-form form { padding: clamp(18px, 3.4vh, 30px) clamp(18px, 2.4vw, 30px); width: min(440px, 100%); border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 30px 60px -36px #0b142266; }
@media (max-width: 860px) { .login-form form { padding: 14px 16px; border-radius: 16px; } }
.bar { background: #f8f3e9e0; border-bottom-color: var(--line); }
.foot { background: #f8f3e9; }
.manage .card, .ecard, .kpi, .panel, .pos, .banner, button.card, .card.inst, .ticket, .receipt-check, .empty-state, .modal { background-color: var(--card); border-color: var(--line); }
.card.is-off { background: transparent; }
.aside { background: var(--mist); border-color: var(--line); }
.tabs { background: #ebe3d3; border-color: var(--line); }
.tabs a[aria-current="page"] { background: var(--card); }
.tbl th { background: #f6f0e4; }
.tbl td { border-top-color: #eee7d9; }
.tbl tbody tr:hover td { background: #faf5ea; }
.tiles div { background: linear-gradient(180deg, var(--card), #f8f2e6); }
.field input, .field select, .cand-row input, .searchbar input, .quick, .receipt-check input, .search input { background: #fff; border-color: #d5ccba; }
.btn.ghost { background: var(--card); border-color: #d5ccba; }
.filters button { background: var(--card); border-color: var(--line); }
.filters button[aria-pressed="true"] { background: var(--navy-deep); border-color: var(--navy-deep); }
.guide { background: #f6f0e4; border-color: #d5ccba; }
.meter { background: #ebe3d3; }
.ring-bg { stroke: #e6ddcc; }
.cand { background: var(--card); }
.record .record-who { background: #f6f0e4; }
.checking { background: var(--card); }

/* Dark areas: the same idea in reverse, a faint cream line grid */
.side { background-image: radial-gradient(420px 260px at 0% 0%, #f7b5001f, transparent 70%), linear-gradient(#f5efe40e 1px, transparent 1px), linear-gradient(90deg, #f5efe40e 1px, transparent 1px); background-size: auto, 44px 44px, 44px 44px; }
.manage .page-head::before { background-image: linear-gradient(#f5efe412 1px, transparent 1px), linear-gradient(90deg, #f5efe412 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: none; mask-image: none; opacity: 1; }
.top { background-image: linear-gradient(#f5efe40d 1px, transparent 1px), linear-gradient(90deg, #f5efe40d 1px, transparent 1px), linear-gradient(120deg, var(--navy) 0%, var(--navy-deep) 100%); background-size: 44px 44px, 44px 44px, auto; }

/* Selected menu item: colour only, no bar or box */
.side nav a[aria-current="page"] { background: none; box-shadow: none; color: var(--gold-hi); font-weight: 600; }
.side nav a[aria-current="page"]:hover { background: #ffffff12; color: var(--gold-hi); }

/* Footer: always visible at the bottom of the window, on the dashboard and the voter screens */
.site-foot { position: sticky; bottom: 0; z-index: 9; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; margin-top: auto; min-height: 46px; padding: 8px clamp(16px, 3vw, 36px); border-top: 1px solid var(--line); background: #f8f3e9f2; backdrop-filter: blur(10px); font-size: 12.5px; color: var(--muted); }
.site-foot .copy { color: var(--navy-2); }
.foot-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.foot-meta span { display: inline-flex; align-items: center; gap: 6px; }
.foot-meta .ico { width: 13px; height: 13px; color: var(--emerald); }
.foot-meta b { color: var(--navy); font-weight: 600; }
.main { min-height: 100vh; }
.content { flex: 1; }
.page { min-height: calc(100vh - 68px - 47px); }
.toasts { bottom: 62px; }
@media (max-width: 640px) {
  .site-foot { justify-content: center; text-align: center; font-size: 11.5px; min-height: 0; padding-block: 7px; }
  .foot-meta { justify-content: center; }
  .foot-meta span:first-child { display: none; }
}
@media print { .site-foot { display: none !important; } }

/* ---------- Lists: search, filters, sortable columns, pager ---------- */
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); scroll-margin-top: 70px; }
.list-search { position: relative; flex: 1 1 280px; max-width: 420px; }
.list-search .ico { position: absolute; left: 13px; top: 50%; margin-top: -8px; width: 16px; height: 16px; color: var(--muted); }
.list-search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border: 1px solid #d5ccba; border-radius: 10px; background: #fff; font: inherit; font-size: 14px; }
.list-search input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px #f7b50059; }
.list-tools .filters, .list-head .filters { margin: 0; }
.filters button b { margin-left: 4px; font-weight: 600; opacity: 0.65; }
.list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 16px 20px 0; }
.pos-pick { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--navy); }
.pos-pick select, .pager-size select { height: 38px; padding: 0 10px; border: 1px solid #d5ccba; border-radius: 9px; background: #fff; font: inherit; font-size: 14px; color: inherit; }
.th-sort { display: inline-flex; align-items: center; gap: 6px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.th-sort span { font-size: 12px; opacity: 0.4; }
.th-sort:hover, .th-sort.on { color: var(--navy); }
.th-sort.on span { opacity: 1; color: var(--yellow-ink); }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.pager b { color: var(--navy); font-variant-numeric: tabular-nums; }
.pager-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager-nav button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; font: 600 13.5px var(--sans); color: var(--navy); font-variant-numeric: tabular-nums; }
.pager-nav button:hover:not(:disabled) { border-color: #d5ccba; background: var(--card); }
.pager-nav button[aria-current="page"] { background: var(--navy-deep); color: #fff; }
.pager-nav button:disabled { opacity: 0.35; cursor: not-allowed; }
.pager-nav .gap { padding: 0 4px; }
.pager-nav .ico { width: 14px; height: 14px; }
.pager-size { display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) {
  .pager { justify-content: center; text-align: center; }
  .pager-nav button { min-width: 32px; padding: 0 7px; }
  .list-search { max-width: none; }
}
@media print { .list-tools, .pager, .list-head { display: none !important; } }

/* ---------- Voter navigation, results page, support line ---------- */
.vnav { display: flex; gap: 4px; margin-right: auto; margin-left: 18px; }
.vnav button { padding: 8px 14px; border-radius: 9px; font: 600 14px var(--sans); color: #a9b6c9; transition: color 0.15s, background 0.15s; }
.vnav button:hover { color: #fff; background: #ffffff12; }
.vnav button[aria-current="page"] { color: var(--gold-hi); }
.flow-bar { border-top: 1px solid #ffffff14; background: #0b142280; }
.flow-bar .wrap { display: flex; justify-content: center; min-height: 46px; align-items: center; }
.step-link { display: inline-flex; align-items: center; gap: 8px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; border-radius: 6px; }
.step-link:hover { color: var(--gold-hi); }
.step-link:hover .dot { border-color: var(--gold-hi); }
.page { min-height: calc(100vh - 68px - 47px); }
.support { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 14px; color: var(--muted); }
.support .ico { margin-top: 2px; color: var(--yellow-ink); }
.support a, .site-foot a { color: var(--navy); font-weight: 600; text-underline-offset: 3px; }
.aside .support { margin-top: 18px; background: #fffdf8cc; font-size: 13.5px; }
.rcards { display: grid; gap: 14px; }
.rcard { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.rcard .crest { background: var(--navy-deep); color: var(--gold-hi); border-radius: 14px; }
.rcard-main { flex: 1 1 320px; min-width: 0; }
.rcard h2 { margin: 3px 0 6px; font: 650 19px/1.25 var(--display); letter-spacing: -0.02em; color: var(--navy); }
.rcard-note { font-size: 14.5px; color: var(--ink); }
.rcard-when { margin-top: 2px; font-size: 13px; color: var(--muted); }
.rcard-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
@media (max-width: 640px) {
  .vnav { margin-left: 6px; gap: 0; }
  .vnav button { padding: 8px 9px; font-size: 13px; }
  .top .brand-word { display: none; }
  .rcard-side { align-items: flex-start; width: 100%; }
}

.msg.note { background: #eef3fb; color: var(--navy); }
.msg.note .ico { color: #2c4f86; }
.msg.note p { margin-top: 4px; color: var(--ink); font-weight: 400; }

/* ---------- Candidate photos ---------- */
.avatar.has-photo { padding: 0; overflow: hidden; background: var(--mist); }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Ballot: large enough to recognise a face */
.cand-av { width: 112px; height: 112px; border-radius: 18px; background: #e6ebf2; color: var(--navy-2); box-shadow: 0 0 0 1px var(--line); }
.cand-av .ico { width: 44px; height: 44px; stroke-width: 1.5; }
.cand:has(input:checked) .cand-av { background: var(--navy); color: var(--gold-hi); box-shadow: 0 0 0 3px var(--yellow); }
.cand:has(input:checked) .cand-av.has-photo { background: var(--mist); }
.cand { gap: 20px; padding: 14px 18px 14px 14px; }
.cand-name { font-size: 19px; }
.cand-line { font-size: 14.5px; }
.rev-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rev-av { width: 52px; height: 52px; border-radius: 12px; background: #e6ebf2; color: var(--navy-2); }
.rev-av .ico { width: 22px; height: 22px; }
.with-face { display: inline-flex; align-items: center; gap: 10px; }
.res-av { width: 40px; height: 40px; border-radius: 10px; background: #e6ebf2; color: var(--navy-2); }
.res-av .ico { width: 18px; height: 18px; }
.tbl .res-av { width: 34px; height: 34px; border-radius: 9px; }
/* Set-up: click the picture to upload */
.cand-row { grid-template-columns: auto 1fr 1fr auto auto auto; }
.photo-pick { position: relative; display: grid; justify-items: center; gap: 3px; width: 64px; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--yellow-ink); text-align: center; }
.photo-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.photo-pick:hover .edit-av, .photo-pick:focus-within .edit-av { box-shadow: 0 0 0 3px var(--yellow); }
.edit-av { width: 56px; height: 56px; border-radius: 14px; background: #e6ebf2; color: var(--navy-2); transition: box-shadow 0.15s; }
.edit-av .ico { width: 24px; height: 24px; }
.photo-gap { width: 64px; font-size: 10.5px; line-height: 1.25; color: var(--muted); text-align: center; }
@media (max-width: 640px) {
  .cand-av { width: 84px; height: 84px; border-radius: 14px; }
  .cand { gap: 14px; }
  .cand-name { font-size: 17px; }
  .cand-row { grid-template-columns: auto 1fr; }
  .cand-row > input { grid-column: 2; }
}

/* Edit dialog */
.modal.wide { width: min(500px, calc(100% - 40px)); }
.modal .field { margin-top: 14px; }
.modal .field input { height: 44px; font-size: 15px; }
.modal .field input[readonly] { background: var(--mist); color: var(--muted); }
.modal .msg { margin: 14px 0 0; }
.modal .hint { margin-top: 10px; }

/* Compact tables: icon buttons for row actions, tighter rows */
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid transparent; border-radius: 9px; color: var(--navy-2); transition: background 0.15s, border-color 0.15s, color 0.15s; }
.icon-btn .ico { width: 17px; height: 17px; vertical-align: 0; }
.icon-btn:hover { border-color: #d5ccba; background: var(--card); color: var(--navy); }
td.acts { gap: 2px; flex-wrap: nowrap; }
.tbl td { padding: 9px 16px; }
.tbl th { padding: 9px 16px; }
.tbl .avatar.soft { width: 28px; height: 28px; }
.tbl .avatar.soft .ico { width: 15px; height: 15px; }

/* =====================================================================
   Compact density and responsiveness, for the whole system.
   Tighter type, padding and gaps; layouts that reflow from 320px phones
   to wide desktops without sideways scrolling.
   ===================================================================== */
body { font-size: 14.5px; }
.label { font-size: 10px; }
.btn { min-height: 40px; padding: 0 18px; font-size: 13.5px; border-radius: 10px; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.field { margin-top: 14px; }
.field span { margin-bottom: 5px; font-size: 12.5px; }
.field input, .field select, .manage .field input { height: 40px; font-size: 14.5px; }
.hint { font-size: 12.5px; }
.msg { padding: 10px 12px; font-size: 13.5px; }
.chip { padding: 3px 8px; font-size: 9.5px; }

/* ----- Voter screens ----- */
.top-in { min-height: 54px; }
.top .brand svg { width: 32px; height: 32px; }
.top .brand-word { font-size: 19px; }
.vnav button { padding: 6px 12px; font-size: 13.5px; }
.who { font-size: 13px; }
.who .avatar { width: 28px; height: 28px; }
.flow-bar .wrap { min-height: 38px; }
.steps li { font-size: 9.5px; }
.steps .dot { width: 20px; height: 20px; }
.page { padding: 24px 0 48px; min-height: calc(100vh - 54px - 44px); }
.wrap { width: min(1120px, calc(100% - 40px)); }
.head { margin-bottom: 20px; }
.head.tight { margin: 20px 0 16px; }
.page h1, .head h1 { margin: 6px 0 8px; font-size: clamp(22px, 2.6vw, 32px); }
.sub { font-size: 14.5px; }
.back { margin-bottom: 12px; }
.banner { gap: 14px; padding: 12px 16px; }
.banner .crest { width: 44px; height: 44px; }
.banner-name { font-size: 17px; }
.banner-elec, .banner-when { font-size: 13px; }
.split { gap: 18px; margin-top: 18px; grid-template-columns: minmax(0, 1fr) 320px; }
.panel { padding: 24px 26px 26px; }
.aside { padding: 20px 20px 22px; }
.how { gap: 12px; font-size: 13.5px; }
.inst-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card.inst { padding: 18px 18px 16px; }
.card-name { margin-top: 12px; font-size: 19px; }
.card-elec { font-size: 13.5px; }
.card .meter { margin-top: 14px; }
.card-go { padding-top: 14px; }
.receipt-check { margin-top: 24px; padding: 18px 20px; }
.record > div { padding: 10px 16px; font-size: 14px; }
.record .record-who { padding: 14px 16px; }
.record-who .record-name { font-size: 19px; }
.avatar.lg { width: 46px; height: 46px; }
.actions { gap: 10px; margin-top: 20px; }
.pills { gap: 6px; }
.pill { width: 32px; height: 32px; font-size: 11.5px; }
.positions { gap: 14px; }
.pos { padding: 20px 22px 22px; }
.pos-title { font-size: 21px; }
.pos-note { font-size: 13.5px; }
.cands { gap: 8px; margin-top: 14px; }
.cand { gap: 16px; padding: 10px 14px 10px 10px; }
.cand-av { width: 96px; height: 96px; border-radius: 14px; }
.cand-name { font-size: 17px; }
.cand-line { font-size: 13.5px; }
.cand.abstain { padding-block: 9px; }
.pos-nav { margin-top: 16px; padding-top: 16px; }
.sum a, .sum button { padding: 7px 8px; }
.review { margin-top: 16px; }
.review li { padding: 11px 16px; }
.rev-pick { font-size: 17px; }
.rev-av { width: 44px; height: 44px; }
.declare { margin-top: 16px; padding: 12px 14px; font-size: 13.5px; }
.receipt { margin-top: 4px; }
.seal { width: 60px; height: 60px; margin-bottom: 12px; box-shadow: 0 0 0 8px var(--emerald-soft); }
.seal .ico { width: 28px; height: 28px; }
.ticket { margin-top: 20px; }
.ticket-main { padding: 20px 20px 18px; }
.code { font-size: clamp(22px, 4.6vw, 30px); }
.ticket-meta div { padding: 12px 18px; }
.turnout { margin-top: 18px; padding: 14px 18px; }
.rcard { gap: 12px 16px; padding: 14px 18px; }
.rcard h2 { font-size: 17px; }
.rcard .crest { width: 44px; height: 44px; }
.support { margin-top: 16px; padding: 10px 14px; font-size: 13px; }
.v-result .panel.res, .panel.res { margin-top: 14px; padding: 18px 20px; }
.site-foot { min-height: 40px; padding-block: 6px; font-size: 12px; }

/* ----- Admin dashboard ----- */
.dash { grid-template-columns: 216px minmax(0, 1fr); }
.side { padding: 16px 10px 12px; }
.side .brand { padding: 2px 8px 16px; }
.side .brand img { width: 32px; height: 32px; }
.side .brand-word { font-size: 19px; }
.side nav a { gap: 10px; padding: 8px 10px; font-size: 13.5px; border-radius: 8px; }
.side nav a .ico { font-size: 16px; }
.side-user { padding: 8px; border-radius: 12px; }
.side-user b { font-size: 12.5px; }
.side-user small { font-size: 11px; }
.bar { min-height: 48px; }
.crumbs ol { font-size: 13px; }
.content { max-width: 1400px; padding: 18px clamp(14px, 2.4vw, 28px) 24px; }
.manage .page-head { margin-bottom: 14px; padding: 18px 22px; border-radius: 16px; gap: 12px 20px; }
.manage .page-head h1 { margin: 5px 0 4px; font-size: clamp(19px, 1.8vw, 25px); }
.manage .page-head .sub { font-size: 13.5px; }
.manage .page-head .crest { width: 46px; min-width: 46px; height: 46px; border-radius: 13px; box-shadow: 0 0 0 4px #f7b5001f; }
.manage .page-head .crest .ico { width: 23px; height: 23px; }
.with-crest { gap: 14px; }
.hero-stats { gap: 8px; }
.hero-stats div { min-width: 88px; padding: 8px 12px 9px; border-radius: 12px; }
.hero-stats dd { font-size: 20px; }
.manage .page-head .head-ring { padding: 7px 14px 7px 9px; border-radius: 13px; font-size: 12px; }
.ring { width: 52px; height: 52px; }
.ring b { font-size: 12px; }
.tabs { margin-bottom: 14px; padding: 3px; border-radius: 11px; }
.tabs a { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.kpis { gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; border-radius: 14px; }
.kpi dt { font-size: 9.5px; }
.kpi dd { margin-top: 8px; font-size: 30px; }
.kpi p { margin-top: 5px; font-size: 12px; }
.kpi-ico { top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
.cols { gap: 14px; }
.manage .card, .card { margin-bottom: 14px; padding: 16px 18px 18px; border-radius: 14px; }
.manage .card.flush { padding: 0; }
.card h2, .card-head h2, .cols > section > .card-head h2 { font-size: 15px; }
.card h3 { margin: 16px 0 8px; }
.card .actions { margin-top: 14px; }
.card-head { margin-bottom: 10px; }
.pad { padding: 14px 18px; }
.ecards, .icards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ecard { gap: 8px; padding: 14px 16px; border-radius: 14px; }
.ecard h3, .icard h3 { font-size: 16px; }
.icard { gap: 12px; padding: 16px; }
.icard-top .crest { width: 42px; min-width: 42px; height: 42px; }
.mini { padding: 10px 0; }
.mini dd { font-size: 20px; }
.tiles { gap: 10px; margin-top: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.tiles div { padding: 10px 12px; border-radius: 12px; }
.tiles dd { margin-top: 4px; font-size: 22px; }
.cols-chart { height: 160px; margin-top: 10px; }
.todo li { padding: 9px 0; font-size: 13.5px; }
.feed li { padding: 8px 0; font-size: 13px; }
.toolbar { margin-bottom: 12px; gap: 10px; }
.res-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 12px; }
.res-head { margin-bottom: 12px; }
.bar-row + .bar-row { margin-top: 10px; }
.bar-top { margin-bottom: 4px; font-size: 14px; }
.bar-row .meter { height: 8px; }
.res-av { width: 34px; height: 34px; border-radius: 9px; }
.list-tools { gap: 10px 12px; padding: 12px 16px; }
.list-search input { height: 36px; font-size: 13.5px; }
.list-head { padding: 12px 16px 0; }
.filters button { padding: 6px 11px; font-size: 9.5px; }
.tbl { font-size: 13.5px; }
.tbl th { padding: 8px 14px; font-size: 9.5px; }
.tbl td { padding: 7px 14px; }
.tbl small { font-size: 11.5px; }
.pager { padding: 10px 16px; font-size: 12.5px; gap: 8px 16px; }
.pager-nav button { min-width: 32px; height: 32px; font-size: 12.5px; }
.pos-pick select, .pager-size select { height: 32px; font-size: 13px; }
.cand-row { gap: 6px; margin-top: 6px; }
.cand-row input { height: 36px; font-size: 13.5px; }
.edit-av { width: 44px; height: 44px; border-radius: 11px; }
.photo-pick, .photo-gap { width: 56px; font-size: 10px; }
.section-head { margin: 20px 0 10px; }
.section-head h2 { font-size: 18px; }
.big { margin: 8px 0 10px; font-size: 30px; }
.empty-state { padding: 30px 20px; }
.roles { gap: 9px; font-size: 13px; }
.modal { padding: 20px 22px; }
.modal h2 { font-size: 18px; }

/* ----- Tablets and small laptops ----- */
@media (max-width: 1100px) {
  .cols.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols.three > :last-child { grid-column: 1 / -1; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi dd { font-size: 26px; }
  .kpi-ico { display: none; }
  .kpi dt { padding-right: 0; }
}
@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .side { width: 240px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ----- Phones ----- */
@media (max-width: 640px) {
  body { font-size: 14px; }
  .wrap { width: calc(100% - 24px); }
  .page { padding: 16px 0 40px; }
  .top-in { gap: 8px; }
  .vnav { margin-left: 2px; }
  .vnav button { padding: 6px 8px; font-size: 12.5px; }
  .who { gap: 6px; }
  .who .link-btn { font-size: 12.5px; white-space: nowrap; }
  .panel { padding: 16px 14px 18px; border-radius: 14px; }
  .pos { padding: 14px 12px 16px; border-radius: 14px; }
  .aside { padding: 14px; }
  .banner { padding: 10px 12px; gap: 10px; border-radius: 14px; }
  .banner .crest { width: 38px; height: 38px; }
  .banner-when { padding-top: 8px; }
  .cand { gap: 12px; padding: 8px 10px 8px 8px; }
  .cand-av { width: 76px; height: 76px; border-radius: 12px; }
  .cand-name { font-size: 15.5px; }
  .tick { width: 22px; height: 22px; }
  .pos-title { font-size: 18px; }
  .pill { width: 30px; height: 30px; }
  .actions .btn { flex: 1 1 auto; }
  .pos-nav .btn { flex: 1 1 100%; }
  .review li { padding: 10px 12px; gap: 10px; }
  .rev-pick { font-size: 15.5px; }
  .ticket-meta div { padding: 10px 14px; }
  .rcard { padding: 12px 14px; }
  .rcard-side { flex-direction: row; align-items: center; justify-content: space-between; }
  .inst-grid { grid-template-columns: 1fr; }
  .receipt-check form .btn { flex: 1 1 auto; }

  .content { padding: 12px 12px 18px; }
  .bar { padding: 0 10px; gap: 8px; }
  .crumbs ol { font-size: 12.5px; }
  .crumbs li:not(:last-child):not(:nth-last-child(2)) { display: none; }
  .manage .page-head { padding: 14px 14px; border-radius: 14px; }
  .manage .page-head h1 { font-size: 19px; }
  .with-crest { gap: 10px; }
  .manage .page-head .crest { width: 38px; min-width: 38px; height: 38px; border-radius: 11px; }
  .hero-stats { width: 100%; }
  .hero-stats div { flex: 1 1 0; min-width: 0; padding: 7px 10px; }
  .hero-stats dd { font-size: 18px; }
  .manage .page-head .head-ring { width: 100%; }
  .page-actions { width: 100%; }
  .page-actions .btn { width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 11px 12px; }
  .kpi dd { font-size: 23px; }
  .kpi p { font-size: 11px; }
  .manage .card, .card { padding: 13px 13px 15px; margin-bottom: 10px; }
  .manage .card.flush { padding: 0; }
  .cols, .cols.even, .cols.three { grid-template-columns: 1fr; gap: 10px; }
  .cols.three > :last-child { grid-column: auto; }
  .ecards, .icards, .res-grid { grid-template-columns: 1fr; gap: 10px; }
  .tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 6px 10px; }
  /* Filters stay on one line and scroll sideways, rather than stacking */
  .filters { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; }
  .list-tools { padding: 10px 12px; }
  .list-search { flex-basis: 100%; }
  .list-head { padding: 10px 12px 0; }
  .pos-pick { width: 100%; }
  .pos-pick select { flex: 1; min-width: 0; }
  /* Tables keep their columns and scroll inside their card; the least important columns drop out */
  .tbl { font-size: 13px; }
  .tbl th, .tbl td { padding: 7px 10px; }
  .tbl .hide-sm { display: none; }
  .tbl .person { gap: 8px; }
  .tbl .avatar.soft { display: none; }
  td.acts { justify-content: flex-end; }
  .pager { justify-content: center; padding: 10px 12px; }
  .pager > p { width: 100%; text-align: center; }
  .pager-nav button { min-width: 30px; height: 30px; padding: 0 6px; }
  .pager-nav button:first-child, .pager-nav button:last-child { font-size: 0; gap: 0; }
  .pager-nav button:first-child .ico, .pager-nav button:last-child .ico { font-size: 13px; }
  .toolbar .btn { flex: 1 1 auto; }
  .grid2, .grid-pos { grid-template-columns: 1fr; }
  .cand-row { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .cand-row > input { grid-column: 2; }
  .cand-row > .btn, .cand-row > .link-btn { grid-column: 2; justify-self: start; }
  .cols-chart { height: 130px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal { padding: 16px; }
  .site-foot { padding: 5px 10px; font-size: 11px; gap: 2px 14px; }
  .toasts { bottom: 54px; }
}
@media (max-width: 380px) {
  .who-mail, .who .avatar { display: none; }
  .vnav button { padding: 6px 6px; }
  .cand-av { width: 64px; height: 64px; }
  .kpi dd { font-size: 21px; }
}

/* Wordmark: an italic serif, for a more distinctive "i-vote" */
.brand-word { font-family: "Palatino Linotype", Palatino, "Book Antiqua", "Iowan Old Style", Georgia, serif; font-style: italic; font-weight: 700; letter-spacing: 0; }
.brand-word i { font-style: italic; }
.top .brand-word, .side .brand-word { font-size: 22px; }
.login-art .login-top .brand-word { font-size: clamp(24px, 4vh, 32px); }
@media (max-width: 400px) { .login-art .login-top .brand-word { font-size: 21px; } }

/* Shown only on paper: used where printing a page is not allowed for the signed-in role */
.print-only { display: none; }
@media print {
  .print-only { display: block; padding: 20px; font-size: 14pt; }
  .no-print { display: none !important; }
}

/* The footer is now the only place that says "Secure ballot system", so it stays visible on phones too */
@media (max-width: 640px) { .foot-meta span:first-child { display: inline-flex; } }

/* =====================================================================
   Fluid, compact type. Every text size scales smoothly with the width of
   the screen between a phone minimum and a desktop maximum, so there are
   no jumps at breakpoints and nothing is oversized on any device.
   Pattern: clamp(phone size, a little of the viewport + a base, desktop size).
   ===================================================================== */
body { font-size: clamp(13px, 0.19vw + 12.3px, 14.5px); line-height: 1.5; }
.label { font-size: clamp(9px, 0.1vw + 8.7px, 10px); }
.sub, .page-head .sub { font-size: clamp(12.5px, 0.2vw + 11.8px, 14.5px); }
.hint { font-size: clamp(11.5px, 0.1vw + 11.2px, 12.5px); }
.msg { font-size: clamp(12.5px, 0.12vw + 12.1px, 13.5px); }
.chip { font-size: clamp(8.5px, 0.1vw + 8.2px, 9.5px); }
.btn { font-size: clamp(12.5px, 0.12vw + 12.1px, 13.5px); min-height: clamp(36px, 0.5vw + 34px, 40px); }
.btn.sm { font-size: clamp(11.5px, 0.12vw + 11.1px, 12.5px); min-height: clamp(30px, 0.25vw + 29px, 32px); }
.link-btn { font-size: clamp(12px, 0.15vw + 11.5px, 13.5px); }
.field span { font-size: clamp(11.5px, 0.12vw + 11.1px, 12.5px); }
.field input, .field select, .manage .field input { font-size: clamp(13.5px, 0.12vw + 13.1px, 14.5px); height: clamp(38px, 0.25vw + 37px, 40px); }

/* Voter screens */
.page h1, .head h1 { font-size: clamp(19px, 1.25vw + 14.5px, 30px); line-height: 1.15; }
.brand-word, .top .brand-word, .side .brand-word { font-size: clamp(18px, 0.5vw + 16.2px, 22px); }
.vnav button { font-size: clamp(12px, 0.2vw + 11.3px, 13.5px); }
.who { font-size: clamp(11.5px, 0.2vw + 10.8px, 13px); }
.steps li, .steps-mini { font-size: clamp(8.5px, 0.12vw + 8.1px, 9.5px); }
.banner-name { font-size: clamp(14.5px, 0.32vw + 13.3px, 17px); }
.banner-elec, .banner-when { font-size: clamp(12px, 0.12vw + 11.6px, 13px); }
.card-name { font-size: clamp(15.5px, 0.45vw + 13.9px, 19px); }
.card-elec, .card-foot, .card-when { font-size: clamp(12px, 0.18vw + 11.4px, 13.5px); }
.how { font-size: clamp(12.5px, 0.12vw + 12.1px, 13.5px); }
.record > div { font-size: clamp(13px, 0.12vw + 12.6px, 14px); }
.record-who .record-name { font-size: clamp(16px, 0.4vw + 14.6px, 19px); }
.pos-title { font-size: clamp(16.5px, 0.6vw + 14.4px, 21px); }
.pos-note { font-size: clamp(12.5px, 0.12vw + 12.1px, 13.5px); }
.cand-name { font-size: clamp(14.5px, 0.32vw + 13.3px, 17px); }
.cand-line { font-size: clamp(12px, 0.2vw + 11.3px, 13.5px); }
.cand.abstain .cand-name { font-size: clamp(13px, 0.2vw + 12.3px, 14.5px); }
.sum b { font-size: clamp(12.5px, 0.12vw + 12.1px, 13.5px); }
.rev-pick { font-size: clamp(14.5px, 0.32vw + 13.3px, 17px); }
.declare { font-size: clamp(12.5px, 0.12vw + 12.1px, 13.5px); }
.code { font-size: clamp(19px, 1.6vw + 13px, 30px); }
.ticket-meta dd { font-size: clamp(13px, 0.15vw + 12.5px, 14.5px); }
.turnout { font-size: clamp(13px, 0.15vw + 12.5px, 14.5px); }
.rcard h2 { font-size: clamp(15px, 0.26vw + 14px, 17px); }
.rcard-note { font-size: clamp(13px, 0.18vw + 12.4px, 14.5px); }
.support { font-size: clamp(12px, 0.12vw + 11.6px, 13px); }
.receipt-check h2 { font-size: clamp(15px, 0.35vw + 13.8px, 18px); }
.checking h2, .checking h1 { font-size: clamp(17px, 0.6vw + 15px, 22px); }
.site-foot { font-size: clamp(10.5px, 0.18vw + 9.9px, 12px); }

/* Admin dashboard */
.side nav a { font-size: clamp(13px, 0.06vw + 12.8px, 13.5px); }
.crumbs ol { font-size: clamp(12px, 0.12vw + 11.6px, 13px); }
.manage .page-head h1 { font-size: clamp(17px, 0.85vw + 14px, 25px); }
.manage .page-head .sub { font-size: clamp(12.5px, 0.12vw + 12.1px, 13.5px); }
.hero-stats dd { font-size: clamp(16.5px, 0.42vw + 15px, 20px); }
.tabs a { font-size: clamp(12px, 0.12vw + 11.6px, 13px); }
.kpi dt { font-size: clamp(8.5px, 0.12vw + 8.1px, 9.5px); }
.kpi dd { font-size: clamp(20px, 1.15vw + 15.9px, 30px); }
.kpi p { font-size: clamp(10.5px, 0.18vw + 9.9px, 12px); }
.card h2, .card-head h2, .cols > section > .card-head h2, .panel h2 { font-size: clamp(14px, 0.12vw + 13.6px, 15px); }
.ecard h3, .icard h3 { font-size: clamp(14.5px, 0.18vw + 13.9px, 16px); }
.mini dd { font-size: clamp(17px, 0.36vw + 15.7px, 20px); }
.tiles dd { font-size: clamp(18px, 0.48vw + 16.3px, 22px); }
.big { font-size: clamp(23px, 0.85vw + 20px, 30px); }
.todo li { font-size: clamp(12.5px, 0.12vw + 12.1px, 13.5px); }
.feed li { font-size: clamp(12px, 0.12vw + 11.6px, 13px); }
.bar-top { font-size: clamp(13px, 0.12vw + 12.6px, 14px); }
.tbl { font-size: clamp(12.5px, 0.12vw + 12.1px, 13.5px); }
.tbl th { font-size: clamp(8.5px, 0.12vw + 8.1px, 9.5px); }
.filters button { font-size: clamp(8.5px, 0.12vw + 8.1px, 9.5px); }
.pager { font-size: clamp(11.5px, 0.12vw + 11.1px, 12.5px); }
.section-head h2 { font-size: clamp(16px, 0.24vw + 15.1px, 18px); }
.empty-title { font-size: clamp(15px, 0.35vw + 13.8px, 18px); }
.modal h2 { font-size: clamp(16px, 0.24vw + 15.1px, 18px); }
.toast { font-size: clamp(12.5px, 0.18vw + 11.9px, 14px); }
.roles { font-size: clamp(12px, 0.12vw + 11.6px, 13px); }

/* Sign-in and account set-up: sized by both the width and the height of the window */
.login-pitch h1 { font-size: clamp(22px, min(3.3vw, 6vh), 44px); }
.login-pitch p:last-child { font-size: clamp(12.5px, min(1.15vw, 2vh), 15.5px); }
.login-pitch > .label { font-size: clamp(9px, min(0.8vw, 1.5vh), 10.5px); }
.assure li { font-size: clamp(11.5px, min(1vw, 1.7vh), 13px); }
.assure b { font-size: clamp(12.5px, min(1.05vw, 1.8vh), 14px); }
.login-art .login-top .brand-word { font-size: clamp(19px, min(2.2vw, 3.8vh), 30px); }
.login-art .login-top .brand svg { width: clamp(30px, min(3.6vw, 6vh), 48px); height: clamp(30px, min(3.6vw, 6vh), 48px); }
.secure { font-size: clamp(8.5px, min(0.75vw, 1.4vh), 10px); }
.login-form h2 { font-size: clamp(20px, min(2.3vw, 4.1vh), 30px); }
.login-form .sub { font-size: clamp(12.5px, min(1.1vw, 1.9vh), 14.5px); }
.login-form .field input { height: clamp(38px, 5.6vh, 44px); }
.login-form .btn { min-height: clamp(38px, 5.4vh, 44px); }
.secure-note { font-size: clamp(11px, min(0.95vw, 1.7vh), 12.5px); }
.guide { font-size: clamp(11.5px, min(1vw, 1.75vh), 13px); }
.invitee { font-size: clamp(12px, min(1vw, 1.8vh), 13.5px); }
.powered { font-size: clamp(8.5px, min(0.75vw, 1.4vh), 10px); }
@media (max-width: 860px) {
  /* Stacked sign-in: the headline sits in the short navy band, so it follows the height */
  .login-pitch h1 { font-size: clamp(19px, 3.3vh, 27px); }
  .login-art .login-top .brand-word { font-size: clamp(18px, 3vh, 22px); }
  .login-art .login-top .brand svg { width: 32px; height: 32px; }
}

/* =====================================================================
   Phones: compact buttons and elements. Buttons take only the width of
   their label instead of stretching across the screen.
   ===================================================================== */
@media (max-width: 640px) {
  .btn { min-height: 34px; padding: 0 14px; font-size: 12.5px; border-radius: 9px; gap: 7px; }
  .btn.sm { min-height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; gap: 5px; }
  .btn .ico { width: 13px; height: 13px; }
  .page-actions { width: auto; }
  .page-actions .btn { width: auto; }
  .actions { gap: 8px; margin-top: 14px; }
  .actions .btn, .toolbar .btn, .pos-nav .btn, .receipt-check form .btn { flex: 0 0 auto; }
  .btn.wide { width: 100%; }
  .icon-btn { width: 30px; height: 30px; }
  .field { margin-top: 10px; }
  .field input, .field select, .manage .field input { height: 36px; font-size: 14px; }
  .list-search input { height: 34px; }
  .cand-row input { height: 34px; }

  /* Dashboard */
  .bar { min-height: 42px; }
  .menu-btn { width: 34px; height: 34px; font-size: 18px; }
  .manage .page-head { padding: 12px; margin-bottom: 10px; gap: 8px 12px; }
  .manage .page-head h1 { margin: 3px 0 2px; }
  .kpi { padding: 9px 11px; border-radius: 12px; }
  .kpi dd { margin-top: 5px; }
  .kpi p { margin-top: 3px; }
  .manage .card, .card { padding: 11px 12px 13px; border-radius: 12px; }
  .manage .card.flush { padding: 0; }
  .ecard { padding: 11px 12px; gap: 6px; border-radius: 12px; }
  .ecard-acts { padding-top: 2px; gap: 6px; }
  .ring { width: 44px; height: 44px; }
  .ring b { font-size: 11px; }
  .tabs { margin-bottom: 10px; }
  .tabs a { padding: 5px 9px; }
  .tiles div { padding: 8px 10px; }
  .hero-stats div { padding: 6px 9px; border-radius: 10px; }
  .icard { padding: 12px; gap: 10px; }
  .card-head { margin-bottom: 8px; }
  .todo li { padding: 7px 0; }
  .feed li { padding: 6px 0; }
  .pager { padding: 8px 10px; }
  .pager-nav button { min-width: 28px; height: 28px; }
  .pos-pick select, .pager-size select { height: 30px; }
  .modal .actions { gap: 8px; }

  /* Voter screens */
  .top-in { min-height: 46px; }
  .flow-bar .wrap { min-height: 30px; }
  .head { margin-bottom: 14px; }
  .head.tight { margin: 14px 0 10px; }
  .back { margin-bottom: 8px; }
  .split { gap: 12px; margin-top: 12px; }
  .card.inst { padding: 14px; }
  .card-name { margin-top: 8px; }
  .card .meter { margin-top: 10px; }
  .card-go { padding-top: 10px; }
  .receipt-check { margin-top: 16px; padding: 14px; }
  .receipt-check input { height: 36px; flex-basis: 160px; }
  .record > div { padding: 8px 12px; }
  .record .record-who { padding: 10px 12px; }
  .avatar.lg { width: 38px; height: 38px; }
  .avatar.lg .ico { width: 22px; height: 22px; }
  .pills { gap: 5px; }
  .pill { width: 28px; height: 28px; font-size: 11px; }
  .cands { gap: 6px; margin-top: 10px; }
  .declare { padding: 10px 12px; }
  .seal { width: 50px; height: 50px; }
  .ticket-main { padding: 16px 14px 14px; }
  .support { margin-top: 12px; padding: 8px 12px; }
  .site-foot { min-height: 0; }
}
@media (max-width: 640px) {
  .login-form .btn { min-height: 38px; }
  .login-form .field input { height: 40px; }
}

/* Sign-in panel (desktop): the headline and the three assurances sit in the vertical middle;
   "Powered by" stays at the bottom. */
@media (min-width: 861px) {
  .login-copy { display: contents; }
  .login-pitch { margin-top: auto; }
  .login-art .powered { margin-top: auto; }
}

/* =====================================================================
   Text hierarchy. On every screen size the order is:
     page title  >  section title  >  item title  >  body  >  secondary  >  labels
   Figures (turnout, counts) are a step above body text but never above the page title.
   ===================================================================== */
.manage .page-head h1 { font-size: clamp(19px, 0.85vw + 15px, 26px); }
.section-head h2 { font-size: clamp(16px, 0.24vw + 15.1px, 18px); }
.card h2, .card-head h2, .cols > section > .card-head h2, .panel h2 { font-size: clamp(15px, 0.1vw + 14.6px, 16px); }
.ecard h3, .icard h3 { font-size: clamp(14.5px, 0.05vw + 14.3px, 15px); }
.kpi dd { font-size: clamp(18px, 0.5vw + 16px, 22px); }
.tiles dd { font-size: clamp(16px, 0.25vw + 15px, 18px); }
.mini dd { font-size: clamp(15px, 0.25vw + 14px, 17px); }
.hero-stats dd { font-size: clamp(15px, 0.35vw + 13.7px, 18px); }
.big { font-size: clamp(19px, 0.4vw + 17.5px, 22px); }
.code { font-size: clamp(19px, 1vw + 15px, 26px); }

@media (max-width: 640px) {
  /* Level 1: page title */
  .page h1, .head h1 { font-size: 20px; }
  .manage .page-head h1 { font-size: 19px; }
  /* Level 2: section and card titles */
  .section-head h2, .pos-title { font-size: 16px; }
  .card h2, .card-head h2, .cols > section > .card-head h2, .panel h2, .receipt-check h2, .checking h2, .modal h2, .empty-title { font-size: 15px; }
  /* Level 3: item titles */
  .ecard h3, .icard h3, .card-name, .banner-name, .rcard h2, .cand-name, .rev-pick, .record-who .record-name { font-size: 14px; }
  /* Level 4: body */
  body, .tbl, .bar-top, .record > div, .rcard-note, .turnout, .todo li, .declare, .how, .msg { font-size: 13px; }
  /* Level 5: secondary text */
  .sub, .page-head .sub, .manage .page-head .sub, .cand-line, .card-elec, .card-foot, .card-when, .banner-elec, .banner-when,
  .pos-note, .feed li, .support, .roles, .kpi p, .ecard-when, .ecard-stat { font-size: 12px; }
  .hint, .tbl small, .feed small, .pager, .site-foot { font-size: 11px; }
  /* Level 6: labels */
  .label, .kpi dt, .tiles dt, .mini dt, .hero-stats dt, .tbl th, .chip, .filters button, .steps-mini { font-size: 8.5px; }
  /* Figures */
  .kpi dd { font-size: 18px; }
  .tiles dd { font-size: 16px; }
  .mini dd, .hero-stats dd { font-size: 15px; }
  .big { font-size: 18px; }
  .code { font-size: 19px; }

  /* Buttons: small and only as wide as their label */
  .btn { min-height: 30px; padding: 0 12px; font-size: 11.5px; border-radius: 8px; gap: 6px; }
  .btn.sm { min-height: 26px; padding: 0 9px; font-size: 10.5px; border-radius: 7px; gap: 4px; }
  .btn .ico { width: 12px; height: 12px; }
  .link-btn { font-size: 11.5px; }
  .icon-btn { width: 28px; height: 28px; }
  .icon-btn .ico { width: 15px; height: 15px; }
  .login-form .btn { min-height: 36px; font-size: 12.5px; }
  .tabs a { font-size: 11.5px; }
  .vnav button { font-size: 12px; }
  .pager-nav button { font-size: 11px; min-width: 26px; height: 26px; }
}

/* The action button in a page header (e.g. "Add institution") is a small button */
.page-actions .btn { min-height: 30px; padding: 0 12px; font-size: 12px; border-radius: 8px; gap: 5px; }
.page-actions .btn .ico { width: 12px; height: 12px; }
@media (max-width: 640px) {
  .page-actions .btn { min-height: 24px; padding: 0 9px; font-size: 10.5px; border-radius: 6px; gap: 4px; }
  .page-actions .btn .ico { width: 10px; height: 10px; }
}

/* Forgot-password link under the password field */
.forgot { margin-top: clamp(4px, 0.9vh, 8px); text-align: right; }
.forgot .link-btn { font-size: clamp(11.5px, min(0.95vw, 1.7vh), 12.5px); font-weight: 600; }
.login-form .btn + .forgot { text-align: center; margin-top: clamp(8px, 1.6vh, 14px); }
