:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #5e636b;
  --border: #d9d7d0;
  --accent: #2f5bd3;
  --accent-text: #ffffff;
  --accent-soft: #e6ecfb;
  --good: #1f7a4a;
  --bad: #b3412e;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1f2226;
    --text: #e8e9eb;
    --muted: #a0a5ad;
    --border: #353a40;
    --accent: #7b9cf0;
    --accent-text: #0d1424;
    --accent-soft: #232c40;
    --good: #5cc48b;
    --bad: #ef8a76;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 16px 40px;
}

h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 1.35rem; line-height: 1.3; margin: 0 0 20px; }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.progress {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}
.progress span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}
.progress span.done { background: var(--accent); }

fieldset { border: 0; margin: 0; padding: 0; }
legend { padding: 0; }

.options { display: grid; gap: 10px; margin-bottom: 24px; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.option:hover { border-color: var(--accent); }
.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.option input { margin: 4px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.option.skip { background: transparent; border-style: dashed; color: var(--muted); }

.actions { display: flex; gap: 10px; justify-content: space-between; }

button {
  font: inherit;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible, .option:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.card.top { border: 2px solid var(--accent); }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.card-head h3 { margin: 0; font-size: 1.15rem; }
.score { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.bar {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  margin: 10px 0 14px;
  overflow: hidden;
}
.bar > div { height: 100%; background: var(--accent); }

.breakdown { list-style: none; margin: 12px 0 0; padding: 0; font-size: 0.92rem; }
.breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}
.agree { color: var(--good); font-weight: 600; }
.disagree { color: var(--bad); font-weight: 600; }
.partial { color: var(--muted); font-weight: 600; }

.note {
  border-left: 3px solid var(--border);
  padding-left: 12px;
  margin-top: 28px;
}

.field { display: grid; gap: 6px; margin-bottom: 6px; font-weight: 600; }
.field input {
  font: inherit;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: 8ch;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.field input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.error { color: var(--bad); min-height: 1.5em; margin-bottom: 16px; }
.action-group { display: flex; gap: 10px; }

a { color: var(--accent); }
.section-title { font-size: 1.05rem; margin: 32px 0 12px; }
.elections { list-style: none; margin: 0; padding: 0; }
.election {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--text);
  text-decoration: none;
}
.election strong { display: block; font-size: 1.1rem; }
.election .eyebrow { margin-bottom: 2px; }
a.election:hover { border-color: var(--accent); }
a.election:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.election .go { color: var(--accent); font-weight: 600; white-space: nowrap; }
.election.soon { color: var(--muted); border-style: dashed; }
.badge {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--border);
  color: var(--text);
}

.party { margin: 2px 0 0; font-weight: 600; color: var(--muted); }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
}
.avatar.initials {
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.sources { margin-top: 12px; font-size: 0.9rem; }
.sources summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.sources ul { margin: 8px 0 0; padding-left: 18px; }
.sources li { margin-bottom: 6px; }

.cover { margin: 0 0 24px; }
.cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: 50% 12%;
  border-radius: var(--radius);
  background: var(--border);
}
.cover figcaption { margin-top: 6px; font-size: 0.75rem; color: var(--muted); text-align: right; }

.site-footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
