@font-face { font-family: 'Newsreader'; src: url('/fonts/newsreader-latin-opsz-normal.woff2') format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; 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: 'Newsreader'; src: url('/fonts/newsreader-latin-ext-opsz-normal.woff2') format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; 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; }
@font-face { font-family: 'Newsreader'; src: url('/fonts/newsreader-latin-opsz-italic.woff2') format('woff2'); font-weight: 200 800; font-style: italic; font-display: swap; 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: 'Newsreader'; src: url('/fonts/newsreader-latin-ext-opsz-italic.woff2') format('woff2'); font-weight: 200 800; font-style: italic; font-display: swap; 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; }
@font-face { font-family: 'Geist'; src: url('/fonts/geist-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; 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: 'Geist'; src: url('/fonts/geist-latin-ext-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; 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; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/geist-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --surface-2: #FBFBFA;
  --ink: #23262B;
  --ink-2: #4A4D52;
  --muted: #787774;
  --line: #E8E6E1;
  --line-2: #DAD7D0;
  --btn: #1E2024;
  --btn-ink: #FFFFFF;
  --ok-bg: #EDF3EC; --ok: #346538;
  --bad-bg: #FDEBEC; --bad: #9F2F2D;
  --warn-bg: #FBF3DB; --warn: #956400;
  --hl: rgba(240, 196, 70, 0.36);
  --shadow: 0 1px 2px rgba(20, 20, 15, 0.03), 0 4px 18px rgba(20, 20, 15, 0.035);
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Geist', -apple-system, 'Helvetica Neue', 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --r: 10px;
  --r-s: 6px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;

  /* Modulfarben: Fläche / Schrift / Punkt */
  --salbei-bg: #EDF3EC; --salbei: #346538; --salbei-dot: #7FA77F;
  --ton-bg: #F8ECE6; --ton: #9A4A2E; --ton-dot: #D08B6D;
  --schiefer-bg: #E9EEF4; --schiefer: #3A5470; --schiefer-dot: #7F96B2;
  --ocker-bg: #FBF3DB; --ocker: #865D00; --ocker-dot: #D6A93E;
  --pflaume-bg: #F4EAF1; --pflaume: #7A3E6A; --pflaume-dot: #B784A9;
  --moos-bg: #EEF1E4; --moos: #56622A; --moos-dot: #9AA764;
  --see-bg: #E1F0FA; --see: #1F6C9F; --see-dot: #6FA8D0;
  --sand-bg: #F4EFE6; --sand: #7A6346; --sand-dot: #BFA683;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) {
    --bg: #151514; --surface: #1D1D1B; --surface-2: #1A1A18; --ink: #ECEAE4; --ink-2: #C9C6BF; --muted: #96948E;
    --line: #2B2A27; --line-2: #3A3935; --btn: #ECEAE4; --btn-ink: #151514;
    --ok-bg: #1D2B1F; --ok: #8FC394; --bad-bg: #331D1D; --bad: #E8918E; --warn-bg: #2F2814; --warn: #DDB15C;
    --hl: rgba(240, 196, 70, 0.28); --shadow: none; color-scheme: dark;
    --salbei-bg: #1E2A20; --salbei: #9CC79F; --ton-bg: #2E211B; --ton: #E2A286; --schiefer-bg: #1C2430; --schiefer: #A3B9D3;
    --ocker-bg: #2C2615; --ocker: #E0BC69; --pflaume-bg: #2B1E28; --pflaume: #D6A7CA; --moos-bg: #23271A; --moos: #BAC686;
    --see-bg: #16263A; --see: #8DC0E6; --sand-bg: #29241D; --sand: #D4BE9C;
  }
}
:root[data-theme="dunkel"] {
  --bg: #151514; --surface: #1D1D1B; --surface-2: #1A1A18; --ink: #ECEAE4; --ink-2: #C9C6BF; --muted: #96948E;
  --line: #2B2A27; --line-2: #3A3935; --btn: #ECEAE4; --btn-ink: #151514;
  --ok-bg: #1D2B1F; --ok: #8FC394; --bad-bg: #331D1D; --bad: #E8918E; --warn-bg: #2F2814; --warn: #DDB15C;
  --hl: rgba(240, 196, 70, 0.28); --shadow: none; color-scheme: dark;
  --salbei-bg: #1E2A20; --salbei: #9CC79F; --ton-bg: #2E211B; --ton: #E2A286; --schiefer-bg: #1C2430; --schiefer: #A3B9D3;
  --ocker-bg: #2C2615; --ocker: #E0BC69; --pflaume-bg: #2B1E28; --pflaume: #D6A7CA; --moos-bg: #23271A; --moos: #BAC686;
  --see-bg: #16263A; --see: #8DC0E6; --sand-bg: #29241D; --sand: #D4BE9C;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--hl); }

.ic { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.16em; }

/* ---------- Grundgerüst ---------- */
#app { max-width: 640px; margin: 0 auto; padding: calc(var(--safe-t) + 20px) 18px calc(96px + var(--safe-b)); }
.ansicht { animation: rein 420ms var(--ease) both; }
@keyframes rein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; gap: 4px;
  padding: 8px 12px calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; max-width: 150px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border-radius: var(--r-s); text-decoration: none; color: var(--muted); font-size: 12px; letter-spacing: 0.01em;
}
.tabbar a .ic { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar .punkt { position: absolute; margin-left: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--ton-dot); }

.kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; min-height: 36px; }
.meta { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
h1 { font-size: 34px; margin: 6px 0 6px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
.leise { color: var(--muted); }
.klein { font-size: 14px; }
.abschnitt { margin-top: 30px; }
.abschnitt > h2, .abschnitt > .meta { margin-bottom: 12px; }

.iconbtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-s);
  border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none;
}
.iconbtn:hover { background: var(--surface); border-color: var(--line); }
.iconbtn .ic { width: 20px; height: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-s); border: 1px solid var(--btn);
  background: var(--btn); color: var(--btn-ink); font-weight: 500; font-size: 15.5px; cursor: pointer; text-decoration: none;
  transition: transform 120ms ease, opacity 120ms ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.35; cursor: default; transform: none; }
.btn.zweit { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.leicht { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn.breit { width: 100%; }
.btn.klein { min-height: 38px; padding: 0 14px; font-size: 14px; }
.linkbtn { background: none; border: 0; padding: 6px 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }

.karte {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px;
}
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tag.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.tag.neu { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }

/* Modulfarben */
.f-salbei { --m-bg: var(--salbei-bg); --m: var(--salbei); --m-dot: var(--salbei-dot); }
.f-ton { --m-bg: var(--ton-bg); --m: var(--ton); --m-dot: var(--ton-dot); }
.f-schiefer { --m-bg: var(--schiefer-bg); --m: var(--schiefer); --m-dot: var(--schiefer-dot); }
.f-ocker { --m-bg: var(--ocker-bg); --m: var(--ocker); --m-dot: var(--ocker-dot); }
.f-pflaume { --m-bg: var(--pflaume-bg); --m: var(--pflaume); --m-dot: var(--pflaume-dot); }
.f-moos { --m-bg: var(--moos-bg); --m: var(--moos); --m-dot: var(--moos-dot); }
.f-see { --m-bg: var(--see-bg); --m: var(--see); --m-dot: var(--see-dot); }
.f-sand { --m-bg: var(--sand-bg); --m: var(--sand); --m-dot: var(--sand-dot); }
.mtag { background: var(--m-bg); color: var(--m); border-color: transparent; }
.mdot { background: var(--m-dot); }

/* ---------- Heute ---------- */
.gruss { margin-top: 4px; }
.aktivitaet { display: grid; grid-template-columns: repeat(28, 1fr); gap: 3px; margin: 18px 0 6px; max-width: 420px; }
.aktivitaet i { aspect-ratio: 1; border-radius: 2px; background: var(--line); display: block; }
.aktivitaet i.s1 { background: color-mix(in srgb, var(--salbei-dot) 55%, var(--line)); }
.aktivitaet i.s2 { background: var(--salbei-dot); }
.aktivitaet i.s3 { background: var(--salbei); }
.aktivitaet i.heute { outline: 1.5px solid var(--ink-2); outline-offset: 1px; }

.modulliste { display: grid; gap: 12px; }
.modulkarte { display: block; text-decoration: none; position: relative; transition: border-color 160ms ease, box-shadow 200ms ease; }
.modulkarte:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.modulkarte .zeile1 { display: flex; align-items: center; gap: 10px; }
.modulkarte .name { font-family: var(--serif); font-size: 21px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; flex: 1; }
.modulkarte .plan { margin: 6px 0 14px; color: var(--ink-2); font-size: 14.5px; }
.modulkarte .fuss { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modulkarte.erledigt .name { color: var(--ink-2); }
.balken { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: var(--line); flex: 1; max-width: 240px; }
.balken b { display: block; height: 100%; }
.balken .fest { background: var(--m, var(--salbei)); }
.balken .aufbau { background: var(--m-dot, var(--salbei-dot)); opacity: 0.55; }
.fertig { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-size: 14px; font-weight: 500; }
.leer { text-align: center; padding: 48px 12px; }
.leer h2 { margin-bottom: 8px; }
.leer p { color: var(--muted); max-width: 380px; margin: 0 auto 20px; }
code, kbd { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }

/* ---------- Listen ---------- */
.liste { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.liste > li { border-bottom: 1px solid var(--line); }
.liste a, .liste button.zeile {
  display: flex; align-items: center; gap: 12px; padding: 14px 2px; text-decoration: none; width: 100%;
  background: none; border: 0; text-align: left; cursor: pointer;
}
.liste .haupt { flex: 1; min-width: 0; }
.liste .titel { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.liste .unter { display: block; color: var(--muted); font-size: 13.5px; margin-top: 1px; }
.liste .nr { font-family: var(--mono); color: var(--muted); font-size: 13px; width: 30px; flex: none; }
.liste .ic.pfeil { color: var(--line-2); }
.itemzeile .vorschau { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; line-height: 1.4; }
.typicon { width: 30px; height: 30px; border-radius: var(--r-s); display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); flex: none; color: var(--ink-2); }
.typicon .ic { width: 16px; height: 16px; }

.kennzahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.kennzahlen > div { padding: 14px 14px 12px; }
.kennzahlen > div + div { border-left: 1px solid var(--line); }
.kennzahlen .zahl { font-family: var(--serif); font-size: 28px; line-height: 1; letter-spacing: -0.02em; }
.kennzahlen .was { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.formzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.formzeile label { font-weight: 500; }
.formzeile .hilfe { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
input[type="date"], input[type="text"], input[type="password"], select, textarea, .eingabe {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 10px 12px; min-height: 44px; font-size: 16px;
  outline: none; transition: border-color 140ms ease, box-shadow 140ms ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent); }
textarea { width: 100%; min-height: 96px; resize: vertical; line-height: 1.5; }

/* ---------- Login ---------- */
.login { min-height: calc(100dvh - 120px); display: flex; flex-direction: column; justify-content: center; max-width: 360px; margin: 0 auto; }
.login h1 { font-size: 44px; }
.login form { display: grid; gap: 12px; margin-top: 28px; }
.login input { width: 100%; }
.marke { display: inline-flex; align-items: center; gap: 10px; }
.marke svg { width: 30px; height: 30px; }
.fehler { color: var(--bad); font-size: 14px; min-height: 1.2em; }

/* ---------- Lernen ---------- */
body.lernmodus .tabbar { display: none; }
body.lernmodus #app { padding-bottom: 24px; }
.lernkopf { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: calc(var(--safe-t) + 6px) 0 10px; margin-top: calc(-1 * var(--safe-t) - 20px); }
.lernkopf .zeile { display: flex; align-items: center; gap: 10px; }
.lernkopf .modulname { flex: 1; font-size: 14px; color: var(--ink-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lernkopf .zaehler { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.fortschritt { display: flex; gap: 3px; margin-top: 8px; }
.fortschritt i { flex: 1; height: 3px; border-radius: 2px; background: var(--line); transition: background 300ms ease; }
.fortschritt i.ok { background: var(--m, var(--salbei)); }
.fortschritt i.nochmal { background: var(--warn); opacity: 0.6; }
.fortschritt i.jetzt { background: var(--ink-2); }

.aufgabe { padding-top: 10px; min-height: calc(100dvh - 230px); display: flex; flex-direction: column; }
.aufgabe .oben { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.aufgabe .thema { font-size: 13px; color: var(--muted); }
.frage { font-family: var(--serif); font-size: 22px; line-height: 1.38; letter-spacing: -0.008em; font-weight: 450; }
.frage p { margin: 0 0 0.6em; }
.frage p:last-child { margin-bottom: 0; }
.text { font-size: 16.5px; line-height: 1.62; }
.text p { margin: 0 0 0.75em; }
.text p:last-child { margin-bottom: 0; }
.text ul, .text ol, .frage ul, .frage ol { padding-left: 1.3em; margin: 0.4em 0 0.8em; }
.text li { margin: 0.2em 0; }
.md table { border-collapse: collapse; font-size: 14px; margin: 0.6em 0; display: block; overflow-x: auto; font-family: var(--sans); }
.md th, .md td { border: 1px solid var(--line-2); padding: 4px 8px; text-align: left; }
.md th { background: var(--surface-2); font-weight: 600; }
.md blockquote { margin: 0.5em 0; padding-left: 12px; border-left: 2px solid var(--line-2); color: var(--ink-2); }
.katex { font-size: 1.04em; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

.hinweis { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.optionen { display: grid; gap: 10px; margin-top: 22px; }
.option {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  padding: 14px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font-size: 16px; line-height: 1.45; transition: border-color 140ms ease, background 140ms ease;
}
.option .buchstabe { font-family: var(--mono); font-size: 12.5px; width: 24px; height: 24px; border-radius: 5px; border: 1px solid var(--line-2); display: grid; place-items: center; flex: none; color: var(--muted); margin-top: 1px; }
.option[aria-pressed="true"] { border-color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--ink-2); }
.option[aria-pressed="true"] .buchstabe { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.option.richtig { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 40%, transparent); box-shadow: none; }
.option.richtig .buchstabe { background: var(--ok); color: var(--surface); border-color: var(--ok); }
.option.falsch { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, transparent); box-shadow: none; }
.option.falsch .buchstabe { background: var(--bad); color: var(--surface); border-color: var(--bad); }
.option.verpasst { border-style: dashed; border-color: var(--ok); }
.option:disabled { cursor: default; }

.lueckentext { font-family: var(--serif); font-size: 20px; line-height: 2.05; margin-top: 4px; }
.luecke-feld {
  font-family: var(--sans); font-size: 16px; border: 0; border-bottom: 1.5px solid var(--ink-2); border-radius: 0; background: var(--surface-2);
  padding: 2px 6px; min-height: 0; width: var(--w, 8ch); max-width: 100%; text-align: center; line-height: 1.4;
}
.luecke-feld:focus { box-shadow: none; background: var(--warn-bg); }
.luecke-feld.richtig { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.luecke-feld.falsch { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); text-decoration: line-through; }
.korrektur { font-family: var(--sans); font-size: 14px; color: var(--ok); font-weight: 600; margin: 0 4px; white-space: nowrap; }
.wortbank { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-s); padding: 8px 12px; font-size: 15px; cursor: pointer; min-height: 40px;
}
.chip:disabled { opacity: 0.3; }

.rueckseite { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line-2); animation: rein 360ms var(--ease) both; }
.loesung { margin-top: 20px; animation: rein 360ms var(--ease) both; }
.nach > *, .loesung { scroll-margin-bottom: 190px; scroll-margin-top: 90px; }
.loesung .meta { margin-bottom: 8px; }
.loesungsbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.kernpunkte { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.kernpunkte button {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 11px 12px; border-radius: var(--r-s);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 15px; line-height: 1.4;
}
.kernpunkte .kasten { width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--line-2); flex: none; display: grid; place-items: center; margin-top: 1px; color: transparent; }
.kernpunkte button[aria-pressed="true"] { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-bg); }
.kernpunkte button[aria-pressed="true"] .kasten { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.kernpunkte .kasten .ic { width: 13px; height: 13px; }

.md > p:last-child { margin-bottom: 0; }
.sachverhalt p { margin: 0 0 0.6em; }
.sachverhalt { font-family: var(--serif); font-size: 18px; line-height: 1.6; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px; }
.fallfrage { font-family: var(--serif); font-size: 20px; font-weight: 500; margin-top: 16px; line-height: 1.35; }
.gutachten { margin-top: 18px; display: grid; gap: 10px; }
.gutachten .schritt { border-left: 2px solid var(--m-dot, var(--line-2)); padding: 2px 0 2px 14px; animation: rein 360ms var(--ease) both; }
.gutachten .schritt h3 { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.ergebnisbox { margin-top: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--m-bg, var(--surface-2)); color: var(--ink); }

.rechenfelder { display: grid; gap: 12px; margin-top: 20px; }
.rechenfeld label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.rechenfeld .mit-einheit { display: flex; align-items: center; gap: 8px; }
.rechenfeld input { flex: 1; font-family: var(--mono); font-size: 17px; }
.rechenfeld input.richtig { border-color: var(--ok); background: var(--ok-bg); }
.rechenfeld input.falsch { border-color: var(--bad); background: var(--bad-bg); }
.rechenfeld .einheit { color: var(--muted); font-size: 14px; min-width: 2ch; }
.rechenfeld .soll { font-size: 13.5px; color: var(--ok); margin-top: 4px; font-weight: 500; }
.schritte { margin: 0; padding-left: 1.3em; }
.schritte li { margin: 0.35em 0; }

.ordnen-ziel { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; counter-reset: o; }
.ordnen-ziel li button, .ordnen-pool button {
  display: flex; gap: 10px; width: 100%; text-align: left; align-items: flex-start; padding: 12px; border-radius: var(--r-s);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 15px; line-height: 1.4;
}
.ordnen-ziel li button::before { counter-increment: o; content: counter(o); font-family: var(--mono); font-size: 12.5px; color: var(--muted); width: 18px; flex: none; margin-top: 1px; }
.ordnen-ziel .platz { border: 1px dashed var(--line-2); border-radius: var(--r-s); height: 46px; }
.ordnen-pool { display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.ordnen-ziel li.richtig button { background: var(--ok-bg); border-color: transparent; }
.ordnen-ziel li.falsch button { background: var(--bad-bg); border-color: transparent; }

.quellchip {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; padding: 7px 11px; border-radius: var(--r-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13.5px; cursor: pointer; text-decoration: none;
}
.quellchip .ic { width: 15px; height: 15px; }
.quellchip b { font-family: var(--mono); font-weight: 500; font-size: 12.5px; }

.aktionen {
  position: sticky; bottom: 0; z-index: 5; margin: auto -18px 0; padding: 14px 18px calc(14px + var(--safe-b));
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 22%);
}
.aktionen .reihe { display: flex; gap: 8px; }
.aktionen .reihe > * { flex: 1; }
.aktionen .unter { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; min-height: 28px; }
.bewertung { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.bewertung button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 58px; padding: 6px 4px;
  border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 500; font-size: 15px;
  transition: transform 120ms ease;
}
.bewertung button:active { transform: scale(0.97); }
.bewertung button small { font-family: var(--mono); font-weight: 400; font-size: 11.5px; color: var(--muted); }
.bewertung button.vorschlag { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.bewertung button.vorschlag small { color: color-mix(in srgb, var(--btn-ink) 70%, transparent); }
.bewertung .b1 { color: var(--bad); }
.ergebnis-zeile { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 10px; font-size: 15px; }
.ergebnis-zeile.ok { color: var(--ok); }
.ergebnis-zeile.bad { color: var(--bad); }
.ergebnis-zeile.teil { color: var(--warn); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); z-index: 50;
  background: var(--btn); color: var(--btn-ink); border-radius: var(--r-s); padding: 10px 14px; font-size: 14px; display: flex; gap: 14px; align-items: center;
  animation: toastRein 260ms var(--ease) both; width: max-content; max-width: calc(100% - 32px); white-space: nowrap;
}
@keyframes toastRein { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
body.lernmodus .toast { bottom: auto; top: calc(var(--safe-t) + 58px); font-size: 13.5px; padding: 8px 12px; }
.toast button { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font-weight: 600; padding: 4px 0; }
.offline { position: fixed; top: calc(var(--safe-t) + 8px); left: 50%; transform: translateX(-50%); z-index: 60; background: var(--warn-bg); color: var(--warn); font-size: 13px; padding: 5px 12px; border-radius: 999px; }

.abschluss { text-align: center; padding: 40px 0 10px; }
.abschluss .kreis { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 20px; display: grid; place-items: center; background: var(--m-bg, var(--ok-bg)); color: var(--m, var(--ok)); }
.abschluss .kreis .ic { width: 34px; height: 34px; }
.abschluss h1 { font-size: 36px; }
.abschluss .zahlen { display: flex; justify-content: center; gap: 28px; margin: 26px 0 30px; }
.abschluss .zahlen div { display: grid; }
.abschluss .zahlen b { font-family: var(--serif); font-size: 30px; font-weight: 500; }
.abschluss .zahlen span { font-size: 13px; color: var(--muted); }

/* ---------- Quelle (Sheet) ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 70; background: rgba(15, 15, 12, 0.36); animation: fade 200ms ease both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-height: 94dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 14px 14px 0 0; padding: 10px 16px calc(24px + var(--safe-b));
  animation: hoch 360ms var(--ease) both; max-width: 760px; margin: 0 auto;
}
@keyframes hoch { from { transform: translateY(40px); opacity: 0; } }
.sheet .griff { width: 38px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 2px auto 10px; }
.sheet .skopf { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sheet .skopf .haupt { flex: 1; min-width: 0; }
.seitenbild { position: relative; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.seitenbild img { display: block; width: 100%; height: auto; }
.seitenbild .mark { position: absolute; background: var(--hl); mix-blend-mode: multiply; border-radius: 2px; box-shadow: 0 0 0 2px var(--hl); }
.seitenbild.zoom { overflow: auto; max-height: 70dvh; }
.seitenbild.zoom .flaeche { width: 220%; position: relative; }
.zitat { font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.5; color: var(--ink-2); margin: 14px 0 0; padding-left: 14px; border-left: 2px solid var(--hl); }
.seitennav { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

/* ---------- Upload ---------- */
.dropzone {
  display: grid; place-items: center; text-align: center; gap: 8px; padding: 34px 18px; border: 1.5px dashed var(--line-2); border-radius: var(--r);
  background: var(--surface); cursor: pointer; transition: border-color 140ms ease, background 140ms ease;
}
.dropzone.aktiv { border-color: var(--ink-2); background: var(--surface-2); }
.dropzone .ic { width: 30px; height: 30px; color: var(--muted); }
.dropzone input { display: none; }
.formular { display: grid; gap: 12px; margin-top: 16px; }
.formular label { display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.formular label > span:first-child { display: block; }
.formular input, .formular textarea { width: 100%; }
.laden { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.laden b { display: block; height: 100%; width: 0; background: var(--ink); transition: width 160ms linear; }
.schritte-hilfe { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.schritte-hilfe li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.schritte-hilfe li::before { counter-increment: s; content: counter(s); font-family: var(--mono); font-size: 12px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; flex: none; margin-top: 1px; color: var(--muted); }

.spinner { width: 22px; height: 22px; border: 2px solid var(--line-2); border-top-color: var(--ink-2); border-radius: 50%; animation: dreh 800ms linear infinite; margin: 60px auto; }
@keyframes dreh { to { transform: rotate(360deg); } }

@media (min-width: 700px) {
  #app { padding-top: 40px; }
  h1 { font-size: 40px; }
  .frage { font-size: 24px; }
}
.liste .nr.zeit { width: 56px; white-space: nowrap; }
