/* Einstufungstest Eumedica Grüezi Academy
   Layout: eine ruhige Spalte, max. 760px, Kopfzeile mit Fortschritt und Uhr; Aufgaben als Karten ohne Rahmenflut.
   Farben aus dem Academy-System (Teal), Ampelfarben nur für Zustände. */
:root {
  --bg: #FFFFFF; --bg2: #F3F6F7; --fg: #1A1A1A; --muted: #5A5A5E; --line: #E3E8EA;
  --teal: #0E7C8C; --teal-ink: #0A5C68; --teal-soft: #E3F1F3; --red: #FF0000;
  --ok: #2E9E5B; --warn: #E0A800; --bad: #D64545; --ok-soft: #E6F4EC; --warn-soft: #FBF3DC; --bad-soft: #F9E4E4;
  --f-body: "Inter", "Helvetica Neue", Arial, sans-serif; --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 14px; --shadow: 0 10px 30px rgba(14, 124, 140, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121617; --bg2: #1B2224; --fg: #F2F5F5; --muted: #A6B0B3; --line: #2B3538;
  --teal: #4FB6C4; --teal-ink: #8ED4DD; --teal-soft: #163238; --ok-soft: #173424; --warn-soft: #3A3115; --bad-soft: #3D1F1F;
  --shadow: 0 10px 30px rgba(0,0,0,.35); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #121617; --bg2: #1B2224; --fg: #F2F5F5; --muted: #A6B0B3; --line: #2B3538;
  --teal: #4FB6C4; --teal-ink: #8ED4DD; --teal-soft: #163238; --ok-soft: #173424; --warn-soft: #3A3115; --bad-soft: #3D1F1F;
  --shadow: 0 10px 30px rgba(0,0,0,.35); color-scheme: dark; }

html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
* { box-sizing: border-box; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

.kopf { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.kopf .innen { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding-block: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.marke { display: flex; align-items: baseline; gap: 8px; font-weight: 600; letter-spacing: .02em; }
.marke b { color: var(--teal); font-weight: 700; }
.marke .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); display: inline-block; margin-left: 2px; }
.marke span { color: var(--muted); font-weight: 500; font-size: 13px; }
.fort { flex: 1; display: flex; gap: 4px; min-width: 0; }
.fort i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); display: block; }
.fort i.erl { background: var(--teal); } .fort i.akt { background: var(--teal); opacity: .45; }
.uhr { font-family: var(--f-mono); font-size: 14px; color: var(--muted); min-width: 52px; text-align: right; }
.uhr.knapp { color: var(--warn); } .uhr.aus { color: var(--bad); }
.thema { font: 500 12px var(--f-body); padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); color: var(--muted); white-space: nowrap; }
.thema:hover { color: var(--fg); border-color: var(--teal); } .thema:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
@media (max-width: 560px) { #teilname { display: none; } }

main { max-width: 760px; margin: 0 auto; padding-block: 28px 80px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 22px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--teal); font-weight: 600; }
.lead { font-size: 17px; color: var(--muted); max-width: 62ch; }
.karte { background: var(--bg2); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; }
.karte.weiss { background: var(--bg); border: 1px solid var(--line); }
.anweisung { border-left: 3px solid var(--teal); padding: 6px 0 6px 14px; display: grid; gap: 6px; }
.anweisung p { max-width: 70ch; }
.anweisung .de { color: var(--muted); font-size: 14px; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.form .reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.feld { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); width: 100%; min-width: 0; }
.feld:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.check { display: flex !important; align-items: center; gap: 10px; font-weight: 400 !important; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); }
.info { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--teal); background: var(--bg); color: var(--teal-ink); font: 600 12px var(--f-body); padding: 0; line-height: 1; margin-left: 2px; }
.info:hover { background: var(--teal-soft); }
.infotext { font-size: 13.5px; color: var(--muted); margin: -6px 0 0 28px; max-width: 62ch; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--teal); background: var(--teal); color: #fff; font-weight: 500; transition: transform .15s, opacity .15s; }
.btn:hover { transform: translateY(-1px); } .btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn.ghost { background: transparent; color: var(--teal-ink); border-color: var(--line); }
.btn.klein { padding: 7px 12px; font-size: 14px; }
.aktionen { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.item { display: grid; gap: 14px; }
.item .satz { font-size: 20px; line-height: 1.45; }
.item .satz .luecke { display: inline-block; min-width: 3em; border-bottom: 2px solid var(--teal); }
.opts { display: grid; gap: 8px; }
.opt { text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); font-size: 16px; }
.opt:hover { border-color: var(--teal); } .opt[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); }
.opt.richtig { border-color: var(--ok); background: var(--ok-soft); } .opt.falsch { border-color: var(--bad); background: var(--bad-soft); }
.zaehler { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }

