:root {
  --navy: #002451;
  --blue: #155a9a;
  --blue-deep: #01315f;
  --red: #c41e22;
  --ink: #122033;
  --muted: #5c6b7c;
  --line: #d5dee8;
  --paper: #f4f7fb;
  --white: #ffffff;
  --ok: #0f6b4c;
  --ok-bg: #e7f6ef;
  --warn-bg: #fff6e8;
  --danger-bg: #fdeceb;
  --shadow: 0 10px 30px rgba(10, 42, 74, 0.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", "Source Sans 3", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--white);
  color: var(--navy);
  padding: 8px 12px;
  z-index: 5;
}
.skip:focus { top: 12px; }
.topbar { background: var(--navy); color: var(--white); }
.topbar a { color: var(--white); }
.accent { height: 4px; background: var(--red); }
.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand img { width: 52px; height: 52px; background: var(--white); border-radius: 50%; object-fit: cover; }
.brand strong { display: block; font-family: Palatino, "Palatino Linotype", Georgia, serif; font-size: 1.15rem; letter-spacing: 0.01em; }
.brand span { display: block; color: #d5e2ef; font-size: 0.85rem; }
nav { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
nav a { color: inherit; text-decoration: none; font-weight: 650; }
nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.nav-btn {
  border: 1px solid rgba(255,255,255,0.45);
  background: transparent;
  color: white;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}
main { padding: 28px 0 64px; }
h1, h2, h3 { font-family: Palatino, "Palatino Linotype", Georgia, serif; line-height: 1.2; color: var(--navy); }
h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin: 0 0 8px; }
h2 { font-size: 1.45rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.lede { font-size: 1.125rem; max-width: 42rem; }
.muted { color: var(--muted); }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 16px 0;
}
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(3, 1fr); }
.stat strong { display: block; font-size: 1.8rem; color: var(--navy); font-family: Palatino, Georgia, serif; }
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 650; }
input, textarea, select {
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #b7c5d4;
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
}
textarea { min-height: 120px; resize: vertical; }
.button, button {
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: var(--white);
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button.secondary, button.secondary { background: var(--white); color: var(--navy); }
.button.danger, button.danger { background: var(--white); color: var(--red); border-color: var(--red); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.notice, .error {
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}
.notice { background: var(--ok-bg); color: var(--ok); }
.error { background: var(--danger-bg); color: var(--red); }
.chip {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  background: #e7eef6;
  color: var(--navy);
}
.chip.open { background: #e7f6ef; color: var(--ok); }
.chip.closed { background: #eef1f4; color: var(--muted); }
.chip.draft { background: var(--warn-bg); color: #8a5a00; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.85rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); }
.election-list { display: grid; gap: 12px; }
.election-list a.card { display: block; color: inherit; text-decoration: none; }
.election-list a.card:hover { border-color: var(--blue); }
fieldset {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0 0 16px;
  padding: 16px;
}
legend { font-family: Palatino, Georgia, serif; color: var(--navy); font-size: 1.2rem; padding: 0 6px; }
.choice { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; padding: 8px 0; }
.choice input { width: 1.25rem; height: 1.25rem; min-height: 0; margin-top: 4px; }
.voting-code {
  font-family: "Cascadia Mono", ui-monospace, monospace;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  color: var(--navy);
}
.qr { width: min(220px, 100%); height: auto; background: white; }
.recovery { columns: 2; padding-left: 18px; }
.hero { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; margin-bottom: 8px; }
.hero img { width: 120px; height: 120px; background: white; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline { display: flex; gap: 8px; align-items: end; }
.inline button, .inline .button { flex: 0 0 auto; }
footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 40px;
  color: var(--muted);
  background: var(--white);
}
footer strong { color: var(--navy); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
@media (max-width: 720px) {
  .stats, .two, .hero { grid-template-columns: 1fr; }
  .bar { align-items: flex-start; flex-direction: column; }
  .recovery { columns: 1; }
  table { display: block; overflow-x: auto; }
}