/* Lehrerplaner – Gestaltung angelehnt an die Walter-Gropius-Schule Erfurt (Anthrazit, Weiß, Rot) */
:root {
  --anthrazit: #535353;
  --dunkel: #2f2f2f;
  --rot: #c8102e;
  --rot-hell: #fbe9ec;
  --bg: #f3f3f1;
  --flaeche: #ffffff;
  --flaeche2: #f8f8f6;
  --linie: #dddcd7;
  --linie2: #ecebe7;
  --text: #222222;
  --text2: #6b6b6b;
  --ferien: #fff1c7;
  --ferien-text: #7a5a00;
  --feiertag: #fde3e3;
  --feiertag-text: #a3142a;
  --heute: #c8102e;
  --ok: #2e7d4f;
  --warn: #b26a00;
  --schatten: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.06);
  --r: 10px;
  --font: Arial, "Helvetica Neue", Helvetica, system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dunkel"] {
  --anthrazit: #a8a8a8;
  --dunkel: #1b1b1b;
  --rot: #ff4d5e;
  --rot-hell: #3a1d21;
  --bg: #161616;
  --flaeche: #222222;
  --flaeche2: #1c1c1c;
  --linie: #3a3a3a;
  --linie2: #2c2c2c;
  --text: #ececec;
  --text2: #a4a4a4;
  --ferien: #3a3218;
  --ferien-text: #f0d27a;
  --feiertag: #3d1f23;
  --feiertag-text: #ff9aa6;
  --heute: #ff4d5e;
  --schatten: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 15px; color: var(--text); background: var(--bg); -webkit-text-size-adjust: 100%; }
