/* =====================================================================
   Stundenplan-PWA – Gestaltung „Heft & Rotstift"
   Hell:   weißes Papier, Königsblau als Tinte, Änderungen wie Korrekturen
           (alter Wert rot durchgestrichen, Randstrich in der Farbe der Art –
           dieselben Farben wie im Desktop-Wocheneditor).
   Dunkel: „Tafel" – Kreideweiß auf Tafelgrün, Kreidegelb als Akzent.
   Nur Systemschriften (offline, keine externen Dienste).
   ===================================================================== */

:root {
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --seite: #eef2f8;
  --papier: #ffffff;
  --tinte: #1f2a44;          /* Blauschwarz wie Füllertinte */
  --leise: #56627c;
  --linie: #d6deeb;          /* Heftlinien */
  --kopf-bg: #2340a8;        /* Königsblau */
  --kopf-text: #ffffff;
  --akzent: #2340a8;
  --auf-akzent: #ffffff;
  --akzent-hell: #e4e9f8;
  --rot: #d0282d;            /* Rotstift */
  --auf-farbe: #ffffff;

  --vertretung: #24804a;  --vertretung-t: #e4f3e9;
  --entfall: #c8262b;     --entfall-t: #fce7e6;
  --verlegung: #a65e0a;   --verlegung-t: #fcefdc;
  --betreuung: #0f7690;   --betreuung-t: #dcf0f5;
  --raum: #8a6b00;        --raum-t: #faf1cf;
  --frei: #636e83;        --frei-t: #eef1f6;
  --sonst: #6a4fb3;       --sonst-t: #eeeafa;
  --klausur: #a1307a;     --klausur-t: #f9e4f1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --seite: #1c2a23;        /* Tafelgrün */
    --papier: #22322a;
    --tinte: #eef3ec;        /* Kreide */
    --leise: #a9b9ae;
    --linie: #3a4d43;
    --kopf-bg: #15201a;
    --kopf-text: #eef3ec;
    --akzent: #f0d264;       /* Kreidegelb */
    --auf-akzent: #1c2a23;
    --akzent-hell: #33442f;
    --rot: #ff8070;
    --auf-farbe: #15201a;

    --vertretung: #7ad49a;  --vertretung-t: #24412f;
    --entfall: #ff8070;     --entfall-t: #4a2723;
    --verlegung: #ffb660;   --verlegung-t: #463419;
    --betreuung: #69cfe3;   --betreuung-t: #1b3b43;
    --raum: #e9cd52;        --raum-t: #433d1a;
    --frei: #9fb0a5;        --frei-t: #2a3a31;
    --sonst: #c3b2ff;       --sonst-t: #34304c;
    --klausur: #f08cc8;     --klausur-t: #45253a;
  }
}

* { box-sizing: border-box; }

/* hidden gilt immer – auch für Elemente, denen das Layout ein display gibt. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.4;
  background: var(--seite);
  color: var(--tinte);
}

button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

.vh {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

/* ---------------- Kopf ---------------- */

.kopf {
  background: var(--kopf-bg);
  color: var(--kopf-text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px 16px;
}
.kopf h1 {
  flex: 1;
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.symbol {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: none; border-radius: 50%;
  background: transparent;
  color: inherit;
}
.symbol:hover { background: rgba(255, 255, 255, 0.12); }
/* Kontoknopf: Ring in Kopffarbe; ohne Anmeldung gestrichelt („nicht angemeldet"). */
#kontoKnopf { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); }
#kontoKnopf.abgemeldet { box-shadow: none; outline: 2px dashed rgba(255, 255, 255, 0.45); outline-offset: -4px; }
.laedt .symbol svg { animation: drehen 0.9s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

/* ---------------- Inhalt ---------------- */

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 16px 8px 16px;
}

.auswahl { display: grid; gap: 10px; margin-bottom: 12px; }

.modi {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: var(--papier);
  padding: 3px;
  gap: 3px;
}
/* Spalten gleich breit, solange der Platz reicht; sonst bekommt das längste Wort
   („Lehrkraft") etwas mehr Raum – es wird nie abgeschnitten. */
.modi button {
  border: none;
  border-radius: 7px;
  background: transparent;
  padding: 8px 4px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--leise);
  white-space: nowrap;
}
.modi button[aria-pressed="true"] { background: var(--akzent); color: var(--auf-akzent); }

.wahl select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: var(--papier);
  font-size: 1.05rem;
  font-weight: 600;
}

/* Schülersuche (Personal) */
.suche { display: grid; gap: 6px; min-width: 0; }
.suche input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: var(--papier);
  font-size: 1.05rem;
  font-weight: 600;
}
.suche input::placeholder { color: var(--leise); font-weight: 500; }
.such-info { margin: 0 2px; font-size: 0.85rem; color: var(--leise); }
.such-info:empty { display: none; }
.treffer {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: 10px;
  max-height: min(50vh, 420px);
  overflow-y: auto;
}
.treffer li + li { border-top: 1px solid var(--linie); }
.treffer-knopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  background: transparent;
  text-align: left;
}
.treffer-knopf:hover, .treffer-knopf:focus-visible { background: var(--akzent-hell); }
.t-name { font-weight: 600; overflow-wrap: anywhere; }
.t-klasse { flex: none; color: var(--leise); font-variant-numeric: tabular-nums; }

/* Wochenleiste */
.woche {
  display: grid;
  grid-template-columns: 44px 1fr 44px auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.pfeil {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: var(--papier);
}
.woche-titel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  min-width: 0;
}
.zeitraum { font-weight: 650; font-size: 1.02rem; text-align: center; text-wrap: balance; }
.kw { font-size: 0.8rem; color: var(--leise); font-variant-numeric: tabular-nums; }
/* Unsichtbares Datumsfeld über dem Titel: Antippen öffnet die Datumsauswahl. */
.woche-titel input[type="date"] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
}
.woche-titel:focus-within { outline: 3px solid var(--akzent); outline-offset: 2px; border-radius: 8px; }
.textknopf {
  border: none;
  background: none;
  color: var(--akzent);
  font-weight: 650;
  padding: 10px 6px;
}

/* Tagesreiter (Handy) */
.tage {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 4px;
  margin-bottom: 8px;
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 2px 8px 2px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--tinte);
}
.tab .wt { font-size: 0.8rem; color: var(--leise); }
.tab .dt { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tab .frei-text { font-size: 0.7rem; color: var(--leise); }
.tab.frei .dt { color: var(--leise); font-weight: 500; }
.tab.heute .dt { text-decoration: underline 3px var(--akzent); text-underline-offset: 4px; }
.tab[aria-selected="true"] { background: var(--akzent); color: var(--auf-akzent); }
.tab[aria-selected="true"] .wt,
.tab[aria-selected="true"] .frei-text,
.tab[aria-selected="true"].frei .dt { color: var(--auf-akzent); }
.tab[aria-selected="true"].heute .dt { text-decoration-color: var(--auf-akzent); }
/* Roter Punkt: An diesem Tag gibt es Änderungen. */
.tab.hat-aenderung::after {
  content: "";
  position: absolute;
  top: 6px; right: calc(50% - 22px);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rot);
  box-shadow: 0 0 0 2px var(--seite);
}

.werkzeuge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 8px 0;
}
.tag-titel { margin: 0; font-size: 1.1rem; font-weight: 700; }
.schalter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--leise);
  white-space: nowrap;
  cursor: pointer;
}
.schalter input { width: 20px; height: 20px; accent-color: var(--akzent); margin: 0; }

.meldung {
  margin: 18px 4px;
  padding: 16px;
  border-left: 4px solid var(--akzent);
  background: var(--papier);
  color: var(--tinte);
}

/* ---------------- Tagesliste (Handy) ---------------- */

.liste {
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: 12px;
  overflow: hidden;
}
.liste:empty { display: none; }

.std-zeile {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  border-top: 1px solid var(--linie);
}
.std-zeile:first-child { border-top: none; }
.std-nr {
  padding: 10px 8px 0 0;
  text-align: right;
  font-size: 1.35rem;
  font-weight: 750;
  color: var(--akzent);
  font-variant-numeric: tabular-nums;
}
.std-eintraege { min-width: 0; }
/* Freie Stunde (Lücke) in der Tagesliste: schmal und zurückgenommen */
.frei-zeile .std-nr { padding-top: 6px; font-size: 1.1rem; color: var(--leise); font-weight: 650; }
.keine { padding: 6px 12px 7px 14px; color: var(--leise); }

.leer, .tagfrei {
  padding: 22px 16px;
  color: var(--leise);
}
.tagfrei {
  font-weight: 650;
  font-size: 1.05rem;
  background-image: repeating-linear-gradient(135deg, transparent 0 9px, var(--linie) 9px 10px);
}

/* ---------------- Eintrag (eine Stunde) ---------------- */

.eintrag {
  padding: 9px 12px 10px 10px;
  border-left: 4px solid transparent;
  min-width: 0;
}
.eintrag + .eintrag { border-top: 1px dashed var(--linie); }

