:root {
  --bg: #f4f5f7;
  --fg: #17181c;
  --muted: #5c6270;
  --card: #ffffff;
  --border: #e2e4ea;
  --accent: #4f46e5;
  --accent-fg: #ffffff;
  --agree: #157f3d;
  --agree-bg: #e5f5eb;
  --neutral: #5c6270;
  --neutral-bg: #eef0f3;
  --disagree: #b42331;
  --disagree-bg: #fbe9ea;
  --warn-bg: #fff7e0;
  --warn-border: #e8c76a;
  --warn-fg: #6b5518;
  --shadow: 0 1px 3px rgba(20, 22, 30, .08), 0 8px 24px rgba(20, 22, 30, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101116;
    --fg: #e8e9ee;
    --muted: #9aa0ad;
    --card: #1a1c23;
    --border: #2b2e38;
    --accent: #818cf8;
    --accent-fg: #14151c;
    --agree: #4ade80;
    --agree-bg: #12301d;
    --neutral: #a8aeba;
    --neutral-bg: #23262e;
    --disagree: #f87171;
    --disagree-bg: #3a1518;
    --warn-bg: #2d2410;
    --warn-border: #6b5518;
    --warn-fg: #e8c76a;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 24px; padding-bottom: 48px; }

a { color: var(--accent); }
h1 { font-size: 1.7rem; line-height: 1.25; margin: .2em 0 .4em; }
h2 { font-size: 1.25rem; margin: 1.2em 0 .5em; }
p { margin: .5em 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Header / Footer */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 700; text-decoration: none; color: var(--fg); font-size: 1.05rem; }
.brand span { color: var(--accent); }
.badge-demo {
  margin-left: auto;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--warn-fg); background: var(--warn-bg); border: 1px solid var(--warn-border);
  padding: 2px 8px; border-radius: 99px;
}
.site-footer { border-top: 1px solid var(--border); padding: 18px 0 28px; }
.site-footer p { font-size: .85rem; color: var(--muted); margin: .3em 0; }

/* Cards & Buttons */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-fg);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: .9rem;
  margin: 14px 0;
}
.notice strong { color: inherit; }

button {
  font: inherit;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  padding: 12px 18px;
  min-height: 48px;
}
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
  font-weight: 600;
  padding: 13px 26px;
}
.btn-link { background: none; border: none; color: var(--muted); text-decoration: underline; min-height: 0; padding: 8px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* Startscreen */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 14px 0; }
.fact { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.fact b { display: block; font-size: 1rem; }
.candidates { font-size: .9rem; }
.candidates li { margin: 2px 0; }

/* Quiz */
.progress { height: 8px; background: var(--neutral-bg); border-radius: 99px; overflow: hidden; margin: 6px 0 18px; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .25s ease; }
@media (prefers-reduced-motion: reduce) { .progress > div, .bar > div { transition: none; } }
.thesis-count { font-size: .85rem; color: var(--muted); }
.thesis-label { font-size: .85rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-top: 10px; }
.thesis-text { font-size: 1.3rem; font-weight: 600; line-height: 1.4; margin: 8px 0 22px; min-height: 3em; }
.answers { display: grid; gap: 10px; }
@media (min-width: 560px) { .answers { grid-template-columns: 1fr 1fr 1fr; } }
.answers button { font-weight: 600; }
.answers .agree { border-color: var(--agree); color: var(--agree); background: var(--agree-bg); }
.answers .neutral { border-color: var(--border); color: var(--fg); background: var(--neutral-bg); }
.answers .disagree { border-color: var(--disagree); color: var(--disagree); background: var(--disagree-bg); }
.answers button.selected { outline: 3px solid var(--accent); outline-offset: 1px; }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 16px; }
.kbd-hint { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 14px; }
.kbd-hint kbd { border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; font-family: inherit; }

/* Gewichtung */
.weight-list { list-style: none; padding: 0; margin: 12px 0; }
.weight-list li {
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border); padding: 9px 2px; font-size: .95rem;
}
.weight-list li:last-child { border-bottom: none; }
.weight-list .lbl { flex: 1; }
.weight-list .my { font-size: .78rem; white-space: nowrap; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Ergebnis */
.party-select { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 10px 0 4px; }
.party-select label { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; cursor: pointer; }
.party-select label.disabled { color: var(--muted); cursor: not-allowed; }
.party-select input { width: 17px; height: 17px; accent-color: var(--accent); }
.result-row { margin: 14px 0; }
.result-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.result-head .rank { color: var(--muted); font-size: .85rem; min-width: 1.4em; }
.result-head .pname { font-weight: 700; }
.result-head .cand { color: var(--muted); font-size: .82rem; }
.result-head .pct { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.bar { height: 14px; border-radius: 99px; background: var(--neutral-bg); overflow: hidden; margin-top: 5px; }
.bar > div { height: 100%; border-radius: 99px; border: 1px solid rgba(127,127,127,.35); transition: width .5s ease; }

/* Detailvergleich */
details.party-detail { border: 1px solid var(--border); border-radius: 12px; margin: 10px 0; overflow: hidden; }
details.party-detail > summary {
  cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
details.party-detail > summary::after { content: "▸"; margin-left: auto; color: var(--muted); }
details.party-detail[open] > summary::after { content: "▾"; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(127,127,127,.4); }
.detail-thesis { border-top: 1px solid var(--border); padding: 12px 14px; }
.detail-thesis .t { font-weight: 600; font-size: .95rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.chip { font-size: .78rem; font-weight: 600; border-radius: 99px; padding: 3px 10px; border: 1px solid var(--border); }
.chip.agree { color: var(--agree); background: var(--agree-bg); border-color: var(--agree); }
.chip.neutral { color: var(--neutral); background: var(--neutral-bg); }
.chip.disagree { color: var(--disagree); background: var(--disagree-bg); border-color: var(--disagree); }
.chip.skipped { color: var(--muted); background: none; border-style: dashed; }
.chip.w2 { color: var(--accent); border-color: var(--accent); background: none; }
details.comment { margin-top: 6px; }
details.comment summary { cursor: pointer; font-size: .82rem; color: var(--accent); }
details.comment blockquote {
  margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--border);
  font-size: .88rem; color: var(--muted);
}

/* Quellen */
.about ul { padding-left: 1.2em; }
.about li { margin: .4em 0; }
