/* AutoBallot — "Quiet Institution" visual language (design handoff 2026-07).
   Single source of truth for the look. Tokens first; class vocabulary is
   stable — templates and the design system reference these names. */

:root {
  --bg: #f3f5f9; --ink: #0e1726;
  --accent: #1c53b8; --accent-hover: #16448f; --accent-tint: #e9eef7;
  --border: #e4e8f0; --input-border: #cfd7e6; --hairline: #eef1f7;
  --muted: #59637a; --muted-faint: #7b8499; --label: #3d4a63;
  --amber-bg: #fdf3dd; --amber-ink: #7c5f13; --amber-dot: #d9a916;
  --success-ink: #1c7a45; --success-bg: #d9efe1;
  --error-ink: #8a1f1f; --error-bg: #fdecea; --error-field: #b3261e;
  --focus-ring: rgba(28, 83, 184, 0.16);
  --shadow-rest: 0 1px 2px rgba(14, 23, 38, 0.05);
  --shadow-lift: 0 6px 18px rgba(28, 83, 184, 0.13);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5;
  font-family: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15.5px;
}

/* --- structure --- */
.container { max-width: 600px; margin: 0 auto; padding: 0 24px 48px; }
.site-header {
  max-width: 600px; margin: 0 auto; padding: 24px 24px 0;
  display: flex; justify-content: space-between; align-items: center;
}
.wordmark { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.wordmark span { color: var(--accent); }
.site-footer { max-width: 600px; margin: 0 auto; padding: 34px 24px 34px; }
.site-footer p { margin: 4px 0; font-size: 13px; color: var(--muted-faint); text-align: center; }

h1 { margin: 44px 0 8px; font-weight: 700; font-size: 32px; letter-spacing: -0.025em; line-height: 1.15; }
h2 { margin: 30px 0 12px; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.hero { margin-bottom: 26px; }
.subhead, .sub { margin: 0 0 26px; color: var(--muted); font-size: 15.5px; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: 14px; }
.small-link { font-size: 13px; }

/* --- step meter --- */
.steps { display: flex; gap: 6px; }
.steps i { width: 22px; height: 4px; border-radius: 2px; background: #d7dde9; }
.steps i.on { background: var(--accent); }

/* --- surfaces --- */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-rest); padding: 20px; margin-bottom: 14px;
}
.panel-title { margin: 0 0 10px; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }

/* --- forms --- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--label); }
.name-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 480px) { .name-grid { grid-template-columns: 1fr 1fr; } }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--input-border);
  border-radius: 10px; font: 400 15px/1.4 inherit; font-family: inherit;
  color: var(--ink); background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring);
}
.field-error { color: var(--error-field); font-size: 13.5px; margin: 6px 0 0; }
.state-reset { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13.5px; }
.state-choices { border: 0; padding: 0; margin: 0; }
.state-choices legend { font-weight: 700; margin-bottom: 4px; }
.state-choice { display: flex; justify-content: space-between; gap: 18px; margin-top: 10px; }

.consent { display: flex; gap: 10px; align-items: flex-start;
  font-size: 13.5px; line-height: 1.45; color: var(--muted); margin-bottom: 18px; }
.consent input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto;
  margin-top: 1px; }
.consent a { color: inherit; text-decoration: underline; }

.vote-plan-options { border: 0; padding: 0; margin: 0 0 18px; }
.vote-plan-choice {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  border: 1px solid var(--input-border); border-radius: 10px;
  margin-top: 10px; cursor: pointer; font-weight: 600;
}
.vote-plan-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.vote-plan-choice input[type="radio"] { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }

/* --- actions --- */
.btn {
  display: block; width: 100%; padding: 13px 22px; background: var(--accent);
  color: #fff; border: none; border-radius: 10px;
  font: 700 15.5px/1 inherit; font-family: inherit; text-align: center;
  text-decoration: none; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(28, 83, 184, 0.28); }
.btn-inline { display: inline-block; width: auto; }
.btn-secondary {
  display: block; width: 100%; margin-top: 18px; padding: 14px;
  background: none; border: 1px solid var(--input-border); border-radius: 12px;
  color: var(--accent); font: 600 15px/1 inherit; font-family: inherit; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-secondary:hover { background: var(--accent-tint); border-color: #b9c8e6; transform: none; box-shadow: none; }

/* --- identity match rows --- */
.candidate-card { padding: 0; overflow: hidden; margin-bottom: 12px; }
.candidate-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px;
  width: 100%; text-align: left; background: none; border: none;
  padding: 18px 20px; cursor: pointer; font: inherit; color: inherit;
}
.candidate-card { transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease; }
.candidate-card:hover { transform: translateY(-2px); border-color: #b9c8e6; box-shadow: var(--shadow-lift); }
.candidate-card:hover .chev { transform: translateX(3px); color: var(--accent); }
.candidate-name { display: block; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.candidate-address { display: block; margin-top: 3px; color: var(--muted); font-size: 14px; }
.chev { color: #aeb8cc; font-size: 20px; transition: transform 0.16s ease, color 0.16s ease; }

/* --- feedback --- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  background: var(--amber-bg); color: var(--amber-ink);
  border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber-dot); }
.banner { background: var(--amber-bg); color: var(--amber-ink); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; font-size: 14.5px; }
.alert { background: var(--error-bg); color: var(--error-ink); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; font-size: 14.5px; }
.chip { background: var(--accent-tint); color: var(--accent); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 700; }
.okmark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 6px;
  border-radius: 50%; background: var(--success-bg); color: var(--success-ink);
  font-size: 19px; vertical-align: 3px;
}
.ok { color: var(--success-ink); font-weight: 700; }

/* --- privacy reassurance --- */
.lock { display: flex; gap: 10px; align-items: flex-start; margin-top: 28px; background: var(--accent-tint); border-radius: 12px; padding: 14px 16px; }
.lock .ic {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  background: var(--accent); color: #fff; display: grid; place-items: center;
}
.lock .ic svg { width: 14px; height: 14px; }
.lock p { margin: 0; font-size: 13.5px; color: var(--label); }

/* --- registration + contest panels --- */
.info-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--hairline); font-size: 15px; }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--muted); }
/* One election heading for the whole run of its races. The election's name
   already carries its date ("November 3, 2026 General Election"), so the
   per-card line that repeated both was noise on every card — 29 of them on
   a Cuyahoga ballot, two wrapped lines each on a phone. */
.election-head { margin: 26px 0 12px; }
.election-head h3 { margin: 0; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.election-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }

.contest-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.contest-office { margin: 0; font-weight: 700; font-size: 16.5px; letter-spacing: -0.01em; }

/* Ten Court of Common Pleas seats carry one office name between them. The
   marker is the only thing on the card that says how many there are, so it
   holds its width rather than wrapping under a long office title. */
.seat-index {
  flex: none; background: var(--accent-tint); color: var(--accent);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}

/* The term is what distinguishes one seat from the next, so it reads as
   the card's subtitle and not as a fragment of a meta line. */
.contest-seat { margin: 3px 0 8px; color: var(--label); font-size: 14px; font-weight: 600; }
.contest-election { margin: 2px 0 8px; color: var(--muted); font-size: 13.5px; }
.contest-desc { margin: 0 0 6px; font-size: 14.5px; color: var(--label); }
.view-toggle { margin: -8px 0 16px; font-size: 13.5px; }
.candidate-item { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--hairline); font-size: 14.5px; }
.candidate-item .cn { font-weight: 600; }
.candidate-item .cp { color: var(--muted); font-size: 13px; }
.candidate-item .cl { color: var(--accent); font-size: 13px; text-decoration: none; }
.candidate-item .cl:hover { text-decoration: underline; color: var(--accent-hover); }
/* Ballot issues: the language can run to a page, so it folds. */
.measure-text { margin: 0 0 8px; }
.measure-text summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }

