/* Layout und Bausteine – mobile first, ab 900 px Navigation links. Farben nur über Variablen aus thema.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--c-bg); color: var(--c-text);
  font: 400 18px/1.55 var(--schrift); -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
a { color: var(--c-akzent); }
a:hover { color: var(--c-akzent-hover); }
:focus-visible { outline: 3px solid var(--c-akzent); outline-offset: 2px; border-radius: 6px; }
button, input, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }

.sprungmarke { position: absolute; left: -999px; top: 8px; background: var(--c-flaeche); padding: 8px 12px; z-index: 50; }
.sprungmarke:focus { left: 8px; }

/* ---------------------------------------------------------------- Rahmen und Navigation */
.rahmen { min-height: 100vh; }
.ansicht {
  max-width: 760px; margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px calc(96px + env(safe-area-inset-bottom));
  outline: none;
}
.hauptnavi {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--c-flaeche) 94%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--c-linie);
  padding-bottom: env(safe-area-inset-bottom);
}
.hauptnavi a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 60px; text-decoration: none; color: var(--c-text-3); font-size: 15px; font-weight: 600;
}
.hauptnavi a[aria-current] { color: var(--c-akzent); }
.navi-symbol { font-size: 20px; line-height: 1; font-weight: 700; }
.navi-zahl {
  position: absolute; top: 6px; left: calc(50% + 8px);
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--c-akzent); color: var(--c-auf-akzent); font-size: 15px; line-height: 22px; text-align: center;
}
@media (min-width: 900px) {
  .rahmen { display: grid; grid-template-columns: 200px 1fr; }
  .hauptnavi {
    position: sticky; top: 0; inset: auto; height: 100vh; grid-template-columns: 1fr; align-content: start;
    gap: 4px; padding: 24px 12px; border-top: 0; border-right: 1px solid var(--c-linie);
  }
  .hauptnavi a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; border-radius: 10px; font-size: 17px; min-height: 48px; }
  .hauptnavi a[aria-current] { background: var(--c-akzent-weich); }
  .navi-symbol { width: 26px; text-align: center; }
  .navi-zahl { position: static; margin-left: auto; }
  .ansicht { padding: 40px 40px 60px; }
}

