/* =====================================================================
   Lernoase – Ahnatal-Schule Vellmar
   DESIGN v4 – „Apple Liquid Glass"
   - großzügige SF-Typografie, echte durchscheinende Glasflächen
   - lebendiger Aurora-Hintergrund (dynamische Spielerei, reines CSS)
   - iOS-26-Materialtiefe, Vibrancy, weiche Spring-Bewegungen
   Alle Klassennamen sind 1:1 identisch mit app.js → volle Funktion.
   ===================================================================== */

:root {
  --bg: #eaf0f2;
  --ink: #0b1620;
  --text: #0b1620;
  --muted: #5c6b76;
  --muted-2: #93a1ab;

  /* Glas */
  --glass: rgba(255, 255, 255, 0.86);
  --glass-2: rgba(255, 255, 255, 0.7);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --glass-line: rgba(255, 255, 255, 0.7);
  --hairline: rgba(11, 22, 32, 0.08);
  --hairline-2: rgba(11, 22, 32, 0.14);

  /* Systemfarben (iOS) */
  --teal: #0f8e80;  --teal-d: #0a6c60;  --teal-tint: rgba(15, 142, 128, .12);
  --blue: #2f7ff0;  --blue-d: #1c62c9;  --blue-tint: rgba(47, 127, 240, .12);
  --red:  #e8483d;  --red-d:  #c22e26;  --red-tint:  rgba(232, 72, 61, .12);
  --amber:#f5972a;  --amber-d:#d0790f;  --amber-tint:rgba(245, 151, 42, .14);

  /* Rollen */
  --primary: var(--teal);
  --primary-d: var(--teal-d);
  --primary-tint: var(--teal-tint);
  --accent: var(--amber);
  --accent-d: var(--amber-d);
  --senden: var(--teal);
  --senden-d: var(--teal-d);
  --warn: var(--amber-d);
  --gefahr: var(--red);
  --ok: #16a06f;
  --auf: var(--blue);
  --auf-d: var(--blue-d);
  --auf-tint: var(--blue-tint);

  --surface: var(--glass);
  --surface-2: rgba(255, 255, 255, 0.55);
  --leer: rgba(255, 255, 255, 0.32);
  --line: var(--hairline);
  --line-strong: var(--hairline-2);

  --radius: 24px;
  --radius-lg: 32px;
  --radius-sm: 16px;
  --radius-xs: 12px;
  --radius-pill: 999px;

  --blur: saturate(160%) blur(18px);
  --schatten: 0 2px 8px rgba(11, 30, 45, .06), 0 14px 40px rgba(11, 30, 45, .10);
  --schatten-hoch: 0 4px 12px rgba(11, 30, 45, .10), 0 28px 60px rgba(11, 30, 45, .18);

  --nav-h: 92px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.014em;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============ Ruhiger, professioneller Hintergrund (statisch, GPU-schonend) ============
   WICHTIG: Hier bewusst KEINE Dauer-Animation. Ein sich bewegender Hintergrund zwingt
   Chrome, jede backdrop-filter-Glasfläche in JEDEM Frame neu zu blurren – dadurch werden
   Seite und Mauszeiger zäh (v.a. macOS-Chrome). Firefox merkt das kaum, Chrome sehr.
   Statische Farbverläufe kosten praktisch nichts und sehen genauso aus. */
body::before, body::after {
  content: ""; position: fixed; z-index: -2; border-radius: 50%;
  filter: blur(90px); opacity: .14; pointer-events: none;
}
body::before {
  width: 60vw; height: 60vw; top: -20vw; left: -14vw;
  background: radial-gradient(circle at 30% 30%, #4a8f88, #2a6f66 60%, transparent 72%);
}
body::after {
  width: 56vw; height: 56vw; bottom: -22vw; right: -16vw;
  background: radial-gradient(circle at 60% 40%, #5f86bf, #3f6aa8 55%, transparent 72%);
}
/* dritter, sehr dezenter Schimmer */
.app::before {
  content: ""; position: fixed; z-index: -2; pointer-events: none;
  width: 44vw; height: 44vw; top: 36vh; left: 46vw;
  border-radius: 50%; filter: blur(100px); opacity: .08;
  background: radial-gradient(circle at 50% 50%, #b79a6a, #9c8352 55%, transparent 72%);
}

.app { max-width: 1500px; margin: 0 auto; padding: 0 24px 72px; position: relative; }

/* =========================== Kopf =========================== */
.kopf {
  position: sticky; top: 12px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 15px 20px;
  margin: 14px 0 18px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
}
.kopf__titel { display: flex; align-items: center; gap: 15px; }

.logo {
  width: 52px; height: 52px; border-radius: 15px;
  display: grid; place-items: center;
  font-size: 0; color: transparent;
  background: rgba(255, 255, 255, .9) url("logo.png") center / 74% auto no-repeat;
  box-shadow: 0 1px 2px rgba(11, 30, 45, .1), 0 6px 18px rgba(11, 30, 45, .12), inset 0 0 0 1px rgba(255, 255, 255, .6);
  flex: none;
}
.kopf h1 { font-size: 25px; font-weight: 800; margin: 0; letter-spacing: -0.035em; }
.kopf__sub { font-size: 13px; color: var(--muted); margin-top: 2px; font-weight: 500; letter-spacing: 0; }
.kopf__rechts { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.sync {
  font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: var(--radius-pill);
  background: var(--glass-2); border: 1px solid var(--glass-line); color: var(--muted);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.sync--ok { color: var(--ok); background: var(--teal-tint); border-color: rgba(22, 160, 111, .28); }
.sync--speichert { color: var(--amber-d); background: var(--amber-tint); border-color: rgba(245, 151, 42, .3); }
.sync--laden { color: var(--muted); }
.sync--fehler { color: var(--red-d); background: var(--red-tint); border-color: rgba(232, 72, 61, .32); }

/* =========================== Buttons =========================== */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--glass-line); background: var(--glass-strong); color: var(--text);
  padding: 11px 18px; border-radius: var(--radius-pill);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn:hover { background: #fff; box-shadow: var(--schatten); }
.btn:active { transform: scale(0.95); }
.btn--klein { padding: 8px 15px; font-size: 14px; }
.btn--primary { background: var(--teal); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(15, 142, 128, .32); }
.btn--primary:hover { background: var(--teal-d); box-shadow: 0 8px 22px rgba(15, 142, 128, .42); }
.btn--warn { background: var(--amber-tint); border-color: rgba(245, 151, 42, .4); color: var(--amber-d); }
.btn--warn:hover { background: rgba(245, 151, 42, .22); }
.btn--gefahr { background: var(--red-tint); border-color: rgba(232, 72, 61, .4); color: var(--red-d); width: 100%; margin-top: 8px; }
.btn--gefahr:hover { background: rgba(232, 72, 61, .2); }
a.btn { text-decoration: none; }

/* =================== Ansichts-Navigation (Segmented Control) =================== */
.ansichtnav {
  display: inline-flex; gap: 4px; margin: 4px 0 20px;
  padding: 5px;
  background: var(--glass-2);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-line);
  box-shadow: var(--schatten);
}
.navbtn {
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  border: none; background: transparent; color: var(--muted);
  padding: 11px 24px; border-radius: var(--radius-pill);
  transition: color .16s ease, transform .16s cubic-bezier(.34,1.56,.64,1);
  letter-spacing: -0.01em;
}
.navbtn:hover { color: var(--text); }
.navbtn:active { transform: scale(0.96); }
.navbtn--aktiv {
  background: #fff; color: var(--teal-d);
  box-shadow: 0 1px 3px rgba(11, 30, 45, .14), 0 4px 10px rgba(11, 30, 45, .1);
}
.navbtn--aktiv:hover { color: var(--teal-d); }

/* =========================== Wochenauswahl =========================== */
.wochenwahl {
  display: flex; align-items: center; gap: 14px; justify-content: center;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line); border-radius: var(--radius);
  padding: 13px 16px; margin-bottom: 16px; box-shadow: var(--schatten); flex-wrap: wrap;
}
.woche-pfeil {
  font-size: 20px; line-height: 1; cursor: pointer; border: 1px solid var(--glass-line);
  background: var(--glass-strong); color: var(--teal); width: 44px; height: 44px; border-radius: var(--radius-pill);
  display: grid; place-items: center; transition: .16s cubic-bezier(.34,1.56,.64,1);
}
.woche-pfeil:hover { background: var(--teal); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(15, 142, 128, .35); }
.woche-pfeil:active { transform: scale(0.9); }
.woche-mitte { text-align: center; min-width: 158px; }
.woche-kw { font-weight: 800; font-size: 20px; letter-spacing: -0.035em; }
.woche-spanne { font-size: 13px; color: var(--muted); font-weight: 500; }
.woche-heute { margin-left: 4px; }

/* =========================== Tagleiste =========================== */
.tagleiste {
  display: flex; gap: 8px; margin: 4px 0 22px;
  background: var(--glass-2); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  padding: 7px; border-radius: var(--radius);
  border: 1px solid var(--glass-line); box-shadow: var(--schatten);
  position: relative; z-index: 1;
}
.tagbtn {
  flex: 1; font: inherit; cursor: pointer; border: none; background: transparent;
  padding: 13px 8px 11px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 700;
  transition: color .16s ease, transform .16s cubic-bezier(.34,1.56,.64,1);
}
.tagbtn:hover { background: rgba(255, 255, 255, .5); color: var(--text); }
.tagbtn:active { transform: scale(0.97); }
.tagbtn--aktiv { background: var(--teal); color: #fff; box-shadow: 0 8px 20px rgba(15, 142, 128, .35); }
.tagbtn--aktiv:hover { background: var(--teal); color: #fff; }
.tagbtn__kurz { display: none; }
.tagbtn__datum { display: block; font-size: 12px; font-weight: 500; opacity: .78; margin-top: 2px; }
.navbtn__kurz { display: none; }

/* =========================== Stunde =========================== */
.stunde { margin-bottom: 32px; }
.stunde__kopf { display: flex; align-items: center; gap: 14px; margin: 0 6px 14px; }
.stunde__kopf h2 { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -0.035em; }
.aufsicht {
  font-size: 13px; font-weight: 700; color: var(--auf-d);
  background: var(--auf-tint); padding: 5px 13px; border-radius: var(--radius-pill);
  border: 1px solid rgba(47, 127, 240, .22);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.aufsicht--leer { color: var(--muted); background: rgba(255, 255, 255, .4); font-weight: 500; border-color: var(--glass-line); }

/* Desktop: alle vier Gruppen nebeneinander, füllen die Breite */
.gruppengitter {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px;
}

/* =========================== Als-App-Anleitung =========================== */
.appanl {
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 28px 30px 30px;
}
.appanl__h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 8px; }
.appanl__intro { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0 0 24px; max-width: 60ch; }
.appanl__schritte { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.appanl__schritt {
  background: rgba(255, 255, 255, .55); border: 1px solid var(--glass-line);
  border-radius: var(--radius-sm); padding: 18px 18px 20px; text-align: center;
}
.appanl__bild { width: 100%; max-width: 190px; height: auto; display: block; margin: 0 auto 14px; }
.appanl__text h3 { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 6px; }
.appanl__text p { font-size: 14px; color: var(--muted); line-height: 1.5; margin: 0; }
.appanl__nr {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--teal); color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 12px rgba(15, 142, 128, .3);
}
.appanl__inline { vertical-align: -6px; margin: 0 1px; }
.appanl__hinweis {
  margin-top: 22px; padding: 15px 18px; border-radius: var(--radius-sm);
  background: var(--teal-tint); font-size: 14px; line-height: 1.6; color: var(--text);
}
@media (max-width: 900px) { .appanl__schritte { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .appanl { padding: 20px 18px 22px; } .appanl__h1 { font-size: 20px; } }

/* =========================== Zugangstor =========================== */
.zugang { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.zugang__karte {
  width: 100%; max-width: 380px; text-align: center;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line); border-radius: var(--radius-lg);
  box-shadow: var(--schatten-hoch); padding: 34px 28px 30px;
}
.zugang__logo {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px;
  background: rgba(255, 255, 255, .9) url("logo.png") center / 74% auto no-repeat;
  box-shadow: 0 1px 2px rgba(11, 30, 45, .1), 0 6px 18px rgba(11, 30, 45, .12), inset 0 0 0 1px rgba(255, 255, 255, .6);
}
.zugang__titel { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 6px; }
.zugang__text { color: var(--muted); font-size: 14px; margin: 0 0 20px; line-height: 1.4; }
.zugang__feld {
  width: 100%; font: inherit; font-size: 16px; text-align: center;
  border: 1px solid var(--hairline-2); border-radius: var(--radius-sm);
  padding: 13px 14px; background: rgba(255, 255, 255, .7); color: var(--text);
}
.zugang__feld:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-tint); }
.zugang__fehler { color: var(--red-d); font-size: 13px; margin-top: 10px; font-weight: 600; }
.zugang__btn { width: 100%; margin-top: 16px; }

/* =========================== Karte =========================== */
.karte {
  position: relative;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--schatten);
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s cubic-bezier(.34,1.4,.64,1);
}
.karte::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.karte:hover { box-shadow: var(--schatten-hoch); transform: translateY(-3px); }
.karte--aktiv { border-color: rgba(15, 142, 128, .55); box-shadow: 0 0 0 3px rgba(15, 142, 128, .16), var(--schatten); }
/* Wartende Karte: statischer Rahmen + separater Glüh-Ring, der nur seine Deckkraft
   animiert. Opacity läuft im Compositor – kein Neu-Rastern der Glasfläche pro Frame. */
.karte--wartet { border-color: rgba(245, 151, 42, .6); }
.karte--wartet::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  pointer-events: none; will-change: opacity;
  box-shadow: 0 0 0 3px rgba(245, 151, 42, .3), 0 0 26px rgba(245, 151, 42, .4);
  animation: wartenPuls 2.4s ease-in-out infinite;
}
@keyframes wartenPuls {
  0%, 100% { opacity: .35; }
  50%       { opacity: 1; }
}
.karte--leer { background: rgba(255, 255, 255, .28); box-shadow: none; border-style: dashed; }
.karte__kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.karte__gruppe { font-weight: 800; font-size: 17px; letter-spacing: -0.03em; display: flex; align-items: center; gap: 9px; }
.karte__gruppe::before { content: ""; width: 10px; height: 10px; border-radius: 4px; background: var(--teal); box-shadow: 0 0 0 3px rgba(15, 142, 128, .18); flex: none; }
.karte__badges { display: flex; align-items: center; gap: 6px; }
.karte__countdown {
  font-size: 11px; font-weight: 800; color: var(--amber-d); background: var(--amber-tint);
  border-radius: var(--radius-pill); padding: 4px 11px; white-space: nowrap;
}
.karte__countdown--ueber { color: var(--red-d); background: var(--red-tint); }
.karte__besetzthinweis { color: var(--muted); font-style: italic; text-align: center; padding: 20px 0; }
.karte__gespeichert {
  font-size: 11px; font-weight: 800; color: var(--ok); background: var(--teal-tint);
  border-radius: var(--radius-pill); padding: 4px 11px; opacity: 0; transform: translateY(-3px);
  transition: opacity .25s ease, transform .25s ease; pointer-events: none; white-space: nowrap;
}
.karte__gespeichert--ein { opacity: 1; transform: translateY(0); }

.schalter { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.schalter input { width: 17px; height: 17px; accent-color: var(--teal); }

/* =========================== Felder / Inputs =========================== */
.felder { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* min-width: 0 -> Felder dürfen schmaler werden als ihr Inhalt; so kann ein Feld
   die Karte nie nach rechts aufsprengen (verhindert das Überlaufen). */
.feld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.feld--breit { grid-column: 1 / -1; }
.feld--schmal { grid-column: span 1; }
.feld--zeit { grid-column: span 1; }
.feld label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .045em; }
.feld input, .feld textarea {
  font: inherit; font-size: 15px; width: 100%;
  border: 1px solid var(--hairline-2); border-radius: var(--radius-xs); padding: 11px 13px;
  background: rgba(255, 255, 255, .92); color: var(--text);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.feld input:focus, .feld textarea:focus {
  outline: none; border-color: var(--teal); background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 142, 128, .16);
}
.feld textarea { resize: vertical; min-height: 46px; }

/* Uhrzeit + „Jetzt": bei schmalen Karten bricht „Jetzt" sauber unter das
   Zeitfeld um (statt aus der Karte zu laufen). */
.zeitzeile { display: flex; flex-wrap: wrap; gap: 6px; }
.zeitzeile input { flex: 1 1 96px; min-width: 96px; }
.jetzt {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
  flex: 1 1 auto; min-width: 72px;
  border: 1px solid rgba(245, 151, 42, .5); color: var(--amber-d); background: var(--amber-tint);
  border-radius: var(--radius-xs); padding: 10px 14px; transition: .16s;
}
.jetzt:hover { background: var(--amber); color: #fff; border-color: transparent; }
.jetzt:active { transform: scale(0.94); }

/* =========================== Fuß =========================== */
.fuss { text-align: center; color: var(--muted); font-size: 13px; margin-top: 34px; }

/* =========================== Overlay / Dialog =========================== */
.overlay {
  position: fixed; inset: 0; background: rgba(11, 22, 32, .32);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: grid; place-items: center; z-index: 50; padding: 16px;
  animation: overlayEin .22s ease;
}
@keyframes overlayEin { from { opacity: 0; } to { opacity: 1; } }
.dialog {
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-radius: var(--radius-lg); width: 100%; max-width: 520px;
  max-height: 90vh; overflow: auto; box-shadow: var(--schatten-hoch);
  border: 1px solid var(--glass-line);
  animation: dialogEin .3s cubic-bezier(.2, .9, .3, 1);
}
@keyframes dialogEin { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
.dialog__kopf {
  display: flex; align-items: center; justify-content: space-between; padding: 20px 24px;
  border-bottom: 1px solid var(--hairline); position: sticky; top: 0;
  background: rgba(255, 255, 255, .7); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  z-index: 2;
}
.dialog__kopf h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.035em; }
.x {
  font-size: 22px; line-height: 1; border: none; cursor: pointer; color: var(--muted);
  width: 34px; height: 34px; border-radius: var(--radius-pill); background: rgba(11, 22, 32, .07);
  display: grid; place-items: center; transition: .16s;
}
.x:hover { background: rgba(11, 22, 32, .14); color: var(--text); }
.admin-login, .admin-inhalt { padding: 24px; }
.admin-login input { font: inherit; width: 100%; padding: 12px; border: 1px solid var(--glass-line); border-radius: var(--radius-xs); margin: 8px 0; background: rgba(255, 255, 255, .6); }
.admin-login input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(15, 142, 128, .16); }
.admin-login .btn { width: 100%; margin-top: 8px; }
.fehler { color: var(--red-d); font-size: 14px; }
.admin-inhalt h3 { margin: 24px 0 11px; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.admin-inhalt h3:first-child { margin-top: 0; }
.statusgitter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.statuskachel { background: rgba(255, 255, 255, .5); border: 1px solid var(--glass-line); border-radius: var(--radius-sm); text-align: center; padding: 14px 4px; }
.statuskachel__tag { font-weight: 800; color: var(--teal); }
.statuskachel__zahl { font-size: 25px; font-weight: 800; letter-spacing: -0.035em; }
.statuskachel__sub { font-size: 11px; color: var(--muted); }
.warnhinweis { color: var(--amber-d); font-size: 13px; margin: 4px 0 10px; }
.reset-zeile { display: flex; flex-wrap: wrap; gap: 6px; }
.reset-zeile .btn { flex: 1; min-width: 64px; }

.dialog--breit { max-width: 640px; }

/* =========================== Responsiv =========================== */
/* Gruppen-Raster passt sich der Breite an. Bewusst NIE 3 Spalten, damit Gruppe D
   nicht allein in einer zweiten Zeile landet: entweder 4, oder 2, oder Wischen. */

/* Schmaler Desktop / iPad: zwei Gruppen nebeneinander (A B / C D).
   Gilt bis hinunter zu echter Handy-Breite, damit auch ein halbes Desktop-Fenster
   noch saubere Spalten zeigt (statt Wischen). */
@media (max-width: 1400px) {
  .gruppengitter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Nur echtes Handy: kompaktere Kopfzeile + eine Karte zum Durchwischen. */
@media (max-width: 560px) {
  .kopf { top: 8px; margin: 8px 0 16px; padding: 13px 16px; }
  .kopf h1 { font-size: 20px; }
  .tagbtn__lang { display: none; }
  .tagbtn__kurz { display: inline; }
  .ansichtnav { display: flex; width: 100%; }
  .navbtn { flex: 1; padding: 11px 6px; font-size: 14px; }
  .navbtn__lang { display: none; }
  .navbtn__kurz { display: inline; }
  .gruppengitter {
    display: flex; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    padding-bottom: 8px; -webkit-overflow-scrolling: touch;
  }
  .gruppengitter .karte { flex: 0 0 min(360px, 88%); scroll-snap-align: start; }
}

/* =========================== Material-Banner =========================== */
.materialbanner {
  display: flex; align-items: center; gap: 15px; text-decoration: none;
  margin: 2px 0 16px; padding: 18px 22px; border-radius: var(--radius);
  background: linear-gradient(120deg, #ffb14d, var(--amber) 55%, var(--amber-d));
  color: #fff; box-shadow: 0 12px 30px rgba(208, 121, 15, .34), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .16s cubic-bezier(.34,1.4,.64,1), box-shadow .16s ease;
}
.materialbanner:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(208, 121, 15, .44), inset 0 1px 0 rgba(255, 255, 255, .3); }
.materialbanner:active { transform: scale(.99); }
.materialbanner__icon { font-size: 28px; }
.materialbanner__text { display: flex; flex-direction: column; line-height: 1.3; flex: 1; }
.materialbanner__text strong { font-size: 17px; font-weight: 800; }
.materialbanner__text small { font-size: 13px; opacity: .92; }
.materialbanner__pfeil { font-size: 22px; opacity: .9; }

/* =========================== Stundenplan =========================== */
.plan { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-line); border-radius: var(--radius); padding: 20px; box-shadow: var(--schatten); }
.plan__hinweis { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.plan__scroll { overflow-x: auto; border-radius: var(--radius-sm); }
.plantab { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 560px; border-radius: var(--radius-sm); overflow: hidden; }
.plantab th, .plantab td { border-bottom: 1px solid var(--hairline); border-right: 1px solid var(--hairline); padding: 12px 10px; text-align: center; font-size: 14px; }
.plantab th:first-child, .plantab td:first-child { border-left: 1px solid var(--hairline); }
.plantab tr:first-child th { border-top: 1px solid var(--hairline); }
.plantab th { background: var(--blue-tint); color: var(--blue-d); font-weight: 800; }
.plan__datum { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.plan__std { background: rgba(255, 255, 255, .5); font-weight: 800; }
.plan__leer { color: var(--muted); font-style: italic; }
.plan__pause td { background: rgba(11, 22, 32, .04); color: var(--muted); font-style: italic; font-size: 13px; }
.plan__nm td { background: rgba(245, 151, 42, .06); font-size: 13px; }
.plantab--edit td { padding: 5px; }
.plantab--edit input { width: 100%; min-width: 90px; font: inherit; font-size: 13px; border: 1px solid var(--glass-line); border-radius: 8px; padding: 7px; background: rgba(255, 255, 255, .6); }
.plantab--edit input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(15, 142, 128, .16); }

/* =========================== Aufsichten-Editor =========================== */
.aufed { margin-bottom: 6px; }
.aufed .hinweis { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.aufed__btns { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.aufed__status { color: var(--ok); font-size: 14px; font-weight: 600; }

/* =========================== Info-Ansicht =========================== */
.info { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-line); border-radius: var(--radius); padding: 28px 32px; box-shadow: var(--schatten); }
.info__h1 { font-size: 25px; font-weight: 800; margin: 0 0 20px; color: var(--teal-d); letter-spacing: -0.035em; }
.info__abs { margin-bottom: 20px; }
.info__abs h3 { font-size: 16px; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.01em; }
.info__abs ul { margin: 0; padding-left: 20px; }
.info__abs li { margin-bottom: 6px; line-height: 1.6; }
.info__material { display: inline-flex; margin-top: 8px; }
.btn--material { background: var(--amber); color: #fff; border-color: transparent; font-weight: 700; box-shadow: 0 6px 18px rgba(245, 151, 42, .34); }
.btn--material:hover { background: var(--amber-d); }

/* =========================== Datei-Upload =========================== */
.dateien { margin-top: 13px; padding-top: 13px; border-top: 1px dashed var(--hairline-2); }
.dateien__kopf { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.dateiliste { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.dateizeile { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .5); border: 1px solid var(--glass-line); border-radius: var(--radius-xs); padding: 8px 11px; }
.dateizeile__name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--blue-d); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dateizeile__name:hover { text-decoration: underline; }
.dateizeile__groesse { font-size: 11px; color: var(--muted); white-space: nowrap; }
.dateizeile__x { border: none; background: none; cursor: pointer; color: var(--red); font-size: 18px; line-height: 1; padding: 0 2px; }
.dateizeile__x:hover { color: var(--red-d); }
.dateiupload { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--teal); border: 1.5px dashed rgba(15, 142, 128, .45); border-radius: var(--radius-xs); padding: 11px 17px; background: var(--teal-tint); transition: .16s; }
.dateiupload:hover { background: rgba(15, 142, 128, .2); border-color: var(--teal); }
.dateiupload input { display: none; }
.dateiupload__haupt { display: block; }
.dateiupload__hint { font-size: 10px; font-weight: 500; color: var(--muted); display: block; }
.dateiupload--busy { opacity: .6; cursor: progress; }
.dateiupload--dragover { background: var(--teal); color: #fff; border-style: solid; border-color: var(--teal); }
.dateien--dragover { background: var(--teal-tint); border-radius: var(--radius-sm); padding: 6px; margin: 4px -6px -6px; }
.dateifehler { color: var(--red-d); font-size: 12px; margin-top: 5px; }

/* =========================== Aufsicht-Felder (Logo-Blau) =========================== */
.feld--aufsicht label { color: var(--auf-d); }
.feld__rolle { display: inline-block; margin-left: 6px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--auf-d); background: var(--auf-tint); border-radius: 5px; padding: 2px 6px; vertical-align: middle; }
.feld--aufsicht input, .feld--aufsicht textarea { background: rgba(47, 127, 240, .07); border-color: rgba(47, 127, 240, .24); }
.feld--aufsicht input:focus, .feld--aufsicht textarea:focus { border-color: var(--auf); background: #fff; box-shadow: 0 0 0 4px rgba(47, 127, 240, .16); }

/* =========================== Nicht besetzte Stunde =========================== */
.stunde--leer .stunde__kopf h2 { color: var(--muted); }
.stunde__hinweis { background: rgba(255, 255, 255, .4); border: 1px dashed var(--hairline-2); border-radius: var(--radius); padding: 18px 20px; color: var(--muted); font-size: 14px; }

/* =========================== Ausgefallene Stunde =========================== */
.stunde--ausgefallen { opacity: .68; }
.stunde--ausgefallen .stunde__kopf h2 { color: var(--muted); text-decoration: line-through; }
.aufsicht--ausgefallen { color: var(--red-d); background: var(--red-tint); border-color: rgba(232, 72, 61, .3); }
.stunde__hinweis--ausgefallen { background: var(--red-tint); border-color: rgba(232, 72, 61, .32); color: var(--red-d); border-style: solid; }
.plan__ausgefallen { color: var(--red-d); background: var(--red-tint); font-style: italic; }
.ausfbtn {
  width: 100%; min-width: 90px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--glass-line); border-radius: 8px; padding: 7px; background: rgba(255, 255, 255, .5); color: var(--muted);
}
.ausfbtn--aus { background: var(--red-tint); border-color: rgba(232, 72, 61, .32); color: var(--red-d); }

/* =========================== Schnelleintrag "Gruppe schicken" =========================== */
.btn--senden { background: var(--amber); color: #fff; border-color: transparent; font-weight: 800; box-shadow: 0 6px 18px rgba(245, 151, 42, .34); }
.btn--senden:hover { background: var(--amber-d); }

.schnellsende-banner {
  display: flex; align-items: center; gap: 13px; width: 100%;
  font: inherit; font-weight: 800; font-size: 16px; color: #fff; cursor: pointer;
  border: none; margin: 0 0 22px; padding: 18px 22px; border-radius: var(--radius);
  background: linear-gradient(120deg, #1fb7a4, var(--teal) 55%, var(--teal-d));
  box-shadow: 0 12px 30px rgba(15, 142, 128, .36), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .16s cubic-bezier(.34,1.4,.64,1), box-shadow .16s ease;
  letter-spacing: -0.02em;
  position: sticky; top: calc(var(--nav-h) + 12px); z-index: 16;
}
.schnellsende-banner:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(15, 142, 128, .46), inset 0 1px 0 rgba(255, 255, 255, .28); }
.schnellsende-banner:active { transform: scale(.99); }
.schnellsende-banner__icon { font-size: 20px; }
.schnellsende-banner__text { flex: 1; text-align: left; }
.schnellsende-banner__pfeil { font-size: 18px; opacity: .9; }

@media (max-width: 560px) {
  .materialbanner__text strong { font-size: 16px; }
  .wochenwahl { gap: 8px; }
  .inhalt { padding-bottom: 96px; }
  .schnellsende-banner {
    position: static;
    width: auto; margin: 0 36px 20px; gap: 10px; font-size: 14px; padding: 16px 18px;
    border-radius: 22px; box-shadow: 0 10px 26px rgba(15, 142, 128, .34);
  }
  .schnellsende-banner__icon { font-size: 16px; }
  .schnellsende-banner__pfeil { font-size: 15px; }
  .schnellsende-banner:active { transform: scale(.97); }
  .schnellsende-banner.schnellsende-banner--schwebend {
    position: fixed; left: 50%; top: auto; bottom: calc(14px + env(safe-area-inset-bottom));
    width: calc(100% - 72px); max-width: 480px; margin: 0;
    z-index: 40; transform: translateX(-50%); transform-origin: 50% 100%;
    animation: tropfenFall .68s both;
    box-shadow: 0 16px 36px rgba(15, 142, 128, .44);
  }
  @keyframes tropfenFall {
    0%   { opacity: 0; transform: translateX(-50%) translateY(-74px) scaleX(.82) scaleY(1.26);
           animation-timing-function: cubic-bezier(.5, 0, .85, .38); }
    46%  { opacity: 1; transform: translateX(-50%) translateY(0) scaleX(.9) scaleY(1.14);
           animation-timing-function: cubic-bezier(.25, .9, .4, 1); }
    63%  { transform: translateX(-50%) translateY(0) scaleX(1.17) scaleY(.79);
           animation-timing-function: ease-out; }
    79%  { transform: translateX(-50%) translateY(-9px) scaleX(.96) scaleY(1.06); }
    91%  { transform: translateX(-50%) translateY(0) scaleX(1.03) scaleY(.98); }
    100% { transform: translateX(-50%) translateY(0) scaleX(1) scaleY(1); }
  }
}

/* =========================== Schnelleintrag-Dialog =========================== */
.qs { padding: 22px 24px; }
.qs__kontext { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.qs__stunden { display: flex; gap: 7px; flex-wrap: wrap; }
.qs__stbtn { font: inherit; font-weight: 800; cursor: pointer; border: 1px solid var(--glass-line); background: rgba(255, 255, 255, .55); color: var(--text); width: 50px; height: 48px; border-radius: var(--radius-sm); transition: .16s cubic-bezier(.34,1.56,.64,1); }
.qs__stbtn:hover { border-color: var(--teal); }
.qs__stbtn--aktiv { background: var(--teal); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(15, 142, 128, .34); }
.qs__stbtn--leer { color: var(--muted); opacity: .55; }
.qs__stbtn--leer.qs__stbtn--aktiv { background: var(--muted); color: #fff; opacity: 1; }
.qs__ziel { margin: 12px 0; padding: 12px 15px; background: var(--teal-tint); border-radius: var(--radius-sm); font-size: 14px; }
.qs__warn { margin: 12px 0; padding: 13px 15px; background: var(--amber-tint); border: 1px solid rgba(245, 151, 42, .32); border-radius: var(--radius-sm); color: var(--amber-d); font-size: 14px; }
.qs__info { margin: 12px 0; color: var(--muted); }
.qs__btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.qs__hint { font-weight: 400; color: var(--muted); font-size: 10px; }

/* =========================== Feste-Gruppen-Editor =========================== */
.fest .hinweis { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.fest__liste { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.fest__zeile {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--teal-tint); border: 1px solid rgba(15, 142, 128, .25);
  border-radius: var(--radius-sm); font-size: 14px;
}
.fest__info { flex: 1; }
.fest__info strong { font-weight: 800; }
.fest__loeschen {
  font: inherit; font-size: 18px; line-height: 1; cursor: pointer;
  border: none; background: none; color: var(--red); padding: 2px 7px; border-radius: 8px;
}
.fest__loeschen:hover { background: var(--red-tint); }
.fest__form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 12px; }
.fest__form select, .fest__form input {
  font: inherit; font-size: 14px; border: 1px solid var(--hairline-2);
  border-radius: 8px; padding: 8px 10px; background: rgba(255, 255, 255, .6); color: var(--text);
}
@media (max-width: 560px) { .fest__form { grid-template-columns: 1fr; } }

/* =========================== Stundenzeiten-Editor =========================== */
.stzeit .hinweis { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.stzeit__gitter { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.stzeit__zeile { display: flex; align-items: center; gap: 7px; }
.stzeit__nr { font-weight: 800; font-size: 13px; min-width: 54px; }
.stzeit__zeile input { font: inherit; font-size: 14px; border: 1px solid var(--glass-line); border-radius: 8px; padding: 7px 9px; background: rgba(255, 255, 255, .6); }
.stzeit__zeile input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(15, 142, 128, .16); }

@media (max-width: 560px) { .stzeit__gitter { grid-template-columns: 1fr; } }

/* =========================== Dark Mode =========================== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070c12;
    --text: #eef4f8;
    --muted: #94a6b3;
    --muted-2: #67788a;
    --glass: rgba(28, 40, 52, 0.86);
    --glass-2: rgba(28, 40, 52, 0.7);
    --glass-strong: rgba(30, 44, 58, 0.94);
    --glass-line: rgba(255, 255, 255, 0.10);
    --hairline: rgba(255, 255, 255, 0.09);
    --hairline-2: rgba(255, 255, 255, 0.16);
    --teal: #22c4b0; --teal-d: #16a494; --teal-tint: rgba(34, 196, 176, .16);
    --blue: #5aa0ff; --blue-d: #3f88ee; --blue-tint: rgba(90, 160, 255, .16);
    --red: #ff6a5f; --red-d: #ff8880; --red-tint: rgba(255, 106, 95, .16);
    --amber: #ffab4d; --amber-d: #ffbf73; --amber-tint: rgba(255, 171, 77, .16);
    --ok: #35d6a0;
    --leer: rgba(255, 255, 255, .05);
    --schatten: 0 2px 8px rgba(0, 0, 0, .4), 0 14px 40px rgba(0, 0, 0, .5);
    --schatten-hoch: 0 4px 12px rgba(0, 0, 0, .5), 0 28px 60px rgba(0, 0, 0, .62);
  }
  body::before { opacity: .38; }
  body::after { opacity: .38; }
  .app::before { opacity: .26; }
  .logo { background-color: rgba(255, 255, 255, .92); }
  .karte::before { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
  .btn { color: var(--text); }
  .btn:hover { background: rgba(40, 56, 70, .9); }
  .navbtn--aktiv { background: rgba(40, 56, 70, .95); color: #4fe0cd; }
  .navbtn--aktiv:hover { color: #4fe0cd; }
  .woche-pfeil { background: var(--glass-strong); }
  .tagbtn:hover { background: rgba(255, 255, 255, .07); }
  .btn--warn { color: var(--amber-d); }
  .btn--gefahr { color: var(--red-d); }
  .qs__warn { color: var(--amber-d); }
  .warnhinweis { color: var(--amber-d); }
  .fehler { color: var(--red-d); }
  .aufsicht { color: #8fc0ff; }
  .aufsicht--ausgefallen { color: var(--red-d); }
  .plan__pause td { background: rgba(255, 255, 255, .04); }
  .plan__nm td { background: rgba(255, 171, 77, .06); }
  .plantab th { color: #8fc0ff; }
  .dialog__kopf { background: rgba(30, 44, 58, .7); }
  .x { background: rgba(255, 255, 255, .08); }
  .x:hover { background: rgba(255, 255, 255, .16); }
  .feld--aufsicht label, .feld__rolle { color: #8fc0ff; }
  .dateizeile__name { color: #8fc0ff; }
  input, textarea, select { color: var(--text); -webkit-text-fill-color: var(--text); }
  input::placeholder, textarea::placeholder { color: var(--muted); -webkit-text-fill-color: var(--muted); opacity: 1; }
  /* Eingabeflächen dunkel halten – sonst steht heller Text auf hellem Feld
     und ist nicht mehr lesbar. */
  .feld input, .feld textarea,
  .admin-login input,
  .plantab--edit input,
  .stzeit__zeile input,
  .fest__form input, .fest__form select,
  .zugang__feld,
  .qs__stbtn {
    background: rgba(12, 20, 28, .72);
  }
  .feld input:focus, .feld textarea:focus,
  .zugang__feld:focus {
    background: rgba(8, 14, 20, .92);
  }
  .feld--aufsicht input, .feld--aufsicht textarea { background: rgba(90, 160, 255, .12); }
  .feld--aufsicht input:focus, .feld--aufsicht textarea:focus { background: rgba(8, 14, 20, .92); }
  .qs__stbtn--aktiv { background: var(--teal); color: #05201c; }
  .qs__stbtn--leer.qs__stbtn--aktiv { background: var(--muted); color: #0b141b; }
  input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.8); }
  input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus,
  textarea:-webkit-autofill, textarea:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(30, 44, 58, .95) inset !important;
    -webkit-text-fill-color: var(--text) !important;
  }
  /* Als-App-Anleitung: Kacheln dunkel halten, sonst wird der Text unlesbar. */
  .appanl__schritt { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .1); }
  .appanl__text p { color: var(--muted); }
}
