/* Therme Wien – PRE/POST-Befragung · CI: Petrol #002535, Hellblau #B2D8E5, Inter */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/static/fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/static/fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --petrol: #002535; --petrol-2: #0a3446; --petrol-3: #13465c;
  --sky: #B2D8E5; --sky-2: #d9edf4; --sky-3: #eef7fa;
  --ink: #002535; --ink-2: #3c5a68; --ink-3: #6f8893;
  --line: #d6e3e9; --bg-admin: #f2f6f8;
  --err: #c2312b; --err-bg: #fdeeed; --warn: #8a5a00; --warn-bg: #fff6e0; --ok: #1d6b45; --ok-bg: #e7f5ed;
  --c-pre: #3A87A8; --c-post: #002535;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Inter", Arial, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ===================================================================== Gäste */
body.guest { background: var(--petrol); color: #fff; min-height: 100vh; }
.g-wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 120px; }
.g-head { position: sticky; top: 0; z-index: 20; background: var(--petrol); padding: 18px 0 12px; }
.g-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.g-logo img { height: 44px; width: auto; display: block; }
.g-step { text-align: right; color: rgba(255,255,255,.7); }
.g-step strong { color: #fff; display: block; font-size: 14px; letter-spacing: 0; text-transform: none; }
.progress { margin-top: 14px; height: 6px; background: rgba(255,255,255,.12); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--sky); border-radius: 99px; transition: width .35s ease; }
.g-hero { text-align: center; padding: 56px 8px 24px; }
.g-hero h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.15; margin: 14px 0 12px; font-weight: 700; letter-spacing: -.01em; }
.g-hero p { color: rgba(255,255,255,.8); max-width: 560px; margin: 0 auto; font-size: 17px; }
.g-hero .g-logo img { height: 64px; margin: 0 auto; }
.g-choice { display: grid; gap: 14px; margin-top: 32px; }
.g-choice a { display: flex; justify-content: space-between; align-items: center; gap: 16px; text-decoration: none;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius);
  padding: 22px 24px; transition: background .2s, border-color .2s; }
.g-choice a:hover, .g-choice a:focus-visible { background: rgba(178,216,229,.14); border-color: var(--sky); }
.g-choice b { font-size: 18px; display: block; }
.g-choice span.arrow { color: var(--sky); font-size: 26px; }
.g-foot { text-align: center; color: rgba(255,255,255,.45); font-size: 12px; padding: 40px 0 0; }

