:root {
  --bg: #f8f4ee;
  --flaeche: #ffffff;
  --flaeche-2: #f2ece3;
  --tinte: #1f1a16;
  --tinte-2: #5b524a;
  --tinte-3: #8a8077;
  --linie: #e6ddd1;
  --rot: #c8402a;
  --rot-tief: #a2311f;
  --rot-hell: #fbe6df;
  --gelb: #f0a81c;
  --gelb-hell: #fdf1d6;
  --gruen: #2c8a4b;
  --gruen-hell: #e2f3e7;
  --orange: #c96a12;
  --orange-hell: #fbeedd;
  --blau: #2a64b6;
  --blau-hell: #e3ecf9;
  --schatten: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 16px rgba(60, 40, 20, .06);
  --r: 16px;
  --r-klein: 11px;
  --nav-h: 64px;
  --schrift: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130f; --flaeche: #221c17; --flaeche-2: #2b241e; --tinte: #f4ece3; --tinte-2: #c9bdb0;
    --tinte-3: #988b7e; --linie: #3a3129; --rot: #ef6a4f; --rot-tief: #ff8b72; --rot-hell: #3b221b;
    --gelb: #f4b740; --gelb-hell: #3a2f17; --gruen: #5cc47f; --gruen-hell: #1d3324; --orange: #f0954a;
    --orange-hell: #3a2a18; --blau: #74a5ee; --blau-hell: #1b2a40;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17130f; --flaeche: #221c17; --flaeche-2: #2b241e; --tinte: #f4ece3; --tinte-2: #c9bdb0;
  --tinte-3: #988b7e; --linie: #3a3129; --rot: #ef6a4f; --rot-tief: #ff8b72; --rot-hell: #3b221b;
  --gelb: #f4b740; --gelb-hell: #3a2f17; --gruen: #5cc47f; --gruen-hell: #1d3324; --orange: #f0954a;
  --orange-hell: #3a2a18; --blau: #74a5ee; --blau-hell: #1b2a40;
  --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--tinte); font-family: var(--schrift);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--rot); }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Kopf */
.kopf {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linie);
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
}
.kopf-in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.marke { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--tinte); font-weight: 750; font-size: 18px; letter-spacing: -.2px; }
.marke-zeichen { width: 30px; height: 30px; border-radius: 9px; background: var(--rot); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; }
.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pille { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; background: var(--flaeche); border: 1px solid var(--linie); font-size: 14px; font-weight: 650; }
.pille .i { width: 17px; height: 17px; }
.pille.flamme { color: var(--orange); }
.rund { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--linie); background: var(--flaeche); display: grid; place-items: center; color: var(--tinte-2); text-decoration: none; }

/* Navigation */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--flaeche);
  border-top: 1px solid var(--linie); padding-bottom: env(safe-area-inset-bottom);
}
.nav-in { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--nav-h); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--tinte-3); font-size: 11.5px; font-weight: 600; }
.nav a[aria-current="page"] { color: var(--rot); }
.nav a .i { width: 24px; height: 24px; }

main { max-width: 760px; margin: 0 auto; padding: 18px 16px 30px; }
.lern main { padding-top: 10px; }

h1 { font-size: 27px; line-height: 1.2; letter-spacing: -.4px; margin: 6px 0 4px; }
h2 { font-size: 19px; letter-spacing: -.2px; margin: 26px 0 10px; }
h3 { font-size: 16px; margin: 0 0 4px; }
.unter { color: var(--tinte-2); margin: 0 0 16px; }
.klein { font-size: 13.5px; color: var(--tinte-3); }
.etikett { font-size: 12.5px; font-weight: 650; color: var(--tinte-3); text-transform: uppercase; letter-spacing: .6px; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); box-shadow: var(--schatten); padding: 18px; }
.karte + .karte { margin-top: 12px; }
.raster { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent; background: var(--rot); color: #fff; font-weight: 700;
  font-size: 16px; cursor: pointer; text-decoration: none; transition: transform .08s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.knopf:active { transform: scale(.98); }
.knopf:hover { background: var(--rot-tief); }
.knopf.zweit { background: var(--flaeche); color: var(--tinte); border-color: var(--linie); }
.knopf.zweit:hover { background: var(--flaeche-2); }
.knopf.leise { background: transparent; color: var(--tinte-2); border-color: transparent; min-height: 40px; padding: 0 12px; }
.knopf.breit { width: 100%; }
.knopf[disabled] { opacity: .45; pointer-events: none; }
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.laut { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--linie); background: var(--flaeche); color: var(--rot); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.laut.klein { width: 34px; height: 34px; }
.laut.klein .i { width: 18px; height: 18px; }
.laut.spielt { background: var(--rot); color: #fff; border-color: var(--rot); }
.mic.hoert { background: var(--rot); color: #fff; border-color: var(--rot); animation: puls 1s infinite; }
@keyframes puls { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--rot) 20%, transparent); } }