/* ---------------------------------------------------------------- Schrift */
.kicker { margin: 0 0 4px; font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-akzent); }
.titel { margin: 0 0 12px; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
.einleitung { margin: 0 0 20px; color: var(--c-text-2); }
.abschnitt-titel { margin: 36px 0 6px; font-size: 24px; line-height: 1.2; }
.abschnitt-text { margin: 0 0 16px; color: var(--c-text-2); font-size: 17px; }
.leer-hinweis, .laden { color: var(--c-text-3); }
.grosse-zahl { font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.version { font-size: 15px; color: var(--c-text-3); }
.fehler-text { color: var(--c-falsch); }
.zurueck-link { display: inline-flex; align-items: center; min-height: 44px; margin: -8px 0 4px; font-weight: 600; text-decoration: none; }

/* ---------------------------------------------------------------- Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 20px; border-radius: 12px; border: 2px solid var(--c-akzent);
  background: var(--c-akzent); color: var(--c-auf-akzent); font-weight: 600; font-size: 17px; line-height: 1.2;
  text-decoration: none; cursor: pointer; text-align: center; touch-action: manipulation;
}
.knopf:hover { background: var(--c-akzent-hover); border-color: var(--c-akzent-hover); color: var(--c-auf-akzent); }
.knopf:disabled { opacity: .45; cursor: default; }
.knopf-zweit { background: transparent; color: var(--c-akzent); }
.knopf-zweit:hover { background: var(--c-akzent-weich); color: var(--c-akzent-hover); }
.knopf-breit { width: 100%; margin-top: 16px; }
.knopf-rund { width: 48px; padding: 0; font-size: 24px; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------------------------------------------------------------- Karten (Flächen) */
.karte {
  position: relative; display: block; margin: 0 0 16px; padding: 20px;
  background: var(--c-flaeche); border-radius: var(--rund); box-shadow: var(--schatten); color: inherit;
}
.karte-link { text-decoration: none; transition: transform .15s ease; }
.karte-link:hover { color: inherit; transform: translateY(-2px); }
.karte-titel { margin: 0 0 6px; font-size: 22px; line-height: 1.2; }
.karte-text { margin: 0 0 10px; color: var(--c-text-2); font-size: 17px; }

/* Start */
.start-kopf { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.start-logo { border-radius: 11px; flex: none; }
.start-titel { margin: 0; font-size: 28px; line-height: 1.1; }
.start-untertitel { margin: 0; color: var(--c-text-3); font-size: 17px; font-weight: 500; }
.start-raster { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .start-raster { grid-template-columns: 3fr 2fr; } }
.weiter-karte { border-left: 6px solid var(--c-akzent); }
.weiter-knopf { margin-top: 8px; }
.weiter-karte .status-marke { position: absolute; top: 18px; right: 18px; }
.kasten-karte .karte-titel { display: flex; align-items: baseline; gap: 8px; }
.neu-karte { border: 2px solid var(--c-akzent); }
.neu-liste { margin: 0 0 4px; padding-left: 22px; }
.vorschau-hinweis { padding: 10px 14px; border-radius: 10px; background: var(--c-entwurf-bg); color: var(--c-text); font-size: 15px; }

/* Schichten-Karte „Vom Sandkorn zur KI“ */
.schichten-stapel { position: relative; display: grid; gap: 6px; }
.schichten-stapel::before { /* durchgehende Linie: alles baut aufeinander auf */
  content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 2px; background: var(--c-linie);
}
.schicht { position: relative; background: var(--c-flaeche); border-radius: 12px; box-shadow: var(--schatten); border-left: 5px solid var(--s-farbe); }
.schicht-kopf { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px 8px 8px; cursor: pointer; list-style: none; }
.schicht-kopf::-webkit-details-marker { display: none; }
.schicht-nr {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--s-farbe); color: #fff; font-weight: 700; font-size: 15px;
}
.schicht-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.schicht-name strong { font-size: 18px; line-height: 1.2; }
.schicht-kurz { font-size: 15px; color: var(--c-text-3); line-height: 1.3; }
.schicht-stand { font-size: 15px; color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.hier-marke { flex: none; padding: 3px 10px; border-radius: 99px; background: var(--s-farbe); color: #fff; font-size: 15px; font-weight: 700; }
.schicht-hier { box-shadow: 0 0 0 2px var(--s-farbe), var(--schatten); }
.schicht-fertig .schicht-nr::after { content: "✓"; position: absolute; }
.schicht-fertig .schicht-nr { color: transparent; position: relative; }
.schicht-fertig .schicht-nr::after { color: #fff; }
.schicht-inhalt { padding: 0 14px 14px 50px; }
.schicht-folgt { margin: 0; color: var(--c-text-3); font-size: 15px; }
.schicht-folgen { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }

/* Balken */
.balken { display: block; height: 8px; margin: 8px 0 4px; border-radius: 4px; background: var(--c-flaeche-2); overflow: hidden; }
.balken-fuellung { display: block; height: 100%; border-radius: 4px; background: var(--c-akzent); }
.schicht .balken-fuellung { background: var(--s-farbe); }

/* Listen von Folgen und Staffeln */
.folgen-liste, .staffel-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.folge-zeile, .staffel-zeile {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px;
  background: var(--c-flaeche); border-radius: 12px; box-shadow: var(--schatten); text-decoration: none; color: inherit;
}
.schicht .folge-zeile { box-shadow: none; background: var(--c-flaeche-2); min-height: 52px; }
a.folge-zeile:hover, a.staffel-zeile:hover { color: inherit; outline: 2px solid var(--c-akzent-weich); }
.folge-geplant { opacity: .6; }
.folge-nr, .staffel-nr {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--c-akzent-weich); color: var(--c-akzent); font-weight: 700;
}
.folge-nr-fertig { background: var(--c-richtig); color: #fff; }
.folge-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.folge-text strong { line-height: 1.25; }
.folge-unter { font-size: 15px; color: var(--c-text-3); }
.stufe { margin-top: 18px; }
.stufe-titel { display: flex; flex-direction: column; margin: 0 0 8px; font-size: 19px; }
.stufe-text { font-size: 15px; font-weight: 400; color: var(--c-text-3); }
.schichten-zeile { font-size: 15px; color: var(--c-text-3); margin: -8px 0 20px; }

.status-marke {
  flex: none; display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 15px; font-weight: 700;
  background: var(--c-entwurf-bg); color: var(--c-entwurf); border: 1px solid currentColor;
}
.status-geprueft { color: var(--c-akzent); background: var(--c-akzent-weich); }

/* ---------------------------------------------------------------- Folge */
.folgen-titel { margin-bottom: 2px; font-size: 27px; }
@media (min-width: 640px) { .folgen-titel { font-size: 32px; } }
.folgen-untertitel { margin: 0 0 12px; color: var(--c-text-2); font-size: 19px; font-weight: 500; }
.entwurf-banner { margin: 8px 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--c-entwurf-bg); font-size: 15px; }
.schritte {
  display: flex; gap: 6px; margin: 12px -20px 20px; padding: 4px 20px 10px; overflow-x: auto;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.schritt {
  flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px 6px 6px;
  border-radius: 99px; background: var(--c-flaeche); box-shadow: var(--schatten); text-decoration: none;
  color: var(--c-text-2); font-size: 15px; font-weight: 600; scroll-snap-align: center;
}
.schritt-buchstabe {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--c-flaeche-2); color: var(--c-text-2); font-weight: 700;
}
.schritt-erledigt .schritt-buchstabe { background: var(--c-richtig-bg); color: var(--c-richtig); }
.schritt-aktiv { background: var(--c-akzent); color: var(--c-auf-akzent); }
.schritt-aktiv:hover { color: var(--c-auf-akzent); }
.schritt-aktiv .schritt-buchstabe { background: color-mix(in srgb, var(--c-auf-akzent) 25%, transparent); color: var(--c-auf-akzent); }
.schritt:not(.schritt-aktiv) .schritt-titel { display: none; }
@media (min-width: 900px) {
  .schritte { flex-wrap: wrap; overflow: visible; margin: 12px 0 24px; padding: 0; }
  .schritt:not(.schritt-aktiv) .schritt-titel { display: inline; }
}
.abschnitt { background: var(--c-flaeche); border-radius: var(--rund); box-shadow: var(--schatten); padding: 22px 20px 24px; }
.abschnitt-kicker { margin: 0; font-size: 15px; font-weight: 700; color: var(--c-akzent); text-transform: uppercase; letter-spacing: .05em; }
.abschnitt-symbol { display: inline-block; min-width: 1.2em; }
.abschnitt-ueberschrift { margin: 4px 0 14px; font-size: 26px; line-height: 1.2; }
.abschnitt-einstieg .text > p:first-child { font-size: 21px; line-height: 1.45; font-weight: 500; }
.folgen-fuss { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.folgen-fuss .knopf { flex: 1 1 auto; }
.folgen-fuss > span { flex: 0; }
.nachlesen-leiste { position: sticky; top: 8px; z-index: 5; margin-bottom: 12px; }
.nachlesen-leiste .knopf { width: 100%; box-shadow: var(--schatten); }

/* Fließtext aus Markdown */
.text > :first-child { margin-top: 0; }
.text p, .text ul, .text ol { margin: 0 0 14px; }
.text h3 { margin: 22px 0 8px; font-size: 20px; }
.text li { margin-bottom: 6px; }
.text code { font-family: var(--schrift-code); font-size: .9em; padding: 1px 5px; border-radius: 5px; background: var(--c-flaeche-2); }
.text blockquote { margin: 0 0 14px; padding: 4px 0 4px 16px; border-left: 4px solid var(--c-linie); color: var(--c-text-2); font-style: italic; }
pre.code { overflow-x: auto; margin: 0 0 14px; padding: 14px; border-radius: 10px; background: var(--c-flaeche-2); font: 15px/1.5 var(--schrift-code); }
pre.code code { background: none; padding: 0; }
.tabelle-rahmen { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--c-linie); border-radius: 10px; }
.tabelle-rahmen table { border-collapse: collapse; width: 100%; font-size: 16px; }
.tabelle-rahmen th, .tabelle-rahmen td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--c-linie); }
.tabelle-rahmen th { background: var(--c-flaeche-2); font-weight: 700; }
.tabelle-rahmen tr:last-child td { border-bottom: 0; }
.box { margin: 0 0 16px; padding: 14px 16px; border-radius: 12px; background: var(--c-akzent-weich); border-left: 5px solid var(--c-akzent); }
.box p { margin: 0; }
.box p + p { margin-top: 4px; }
.box-marke { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c-akzent); }
.box-werkstatt { background: color-mix(in srgb, var(--c-lampe) 14%, var(--c-flaeche)); border-left-color: var(--c-lampe); }
.box-werkstatt .box-marke { color: var(--c-text-2); }
.box-achtung { background: var(--c-falsch-bg); border-left-color: var(--c-falsch); }
.box-achtung .box-marke { color: var(--c-falsch); }
.box-wusstest { background: var(--c-flaeche-2); border-left-color: var(--c-text-3); }
.box-wusstest .box-marke { color: var(--c-text-2); }

/* Antippbare Glossarbegriffe */
.glossar-wort {
  display: inline; padding: 0; margin: 0; border: 0; background: none; cursor: help;
  color: inherit; font: inherit; text-decoration: underline dotted var(--c-akzent) 2px; text-underline-offset: 4px;
}
.glossar-wort:hover { color: var(--c-akzent); }

/* Quellen */
.quellen { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--c-linie); font-size: 15px; color: var(--c-text-2); }
.quellen summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.quellen ul { padding-left: 20px; }
.quellen-check { font-style: italic; }