/* --- dashboard --- */
.container.dashboard { max-width: 900px; }
body:has(.container.dashboard) .site-header { max-width: 900px; }
.dashboard-filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.dashboard-filters .field { flex: 1 1 120px; min-width: 100px; margin-bottom: 0; }
.dashboard-filters .btn { width: auto; }
.statrow { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 640px) { .statrow { grid-template-columns: 1fr; } }
.statrow .card { margin-bottom: 0; }
.stat .big { display: block; font-weight: 700; font-size: 26px; letter-spacing: -0.02em; font-feature-settings: "tnum"; }
.stat .lbl { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.table-scroll { overflow-x: auto; }
.grid-table, .dashboard-table { width: 100%; border-collapse: collapse; font-feature-settings: "tnum"; }
.grid-table thead th, .dashboard-table thead th {
  background: var(--bg); color: var(--label); font-weight: 600; font-size: 12.5px;
  letter-spacing: 0.04em; text-transform: uppercase; padding: 8px 10px; text-align: center; border-radius: 6px;
}
.grid-table tbody th, .dashboard-table tbody th {
  color: var(--muted); font-weight: 600; font-size: 13.5px; text-align: left;
  padding: 10px; border-bottom: 1px solid var(--hairline);
}
.grid-table td, .dashboard-table td { padding: 10px; text-align: center; border-bottom: 1px solid var(--hairline); font-size: 14.5px; }
.grid-table tbody tr:last-child th, .grid-table tbody tr:last-child td,
.dashboard-table tbody tr:last-child th, .dashboard-table tbody tr:last-child td { border-bottom: none; }
.grid-table td:hover { background: #f6f8fc; }
.cell-count { display: block; font-weight: 700; font-size: 15.5px; }
.cell-sub { display: block; font-style: normal; color: #8d96aa; font-size: 11.5px; margin-top: 1px; }
.note { margin: 12px 0 0; color: var(--muted-faint); font-size: 13px; }

/* Split-precinct caveat: present but quiet — it qualifies the race, it
   isn't news. Sits between the description and the candidate list. */
.contest-note {
  margin: .4rem 0 .6rem;
  padding: .45rem .6rem;
  border-left: 2px solid var(--rule, #d8d3c7);
  background: var(--tint, #faf8f4);
  color: var(--muted, #6b665c);
  font-size: .82rem;
  line-height: 1.45;
}

/* --- research app (volunteer scoring) ------------------------------------
   Same tokens and vocabulary as the voter-facing pages; the only structural
   difference is a wider measure, because a rubric is a working surface
   rather than a funnel. */

.container-wide { max-width: 860px; }

.research-nav { display: flex; gap: 18px; align-items: center; font-size: 14px; font-weight: 600; }
.research-nav a { text-decoration: none; }
.research-nav .muted-link { color: var(--muted-faint); font-weight: 500; }

.crumb { margin: 28px 0 0; font-size: 13.5px; }
.crumb a { text-decoration: none; }

/* work tally */
.tally { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.tally-item {
  flex: 1 1 96px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
}
.tally-item .n { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tally-item .k { font-size: 12px; color: var(--muted-faint); font-weight: 600; letter-spacing: 0.02em; }

/* one row of work */
.work-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.work-main { min-width: 0; flex: 1 1 260px; }
.work-name { margin: 0; font-weight: 700; font-size: 16.5px; letter-spacing: -0.01em; }
.work-office { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.work-note { margin: 6px 0 0; font-size: 13.5px; color: var(--amber-ink); }
.work-side { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.work-side form { margin: 0; }
.work-also { margin: 4px 0 0; font-size: 13px; }
.work-race { margin: 18px 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

.state {
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--hairline); color: var(--muted); white-space: nowrap;
}
.state-open { background: var(--accent-tint); color: var(--accent); }
.state-yours, .state-draft { background: var(--amber-bg); color: var(--amber-ink); }
.state-returned { background: var(--error-bg); color: var(--error-ink); }
.state-done, .state-accepted { background: var(--success-bg); color: var(--success-ink); }

.btn-small { padding: 8px 14px; font-size: 13.5px; }
.linkish {
  background: none; border: 0; padding: 0; font: inherit; font-size: 13px;
  color: var(--muted-faint); text-decoration: underline; cursor: pointer;
}
.linkish:hover { color: var(--error-ink); }

/* criterion block */
.criterion-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.criterion-head .panel-title { margin: 0; }
.weight { font-size: 12px; color: var(--muted-faint); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.criterion .prompt { margin: 8px 0 12px; }

.anchors { margin: 0 0 14px; }
.anchors summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); }
.anchors p { margin: 10px 0 0; font-size: 13.5px; line-height: 1.65; color: var(--label); }

.cites { display: flex; flex-direction: column; gap: 6px; }
.cites label { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; font-weight: 400; color: var(--label); }
.cites input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; }

/* evidence */
.evidence-item { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.evidence-item:last-child { border-bottom: 0; }
.evidence-head { margin: 0 0 4px; display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.tag {
  background: var(--hairline); color: var(--label); border-radius: 6px;
  padding: 2px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em;
}
.evidence-summary { margin: 0; font-size: 14.5px; }
.add-evidence summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.add-evidence form { margin-top: 16px; }

.blockers { margin: 8px 0 0; padding-left: 20px; }
.blockers li { margin: 2px 0; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* review: the researcher's answer is displayed, never editable */
.answer { margin: 4px 0 10px; }
.answer-value {
  display: inline-block; background: var(--accent-tint); color: var(--accent);
  font-weight: 700; font-size: 15px; padding: 5px 12px; border-radius: 8px;
}
.cites-title { margin: 14px 0 4px; font-size: 13px; color: var(--muted); }
.criterion .answer + .prompt { margin-top: 0; }
.flag-warn { color: var(--amber-ink); font-weight: 700; }

/* --- share card (#19) --- */
.share-card-lead { border: 1px solid var(--accent-tint); box-shadow: 0 0 0 3px var(--accent-tint); }
.share-link { width: 100%; box-sizing: border-box; padding: 10px 12px; margin: 0 0 12px; border: 1px solid var(--input-border);
  border-radius: 10px; font: 14px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--label); background: #fff; }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.btn-link { color: var(--accent); font-weight: 600; font-size: 14.5px; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.welcome { background: var(--accent-tint); color: var(--label); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; font-size: 14.5px; }
