/* Sprachtool – mobil zuerst, hell/dunkel. Keine Inline-Stile (CSP style-src 'self'). */
:root {
  --grund: #f6f4ef; --karte: #ffffff; --text: #1d2430; --grau: #5e6673; --linie: #e2ded5;
  --blau: #1f3a5f; --blau-hell: #e8eef6; --akzent: #c8553d; --gut: #2f7d4f; --gut-hell: #e5f3ea;
  --fast: #9a6b00; --fast-hell: #fbf1d9; --falsch: #b23a2b; --falsch-hell: #fbe9e6;
  --radius: 14px; --schatten: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #12161c; --karte: #1b2129; --text: #e7e9ec; --grau: #9aa3ae; --linie: #2c3440;
    --blau: #8fb3e0; --blau-hell: #1f2b3a; --akzent: #e88a72; --gut: #6cc28f; --gut-hell: #18291f;
    --fast: #e0b44f; --fast-hell: #2c2614; --falsch: #ef8a7c; --falsch-hell: #2d1b19;
    --schatten: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}
a { color: var(--blau); }
h1 { font-size: 1.5rem; margin: .2rem 0 .8rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }

/* Kopf und Navigation */
.kopf {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top));
  background: #1f3a5f; color: #fff;
}
.marke { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 600; }
.nav-oben { display: none; gap: 1rem; margin-left: auto; }
.nav-oben a { color: #dfe7f1; text-decoration: none; }
.nav-oben a.aktiv, .nav-oben a:hover { color: #fff; text-decoration: underline; }
.nav-unten {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-around;
  background: var(--karte); border-top: 1px solid var(--linie); padding: .3rem 0 calc(.3rem + env(safe-area-inset-bottom));
}
.nav-unten a { display: flex; flex-direction: column; align-items: center; font-size: .75rem; color: var(--grau);
  text-decoration: none; min-width: 56px; padding: .2rem; }
.nav-unten a span { font-size: 1.3rem; line-height: 1.2; height: 1.6rem; display: flex; align-items: center; }
.nav-unten a.aktiv { color: var(--blau); font-weight: 600; }
@media (min-width: 800px) {
  .nav-oben { display: flex; }
  .nav-unten { display: none; }
  body { padding-bottom: 2rem; }
}

main { max-width: 760px; margin: 0 auto; padding: 1rem; }
.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten);
  border: 1px solid var(--linie); padding: 1rem 1.1rem; margin: 0 0 1rem; }
.karte.schmal { max-width: 420px; margin: 2rem auto; }
.karte.gedimmt { opacity: .6; }
.held { text-align: center; }
.mitte { text-align: center; }
.klein-grau { color: var(--grau); font-size: .88rem; margin: 0 0 .3rem; }
.hinweis { color: var(--grau); font-size: .9rem; }

