/* Gestaltung der Redaktion (Plan 5.8): Muster der Feilbank, mobil zuerst, hell/dunkel, Inter 17 px.
   Rot nur für „Nein“ und harte Fehler. Knöpfe ≥ 48 px, nichts unter 14 px, keine waagerechte Scroll-Leiste. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/statisch/schrift/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/statisch/schrift/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/statisch/schrift/Inter-Bold.woff2") format("woff2"); }

:root {
  --grund: #F6F4EF; --flaeche: #FFFFFF; --tinte: #1F2328; --leise: #636A73; --linie: #E2DED6;
  --akzent: #F2B705; --auf-akzent: #1E1700; --gut: #2E6DAE; --nein: #B0463B; --bestanden: #2F7D4F; --hinweis: #9A6B00;
  --rand: 16px; --knopf: 48px; --radius: 14px; --bewegung: 200ms;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #14171A; --flaeche: #1C2024; --tinte: #E8EAED; --leise: #9AA1A9; --linie: #2C3238;
    --akzent: #F5C12E; --auf-akzent: #1E1700; --gut: #71A8E2; --nein: #E27C70; --bestanden: #6CC08F; --hinweis: #E2B04A;
  }
}
@media (prefers-reduced-motion: reduce) { :root { --bewegung: 0ms; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--grund); color: var(--tinte);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 17px; line-height: 1.5;
  overflow-x: hidden; padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
body.schmal { padding-bottom: env(safe-area-inset-bottom); }
.seite { max-width: 640px; margin: 0 auto; padding: var(--rand); padding-top: calc(var(--rand) + env(safe-area-inset-top)); }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 8px; font-weight: 700; overflow-wrap: anywhere; }
h2 { font-size: 19px; line-height: 1.3; margin: 0 0 8px; font-weight: 600; }
h2.klein { font-size: 15px; color: var(--leise); text-transform: none; margin-top: 16px; }
p { margin: 0 0 12px; }
a { color: var(--gut); }
code, .geheimnis { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 16px; }
.leise { color: var(--leise); font-size: 15px; }
.gross { font-size: 20px; font-weight: 600; }
.ruhig { color: var(--leise); }
.kennung { font-size: 14px; color: var(--leise); font-weight: 400; margin-left: 6px; white-space: nowrap; }

/* Flächen */
.kasten { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: var(--rand); margin: 0 0 var(--rand); }
.kopf { margin-bottom: var(--rand); }
.zeilen, .meldungen, .technik, .belege, .hinweise, .jobs, .fluss, .verlauf { list-style: none; margin: 0; padding: 0; }
.zeilen li, .technik li, .fluss li, .jobs > li, .verlauf li { padding: 8px 0; border-bottom: 1px solid var(--linie); }
.zeilen li:last-child, .technik li:last-child, .fluss li:last-child, .jobs > li:last-child, .verlauf li:last-child { border-bottom: 0; }
.meldungen li { background: var(--flaeche); border-left: 4px solid var(--akzent); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.technik .achtung .befund-zeichen { color: var(--hinweis); }
.technik .ok .befund-zeichen { color: var(--bestanden); }
.hinweiszeile { color: var(--hinweis); }
.fehlerzeile { color: var(--nein); font-weight: 600; }
.fusszeile { margin-top: 12px; }

/* Knöpfe (≥ 48 px, Daumenbereich) */
.knopf, button.knopf, a.knopf {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--knopf); min-width: var(--knopf);
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--tinte);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background var(--bewegung);
}
.knopf.knopf-haupt { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
.knopf.knopf-nein { color: var(--nein); border-color: var(--nein); }
.knopf.knopf-gewaehlt { border: 2px solid var(--akzent); }
.knopf.knopf-klein { min-height: var(--knopf); padding: 6px 12px; font-size: 15px; }
.knopf-text { background: none; border: 0; padding: 12px 4px; min-height: var(--knopf); font: inherit; color: var(--gut); cursor: pointer; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.knopfreihe form { margin: 0; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid var(--gut); outline-offset: 2px; }

/* Formulare */
.formular { display: grid; gap: 12px; margin: 0 0 12px; }
.formular label { display: grid; gap: 4px; font-weight: 600; font-size: 15px; }
input, textarea, select {
  font: inherit; font-size: 17px; color: var(--tinte); background: var(--grund); border: 1px solid var(--linie);
  border-radius: 10px; padding: 12px; min-height: var(--knopf); width: 100%;
}
textarea { min-height: calc(3 * 1.5em + 24px); resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; min-height: 0; flex: 0 0 auto; accent-color: var(--akzent); }
.schalter, .tag { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 400 !important; min-height: var(--knopf); }
.tage { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.tage legend { font-weight: 600; margin-bottom: 4px; }
form.inline { display: inline; }

/* Fachwörter: ⓘ öffnet die Erklärung (Popover) */
.begriff { white-space: nowrap; }
.info { border: 0; background: none; color: var(--gut); font: inherit; font-size: 15px; padding: 0 2px; min-width: 24px; cursor: pointer; }
.erklaerung[popover] { max-width: min(320px, calc(100vw - 32px)); border: 1px solid var(--linie); border-radius: 12px; background: var(--flaeche); color: var(--tinte); padding: 12px; white-space: normal; font-size: 15px; }

/* Untere Leiste */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; align-items: stretch;
  background: var(--flaeche); border-top: 1px solid var(--linie); padding-bottom: env(safe-area-inset-bottom); z-index: 10;
}
.leiste-punkt { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 56px; color: var(--leise); text-decoration: none; font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
.leiste-punkt::-webkit-details-marker { display: none; }
.leiste-punkt.aktiv { color: var(--tinte); }
.leiste-mehr { flex: 1; position: relative; display: flex; }
.leiste-mehr > summary { width: 100%; }

/* Blätter von unten (Dialoge, Menüs) */
.blatt { display: grid; gap: 4px; }
details.menue > .blatt, .mehr-blatt {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--flaeche); border-top: 1px solid var(--linie);
  border-radius: 18px 18px 0 0; padding: var(--rand); padding-bottom: calc(var(--rand) + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .15); z-index: 20; max-height: 80dvh; overflow-y: auto;
}
.blatt-zeile { display: flex; align-items: center; min-height: var(--knopf); padding: 4px 0; color: var(--tinte); text-decoration: none; border-bottom: 1px solid var(--linie); }
.blatt-zeile.formular { display: grid; }
.menue > summary { list-style: none; }
.menue > summary::-webkit-details-marker { display: none; }

/* Karte */
.karte { display: block; }
.karten-kopf h1 { margin-bottom: 4px; }
.sitzung-kopf { display: flex; justify-content: space-between; align-items: center; color: var(--leise); margin: 0 0 8px; }
.spur { display: flex; gap: 6px; list-style: none; margin: 4px 0 8px; padding: 0; font-size: 22px; }
.spur a { color: var(--leise); text-decoration: none; display: inline-flex; min-width: 32px; min-height: 32px; align-items: center; justify-content: center; }
.spur-freigegeben a { color: var(--bestanden); }
.spur-aktuell a { color: var(--tinte); font-weight: 700; }
.status-zeile { color: var(--leise); }
.stufe-inhalt { margin: var(--rand) 0; }
.ideen-satz { font-size: 24px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.belege li { display: flex; align-items: baseline; gap: 6px; padding: 4px 0; }
.beleg-zahl { text-decoration: underline dotted; text-underline-offset: 3px; }
.schloss { display: inline-block; width: 12px; height: 12px; background: url("/statisch/symbole/schloss.svg") no-repeat center / contain; }
.hinweise li { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; }
.punkt-gelb { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--akzent); }
.pruefliste { margin: 12px 0; }
.pruefliste summary { cursor: pointer; min-height: var(--knopf); padding: 12px 0; }
.pruefliste ul { list-style: none; padding: 0; margin: 0; }
.befund { padding: 4px 0; }
.befund-ok .befund-zeichen { color: var(--bestanden); }
.befund-hinweis .befund-zeichen { color: var(--hinweis); }
.befund-fehler .befund-zeichen { color: var(--nein); }
.blatt-wahl { border-top: 1px solid var(--linie); padding-top: var(--rand); margin-top: var(--rand); display: grid; gap: 8px; }
.blatt-wahl .knopf { width: 100%; }
.wahl-form { margin: 0; }
.knopfleiste { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; background: var(--grund); }
/* fest im Daumenbereich, sobald sie einen Haupt-Knopf trägt (5.4) */
.knopfleiste:has(.knopf-haupt) { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); }
.knopfleiste > form { flex: 1 1 auto; }
.knopfleiste .knopf-haupt { width: 100%; }
.ki-text { overflow-wrap: anywhere; }

/* Verlauf, Jobs */
.verlauf li.zurueckgenommen { color: var(--leise); }
.job { display: grid; gap: 4px; }
.job-name { font-weight: 600; }
.job-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.job-knoepfe form { margin: 0; }
.antwort { background: var(--grund); border-radius: 10px; padding: 8px 12px; margin: 4px 0; }

/* Meldungen und Toast */
.meldung-ort { position: fixed; left: var(--rand); right: var(--rand); top: calc(var(--rand) + env(safe-area-inset-top)); z-index: 30; pointer-events: none; }
.meldung-ort .meldung { pointer-events: auto; background: var(--flaeche); border: 1px solid var(--nein); border-radius: 12px; padding: 12px; margin: 0; }
.toast-ort { position: fixed; left: var(--rand); right: var(--rand); bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 25; display: flex; justify-content: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--tinte); color: var(--grund); border-radius: 12px; padding: 4px 8px 4px 16px; transition: opacity var(--bewegung); }
.toast .knopf-text { color: var(--akzent); }
.toast-form { margin: 0; }
.offline { background: var(--hinweis); color: #fff; padding: 8px var(--rand); text-align: center; }

/* Einrichtung */
.qr-rahmen { background: #fff; padding: 12px; border-radius: 12px; max-width: 280px; margin: 8px 0 12px; }
.qr-rahmen svg { display: block; width: 100%; height: auto; }
.geheimnis { overflow-wrap: anywhere; letter-spacing: .05em; }
.notfall-codes { font-size: 18px; padding-left: 28px; }
.notfall-codes li { padding: 2px 0; }
.stufen-bild { list-style: none; padding: 0; display: grid; gap: 4px; }
.spur-zeichen { color: var(--akzent); font-weight: 700; }
.aufklapp summary { cursor: pointer; min-height: var(--knopf); padding: 12px 0; color: var(--gut); }

/* M2: Wisch-Modus, Belege, Blätter, Start, Regeln (5.4, 5.5.4, 5.8) */
.blatt[popover]:not(:popover-open) { display: none; }
.blatt[popover] {
  position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; max-height: 80dvh; overflow-y: auto;
  border: 1px solid var(--linie); border-radius: 18px 18px 0 0; background: var(--flaeche); color: var(--tinte);
  padding: var(--rand); padding-bottom: calc(var(--rand) + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(0, 0, 0, .15);
}
.blatt[popover]::backdrop { background: rgba(0, 0, 0, .35); }
h3.klein { font-size: 15px; color: var(--leise); margin: 16px 0 4px; font-weight: 600; }
.beleg-chip {
  display: inline; border: 0; background: none; padding: 0 2px; margin: 0; font: inherit; color: inherit; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 4px; min-height: 0;
}
.beleg-chip .schloss { width: 11px; height: 11px; margin-left: 3px; vertical-align: baseline; }
.beleg-kopf { font-weight: 600; margin-bottom: 4px; }
.beleg-inhalt p { margin-bottom: 6px; }
.etikett, .schild, .abzeichen {
  display: inline-block; font-size: 14px; line-height: 1.3; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--linie);
  color: var(--leise); background: var(--grund);
}
.schild-ok { color: var(--bestanden); border-color: var(--bestanden); }
.chips, .chips-gruppe { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; padding: 0; border: 0; }
.chip, .chip-knopf, .chip-wahl {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 15px; min-height: 36px; padding: 4px 12px;
  border-radius: 999px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--tinte); text-decoration: none;
}
.chip-knopf { cursor: pointer; }
.chip-aktiv { border-color: var(--akzent); background: var(--akzent); color: var(--auf-akzent); }
.chip-wahl input { width: 20px; height: 20px; min-height: 0; }
.chips-gruppe legend { width: 100%; margin-bottom: 4px; }
.knopf.knopf-gut { color: var(--gut); border-color: var(--gut); }
progress.balken { width: 100%; height: 10px; accent-color: var(--akzent); }

.wischen { display: block; }
.wisch-kopf { display: flex; justify-content: space-between; align-items: center; color: var(--leise); margin: 0 0 8px; }
.wisch-frage { color: var(--leise); margin-bottom: 8px; }
.wisch-karte {
  position: relative; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 20px; padding: 20px var(--rand);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .35); touch-action: none; user-select: none; overflow: hidden; min-height: 40dvh;
}
.wisch-karte .ideen-satz { font-size: 24px; font-weight: 600; line-height: 1.35; }
.wisch-karte .belegzeilen { list-style: none; margin: 12px 0; padding: 0; color: var(--tinte); }
.wisch-karte .belegzeilen li { padding: 4px 0; }
.wisch-weg { margin: 8px 0; }
.wisch-mehr { margin: 12px 0 0; }
.stempel {
  position: absolute; top: 14px; font-weight: 700; font-size: 26px; letter-spacing: .04em; text-transform: uppercase; opacity: 0;
  border: 4px solid currentColor; border-radius: 8px; padding: 0 12px; pointer-events: none;
}
.stempel-hit { right: 20px; color: var(--akzent); transform: rotate(-12deg); }
.stempel-nein { left: 20px; color: var(--nein); transform: rotate(12deg); }
.stempel-gut { left: 50%; margin-left: -48px; top: auto; bottom: 16px; color: var(--gut); transform: rotate(-4deg); }
.wisch-form { position: sticky; bottom: calc(56px + env(safe-area-inset-bottom)); background: var(--grund); padding: 8px 0; margin: 8px 0 0; z-index: 5; }
.wisch-form .notiz-feld textarea { min-height: var(--knopf); resize: none; }
.stern-feld { display: flex; align-items: center; gap: 8px; min-height: var(--knopf); font-size: 15px; }
.wisch-knoepfe { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }
.wisch-knoepfe .knopf { width: 100%; padding: 10px 6px; }
.schnellgruende { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip-knopf, .chip-knopf:hover { cursor: pointer; }
.toast .schnellgruende { max-width: 70vw; }
.toast { flex-wrap: wrap; }
.mehr-abschnitt { margin: 8px 0; }
.drei-werte { margin: 8px 0; }
.satz-ende h2 { margin-bottom: 4px; }
.satz-zeile p { margin-bottom: 6px; }
.saetze, .regeln { list-style: none; margin: 0; padding: 0; }

.regel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px var(--rand); margin: 0 0 12px; }
.regel-verworfen { opacity: .65; }
.regel-kopf { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 6px; }
.regel-text { font-size: 17px; }
.vorschlag { background: var(--grund); border-radius: 10px; padding: 8px 12px; margin: 6px 0; }
.wahl-gruppe { border: 1px solid var(--linie); }
.wahl-gruppe legend { font-weight: 600; padding: 0 6px; }
.wahl-zahl { margin: 8px 0; }
.kommentare { border-top: 1px solid var(--linie); margin-top: var(--rand); padding-top: var(--rand); }
.suche .filter { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bremse { border-left: 4px solid var(--akzent); }
.recht-zeile { margin: 8px 0; }
details.aufklapp.fakten-blatt .kasten { margin-top: 8px; }

/* M3/M4: Winkel, Fassungen, Sätze, Vorher/Nachher, Startrunde (5.4, 5.5.5, 5.5.6) */
.stufen-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--rand); }
.optionen { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 calc(-1 * var(--rand)); padding-inline: var(--rand); }
.option { flex: 0 0 min(88%, 420px); scroll-snap-align: start; margin: 0; min-width: 0; }
.option-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.option-kopf h2 { margin: 0; }
.wahl-nav { display: flex; gap: 8px; margin: 4px 0 8px; }
.punkt { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; border-radius: 999px; border: 1px solid var(--linie); text-decoration: none; color: var(--tinte); }
.feld { padding: 6px 0; border-bottom: 1px solid var(--linie); }
.feld:last-of-type { border-bottom: 0; }
.feld-titel { margin: 0 0 2px; font-size: 14px; }
.feld-kommentar summary { min-height: 36px; padding: 4px 0; cursor: pointer; font-size: 15px; }
.kette { list-style: none; margin: 0; padding: 0; }
.kette .aufloesung { border-left: 4px solid var(--akzent); padding-left: 8px; font-weight: 600; }
.pfeil { color: var(--leise); }
.ampel-gruen { color: var(--bestanden); border-color: var(--bestanden); }
.ampel-gelb { color: var(--hinweis); border-color: var(--hinweis); }
.ampel-rot { color: var(--nein); border-color: var(--nein); }
.auswahl { display: grid; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--linie); }
.auswahl-form { margin: 8px 0; }
.vorbild blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--linie); color: var(--leise); }
.geaendert { border-color: var(--akzent); }
.saetze-liste { list-style: none; margin: 8px 0; padding: 0; }
.satz-zeile { display: grid; grid-template-columns: 2em 1fr; gap: 2px 8px; align-items: start; padding: 8px 4px; border-bottom: 1px solid var(--linie); border-radius: 8px; }
.satz-zeile:last-child { border-bottom: 0; }
.satz-rand { grid-column: 2; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.satz-hinweise, .satz-menue { grid-column: 2; }
.satz-menue summary { list-style: none; cursor: pointer; min-height: 36px; display: inline-flex; align-items: center; }
.satz-menue summary::-webkit-details-marker { display: none; }
.satz-menue-inhalt { display: grid; gap: 8px; padding: 8px 0; }
.alternative { background: var(--grund); border-radius: 10px; padding: 8px 12px; }
.spricht { background: var(--akzent); color: var(--auf-akzent); }
.anhoeren { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.vergleich-satz { padding: 8px 0; border-bottom: 1px solid var(--linie); }
.vergleich-satz p, .vergleich-felder p { margin: 0 0 4px; }
.vergleich-satz mark { background: var(--akzent); color: var(--auf-akzent); border-radius: 4px; padding: 0 2px; }
.vergleich ul { list-style: none; margin: 0 0 12px; padding: 0; }
.vorher del { color: var(--leise); }
.vergleich-felder li { padding: 8px 0; border-bottom: 1px solid var(--linie); }
.beispiel .formular { margin-top: 8px; }
.formular label.chip-wahl { display: inline-flex; font-weight: 400; font-size: 15px; }

/* Desktop (≥ 900 px): zwei Spalten, Leiste bleibt unten */
@media (min-width: 900px) {
  .seite { max-width: 1040px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; align-items: start; }
  .seite > .kopf, .seite > .karte, .seite > .meldungen, .seite > .ruhig, .seite > .wischen { grid-column: 1 / -1; }
  .seite > .wischen { max-width: 600px; margin: 0 auto; width: 100%; }
  .seite > .vergleich, .seite > .beispiel, .seite > h2, .seite > .stufen-nav, .seite > .leise { grid-column: 1 / -1; }
  .optionen { margin: 0; padding-inline: 0; }
  .option { flex: 1 1 0; }
  .satz-zeile { grid-template-columns: 2em 1fr auto; }
  .satz-rand { grid-column: auto; justify-content: flex-end; }
  body.schmal .seite { max-width: 520px; display: block; }
  details.menue > .blatt, .mehr-blatt { left: auto; right: 24px; bottom: 80px; width: 360px; border-radius: 18px; }
}
