[hidden] { display: none !important; }
:root {
  --blau: #1f3a5f;
  --blau-hell: #e8eef6;
  --gruen: #1e8e4e;
  --gruen-hell: #e3f5ea;
  --rot: #c62828;
  --rot-hell: #fdecea;
  --gelb: #b26a00;
  --gelb-hell: #fff4e0;
  --grau: #667085;
  --linie: #e4e7ec;
  --grund: #f5f7fa;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grund); color: #1d2939;
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--blau); }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.2rem; margin: 1.6rem 0 .5rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
h3 { font-size: 1rem; margin: 1.2rem 0 .4rem; color: var(--grau); }
code { background: #eef1f5; padding: 0 .3em; border-radius: 4px; }

/* Kopfzeile mit Datum */
.kopf { background: var(--blau); color: #fff; padding: env(safe-area-inset-top) 0 0; }
.kopf-innen { max-width: 1100px; margin: 0 auto; padding: .8rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.heute { font-size: 1.55rem; font-weight: 700; letter-spacing: .01em; }
.schule { font-size: .95rem; opacity: .9; display: flex; gap: .7rem; align-items: center; }
.rolle { background: rgba(255,255,255,.15); padding: .1rem .55rem; border-radius: 99px; font-size: .8rem; }
.abmelden { color: #fff; }

/* Reiter */
.reiter {
  position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--linie);
  display: flex; gap: .35rem; padding: .55rem max(1rem, calc((100% - 1100px)/2 + 1rem));
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.reiter a {
  flex: 0 0 auto; text-decoration: none; color: #344054; padding: .55rem 1rem; border-radius: 10px;
  font-weight: 600; min-width: 3.2rem; text-align: center; background: var(--grund); border: 1px solid var(--linie);
}
.reiter a.aktiv { background: var(--blau); color: #fff; border-color: var(--blau); }
.reiter a.sonder { background: #fff; }
.reiter a.sonder.aktiv { background: var(--blau); }
.reiter .trenner { flex: 0 0 1px; background: var(--linie); margin: 0 .3rem; }
.zaehler { display: inline-block; background: var(--rot); color: #fff; border-radius: 99px; padding: 0 .45rem; font-size: .8rem; margin-left: .2rem; }

main { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 3rem; }

.leiste { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .4rem 0 1rem; flex-wrap: wrap; }
.datumsnav { display: flex; align-items: center; gap: .3rem; background: #fff; border: 1px solid var(--linie); border-radius: 10px; padding: .2rem; }
.datumsnav a { text-decoration: none; padding: .35rem .8rem; border-radius: 8px; font-size: 1.2rem; line-height: 1; }
.datumsnav a:hover { background: var(--grund); }
.datumsnav span { font-weight: 600; padding: 0 .3rem; }
.datumsnav .heute-link { font-size: .9rem; background: var(--blau); color: #fff; }

.hinweis { padding: .75rem 1rem; border-radius: 10px; margin: 0 0 1rem; background: var(--blau-hell); }
.hinweis ul { margin: 0; padding-left: 1.2rem; }
.hinweis.ok { background: var(--gruen-hell); color: #14532d; }
.hinweis.fehler { background: var(--rot-hell); color: #7f1d1d; }
.hinweis.warnung { background: var(--gelb-hell); color: #6b3d00; }

.leise { color: var(--grau); }
.klein { font-size: .85rem; }
.mitte { text-align: center; }
.leer { color: var(--grau); background: #fff; border: 1px dashed var(--linie); border-radius: var(--radius); padding: 1rem; text-align: center; }
.versteckt { position: absolute; left: -9999px; }

/* Karten & Formulare */
.karte { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: 1rem; }
.karte h2 { margin-top: 0; }
.karte.schmal { max-width: 460px; margin: 2rem auto 1rem; }
label { display: block; font-weight: 600; font-size: .92rem; margin: .6rem 0; }
input[type=text], input[type=search], input[type=password], input[type=tel], input[type=date], input[type=time], input:not([type]), select {
  display: block; width: 100%; margin-top: .3rem; font: inherit; font-weight: 400; padding: .65rem .75rem;
  border: 1px solid #cfd4dc; border-radius: 10px; background: #fff; min-height: 46px; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, #667085 50%), linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
input:focus, select:focus { outline: 3px solid #b6c8e3; border-color: var(--blau); }
label.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: .3rem; width: 18px; height: 18px; }
fieldset { border: 0; padding: 0; margin: 1rem 0; }
legend { font-weight: 700; font-size: 1.05rem; margin-bottom: .2rem; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .zwei { grid-template-columns: 1fr; } }

.btn {
  font: inherit; font-weight: 600; border: 1px solid #cfd4dc; background: #fff; color: #1d2939; border-radius: 10px;
  padding: .65rem 1.1rem; min-height: 46px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.btn.primaer { background: var(--blau); color: #fff; border-color: var(--blau); }
.btn.gruen { background: var(--gruen); color: #fff; border-color: var(--gruen); }
.btn.rot { background: #fff; color: var(--rot); border-color: #f1b5b0; }
.btn.breit { width: 100%; margin-top: 1rem; font-size: 1.05rem; }
.btn.klein { min-height: 36px; padding: .3rem .8rem; font-size: .9rem; }
.btn:disabled { opacity: .5; }
button.link { background: none; border: 0; color: var(--blau); text-decoration: underline; font: inherit; cursor: pointer; padding: .2rem .4rem; }
button.link.rot { color: var(--rot); }

/* Klassenliste */
.zusammenfassung { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
.z { background: #fff; border: 1px solid var(--linie); border-radius: 99px; padding: .3rem .85rem; font-size: .92rem; }
.z b { font-size: 1.05rem; }
.z.anwesend b { color: var(--gruen); }
.z.abwesend b { color: var(--rot); }
.z.entschuldigt b { color: var(--gelb); }
.z.offen b { color: var(--grau); }

.schuelerliste { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
.schueler { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem .9rem; border-top: 1px solid var(--linie); flex-wrap: wrap; }
.schueler:first-child { border-top: 0; }
.schueler.offen { background: #fcfcfd; }
.schueler[data-status=abwesend] { background: var(--rot-hell); }
.schueler .name { flex: 1 1 240px; display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; font-size: 1.05rem; }
.knoepfe { display: flex; gap: .4rem; }
.knoepfe button {
  font: inherit; font-size: .95rem; font-weight: 600; min-width: 7.2rem; min-height: 48px; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--linie); background: #fff; color: #475467; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.knoepfe button[data-status=anwesend].an { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.knoepfe button[data-status=abwesend].an { background: var(--rot); border-color: var(--rot); color: #fff; }
.knoepfe button[data-status=entschuldigt].an { background: var(--gelb); border-color: var(--gelb); color: #fff; }
.knoepfe button.vorschlag { border-style: dashed; border-color: var(--gelb); color: var(--gelb); background: var(--gelb-hell); }
@media (max-width: 700px) {
  .knoepfe { width: 100%; }
  .knoepfe button { flex: 1; min-width: 0; }
}

.badge { display: inline-block; font-size: .8rem; font-weight: 600; padding: .15rem .55rem; border-radius: 6px; background: var(--blau-hell); color: var(--blau); }
.badge.krank { background: var(--gelb-hell); color: #8a4b00; }
.badge.abholung { background: #ece8fb; color: #4c2c99; }
.badge.warn { background: var(--rot-hell); color: var(--rot); }
.badge.wartet { background: #eef1f5; color: #344054; border: 1px dashed #98a2b3; }
.freigabe-karte { background: #fff; border: 1px solid var(--linie); border-left: 5px solid var(--gelb); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .7rem; }
.freigabe-details { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin: .3rem 0 .7rem; font-size: .95rem; }
.badge.info { background: #eef1f5; color: var(--grau); font-weight: 500; }

.fuss-aktion { margin-top: .6rem; }

/* Sekretariat */
.anzahl { background: var(--rot); color: #fff; border-radius: 99px; padding: 0 .6rem; font-size: .9rem; }
.anzahl.null { background: #d0d5dd; color: #344054; }
.sek-karte { background: #fff; border: 1px solid var(--linie); border-left: 5px solid var(--rot); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .7rem; }
.sek-kopf { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; font-size: 1.1rem; margin-bottom: .4rem; }
.klasse-tag { display: inline-block; background: var(--blau); color: #fff; border-radius: 6px; padding: 0 .45rem; font-size: .85rem; font-weight: 700; }
.telefone { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.tel { display: inline-block; text-decoration: none; background: var(--blau-hell); padding: .35rem .8rem; border-radius: 8px; font-weight: 600; font-size: 1.05rem; }
.sek-aktionen .notiz { margin: .3rem 0 .5rem; }
.sek-knoepfe { display: flex; gap: .4rem; flex-wrap: wrap; }
ul.kompakt { list-style: none; padding: 0; margin: 0; }
.sek-karte.erledigt { border-left-color: #98a2b3; padding: .5rem .8rem; margin-bottom: .4rem; color: #475467; }

.stand { display: flex; flex-wrap: wrap; gap: .5rem; }
.stand-kachel { text-decoration: none; display: flex; flex-direction: column; align-items: center; min-width: 5.5rem; padding: .5rem .7rem; border-radius: 10px; border: 1px solid var(--linie); background: #fff; color: #344054; }
.stand-kachel b { font-size: 1.1rem; }
.stand-kachel span { font-size: .8rem; }
.stand-kachel.fertig { background: var(--gruen-hell); border-color: #a6dcb9; }
.stand-kachel.teil { background: var(--gelb-hell); border-color: #f5c98a; }
.stand-kachel.nichts { background: #f2f4f7; color: var(--grau); }

/* Tabellen */
.tabelle-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); }
.tabelle { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabelle th { text-align: left; background: #f9fafb; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--grau); padding: .6rem .7rem; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.tabelle td { padding: .55rem .7rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle td.zahl { text-align: center; font-variant-numeric: tabular-nums; }
.tabelle td.markiert { background: var(--rot-hell); color: var(--rot); font-weight: 700; }

.filter { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; }
.filter label { margin: 0; flex: 1 1 150px; }
.import { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; }
.import input[type=file] { font: inherit; }
.dateien { list-style: none; padding: 0; margin: 0; }
.dateien li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .4rem 0; border-top: 1px solid var(--linie); }
.url { word-break: break-all; font-weight: 600; }

/* Eltern */
.karte.eltern { max-width: 680px; margin: 1rem auto; }
.art { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.art legend { grid-column: 1 / -1; }
@media (max-width: 560px) { .art { grid-template-columns: 1fr; } }
.wahl { display: flex; flex-direction: column; border: 2px solid var(--linie); border-radius: var(--radius); padding: .8rem 1rem; margin: 0; cursor: pointer; position: relative; }
.wahl input { position: absolute; opacity: 0; }
.wahl span { font-size: 1.05rem; }
.wahl small { font-weight: 400; color: var(--grau); }
.wahl:has(input:checked) { border-color: var(--blau); background: var(--blau-hell); }
.erfolg { text-align: center; }
.haken { width: 64px; height: 64px; border-radius: 50%; background: var(--gruen); color: #fff; font-size: 2.2rem; line-height: 64px; margin: 0 auto 1rem; }
.erfolg h1 { font-size: 1.3rem; margin-bottom: .6rem; }

#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(150%); background: #1d2939; color: #fff;
  padding: .7rem 1.2rem; border-radius: 10px; transition: transform .25s, opacity .25s; z-index: 50; max-width: 90vw;
  opacity: 0; visibility: hidden; }
#toast.sichtbar { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
#toast.fehler { background: var(--rot); }

@media print {
  .kopf, .reiter, .filter, .fuss-aktion, .datumsnav { display: none; }
  body { background: #fff; }
}

/* Fußzeile & Einstellungen */
.fuss { text-align: center; color: #98a2b3; font-size: .8rem; padding: 0 1rem 2rem; }
.einst-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 700px) { .einst-raster { grid-template-columns: 1fr; } }
.status-punkt { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.status-punkt.an { background: var(--gruen); }
.status-punkt.aus { background: #d0d5dd; }
.knopfreihe { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.schalter { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1rem; }
@media (max-width: 700px) { .schalter { grid-template-columns: 1fr; } }
.tabelle td.mail-gesendet { color: var(--gruen); }
.tabelle td.mail-fehler { color: var(--rot); }
details.details-text summary { cursor: pointer; color: var(--blau); }
details.details-text pre { white-space: pre-wrap; word-break: break-word; font-size: .78rem; background: #f9fafb; border: 1px solid var(--linie); border-radius: 8px; padding: .6rem; max-height: 320px; overflow: auto; }
.version-block { border-top: 1px solid var(--linie); padding: .6rem 0; }
.version-block:first-of-type { border-top: 0; }
.version-block ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.art-tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: .05rem .45rem; border-radius: 6px; background: #eef1f5; white-space: nowrap; }
.art-tag.fehler, .art-tag.backup { background: var(--rot-hell); color: var(--rot); }
.art-tag.login { background: var(--gelb-hell); color: #8a4b00; }
.art-tag.update, .art-tag.test { background: var(--gruen-hell); color: #14532d; }

/* Klassenverwaltung */
.badge.neu { background: #e0f2fe; color: #075985; }
.kv-kopf { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.kv-kopf .knopfreihe { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; }
.chips a { text-decoration: none; padding: .35rem .75rem; border-radius: 99px; border: 1px solid var(--linie); background: #fff; color: #344054; font-weight: 600; font-size: .92rem; }
.chips a small { font-weight: 400; color: var(--grau); margin-left: .2rem; }
.chips a.aktiv { background: var(--blau); color: #fff; border-color: var(--blau); }
.chips a.aktiv small { color: #dbe4f0; }
.suche { max-width: 320px; margin: 0 0 .7rem; }
.tabelle tr.klickbar { cursor: pointer; }
.tabelle tr.klickbar:hover td { background: #f9fafb; }
.aktionen-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.aktionen-raster .karte { margin: 0; }
.aktionen-raster form { display: flex; flex-direction: column; gap: .3rem; }
.zeitstrahl { list-style: none; padding: 0; margin: 0; }
.zeitstrahl li { padding: .45rem 0 .45rem 1rem; border-left: 3px solid var(--linie); position: relative; }
.zeitstrahl li::before { content: ""; position: absolute; left: -7px; top: .8rem; width: 11px; height: 11px; border-radius: 50%; background: var(--blau); }
.zeitstrahl li.aktuell::before { background: var(--gruen); }
.vorschau-gruppe { margin: .8rem 0; }
.vorschau-gruppe h3 { color: #1d2939; margin: 0 0 .3rem; }
.vorschau-gruppe ul { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
@media (max-width: 700px) { .vorschau-gruppe ul { columns: 1; } }
.kz { display: inline-flex; gap: .4rem; align-items: center; }
.schritt { display: flex; gap: .8rem; align-items: flex-start; }
.schritt b.nr { flex: 0 0 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--blau); color: #fff; display: flex; align-items: center; justify-content: center; }

/* Version 1.5: Verspätung, Langzeit, Bemerkungen */
.z.verspaetet b { color: #6d28d9; }
.knoepfe button[data-status=verspaetet].an { background: #6d28d9; border-color: #6d28d9; color: #fff; }
.knoepfe button.vorschlag[data-status=verspaetet] { border-color: #6d28d9; color: #6d28d9; background: #f3effd; }
.knoepfe button.notiz-knopf { min-width: 48px; font-size: 1.2rem; color: var(--blau); }
.schueler[data-status=verspaetet] { background: #f8f5ff; }
.knoepfe button { min-width: 6.4rem; }
.badge.spaeter { background: #f3effd; color: #5b21b6; }
.badge.lang { background: #e0f2fe; color: #075985; }
.badge.ankunft { background: #f3effd; color: #5b21b6; font-weight: 500; }
.bemerkung { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; font-size: .82rem; background: #fffbea; border: 1px solid #f5dfa0; color: #5c4400; border-radius: 6px; padding: .1rem .45rem; }
.bemerkung.dringend { background: var(--rot-hell); border-color: #f1b5b0; color: #7f1d1d; }
.bemerkung.erledigt { background: #eef7f1; border-color: #bfe3cc; color: #14532d; }
.bemerkung .antwort { font-weight: 600; }
.bem-loeschen { border: 0; background: none; color: inherit; font-size: 1rem; line-height: 1; cursor: pointer; padding: 0 .1rem; }
dialog#bem-dialog { border: 0; border-radius: var(--radius); padding: 1.2rem 1.3rem; width: min(560px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog#bem-dialog::backdrop { background: rgba(16,24,40,.45); }
dialog#bem-dialog h2 { margin: 0 0 .2rem; }
textarea { display: block; width: 100%; margin-top: .3rem; font: inherit; font-weight: 400; padding: .65rem .75rem; border: 1px solid #cfd4dc; border-radius: 10px; }
.bem-karte { border-left-color: #e3b341; }
.bem-karte.dringend { border-left-color: var(--rot); }
.bem-text { margin: .2rem 0 .6rem; font-size: 1.05rem; white-space: pre-wrap; }
.kind-suche label { margin: 0; }

/* Version 1.6: Stunden, Fehltage, Benachrichtigung */
.tabelle.auswertung th { text-align: center; white-space: normal; line-height: 1.2; }
.tabelle.auswertung th:first-child, .tabelle.auswertung th:last-child { text-align: left; }
.tabelle.auswertung th.gruppe { border-bottom: 1px solid var(--linie); }
.fehltage { flex: 0 0 4.4rem; text-align: center; line-height: 1.1; padding: .2rem .3rem; border-radius: 8px; background: #f2f4f7; color: #344054; }
.fehltage b { display: block; font-size: 1.15rem; }
.fehltage small { display: block; font-size: .68rem; color: var(--grau); }
.fehltage .unent { color: var(--rot); font-weight: 700; }
.fehltage.null b { color: #98a2b3; }
.stunden-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.stunden-form label { margin: 0; width: 4.6rem; text-align: center; }
.stunden-form input[type=number] { text-align: center; display: block; width: 100%; margin-top: .3rem; font: inherit; padding: .55rem .3rem; border: 1px solid #cfd4dc; border-radius: 10px; min-height: 46px; }
.stunden-form .check { width: auto; text-align: left; align-self: center; }
.ton-leiste { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ton-leiste .btn.an { background: var(--gruen-hell); border-color: #a6dcb9; color: #14532d; }
.neu-banner { position: sticky; top: 64px; z-index: 9; background: var(--rot); color: #fff; border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.neu-banner button { background: #fff; color: var(--rot); border: 0; border-radius: 8px; padding: .4rem .8rem; font: inherit; font-weight: 600; cursor: pointer; }
@keyframes aufblinken { 0%,100% { box-shadow: 0 0 0 0 rgba(198,40,40,.0); } 50% { box-shadow: 0 0 0 6px rgba(198,40,40,.35); } }
.reiter a.blinkt { animation: aufblinken 1s ease-in-out infinite; }

/* Version 1.7 */
.badge.lang.kur { background: #ecfdf3; color: #05603a; }
.kat-form { display: inline-block; margin-left: .3rem; }
.kat-form select { display: inline-block; width: auto; min-height: 32px; padding: .15rem 1.8rem .15rem .5rem; margin: 0; font-size: .85rem; }
/* Auswertung: eigener Scrollbereich, Kopfzeilen und Namensspalte bleiben stehen */
.tabelle-wrap.scrollbereich { max-height: calc(100vh - 170px); overflow: auto; -webkit-overflow-scrolling: touch; }
.tabelle.auswertung { border-collapse: separate; border-spacing: 0; }
.tabelle.auswertung thead th { position: sticky; top: 0; z-index: 3; background: #f3f5f8; box-shadow: inset 0 -1px 0 var(--linie); }
.tabelle.auswertung thead tr:nth-child(2) th { top: var(--kopf1, 0px); }
.tabelle.auswertung tbody td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: inset -1px 0 0 var(--linie); min-width: 170px; }
.tabelle.auswertung thead th:first-child { left: 0; z-index: 4; }
.tabelle.auswertung tbody td.markiert:first-child { background: #fff; }
.tabelle.auswertung tbody tr:hover td { background: #f9fafb; }
.tabelle.auswertung tbody tr:hover td.markiert { background: #fbd9d6; }
@media print { .tabelle-wrap.scrollbereich { max-height: none; overflow: visible; } .tabelle.auswertung thead th, .tabelle.auswertung tbody td:first-child { position: static; } }
.ton-einst summary { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; cursor: pointer; list-style: none; }
.ton-einst summary::-webkit-details-marker { display: none; }
.ton-einst .ton-mehr { margin-left: auto; color: var(--blau); }
.ton-einst[open] .ton-mehr { visibility: hidden; }
.ton-raster { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1.5rem; margin-top: .8rem; }
@media (max-width: 760px) { .ton-raster { grid-template-columns: 1fr; } }
.ton-zeile { display: flex; gap: .4rem; align-items: center; margin-top: .3rem; }
.ton-zeile select { margin-top: 0; }
.ton-zeile .btn { white-space: nowrap; }
input[type=range] { width: 100%; margin-top: .6rem; accent-color: var(--blau); }
.ton-einst .btn.an { background: var(--gruen-hell); border-color: #a6dcb9; color: #14532d; }

/* Version 1.8: Beurlaubt-Status, Anträge, Ferien */
.z.beurlaubt b { color: #0e7490; }
.knoepfe button[data-status=beurlaubt].an { background: #0e7490; border-color: #0e7490; color: #fff; }
.schueler[data-status=beurlaubt] { background: #ecfeff; }
.knoepfe button { min-width: 5.9rem; font-size: .9rem; }
.badge.beurlaubt-info { background: #cffafe; color: #155e75; font-weight: 500; }
.badge.ok { background: var(--gruen-hell); color: #14532d; }
dialog.dialog { border: 0; border-radius: var(--radius); padding: 1.2rem 1.3rem; width: min(560px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.dialog::backdrop { background: rgba(16,24,40,.45); }
dialog.dialog h2 { margin: 0 0 .2rem; }
.stunden-wahl { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0; }
.stunden-wahl .btn { min-width: 4.4rem; }
.antraege-klasse { border-left: 5px solid #0e7490; }
.antrag-zeile { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .5rem 0; border-top: 1px solid var(--linie); }
.antrag-zeile:first-of-type { border-top: 0; }
.antrag-karte { border-left-color: #0e7490; }
.antrag-karte.entschieden { border-left-color: #98a2b3; }
.antrag-hinweis ul { margin: .3rem 0 0; }
.antrag-ok { text-align: left; }
@media (max-width: 1100px) { .knoepfe button { min-width: 0; padding: 0 .55rem; } }

/* Elternbrief (Version 1.10) */
.brief-leiste { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: .4rem 0 1rem; }
.brief { display: flex; flex-direction: column; gap: 1.5rem; align-items: center; }
.blatt { background: #fff; width: 210mm; min-height: 297mm; padding: 16mm 18mm; box-shadow: 0 2px 14px rgba(16,24,40,.12); border-radius: 4px;
  font-size: 11.5pt; line-height: 1.45; color: #1d2939; }
.blatt h1 { font-size: 21pt; line-height: 1.2; margin: .2rem 0 0; color: var(--blau); }
.blatt h2 { font-size: 14pt; margin: 7mm 0 3mm; color: var(--blau); display: block; }
.blatt h2.erste { margin-top: 0; }
.blatt h3 { font-size: 12pt; margin: 0 0 1.5mm; color: #1d2939; }
.brief-kopf { border-bottom: 3px solid var(--blau); padding-bottom: 4mm; margin-bottom: 5mm; }
.brief-schule { font-size: 11pt; font-weight: 700; color: var(--grau); text-transform: uppercase; letter-spacing: .06em; }
.brief-intro { margin: 0 0 5mm; }
.qr-block { display: flex; gap: 8mm; align-items: center; border: 2px solid var(--blau); border-radius: 6mm; padding: 6mm; background: #f7f9fc; }
.qr-bild svg, .qr-klein svg { display: block; width: 100%; height: auto; }
.qr-bild { flex: 0 0 62mm; background: #fff; border-radius: 3mm; padding: 1mm; }
.qr-titel { font-size: 17pt; font-weight: 800; color: var(--blau); margin-bottom: 2mm; }
.qr-text p { margin: 0 0 2mm; }
.qr-oder { color: var(--grau); font-size: 10pt; margin-top: 3mm !important; }
.qr-url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5pt; font-weight: 700; word-break: break-all;
  background: #fff; border: 1px solid #cfd4dc; border-radius: 2mm; padding: 2mm 3mm; }
.schritte-liste { margin: 0; padding-left: 0; list-style: none; counter-reset: schritt; }
.schritte-liste li { counter-increment: schritt; position: relative; padding: 1.6mm 0 1.6mm 11mm; }
.schritte-liste li::before { content: counter(schritt); position: absolute; left: 0; top: 1.2mm; width: 7.5mm; height: 7.5mm; border-radius: 50%;
  background: var(--blau); color: #fff; font-weight: 700; text-align: center; line-height: 7.5mm; font-size: 10.5pt; }
.tipp { margin-top: 6mm; background: #fff8e6; border-left: 4px solid #e3b341; padding: 3mm 4mm; border-radius: 2mm; font-size: 10.5pt; }
.sym { font-weight: 700; }
.arten { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.art-box { border: 1px solid #d0d5dd; border-radius: 3mm; padding: 3.5mm 4mm; }
.art-box p { margin: 0; font-size: 10.5pt; }
.regel-box { margin-top: 5mm; border: 2px solid #0e7490; background: #ecfeff; border-radius: 3mm; padding: 3.5mm 5mm; }
.regel-box ul { margin: 0; padding-left: 5mm; font-size: 10.5pt; }
.regel-box li { margin: .6mm 0; }
.wissen { margin: 0; padding-left: 5mm; font-size: 10.5pt; }
.wissen li { margin: 1mm 0; }
.kontakt { margin-top: 5mm; background: #f2f4f7; border-radius: 3mm; padding: 3.5mm 5mm; display: flex; gap: 6mm; align-items: center; justify-content: space-between; }
.tel-gross { font-size: 14pt; font-weight: 800; white-space: nowrap; }
.mini-qr { flex: 0 0 34mm; text-align: center; font-size: 8.5pt; word-break: break-all; }
.mini-qr .klein { font-size: 8.5pt; }
.qr-klein { width: 26mm; margin: 0 auto 1mm; background: #fff; }
.gruss { margin: 3mm 0 0; }
@media screen and (max-width: 860px) {
  .blatt { width: 100%; min-height: 0; padding: 6mm; }
  .qr-block { flex-direction: column; align-items: stretch; } .qr-bild { flex-basis: auto; max-width: 70mm; margin: 0 auto; }
  .arten { grid-template-columns: 1fr; }
}
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .nicht-drucken, .kopf, .reiter, .fuss, #neu-banner-platz, #toast { display: none !important; }
  main { max-width: none; padding: 0; }
  .brief { gap: 0; display: block; }
  .blatt { box-shadow: none; border-radius: 0; width: 210mm; height: 297mm; min-height: 0; overflow: hidden; page-break-after: always; break-after: page; }
  .blatt:last-child { page-break-after: auto; break-after: auto; }
  .qr-block, .regel-box, .tipp, .kontakt, .art-box { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .schritte-liste li::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Logo + kompakte Elternanleitung (Version 1.11) */
.kopf-logo { height: 30px; width: auto; max-width: 90px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 4px; vertical-align: middle; }
.eltern-logo { display: block; max-height: 70px; max-width: 220px; margin: 0 auto .8rem; object-fit: contain; }
.logo-einst { display: flex; gap: 1.2rem; align-items: flex-start; flex-wrap: wrap; }
.logo-vorschau { width: 150px; height: 100px; border: 1px dashed var(--linie); border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fff; }
.logo-vorschau img { max-width: 140px; max-height: 90px; object-fit: contain; }
.blatt.kompakt { padding: 13mm 15mm; font-size: 11pt; }
.k-kopf { display: flex; align-items: center; gap: 6mm; border-bottom: 3px solid var(--blau); padding-bottom: 3.5mm; margin-bottom: 4mm; }
.k-logo { max-height: 22mm; max-width: 45mm; object-fit: contain; }
.k-kopf h1 { font-size: 20pt; }
.k-intro { margin: 0 0 5mm; }
.k-qr { display: flex; gap: 7mm; align-items: center; border: 2px solid var(--blau); border-radius: 5mm; padding: 5mm; background: #f7f9fc; }
.k-qr .qr-bild { flex: 0 0 52mm; }
.k-qr .qr-titel { font-size: 15pt; margin-bottom: 1mm; }
.k-schritte { margin: 0 0 3mm; padding-left: 5mm; }
.k-schritte li { margin: .8mm 0; }
.k-qr .qr-url { font-size: 11pt; }
.k-arten { display: grid; grid-template-columns: 1fr 1fr; gap: 3mm; margin-top: 5mm; }
.k-arten > div { border: 1px solid #d0d5dd; border-radius: 2.5mm; padding: 2.5mm 3.5mm; font-size: 10.5pt; line-height: 1.4; }
.blatt.kompakt .regel-box { margin-top: 4mm; font-size: 10.5pt; padding: 3mm 4mm; }
.k-wissen { margin: 4mm 0 0; padding-left: 5mm; font-size: 10.5pt; }
.k-wissen li { margin: .8mm 0; }
.k-fuss { margin-top: 5mm; display: flex; justify-content: space-between; align-items: center; gap: 4mm; flex-wrap: wrap;
  background: #f2f4f7; border-radius: 3mm; padding: 3mm 4mm; font-size: 10.5pt; }
.k-fuss .tel-gross { font-size: 13pt; }
@media print {
  .blatt.kompakt { height: auto; min-height: 0; overflow: visible; }
  .k-qr, .k-fuss { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media screen and (max-width: 860px) {
  .k-qr { flex-direction: column; align-items: stretch; } .k-qr .qr-bild { flex-basis: auto; max-width: 60mm; margin: 0 auto; }
  .k-arten { grid-template-columns: 1fr; }
}

/* Elternkarte A5 (Version 1.12) */
.karten { display: flex; justify-content: center; align-items: stretch; background: #fff; margin: 0 auto; box-shadow: 0 2px 14px rgba(16,24,40,.12); }
.karten-a4 { width: 297mm; height: 210mm; }
.karten-a5 { width: 148mm; height: 210mm; }
.karte-a5 { width: 148mm; height: 210mm; padding: 11mm 11mm 10mm; display: flex; flex-direction: column; align-items: center; text-align: center;
  color: #1d2939; font-size: 10.5pt; line-height: 1.35; overflow: hidden; }
.schnittlinie { width: 0; border-left: 1px dashed #98a2b3; position: relative; }
.schnittlinie::before { content: "✂"; position: absolute; top: 6mm; left: -2.4mm; font-size: 9pt; color: #98a2b3; background: #fff; }
.ka-kopf { display: flex; align-items: center; justify-content: center; gap: 3mm; min-height: 14mm; }
.ka-logo { max-height: 18mm; max-width: 40mm; object-fit: contain; }
.ka-schule { font-weight: 800; font-size: 13pt; color: var(--blau); text-align: left; line-height: 1.2; }
.ka-titel { margin: 4.5mm 0 4.5mm; font-size: 23pt; font-weight: 800; line-height: 1.15; color: var(--blau); }
.ka-titel span { color: #1d2939; font-size: 17pt; font-weight: 700; }
.ka-qr { width: 74mm; padding: 1.5mm; border: 2px solid var(--blau); border-radius: 4mm; background: #fff; }
.ka-qr svg { display: block; width: 100%; height: auto; }
.ka-url { margin-top: 2.5mm; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 9.5pt; color: #475467; word-break: break-all; }
.ka-arten { list-style: none; padding: 0 2mm; margin: 5mm 0 0; font-size: 12pt; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5mm 4mm; text-align: left; width: 100%; }
.ka-arten li { padding-left: 5.5mm; position: relative; font-weight: 600; }
.ka-arten li::before { content: "✓"; position: absolute; left: 0; color: var(--gruen); font-weight: 800; }
.ka-arten small { font-weight: 400; color: #475467; }
.ka-hinweis { margin: 4.5mm 0 0; font-size: 10.5pt; color: #344054; }
.ka-tel { margin-top: auto; width: 100%; padding: 3mm; background: #f2f4f7; border-radius: 3mm; font-size: 12pt; }
.ka-tel b { font-size: 14pt; white-space: nowrap; }
@media print {
  body { background: #fff; }
  .karten { box-shadow: none; margin: 0; }
  .ka-tel, .ka-qr { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media screen and (max-width: 1000px) { .karten-a4 { transform: scale(.75); transform-origin: top center; } }
/* 4 Karten A6 auf A4 hoch: die A5-Karte wird exakt um 1/√2 verkleinert */
.karten-a6 { width: 210mm; height: 297mm; display: grid; grid-template-columns: 105mm 105mm; grid-template-rows: 148.5mm 148.5mm; position: relative; }
.a6-feld { width: 105mm; height: 148.5mm; overflow: hidden; }
.a6-feld .karte-a5 { transform: scale(0.70711); transform-origin: top left; }
.schnitt-h, .schnitt-v { position: absolute; pointer-events: none; }
.schnitt-h { left: 0; right: 0; top: 148.5mm; border-top: 1px dashed #98a2b3; }
.schnitt-v { top: 0; bottom: 0; left: 105mm; border-left: 1px dashed #98a2b3; }
.ka-pw { margin-top: 2.5mm; padding: 1.5mm 4mm; border: 1.5px dashed var(--blau); border-radius: 2.5mm; font-size: 12pt; color: #1d2939; }
.ka-pw b { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14pt; letter-spacing: .04em; }
.karte.mitte { text-align: center; }
