:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef0f6;
  --text: #171a2b;
  --muted: #646b84;
  --line: #e2e5ee;
  --accent: #d6407f;
  --accent-on: #ffffff;
  --accent-soft: #fce4ee;
  --danger: #d92d4b;
  --warn: #e58a00;
  --ok: #16a36a;
  --shadow: 0 1px 2px rgba(20, 24, 50, .06), 0 4px 16px rgba(20, 24, 50, .06);
  --radius: 10px;
  --nav-h: 64px;
  --ink-lo: 0; --ink-hi: .6;   /* Fachfarben als Schrift/Rand: zu helle (weiße) Fächer im hellen Modus abdunkeln */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1120; --surface: #181b2e; --surface-2: #22263d; --text: #eceefa; --muted: #9aa0bd;
    --line: #2b3050; --accent: #f27aae; --accent-soft: #4a2238; --accent-on: #2b0d1b; --shadow: 0 1px 2px rgba(0,0,0,.4);
    --ink-lo: .62; --ink-hi: 1;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1120; --surface: #181b2e; --surface-2: #22263d; --text: #eceefa; --muted: #9aa0bd;
  --line: #2b3050; --accent: #f27aae; --accent-soft: #4a2238; --accent-on: #2b0d1b; --shadow: 0 1px 2px rgba(0,0,0,.4);
  --ink-lo: .62; --ink-hi: 1;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Lesbare Variante der Fach-/Stundenfarbe (--sc / --c): Helligkeit je nach Modus begrenzt, damit weiße Fächer
   im hellen und schwarze im dunklen Modus sichtbar bleiben. Ohne Unterstützung bleibt die Originalfarbe. */
[style*="--sc"], .mv-card { --sc-ink: var(--sc); }
[style*="--c"] { --c-ink: var(--c); }
@supports (color: oklch(from red l c h)) {
  [style*="--sc"], .mv-card { --sc-ink: oklch(from var(--sc) clamp(var(--ink-lo), l, var(--ink-hi)) c h); }
  [style*="--c"] { --c-ink: oklch(from var(--c) clamp(var(--ink-lo), l, var(--ink-hi)) c h); }
}
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }   /* iOS vergrößert Text beim Drehen sonst eigenmächtig */
/* iOS Safari zoomt beim Antippen jedes Eingabefelds unter 16 px hinein und verschiebt dabei die Ansicht → dort mindestens 16 px */
@supports (-webkit-touch-callout: none) {
  input, textarea, select { font-size: max(16px, 1em) !important; }
}
#app {
  max-width: 520px; margin: 0 auto; min-height: 100%;
  background: var(--bg); position: relative; display: flex; flex-direction: column;
}
/* Seitenwechsel gleiten von rechts herein; ohne Kappen würde die Seite kurz breiter, und das Handy schöbe die untere Navileiste aus dem Bild */
#view { overflow-x: clip; }
@media (min-width: 560px) {
  body { background: var(--surface-2); }
  #app { box-shadow: 0 0 0 1px var(--line), 0 10px 40px rgba(0,0,0,.08); }
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--surface);
  border-bottom: 1px solid var(--line); padding: 10px 8px 8px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
}
.topbar-row { display: flex; align-items: center; gap: 4px; }
.topbar h1 { font-size: 19px; margin: 0; font-weight: 700; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-btn { all: unset; cursor: pointer; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.title-btn .sub { font-size: 12.5px; color: var(--muted); }
.title-btn h1::after { content: " ▾"; font-size: 13px; color: var(--muted); }
.title-btn h1.noarrow::after { content: none; }
.icon-btn {
  border: 0; background: transparent; width: 40px; height: 40px; border-radius: 8px;
  display: grid; place-items: center; flex: none;
}
@media (hover: hover) { .icon-btn:hover { background: var(--surface-2); } }
.icon-btn svg { width: 22px; height: 22px; }
.pill-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 6px;
  padding: 5px 12px; font-size: 13px; font-weight: 600; }

/* ---------- Content ---------- */
main { flex: 1; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); }
.page { padding: 14px 16px; }
main.page { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }   /* Platz für die untere Leiste am Handy */
.section-title { font-size: 13px; font-weight: 700;
  color: var(--muted); margin: 18px 4px 8px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 10px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .meta { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty .big { font-size: 40px; margin-bottom: 8px; }
.error-box { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger);
  border-radius: 8px; padding: 10px 14px; font-size: 14px; margin: 10px 0; }

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line); display: flex; z-index: 30;
}
.bottomnav button {
  flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; font-size: 11.5px; color: var(--muted); font-weight: 600;
  min-width: 0; padding: 0 2px;   /* alle fünf Einträge passen auch bei schmalen Handys / großer Systemschrift */
}
.bottomnav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottomnav button svg { width: 24px; height: 24px; padding: 2px 14px; box-sizing: content-box; border-radius: 6px; }
@media (max-width: 400px) {
  .bottomnav button { font-size: 10.5px; letter-spacing: -.01em; }
  .bottomnav button svg { padding: 2px 10px; }
}
.bottomnav button.active { color: var(--accent); }
.bottomnav button.active svg { background: var(--accent-soft); }

/* ---------- Kopfzeile: Woche/Tag ---------- */
.tb-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.view-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.view-seg button { border: 0; background: none; padding: 4px 14px; font-size: 13px; font-weight: 600; color: var(--muted); }
.view-seg button + button { border-left: 1px solid var(--line); }
.view-seg button.active { background: var(--surface-2); color: var(--text); }
.today-btn { padding: 4px 11px; font-size: 13px; }
.today-btn:disabled { opacity: .4; cursor: default; }

.day-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); margin: 8px 8px 0 0; }
.ds-day { position: relative; border: 0; background: none; padding: 4px 0 6px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; border-bottom: 2px solid transparent; }
.ds-day span { font-size: 12px; color: var(--muted); }
.ds-day b { font-size: 16px; font-weight: 600; }
.ds-day.today span, .ds-day.today b { color: var(--accent); }
.ds-day.sel { border-bottom-color: var(--accent); }
.ds-day.sel b { font-weight: 800; }
.ds-day i, .tt-dh i { position: absolute; top: 4px; right: calc(50% - 15px); width: 5px; height: 5px; border-radius: 50%; background: var(--warn); }

/* ---------- Wochenansicht ---------- */
.tt-head { display: grid; grid-template-columns: 38px repeat(var(--days), 1fr); background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: var(--topbar-h, 64px); z-index: 10; }
.tt-dh { position: relative; border: 0; background: none; display: flex; flex-direction: column; align-items: center;
  gap: 1px; padding: 5px 0 6px; }
.tt-dh span { font-size: 12px; color: var(--muted); }
.tt-dh b { font-size: 15px; font-weight: 600; width: 26px; height: 26px; line-height: 26px; border-radius: 50%; text-align: center; }
.tt-dh.today span { color: var(--accent); }
.tt-dh.today b { background: var(--accent); color: var(--accent-on); }
.tt-dh i { right: calc(50% - 17px); }

.tt-body { display: grid; grid-template-columns: 38px repeat(var(--days), 1fr); position: relative; touch-action: pan-y; }
.tt-times { position: relative; border-right: 1px solid var(--line); overflow: hidden; }
.tt-unit { position: absolute; left: 0; right: 0; text-align: center; padding-top: 3px; line-height: 1.15; }
.tt-unit b { display: block; font-size: 13px; }
.tt-unit span { font-size: 10px; color: var(--muted); display: block; }
.tt-unit .tt-end { opacity: .6; }
.tt-unit .tt-end::before { content: "bis "; }
.tt-day { position: relative; border-right: 1px solid var(--line); }
.tt-day:last-child { border-right: 0; }
.tt-gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); pointer-events: none; }
.tt-break { position: absolute; left: 0; right: 0; background: var(--surface-2); opacity: .5; pointer-events: none; }
/* Ferien: große, gut lesbare Beschriftung über die ganze Tageshöhe (Größe passt sich der Spaltenbreite an) */
.tt-holiday { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; container-type: size;
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 14px, color-mix(in srgb, var(--surface-2) 93%, var(--accent)) 14px 28px); }
.tt-holiday span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-weight: 800; letter-spacing: .06em;
  font-size: clamp(16px, min(42cqw, 5.5cqh), 40px); color: var(--text); opacity: .75; }
.tt-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 5; pointer-events: none; }
/* Griff zum Vergrößern/Verkleinern des Wochenplans */
.tt-resize { display: flex; justify-content: center; align-items: center; height: 22px; margin-top: 2px; cursor: ns-resize;
  touch-action: none; user-select: none; border-top: 1px solid var(--line); }
.tt-resize span { width: 44px; height: 5px; border-radius: 999px; background: var(--line); transition: background .15s, width .15s; }
.tt-resize.drag span { background: var(--accent); width: 64px; }
@media (hover: hover) { .tt-resize:hover span { background: var(--accent); width: 64px; } }
body.tt-resizing, body.tt-resizing * { cursor: ns-resize !important; user-select: none; }