/* Formulare */
label { display: block; margin: 0 0 .8rem; font-weight: 500; }
input:not([type=hidden]), textarea, select {
  display: block; width: 100%; margin-top: .3rem; padding: .7rem .8rem; font: inherit; color: var(--text);
  background: var(--grund); border: 1px solid var(--linie); border-radius: 10px;
}
input:focus, textarea:focus { outline: 2px solid var(--blau); outline-offset: 1px; }
.knopf {
  display: inline-block; padding: .7rem 1.2rem; border: 0; border-radius: 10px; font: inherit; font-weight: 600;
  background: var(--blau); color: #fff; text-decoration: none; cursor: pointer; text-align: center;
}
@media (prefers-color-scheme: dark) { .knopf { color: #12161c; } }
.knopf.gross { display: block; width: 100%; padding: .9rem; font-size: 1.1rem; margin-top: .6rem; }
.knopf.klein { padding: .35rem .7rem; font-size: .85rem; background: #ffffff22; color: #fff; }
.knopf.zweit { background: var(--blau-hell); color: var(--blau); margin: .4rem 0; }
.knopf.warnung { background: var(--falsch); }
.kopf .knopf.klein { margin-left: auto; }
@media (min-width: 800px) { .kopf .knopf.klein { margin-left: 0; } }

/* Meldungen */
.meldung { padding: .7rem .9rem; border-radius: 10px; background: var(--blau-hell); margin: 0 0 1rem; }
.meldung.success { background: var(--gut-hell); color: var(--gut); }
.meldung.warning { background: var(--fast-hell); color: var(--fast); }
.meldung.error { background: var(--falsch-hell); color: var(--falsch); }

/* Üben */
.aufgabe { text-align: center; }
.zeit-name { font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--akzent); margin: .4rem 0 0; font-weight: 600; }
.verb { font-size: 1.7rem; margin: .2rem 0 1rem; }
.antwort-zeile { display: flex; align-items: center; gap: .6rem; text-align: left; }
.antwort-zeile input { margin-top: 0; font-size: 1.25rem; }
.pronomen { white-space: nowrap; font-size: 1.15rem; color: var(--grau); }
.zeichen { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin: .2rem 0 .4rem; }
.zeichen button { min-width: 2.4rem; min-height: 2.4rem; font: inherit; font-size: 1.1rem; border-radius: 8px;
  border: 1px solid var(--linie); background: var(--grund); color: var(--text); cursor: pointer; }
.ergebnis { border-left: 6px solid var(--blau); }
.ergebnis.gut { border-left-color: var(--gut); }
.ergebnis.gut h1 { color: var(--gut); }
.ergebnis.fast { border-left-color: var(--fast); }
.ergebnis.fast h1 { color: var(--fast); }
.ergebnis.falsch { border-left-color: var(--falsch); }
.ergebnis.falsch h1 { color: var(--falsch); }
.loesung { font-size: 1.5rem; font-weight: 600; margin: .2rem 0 .6rem; }
.deine { text-decoration: line-through; color: var(--falsch); }
.diagnose { background: var(--grund); border-radius: 10px; padding: .6rem .8rem; }
.herleitung { margin: 0; padding-left: 1.3rem; }
.herleitung li { margin: .25rem 0; }
.regel-link { font-size: .82rem; white-space: nowrap; }

/* Lernpfad */
.stufen { list-style: none; margin: 0; padding: 0; }
.stufen li { display: flex; justify-content: space-between; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--linie); }
.stufen li:last-child { border-bottom: 0; }
.stufen li.gesperrt { color: var(--grau); }
.stufen li.sitzt .stufe-info { color: var(--gut); font-weight: 600; }
.stufe-info { white-space: nowrap; font-size: .9rem; color: var(--grau); }
.liste { margin: 0; padding-left: 1.2rem; }
.liste li { margin: .35rem 0; }

/* Regeln */
.frage { font-weight: 600; color: var(--akzent); }
.kern { font-size: 1.08rem; font-weight: 600; }
.merken { background: var(--fast-hell); padding: .6rem .8rem; border-radius: 10px; }
.merken.gut { background: var(--gut-hell); }
details.modell > summary { cursor: pointer; list-style: none; }
details.modell > summary h2 { display: inline; }
details.modell > summary::before { content: "▸ "; color: var(--grau); }
details.modell[open] > summary::before { content: "▾ "; }
.eigene { margin: .8rem 0 0; padding: .6rem .8rem; border-left: 4px solid var(--blau); background: var(--blau-hell); border-radius: 0 10px 10px 0; }
.eigene footer { font-size: .8rem; color: var(--grau); margin-top: .3rem; }

/* Tabellen */
.tabelle-rahmen { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabelle { border-collapse: collapse; width: 100%; font-size: .95rem; }
.tabelle th, .tabelle td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle th { font-size: .82rem; color: var(--grau); font-weight: 600; }
.tabelle.daten td:first-child { width: 50%; }
meter { width: 6rem; }

/* Konjugator */
details.form { border-bottom: 1px solid var(--linie); padding: .45rem 0; }
details.form:last-child { border-bottom: 0; }
details.form summary { cursor: pointer; font-size: 1.05rem; }
details.form .herleitung { margin: .4rem 0 .2rem; font-size: .92rem; color: var(--grau); }
.verbwolke { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.verbwolke a { display: inline-block; padding: .3rem .65rem; border-radius: 999px; background: var(--blau-hell); text-decoration: none; }
.suche { display: flex; gap: .6rem; align-items: flex-end; }
.suche label { flex: 1; margin: 0; }

/* Zwei-Faktor */
.qr { display: flex; justify-content: center; background: #fff; padding: .6rem; border-radius: 10px; }
.qr svg { width: 240px; max-width: 100%; height: auto; aspect-ratio: 1; }
.schluessel { text-align: center; word-break: break-all; }
.blaettern { text-align: center; }

/* Wortschatz */
.zwei-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.tipp { margin-top: .8rem; text-align: left; }
.tipp summary { cursor: pointer; color: var(--blau); }
tr.status-ausnahme td:last-child, tr.status-falsch td:last-child { color: var(--fast); }
