:root {
  --bg: #f5f6f8; --karte: #fff; --text: #1d2330; --leise: #667085; --rand: #dde1e7;
  --primaer: #2f6fdb; --primaer-dunkel: #2459b3; --ok: #1d8a4e; --ok-bg: #e6f6ed;
  --fehler: #c0392b; --fehler-bg: #fdecea; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --karte: #1e232b; --text: #e6e9ee; --leise: #98a2b3; --rand: #323a46;
          --primaer: #5b93f0; --primaer-dunkel: #78a8f5; --ok: #4cc584; --ok-bg: #18301f;
          --fehler: #f07167; --fehler-bg: #3a1f1d; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 17px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
header { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between;
         padding: .7rem 1.2rem; background: var(--karte); border-bottom: 1px solid var(--rand); }
.logo { font-weight: 700; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: .45em; }
.logo img { height: 56px; width: auto; display: block; border-radius: 8px; }
@media (max-width: 600px) { .logo img { height: 44px; } }
.logo-vorschau { max-height: 96px; border-radius: 8px; }
nav { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
nav a { color: var(--leise); text-decoration: none; }
nav a:hover { color: var(--primaer); }
main { max-width: 900px; margin: 0 auto; padding: 1.2rem; }
h1 { font-size: 1.6rem; } h2 { margin-top: 2rem; } h3 { color: var(--leise); font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }
a { color: var(--primaer); }
.karte { background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 1rem 0; }
.schmal { max-width: 420px; margin-left: auto; margin-right: auto; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.raster .karte { margin: 0; display: flex; flex-direction: column; }
.raster .karte form { margin-top: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.satz.erledigt { border-left: 5px solid var(--primaer); }
.satz.perfekt { border-left: 5px solid var(--ok); }
.satz-kopf { display: flex; justify-content: space-between; gap: .5rem; align-items: start; }
.tag { font-size: .75rem; background: var(--bg); border: 1px solid var(--rand); border-radius: 99px; padding: 0 .6rem; white-space: nowrap; }
.klein { font-size: .88rem; color: var(--leise); margin: .3rem 0; }
label { display: block; margin: .8rem 0; }
input[type=text], input[type=password], input:not([type]), input[inputmode] {
  display: block; width: 100%; padding: .6rem .7rem; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--rand); border-radius: 8px; margin-top: .25rem; }
input:focus { outline: 2px solid var(--primaer); outline-offset: 1px; }
button, .knopf { display: inline-block; font: inherit; font-weight: 600; padding: .55rem 1.2rem; border-radius: 8px; border: 0;
  background: var(--primaer); color: #fff; cursor: pointer; text-decoration: none; margin-top: .5rem; }
button:hover, .knopf:hover { background: var(--primaer-dunkel); }
.zweit { background: transparent; color: var(--primaer); border: 1px solid var(--primaer); }
.zweit:hover { background: var(--bg); }
.gefahr { background: var(--fehler); }
button.link { background: none; color: var(--leise); padding: 0; margin: 0; font-weight: normal; }
button.link:hover { color: var(--primaer); background: none; }
form.inline { display: inline; }
.zeile { display: flex; gap: .7rem; align-items: center; }
.flash { padding: .7rem 1rem; border-radius: 8px; margin: .8rem 0; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.fehler { background: var(--fehler-bg); color: var(--fehler); }
.flash ul { margin: .3rem 0 0; }
.lauf-kopf { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; color: var(--leise); font-size: .9rem; }
.balken { height: 6px; background: var(--rand); border-radius: 99px; overflow: hidden; margin-top: .4rem; }
.balken div { height: 100%; background: var(--primaer); transition: width .3s; }
.frage { font-size: 1.25rem; white-space: pre-line; margin-bottom: 1rem; }
.frage-klein { white-space: pre-line; }
.feld { display: flex; align-items: center; gap: .6rem; }
.feld input { flex: 1; max-width: 260px; font-size: 1.2rem; margin: 0; }
.feld span { font-size: 1.15rem; min-width: 2.5rem; }
.option { display: flex; gap: .7rem; align-items: center; padding: .6rem .8rem; border: 1px solid var(--rand); border-radius: 8px; margin: .5rem 0; cursor: pointer; }
.option:has(input:checked) { border-color: var(--primaer); background: var(--bg); }
.hinweis { margin-top: 1.2rem; color: var(--leise); white-space: pre-line; }
.hinweis summary { cursor: pointer; color: var(--primaer); }
.erklaerung { white-space: pre-line; background: var(--bg); border-radius: 8px; padding: .4rem 1rem .8rem; margin: 1rem 0; }
.erklaerung h3 { margin: .6rem 0 .2rem; }
table { width: 100%; border-collapse: collapse; background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
th { font-size: .85rem; color: var(--leise); }
tr.ok td:first-child { border-left: 4px solid var(--ok); }
tr.fehler td:first-child { border-left: 4px solid var(--fehler); }
.aktionen form { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin: .2rem 0; }
.aktionen input { width: 150px; display: inline-block; margin: 0; padding: .35rem .5rem; }
.aktionen button { margin: 0; padding: .35rem .7rem; font-size: .85rem; }
.ergebnis-kopf { text-align: center; }
.gross { font-size: 3rem; font-weight: 800; }
@media (max-width: 640px) { table { font-size: .9rem; } .aktionen input { width: 100%; } }
.thema { font-size: .78rem; font-weight: 600; color: var(--primaer); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .2rem; }
.schmal.links { margin-left: 0; }
.graph-box { overflow-x: auto; margin: .5rem 0 1rem; }
.graph { max-width: 100%; height: auto; background: var(--karte); font-family: system-ui, sans-serif; }
.graph .gitter { stroke: var(--rand); stroke-width: 1; }
.graph .achse { stroke: var(--text); stroke-width: 1.4; }
.graph .pfeil { fill: var(--text); }
.graph .zahl { fill: var(--leise); font-size: 11px; }
.graph .achsname { fill: var(--text); font-size: 14px; font-style: italic; }
.graph .gerade { stroke-width: 2.6; stroke-linecap: round; }
.graph .name { font-size: 15px; font-weight: 700; font-style: italic; fill: var(--text); }
.graph .g0 { stroke: #2f6fdb; fill: #2f6fdb; } .graph .g1 { stroke: #e0752d; fill: #e0752d; } .graph .g2 { stroke: #1d8a4e; fill: #1d8a4e; }
.graph text.g0, .graph text.g1, .graph text.g2 { stroke: none; }
.graph .punkt { fill: #c0392b; stroke: var(--karte); stroke-width: 1.5; }
.skizze { max-width: 100%; height: auto; font-family: system-ui, sans-serif; }
.skizze .dreieck { fill: rgba(47, 111, 219, .07); stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.skizze .gegeben { stroke: #e0752d; stroke-width: 4; stroke-linecap: round; }
.skizze .winkel { fill: none; stroke: #e0752d; stroke-width: 1.8; }
.skizze .punkt-klein { fill: #e0752d; }
.skizze .etext { fill: var(--text); font-size: 17px; font-weight: 700; }
.skizze .stext { fill: var(--text); font-size: 14px; font-style: italic; }
.skizze .wtext { fill: #e0752d; font-size: 13px; font-weight: 600; }
.tipps { margin-top: 1.2rem; }
.tipps .hinweis { margin: .4rem 0; padding: .5rem .8rem; border: 1px solid var(--rand); border-radius: 8px; background: var(--bg); color: var(--text); white-space: normal; }
.tipps .hinweis > div { white-space: pre-line; padding-top: .4rem; }
.tipps .hinweis summary { font-weight: 600; }
/* Der nächste Tipp erscheint erst, wenn der vorige aufgeklappt ist */
.tipps .hinweis:not([open]) ~ .hinweis { display: none; }
.stufen { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.3rem 0 1rem; }
.stufen a { padding: .25rem .8rem; border: 1px solid var(--rand); border-radius: 99px; text-decoration: none; color: var(--leise); background: var(--karte); font-size: .9rem; }
.stufen a.aktiv { background: var(--primaer); border-color: var(--primaer); color: #fff; }
.tag.gesperrt { font-size: .75rem; vertical-align: middle; font-weight: 600; }
select { font: inherit; padding: .35rem .5rem; border: 1px solid var(--rand); border-radius: 8px; background: var(--bg); color: var(--text); }
label select { display: block; margin-top: .25rem; }
.faecher { display: flex; flex-wrap: wrap; gap: .3rem; border-bottom: 2px solid var(--rand); margin-bottom: 1rem; }
.faecher a { padding: .5rem 1.1rem; text-decoration: none; color: var(--leise); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.faecher a:hover { color: var(--primaer); }
.faecher a.aktiv { color: var(--primaer); border-bottom-color: var(--primaer); }
.faecher-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.faecher-admin .karte { margin: 0; }
.nutzerwahl { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; margin: .3rem 0 .6rem; }
.klein-option { margin: 0; padding: .25rem .6rem; font-size: .9rem; }
.skizze .hilfslinie { stroke: #2f6fdb; stroke-width: 1.8; stroke-dasharray: 6 4; }
.skizze .htext { fill: #2f6fdb; font-size: 14px; font-style: italic; font-weight: 600; }
.stufe-tag { font-size: .75rem; color: var(--leise); white-space: nowrap; }
.ungleichung select { font-size: 1.2rem; padding: .45rem .5rem; }
.ungleichung input { max-width: 160px; }
.feld.ungleichung { gap: .5rem; }
.feld.ungleichung > span { width: auto; min-width: 0; font-size: 1.2rem; font-style: italic; }
.themengruppe { background: var(--karte, #fff); border: 1px solid var(--rand); border-radius: 12px; margin-bottom: .8rem; }
.themengruppe > summary { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; padding: .9rem 1.1rem; cursor: pointer; list-style: none; }
.themengruppe > summary::-webkit-details-marker { display: none; }
.themengruppe > summary::before { content: "▸"; color: var(--primaer); transition: transform .15s; }
.themengruppe[open] > summary::before { transform: rotate(90deg); }
.themengruppe > summary:hover { background: rgba(47, 111, 219, .05); border-radius: 12px; }
.tg-name { font-weight: 700; font-size: 1.1rem; }
.tg-fortschritt { margin-left: auto; }
.tg-balken { flex-basis: 100%; height: 4px; background: var(--rand); border-radius: 2px; overflow: hidden; }
.tg-balken > span { display: block; height: 100%; background: #2e9e5b; }
.themengruppe > .raster { padding: 0 1.1rem 1.1rem; }
.themengruppe .karte.satz { box-shadow: none; }
h2.bereich { font-size: 1.05rem; color: var(--leise); text-transform: uppercase; letter-spacing: .04em; margin: 1.4rem 0 .5rem; }
.themengruppe { margin-bottom: .45rem; }
.themengruppe > summary { padding: .55rem 1rem; }
.tg-balken { flex-basis: auto; width: 90px; height: 6px; border-radius: 3px; }
.term-vorschau { min-height: 2.2rem; font-size: 1.3rem; padding: .3rem 0; color: var(--primaer); }
.skizze .linie { stroke: #1f2433; stroke-width: 2; }
.skizze .zeiger { stroke: #1f2433; stroke-width: 4; stroke-linecap: round; }
.skizze .kreis { fill: none; stroke: #1f2433; stroke-width: 2; }
.skizze .kreis.gefuellt { fill: #e6ecf7; }
.skizze .winkel-fuell { fill: rgba(232, 119, 34, .18); }
.skizze .punkt { fill: #1f2433; }
.diagramm { max-width: 100%; height: auto; font-family: inherit; }
.diagramm .dgitter { stroke: #dde2ea; stroke-width: 1; }
.diagramm .dachse { stroke: #1f2433; stroke-width: 1.6; }
.diagramm .dtext { fill: #4a5163; font-size: 13px; }
.diagramm .dtitel { fill: #1f2433; font-size: 15px; font-weight: 700; }
.diagramm .dwert { fill: #1f2433; font-size: 13px; font-weight: 600; }
.diagramm .dlinie { fill: none; stroke: #2f6fdb; stroke-width: 3; stroke-linejoin: round; }
.diagramm .dpunkt { fill: #2f6fdb; stroke: #fff; stroke-width: 2; }
.tabelle-box { overflow-x: auto; margin: .8rem 0; }
table.daten { border-collapse: collapse; font-size: 1.05rem; }
table.daten th, table.daten td { border: 1px solid var(--rand); padding: .4rem .8rem; text-align: center; }
table.daten th { background: #eef3fb; }
.flash.nochmal { background: #fff6e0; color: #7a5200; border: 1px solid #f0d48a; }
/* Englisch: Lückensätze */
.luecken-satz { line-height: 2.4; }
input.luecke { display: inline-block; width: 8ch; min-width: 6ch; max-width: 100%; padding: .1rem .4rem; margin: 0 .2rem; font-size: 1.05rem; border: 1px solid var(--rand); border-bottom: 2px solid var(--primaer); border-radius: 6px 6px 0 0; background: var(--bg); color: var(--text); }
.luecke-loesung { color: var(--ok); border-bottom: 2px solid var(--ok); padding: 0 .2rem; }
/* Eigene Vokabeln */
.vokabel-form label { display: block; margin: .8rem 0; }
.vokabel-form input[name=titel] { width: 100%; max-width: 30rem; }
.vokabel-form textarea { width: 100%; font: inherit; font-family: ui-monospace, monospace; padding: .5rem; border: 1px solid var(--rand);
  border-radius: 8px; background: var(--karte); color: inherit; box-sizing: border-box; }
.foto-box { border: 1px dashed var(--rand); border-radius: 8px; padding: .6rem 1rem; }
.foto-box input[type=file] { margin: .3rem .5rem .3rem 0; }
.aktionen .knopf { margin: 0; padding: .35rem .7rem; font-size: .85rem; }