.e-oben, .e-unten {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.e-unten { margin-top: 1px; }
.fach { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.raum { color: var(--leise); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wer { color: var(--leise); overflow-wrap: anywhere; }
.badge {
  flex: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--auf-farbe);
  background: var(--frei);
  white-space: nowrap;
}

/* Korrektur: alter Wert rot gestrichen, neuer daneben */
s.alt {
  color: var(--leise);
  text-decoration-line: line-through;
  text-decoration-color: var(--rot);
  text-decoration-thickness: 2px;
}
.neu { font-weight: 700; color: var(--tinte); }

/* Änderungsarten: Randstrich + Tönung + Abzeichen */
.eintrag.vertretung { border-left-color: var(--vertretung); background: var(--vertretung-t); }
.eintrag.vertretung .badge { background: var(--vertretung); }
.eintrag.entfall    { border-left-color: var(--entfall); background: var(--entfall-t); }
.eintrag.entfall .badge { background: var(--entfall); }
.eintrag.verlegung  { border-left-color: var(--verlegung); background: var(--verlegung-t); }
.eintrag.verlegung .badge { background: var(--verlegung); }
.eintrag.betreuung  { border-left-color: var(--betreuung); background: var(--betreuung-t); }
.eintrag.betreuung .badge { background: var(--betreuung); }
.eintrag.raumwechsel { border-left-color: var(--raum); background: var(--raum-t); }
.eintrag.raumwechsel .badge { background: var(--raum); }
.eintrag.frei       { border-left-color: var(--frei); background: var(--frei-t); }
.eintrag.frei .badge { background: var(--frei); }
.eintrag.sonst      { border-left-color: var(--sonst); background: var(--sonst-t); }
.eintrag.sonst .badge { background: var(--sonst); }
.eintrag.klausur    { border-left-color: var(--klausur); background: var(--klausur-t); }
.eintrag.klausur .badge { background: var(--klausur); }

/* Entfall/verlegt/frei: ganze Stunde mit dem Rotstift gestrichen */
.eintrag.gestrichen .fach,
.eintrag.gestrichen .wer,
.eintrag.gestrichen .raum {
  text-decoration-line: line-through;
  text-decoration-color: var(--rot);
  text-decoration-thickness: 2px;
}
.eintrag.gestrichen .fach { color: var(--leise); }

/* Bereitschaft, UV, Pseudofächer: Dienst der Lehrkraft, kein Unterricht */
.eintrag.dienst { border-left: 4px dotted var(--linie); }
.eintrag.dienst .fach { font-weight: 550; color: var(--leise); }

/* Lehrersicht: eigene Stunde wird von jemand anderem gehalten */
.eintrag.fuer-mich-frei .fach { color: var(--leise); }

/* ---------------- Wochenraster (breit / Handy quer) ---------------- */

.raster-huelle { display: none; }

.raster {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--papier);
}
.raster th, .raster td { border: 1px solid var(--linie); vertical-align: top; }
.raster thead th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 650;
  background: var(--papier);
}
.raster thead th .wt { display: block; }
.raster thead th .dt { display: block; font-size: 0.82rem; color: var(--leise); font-weight: 500; font-variant-numeric: tabular-nums; }
.raster thead th.heute { box-shadow: inset 0 -4px 0 var(--akzent); }
.raster thead th.hat-aenderung .wt::after {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--rot);
  vertical-align: middle;
}
.raster .ecke { width: 2.8rem; }
.raster tbody th {
  width: 2.8rem;
  padding-top: 8px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--akzent);
  font-variant-numeric: tabular-nums;
}
.raster td { padding: 0; height: 3.4rem; }
.raster td.tagfrei {
  vertical-align: middle;
  text-align: center;
  font-size: 1rem;
}
.raster .eintrag { padding: 6px 8px 7px 7px; font-size: 0.9rem; }
.raster .wt-kurz { display: none; }
/* Im Raster darf der Raum unter das Fach rutschen, statt das Fach zu trennen. */
.raster .e-oben { flex-wrap: wrap; column-gap: 8px; row-gap: 0; }
.raster .fach { overflow-wrap: normal; }
.raster .fach { font-size: 0.95rem; }
.raster .badge { font-size: 0.7rem; padding: 1px 7px; }
.raster .e-unten { flex-wrap: wrap; gap: 2px 8px; }

/* Breit (oder Handy quer ab 600 px): Auswahl oben, darunter Wochenleiste mit
   Schalter rechts, dann das Raster. */
@media (min-width: 760px), (orientation: landscape) and (min-width: 600px) {
  #inhalt {
    max-width: 1180px;
    padding-top: 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "auswahl auswahl"
      "woche   werkzeuge"
      "meldung meldung"
      "raster  raster";
    column-gap: 16px;
    align-items: center;
  }
  .auswahl { grid-area: auswahl; grid-template-columns: minmax(300px, 380px) minmax(220px, 360px); justify-content: start; align-items: start; }
  .woche { grid-area: woche; grid-template-columns: 44px auto 44px auto; justify-content: start; gap: 10px; }
  .woche-titel { align-items: flex-start; padding: 0 6px; }
  .zeitraum { text-align: left; white-space: nowrap; }
  .werkzeuge { grid-area: werkzeuge; margin: 0 0 10px 0; }
  .meldung { grid-area: meldung; }
  .tage, .tag-titel, .liste { display: none; }
  .raster-huelle {
    grid-area: raster;
    display: block;
    overflow-x: auto;
    border: 1px solid var(--linie);
    border-radius: 12px;
  }
  .raster-huelle:empty { display: none; }
}

/* ---------------- Fuß ---------------- */

.fuss {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px calc(22px + env(safe-area-inset-bottom, 0px)) 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  font-size: 0.8rem;
  color: var(--leise);
}
.stand.offline { color: var(--rot); font-weight: 650; }

/* ---------------- Anmeldung ---------------- */

main.anmeldung {
  max-width: 440px;
  padding-top: clamp(18px, 6vh, 56px);
}
.karte {
  display: grid;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: 14px;
  padding: 22px 20px 18px 20px;
}
.karte-titel { margin: 0 0 6px 0; font-size: 1.35rem; font-weight: 750; }
.feld { margin: 14px 0 6px 0; font-weight: 650; font-size: 0.95rem; }
.karte input[type="text"],
.karte input[type="password"] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: var(--seite);
  font-size: 1.05rem; /* mindestens 16 px: iOS zoomt sonst beim Antippen */
}
.passwort { position: relative; }
.passwort input { padding-right: 104px !important; }
.passwort .textknopf {
  position: absolute;
  top: 50%; right: 4px;
  transform: translateY(-50%);
  padding: 8px 10px;
}
.textknopf.klein { font-size: 0.88rem; }
.schalter.bleiben { margin-top: 16px; color: var(--tinte); font-size: 1rem; justify-self: start; }
.kleingedruckt { margin: 4px 0 0 28px; font-size: 0.82rem; color: var(--leise); }
.hinweis {
  margin: 4px 0 2px 0;
  padding: 10px 12px;
  border-left: 4px solid var(--akzent);
  background: var(--akzent-hell);
  border-radius: 0 8px 8px 0;
}
/* Fehler im Rotstift-Stil */
.fehler {
  margin: 14px 0 0 0;
  padding: 10px 12px;
  border-left: 4px solid var(--rot);
  background: var(--entfall-t);
  border-radius: 0 8px 8px 0;
  font-weight: 600;
}
.fehler.klein { margin: 6px 6px; font-size: 0.9rem; font-weight: 500; }
.hauptknopf {
  margin-top: 18px;
  padding: 13px 16px;
  border: none;
  border-radius: 10px;
  background: var(--akzent);
  color: var(--auf-akzent);
  font-weight: 700;
  font-size: 1.05rem;
}
.hauptknopf:disabled { opacity: 0.65; cursor: progress; }
#ohneAnmeldung { margin-top: 8px; justify-self: center; }

/* ---------------- Kontomenü ---------------- */

.konto {
  margin: calc(62px + env(safe-area-inset-top, 0px)) 12px auto auto;
  width: min(330px, calc(100vw - 24px));
  padding: 6px;
  border: 1px solid var(--linie);
  border-radius: 14px;
  background: var(--papier);
  color: var(--tinte);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}
.konto::backdrop { background: rgba(10, 16, 32, 0.35); }
.konto-kopf { padding: 12px 12px 10px 12px; border-bottom: 1px solid var(--linie); margin-bottom: 4px; }
.konto-name { margin: 0; font-weight: 750; font-size: 1.12rem; overflow-wrap: anywhere; }
.konto-info { margin: 3px 0 0 0; font-size: 0.85rem; color: var(--leise); }
.menuepunkt {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  font-weight: 600;
}
.menuepunkt:hover { background: var(--akzent-hell); }
.menuepunkt.leise { color: var(--leise); font-weight: 500; }
.menuepunkt.warnung { color: var(--rot); font-weight: 700; background: var(--entfall-t); }
.menuepunkt.schliessen { color: var(--akzent); border-top: 1px solid var(--linie); border-radius: 0 0 9px 9px; margin-top: 4px; }

/* =====================================================================
   Konten (Phase 2, Schritt 5): Passwort, Verwaltung, Dialoge, Zugangszettel
   ===================================================================== */

