:root {
  --paper: oklch(0.98 0.002 180);
  --surface: oklch(0.995 0.001 180);
  --ink: oklch(0.26 0.012 180);
  --ink-2: oklch(0.46 0.012 180);
  --line: oklch(0.26 0.012 180 / 0.16);
  --control-border: oklch(0.65 0.012 180);
  --accent: oklch(0.45 0.075 180);
  --accent-hover: oklch(0.39 0.06 180);
  --accent-wash: oklch(0.95 0.018 180);
  --focus: oklch(0.32 0 0);
  --ok: oklch(0.44 0.09 155);
  --mid: oklch(0.46 0.09 78);
  --no: oklch(0.48 0.145 29);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --radius-control: 14px;
  --radius-option: 18px;
  --duration-progress: 280ms;
  --duration-result: 600ms;
  --ease-progress: cubic-bezier(0.645, 0.045, 0.355, 1);
  --ease-result: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-press: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, select, label:has(input), summary { cursor: pointer; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }
button { color: inherit; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
button:disabled { opacity: 0.35; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
h1:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
h1 { font: var(--font-weight-normal) clamp(34px, 4vw, 48px)/1.12 var(--serif); letter-spacing: -0.025em; text-wrap: balance; overflow-wrap: break-word; }
.app { width: min(100% - 96px, 1080px); min-height: 100dvh; margin: 0 auto; padding: 32px 0 calc(40px + env(safe-area-inset-bottom)); }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 60px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.wordmark { color: var(--accent); font: var(--font-weight-bold) 32px/1 var(--serif); letter-spacing: -0.055em; white-space: nowrap; }
.locale-field { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }
.locale-field select { min-height: 44px; max-width: 150px; padding: 8px 10px; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--ink); font-size: 16px; }
.start-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(48px, 8vw, 128px); align-items: start; padding-top: clamp(56px, 8vw, 112px); }
.start-intro h1 { max-width: 10ch; font-size: clamp(52px, 5.5vw, 76px); line-height: 1.04; }
.tagline { color: var(--ink-2); font-size: 17px; line-height: 1.65; max-width: 48ch; margin-top: 20px; }
.start-intro .tagline { max-width: 34ch; margin-top: 28px; font-size: 18px; }
.demo-note { color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.start-intro .demo-note { max-width: 36ch; margin-top: 36px; }
.lengths { min-width: 0; border: 0; padding: 0; margin: 0; }
.lengths legend { width: 100%; padding: 0 0 22px; font-size: 15px; font-weight: var(--font-weight-semibold); }
.length-option { display: flex; align-items: center; gap: 18px; min-height: 84px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-control); transition: background-color 120ms ease, border-color 120ms ease; }
.length-option + .length-option { margin-top: 8px; }
.length-option:has(input:checked) { background: var(--accent-wash); border-color: var(--accent); }
input[type="radio"], input[type="checkbox"] { flex: none; margin: 0; accent-color: var(--accent); }
.length-option input { width: 18px; height: 18px; }
.length-copy { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.length-name { font: var(--font-weight-normal) 25px/1.2 var(--serif); }
.length-meta { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.important { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; }
.important input { width: 18px; height: 18px; }
.primary, .secondary, .stance { min-height: 48px; padding: 12px 20px; border: 1px solid var(--control-border); border-radius: var(--radius-control); background: transparent; font-size: 15px; font-weight: var(--font-weight-medium); transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease; }
.primary { display: block; width: 100%; margin-top: 24px; border-color: var(--accent); background: var(--accent); color: var(--surface); }
.start-form .primary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.start-form .secondary { width: 100%; margin-top: 10px; }
.button-arrow { font-size: 22px; line-height: 1; pointer-events: none; }
.text-btn, .skip { min-height: 44px; padding: 10px 0; border: 0; background: transparent; color: var(--ink-2); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.start-footer { margin-top: 20px; }
.reading-pane { max-width: 760px; margin: 48px auto 0; }
.question-screen .reading-pane { margin-top: 0; }
.question-top { display: flex; align-items: center; gap: 24px; min-height: 44px; margin-bottom: 36px; }
run-progress { display: flex; flex: 1; align-items: center; gap: 16px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.run-progress-label { display: inline-flex; flex: none; width: 10ch; white-space: nowrap; }
.run-progress-label number-flow { --number-flow-mask-height: 0.1em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.run-progress-track { flex: 1; max-width: 260px; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.run-progress-fill { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--duration-progress) var(--ease-progress); }
run-progress[data-instant] .run-progress-fill { transition: none; }
law-question { display: block; }
.law-reference { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 18px; }
.law-topic { padding: 4px 12px; border-radius: 999px; background: var(--accent-wash); color: var(--accent); font-size: 12px; line-height: 20px; font-weight: var(--font-weight-semibold); }
.law-meta { color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.law-title { max-width: 27ch; font-size: clamp(30px, 3.5vw, 44px); line-height: 1.15; text-wrap: pretty; }
.law-explanation { margin-top: 24px; color: var(--ink-2); font-size: 17px; line-height: 1.7; max-width: 68ch; }
.law-arguments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 32px; }
.argument { border-top: 1px solid var(--line); padding-top: 16px; }
.argument h2 { margin-bottom: 10px; font-size: 13px; line-height: 1.5; font-weight: var(--font-weight-semibold); }
.argument p { color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.law-links { display: flex; gap: 8px 24px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.law-links a { display: inline-flex; align-items: center; min-height: 44px; }
.vote-controls { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.important { color: var(--ink-2); margin-bottom: 12px; }
.weight-badge { flex: none; min-width: 32px; padding: 2px 8px; border-radius: 999px; background: var(--accent-wash); color: var(--accent); font-size: 12px; line-height: 20px; font-weight: var(--font-weight-semibold); text-align: center; font-variant-numeric: tabular-nums; transition: background-color 120ms ease, color 120ms ease; }
.important:has(input:checked) .weight-badge { background: var(--accent); color: var(--surface); }
.stances { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stance { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; padding: 16px 12px; border-radius: var(--radius-option); background: var(--surface); overflow-wrap: anywhere; transition: transform 150ms var(--ease-press), background-color 120ms ease, color 120ms ease, border-color 120ms ease; }
.stance .icon { flex: none; pointer-events: none; }
.stance.is-selected { border-color: var(--accent); background: var(--accent); color: var(--surface); }
.stance:active, .stance.is-pressed { border-color: var(--accent); background: var(--accent-wash); color: var(--accent); }
.stance.is-pressed { transform: scale(0.97); }
.stance[aria-disabled="true"] { transform: none; }
.stance:focus-visible { transition: none; }
.stance:focus-visible:active { transform: none; }
.question-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.question-nav .secondary { min-height: 44px; padding: 10px 0; border: 0; color: var(--ink-2); font-size: 14px; }
.result-screen .tagline { margin-top: 16px; }
.result-screen .demo-note { margin-top: 16px; }
party-badge { display: inline-flex; align-items: center; gap: 10px; font-size: 21px; font-weight: var(--font-weight-semibold); letter-spacing: -0.02em; }
party-badge::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--party-color, #333); }
.featured-result { margin-top: 32px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 30px 0; }
result-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 220px); gap: 12px 32px; align-items: start; }
.result-head { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; gap: 4px; }
.result-party-name { color: var(--ink-2); font-size: 12px; }
.result-candidate { font-size: 14px; }
.featured-result party-badge { font: var(--font-weight-normal) 38px/1.1 var(--serif); }
.featured-result .result-party-name { margin-top: 4px; }
affinity-bar { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 12px; min-width: 0; }
.affinity-track { display: block; width: 100%; height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.affinity-fill { display: block; width: 100%; height: 100%; background: var(--party-color, #333); transform-origin: left; }
.affinity-value { font: var(--font-weight-normal) 32px/1 var(--serif); font-variant-numeric: tabular-nums; text-align: right; }
.affinity-value number-flow { font: inherit; --number-flow-mask-height: 0.1em; }
.affinity-unit { margin-left: 3px; font: var(--font-weight-normal) 16px var(--sans); color: var(--ink-2); }
.featured-result .affinity-value { font-size: 64px; }
.result-coverage { grid-column: 1 / -1; color: var(--ink-2); font-size: 12px; }
.ranking { padding: 0; margin: 0; list-style: none; }
.ranking > li { padding: 24px 0; border-bottom: 1px solid var(--line); }
.result-detail { grid-column: 1 / -1; font-size: 13px; }
.result-detail summary { min-height: 44px; padding: 12px 0; color: var(--ink-2); }
.result-detail ul { display: grid; gap: 10px; padding: 0; margin: 8px 0 4px; list-style: none; }
.result-detail li { line-height: 1.5; }
.detail-mark { display: inline-block; min-width: 20px; font-weight: var(--font-weight-semibold); }
.detail-mark[data-score="1"] { color: var(--ok); }
.detail-mark[data-score="0.5"] { color: var(--mid); }
.detail-mark[data-score="0"] { color: var(--no); }
.detail-important { color: var(--mid); }
.result-nodata { color: var(--ink-2); text-align: right; font-size: 14px; }
.result-screen .primary { width: auto; min-width: 200px; margin-top: 32px; }
.methodology-screen .reading-pane { max-width: 680px; }
.methodology-body { margin-top: 28px; color: var(--ink-2); font-size: 17px; line-height: 1.8; }
.methodology-screen .demo-note { margin-top: 24px; }
.methodology-screen .secondary { margin-top: 32px; }
.warning, .save-warning { padding: 12px 16px; border-left: 2px solid var(--accent); border-radius: var(--radius-control); background: var(--accent-wash); font-size: 14px; line-height: 1.6; }
.warning { margin-top: 24px; }
.save-warning { max-width: 1080px; margin: 12px auto 0; }
.loading { padding: 80px 0; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) {
  .primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
  .secondary:hover, .stance:not(.is-selected):hover { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }
  .question-nav .secondary:hover { background: transparent; color: var(--ink); }
  .text-btn:hover, .skip:hover, .law-links a:hover { color: var(--ink); }
}
.primary:active { background: var(--accent-hover); border-color: var(--accent-hover); }
.secondary:active { background: var(--accent-wash); color: var(--ink); }
@media (max-width: 760px) {
  .app { width: min(100% - 40px, 560px); padding-top: 16px; }
  .masthead { min-height: 52px; padding-bottom: 12px; }
  .wordmark { font-size: 28px; }
  .start-layout { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; }
  .start-intro h1 { font-size: clamp(42px, 10vw, 60px); max-width: 13ch; }
  .start-intro .tagline { margin-top: 20px; font-size: 16px; max-width: 40ch; }
  .start-intro .demo-note { max-width: 44ch; margin-top: 20px; font-size: 12px; }
  .lengths legend { padding-bottom: 16px; }
  .length-option { min-height: 68px; padding: 14px; }
  .length-name { font-size: 23px; }
  .reading-pane { margin-top: 28px; }
  .question-top { margin-bottom: 24px; gap: 16px; }
  .law-reference { gap: 6px 16px; margin-bottom: 16px; }
  .law-explanation { margin-top: 20px; font-size: 16px; }
  .law-arguments { grid-template-columns: 1fr; gap: 20px; margin-top: 24px; }
  .argument { padding-top: 12px; }
  .argument h2 { margin-bottom: 6px; }
  .vote-controls { margin-top: 12px; }
  .stance { flex-direction: column; gap: 8px; min-height: 84px; padding: 14px 6px; font-size: 14px; }
  result-row { grid-template-columns: minmax(0, 1fr) 100px; gap: 8px 20px; }
  .featured-result { padding: 24px 0; }
  .featured-result party-badge { font-size: 32px; }
  .featured-result .affinity-value { font-size: 48px; }
  .result-screen .primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-property: opacity, color, background-color, border-color !important; transition-duration: 120ms !important; }
  .run-progress-fill { transition: none !important; }
  .stance:active, .stance.is-pressed { transform: none; }
}
