/* Gestaltung aus docs/prototype.html */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --bg: #EDF0F4;
  --surface: #FFFFFF;
  --line: #D3D9E2;
  --ink: #1A2331;
  --muted: #586274;
  --accent: #3347C9;
  --accent-ink: #FFFFFF;
  --accent-soft: #E2E6FA;
  --mark: #D99A2B;
  --mark-soft: #F7E8CC;
  --warn: #A3401F;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151C; --surface: #19202A; --line: #2B3443; --ink: #E5E9F0; --muted: #9CA6B6;
    --accent: #8C9BFF; --accent-ink: #10142A; --accent-soft: #252D52; --mark: #F0B656; --mark-soft: #3A2F1A; --warn: #F08A66;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11151C; --surface: #19202A; --line: #2B3443; --ink: #E5E9F0; --muted: #9CA6B6;
  --accent: #8C9BFF; --accent-ink: #10142A; --accent-soft: #252D52; --mark: #F0B656; --mark-soft: #3A2F1A; --warn: #F08A66;
  color-scheme: dark;
}
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 48px;
}
.app { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; line-height: 1.15; }
h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.eyebrow { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand span { font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.chip { font-size: 0.75rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); white-space: nowrap; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .3s ease; }
.progress-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.statement { font-family: var(--display); font-size: clamp(1.35rem, 4.4vw, 1.75rem); font-weight: 500; line-height: 1.3; text-wrap: pretty; min-height: 3.9em; }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; min-width: 0;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px; cursor: pointer;
  font: inherit; font-size: 0.78rem; line-height: 1.25; text-align: center;
}
.scale button b { font-family: var(--display); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.scale button:hover { border-color: var(--accent); }
.scale button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (max-width: 520px) {
  .scale { grid-template-columns: 1fr; }
  .scale button { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 14px; font-size: 0.9rem; text-align: left; }
  .scale button b { width: 1.2em; }
}

.voicebar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mic {
  width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface); color: var(--accent);
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.mic svg { width: 26px; height: 26px; }
.mic.live { background: var(--accent); color: var(--accent-ink); animation: pulse 1.6s ease-in-out infinite; }
.mic:disabled { opacity: .4; cursor: not-allowed; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .mic.live { animation: none; } .progress > div { transition: none; } }
.voicetext { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
.voicetext strong { font-weight: 600; }
.live { color: var(--muted); font-style: italic; min-height: 1.4em; overflow-wrap: anywhere; }
.heard { font-size: 0.9rem; padding: 8px 12px; border-radius: 8px; background: var(--mark-soft); color: var(--ink); overflow-wrap: anywhere; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.btn {
  font: inherit; font-weight: 600; font-size: 0.92rem; padding: 10px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); padding-inline: 8px; }
.btn.quiet:hover { color: var(--ink); }
.btn.danger { color: var(--warn); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, textarea:focus-visible, input:focus-visible, label.toggle:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

label.toggle { display: inline-flex; gap: 8px; align-items: center; font-size: 0.88rem; cursor: pointer; border-radius: 6px; }
label.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

textarea {
  width: 100%; min-height: 150px; resize: vertical; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-sizing: border-box;
}

.intro { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center; }
.intro svg { width: 100%; height: auto; max-width: 200px; }
@media (max-width: 560px) { .intro { grid-template-columns: 1fr; } .intro svg { max-width: 170px; margin: 0 auto; } }
.steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; counter-increment: s; }
.steps li::before { content: counter(s); font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 1.1rem; }
.phrases { display: flex; flex-wrap: wrap; gap: 6px; }
.phrases span { font-size: 0.8rem; padding: 3px 9px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.phrases span b { font-variant-numeric: tabular-nums; color: var(--accent); margin-right: 4px; }
.notice { font-size: 0.88rem; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); }
.notice.warn { color: var(--warn); }

.result-head { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.bignum { font-family: var(--display); font-weight: 700; font-size: 5rem; line-height: 0.9; color: var(--mark); font-variant-numeric: tabular-nums; }
.result-head .meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.conf { align-self: flex-start; font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.figure-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center; }
.figure-wrap svg { width: 100%; max-width: 220px; height: auto; }
@media (max-width: 560px) { .figure-wrap { grid-template-columns: 1fr; } .figure-wrap svg { margin: 0 auto; } }
.bars { display: grid; gap: 6px; font-variant-numeric: tabular-nums; }
.bar { display: grid; grid-template-columns: 1.4em 1fr 2.6em; gap: 8px; align-items: center; font-size: 0.85rem; }
.bar .track { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); }
.bar.top .fill { background: var(--mark); }
.bar .num { text-align: right; color: var(--muted); }
.reasons { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.reasons blockquote { margin: 0 0 4px; padding-left: 12px; border-left: 3px solid var(--mark); font-style: italic; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.fig-circle { fill: none; stroke: var(--line); stroke-width: 1.5; }
.fig-line { fill: none; stroke: var(--muted); stroke-width: 1; opacity: .55; }
.fig-dot { fill: var(--accent); }
.fig-dot.top { fill: var(--mark); }
.fig-dot.idle { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
.fig-label { fill: var(--ink); font-family: var(--display); font-weight: 700; font-size: 15px; text-anchor: middle; dominant-baseline: central; }
.fig-label.top { fill: var(--mark); }

.top-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn.small { padding: 5px 12px; font-size: 0.8rem; }
.savebox { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
label.check { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; font-size: 0.9rem; cursor: pointer; }
label.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.ovlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ovlist details { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.ovlist summary { cursor: pointer; padding: 12px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ovlist .t { font-family: var(--display); font-weight: 700; color: var(--mark); font-variant-numeric: tabular-nums; min-width: 2.4em; }
.ovlist .who { font-weight: 600; flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
.ovlist .body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.qa { margin: 0; font-size: 0.9rem; }
.qa dt { font-weight: 600; }
.qa dd { margin: 0 0 10px; overflow-wrap: anywhere; white-space: pre-wrap; }
.loginbox { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.loginbox code { font-size: 0.82rem; overflow-wrap: anywhere; user-select: all; }
a.btn { text-decoration: none; display: inline-block; }

/* ---- Ergänzungen zur Vorlage (keine Inline-Styles wegen CSP) ---- */
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stack-xs { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
a { color: var(--accent); }
.brand { color: inherit; text-decoration: none; }
.meter { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--accent); transition: width .08s linear; }
.meter.hit > div { background: var(--mark); }
@media (prefers-reduced-motion: reduce) { .meter > div { transition: none; } }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; }
.field input[type="text"], .field input[type="email"] {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; width: 100%; box-sizing: border-box;
}
.linkbox { border: 1px solid var(--mark); background: var(--mark-soft); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.linkbox .link { font-family: var(--display); font-weight: 700; font-size: 1.15rem; overflow-wrap: anywhere; word-break: break-all; user-select: all; color: var(--ink); }
.saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.9rem; }