.szene { display: grid; gap: 12px; }
.player { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: 12px; background: var(--teal-soft); }
.player .welle { flex: 1; height: 28px; display: flex; align-items: center; gap: 3px; min-width: 80px; }
.player .welle i { width: 3px; height: 30%; background: var(--teal); border-radius: 2px; opacity: .5; }
.player.laeuft .welle i { animation: welle 1s ease-in-out infinite; }
.player.laeuft .welle i:nth-child(odd) { animation-delay: .2s; } .player.laeuft .welle i:nth-child(3n) { animation-delay: .4s; }
@keyframes welle { 0%,100% { height: 30%; } 50% { height: 100%; } }
@media (prefers-reduced-motion: reduce) { .player.laeuft .welle i { animation: none; height: 60%; } .btn:hover { transform: none; } }
.frage { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.frage b { font-weight: 500; }
.frage .reihe { display: flex; flex-wrap: wrap; gap: 8px; }
.frage .opt { flex: 1 1 160px; }

.lesetext { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; font-size: 15px; line-height: 1.6; white-space: pre-wrap; max-height: 44vh; overflow: auto; }
.lesetext.aushang { font-family: var(--f-body); background: #FFFDF5; color: #1A1A1A; border-color: #E6DCB8; }
.lesetext.bericht { font-family: var(--f-mono); font-size: 13.5px; }
.zuordnung { display: grid; gap: 8px; }
.zuordnung .zeile { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.zuordnung select { max-width: 120px; }
.antwortliste { display: grid; gap: 4px; font-size: 14px; }
.antwortliste span.weg { color: var(--muted); text-decoration: line-through; }

textarea.feld { min-height: 200px; resize: vertical; line-height: 1.55; }
.wortzahl { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.wortzahl.ok { color: var(--ok); }

.gespraech { display: grid; gap: 12px; }
.sprech { display: grid; gap: 10px; max-height: 46vh; overflow: auto; padding-right: 4px; }
.blase { padding: 10px 14px; border-radius: 14px; max-width: 85%; font-size: 15px; }
.blase.tut { background: var(--teal-soft); justify-self: start; border-bottom-left-radius: 4px; }
.blase.ich { background: var(--bg); border: 1px solid var(--line); justify-self: end; border-bottom-right-radius: 4px; }
.blase.sys { background: transparent; color: var(--muted); font-size: 13px; justify-self: center; }
.blase small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.patkarte { border: 1px dashed var(--teal); border-radius: 12px; padding: 14px 16px; font-family: var(--f-mono); font-size: 13.5px; line-height: 1.6; background: var(--bg); }
.mikro { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mikro .punkt { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.mikro.hoert .punkt { background: var(--bad); box-shadow: 0 0 0 6px var(--bad-soft); }
.mikro.spricht .punkt { background: var(--teal); }

.pause { text-align: center; display: grid; gap: 14px; justify-items: center; padding-block: 20px; }
.ergebnis { display: grid; gap: 18px; }
.gross { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.gross b { font-size: 44px; line-height: 1; color: var(--teal); letter-spacing: -.02em; }
.balken { display: grid; gap: 10px; }
.balken .z { display: grid; grid-template-columns: 170px 1fr 70px; gap: 12px; align-items: center; font-size: 14px; }
.balken .spur { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.balken .spur i { display: block; height: 100%; background: var(--teal); border-radius: 5px; }
@media (max-width: 480px) { .balken .z { grid-template-columns: 1fr 70px; } .balken .z .spur { grid-column: 1 / -1; } }
.ampeln { display: grid; gap: 8px; }
.ampel { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.ampel .l { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.ampel .l.gruen { background: var(--ok); } .ampel .l.gelb { background: var(--warn); } .ampel .l.rot { background: var(--bad); } .ampel .l.grau { background: var(--line); }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--teal-soft); color: var(--teal-ink); }
.pill.warn { background: var(--warn-soft); color: #7A5A00; } .pill.bad { background: var(--bad-soft); color: #8A2323; } .pill.ok { background: var(--ok-soft); color: #1E6B3C; }
:root[data-theme="dark"] .pill.warn, :root[data-theme="dark"] .pill.bad, :root[data-theme="dark"] .pill.ok { color: var(--fg); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs button[aria-selected="true"] { color: var(--teal-ink); border-bottom-color: var(--teal); }
.profiltext { white-space: pre-wrap; line-height: 1.6; max-width: 68ch; }
.cockpit { display: grid; gap: 12px; }
.cockpit .kopfz { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.cockpit .niv { display: flex; gap: 6px; flex-wrap: wrap; }
.cockpit .niv span { padding: 6px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; }
.cockpit .niv span b { display: block; font-size: 15px; color: var(--teal-ink); }
.lehr { font-size: 13.5px; }
.lehr table { width: 100%; border-collapse: collapse; }
.lehr th, .lehr td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.lehr th { color: var(--muted); font-weight: 500; }
.tabelle { overflow-x: auto; }
pre.json { font-family: var(--f-mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0; }
.hinweis { padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); font-size: 14px; }
.hinweis.ok { background: var(--ok-soft); } .hinweis.bad { background: var(--bad-soft); }
.fuss { color: var(--muted); font-size: 13px; }

/* Warteanzeige während der Auswertung */
.warte { text-align: center; justify-items: center; }
.ekg { width: 100%; max-width: 420px; height: 70px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 25%, #000 85%, transparent); }
.ekg svg { width: 150%; height: 100%; display: block; animation: ekg-lauf 1.6s linear infinite; }
.ekg path { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
@keyframes ekg-lauf { from { transform: translateX(0); } to { transform: translateX(-33.333%); } }
.ekg-satz { font-weight: 600; color: var(--teal-ink); margin: 0; min-height: 1.6em; }
.warte-bitte { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--teal-soft); max-width: 46ch; }
.warte.fertig .ekg svg { animation: none; opacity: 0; transition: opacity .3s; }
.warte.fertig .ekg { position: relative; }
.warte.fertig .ekg::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 44px; color: var(--ok); animation: ekg-haken .4s ease-out; }
@keyframes ekg-haken { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ekg svg { animation-duration: 6s; } }
/* Teil 6: Risikosituationen und Grüezi-Index, eigens gekennzeichnet */
:root { --risiko: #B4471F; --risiko-soft: #FBEDE6; }
:root[data-theme="dark"] { --risiko: #F0875E; --risiko-soft: #3A2219; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --risiko: #F0875E; --risiko-soft: #3A2219; } }
.risikomarke { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--risiko-soft); color: var(--risiko); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.risikomarke::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--risiko); }
.karte.risiko { border-left: 4px solid var(--risiko); }
.fort i.risiko { box-shadow: inset 0 0 0 1px var(--risiko); } .fort i.risiko.akt, .fort i.risiko.erl { background: var(--risiko); }
.indexkarte { display: grid; gap: 10px; }
.indexkarte .kopfz { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.indexkarte .gross b { color: var(--risiko); }
.indexkarte.stufe-gruen .gross b { color: var(--ok); }
.akutuhr { font-size: 44px; font-weight: 700; color: var(--risiko); margin: 6px 0; }
.akutuhr.knapp { color: var(--bad); }
.antwort { display: grid; gap: 8px; }