a { color: var(--rot); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.muted { color: var(--text2); }
.klein { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- Kopfleiste ---------- */
.kopf { position: sticky; top: 0; z-index: 20; background: var(--dunkel); color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 18px; height: 56px; }
.marke { display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.marke .zeichen { width: 30px; height: 30px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.marke .zeichen i { display: block; background: #fff; }
.marke .zeichen i:nth-child(2) { background: var(--rot); }
.marke .zeichen i:nth-child(3) { background: #9a9a9a; }
.marke .zeichen i:nth-child(4) { background: transparent; border: 2px solid #fff; }
.marke img { height: 32px; }
.marke small { display: block; font-weight: 400; font-size: 11px; opacity: .7; letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; gap: 2px; height: 100%; }
.nav button { background: none; border: 0; color: #d9d9d9; padding: 0 14px; height: 100%; cursor: pointer; display: flex; align-items: center; gap: 8px; border-bottom: 3px solid transparent; }
.nav button:hover { color: #fff; }
.nav button.aktiv { color: #fff; border-bottom-color: var(--rot); }
.nav svg { width: 18px; height: 18px; }
.kopf .rechts { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; }
.sync { display: flex; align-items: center; gap: 6px; color: #cfcfcf; white-space: nowrap; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: #6fbf8c; display: inline-block; }
.sync.offen i { background: #f2c230; }
.sync.fehler i { background: #ff5b6b; }

/* Mobile Navigation unten */
.navunten { display: none; }

main { padding: 20px; max-width: 1500px; margin: 0 auto; }

/* ---------- Bausteine ---------- */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); box-shadow: var(--schatten); }
.pad { padding: 16px; }
.leiste { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.leiste .titel { font-size: 20px; font-weight: 700; margin-right: 6px; }
.fuell { flex: 1; }
.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--linie); background: var(--flaeche); border-radius: 8px; padding: 7px 12px; cursor: pointer; line-height: 1.2; white-space: nowrap; }
.btn:hover { border-color: var(--anthrazit); }
.btn.haupt { background: var(--rot); border-color: var(--rot); color: #fff; }
.btn.haupt:hover { filter: brightness(1.08); }
.btn.dunkel { background: var(--dunkel); border-color: var(--dunkel); color: #fff; }
.btn.leise { background: none; border-color: transparent; }
.btn.leise:hover { background: var(--flaeche2); border-color: var(--linie); }
.btn.gefahr { color: var(--rot); }
.btn.icon { padding: 7px 9px; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.gruppe { display: inline-flex; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; background: var(--flaeche); }
.gruppe button { border: 0; background: none; padding: 7px 12px; cursor: pointer; border-right: 1px solid var(--linie); }
.gruppe button:last-child { border-right: 0; }
.gruppe button.aktiv { background: var(--dunkel); color: #fff; }
.gruppe svg { width: 16px; height: 16px; display: block; }

input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=url], select, textarea {
  border: 1px solid var(--linie); background: var(--flaeche); border-radius: 8px; padding: 8px 10px; width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--anthrazit); box-shadow: 0 0 0 3px rgba(83,83,83,.15); }
textarea { resize: vertical; min-height: 70px; }
label.feld { display: block; margin-bottom: 12px; }
label.feld > span { display: block; font-size: 12px; color: var(--text2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
.zeile { display: flex; gap: 12px; }
.zeile > * { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 10px; }
.check input { width: 18px; height: 18px; accent-color: var(--rot); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: var(--flaeche2); border: 1px solid var(--linie); }
.punkt { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.leer { text-align: center; padding: 40px 20px; color: var(--text2); }
.leer svg { width: 40px; height: 40px; opacity: .4; display: block; margin: 0 auto 10px; }

/* ---------- Anmeldung ---------- */
.anmeldung { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.anmeldung .bild { background: var(--dunkel); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.anmeldung .bild h1 { font-size: 44px; line-height: 1.05; margin-top: 30px; }
.anmeldung .bild p { color: #bdbdbd; max-width: 420px; line-height: 1.5; }
.anmeldung .bauhaus { position: absolute; right: -60px; bottom: -60px; width: min(360px, 42vh); height: min(360px, 42vh); opacity: .9; z-index: 0; }
.anmeldung .bild > div:not(.bauhaus) { position: relative; z-index: 1; }
.anmeldung .form { display: flex; align-items: center; justify-content: center; padding: 30px; }
.anmeldung .form .karte { width: 100%; max-width: 380px; padding: 28px; }
.anmeldung .form h2 { margin-bottom: 18px; }
.meldung { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; background: var(--rot-hell); color: var(--rot); }
.meldung.ok { background: #e5f3ea; color: var(--ok); }

/* ---------- Woche ---------- */
.woche { display: grid; border: 1px solid var(--linie); border-radius: var(--r); overflow: hidden; background: var(--flaeche); box-shadow: var(--schatten); }
.woche .kz { background: var(--flaeche2); border-right: 1px solid var(--linie); border-bottom: 1px solid var(--linie2); padding: 8px; font-size: 12px; color: var(--text2); text-align: right; }
.woche .kz b { display: block; font-size: 15px; color: var(--text); }
.woche .tk { padding: 10px; border-bottom: 1px solid var(--linie); border-right: 1px solid var(--linie2); background: var(--flaeche2); min-width: 0; }
.woche .tk .tag { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); }
.woche .tk .datum { font-size: 20px; font-weight: 700; }
.woche .tk.heute .datum { color: var(--heute); }
.woche .tk.heute { box-shadow: inset 0 3px 0 var(--heute); }
.woche .ganz { padding: 4px; border-bottom: 1px solid var(--linie); border-right: 1px solid var(--linie2); min-height: 30px; display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: pointer; }
.woche .zelle { border-right: 1px solid var(--linie2); border-bottom: 1px solid var(--linie2); padding: 3px; min-height: 64px; position: relative; cursor: pointer; min-width: 0; }
.woche .zelle:hover { background: var(--flaeche2); }
.woche .zelle.frei { background: repeating-linear-gradient(-45deg, transparent 0 8px, var(--linie2) 8px 9px); cursor: default; }
.woche .zelle.jetzt { box-shadow: inset 3px 0 0 var(--heute); }
.std { border-radius: 7px; padding: 6px 8px; height: 100%; border-left: 4px solid var(--farbe, #888); background: color-mix(in srgb, var(--farbe, #888) 13%, var(--flaeche)); font-size: 13px; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.std .k { font-weight: 700; display: flex; justify-content: space-between; gap: 6px; }
.std .k span { font-weight: 400; color: var(--text2); font-size: 12px; }
.std .fa { color: var(--text2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -2px; }
.std .th { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.std .ha { color: var(--text2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.std.ausfall { opacity: .55; }
.std.ausfall .k b { text-decoration: line-through; }
.std.extra { border-left-style: dashed; }
.std .marken { display: flex; gap: 4px; margin-top: auto; }
.std .marken i { font-style: normal; font-size: 10px; padding: 0 5px; border-radius: 4px; background: var(--flaeche); border: 1px solid var(--linie); color: var(--text2); }
.band { font-size: 12px; padding: 3px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.band.ferien { background: var(--ferien); color: var(--ferien-text); }
.band.feiertag { background: var(--feiertag); color: var(--feiertag-text); }
.band.termin { background: var(--flaeche2); border-left: 3px solid var(--farbe, var(--anthrazit)); }
.band.extern { background: var(--flaeche2); border-left: 3px dotted var(--farbe, var(--anthrazit)); color: var(--text2); }
.band.auf { background: var(--flaeche2); border-left: 3px solid var(--warn); }
.band.geb { background: var(--flaeche2); border-left: 3px solid #9b59b6; }
.tagesliste { display: none; }

/* ---------- Monat ---------- */
.monat { display: grid; grid-template-columns: 44px repeat(7, 1fr); background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); overflow: hidden; box-shadow: var(--schatten); }
.monat .wt { padding: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); background: var(--flaeche2); border-bottom: 1px solid var(--linie); }
.monat .kw { font-size: 11px; color: var(--text2); padding: 8px 4px; text-align: center; border-right: 1px solid var(--linie2); border-bottom: 1px solid var(--linie2); background: var(--flaeche2); }
.monat .tag { min-height: 108px; border-right: 1px solid var(--linie2); border-bottom: 1px solid var(--linie2); padding: 5px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.monat .tag:hover { background: var(--flaeche2); }
.monat .tag.fremd { opacity: .45; }
.monat .tag.ferien { background: color-mix(in srgb, var(--ferien) 55%, var(--flaeche)); }
.monat .tag.feiertag { background: color-mix(in srgb, var(--feiertag) 55%, var(--flaeche)); }
.monat .tag.we { background: var(--flaeche2); }
.monat .tag .nr { font-size: 13px; font-weight: 700; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.monat .tag.heute .nr { background: var(--heute); color: #fff; }
.monat .mehr { font-size: 11px; color: var(--text2); }

/* ---------- Jahr ---------- */
.jahr { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.mini { padding: 12px; }
.mini h3 { font-size: 14px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.mini .g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 12px; text-align: center; }
.mini .g b { font-weight: 400; color: var(--text2); font-size: 10px; }
.mini .g span { padding: 4px 0; border-radius: 4px; cursor: pointer; }
.mini .g span.we { color: var(--text2); }
.mini .g span.ferien { background: var(--ferien); color: var(--ferien-text); }
.mini .g span.feiertag { background: var(--feiertag); color: var(--feiertag-text); font-weight: 700; }
.mini .g span.beweglich { background: var(--ferien); color: var(--ferien-text); outline: 2px dashed var(--ferien-text); outline-offset: -2px; }
.mini .g span.termin { box-shadow: inset 0 -2px 0 var(--rot); }
.mini .g span.heute { background: var(--heute); color: #fff; }
.legende { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text2); align-items: center; }
.legende i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.ferienliste { columns: 2; font-size: 14px; }
.ferienliste div { break-inside: avoid; padding: 4px 0; border-bottom: 1px solid var(--linie2); display: flex; justify-content: space-between; gap: 10px; }

/* ---------- Klassen ---------- */
.klassen { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.klasse-karte { padding: 16px; cursor: pointer; border-top: 5px solid var(--farbe); transition: transform .12s; }
.klasse-karte:hover { transform: translateY(-2px); }
.klasse-karte .n { font-size: 24px; font-weight: 700; }
.klasse-karte .f { color: var(--text2); margin-top: 2px; }
.klasse-karte .z { display: flex; gap: 14px; margin-top: 14px; font-size: 13px; color: var(--text2); }
.klasse-kopf { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.klasse-kopf .farbe { width: 14px; height: 40px; border-radius: 4px; background: var(--farbe); }
.klasse-kopf .n { font-size: 26px; font-weight: 700; }
.reiter { display: flex; gap: 4px; border-bottom: 1px solid var(--linie); margin-bottom: 14px; overflow-x: auto; }
.reiter button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--text2); border-bottom: 3px solid transparent; white-space: nowrap; }
.reiter button.aktiv { color: var(--text); border-bottom-color: var(--rot); font-weight: 700; }

table.tab { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.tab th, table.tab td { padding: 7px 8px; border-bottom: 1px solid var(--linie2); text-align: left; vertical-align: middle; }
table.tab th { font-size: 12px; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; background: var(--flaeche2); position: sticky; top: 0; z-index: 1; }
table.tab tr:hover td { background: var(--flaeche2); }
table.tab input { padding: 5px 7px; }
.scroll { overflow: auto; max-width: 100%; }

/* Notenbuch */
.noten { border-collapse: separate; border-spacing: 0; font-size: 14px; }
.noten th, .noten td { border-bottom: 1px solid var(--linie2); border-right: 1px solid var(--linie2); padding: 0; text-align: center; height: 36px; background: var(--flaeche); }
.noten th { background: var(--flaeche2); font-size: 12px; font-weight: 700; padding: 6px 4px; vertical-align: bottom; position: sticky; top: 0; z-index: 2; cursor: pointer; min-width: 58px; }
.noten th .art { display: block; font-weight: 400; color: var(--text2); font-size: 10px; text-transform: uppercase; }
.noten th .dt { display: block; font-weight: 400; color: var(--text2); font-size: 11px; }
.noten td.name, .noten th.name { text-align: left; padding: 0 10px; position: sticky; left: 0; z-index: 1; white-space: nowrap; min-width: 170px; }
.noten th.name { z-index: 3; cursor: default; }
.noten td input { border: 0; width: 100%; height: 100%; text-align: center; background: transparent; border-radius: 0; padding: 0; font-weight: 700; }
.noten td input:focus { background: var(--rot-hell); box-shadow: none; }
.noten td.schnitt { font-weight: 700; background: var(--flaeche2); min-width: 64px; }
.noten td.schnitt.gesamt { background: var(--dunkel); color: #fff; }
.noten tfoot td { background: var(--flaeche2); font-size: 12px; color: var(--text2); }
.n1 { color: #1e7a45; } .n2 { color: #4e8a2a; } .n3 { color: #8a7a00; } .n4 { color: #b26a00; } .n5 { color: #c8102e; } .n6 { color: #8b0000; }
:root[data-theme="dunkel"] .n1 { color: #6fd39a; } :root[data-theme="dunkel"] .n2 { color: #a5d46a; } :root[data-theme="dunkel"] .n3 { color: #e3d15e; } :root[data-theme="dunkel"] .n4 { color: #f0a54a; } :root[data-theme="dunkel"] .n5 { color: #ff6b7a; } :root[data-theme="dunkel"] .n6 { color: #ff4040; }

/* Anwesenheit */
.anw { display: grid; grid-template-columns: 1fr auto; gap: 0; }
.anw .s { padding: 8px 4px; border-bottom: 1px solid var(--linie2); display: flex; align-items: center; gap: 10px; }
.anw .b { padding: 6px 4px; border-bottom: 1px solid var(--linie2); display: flex; gap: 4px; }
.status button { border: 1px solid var(--linie); background: var(--flaeche); border-radius: 7px; min-width: 40px; height: 34px; cursor: pointer; font-weight: 700; font-size: 13px; }
.status button.an { background: var(--dunkel); color: #fff; border-color: var(--dunkel); }
.status button.an.f { background: var(--rot); border-color: var(--rot); }
.status button.an.e { background: var(--warn); border-color: var(--warn); }
.status button.an.v { background: #7a6a00; border-color: #7a6a00; }
.matrix td.st { text-align: center; font-weight: 700; font-size: 12px; }
.matrix td.st.f { color: var(--rot); } .matrix td.st.e { color: var(--warn); } .matrix td.st.v { color: #7a6a00; }

/* Sitzplan */
.sitzplan { display: grid; gap: 8px; }
.tafel { text-align: center; background: var(--dunkel); color: #fff; border-radius: 6px; padding: 6px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 14px; }
.platz { min-height: 58px; border: 2px dashed var(--linie); border-radius: 8px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; padding: 4px; cursor: pointer; background: var(--flaeche); user-select: none; -webkit-user-select: none; }
.platz.belegt { border-style: solid; border-color: var(--farbe, var(--anthrazit)); background: color-mix(in srgb, var(--farbe, #888) 10%, var(--flaeche)); font-weight: 700; }
.platz.belegt small { display: block; font-weight: 400; color: var(--text2); }
.platz.gewaehlt, .schueler-chip.gewaehlt { outline: 3px solid var(--rot); outline-offset: 1px; }
.platz.drueber { background: var(--rot-hell); }
.platz.kein { border: 0; background: none; cursor: pointer; opacity: .35; }
.schueler-chip { display: inline-block; padding: 6px 10px; border-radius: 99px; background: var(--flaeche2); border: 1px solid var(--linie); margin: 3px; cursor: grab; font-size: 13px; user-select: none; -webkit-user-select: none; }

/* Zufall */
.zufall { font-size: 46px; font-weight: 700; text-align: center; padding: 34px 10px; min-height: 140px; }
.gruppen { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.gruppen .karte { padding: 10px 12px; }
.gruppen h3 { font-size: 13px; color: var(--text2); text-transform: uppercase; margin-bottom: 6px; }

/* Aufgaben */
.aufgabe { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--linie2); }
.aufgabe:last-child { border-bottom: 0; }
.aufgabe .t { flex: 1; min-width: 0; }
.aufgabe.erledigt .t { text-decoration: line-through; color: var(--text2); }
.aufgabe .faellig { font-size: 12px; color: var(--text2); }
.aufgabe .faellig.ueber { color: var(--rot); font-weight: 700; }
.haken { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--anthrazit); background: none; cursor: pointer; flex: none; display: grid; place-items: center; padding: 0; }
.haken.an { background: var(--ok); border-color: var(--ok); }
.haken svg { width: 14px; height: 14px; color: #fff; }
.abschnitt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); margin: 18px 0 6px; font-weight: 700; }

/* Einstellungen */
.einst { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.einst nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.einst nav button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--text2); }
.einst nav button.aktiv { background: var(--flaeche); color: var(--text); font-weight: 700; box-shadow: var(--schatten); }
.einst section { margin-bottom: 20px; }
.einst section > h3 { margin-bottom: 4px; }
.einst section > p.muted { margin: 0 0 14px; font-size: 14px; }
.plan { border-collapse: separate; border-spacing: 4px; width: 100%; }
.plan th { font-size: 12px; color: var(--text2); font-weight: 700; text-transform: uppercase; }
.plan td.z { font-size: 12px; color: var(--text2); white-space: nowrap; text-align: right; padding-right: 6px; }
.plan td.c { height: 50px; border: 1px dashed var(--linie); border-radius: 7px; cursor: pointer; padding: 4px 6px; font-size: 13px; vertical-align: top; }
.plan td.c:hover { border-color: var(--anthrazit); }
.plan td.c.voll { border: 0; background: color-mix(in srgb, var(--farbe) 16%, var(--flaeche)); border-left: 4px solid var(--farbe); }
.plan td.c .ab { font-size: 11px; color: var(--text2); }
.adresse { display: flex; gap: 8px; }
.adresse input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.farben { display: flex; gap: 6px; flex-wrap: wrap; }
.farben button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.farben button.an { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--flaeche); }

/* Anleitung mit Bildern */
.anleitung { margin: -4px 0 14px; font-size: 14px; }
.anleitung summary { cursor: pointer; color: var(--rot); font-weight: 700; }
.anleitung ol { padding-left: 20px; margin: 10px 0 4px; }
.anleitung li { margin-bottom: 12px; }
.anleitung img { display: block; max-width: 100%; margin-top: 6px; border: 1px solid var(--linie); border-radius: 8px; }

/* ---------- Dialog ---------- */
.hinter { position: fixed; inset: 0; background: rgba(20,20,20,.45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow: auto; animation: ein .12s; }
.dialog { background: var(--flaeche); border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: hoch .15s; }
.dialog.breit { max-width: 860px; }
.dialog .dk { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; }
.dialog .dk h2 { font-size: 18px; flex: 1; }
.dialog .di { padding: 6px 18px 12px; }
.dialog .df { display: flex; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--linie2); }

@keyframes ein { from { opacity: 0; } }
@keyframes hoch { from { transform: translateY(10px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--dunkel); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 60; font-size: 14px; box-shadow: var(--schatten); animation: hoch .15s; }

/* ---------- Mobil / Tablet ---------- */
@media (max-width: 1100px) {
  .jahr { grid-template-columns: repeat(3, 1fr); }
  .nav button span { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  main { padding: 12px 12px 90px; }
  .kopf { height: 50px; padding: 0 12px; }
  .kopf .nav { display: none; }
  .marke small { display: none; }
  .navunten { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--dunkel); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .navunten button { flex: 1; background: none; border: 0; color: #bdbdbd; padding: 8px 2px 7px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; cursor: pointer; }
  .navunten button.aktiv { color: #fff; }
  .navunten button.aktiv svg { color: var(--rot); }
  .navunten svg { width: 22px; height: 22px; }
  .woche { display: none; }
  .tagesliste { display: block; }
  .tagesliste .tagblock { margin-bottom: 14px; }
  .tagesliste .tagkopf { display: flex; align-items: baseline; gap: 8px; margin: 4px 2px 8px; }
  .tagesliste .tagkopf b { font-size: 18px; }
  .tagesliste .tagkopf.heute b { color: var(--heute); }
  .tagesliste .eintrag { display: flex; gap: 10px; align-items: stretch; margin-bottom: 6px; }
  .tagesliste .eintrag .zeit { width: 48px; font-size: 12px; color: var(--text2); text-align: right; padding-top: 6px; flex: none; }
  .tagesliste .eintrag .std { flex: 1; min-height: 52px; }
  .tagesliste .bands { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
  .monat { grid-template-columns: 26px repeat(7, 1fr); }
  .monat .tag { min-height: 58px; padding: 3px; }
  .monat .tag .band { font-size: 0; padding: 0; height: 5px; border-radius: 3px; }
  .monat .kw { font-size: 9px; padding: 6px 1px; }
  .monat .wt { padding: 6px 2px; font-size: 10px; text-align: center; }
  .jahr { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mini { padding: 8px; }
  .ferienliste { columns: 1; }
  .anmeldung { grid-template-columns: 1fr; }
  .anmeldung .bild { padding: 28px; min-height: 230px; }
  .anmeldung .bild h1 { font-size: 30px; margin-top: 16px; }
  .anmeldung .bauhaus { width: 200px; height: 200px; right: -40px; bottom: -40px; }
  .einst { grid-template-columns: 1fr; }
  .einst nav { position: static; flex-direction: row; overflow-x: auto; }
  .einst nav button { white-space: nowrap; }
  .zeile { flex-direction: column; gap: 0; }
  .leiste .titel { font-size: 17px; width: 100%; }
  .klasse-kopf .n { font-size: 22px; }
  .zufall { font-size: 32px; }
  .dialog { border-radius: 14px; }
  .hinter { padding-top: 3vh; }
  .sync span { display: none; }
}

/* ---------- Druck ---------- */
@media print {
  .kopf, .navunten, .leiste .btn, .leiste .gruppe, .reiter, .nicht-drucken { display: none !important; }
  main { padding: 0; max-width: none; }
  body { background: #fff; }
  .karte, .woche, .monat { box-shadow: none; }
  .jahr { grid-template-columns: repeat(4, 1fr); }
  .noten th, table.tab th { position: static; }
}

/* ================= Papier-Planer ================= */
body.papier { position: fixed; inset: 0; width: 100%; background: #3a3835; color: #2b2b2b; overflow: hidden; height: 100vh; height: 100dvh; margin: 0; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
body.papier input, body.papier textarea, body.papier select { -webkit-user-select: text; user-select: text; }
.pleiste { height: 52px; display: flex; align-items: center; gap: 6px; padding: 0 10px; padding-top: env(safe-area-inset-top); background: #2a2927; color: #eee; box-sizing: content-box; overflow-x: auto; scrollbar-width: none; }
.pleiste::-webkit-scrollbar { display: none; }
.pleiste .marke { display: flex; align-items: center; margin-right: 4px; }
.pleiste .marke svg, .pleiste .marke img { height: 26px; width: auto; }
.gruppe-wz { display: flex; gap: 2px; padding: 0 6px; border-right: 1px solid #45433f; }
.wz { min-width: 38px; height: 38px; border: 0; border-radius: 9px; background: transparent; color: #ddd; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0 6px; font: inherit; font-size: 14px; flex-shrink: 0; }
.wz:hover { background: #3a3936; }
.wz.an { background: #4a4844; box-shadow: inset 0 0 0 2px #eee; }
.wz.text { padding: 0 12px; border: 1px solid #55534f; }
.wz svg { width: 20px; height: 20px; }
.wz.spiegel svg { transform: scaleX(-1) rotate(-30deg); }
.wz .farbe { width: 20px; height: 20px; border-radius: 50%; display: block; box-shadow: 0 0 0 1px #0006; }
.wz .farbe.marker { border-radius: 4px; width: 14px; height: 22px; }
.wz .strich { width: 22px; background: #ddd; border-radius: 4px; display: block; }
.pleiste .fuell { flex: 1; min-width: 6px; }
.nav-b { display: flex; align-items: center; gap: 4px; }
.titel-b { font-weight: 700; font-size: 15px; white-space: nowrap; padding: 0 6px; min-width: 120px; text-align: center; }
.sync { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #aaa; white-space: nowrap; padding: 0 6px; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: #6fbf73; display: block; }
.sync.offen i { background: #e3a33b; }
.tisch { position: relative; height: calc(100vh - 52px - env(safe-area-inset-top)); height: calc(100dvh - 52px - env(safe-area-inset-top)); display: flex; align-items: center; justify-content: center; padding-right: 56px; box-sizing: border-box; }
.buch { display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 6px 18px #0007); transition: transform .12s ease, opacity .12s ease; }
.buch .seite { transition: transform .18s ease-in, opacity .18s ease-in; }
.buch.blaettern-l .seite:last-child { transform-origin: left center; transform: perspective(2200px) rotateY(-70deg); opacity: .5; }
.buch.blaettern-r .seite:first-child { transform-origin: right center; transform: perspective(2200px) rotateY(70deg); opacity: .5; }
.ecke { position: absolute; bottom: 0; width: 44px; height: 44px; z-index: 3; cursor: pointer; touch-action: none; }
.ecke.rechts { right: 0; background: linear-gradient(135deg, #fbf8f1 0, #e2dbcd 44%, #bdb4a3 50%, #3a3835 50%); filter: drop-shadow(-2px -2px 2px #0002); }
.ecke.links { left: 0; background: linear-gradient(225deg, #fbf8f1 0, #e2dbcd 44%, #bdb4a3 50%, #3a3835 50%); filter: drop-shadow(2px -2px 2px #0002); }
.ecke:hover { width: 60px; height: 60px; }
.schnitt { position: absolute; top: 12px; bottom: 60px; width: 18px; z-index: 2; cursor: pointer; touch-action: none; }
.schnitt.rechts { right: 0; background: repeating-linear-gradient(90deg, transparent 0 3px, #e4ded2 3px 4px); }
.schnitt.links { left: 0; background: repeating-linear-gradient(90deg, #e4ded2 0 1px, transparent 1px 4px); }
.schnitt:hover { background-color: #0000000a; }
.seite { position: relative; background: #fffdf8; overflow: hidden; flex-shrink: 0; }
.buch.doppel .seite:first-child { border-radius: 6px 0 0 6px; background: linear-gradient(to left, #e9e4d9 0, #fffdf8 26px); }
.buch.doppel .seite:last-child { border-radius: 0 6px 6px 0; background: linear-gradient(to right, #e9e4d9 0, #fffdf8 26px); }
.buch:not(.doppel) .seite { border-radius: 6px; }
.seite.leer-s { background: #f1ede4 !important; }
.seite .druck, .seite .druck svg, .seite canvas, .seite .werte { position: absolute; inset: 0; width: 100%; height: 100%; }
.seite canvas { touch-action: none; }
.seite .werte { pointer-events: none; }
.nw { position: absolute; transform: translateX(-100%); color: #1f7a45; font-weight: 700; line-height: 1; background: #fffdf8cc; padding: 0 1px; border-radius: 2px; }
.nw.fragl { color: #c8102e; }
.nw.fest { color: #555; }
.schnitt-w { position: absolute; font-weight: 700; color: #3c3a36; }
.schnitt-w.klein-w { font-weight: 600; color: #6b6760; }
.tisch { gap: 0; padding-right: 0 !important; }
.register { width: 52px; display: flex; flex-direction: column; gap: 4px; padding: 10px 0; box-sizing: border-box; overflow-y: auto; scrollbar-width: none; flex-shrink: 0; align-self: center; }
.register::-webkit-scrollbar { display: none; }
.register.links { align-items: flex-end; }
.reiter-b { --farbe: #888; flex: 1 1 0; min-height: 44px; max-height: 120px; width: 44px; border: 0; border-radius: 0 10px 10px 0; background: var(--farbe); color: #fff; cursor: pointer; padding: 4px 2px; display: flex; align-items: center; justify-content: center; opacity: .75; box-shadow: 2px 2px 6px #0004; font: inherit; overflow: hidden; }
.register.links .reiter-b { border-radius: 10px 0 0 10px; box-shadow: -2px 2px 6px #0004; }
.reiter-b span { writing-mode: vertical-rl; font-size: 13px; font-weight: 700; line-height: 1.1; text-align: center; white-space: nowrap; }
.register.links .reiter-b span { transform: rotate(180deg); }
.reiter-b.an { opacity: 1; width: 52px; }
.notenwahl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.notenwahl .btn { justify-content: center; font-size: 17px; min-height: 46px; }
.einst-a { margin-bottom: 18px; }
.einst-a h3 { font-size: 15px; margin: 0 0 8px; }
label.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
label.check input { width: auto; }
.breiten-kurz, .titel-b .kurz { display: none; }
@media (max-width: 1050px) { .breiten-voll, .titel-b .lang, .sync span, .pleiste .marke { display: none; } .breiten-kurz, .titel-b .kurz { display: flex; } .titel-b { min-width: 0; } .gruppe-wz { padding: 0 3px; } .wz { min-width: 34px; } }
@media (max-width: 640px) { .gruppe-wz:has(.marker) { display: none; } }
.kw-nav { position: absolute; z-index: 4; display: flex; align-items: center; gap: .35em; color: #3c3a36; }
.kw-nav .kw-t { white-space: nowrap; padding: 0 .2em; }
.kw-nav .kw-t b { margin-right: .25em; }
.kwb { border: 1px solid #cfc9bd; background: #fff; color: #3c3a36; border-radius: .45em; height: 1.9em; min-width: 1.9em; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font: inherit; font-size: .9em; padding: 0 .4em; touch-action: manipulation; }
.kwb:hover { background: #f3efe6; }
.kwb svg { width: 1.1em; height: 1.1em; }
.kwb.text { padding: 0 .7em; font-weight: 600; }
.kwb.aus { opacity: .45; }
.wz.untis-hinweis { background: #c8102e; color: #fff; border: 0; font-weight: 700; padding: 0 12px; }
.wz.untis-hinweis:hover { background: #a50d26; }
