:root {
  --bg: #f4f4f6; --card: #fff; --ink: #1f2937; --muted: #6b7280; --line: #e5e7eb;
  --brand: #7a1f2b; --brand-ink: #fff; --accent: #2563eb;
  --low: #dc2626; --mid: #d97706; --high: #16a34a;
  --sel: #fdf2f3; --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14141a; --card: #1e1e26; --ink: #e7e7ee; --muted: #9a9aa8; --line: #33333f;
    --brand: #c4505e; --sel: #2a1c20; --accent: #6ea0ff;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 "Segoe UI", system-ui, sans-serif; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.top { background: #7a1f2b; color: #fff; }
.top-in { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; }
.brand span { font-weight: 400; opacity: .85; }
.tag { font-size: 13px; opacity: .85; }
h1 { font-size: 28px; margin: 24px 0 8px; }
h2 { font-size: 20px; margin: 0 0 4px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); flex: 1 1 220px; }
input[type=text], input[type=email], select {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink);
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 11px 20px; cursor: pointer; background: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; justify-content: space-between; gap: 12px; margin: 20px 0 40px; flex-wrap: wrap; }

/* Stepper */
.steps { display: flex; gap: 6px; margin: 20px 0 8px; list-style: none; padding: 0; }
.steps li { flex: 1; text-align: center; font-size: 13px; color: var(--muted); }
.steps .dot { display: flex; margin: 0 auto 4px; width: 28px; height: 28px; border-radius: 50%; background: var(--line); color: var(--muted); align-items: center; justify-content: center; font-weight: 700; }
.steps .on .dot { background: var(--brand); color: #fff; }
.steps .done .dot { background: var(--high); color: #fff; }
.steps .on { color: var(--ink); font-weight: 600; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.bar > i { display: block; height: 100%; background: var(--brand); transition: width .3s; }
@media (max-width: 640px) { .steps li span.lbl { display: none; } }

/* Fragen */
/* Eine Frage pro Bildschirm */
.qwrap { max-width: 780px; margin: 0 auto; }
.q-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 20px 0 8px; }
.q-dim { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.q-count { font-size: 14px; color: var(--muted); }
.seg { display: flex; gap: 4px; margin-bottom: 18px; }
.seg i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.seg i.done { background: var(--brand); }
.seg i.on { background: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.q-intro { margin: 0 0 14px; }
.q-single { padding: 28px 28px 24px; margin: 0 0 8px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05); }
.q-single fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q-text { float: left; width: 100%; padding: 0; margin: 0 0 8px; font-size: 22px; line-height: 1.35; font-weight: 700; outline: none; }
.q-single .info-btn, .q-single .info-box, .q-single .choices { clear: both; }
.choices { display: grid; gap: 10px; margin-top: 14px; }
.choice { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 52px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; line-height: 1.35; transition: border-color .12s, background .12s, transform .12s; }
.choice:hover { border-color: var(--brand); }
.choice:active { transform: scale(.995); }
.choice input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.choice.picked { background: var(--sel); border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; font-weight: 600; }
.choice:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice.skip { min-height: 44px; border-style: dashed; color: var(--muted); font-size: 15px; }
.qwrap .actions { margin-top: 18px; }
.intro-box { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .intro-box { grid-template-columns: 1fr; } }
.badge { display: inline-block; font-size: 12px; background: var(--sel); color: var(--brand); border: 1px solid var(--brand); border-radius: 99px; padding: 1px 8px; margin-left: 8px; vertical-align: middle; }
.msg { padding: 10px 14px; border-radius: 8px; background: var(--sel); border: 1px solid var(--brand); margin: 12px 0; }
.msg.err { border-color: var(--low); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.checks label { display: flex; gap: 8px; align-items: center; font-size: 14px; }

/* Responsiv: Handy, Tablet, Desktop */
html { -webkit-text-size-adjust: 100%; }
body { overflow-wrap: anywhere; }
.top-in, .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
img, canvas, svg { max-width: 100%; }
.charts canvas { width: 100% !important; height: auto !important; max-height: 420px; }
.btn, details.dim > summary, .faq summary, .info-btn, input[type=text], input[type=email], select { min-height: 44px; }
details.dim > summary, .faq summary { align-items: center; padding: 4px 0; }
.faq summary { display: flex; align-items: center; }
.info-btn { padding: 8px 0; }
.facts, .provs { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.checks { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.stats { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
@media (max-width: 760px) {
  h1 { font-size: 24px; }
  .card { padding: 16px; }
  .q-single { padding: 20px 16px 16px; }
  .q-text { font-size: 19px; }
}
@media (max-width: 640px) {
  .facts, .provs, .stats, .checks, .intro-box, .two, .charts { grid-template-columns: minmax(0, 1fr); }
  .fact, .prov, .stat, .card { min-width: 0; }
}
@media (max-width: 520px) {
  .actions, .row { flex-direction: column; align-items: stretch; }
  .actions .btn, .row .btn { width: 100%; text-align: center; }
  .dimhead, .item-head { flex-wrap: wrap; }
  .gauge { width: 170px; height: 170px; }
  .gauge > div { width: 136px; height: 136px; }
  .gauge b { font-size: 34px; }
  .stat b { font-size: 28px; }
  .top-in { gap: 8px; }
  .tag { font-size: 12px; text-align: right; }
}
@media (hover: none) { .choice:hover { border-color: var(--line); } .choice.picked:hover { border-color: var(--brand); } }

/* Info-Box zu den Fragen */
.info-btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; color: var(--accent); background: none; border: 0; padding: 4px 0; margin: 0 0 10px; cursor: pointer; }
.info-btn .i { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; font: italic 700 13px Georgia, serif; }
.info-btn:hover { text-decoration: underline; }
.info-box { background: var(--sel); border-left: 4px solid var(--brand); border-radius: 8px; padding: 12px 14px; margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.info-box[hidden] { display: none; }
.impulse { border-left: 6px solid var(--brand); background: var(--sel); }
.impulse h2 { margin-bottom: 8px; }
.impulse p { margin: 8px 0; }
.impulse small { color: var(--muted); }

/* SEO-Bereich (FAQ) */
.about[hidden] { display: none; }
.about { margin-top: 8px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 8px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; color: var(--muted); }

/* Ergebnis: Details */
.aitext p { margin: 4px 0; }
.aihead { display: block; margin-top: 12px; color: var(--brand); }
a { color: var(--accent); }
.btn { text-decoration: none; display: inline-block; }
details.dim { border-top: 1px solid var(--line); padding: 12px 0; }
details.dim:first-of-type { border-top: 0; }
details.dim > summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 600; list-style: none; }
details.dim > summary::-webkit-details-marker { display: none; }
details.dim > summary::before { content: "▸"; margin-right: 8px; color: var(--muted); transition: transform .15s; }
details.dim[open] > summary::before { transform: rotate(90deg); display: inline-block; }
.dim-title { flex: 1; }
.advice { margin: 8px 0; }
.items { display: grid; gap: 10px; margin: 12px 0; }
.item { background: var(--bg); border-radius: 8px; padding: 12px 14px; }
.item-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.pill { color: #fff; border-radius: 99px; padding: 1px 9px; font-size: 12px; font-weight: 700; }
.meter.sm { height: 6px; margin: 6px 0; }
.status, .tip { margin: 6px 0 0; font-size: 14px; }
.tip { border-left: 3px solid var(--brand); padding-left: 10px; }
.levs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.lev { border-left: 4px solid var(--low); background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.lev.good { border-left-color: var(--high); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.stat { background: var(--bg); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 34px; line-height: 1.1; color: var(--brand); }
.stat a, .fact a { font-size: 13px; }
.road { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.road li { border-left: 4px solid var(--brand); padding: 4px 0 4px 14px; }
.road p { margin: 4px 0 0; }
.when { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 10px; }
.fact { background: var(--bg); border-radius: 10px; padding: 14px 16px; }
.fact p { margin: 6px 0; font-size: 14px; }
.provs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 10px; }
.prov { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.prov.rec { border-color: var(--brand); background: var(--sel); }
.prov h3 { margin: 6px 0 2px; }
@media print { details.dim > :not(summary) { display: block !important; } }

/* Ergebnis */
.hero { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: center; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; text-align: center; } }
.gauge { width: 200px; height: 200px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); }
.gauge > div { width: 160px; height: 160px; border-radius: 50%; background: var(--card); display: grid; place-items: center; text-align: center; }
.gauge b { font-size: 40px; line-height: 1; display: block; }
.gauge small { color: var(--muted); }
.lvl { font-size: 22px; font-weight: 700; }
.stages { display: flex; gap: 4px; margin: 12px 0; }
.stages i { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.stages i.on { background: var(--brand); }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: center; }
@media (max-width: 760px) { .charts { grid-template-columns: 1fr; } }
.dimrow { padding: 14px 0; border-bottom: 1px solid var(--line); }
.dimrow:last-child { border: 0; }
.dimhead { display: flex; justify-content: space-between; font-weight: 600; gap: 12px; }
.meter { height: 12px; background: var(--line); border-radius: 6px; margin: 8px 0; position: relative; }
.meter > i { display: block; height: 100%; border-radius: 6px; }
.meter > u { position: absolute; top: -3px; width: 3px; height: 18px; background: var(--ink); border-radius: 2px; }
.muted { color: var(--muted); font-size: 14px; }
ul.list { margin: 8px 0 0; padding-left: 20px; }
ul.list li { margin: 4px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.foot { color: var(--muted); font-size: 13px; padding-bottom: 40px; }
.foot a { color: inherit; }
.code { font-family: Consolas, monospace; font-weight: 700; letter-spacing: .05em; }

@media (max-width: 400px) {
  .brand { font-size: 17px; white-space: nowrap; }
  .tag { font-size: 11px; white-space: nowrap; }
}

/* Kleine Bildschirme: am Dateiende, damit diese Regeln die Raster-Definitionen oben überschreiben */
@media (max-width: 640px) {
  .facts, .provs, .stats, .checks, .intro-box, .two, .charts, .hero { grid-template-columns: minmax(0, 1fr); }
  .fact, .prov, .stat, .card { min-width: 0; }
}

@media print {
  .top, .foot, .actions, .noprint { display: none !important; }
  body { background: #fff; color: #000; }
  .card { break-inside: avoid; }
}