/* Heute */
.gruss { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.ring { width: 74px; height: 74px; flex: none; position: relative; }
.ring svg { width: 74px; height: 74px; transform: rotate(-90deg); }
.ring .bahn { stroke: var(--linie); }
.ring .wert { stroke: var(--gruen); transition: stroke-dashoffset .4s; }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 750; font-size: 14px; text-align: center; line-height: 1.1; }
.plan { list-style: none; margin: 0; padding: 0; }
.plan li + li { border-top: 1px solid var(--linie); }
.schritt { display: flex; align-items: center; gap: 14px; padding: 13px 2px; text-decoration: none; color: var(--tinte); }
.schritt-zahl { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 750; background: var(--flaeche-2); color: var(--tinte-2); font-size: 15px; }
.schritt.fertig .schritt-zahl { background: var(--gruen); color: #fff; }
.schritt.jetzt .schritt-zahl { background: var(--rot); color: #fff; }
.schritt-text { flex: 1; min-width: 0; }
.schritt-text b { display: block; font-size: 16px; }
.schritt-text span { font-size: 14px; color: var(--tinte-2); }
.schritt .pfeil { color: var(--tinte-3); }

.stufen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stufe { border-radius: var(--r-klein); padding: 10px; background: var(--flaeche-2); text-align: center; }
.stufe b { font-size: 18px; display: block; }
.stufe.aktiv { background: var(--rot-hell); outline: 2px solid var(--rot); }
.stufe.fertig { background: var(--gruen-hell); }
.balken { height: 8px; border-radius: 99px; background: var(--flaeche-2); overflow: hidden; }
.balken > i { display: block; height: 100%; background: var(--gruen); border-radius: 99px; transition: width .4s; }
.balken.rot > i { background: var(--rot); }
.zeile { display: flex; align-items: center; gap: 10px; }
.zeile .wachs { flex: 1; min-width: 0; }
.zahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.zahl { text-align: center; }
.zahl b { display: block; font-size: 24px; letter-spacing: -.5px; }
.zahl span { font-size: 13px; color: var(--tinte-2); }
.tipp { background: var(--gelb-hell); border-color: color-mix(in srgb, var(--gelb) 40%, var(--linie)); }

/* Lernsitzung */
.sitzung-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sitzung-kopf .balken { flex: 1; height: 10px; }
.zu { background: none; border: none; color: var(--tinte-3); cursor: pointer; padding: 6px; }
.lernkarte { min-height: 300px; display: flex; flex-direction: column; }
.lernkarte .typ { margin-bottom: 14px; }
.wort-gross { font-size: 34px; font-weight: 750; letter-spacing: -.5px; line-height: 1.15; margin: 4px 0; }
.wort-mittel { font-size: 24px; font-weight: 700; letter-spacing: -.3px; line-height: 1.25; margin: 4px 0; }
.wortart { font-size: 14px; color: var(--tinte-3); }
.trenn { height: 1px; background: var(--linie); margin: 18px 0; border: 0; }
.beispiel { display: flex; gap: 10px; align-items: flex-start; }
.beispiel p { margin: 0; }
.beispiel .es { font-size: 17px; font-weight: 600; }
.beispiel .de { color: var(--tinte-2); font-size: 15px; }
.hinweis { margin-top: 12px; font-size: 14px; background: var(--blau-hell); color: var(--tinte); padding: 8px 12px; border-radius: var(--r-klein); }
.noten { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: auto; padding-top: 18px; }
.note { border-radius: 14px; border: 1px solid var(--linie); background: var(--flaeche); padding: 9px 4px; cursor: pointer; text-align: center; font-weight: 700; font-size: 15px; }
.note small { display: block; font-weight: 500; color: var(--tinte-3); font-size: 12px; }
.note.n1 { color: var(--rot); } .note.n2 { color: var(--orange); } .note.n3 { color: var(--gruen); } .note.n4 { color: var(--blau); }
.eingabe {
  width: 100%; font-size: 20px; padding: 13px 15px; border-radius: 14px; border: 2px solid var(--linie);
  background: var(--flaeche); outline: none; -webkit-appearance: none;
}
.eingabe:focus { border-color: var(--blau); }
.eingabe.ok { border-color: var(--gruen); background: var(--gruen-hell); }
.eingabe.halb { border-color: var(--orange); background: var(--orange-hell); }
.eingabe.nein { border-color: var(--rot); background: var(--rot-hell); }
.akzente { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 5px; margin: 10px 0 2px; max-width: 460px; }
.akzente button { min-width: 0; height: 42px; padding: 0; border-radius: 10px; border: 1px solid var(--linie); background: var(--flaeche-2); font-size: 18px; cursor: pointer; }
.rueck { margin-top: 14px; border-radius: 14px; padding: 13px 15px; }
.rueck.ok { background: var(--gruen-hell); }
.rueck.halb { background: var(--orange-hell); }
.rueck.nein { background: var(--rot-hell); }
.rueck b.titel { display: block; margin-bottom: 3px; }
.rueck .loesung { font-size: 19px; font-weight: 700; }
mark { background: color-mix(in srgb, var(--gelb) 55%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.fertig-gross { text-align: center; padding: 26px 8px; }
.fertig-gross .zeichen { width: 72px; height: 72px; border-radius: 50%; background: var(--gruen); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; }
.fertig-gross .zeichen .i { width: 38px; height: 38px; stroke-width: 2.4; }

/* Konjugation */
.konj-frage { text-align: center; padding: 6px 0 10px; }
.konj-frage .zeit { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--blau-hell); color: var(--blau); font-weight: 700; font-size: 14px; }
.konj-frage .verb { font-size: 30px; font-weight: 750; margin: 12px 0 2px; }
.konj-frage .person { font-size: 22px; font-weight: 650; color: var(--rot); }
table.konj { width: 100%; border-collapse: collapse; font-size: 15.5px; }
table.konj td { padding: 6px 8px; border-bottom: 1px solid var(--linie); }
table.konj td:first-child { color: var(--tinte-3); width: 42%; }
table.konj tr.ziel td { background: var(--gelb-hell); font-weight: 700; }
.unr { color: var(--rot); font-weight: 650; }
.zeiten-wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--linie); background: var(--flaeche); cursor: pointer; font-size: 14.5px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--tinte); color: var(--bg); border-color: var(--tinte); }
.chip.zu-gesperrt { opacity: .55; }
.tabellen { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tabellen .karte { padding: 12px 14px; }

/* Grammatik */
.lektionsliste { list-style: none; padding: 0; margin: 0; }
.lektion-zeile { display: flex; gap: 12px; align-items: center; padding: 12px 4px; text-decoration: none; color: var(--tinte); border-bottom: 1px solid var(--linie); }
.lektion-zeile .nr { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 750; font-size: 13px; background: var(--flaeche-2); color: var(--tinte-2); flex: none; }
.lektion-zeile.fertig .nr { background: var(--gruen-hell); color: var(--gruen); }
.lektion-zeile.naechste .nr { background: var(--rot); color: #fff; }
.lektion-zeile .titel { flex: 1; min-width: 0; }
.lektion-zeile .titel b { display: block; font-weight: 650; }
.lektion-zeile .titel .klein { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stufen-kopf { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 4px; }
.stufen-kopf h2 { margin: 0; }
.theorie p { margin: 0 0 12px; }
.theorie .merke, .theorie .falle { border-radius: 12px; padding: 11px 14px; margin: 0 0 12px; }
.theorie .merke { background: var(--gruen-hell); }
.theorie .falle { background: var(--orange-hell); }
.theorie .merke::before { content: "Merke"; display: block; font-weight: 750; font-size: 13px; color: var(--gruen); text-transform: uppercase; letter-spacing: .5px; }
.theorie .falle::before { content: "Achtung"; display: block; font-weight: 750; font-size: 13px; color: var(--orange); text-transform: uppercase; letter-spacing: .5px; }
.theorie ul { margin: 0 0 12px; padding-left: 20px; }
.theorie table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 15px; }
.theorie th, .theorie td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--linie); }
.theorie th { color: var(--tinte-3); font-weight: 650; font-size: 13.5px; }
.tabelle-scroll { overflow-x: auto; }
.satz-luecke { font-size: 20px; line-height: 1.9; font-weight: 600; }
.satz-luecke input { width: 9em; font-size: 19px; padding: 4px 8px; border-radius: 10px; border: 2px solid var(--linie); background: var(--flaeche); text-align: center; outline: none; }
.satz-luecke input:focus { border-color: var(--blau); }
.optionen { display: grid; gap: 9px; margin-top: 12px; }
.option { text-align: left; padding: 13px 15px; border-radius: 14px; border: 2px solid var(--linie); background: var(--flaeche); cursor: pointer; font-size: 17px; font-weight: 600; }
.option.ok { border-color: var(--gruen); background: var(--gruen-hell); }
.option.nein { border-color: var(--rot); background: var(--rot-hell); }
.bausteine { display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px; padding: 8px; border-radius: 14px; }
.bausteine.ziel { border: 2px dashed var(--linie); margin-bottom: 12px; }
.baustein { padding: 8px 13px; border-radius: 10px; border: 1px solid var(--linie); background: var(--flaeche); font-size: 17px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 0 var(--linie); }
.baustein.weg { visibility: hidden; }

