:root {
  --bg: #f7f7f5; --surface: #ffffff; --ink: #1d1f24; --muted: #5f6470; --line: #e2e2de;
  --accent: #5b3fd1; --accent-ink: #ffffff; --accent-soft: #ece8fb;
  --ok: #1f7a4d; --ok-soft: #e4f4ec; --warn: #9a5b00; --warn-soft: #fbf0dc;
  --radius: 12px; --max: 860px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15161a; --surface: #1e2026; --ink: #ececec; --muted: #a0a4ad; --line: #30333b;
    --accent: #8f78f0; --accent-ink: #15161a; --accent-soft: #2a2545; --ok: #6fd3a0; --ok-soft: #173326; --warn: #f0b55c; --warn-soft: #3a2c14; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 17px; }
a { color: var(--accent); }
main { max-width: var(--max); margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); line-height: 1.2; margin: .2em 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin: 1.8em 0 .6em; }
h3 { font-size: 1.05rem; margin: 0 0 .4em; }
.lead { font-size: 1.12rem; color: var(--muted); }
.muted, .fine { color: var(--muted); }
.fine { font-size: .88rem; }

header.site, footer.site { max-width: var(--max); margin: 0 auto; padding: 16px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
header.site nav, footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
header.site nav a, footer.site nav a { color: var(--ink); text-decoration: none; font-size: .95rem; }
header.site nav a:hover { color: var(--accent); }
footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.brand { font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand .tld { color: var(--muted); font-weight: 500; }
.mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-size: 16px; }
.modebar { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: .85rem; padding: 6px 16px; }

.hero { padding: 24px 0 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--ink); text-decoration: none; transition: border-color .15s; }
.card:hover { border-color: var(--accent); }
.topic { display: inline-block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.meta { font-size: .85rem; color: var(--muted); }
.meta.open { color: var(--ok); }
.how ol { padding-left: 1.2em; }
.how li { margin-bottom: .5em; }

.poll { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 4vw, 32px); }
.client { color: var(--muted); }
.scope { background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; font-size: .92rem; }
details.context { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 16px 0; }
details.context summary { cursor: pointer; font-weight: 600; }
.procon { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 10px; }
.sources { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.vote { margin-top: 20px; }
.options { display: grid; gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }
.options.preview li { border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; color: var(--muted); }
label.option { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 14px; cursor: pointer; background: var(--surface); }
label.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
label.option input { width: 20px; height: 20px; accent-color: var(--accent); }
.share { margin-top: 24px; font-size: .9rem; color: var(--muted); }

.btn { display: inline-block; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 12px 20px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn:hover { filter: brightness(1.05); }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.logout { text-align: right; margin-top: 12px; }

.note { border-radius: 10px; padding: 12px 14px; background: var(--accent-soft); }
.note.ok { background: var(--ok-soft); color: var(--ok); }
.note.warn { background: var(--warn-soft); color: var(--warn); }

.narrow { max-width: 640px; margin: 0 auto; }
.prose li { margin-bottom: .4em; }
form label { display: block; margin: 0 0 12px; font-weight: 500; }
form label input:not([type=radio]):not([type=checkbox]), form label textarea, form label select { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
form.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
form.grid .wide, form.grid button { grid-column: 1 / -1; }
@media (max-width: 600px) { form.grid { grid-template-columns: 1fr; } }

.bars { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 12px; align-items: center; }
.bars .label { font-weight: 600; }
svg.bar { width: 100%; height: 14px; border-radius: 7px; overflow: hidden; display: block; }
svg.bar .track { fill: var(--line); }
svg.bar .fill { fill: var(--accent); }
.bars .val { font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.groups td { font-variant-numeric: tabular-nums; }
td.actions a { margin-right: 8px; white-space: nowrap; }
code { font-size: 1rem; font-weight: 700; letter-spacing: .05em; }

/* QR-Code (chillerlan SVG) */
.qr svg { width: 100%; height: auto; }
.qr svg .dark, .qr svg path { fill: #000; }

/* Druck-Aushang A4 */
body.bare { background: #fff; color: #000; }
body.bare main { max-width: none; padding: 0; }
.sheet { width: 190mm; min-height: 270mm; margin: 0 auto; padding: 12mm; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4mm; }
.sheet .brandline { font-weight: 700; font-size: 18pt; display: flex; gap: 8px; align-items: center; }
.sheet h1 { font-size: 30pt; line-height: 1.15; margin: 4mm 0; }
.sheet .client { font-size: 16pt; margin: 0; color: #333; }
.sheet .qr { width: 95mm; }
.sheet .short { font-size: 26pt; font-weight: 700; letter-spacing: .02em; margin: 0; }
.sheet .until { font-size: 14pt; font-weight: 600; }
@page { size: A4; margin: 0; }
@media print { body { background: #fff; } }

/* Feinschliff */
.brand { gap: 0; }
.brand .mark { margin-right: 8px; }
table.groups th { white-space: nowrap; }
@media (max-width: 600px) {
  .bars li { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .bars .label { grid-column: 1 / -1; }
}