/* ---------------------------------------------------------------- Simulatoren */
.sim { margin: 0 0 18px; padding: 16px; border-radius: 14px; border: 2px solid var(--c-linie); background: var(--c-bg); }
.sim-uebung { border-color: var(--c-akzent); }
.uebung-marke { display: inline-block; margin: 0 0 10px; padding: 2px 10px; border-radius: 99px; background: var(--c-akzent); color: var(--c-auf-akzent); font-size: 15px; font-weight: 700; }
.uebung-fertig { background: var(--c-richtig); color: #fff; }
.sim-info p { margin: 0 0 8px; }
.sim-gross { font-size: 22px; font-weight: 700; }
.sim-label { font-weight: 500; color: var(--c-text-2); font-size: 17px; }
.sim-zusatz { font-size: 16px; color: var(--c-text-2); }
.sim-steuerung { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.sim-anzahl { min-width: 96px; text-align: center; font-weight: 600; }
.bitmuster { font-family: var(--schrift-code); font-size: 26px; letter-spacing: .12em; color: var(--c-akzent); background: none; }

/* Bit-Schalter */
.schalter-reihe { /* immer eine Reihe: ein Byte soll als Ganzes zu sehen sein */
  display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 64px)); gap: 6px; margin-bottom: 14px;
}
.schalter {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 120px; padding: 8px 2px; min-width: 0;
  border: 2px solid var(--c-linie); border-radius: 12px; background: var(--c-flaeche); cursor: pointer; touch-action: manipulation;
}
.schalter-an { border-color: var(--c-lampe); }
.lampe { width: min(38px, 100%); height: 46px; overflow: visible; }
.lampe-glas { fill: var(--c-flaeche-2); stroke: var(--c-text-3); stroke-width: 2; }
.lampe-sockel { fill: var(--c-text-3); }
.lampe-an .lampe-glas { fill: var(--c-lampe); stroke: var(--c-lampe); }
.lampe-schein { fill: var(--c-lampe); opacity: .22; }
.schalter-wippe { position: relative; width: min(26px, 80%); height: 34px; border-radius: 6px; background: var(--c-flaeche-2); border: 2px solid var(--c-text-3); }
.schalter-wippe::after { content: ""; position: absolute; left: 3px; right: 3px; height: 13px; bottom: 3px; border-radius: 3px; background: var(--c-text-3); transition: all .15s; }
.schalter-an .schalter-wippe::after { bottom: 15px; background: var(--c-akzent); }
.schalter-wert { font: 700 18px var(--schrift-code); }