.lesson {
  --c: var(--accent);
  position: absolute; border: 0; text-align: left; cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; padding: 3px 4px 3px 6px; border-radius: 4px;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--text);
  border-left: 3px solid var(--c-ink); font-size: 10.5px; line-height: 1.2;
}
.lesson .subj { font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson .line { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson .changed { color: var(--warn); font-weight: 700; }
.lesson.narrow { padding: 3px 2px 3px 3px; }
.lesson.narrow .subj { font-size: 10.5px; }
/* Ausfall: rot gestreift, durchgestrichen, mit „Entfällt“ */
.lesson.cancelled {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--danger) 16%, var(--surface)) 0 6px, color-mix(in srgb, var(--danger) 6%, var(--surface)) 6px 12px);
  border-left-color: var(--danger); color: var(--muted);
}
.lesson.cancelled .subj { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--danger); }
.lesson.cancelled .line { text-decoration: line-through; opacity: .8; }
.lesson .can-tag { color: var(--danger); font-weight: 700; font-size: 10px; }
.lesson.exam { border-left-color: var(--danger); }
/* Markierungsleiste rechts: Segmente für Prüfung, Änderung, Hausaufgabe */
.marks { position: absolute; top: 3px; bottom: 3px; right: 3px; width: 4px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.marks i { flex: 1; border-radius: 2px; min-height: 4px; }
.mk-exam { background: var(--danger); } .mk-chg { background: var(--warn); } .mk-hw { background: var(--accent); }
.lesson:has(.marks) { padding-right: 9px; }
.ag-card:has(.marks) { position: relative; padding-right: 20px; }
.ag-card .marks { top: 7px; bottom: 7px; right: 7px; width: 5px; }


/* ---------- Tagesansicht ---------- */
.ag { padding: 10px 14px 16px; touch-action: pan-y; min-height: 50vh; }
.ag-row { display: grid; grid-template-columns: 44px 1fr; gap: 10px; margin-bottom: 6px; }
.ag-time { padding-top: 10px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ag-time span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.ag-cards { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ag-card {
  --c: var(--accent);
  width: 100%; text-align: left; cursor: pointer; padding: 9px 12px; border-radius: 6px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-left: 4px solid var(--c-ink);
}
@media (hover: hover) { .ag-card:hover { background: var(--surface-2); } }
.ag-top { display: flex; align-items: baseline; gap: 8px; }
.ag-top b { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st { font-style: normal; font-size: 12px; font-weight: 600; flex: none; }
.st.irr { color: var(--warn); } .st.can, .st.exam { color: var(--danger); } .st.now { color: var(--ok); }
.ag-meta { margin-top: 2px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-meta i { font-style: normal; margin: 0 6px; opacity: .6; }
.ag-meta .chg { color: var(--warn); }
.ag-meta s { opacity: .7; }
.ag-note { margin-top: 4px; font-size: 13px; color: var(--text); }
.ag-card.cancelled { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); border-left-color: var(--danger); }
.ag-card.cancelled .ag-top b { text-decoration: line-through; color: var(--muted); }
.ag-card.now { border-color: var(--ok); border-left-color: var(--c-ink); }
.ag-gap { margin: 2px 0 8px 54px; font-size: 12px; color: var(--muted); }
.ag-gap.free { padding: 8px 12px; border: 1px dashed var(--line); border-radius: 6px; }
.ag-empty { text-align: center; color: var(--muted); padding: 56px 16px; }

/* Ladebalken (nur im Stundenplan) */
.loading-bar { height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%; animation: load 1s linear infinite; }
@keyframes load { from { background-position: 200% 0; } to { background-position: -200% 0; } }
/* Ladeanimation: Kreis aus 12 Strichen */
.spinner { position: relative; width: 26px; height: 26px; margin: 28px auto; }
.spinner i { position: absolute; left: 46%; top: 0; width: 8%; height: 27%; border-radius: 2px; background: var(--muted);
  transform-origin: 50% 185%; animation: spin-fade 1s linear infinite; }
.spinner i:nth-child(1) { transform: rotate(0deg); animation-delay: -0.917s; }
.spinner i:nth-child(2) { transform: rotate(30deg); animation-delay: -0.833s; }
.spinner i:nth-child(3) { transform: rotate(60deg); animation-delay: -0.750s; }
.spinner i:nth-child(4) { transform: rotate(90deg); animation-delay: -0.667s; }
.spinner i:nth-child(5) { transform: rotate(120deg); animation-delay: -0.583s; }
.spinner i:nth-child(6) { transform: rotate(150deg); animation-delay: -0.500s; }
.spinner i:nth-child(7) { transform: rotate(180deg); animation-delay: -0.417s; }
.spinner i:nth-child(8) { transform: rotate(210deg); animation-delay: -0.333s; }
.spinner i:nth-child(9) { transform: rotate(240deg); animation-delay: -0.250s; }
.spinner i:nth-child(10) { transform: rotate(270deg); animation-delay: -0.167s; }
.spinner i:nth-child(11) { transform: rotate(300deg); animation-delay: -0.083s; }
.spinner i:nth-child(12) { transform: rotate(330deg); animation-delay: 0.000s; }
/* Ladeanimation im Knopf (z. B. „Speichert …“) */
.btn-busy { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-busy .spinner { width: 18px; height: 18px; margin: 0; }
.btn-busy .spinner i { background: currentColor; }
.btn:disabled:has(.btn-busy) { opacity: .85; }
@keyframes spin-fade { from { opacity: 1; } to { opacity: .12; } }
.spin-wrap { position: relative; height: 0; z-index: 20; }
.spin-bubble { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 4px 16px rgba(0, 0, 0, .2); display: grid; place-items: center; animation: fade .2s ease-out; }
.spin-bubble .spinner { margin: 0; width: 22px; height: 22px; }

/* ---------- Sheets ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(10, 12, 30, .45); z-index: 50;
  animation: fade .15s ease-out; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 520px;
  max-height: 88vh; max-height: 88dvh; background: var(--surface); border-radius: 14px 14px 0 0; z-index: 51;
  display: flex; flex-direction: column; animation: up .2s cubic-bezier(.2,.9,.3,1);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.full { height: 88vh; height: 88dvh; }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 10px auto 4px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px 10px 20px; flex: none; }
.sheet-head h2 { margin: 0; font-size: 19px; flex: 1; }
/* Platz für die Scrollleiste immer freihalten und vom rechten Rand abziehen (--sbw aus app.js), damit der Inhalt bündig unter Kopf und Umschalter steht */
.sheet-body { overflow-y: auto; padding: 0 max(0px, calc(20px - var(--sbw, 0px))) 20px 20px; scrollbar-gutter: stable; }
@keyframes up { from { transform: translate(-50%, 100%); } }
@keyframes fade { from { opacity: 0; } }

.detail-time { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; padding: 4px 11px;
  font-size: 13px; font-weight: 600; }
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
/* Terminwahl in den Formularen: Kacheln je Stunde, Ausfälle sichtbar aber nicht wählbar */
.due-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px 8px; padding-top: 6px; }
.due-t { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; padding: 9px 11px 10px; text-align: left;
  border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s; }
.due-t:active:not(:disabled) { transform: scale(.97); }
@media (hover: hover) { .due-t:hover:not(:disabled):not(.active) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); } }
.due-wd { display: flex; align-items: center; gap: 6px; width: 100%; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.due-dt { font-size: 17px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.due-u { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due-tag { position: absolute; top: -8px; right: 8px; font-style: normal; box-shadow: 0 0 0 3px var(--bg); font-size: 11px; font-weight: 700;
  padding: 1px 7px; line-height: 15px; border-radius: 6px; background: var(--accent); color: var(--accent-on); }
.due-tag.warn { background: var(--warn); color: #1b1300; }
.due-tag.bad { background: var(--danger); color: #fff; }
.due-t.active { border-color: var(--accent); background: var(--accent-soft); }
.due-t.active .due-wd, .due-t.active .due-u { color: color-mix(in srgb, var(--accent) 70%, var(--text)); }

.due-t.off { cursor: not-allowed; background: transparent; border-style: dashed; }
.due-t.off .due-dt, .due-t.off .due-u { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 70%, transparent); }
.due-custom { justify-content: center; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; border-style: dashed; }
.due-custom svg { width: 20px; height: 20px; }
.due-custom.active { color: var(--accent); }
.due-more { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px;
  background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: color .15s, border-color .15s; }
.due-more svg { width: 16px; height: 16px; } .due-more[hidden] { display: none; }
@media (hover: hover) { .due-more:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); } }
/* Fenster „Stunden wählen“ */
/* oben/rechts Platz für das „2×“-Abzeichen, das sonst vom Scrollbereich abgeschnitten wird */
.lsel-days { display: flex; gap: 8px; overflow-x: auto; padding: 9px 6px 10px 2px; margin: -7px -6px 0 -2px; scrollbar-width: none; }
.lsel-days::-webkit-scrollbar { display: none; }
.lsel-day { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 62px; padding: 7px 10px;
  border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.lsel-day span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.lsel-day b { font-size: 15px; font-weight: 800; }
.lsel-day i { position: absolute; top: -7px; right: -4px; font-style: normal; font-size: 10.5px; font-weight: 800; padding: 0 5px; line-height: 15px;
  border-radius: 6px; background: var(--accent); color: var(--accent-on); }
.lsel-day.active { border-color: var(--accent); background: var(--accent-soft); }
.lsel-day.active span { color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.lsel-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.lsel-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; background: none; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; }
.lsel-row + .lsel-row { border-top: 1px solid var(--line); }
.lsel-ck { flex: none; width: 22px; height: 22px; border-radius: 5px; border: 2px solid var(--line); display: grid; place-items: center; color: var(--accent-on); }
.lsel-ck svg { width: 14px; height: 14px; }
.lsel-row.on { background: var(--accent-soft); }
.lsel-row.on .lsel-ck { background: var(--accent); border-color: var(--accent); }
.lsel-u { font-weight: 700; min-width: 64px; }
.lsel-t { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lsel-row.off { cursor: not-allowed; }
.lsel-row.off .lsel-u, .lsel-row.off .lsel-t { color: var(--muted); text-decoration: line-through; }
.lsel-tag { position: static; margin-left: auto; box-shadow: none; }
.lsel-sum { margin: 10px 2px 4px; font-size: 13px; }
.chip.old { text-decoration: line-through; opacity: .6; }
.chip.new { border-color: var(--warn); }
@media (hover: hover) { button.chip:hover { border-color: var(--accent); } }
.state { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 700; margin-right: 6px; }
.state.CANCELLED { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.state.IRREGULAR { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.state.EXAM { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.state.REGULAR { background: var(--accent-soft); color: var(--accent); }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 10px 12px; align-items: start; margin-top: 14px; }
.kv dt { color: var(--muted); font-size: 13px; padding-top: 4px; }
.kv dd { margin: 0; }
.note { background: var(--surface-2); border-radius: 7px; padding: 10px 12px; margin-top: 12px; font-size: 14px; white-space: pre-wrap; }

/* ---------- Picker ---------- */
.seg { display: flex; background: var(--surface-2); border-radius: 8px; padding: 3px; margin: 0 20px 10px; flex: none; }
.seg button { flex: 1; border: 0; background: none; border-radius: 6px; padding: 7px 0; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.search { width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px;
  padding: 11px 14px; outline: none; }
.search:focus { border-color: var(--accent); background: var(--surface); }
.list { list-style: none; margin: 10px 0 0; padding: 0; }
.list li button { width: 100%; border: 0; background: none; text-align: left; padding: 11px 6px;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
@media (hover: hover) { .list li button:hover { background: var(--surface-2); } }
.list .avatar { width: 36px; height: 36px; border-radius: 7px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.list .t { font-weight: 600; }
.list .s { font-size: 12.5px; color: var(--muted); }

/* ---------- Login ---------- */
.login { padding: 32px 22px; padding-top: calc(48px + env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand img { width: 48px; height: 48px; }
.brand h1 { margin: 0; font-size: 26px; }
.brand p { margin: 0; color: var(--muted); font-size: 14px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.btn { width: 100%; border: 0; border-radius: 8px; padding: 13px; font-weight: 700; font-size: 15px;
  background: var(--accent); color: var(--accent-on); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--surface-2); color: var(--text); margin-top: 8px; }
.school-card { display: flex; align-items: center; gap: 12px; }
.school-card .t { font-weight: 700; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 16px; }
.linkish { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 0; }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 300; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }

.msg-body { font-size: 14px; overflow-wrap: anywhere; }
.msg-body img { max-width: 100%; }
.row { display: flex; align-items: center; gap: 10px; }
.date-badge { flex: none; width: 46px; text-align: center; background: var(--accent-soft); color: var(--accent);
  border-radius: 7px; padding: 5px 0; font-size: 11px; font-weight: 700; line-height: 1.1; }
.date-badge b { display: block; font-size: 18px; }
.done { opacity: .55; }

/* ---------- Stundendetails (Detail-Sheet) ---------- */
.pd-h { display: flex; align-items: center; gap: 10px; }
.pd-dot { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.pd-sub { color: var(--muted); font-size: 14px; margin: -4px 0 12px; }
.pd-status { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pd-status .st { --pc: var(--muted); font-size: 13px; padding: 4px 11px; border-radius: 6px; color: #fff; background: var(--pc); }
.pd-status .st.irr { --pc: var(--warn); } .pd-status .st.can, .pd-status .st.exam { --pc: var(--danger); } .pd-status .st.now { --pc: var(--ok); }
.pd-list { border-top: 1px solid var(--line); margin-bottom: 14px; }
.pd-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 0; border: 0;
  border-bottom: 1px solid var(--line); background: none; text-align: left; }
@media (hover: hover) { .pd-row:hover .pd-v b { color: var(--accent); } }
.pd-l { flex: none; width: 82px; font-size: 13px; color: var(--muted); }
.pd-v { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pd-v b { font-weight: 600; }
.pd-v small { font-size: 12.5px; color: var(--muted); }
.pd-v s { color: var(--muted); font-size: 13px; }
.pd-row.changed .pd-v b { color: var(--warn); }
.pd-chev { flex: none; color: var(--muted); display: grid; }
.pd-chev svg { width: 16px; height: 16px; }
.pd-note { padding: 10px 12px; border-radius: 6px; background: var(--surface-2); margin-bottom: 8px; }
.pd-note-l { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.pd-note-t { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Konten ---------- */
.login { position: relative; }
.login-cancel { position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 22px; }
.login-title { font-size: 20px; margin: 0 0 14px; }
.acc-list { border-top: 1px solid var(--line); margin-bottom: 6px; }
.acc-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.acc-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border: 0; background: none; text-align: left; color: var(--text); }
.acc-av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 13px; }
.acc-row.active .acc-av { background: var(--accent-soft); color: var(--accent); }
.acc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acc-txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-txt small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-cur { flex: none; font-size: 12px; color: var(--accent); font-weight: 600; }
.acc-x { flex: none; border: 0; background: none; color: var(--danger); font-size: 13px; padding: 8px 0 8px 6px; }

/* ---------- Kurswahl & Kursgruppen ---------- */
.pill-btn.on { border-color: var(--accent); color: var(--accent); }
/* „Neu“ bei Aufgaben und Prüfungen */
.new-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 15px 0 11px; border: 0; border-radius: 6px;
  background: var(--accent); color: var(--accent-on); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .12s, filter .15s; }
.new-btn svg { width: 17px; height: 17px; flex: none; }
@media (hover: hover) { .new-btn:hover { filter: brightness(1.06); } }
.new-btn:active { transform: scale(.95); }
.lesson.group { --c: var(--muted); background: var(--surface-2); }
.lesson.group .g-codes { color: var(--muted); font-size: 10.5px; white-space: normal; overflow: hidden; line-height: 1.25; }
.pd-row .st { flex: none; font-size: 12px; }
.cw-block { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; margin-bottom: 10px; }
.cw-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 0 6px; }
.cw-head b { font-size: 14px; font-weight: 700; }
.cw-head span { font-size: 12px; color: var(--muted); text-align: right; }
.cw-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; }
.cw-row input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.cw-name { flex: 1; min-width: 0; font-size: 14.5px; }
.cw-row:has(input:not(:checked)) .cw-name { color: var(--muted); text-decoration: line-through; }
.cw-t { flex: none; font-size: 13px; color: var(--muted); }
.cw-more { margin: 4px 0 10px; }
.cw-more summary { cursor: pointer; padding: 10px 0; color: var(--accent); font-weight: 600; font-size: 14px; list-style: none; }
.cw-more summary::-webkit-details-marker { display: none; }
.cw-more summary::after { content: " ▾"; }
.cw-more[open] summary::after { content: " ▴"; }
.cw-more .cw-block .cw-row:first-child { border-top: 0; }

/* Detail-Sheet: Zeit und kompakte Spalten */
.pd-time { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: -4px; }
.pd-time + .pd-sub { margin: 2px 0 14px; }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.pd-cell { position: relative; min-width: 0; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); transition: background .15s; }
.pd-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.pd-ic svg { width: 18px; height: 18px; }
.pd-cv { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.pd-cell .pd-l { width: auto; font-size: 12px; }
.pd-go { flex: none; display: grid; color: var(--muted); opacity: .6; transition: opacity .15s, transform .15s; }
.pd-go svg { width: 16px; height: 16px; }
.pd-cell.one { cursor: pointer; }
.pd-cell.one .pd-val::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
@media (hover: hover) { .pd-cell.one:hover { background: color-mix(in srgb, var(--text) 7%, var(--surface-2)); } }
@media (hover: hover) { .pd-cell.one:hover .pd-go { opacity: 1; transform: translateX(2px); } }
@media (hover: hover) { .pd-cell.one:hover .pd-val:not(.changed) { color: var(--text); } }
/* Kachel mit mehreren Einträgen: ganze Kachel öffnet eine Auswahl */
.pd-cell.multi { cursor: pointer; }
.pd-cell.multi .pd-val, .pd-cell.multi .pd-was { pointer-events: none; }
.pd-hit { position: absolute; inset: 0; z-index: 2; border: 0; padding: 0; background: none; border-radius: inherit; cursor: pointer; }
@media (hover: hover) { .pd-cell.multi:hover { background: color-mix(in srgb, var(--text) 7%, var(--surface-2)); } .pd-cell.multi:hover .pd-go { opacity: 1; } }
.pd-cell.open { z-index: 6; background: color-mix(in srgb, var(--text) 7%, var(--surface-2)); }
.pd-cell.open .pd-go { opacity: 1; transform: rotate(90deg); }
.pd-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 7; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px; box-shadow: 0 12px 30px rgb(0 0 0 / .35); display: flex; flex-direction: column; cursor: default; }
.pd-menu[hidden] { display: none; }
.pd-menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
@media (hover: hover) { .pd-menu button:hover { background: var(--surface-2); } }
.pd-menu button > svg { flex: none; width: 17px; height: 17px; color: var(--muted); }
.pd-menu button > svg:last-child { width: 15px; height: 15px; margin-left: auto; opacity: .6; }
.pd-menu span { min-width: 0; display: flex; flex-direction: column; }
.pd-menu b { font-size: 14.5px; font-weight: 600; }
.pd-menu small { font-size: 12px; color: var(--muted); }
.pd-cell.chg .pd-ic { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pd-cell .pd-val { overflow-wrap: break-word; }
@media (max-width: 480px) {
  .pd-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .pd-cell { gap: 9px; padding: 9px 10px; }
  .pd-ic { width: 30px; height: 30px; border-radius: 6px; }
  .pd-ic svg { width: 16px; height: 16px; }
  .pd-go { display: none; }
}
.pd-val { border: 0; background: none; padding: 0; text-align: left; font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
@media (hover: hover) { .pd-val:hover { color: var(--accent); } }
.pd-val.changed { color: var(--warn); }
.pd-val s { display: block; font-size: 12px; font-weight: 400; color: var(--muted); text-decoration: none; }
/* ursprüngliches Element („statt 215“): eigener Link über der Kachel */
.pd-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.pd-was { position: relative; z-index: 1; border: 0; background: none; padding: 0; font: inherit; font-size: 15px; font-weight: 600; color: var(--muted); text-align: left;
  overflow-wrap: anywhere; transition: color .15s; }
button.pd-was { cursor: pointer; }
.pd-arr { flex: none; width: 15px; height: 15px; color: var(--muted); opacity: .8; }
.pd-was.pd-gone { margin: 0; font-size: inherit; font-weight: inherit; color: inherit; text-decoration: none; }
@media (hover: hover) { button.pd-was:hover { color: var(--accent); } }

/* ---------- Anmeldung (Supabase) ---------- */
.info-box { background: var(--accent-soft); color: var(--text); border-radius: 7px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.code-input { letter-spacing: .12em; font-family: ui-monospace, Consolas, monospace; }

/* Anmelde-/Registrierseite: große Felder, Schritte bei der Registrierung */
.login.auth { padding: calc(20px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }
.af-lead { margin: 0; color: var(--muted); font-size: 15px; }

/* Startseite: „Neu hier?“ / „Anmelden“ und Testzugang */
.af-choices { display: flex; flex-direction: column; gap: 12px; }
.af-choice { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, background .15s, transform .1s; }
.af-choice:active { transform: scale(.99); }
@media (hover: hover) { .af-choice:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); } }
.af-ci { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.af-ci svg { width: 23px; height: 23px; }
.af-ct { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.af-ct b { font-size: 16.5px; }
.af-ct small { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.af-choice > svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
.af-choice.primary { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.af-choice.primary .af-ci { background: var(--accent); color: #fff; }
.af-choice.primary > svg { color: var(--accent); }
.af-rec { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 6px; vertical-align: 2px;
  font-size: 11.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.af-back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 600;
  padding: 8px 10px 8px 4px; margin: 0 0 -8px; cursor: pointer; }
.af-back svg { width: 20px; height: 20px; }
@media (hover: hover) { .af-back:hover { color: var(--text); } }
.af-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 20px; box-shadow: var(--shadow); }
.auth .af-seg { margin: 0 0 20px; }
.auth .af-seg button { padding: 10px 0; font-size: 15px; }
.auth .field { margin-bottom: 16px; }
.auth .field > span { font-size: 14px; color: var(--text); margin-bottom: 7px; }
.auth .search { min-height: 54px; padding: 14px 16px; font-size: 16px; border-radius: 8px;
  transition: border-color .15s, box-shadow .15s, background .15s; }
.auth .search::placeholder { color: var(--muted); opacity: .7; }
.auth .search:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.auth .code-input { font-size: 17px; }
.af-help { display: block; margin-top: 7px; font-size: 13px; color: var(--muted); }
.af-err { display: none; margin-top: 7px; font-size: 13.5px; font-weight: 600; color: var(--danger); }
.auth .field.bad .af-err { display: block; }
.auth .field.bad .af-help { display: none; }
.auth .field.bad .search { border-color: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent); }
.af-pw { position: relative; }
.af-pw .search { padding-right: 56px; }
.af-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border: 0;
  border-radius: 7px; background: none; color: var(--muted); display: grid; place-items: center; }
@media (hover: hover) { .af-eye:hover { color: var(--text); background: var(--surface); } }
.af-eye svg { width: 22px; height: 22px; }
.af-meter { display: flex; align-items: center; gap: 5px; margin: -6px 0 16px; }
.af-meter i { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-2); transition: background .2s; }
.af-meter span { flex: none; min-width: 92px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.af-meter[data-lvl="1"] i:nth-child(1) { background: var(--danger); }
.af-meter[data-lvl="1"] span { color: var(--danger); }
.af-meter[data-lvl="2"] i:nth-child(-n+2) { background: var(--warn); }
.af-meter[data-lvl="2"] span { color: var(--warn); }
.af-meter[data-lvl="3"] i { background: var(--ok); }
.af-meter[data-lvl="3"] span { color: var(--ok); }

.af-steps { list-style: none; display: flex; gap: 8px; margin: 0 0 18px; padding: 0; }
.af-steps li { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.af-steps li::before { content: ""; display: block; height: 6px; border-radius: 99px; background: var(--surface-2); margin-bottom: 7px; transition: background .25s; }
.af-steps li.done::before { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.af-steps li.on::before { background: var(--accent); }
.af-steps li.on { color: var(--accent); }
.af-steps span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-h { margin: 0 0 4px; font-size: 21px; letter-spacing: -.01em; }
.af-sub { margin: 0 0 18px; color: var(--muted); font-size: 14.5px; }
.af-step:not([hidden]) { animation: af-in .25s ease-out; }
@keyframes af-in { from { opacity: 0; transform: translateX(10px); } }
@media (prefers-reduced-motion: reduce) { .af-step:not([hidden]) { animation: none; } }

.auth .btn { min-height: 52px; font-size: 16px; border-radius: 8px; transition: transform .1s, filter .15s; }
@media (hover: hover) { .auth .btn:not(:disabled):hover { filter: brightness(1.05); } }
.auth .btn:not(:disabled):active { transform: scale(.98); }
.auth .btn.ghost { background: var(--surface-2); color: var(--text); box-shadow: none; }
.af-nav { display: flex; gap: 10px; }
.af-nav .btn.ghost { flex: none; width: auto; margin: 0; padding: 0 16px 0 12px; display: inline-flex; align-items: center; gap: 4px; }
.af-nav .btn.ghost svg { width: 20px; height: 20px; }
.af-nav .btn:last-child { flex: 1; }
.af-alert { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 12px 14px; border-radius: 8px; font-size: 14.5px; line-height: 1.4; }
.af-alert svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.info-box.af-alert svg { color: var(--accent); }
.af-links { display: flex; justify-content: center; margin-top: 6px; }
.auth .linkish { padding: 12px 6px; font-size: 14.5px; }
.auth .hint .linkish { padding: 10px 4px; font-size: inherit; }
.auth .hint { text-align: center; font-size: 14px; line-height: 1.5; margin-top: 14px; }

/* Formularseiten (Anmelden, Registrieren, Testzugang) im Stil von KielTraffic: Glaskarte mit Logo,
   Beschriftung über dem Feld mit rotem Stern, eckige Felder, Knopf mit Symbol rechts, Links darunter mittig */
.af-page { isolation: isolate; width: 100%; }   /* #app ist ein Flex-Container: ohne volle Breite schrumpft die Seite auf ihren Inhalt */
@media (min-width: 768px) { .login.af-page { max-width: 480px; } }
.af-page::before { content: ""; position: fixed; inset: -80px; z-index: -1; pointer-events: none; filter: blur(70px); opacity: .55;
  background: radial-gradient(40% 35% at 18% 20%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%),
              radial-gradient(35% 30% at 85% 30%, rgba(77, 171, 247, .45), transparent 70%),
              radial-gradient(40% 30% at 60% 90%, rgba(255, 212, 59, .3), transparent 70%); }
.af-page .af-card { max-width: 440px; margin: 14px auto 0; padding: 8px 20px 18px; border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.af-brand { display: grid; justify-items: center; gap: 8px; padding: 18px 0 2px; }
.af-word { display: flex; align-items: center; gap: 10px; }
.af-word img { width: 38px; height: 38px; border-radius: 7px; }
.af-word b { font-size: 25px; line-height: 1.1; letter-spacing: -.01em; }
.af-title { margin: 20px 0 2px; font-size: 23px; text-align: center; }
.af-page .af-lead { margin: 2px 0 0; font-size: 14px; text-align: center; }
.af-page form { margin-top: 16px; }
.af-page .field { margin-bottom: 14px; }
.af-page .field > span { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.af-page .field > span::after { content: "*"; color: #e03131; margin-left: 2px; }
.af-page .search { min-height: 0; height: 44px; padding: 0 12px; border-radius: 0; font-size: 16px;
  background: color-mix(in srgb, var(--bg) 70%, transparent); }
.af-page .search:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); box-shadow: none; }
.af-page .field.bad .search { box-shadow: none; outline: 2px solid var(--danger); outline-offset: -1px; }
.af-page .af-pw .search { padding-right: 46px; }
.af-page .af-eye { right: 2px; width: 40px; height: 40px; border-radius: 0; color: var(--accent); }
@media (hover: hover) { .af-page .af-eye:hover { background: none; color: var(--accent); filter: brightness(1.15); } }
.af-page form > .btn, .af-page .af-nav .btn { width: auto; min-height: 0; height: 44px; padding: 0 18px; border-radius: 0; margin: 10px 0 0 auto;
  display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.af-page .btn svg { width: 20px; height: 20px; flex: none; }
.af-page .af-nav { justify-content: flex-end; }
.af-page .af-nav .btn:last-child { flex: none; }
.af-page .af-nav .btn.ghost { margin: 10px auto 0 0; padding: 0 14px 0 10px; gap: 4px; }
.af-page .af-alert { border-radius: 0; }
.af-page .af-links { flex-direction: column; align-items: center; gap: 0; margin-top: 12px; }
.af-page .af-links .linkish { padding: 5px 4px; font-size: 13.5px; font-weight: 500; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) { .af-page .af-links .linkish:hover { color: var(--text); } }
.af-page .af-steps li::before { border-radius: 0; }
/* Auswahl („Neu hier?“ / „Anmelden“, Testzugang / Konto erstellen) in der Karte: eckige Zeilen */
.af-page .af-choices { margin-top: 18px; gap: 10px; }
.af-page .af-choice { padding: 12px 14px; border-radius: 0; box-shadow: none; background: color-mix(in srgb, var(--bg) 55%, transparent); }
.af-page .af-choice.primary { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.af-page .af-ci { width: 40px; height: 40px; border-radius: 0; }
.af-page .af-ci svg { width: 21px; height: 21px; }
.af-page .af-ct b { font-size: 16px; }
.af-page .af-ct small { font-size: 13px; }
.af-page .af-rec { border-radius: 0; }
.af-note { margin: 14px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); text-align: center; }

/* =====================================================================
   Tablet (ab 768 px) und Desktop (ab 1100 px)
   ===================================================================== */
.nav-brand { display: none; }

@media (min-width: 768px) {
  :root { --nav-h: 0px; --rail-w: 84px; }
  body { background: var(--bg); }
  #app { max-width: none; box-shadow: none; padding-left: var(--rail-w); }
  #app:has(.login) { padding-left: 0; }

  /* Navigation als Leiste links */
  .bottomnav {
    left: 0; top: 0; bottom: 0; transform: none; width: var(--rail-w); max-width: none; height: auto;
    flex-direction: column; justify-content: flex-start; gap: 4px; padding: calc(14px + env(safe-area-inset-top)) 8px 14px;
    border-top: 0; border-right: 1px solid var(--line);
  }
  .bottomnav button { flex: none; height: 64px; border-radius: 8px; }
  @media (hover: hover) { .bottomnav button:hover { background: var(--surface-2); } }
  main { padding-bottom: 24px; }

  .topbar { padding: 12px 16px 10px 24px; }
  .page, main.page { padding: 20px 24px; max-width: 760px; }
  .login { max-width: 440px; margin: 0 auto; padding-top: 72px; }
  .login.auth { padding-top: 64px; }
  .af-card { padding: 18px 26px 26px; }

  /* Stundenplan */
  .tt-head, .tt-body { grid-template-columns: 52px repeat(var(--days), 1fr); }
  .tt-wrap { padding-right: 8px; }
  .lesson { font-size: 11.5px; padding: 4px 6px 4px 8px; }
  .lesson .subj { font-size: 13px; }
  .lesson.group .g-codes { font-size: 11.5px; }
  .ag { max-width: 760px; padding: 16px 24px 24px; }
  .day-strip { max-width: 560px; }

  /* Sheets als mittige Dialoge */
  .sheet {
    top: 50%; bottom: auto; transform: translate(-50%, -50%); max-width: 520px; max-height: 82vh;
    border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: pop .16s ease-out;
    padding-bottom: 0;
  }
  .sheet.full { height: 82vh; }
  .sheet-grip { visibility: hidden; height: 0; margin: 6px auto 0; }
  @keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
  #toast { bottom: 24px; }
}

@media (min-width: 1100px) {
  :root { --rail-w: 220px; }
  .bottomnav { padding: 18px 12px; }
  .nav-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-size: 16px; }
  .nav-brand img { width: 28px; height: 28px; }
  .bottomnav button {
    height: 44px; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 12px;
    font-size: 14.5px; text-align: left;
  }
  .bottomnav button svg { width: 22px; height: 22px; padding: 0; background: none !important; }
  .bottomnav button.active { background: var(--accent-soft); }

  #view { max-width: 1320px; }
  .topbar { padding: 14px 24px 12px 32px; }
  .topbar h1 { font-size: 21px; }
  .page, main.page { padding: 24px 32px; }
  .ag { padding: 20px 32px 32px; }
  .lesson.narrow { padding: 4px 4px 4px 6px; }
  .lesson.narrow .subj { font-size: 12px; }
}

.prof-name { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

/* ---------- Klassenwahl ---------- */
.fr-go { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 16px 0 6px; }
.fr-go svg { width: 18px; height: 18px; flex: none; }
.cp-list { margin-top: 14px; }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cp-year + .cp-year { margin-top: 16px; }
.cp-year h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.cp-confirm { position: sticky; bottom: 0; margin-top: 20px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 14px); }
.cp-confirm .btn { width: 100%; }
.cp-item { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; min-width: 0;
  border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 10px; color: var(--text); }
@media (hover: hover) { .cp-item:hover { border-color: var(--accent); } }
.cp-item b { font-size: 15px; }
.cp-item small { font-size: 11.5px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-item.sel { border-color: var(--accent); background: var(--accent-soft); }
@media (min-width: 768px) { .login:has(.cp-list) { max-width: 640px; } }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; padding: 0; box-shadow: inset 0 0 0 2px var(--surface); }
.swatches button.sel { border-color: var(--text); }
.swatches .sw-none { background: linear-gradient(135deg, transparent 45%, var(--muted) 45%, var(--muted) 55%, transparent 55%), var(--surface-2); }
.sj-dot { flex: none; width: 34px; height: 34px; border-radius: 50%; }
.swatches { gap: 12px; }
.swatches button { width: 36px; height: 36px; }

/* Einstellungen: Übersicht mit Unterseiten */
.st-wrap { max-width: 640px; margin: 0 auto; }
.st-head { width: 100%; display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding: 18px; text-align: left; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface);
  box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
@media (hover: hover) { .st-head:hover { background: var(--surface-2); } }
.st-head:active { transform: scale(.99); }
.st-av { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.st-av svg { width: 26px; height: 26px; }
.st-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.st-who b { font-size: 18px; font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chips { min-width: 0; }
.st-chips span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 3px 10px; }
.st-edit { flex: none; display: flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--accent); }
.st-edit svg { width: 16px; height: 16px; }
.st-group { margin-bottom: 18px; }
.st-gt { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 4px 8px; }
.st-menu { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.st-group .st-menu { margin-bottom: 0; }
.st-menu > button, .st-menu > .st-row, .st-rowslot > .st-row { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: none; color: var(--text);
  text-align: left; padding: 12px 14px; position: relative; transition: background .12s; font: inherit; }
.st-menu > * + *::before, .st-rowslot > .st-row::before { content: ""; position: absolute; top: 0; right: 0; left: 14px; border-top: 1px solid var(--line); }
.st-menu > :has(.st-ic, .sj-dot) + *::before, .st-rowslot > .st-row::before { left: 62px; }
.st-rowslot:empty::before { display: none; }
@media (hover: hover) { .st-menu > button:hover, .st-rowslot > button:hover { background: var(--surface-2); } }
.st-menu > button > svg, .st-rowslot > button > svg { flex: none; width: 18px; height: 18px; color: var(--muted); transition: transform .15s; }
@media (hover: hover) { .st-menu > button:hover > svg { transform: translateX(2px); color: var(--text); } }
.st-rowslot { position: relative; padding: 0 !important; }
.st-link { flex: none; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.st-note { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 8px 6px 0; }
.st-note code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.st-badge { font-size: 12.5px; font-weight: 800; letter-spacing: -.01em; }
.st-empty { padding: 14px; margin: 0; }
.st-search { margin: 0 0 10px; }
.st-sub .sj-dot { width: 36px; height: 36px; box-shadow: inset 0 0 0 2px color-mix(in srgb, #fff 12%, transparent); }
.st-danger, .st-danger .acc-txt b { color: var(--danger) !important; }
.st-danger .st-ic { --ic: var(--danger) !important; color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, transparent); }
/* Schalter */
.st-switch { flex: none; position: relative; width: 46px; height: 28px; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
  background: color-mix(in srgb, var(--muted) 35%, var(--surface-2)); transition: background .2s; }
.st-switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s ease; }
.st-switch.on { background: var(--accent); }
.st-switch.on i { transform: translateX(18px); }
/* Farbschema-Auswahl */
.st-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.st-theme { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 10px 12px; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); color: var(--text); font: inherit; transition: border-color .15s; }
@media (hover: hover) { .st-theme:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); } }
.st-theme.active { border-color: var(--accent); }
.st-theme b { font-size: 14px; font-weight: 600; }
.st-theme.active b { color: var(--accent); }
.st-prev { width: 100%; aspect-ratio: 16 / 10; border-radius: 7px; padding: 8px; display: flex; flex-direction: column; gap: 5px; overflow: hidden; border: 1px solid rgba(128,128,128,.25); }
.st-prev i { display: block; height: 22%; border-radius: 4px; }
.st-prev i:nth-child(1) { width: 55%; }
.st-prev-light { background: #f4f5fb; } .st-prev-light i { background: #dfe2ef; } .st-prev-light i:first-child { background: #f27aae; }
.st-prev-dark { background: #12152a; } .st-prev-dark i { background: #262b48; } .st-prev-dark i:first-child { background: #f27aae; }
.st-prev-auto { background: linear-gradient(135deg, #f4f5fb 50%, #12152a 50%); }
.st-prev-auto i { background: rgba(128,128,128,.4); } .st-prev-auto i:first-child { background: #f27aae; }
/* Synchronisieren: Drehsymbol */
.st-spin { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; }
.busy .st-spin { border-color: var(--line); border-top-color: var(--accent); animation: st-rot .8s linear infinite; }
@keyframes st-rot { to { transform: rotate(360deg); } }
.busy { opacity: .7; pointer-events: none; }
/* Kurse im Kartenstil */
.st-sub .cw-block { background: var(--surface); border-radius: 10px; padding: 0 14px; box-shadow: var(--shadow); margin-bottom: 14px; }
.st-sub > #cw-root > .meta:first-child { font-size: 13px; line-height: 1.5; margin: 0 6px 14px !important; }
.st-ic { --ic: var(--accent); flex: none; width: 36px; height: 36px; border-radius: 7px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ic) 18%, transparent); color: var(--ic); }
[style*="--ic"] > .st-ic { --ic: inherit; }
.st-ic svg { width: 19px; height: 19px; }
.st-menu .acc-txt b { font-size: 15px; }
.st-menu .acc-txt small { font-size: 13px; margin-top: 1px; white-space: normal; overflow-wrap: break-word; line-height: 1.35; }   /* Beschreibungen umbrechen statt abschneiden (Handy) */
.st-logout { color: var(--danger) !important; }
.st-logout .st-ic { --ic: var(--danger); }
@media (max-width: 480px) { .st-head { padding: 16px 14px; gap: 12px; } .st-av { width: 46px; height: 46px; } .st-edit span, .st-edit { font-size: 0; } .st-edit svg { width: 20px; height: 20px; color: var(--muted); } }

/* Räume */
.room-note { font-size: 12px; color: var(--muted); padding: 2px 0 6px; }
.fr-row { margin-bottom: 4px; }
.fr-row .chip { padding: 6px 12px; }

/* Änderungen bestätigen */
.lesson.unread { box-shadow: inset 0 0 0 2px var(--accent); }
.ag-card.unread { box-shadow: 0 0 0 2px var(--accent); }
.ch-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; border: 0; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13.5px; padding: 9px 16px; text-align: left; }
.ch-bar span { text-decoration: underline; }
.ch-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.ch-item { display: flex; gap: 12px; align-items: flex-start; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); text-align: left; padding: 10px 2px; }
@media (hover: hover) { .ch-item:hover { background: var(--surface-2); } }
.ch-when { flex: none; width: 64px; font-weight: 700; font-size: 13.5px; display: flex; flex-direction: column; }
.ch-when small, .ch-txt small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.ch-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tt-stand { margin: 6px 0 0; padding: 0 12px 4px; font-size: 11.5px; color: var(--muted); text-align: left; }
.room-note .stale, .hint .stale, .tt-stand .stale { color: var(--warn); font-weight: 600; }

/* Volle Namen in der Wochenansicht: Langform nur, wenn die Kachel breit genug ist */
.lesson.full { container-type: inline-size; }
.lesson .nm-l { display: none; }
@container (min-width: 105px) {
  .lesson .nm-l { display: inline; }
  .lesson .nm-s { display: none; }
}

/* ---------- Modul Hausaufgaben ---------- */
.hw-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.hw-check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: none;
  color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; padding: 0; cursor: pointer; }
@media (hover: hover) { .hw-check:hover { border-color: var(--accent); } }
.hw-row.done .hw-check { background: var(--accent); border-color: var(--accent); }
.hw-row.done .acc-txt { opacity: .55; text-decoration: line-through; }
.hw-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 11px 0; border: 0; background: none;
  color: inherit; text-align: left; font: inherit; cursor: pointer; }
.hw-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.acc-txt small.hw-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hw-due { flex: none; font-size: 12.5px; color: var(--muted); }
.section-title.hw-late { color: var(--danger); }
/* Aufgabenliste: Karten je Aufgabe mit Fachfarbe, gruppiert nach Tag */
.hw-page { max-width: 760px; }
.hw-group { margin-bottom: 22px; }
.hw-gh { display: flex; align-items: baseline; gap: 8px; margin: 4px 4px 8px; }
.hw-gh b { font-size: 16px; font-weight: 750; letter-spacing: -.01em; }
.hw-gh span { color: var(--muted); font-size: 13.5px; }
.by-subj .hw-group.subj .hw-subj { display: none; }
.hw-gh .hw-gdot { flex: none; align-self: center; width: 10px; height: 10px; border-radius: 50%; }
.hw-grp { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.hw-gh i { margin-left: auto; font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.hw-group.soon .hw-gh b { color: var(--accent); }
.hw-group.late .hw-gh b { color: var(--danger); }
.hw-group.late .hw-gh i { color: var(--danger); }
.hw-list { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.hw-card { --sc: var(--accent); position: relative; display: flex; flex-wrap: wrap; align-items: center;
  transition: opacity .2s ease, background .15s ease; }
.hw-card + .hw-card::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; height: 1px; background: var(--line); }
@media (hover: hover) { .hw-card:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); } }
.hw-card .hw-check { flex: none; width: 22px; height: 22px; margin: 0 0 0 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--sc-ink) 85%, var(--text));
  background: none; color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; cursor: pointer; transition: background .15s, transform .15s; }
@media (hover: hover) { .hw-card .hw-check:hover { background: color-mix(in srgb, var(--sc) 22%, transparent); } }
.hw-card.done .hw-check, .hw-card.ticking .hw-check { background: var(--sc-ink); border-color: var(--sc-ink); }
.hw-card.ticking { opacity: .45; }
.hw-card .hw-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border: 0; background: none;
  color: inherit; text-align: left; font: inherit; cursor: pointer; }
.hw-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hw-card .hw-body { padding: 0; gap: 1px; }
.hw-subj { font-size: 12.5px; font-weight: 600; color: color-mix(in srgb, var(--sc-ink) 80%, var(--text)); }
.hw-new { display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 6px; vertical-align: 1px; font-style: normal;
  font-size: 11px; font-weight: 700; line-height: 15px; background: var(--accent); color: var(--accent-on); }
.hw-card .hw-text { font-size: 15px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hw-notep { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-notep::before { content: "≡ "; opacity: .7; }
.hw-card .hw-due { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.hw-card .hw-due b { font-size: 12.5px; color: color-mix(in srgb, var(--text) 80%, var(--muted)); font-weight: 600; }
.hw-group.late .hw-card .hw-due { color: var(--danger); font-weight: 600; }
.hw-card.done { opacity: .55; }
/* Schieber zum Bestätigen (erscheint über der Zeile nach Tippen auf den Kreis) */
.hw-slide { position: absolute; inset: 7px 10px; z-index: 2; border-radius: 8px; overflow: hidden; display: flex; align-items: center;
  background: color-mix(in srgb, var(--sc) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sc) 40%, transparent);
  opacity: 0; transform: scale(.97); transition: opacity .16s ease, transform .16s ease; touch-action: none; user-select: none; -webkit-user-select: none; }
.hw-slide.in { opacity: 1; transform: none; }
/* fest eingebaut in der Detailseite */
.hw-slide-host { --sc: var(--accent); }
.hw-slide-host + .hw-acts, .hw-move-btn + .hw-slide-host { margin-top: 8px; }
.hw-slide.static { position: relative; inset: auto; height: 54px; border-radius: 8px; }
.hw-slide.static .hw-slide-knob { left: 5px; margin-top: -22px; width: 44px; height: 44px; border-radius: 7px; }
.hw-slide.static .hw-slide-knob svg { width: 21px; height: 21px; }
.hw-slide.static .hw-slide-fill { border-radius: 8px; }
.hw-slide.static .hw-slide-txt { font-size: 15px; padding-left: 48px; }
.hw-slide.out { opacity: 0; transform: scale(.97); }
.hw-slide-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: color-mix(in srgb, var(--sc) 32%, transparent); }
.hw-slide-txt { position: relative; flex: 1; text-align: center; padding-left: 40px; font-size: 13.5px; font-weight: 600; color: color-mix(in srgb, var(--sc-ink) 70%, var(--text));
  pointer-events: none; }
.hw-slide-txt::after { content: " ›››"; letter-spacing: 1px; opacity: .6; }
.hw-slide-knob { position: absolute; left: 4px; top: 50%; margin-top: -19px; width: 38px; height: 38px; border-radius: 6px; border: 0; padding: 0;
  background: var(--sc-ink); color: #fff; display: grid; place-items: center; cursor: grab; box-shadow: 0 2px 8px rgba(0,0,0,.25); touch-action: none; }
.hw-slide-knob svg { width: 19px; height: 19px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.hw-slide.drag .hw-slide-knob { cursor: grabbing; }
.hw-slide.anim .hw-slide-knob, .hw-slide.anim .hw-slide-fill { transition: transform .22s cubic-bezier(.3,.7,.3,1), width .22s cubic-bezier(.3,.7,.3,1); }
.hw-slide.anim .hw-slide-txt { transition: opacity .22s; }
.hw-slide.ok .hw-slide-fill { background: color-mix(in srgb, var(--sc) 55%, transparent); }
.hw-slide.nudge .hw-slide-knob { animation: hw-nudge .45s ease; }
@keyframes hw-nudge { 30% { transform: translateX(14px); } 60% { transform: translateX(-2px); } }
@media (prefers-reduced-motion: reduce) { .hw-slide, .hw-slide.anim * { transition: none !important; } .hw-slide.nudge .hw-slide-knob { animation: none; } }
.hw-card.done .hw-text { text-decoration: line-through; }
.hw-done-tg { display: block; margin: 6px auto 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 6px; padding: 7px 16px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .hw-done-tg:hover { color: var(--text); } }
.topbar .title-btn .sub .late { color: var(--danger); }
.hw-ta { resize: vertical; min-height: 76px; font: inherit; }
.hw-own { border-left: 3px solid var(--accent); }
.hw-edit { display: block; width: 100%; border: 0; background: none; padding: 2px 0; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.hw-edit + .hw-edit { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
/* Markierung im Plan: Stunde mit eigener offener Hausaufgabe */

/* Fachauswahl im Hausaufgaben-Formular */
.sp-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2); color: inherit; font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.sp-btn[aria-expanded="true"] { border-color: var(--accent); }
@media (hover: hover) { .sp-btn:hover { border-color: var(--accent); } }
.sp-btn svg { width: 18px; height: 18px; flex: none; color: var(--muted); transform: rotate(90deg); transition: transform .15s; }
.sp-btn[aria-expanded="true"] svg { transform: rotate(-90deg); }
.sp-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.sp-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-code { flex: none; font-size: 12.5px; color: var(--muted); }
.sp-list { margin-top: 6px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); padding: 4px; }
.sp-list button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 6px;
  background: none; color: inherit; font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
@media (hover: hover) { .sp-list button:hover { background: var(--surface); } }
.sp-list button.sel { background: var(--accent-soft); }
.sp-list button.sel .sp-name { color: var(--accent); }
.sp-list .sp-name { font-weight: 500; }
.field .opt { font-style: normal; font-weight: 400; opacity: .7; }
.hw-has-note { opacity: .6; }
.hw-note { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; white-space: pre-wrap; }
/* Detailseite Hausaufgabe */
.hw-d-text { font-size: 16px; font-weight: 600; }
.hw-d-meta { margin: 4px 0 14px; font-size: 12.5px; }
.hw-d-actions { display: flex; gap: 8px; }
.hw-d-actions .btn { flex: 1; margin-top: 8px; }
.st.hw-st-done { background: var(--accent-soft); color: var(--accent); }
.pd-note-t a { color: var(--accent); }

/* ---------- Detailseiten (statt Popup) ---------- */
.pv { position: fixed; top: 0; bottom: 0; left: max(0px, calc(50% - 260px)); width: min(100%, 520px); z-index: 45;
  background: var(--bg); display: flex; flex-direction: column; animation: pv-in .2s cubic-bezier(.2,.9,.3,1); }
.pv-top { flex: none; }
.pv-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pv-title .pd-dot { width: 14px; height: 14px; }
.pv-body { flex: 1; overflow-y: auto; padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); }
@keyframes pv-in { from { opacity: 0; transform: translateX(28px); } }
@media (min-width: 768px) {
  .pv { left: var(--rail-w); width: auto; right: 0; }
  .pv-body { padding: 20px 24px 32px; }
  .pv-body > * { max-width: 640px; }
}
/* Farbwahl: großes Raster + Teilen */
.swatches.sw-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.swatches.sw-grid button { width: auto; height: auto; aspect-ratio: 1; }
.swatches.sw-grid .sw-none { grid-column: span 12; aspect-ratio: auto; height: 30px; border-radius: 6px; }
.sw-custom { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-weight: 600; }
.sw-custom input { width: 48px; height: 32px; border: 0; background: none; padding: 0; }
.share-code { font-size: 34px; font-weight: 800; letter-spacing: .2em; text-align: center; padding: 18px; margin-bottom: 12px;
  border-radius: 8px; background: var(--surface-2); font-family: ui-monospace, monospace; }
.share-prev { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.share-prev span { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 3px 9px; border-radius: 6px; background: var(--surface-2); }
.share-prev i { width: 10px; height: 10px; border-radius: 50%; }

/* Weggefallenes Element (z. B. Lehrkraft entfällt): zwei deutliche Striche */
.gone { font-weight: 800; letter-spacing: .08em; color: var(--warn); }

/* Mitteilungen (unter Tools): Tageswahl oben */
.msg-page { max-width: 760px; }
.msg-bar { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px; margin-bottom: 12px; }
.msg-day { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.msg-day b { font-size: 16px; font-weight: 800; }
.msg-day span { font-size: 12.5px; color: var(--muted); }
.msg-today { display: block; margin: -4px auto 12px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }

/* Prüfungen: schlichte Zeilen – Datumskachel in der Fachfarbe, Fach und Details, Countdown als kleine Plakette */
.ex-card { --sc: var(--accent); width: 100%; display: flex; align-items: center; gap: 14px; margin-bottom: 8px; padding: 10px 14px 10px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: background .15s, border-color .15s; }
@media (hover: hover) { .ex-card:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--sc) 35%, var(--line)); } }
.ex-date { flex: none; width: 48px; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 8px; background: color-mix(in srgb, var(--sc) 16%, var(--surface)); line-height: 1.05; }
.ex-date b { font-size: 20px; font-weight: 800; color: color-mix(in srgb, var(--sc-ink) 70%, var(--text)); letter-spacing: -.02em; }
.ex-date span { font-size: 11.5px; font-weight: 600; color: color-mix(in srgb, var(--sc-ink) 45%, var(--muted)); }
.ex-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ex-subj { display: block; font-size: 15.5px; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ex-subj i { display: none; }   /* die Farbe trägt die Datumskachel */
.ex-when { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-cd { flex: none; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 4px 10px; border-radius: 6px; white-space: nowrap; }
.ex-card.soon .ex-cd { color: var(--accent); background: var(--accent-soft); }
.ex-card.past { opacity: .6; }
.ex-card.past .ex-date { background: var(--surface-2); }
.ex-card.past .ex-date b, .ex-card.past .ex-date span { color: var(--muted); }
/* schmal: Countdown oben rechts neben dem Fach, die Details bekommen die ganze Breite */
@media (max-width: 560px) {
  .ex-card { position: relative; align-items: flex-start; }
  .ex-body { padding-top: 5px; }
  .ex-card > .ex-cd { position: absolute; top: 12px; right: 12px; }
  .ex-card:has(> .ex-cd) .ex-subj { padding-right: 104px; }
}

/* Prüfungen aus Untis: übernehmen oder ausblenden */
.ex-auto { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.ex-src { font-size: 12px; color: var(--muted); margin-right: 4px; }
.ex-act { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 6px; padding: 4px 12px;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; min-height: 28px; }
@media (hover: hover) { .ex-act:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); } }
.ex-act.ok { color: var(--accent); }
.ex-act.no { color: var(--muted); }
.ex-act .btn-busy .spinner { width: 14px; height: 14px; }
.ex-card > .ex-act { flex: none; }

/* Karussell beim Wischen zwischen Wochen/Tagen */
#plan-main { position: relative; overflow-x: clip; }
.car-peek { position: absolute; pointer-events: none; }
.car-wait { display: grid; place-items: center; padding: 60px 0; }

/* Hausaufgaben: Abgabe vorbei – deutlich rot, mit Verschieben auf die nächste Stunde */
.hw-card.late .hw-due, .hw-card.late .hw-due b { color: var(--danger); font-weight: 700; }
.hw-late { flex-basis: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px 50px; margin-top: -4px; }
.hw-late-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--danger); margin-right: auto; }
.hw-late-tag::before { content: "!"; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1.8px solid currentColor; font-size: 11px; font-weight: 900; }
.hw-move { border: 0; background: var(--accent); color: var(--accent-on); border-radius: 7px; padding: 7px 12px 7px 14px; font: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent); transition: filter .15s, transform .1s; }
.hw-move svg { width: 15px; height: 15px; }
@media (hover: hover) { .hw-move:hover { filter: brightness(1.08); } }
.hw-move:active { transform: scale(.97); }
.hw-move .btn-busy .spinner { width: 14px; height: 14px; }
.hw-move .btn-busy .spinner i { background: currentColor; }
.hw-move-btn { background: var(--danger); color: #fff; }
.hw-keep { border: 0; background: var(--surface-2); color: var(--text); border-radius: 7px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
@media (hover: hover) { .hw-keep:hover { filter: brightness(1.15); } }
.hw-keep:active { transform: scale(.97); }

/* Prüfungen: Papierkorb für vorbeie Prüfungen */
.ex-trash-tg { display: flex; align-items: center; gap: 6px; }
.ex-trash-tg svg { width: 15px; height: 15px; }
.ex-trash-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 2px 10px; font-size: 12.5px; color: var(--muted); }
.ex-act.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }

/* Bestätigung: Hausaufgabe verschieben */
.mv-card { --sc: var(--accent); border: 1px solid var(--line); border-left: 4px solid var(--sc-ink); border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; background: var(--surface-2); }
.mv-subj { font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--sc-ink) 75%, var(--text)); }
.mv-text { font-size: 15px; font-weight: 600; margin: 2px 0 10px; overflow-wrap: anywhere; }
.mv-route { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; }
.mv-route svg { width: 16px; height: 16px; color: var(--muted); }
.mv-old { color: var(--danger); text-decoration: line-through; }
.mv-route b { color: var(--accent); }
.mv-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* Stundenplan wählen: Favoriten */
/* Stundenplan wählen: Kacheln im Raster (Klassen nach Jahrgang), Stern klein in der Ecke */
.pk-own { width: 100%; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); color: var(--text); font: inherit; text-align: left; }
.pk-own-ic { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 7px; background: var(--accent); color: #fff; }
.pk-own-ic svg { width: 19px; height: 19px; }
.pk-own-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pk-own-t b { font-size: 15px; }
.pk-own-t small { font-size: 12.5px; color: color-mix(in srgb, var(--accent) 65%, var(--text)); font-weight: 600; }
.pk-own > svg { flex: none; width: 18px; height: 18px; color: var(--accent); }
.pk-head { font-size: 13px; font-weight: 650; color: var(--muted); margin: 18px 2px 8px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.pk-tile { position: relative; min-width: 0; }
.pk-tile .pk-main { width: 100%; min-height: 56px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px;
  padding: 9px 26px 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
@media (hover: hover) { .pk-tile .pk-main:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); } }
.pk-tile b { font-size: 15px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-tile small { font-size: 11.5px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-tile.cur .pk-main { border-color: var(--accent); background: var(--accent-soft); }
.pk-tile .pk-star { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: 6px; background: none; color: var(--muted); opacity: .45; cursor: pointer; }
.pk-star svg { width: 15px; height: 15px; }
.pk-tile .pk-star.on { color: #f5b301; opacity: 1; }
.pk-star.on svg { fill: currentColor; }
@media (hover: hover) { .pk-tile .pk-star:hover { opacity: 1; color: #f5b301; background: color-mix(in srgb, #f5b301 12%, transparent); } }
.pk-favs .pk-main { background: color-mix(in srgb, #f5b301 8%, var(--surface-2)); }
.pk-hint { font-size: 12.5px; color: var(--muted); margin: 12px 2px 0; }

/* Ungelesene Änderungen: nach Tagen gruppierte Karten */
.chg-intro { margin: 0 0 4px; }
.chg-day h3 { display: flex; align-items: baseline; gap: 8px; font-size: 15px; margin: 16px 2px 8px; }
.chg-day h3 span { font-size: 13px; font-weight: 500; color: var(--muted); }
.chg-card { --c: var(--accent); display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; color: var(--text); font: inherit;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--c-ink); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
@media (hover: hover) { .chg-card:hover { border-color: color-mix(in srgb, var(--c-ink) 45%, var(--line)); border-left-color: var(--c-ink); } }
.chg-card.cancelled .chg-title { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 70%, transparent); }
.chg-unit { flex: none; width: 42px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; padding-top: 1px; }
.chg-unit b { font-size: 15px; white-space: nowrap; }
.chg-tags s { opacity: .65; font-weight: 500; }
.chg-unit small { font-size: 11px; color: var(--muted); }
.chg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.chg-title { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.chg-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.chg-tags .st { margin: 0; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, currentColor 14%, transparent); }
.chg-note { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.chg-time { flex: none; font-size: 12px; color: var(--muted); padding-top: 3px; }
.chg-tags .st.info { color: var(--muted); }
.chg-tags .st.can, .chg-tags .st.exam { background: var(--danger); color: #fff; }
.chg-tags .st.irr { background: var(--warn); color: #fff; }
.chg-tags .st s { opacity: .75; }

/* Tagesansicht: Mitteilung des Tages über den Stunden */
.dm-wrap:empty { display: none; }
.dm-wrap { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.dm-card { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border-radius: 8px; padding: 10px 14px; }
.dm-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 4px; }
.dm-head svg { width: 17px; height: 17px; color: var(--accent); flex: none; }
.dm-body { max-height: 4.6em; overflow: hidden; line-height: 1.5; color: var(--text); font-size: 13.5px; }
.dm-body p { margin: 0 0 4px; }
.dm-card.open .dm-body { max-height: none; }
.dm-more { border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; padding: 4px 0 0; cursor: pointer; }
.dm-card .chip { margin-top: 6px; }
.dm-body > :last-child { margin-bottom: 0; }
.dm-body br:last-child, .dm-body p:empty { display: none; }

/* Stundendetails: eigene Prüfung */
.ex-own { border-left-color: var(--danger); }
.ex-own .pd-note-l { display: flex; align-items: center; gap: 6px; }
.ex-kind { background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 8px; }
.ex-own-none { color: var(--muted); font-style: italic; }

/* Seitenkopf: Hinzufügen-Knopf mit Auswahl */
.pv-add { position: relative; flex: none; }
.pv-add-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 6px; background: var(--accent-soft); color: var(--accent);
  font: inherit; font-size: 13.5px; font-weight: 700; padding: 7px 13px 7px 10px; cursor: pointer; }
@media (hover: hover) { .pv-add-btn:hover { filter: brightness(1.1); } }
.pv-add-btn:disabled { background: var(--surface-2); color: var(--muted); opacity: .6; cursor: not-allowed; filter: none; }
.pv-add-btn svg { width: 16px; height: 16px; }
.pv-add-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 180px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px; box-shadow: 0 12px 30px rgb(0 0 0 / .35); display: flex; flex-direction: column; }
.pv-add-menu[hidden] { display: none; }
.pv-add-menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--text); font: inherit; font-size: 14.5px;
  text-align: left; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
@media (hover: hover) { .pv-add-menu button:hover { background: var(--surface-2); } }
.pv-add-menu svg { width: 18px; height: 18px; color: var(--muted); }

/* Stundendetails: freie Räume bei Entfall */
.fr-box { border-left: 3px solid #22b8a6; }
.fr-group + .fr-group { margin-top: 10px; }
.fr-h { font-size: 13px; font-weight: 600; margin: 4px 0 6px; }
.fr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fr-chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 6px; padding: 4px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .fr-chip:hover { border-color: #22b8a6; color: #22b8a6; } }
.fr-box .hint { margin: 10px 0 0; }
.fr-box .spinner { margin: 8px 0; width: 18px; height: 18px; }

/* Kopfleiste Stundenplan: alles in einer Zeile; am Handy Kurzfassung, „Heute“ nur wenn nötig */
.sub-s { display: none; }
@media (max-width: 767px) {
  .sub-l { display: none; } .sub-s { display: inline; }
  .topbar .icon-btn#prev, .topbar .icon-btn#next { width: 34px; }
  .view-seg button { padding: 4px 10px; }
  .today-btn:disabled { display: none; }
  .tt-unit .tt-end::before { content: none; }
}

/* Einstellungen: Auswahlfeld in einer Zeile (z. B. Uhrzeit der Erinnerung) */
.st-select { font: inherit; font-size: 14px; font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; cursor: pointer; }

button.st-select.push-time { min-width: 64px; font-variant-numeric: tabular-nums; }
button.st-select.push-time[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }

/* Uhrzeit-Drehräder wie bei Apple (openTimeWheel) */
.tw-pop { position: fixed; z-index: 120; padding: 8px 14px; border-radius: 10px; background: color-mix(in srgb, var(--surface) 97%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  opacity: 0; transform: scale(.94); transition: opacity .16s, transform .18s cubic-bezier(.2, .9, .3, 1); }
.tw-pop.show { opacity: 1; transform: none; }
.tw-wheels { position: relative; display: flex; align-items: center; justify-content: center; gap: 2px; height: 180px; }
.tw-band { position: absolute; left: -6px; right: -6px; top: 50%; height: 36px; transform: translateY(-50%); border-radius: 7px;
  background: color-mix(in srgb, var(--text) 9%, transparent); pointer-events: none; }
.tw-col { position: relative; width: 64px; height: 180px; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain;
  padding: 72px 0; box-sizing: border-box; perspective: 420px; scrollbar-width: none; outline: none;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.tw-col::-webkit-scrollbar { display: none; }
.tw-item { height: 36px; display: grid; place-items: center; scroll-snap-align: center; font-size: 21px; font-variant-numeric: tabular-nums;
  color: var(--text); cursor: pointer; user-select: none; transform-origin: center; }
.tw-item.on { font-weight: 600; }
.tw-colon { position: relative; z-index: 1; font-size: 21px; font-weight: 600; padding-bottom: 2px; }
@media (prefers-reduced-motion: reduce) { .tw-pop { transition: none; } }

/* Eigene Auswahllisten (enhanceSelect): Knopf mit Pfeil, Glasfenster mit Einträgen und Haken */
.dd-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.dd-btn.search { display: flex; width: 100%; }
.dd-btn .dd-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn svg { flex: none; width: 16px; height: 16px; color: var(--muted); transition: transform .18s; }
.dd-btn[aria-expanded="true"] { border-color: var(--accent); }
.dd-btn[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--accent); }
.dd-btn:disabled { opacity: .55; cursor: default; }
.dd-pop { position: fixed; z-index: 120; max-width: calc(100vw - 16px); overflow-y: auto; overscroll-behavior: contain; padding: 5px;
  border-radius: 10px; background: color-mix(in srgb, var(--surface) 97%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  opacity: 0; transform: scale(.96); transition: opacity .14s, transform .16s cubic-bezier(.2, .9, .3, 1); }
.dd-pop.show { opacity: 1; transform: none; }
.dd-opt { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; white-space: nowrap; }
.dd-opt svg { flex: none; width: 17px; height: 17px; color: var(--accent); }
.dd-opt.on { font-weight: 600; color: var(--accent); }
.dd-opt:focus-visible, .dd-opt:focus { outline: none; background: color-mix(in srgb, var(--text) 8%, transparent); }
@media (hover: hover) { .dd-opt:hover { background: color-mix(in srgb, var(--text) 8%, transparent); } }
.dd-opt:disabled { opacity: .45; cursor: default; }
@media (prefers-reduced-motion: reduce) { .dd-pop, .dd-btn svg { transition: none; } }

/* Hinweis auf eine neue Version (über der Navigation) */
#update-bar { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 12px); transform: translateX(-50%) translateY(16px); opacity: 0; transition: .25s;
  z-index: 99; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 8px; max-width: calc(100vw - 32px);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; white-space: nowrap; }
#update-bar.show { opacity: 1; transform: translateX(-50%); }
#update-bar .update-go { font: inherit; border: 0; border-radius: 7px; padding: 7px 12px; background: var(--accent); color: var(--accent-on); cursor: pointer; }
#update-bar .update-go:disabled { opacity: .6; }
#update-bar .update-x { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; font-size: 18px; }
#update-bar .update-x svg { width: 18px; height: 18px; }
@media (min-width: 768px) { #update-bar { bottom: 24px; } }

/* Einstellungszeile als Link (z. B. Regeln für Nutzerinhalte) */
.st-menu > a.st-row { text-decoration: none; }
@media (hover: hover) { .st-menu > a.st-row:hover { background: var(--surface-2); } }
.st-menu > a.st-row > svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
.af-help a, .meta a, .st-note a { color: var(--accent); font-weight: 600; }

/* Kontakt zum Admin: Punkt in der Navigation, Unterhaltung */
.bottomnav button { position: relative; }
.nav-dot { position: absolute; top: 8px; left: calc(50% + 10px); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
@media (min-width: 1100px) { .nav-dot { position: static; margin-left: auto; } }
.msg-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.msg-input { resize: vertical; min-height: 44px; font: inherit; line-height: 1.4; }
.msg-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; }
.msg-b { max-width: 85%; padding: 9px 12px; border-radius: 8px; }
.msg-b.mine { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 4px; }
.msg-b.theirs { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg-t { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.msg-b small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.msg-b.mine small { text-align: right; }
.msg-closed { text-align: center; margin: 4px 0 12px; }
.msg-reply { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: flex-end; padding: 10px 0 calc(4px + env(safe-area-inset-bottom)); background: var(--surface); }
.msg-reply .search { flex: 1; }
.msg-reply .btn { flex: none; width: 48px; height: 48px; padding: 0; display: grid; place-items: center; border-radius: 8px; }
.msg-reply .btn svg { width: 20px; height: 20px; }

/* Anleitung „Als App installieren“ */
.inst-seg { margin: 0 0 14px; }
.st-menu > .inst-row { align-items: flex-start; }
.inst-n { font-size: 15px; font-weight: 800; }
.inst-row .acc-txt > b { white-space: normal; overflow: visible; }
.inst-t { display: block; font-weight: 500; line-height: 1.55; padding-top: 6px; }
.inst-t b { font-weight: 700; }
.inst-k { background: var(--surface-2); border-radius: 5px; padding: 2px 7px; font-weight: 600;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.inst-k svg { width: 15px; height: 15px; vertical-align: -2px; }

/* Doppelstunden */
.st-switch:disabled { opacity: .5; cursor: default; }

/* Fachfarben: Standardfarbe der Schule */
.sw-def { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.sw-def .sj-dot { width: 22px; height: 22px; }
.swatches.sw-grid .sw-none.sw-def-btn { font-size: 13px; font-weight: 600; }
.col-seg { margin: 0 0 14px; }

/* Vergangene Stunde: dezenter Haken unten rechts */
.past-ck { position: absolute; right: 4px; bottom: 3px; width: 11px; height: 11px; color: currentColor; opacity: .45; pointer-events: none; display: grid; }
.past-ck svg { width: 100%; height: 100%; }
.lesson:has(.marks) .past-ck { right: 10px; }
.ag-card:has(.past-ck) { position: relative; }
.ag-card .past-ck { right: 10px; bottom: 8px; width: 13px; height: 13px; }
.ag-card:has(.marks) .past-ck { right: 18px; }

/* Handy: Auswahl bei parallelen Stunden */
.lesson-pop { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
  padding: 6px; opacity: 0; transform: translateY(-4px) scale(.98); transition: opacity .15s, transform .15s; max-height: 60vh; overflow: auto; }
.lesson-pop.show { opacity: 1; transform: none; }
.lp-head { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 4px 2px; }
.lesson-pop { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
/* Einträge sehen aus wie die Kacheln im Stundenplan */
.lp-row { flex: none; display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: 0; color: var(--text); font: inherit;
  padding: 8px 24px 8px 10px; border-radius: 6px; cursor: pointer; position: relative;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-left: 3px solid var(--c-ink); transition: background .12s; }
.lp-row:active { background: color-mix(in srgb, var(--c) 28%, var(--surface)); }
@media (hover: hover) { .lp-row:hover { background: color-mix(in srgb, var(--c) 28%, var(--surface)); } }
.lp-main { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; min-width: 0; }
.lp-main b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-main .st { flex: none; font-size: 11.5px; font-weight: 700; }
.lp-row small { font-size: 12.5px; color: var(--muted); }
.lp-row .changed { color: var(--warn); font-weight: 700; }
.lp-row .lp-note { color: var(--text); opacity: .8; }
.lp-row.exam { border-left-color: var(--danger); }
.lp-row.cancelled { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--danger) 16%, var(--surface)) 0 6px, color-mix(in srgb, var(--danger) 6%, var(--surface)) 6px 12px);
  border-left-color: var(--danger); color: var(--muted); }
.lp-row.cancelled b { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--danger); }
.lp-row.cancelled .lp-meta { text-decoration: line-through; opacity: .8; }
.lp-row.room-chg { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 55%, transparent); border-left-color: var(--warn); }
.lp-row .past-ck { right: 6px; bottom: 6px; }
.lp-row:has(.marks) .past-ck { right: 12px; }

/* Unterseiten (Einstellungen, Tools): kurze Wisch-Animation beim Öffnen und Zurückgehen */
.nav-fwd { animation: nav-fwd .24s cubic-bezier(.2,.9,.3,1); }
.nav-back { animation: nav-back .24s cubic-bezier(.2,.9,.3,1); }
@keyframes nav-fwd { from { opacity: 0; transform: translateX(32px); } }
@keyframes nav-back { from { opacity: 0; transform: translateX(-32px); } }
@media (prefers-reduced-motion: reduce) { .nav-fwd, .nav-back { animation: fade .15s; } }

/* Untere Navigation (Handy): Tab-Wechsel animiert, Antippen gibt leicht nach */
@media (max-width: 767px) {
  .bottomnav button svg { transition: transform .15s; }
  .bottomnav button:active svg { transform: scale(.9); }
  .bottomnav button.nav-in svg { animation: nav-pill .32s cubic-bezier(.2,.9,.3,1.2); }
  .bottomnav button.nav-in span { animation: nav-lbl .3s ease-out; }
  .bottomnav button.nav-out svg { animation: nav-unpill .25s ease-out; }
  @keyframes nav-pill { 0% { padding-left: 2px; padding-right: 2px; background: transparent; transform: scale(.85); } 60% { transform: scale(1.06); } }
  @keyframes nav-lbl { from { opacity: .4; transform: translateY(2px); } }
  @keyframes nav-unpill { from { background: var(--accent-soft); color: var(--accent); } }
}
@media (prefers-reduced-motion: reduce) { .bottomnav button.nav-in svg, .bottomnav button.nav-in span, .bottomnav button.nav-out svg { animation: none; } }

/* Hausaufgabe im Detail: Hauptknopf + Aktionskacheln */
.hw-done-btn, .hw-move-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.hw-done-btn svg, .hw-move-btn svg { width: 19px; height: 19px; flex: none; }
.hw-move-btn + .hw-done-btn { margin-top: 8px; }
.hw-acts { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 8px; margin-top: 10px; }
.hw-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding: 12px 6px 10px;
  border: 0; border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .1s; }
.hw-act svg { width: 21px; height: 21px; color: var(--muted); transition: color .15s; }
.hw-act span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .hw-act:hover { background: color-mix(in srgb, var(--surface-2) 80%, var(--text)); } }
@media (hover: hover) { .hw-act:hover svg { color: var(--text); } }
.hw-act:active { transform: scale(.96); }
.hw-act:disabled { opacity: .6; }
.hw-act .btn-busy { font-size: 11px; }
.hw-act.danger, .hw-act.danger svg { color: var(--danger); }
.hw-act.danger.armed { background: var(--danger); color: #fff; }
.hw-act.danger.armed svg { color: #fff; }
/* Handy: Aktionskacheln in zwei Reihen, Symbol neben dem Text */
@media (max-width: 560px) {
  .hw-acts { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .hw-act { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 13px 14px; font-size: 14px; }
  .hw-act svg { width: 20px; height: 20px; flex: none; }
  .hw-act:last-child:nth-child(odd) { grid-column: span 2; }
}

/* Stundendetail: eigene Hausaufgaben als Liste zum Abhaken */
.hw-box { background: var(--surface-2); border-radius: 8px; padding: 4px 0; margin: 0 0 8px; }
.hw-box-h { display: flex; align-items: center; gap: 7px; padding: 8px 14px 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.hw-box-h svg { width: 15px; height: 15px; color: var(--accent); }
.hw-count { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; text-align: center; }
.hw-item { position: relative; display: flex; align-items: center; gap: 4px; padding: 0 6px 0 10px; }
.hw-item + .hw-item::before { content: ""; position: absolute; top: 0; left: 46px; right: 12px; border-top: 1px solid var(--line); }
.hw-ck { flex: none; display: grid; place-items: center; width: 36px; height: 44px; border: 0; background: none; cursor: pointer; padding: 0; color: transparent; }
.hw-ck::before { content: ""; grid-area: 1 / 1; width: 20px; height: 20px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 70%, var(--muted)); box-sizing: border-box; transition: background .15s, border-color .15s, transform .15s; }
.hw-ck svg { grid-area: 1 / 1; width: 12px; height: 12px; position: relative; transform: scale(.4); opacity: 0; transition: transform .2s cubic-bezier(.2,.9,.3,1.4), opacity .15s; }
@media (hover: hover) { .hw-ck:hover::before { background: var(--accent-soft); } }
.hw-ck:active::before { transform: scale(.88); }
.hw-item.done .hw-ck::before { background: var(--accent); border-color: var(--accent); }
.hw-item.done .hw-ck svg { color: var(--accent-on); opacity: 1; transform: none; }
.hw-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; padding: 11px 4px; cursor: pointer; }
.hw-t { font-size: 15px; font-weight: 600; line-height: 1.35; transition: color .15s; }
.hw-body .hw-note { margin-top: 0; }
.hw-item.done .hw-t { color: var(--muted); text-decoration: line-through; }
.hw-chev { flex: none; display: grid; color: var(--muted); opacity: .7; }
.hw-chev svg { width: 18px; height: 18px; }

/* Hausaufgabe/Prüfung im Detail: Kopfkarte */
.dc { background: var(--surface-2); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.dc-head { display: flex; align-items: center; gap: 12px; }
.dc-when { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dc-when b { font-size: 17px; font-weight: 700; }
.dc-when small { font-size: 13.5px; color: var(--muted); }
.dc-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.dc-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 6px; background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.dc-pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.dc-pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); }
.dc-pill.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 15%, transparent); }
.dc-pill.solid { background: var(--danger); color: #fff; }
.dc-body { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.dc-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.dc-text { font-size: 18px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.dc.done .dc-text { color: var(--muted); text-decoration: line-through; }
.dc-note { margin-top: 8px; font-size: 14px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-created { text-align: center; font-size: 12px; color: var(--muted); margin: 18px 0 0; }

/* „Zur Stunde“: angesteuerte Stunde kurz pulsierend umrandet */
.lesson.flash, .ag-card.flash { outline: 2.5px solid transparent; outline-offset: 2px; animation: flash-ring 1.1s ease-in-out 3; }
@keyframes flash-ring { 0%, 100% { outline-color: transparent; } 45%, 60% { outline-color: var(--c, var(--accent)); } }
@media (prefers-reduced-motion: reduce) { .lesson.flash, .ag-card.flash { animation: none; outline-color: var(--c, var(--accent)); } }

/* Hausaufgaben: Stunde entfällt / Vertretung */
.hw-chg .hw-late-tag { color: var(--warn); }
.hw-sub-info { flex-basis: 100%; padding: 0 16px 10px 50px; margin-top: -4px; font-size: 12.5px; color: var(--muted); }
.hw-warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; margin: -4px 0 12px; font-size: 14px;
  background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.hw-warn.bad { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.hw-box-warn { margin: 2px 14px 4px; padding: 8px 10px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.hw-box-move { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 7px; background: var(--accent-soft); color: var(--accent); cursor: pointer; }
.hw-box-move svg { width: 19px; height: 19px; }
.hw-box-move .btn-busy { font-size: 0; }

/* Fehler beim Laden des Plans: Aktionen */
.err-acts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; max-width: 420px; }
.err-acts .btn { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.err-acts .btn small { font-size: 12px; font-weight: 500; opacity: .8; }
.err-acts .btn:disabled { opacity: .6; cursor: default; }

/* Raumplan: Änderungen am Raum (neu hier, verlegt, Klasse nicht dabei) */
.lesson .chg-tag { color: var(--warn); font-weight: 700; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson .can-tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
s.dropped, .lesson s.dropped { color: var(--warn); text-decoration: line-through; text-decoration-thickness: 2px; opacity: .9; }
.lesson.room-chg { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 55%, transparent); }
.pd-val del { text-decoration-thickness: 2px; }
.ag-card.room-chg { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--warn) 60%, transparent); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }

/* Geänderte Stunde: Ausrufezeichen an der Stelle des Hakens */
.past-ck.chg-ck { place-items: center; width: 13px; height: 13px; border-radius: 50%; background: var(--warn); color: #fff; opacity: 1; font-size: 9.5px; font-weight: 900; line-height: 1; font-style: normal; }
.ag-card .past-ck.chg-ck { width: 16px; height: 16px; font-size: 11px; }
.past-ck.chg-ck.can { background: var(--danger); }

/* Punkt über dem Tag: rot = Ausfall, orange = Änderung; leuchtend = neu, sonst gedämpft */
.ds-day i.dd, .tt-dh i.dd { width: 6px; height: 6px; opacity: .45; }
.ds-day i.dd.can, .tt-dh i.dd.can { background: var(--danger); }
.ds-day i.dd.chg, .tt-dh i.dd.chg { background: var(--warn); }
.ds-day i.dd.new, .tt-dh i.dd.new { opacity: 1; width: 7px; height: 7px; box-shadow: 0 0 0 2px var(--bg), 0 0 8px 1px currentColor; }
.ds-day i.dd.can.new, .tt-dh i.dd.can.new { color: var(--danger); }
.ds-day i.dd.chg.new, .tt-dh i.dd.chg.new { color: var(--warn); }

/* Stundendetail: parallele Stunden im eigenen Plan */
.pd-par { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 12px; }
.pd-par-h { display: flex; align-items: center; gap: 7px; padding: 4px 2px 2px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pd-par-h svg { width: 15px; height: 15px; color: var(--accent); }
.pd-par-h .hw-count { margin-left: auto; }
.lp-row.off { opacity: .6; border-left-style: dashed; }
@media (hover: hover) { .lp-row.off:hover { opacity: .85; } }
.st.off { color: var(--muted); }
.lp-pills { flex: none; display: flex; gap: 8px; align-items: baseline; }
.lp-pills .st { font-size: 11.5px; font-weight: 700; }
.pd-val .pd-long { font-size: 12px; font-weight: 500; color: var(--muted); }
.room-note .rn-hint { display: block; margin-top: 1px; opacity: .85; }
/* Popup und parallele Stunden: genug Platz, also nur der lange Name */
.lp-row .nm-s { display: none; }

/* Einstellungen durchsuchen */
.st-find { position: relative; display: flex; align-items: center; margin: 0 0 14px; }
.st-find > svg { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.st-find input { width: 100%; height: 44px; padding: 0 40px 0 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; outline: none; transition: border-color .15s, background .15s; -webkit-appearance: none; appearance: none; }
.st-find input::-webkit-search-cancel-button { display: none; }
.st-find input:focus { border-color: var(--accent); background: var(--surface); }
.st-find-x { position: absolute; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
@media (hover: hover) { .st-find-x:hover { color: var(--text); background: var(--surface-2); } }
.st-find-x[hidden] { display: none; }
#st-res .sj-dot { width: 14px; height: 14px; border-radius: 50%; display: block; }
/* Treffer auf der Zielseite kurz hervorheben */
.st-flash { animation: st-flash 1.6s ease-out; border-radius: 8px; }
@keyframes st-flash { 0%, 30% { box-shadow: inset 0 0 0 2px var(--accent); background-color: var(--accent-soft); } 100% { box-shadow: inset 0 0 0 2px transparent; } }

/* Volle Namen erzwingen: immer der lange Name, Überlauf blendet zum Ende hin aus statt „…“ */
.lesson.force .nm-l { display: inline; }
.lesson.force .nm-s { display: none; }
.lesson.force .subj, .lesson.force .line { text-overflow: clip; }
.lesson.force .fade { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent); }
.lesson.force.narrow .fade { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 12px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 12px), transparent); }

/* ---------- Willkommens-Animation (nach Login/Registrierung) ---------- */
.welcome { position: fixed; inset: 0; z-index: 9500; background: var(--bg); color: var(--text); overflow: hidden;
  display: flex; align-items: center; justify-content: center; transition: opacity .45s ease, visibility .45s; }
.welcome.out { opacity: 0; visibility: hidden; }
.welcome.out .wl-mid { transform: scale(1.06); }
.wl-tiles { position: absolute; inset: 0; max-width: 560px; margin: 0 auto; }
.wl-tiles i { position: absolute; border-radius: 6px; transform: translate(-50%, -50%) rotate(var(--r));
  background: hsl(var(--h) 72% 62% / .22); border-left: 4px solid hsl(var(--h) 72% 58%);
  animation: wl-tile .55s var(--d) cubic-bezier(.3, 1.5, .5, 1) both, wl-float 4.5s calc(var(--d) + .6s) ease-in-out infinite alternate; }
.wl-mid { position: relative; text-align: center; padding: 0 24px; transition: transform .45s ease; }
.wl-logo { width: 96px; height: 96px; overflow: visible; filter: drop-shadow(0 10px 26px rgba(214, 64, 127, .35)); }
.wl-bg { fill: var(--accent); transform-box: fill-box; transform-origin: center; animation: wl-pop .5s .15s cubic-bezier(.3, 1.4, .5, 1) both; }
.wk { transform-box: fill-box; transform-origin: center; animation: wl-in .6s cubic-bezier(.25, 1.3, .5, 1) both; }
.wk:nth-child(1) { animation-delay: .35s; } .wk:nth-child(2) { animation-delay: .45s; }
.wk:nth-child(3) { animation-delay: .55s; } .wk:nth-child(4) { animation-delay: .65s; }
.welcome h2 { margin: 22px 0 8px; font-size: 26px; line-height: 1.2; letter-spacing: -.01em; animation: wl-up .5s .8s ease both; }
.welcome h2 span { color: var(--accent); }
.welcome p { margin: 0 auto; max-width: 290px; color: var(--muted); font-size: 15px; animation: wl-up .5s 1s ease both; }
.welcome.is-new h2 { animation-delay: 1s; } .welcome.is-new p { animation-delay: 1.25s; }
.welcome.is-new .wk { animation-duration: .7s; }
@keyframes wl-tile { from { opacity: 0; transform: translate(-50%, -50%) rotate(var(--r)) scale(.3); } }
@keyframes wl-float { to { transform: translate(-50%, calc(-50% - 8px)) rotate(calc(var(--r) * -1)); } }
@keyframes wl-pop { from { transform: scale(.4); opacity: 0; } }
@keyframes wl-in { from { transform: translate(var(--tx), var(--ty)) scale(.4); opacity: 0; } }
@keyframes wl-up { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .welcome *, .welcome { animation: none !important; } }

/* ---------- Bilder zu Hausaufgaben/Prüfungen ---------- */
.att:empty { display: none; }
.att { margin: 4px 0 14px; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.att-th, .att-add { aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); padding: 0;
  display: grid; place-items: center; cursor: pointer; color: var(--muted); position: relative; }
.att-th img { width: 100%; height: 100%; object-fit: cover; display: block; animation: att-in .25s ease; }
.att-th:empty::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.08) 50%, transparent 70%); background-size: 200% 100%; animation: att-shimmer 1.2s linear infinite; }
.att-err { color: var(--danger); font-weight: 800; }
.att-add { border-style: dashed; border-width: 1.5px; align-content: center; gap: 2px; font-size: 12.5px; font-weight: 600; }
.att-add svg { width: 22px; height: 22px; }
.att-add.busy { pointer-events: none; }
.att-add .spinner { transform: scale(.6); }
.att-hint { margin: 8px 0 0; font-size: 12.5px; }
/* Bilder im Anlege-Formular (noch nicht hochgeladen) */
.att-pick .att-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); max-width: 420px; }
.att-new { cursor: default; }
.att-new img { width: 100%; height: 100%; object-fit: cover; display: block; animation: att-in .25s ease; }
.att-new.off img { opacity: .35; filter: grayscale(1); }
.att-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0; background: rgba(10, 12, 24, .7);
  color: #fff; display: grid; place-items: center; cursor: pointer; }
.att-x svg { width: 13px; height: 13px; }
@media (hover: hover) { .att-x:hover { background: var(--danger); } }
.att-view { position: fixed; inset: 0; z-index: 200; background: rgba(5, 6, 14, .94); display: flex; flex-direction: column; animation: att-in .2s ease; touch-action: pan-y pinch-zoom; }
.att-bar { display: flex; align-items: center; gap: 6px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; color: #fff; }
.att-pos { flex: 1; font-size: 14px; font-weight: 600; opacity: .8; }
.att-btn { width: 42px; height: 42px; border-radius: 8px; border: 0; background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; cursor: pointer; }
.att-btn svg { width: 20px; height: 20px; }
.att-btn.armed { background: var(--danger); }
.att-stage { flex: 1; min-height: 0; position: relative; }
/* absolut + margin:auto: das Bild passt immer ganz hinein (im Grid griff max-height nicht, hohe Fotos liefen auf Tablets unten heraus) */
.att-stage img { position: absolute; inset: 0 12px calc(16px + env(safe-area-inset-bottom)); margin: auto; max-width: calc(100% - 24px); max-height: calc(100% - 16px - env(safe-area-inset-bottom)); border-radius: 6px; }
.att-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(10, 12, 24, .6); box-shadow: 0 2px 10px rgba(0,0,0,.3); color: #fff; display: grid; place-items: center; cursor: pointer; }
.att-nav svg { width: 22px; height: 22px; }
.att-nav.prev { left: 10px; } .att-nav.next { right: 10px; }
@media (hover: hover) { .att-th:hover, .att-add:hover { border-color: var(--accent); } .att-btn:hover { background: rgba(255,255,255,.2); } .att-nav:hover { background: rgba(10, 12, 24, .8); } }
@keyframes att-in { from { opacity: 0; } }
@keyframes att-shimmer { to { background-position: -200% 0; } }
.att-meter { display: block; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 6px 0 5px; max-width: 220px; }
.att-meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.att-meter.warn i { background: var(--warn); }
.att-meter.full i { background: var(--danger); }
/* Fach-Farbpunkte: feiner Rand, damit weiße Fächer auf hellem Grund sichtbar bleiben */
.pd-dot, .sp-dot, .sj-dot, .hw-gdot { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent); }