/* Sprechen */
.reiter { display: flex; gap: 6px; background: var(--flaeche-2); padding: 4px; border-radius: 999px; margin-bottom: 16px; }
.reiter button { flex: 1; border: none; background: none; padding: 9px; border-radius: 999px; font-weight: 650; cursor: pointer; color: var(--tinte-2); }
.reiter button[aria-selected="true"] { background: var(--flaeche); color: var(--tinte); box-shadow: var(--schatten); }
.kachel { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--tinte); }
.kachel .sym { width: 44px; height: 44px; border-radius: 13px; background: var(--rot-hell); color: var(--rot); display: grid; place-items: center; flex: none; }
.kachel b { display: block; line-height: 1.3; }
.stufe-mini { display: inline-block; font-size: 11.5px; font-weight: 750; padding: 2px 7px; border-radius: 6px; background: var(--flaeche-2); color: var(--tinte-2); }
.satzliste { list-style: none; padding: 0; margin: 0; }
.satzliste li { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--linie); }
.satzliste .es { font-weight: 650; font-size: 17px; }
.satzliste .de { color: var(--tinte-2); font-size: 15px; }
.satzliste .wachs { flex: 1; min-width: 0; }
.merk { border: 1px solid var(--linie); background: var(--flaeche); border-radius: 10px; padding: 5px 9px; font-size: 13px; font-weight: 650; cursor: pointer; color: var(--tinte-2); white-space: nowrap; }
.merk[aria-pressed="true"] { background: var(--gruen-hell); color: var(--gruen); border-color: var(--gruen); }
.dialog .zeile-d { display: flex; gap: 10px; padding: 9px 0; align-items: flex-start; }
.dialog .sprecher { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 750; background: var(--blau-hell); color: var(--blau); }
.dialog .sprecher.b { background: var(--rot-hell); color: var(--rot); }
.dialog .sprecher.c { background: var(--gelb-hell); color: var(--orange); }
.dialog .blase { flex: 1; cursor: pointer; }
.dialog .blase .es { font-size: 17px; font-weight: 600; }
.dialog .blase .de { color: var(--tinte-2); font-size: 15px; display: none; }
.dialog.zeige-de .blase .de { display: block; }
.dialog .zeile-d.aktiv .blase .es { color: var(--rot); }

/* Profil */
.feld { display: block; margin-bottom: 16px; }
.feld > span { display: block; font-weight: 650; margin-bottom: 6px; }
.feld select, .feld input[type="text"], .feld input[type="number"] { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--linie); background: var(--flaeche); font-size: 16px; }
.schalter { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linie); }
.schalter input { width: 22px; height: 22px; accent-color: var(--rot); }
.methode p { margin: 0 0 12px; }
.liste-wort { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--linie); }
.liste-wort .wachs b { font-weight: 650; }
.punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--linie); flex: none; }
.punkt.lernt { background: var(--gelb); } .punkt.sitzt { background: var(--gruen); } .punkt.kennt { background: var(--blau); }
.suche { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--linie); background: var(--flaeche); font-size: 16px; margin-bottom: 12px; }
.leer { text-align: center; color: var(--tinte-2); padding: 30px 10px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); transform: translateX(-50%); background: var(--tinte); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 650; font-size: 14.5px; z-index: 50; box-shadow: var(--schatten); max-width: 90vw; text-align: center; }
.lern .nav { display: none; }
.lern body, body.lern { padding-bottom: env(safe-area-inset-bottom); }

@media (min-width: 900px) {
  main { padding-top: 26px; }
  h1 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