/* Eingabefelder außerhalb der Anmeldekarte im selben Stil */
.pw-form { display: grid; }
.pw-form input[type="text"],
.pw-form input[type="password"],
.eingabe {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: var(--seite);
  font-size: 1.05rem; /* mindestens 16 px: iOS zoomt sonst */
}
.pw-form input { padding: 12px; }
select.eingabe { background: var(--papier); font-weight: 600; }
.eingabe::placeholder { color: var(--leise); }
.regel { margin: 6px 2px 0 2px; font-size: 0.85rem; color: var(--leise); }
.kleingedruckt.ohne-einzug { margin-left: 0; }
.hauptknopf.klein { margin-top: 0; padding: 10px 14px; font-size: 0.98rem; }
.knopfreihe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 16px; }
.knopfreihe .hauptknopf { margin-top: 0; }
.knopfreihe.klein { margin: 0 0 6px 0; gap: 4px 10px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace; overflow-wrap: anywhere; }
.passwort-text {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---- Verwaltung ---- */
main.verwaltung { max-width: 920px; }
.verw-kopf { display: flex; align-items: center; margin: -6px 0 6px -6px; }
.verw-kopf .textknopf { display: inline-flex; align-items: center; gap: 4px; }
.verw-reiter { margin-bottom: 12px; }
.verw-reiter button[aria-selected="true"] { background: var(--akzent); color: var(--auf-akzent); }
/* Phase 5.2c-2: fünf Reiter der Kontenverwaltung – auf schmalen Handys zweizeilig statt abgeschnitten (gleich breit,
   solange Platz ist); die Reiter des Klassenbuchs bleiben, wie sie sind. */
#verwReiter, #schTeile { display: flex; flex-wrap: wrap; }
#verwReiter button, #schTeile button { flex: 1 1 0; min-width: max-content; min-height: 44px; }
/* Phase 5.2c-2: Reiter „SchILD“ – Vorschläge und Importprotokoll */
.sch-teile { margin-bottom: 10px; }
.sch-liste .p-eintrag { gap: 3px; }
.sch-liste .knopfreihe.klein { margin: 6px 0 0 0; }
.sch-knopf { min-height: 44px; }
.p-eintrag.sch-uebernehmen { border-left: 4px solid var(--akzent); }
.p-eintrag.sch-entfernen { border-left: 4px solid var(--verlegung); }
.p-text .marke { margin-left: 6px; }
#sLeitungBox { margin-top: 10px; }

.k-werkzeuge { display: grid; gap: 8px; margin-bottom: 6px; }
.k-filter { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.k-filter select[hidden] ~ select { grid-column: 1 / -1; }
#kNeu { justify-self: start; }
@media (min-width: 760px) {
  .k-werkzeuge { grid-template-columns: 1fr auto auto; align-items: center; }
  .k-filter { grid-template-columns: auto auto; }
}
#kInfo, #pInfo { margin: 6px 2px 8px 2px; }

.k-liste, .p-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: 12px;
  overflow: hidden;
}
.k-liste:empty, .p-liste:empty { display: none; }
.k-liste li + li, .p-liste li + li { border-top: 1px solid var(--linie); }
.k-zeile {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 12px 11px 12px;
  border: none;
  border-left: 4px solid transparent;
  background: transparent;
  text-align: left;
}
.k-zeile:hover, .k-zeile:focus-visible { background: var(--akzent-hell); }
.k-zeile.gesperrt { border-left-color: var(--rot); }
.k-zeile.gesperrt .k-name { color: var(--leise); text-decoration: line-through 2px var(--rot); }
.k-oben { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.k-name { font-weight: 700; overflow-wrap: anywhere; }
.k-rechts { flex: none; color: var(--leise); font-weight: 600; font-variant-numeric: tabular-nums; }
.k-unten { color: var(--leise); font-size: 0.88rem; overflow-wrap: anywhere; }
.k-marken { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.marke {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  color: var(--auf-farbe);
  background: var(--frei);
}
.marke.ich { background: var(--akzent); color: var(--auf-akzent); }
.marke.gesperrt { background: var(--entfall); }
.marke.start { background: var(--verlegung); }

/* Protokoll */
.p-eintrag { display: grid; gap: 1px; padding: 9px 12px 10px 12px; }
.p-zeit { font-size: 0.8rem; color: var(--leise); font-variant-numeric: tabular-nums; }
.p-text { overflow-wrap: anywhere; }
.p-wer { color: var(--leise); }
.p-details { font-size: 0.86rem; color: var(--leise); overflow-wrap: anywhere; }

/* Sammelanlage */
.sammel-karte { margin-bottom: 12px; }
.art-wahl { border: none; margin: 4px 0 0 0; padding: 0; display: grid; gap: 4px; }
.art-wahl legend { padding: 0; margin-bottom: 4px; }
.schalter.gross { color: var(--tinte); font-size: 1rem; white-space: normal; padding: 6px 0; }
.gruppen { display: grid; gap: 10px; }
.gruppen-titel { margin: 4px 0 4px 2px; font-size: 0.85rem; font-weight: 700; color: var(--leise); }
.gruppen-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.gruppe-wahl {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "box name" "box zahl";
  column-gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--linie);
  border-radius: 9px;
  background: var(--seite);
  cursor: pointer;
}
.gruppe-wahl input { grid-area: box; width: 20px; height: 20px; margin: 0; accent-color: var(--akzent); }
.gruppe-wahl .g-name { grid-area: name; font-weight: 700; }
.gruppe-wahl .g-zahl { grid-area: zahl; font-size: 0.75rem; color: var(--leise); }
.gruppe-wahl:has(input:checked) { border-color: var(--akzent); background: var(--akzent-hell); }
.gruppe-wahl.fertig .g-name { color: var(--leise); }
.sammel-info { margin: 0 0 10px 0; color: var(--leise); }
.tabelle-huelle { overflow-x: auto; margin-top: 12px; border: 1px solid var(--linie); border-radius: 10px; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.tabelle th, .tabelle td { padding: 7px 10px; text-align: left; vertical-align: top; border-top: 1px solid var(--linie); }
.tabelle thead th { border-top: none; font-size: 0.82rem; color: var(--leise); background: var(--papier); }
.tabelle .spalte-wahl { width: 36px; padding-right: 0; }
.tabelle .spalte-wahl input { width: 20px; height: 20px; margin: 0; accent-color: var(--akzent); }
.tabelle tr.z-vorhanden td { color: var(--leise); }
.tabelle tr.z-konflikt td { background: var(--entfall-t); }
.tabelle .t-klasse { color: var(--leise); }
.tabelle .mono { white-space: nowrap; overflow-wrap: normal; }
.z-hinweis { display: block; font-size: 0.8rem; color: var(--leise); }
#sFertig { margin-top: 12px; justify-self: start; }
#sVorschau { justify-self: start; min-width: 220px; }

/* ---- Dialoge ---- */
.fenster {
  width: min(500px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 20px 18px 14px 18px;
  border: 1px solid var(--linie);
  border-radius: 14px;
  background: var(--papier);
  color: var(--tinte);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}
.fenster::backdrop { background: rgba(10, 16, 32, 0.4); }
.fenster form { display: grid; }
.fenster .hauptknopf { margin-top: 0; }
/* Im Dialog: eigener, flächiger Knopf ohne Trennlinie (die Linie bog sich sonst mit den runden Ecken). */
.fenster .menuepunkt.schliessen { margin-top: 10px; border-top: none; border-radius: 9px; background: var(--seite); text-align: center; }
.fenster .menuepunkt.schliessen:hover { background: var(--akzent-hell); }
#pwDialog .pw-form .hauptknopf { margin-top: 18px; }

.kd-kopf { border-bottom: 1px solid var(--linie); padding-bottom: 10px; margin-bottom: 6px; }
.kd-daten { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 8px 0 0 0; font-size: 0.92rem; }
.kd-daten dt { color: var(--leise); }
.kd-daten dd { margin: 0; overflow-wrap: anywhere; }
.kd-aktionen { display: grid; }
.kd-hinweis { margin: 8px 12px; color: var(--leise); font-size: 0.92rem; }

.gewaehlt {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px 0;
  padding: 10px 12px;
  border-left: 4px solid var(--akzent);
  background: var(--akzent-hell);
  border-radius: 0 8px 8px 0;
  font-weight: 650;
}
.gewaehlt .g-klasse { color: var(--leise); }
#kfTreffer { margin-top: 6px; max-height: 240px; }

.sp-fuer { margin: 0 0 12px 0; font-weight: 650; }
.sp-daten {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  align-items: baseline;
  padding: 14px;
  border: 2px dashed var(--linie);
  border-radius: 10px;
  background: var(--seite);
}
.sp-etikett { color: var(--leise); font-size: 0.88rem; }
.sp-wert { font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
#spPasswort { font-size: 1.35rem; color: var(--akzent); }

/* =====================================================================
   Klassenbuch (Phase 3.1): Stundenblatt, Gruppe zusammenstellen, Gruppen
   ===================================================================== */

/* Plan: Stunden mit Klassenbuch sind antippbar */
.eintrag.kb-ja { cursor: pointer; }
.eintrag.kb-ja:hover { box-shadow: inset 0 0 0 2px var(--akzent-hell); }
.eintrag.kb-ja:active { box-shadow: inset 0 0 0 2px var(--akzent); }
.eintrag.kb-ja:focus-visible { outline: 3px solid var(--akzent); outline-offset: -3px; }
.e-rechts { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.kb-symbol { display: inline-grid; place-items: center; color: var(--leise); }
.kb-symbol.ok { color: var(--vertretung); }
.raster .kb-symbol svg { width: 14px; height: 14px; }

main.klassenbuch { max-width: 720px; padding-bottom: 0; }
.kb-bereich { display: grid; gap: 10px; }
.kb-kopf { padding: 14px 16px; gap: 2px; }
.kb-wann { margin: 0; font-size: 0.88rem; font-weight: 600; color: var(--leise); }
.kb-fach { margin: 0; font-size: 1.35rem; font-weight: 750; overflow-wrap: anywhere; }
.kb-wer { margin: 2px 0 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.kb-wer:empty { display: none; }
.kb-raum { color: var(--leise); }
.kb-erfasst { margin: 6px 0 0 0; font-size: 0.9rem; color: var(--leise); }
.kb-erfasst:empty { display: none; }
.kb-ok { color: var(--vertretung); font-weight: 700; }
.kb-offen { color: var(--verlegung); font-weight: 650; }
.kb-sperre { display: block; margin-top: 2px; color: var(--verlegung); font-weight: 600; }
.marke.kb-art.vertretung { background: var(--vertretung); }
.marke.kb-art.verlegung { background: var(--verlegung); }
.marke.kb-art.betreuung { background: var(--betreuung); }
.marke.kb-art.raumwechsel { background: var(--raum); }
.marke.kb-art.sonst { background: var(--sonst); }
.marke.kb-art.klausur { background: var(--klausur); }
#kbHinweise:empty, #kbOffen:empty { display: none; }
#kbHinweise, #kbOffen { display: grid; gap: 8px; }
#kbHinweise .hinweis { margin: 0; }

.kb-gruppe-offen { gap: 8px; padding: 14px 16px; border-left: 4px solid var(--verlegung); border-radius: 0 14px 14px 0; }
.kb-go-titel { margin: 0; font-weight: 700; }
.kb-gruppe-offen .hauptknopf { justify-self: start; }

.kb-listekopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 2px -6px 2px; }
.kb-zahlen { margin: 0; font-size: 0.88rem; color: var(--leise); font-variant-numeric: tabular-nums; }
.kb-listekopf .textknopf { flex: none; white-space: nowrap; }

/* Teilnehmerliste */
.kb-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: 12px;
  overflow: hidden;
}
.kb-liste:empty { display: none; }
.kb-zeile { display: grid; grid-template-columns: 1fr 48px; border-left: 4px solid transparent; }
.kb-zeile + .kb-zeile { border-top: 1px solid var(--linie); }
.kb-person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  padding: 7px 8px 7px 12px;
  border: none;
  background: transparent;
  text-align: left;
}
.kb-person.nur-lesen { grid-column: 1 / -1; padding-right: 12px; }
button.kb-person:hover { background: var(--akzent-hell); }
.kb-person:focus-visible, .kb-mehr:focus-visible { outline-offset: -3px; }
.kb-namezeile { display: grid; min-width: 0; }
.kb-name { font-weight: 650; overflow-wrap: anywhere; }
.kb-unter { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 0.8rem; color: var(--leise); }
.kb-ausser { font-style: italic; }
.kb-status {
  flex: none;
  padding: 2px 9px;
  border: 1px solid var(--linie);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--leise);
  white-space: nowrap;
}
.kb-zeile.s-da .kb-status { border-color: transparent; padding-right: 2px; font-weight: 600; }
.kb-mehr {
  border: none;
  border-left: 1px solid var(--linie);
  background: transparent;
  color: var(--leise);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}
.kb-mehr:hover { background: var(--akzent-hell); color: var(--tinte); }
.kb-zeile.s-fehlt   { border-left-color: var(--entfall);   background: var(--entfall-t); }
.kb-zeile.s-spaet   { border-left-color: var(--verlegung); background: var(--verlegung-t); }
.kb-zeile.s-urlaub  { border-left-color: var(--betreuung); background: var(--betreuung-t); }
.kb-zeile.s-veranst { border-left-color: var(--sonst);     background: var(--sonst-t); }
.kb-zeile.s-fehlt .kb-status   { background: var(--entfall);   color: var(--auf-farbe); border-color: transparent; }
.kb-zeile.s-spaet .kb-status   { background: var(--verlegung); color: var(--auf-farbe); border-color: transparent; }
.kb-zeile.s-urlaub .kb-status  { background: var(--betreuung); color: var(--auf-farbe); border-color: transparent; }
.kb-zeile.s-veranst .kb-status { background: var(--sonst);     color: var(--auf-farbe); border-color: transparent; }

/* Leiste mit Speichern: bleibt beim Blättern unten sichtbar */
.kb-leiste {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 4px -16px 0 -16px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) 16px;
  background: var(--seite);
  border-top: 1px solid var(--linie);
}
.kb-leiste .hauptknopf { margin-top: 0; flex: 1 1 220px; }
.kb-leiste .hauptknopf:disabled { cursor: default; }
/* „Gespeichert": ruhiger Zustand statt ausgegrautem Hauptknopf */
.kb-leiste .hauptknopf.gespeichert:disabled {
  opacity: 1;
  background: var(--vertretung-t);
  color: var(--vertretung);
  box-shadow: inset 0 0 0 1px var(--vertretung);
}
.kb-leiste.ungespeichert .hauptknopf:not(:disabled) { box-shadow: 0 0 0 3px var(--akzent-hell); }
/* Nachtrag 3.4: „Noch nicht gespeichert" links neben dem Knopf (Rotstift); bricht auf
   schmalen Handys zweizeilig um, der Knopf bleibt in derselben Zeile. */
.kb-ungespeichert {
  flex: 0 1 auto;
  max-width: 15em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--rot);
  font-weight: 750;
  font-size: 0.92rem;
  line-height: 1.2;
}
.kb-ungespeichert::before {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rot);
}
.kb-leiste.ungespeichert .hauptknopf { flex-basis: 140px; }
@media (max-width: 380px) {
  .kb-ungespeichert { max-width: 7.2em; font-size: 0.88rem; }
}
/* Einträge-Karte: Einträge werden sofort gespeichert (nicht über die Leiste) */
.ke-sofort {
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--akzent-hell);
  color: var(--tinte);
  font-size: 0.85rem;
  line-height: 1.35;
}
#kbFehler, #kgFehler { margin: 0; }
/* Doppelstunde: Schalter und Hinweis über dem Speichern-Knopf */
.kb-folge { flex: 1 1 100%; color: var(--tinte); font-weight: 600; white-space: normal; min-height: 32px; }
.kb-folge-info { flex: 1 1 100%; margin: -4px 0 0 0; font-size: 0.85rem; color: var(--leise); }
.kb-folge:not([hidden]) + .kb-folge-info { margin-left: 28px; }