/* Zahlenraten */
.zahlen-raster { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 10px 0; max-width: 480px; }
.zahl {
  min-height: 38px; padding: 0; border: 1px solid var(--c-linie); border-radius: 7px; background: var(--c-flaeche);
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; touch-action: manipulation;
}
.zahl-links { background: var(--c-akzent-weich); border-color: var(--c-akzent); }
.zahl-raus { opacity: .25; cursor: default; background: transparent; }
.zahl-treffer { background: var(--c-richtig); color: #fff; opacity: 1; border-color: var(--c-richtig); }
.knopf-frage { flex: 1 1 220px; }
.raten-verlauf { margin: 12px 0 0; padding-left: 24px; font-size: 15px; color: var(--c-text-2); }

/* ---------------------------------------------------------------- Quiz */
.quiz { margin-top: 8px; scroll-margin-top: 16px; }
.quiz-zaehler { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--c-text-3); }
.quiz-frage { margin: 0 0 14px; font-size: 21px; font-weight: 600; line-height: 1.35; }
.antworten { display: grid; gap: 8px; }
.antwort {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 56px; padding: 12px 14px;
  border: 2px solid var(--c-linie); border-radius: 12px; background: var(--c-flaeche); text-align: left; cursor: pointer;
  font-size: 18px; line-height: 1.35; touch-action: manipulation;
}
.antwort:not(:disabled):hover { border-color: var(--c-akzent); }
.antwort:disabled { cursor: default; color: var(--c-text); }
.antwort-buchstabe {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--c-flaeche-2); font-weight: 700; font-size: 16px;
}
.antwort-richtig { border-color: var(--c-richtig); background: var(--c-richtig-bg); }
.antwort-richtig .antwort-buchstabe { background: var(--c-richtig); color: #fff; }
.antwort-falsch { border-color: var(--c-falsch); background: var(--c-falsch-bg); }
.antwort-falsch .antwort-buchstabe { background: var(--c-falsch); color: #fff; }
.rueckmeldung { margin-top: 14px; padding: 14px 16px; border-radius: 12px; border-left: 5px solid; }
.rueckmeldung-richtig { background: var(--c-richtig-bg); border-color: var(--c-richtig); }
.rueckmeldung-falsch { background: var(--c-falsch-bg); border-color: var(--c-falsch); }
.rueckmeldung-titel { margin: 0 0 4px; font-weight: 700; }
.rueckmeldung-text p { margin: 0 0 8px; }
.nachlesen-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.quiz-ergebnis, .karten-ende { text-align: center; padding: 16px 0 4px; }
.quiz-lob { margin: 8px 0 0; color: var(--c-text-2); }

/* ---------------------------------------------------------------- Karteikarten */
.karten-runde { margin-top: 8px; }
.lernkarte {
  min-height: 180px; padding: 20px; border-radius: 16px; background: var(--c-flaeche);
  border: 2px solid var(--c-linie); box-shadow: var(--schatten);
}
.abschnitt .lernkarte { background: var(--c-bg); box-shadow: none; }
.lernkarte-offen { border-color: var(--c-akzent); }
.karte-seite { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--c-text-3); text-transform: uppercase; letter-spacing: .05em; }
.karte-vorne .text p { font-size: 20px; font-weight: 600; line-height: 1.35; }
.karte-hinten { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--c-linie); }
.karten-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.knopf-nein { background: var(--c-falsch-bg); border-color: var(--c-falsch); color: var(--c-text); }
.knopf-nein:hover { background: var(--c-falsch-bg); border-color: var(--c-falsch); color: var(--c-text); filter: brightness(.97); }
.knopf-ja { background: var(--c-richtig); border-color: var(--c-richtig); color: #fff; }
.knopf-ja:hover { background: var(--c-richtig); border-color: var(--c-richtig); color: #fff; filter: brightness(1.08); }
.faecher { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; list-style: none; margin: 0 0 8px; padding: 16px; background: var(--c-flaeche); border-radius: var(--rund); box-shadow: var(--schatten); }
.fach { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.fach-saeule { position: relative; width: 100%; max-width: 54px; height: 96px; border-radius: 8px; background: var(--c-flaeche-2); overflow: hidden; }
.fach-fuellung { position: absolute; left: 0; right: 0; bottom: 0; background: var(--c-akzent); border-radius: 8px 8px 0 0; }
.fach-zahl { font-weight: 700; font-size: 20px; }
.fach-name { font-size: 15px; font-weight: 600; }
.fach-abstand { font-size: 15px; color: var(--c-text-3); line-height: 1.2; }

/* ---------------------------------------------------------------- Glossar */
.suchfeld, .code-feld {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 2px solid var(--c-linie); border-radius: 12px; background: var(--c-flaeche);
}
.suchfeld:focus, .code-feld:focus { border-color: var(--c-akzent); outline: none; }
.code-feld { margin-top: 12px; font: 15px/1.4 var(--schrift-code); resize: vertical; word-break: break-all; }
.glossar-liste { margin-top: 12px; }
.glossar-buchstabe { margin: 18px 0 6px; font-size: 18px; color: var(--c-akzent); }
.glossar-eintrag { margin-bottom: 6px; background: var(--c-flaeche); border-radius: 12px; box-shadow: var(--schatten); }
.glossar-eintrag summary { display: flex; flex-direction: column; justify-content: center; min-height: 56px; padding: 10px 16px; cursor: pointer; list-style: none; }
.glossar-eintrag summary::-webkit-details-marker { display: none; }
.glossar-vorschau { font-size: 15px; color: var(--c-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glossar-eintrag[open] .glossar-vorschau { display: none; }
.glossar-text { padding: 0 16px 6px; }
.glossar-text p { margin: 0 0 10px; }
.glossar-eintrag .nachlesen-link { padding: 0 16px 8px; }

/* ---------------------------------------------------------------- Einstellungen */
.umschalter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 12px; background: var(--c-flaeche-2); }
.umschalter-knopf { min-height: 44px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; cursor: pointer; }
.umschalter-knopf[aria-checked="true"] { background: var(--c-flaeche); box-shadow: var(--schatten); color: var(--c-akzent); }
.datei-knopf { position: relative; overflow: hidden; }
.datei-feld { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------------------------------------------------------------- Blätter, Meldungen */
dialog.blatt {
  width: min(560px, calc(100% - 24px)); max-height: 85vh; margin: auto auto 12px; padding: 22px 20px;
  border: 0; border-radius: 18px; background: var(--c-flaeche); color: var(--c-text); box-shadow: 0 10px 40px rgb(0 0 0 / .3);
}
@media (min-width: 640px) { dialog.blatt { margin: auto; } }
dialog.blatt::backdrop { background: rgb(10 15 20 / .45); }
.blatt-titel { margin: 0 0 8px; font-size: 24px; }
.blatt-text { margin: 0 0 10px; }
.blatt-mehr { color: var(--c-text-2); font-size: 17px; }
.toast {
  position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--c-text); color: var(--c-bg);
  font-weight: 600; font-size: 16px; box-shadow: var(--schatten);
}
.update-leiste {
  position: fixed; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 560px; margin: 0 auto;
  padding: 10px 12px 10px 18px; border-radius: 14px; background: var(--c-text); color: var(--c-bg); font-weight: 600;
}
.update-knopf { min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--c-akzent); color: var(--c-auf-akzent); font-weight: 700; cursor: pointer; }
@media (min-width: 900px) { .toast, .update-leiste { bottom: 24px; } }
/* Während einer Folge keine Update-Leiste über dem Inhalt – sie erscheint auf der Startseite */
body[data-ansicht="folge"] .update-leiste { display: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