.card { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 28px; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.g-page-title { color: var(--sky); margin: 26px 4px 12px; }
.q { padding: 4px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.q:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.q.sub { border-bottom: 0; padding-bottom: 6px; margin-bottom: 18px; }
.q-intro { font-size: 19px; font-weight: 650; line-height: 1.35; margin: 0 0 6px; }
.q-stem { font-weight: 600; color: var(--ink-2); margin: 10px 0 4px; }
.q-label { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.q-hint { color: var(--ink-3); font-size: 14px; margin: 0 0 14px; }
.req { color: var(--err); margin-left: 3px; }
.q.has-error { box-shadow: -14px 0 0 -10px var(--err); }
.q-error { color: var(--err); font-weight: 600; font-size: 14px; margin-top: 10px; display: none; }
.q.has-error .q-error { display: block; }
.q-notice { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: 14px; font-weight: 500; }

.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border: 2px solid var(--line); border-radius: 14px;
  cursor: pointer; transition: border-color .15s, background .15s; user-select: none; }
.opt:hover { border-color: var(--sky); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .mark { flex: 0 0 22px; height: 22px; border: 2px solid #9fb6c0; border-radius: 50%; margin-top: 1px; display: grid; place-items: center; background: #fff; }
.opt.multi .mark { border-radius: 6px; }
.opt.sel { border-color: var(--petrol); background: var(--sky-3); }
.opt.sel .mark { background: var(--petrol); border-color: var(--petrol); }
.opt.sel .mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.opt.multi.sel .mark::after { width: 10px; height: 6px; border-radius: 0; background: none; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); }
.opt.disabled { opacity: .45; cursor: not-allowed; }
.opt:focus-within { outline: 3px solid var(--sky); outline-offset: 2px; }
.opt-other { margin: 8px 0 0 34px; }
.counter { font-size: 13px; color: var(--ink-3); margin-top: 8px; }

.scale { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; }
.scale button { height: 46px; border: 2px solid var(--line); background: #fff; border-radius: 12px; font-weight: 650; cursor: pointer; transition: all .12s; }
.scale button:hover { border-color: var(--sky); background: var(--sky-3); }
.scale button.sel { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.scale button:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.scale-legend { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.scale-legend span:last-child { text-align: right; }
.scale.na-on button { opacity: .35; }
.na { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.na input { width: 18px; height: 18px; accent-color: var(--petrol); }
.matrix-item { padding: 16px 0; border-top: 1px dashed var(--line); }
.matrix-item:first-of-type { border-top: 0; }
@media (max-width: 560px) {
  .scale.n11 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .scale.n10 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .card { padding: 22px 18px; }
  .q-intro { font-size: 18px; }
}

.inp { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 16px; background: #fff; }
.inp:focus { outline: none; border-color: var(--petrol); box-shadow: 0 0 0 3px var(--sky-2); }
textarea.inp { min-height: 120px; resize: vertical; }
.inp.code { font-size: 22px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; max-width: 340px; }
.inp.short { max-width: 220px; }
.check-line { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; }
.check-line input { width: 20px; height: 20px; accent-color: var(--petrol); }
.check-line.sel { border-color: var(--petrol); background: var(--sky-3); }
.alert { padding: 14px 16px; border-radius: 12px; font-size: 14px; margin: 14px 0 0; }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.err { background: var(--err-bg); color: var(--err); font-weight: 600; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: var(--sky-3); color: var(--ink-2); }
.prefill-note { background: var(--sky-3); padding: 12px 14px; border-radius: 12px; font-size: 14px; color: var(--ink-2); margin-bottom: 20px; }

.g-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(0,37,53,.96); border-top: 1px solid rgba(255,255,255,.1);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
.g-nav-in { max-width: 760px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 13px 26px; font-weight: 700;
  cursor: pointer; text-decoration: none; font-size: 15px; transition: background .15s, opacity .15s; }
.btn-sky { background: var(--sky); color: var(--petrol); }
.btn-sky:hover { background: #c9e5ef; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn-ghost:hover { border-color: #fff; }
.btn[disabled] { opacity: .5; cursor: wait; }
.btn-petrol { background: var(--petrol); color: #fff; }
.btn-petrol:hover { background: var(--petrol-3); }
.btn-line { background: #fff; color: var(--petrol); border: 1px solid var(--line); }
.btn-line:hover { border-color: var(--petrol); }
.btn-danger { background: var(--err); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

.end { text-align: center; padding: 30px 6px; }
.end h2 { font-size: 28px; margin: 6px 0 14px; }
.end .codebox { display: inline-block; margin: 18px 0 8px; padding: 18px 28px; border-radius: 16px; background: var(--petrol); color: #fff; }
.end .codebox b { display: block; font-size: 34px; letter-spacing: .12em; margin-top: 4px; }
.end .hint { background: var(--sky-3); padding: 16px; border-radius: 14px; margin-top: 18px; color: var(--ink-2); font-weight: 500; }
.end .meta { color: var(--ink-3); font-size: 13px; margin-top: 12px; }
.preview-bar { background: var(--warn-bg); color: var(--warn); text-align: center; padding: 8px; font-size: 13px; font-weight: 600; }
.hp { position: absolute; left: -5000px; height: 0; overflow: hidden; }

/* ===================================================================== Admin */
body.admin { background: var(--bg-admin); min-height: 100vh; font-size: 14px; }
.a-top { background: var(--petrol); color: #fff; }
.a-top-in { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; gap: 22px; padding: 0 20px; height: 62px; }
.a-top img { height: 32px; }
.a-top nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.a-top nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; color: rgba(255,255,255,.75); font-weight: 600; font-size: 13px; white-space: nowrap; }
.a-top nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.a-top nav a.on { color: var(--petrol); background: var(--sky); }
.a-top .who { font-size: 12px; color: rgba(255,255,255,.7); white-space: nowrap; }
.a-top .who a { color: var(--sky); margin-left: 8px; }
.a-main { max-width: 1440px; margin: 0 auto; padding: 24px 20px 80px; }
.a-main h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.01em; }
.a-main h2 { font-size: 17px; margin: 0 0 12px; }
.a-main h3 { font-size: 14px; margin: 0 0 8px; }
.a-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 18px; }
.panel.tight { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-decoration: none; display: block; }
a.kpi:hover { border-color: var(--petrol); }
.kpi .v { font-size: 28px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; margin-top: 4px; }
.kpi .s { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi.dark { background: var(--petrol); color: #fff; border-color: var(--petrol); }
.kpi.dark .s { color: rgba(255,255,255,.65); }
.flt { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.flt label { display: grid; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.flt select, .flt input, .fi { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: #fff; font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); min-width: 0; }
.fi { width: 100%; }
textarea.fi { min-height: 70px; }
.flt .grow { flex: 1 1 220px; }
.flt select { max-width: 280px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f8fbfc; position: sticky; top: 0; }
.t td { padding: 9px 12px; border-bottom: 1px solid #edf2f4; vertical-align: top; }
.t tr:hover td { background: #fafcfd; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t tr.clu td { background: var(--sky-3); font-weight: 700; font-size: 12px; color: var(--ink-2); }
.tbl-wrap { overflow-x: auto; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; background: #e8eef1; color: var(--ink-2); }
.badge.pre { background: #e1eff5; color: #1d5f7b; }
.badge.post { background: var(--petrol); color: #fff; }
.badge.paired { background: var(--ok-bg); color: var(--ok); }
.badge.pre_only { background: var(--warn-bg); color: var(--warn); }
.badge.post_only { background: var(--err-bg); color: var(--err); }
.badge.excl { background: #333; color: #fff; }
.badge.dup { background: #f1e7ff; color: #5b2a99; }
.badge.na { background: #f0f0f0; color: #666; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; white-space: pre-line; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }
.lownote { font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-bg); padding: 2px 7px; border-radius: 6px; }
.delta-pos { color: var(--ok); font-weight: 700; }
.delta-neg { color: var(--err); font-weight: 700; }
/* Balken */
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); margin: 0 0 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 38%) 1fr 92px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .lab { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.bar-track { position: relative; height: 16px; }
.bar-track.dual { height: 22px; display: grid; gap: 2px; }
.bar { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; background: var(--c-post); }
.bar.pre { background: var(--c-pre); }
.bar-track.dual .bar { height: 10px; }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.dist { display: flex; align-items: flex-end; gap: 3px; height: 80px; padding-top: 6px; }
.dist .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.dist .col span { width: 100%; background: var(--c-post); border-radius: 4px 4px 0 0; min-height: 1px; }
.dist.pre .col span { background: var(--c-pre); }
.dist-x { display: flex; gap: 3px; font-size: 11px; color: var(--ink-3); }
.dist-x span { flex: 1; text-align: center; }
.tl { display: flex; align-items: flex-end; gap: 2px; height: 90px; }
.tl .d { flex: 1; display: flex; gap: 1px; align-items: flex-end; height: 100%; min-width: 4px; }
.tl .d span { flex: 1; background: var(--c-post); border-radius: 2px 2px 0 0; }
.tl .d span.pre { background: var(--c-pre); }
.qcard { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.qcard .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.qcard p.qt { margin: 0 0 10px; font-weight: 600; }
.stats-line { font-size: 12px; color: var(--ink-2); margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
details summary { cursor: pointer; font-weight: 600; }
.answer-val { font-weight: 600; }
.answer-val.st-na, .answer-val.st-not_shown, .answer-val.st-optional_empty { color: var(--ink-3); font-weight: 400; font-style: italic; }
.cmp td.pre, .cmp td.post { width: 34%; }
.cmp td.post { background: #f7fbfc; }
.cmp .qtext { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.login-box { max-width: 400px; margin: 10vh auto; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tags label { display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; font-size: 12px; cursor: pointer; }
.tags label:has(input:checked) { background: var(--petrol); color: #fff; border-color: var(--petrol); }
.tags input { display: none; }
.code-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 600; letter-spacing: .03em; }
/* Editor */
.ed { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.ed-list { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.ed-page { margin-bottom: 10px; }
.ed-page-h { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 12px; color: var(--ink-2); padding: 6px 8px; background: var(--sky-3); border-radius: 8px; }
.ed-q { display: flex; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 12.5px; }
.ed-q:hover { background: #f1f6f8; }
.ed-q.on { background: var(--petrol); color: #fff; }
.ed-q .c { font-family: ui-monospace, Menlo, monospace; font-size: 11px; opacity: .75; flex: 0 0 auto; }
.ed-q .l { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ed-form { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px 14px; }
.ed-form .f { display: grid; gap: 4px; }
.ed-form .f > span { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.c12 { grid-column: span 12; } .c6 { grid-column: span 6; } .c4 { grid-column: span 4; } .c3 { grid-column: span 3; } .c8 { grid-column: span 8; } .c2 { grid-column: span 2; }
.ed-opts td { padding: 4px; }
.ed-opts input[type=text] { width: 100%; }
.ed-sec { grid-column: span 12; font-weight: 700; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.savebar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 10px; align-items: center; justify-content: space-between; margin: 18px -20px -20px; border-radius: 0 0 14px 14px; }
@media (max-width: 900px) { .ed { grid-template-columns: 1fr; } .ed-list { position: static; max-height: 300px; } .g2 { grid-template-columns: 1fr; }
  .c6, .c4, .c3, .c8, .c2 { grid-column: span 12; } }