/* Statusdialog */
.ks-wahl { display: grid; gap: 6px; margin-top: 10px; }
.ks-knopf {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: var(--seite);
  text-align: left;
  font-weight: 650;
}
.ks-knopf:hover { background: var(--akzent-hell); }
.ks-knopf[aria-pressed="true"] { border-color: var(--akzent); box-shadow: inset 0 0 0 1px var(--akzent); background: var(--akzent-hell); }
.ks-punkt { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--linie); }
.ks-knopf.s-da .ks-punkt      { background: var(--vertretung); }
.ks-knopf.s-fehlt .ks-punkt   { background: var(--entfall); }
.ks-knopf.s-spaet .ks-punkt   { background: var(--verlegung); }
.ks-knopf.s-urlaub .ks-punkt  { background: var(--betreuung); }
.ks-knopf.s-veranst .ks-punkt { background: var(--sonst); }
.ks-minuten-feld { display: grid; }
.ks-minuten { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ks-minuten input { width: 7.5rem; }
.ks-schnell { display: flex; gap: 4px; }
.ks-schnell .textknopf { min-width: 44px; min-height: 42px; border: 1px solid var(--linie); border-radius: 8px; }
.ks-minuten-feld .hauptknopf { margin-top: 12px; }

/* Historie */
.kh-liste { margin-top: 8px; }

/* Gruppe zusammenstellen */
.kg-werkzeuge { display: grid; gap: 4px; }
.kg-werkzeuge .knopfreihe { margin: 0; }
.kg-klassen { display: grid; gap: 10px; }
.kg-klasse {
  min-width: 0;
  margin: 0;
  padding: 10px 12px 10px 12px;
  border: 1px solid var(--linie);
  border-radius: 12px;
  background: var(--papier);
}
.kg-legende { float: left; width: 100%; display: flex; align-items: baseline; gap: 10px; padding: 0; margin: 0 0 2px 0; }
.kg-legende + * { clear: both; }
.kg-kname { font-weight: 750; font-size: 1.05rem; }
.kg-kzahl { font-size: 0.85rem; font-weight: 600; color: var(--leise); font-variant-numeric: tabular-nums; }
.kg-kknoepfe { margin: 0 0 4px 0; }
.kg-kknoepfe .textknopf { padding: 6px 6px; }
.kg-namen { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 10px; }
.kg-name { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.kg-name:hover { background: var(--akzent-hell); }
.kg-name input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--akzent); }
.kg-name:has(input:checked) { font-weight: 650; }
.kg-name:has(input:disabled) { cursor: default; }
.kg-name:has(input:disabled):hover { background: transparent; }
.k-zeile.kg-offen { border-left-color: var(--verlegung); }
.kgs-erklaerung { margin: 0 2px; }
#kgsInfo { margin: 0 2px; }
/* Im Klassenbuch erscheint die Rückmeldung oben unter dem Kopf – nicht über der Speichern-Leiste */
main.klassenbuch:not([hidden]) ~ .toast { bottom: auto; top: calc(74px + env(safe-area-inset-top, 0px)); }
main.fehlzeiten:not([hidden]) ~ .toast { bottom: auto; top: calc(74px + env(safe-area-inset-top, 0px)); }

/* =====================================================================
   Fehlzeiten (Phase 3.2)
   ===================================================================== */

main.fehlzeiten { max-width: 760px; }
.fz-bereich { display: grid; gap: 10px; margin-bottom: 12px; }
.fz-wahl { margin: 0; }
.fz-wahl button { min-height: 44px; }   /* Phase 4.1: Tippflächen ≥ 44 px */
.fz-wahl button[aria-pressed="true"] { background: var(--akzent); color: var(--auf-akzent); }
#fzNeFilter { margin: 0; }
#fzNeInfo, #fzKurseInfo, #fzEintraegeInfo { margin: 0 2px; }
.fz-titel { margin: 6px 2px 0 2px; font-size: 1rem; font-weight: 750; }
.fz-kopfzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fz-kopfzeile .fz-titel { margin: 0; }
.fz-entsch:empty, #fzFaecher:empty { display: none; }
.fz-entsch .such-info { margin: 0 2px; }

/* Summen */
.fz-summe { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.fz-karte {
  display: grid;
  gap: 1px;
  padding: 12px 14px;
  border: 1px solid var(--linie);
  border-left: 4px solid var(--vertretung);
  border-radius: 0 12px 12px 0;
  background: var(--papier);
}
.fz-karte.offen { border-left-color: var(--verlegung); }
.fz-karte.unent { border-left-color: var(--entfall); }
.fz-zahl { font-size: 1.7rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fz-was { font-weight: 650; }
.fz-details { font-size: 0.82rem; color: var(--leise); }

/* Tabellen (Klasse/Stufe, Unterricht, Fächer) */
.fz-huelle { margin-top: 0; background: var(--papier); }
.fz-tabelle th[scope="row"] { font-weight: 600; }
.fz-tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; width: 3.4rem; padding-left: 4px; }
.fz-tabelle th, .fz-tabelle td { padding-top: 5px; padding-bottom: 5px; }
@media (max-width: 420px) {
  .fz-tabelle { font-size: 0.88rem; }
  .fz-tabelle .zahl { width: 2.8rem; padding-right: 8px; }
}
/* Kleine Handys (≤ 360 px): alle Spalten ohne seitliches Wischen */
@media (max-width: 360px) {
  .fz-tabelle { font-size: 0.82rem; }
  .fz-tabelle th, .fz-tabelle td { padding-left: 6px; padding-right: 6px; }
  .fz-tabelle .zahl { width: 2.55rem; padding-left: 2px; padding-right: 5px; }
  .fz-tabelle thead th { font-size: 0.7rem; }
}
/* Handy quer (wenig Höhe): Speichern-Leiste und Kopf des Stundenblatts flacher */
@media (orientation: landscape) and (max-height: 500px) {
  .kb-leiste { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); gap: 4px 12px; }
  .kb-leiste .hauptknopf { padding: 8px 14px; font-size: 0.98rem; min-height: 44px; }
  .kb-folge { min-height: 26px; }
  .kb-folge-info { margin-top: -2px; }
  .kb-kopf { padding: 10px 14px; }
  .kb-fach { font-size: 1.15rem; }
}
.fz-tabelle td.offen { color: var(--verlegung); font-weight: 750; }
.fz-tabelle td.unent { color: var(--entfall); font-weight: 750; }
.fz-tabelle abbr { text-decoration: none; }
.fz-name {
  display: grid;
  width: 100%;
  min-height: 40px;
  padding: 4px 0;
  border: none;
  background: none;
  text-align: left;
  font-weight: 650;
  color: var(--akzent);
}
.fz-name:hover { text-decoration: underline; }
.fz-klasse { display: block; font-size: 0.78rem; font-weight: 500; color: var(--leise); }

/* ---- Phase 4.1: Zeitraum, Konferenzübersicht, offene Fälle ---- */
.fz-zeitraum { display: grid; gap: 8px; margin-bottom: 12px; }
.fz-zr-wahl button { min-height: 44px; }
.fz-zr-wahl .zr-kurz { display: none; }
.fz-zr-frei { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.fz-zr-frei > div { min-width: 0; }
.fz-zr-frei input { width: 100%; min-width: 0; }
.fz-zr-frei .feld { margin-top: 0; }
.fz-zr-frei .hauptknopf { min-height: 44px; }
#fzZrFehler { margin: 0 2px; }
@media (max-width: 480px) {
  .fz-zr-wahl .zr-lang { display: none; }
  .fz-zr-wahl .zr-kurz { display: inline; }
  .fz-zr-frei { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fz-zr-frei .hauptknopf { grid-column: 1 / -1; }
}
.fz-offen-hinweis {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px;
  margin: 4px 0 0 0; color: var(--verlegung); font-weight: 700; font-size: 0.92rem;
}
.fz-offen-hinweis .textknopf { min-height: 44px; padding-left: 0; padding-right: 0; }
.fz-nur-offen { margin: 0 2px; min-height: 44px; color: var(--tinte); white-space: normal; }
.fz-legende { margin: 0 2px; }
/* Sortierbare Spaltenköpfe */
.fz-konferenz thead th { padding-top: 2px; padding-bottom: 2px; vertical-align: bottom; }
/* Pfeil über dem Text: kostet keine Breite, der Kopf springt beim Sortieren nicht */
.fz-sort {
  display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  min-height: 44px; padding: 0; border: none; background: none;
  color: inherit; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.fz-konferenz th.zahl .fz-sort { align-items: flex-end; }
.fz-sort:hover abbr, .fz-sort:hover { color: var(--akzent); }
.fz-pfeil { order: -1; height: 0.9em; line-height: 0.9em; font-size: 0.68em; color: var(--akzent); }
.fz-tabelle .zahl.fz-quote { width: 3.9rem; }
.fz-unter { display: block; font-size: 0.72rem; font-weight: 650; color: var(--leise); white-space: nowrap; }
.fz-tabelle td .fz-unter.offen { color: var(--verlegung); }
.fz-konferenz .fz-min-kurz { display: none; }
.fz-konferenz tfoot th, .fz-konferenz tfoot td {
  border-top: 2px solid var(--linie); background: var(--akzent-hell); font-weight: 750;
}
.fz-konferenz tfoot th { padding-top: 8px; padding-bottom: 8px; }
/* Schmal: „entsch." und „Min." ausblenden (Minuten stehen dann unter den Verspätungen) */
@media (max-width: 560px) {
  .fz-konferenz .fz-schmal { display: none; }
  .fz-konferenz .fz-min-kurz { display: block; }
  .fz-tabelle .zahl.fz-quote { width: 3.3rem; }
}
@media (max-width: 360px) {
  .fz-zr-frei { grid-template-columns: minmax(0, 1fr); }
  .fz-tabelle .zahl.fz-quote { width: 2.55rem; }
  .fz-unter { font-size: 0.66rem; white-space: normal; }
}
/* Offene Fälle */
.fz-of-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.fz-of-person.alt { border-left-color: var(--verlegung); }
.fz-of-seit { font-size: 0.82rem; font-weight: 650; color: var(--verlegung); }
.fz-of-ent { min-height: 44px; margin-right: 8px; padding: 6px 8px; white-space: normal; text-align: right; max-width: 9.5em; }
@media (max-width: 400px) {
  .fz-of-zeile { grid-template-columns: 1fr; }
  .fz-of-ent { justify-self: start; margin: -6px 0 6px 12px; text-align: left; max-width: none; }
}

/* ---- Phase 4.2: Klassenbuch/Kursheft als PDF ---- */
.fz-pdf-leiste { display: flex; justify-content: flex-end; margin: -4px 0 8px 0; }
.fz-pdf-knopf { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 4px; }
.pd-was { margin: 0 0 4px 0; font-weight: 700; font-size: 1.02rem; }
#fzPdfDialog .feld { margin-top: 4px; }
#fzPdfDialog select { width: 100%; }
.pd-schueler { margin-top: 6px; min-height: 44px; }
.pd-warnung {
  margin: 10px 0 0 0; padding: 8px 10px; border-left: 4px solid var(--verlegung); border-radius: 0 8px 8px 0;
  background: var(--verlegung-t); color: var(--tinte); font-size: 0.86rem; line-height: 1.4;
}
#pdStatus { margin: 8px 0 0 0; }
#pdStatus:empty { display: none; }
#fzPdfDialog .knopfreihe .hauptknopf, #fzPdfDialog .knopfreihe .textknopf { min-height: 44px; }

/* Entschuldigungen */
.fz-ent { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; }
.fz-ent-text { min-width: 0; overflow-wrap: anywhere; }
.fz-ent-wer { display: block; font-size: 0.8rem; color: var(--leise); }
.fz-ent .textknopf { flex: none; }
.fz-ent .textknopf.warnung { color: var(--rot); }

/* Einträge */
.fz-eintrag.b-offen { border-left-color: var(--verlegung); }
.fz-eintrag.b-unentschuldigt { border-left-color: var(--entfall); }
.fz-eintrag.b-entschuldigt { border-left-color: var(--vertretung); }
.fz-unten { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.marke.fz-status { background: var(--frei); }
.marke.fz-status.s-fehlt { background: var(--entfall); }
.marke.fz-status.s-spaet { background: var(--verlegung); }
.marke.fz-status.s-urlaub { background: var(--betreuung); }
.marke.fz-status.s-veranst { background: var(--sonst); }
.marke.fz-bew { background: transparent; color: var(--tinte); box-shadow: inset 0 0 0 1.5px var(--linie); }
.marke.fz-bew.b-offen { color: var(--verlegung); box-shadow: inset 0 0 0 1.5px var(--verlegung); }
.marke.fz-bew.b-entschuldigt { color: var(--vertretung); box-shadow: inset 0 0 0 1.5px var(--vertretung); }
.marke.fz-bew.b-unentschuldigt { color: var(--entfall); box-shadow: inset 0 0 0 1.5px var(--entfall); }
.fz-hinweis { font-size: 0.8rem; color: var(--leise); }
.fz-aktion { justify-self: start; margin-top: 2px; font-size: 0.85rem; font-weight: 700; color: var(--akzent); }

/* Dialoge */
.fb-wahl { margin-top: 8px; }
.fb-grund { margin: 0 0 6px 28px; }
.fe-daten { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fe-hinweis { margin-top: 10px; }

/* Stundenblatt: Entschuldigung anzeigen */
.kb-bew { font-weight: 700; }
.kb-bew.b-entschuldigt { color: var(--vertretung); }
.kb-bew.b-unentschuldigt { color: var(--entfall); }
/* Festgelegt (Nachtrag 3.2): Zeile nicht änderbar für Fach-/Kurslehrkraft */
.kb-zeile.gesperrt .kb-person { cursor: default; }
.kb-zeile.gesperrt button.kb-person:hover { background: transparent; }
.kb-schloss { display: grid; place-items: center; border-left: 1px solid var(--linie); color: var(--leise); }

/* ---- Rückmeldung ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 10;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--tinte);
  color: var(--papier);
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* ---- Zugangszettel (nur Druck) ---- */
.druck { display: none; }
@media print {
  body.druckt { background: #fff; color: #000; }
  body.druckt > :not(#druck) { display: none !important; }
  body.druckt .druck { display: block; }
  .zettel {
    break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 8mm 0;
    padding: 6mm 7mm;
    border: 1.5px dashed #555;
    border-radius: 3mm;
    color: #000;
    font-size: 11pt;
  }
  .z-titel { margin: 0 0 1mm 0; font-size: 9pt; text-transform: uppercase; letter-spacing: 0.08em; color: #333; }
  .z-name { margin: 0 0 3mm 0; font-size: 14pt; font-weight: 700; }
  .z-gruppe { font-weight: 400; }
  .zettel dl { display: grid; grid-template-columns: 34mm 1fr; gap: 1.5mm 4mm; margin: 0; }
  .zettel dt { color: #333; }
  .zettel dd { margin: 0; overflow-wrap: anywhere; }
  .z-wert { font-family: ui-monospace, Consolas, "Liberation Mono", monospace; font-size: 13pt; font-weight: 700; }
  .z-hinweis { margin: 3mm 0 0 0; font-size: 9pt; color: #333; }
}

/* Handy quer: kurze Tagesnamen im Raster, flacherer Kopf für mehr Plan auf dem Schirm. */
@media (orientation: landscape) and (max-width: 759px) {
  .raster .wt-lang { display: none; }
  .raster .wt-kurz { display: inline; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .kopf { padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-bottom: 6px; }
  .kopf h1 { font-size: 1.1rem; }
  main { padding-top: 8px; }
  .auswahl { margin-bottom: 6px; }
  .modi button { padding: 5px 4px; }
  .wahl select { padding: 6px 10px; }
  .pfeil { width: 38px; height: 38px; }
  .woche { grid-template-columns: 38px auto 38px auto; }
}

/* =====================================================================
   Thema und Hausaufgabe (Phase 3.3)
   ===================================================================== */

textarea { font: inherit; color: inherit; }

/* Stundenblatt: Karte über der Anwesenheitsliste */
.kb-inhalt { padding: 12px 16px 14px 16px; }
.kb-inhalt-form { display: grid; }
.kb-inhalt-form .feld { margin: 10px 0 4px 0; }
.kb-inhalt-form > .feld:first-child { margin-top: 2px; }
.kb-ha { resize: vertical; min-height: 3.4em; line-height: 1.4; }
.kb-faellig { display: grid; }
.kb-faellig-reihe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.kb-faellig-reihe input[type="date"] { width: auto; flex: 0 1 11.5rem; min-width: 9.5rem; padding-top: 8px; padding-bottom: 8px; }
.kb-faellig-schnell { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-chip {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--linie);
  border-radius: 999px;
  background: var(--seite);
  color: var(--tinte);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}
.kb-chip:hover { background: var(--akzent-hell); }
.kb-chip[aria-pressed="true"] { border-color: var(--akzent); background: var(--akzent-hell); box-shadow: inset 0 0 0 1px var(--akzent); }
.kb-inhalt .regel { margin: 8px 0 0 0; }
.kb-sichtbar { margin-top: 10px; color: var(--tinte); white-space: normal; align-items: flex-start; min-height: 32px; }
.kb-sichtbar input { flex: none; margin-top: 1px; }
.kb-sichtbar-zusatz { color: var(--leise); font-size: 0.85rem; }
#kbInhaltSperre, #kbSichtbarInfo { margin-top: 8px; }
.kb-vorige {
  margin: 0 0 6px 0;
  padding: 7px 10px;
  border-left: 3px solid var(--linie);
  border-radius: 0 8px 8px 0;
  background: var(--seite);
  font-size: 0.9rem;
}
.kb-vorige p { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.kb-vorige-kopf { font-size: 0.8rem; font-weight: 700; color: var(--leise); }
.kb-vorige-etikett { font-weight: 650; }

/* Thema/Hausaufgabe lesen (Stundenblatt ohne Schreibrecht, Dialog im Plan) */
.kb-inhalt-lesen { display: grid; gap: 10px; }
.kl-block { display: grid; gap: 1px; }
.kl-etikett { margin: 0; font-size: 0.8rem; font-weight: 700; color: var(--leise); }
.kl-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.kl-leer { margin: 0; color: var(--leise); font-style: italic; }
.kb-inhalt a, .kb-inhalt-lesen a, .ha-gruppen a { color: var(--akzent); text-decoration: underline; overflow-wrap: anywhere; }
#inhaltDialog .kb-wann { margin-bottom: 2px; }
#inhaltDialog .kb-inhalt-lesen { margin: 10px 0 4px 0; }

/* Historie: Thema/Hausaufgabe mehrzeilig */
.kh-inhalt { white-space: pre-line; }

/* Plan: Marke „HA" */
.ha-marke {
  flex: none;
  padding: 0 5px;
  border: 1.5px solid var(--akzent);
  border-radius: 6px;
  color: var(--akzent);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

/* Nicht erfasst: Marke „Thema fehlt" */
.marke.thema { background: var(--sonst); }

/* Themenliste je Unterricht */
.fz-thema { gap: 3px; }
.fz-t-thema, .fz-t-ha {
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.fz-t-thema { font-weight: 600; }
.fz-t-thema.leer { color: var(--leise); font-weight: 500; font-style: italic; }
.fz-t-ha { font-size: 0.9rem; white-space: pre-line; }
.fz-t-etikett { font-weight: 650; color: var(--leise); }
.kb-kopf .kb-sichtbar { margin-top: 8px; }
#fzTLeer { margin: 0 2px; }

/* Hausaufgaben (Schüler) */
main.hausaufgaben { max-width: 720px; }
.ha-leiste {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  margin: 0 0 12px 0;
  padding: 10px 14px;
  border: 1px solid var(--linie);
  border-left: 4px solid var(--akzent);
  border-radius: 12px;
  background: var(--papier);
  color: var(--tinte);
  text-align: left;
  font-weight: 700;
}
.ha-leiste:hover { background: var(--akzent-hell); }
.ha-leiste-zahl { color: var(--leise); font-size: 0.9rem; font-weight: 650; white-space: nowrap; }
.ha-leiste.dringend { border-left-color: var(--verlegung); }
.ha-leiste.dringend .ha-leiste-zahl { color: var(--verlegung); }
@media (min-width: 760px), (orientation: landscape) and (min-width: 600px) {
  .ha-leiste { grid-column: 1 / -1; justify-self: start; width: auto; min-width: 320px; }
}
#haInfo.offline { color: var(--rot); font-weight: 650; }
.ha-gruppen { display: grid; gap: 14px; margin-top: 8px; }
.ha-gruppen:empty { display: none; }
.ha-gruppe { display: grid; gap: 6px; }
.ha-titel { margin: 0 2px; font-size: 1rem; font-weight: 750; }
.ha-heute .ha-titel { color: var(--verlegung); }
.ha-vorbei .ha-titel { color: var(--leise); }
.ha-liste { list-style: none; margin: 0; padding: 0; background: var(--papier); border: 1px solid var(--linie); border-radius: 12px; overflow: hidden; }
.ha-eintrag { display: grid; grid-template-columns: 48px 1fr; align-items: stretch; }
.ha-eintrag + .ha-eintrag { border-top: 1px solid var(--linie); }
.ha-haken {
  display: grid;
  place-items: start center;
  width: 48px;
  min-height: 52px;
  padding: 12px 0 0 0;
  border: none;
  background: transparent;
  color: var(--leise);
}
.ha-haken:hover { background: var(--akzent-hell); }
.ha-haken .haken { opacity: 0; }
.ha-haken[aria-pressed="true"] { color: var(--vertretung); }
.ha-haken[aria-pressed="true"] .haken { opacity: 1; }
.ha-haken:focus-visible { outline-offset: -3px; }
.ha-text { min-width: 0; padding: 10px 12px 11px 2px; }
.ha-text p { margin: 0; }
.ha-kopf { font-size: 0.85rem; color: var(--leise); overflow-wrap: anywhere; }
.ha-kopf strong { color: var(--tinte); font-size: 0.98rem; }
.ha-text .ha-auftrag { margin-top: 2px; white-space: pre-line; overflow-wrap: anywhere; }
.ha-text .ha-thema { margin-top: 3px; font-size: 0.85rem; color: var(--leise); overflow-wrap: anywhere; }
.ha-eintrag.erledigt { background: var(--seite); }
.ha-eintrag.erledigt .ha-auftrag { color: var(--leise); text-decoration: line-through 1.5px var(--leise); }
.ha-fuss { margin-top: 14px; }

@media (orientation: landscape) and (max-height: 500px) {
  .kb-inhalt { padding: 8px 14px 10px 14px; }
  .kb-inhalt-form .feld { margin-top: 6px; }
  .ha-leiste { min-height: 44px; padding: 6px 12px; margin-bottom: 8px; }
}

/* =====================================================================
   Klassenbucheinträge (Phase 3.4)
   Farben je Kategorie: Lob grün, Hinweis blaugrün, Ermahnung rot,
   „vergessen" orange, Vorkommnis violett (dieselben Töne wie die Planfarben).
   ===================================================================== */

.marke.ke-marke { flex: none; white-space: nowrap; }
.marke.ke-marke.k-lob        { background: var(--vertretung); }
.marke.ke-marke.k-hinweis    { background: var(--betreuung); }
.marke.ke-marke.k-ermahnung  { background: var(--entfall); }
.marke.ke-marke.k-vergessen  { background: var(--verlegung); }
.marke.ke-marke.k-vorkommnis { background: var(--sonst); }

/* Stundenblatt: Karte „Einträge" */
.ke-karte { padding: 10px 16px 12px 16px; gap: 6px; }
.ke-karte-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; }
.ke-karte-titel { margin: 0; font-size: 1rem; font-weight: 750; }
.ke-karte-kopf .textknopf { min-height: 44px; padding-left: 2px; padding-right: 2px; }
.ke-karte .kleingedruckt { margin-top: 0; }
.ke-kliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ke-kliste:empty { display: none; }
.ke-kzeile {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: 7px 10px 8px 10px;
  border: 1px solid var(--linie);
  border-left: 4px solid var(--linie);
  border-radius: 0 10px 10px 0;
  background: var(--seite);
  color: var(--tinte);
  text-align: left;
}
.ke-kzeile:hover { background: var(--akzent-hell); }
.ke-k-oben { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.ke-k-wer { font-weight: 650; overflow-wrap: anywhere; }
.ke-k-text, .ke-z-text {
  white-space: pre-line;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.ke-k-von { font-size: 0.78rem; color: var(--leise); }
.ke-kzeile.k-lob, .ke-zeile.k-lob               { border-left-color: var(--vertretung); }
.ke-kzeile.k-hinweis, .ke-zeile.k-hinweis       { border-left-color: var(--betreuung); }
.ke-kzeile.k-ermahnung, .ke-zeile.k-ermahnung   { border-left-color: var(--entfall); }
.ke-kzeile.k-vergessen, .ke-zeile.k-vergessen   { border-left-color: var(--verlegung); }
.ke-kzeile.k-vorkommnis, .ke-zeile.k-vorkommnis { border-left-color: var(--sonst); }

/* Teilnehmerliste: Kategorien unter dem Namen */
.ke-mini { display: inline-flex; flex-wrap: wrap; gap: 0 6px; }
.ke-mini-k { font-weight: 700; }
.ke-mini-k.k-lob        { color: var(--vertretung); }
.ke-mini-k.k-hinweis    { color: var(--betreuung); }
.ke-mini-k.k-ermahnung  { color: var(--entfall); }
.ke-mini-k.k-vergessen  { color: var(--verlegung); }
.ke-mini-k.k-vorkommnis { color: var(--sonst); }

/* Statusdialog: Bereich „Einträge" */
.ks-eintrag { display: grid; gap: 6px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--linie); }
.ks-e-titel { margin: 0; font-size: 1rem; font-weight: 750; }
.ks-e-neu { justify-self: start; min-height: 44px; padding-left: 0; text-align: left; white-space: normal; }

/* Formular */
.ke-form { display: grid; }
.ke-feld { margin: 10px 0 4px 0; }
.ke-form > .ke-feld:first-child { margin-top: 2px; }
.ke-kats { display: flex; flex-wrap: wrap; gap: 6px; }
.ke-chip, .ke-filterchip { min-height: 44px; }
.ke-chip::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--linie);
  vertical-align: 1px;
}
.ke-chip.k-lob::before        { background: var(--vertretung); }
.ke-chip.k-hinweis::before    { background: var(--betreuung); }
.ke-chip.k-ermahnung::before  { background: var(--entfall); }
.ke-chip.k-vergessen::before  { background: var(--verlegung); }
.ke-chip.k-vorkommnis::before { background: var(--sonst); }
.ke-chip[aria-pressed="true"], .ke-filterchip[aria-pressed="true"] {
  border-color: var(--akzent);
  background: var(--akzent-hell);
  box-shadow: inset 0 0 0 1px var(--akzent);
}
.ke-textkopf { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ke-pflicht { font-weight: 500; color: var(--leise); }
.ke-zaehler { font-size: 0.8rem; color: var(--leise); font-variant-numeric: tabular-nums; }
.ke-text { resize: vertical; min-height: 3.2em; line-height: 1.4; }
.ke-datum { width: auto; max-width: 12rem; }
.ke-weitere { display: grid; margin-top: 6px; }
.ke-weitere-auf { justify-self: start; min-height: 44px; padding-left: 0; }
.ke-weitere-liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0 8px;
  max-height: 40vh;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--linie);
  border-radius: 10px;
}
.ke-knoepfe { margin-top: 12px; }
.ke-knoepfe .hauptknopf, .ke-knoepfe .textknopf, .ke-aktionen .hauptknopf { min-height: 44px; }
.ke-form .fehler { margin-top: 10px; }

/* Dialog „Eintrag" */
.ke-info { display: grid; gap: 1px; margin: 2px 0 0 0; font-size: 0.85rem; color: var(--leise); }
.ke-info:empty { display: none; }
.ke-inhalt { display: grid; justify-items: start; gap: 6px; margin-top: 12px; }
.ke-volltext { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.ke-aktionen { margin-top: 14px; }
.ke-aktionen .textknopf { min-height: 44px; }
.ke-aktionen .textknopf.warnung { color: var(--rot); font-weight: 700; }
.ke-dialog .kh-liste { margin-top: 12px; }
#keForm { margin-top: 8px; }

/* Listen: Schülerdetail, Klasse/Stufe, Unterricht */
.ke-bereich { display: grid; gap: 6px; }
.ke-bereich .fz-kopfzeile { margin-bottom: 0; }
.ke-zaehlzeile { margin: 0 2px; font-weight: 650; }
.ke-zeile { gap: 3px; }
.ke-z-wer { font-weight: 650; overflow-wrap: anywhere; }
.ke-filter { display: flex; flex-wrap: wrap; gap: 6px; }
#fzKeLeer, #fzKeWeitereInfo { margin: 0 2px; }
#fzKeWeitereTitel { margin-top: 10px; }

/* Klassenbuch-Reiter: vier Reiter passen auf schmalen Handys in zwei Reihen */
@media (max-width: 440px) {
  #fzReiter:has(> :nth-child(4)) { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .laedt .symbol svg { animation: none; }
}

/* =====================================================================
   Hilfe (Entscheidungen 52–59): „?" im Kopf, Hilfe-Dialog, Kurzkarte,
   kurze Hinweise an der Stelle
   ===================================================================== */

/* Das Hilfe-Symbol dreht sich beim Laden nicht mit. */
.laedt #hilfeKnopf svg { animation: none; }
/* Schmale Handys: drei Knöpfe im Kopf – etwas enger, damit der Titel Platz behält. */
@media (max-width: 380px) {
  .kopf { gap: 4px; padding-right: 10px; }
}

/* Kurzkarte „Kurz erklärt" */
.hi-karte {
  display: grid;
  gap: 4px;
  margin: 0 0 12px 0;
  padding: 12px 14px 10px 14px;
  border: 1px solid var(--linie);
  border-left: 4px solid var(--akzent);
  border-radius: 0 12px 12px 0;
  background: var(--papier);
}
.hi-karte-titel { margin: 0; font-size: 0.82rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--akzent); }
.hi-karte-text { margin: 0; }
.hi-karte-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; }
.hi-karte-knoepfe .hauptknopf, .hi-karte-knoepfe .textknopf { min-height: 44px; }
main.klassenbuch > .hi-karte, main.fehlzeiten > .hi-karte { margin-top: 2px; }

/* Hilfe-Dialog */
.hi-dialog { padding-top: 14px; }
.hi-zurueck { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 4px -6px; min-height: 44px; }
.hi-dialog .karte-titel { outline-offset: 4px; }
.hi-inhalt { display: grid; gap: 8px; }
.hi-inhalt p { margin: 0; }
.hi-zwischen { margin: 8px 0 0 0; font-size: 0.82rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--leise); }
.hi-liste, .hi-farben { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.hi-farben { list-style: none; padding-left: 0; }
.hi-farben li { display: flex; align-items: center; gap: 10px; }
.hi-farbe { flex: none; width: 22px; height: 16px; border-radius: 4px; }
.hi-f-vertretung { background: var(--vertretung); }
.hi-f-entfall { background: var(--entfall); }
.hi-f-verlegung { background: var(--verlegung); }
.hi-f-betreuung { background: var(--betreuung); }
.hi-f-raum { background: var(--raum); }
.hi-f-klausur { background: var(--klausur); }
.hi-begriffe { margin: 0; display: grid; gap: 2px; }
.hi-begriffe dt { margin-top: 6px; font-weight: 700; }
.hi-begriffe dt:first-child { margin-top: 0; }
.hi-begriffe dd { margin: 0; }
.hi-dazu, .hi-themen { display: grid; }
.hi-dazu { gap: 0; margin-top: 4px; border-top: 1px solid var(--linie); padding-top: 4px; }
.hi-themaknopf { min-height: 44px; color: var(--akzent); }

/* Anmeldung: „Passwort vergessen?" */
#pwVergessen { justify-self: center; margin-top: 4px; min-height: 44px; }
.pw-vergessen { margin-top: 2px; font-size: 0.95rem; }

/* Stundenblatt: Bedienhilfe über der Namensliste */
.kb-tipp { margin: 0 2px; font-size: 0.85rem; color: var(--leise); }

/* Nicht erfasst: sichtbare Überschrift über den Umschaltern (Entscheidung 57) */
.fz-wahl-titel { margin: 0 2px -6px 2px; font-size: 0.85rem; font-weight: 650; color: var(--leise); }
#fzNeWahl button { white-space: normal; line-height: 1.2; }

/* Meine Fehlzeiten (Schüler): was „offen" heißt */
.fz-ich-hinweis { margin: 4px 2px 0 2px; }

@media print {
  .hi-karte { display: none !important; }
}

/* =====================================================================
   Phase 4.3: Fehlzeiten als CSV, Jahresarchiv, Reiter „Downloads"
   ===================================================================== */
.fz-pdf-leiste { flex-wrap: wrap; column-gap: 14px; }
#fzCsvDialog .feld, #fzArchivDialog .feld { margin-top: 4px; }
#fzCsvDialog .art-wahl .schalter { min-height: 44px; }
.cs-offen {
  margin: 10px 0 0 0; padding: 8px 10px; border-left: 4px solid var(--entfall); border-radius: 0 8px 8px 0;
  background: var(--entfall-t); color: var(--tinte); font-size: 0.86rem; line-height: 1.4;
}
#csPruefung, #arStatus { margin: 8px 0 0 0; }
#csPruefung:empty, #arStatus:empty { display: none; }
#arStatus { font-variant-numeric: tabular-nums; }
#fzCsvDialog .knopfreihe .hauptknopf, #fzCsvDialog .knopfreihe .textknopf,
#fzArchivDialog .knopfreihe .hauptknopf, #fzArchivDialog .knopfreihe .textknopf { min-height: 44px; }
.d-filter { margin-bottom: 6px; }
.d-filter input { min-width: 0; }
/* Konten verwalten: vier Reiter passen auf schmalen Handys in zwei Reihen */
@media (max-width: 440px) {
  #verwReiter:has(> :nth-child(4)) { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
}
#dInfo { margin: 6px 2px 8px 2px; }
@media (min-width: 760px) {
  .d-filter { grid-template-columns: minmax(0, 15em) minmax(0, 20em); }
}
/* Tippflächen ≥ 44 px auch für die Reiter in „Konten verwalten" (wie die Klassenbuch-Reiter) */
#verwReiter button { min-height: 44px; }

/* =====================================================================
   P3 (E-1): Schuleinstellungen (Kontomenü „Einstellungen“, nur Admin), Name der Schule auf der
   Anmeldeseite; Kleinigkeit (b): „Konto löschen“ rot statt grau
   ===================================================================== */
.schul-name { margin: 0 0 4px 0; font-size: 0.95rem; font-weight: 650; color: var(--leise); overflow-wrap: anywhere; }
#esReiter { display: flex; flex-wrap: wrap; }
#esReiter button { flex: 1 1 0; min-width: max-content; min-height: 44px; }
.es-gruppen { display: grid; gap: 12px; margin-top: 8px; }
.es-karte { padding: 18px 16px 16px 16px; }
.es-feld { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--linie); }
.es-feld > div > .feld { margin-top: 2px; }
.es-eingabe { display: flex; align-items: center; gap: 8px; }
.es-eingabe .eingabe { flex: 1 1 auto; min-width: 0; }
.es-eingabe input[type="number"], .es-eingabe input[type="date"] { flex: 0 1 13rem; }
.es-standard { flex: none; min-height: 44px; }
.es-einheit { font-weight: 500; color: var(--leise); }
.es-schalter { min-height: 44px; font-weight: 650; }
.es-info { margin: 6px 0 0 0; font-size: 0.86rem; color: var(--leise); overflow-wrap: anywhere; }
.es-info strong { color: var(--tinte); }
.es-info.leise { font-size: 0.8rem; }
.es-dsb {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 4px solid var(--verlegung);
  background: var(--seite);
  border-radius: 0 8px 8px 0;
}
.es-dsb-frage { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.es-dsb-stand { margin: 6px 0 0 0; font-size: 0.86rem; color: var(--leise); overflow-wrap: anywhere; }
.es-dsb-felder { display: grid; grid-template-columns: 1fr; column-gap: 12px; }
.es-dsb-felder .feld { margin: 10px 0 4px 0; font-size: 0.88rem; }
.es-dsb-felder .eingabe { background: var(--papier); }
@media (min-width: 560px) {
  .es-dsb-felder { grid-template-columns: minmax(0, 13rem) 1fr; }
}
.es-dsb-hinweis { margin: 8px 0 0 0; font-size: 0.86rem; font-weight: 600; color: var(--rot); }
.es-hinweis { margin: 0 0 8px 0; }
.es-karte .fehler.klein { margin: 6px 0 0 0; }
.es-karte .hinweis { margin-top: 12px; }
.es-karte .hauptknopf:disabled { cursor: default; }
.es-karte .knopfreihe .hauptknopf, .es-karte .knopfreihe .textknopf { min-height: 44px; }
.hauptknopf.warnung { background: var(--rot); }
.menuepunkt.gefahr { color: var(--rot); }

/* =====================================================================
   P4a (5.3a): Testdatum-Band (Entscheidung 221) und Bereich „Jahresablauf“ (205) – Karten mit Ampel
   (Punkt + Wort, nie nur die Farbe)
   ===================================================================== */
.testdatum-band {
  margin: 0;
  padding: 6px 16px;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--tinte);
  background: repeating-linear-gradient(135deg, var(--raum-t) 0 14px, var(--verlegung-t) 14px 28px);
  border-bottom: 2px solid var(--verlegung);
  overflow-wrap: anywhere;
}
/* PB-1a (Entscheidung 299): Band „Probebetrieb – nur Testdaten“ (anders als das Testdatum: violett, immer oben) */
.probe-band {
  margin: 0;
  padding: 6px 16px;
  font-size: 0.86rem;
  color: var(--tinte);
  background: repeating-linear-gradient(135deg, var(--sonst-t) 0 14px, var(--klausur-t) 14px 28px);
  border-bottom: 2px solid var(--sonst);
  overflow-wrap: anywhere;
}
.probe-band strong { font-weight: 750; }
.probe-band-zusatz { font-weight: 500; }
.ja-stand { margin: 8px 0 0 0; font-size: 0.9rem; font-weight: 650; color: var(--leise); overflow-wrap: anywhere; }
.ja-karten { display: grid; gap: 12px; margin-top: 10px; }
.ja-karte { padding: 18px 16px 16px 16px; border-left-width: 6px; }
.ja-karte.a-gruen { border-left-color: var(--vertretung); }
.ja-karte.a-gelb { border-left-color: var(--verlegung); }
.ja-karte.a-rot { border-left-color: var(--entfall); }
.ja-karte.a-grau { border-left-color: var(--frei); }
.ja-kartenkopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.ja-kartenkopf .karte-titel { margin: 0; }
.ja-text { margin: 8px 0 0 0; overflow-wrap: anywhere; }
.ja-ampel {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 0.8rem; font-weight: 700; white-space: nowrap; color: var(--leise);
}
.ja-punktfarbe { width: 12px; height: 12px; border-radius: 50%; background: var(--frei); flex: none; }
.ja-ampel.a-gruen { color: var(--vertretung); }
.ja-ampel.a-gruen .ja-punktfarbe { background: var(--vertretung); }
.ja-ampel.a-gelb { color: var(--verlegung); }
.ja-ampel.a-gelb .ja-punktfarbe { background: var(--verlegung); }
.ja-ampel.a-rot { color: var(--entfall); }
.ja-ampel.a-rot .ja-punktfarbe { background: var(--entfall); }
.ja-punkte { list-style: none; margin: 10px 0 0 0; padding: 0; display: grid; gap: 0; }
.ja-punkt { padding: 10px 0 10px 12px; border-top: 1px solid var(--linie); border-left: 3px solid var(--frei); }
.ja-punkt.a-gruen { border-left-color: var(--vertretung); }
.ja-punkt.a-gelb { border-left-color: var(--verlegung); }
.ja-punkt.a-rot { border-left-color: var(--entfall); }
.ja-punkt-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.ja-punkt-titel { overflow-wrap: anywhere; }
.ja-punkt-text { margin: 4px 0 0 0; font-size: 0.92rem; overflow-wrap: anywhere; }
.ja-liste {
  margin: 6px 0 0 0; padding: 6px 10px 6px 26px; font-size: 0.86rem; color: var(--leise);
  background: var(--seite); border-radius: 8px; max-height: 14rem; overflow-y: auto; overflow-wrap: anywhere;
}
.ja-weitere { list-style: none; margin-left: -14px; font-style: italic; }
.ja-ziele { display: flex; flex-wrap: wrap; gap: 0 12px; margin-top: 2px; }
.ja-ziel { min-height: 44px; }
/* P5a: Aktionen der Karte „Schuljahreswechsel“ und ihr Dialog */
.ja-aktionen { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 8px; }
.ja-aktion { min-height: 44px; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.ja-dialog .feld { margin: 10px 0 4px 0; }
.ja-dialog #jaDWarnBox .feld { margin-top: 0; }
.ja-dliste { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 0.9rem; line-height: 1.4; }
.ja-dliste li { overflow-wrap: anywhere; }
.ja-dialog textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 4.5rem; }
#jaDZeichen { margin: 4px 0 0 0; }
.ja-dialog .knopfreihe .hauptknopf, .ja-dialog .knopfreihe .textknopf { min-height: 44px; }
/* P5b-2: Zuständigkeiten übernehmen (eine Zeile je Konto) */
.jz-auswahl { display: flex; flex-wrap: wrap; gap: 0 12px; margin: 6px 0 2px 0; }
.jz-auswahl .textknopf { min-height: 44px; }
.jz-liste { list-style: none; margin: 4px 0 0 0; padding: 0; display: grid; gap: 0; max-height: 55vh; overflow-y: auto; }
.jz-zeile { display: grid; grid-template-columns: 28px 1fr; gap: 0 8px; align-items: start; padding: 10px 4px 10px 0;
  border-top: 1px solid var(--linie); }
.jz-haken { width: 22px; height: 22px; margin: 2px 0 0 2px; accent-color: var(--akzent); }
.jz-ohne { width: 22px; }
.jz-inhalt { display: grid; gap: 3px; min-height: 28px; cursor: pointer; overflow-wrap: anywhere; }
.jz-hinweis .jz-inhalt { cursor: default; }
.jz-kopf .marke { margin-left: 6px; }
.jz-text, .jz-aenderung { font-size: 0.9rem; line-height: 1.4; }
.jz-aenderung { color: var(--leise); }
.marke.jz-art-schild, .marke.jz-art-folge { background: var(--vertretung); }
.marke.jz-art-entfaellt { background: var(--verlegung); }
.marke.jz-art-hinweis { background: var(--frei); }

/* P4b (210): Dialog „Fehlstunden für SchILD bereitstellen“ – Zahlen, Warnungen, Abholcode */
.rw-dialog .art-wahl .schalter { min-height: 44px; }
.rw-dialog #rwZeitraeume { margin: 0; }
.rw-dialog #rwEigen { margin-top: 6px; }
#rwInfo { margin: 8px 0 0 0; }
#rwInfo:empty { display: none; }
.rw-zahlen { margin-top: 6px; display: grid; gap: 4px; }
.rw-zeile { margin: 0; font-size: 0.9rem; line-height: 1.4; overflow-wrap: anywhere; }
#rwWarnung p { margin: 0; }
#rwWarnung p + p { margin-top: 6px; }
.rw-frueher { margin: 4px 0 0 0; padding-left: 18px; }
.rw-code-box {
  margin-top: 10px; padding: 10px 12px; border: 2px solid var(--vertretung); border-radius: 10px; background: var(--seite);
}
.rw-code-box .feld { margin: 0; }
.rw-code {
  margin: 4px 0; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.9rem; font-weight: 750;
  letter-spacing: 0.12em; color: var(--tinte); overflow-wrap: anywhere; user-select: all;
}
#rwAktiv { margin: 8px 0 0 0; }
.rw-dialog .knopfreihe .hauptknopf, .rw-dialog .knopfreihe .textknopf { min-height: 44px; }

/* =====================================================================
   P6a (Entscheidungen 225–231): zweiter Faktor, Code-Schritt der Anmeldung, Hinweis nach der Anmeldung,
   Reiter „Zugriffe“, Karte „Zugriff“ der Einstellungen. Der QR-Code ist ein SVG mit eigenem weißen Grund –
   auch im dunklen Modus schwarz auf weiß, damit ihn jede Kamera liest.
   ===================================================================== */
.nach-anmeldung {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
  margin: 0; padding: 8px 16px;
  background: var(--verlegung-t); border-bottom: 2px solid var(--verlegung); color: var(--tinte);
}
.nach-anmeldung[hidden] { display: none; }
.nach-anmeldung-text { margin: 0; font-size: 0.92rem; font-weight: 600; overflow-wrap: anywhere; flex: 1 1 260px; }
.nach-anmeldung .textknopf { min-height: 44px; }

.karte input.zf-code, input.zf-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: 1.35rem; letter-spacing: 0.14em; text-align: center;
}
#codeForm #codeWechsel, #codeForm #codeZurueck { margin-top: 8px; justify-self: center; min-height: 44px; }
#codeForm .kleingedruckt { margin-top: 10px; }

.zf-assistent { display: grid; }
.zf-stand { margin: 8px 0 0 0; overflow-wrap: anywhere; }
.zf-assistent .knopfreihe .textknopf, .zf-assistent .knopfreihe .hauptknopf { min-height: 44px; }
.zf-assistent #zfAbmelden { margin-top: 10px; justify-self: center; min-height: 44px; }
.zf-schritte { margin: 8px 0 4px 0; padding-left: 22px; font-size: 0.92rem; line-height: 1.45; }
.zf-schritte li + li { margin-top: 4px; }
.zf-qr { display: flex; justify-content: center; margin: 10px 0 4px 0; }
.zf-qr svg {
  display: block; width: min(260px, 72vw); height: auto;
  border-radius: 6px; box-shadow: 0 0 0 1px var(--linie);
}
.zf-schluessel {
  margin: 0; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.1rem; font-weight: 700;
  letter-spacing: 0.06em; word-spacing: 0.25em; overflow-wrap: anywhere; user-select: all;
}
#zfSchluesselKopieren { justify-self: start; min-height: 44px; }
.zf-codeliste {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5em, 1fr)); gap: 6px 16px;
  margin: 10px 0 0 0; padding: 10px 12px 10px 34px; background: var(--seite); border-radius: 10px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.05rem; font-weight: 700; user-select: all;
}
.zf-gesichert { margin-top: 14px; }
.zf-dialog { max-width: 480px; }
.hauptknopf.gefahr { background: var(--rot); color: var(--auf-farbe); }

.zg-filter { grid-template-columns: 1fr 1fr; align-items: end; }
.zg-datum { display: grid; }
.feld.klein-feld { margin: 0 0 2px 2px; font-size: 0.8rem; font-weight: 600; color: var(--leise); }
.zg-zusammenfassung { margin: 0 0 10px 0; }
.zg-zusammenfassung.warnung-leise { border-left-color: var(--verlegung); background: var(--verlegung-t); }
.p-eintrag.zg-fehl { border-left: 4px solid var(--entfall); }
.p-eintrag.zg-ok { border-left: 4px solid var(--vertretung); }
@media (min-width: 760px) {
  .zg-filter { grid-template-columns: 2fr 1.4fr 1fr 1fr; }
}

.es-zugriff-daten { margin-top: 10px; }
.es-zugriff-daten dd { overflow-wrap: anywhere; }

/* P6b (232, 233): Zugriffe → Ansichten (Leseprotokoll) */
.za-filter .za-schueler { grid-column: 1 / -1; min-width: 0; }
.za-treffer { margin-top: 6px; max-height: 240px; }
.za-gewaehlt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; min-height: 44px;
  font-weight: 600; overflow-wrap: anywhere; }
.p-eintrag.za-eintrag { border-left: 4px solid var(--linie); }
#zaSchalter { margin: 0 0 10px 0; }
@media (min-width: 760px) {
  .za-filter { grid-template-columns: 1.8fr 1.1fr 1.9fr 1.1fr 1.1fr; }
  .za-filter .za-schueler { grid-column: auto; }
}
/* P6b (234): Auskunft im Schülerdetail; (236): vorhandene Gründe entfernen */
.fz-s-aktionen { margin-top: 6px; }
.es-gruende { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--linie); }
.es-gruende-knopf.warnung { color: var(--rot); font-weight: 700; }
/* P5b-2 (N1): Meldungskasten im Jahresablauf – bleibt bis zur nächsten Aktion bzw. bis „×“ */
.ja-meldung {
  display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0 0; padding: 10px 6px 10px 14px;
  border-radius: 10px; border: 1px solid var(--vertretung); border-left-width: 6px; background: var(--vertretung-t);
  color: var(--tinte); scroll-margin-top: 80px;
}
.ja-meldung[hidden] { display: none; }
.ja-meldung.a-gelb { border-color: var(--verlegung); background: var(--verlegung-t); }
.ja-meldung p { margin: 0; flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.ja-meldung-zu { flex: none; min-width: 44px; min-height: 44px; margin: -8px 0; font-size: 1.4rem; line-height: 1; }
/* P5c-1: Archiv mit Kennwort (axDialog) und „Aufbewahrung bestätigen“ (abDialog) */
.ax-dialog .eingabe, .ab-dialog .eingabe { width: 100%; box-sizing: border-box; }
.ax-dialog .passwort { margin-bottom: 0; }
#axKwInfo { margin: 4px 0 0 0; }
.ax-stand { margin: 12px 0 0 0; padding: 10px 12px; border-radius: 10px; background: var(--seite); }
.ax-stand[hidden] { display: none; }
.ax-schritt { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.ax-balken { display: block; width: 100%; height: 12px; margin: 8px 0 0 0; accent-color: var(--akzent); }
.ax-balken[hidden] { display: none; }
.ax-info { margin: 8px 0 0 0; overflow-wrap: anywhere; }
.ax-dialog .knopfreihe .hauptknopf, .ax-dialog .knopfreihe .textknopf,
.ab-dialog .knopfreihe .hauptknopf, .ab-dialog .knopfreihe .textknopf { min-height: 44px; }
.ab-datei { display: block; width: 100%; min-height: 44px; margin: 2px 0 0 0; font-size: 0.95rem; }
.ab-summe { font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.86rem; }
.ab-vergleich { margin: 6px 0 0 0; font-size: 0.9rem; font-weight: 650; overflow-wrap: anywhere; }
.ab-vergleich:empty { display: none; }
.ab-vergleich.richtig { color: var(--vertretung); }
.ab-vergleich.falsch { color: var(--entfall); }
.ab-haken { margin-top: 14px; }
/* P5c-2 (Befund B aus P5c-1): Haken und Überschrift je in eigener Zeile – .schalter ist inline-flex, label.feld inline */
.ja-dialog label.feld { display: block; }
.ja-dialog .schalter.gross { display: flex; }
/* P5c-2 (Befund A): Ziel eines Sprungs kurz hervorheben; die Karte bleibt unter dem Rand frei */
.ja-karte { scroll-margin-top: 12px; }
.ja-karte.ja-hervor { animation: ja-hervor 1.6s ease-out 1; }
@keyframes ja-hervor {
  0%, 35% { box-shadow: 0 0 0 4px var(--akzent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .ja-karte.ja-hervor { animation: none; outline: 3px solid var(--akzent); outline-offset: 2px; }
}
/* P5c-2 (266–270): Schuljahr löschen */
.lj-dialog .eingabe { width: 100%; box-sizing: border-box; }
.lj-warnung {
  margin: 4px 0 0 0; padding: 8px 10px; border-left: 4px solid var(--entfall); border-radius: 0 8px 8px 0;
  background: var(--entfall-t); color: var(--tinte); font-size: 0.9rem; line-height: 1.4;
}
.lj-neu { margin: 8px 0 0 0; padding: 8px 10px; border-radius: 8px; background: var(--verlegung-t); font-weight: 650; }
.lj-neu[hidden] { display: none; }
.lj-zahlen { font-variant-numeric: tabular-nums; }
.lj-mehr { margin: 10px 0 0 0; font-size: 0.9rem; }
.lj-mehr summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 650; }
.lj-mehr .ja-dliste { margin-top: 2px; }
#ljStand { margin: 8px 0 0 0; }
#ljStand:empty { display: none; }
.lj-dialog .knopfreihe .hauptknopf, .lj-dialog .knopfreihe .textknopf { min-height: 44px; }

@media print {
  .zf-zettel .zf-codeliste {
    background: none; padding: 2mm 0 0 8mm; color: #000; font-size: 13pt; grid-template-columns: 1fr 1fr;
  }
}
