/* Lehrerpult: Grundgestaltung */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/montserrat-latin-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/montserrat-latin-ext-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f4f2ed;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --surface-3: #f0ede6;
  --border: #e3dfd5;
  --border-strong: #cfc9bc;
  --text: #1c2430;
  --text-2: #586371;
  --text-3: #616a76; /* blasse Schrift: mindestens 4,5:1 auf allen Flächen */
  --accent: #1f5f73;
  --accent-strong: #174a59;
  --accent-soft: #e2eef1;
  --accent-text: #ffffff;
  /* Schrift in diesen Farben auch auf ihren hellen Flächen (--*-soft) mindestens 4,5:1 */
  --now: #c2410c;
  --now-soft: #fff1e8;
  --danger: #c0262d;
  --danger-soft: #fdeceb;
  --success: #286b44;
  --success-soft: #e7f4ec;
  --warn: #855c00;
  --warn-soft: #fdf4dc;
  --ai: #6b4fd8;
  --on-color: #ffffff; /* Schrift und Symbole auf vollen Flächen in --danger, --success, --warn, --now */
  --backdrop: rgba(15, 20, 26, .45); /* hinter Dialogen; --backdrop-soft hinter Panel und Blatt */
  --backdrop-soft: rgba(15, 20, 26, .3);
  --modal-ring: transparent; /* dunkel: Rand, damit sich Dialoge von der Seite abheben */
  --tint-lift: 0%; /* dunkel: Markenfarben auf getönter Fläche aufhellen (Datei-Symbole) */
  --mark-red: #d63a3a;
  --mark-green: #2f9e44;
  --mark-magenta: #b23cbf;
  --mark-yellow: #c99a00;
  --shadow-sm: 0 1px 2px rgba(28, 36, 48, .06);
  --shadow: 0 1px 2px rgba(28, 36, 48, .06), 0 4px 16px rgba(28, 36, 48, .06);
  --shadow-lg: 0 10px 40px rgba(28, 36, 48, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Früher eine eigene Schulschrift, jetzt überall Montserrat */
  --font-kids: var(--font);
  --sidebar: 236px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151a;
    --surface: #191e25;
    --surface-2: #1e242c;
    --surface-3: #252c35;
    --border: #2b333d;
    --border-strong: #3b4552;
    --text: #e7ecf1;
    --text-2: #a6b0bb;
    --text-3: #939ca8;
    --accent: #5fb0c6;
    --accent-strong: #7cc4d7;
    --accent-soft: #1d3540;
    --accent-text: #0d1b20;
    --now: #ff8a3d;
    --now-soft: #3a2416;
    --danger: #ff6b6b;
    --danger-soft: #3a1d1f;
    --success: #5cc488;
    --success-soft: #183126;
    --warn: #e8b84a;
    --warn-soft: #34290f;
    --ai: #a996ff;
    --on-color: #0d1b20;
    --backdrop: rgba(0, 0, 0, .62);
    --backdrop-soft: rgba(0, 0, 0, .5);
    --modal-ring: var(--border-strong);
    --tint-lift: 35%;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11151a;
  --surface: #191e25;
  --surface-2: #1e242c;
  --surface-3: #252c35;
  --border: #2b333d;
  --border-strong: #3b4552;
  --text: #e7ecf1;
  --text-2: #a6b0bb;
  --text-3: #939ca8;
  --accent: #5fb0c6;
  --accent-strong: #7cc4d7;
  --accent-soft: #1d3540;
  --accent-text: #0d1b20;
  --now: #ff8a3d;
  --now-soft: #3a2416;
  --danger: #ff6b6b;
  --danger-soft: #3a1d1f;
  --success: #5cc488;
  --success-soft: #183126;
  --warn: #e8b84a;
  --warn-soft: #34290f;
  --ai: #a996ff;
  --on-color: #0d1b20;
  --backdrop: rgba(0, 0, 0, .62);
  --backdrop-soft: rgba(0, 0, 0, .5);
  --modal-ring: var(--border-strong);
  --tint-lift: 35%;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word; /* sehr lange Wörter und Links nie über den Rand */
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .6em; }
a { color: var(--accent); }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; background: var(--surface-3); padding: .1em .35em; border-radius: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.boot { display: grid; place-items: center; min-height: 100vh; color: var(--text-3); }
/* Ladehinweis aus dem HTML erst nach einer Sekunde: Lädt die Seite schnell (der Normalfall), blitzt er nicht kurz auf */
.boot-wait { animation: boot-wait .2s 1s both; }
@keyframes boot-wait { from { opacity: 0; } }
/* Besuch ohne Anmeldung (View::guestBoot()): Bis die öffentliche Seite steht, zeigt das HTML schon ihren Kopf und ihre
   Farbfläche, auf der Startseite ungefähr so hoch wie deren Kopf; der Hinweis steht in der Mitte des Fensters */
.boot-hero { min-height: max(100vh, 1040px); }
.boot-guest { position: fixed; inset: 0; z-index: 1; min-height: 0; pointer-events: none; }
:is(.start-home, .signin) .boot-guest { color: rgba(255, 255, 255, .8); }
@media (scripting: none) { .boot-wait { display: none; } }

/* ---------------------------------------------------------------- Layout */

.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px 12px; /* links bündig mit den Symbolen der Seiten und dem Titel «Heute» */ font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.brand-logo { width: 30px; height: 30px; flex: none; border-radius: 8px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px;
  color: var(--text-2); text-decoration: none; font-weight: 520;
}
.nav-link:hover { background: var(--surface-3); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-strong); }
.nav-link svg { width: 19px; height: 19px; flex: none; }
/* «Suchen» und daneben «Neu» (+) in einer Zeile */
.nav-tools { display: flex; align-items: stretch; gap: 6px; margin: 0 0 18px; /* mit den 2 px über «Heute» 20 px: die Suche wirkt als eigener Bereich, nicht als Teil der ersten Gruppe */ }
.nav-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 10px 8px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text-3); font: inherit; font-size: .92rem; cursor: pointer; text-align: left; }
.nav-search:hover { border-color: var(--accent); color: var(--text-2); }
.nav-search svg { width: 17px; height: 17px; flex: none; }
.nav-search kbd, .search-close kbd { font: inherit; font-size: .72rem; padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text-3); }
/* Bereiche der Seitenleiste: kleiner Titel über den Seiten (wie die Gruppen der Suche) */
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-group-title { padding: 12px 12px 3px; color: var(--text-3); font-size: .72rem; font-weight: 700; letter-spacing: .05em; line-height: 1.2; text-transform: uppercase; }
.nav-tools + .nav-group > .nav-group-title { padding-top: 2px; }
/* «Neu»: öffnet das Menü für alles Neue (newmenu.js), auch mit Taste N */
.nav-new { flex: none; width: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: var(--accent); color: var(--accent-text); cursor: pointer; }
.nav-new:hover, .nav-new[aria-expanded="true"] { background: var(--accent-strong); }
.nav-new svg { width: 19px; height: 19px; }

/* Mitteilungen: Glocke mit Zahl (Seitenleiste, Handy-Leiste) und die Liste dazu */
.bell { position: relative; }
.nav-bell { margin-left: auto; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--text-2); cursor: pointer; }
.nav-bell:hover, .nav-bell[aria-expanded="true"] { background: var(--surface-3); color: var(--text); }
.bell.has-unread { color: var(--accent-strong); }
.bell-count { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: var(--on-color); font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.bell-panel { position: fixed; z-index: 10040; width: min(380px, calc(100vw - 16px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; animation: sb-in .12s ease-out; }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--border); }
.bell-head > strong { flex: 1 0 auto; }
/* kleines Handy: «Alle gelesen» nur mit Häkchen, sonst bricht «Mitteilungen» um */
@media (max-width: 360px) { .bell-all-lbl { display: none; } }
.bell-list { overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.bell-item { flex: 1 1 auto; min-width: 0; display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 10px; color: inherit; text-decoration: none; }
/* Zeile mit «×» zum Löschen: am Computer beim Darüberfahren, mit Finger immer (blass) */
.bell-row { position: relative; display: flex; align-items: flex-start; border-radius: 10px; }
.bell-row:hover { background: var(--surface-3); }
.bell-row:hover > a.bell-item:hover { background: none; }
.bell-del { flex: none; width: 30px; height: 30px; margin: 6px 4px 0 -4px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--text-3); cursor: pointer; opacity: 0; }
.bell-row:hover > .bell-del, .bell-del:focus-visible { opacity: 1; }
.bell-del:hover, .bell-del:focus-visible { background: var(--surface-2); color: var(--danger); }
@media (hover: none) { .bell-del { width: 36px; height: 36px; margin-top: 3px; opacity: .7; } }
a.bell-item:hover { background: var(--surface-3); }
.bell-item small { display: block; margin-top: 2px; color: var(--text-2); }
.bell-title { font-weight: 550; }
.bell-item.unread .bell-title { font-weight: 700; }
.bell-dot { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; }
.bell-item.unread .bell-dot { background: var(--accent); }
.bell-empty { margin: 8px 10px; }
/* Ohne KI: eine Zeile mit «KI einrichten» statt Fehlermeldungen */
.ai-setup { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--text-2); font-size: .9rem; line-height: 1.45; }
.ai-setup > .icon { flex: none; margin-top: 2px; color: var(--accent-strong); }
.ai-setup a { font-weight: 650; white-space: nowrap; }
.ss-ai > .ai-setup { padding: 0; background: none; }
/* Hinweis auf einer Seite (aiSetupLine({ dismiss })): eine schmale Zeile mit Rahmen statt Fläche, × blendet sie aus */
.ai-setup.ai-hint { align-items: center; padding: 4px 4px 4px 10px; border: 1px solid var(--border); background: none; font-size: .86rem; }
.ai-setup.ai-hint > .icon { margin-top: 0; }
.ai-setup.ai-hint > span { flex: 1; min-width: 0; }
.ai-hint-close { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--text-3); cursor: pointer; }
.ai-hint-close:hover { background: var(--surface-3); color: var(--text); }
@media (pointer: coarse) { .ai-hint-close { width: 40px; height: 40px; } }
/* KI-Guthaben knapp (aisetup.js → aiLowLine()): wie die Zeile «KI einrichten», in den Farben eines Hinweises */
.ai-setup.ai-low, .ss-ai > .ai-setup.ai-low { padding: 10px 12px; background: var(--warn-soft); }
.ai-setup.ai-low > .icon { color: var(--warn); }
.nav-spacer { flex: 1; }
/* Einstellungen, Hilfe und Support als Symbole nebeneinander; die Zahl neuer Antworten als kleiner Punkt am Symbol */
.nav-icons { display: flex; gap: 4px; }
.nav-icons .nav-link { position: relative; flex: 1; justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
.nav-icons .nav-count { position: absolute; top: 2px; right: calc(50% - 20px); margin: 0; min-width: 16px; padding: 0 4px; font-size: .64rem; box-shadow: 0 0 0 2px var(--surface); }
.nav-user { padding: 12px 12px 0; /* unten nichts: «Abmelden» bringt seinen eigenen Rand mit */ font-size: .85rem; color: var(--text-3); border-top: 1px solid var(--border); margin-top: 8px; }
.nav-user strong { display: block; color: var(--text-2); font-weight: 600; }
.nav-email { display: block; overflow-wrap: anywhere; line-height: 1.35; }
/* niedrige Fenster (Tablet quer, kleiner Laptop): Seitenleiste dichter, damit «Abmelden» ohne Scrollen sichtbar bleibt */
@media (min-width: 861px) and (max-height: 940px) {
  .sidebar, .nav-group { gap: 2px; }
  .sidebar { padding-top: 12px; padding-bottom: 10px; }
  .brand { padding-bottom: 8px; }
  .nav-tools { margin-bottom: 10px; }
  .nav-link { padding-top: 6px; padding-bottom: 6px; }
  .nav-group-title { padding-top: 8px; padding-bottom: 2px; }
  .nav-user { padding-top: 6px; padding-bottom: 0; margin-top: 4px; }
}
/* noch niedriger (z. B. Laptop mit 1920 × 1080 und Skalierung 125 %) */
@media (min-width: 861px) and (max-height: 760px) {
  .sidebar { padding-top: 8px; padding-bottom: 6px; }
  .brand { padding-top: 0; padding-bottom: 4px; }
  .nav-tools { margin-bottom: 6px; }
  .nav-link { padding-top: 5px; padding-bottom: 5px; }
  .nav-group-title { padding-top: 6px; padding-bottom: 1px; }
  .nav-user { padding-top: 4px; padding-bottom: 0; }
}
/* ganz niedrig (Laptop mit 1366 × 768): Zeilen enger, die E-Mail nur beim Darüberfahren */
@media (min-width: 861px) and (max-height: 700px) {
  .nav-search { padding-top: 6px; padding-bottom: 6px; }
  .nav-link { padding-top: 4px; padding-bottom: 4px; }
  .nav-email { display: none; }
}
@media (min-width: 861px) and (max-height: 940px) and (pointer: coarse) { .sidebar .nav-link { min-height: 40px; } }
/* Tablet quer (z. B. 1024 × 768): etwas kleinere Zeilen und ohne E-Mail, damit «Abmelden» ohne Scrollen sichtbar bleibt */
@media (min-width: 861px) and (max-height: 800px) and (pointer: coarse) { .sidebar .nav-link { min-height: 36px; } .nav-email { display: none; } }

/* rechte Spalte: die Seite und darunter die Fusszeile, bei kurzen Seiten unten am Fenster */
.main-col { display: flex; flex-direction: column; min-width: 0; }
.main { flex: 1 0 auto; min-width: 0; padding: 24px clamp(16px, 3vw, 40px) 36px; /* oben 24 px: der Titel steht mittig auf der Höhe des Logos */ max-width: 1760px; width: 100%; } /* auf grossen Bildschirmen die Breite nutzen */
.app-foot { max-width: 1760px; width: 100%; padding: 0 clamp(16px, 3vw, 40px) 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; text-align: center; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); margin-top: 4px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: 0 0 2px -6px; font-size: .85rem; color: var(--text-2); }
.crumbs a { color: var(--text-2); text-decoration: none; padding: 2px 6px; border-radius: 6px; }
.crumbs a:hover { background: var(--surface-3); color: var(--text); }
.crumbs [aria-current] { padding: 2px 6px; }
.crumbs > .icon { color: var(--text-3); }
/* Handy: die aktuelle Seite steht schon als Titel darunter, der Pfad bleibt so in einer Zeile */
@media (max-width: 640px) { .crumbs > [aria-current], .crumbs > .icon:has(+ [aria-current]) { display: none; } }
.page-head.plan-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-actions .btn { white-space: nowrap; } /* nie zweizeilig («Neue Runde» bei 360 px) */
/* Kopf einer Runde der Elterngespräche auf dem Handy: «Link für alle», «Einladungen» und «…» in einer Zeile, sehr schmal
   «Einladungen» nur mit Symbol (der Name bleibt für Bildschirmleser) */
@media (max-width: 640px) {
  .pm-head .page-actions { flex-wrap: nowrap; gap: 6px; }
  .pm-head .page-actions .btn:not(.icon-only) { padding-left: 11px; padding-right: 11px; }
}
@media (max-width: 340px) { .page-head.pm-head > .page-actions .btn.pm-invite { font-size: 0; gap: 0; min-width: 36px; padding: 0; } }
/* Handy: Kopf der Seite schlank. Titel und Aktionen in einer Zeile (kompakte Knöpfe), darunter der Untertitel in einer
   Zeile; ein Untertitel, der nur erklärt (.sub-note), fällt weg. Der Pfad (.crumbs) steht darüber. Seiten mit vielen oder
   breiten Aktionen (.ph-stack, Leiste der Fächer- und Terminansicht) setzen sie in eine eigene Zeile darunter. Teile von
   Beschriftungen nur am Computer (.lbl-wide, mit .ph-icon bleibt das Symbol) bzw. nur auf dem Handy (.lbl-narrow) */
@media (max-width: 640px) {
  .page-head {
    display: grid; grid-template-columns: minmax(min-content, 1fr) auto; grid-template-areas: "trail trail" "title acts" "sub sub";
    align-items: center; gap: 0 10px; margin-bottom: 14px;
  }
  .page-head > div:first-child { display: contents; }
  .page-head .crumbs { grid-area: trail; }
  /* so hoch wie die Knöpfe daneben: der Titel steht mit und ohne Knöpfe gleich hoch */
  .page-head h1 { grid-area: title; font-size: 1.3rem; min-height: 36px; display: flex; align-items: center; }
  /* width 0 und min-width 100 %: Der lange Untertitel macht die Spalte des Titels nicht breiter (sonst brechen die Aktionen um) */
  .page-head .sub { grid-area: sub; width: 0; min-width: 100%; margin-top: 2px; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .page-head .sub:has(> .sub-note) { display: none; }
  .page-head > .page-actions { grid-area: acts; justify-content: flex-end; gap: 4px; }
  .page-head > .page-actions .btn, .page-head > .page-actions .select { min-height: 36px; }
  .page-head > .page-actions .btn { padding: 5px 12px; font-size: .9rem; }
  .page-head > .page-actions .btn:is(.icon-only, .ph-icon) { min-width: 36px; padding: 0; }
  .page-head:is(.ph-stack, .ov-head.editing), .page-head:has(> .page-actions > .subject-nav) { grid-template-areas: "trail trail" "title title" "sub sub" "acts acts"; }
  .page-head:is(.ph-stack, .ov-head.editing) > .page-actions, .page-head > .page-actions:has(> .subject-nav) { justify-content: flex-start; margin-top: 10px; }
  .lbl-wide { display: none; }
}
@media (min-width: 641px) { .lbl-narrow { display: none; } }

.bottom-nav, .more-sheet, .m-top { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 4px 16px 24px; }
  /* Kopfzeile: bleibt beim Scrollen oben wie die Leiste unten. Links das Logo, ist der Titel der Seite weggescrollt, an
     seiner Stelle der Titel (.titled, app.js → markTop()); rechts die Glocke, «Suchen» und «Neu». Oben liegt sie auf der
     Seite, gescrollt mit Fläche und Linie (.scrolled). Was auf der Seite oben haftet (.day-tabs) oder hingescrollt wird, bleibt unter ihr */
  :root { --m-top-h: calc(52px + env(safe-area-inset-top)); }
  html:has(.m-top) { scroll-padding-top: calc(var(--m-top-h) + 8px); scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .m-top {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: var(--m-top-h);
    padding: env(safe-area-inset-top) 12px 0 16px; background: var(--bg); border-bottom: 1px solid transparent;
    transition: background-color .2s, border-color .2s;
  }
  .m-top.scrolled {
    background: color-mix(in srgb, var(--bg) 95%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom-color: var(--border);
  }
  .m-top-lead { position: relative; flex: 1; min-width: 0; align-self: stretch; }
  .m-top-brand, .m-top-title { position: absolute; inset: 0; transition: opacity .2s, transform .2s, visibility .2s; -webkit-tap-highlight-color: transparent; }
  .m-top-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
  .m-top-brand .brand-logo { width: 28px; height: 28px; }
  .m-top-title {
    display: block; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 1.02rem; font-weight: 650;
    line-height: 52px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
    opacity: 0; visibility: hidden; transform: translateY(8px);
  }
  .m-top.titled .m-top-brand { opacity: 0; visibility: hidden; transform: translateY(-8px); }
  .m-top.titled .m-top-title { opacity: 1; visibility: visible; transform: none; }
  /* «Ohne Netz» unter der Kopfzeile, die Seite rückt darunter */
  body:has(.m-top) .offline-pill { top: calc(var(--m-top-h) + 6px); }
  body:has(> .offline-pill):not(:has(.offline-banner)) .main { padding-top: 48px; }
  .m-top-btn {
    position: relative; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border);
    border-radius: 50%; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .m-top-btn:active, .m-top-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-strong); }
  .m-top-btn svg { width: 19px; height: 19px; }
  .m-top-btn.has-unread { color: var(--accent-strong); }
  .m-top-btn .bell-count { top: -3px; right: -3px; }
  /* «Neu» als Hauptknopf der Zeile */
  .m-top-new { border-color: transparent; background: var(--accent); color: var(--accent-text); }
  .m-top-new:active, .m-top-new[aria-expanded="true"] { background: var(--accent-strong); color: var(--accent-text); }
  /* Platz für die Handy-Leiste unten */
  .app-foot { padding: 0 16px calc(88px + env(safe-area-inset-bottom)); }
  /* schmal: die Version in einer eigenen Zeile, darunter die Links */
  @media (max-width: 560px) { .app-foot-version { flex-basis: 100%; } }
  .bottom-nav {
    display: flex; gap: 2px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 5px 3px calc(5px + env(safe-area-inset-bottom));
  }
  /* Symbol und darunter der Name in gleich breiten Feldern; die aktive Seite bekommt eine Pille hinter dem Symbol. Ein langer
     Name («Stundenplan») darf ein paar Pixel über sein Feld hinaus, die Namen daneben sind kürzer */
  .bottom-nav a, .bottom-nav button {
    flex: 1 1 0; min-width: 0; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 0; border: 0; background: none; color: var(--text-3); cursor: pointer; text-decoration: none;
    font: inherit; -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav svg { width: 22px; height: 22px; flex: none; padding: 3px 14px; box-sizing: content-box; border-radius: 999px; transition: background-color .15s; }
  .bn-lbl { max-width: calc(100% + 10px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
  .bottom-nav a.active, .bottom-nav button.active, .bottom-nav button[aria-expanded="true"] { color: var(--accent-strong); }
  .bottom-nav a.active svg, .bottom-nav button.active svg, .bottom-nav button[aria-expanded="true"] svg { background: var(--accent-soft); }
  /* schmal: Felder nach Inhalt, damit «Stundenplan» nicht an «Übersicht» stösst */
  @media (max-width: 380px) { .bottom-nav a, .bottom-nav button { flex: 1 1 auto; } }
  @media (max-width: 340px) { .bottom-nav { padding-left: 1px; padding-right: 1px; } .bottom-nav svg { padding: 3px 10px; } .bn-lbl { font-size: 9px; } }
  .more-sheet:not([hidden]) {
    display: flex; flex-direction: column; position: fixed; right: 8px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 41;
    min-width: 210px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  }
  .more-sheet a, .more-sheet button { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: 9px; background: none; color: var(--text); text-decoration: none; font: inherit; font-weight: 550; cursor: pointer; text-align: left; }
  .more-sheet a:hover, .more-sheet button:hover { background: var(--surface-3); }
  .more-sheet a.active { background: var(--accent-soft); color: var(--accent-strong); }
  .more-sheet .more-logout { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 9px 9px; }
  .more-sheet svg { width: 19px; height: 19px; flex: none; color: var(--text-3); }
  h1 { font-size: 1.3rem; }
}

/* ------------------------------------------------------------- Bausteine */

.icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 560; cursor: pointer;
  text-decoration: none; white-space: nowrap; line-height: 1.3; min-height: 38px;
  transition: background .12s, border-color .12s, box-shadow .12s;
  max-width: 100%;
}
/* auf schmalen Bildschirmen dürfen lange Knopf-Beschriftungen umbrechen statt über den Rand zu laufen */
@media (max-width: 640px) { .btn { white-space: normal; text-align: center; } }
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ai { background: linear-gradient(135deg, #6b4fd8, #1f8fae); border: 0; color: #fff; }
.btn.ai:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: .88rem; }
.btn.icon-only { padding: 7px; min-width: 38px; }
.btn.sm.icon-only { padding: 5px; min-width: 32px; }
.btn .spinner { width: 15px; height: 15px; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
/* Auswahlliste im Stil eines Knopfs (selectButton): die echte Liste liegt unsichtbar darüber */
.select-btn { position: relative; }
.select-btn > select { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font: inherit; appearance: none; }
.select-btn:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.select-btn-text { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1025px) { .select-btn-text { max-width: 260px; } } /* Platz genug: längere Namen ganz zeigen */
.select-btn .icon.sm { opacity: .7; margin-left: -3px; }
.select-btn .sb-short { display: none; }
/* eigene Liste zu den Auswahlknöpfen (mit Maus) */
.sb-menu { position: fixed; z-index: 10060; max-width: min(380px, calc(100vw - 16px)); overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); animation: sb-in .12s ease-out; scrollbar-width: thin; }
@keyframes sb-in { from { opacity: 0; transform: translateY(-4px); } }
.sb-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px 8px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: .93rem; font-weight: 520; text-align: left; cursor: pointer; }
.sb-opt > span { min-width: 0; overflow-wrap: anywhere; }
.sb-opt .icon { flex: none; color: var(--accent); visibility: hidden; }
.sb-opt:focus, .sb-opt:hover { outline: none; background: var(--surface-3); }
.sb-opt.selected { color: var(--accent-strong); font-weight: 650; }
.sb-opt.selected .icon { visibility: visible; }
.sb-opt.none { color: var(--text-2); }
.sb-opt:disabled { opacity: .45; cursor: default; }
.sb-sep { height: 1px; margin: 5px 8px; background: var(--border); }
/* Titel einer Gruppe (optgroup) und zweite Zeile einer Option (data-hint), z. B. bei der Klasse im Journal */
.sb-group { padding: 8px 12px 4px 32px; font-size: .72rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.sb-sep + .sb-group { padding-top: 4px; }
.sb-two { display: flex; flex-direction: column; gap: 1px; }
.sb-two small { font-size: .78rem; font-weight: 450; color: var(--text-3); }
.sb-note { max-width: 340px; padding: 6px 12px 8px; font-size: .8rem; line-height: 1.4; color: var(--text-2); }
.sb-dot { flex: none; width: 10px; height: 10px; border-radius: 3px; }
/* Aktionsmenü («…»): Symbol statt Häkchen, mit kurzer Erklärung */
.sb-action { padding: 9px 14px 9px 10px; gap: 10px; }
.sb-action .icon { visibility: visible; color: var(--text-2); }
.sb-action > span { display: flex; flex-direction: column; }
.sb-action small { font-size: .78rem; font-weight: 450; color: var(--text-3); }

/* Menü «Neu» (newmenu.js): am Computer neben dem Knopf der Seitenleiste, auf dem Handy ein Blatt von unten mit Kacheln */
.nm-backdrop { position: fixed; inset: 0; z-index: 10050; }
.nm-panel { position: fixed; width: 330px; max-width: calc(100vw - 16px); padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); animation: sb-in .12s ease-out; }
.nm-merken { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font: inherit; font-size: .95rem; font-weight: 650; text-align: left; cursor: text; }
.nm-merken:hover, .nm-merken:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.nm-merken-text { flex: 1; }
/* «Merken» und daneben das Mikrofon (dictate.js); offen: das Feld und darunter der Hinweis */
.nm-merken-box { display: flex; align-items: stretch; gap: 6px; }
.nm-merken-box > .nm-merken { flex: 1; min-width: 0; }
.nm-merken-box.open { display: block; }
.nm-mic { flex: none; width: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); cursor: pointer; }
.nm-mic:hover, .nm-mic:focus-visible { outline: none; background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.nm-merken-form .nm-mic { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--text-2); }
@media (pointer: coarse) { .nm-merken-form .nm-mic { width: 40px; height: 40px; } .nm-merken-form { padding-left: 10px; gap: 6px; } .nm-merken-form .input { padding-block: 9px; } .nm-merken-form > .icon { margin-bottom: 11px; } } /* Finger */
.nm-merken-form .nm-mic:hover, .nm-merken-form .nm-mic:focus-visible { background: var(--surface-3); color: var(--accent-strong); box-shadow: none; }
.nm-merken-form .nm-mic.on { background: var(--accent); color: var(--accent-text); animation: nm-pulse 1.4s ease-out infinite; }
@keyframes nm-pulse { 0% { box-shadow: 0 0 0 0 var(--accent-soft); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
/* unten bündig: Wird der Text länger, wächst das Feld nach oben, Stift, Mikrofon und «Merken» bleiben auf der letzten Zeile */
.nm-merken-form { display: flex; align-items: flex-end; gap: 8px; padding: 4px 4px 4px 12px; border: 1px solid var(--accent); border-radius: 10px; background: var(--surface); color: var(--accent-strong); }
.nm-merken-form > .icon { flex: none; margin-bottom: 8px; }
/* das Feld wächst mit dem Text (newmenu.js → changed()), bis etwa sechs Zeilen, dann scrollt es */
.nm-merken-form .input { flex: 1; min-width: 0; min-height: 0; max-height: calc(8.4em + 12px); border: 0; padding: 6px 0; background: none; box-shadow: none; line-height: 1.4; resize: none; overflow-y: auto; }
.nm-merken-form .input:focus { outline: none; box-shadow: none; }
.nm-merken-form .input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* am Computer breiter, solange das Feld offen ist: Platz für längere Notizen */
.nm-panel:not(.sheet):has(.nm-merken-box.open) { width: 400px; }
/* darunter die Wahl: Aufgabe oder Notiz */
/* Vorschau unter dem Feld: Art (antippen zum Wählen), Tag, Zeit, Klasse und Titel, wie Enter es anlegt */
.nm-preview { display: grid; gap: 6px; margin-top: 8px; }
.nm-preview-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.nm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); font: inherit; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.nm-chip .icon { width: 14px; height: 14px; }
button.nm-chip { cursor: pointer; }
button.nm-chip:hover, button.nm-chip:focus-visible { border-color: var(--accent); outline: none; }
.nm-chip.kind { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.nm-chip.warn { border-color: transparent; background: var(--warn-soft); color: var(--warn); }
.nm-preview-title { flex: 1 1 120px; min-width: 0; overflow: hidden; color: var(--text); font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.nm-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.nm-pick .chip { display: inline-flex; align-items: center; gap: 5px; }
.nm-merken-hint { margin: 6px 4px 2px; color: var(--text-3); line-height: 1.4; }
/* deutlich: hört zu, Hinweis zur Erkennung, wie man sonst diktiert (dictate.js) */
.nm-merken-hint.note { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 2px; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--text); }
.nm-merken-hint.note > .icon { flex: none; margin-top: 2px; color: var(--accent-strong); }
.nm-items { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nm-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: .93rem; font-weight: 520; text-align: left; cursor: pointer; }
.nm-item:hover, .nm-item:focus { outline: none; background: var(--surface-3); }
.nm-item .icon { color: var(--text-2); }
.nm-label { flex: 1; }
/* «Später» (Strg+Enter) hinten in der Zeile der Vorschau, und die Zeile zum Korb «Zum Einordnen» unter «Merken» */
.nm-later { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: .8rem; cursor: pointer; }
.nm-later:hover, .nm-later:focus-visible { border-color: var(--accent); color: var(--accent-strong); outline: none; }
.nm-later .icon { width: 14px; height: 14px; }
.nm-inbox { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 6px; padding: 8px 10px; border: 1px dashed var(--accent); border-radius: 8px; background: none; color: var(--accent-strong); font: inherit; font-size: .9rem; font-weight: 600; text-align: left; cursor: pointer; }
.nm-inbox:hover, .nm-inbox:focus-visible { outline: none; background: var(--accent-soft); }
.nm-inbox .badge { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: .75rem; text-align: center; }
.nm-panel kbd { font: inherit; font-size: .72rem; font-weight: 600; min-width: 22px; padding: 1px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); color: var(--text-3); text-align: center; }
.nm-merken kbd { border-color: currentColor; background: none; color: inherit; opacity: .7; }
.nm-foot { margin: 6px 10px 2px; color: var(--text-3); }
.nm-head { padding: 2px 4px 10px; font-size: 1.05rem; }
/* Handy: Blatt von unten, «Merken» oben, darunter die fünf als Kacheln */
.nm-backdrop.sheet { display: grid; align-items: end; background: var(--backdrop-soft); }
.nm-panel.sheet { position: static; width: 100%; max-width: none; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: 16px 16px 0 0; animation: sheet-in .26s cubic-bezier(.22, 1, .36, 1); }
.nm-panel.sheet .nm-merken { min-height: 48px; font-size: 1rem; }
/* auf dem Handy ein grosses Mikrofon neben «Merken» */
.nm-panel.sheet .nm-merken-box > .nm-mic { width: 52px; border-radius: 12px; }
.nm-panel.sheet .nm-merken-box > .nm-mic .icon { width: 24px; height: 24px; }
.nm-panel.sheet .nm-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px; margin-top: 12px; } /* alle Kacheln gleich hoch */
.nm-panel.sheet .nm-item { flex-direction: column; justify-content: center; gap: 6px; min-height: 76px; padding: 10px 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-size: .82rem; font-weight: 600; line-height: 1.25; text-align: center; }
.nm-panel.sheet .nm-item .icon { width: 22px; height: 22px; color: var(--accent-strong); }
.nm-panel.sheet .nm-label { flex: none; }
@media (prefers-reduced-motion: reduce) { .nm-panel, .nm-panel.sheet, .nm-merken-form .nm-mic.on { animation: none; } .m-top-brand, .m-top-title { transform: none !important; } }
.select-btn.active, .select-btn.active:hover { background: var(--accent-soft); color: var(--accent-strong); }
.select-btn:has(> select:disabled) { opacity: .55; }
.select-btn > select:disabled { cursor: default; }

.spinner { width: 20px; height: 20px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head > * { min-width: 0; max-width: 100%; } /* lange Titel/Markierungen umbrechen statt die Karte zu verbreitern */
.card-head > :last-child:not(:first-child) { margin-left: auto; } /* rutschen die Knöpfe in die zweite Zeile, bleiben sie rechts */
.card-head h2 { display: flex; align-items: center; gap: 9px; font-size: 1rem; }
.card-toggle { display: inline-flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.card.collapsed .card-head { border-bottom: 0; }
.card-summary { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.card-head-toggle { cursor: pointer; user-select: none; }
.row.card-title-row { gap: 10px; flex-wrap: nowrap; min-width: 0; }
.card-title-row h2 { flex: none; }
.card-title-row .card-summary { display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* nur mit Maus: auf Touch bliebe die Farbe nach dem Antippen haften */
@media (hover: hover) { .card-toggle:hover, .card-head-toggle:hover .card-toggle { color: var(--accent); } }
.card-chevron { display: inline-flex; }
.card-status { display: inline-flex; align-items: center; margin-left: auto; white-space: nowrap; }
@media (max-width: 640px) {
  /* lange Titel (z. B. «Microsoft (To Do, OneDrive, SharePoint)») umbrechen statt die Seite zu verbreitern */
  .card-title-row h2 { flex: 0 1 auto; min-width: 0; }
  /* Kurzinfo ganz lesbar auf eigener Zeile unter dem Titel statt abgeschnitten */
  .row.card-title-row { flex-wrap: wrap; row-gap: 2px; }
  .card-title-row .card-summary { flex-basis: 100%; padding-left: 51px; white-space: normal; overflow: visible; }
  /* Status unter dem Titel, bündig mit dem Text */
  .card-head-toggle > .card-status { flex-basis: 100%; min-width: 0; margin: -4px 0 0; padding-left: 51px; white-space: normal; overflow-wrap: anywhere; } /* lange E-Mail-Adresse */
}
.card-head h2 .icon { color: var(--text-3); }
.card-body { padding: 16px 18px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: .86rem; }
.tiny { font-size: .76rem; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: .78rem; font-weight: 560; background: var(--surface-3); color: var(--text-2); border: 1px solid transparent;
  /* nie breiter als die Zeile: sehr lange Wörter (z. B. Themen, Fehlermeldungen) brechen um; in Zeilen nicht zusammengestaucht */
  max-width: 100%; flex-shrink: 0; overflow-wrap: anywhere;
}
/* lange Inhalte (Termine, Fehlermeldungen) umbrechen statt die Seite zu verbreitern */
.chip.wrap, .ov-week-info .chip, .source-row .chip { white-space: normal; overflow-wrap: anywhere; border-radius: 9px; }
.chip.accent { background: var(--accent-soft); color: var(--accent-strong); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.success { background: var(--success-soft); color: var(--success); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--border-strong); }
button.chip.active, span.chip.active { background: var(--accent); color: var(--accent-text); }
/* Handy und Touch: Chips zum Antippen (Datum, Beispiele, Platzhalter …) gross genug */
@media (max-width: 640px), (pointer: coarse) { button.chip, span.chip.active { min-height: 32px; padding: 4px 12px; } }

.mark { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 560; padding: 2px 8px 2px 6px; border-radius: 6px; }
.mark::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.mark.red { color: var(--mark-red); background: color-mix(in srgb, var(--mark-red) 12%, transparent); }
.mark.green, .mark.brightGreen { color: var(--mark-green); background: color-mix(in srgb, var(--mark-green) 12%, transparent); }
.mark.magenta, .mark.pink { color: var(--mark-magenta); background: color-mix(in srgb, var(--mark-magenta) 12%, transparent); }
.mark.yellow, .mark.darkYellow { color: var(--mark-yellow); background: color-mix(in srgb, var(--mark-yellow) 16%, transparent); }
.mark.other { color: var(--text-2); background: var(--surface-3); }
.mark.struck { text-decoration: line-through; opacity: .7; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span, .field-label { font-size: .84rem; font-weight: 600; color: var(--text-2); }
.field small, .hint { color: var(--text-3); font-size: .8rem; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface); min-height: 40px; transition: border-color .12s, box-shadow .12s;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.input.search { padding-left: 36px; background: var(--surface) no-repeat 11px center; }
.search-wrap { position: relative; }
.row > .search-wrap.grow { flex: 1 1 220px; } /* Suchfeld in einer Zeile mit Filtern: nie schmaler als ~220 px (sonst darunter) */
.search-wrap .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-wrap .input { padding-left: 36px; }
.checkbox { display: inline-flex; gap: 9px; align-items: flex-start; cursor: pointer; }
.checkbox input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); } /* auf der Höhe der ersten Zeile */
/* Kästchen und Optionsfelder überall in der Farbe der App statt im Blau des Browsers */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
/* «Anwesend» im Termin-Dialog und bei einer Lektion: nebeneinander, Zeilen eng (auf Touch-Geräten ist jedes Kästchen
   schon 44 px hoch, siehe unten) */
.people-pick { column-gap: 10px; row-gap: 4px; }
.people-pick .checkbox { gap: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-grid.fg-end { align-items: end; } /* Felder auf einer Linie, auch wenn eine Beschriftung umbricht (ohne Hinweise darunter) */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { appearance: none; width: 40px; height: 23px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(17px); }
/* Schieberegler, überall gleich: Bahn bis zum Griff gefüllt (--range-p setzt ui.js → rangeFill(), Firefox füllt selbst),
   runder Griff mit Ring beim Darüberfahren, Ziehen und Fokus. Ein Bereich kann --range-accent und --range-track setzen */
input[type="range"] {
  --range-a: var(--range-accent, var(--accent)); --range-t: var(--range-track, var(--border-strong));
  -webkit-appearance: none; appearance: none; height: 28px; margin: 0; padding: 0; background: none; cursor: pointer;
}
input[type="range"]:focus { outline: none; }
input[type="range"]:disabled { cursor: default; opacity: .5; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(var(--range-a), var(--range-a)) 0 / calc(10px + (100% - 20px) * var(--range-p, 0)) 100% no-repeat, var(--range-t);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--range-t); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--range-a); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%;
  border: 2px solid var(--range-a); background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: box-shadow .15s, transform .15s;
}
input[type="range"]::-moz-range-thumb {
  box-sizing: border-box; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--range-a); background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: box-shadow .15s, transform .15s;
}
input[type="range"]:enabled:is(:hover, :focus-visible)::-webkit-slider-thumb { box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 0 0 6px color-mix(in srgb, var(--range-a) 20%, transparent); }
input[type="range"]:enabled:is(:hover, :focus-visible)::-moz-range-thumb { box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 0 0 6px color-mix(in srgb, var(--range-a) 20%, transparent); }
input[type="range"]:enabled:active::-webkit-slider-thumb { transform: scale(1.1); box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 0 0 8px color-mix(in srgb, var(--range-a) 25%, transparent); }
input[type="range"]:enabled:active::-moz-range-thumb { transform: scale(1.1); box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 0 0 8px color-mix(in srgb, var(--range-a) 25%, transparent); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 9px 14px; border: 0; background: none; color: var(--text-2); font-weight: 560; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
/* Einstellungen: Bereiche umbrechen statt seitlich verstecken (Administratoren haben zwei mehr) */
.settings-tabs { flex-wrap: wrap; overflow: visible; }
/* Einstellungen auf Handy und Tablet: alle Bereiche sichtbar (umbrechende Knöpfe) statt seitlich versteckt; als Reiter
   stünde dort sonst ein einzelner (z. B. «Daten») allein in der zweiten Zeile */
@media (max-width: 1180px) {
  .settings-tabs { flex-wrap: wrap; gap: 6px; padding-bottom: 14px; overflow: visible; }
  .settings-tabs .tab { padding: 7px 10px; font-size: .9rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
  .settings-tabs .tab.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
}

/* Leere Zustände und Hinweise */
.empty { text-align: center; padding: 34px 20px; color: var(--text-3); }
.empty .icon { width: 34px; height: 34px; margin-bottom: 8px; opacity: .6; }
.empty p { margin: 4px auto 12px; } /* mittig, auch wo Absätze eine grösste Breite haben (Einstellungen) */
.empty .btn .icon { width: 18px; height: 18px; margin: 0; opacity: 1; } /* Knöpfe in der Meldung: Symbol in normaler Grösse */
.notice { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--text); align-items: flex-start; }
.notice .icon { color: var(--accent); margin-top: 2px; }
.notice.warn { background: var(--warn-soft); }
/* Korb «Zum Einordnen» (inbox.js): Hinweis in der Übersicht, Einträge mit dem Feld «Merken», «Erledigt», eigene Regeln */
.ib-notice { align-items: center; }
.ib-notice .icon { margin-top: 0; }
.ib-list { display: grid; gap: 8px; }
.ib-item { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.ib-item.open { border-color: var(--accent); }
.ib-head { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; }
.ib-head > .icon { flex: none; margin-top: 3px; color: var(--text-3); }
.ib-text { color: var(--text); line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ib-item.open .ib-text { display: block; }
.ib-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--warn-soft); color: var(--text); }
.ib-note .icon { flex: none; margin-top: 2px; color: var(--warn); }
.ib-actions { display: flex; flex: none; align-items: center; gap: 4px; }
.ib-field { padding: 0 12px; }
.ib-item.open .ib-field { padding-bottom: 12px; }
.ib-empty { padding: 20px; }
.ib-done summary { cursor: pointer; color: var(--text-2); font-weight: 600; }
.ib-done-list { display: grid; gap: 6px; margin: 8px 0; padding: 0; list-style: none; }
.ib-done-list li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ib-done-list li .icon { flex: none; color: var(--text-3); }
.ib-done-list li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-rules { display: grid; gap: 6px; }
.ib-rule { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ib-rule .input { width: auto; min-width: 0; }
.ib-rule select.input { flex: none; width: 150px; }
.ib-new .input:first-child { flex: 1; }
.ib-word { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .ib-head { flex-wrap: wrap; }
  .ib-actions { width: 100%; justify-content: flex-end; }
  .ib-new { flex-wrap: wrap; }
}
.notice.warn .icon { color: var(--warn); }
.notice.success { background: var(--success-soft); }
.notice.success .icon { color: var(--success); }
.access-done { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 0; text-align: center; color: var(--success); font-weight: 600; font-size: 1.05rem; }
.access-done p { margin: 0; }
.access-done .icon { width: 44px; height: 44px; }
.notice.danger { background: var(--danger-soft); }
.notice.danger .icon { color: var(--danger); }
/* Hinweis mit einklappbarer Zeile (foldNotice) */
.notice-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.notice-toggle:hover { color: var(--accent-strong); }
.notice-toggle .card-chevron .icon { color: var(--text-3); margin-top: 0; }
/* Übersicht: Karte «Erste Schritte» für neue Konten */
.first-steps .card-head h2 .chip { margin-left: 4px; }
/* schmal: der Zähler bricht unter den Titel, das Kreuz bleibt oben rechts */
.first-steps .card-head { flex-wrap: nowrap; }
.first-steps .card-head h2 { flex: 1 1 0; flex-wrap: wrap; row-gap: 4px; }
.first-steps-intro { margin: 0 0 6px; }
/* nur noch einer oder zwei Schritte offen: eine Zeile */
.first-steps-line { align-items: center; }
.first-steps-line > .grow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.first-steps-line a { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.first-steps-list { list-style: none; margin: 0; padding: 0; }
.first-step { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.first-step:first-child { border-top: 0; }
.first-step-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--accent-soft); color: var(--accent-strong); }
.first-step.done .first-step-mark { background: var(--success); color: var(--on-color); }
.first-step-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.first-step-text strong { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.first-step.done .first-step-text strong { color: var(--text-2); }
.first-step-ok { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-weight: 600; }
@media (max-width: 560px) {
  .first-step { grid-template-columns: auto 1fr; }
  .first-step > .btn, .first-step-ok { grid-column: 2; justify-self: start; }
  /* auf dem Handy nur, was noch fehlt: Erledigtes zählt der Kopf */
  .first-steps-intro, .first-step.done { display: none; }
  .first-step { border-top: 0; }
  .first-step:not(.done) ~ .first-step:not(.done) { border-top: 1px solid var(--border); }
}

/* Toasts */
/* Ohne Netz (offline.js): oben in der Mitte, über allem, auch im Screen */
.offline-pill { position: fixed; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 10200; display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; border: 1px solid var(--warn); border-radius: 999px; background: var(--warn-soft); color: var(--text); font-size: .8rem; font-weight: 600;
  white-space: nowrap; box-shadow: var(--shadow); pointer-events: none; }
.offline-pill .icon { width: 14px; height: 14px; color: var(--warn); }
.offline-pill .op-short { display: none; }
/* Ohne Verbindung (offline.js): an Stelle einer Seite, die nicht lädt, bzw. über einer Seite, von der ein Teil fehlt */
.offline-page { display: grid; justify-items: center; gap: 10px; box-sizing: border-box; width: min(460px, 100%); margin: clamp(24px, 9vh, 88px) auto; padding: 28px 24px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); text-align: center; box-shadow: var(--shadow); }
.offline-page-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); }
.offline-page h2 { margin: 4px 0 0; font-size: 1.25rem; }
.offline-page p { margin: 0; color: var(--text-2); line-height: 1.5; }
.offline-page .btn { margin-top: 8px; }
/* ohne Rand drumherum (Screen, Start der App): etwas Abstand zum Bildschirmrand */
:is(.screen-root, .boot) > .offline-page { width: min(460px, calc(100% - 32px)); }
.offline-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 18px clamp(16px, 3vw, 40px) 0; padding: 10px 14px;
  border: 1px solid var(--warn); border-radius: 12px; background: var(--warn-soft); color: var(--text); font-size: .92rem; line-height: 1.45; }
.offline-banner > .icon { flex: none; color: var(--warn); }
.offline-banner > span { flex: 1 1 220px; }
.offline-banner + .main { padding-top: 16px; }
/* «Neuer Stand · Neu laden» (offerReload): derselbe Hinweis als Knopf */
.offline-pill.reload { pointer-events: auto; cursor: pointer; font-family: inherit; }
.offline-pill.reload:hover { border-color: var(--text); }
@media (max-width: 640px) {
  /* rechts oben (in der App unter der Kopfzeile); die Seite rückt darunter, damit Titel und Knöpfe frei bleiben */
  .offline-pill { left: auto; right: 12px; transform: none; }
  .offline-pill .op-long { display: none; }
  .offline-pill .op-short { display: inline; }
}
/* öffentliche Seiten: unten in der Mitte, oben liegen «Anmelden» und das Menü */
body:has(.start-top) .offline-pill { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; right: auto; transform: translateX(-50%); }
/* fehlt ein Teil der Seite, sagt es schon die Leiste darüber */
body:has(.offline-banner) .offline-pill { display: none; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 10100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 11px 15px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: toast-in .2s ease-out; font-size: .92rem; }
/* Links in Meldungen (z. B. «Rückgängig» im Screen) in der Schrift der Meldung, sonst kaum lesbar */
.toast a { color: inherit; font-weight: 650; text-decoration: underline; }
/* dunkel sind Grün und Rot hell: dann dunkle Schrift (--on-color) */
.toast.error { background: var(--danger); color: var(--on-color); }
.toast.success { background: var(--success); color: var(--on-color); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
@media (max-width: 860px) {
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); left: 16px; right: 16px; }
  /* ohne Leiste unten (öffentliche Seiten, Anmelden) nicht mitten über Formular und Knöpfe */
  body:not(:has(.bottom-nav)) .toasts { bottom: max(16px, env(safe-area-inset-bottom)); }
}
/* offenes Panel einer Lektion (bleibt nach Aktionen offen): Meldungen links daneben statt über «Speichern» */
@media (min-width: 861px) {
  body:has(.modal-backdrop.side:not(.closing)) .toasts { right: calc(min(520px, 100%) + 18px); max-width: min(420px, calc(100vw - 556px)); }
}
/* schmaler liegt das Panel (rechts oder als Blatt von unten) dort, wo die Meldungen sonst stehen: dann oben */
@media (max-width: 860px) {
  body:has(.modal-backdrop.side:not(.closing)) .toasts { top: max(10px, env(safe-area-inset-top)); bottom: auto; }
}

/* Dialoge */
.modal-backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 10000; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; animation: fade-in .15s; } /* minmax: lange Titel oder Inhalte machen den Dialog nie breiter als den Bildschirm */
@keyframes fade-in { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--modal-ring); width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: modal-in .18s ease-out; }
.modal:focus { outline: none; } /* Fokus aufs Fenster selbst (z. B. Tagesrückblick), Tab führt hinein */
.modal.wide { width: min(860px, 100%); }
@keyframes modal-in { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { min-width: 0; overflow-wrap: anywhere; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
/* Mit dem Finger: Ist ein Dialog, die Suche oder «Neu» offen, scrollt die Seite dahinter nicht mit. Sonst klappt beim Wischen
   die Leiste des Browsers ein oder aus, die abgedunkelte Fläche zieht nicht immer gleich nach, und unter einem Blatt von
   unten kam die Handy-Leiste hervor; auch kein Neuladen durch Ziehen */
@media (pointer: coarse) {
  html:has(> body > :is(.modal-backdrop, .nm-backdrop)) { overflow: hidden; overscroll-behavior-y: none; }
}
/* schmale Handys: weniger Rand, damit Inhalt und Knöpfe Platz haben; die Knöpfe im Fuss teilen sich die Zeile (bricht
   sie um, ist auch die zweite Zeile gefüllt statt ein Knopf allein), «Löschen» links nur mit Symbol */
@media (max-width: 420px) {
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100dvh - 20px); }
  .modal-head { padding: 12px 10px 12px 16px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 10px 12px; gap: 6px; }
  .modal-foot > .grow { display: none; }
  .modal-foot > .btn:not(.icon-only) { flex: 1 1 auto; min-width: 0; padding-left: 10px; padding-right: 10px; }
  .modal-foot > .btn.danger:has(> .icon):has(~ .grow) { flex: none; font-size: 0; gap: 0; padding: 7px; min-width: 40px; }
}
/* Panel am rechten Rand (lessonpanel.js): volle Höhe, die Seite bleibt links sichtbar; schmal ein Blatt von unten. Es gleitet
   herein und beim Schliessen wieder hinaus, während die Seite dahinter wieder hell wird (ui.js → modal(): closing) */
.modal-backdrop.side { place-items: stretch end; padding: 0; background: var(--backdrop-soft); }
.modal.side { width: min(520px, 100%); max-height: 100dvh; border-radius: 16px 0 0 16px; animation: side-in .28s cubic-bezier(.22, 1, .36, 1); }
.modal.side .modal-body { flex: 1; } /* Knöpfe im Fuss bleiben unten */
.modal-backdrop.side.closing { pointer-events: none; animation: dim-out .24s ease-in forwards; }
.modal-backdrop.side.closing .modal.side { animation: side-out .24s cubic-bezier(.55, 0, .7, .3) forwards; }
@keyframes side-in { from { transform: translateX(100%); } }
@keyframes side-out { to { transform: translateX(100%); } }
@keyframes dim-out { to { background-color: transparent; } }
@media (max-width: 640px) {
  .modal-backdrop.side { place-items: end stretch; padding: 0; }
  .modal.side { width: 100%; max-height: calc(100dvh - 40px); border-radius: 16px 16px 0 0; animation-name: sheet-in; }
  .modal-backdrop.side.closing .modal.side { animation-name: sheet-out; }
  .modal.side .modal-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .modal.side, .modal-backdrop.side.closing, .modal-backdrop.side.closing .modal.side { animation: none; } }
/* Inhalt des Panels: Angaben, Hinweise, Inhalt (Editor mit Dateien), Aktionen */
.lp { gap: 12px; }
/* Über der Zeile mit Datum und Zeit gleich viel Luft wie darunter (Computer und Handy) */
.lp-panel .modal-body { padding-top: 16px; }
.lp-meta { gap: 6px 10px; }
.lp-when { gap: 6px; flex-wrap: nowrap; }
/* eine Zeile, die erst nachlädt (Thema der Jahresplanung), bekommt leer keinen Abstand: oben und unten gleich viel Luft */
.lp > div:empty { display: none; }
/* Angaben aus dem festen Plan (Zimmer, Notiz): eigene Fläche, ein Symbol pro Zeile, damit sie sich vom Inhalt abheben */
.lp-details { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-weight: 500; }
.lp-detail { display: flex; align-items: flex-start; gap: 8px; overflow-wrap: anywhere; }
.lp-detail > .icon { flex: none; margin-top: .2em; color: var(--accent); }
.lp-text { margin: 0; white-space: pre-wrap; }
.lp-hint { margin: -4px 0 0; }
.lp .we-editor { min-height: 120px; max-height: 40vh; }
/* Notiz eines Termins (bei einem aus einem Kalender eine eigene): kürzer als der Inhalt einer Lektion */
.lp-note { gap: 4px; }
.lp .lp-note .we-editor { min-height: 72px; }
/* Aktionen als Kacheln: Symbol und Name darunter (bricht um); Name und Erklärung auch im Tooltip */
.lp-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.lp-act {
  min-height: 64px; display: grid; place-items: center; align-content: start; gap: 5px; padding: 9px 4px 8px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--accent-strong); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .12s, border-color .12s;
}
.lp-act:hover { border-color: var(--border-strong); background: var(--surface-3); }
.lp-act:active { background: var(--accent-soft); }
.lp-act:disabled { cursor: progress; }
.lp-act > .icon { width: 18px; height: 18px; }
.lp-act.danger { color: var(--danger); }
.lp-act-lbl { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--text-2); font-size: .72rem; font-weight: 600; line-height: 1.25; text-align: center; overflow-wrap: anywhere; hyphens: auto; }
.lp-act.danger .lp-act-lbl { color: inherit; }
/* Finger: Symbol etwas grösser */
@media (pointer: coarse) { .lp-act { min-height: 66px; } .lp-act > .icon { width: 20px; height: 20px; } }
/* Editor im Panel: Markierungen als Farbpunkte in einer Zeile, ihre Bedeutung als Legende darunter (wie auf dem Handy) */
.lp .we-swatch-label { display: none; }
.lp .we-legend { display: flex; }
/* Blättern zur vorherigen und nächsten Lektion im Kopf des Panels */
.lp-panel .modal-head h2 { flex: 1; }
.lp-nav { display: flex; gap: 2px; flex: none; }
.lp-nav .btn:disabled { opacity: .35; }

/* Panel eines Kindes (studentpanel.js): Aktionen fest unter dem Kopf, Abschnitte mit Kopfzeile, Einträge wie auf der Seite
   des Kindes */
.sp-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.sp-acts:empty { display: none; }
@media (max-width: 600px) { .sp-acts > .btn { flex: 1; justify-content: center; } }
@media (max-width: 420px) { .sp-acts { padding: 8px 16px; } }
.sp-sec { display: flex; flex-direction: column; gap: 6px; }
.sp-head { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .86rem; font-weight: 700; color: var(--text-2); }
.sp-head > .icon { color: var(--accent); }
.sp-extra { margin-left: auto; font-size: .8rem; font-weight: 500; color: var(--text-3); }
.sp-empty { margin: 0; }
.sp-entries, .sp-lists { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.sp-entries .jn-ce { border-radius: 0; }
.sp-entry.static { cursor: default; }
.sp-entry.static:hover { background: none; }
.sp-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: normal; }
.sp-more { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; }
.sp-points { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; }
.sp-point { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 7px 10px; min-height: 40px; }
.sp-point + .sp-point { border-top: 1px solid var(--border); }
.sp-point-name { flex: 0 0 6.5rem; min-width: 0; font-weight: 600; font-size: .86rem; overflow-wrap: anywhere; }
.sp-seating { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.sp-list { display: flex; flex-direction: column; gap: 4px; padding: 6px 4px 6px 10px; }
.sp-list + .sp-list { border-top: 1px solid var(--border); }
.sp-list-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* Titel und daneben «bis …», «zu spät»; reicht der Platz nicht, stehen sie unter dem Titel */
.sp-list-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.sp-list-title, .sp-check-title { flex: 1 1 11rem; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.sp-list-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.sp-list.done .sp-list-title, .sp-list.done .sp-check-title > span { color: var(--text-3); }
.sp-cols { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-bottom: 2px; }
.sp-check { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; cursor: pointer; font-size: .86rem; }
.sp-check > input { flex: none; }
.sp-overdue { color: var(--danger); }
.sp-late { display: inline-flex; align-items: center; gap: 4px; }
.sp-list-note { padding-right: 6px; overflow-wrap: anywhere; }
.sp-meeting { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; color: inherit; text-decoration: none; }
.sp-meeting:hover { background: var(--surface-2); }
.sp-meeting-title { font-weight: 600; overflow-wrap: anywhere; }
.sp-meeting > .icon { grid-column: 2; grid-row: 1 / span 2; color: var(--text-3); }
.sp-slot { display: inline-flex; align-items: center; gap: 5px; font-size: .86rem; }

/* Globale Suche */
.search-backdrop { place-items: start center; padding-top: min(12vh, 110px); }
.search-box { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--modal-ring); width: min(700px, 100%); max-height: min(70vh, 640px); display: flex; flex-direction: column; overflow: hidden; animation: modal-in .15s ease-out; }
.search-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--border); }
.search-head > svg { color: var(--text-3); flex: none; }
.search-input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 1.08rem; color: var(--text); padding: 6px 0; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-close { border: 0; background: none; cursor: pointer; padding: 2px; color: var(--text-2); }
.search-close > .icon { display: none; }
/* Touch: ein «×» zum Antippen statt der Taste «Esc»; ohne Tastatur auch kein Tipp zu Strg+K */
@media (pointer: coarse) {
  .search-close { display: grid; place-items: center; min-width: 40px; min-height: 40px; margin: -6px -8px -6px 0; }
  .search-close kbd, .search-hint-keys { display: none; }
  .search-close > .icon { display: block; }
  .search-hint:not(:has(.search-hint-ai, .search-hint-new)) { display: none; }
}
.search-results { overflow-y: auto; padding: 6px 8px 10px; }
.search-group-title { display: flex; align-items: center; gap: 6px; padding: 10px 10px 4px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.search-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; color: inherit; text-decoration: none; }
.search-item > svg { color: var(--text-3); flex: none; }
.search-item > svg:last-child { opacity: 0; }
.search-item.active { background: var(--accent-soft); }
.search-item.active > svg:last-child { opacity: 1; color: var(--accent); }
.search-item .grow { display: flex; flex-direction: column; min-width: 0; }
.search-title { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item small { color: var(--text-3); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item.done .search-title { text-decoration: line-through; color: var(--text-3); }
/* Treffer im Text überall gleich hinterlegt: Suche, Hilfe und Suche im Stundenplan */
.search-item mark, .help-mark, .ss-hit mark { background: color-mix(in srgb, var(--mark-yellow) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 26px 12px; text-align: center; color: var(--text-3); }
.search-hint { padding: 10px 12px 2px; font-size: .78rem; color: var(--text-3); }
/* «Claude fragen» in der Suche */
.search-item.ask-item > svg:first-child { color: var(--accent); }
.search-item .ask-kbd { flex: none; font: inherit; font-size: .7rem; padding: 1px 6px; border: 1px solid var(--border); border-radius: 5px; color: var(--text-3); }
.search-item .src-n { flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-strong); font-size: .74rem; font-weight: 700; }
.ask-view { display: flex; flex-direction: column; gap: 12px; padding: 10px 10px 4px; }
.ask-q { display: flex; align-items: flex-start; gap: 8px; font-weight: 650; overflow-wrap: anywhere; }
.ask-q > svg { flex: none; margin-top: 3px; color: var(--accent); }
.ask-wait { display: flex; align-items: center; gap: 10px; padding: 14px 0 18px; color: var(--text-3); }
.ask-a { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.ask-a .md p { margin: 0 0 8px; }
.ask-a .md > :last-child { margin-bottom: 0; }
.ask-sources { margin: 0 -2px; }
.ask-sources .search-group-title { padding-top: 2px; }
.ask-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 4px 2px 8px; }
.ask-foot > .small { flex: 1 1 260px; }
.ask-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.ask-entry { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 8px; }
.ask-entry + .ask-entry { padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.ask-meta { padding: 0 2px; }
.ask-more { padding: 6px 10px; }
@media (max-width: 640px) {
  .search-backdrop { padding: 10px; }
  .search-box { max-height: calc(100dvh - 20px); } /* dvh: mit eingeblendeter Leiste des Browsers */
  /* schmal: Titel in bis zu zwei Zeilen statt nach wenigen Wörtern gekürzt */
  .search-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; }
}

/* Markdown von Claude */
.md { line-height: 1.6; overflow-wrap: anywhere; } /* lange Links brechen um */
.md h2, .md h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 18px 0 6px; font-weight: 700; }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 20px; }
.md li { margin: 3px 0; }
/* Checkliste «Vorbereiten»: kompakt, mit feiner Linie zwischen den Einträgen (Linie aus .task) */
.md li.task { list-style: none; display: block; margin: 0 0 0 -20px; padding: 2px 0; }
.md li.task label { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; padding: 3px 6px; margin: 0 -6px; border-radius: 7px; user-select: none; transition: background .12s; }
.md li.task label:hover { background: var(--surface-3); }
.md li.task input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; cursor: pointer; }
.md li.task.done span { text-decoration: line-through; color: var(--text-3); }
.md p:last-child { margin-bottom: 0; }
.md .cite { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin: 0 1px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-strong); font-size: .74rem; font-weight: 700; text-decoration: none; vertical-align: 1px; }

/* ---------------------------------------------------------------- Startseite und Anmeldung */

/* Startseite (ohne Anmeldung unter «/»): oben auf der Farbfläche Marke, Motto, Knöpfe und ein Bild der App, das unten von
   der Fläche abgeschnitten wird; darunter die Funktionen mit Bildern aus der App (abwechselnd links und rechts), KI und
   Datenschutz, weitere Funktionen und zum Schluss nochmals die Knöpfe. Jedes Bild gibt es hell und dunkel
   (docs/startseite/bilder.mjs), zu sehen ist das zum Design passende. Der Punkt des Logos steht als Sonne am Rand der
   Farbfläche. Kopf, Farbfläche und Fusszeile nutzen auch Hilfe, Changelog, Datenschutz, Impressum und AGB */
.start { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.start-hero, .signin { position: relative; overflow: hidden; color: #fff; background: linear-gradient(150deg, #2a7a91 0%, #1d5a6c 55%, #163f4e 100%); }
.start-hero::before, .signin::before { content: ""; position: absolute; border-radius: 50%; background: #f4a63d; box-shadow: 0 18px 60px rgba(244, 166, 61, .35); pointer-events: none; }
.start-hero::before { top: 120px; right: -70px; width: 200px; height: 200px; }
.start-hero { padding: 22px clamp(20px, 6vw, 88px) clamp(48px, 8vw, 96px); }
/* Kopf (publicTop) vor der Farbfläche: bleibt beim Scrollen oben stehen. Oben liegt er ohne eigene Fläche auf der
   Farbfläche, die hinter ihm beginnt (Logo 22 px vom Rand); ist die Seite gescrollt (.scrolled, app.js) oder das Menü
   offen, mit Fläche und Schatten. Angeheftet ist er knapper (--top-pad oben und unten, der Rest steht über dem Rand), so
   bleibt seine Höhe gleich und nichts springt. Der Inhalt ist auf allen öffentlichen Seiten so breit wie auf der
   Startseite (--top-max) */
.start { --top-logo: 44px; --top-pad: 16px; --top-h: calc(22px + var(--top-logo) + var(--top-pad)); --top-stuck: calc(var(--top-logo) + 2 * var(--top-pad)); --top-max: 1160px;
  --top-x: max(clamp(20px, 6vw, 88px), calc((100% - var(--top-max)) / 2)); }
.start-top { position: sticky; top: calc(var(--top-pad) - 22px); z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: var(--top-h); padding: 22px var(--top-x) var(--top-pad); transition: background-color .25s, box-shadow .25s; }
.start-top.scrolled, .start-top.open { background: rgba(29, 90, 108, .96); box-shadow: 0 8px 24px rgba(5, 25, 32, .22); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.start-top + .start-hero { margin-top: calc(-1 * var(--top-h)); }
/* Sprungziele (Funktionen, Hilfe, Changelog, Datenschutz) und die Seitennavigation von Hilfe und Changelog unter dem Kopf */
.start [id] { scroll-margin-top: calc(var(--top-stuck) + 12px); }
.start :is(.help-nav, .cl-nav) { top: calc(var(--top-stuck) + 16px); max-height: calc(100vh - var(--top-stuck) - 32px); }
.start-hero-inner { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; }
.login-logo { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.login-logo-img { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .22), 0 0 0 1px rgba(255, 255, 255, .18); }
.start h1 { margin: 0 0 16px; color: #fff; font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.08; letter-spacing: -.03em; }
.login-accent { color: #f6b85c; }
.login-lead { margin: 0 0 28px; color: rgba(255, 255, 255, .86); font-size: clamp(1.02rem, 1.6vw, 1.2rem); line-height: 1.55; }
.start-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.start .btn.start-cta-main, .start .btn.start-top-login { border-color: transparent; background: #f4a63d; color: #1d2b30; font-weight: 700; }
.start .btn.start-cta-main:hover, .start .btn.start-top-login:hover { background: #f6b85c; }
.start .btn.start-cta-main { min-height: 50px; padding: 0 22px; font-size: 1.05rem; }
.start .btn.start-cta-more { min-height: 50px; padding: 0 18px; border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); color: #fff; font-size: 1rem; }
.start .btn.start-cta-more:hover { background: rgba(255, 255, 255, .16); }
/* Hinweis über dem Motto: Lehrerpult ist noch in der Testphase */
.start-beta { display: inline-flex; align-items: flex-start; gap: 8px; margin: 0 0 18px; padding: 7px 14px; border: 1px solid rgba(246, 184, 92, .5); border-radius: 14px; background: rgba(244, 166, 61, .14); color: rgba(255, 255, 255, .9); font-size: .88rem; line-height: 1.45; }
.start-beta .icon { flex: none; margin-top: 2px; color: #f6b85c; }
.start-beta strong { color: #f6b85c; }
/* Kopf der öffentlichen Seiten (publicTop): rechts das Menü «Funktionen», «Über uns», «Hilfe» (die offene Seite markiert),
   der Knopf für das Design (hell oder dunkel) und «Anmelden»; auf dem Handy klappt der Menüknopf das Menü unter der Leiste auf */
.start-links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.start-actions { display: flex; align-items: center; gap: 8px; }
.start-nav-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: rgba(255, 255, 255, .86); font: inherit; font-size: .95rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.start-nav-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.start-nav-link[aria-current="page"] { background: rgba(255, 255, 255, .14); color: #fff; }
.start-theme, .start-menu-btn { display: grid; place-items: center; flex: none; width: 42px; height: 42px; padding: 0; border: 1px solid rgba(255, 255, 255, .32); border-radius: 50%; background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; }
.start-theme:hover, .start-menu-btn:hover { background: rgba(255, 255, 255, .18); }
.start-theme { margin-left: 4px; }
.start-theme-label { display: none; }
.start-menu-btn { display: none; }
/* «Anmelden» so hoch wie die runden Knöpfe daneben (Design, auf dem Handy der Menüknopf); mit dem Finger ist die
   Tippfläche von «Anmelden» und Menüknopf trotzdem mindestens 44 px wie bei den übrigen Knöpfen (pointer: coarse) */
.start .btn.start-top-login { min-height: 42px; }
@media (pointer: coarse) {
  .start-top .start-top-login, .start-menu-btn { position: relative; }
  .start-top .start-top-login::after, .start-menu-btn::after { content: ""; position: absolute; inset: -4px; }
}
/* Wechsel des Designs mit dem Knopf: die Seite blendet kurz über (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
.start-foot { margin-top: auto; padding: 24px 16px 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; text-align: center; }
.start-foot a, .app-foot a { color: inherit; text-decoration: none; }
.start-foot a:hover, .app-foot a:hover { text-decoration: underline; }

/* Bilder aus der App: hell oder dunkel wie die Seite */
.start-shot { display: block; overflow: hidden; background: var(--surface); }
.start-shot img { display: block; width: 100%; height: auto; }
.start-shot .start-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .start-shot .start-light { display: none; }
  :root:not([data-theme="light"]) .start-shot .start-dark { display: block; }
}
:root[data-theme="dark"] .start-shot .start-light { display: none; }
:root[data-theme="dark"] .start-shot .start-dark { display: block; }
.start-home { --start-max: 1160px; --start-pad: clamp(16px, 5vw, 64px); --start-stage: linear-gradient(150deg, #d8e9ee 0%, #edf1ee 50%, #f7ebd7 100%);
  --start-frame: #e9e5dd; --start-dot: #c9c3b8; --start-line: rgba(28, 36, 48, .09); --start-shadow: 0 24px 60px rgba(28, 36, 48, .16); }
/* kein einzelnes Wort allein auf der letzten Zeile, vor allem auf dem Handy */
.start-home :is(p, li) { text-wrap: pretty; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .start-home { --start-stage: linear-gradient(150deg, #173641 0%, #182228 50%, #2c2417 100%);
    --start-frame: #232a33; --start-dot: #48525f; --start-line: rgba(255, 255, 255, .08); --start-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
}
:root[data-theme="dark"] .start-home { --start-stage: linear-gradient(150deg, #173641 0%, #182228 50%, #2c2417 100%);
  --start-frame: #232a33; --start-dot: #48525f; --start-line: rgba(255, 255, 255, .08); --start-shadow: 0 24px 60px rgba(0, 0, 0, .45); }

/* Kopf der Startseite: alles in der Mitte, darunter das Bild der App im Browser und auf dem Handy */
.start-hero-home { padding-top: calc(var(--top-h) - var(--top-pad) + clamp(40px, 7vw, 76px)); padding-bottom: 0; }
.start-hero-home::before { top: 150px; right: -90px; width: 240px; height: 240px; }
.start-hero-home .start-hero-inner { display: flex; flex-direction: column; align-items: center; max-width: 880px; text-align: center; }
.start-hero-home h1 { margin-bottom: 18px; font-size: clamp(2.3rem, 6.4vw, 4.3rem); line-height: 1.03; letter-spacing: -.04em; }
.start-hero-home .login-lead { max-width: 700px; margin-bottom: 30px; }
.start-hero-home .start-cta { justify-content: center; }
.start-access { margin: 16px 0 0; color: rgba(255, 255, 255, .78); font-size: .92rem; }
.start-access a, .start-final-note a { color: #fff; font-weight: 650; }
.start-hero-shots { position: relative; z-index: 1; max-width: 1060px; height: clamp(240px, 36vw, 480px); margin: clamp(40px, 6vw, 64px) auto 0; }
.start-window { position: absolute; inset: 0 0 auto 0; overflow: hidden; border-radius: 14px 14px 0 0; background: var(--start-frame); box-shadow: 0 30px 80px rgba(5, 25, 32, .5), 0 0 0 1px rgba(255, 255, 255, .14); }
.start-window-bar { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; }
.start-window-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--start-dot); }
.start-window-bar span { display: inline-flex; align-items: center; gap: 6px; margin: 0 auto; padding: 3px 14px; border-radius: 999px; background: var(--surface); color: var(--text-3); font-size: .78rem; font-weight: 600; transform: translateX(-27px); }
.start-phone { padding: 8px; border-radius: 40px; background: #0e1418; box-shadow: 0 30px 70px rgba(5, 25, 32, .45), inset 0 0 0 1px rgba(255, 255, 255, .12); }
.start-phone .start-shot { aspect-ratio: 390 / 844; border-radius: 32px; }
.start-hero-shots .start-phone { position: absolute; top: 64px; right: -36px; width: clamp(170px, 20vw, 236px); }

/* Vorteile unter dem Kopf */
.start-perks { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; max-width: calc(var(--start-max) + 2 * var(--start-pad)); margin: 0 auto; padding: 28px var(--start-pad) 0; list-style: none; }
.start-perks li { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: .92rem; font-weight: 600; }
.start-perks .icon { color: var(--accent-strong); }

/* Abschnitte: Titel in der Mitte, kleine Überschrift (Eyebrow) darüber */
.start-section { box-sizing: border-box; width: 100%; max-width: calc(var(--start-max) + 2 * var(--start-pad)); margin: 0 auto; padding: clamp(64px, 9vw, 112px) var(--start-pad) 0; }
.start-head { max-width: 760px; margin: 0 auto clamp(24px, 4vw, 40px); text-align: center; }
.start-head h2, .start-feature h2, .start-panel h2 { margin: 0 0 14px; color: var(--text); font-size: clamp(1.75rem, 3.6vw, 2.6rem); line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
.start-head p { margin: 0; color: var(--text-2); font-size: clamp(1rem, 1.5vw, 1.12rem); line-height: 1.6; }
.start-eyebrow { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 12px; color: var(--accent-strong); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.start-jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.start-jump button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 15px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); }
.start-jump button .icon { color: var(--accent-strong); }
.start-jump button:hover { border-color: var(--accent); color: var(--accent-strong); }

/* eine Funktion: Text und Bild nebeneinander, jede zweite gespiegelt; auf schmalen Bildschirmen das Bild unter dem Text */
.start-feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: clamp(28px, 5vw, 72px); padding: clamp(28px, 4vw, 52px) 0; scroll-margin-top: 12px; }
.start-feature.rev { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.start-feature.rev .start-feature-text { order: 2; }
.start-feature-text > p, .start-panel > p { margin: 0 0 20px; color: var(--text-2); font-size: 1.05rem; line-height: 1.6; }
.start-checks { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.start-checks li { display: flex; align-items: flex-start; gap: 10px; color: var(--text); font-size: .97rem; line-height: 1.45; }
.start-checks .icon { flex: none; margin-top: 2px; color: var(--accent-strong); }
.start-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 22px; color: var(--accent-strong); font-weight: 700; text-decoration: none; }
.start-link:hover { text-decoration: underline; }
/* Fläche um das Bild: am Computer oben links mit Rand, das Bild läuft rechts und unten hinaus (links stehen Titel und Namen),
   das Handy steht in der Mitte und läuft unten hinaus, der Screen ist ganz zu sehen */
.start-stage { position: relative; overflow: hidden; aspect-ratio: 5 / 4; border: 1px solid var(--start-line); border-radius: 28px; background: var(--start-stage); }
.start-stage > .start-shot { position: absolute; top: 9%; left: 8%; width: 112%; border: 1px solid var(--start-line); border-radius: 14px; box-shadow: var(--start-shadow); }
.start-stage.is-phone .start-phone { position: absolute; top: 8%; left: 50%; width: min(50%, 270px); transform: translateX(-50%); box-shadow: var(--start-shadow); }
.start-stage.is-screen { display: grid; place-items: center; }
.start-display { width: 88%; padding: 6px; border-radius: 16px; background: #0e1418; box-shadow: var(--start-shadow); }
.start-display .start-shot { aspect-ratio: 16 / 9; border-radius: 11px; }
/* ohne aspect-ratio (z. B. iOS 14) hätte die Fläche keine Höhe, die Bilder stehen ja frei darin */
@supports not (aspect-ratio: 1 / 1) {
  .start-stage { height: 0; padding-bottom: 80%; }
  .start-stage.is-screen { height: auto; padding: 24px 0; }
}

/* KI und Datenschutz nebeneinander, Datenschutz auf der Farbfläche der Marke */
.start-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.start-panel { padding: clamp(26px, 4vw, 44px); border: 1px solid var(--border); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.start-panel h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
.start-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.start-chips li { padding: 6px 13px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: .88rem; font-weight: 700; }
.start-privacy { position: relative; overflow: hidden; border: 0; color: #fff; background: linear-gradient(150deg, #2a7a91 0%, #1d5a6c 55%, #163f4e 100%); }
.start-privacy::before { content: ""; position: absolute; top: -56px; right: -56px; width: 150px; height: 150px; border-radius: 50%; background: #f4a63d; box-shadow: 0 18px 60px rgba(244, 166, 61, .35); }
.start-privacy > * { position: relative; }
.start-privacy h2, .start-privacy .start-checks li, .start-privacy .start-link { color: #fff; }
.start-privacy > p { color: rgba(255, 255, 255, .86); }
.start-privacy .start-eyebrow, .start-privacy .start-checks .icon { color: #f6b85c; }
.start-swap { display: grid; justify-items: start; gap: 6px; margin: 0 0 22px; padding: 14px 16px; border-radius: 16px; background: rgba(0, 0, 0, .18); font-size: .95rem; }
.start-swap .icon { margin-left: 16px; color: #f6b85c; }
.start-swap b { padding: 1px 7px; border-radius: 6px; background: rgba(255, 255, 255, .14); }

/* weitere Funktionen: vier, zwei oder eine Spalte */
.start-more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.start-more li { position: relative; display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); }
.start-more li:hover, .start-more li:focus-within { border-color: var(--accent); box-shadow: var(--shadow); }
.start-more-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); }
.start-more h3 { margin: 0 0 6px; font-size: 1.02rem; }
.start-more p { margin: 0; color: var(--text-2); font-size: .92rem; line-height: 1.5; }
/* «Mehr dazu» unten in der Karte; die ganze Karte ist der Link */
.start-more .start-link { margin-top: auto; padding-top: 14px; font-size: .9rem; }
.start-more .start-link::after { content: ""; position: absolute; inset: 0; }

/* zum Schluss: Motto und Knöpfe auf der Farbfläche */
.start-final-card { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 76px) clamp(20px, 5vw, 64px); border-radius: 32px; color: #fff; text-align: center; background: linear-gradient(150deg, #2a7a91 0%, #1d5a6c 55%, #163f4e 100%); }
.start-final-card::before { content: ""; position: absolute; bottom: -70px; left: -60px; width: 190px; height: 190px; border-radius: 50%; background: #f4a63d; box-shadow: 0 18px 60px rgba(244, 166, 61, .35); }
.start-final-card > * { position: relative; }
.start-final-card h2 { margin: 0 0 14px; color: #fff; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05; letter-spacing: -.035em; }
.start-final-card > p { max-width: 560px; margin: 0 auto 26px; color: rgba(255, 255, 255, .86); font-size: 1.05rem; line-height: 1.55; }
.start-final-card .start-cta { justify-content: center; }
.start-final-card > .start-final-note { margin: 16px auto 0; color: rgba(255, 255, 255, .78); font-size: .92rem; }
.start-home .start-foot { margin-top: clamp(48px, 7vw, 80px); }

/* Bewegung wie auf der Startseite von Lernspiegel: der Kopf baut sich beim Laden auf, das Handy schwebt leicht; weiter
   unten erscheinen die Teile beim Scrollen (.start-reveal, dann .is-in, gesetzt von startMotion() in app.js), die Bilder
   der Funktionen von der Seite her; Knöpfe, Links und Karten heben sich beim Darüberfahren. Mit «Bewegung reduzieren»
   und beim Drucken steht alles still. Verschoben wird mit translate/scale, damit transform der Elemente bleibt. */
@keyframes start-rise { from { opacity: 0; translate: 0 18px; } }
@keyframes start-lift { from { opacity: 0; translate: 0 56px; } }
@keyframes start-float { 50% { translate: 0 -7px; } }
@media screen and (prefers-reduced-motion: no-preference) {
  .start-home .start-hero-inner > * { animation: start-rise .9s cubic-bezier(.16, 1, .3, 1) both; }
  .start-home .start-hero-inner > :nth-child(2) { animation-delay: .08s; }
  .start-home .start-hero-inner > :nth-child(3) { animation-delay: .16s; }
  .start-home .start-hero-inner > :nth-child(4) { animation-delay: .24s; }
  .start-home .start-hero-inner > :nth-child(5) { animation-delay: .32s; }
  .start-home .start-hero-shots .start-window { animation: start-lift 1.2s .3s cubic-bezier(.16, 1, .3, 1) both; }
  .start-home .start-hero-shots .start-phone { animation: start-lift 1.2s .5s cubic-bezier(.16, 1, .3, 1) both, start-float 7s 1.8s ease-in-out infinite; }

  /* Erscheinen: verborgen ohne Übergang, sichtbar mit Übergang (--start-delay: nacheinander) */
  .start-reveal { opacity: 0; translate: 0 28px; }
  /* Bilder neben dem Text kommen von ihrer Seite (untereinander auf schmalen Bildschirmen von unten) */
  @media (min-width: 861px) {
    .start-feature .start-reveal.start-stage { translate: 32px 0; }
    .start-feature.rev .start-reveal.start-stage { translate: -32px 0; }
  }
  .start-reveal.start-final-card { scale: .97; }
  .start-reveal > .start-shot { translate: 24px 16px; }
  .start-reveal > .start-phone { opacity: 0; translate: 0 40px; }
  .start-reveal .start-display { scale: .94; }
  .start-reveal.is-in, .start-feature .start-reveal.is-in.start-stage { opacity: 1; translate: none; scale: none;
    transition: opacity .65s ease, translate .9s cubic-bezier(.16, 1, .3, 1), scale .9s cubic-bezier(.16, 1, .3, 1); transition-delay: var(--start-delay, 0s); }
  .start-reveal.is-in > .start-shot, .start-reveal.is-in .start-display { translate: none; scale: none;
    transition: translate 1.1s cubic-bezier(.16, 1, .3, 1), scale 1.1s cubic-bezier(.16, 1, .3, 1); transition-delay: calc(var(--start-delay, 0s) + .05s); }
  .start-reveal.is-in > .start-phone { opacity: 1; translate: none;
    transition: opacity .65s ease, translate 1.1s cubic-bezier(.16, 1, .3, 1); transition-delay: calc(var(--start-delay, 0s) + .3s); }

  /* beim Darüberfahren */
  .start-home .start-cta .btn { transition: background .12s, border-color .12s, box-shadow .12s, translate .25s ease; }
  .start-home .start-cta .btn:hover { translate: 0 -2px; }
  .start-home .start-link .icon { transition: translate .25s ease; }
  .start-home .start-link:hover .icon { translate: 3px 0; }
  .start-jump button { transition: border-color .2s, color .2s, translate .25s ease; }
  .start-jump button:hover { translate: 0 -2px; }
  .start-more li { transition: border-color .2s, box-shadow .2s, translate .3s cubic-bezier(.16, 1, .3, 1); }
  .start-more li:hover { translate: 0 -4px; }
}

/* schmaler: die Sonne steht unten hinter dem Handy statt neben dem Text */
@media (max-width: 1199px) {
  .start-hero-home::before { top: auto; bottom: 130px; right: -70px; width: 180px; height: 180px; }
}
/* acht Karten: unter 1180 px zwei Spalten statt vier schmaler (z. B. Tablet quer) */
@media (max-width: 1180px) {
  .start-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .start-feature, .start-feature.rev { grid-template-columns: minmax(0, 1fr); }
  .start-feature.rev .start-feature-text { order: 0; }
  .start-duo { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .start-hero-shots { max-width: 290px; height: 330px; }
  .start-hero-shots .start-window { display: none; }
  .start-hero-shots .start-phone { top: 0; right: auto; left: 50%; width: 250px; transform: translateX(-50%); }
  .start-stage > .start-shot { width: 140%; }
  /* Vorteile untereinander: eine Spalte in der Mitte, links bündig, die Symbole genau untereinander; ein langer Punkt
     bricht um, das Symbol bleibt auf der ersten Zeile */
  .start-perks { display: grid; justify-content: center; gap: 12px; }
  .start-perks li { align-items: flex-start; max-width: 19em; }
  .start-perks li .icon { margin-top: .24em; }
}
/* bis 800 px passen die Links nicht neben Logo und «Anmelden»: Menüknopf */
@media (max-width: 800px) {
  /* Menü: nur Logo, «Anmelden» und der Menüknopf in der Leiste; aufgeklappt stehen die Links und der Knopf für das Design
     in einer Liste unter der Leiste, über dem Inhalt (auch gescrollt, ohne dass die Seite springt) */
  .start-actions { margin-left: auto; }
  .start-menu-btn { display: grid; }
  .start-links { display: none; position: absolute; top: calc(100% + 6px); left: var(--top-x); right: var(--top-x); flex-direction: column; align-items: stretch; gap: 2px;
    max-height: calc(100vh - var(--top-h) - 12px); max-height: calc(100dvh - var(--top-h) - 12px); overflow-y: auto; margin: 0; padding: 8px;
    border: 1px solid rgba(255, 255, 255, .22); border-radius: 16px; background: #1a5264; box-shadow: 0 18px 40px rgba(5, 25, 32, .35); }
  .start-top.open .start-links { display: flex; }
  .start-links .start-nav-link { min-height: 46px; padding: 0 14px; font-size: 1rem; }
  .start-links .start-theme { display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; margin: 0; padding: 0 14px; border: 0; border-radius: 10px;
    background: none; color: rgba(255, 255, 255, .86); font: inherit; font-size: 1rem; font-weight: 600; text-align: left; }
  .start-links .start-theme:hover { background: rgba(255, 255, 255, .1); color: #fff; }
  .start-theme-label { display: inline; }
}
/* Tablet hoch: das Menü rechts unter dem Menüknopf statt über die ganze Breite */
@media (min-width: 561px) and (max-width: 800px) { .start-links { left: auto; width: 300px; } }
@media (max-width: 640px) {
  .start-hero::before { top: auto; bottom: -36px; right: 22px; width: 72px; height: 72px; }
  .start-hero-home::before { top: auto; bottom: 150px; right: -34px; width: 96px; height: 96px; }
  .start-final-card::before { bottom: auto; left: auto; top: -46px; right: -46px; width: 104px; height: 104px; }
  .start-privacy::before { top: -46px; right: -46px; width: 104px; height: 104px; }
  .start-top .btn { padding: 0 12px; }
  .start-cta .btn { flex: 1 1 100%; justify-content: center; }
  .start-more { grid-template-columns: minmax(0, 1fr); }
  .start-stage { border-radius: 22px; }
}
/* Handy: Logo, «Anmelden» (ohne Symbol) und Menüknopf kleiner, damit sie bis 360 px in einer Zeile stehen; die Leiste
   ist niedriger */
@media (max-width: 440px) {
  .start { --top-logo: 38px; --top-pad: 12px; }
  .start-top .login-logo { gap: 10px; font-size: 1.15rem; }
  .start-top .login-logo-img { width: 38px; height: 38px; }
  .start-menu-btn { width: 38px; height: 38px; }
  .start .btn.start-top-login { min-height: 38px; }
  .start-top .start-top-login .icon { display: none; }
  .start-actions { gap: 6px; }
}
/* noch schmaler (320 px): nur das Logo ohne Schriftzug */
@media (max-width: 359px) {
  .start-top .login-logo span { display: none; }
}

/* Anmeldeseite (/anmelden): auf der Farbfläche das Logo und eine Karte mit dem Formular */
.signin { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 32px 16px 20px; isolation: isolate; }
/* der orange Kreis schaut oben rechts hinter der Karte hervor, bei jeder Breite beim Formular */
.signin::before { content: none; }
.signin-card::after { content: ""; position: absolute; z-index: -1; top: -48px; right: -56px; width: 136px; height: 136px; border-radius: 50%; background: #f4a63d; box-shadow: 0 18px 60px rgba(244, 166, 61, .35); pointer-events: none; }
.signin-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; color: #fff; font-size: 1.3rem; font-weight: 700; text-decoration: none; }
.signin-card { position: relative; width: min(400px, 100%); box-sizing: border-box; padding: 30px 28px 24px; border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .28); }
.signin-card h1 { margin: 0 0 6px; font-size: 1.6rem; letter-spacing: -.02em; }
.signin-card > p.muted { margin: 0 0 24px; }
.signin-card form { display: flex; flex-direction: column; gap: 16px; }
.signin-card .input { min-height: 46px; }
.signin-card .btn.primary { min-height: 48px; margin-top: 4px; font-size: 1rem; }
.signin-card > p.signin-hint { margin: 20px 0 0; }
.signin-card > .btn.signin-wide { width: 100%; min-height: 48px; }
.signin-card > .btn.signin-wide + .btn.signin-wide { margin-top: 10px; }
.signin-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.pw-wrap { position: relative; }
.pw-wrap .input { width: 100%; padding-right: 48px; }
.pw-toggle { position: absolute; top: 50%; right: 6px; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--text-3); cursor: pointer; transform: translateY(-50%); }
.pw-toggle:hover, .pw-toggle:focus-visible { background: var(--surface-2); color: var(--text); }
/* «Screen ohne Konto ausprobieren» unter der Karte */
.signin-try { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; background: rgba(255, 255, 255, .08); color: #fff; font-weight: 600; text-decoration: none; }
.signin-try:hover { background: rgba(255, 255, 255, .16); }
.signin-foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; color: rgba(255, 255, 255, .8); }
.signin-foot a { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.signin-foot a:hover { color: #fff; text-decoration: underline; }
/* Handy: Fusszeilen ohne Trennpunkte (sie blieben am Zeilenrand stehen), dafür mehr Abstand und grössere Tippflächen */
@media (max-width: 560px) {
  :is(.app-foot, .start-foot, .signin-foot) > [aria-hidden] { display: none; }
  :is(.app-foot, .start-foot, .signin-foot) { column-gap: 18px; }
  :is(.app-foot, .start-foot, .signin-foot) a { display: inline-flex; align-items: center; min-height: 32px; }
}
@media (max-width: 640px) {
  .signin { justify-content: flex-start; padding-top: 28px; }
  .signin-card::after { top: -30px; right: -6px; width: 80px; height: 80px; }
  .signin-card { padding: 24px 20px 20px; }
}

/* Meldung des Servers ohne die App (View::message, z. B. kein Beispiel-Screen): das Logo darüber, auf dem Handy mit Rand */
.message-page { max-width: 560px; margin: 0 auto; padding: 48px 16px; }
.message-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; color: var(--text); font-size: 1.2rem; font-weight: 700; text-decoration: none; }
.message-brand img { border-radius: 10px; }

/* Datenschutz und Impressum (/datenschutz, /impressum): ohne Anmeldung unter dem Kopf der Startseite, angemeldet in der App */
.legal-hero { padding-top: var(--top-h); padding-bottom: calc(22px - var(--top-pad)); }
/* die Sonne schaut oben rechts aus der Ecke, neben «Anmelden» bzw. dem Menüknopf; erst wenn rechts davon genug Platz ist,
   steht sie grösser da */
.legal-hero::before { top: -105px; right: -95px; width: 150px; height: 150px; }
@media (max-width: 640px) { .legal-hero::before { top: -112px; right: -102px; } }
@media (min-width: 1380px) { .legal-hero::before { top: -64px; right: -48px; } }
.legal-main { padding: clamp(24px, 5vw, 48px) var(--top-x, 16px) 8px; } /* seitlich wie der Kopf */
.legal { max-width: 760px; margin: 0 auto; padding: clamp(22px, 4vw, 36px); border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); line-height: 1.6; overflow-wrap: break-word; }
.main > .legal { margin-top: 8px; }
.legal h1 { margin: 0 0 4px; color: var(--text); font-size: clamp(1.6rem, 3.4vw, 2.1rem); letter-spacing: -.02em; }
.legal-meta { margin: 0 0 22px; color: var(--text-3); font-size: .88rem; }
.legal h2 { margin: 0 0 10px; font-size: 1.12rem; letter-spacing: -.01em; }
.legal section { padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--border); scroll-margin-top: 16px; }
.legal p, .legal li { color: var(--text-2); font-size: .95rem; }
.legal p { margin: 0 0 10px; }
.legal p:last-child { margin-bottom: 0; }
.legal ul { margin: 0 0 10px; padding-left: 1.2em; }
.legal li + li { margin-top: 6px; }
.legal strong { color: var(--text); }
.legal a { color: var(--accent-strong); }
.legal address { margin: 0 0 10px; font-style: normal; color: var(--text); }
.legal-short { padding: 16px 18px; border-radius: 12px; background: var(--accent-soft); }
.legal-short h2 { font-size: 1rem; }
.legal-short ul { margin: 0; }
.legal-short li { color: var(--text); }
.legal-toc { margin-top: 22px; }
.legal-toc ol { margin: 0; padding-left: 1.4em; columns: 2 220px; column-gap: 28px; }
.legal-toc li { margin: 0 0 4px; break-inside: avoid; font-size: .92rem; }

/* Über uns (/ueber-uns, about.js): Titel in der Mitte, darunter Idee, Person, Haltung und weitere Projekte als Karten und
   zum Schluss der Kontakt auf der Farbfläche der Marke; ohne Anmeldung unter dem Kopf der Startseite, angemeldet in der App */
.about { max-width: 960px; margin: 0 auto; }
.about-head { padding: clamp(4px, 2vw, 16px) 0 clamp(8px, 2vw, 16px); text-align: center; }
.about-eyebrow { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 12px; color: var(--accent-strong); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.about-head h1 { margin: 0 0 14px; color: var(--text); font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -.035em; }
.about-lead { max-width: 640px; margin: 0 auto; color: var(--text-2); font-size: clamp(1.02rem, 1.6vw, 1.15rem); line-height: 1.6; }
.about-section { margin-top: clamp(28px, 5vw, 48px); }
.about-section > h2, .about-contact h2 { margin: 0 0 14px; color: var(--text); font-size: clamp(1.3rem, 2.6vw, 1.7rem); letter-spacing: -.02em; }
.about-card { padding: clamp(20px, 3.5vw, 32px); border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.about-card p, .about-tiles p { margin: 0 0 12px; color: var(--text-2); line-height: 1.65; }
.about-card p:last-child, .about-tiles p:last-child { margin-bottom: 0; }
.about-quote { padding-left: 16px; border-left: 3px solid #f4a63d; font-size: 1.15rem; font-weight: 700; }
.about-card .about-quote { color: var(--text); }
.about-person { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 20px; }
.about-avatar { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(150deg, #2a7a91 0%, #1d5a6c 55%, #163f4e 100%);
  color: #fff; font-size: 1.45rem; font-weight: 800; letter-spacing: .02em; box-shadow: 0 0 0 4px var(--accent-soft); }
.about-person h3 { margin: 0; font-size: 1.2rem; }
.about-card .about-role { margin: 2px 0 10px; color: var(--accent-strong); font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.about a:not(.btn) { color: var(--accent-strong); font-weight: 650; }
.about-person a, .about-tiles a { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; text-decoration: none; }
.about-person a:hover, .about-tiles a:hover { text-decoration: underline; }
.about-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.about-tiles li { padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.about-tiles h3 { margin: 0 0 6px; font-size: 1.02rem; }
.about-tiles p { font-size: .93rem; line-height: 1.55; }
.about-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); }
.about-note { margin: 16px 0 0; color: var(--text-2); font-size: .95rem; line-height: 1.6; }
.about-contact { position: relative; overflow: hidden; margin-top: clamp(32px, 6vw, 56px); padding: clamp(28px, 5vw, 48px) clamp(20px, 5vw, 48px); border-radius: 24px; text-align: center;
  color: #fff; background: linear-gradient(150deg, #2a7a91 0%, #1d5a6c 55%, #163f4e 100%); }
.about-contact::before { content: ""; position: absolute; top: -50px; right: -50px; width: 140px; height: 140px; border-radius: 50%; background: #f4a63d; box-shadow: 0 18px 60px rgba(244, 166, 61, .35); }
.about-contact > * { position: relative; }
.about-contact h2 { color: #fff; }
.about-contact p { max-width: 560px; margin: 0 auto 22px; color: rgba(255, 255, 255, .86); line-height: 1.6; }
.about .about-contact a:not(.btn) { color: #fff; }
.about-contact .btn.about-mail { min-height: 48px; padding: 0 20px; border-color: transparent; background: #f4a63d; color: #1d2b30; font-weight: 700; }
.about-contact .btn.about-mail:hover { background: #f6b85c; }
.legal-main > .about { padding-bottom: 8px; }
@media (max-width: 640px) {
  .about-tiles { grid-template-columns: minmax(0, 1fr); }
  .about-person { grid-template-columns: minmax(0, 1fr); }
  .about-contact::before { top: -44px; right: -44px; width: 88px; height: 88px; }
}
/* Changelog (/changelog): links die Versionen, rechts je eine Karte; auf dem Handy die Versionen oben als Knöpfe */
.changelog { max-width: 1040px; margin: 0 auto; }
.main > .changelog { margin-top: 8px; }
.cl-hero { margin: 0 0 22px; }
.cl-hero h1 { margin: 0 0 6px; color: var(--text); font-size: clamp(1.6rem, 3.4vw, 2.1rem); letter-spacing: -.02em; }
.cl-hero p { margin: 0; color: var(--text-2); }
.cl-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.cl-nav { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; }
.cl-nav-title { margin-bottom: 4px; padding: 0 10px 8px; border-bottom: 1px solid var(--border); color: var(--text-3); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.cl-nav-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.cl-nav-list a { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-left: 2px solid transparent; border-radius: 8px; color: var(--text-2); text-decoration: none; }
.cl-nav-list a:hover { background: var(--surface-2); color: var(--text); }
.cl-nav-list a.active { border-left-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.cl-nav-version { font-size: .88rem; font-weight: 700; }
.cl-nav-date { color: var(--text-3); font-size: .74rem; }
.cl-nav-name { color: var(--text); font-size: .8rem; font-weight: 600; line-height: 1.3; }
.cl-nav-list a.active .cl-nav-name { color: inherit; }
.cl-nav-list a.active .cl-nav-date { color: inherit; opacity: .8; }
.cl-nav-more { display: none; }
.cl-nav-more button { padding: 5px 10px; border: 1px dashed var(--border); border-radius: 8px; background: none; color: var(--accent); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.cl-entry { margin-bottom: 18px; padding: 22px 26px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); scroll-margin-top: 16px; }
.cl-entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 14px; }
.cl-version { margin: 0; color: var(--accent-strong); font-size: 1.15rem; }
.cl-name { color: var(--text); font-weight: 650; }
.cl-date { color: var(--text-3); font-size: .85rem; }
.cl-badge { padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.cl-section + .cl-section { margin-top: 14px; }
.cl-section-title { display: inline-block; margin: 0 0 8px; padding: 2px 10px; border-radius: 999px; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.cl-section-title.added { background: var(--success-soft); color: var(--success); }
.cl-section-title.changed { background: var(--warn-soft); color: var(--warn); }
.cl-section-title.fixed { background: var(--danger-soft); color: var(--danger); }
.cl-list { margin: 0; padding: 0; list-style: none; }
.cl-list li { position: relative; padding-left: 18px; font-size: .92rem; line-height: 1.6; overflow-wrap: break-word; }
.cl-list li + li { margin-top: 4px; }
.cl-list li::before { content: '•'; position: absolute; left: 2px; color: var(--text-3); }
/* Unterpunkte: kleiner und grauer, mit einer Linie links */
.cl-list .cl-list { margin: 6px 0 4px 2px; padding-left: 10px; border-left: 1px solid var(--border); }
.cl-list .cl-list li { padding-left: 14px; color: var(--text-2); font-size: .86rem; line-height: 1.55; }
.cl-list .cl-list li + li { margin-top: 2px; }
.cl-list .cl-list li::before { content: '-'; font-weight: 600; }
@media (max-width: 900px) {
  .cl-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .cl-nav { position: static; max-height: none; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
  .cl-nav-title { padding: 0 0 8px; }
  .cl-nav-list { gap: 6px; }   /* mit Namen gleich breit untereinander */
  .cl-nav-list a { padding: 5px 10px; border: 1px solid var(--border); }
  .cl-nav-list a.active { border-color: var(--accent); }
  .cl-nav-list .cl-nav-older { display: none; }
  .cl-nav-list.open .cl-nav-older { display: block; }
  .cl-nav-more { display: block; }
  .cl-nav-list.open .cl-nav-more { display: none; }
}
@media (max-width: 640px) { .cl-entry { padding: 16px; } }

/* Hilfe (/hilfe), aufgebaut wie die Hilfe von Lernspiegel: oben die Suche, links das Inhaltsverzeichnis, rechts die
   Abschnitte als Karten mit Einträgen zum Aufklappen; auf dem Handy ohne Inhaltsverzeichnis (die Kopfzeilen genügen) */
.help { max-width: 1100px; margin: 0 auto; }
.main > .help { margin-top: 8px; }
.help-hero { padding: 6px 0 26px; text-align: center; }
.help-hero h1 { margin: 0 0 6px; color: var(--text); font-size: clamp(1.6rem, 3.4vw, 2.1rem); letter-spacing: -.02em; }
.help-hero > p { margin: 0; color: var(--text-2); }
.help-search { max-width: 560px; margin: 18px auto 0; }
.help-search-field { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.help-search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.help-search-icon { flex: none; margin: 0 4px 0 14px; color: var(--text-3); }
.help-search-input { flex: 1; min-width: 0; padding: 12px 8px; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: .95rem; }
.help-search-input::-webkit-search-cancel-button { display: none; }
.help-search-clear { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; margin-right: 6px; border: 0; border-radius: 50%; background: none; color: var(--text-2); cursor: pointer; }
.help-search-clear:hover { background: var(--surface-3); color: var(--text); }
.help-search-count { min-height: 1.3em; margin: 12px 0 0; color: var(--text-2); font-size: .85rem; }
.help-search-count strong { color: var(--accent-strong); }
.help-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.help-nav { position: sticky; top: calc(var(--m-top-h, 0px) + 16px); max-height: calc(100vh - var(--m-top-h, 0px) - 32px); overflow-y: auto; padding: 12px 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); scrollbar-width: thin; }
.help-nav-title { padding: 0 8px 8px; color: var(--text-3); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.help-nav a { display: grid; grid-template-columns: 2em minmax(0, 1fr); align-items: baseline; padding: 6px 8px; border-radius: 8px; color: var(--text-2); font-size: .85rem; font-weight: 500; line-height: 1.4; text-decoration: none; }
.help-nav a + a { margin-top: 1px; }
.help-nav a:hover, .help-nav a.active { background: var(--accent-soft); color: var(--accent-strong); }
.help-nav a.disabled { opacity: .35; pointer-events: none; }
.help-nav-num { color: var(--text-3); font-variant-numeric: tabular-nums; }
.help-nav a.active .help-nav-num { color: inherit; }
/* Abschnitt: die Karte; zugeklappt bleibt die Kopfzeile mit der Anzahl Einträge */
.help-section { margin-bottom: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; scroll-margin-top: 16px; }
.help-section-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; cursor: pointer; user-select: none; }
.help-section-head:hover { background: var(--surface-2); }
.help-section-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 16px; }
.help-section:not(.collapsed) .help-section-head { border-bottom: 1px solid var(--border); }
.help-section.collapsed .help-section-body { display: none; }
.help-section-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 10px; }
.help-section-icon.tone-accent { background: var(--accent-soft); color: var(--accent-strong); }
.help-section-icon.tone-success { background: var(--success-soft); color: var(--success); }
.help-section-icon.tone-warn { background: var(--warn-soft); color: var(--warn); }
.help-section-icon.tone-now { background: var(--now-soft); color: var(--now); }
.help-section-icon.tone-danger { background: var(--danger-soft); color: var(--danger); }
.help-section-head h2 { min-width: 0; margin: 0; color: var(--text); font-size: 1.08rem; overflow-wrap: anywhere; }
.help-section-count { margin-left: auto; color: var(--text-3); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.help-section-chevron { flex: none; color: var(--text-3); transition: transform .18s; }
.help-section:not(.collapsed) .help-section-chevron { transform: rotate(90deg); }
.help-intro { margin: 0; padding: 12px 18px 2px; color: var(--text-2); font-size: .9rem; }
.help-group { margin: 18px 0 6px; padding: 0 18px; color: var(--text-3); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
/* Einträge: schlichte Zeilen mit feiner Trennlinie, der geöffnete hebt sich als Fläche ab */
.help-entry { border-bottom: 1px solid var(--border); scroll-margin-top: 16px; }
.help-entry:last-child { border-bottom: 0; }
.help-entry[open] { background: var(--surface-2); }
.help-entry > summary { display: flex; align-items: center; gap: 8px; padding: 13px 18px; color: var(--text); font-size: .93rem; font-weight: 600; cursor: pointer; list-style: none; }
.help-entry > summary::-webkit-details-marker { display: none; }
.help-entry > summary:hover { background: var(--surface-3); }
.help-entry[open] > summary { border-bottom: 1px solid var(--border); }
.help-entry-title { min-width: 0; overflow-wrap: anywhere; }
.help-entry-chevron { flex: none; margin-left: auto; color: var(--text-3); transition: transform .2s; }
.help-entry[open] .help-entry-chevron { transform: rotate(180deg); }
/* Link auf den Eintrag (kopiert ihn): beim Darüberfahren und mit der Tastatur */
.help-anchor { color: var(--text-3); font-weight: 700; text-decoration: none; opacity: 0; transition: opacity .15s; }
.help-entry > summary:hover .help-anchor, .help-anchor:focus-visible { opacity: 1; }
.help-anchor:hover { color: var(--accent-strong); }
@media (hover: none) { .help-anchor { display: none; } }
.help-entry-body { padding: 14px 22px 18px 18px; color: var(--text-2); font-size: .9rem; line-height: 1.7; }
.help-entry-body p { margin: 0 0 10px; }
.help-entry-body > :last-child { margin-bottom: 0; }
.help-entry-body ol, .help-entry-body ul { margin: 6px 0 10px; padding-left: 1.3em; }
.help-entry-body li + li { margin-top: 4px; }
.help-entry-body strong { color: var(--text); font-weight: 650; }
.help-entry-body a, .help-intro a, .help-more a { color: var(--accent-strong); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; }
.help-entry-body a:hover, .help-intro a:hover, .help-more a:hover { text-decoration-color: currentColor; }
.help-tip { display: flex; gap: 8px; margin: 10px 0; padding: 10px 14px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--accent-soft); color: var(--text); font-size: .86rem; line-height: 1.6; }
.help-tip .icon { flex: none; margin-top: 3px; color: var(--accent-strong); }
.help-empty { padding: 36px 16px; color: var(--text-2); text-align: center; }
.help-empty p { margin: 0 0 6px; }
.help-more { margin: 18px 0 0; color: var(--text-3); text-align: center; }
@media (max-width: 760px) {
  .help-hero { padding-bottom: 12px; }
  .help-layout { grid-template-columns: minmax(0, 1fr); }
  .help-nav { display: none; }
}
@media (max-width: 480px) {
  .help-section-count { display: none; }
  .help-section-chevron { margin-left: auto; }
  .help-section-head, .help-entry > summary { padding-left: 14px; padding-right: 14px; }
  .help-entry-body { padding: 12px 14px 16px; }
  .help-intro { padding: 12px 14px 2px; }
  .help-group { padding: 0 14px; }
}

/* Ankündigungen (announcements.js): Banner über der Seite, Fenster, Vorschau in der Verwaltung; Farbe über --ann-* */
.ann-strip { display: grid; gap: 10px; width: 100%; max-width: 1760px; padding: 18px clamp(16px, 3vw, 40px) 0; }
.ann-strip:empty { display: none; }
.ann-strip:not(:empty) + .main { padding-top: 16px; }
.ann-public { max-width: 1120px; margin: 0 auto; padding: 14px 16px 0; }
.signin .ann-public { position: relative; z-index: 1; width: min(440px, 100%); margin: 0; padding: 0; }
.ann-info { --ann-bg: var(--accent-soft); --ann-ink: var(--accent-strong); }
.ann-success { --ann-bg: var(--success-soft); --ann-ink: var(--success); }
.ann-warning { --ann-bg: var(--warn-soft); --ann-ink: var(--warn); }
.ann-error { --ann-bg: var(--danger-soft); --ann-ink: var(--danger); }
.ann-banner { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--ann-ink) 28%, transparent); border-radius: 12px; background: var(--ann-bg); color: var(--text); font-size: .92rem; line-height: 1.5; box-shadow: var(--shadow-sm); }
.ann-icon { display: inline-flex; flex: none; margin-top: 1px; color: var(--ann-ink); }
.ann-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ann-text p { margin: 0; }
.ann-text p + p { margin-top: 6px; }
.ann-title { display: block; margin-bottom: 2px; }
.ann-text a { color: var(--ann-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ann-close { flex: none; margin: -6px -8px -6px 0; }
.ann-popup { display: flex; align-items: flex-start; gap: 12px; line-height: 1.55; }
.ann-popup > .ann-icon { align-items: center; justify-content: center; width: 34px; height: 34px; margin: 0; border-radius: 10px; background: var(--ann-bg); }
.ann-popup .ann-text { padding-top: 5px; }
/* Fenster als Vorschau in der Verwaltung */
.ann-popup-card { max-width: 460px; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.ann-popup-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ann-popup-head .icon { color: var(--text-3); }
.ann-popup-card .ann-popup { padding: 14px 16px; font-size: .92rem; }
.ann-popup-foot { display: flex; justify-content: flex-end; padding: 0 16px 14px; }
.ann-popup-foot .btn { pointer-events: none; }
/* Verwaltung → Ankündigungen */
.ann-admin-intro { margin: 0; flex: 1 1 260px; }
.ann-admin-list { display: grid; gap: 12px; }
.ann-admin-item { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.ann-admin-muted > .ann-banner, .ann-admin-muted > .ann-popup-card { opacity: .6; }
.ann-admin-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ann-admin-meta .small { display: inline-flex; align-items: center; gap: 4px; }
.ann-admin-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ann-admin-foot > .grow { flex: 1 1 220px; }
.ann-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: start; }
.ann-form .seg { display: flex; flex-wrap: wrap; align-self: flex-start; max-width: 100%; }
.ann-form .seg-btn { flex: 0 1 auto; white-space: nowrap; }
.ann-admin-item .ann-close { pointer-events: none; }
/* Verwaltung → Instagram: Posts in der Reihenfolge zum Posten, gepostete zugeklappt */
.ig-intro { margin: 0; flex: 1 1 260px; }
.ig-list { display: grid; gap: 22px; }
.ig-group { display: grid; gap: 10px; }
.ig-group-head h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; font-size: 1rem; }
.ig-group-head p { margin: 2px 0 0; }
.ig-post { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.ig-post > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.ig-post > summary::-webkit-details-marker { display: none; }
.ig-nr { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: .9rem; }
.ig-done .ig-nr { background: var(--success-soft); color: var(--success); }
.ig-title { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.ig-title strong { overflow-wrap: anywhere; }
.ig-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ig-chips .chip { display: inline-flex; align-items: center; gap: 4px; }
.ig-caret { flex: none; color: var(--text-2); transition: transform .15s; }
.ig-post[open] .ig-caret { transform: rotate(180deg); }
.ig-body { display: grid; gap: 12px; padding: 0 14px 14px; }
.ig-slides { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
.ig-thumb { position: relative; flex: none; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); cursor: zoom-in; scroll-snap-align: start; }
.ig-thumb img { display: block; width: 108px; height: 135px; object-fit: cover; }
.ig-thumb span { position: absolute; right: 4px; bottom: 4px; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .75rem; font-weight: 600; text-align: center; }
.ig-thumb:hover, .ig-thumb:focus-visible { border-color: var(--accent); }
.ig-alt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; }
.ig-alt a { display: inline-flex; align-items: center; gap: 4px; }
.ig-text-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: -6px; }
.ig-text { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.5; max-height: 260px; overflow-y: auto; }
.ig-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ig-actions > .grow { flex: 1 1 0; }
.ig-posted { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ig-date { width: auto; min-width: 0; }
.ig-view { display: grid; place-items: center; }
.ig-view-img { display: block; max-width: 100%; max-height: min(70vh, 760px); width: auto; height: auto; border-radius: 8px; }
@media (max-width: 640px) {
  .ig-post > summary { flex-wrap: wrap; padding: 10px 12px; }
  .ig-title { flex-basis: calc(100% - 80px); }
  .ig-chips { order: 4; flex-basis: 100%; justify-content: flex-start; padding-left: 42px; }
  .ig-chips:empty { display: none; }
  .ig-body { padding: 0 12px 12px; }
  .ig-thumb img { width: 96px; height: 120px; }
  .ig-actions > .grow { display: none; }
}
.ann-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; margin-top: 8px; }
.ann-pages[hidden] { display: none; }
.ann-seg-info::before, .ann-seg-success::before, .ann-seg-warning::before, .ann-seg-error::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; vertical-align: 0; }
.ann-seg-info::before { background: var(--accent); }
.ann-seg-success::before { background: var(--success); }
.ann-seg-warning::before { background: var(--warn); }
.ann-seg-error::before { background: var(--danger); }
.ann-preview { display: grid; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--border); }
.ann-preview-label { font-weight: 600; }

/* Zahl bei «Support» in der Navigation (auch auf dem Teil «Support» der Verwaltung) und Punkt auf «Mehr» */
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--danger); color: var(--on-color); font-size: .72rem; font-weight: 700; line-height: 1.4; text-align: center; }
.nav-count[hidden] { display: none; }
.seg-btn .nav-count { margin-left: 6px; }
.bottom-nav .more-btn { position: relative; }
.bottom-nav .more-btn.has-dot::after { content: ""; position: absolute; top: 6px; right: calc(50% - 17px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }

/* Support (pages/support.js für Lehrpersonen, pages/support-admin.js in der Verwaltung) */
.sup-page { display: grid; gap: 14px; max-width: 920px; }
.page-head:has(+ .sup-page) { max-width: 920px; } /* «Neue Anfrage» über dem Inhalt statt ganz rechts am breiten Bildschirm */
.sup-tip { align-items: center; }
.sup-tip a { color: var(--accent-strong); font-weight: 600; }
.sup-list { overflow: hidden; }
.sup-item { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.sup-item:first-child { border-top: 0; }
.sup-item:hover { background: var(--surface-2); }
.sup-item-main { display: grid; flex: 1; gap: 2px; min-width: 0; }
.sup-item-title { display: flex; align-items: center; gap: 8px; font-weight: 600; overflow-wrap: anywhere; }
.sup-item.unread .sup-item-title { font-weight: 750; }
.sup-item-chevron { flex: none; color: var(--text-3); }
.sup-dot { display: inline-block; flex: none; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.sup-item-title .sup-dot { margin-right: 0; }
.sup-head-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sup-thread { display: grid; gap: 10px; }
.sup-msg { padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.sup-msg.sup-support { border-left: 3px solid var(--accent); }
.sup-msg.sup-internal { border-style: dashed; background: var(--surface-2); }
.sup-msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; font-size: .86rem; }
.sup-msg-label { color: var(--accent-strong); font-size: .78rem; font-weight: 650; }
.sup-internal .sup-msg-label { color: var(--text-3); font-style: italic; }
.sup-msg-time { margin-left: auto; color: var(--text-3); font-size: .78rem; }
.sup-msg-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.sup-reply { display: grid; gap: 10px; }
.sup-reply p.small { margin: 0; }
.sup-reply-foot { justify-content: flex-end; }
.sup-hints { padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); font-size: .88rem; }
.sup-hints p { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-weight: 600; }
.sup-hints ul { margin: 0; padding-left: 1.2em; }
.sup-hints a { color: var(--accent-strong); }
.sup-kpis { margin-bottom: 16px; }
.sup-search { flex: 1 1 220px; }
.sup-grid tbody tr { cursor: pointer; }
.sup-grid tbody tr:hover, .sup-grid tbody tr:focus-visible { background: var(--surface-2); outline: none; }
.sup-grid td { vertical-align: top; }
.sup-grid td.sup-cell-subject { min-width: 220px; white-space: normal; }
.sup-cell-subject strong { overflow-wrap: anywhere; }
.sup-grid tr.fresh strong { font-weight: 750; }
.sup-back { margin-bottom: 10px; }
.sup-detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.sup-side { display: grid; gap: 12px; }
.sup-side-card h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .95rem; }
.sup-info { display: grid; gap: 8px; margin: 10px 0 0; font-size: .88rem; }
.sup-info dt { color: var(--text-3); font-size: .78rem; }
.sup-info dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 1000px) { .sup-detail { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .sup-item { flex-wrap: wrap; padding: 12px 14px; }
  .sup-item-main { flex-basis: calc(100% - 30px); }
  .sup-item-chevron { order: -1; display: none; }
}

/* Installer (ohne JS) */
body.install { background: var(--bg); padding: 30px 16px; }
.install-card { max-width: 620px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.install-card h1 { margin-bottom: 10px; }
.install-logo { display: block; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 13px; }
.install-card fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 16px; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.install-card legend { font-weight: 650; padding: 0 6px; }
.install-card label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 600; color: var(--text-2); flex: 1; }
.install-card input { padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); font-size: 1rem; }
.install-card .row { flex-wrap: nowrap; }
.install-card .narrow { max-width: 110px; }
.install-card small { color: var(--text-3); }
.install-card button { width: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-weight: 650; font-size: 1rem; cursor: pointer; }
.install-card .err { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 9px; }

/* ------------------------------------------------------------- Übersicht */

/* Spalten setzt overview.js je nach Breite (--ov-cols); minmax(…): lange Inhalte sprengen die Spalte nicht */
.overview-grid { display: grid; grid-template-columns: var(--ov-cols, minmax(0, 1fr)); gap: 20px; align-items: start; }
.overview-grid > .stack { gap: 20px; }

.hero-date { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.hero-date .kw { font-size: .9rem; font-weight: 650; color: var(--accent-strong); background: var(--accent-soft); padding: 3px 10px; border-radius: 99px; }
.hero-clock { font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 520; }
/* Handy: «Anpassen» als Symbol neben dem Gruss (.page-head), die Uhrzeit steht schon oben am Handy */
@media (max-width: 640px) {
  .ov-head .ov-act .lbl { display: none; }
  .ov-head .ov-act { width: 36px; padding: 0; justify-content: center; }
  .ov-head .hero-clock { display: none; }
}

.briefing { position: relative; }
.briefing .card-head h2 .icon { color: var(--ai); }
.briefing-meta { font-size: .8rem; color: var(--text-3); }
.briefing-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 12px; }
.briefing-material { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .84rem; }
.briefing-material a { display: inline-flex; align-items: center; gap: 4px; }
/* Punkt steht in der Materialliste */
.md li.task .md-linked { display: inline-block; margin-left: 6px; color: var(--accent); vertical-align: -2px; }
.briefing-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

/* Übersicht anpassen */
.ov-col { min-width: 0; }
.overview-grid.editing .ov-col { min-height: 140px; padding: 6px; margin: -6px; border-radius: calc(var(--radius) + 4px); outline: 2px dashed var(--border); outline-offset: -2px; }
.ov-edit { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; padding: 8px 10px 8px 6px; background: var(--accent-soft); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.ov-edit strong { display: flex; align-items: center; flex: 1 1 9em; flex-wrap: wrap; gap: 4px 7px; font-size: .92rem; min-width: 0; overflow-wrap: break-word; }
.ov-edit-btns { display: flex; gap: 4px; margin-left: auto; }
.ov-grip { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: grab; touch-action: none; }
.ov-grip:hover { background: var(--surface); color: var(--text); }
.overview-grid.editing .ov-content { max-height: 170px; overflow: hidden; pointer-events: none; opacity: .55; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.ov-dragging { z-index: 60; box-shadow: var(--shadow-lg, 0 18px 40px rgba(0,0,0,.18)); pointer-events: none; transform: rotate(.6deg); }
.ov-placeholder { border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--accent-soft); opacity: .7; }
body.ov-drag-active { user-select: none; cursor: grabbing; }
.ov-new { animation: ov-flash 1.6s ease; }
@keyframes ov-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: var(--shadow-sm); } }
.ov-palette { padding: 14px 16px; margin-bottom: 20px; }
.ov-palette-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ov-ratio-groups { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.ov-ratio-groups .ov-label { margin-top: 0; }
.ov-ratios { display: flex; flex-wrap: wrap; gap: 8px; }
.ov-ratio { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 10px; min-width: 76px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-2); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.ov-ratio:hover { border-color: var(--accent); }
.ov-ratio.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.ov-ratio-bars { display: flex; gap: 3px; width: 54px; height: 18px; }
.ov-ratio-bars i { display: block; flex-basis: 0; border-radius: 3px; background: var(--border-strong, var(--text-3)); }
.ov-ratio.active .ov-ratio-bars i { background: var(--accent); }
.ov-palette-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.ov-add { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ov-add:hover { border-color: var(--accent); background: var(--accent-soft); }
.ov-add > .icon:first-child { color: var(--accent); flex: none; }
.ov-add span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ov-add small { color: var(--text-3); font-size: .78rem; }
/* Handy: zwei Spalten, ohne Beschreibung (steht im Tooltip), damit die Liste nicht den ganzen Bildschirm füllt */
@media (max-width: 640px) {
  .ov-palette { padding: 12px; }
  .ov-palette-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .ov-add { gap: 8px; padding: 8px 8px 8px 10px; min-height: 48px; }
  .ov-add small { display: none; }
  .ov-add strong { font-size: .88rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; }
}
@media (max-width: 1100px) { .ov-side { display: none; } }

/* Bereiche der Übersicht */
.ov-label { text-transform: uppercase; letter-spacing: .04em; font-weight: 650; margin: 14px 0 6px; }
/* Anpassen: Bereich ohne Inhalt (fehlt sonst auf der Übersicht) */
.ov-edit .chip.ov-empty { flex: none; margin-left: 6px; font-weight: 500; white-space: nowrap; }
.ov-week { display: flex; flex-direction: column; gap: 4px; }
.ov-week-day { display: flex; align-items: flex-start; gap: 12px; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ov-week-day:hover { background: var(--surface-2); }
.ov-week-day.today { background: var(--accent-soft); }
.ov-week-day.selected { border-color: var(--accent); }
.ov-week-day.off { opacity: .7; }
.ov-week-date { display: flex; gap: 8px; align-items: baseline; width: 92px; flex: none; font-variant-numeric: tabular-nums; }
.ov-week-date strong { min-width: 22px; white-space: nowrap; } /* «Mo» nie auf zwei Zeilen */
.ov-week-date span { color: var(--text-2); font-size: .88rem; }
.ov-week-info { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; font-size: .9rem; }
.ov-week-date.range { flex-direction: column; gap: 0; }
/* Tage ohne Besonderes: nur die Kürzel */
.ov-week-rest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px 2px; }
.ov-week-short { min-width: 38px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.ov-week-short:hover { background: var(--surface-2); }
.ov-week-short.today { border-color: transparent; background: var(--accent-soft); }
.ov-week-short.selected { border-color: var(--accent); }
.ov-holiday { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.ov-holiday + .ov-holiday { border-top: 1px solid var(--border); }
.ov-holiday:not(.first) .integration-logo { width: 34px; height: 34px; }
.ov-countdown { display: flex; flex-direction: column; align-items: center; line-height: 1.1; color: var(--accent-strong); }
.ov-countdown strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.ov-countdown span { font-size: .72rem; }
.ov-events { margin-top: 4px; }
.ov-event { display: flex; gap: 12px; padding: 5px 0; font-size: .9rem; border-top: 1px solid var(--border); }
.ov-event-date { width: 118px; flex: none; color: var(--text-2); }
/* «Diese Woche»: die nächsten Ferien unter den Tagen und Terminen */
.ov-holidays { margin-top: 10px; padding-top: 4px; border-top: 1px solid var(--border); }
.ov-links { display: flex; flex-direction: column; }
.ov-link { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
a.ov-link:hover, button.ov-link:hover { background: var(--surface-2); }
.ov-link > .icon { color: var(--text-3); flex: none; }
.ov-link .grow { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.ov-link small { color: var(--text-3); font-size: .78rem; }
.ov-link.unread .grow { font-weight: 620; }
.ov-link.unread > .icon { color: var(--accent); }
.ov-note { min-height: 120px; resize: none; overflow: hidden; background: #fff8d6; border-color: #f0e2a0; }
/* dunkel wie die Seite: gewähltes Design, sonst das des Systems (sonst helle Schrift auf Hellgelb oder umgekehrt) */
:root[data-theme="dark"] .ov-note { background: #3a3420; border-color: #5a4f2a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ov-note { background: #3a3420; border-color: #5a4f2a; } }
/* Linkliste: Ordner (aufklappbar) und Links; Bearbeiten-Knöpfe beim Darüberfahren, auf Touch immer */
.lk-list { display: flex; flex-direction: column; gap: 1px; }
.lk-row { display: flex; align-items: center; gap: 2px; min-width: 0; margin: 0 -8px; padding-right: 4px; border-radius: 8px; }
.lk-row:hover { background: var(--surface-2); }
.lk-link, .lk-folder-btn {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 8px;
  background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.lk-link > .icon, .lk-chevron .icon { color: var(--text-3); flex: none; }
.lk-chevron { display: inline-flex; gap: 4px; flex: none; }
.lk-chevron .icon:last-child { color: var(--accent); }
.lk-folder-btn { font-weight: 620; }
.lk-text { display: flex; flex-direction: column; min-width: 0; }
.lk-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-text small { color: var(--text-3); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-count { margin-left: auto; padding-left: 6px; color: var(--text-3); font-size: .78rem; font-weight: 500; flex: none; }
.lk-items { margin-left: 15px; padding-left: 12px; border-left: 1px solid var(--border); }
.lk-empty { margin: 4px 0 8px; color: var(--text-3); font-size: .85rem; }
.lk-actions { display: flex; flex: none; opacity: 0; transition: opacity .15s; }
.lk-row:hover .lk-actions, .lk-row:focus-within .lk-actions { opacity: 1; }
@media (hover: none) { .lk-actions { opacity: 1; } }
.lk-link:focus-visible, .lk-folder-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lk-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lk-file-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.lk-file-name small { color: var(--text-3); font-weight: 500; }

.ov-screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ov-screen { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: inherit; text-decoration: none; font-weight: 560; min-width: 0; }
.ov-screen span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-screen:hover { border-color: var(--accent); background: var(--accent-soft); }
.ov-screen .icon { color: var(--accent); flex: none; }
/* Screen mit Knopf «Präsentieren» rechts daneben (nur wenn Präsentieren möglich ist) */
.ov-screen-row { display: flex; min-width: 0; }
.ov-screens:has(.ov-screen-row) { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.ov-screen-row .ov-screen { flex: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ov-screen-present { flex: none; display: grid; place-items: center; width: 38px; border: 1px solid var(--border); border-left: 0; border-radius: 0 10px 10px 0; background: none; color: var(--text-3); cursor: pointer; }
.ov-screen-present:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
/* Screens nach Ordnern (wie die Linkliste): Ordner zum Aufklappen, darunter die Screens ohne Ordner */
.ov-screen-list { display: grid; gap: 10px; }
.ov-screen-items { padding-top: 4px; padding-bottom: 6px; }
.ov-wx-now { display: flex; align-items: center; gap: 14px; }
.ov-wx-emoji { font-size: 2.4rem; line-height: 1; }
.ov-wx-temp { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.ov-wx-range { margin-left: auto; text-align: right; }
.ov-wx-hours { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.ov-wx-hour { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 8px; background: var(--surface-2); }
.ov-rain { color: var(--accent-text); font-weight: 650; }
.ov-wx-tomorrow { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }

/* Tagesablauf */
.timeline { position: relative; display: flex; flex-direction: column; gap: 8px; container-type: inline-size; }
.tl-row { display: grid; grid-template-columns: 64px 1fr; gap: 12px; position: relative; }
.tl-time { font-variant-numeric: tabular-nums; font-size: .84rem; color: var(--text-2); padding-top: 9px; text-align: right; line-height: 1.25; }
.tl-time .end { display: block; color: var(--text-3); font-size: .76rem; }
.tl-cells { display: grid; gap: 8px; grid-auto-flow: column; grid-auto-columns: 1fr; min-width: 0; }
/* nacheinander in derselben Spalte (z. B. zwei Halbklassen neben einer längeren Lektion) */
.tl-stack { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tl-part { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tl-part-time { font-size: .74rem; color: var(--text-3); font-variant-numeric: tabular-nums; padding-left: 2px; }
.lesson {
  position: relative; border-radius: 10px; padding: 9px 12px 9px 15px; background: var(--surface-2);
  border: 1px solid var(--border); min-width: 0; overflow: hidden;
}
.lesson::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--lesson-color, var(--border-strong)); }
.lesson.tinted { background: color-mix(in srgb, var(--lesson-color) 26%, var(--surface)); border-color: color-mix(in srgb, var(--lesson-color) 60%, var(--border)); }
.lesson-title { font-weight: 640; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
/* höchstens zwei Zeilen, ein längerer Name endet mit «…» (ganz steht er beim Öffnen) */
.lesson-name { min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.lesson-group { font-size: .74rem; font-weight: 650; color: var(--text-2); background: color-mix(in srgb, var(--surface) 70%, transparent); padding: 0 7px; border-radius: 99px; border: 1px solid var(--border); }
.lesson-details { font-size: .87rem; color: var(--text-2); margin-top: 3px; }
.lesson-details div + div { margin-top: 2px; }
.lesson-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; font-size: .85rem; }
.lesson.cancelled .lesson-title { text-decoration: line-through; opacity: .6; }
.lesson.current { box-shadow: 0 0 0 2px var(--now); }
.lesson.past { opacity: .55; }
.lesson.event { background: color-mix(in srgb, var(--mark-magenta) 9%, var(--surface)); border-style: dashed; }
.lesson.event::before { background: var(--mark-magenta); }
/* Termine aus eingebundenen Kalendern in deren Farbe */
.lesson.event.tinted { background: color-mix(in srgb, var(--lesson-color) 12%, var(--surface)); border-color: color-mix(in srgb, var(--lesson-color) 45%, var(--border)); }
.lesson.event.tinted::before { background: var(--lesson-color); }
.tl-break { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; font-size: .82rem; color: var(--text-3); }
.tl-break .line { display: flex; align-items: center; gap: 8px; }
.tl-break .line::after { content: ""; flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--border-strong) 0 4px, transparent 4px 8px); }
.tl-break .notes { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 2; }
.tl-break.lunch .line { color: var(--text-2); }
.tl-now { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; color: var(--now); font-weight: 700; font-size: .78rem; margin: -2px 0; }
.tl-now .label { text-align: right; text-transform: uppercase; letter-spacing: .05em; }
.tl-now .bar { height: 2px; background: var(--now); border-radius: 2px; position: relative; }
.tl-now .bar::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); box-shadow: 0 0 0 4px var(--now-soft); }
/* schmal (Handy): Halbklassen untereinander statt zu schmal nebeneinander, schmalere Zeitspalte */
@container (max-width: 460px) {
  .tl-row, .tl-break, .tl-now { grid-template-columns: 46px minmax(0, 1fr); gap: 10px; }
  .tl-cells { grid-auto-flow: row; }
  .tl-stack { display: contents; }
  .tl-cells > *, .tl-stack > * { order: var(--o, 0); }
  .tl-time { font-size: .8rem; }
  .tl-now .label { font-size: .7rem; letter-spacing: .02em; }
}
.day-notes { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.day-off { display: flex; gap: 12px; align-items: center; padding: 18px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }

/* Aufgaben */
.task-list { display: flex; flex-direction: column; }
.task-folders { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.task-folder-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.task-folder-chip:hover { border-color: var(--accent); }
.task-folder-chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.task-folder-chip .count { font-size: .72rem; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.task-folder-chip.active .count { background: rgba(255, 255, 255, .25); color: inherit; }
.task-folder-actions { display: inline-flex; gap: 2px; }
/* Mit Maus erst beim Darüberfahren über den gewählten Ordner (und solange die Maus auf den Knöpfen ist); mit der Tastatur,
   sobald der Ordner oder ein Knopf den Fokus hat. Zu nehmen sie keinen Platz weg (-6px gleicht den Abstand der Leiste aus);
   beim Verlassen bleiben sie kurz stehen, damit die Maus vom Namen zu den Knöpfen kommt. Ohne Maus (Handy) immer sichtbar */
@media (hover: hover) and (pointer: fine) {
  .task-folder-actions { max-width: 0; margin-left: -6px; overflow: hidden; opacity: 0; visibility: hidden;
    transition: max-width .18s ease .3s, margin .18s ease .3s, opacity .12s ease .3s, visibility 0s linear .48s; }
  .task-folder-chip.active:hover + .task-folder-actions, .task-folder-chip.active:focus-visible + .task-folder-actions,
  .task-folder-actions:hover, .task-folder-actions:focus-within {
    max-width: 160px; margin-left: 0; opacity: 1; visibility: visible; transition: max-width .18s ease, margin .18s ease, opacity .12s ease, visibility 0s; }
}
.task-folder-chip .tf-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Handy: Ordner in einer Zeile zum Wischen statt mehrerer Zeilen */
@media (max-width: 640px) {
  .task-folders { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -18px 12px; padding: 0 18px 2px; }
  .task-folders::-webkit-scrollbar { display: none; }
  .task-folder-chip, .task-folders > .btn, .task-folder-actions { flex: none; white-space: nowrap; }
  .task-folder-chip { max-width: 70vw; } /* langer Name: gekürzt, damit die Knöpfe daneben sichtbar bleiben */
  /* Wissen: direkt auf der Seite (16px Rand) statt in einer Karte */
  .task-folders.kb-folders { margin: 0 -16px 12px; padding: 0 16px 2px; }
}
.task-meta .task-folder { color: var(--accent); }
.import-preview .task-check { pointer-events: none; opacity: .5; }
.task.has-grip { grid-template-columns: auto auto 1fr auto; }
.task-grip { align-self: start; display: grid; place-items: center; width: 26px; height: 28px; margin: -3px -6px 0 -4px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-3); cursor: grab; touch-action: none; }
.task-grip:hover, .task-grip:focus-visible { color: var(--accent); background: var(--surface-2); }
.task.dragging { background: var(--surface); box-shadow: 0 6px 18px rgba(0, 0, 0, .14); border-radius: 10px; position: relative; z-index: 2; }
.task.dragging .task-grip { cursor: grabbing; }
.task-tabs-wrap { container-type: inline-size; margin-top: 8px; }
.task-tabs { align-items: center; }
.task-order { margin-left: auto; flex: none; padding: 2px; }
.task-order .seg-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; font-size: .8rem; white-space: nowrap; }
@container (max-width: 330px) { .task-order .lbl { display: none; } .task-order .seg-btn { padding: 4px 7px; } }
.task { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
/* ganz schmal: Stift und Papierkorb unter den Text (mit Griff in die dritte Spalte); nur der Stift bleibt in der Zeile */
@media (max-width: 360px) {
  .task:has(.task-actions > :nth-child(2)) { grid-template-columns: auto minmax(0, 1fr); }
  .task.has-grip:has(.task-actions > :nth-child(2)) { grid-template-columns: auto auto minmax(0, 1fr); }
  .task:has(.task-actions > :nth-child(2)) .task-actions { grid-column: -2; justify-content: flex-end; }
}
.task-check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; margin-top: 1px; padding: 0; color: transparent; }
.task-check:hover { border-color: var(--accent); }
.task.done .task-check { background: var(--success); border-color: var(--success); color: var(--on-color); }
.task-check svg { width: 14px; height: 14px; }
/* Handy und Touch: grössere Tippfläche um das Kästchen, ohne es grösser zu zeichnen */
@media (max-width: 640px), (pointer: coarse) {
  .task-check { position: relative; }
  .task-check::after { content: ''; position: absolute; inset: -9px; }
  .task-order .seg-btn { min-height: 32px; }
}
.task-title { font-weight: 540; overflow-wrap: anywhere; }
/* ein Klick auf den Titel hakt die Aufgabe ab (taskList) */
.task-title.can-tick { cursor: pointer; }
@media (hover: hover) { .task-title.can-tick:hover { color: var(--accent-strong); } .task.done .task-title.can-tick:hover { color: var(--text-2); } }
.task.done .task-title { text-decoration: line-through; color: var(--text-3); }
.task-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--text-3); margin-top: 2px; }
.task-notes { font-size: .85rem; color: var(--text-2); white-space: pre-wrap; margin-top: 3px; overflow-wrap: anywhere; }
.task.overdue .due { color: var(--danger); font-weight: 650; }
/* überfällig: Datum und Kästchen rot, die Zeile bleibt ruhig (die Überschrift «Überfällig» ist schon rot) */
.task.overdue .task-check { border-color: var(--danger); }
/* «Auf die Kopierliste»: Anzahl und Tag mit Vorschlägen */
.cl-chips { gap: 6px; flex-wrap: wrap; }
/* Überschrift «Überfällig» mit «Alle verschieben …» rechts */
.task-group-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.task-group-head .btn { margin-bottom: 2px; }
.task-actions { display: flex; gap: 2px; opacity: .55; }
.task:hover .task-actions { opacity: 1; }
.task .star { color: var(--warn); }
.quick-add { display: flex; gap: 8px; }
/* Aufgabe: Heute, Morgen, In 1 Woche, Kein Datum auch bei 360 px in einer Zeile */
@media (max-width: 420px) { .task-quick-dates { gap: 3px !important; } .task-quick-dates .chip { padding-inline: 6px; } }
/* Fester Stundenplan (schedule-plan.js): Abstand der Wochen-Tabelle (früher die Karten der Fächer, gleicher Name) */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
@media (max-width: 640px) { .plan-grid { grid-template-columns: 1fr; gap: 10px; } }
/* Planung: Reiter «Jahr» / «Sammlung», Auswahl der Klasse in der Zeitleiste */
.plan-tabs { margin-bottom: 14px; }
.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); font-size: .74rem; font-weight: 650; }
.plan-classes .seg-btn { flex: none; display: inline-flex; align-items: center; white-space: nowrap; }
.plan-saved .saved-seqs { margin-top: 0; }
.plan-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
/* Planung: Termine und Elterngespräche als zwei Links unter der Zeitleiste, je mit dem Stand in einer Zeile */
.plan-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.plan-link { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  color: inherit; text-decoration: none; transition: border-color .12s; }
@media (hover: hover) { .plan-link:hover { border-color: var(--accent); } }
.plan-link-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); }
.plan-link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.plan-link-text strong { font-size: .95rem; }
.plan-link-text span { overflow: hidden; color: var(--text-2); font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.plan-link > .icon:last-child { flex: none; color: var(--text-3); }
@media (max-width: 640px) {
  .plan-links { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 10px; }
  .plan-link { padding: 9px 12px; }
  .plan-link-text span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
}
/* Planung, Jahresübersicht: Fächer als Zeilen, Kalenderwochen als Spalten; Themen als Balken, Platz grau, Ferien schraffiert */
.tl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 14px; }
.tl-tools .plan-classes { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.tl-span .seg-btn { white-space: nowrap; padding: 6px 10px; }
.tl-span .lbl-short { display: none; }
.tl-card { padding: 0; overflow: hidden; }
.tl-scroll { overflow-x: auto; scrollbar-width: thin; }
.tl { --tl-label: 190px; --tl-wk: 30px; position: relative; display: grid; min-width: min-content; }
.tl.all { --tl-label: 160px; --tl-wk: 18px; }
.tl-corner, .tl-label { position: sticky; left: 0; z-index: 4; grid-column: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--border); }
.tl-corner { grid-row: 1 / span 2; display: flex; align-items: flex-end; padding: 0 12px 6px; font-size: .72rem; color: var(--text-3); }
.tl-month { grid-row: 1; min-width: 0; padding: 8px 6px 2px; overflow: hidden; font-size: .76rem; font-weight: 650; color: var(--text-2); white-space: nowrap; box-shadow: inset 1px 0 0 var(--border); }
.tl-kw { grid-row: 2; padding: 2px 0 6px; font-size: .68rem; text-align: center; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-kw.m, .tl-cell.m { box-shadow: inset 1px 0 0 var(--border); }
.tl-kw.s, .tl-cell.s { box-shadow: inset 2px 0 0 var(--border-strong); }
.tl-kw.off, .tl-cell.off { background: repeating-linear-gradient(135deg, var(--warn-soft) 0 4px, transparent 4px 8px); }
.tl-kw.now { color: var(--now); font-weight: 700; }
.tl-label { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 12px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.tl-label:hover strong { color: var(--accent); }
.tl-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tl-name strong, .tl-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Fachnamen auf zwei Zeilen statt «Bildneris…» */
.tl-name strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: normal; hyphens: auto; }
.tl-name strong { font-size: .88rem; }
.tl-name small { font-size: .72rem; color: var(--text-3); }
/* Stand der nächsten vier Wochen beim Fach: «12 ohne Inhalt bis 27.11.» bzw. «alles geplant» (auf dem Handy ohne Datum) */
.tl-name .tl-soon { font-weight: 600; }
.tl-soon.warn { color: var(--warn); }
.tl-soon.ok { color: var(--success); }
.tl-soon .icon { width: 11px; height: 11px; margin-right: 3px; vertical-align: -1px; }
/* unter den Fächern: «Fach ohne Lektionen …» (bleibt beim waagrechten Scrollen links) */
.tl-addrow { grid-column: 1 / -1; padding: 6px 8px; border-top: 1px solid var(--border); }
.tl-addrow > span { position: sticky; left: 8px; display: inline-block; }
.tl-track { grid-column: 2 / -1; position: relative; display: grid; min-height: 40px; border-top: 1px solid var(--border); }
/* weiterer Bereich desselben Fachs: gestrichelt abgesetzt */
.tl-label.more, .tl-track.more { border-top-style: dashed; }
.tl-cell { display: block; }
.tl-bar { position: absolute; top: 0; bottom: 0; z-index: 1; height: 27px; margin: auto 0; display: flex; align-items: center; min-width: 4px; padding: 0 7px; overflow: hidden; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font: inherit; font-size: .76rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tl-bar > span { overflow: hidden; text-overflow: ellipsis; }
.tl-bar:hover { filter: brightness(1.1); }
.tl-bar:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.tl-bar.free { justify-content: center; padding: 0; background: var(--surface-3); color: var(--accent); box-shadow: inset 0 0 0 1px var(--border); }
.tl-bar.free .icon { width: 14px; height: 14px; opacity: 0; }
.tl-bar.free:hover, .tl-bar.free:focus-visible { filter: none; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.tl-bar.free:hover .icon, .tl-bar.free:focus-visible .icon { opacity: 1; }
.tl-past { position: absolute; top: 0; bottom: 0; left: 0; z-index: 2; background: var(--surface); opacity: .45; pointer-events: none; }
/* Heute: über alle Zeilen, auch über den Rand oben (nicht .tl-now, so heisst die Jetzt-Linie der Übersicht) */
.tl-today { position: absolute; top: -1px; bottom: 0; z-index: 3; width: 2px; margin-left: -1px; background: var(--now); pointer-events: none; }
.tl-group { grid-column: 1 / -1; padding: 10px 12px 4px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: .8rem; font-weight: 650; color: var(--text-2); }
.tl-group > span { position: sticky; left: 12px; display: inline-block; }
.tl-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text-2); }
.tl-foot > span { display: inline-flex; align-items: center; gap: 6px; }
.tl-foot .tl-help { flex: 1 1 18rem; justify-content: flex-end; color: var(--text-3); text-align: right; }
.tl-key { display: inline-block; flex: none; width: 18px; height: 10px; border-radius: 3px; background: var(--accent); }
.tl-key.free { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border); }
.tl-key.off { background: repeating-linear-gradient(135deg, var(--warn) 0 2px, var(--warn-soft) 2px 4px); }
.tl-key.now { width: 2px; height: 14px; border-radius: 0; background: var(--now); }
@media (max-width: 640px) { .tl-print .lbl { display: none; } }
@media (max-width: 640px) {
  .tl, .tl.all { --tl-label: 124px; } /* «Mathematik» passt ganz in die Zeile */
  .tl.all { --tl-wk: 22px; }
  .tl-label { gap: 6px; padding: 6px 8px; }
  .tl-name strong { font-size: .82rem; }
  .tl-corner { padding: 0 8px 6px; }
  .tl-span .lbl { display: none; }
  .tl-span .lbl-short { display: inline; }
  .tl-foot .tl-help { justify-content: flex-start; text-align: left; }
  .tl-soon-to { display: none; }
}
/* Abläufe (Vorlagen für wiederkehrende Aufgaben) */
.routine-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; }
.routine-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.routine-row + .routine-row { border-top: 1px solid var(--border); }
.routine-icon { color: var(--accent); display: inline-flex; }
.routine-steps { display: flex; flex-direction: column; gap: 8px; }
.routine-step { display: grid; grid-template-columns: 250px minmax(0, 1.5fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.routine-when { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 6px; }
.routine-plan { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; max-height: 46vh; overflow-y: auto; }
.routine-plan-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.routine-plan-row + .routine-plan-row { border-top: 1px solid var(--border); }
.routine-plan-row input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.routine-plan-date { flex: none; width: 78px; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: .88rem; }
.routine-plan-row.past { opacity: .65; }
@media (max-width: 640px) {
  .routine-plan-row { flex-wrap: wrap; row-gap: 2px; }
  .routine-plan-row > .grow { flex: 1 1 9em; min-width: 0; }
  .routine-plan-row > .chip { margin-left: auto; }
}
@media (max-width: 640px) {
  .routine-row { flex-wrap: wrap; }
  .routine-row .btn-group { width: 100%; justify-content: flex-end; }
  .routine-step { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
  .routine-step > .routine-when { grid-column: 1; }
  .routine-step > .btn { grid-column: 2; grid-row: 1; }
  .routine-step > .input { grid-column: 1 / -1; }
}
/* Material- und Kopierliste */
.material-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: -2px 0 12px; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); }
.material-bar p { margin: 0; flex: 1 1 280px; font-size: .86rem; color: var(--text-2); }
.material-sheet .ps-head { border-bottom: 2px solid var(--text); padding-bottom: 8px; }
.mat-day { margin-top: 14px; }
.mat-day h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 1rem; }
.mat-late { font-size: .74rem; font-weight: 650; color: var(--danger); }
.mat-list { list-style: none; margin: 0; padding: 0; }
.mat-item { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--border); break-inside: avoid; }
.mat-box { flex: none; width: 14px; height: 14px; margin-top: 2px; border: 1.5px solid var(--text-2); border-radius: 3px; }
.mat-title { font-size: .95rem; line-height: 1.35; }
.mat-notes { font-size: .8rem; color: var(--text-2); margin-top: 2px; white-space: pre-wrap; }
.quick-add .input { flex: 1; }

/* -------------------------------------------------------------- Stundenplan */

.week-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wn-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.week-title .wk-short { display: none; }
.wn-tools { flex: 1; }
.wn-more { margin-left: auto; }
/* die Werkzeuge bleiben zusammen: reicht der Platz nicht, rücken sie als Ganzes unter die Woche */
@media (min-width: 761px) { .wn-tools { flex-wrap: nowrap; } }
/* Computer: die Woche steht fest neben dem Titel, die Werkzeuge rechts davon (sonst darunter). Der Titel ist immer gleich
   breit: ‹ › bleiben beim Blättern an derselben Stelle, auch in Ferienwochen oder wenn «Planung» dazukommt */
@media (min-width: 761px) {
  /* reicht der Platz neben dem Titel nicht (Tablet, langer Titel wie beim geteilten Stundenplan), rückt die Leiste als Ganzes
     darunter, statt dass ‹ › und «Heute» auseinanderfallen */
  .page-head > .page-actions:has(> .week-nav) { flex: 1 1 540px; }
  .wn-week { flex-wrap: nowrap; }
  .page-actions > .week-nav { width: 100%; }
  .wn-week .week-title { width: 16rem; font-variant-numeric: tabular-nums; }
}
/* Handy: Woche in der ersten Zeile, Hervorheben und Eintrag in der zweiten, der Rest unter «Mehr» */
@media (max-width: 760px) {
  .page-head:has(.week-nav) { margin-bottom: 14px; }
  .page-actions:has(> .week-nav) { width: 100%; min-width: 0; }
  .week-nav { width: 100%; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 8px; }
  .wn-group { flex-wrap: nowrap; }
  .wn-week .week-title-wrap { flex: 1; min-width: 0; }
  .wn-week .week-title { min-width: 0; width: 100%; padding: 6px 4px; }
  .week-title .wk-long { display: none; }
  .week-title .wk-short { display: inline; }
  .wn-extra { display: none !important; }
  .wn-add .wn-lbl { display: none; }
  .wn-tools .select-btn { flex: 1 1 auto; min-width: 0; padding-left: 10px; padding-right: 10px; }
  .wn-tools .select-btn-text { flex: 1; min-width: 0; max-width: none; text-align: left; }
  .wn-tools .sb-full { display: none; }
  .wn-tools .sb-short { display: inline; }
}
/* Handy: zwei Zeilen. Neben dem Titel Fach, Person, Suche, Zahnrad und «…» als Symbole (ein gewählter Filter ist hinterlegt),
   darunter die Woche mit «Heute»; «Termin» steht im «+» oben (auf der geteilten Seite ohne Kopfzeile bleibt der Knopf) */
@media (max-width: 640px) {
  .page-head:has(> .page-actions > .week-nav > .wn-tools) { grid-template-areas: "trail trail" "title acts" "sub sub" "week week"; }
  .page-head > .page-actions:has(> .week-nav > .wn-tools), .page-head .week-nav:has(> .wn-tools) { display: contents; }
  .page-head .wn-tools { grid-area: acts; justify-self: end; gap: 2px; }
  .page-head .wn-week { grid-area: week; margin-top: 10px; gap: 4px; }
  body:has(.m-top) .page-head .wn-add { display: none; }
  .page-head .wn-more { margin-left: 0; }
  .page-head .wn-tools .select-btn { flex: none; width: 36px; padding: 0; gap: 0; }
  .page-head .wn-tools .select-btn > :not(.icon:first-child, select) { display: none; }
  .page-head .week-title { min-height: 36px; }
}
/* Handy: Tage als fünf Reiter, beim Scrollen oben (unter der Kopfzeile, --m-top-h) */
.day-tabs { position: sticky; top: var(--m-top-h, 0px); z-index: 6; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0 -4px 12px; padding: 6px 4px; background: var(--bg); }
.day-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text-2); font: inherit; cursor: pointer; min-width: 0; }
.day-tab .dt-wd { font-weight: 700; font-size: .95rem; }
.day-tab .dt-date { font-size: .74rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.day-tab.today:not(.active) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent-strong); }
.day-tab.active { background: var(--accent); color: var(--accent-text); }
.day-tab.active .dt-date { color: inherit; opacity: .85; }
.day-tab.off:not(.active) { opacity: .55; }
.day-tab .dt-dot { position: absolute; top: 5px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--mark-magenta); }
.week-title-wrap { position: relative; display: inline-flex; }
.week-title { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 650; min-width: 210px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: none; color: inherit; cursor: pointer; }
.week-title:hover { border-color: var(--border); background: var(--surface); }
.week-title .icon { color: var(--text-3); }
/* unsichtbar unter dem Titel: Kalender des Browsers (showPicker) erscheint dort */
.week-jump { position: absolute; left: 50%; bottom: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
/* Seite eines Fachs (schedule-subject.js): oben Stand und Jahresbalken, darunter das Schuljahr als Gliederung, ein
   Abschnitt pro Thema (Streifen in seiner Farbe) und pro Folge von Lektionen ohne Thema; aufgeklappt die Lektionen,
   die Wochen als feine Zeilen dazwischen */
.subject-view { display: flex; flex-direction: column; gap: 12px; }
.ss-head-card { padding: 12px 16px 10px; }
.ss-status-line { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; color: var(--text-2); }
.ss-status-line:empty { display: none; }
.ss-status-line > .icon { flex: none; margin-top: 2px; color: var(--text-3); }
.ss-status-line .ss-room-line { gap: 2px 10px; }
.ss-status-line .ss-room-part + .ss-room-part::before { content: "·"; margin-right: 10px; color: var(--text-3); }
.ss-secs { display: flex; flex-direction: column; gap: 8px; }
.ss-sec { padding: 0; overflow: hidden; }
.ss-sec.theme { border-left: 4px solid var(--blk, var(--border)); }
.ss-sec.free { border-style: dashed; }
.ss-sec.now { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.ss-sec.theme.now { border-left-color: var(--blk, var(--accent)); }
.ss-sec.past:not(.open) .ss-sec-head { opacity: .72; }
.ss-sec.yp-flash { animation: yp-flash 2.2s ease-out; }
.ss-sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px 6px 4px; }
.ss-sec.open > .ss-sec-head { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.ss-sec-toggle { flex: 1 1 18rem; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 5px 6px; border: 0; border-radius: 8px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ss-sec-toggle:hover .ss-sec-title > strong { color: var(--accent); }
.ss-sec-toggle > .icon { flex: none; color: var(--text-3); transition: transform .15s; }
.ss-sec.open .ss-sec-toggle > .icon { transform: rotate(90deg); }
.ss-sec.unplaced .ss-sec-toggle { padding-left: 10px; }
.ss-sec-title { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.ss-sec-title > strong { overflow-wrap: anywhere; }
.ss-sec-meta { flex: 0 1 auto; }
.ss-sec-toggle > .yp-progress { flex: 0 0 110px; margin-top: 0; }
.ss-sec-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.ss-sec-tools:empty { display: none; }
.ss-sec-head > .yp-drift { flex: 1 1 100%; max-width: calc(100% - 30px); margin: 0 0 4px 30px; }
.ss-sec-body > .ss-block-files { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
/* Woche als feine Zeile, Ferien dazwischen schraffiert */
.ss-wk { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 3px 14px; background: var(--surface-2); color: var(--text-2); font-size: .76rem; }
.ss-wk + .ss-wk, .ss-row + .ss-wk, .ss-side + .ss-wk { border-top: 1px solid var(--border); }
.ss-wk + .ss-row, .ss-wk + .ss-side { border-top: 0; }
.ss-wk.current { color: var(--accent-strong); font-weight: 650; }
.ss-wk.off { background: repeating-linear-gradient(135deg, var(--warn-soft) 0 4px, var(--surface-2) 4px 8px); }
.ss-wk .chip { font-size: .72rem; }
/* laufender Abschnitt: frühere Lektionen als eine Zeile zum Aufklappen */
button.ss-wk { width: 100%; border: 0; border-bottom: 1px solid var(--border); font: inherit; font-size: .78rem; text-align: left; cursor: pointer; }
button.ss-wk:hover { color: var(--accent); }
/* Lektion ohne Thema in der Zeit eines Themas (z. B. Klassenrat): grau an ihrem Tag */
.ss-row.ss-other { background: color-mix(in srgb, var(--surface-2) 75%, transparent); }
.ss-row.ss-other .ss-when { opacity: .7; }
/* Handy: die vergangenen Abschnitte in einer Zeile zum Aufklappen */
.ss-past > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-2);
  cursor: pointer; list-style: none; }
.ss-past > summary::-webkit-details-marker { display: none; }
.ss-past > summary > .icon { flex: none; transition: transform .15s; }
.ss-past[open] > summary { margin-bottom: 8px; }
.ss-past[open] > summary > .icon { transform: rotate(90deg); }
/* Themen ohne Lektionen am Schluss */
.ss-unplaced { display: flex; flex-direction: column; gap: 8px; }
.ss-unplaced-title { margin: 6px 0 0; font-size: .95rem; color: var(--text-2); }
/* Direkt ändern: Griff zum Ziehen, «−» und «+» */
.ss-theme-grip { flex: none; display: grid; place-items: center; width: 24px; height: 32px; margin-right: -6px; padding: 0; border: 0; border-radius: 6px; background: none;
  color: var(--text-3); cursor: grab; touch-action: none; }
.ss-theme-grip:hover, .ss-theme-grip:focus-visible { color: var(--accent); background: var(--surface); }
.ss-sec.dragging { box-shadow: var(--shadow-lg); opacity: .92; position: relative; z-index: 2; }
.ss-sec.dragging .ss-theme-grip { cursor: grabbing; }
.ss-secs.sorting .ss-sec-body, .ss-secs.sorting .ss-sec-head > .yp-drift { display: none; }
.ss-secs.sorting .ss-sec.open > .ss-sec-head { border-bottom: 0; }
.ss-step { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.ss-step-btn { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--text-2); cursor: pointer; }
.ss-step-btn:hover:not(:disabled), .ss-step-btn:focus-visible { color: var(--accent); background: var(--surface-2); }
.ss-step-btn:disabled { opacity: .35; cursor: default; }
.ss-step-n { min-width: 1.6em; font-size: .82rem; font-weight: 650; text-align: center; font-variant-numeric: tabular-nums; }
.ss-move-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ss-move-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px; }
.ss-move-row > strong { flex: 1 1 9rem; }
.ss-move-when { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ss-move-when > .icon { color: var(--text-3); }
.ss-move-row + .ss-move-row { border-top: 1px solid var(--border); }
.ss-move-row.moved { background: var(--accent-soft); }
.ss-move-warn { flex-basis: 100%; display: inline-flex; align-items: center; gap: 6px; color: var(--warn); }
/* Finger: «−», «+» und Griff mit grösserer Tippfläche, ohne sie grösser zu zeichnen */
@media (pointer: coarse) {
  .ss-step-btn { width: 34px; height: 34px; }
  .ss-theme-grip { position: relative; }
  .ss-theme-grip::after { content: ''; position: absolute; inset: -6px -4px -6px -10px; }
}
/* Jahresbalken auf der Seite des Fachs: ein Klick auf eine Woche springt dorthin */
button.yp-week { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
button.yp-week:hover .yp-stack { box-shadow: 0 0 0 2px var(--text-3); }
button.yp-week.now:hover .yp-stack { box-shadow: 0 0 0 2px var(--accent); }
.yp-dot.now { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); border-radius: 2px; }
@media (max-width: 640px) {
  .ss-head-card { padding: 10px 12px 8px; }
  .ss-status-line .ss-room-line { flex-direction: column; align-items: flex-start; } /* ein Teil pro Zeile, ohne Punkt davor */
  .ss-status-line .ss-room-part + .ss-room-part::before { content: none; }
  .ss-sec-toggle { flex-basis: 100%; }
  .ss-theme-grip + .ss-sec-toggle { flex-basis: calc(100% - 30px); }
  .ss-sec-tools { margin-left: 30px; }
  .ss-sec-toggle > .yp-progress { flex-basis: 80px; }
  .ss-sec-head > .yp-drift { max-width: calc(100% - 8px); margin-left: 8px; }
}
/* Leiste eines Fachs passt nicht in eine Zeile (schedule-subject.js → fitNav()): kurze Beschriftungen, dann ohne Symbole */
.subject-nav.sn-compact .sb-full { display: none; }
.subject-nav.sn-compact .sb-short { display: inline; }
.subject-nav.sn-compact .sn-theme > .lbl { display: none; }
.subject-nav.sn-tight .select-btn > .icon:first-child { display: none; }
.page-head > .page-actions:has(> .subject-nav.sn-row) { flex-basis: 100%; justify-content: flex-start; }
/* Handy: kurze Beschriftungen ohne Symbole; mit Halbklassen und Bereichen in zwei Zeilen */
@media (max-width: 760px) {
  .week-nav.subject-nav { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  /* die Leiste bestimmt die Breite des Seitenkopfs nicht mit (sonst wird die Seite breiter als das Handy) */
  .page-head > .page-actions:has(> .subject-nav) { min-width: 0; contain: inline-size; }
  .week-nav.subject-nav { flex: 1 1 auto; min-width: 0; }
  .subject-nav .select-btn { flex: 0 1 auto; min-width: 0; padding-left: 10px; padding-right: 10px; }
  .subject-nav .select-btn.sn-subject { flex: 1 1 0; min-width: 6.5rem; }
  .subject-nav .select-btn:not(.sn-subject) { max-width: 42%; }
  .subject-nav .select-btn > .icon:first-child { display: none; } /* Platz für den Namen des Fachs */
  .subject-nav .select-btn-text { flex: 1; min-width: 0; max-width: none; text-align: left; }
  .subject-nav .sb-full { display: none; }
  .subject-nav .sb-short { display: inline; }
  .subject-nav .sn-theme { padding-left: 9px; padding-right: 9px; }
  .subject-nav .sn-theme > .lbl { display: none; } /* nur «+» */
}
.ss-more { display: flex; justify-content: center; }
/* Inhalte ohne Lektion (fällt aus, freier Tag) */
.ss-stranded-list { margin: 6px 0 8px; padding: 0; list-style: none; display: grid; gap: 4px; }
.ss-stranded-row { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; }
.ss-stranded-text { flex: 1 1 220px; min-width: 0; overflow-wrap: break-word; }
/* Themen, die bald ohne Inhalt beginnen (Übersicht, Planung) */
.soon-box:not(:empty) { margin: 12px 0 14px; }
.soon-list { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
/* in schmalen Karten (Übersicht mit drei Spalten, Handy) kommt der Knopf unter den Text statt das Fach Buchstabe für
   Buchstabe neben ihn */
.soon-row { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; }
.soon-row > .grow { flex: 1 1 220px; min-width: 0; overflow-wrap: break-word; }
/* Klassenliste aus Schulsoftware: Vorschau mit eigener Bildlaufleiste */
.import-preview { max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.import-preview .student-table { margin: 0; }
.ss-week { padding: 0; overflow: hidden; }
.ss-week.current { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.ss-week-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .92rem; }
.ss-week-head:last-child { border-bottom: 0; }
.ss-none { padding: 10px 14px; }
/* Filter «Bereich»: Wochen ohne seine Lektionen als eine Zeile */
.ss-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 10px 8px 14px; border-top: 1px solid var(--border); }
.ss-week-head + .ss-row { border-top: 0; }
.ss-row.today { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.ss-row.past .ss-when, .ss-row.past .we-inline:not(:focus) { opacity: .62; }
.ss-row.cancelled .ss-when strong { text-decoration: line-through; }
/* Themenblock der Jahresplanung: Farbstreifen links, Name und Nummer, Kopf beim Anfang des Blocks */
.ss-row.in-block { box-shadow: inset 4px 0 0 var(--blk); }
.ss-blk { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; color: var(--text-2); }
.ss-blk > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Handy: das Thema auf zwei Zeilen statt «7/25 · Br…» */
@media (max-width: 640px) { .ss-blk > span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: break-word; } }
.ss-blk .yp-dot { width: 8px; height: 8px; }
/* Dateien für alle Lektionen des Themas: eigene Zeile unter dem Titel */
.ss-block-files { flex-basis: 100%; min-width: 0; }
.ss-block-files:empty { display: none; }
.ss-block-files .lf-chips { margin-top: 0; }
.ss-when { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding-top: 5px; }
.ss-when strong { font-size: .92rem; }
.ss-field { position: relative; min-width: 0; }
.ss-status { position: absolute; right: 8px; bottom: -15px; font-size: .72rem; }
.ss-readonly { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 2px; min-height: 36px; }
.ss-readonly .we-view { flex: 1 1 100%; }
.ss-menu { width: 32px; height: 32px; display: grid; place-items: center; margin-top: 2px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--text-3); cursor: pointer; }
.ss-menu:hover, .ss-menu:focus-visible { background: var(--surface-2); color: var(--text); }
/* Inhalt in eine andere Lektion ziehen: Griff nur bei Lektionen mit Inhalt, die nicht fixiert sind; Ziel hervorgehoben mit Hinweis */
.ss-grip { cursor: grab; touch-action: none; }
.ss-row:not(.filled) .ss-grip, .ss-row.pinned .ss-grip { visibility: hidden; }
.ss-pin { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; border: 0; font: inherit; }
.ss-pin .icon { width: 12px; height: 12px; }
.ss-row.ss-dragging { opacity: .45; }
.ss-row.ss-drop { position: relative; background: color-mix(in srgb, var(--accent-soft) 70%, transparent); box-shadow: inset 0 0 0 2px var(--accent); }
.ss-row.ss-drop::after { content: attr(data-drop); position: absolute; z-index: 3; top: -11px; right: 12px; max-width: calc(100% - 24px); padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: .74rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.ss-ghost { position: fixed; z-index: 10050; pointer-events: none; display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-lg); font-size: .85rem; }
.ss-ghost span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.we-editor.we-inline { position: relative; min-height: 36px; max-height: none; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.we-editor.we-inline:hover { border-color: var(--border-strong); }
.we-editor.we-inline:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.we-editor.we-inline.is-empty::before { content: attr(data-placeholder); position: absolute; left: 11px; top: 6px; color: var(--text-3); pointer-events: none; }
/* Planung → Termine: Bezeichnung direkt in der Zeile, darunter die Notiz */
.ev-row .ss-field { display: flex; flex-direction: column; gap: 4px; }
.ev-title { width: 100%; min-width: 0; padding: 5px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-weight: 600; }
.ev-title:hover { border-color: var(--border); }
.ev-title:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ss-row.past .ev-title:not(:focus) { opacity: .62; }
.ss-week-head .ev-add { margin: -6px -8px -6px 0; }
.ss-preview { display: flex; flex-direction: column; gap: 6px; }
/* Vorschlag von Claude im Dialog «Sequenz einfügen» */
.ss-ai { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--ai) 30%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--ai) 5%, var(--surface)); }
.ss-ai-grid { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; }
@media (max-width: 640px) { .ss-ai-grid { grid-template-columns: minmax(0, 1fr) 90px; } }
.ss-files { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ss-files .chip { max-width: 100%; overflow-wrap: anywhere; }
/* «Inhalte einfügen»: für welches Thema, dann die Wege (selbst schreiben, Liste, Thema, KI) */
.ss-for { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.ss-ways { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ss-way { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ss-way strong { display: flex; align-items: flex-start; gap: 6px; font-size: 13.5px; line-height: 1.3; }
.ss-way strong .icon { flex: none; margin-top: 1px; }
.ss-way-hint { font-size: 12px; color: var(--text-2); line-height: 1.3; }
@media (hover: hover) { .ss-way:hover { border-color: var(--accent); } }
.ss-way.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.ss-way.ai.on { border-color: var(--ai); background: color-mix(in srgb, var(--ai) 8%, var(--surface)); box-shadow: inset 0 0 0 1px var(--ai); }
.ss-ways.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .ss-ways, .ss-ways.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ss-ways.three > :last-child { grid-column: span 2; } }
/* eingefügte Tabelle: welche Spalten in die Lektion kommen */
.ss-table > .grow { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ss-cols { display: flex; flex-wrap: wrap; gap: 6px; }
.ss-col { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); cursor: pointer; overflow-wrap: anywhere; }
.ss-col.on { border-color: var(--accent); background: var(--accent-soft); }
/* KI: neu vorschlagen oder aus einem Dokument übernehmen */
.ss-ai-mode { display: flex; width: 100%; }
.ss-ai-mode .seg-btn { min-width: 0; }
.ss-doc-row { gap: 6px; flex-wrap: wrap; align-items: center; }
.ss-plan { display: flex; flex-direction: column; max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.ss-plan-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px; padding: 6px 10px; border-top: 1px solid var(--border); font-size: .88rem; }
.ss-plan-row:first-child { border-top: 0; }
.warn-text { color: var(--warn); }
/* Thema der Lektion, zu dem der Inhalt danach gehört (Vorjahr übernehmen), mit seiner Farbe */
.ss-theme { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: .74rem; white-space: nowrap; }
.ss-theme .yp-dot { width: 7px; height: 7px; margin-right: 4px; vertical-align: 0; }
.ss-theme.warn { background: var(--warn-soft); color: var(--warn); }
.ss-plan-row.tinted { box-shadow: inset 3px 0 0 var(--blk); }
/* Assistent: Schritte oben, die erledigten führen zurück */
.wiz-steps { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.wiz-steps li { flex: 1; min-width: 0; }
.wiz-steps button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--text-3); font: inherit; font-size: .86rem; font-weight: 600; text-align: left; }
.wiz-steps button:disabled { cursor: default; opacity: 1; }
.wiz-steps .done button { color: var(--text-2); cursor: pointer; }
.wiz-steps .done button:hover { background: var(--surface-2); color: var(--text); }
.wiz-steps .on button { color: var(--text); }
.wiz-steps .n { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); font-size: .78rem; }
.wiz-steps .on .n { background: var(--accent); color: var(--accent-text); }
.wiz-steps .done .n { background: var(--accent-soft); color: var(--accent-strong); }
.wiz-steps .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Schuljahreswechsel: Klassen als Karten, Stundenplan zur Wahl, Fächer mit Quelle, Übersicht und Ergebnis */
.sy-class { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }
.sy-class-head { display: flex; align-items: center; gap: 12px; }
.sy-class-head .select { width: auto; max-width: 230px; }
.sy-class-details p { margin: 0; }
.sy-kids summary { cursor: pointer; }
.sy-kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; margin-top: 8px; }
.sy-choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.sy-choice.on { border-color: var(--accent); background: var(--accent-soft); }
.sy-choice input { margin-top: 3px; }
.sy-subjects { display: grid; border: 1px solid var(--border); border-radius: 10px; }
.sy-subject { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.sy-subject + .sy-subject { border-top: 1px solid var(--border); }
.sy-subject.muted { color: var(--text-3); }
.sy-subject-name { flex: 1; min-width: 0; }
.sy-subject-name .chip { margin-left: 6px; }
.sy-subject-pick { display: flex; gap: 8px; flex: 0 1 460px; min-width: 0; }
.sy-subject-pick .select { min-width: 0; }
.sy-subject-pick .select:first-child { flex: 1 1 260px; }
.sy-subject-pick .select:last-child { flex: 0 1 190px; }
.sy-h { margin: 6px 0 0; font-size: .95rem; }
.sy-summary { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.sy-summary li { display: flex; gap: 8px; align-items: flex-start; }
.sy-summary li .icon { flex: none; margin-top: 3px; color: var(--accent); }
.sy-summary li.warn .icon { color: var(--warn); }
.sy-links { flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) {
  .sy-class-head { flex-wrap: wrap; }
  .sy-class-head .select { width: 100%; max-width: none; }
  .sy-subject { flex-direction: column; align-items: stretch; }
  .sy-subject-pick { flex: none; flex-direction: column; }
  .sy-subject-pick .select:first-child, .sy-subject-pick .select:last-child { flex: none; }
}
/* Vorjahr übernehmen: Quelle, Themen von damals (mit Farbe) und Inhalte in Abschnitten zwischen den Ferien */
.adopt-foot { gap: 8px; width: 100%; }
.adopt-found-box { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .88rem; }
.adopt-dots { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.adopt-dot, .adopt-topic { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.adopt-mode { display: flex; width: 100%; }
.adopt-mode .seg-btn { flex: 1 1 0; min-width: 0; line-height: 1.25; overflow-wrap: normal; hyphens: auto; }
.adopt-sec-text { display: flex; flex-direction: column; min-width: 0; }
.adopt-sec-text .small { font-weight: 400; }
.adopt-topics { display: grid; gap: 4px; }
@media (max-width: 640px) {
  .wiz-steps li { flex: none; }
  .wiz-steps li.on { flex: 0 1 auto; min-width: 0; }
  .wiz-steps li:not(.on) .lbl { display: none; }
  .adopt-foot .adopt-back ~ .adopt-cancel { display: none; }
}
.adopt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.adopt-src { max-height: min(40vh, 340px); overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.adopt-src > .empty { padding: 16px; }
.adopt-src-head { margin-bottom: 4px; }
.adopt-none { margin: 0; padding: 12px; }
.adopt-sec + .adopt-sec { border-top: 1px solid var(--border); }
.adopt-sec-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; background: var(--surface-2); }
.adopt-sec-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .88rem; }
.adopt-sec-label input, .adopt-row input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); }
.adopt-row { display: grid; grid-template-columns: auto 92px minmax(0, 1fr); align-items: baseline; gap: 8px; padding: 5px 10px 5px 30px; border-top: 1px solid var(--border); font-size: .86rem; cursor: pointer; }
@media (max-width: 640px) { .adopt-lbl { display: none; } .adopt-row { grid-template-columns: auto minmax(0, 1fr); padding-left: 14px; } .adopt-row > span:last-child { grid-column: 2; } }
.linklike { padding: 0; border: 0; background: none; color: var(--accent-strong); font: inherit; text-decoration: underline; cursor: pointer; }
.ss-plan-break { padding: 3px 10px; border-top: 1px solid var(--border); background: var(--warn-soft); color: var(--warn); font-size: .76rem; font-weight: 650; text-align: center; }
.ss-plan-break:first-child { border-top: 0; }
/* Lektionen für später speichern: Auswahl mit Häkchen, Leiste unten */
.ss-row.ss-pickrow { grid-template-columns: 150px minmax(0, 1fr); cursor: pointer; user-select: none; -webkit-user-select: none; } /* Shift-Klick markiert keinen Text */
.ss-pickrow:hover { background: var(--surface-2); }
.ss-pickrow.picked { background: color-mix(in srgb, var(--accent-soft) 75%, transparent); }
.ss-pickrow.off { cursor: default; }
.ss-pickrow.off .ss-when, .ss-pickrow.off .ss-field { opacity: .55; }
.ss-pick { display: inline-flex; align-items: center; gap: 8px; }
.ss-pick input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); }
.ss-pickbar { position: sticky; bottom: 14px; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); }
.ss-pickcount { font-size: .92rem; }
/* Tablet: Anzahl links, Knöpfe rechts beisammen (statt halb links, halb rechts) */
@media (min-width: 561px) and (max-width: 1100px) { .ss-pickbar { justify-content: flex-end; } .ss-pickbar > .grow { display: none; } .ss-pickcount { margin-right: auto; } }
/* Fach-Leiste: Suche und «…» rechts beisammen, wenn sie umbricht */
.subject-nav .sn-search { margin-left: auto; }
.subject-nav .sn-search ~ .wn-more { margin-left: 0; }
@media (max-width: 1100px) { .subject-nav .wn-extra { display: none; } } /* Tablet: unter «…» (schedule-subject.js, schedule-events.js → narrow) */
.ss-first { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
/* Planung: gespeicherte Sequenzen, nach Fach, mit Suche und Filter nach Klassenstufe */
.saved-seqs { margin-top: 18px; }
.saved-seqs > p { padding: 14px 18px; }
.saved-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.saved-search { position: relative; flex: 1 1 240px; display: flex; align-items: center; min-width: 0; }
.saved-search > .icon { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.saved-search input { width: 100%; padding-left: 32px; }
.saved-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-filters .select { width: auto; min-width: 9em; max-width: 14em; }
/* auf dem Handy zwei Filter pro Zeile */
@media (max-width: 600px) { .saved-filters { flex: 1 1 100%; } .saved-filters .select { flex: 1 1 40%; min-width: 0; max-width: none; } }
@media (max-width: 400px) { .saved-filters .select { flex-basis: 100%; } } /* eine Auswahl pro Zeile, ganz lesbar */
.saved-group-head { display: flex; align-items: baseline; gap: 8px; padding: 7px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .9rem; }
.saved-group + .saved-group .saved-group-head { border-top: 1px solid var(--border); }
.saved-none { margin: 0; padding: 14px 18px; }
.saved-title { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.saved-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px 10px 18px; border-top: 1px solid var(--border); }
.saved-row > .btn { margin-left: auto; } /* schmal: unter dem Namen, rechts */
.saved-group-head + .saved-row { border-top: 0; }
/* Themen wählen (z. B. zum Herunterladen): Häkchen, die ganze Zeile wählt; die Leiste darunter klebt unten */
.saved-pickrow { flex-wrap: nowrap; align-items: flex-start; cursor: pointer; user-select: none; -webkit-user-select: none; }
.saved-pickrow:hover { background: var(--surface-2); }
.saved-pickrow.picked { background: color-mix(in srgb, var(--accent-soft) 75%, transparent); }
.saved-pickrow .ss-pick { padding-top: 2px; }
.pick-slot { display: contents; }
/* Vorschau importierter Themen (Datei, Antwort einer KI): jede Lektion mit Inhalt und Material wie in der Planung */
.tp-preview { display: flex; flex-direction: column; gap: 10px; }
.tp-topic { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.tp-head { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 6px; align-items: center; padding: 10px 12px; background: var(--surface-2); cursor: pointer; list-style: none; }
.tp-head::-webkit-details-marker { display: none; }
.tp-head > .icon { color: var(--text-3); transition: transform .15s; }
.tp-topic:not([open]) > .tp-head > .icon { transform: rotate(-90deg); }
.tp-topic[open] > .tp-head { border-bottom: 1px solid var(--border); }
.tp-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; overflow-wrap: anywhere; }
.tp-meta { grid-column: 2; margin-top: 2px; overflow-wrap: anywhere; }
.tp-topic > .notice { margin: 10px 12px 0; }
.tp-lessons { list-style: none; margin: 0; padding: 0; }
.tp-lessons > li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; padding: 9px 12px; border-top: 1px solid var(--border); }
.tp-lessons > li:first-child { border-top: 0; }
.tp-n { padding-top: 1px; color: var(--text-3); font-size: .8rem; font-weight: 650; text-align: right; }
.tp-body { min-width: 0; overflow-wrap: anywhere; }
.tp-mat { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--text-2); }
.tp-mat .icon { flex: none; }
.tp-legend { gap: 6px; }
/* Thema mit KI erstellen: Prompt zum Ansehen */
.ai-prompt summary { cursor: pointer; color: var(--text-2); }
.ai-prompt pre { margin: 8px 0 0; max-height: 240px; overflow: auto; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: .78rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
/* «Antwort der KI» mit «Antwort löschen» rechts; gleich hoch, ob der Knopf da ist oder nicht */
.tp-answer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.saved-fields { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 10px; }
@media (max-width: 640px) { .saved-fields { grid-template-columns: minmax(0, 1fr); } }
/* im Dialog «Gespeicherte Sequenz einfügen» */
.saved-pick .saved-tools { padding: 0 0 12px; border-bottom: 0; }
.saved-pick .saved-groups { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.saved-pick .saved-group-head { padding: 6px 12px; }
.saved-pick .picker-row { width: 100%; }
.saved-pick .saved-group .picker-row:last-child { border-bottom: 0; }
.saved-main { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.saved-main:hover strong { color: var(--accent-strong); }
.saved-main > * { max-width: 100%; overflow-wrap: anywhere; }
.saved-items { display: flex; flex-direction: column; max-height: min(52vh, 480px); overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.saved-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 6px 6px 10px; border-top: 1px solid var(--border); }
.saved-item:first-child { border-top: 0; }
/* Material einer gespeicherten Sequenz: Lektion, was zu tun ist, Datei, entfernen */
.seq-mat-rows { display: grid; gap: 6px; }
.seq-mat-row { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) 32px 32px; gap: 6px; align-items: center; }
@media (max-width: 560px) {
  .seq-mat-row { grid-template-columns: minmax(0, 1fr) 32px 32px; }
  .seq-mat-row > select { grid-column: 1 / -1; }
  .seq-mat-row + .seq-mat-row { padding-top: 8px; border-top: 1px solid var(--border); }
}
.saved-n { flex: none; width: 24px; padding-top: 3px; text-align: right; }
/* Lektionen eines Themas bearbeiten (themelessons.js): Werkzeuge rechts neben dem Feld, auf dem Handy darunter */
.tle-item .saved-n { padding-top: 9px; }
/* Inhalte, die dem Stundenplan folgen (nur ansehen): Nummer und erste Zeile mittig zur Büroklammer daneben (32 px, Touch 40 px) */
.tle-view { --tle-btn: 32px; }
.tle-view > :is(.saved-n, .grow) { padding-top: calc((var(--tle-btn) - 1.5em) / 2); line-height: 1.5; }
@media (pointer: coarse) { .tle-view { --tle-btn: 40px; } }
.tle-tools { display: flex; flex: none; gap: 2px; padding-top: 2px; }
.tle-add { gap: 4px; }
@media (max-width: 560px) {
  .tle-item { flex-wrap: wrap; row-gap: 2px; }
  .tle-item > .grow { flex: 1 1 calc(100% - 40px); }
  .tle-tools { margin-left: auto; padding-top: 0; }
}
@media (max-width: 640px) {
  .ss-row { grid-template-columns: minmax(0, 1fr) auto; padding: 8px 8px 10px 12px; }
  .ss-when { grid-column: 1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-top: 6px; }
  .ss-field { grid-column: 1 / -1; grid-row: 2; }
  .ss-tools { grid-column: 2; grid-row: 1; }
  .ss-plan-row { grid-template-columns: 1fr; gap: 2px; }
  .ss-row.ss-pickrow { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) { .ss-pickbar { bottom: calc(72px + env(safe-area-inset-bottom)); } }
@media (max-width: 560px) { .ss-pickbar .pb-lbl { display: none; } .ss-pickbar .btn.sm { padding-left: 9px; padding-right: 9px; } }
/* Meldungen (mit «Rückgängig») über der Leiste der Auswahl, nicht darauf */
body:has(.ss-pickbar) .toasts { bottom: 84px; }
@media (max-width: 860px) { body:has(.ss-pickbar) .toasts { bottom: calc(150px + env(safe-area-inset-bottom)); } }
/* Halbklassen nebeneinander: eine Spalte pro Halbklasse, Lektionen der ganzen Klasse über die ganze Breite */
.ss-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.ss-week-head + .ss-side { border-top: 0; }
.ss-side + .ss-row { border-top: 1px solid var(--border); }
.ss-side-col { min-width: 0; }
.ss-side-col + .ss-side-col { border-left: 1px solid var(--border); }
.ss-side-head { padding: 6px 10px 0 14px; }
.ss-side-head + .ss-row { border-top: 0; }
.ss-side .ss-row { grid-template-columns: minmax(0, 1fr) auto; padding: 8px 8px 10px 14px; }
.ss-side .ss-when { grid-column: 1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-top: 6px; }
.ss-side .ss-when > .chip.accent { display: none; } /* steht über der Spalte */
.ss-side .ss-field { grid-column: 1 / -1; grid-row: 2; }
.ss-side .ss-tools { grid-column: 2; grid-row: 1; }
.ss-side .ss-row.ss-pickrow { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) {
  .ss-side { grid-template-columns: minmax(0, 1fr); }
  .ss-side-col + .ss-side-col { border-left: 0; border-top: 1px solid var(--border); }
}
/* Wie viel Platz bleibt */
.ss-room { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.ss-room > .icon { margin-top: 2px; color: var(--text-3); flex: none; }
.ss-room-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; }
.ss-room-part { white-space: nowrap; }
@media (max-width: 560px) { .ss-room-part { white-space: normal; } }
/* Suche in der Planung */
.ss-search { margin-bottom: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ss-search-bar { display: flex; align-items: center; gap: 8px; }
.ss-search-bar > .icon { flex: none; color: var(--text-3); }
.ss-search-bar .input { flex: 1; min-width: 0; }
.ss-search-bar .select { width: auto; flex: none; }
/* kleines Handy: das Suchfeld über die ganze Breite, das Schuljahr darunter */
@media (max-width: 400px) {
  .ss-search-bar { flex-wrap: wrap; }
  .ss-search-bar .input { flex: 1 1 calc(100% - 84px); }
  .ss-search-bar .select { order: 1; flex: 1; }
}
.ss-hits { display: flex; flex-direction: column; gap: 2px; max-height: min(50vh, 420px); overflow: auto; }
.ss-hits:empty { display: none; }
.ss-hit { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 10px; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: .88rem; text-align: left; cursor: pointer; }
.ss-hit:hover, .ss-hit:focus-visible { background: var(--surface-2); outline: none; }
.ss-hit-when { color: var(--text-2); }
.ss-hit-text { min-width: 0; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.ss-hit-files { color: var(--text-2); }
@media (max-width: 640px) { .ss-hit { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.ss-row.ss-flash { animation: ss-flash 2.2s ease-out; }
@keyframes ss-flash { 0%, 35% { background: color-mix(in srgb, var(--mark-yellow) 40%, transparent); } }
/* Suche im Stundenplan: Treffer ab heute nach dem Strich, gewählter Treffer, Eintrag leuchtet nach dem Sprung auf */
.sp-today { display: flex; align-items: center; gap: 8px; margin: 4px 8px; font-size: .74rem; font-weight: 650; color: var(--accent-strong); }
.sp-today::after { content: ""; flex: 1; border-top: 1px solid currentColor; opacity: .4; }
.ss-hit[aria-current] { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sp-found { animation: sp-found 2.6s ease-out; }
@keyframes sp-found { 0%, 45% { box-shadow: inset 0 0 0 3px var(--mark-yellow), 0 0 0 3px color-mix(in srgb, var(--mark-yellow) 40%, transparent); } }
.wn-search { margin-left: auto; }
.wn-search + .wn-more, .wn-search + .wn-setup, .wn-setup + .wn-more { margin-left: 0; }
/* Zahnrad «Stundenplan einrichten»: Plan, Kalender, Ferien, Darstellung und Personen über der Woche; ein Punkt daran, wenn
   ein Kalender nicht lädt */
.wn-setup { position: relative; }
.wn-setup.active { background: var(--surface-3); color: var(--text); }
.wn-alert { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.sp-setup { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.sp-setup-head { display: flex; align-items: center; gap: 8px; padding-left: 4px; flex-wrap: wrap; }
.sp-setup-links { display: flex; flex-wrap: wrap; gap: 4px; }
/* Handy: «Darstellung & Legende» und «Personen» in einer eigenen Zeile unter dem Titel */
@media (max-width: 760px) { .sp-setup-links { order: 3; flex-basis: 100%; } }
.sp-setup-head .icon { color: var(--text-2); }
/* Laptop: «Fach» statt «Alle Fächer», damit die Leiste neben dem Titel Platz hat */
@media (max-width: 1500px) {
  .wn-tools .sb-full { display: none; }
  .wn-tools .sb-short { display: inline; }
}
@media (max-width: 640px) {
  .sp-setup { gap: 8px; padding: 8px; }
  /* die beiden Knöpfe nebeneinander, gleich breit (statt je allein in einer Zeile) */
  .sp-setup-links { display: grid; grid-template-columns: 1fr 1fr; }
  .sp-setup-links .btn { justify-content: center; }
}
@media (max-width: 640px) {
  /* Handy: Feld und Schliessen oben, Schuljahr und «Suchen» darunter */
  .sp-search .ss-search-bar { flex-wrap: wrap; }
  .sp-search .ss-search-bar .input { flex: 1 1 calc(100% - 84px); }
  .sp-search .ss-search-bar .select { order: 1; flex: 1; }
  .sp-search .ss-search-bar .sp-go { order: 2; }
  /* nur ein «×»: das daneben schliesst die Suche, das des Browsers im Feld fällt weg */
  .sp-search .ss-search-bar .input::-webkit-search-cancel-button { display: none; }
}
/* Ziehen mit Alt/Ctrl: Kopie */
.ss-ghost-copy { display: none; margin-left: 8px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: .72rem; font-style: normal; font-weight: 650; }
.ss-ghost.copy .ss-ghost-copy { display: inline-block; }
/* Letzte Schritte, wiederkehrende Inhalte */
.ss-hist { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; max-height: 340px; overflow: auto; }
.ss-hist .empty { padding: 14px; }
.ss-hist-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 8px 10px; border-top: 1px solid var(--border); }
.ss-hist-row:first-child { border-top: 0; }
/* schmal: «Rückgängig» unter den Text statt Wörter in einer engen Spalte zu trennen */
.ss-hist-row .grow { flex: 1 1 12em; min-width: 0; overflow-wrap: break-word; }
.ss-hist-row > .btn:first-of-type { margin-left: auto; }
.ss-rec-title { margin: 6px 0 0; font-size: .95rem; }
.ss-rec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ss-rec-lessons { display: flex; flex-wrap: wrap; gap: 4px 18px; }
@media (max-width: 720px) { .ss-rec-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .ss-rec-grid > :first-child { grid-column: 1 / -1; } }
/* Fächeransicht auf Papier: Tabelle mit Datum, Zeit, Halbklasse, Inhalt */
.subject-sheet .ss-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.subject-sheet .ss-table th { text-align: left; padding: 5px 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: .74rem; }
.subject-sheet .ss-table td { padding: 5px 8px; border: 1px solid var(--border); vertical-align: top; }
/* Jahresübersicht drucken: Zeitleiste auf A4 quer, Fächer als Zeilen, Wochen als Spalten (auch Grundlage fürs PDF:
   Ferien und Platz ohne Verlauf, Striche als Rand) */
.timeline-sheet .tp-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 7.5pt; line-height: 1.2; }
.timeline-sheet .tp-c-label { width: 30mm; }
.timeline-sheet th, .timeline-sheet td { padding: 0; border: 1px solid var(--border); }
.timeline-sheet thead th { background: var(--surface-2); font-weight: 650; }
.timeline-sheet .tp-corner { padding: 1mm 2mm; text-align: left; vertical-align: bottom; color: var(--text-3); font-weight: 500; }
.timeline-sheet .tp-month { padding: 1mm; overflow: hidden; text-align: left; white-space: nowrap; }
.timeline-sheet .tp-kw { padding: .6mm 0; text-align: center; font-size: 6.5pt; font-weight: 500; color: var(--text-2); }
.timeline-sheet .tp-kw.off, .timeline-sheet .tp-off { background: var(--warn-soft); }
.timeline-sheet .tp-month.s, .timeline-sheet .tp-kw.s { border-left: 2px solid var(--text-3); }
.timeline-sheet .tp-label { padding: 1mm 2mm; text-align: left; font-weight: 600; vertical-align: middle; }
.timeline-sheet .tp-label > span { display: inline-block; max-width: calc(100% - 4mm); vertical-align: middle; overflow-wrap: anywhere; }
.timeline-sheet .tp-label small { display: block; font-size: 6.5pt; font-weight: 500; color: var(--text-2); }
.timeline-sheet .tp-dot { display: inline-block; width: 2mm; height: 2mm; margin-right: 1.4mm; border-radius: 50%; background: var(--border-strong); vertical-align: middle; }
.timeline-sheet .tp-track { height: 9mm; }
.timeline-sheet .tp-lane { position: relative; height: 9mm; }
.timeline-sheet .tp-off { position: absolute; top: 0; bottom: 0; }
.timeline-sheet .tp-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--border); }
.timeline-sheet .tp-line.s { border-left: 2px solid var(--text-3); }
.timeline-sheet .tp-bar { position: absolute; top: 1mm; bottom: 1mm; overflow: hidden; padding: .7mm 1mm; border-radius: 1.2mm; background: var(--accent); color: #fff; font-size: 6.5pt; font-weight: 600; line-height: 1.15; }
/* Titel höchstens zwei Zeilen, Wörter ganz (zu lange abgeschnitten) */
.timeline-sheet .tp-bar > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: normal; word-break: normal; }
.timeline-sheet .tp-bar.free { padding: 0; background: none; border: 1px dashed var(--border-strong); }
.timeline-sheet.mono .tp-bar:not(.free) { background: #fff; color: var(--text); border: 1px solid var(--text-3); }
.timeline-sheet.mono .tp-dot { background: var(--text-3); }
.timeline-sheet .tp-group td { padding: 1.2mm 2mm; background: var(--surface-2); font-weight: 650; }
.timeline-sheet tr { break-inside: avoid; }
.timeline-sheet .tp-legend { display: flex; flex-wrap: wrap; gap: 1mm 5mm; margin-top: 2mm; font-size: 7pt; color: var(--text-2); }
.timeline-sheet .tp-legend > span { display: inline-flex; align-items: center; gap: 1.5mm; }
.timeline-sheet .tp-key { display: inline-block; width: 5mm; height: 2.5mm; border-radius: .8mm; background: var(--accent); }
.timeline-sheet .tp-key.free { background: none; border: 1px dashed var(--border-strong); }
.timeline-sheet .tp-key.off { background: #faefcf; border: 1px solid var(--border); }
.timeline-sheet .tp-key.sem { width: 0; height: 3mm; border-radius: 0; background: none; border-left: 2px solid var(--text-3); }
.timeline-sheet.mono .tp-key:not(.free):not(.off):not(.sem) { background: #fff; border: 1px solid var(--text-3); }
/* Jahresplanung drucken: Wochen als Zeilen, Fächer als Spalten */
.yearplan-sheet .yo-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .72rem; line-height: 1.25; }
.yearplan-sheet .yo-table th, .yearplan-sheet .yo-table td { padding: 3px 5px; border: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.yearplan-sheet .yo-table thead th { background: var(--surface-2); text-align: left; font-size: .74rem; }
.yearplan-sheet .yo-kw { width: 9mm; color: var(--text-2); white-space: nowrap; }
.yearplan-sheet .yo-date { width: 15mm; white-space: nowrap; }
.yearplan-sheet .yo-date small { display: block; color: var(--text-2); white-space: normal; font-size: .9em; }
.yearplan-sheet .yo-gap td { padding: 2px 6px; background: #f1ede4; color: var(--text-2); text-align: center; font-size: .68rem; }
.yearplan-sheet .yo-block strong { display: block; }
.yearplan-sheet .yo-block span { color: var(--text-2); font-size: .9em; }
.yearplan-sheet .yo-block .yo-note { display: block; margin-top: 2px; color: var(--text); white-space: pre-line; }
/* Inhalte: pro Lektion die erste Zeile, nummeriert */
.yearplan-sheet .yo-contents { margin-top: 3px; font-size: .92em; line-height: 1.3; }
.yearplan-sheet .yo-part + .yo-contents { margin: 1px 0 3px 11px; }
.yearplan-sheet .yo-part { display: flex; align-items: baseline; gap: 4px; }
.yearplan-sheet .yo-part .yp-dot { width: 7px; height: 7px; }
.yearplan-sheet .yo-free { color: var(--text-3); }
.yearplan-sheet tfoot td { background: var(--surface-2); color: var(--text-2); font-size: .68rem; }
.subject-sheet .ss-tweek td { background: var(--surface-2); font-weight: 650; font-size: .74rem; }
.subject-sheet .ss-tweek td span { font-weight: 400; color: var(--text-2); }
.subject-sheet .ss-trow td:nth-child(-n+2) { width: 1%; }
/* Elterngespräche: die Spalte «Kind» nimmt den Rest der Zeile */
.subject-sheet .pm-print .ss-trow td:nth-child(2) { width: auto; }
.subject-sheet .ss-trow.cancelled td:first-child { text-decoration: line-through; }
.subject-sheet .ss-off { color: var(--warn); font-weight: 600; }
.subject-sheet .we-view { line-height: 1.35; }

/* Fach-Filter: gewähltes Fach hervorheben, alles andere blasser (Darüberfahren zeigt es wieder deutlicher) */
.subject-on .wg-cell > :not(.hit, .wg-add), .subject-on .lesson:not(.hit), .subject-on .tl-break .notes, .subject-on .cal-allday, .subject-on .day-notes, .subject-on .tl-free { opacity: .3; transition: opacity .12s; }
.subject-on .wg-cell > :not(.hit, .wg-add):hover, .subject-on .wg-cell > :not(.hit, .wg-add):focus-within, .subject-on .lesson:not(.hit):hover { opacity: .85; }
.week-grid { display: grid; grid-template-columns: 70px repeat(5, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: clip; }
.wg-head { padding: 10px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 650; font-size: .9rem; position: sticky; top: 0; z-index: 2; }
body:has(.m-top) .wg-head { top: var(--m-top-h, 0px); } /* mit der Kopfzeile oben (Tablet) darunter, nicht dahinter */
.wg-head .date { display: block; font-weight: 500; color: var(--text-3); font-size: .8rem; }
/* schmale Wochenansicht (Tablet): «Mo», «Di» … statt Wochentage, die mitten im Wort umbrechen */
.wg-scroll { container-type: inline-size; }
.wg-head .wd-short { display: none; }
@container (max-width: 760px) { .wg-head .wd-long { display: none; } .wg-head .wd-short { display: inline; } }
.wg-head.today { background: var(--accent-soft); color: var(--accent-strong); }
.wg-head .label { display: inline-block; margin-top: 3px; max-width: 100%; overflow-wrap: normal; hyphens: auto; } /* «Weiterbildungs-tag» statt mitten im Wort */
.wg-time { padding: 8px 8px; font-size: .78rem; color: var(--text-2); font-variant-numeric: tabular-nums; border-top: 1px solid var(--border); text-align: right; line-height: 1.25; }
.wg-time .end { display: block; color: var(--text-3); }
/* Raster, das seitlich scrollt (fester Stundenplan, Halbklassen): die Zeiten bleiben links stehen */
.wg-scroll > .week-grid > :is(.wg-time, .wg-head:first-child) { position: sticky; left: 0; }
.wg-scroll > .week-grid > .wg-time { z-index: 3; background: var(--surface); }
.wg-scroll > .week-grid > .wg-head:first-child { z-index: 4; }
.wg-cell { border-top: 1px solid var(--border); border-left: 1px solid var(--border); padding: 4px; display: grid; gap: 4px; grid-auto-flow: column; grid-auto-columns: 1fr; min-width: 0; min-height: 44px; }
.wg-cell.off { background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--surface-3) 8px 16px); }
.wg-cell.today { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.wg-lesson { border-radius: 7px; padding: 5px 7px 5px 9px; font-size: .8rem; position: relative; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; min-width: 0; text-align: left; color: inherit; hyphens: auto; }
.wg-lesson::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lesson-color, var(--border-strong)); }
.wg-lesson.tinted { background: color-mix(in srgb, var(--lesson-color) 28%, var(--surface)); border-color: color-mix(in srgb, var(--lesson-color) 55%, var(--border)); }
.wg-lesson .t { font-weight: 640; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-lesson .g { font-size: .68rem; color: var(--text-2); font-weight: 650; display: block; }
/* wer dabei ist (Personen im Stundenplan) */
.wg-lesson .p { display: flex; align-items: center; gap: 3px; font-size: .68rem; color: var(--text-2); font-weight: 600; margin-top: 1px; }
.wg-lesson .p .icon { width: 11px; height: 11px; flex: none; }
/* Fach und rechts davon die Personen: das Fach bricht dafür zwischen Wörtern um, höchstens auf zwei Zeilen (ein längerer
   Name endet mit «…», ganz steht er im Tooltip); passt nicht einmal das längste Wort, stehen die Personen darunter
   (rechtsbündig) */
.wg-lesson .tr { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 6px; min-width: 0; }
.wg-lesson .tr .t { flex: 1 1 0%; min-width: min-content; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.wg-lesson .tr .p { margin: 2px 0 0 auto; white-space: nowrap; }
/* ohne Personen daneben (und immer in der schmalen Spalte rechts für lange Termine, wg-side): ein Wort, das nicht in die Zeile
   passt, wird getrennt statt abgeschnitten, so endet auch ein solcher Name nach zwei Zeilen mit «…» */
.wg-lesson .tr .t:only-child, .wg-side .wg-lesson .tr .t { min-width: 0; overflow-wrap: anywhere; }
.lesson-people { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; font-weight: 600; color: var(--text-2); }
.lesson-people .icon { width: 12px; height: 12px; }
.people-editor { display: flex; flex-direction: column; gap: 8px; }
.people-rows { display: flex; flex-direction: column; gap: 6px; }
.people-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 190px auto; gap: 6px; align-items: center; }
@media (max-width: 600px) { .people-row { grid-template-columns: minmax(0, 1fr) 70px auto; } .people-row .select { grid-column: 1 / 3; } }
.wg-lesson .d { color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 1px; }
/* Links im Text einer Lektion: direkt anklickbar (Dateien öffnen in Lehrerpult) */
.wg-lesson .d a { color: var(--accent-strong); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; font-weight: 560; overflow-wrap: anywhere; }
.wg-lesson .d a:hover { color: var(--accent); text-decoration-thickness: 2px; }
.dots { display: inline-flex; gap: 3px; margin: 0 5px 0 0; vertical-align: 1px; }
.dots .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dots .dot.red { background: var(--mark-red); }
.dots .dot.green { background: var(--mark-green); }
.dots .dot.magenta { background: var(--mark-magenta); }
.dots .dot.yellow { background: var(--mark-yellow); }
.dots .dot.struck { opacity: .4; }
.wg-lesson > .dots { display: flex; margin: 3px 0 0; }
.wg-lesson.event { background: color-mix(in srgb, var(--mark-magenta) 10%, var(--surface)); border-style: dashed; }
.wg-lesson.event::before { background: var(--mark-magenta); }
.wg-lesson.event.tinted { background: color-mix(in srgb, var(--lesson-color) 13%, var(--surface)); border-color: color-mix(in srgb, var(--lesson-color) 45%, var(--border)); }
.wg-lesson.event.tinted::before { background: var(--lesson-color); }
.wg-scroll { overflow-x: auto; }
.wg-lesson.cancelled { opacity: .55; }
.wg-lesson.cancelled .t { text-decoration: line-through; }
/* läuft gerade: Rahmen in der Farbe der «Jetzt»-Linie (wie .lesson.current in der Übersicht) */
.wg-lesson.now { box-shadow: 0 0 0 2px var(--now); }
.wg-lesson.now.changed:not(.cancelled) { box-shadow: 0 0 0 2px var(--now), inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.lesson.clickable { cursor: pointer; }
.holiday-item.current { background: var(--accent-soft); }

/* Fester Stundenplan: Editor */
.plan-rows { display: flex; flex-direction: column; gap: 6px; }
.plan-row { display: grid; grid-template-columns: minmax(110px, 140px) 132px auto 132px 1fr auto; gap: 8px; align-items: center; }
.plan-row.pause .select, .plan-row.pause .input { background: var(--surface-2); }
.plan-row.bad .input { border-color: var(--danger); }
/* Handy: Art und Löschen oben, die Zeiten darunter. Sonst bleibt von der Auswahl nur der Pfeil */
@media (max-width: 640px) {
  .plan-rows { gap: 10px; }
  .plan-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 6px 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
  .plan-row:last-child { padding-bottom: 0; border-bottom: 0; }
  .plan-row > .select { grid-area: 1 / 1 / 2 / 4; }
  .plan-row > .btn { grid-area: 1 / 4; }
  .plan-row > .small { display: none; }
}
.plan-grid .wg-cell { min-height: 52px; }
/* Umstieg von den Word-Wochen: Art wählen */
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { margin-top: 3px; flex: none; }
.radio-card > span { display: flex; flex-direction: column; gap: 2px; }
/* Fenster «Thema» (newtheme.js): Abschnitte mit etwas mehr Luft */
.nt { gap: 18px; }
.nt-where { gap: 8px; }
.nt-where:not(:has(> :not([hidden]))) { display: none; }
/* «Wohin?» als Kacheln nebeneinander (auf dem Handy untereinander): Symbol, Titel, kurze Beschreibung; die gewählte farbig */
.nt-places { display: grid; grid-template-columns: repeat(var(--nt-n, 3), minmax(0, 1fr)); gap: 8px; }
.nt-place { position: relative; display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); cursor: pointer; transition: border-color .12s, background-color .12s; }
@media (hover: hover) { .nt-place:hover { border-color: var(--border-strong); } }
.nt-place:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.nt-place:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.nt-place-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); transition: background-color .12s, color .12s; }
.nt-place-icon .icon { width: 18px; height: 18px; }
.nt-place:has(input:checked) .nt-place-icon { background: var(--accent); color: var(--accent-text); }
.nt-place-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 1px; }
.nt-place-text strong { font-size: .9rem; line-height: 1.3; }
.nt-place-text span { font-size: .78rem; line-height: 1.35; color: var(--text-2); }
/* was zur gewählten Kachel gehört (Schuljahr, Halbklasse, ab welchem Tag, Lektionen, das bestehende Thema) in einer Zeile,
   die Namen links neben den Feldern; der Hinweis, wie viele Lektionen frei sind, daneben (schmal darunter) */
.nt-setup { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.nt-setup > .field { flex: 0 1 auto; flex-direction: row; align-items: center; gap: 8px; min-width: 0; }
.nt-setup > .field > span { white-space: nowrap; }
.nt-setup .select { width: auto; min-width: 7.5em; max-width: 100%; }
.nt-setup .nt-lessons .input { width: 6.5em; }
.nt-setup .nt-date .input { width: auto; }
.nt-setup .nt-wide { flex: 1 1 20rem; }
.nt-setup .nt-wide .select { flex: 1; min-width: 0; }
.nt-hint { flex: 1 1 16rem; margin: 0; color: var(--text-2); font-size: .84rem; line-height: 1.4; }
.nt-hint.warn { color: var(--warn); }
/* Inhalte: eine Karte mit den Inhalten und darunter allen Wegen in einer Leiste */
.nt-optional { font-weight: 450; color: var(--text-3); }
.nt-contents .tle { gap: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.nt-contents .tle > .saved-items { border: 0; border-radius: 10px 10px 0 0; }
.nt-contents .tle-add { flex-wrap: wrap; gap: 2px 4px; padding: 6px 8px; border-top: 1px solid var(--border); border-radius: 0 0 10px 10px; background: var(--surface-2); }
.nt-ai-btn.on { color: var(--ai); background: color-mix(in srgb, var(--ai) 10%, transparent); }
/* Material, Dateien für alle Lektionen, Weitere Angaben: eine Liste zum Aufklappen, rechts was darin ist */
.nt-folds { border: 1px solid var(--border); border-radius: 10px; }
.nt-folds:not(:has(> .nt-fold:not([hidden]))) { display: none; }
.nt-fold:not([hidden]) ~ .nt-fold:not([hidden]) { border-top: 1px solid var(--border); }
.nt-fold > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; cursor: pointer; list-style: none; }
.nt-fold > summary::-webkit-details-marker { display: none; }
.nt-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 10px; }
.nt-fold > summary strong { font-size: .9rem; font-weight: 600; white-space: nowrap; }
@media (hover: hover) { .nt-fold > summary:hover strong { color: var(--accent-strong); } }
.nt-fold-chev { flex: none; color: var(--text-3); transition: transform .15s; }
.nt-fold[open] > summary .nt-fold-chev { transform: rotate(90deg); }
.nt-fold-icon { flex: none; color: var(--accent); }
.nt-fold-val { min-width: 0; margin-left: auto; padding-left: 12px; overflow: hidden; color: var(--text-3); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.nt-fold > .stack { padding: 2px 12px 14px; }
@media (max-width: 560px) {
  .nt { gap: 16px; }
  .nt-places { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .nt-place { align-items: center; padding: 8px 10px; }
  .nt-place-icon { width: 30px; height: 30px; }
  .nt-setup { padding: 10px 12px; gap: 8px 12px; }
}
.nt-source { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); background: var(--surface-2); min-width: 0; }
.nt-source > .icon { margin-top: 3px; flex: none; color: var(--text-3); }
.nt-source .grow { min-width: 0; }
.plan-grid .plan-pause { min-height: 0; padding: 4px 10px; background: var(--surface-2); color: var(--text-3); font-size: .74rem; display: block; }
.wg-add { width: 100%; min-height: 42px; border: 1px dashed var(--border); border-radius: 7px; background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center; opacity: .55; }
.wg-add:hover, .wg-add:focus-visible { opacity: 1; border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.color-pick { display: flex; flex-wrap: wrap; gap: 8px; }
/* Farben in drei Reihen nach Farbton, darüber «keine» und «eigene» Farbe */
.color-pick:has(.cp-grid) { flex-direction: column; flex-wrap: nowrap; }
.color-pick .cp-extra { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.color-pick .cp-grid { display: grid; grid-template-columns: repeat(8, 30px); gap: 8px; }
@media (max-width: 380px) { .color-pick .cp-grid { grid-template-columns: repeat(8, 28px); gap: 6px; } .color-pick .cp-grid button { width: 28px; height: 28px; } }
.color-pick button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; display: grid; place-items: center; background: var(--surface); color: var(--text-3); }
.color-pick button.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.color-pick button.keep { width: auto; padding: 0 11px; border-radius: 15px; font-size: .78rem; font-weight: 600; color: var(--text-2); }
/* eigene Farbe: das Farbfeld des Browsers liegt unsichtbar über dem Kreis */
.color-pick .own { position: relative; width: 30px; height: 30px; border-radius: 50%; border: 2px dashed var(--border-strong); display: grid; place-items: center; color: var(--text-3); cursor: pointer; overflow: hidden; }
.color-pick .own.active { border: 2px solid var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.color-pick .own input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.color-pick .own:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Stundenplan von Hand: Speicherstand oben, Mehrfachauswahl im Raster */
.plan-save { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; color: var(--text-3); }
.plan-save > .icon { color: var(--success); }
.plan-save.bad, .plan-save.bad > .icon { color: var(--danger); }
.plan-save .linklike { white-space: nowrap; }
.btn.ghost.active { background: var(--accent-soft); color: var(--accent-strong); }
.plan-grid.picking .wg-add { opacity: .75; border-color: var(--border-strong); }
.plan-grid .wg-cell .wg-add.picked { opacity: 1; border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.wg-lesson.picked { outline: 3px solid var(--accent); outline-offset: -2px; }
.plan-grid .pick-all { cursor: pointer; }
/* A- und B-Wochen: Reiter über dem Raster, Buchstabe in Lektionen, die nur in einer Woche gelten */
.plan-ab-tabs { margin: 2px 0 0; }
.plan-ab-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 6px 12px; border-bottom: 1px solid var(--border); }
.plan-ab-bar .tabs { border-bottom: 0; margin: 0; }
.plan-ab-bar > .btn { margin: 0 0 6px auto; }
.plan-ab-tabs .tab-count { color: var(--text-3); font-weight: 500; }
@media (max-width: 560px) { .plan-ab-tabs .tab-count.n { display: none; } }
.wg-lesson .wg-ab { position: absolute; top: 3px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--text-2); color: var(--surface); font-size: .66rem; font-weight: 700; line-height: 17px; text-align: center; }
.wg-lesson:has(.wg-ab) .t { padding-right: 18px; }
.plan-grid .pick-all:hover, .plan-grid .pick-all:focus-visible { color: var(--accent-strong); background: var(--accent-soft); }
.wg-scroll .week-grid { min-width: 590px; } /* Tablet mit Seitenleiste: ganze Woche ohne seitliches Scrollen */
/* zwei Einträge nebeneinander (Halbklassen, Lektion neben Termin): nicht schmaler als 1000 px, sonst stehen Fächer und
   Namen Buchstabe für Buchstabe da; schmalere Bildschirme scrollen seitlich */
.wg-scroll .week-grid.wg-split { min-width: 1000px; }
/* die Wochentage bleiben beim Scrollen oben stehen; geht nur, wo das Raster nicht seitlich scrollt */
@media (min-width: 641px) and (max-width: 860px), (min-width: 900px) { .wg-scroll:has(> .week-grid:not(.plan-grid, .wg-split)) { overflow: visible; } }
.week-notes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* Geburtstage der Kinder zu Beginn des Tages */
.bdays { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: .8rem; color: var(--text-2); line-height: 1.35; }
.bdays > .icon { color: var(--mark-magenta); flex: none; }
.bday strong { font-weight: 600; color: var(--text); }
.timeline > .bdays { padding: 8px 12px; margin-bottom: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.wg-bdays { min-height: 0; align-content: center; }
.wg-bdays .bdays { font-size: .74rem; padding: 2px 4px; }
.wg-bdays .bdays > .icon { display: none; }
.week-grid .wg-time > .icon { color: var(--mark-magenta); }
.holiday-list { display: flex; flex-direction: column; gap: 6px; }
.holiday-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: .9rem; }
/* schmal: Datum und Knöpfe unter den Namen statt den Text in Stücke zu brechen */
.holiday-item > :first-child { flex: 1 1 12em; min-width: 0; overflow-wrap: break-word; }
.holiday-item > :last-child:not(:first-child) { margin-left: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .82rem; color: var(--text-2); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend-people { margin-left: auto; justify-content: flex-end; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--border); }

/* --------------------------------------------------------------- Vorlagen */

.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
/* untereinander: kein Platzhalter «Wähle eine Vorlage …» unter der Liste */
@media (max-width: 960px) { .split { grid-template-columns: minmax(0, 1fr); } .split-placeholder { display: none; } }
/* Aufgaben auf dem Handy: «Neue Abhakliste» unter «…» (wie «Abläufe» immer) */
@media (max-width: 640px) { .page-head .tk-extra { display: none; } }
/* E-Mail-Vorlagen auf dem Handy: zuerst die Liste, eine Vorlage dann für sich mit «Alle Vorlagen» */
.tpl-back { display: none; }
@media (max-width: 760px) {
  .tpl-split:not(.tpl-open) > .tpl-detail, .tpl-split.tpl-open > .tpl-list { display: none; }
  .tpl-back { display: block; margin: -4px 0 -6px -8px; }
}
.list-nav { display: flex; flex-direction: column; padding: 8px; gap: 2px; }
.list-nav .group-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; padding: 10px 10px 4px; }
.list-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; cursor: pointer; border: 0; background: none; text-align: left; width: 100%; color: var(--text); }
.list-item:hover { background: var(--surface-3); }
/* ohne Fettschrift: sonst bricht ein langer Titel beim Antippen anders um und die Liste springt */
.list-item.active { background: var(--accent-soft); color: var(--accent-strong); }
.list-item .icon { color: var(--text-3); }
.placeholder-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.preview-mail { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; line-height: 1.6; min-height: 160px; }
.preview-mail .ph { background: var(--warn-soft); color: var(--warn); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-actions .chip { padding: 5px 11px; font-size: .84rem; }

/* ----------------------------------------------------------------- Wissen */

.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
/* sehr lange Stichworte kürzen (ganzer Text im Eintrag) statt die Karte zu sprengen */
.kb-tags .chip, .tag-bar .chip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-bar { min-width: 0; max-width: 100%; }
/* Wissen: Suchen oder fragen in einem Feld, daneben «Fragen» und Alles/Notizen/Dateien; darunter Ordner und Stichworte in
   einer Zeile (auf dem Handy je eine Zeile zum Wischen) */
.kb-ai-hint { margin-bottom: 16px; }
.kb-search-row { margin-bottom: 12px; }
.kb-search-row > .search-wrap { max-width: 460px; }
.kb-answer { margin: 0 0 14px; }
/* Antwort aus «Letzte Fragen»: wann und was gefragt wurde */
.kb-asked { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.kb-asked .icon { align-self: center; }
.kb-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.kb-filters > .task-folders { margin: 0; }
/* die Stichworte fliessen hinter den Ordnern weiter (auch in die nächste Zeile), ein Strich trennt sie */
.kb-filters > .tag-bar { display: contents; }
.kb-filters > .task-folders:not([hidden]) + .tag-bar:not(:empty)::before { content: ''; align-self: stretch; width: 1px; margin: 3px 6px; background: var(--border); }
@media (max-width: 640px) {
  .kb-search-row > .search-wrap { flex: 1 1 100%; max-width: none; }
  .kb-filters { display: block; margin-bottom: 12px; }
  .kb-filters > .task-folders.kb-folders { margin: 0 -16px 8px; }
  .kb-filters > .tag-bar { display: flex; }
  .kb-filters > .task-folders:not([hidden]) + .tag-bar:not(:empty)::before { content: none; }
  /* Karte «Dateien»: Knöpfe nur als Symbol (Text bleibt für Bildschirmleser, Name im title) */
  .kb-files-actions { gap: 0; }
  .kb-files-actions > .btn { font-size: 0; gap: 0; min-width: 32px; padding: 7px 6px; justify-content: center; }
  .kb-files-title h2 { gap: 6px; }
  /* Symbole in der Zeile des Titels, die Zusammenfassung darunter über die ganze Breite */
  .kb-files-title { display: contents; }
  .kb-files-title > .card-summary { order: 2; flex-basis: 100%; margin-top: -4px; }
  .card-head > .kb-files-actions { order: 1; margin-left: auto; }
}
@media (max-width: 640px) { .tag-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .tag-bar .chip { flex: none; } }
.kb-card { padding: 16px 18px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color .12s, box-shadow .12s; }
.kb-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.kb-card .excerpt { color: var(--text-2); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; overflow-wrap: anywhere; }
.kb-file h3, .kb-hit h3 { display: flex; align-items: flex-start; gap: 7px; overflow-wrap: anywhere; }
.kb-file h3 > svg, .kb-hit h3 > svg { flex: none; margin-top: 3px; color: var(--accent); }
/* Treffer in Dateien: Ordner gekürzt (ganz im Tooltip), höchstens zwei Zeilen */
.kb-hit-path { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.kb-file-foot { margin-top: auto; justify-content: space-between; flex-wrap: nowrap; }
.kb-file-foot > .tiny { flex: none; white-space: nowrap; }
.kb-file-foot .kb-tags { min-width: 0; flex-wrap: wrap; }
.kb-file-foot .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Markierung von Dateien: Lehrmittel, Arbeitsblatt, Lösung */
.kind-chip { font-weight: 600; }
.file-name .kind-chip { font-size: .72rem; padding: 1px 7px; vertical-align: 1px; }
/* Ordner markieren (Wissen): Baum mit Auswahl pro Ordner */
.fk-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.fk-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px calc(10px + var(--depth, 0) * 18px); border-top: 1px solid var(--border); }
.fk-row:first-child { border-top: 0; background: var(--surface-2); }
.fk-row > .icon { flex: none; color: var(--text-3); }
.fk-row.marked > .icon { color: var(--accent); }
.fk-name { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.fk-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fk-row .select { flex: none; max-width: 48%; }
.fk-toggle { flex: none; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; margin-right: -4px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-3); cursor: pointer; }
span.fk-toggle { cursor: default; }
button.fk-toggle:hover { background: var(--surface-2); color: var(--text); }
.fk-openable { cursor: pointer; }
@media (max-width: 560px) { .fk-row { flex-wrap: wrap; } .fk-row .select { max-width: none; flex: 1 1 100%; min-width: 0; margin-left: 0; } }
.select.sm { width: auto; min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.todo-lists { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; max-width: 420px; }
.task-list-name { color: var(--accent-strong); }
.kb-more { grid-column: 1 / -1; display: flex; justify-content: center; padding: 4px 0 10px; }
.kb-tags { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; max-width: 100%; }
.ask-answer { margin-top: 14px; padding: 14px 16px; background: var(--surface); border-radius: 10px; border: 1px solid var(--border); }
/* Feld mit Knopf daneben (Frag deine Unterlagen, Ort suchen): auf dem kleinen Handy der Knopf nur mit Symbol */
@media (max-width: 360px) { .send-row > .btn:has(> .icon) { flex: none; font-size: 0; gap: 0; padding: 7px; min-width: 40px; } }
.kb-body { white-space: pre-wrap; line-height: 1.65; }
/* Notizen: formatiert wie Lektionen, Ordner und Stichworte über dem Text */
.kb-note { overflow-x: auto; } /* breite Tabellen scrollen im schmaleren Fenster */
.kb-note .we-view { line-height: 1.65; }
.kb-note-meta { gap: 10px; flex-wrap: wrap; }
.kb-note-folder { flex: 1 1 220px; flex-wrap: nowrap; min-width: 0; gap: 6px; color: var(--text-2); }
.kb-note-folder > .select { flex: 1; width: auto; min-width: 0; }
.we-box.kb-editor .we-editor { min-height: 280px; max-height: 55vh; }

/* ----------------------------------------------------------------- Dateien */

.file-results { display: flex; flex-direction: column; }
.file-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.file-row:hover { background: var(--surface-2); }
.file-row:last-child { border-bottom: 0; }
/* Treffer der Seite «Dateien» (die Karten im Wissen heissen .kb-hit): Zeile öffnet die Datei, Knopf daneben übernimmt sie
   in die Linkliste */
.file-hit { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.file-hit:last-child { border-bottom: 0; }
.file-hit > .file-row { flex: 1; min-width: 0; border-bottom: 0; }
.file-hit > .btn { flex: none; margin-right: 10px; }
@media (max-width: 640px) {
  .file-hit > .btn .lbl { display: none; }
  /* Handy: Treffer mit ganzem Namen (umbrechen statt nach zehn Zeichen gekürzt), ohne Spalte fürs Datum */
  .file-results .file-row { grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 10px 12px; }
  .file-results .file-name { white-space: normal; overflow-wrap: break-word; }
  .file-results .fr-date { display: none; }
  .files-search { flex-wrap: nowrap; }
  .files-search > .btn { flex: none; }
}
.file-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
/* Quelle in ihrer Farbe: Fläche leicht getönt; dunkel die Farbe aufgehellt (--tint-lift), keine hellen Kacheln */
.file-icon:is(.dropbox, .onedrive, .sharepoint, .microsoft, .nextcloud, .google, .folder) {
  background: color-mix(in srgb, var(--fi) 12%, var(--surface)); color: color-mix(in srgb, var(--fi), var(--text) var(--tint-lift));
}
.file-icon.dropbox { --fi: #0061fe; }
.file-icon:is(.onedrive, .microsoft) { --fi: #0a6cbd; }
.file-icon.sharepoint { --fi: #03787c; }
.file-icon.nextcloud { --fi: #0082c9; }
.file-icon.google { --fi: #188038; }
.file-icon.folder { --fi: #b7791f; }
.file-name { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-path { font-size: .8rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-tag { font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
/* Dateien: verbundene Ordner als Kacheln, darin Unterordner und Dateien */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 14px; }
.folder-tile { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; color: inherit; text-decoration: none; transition: background .12s, border-color .12s; }
.folder-tile:hover { background: var(--surface-2); border-color: var(--border-strong); }
.folder-tile .file-icon { flex: none; }
.ft-body { min-width: 0; }
.ft-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-sub { font-size: .8rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-head { padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.fb-head .fb-crumbs { flex: 1 1 auto; min-width: 0; }
.fb-kind { display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 100%; }
.fb-kind .select { max-width: 100%; }
.fb-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; font-size: .9rem; }
.fb-crumbs a { color: var(--text-2); text-decoration: none; padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.fb-crumbs a:hover { background: var(--surface-3); color: var(--text); }
.fb-crumbs [aria-current] { padding: 2px 6px; font-weight: 650; overflow-wrap: anywhere; }
.fb-crumbs > .icon { color: var(--text-3); }
.files-folders .file-row > .icon { color: var(--text-3); flex: none; }
.fb-foot { padding: 10px 14px; border-top: 1px solid var(--border); font-size: .8rem; color: var(--text-3); }
.files-folders .file-name { white-space: normal; overflow-wrap: anywhere; }
.files-folders .lbl-short, .files-folders .fr-date-inline { display: none; }
@media (max-width: 640px) {
  .files-folders .lbl-long, .files-folders .fr-date { display: none; }
  .files-folders .lbl-short, .files-folders .fr-date-inline { display: inline; }
  .files-folders > .card-head { padding: 12px 10px 12px 14px; }
  .files-folders > .card-head .btn { flex: none; }
  .folder-grid { padding: 10px; }
}

/* Einstellungen → Benutzer: eine Zeile pro Lehrperson, auf dem Handy untereinander */
.user-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; }
.user-list { container-type: inline-size; }
/* Name und E-Mail nie schmaler als 12rem; die Angaben daneben brechen um */
.user-row { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(0, max-content) auto; align-items: center; gap: 6px 16px; padding: 10px 12px; border-top: 1px solid var(--border); }
.user-row:first-child { border-top: 0; }
.user-main { display: flex; flex-direction: column; min-width: 0; }
.user-mail { overflow-wrap: anywhere; }
.user-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.user-actions { flex-wrap: nowrap; }
/* nach der Breite der Liste (Tablet mit Seitenleiste wie Handy): Angaben unter den Namen, Knöpfe rechts bzw. darunter */
@container (max-width: 720px) {
  .user-row { grid-template-columns: minmax(0, 1fr) auto; }
  .user-meta { grid-column: 1; grid-row: 2; }
  .user-actions { grid-column: 2; grid-row: 1 / span 2; }
}
@container (max-width: 400px) {
  .user-row { grid-template-columns: minmax(0, 1fr); }
  .user-actions { grid-column: 1; grid-row: 3; justify-self: end; }
}

/* Einstellungen → Statistik (Admin): Kennzahlen, Aktivität als Säulen, Funktionen mit Anteil der Personen */
.us-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.us-toolbar > .us-refresh { margin-left: auto; }
.us-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.us-kpi { min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.us-kpi-label { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.us-kpi-value { margin-top: 4px; font-size: 1.6rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.us-kpi-sub { font-size: .78rem; color: var(--text-3); }
.us-note { margin: 10px 0 0; }
.us-toolbar .seg-btn, .us-chart-head .seg-btn { white-space: nowrap; }
.us-lead { margin: 0; }
.us-chart-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
.us-chart { position: relative; height: 150px; padding-top: 18px; border-bottom: 1px solid var(--border-strong); }
.us-chart-max { position: absolute; top: 0; left: 0; }
.us-bars { display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.us-bar { display: flex; align-items: flex-end; flex: 1 1 0; min-width: 0; height: 100%; }
.us-bar-fill { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--accent); }
.us-bar:hover .us-bar-fill { background: var(--accent-strong); }
.us-axis { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.us-area + .us-area { margin-top: 18px; }
.us-area-title { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: .92rem; }
.us-table { border: 1px solid var(--border); border-radius: 12px; }
.us-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(120px, 1fr) 76px 60px; align-items: center; gap: 4px 14px; padding: 7px 12px; border-top: 1px solid var(--border); }
.us-row:first-child { border-top: 0; }
.us-row.one { grid-template-columns: minmax(0, 1fr) 76px 60px; }
/* Statistik: Herkunft der Konten (Zahlenspalten) und Kette der Registrierung */
.us-origins .us-row { grid-template-columns: minmax(0, 1.6fr) repeat(3, 64px); }
.us-funnel .us-row { grid-template-columns: minmax(0, 1.6fr) repeat(3, 84px) 104px; }
/* Spaltenköpfe dürfen zwischen Wörtern umbrechen («Nach 7 Tagen aktiv»), die Zahlen nicht */
.us-origins .us-row-head, .us-funnel .us-row-head { align-items: end; }
.us-origins .us-row-head .us-num, .us-funnel .us-row-head .us-num { white-space: normal; line-height: 1.25; overflow-wrap: normal; hyphens: manual; }
.us-subhead { margin: 14px 0 8px; font-size: .92rem; }
/* Handy: Herkunft über die ganze Zeile (wie bei den übrigen Tabellen), darunter die Zahlen gleich breit */
@media (max-width: 640px) {
  .us-origins .us-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .us-funnel .us-row { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 8px; }
  .us-funnel .us-row-head { font-size: .75rem; }
}
.us-row.unused .us-label { color: var(--text-3); }
.us-label { min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.us-kpi-label, .us-kpi-sub { overflow-wrap: break-word; hyphens: auto; }
/* Handy: der Zeitraum über die ganze Breite, die Knöpfe teilen sie sich */
@media (max-width: 400px) { .us-toolbar .seg { display: flex; width: 100%; } .us-toolbar .seg-btn { flex: 1; padding: 6px 4px; } }
.us-label .icon { vertical-align: -2px; color: var(--text-2); }
.us-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.us-meter { display: flex; align-items: center; gap: 8px; min-width: 0; }
.us-meter-bar { flex: 1; height: 8px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.us-meter-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.us-meter-num { min-width: 46px; font-size: .8rem; text-align: right; white-space: nowrap; color: var(--text-2); font-variant-numeric: tabular-nums; }
.us-sub { margin-top: 16px; }
.us-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.us-grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
.us-grid th, .us-grid td { padding: 7px 12px; text-align: left; white-space: nowrap; border-top: 1px solid var(--border); }
.us-grid thead th { border-top: 0; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.us-grid th.us-num, .us-grid td.us-num { text-align: right; }
.us-sort { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.us-click { cursor: pointer; }
.us-click:hover, .us-click:focus-visible { background: var(--surface-2); outline: none; }
.us-role { margin-left: 6px; font-size: .72rem; }
.us-people td:first-child { min-width: 140px; white-space: normal; }
.us-grid td.us-wrap { white-space: normal; min-width: 110px; }
/* Betrieb: Aufgabe bzw. Adresse und Spaltenköpfe brechen um, damit die Zahlen auch auf dem Handy daneben Platz haben */
.us-ops th, .us-ops td:first-child { white-space: normal; }
.us-ops td:first-child { min-width: 110px; }
.us-bad { font-weight: 700; color: var(--danger); }
.us-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.us-person { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin: -4px 0 16px; padding: 10px 14px;
  border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); }
.us-person-main { display: flex; flex-direction: column; min-width: 0; }
.us-person-main .small { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .us-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .us-kpi-value { font-size: 1.35rem; }
  .us-chart-head .seg { display: flex; width: 100%; }
  .us-chart-head .seg-btn { padding: 6px 8px; white-space: normal; }
  /* Funktion über die ganze Zeile, darunter Anteil und Zahlen */
  .us-row { grid-template-columns: minmax(0, 1fr) 64px 44px; padding: 8px 10px; }
  .us-row > :first-child { grid-column: 1 / -1; }
  .us-row-head > :first-child { display: none; }
  /* eine Person: Funktion und Zahlen in einer Zeile */
  .us-row.one { grid-template-columns: minmax(0, 1fr) 64px 44px; }
  .us-row.one > :first-child { grid-column: auto; }
  .us-row-head.one > :first-child { display: inline; }
  .us-people td:first-child { max-width: 150px; overflow-wrap: anywhere; }
  .us-ops { font-size: .85rem; }
  .us-ops th, .us-ops td { padding: 7px 8px; }
}

/* Einstellungen → Verwaltung → KI-Pakete: Nutzungsarten als dünner geteilter Balken in einer Farbe, von hell (wenig) bis
   dunkel (viel), mit 2px Lücke; jede Stufe hebt sich mindestens 2:1 von der Karte ab */
.kp-split { display: flex; gap: 2px; height: 8px; overflow: hidden; border-radius: 99px; }
.kp-part { min-width: 4px; }
.kp-wenig { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.kp-mittel { background: color-mix(in srgb, var(--accent) 72%, var(--surface)); }
.kp-viel { background: var(--accent); }
.kp-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; color: var(--text-2); }
.kp-key { display: inline-flex; align-items: center; gap: 6px; }
.kp-key strong { color: var(--text); font-variant-numeric: tabular-nums; }
.kp-dot { flex: none; width: 10px; height: 10px; border-radius: 99px; }
/* KI-Pakete: Reiter wie die Teile der Verwaltung, Stand als Zeilen, Formulare in einer Reihe (auf dem Handy untereinander) */
.kp-tabs { margin-bottom: 16px; flex-wrap: wrap; }
.kp-tabs .seg-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.kp-status { display: grid; gap: 10px; }
.kp-status-row { display: grid; grid-template-columns: 150px auto minmax(0, 1fr); align-items: center; gap: 4px 12px; }
.kp-status-row > .small, .kp-status-row > .kp-chips { min-width: 0; overflow-wrap: anywhere; }
.kp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kp-search { flex: 1 1 200px; max-width: 280px; }
.kp-form-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; }
.kp-form-row > .field { flex: 1 1 200px; min-width: 0; }
.kp-form-end { align-items: center; }
.kp-narrow { flex: 0 1 220px; }
.kp-factor { width: 90px; }
.kp-tiers td { vertical-align: middle; }
.kp-tiers select { min-width: 220px; }
.kp-person { gap: 14px; }
.kp-book { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.kp-book-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.kp-book-row > .field { flex: 1 1 180px; min-width: 0; }
.kp-person-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.kp-history td { white-space: nowrap; }
/* Karte «KI» → Teil «KI-Paket» der Lehrperson: Kopf mit Stand und Reichweite, «Wofür reicht das?», Startguthaben, Stufe */
.kp-pkg { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.kp-pkg-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.kp-pkg-head > .icon { color: var(--accent); }
.kp-pkg-head-side { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
/* Stand gross im Kopf: «3 Mio. Tokens frei» */
.kp-pkg-amount { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; color: var(--text-2); font-size: .9rem; }
.kp-pkg-num { font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.kp-pkg-reachline { margin-top: 2px; font-weight: 600; }
/* «Wofür reicht das?»: zu, bis man es öffnet; darin die Funktionen einzeln, Schätzung und Zählweise */
.kp-more > summary { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-strong); font-size: .9rem; font-weight: 600; cursor: pointer; list-style: none; }
.kp-more > summary::-webkit-details-marker { display: none; }
.kp-more[open] > summary .icon { transform: rotate(90deg); }
.kp-more-body { display: grid; gap: 6px; margin-top: 8px; }
/* «Oder ungefähr, wenn du nur eine Funktion nutzt»: Spalten nach Platz, auf dem Handy eine */
.kp-uses { display: grid; gap: 4px; }
.kp-uses ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 2px 20px; font-size: .92rem; }
.kp-uses strong { font-variant-numeric: tabular-nums; }
.kp-pkg-reach { display: grid; gap: 6px; }
.kp-pkg-reach > strong { font-size: 1.05rem; }
.kp-pkg-starter { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--border); }
/* Stufe: drei Knöpfe in einer Zeile wie «Woher kommt die KI?», darunter Modell und Zweck der gewählten */
.kp-tier-pick { display: grid; gap: 8px; }
.kp-tier-pick > .seg { display: flex; }
/* «Was von selbst läuft»: eine Zeile pro Funktion, Schalter rechts */
.kp-auto { display: grid; gap: 8px; }
.kp-auto-list { display: grid; gap: 8px; }
.kp-auto-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.kp-auto-text { display: grid; gap: 2px; min-width: 0; }
.kp-own > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.kp-own[open] > summary .icon { transform: rotate(90deg); }
.kp-own > .stack { margin-top: 12px; }
.kp-h3 { margin: 4px 0 0; font-size: .95rem; }
/* Karte «KI-Paket»: Pakete zum Kaufen (ein Knopf pro Paket) und das Fenster vor der Zahlung */
.kp-offer { display: grid; gap: 8px; }
.kp-offer-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.kp-offer-item { display: grid; gap: 2px; justify-items: start; align-content: start; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.kp-offer-item:hover, .kp-offer-item:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.kp-offer-name { font-weight: 600; }
.kp-offer-price { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kp-buy-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; font-size: 1.1rem; }
.kp-buy-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.kp-history tr.kp-sub td { padding-top: 0; border-top: 0; color: var(--text-2); font-size: .82rem; }
/* Funktion eines Monats eingerückt unter dem Monat; ein langer Name bricht um statt die Tabelle zu verbreitern */
.kp-history td.kp-feat { padding-left: 26px; white-space: normal; }
@media (max-width: 640px) {
  /* Verlauf auf dem Handy enger, damit «Pro Monat» ohne Schieben Platz hat */
  .kp-history th, .kp-history td { padding: 6px 6px; font-size: .82rem; }
  .kp-history td.kp-month { white-space: normal; }
  .kp-history td.kp-feat { padding-left: 14px; }
}
@media (max-width: 640px) {
  .kp-pkg-head { grid-template-columns: auto minmax(0, 1fr); }
  .kp-pkg-head > .kp-pkg-head-side { grid-column: 2; justify-content: flex-start; }
  /* Pakete auf dem Handy als schmale Zeilen: Name und Tokens links, Preis rechts */
  .kp-offer-list { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .kp-offer-item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'name price' 'tokens price'; align-items: center; column-gap: 12px; }
  .kp-offer-name { grid-area: name; }
  .kp-offer-price { grid-area: price; }
  .kp-offer-item > .small { grid-area: tokens; }
}
/* Stripe in der Einrichtung: Adresse und Ereignisse für den Webhook */
.kp-code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
/* Pakete in der Einrichtung: eine Zeile pro Paket, auf dem Handy zwei */
.kp-shop { display: grid; gap: 10px; }
.kp-shop-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 150px 120px; align-items: end; gap: 10px 14px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.kp-shop-row > .kp-shop-on { margin-bottom: 10px; }
/* Bestellungen: Stand als Auswahl, lange Namen und Adressen brechen um; schmal (nach der Breite der Karte) wird jede
   Zeile eine Karte mit dem Betrag rechts */
.kp-filter { flex: 0 1 200px; width: auto; }
.kp-orders-wrap { container-type: inline-size; }
.kp-orders td { vertical-align: top; }
.kp-orders td.kp-who { white-space: normal; min-width: 160px; max-width: 340px; overflow-wrap: anywhere; }
.kp-orders td.us-num > div + div { margin-top: 4px; }
@container (max-width: 559px) {
  .kp-orders thead { display: none; }
  .kp-orders, .kp-orders tbody, .kp-orders td { display: block; }
  .kp-orders tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 12px; border-top: 1px solid var(--border); }
  .kp-orders tr:first-child { border-top: 0; }
  .kp-orders td, .kp-orders td.kp-who { min-width: 0; max-width: none; padding: 0; border: 0; white-space: normal; }
  .kp-orders td:first-child { grid-row: 1; grid-column: 1; }
  .kp-orders td.kp-who { grid-row: 2; grid-column: 1; }
  .kp-orders td.us-num { grid-row: 1 / span 2; grid-column: 2; }
}
@media (max-width: 640px) {
  .kp-shop-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kp-shop-row > .kp-shop-on, .kp-shop-row > :nth-child(2) { grid-column: 1 / -1; }
  .kp-shop-row > .kp-shop-on { margin-bottom: 0; }
  .kp-filter, .kp-search { flex: 1 1 100%; max-width: none; }
}
/* Erinnerung «Preise und Modelle prüfen»: was Lehrerpult bemerkt, mit Zeichen vorne */
.kp-findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kp-findings li { display: flex; align-items: flex-start; gap: 8px; font-size: .92rem; line-height: 1.45; overflow-wrap: anywhere; }
.kp-findings li > .icon { flex: none; margin-top: 2px; }
.kp-findings li.warn > .icon { color: var(--warn); }
.kp-findings li.info > .icon { color: var(--text-2); }
.kp-history td.kp-detail { white-space: normal; min-width: 220px; color: var(--text-2); }
@media (max-width: 640px) {
  .kp-status-row { grid-template-columns: minmax(0, 1fr) auto; }
  .kp-status-row > .small, .kp-status-row > .kp-chips { grid-column: 1 / -1; }
  .kp-tabs { display: flex; }
  .kp-tabs .seg-btn { flex: 1 1 auto; padding: 6px 8px; }
  .kp-book-row > .btn { width: 100%; justify-content: center; }
  .kp-tiers select { min-width: 160px; }
}

/* Einstellungen → Aktivitätslog (Admin): Tabelle wie in der Statistik. Nach der Breite der Karte (nicht des Fensters, die
   Seitenleiste kommt und geht): schmaler steht die IP-Adresse unter dem Zeitpunkt, noch schmaler wird jede Zeile eine Karte */
.alog-toolbar .alog-search { flex: 1 1 220px; max-width: 340px; }
.alog-toolbar .alog-admins { font-size: .9rem; white-space: nowrap; }
.alog-results { container-type: inline-size; transition: opacity .15s; }
.alog-results.alog-loading { opacity: .55; }
.alog-count { margin: 0 0 8px; }
.alog-grid td { vertical-align: top; }
.alog-grid td.alog-who, .alog-grid td.alog-action, .alog-grid td.alog-details { white-space: normal; overflow-wrap: anywhere; }
.alog-grid td.alog-who { min-width: 150px; }
.alog-grid td.alog-action { min-width: 130px; }
.alog-grid td.alog-details { width: 30%; min-width: 170px; font-size: .85rem; }
.alog-time { color: var(--text-2); font-size: .82rem; font-variant-numeric: tabular-nums; }
.alog-person { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: inherit; text-align: left; cursor: pointer; }
.alog-person:hover, .alog-person:focus-visible { color: var(--accent); text-decoration: underline; }
.alog-target .alog-person { font-weight: 500; color: var(--text-2); }
.alog-nobody { font-style: italic; color: var(--text-3); }
.alog-warn { font-weight: 600; color: var(--danger); }
.alog-ip { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .8rem; color: var(--text-3); }
.alog-ip-sub { display: none; margin-top: 2px; }
.alog-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; margin-top: 12px; }
.alog-pages .btn:not(.icon-only) { min-width: 36px; justify-content: center; }
.alog-gap { padding: 0 4px; color: var(--text-3); }
@container (max-width: 999px) {
  .alog-grid th:last-child, .alog-grid td.alog-ip { display: none; }
  .alog-ip-sub { display: block; }
}
@container (max-width: 639px) {
  /* jede Zeile als Karte: Aktion und Zeitpunkt oben, darunter Benutzer, Details und IP-Adresse (leere weg) */
  .alog-grid thead, .alog-ip-sub { display: none; }
  .alog-grid, .alog-grid tbody, .alog-grid td, .alog-grid td.alog-ip { display: block; }
  .alog-grid td.alog-empty { display: none; }
  .alog-grid tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 10px 12px; border-top: 1px solid var(--border); }
  .alog-grid tr:first-child { border-top: 0; }
  .alog-grid td, .alog-grid td.alog-who, .alog-grid td.alog-action, .alog-grid td.alog-details { width: auto; min-width: 0; padding: 0; border: 0; white-space: normal; }
  .alog-grid .alog-action { grid-row: 1; grid-column: 1; }
  .alog-grid .alog-time { grid-row: 1; grid-column: 2; font-size: .78rem; text-align: right; }
  .alog-grid .alog-who, .alog-grid .alog-details, .alog-grid .alog-ip { grid-column: 1 / -1; }
  .alog-grid td.alog-who { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; } /* E-Mail-Adresse ganz in die nächste Zeile */
}
@container (max-width: 360px) { .alog-grid .alog-time { grid-row: 2; grid-column: 1 / -1; text-align: left; } }

@media (max-width: 640px) {
  /* Handy: Suche über die ganze Breite, darunter beide Filter nebeneinander («Benutzer», «Aktion» ohne Auswahl) */
  .alog-toolbar .alog-search { max-width: none; flex-basis: 100%; }
  .alog-toolbar .select-btn { flex: 1 1 120px; min-width: 0; padding-left: 10px; padding-right: 10px; }
  .alog-toolbar .select-btn-text { flex: 1; min-width: 0; max-width: none; text-align: left; }
  .alog-toolbar .sb-full { display: none; }
  .alog-toolbar .sb-short { display: inline; }
}

/* Einstellungen → Navigation: Seitenleiste und Handy-Leiste */
.nav-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 28px; }
.nav-col h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: .95rem; }
.nav-col > p { margin: 0 0 10px; }
.nav-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; }
/* Einstellungen → Navigation: die Seiten der Seitenleiste nach Bereichen, mit demselben kleinen Titel wie dort */
.nav-set-group + .nav-set-group { margin-top: 12px; }
.nav-set-title { margin: 0 0 4px 2px; color: var(--text-3); font-size: .72rem; font-weight: 700; letter-spacing: .05em; line-height: 1.2; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 2px; min-height: 42px; padding: 2px 6px 2px 10px; border-top: 1px solid var(--border); }
.nav-item:first-child { border-top: 0; }
.nav-item .checkbox, .nav-item .nav-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nav-item .icon { flex: none; color: var(--text-3); }
.nav-item.off .checkbox > span, .nav-item.off .checkbox > .icon { opacity: .45; }
/* wie die echte Leiste: so breit wie ein Handy, lange Namen bekommen mehr Platz (sonst «Stundenpl…») */
.nav-preview { display: flex; gap: 2px; max-width: 390px; margin-bottom: 10px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.nav-preview > span { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 44px; color: var(--text-3); }
.nav-preview > span > small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .62rem; font-weight: 600; }
.nav-preview > span:last-child { color: var(--text-2); }
.nav-add { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 10px; }

/* Hochgeladene Dateien (Wissen, Lektionen und Screen) auf der Seite «Dateien»; die verbundenen Ordner darunter */
.files-folders { margin-top: 18px; }
.up-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 12px 14px; }
.up-slot { display: contents; }
.files-card-body { padding: 0; }
.up-actions { align-items: center; }
.up-filter { flex: 0 1 220px; min-width: 150px; }
/* Name mit Markierung (Lehrmittel …) und Hinweis «ohne Text»: bricht um statt abzuschneiden */
.up-row .file-name { white-space: normal; overflow-wrap: anywhere; }
.up-status { margin-left: 6px; }
.up-more { padding: 10px 14px; border-top: 1px solid var(--border); }
/* aus der Suche geöffnet: die Datei leuchtet kurz auf */
.up-row.up-flash { animation: ss-flash 2.2s ease-out; }
/* Speicherplatz für hochgeladene Dateien (Seite «Dateien») */
.quota { display: grid; gap: 6px; padding: 10px 14px 4px; }
.quota-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.quota-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.quota.full .quota-bar > span { background: var(--danger); }
.up-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 10px 14px; border-top: 1px solid var(--border); }
.up-row.picked { background: var(--accent-soft); }
.up-row > input { width: 18px; height: 18px; margin-top: 11px; accent-color: var(--accent); }
.up-body { min-width: 0; }
.up-main { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.up-main:hover .file-name { text-decoration: underline; }
.up-main .file-icon { width: 40px; height: 40px; }
.up-thumb { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: var(--surface-3); }
.up-uses { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 5px 0 0 52px; color: var(--text-2); }
.up-use { display: inline-flex; align-items: center; gap: 4px; min-width: 0; color: var(--accent-strong); text-decoration: none; }
.up-use span { overflow-wrap: anywhere; }
.up-use:hover span { text-decoration: underline; }
.up-pickbar { margin: 12px 14px; }
@media (max-width: 640px) {
  .up-uses { margin-left: 0; }
  .files-uploads > .card-head { padding: 12px 10px 12px 14px; }
  /* Knöpfe unter dem Titel, die Anzahl rechts daneben */
  .up-actions { flex: 1 1 100%; flex-wrap: nowrap; }
  .up-count { order: 3; margin-left: auto; }
  .up-filter { flex: 1 1 100%; }
}
@media (max-width: 400px) {
  .up-actions { flex-wrap: wrap; }
  .up-count { flex-basis: 100%; margin-left: 0; }
  .up-tools .seg { max-width: 100%; overflow-x: auto; }
  .up-tools .seg-btn { flex: none; padding-inline: 9px; }
}
/* Auswahlleiste: bleibt beim Scrollen sichtbar (der Rahmen zählt nicht) */
.up-pick { display: contents; }

/* ------------------------------------------------------------- Einstellungen */

.settings-section { margin-bottom: 20px; }
/* Überschrift zwischen Karten (Reiter «Daten»: «Daten löschen» unter dem Export) */
/* Verwaltung (Admin): Teile Lehrpersonen, Statistik, Aktivitätslog, Betrieb */
.admin-parts { margin-bottom: 16px; flex-wrap: wrap; }
.admin-parts .seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; white-space: nowrap; }
/* Handy: eine Zeile zum Wischen statt vier (sonst stehen mit Reitern und Teilen der KI-Pakete drei Leisten übereinander) */
@media (max-width: 560px) {
  .admin-parts, .kp-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; max-width: 100%; }
  :is(.admin-parts, .kp-tabs)::-webkit-scrollbar { display: none; }
  :is(.admin-parts, .kp-tabs) .seg-btn { flex: none; padding: 6px 10px; }
}
/* geändert, aber noch nicht gespeichert */
.settings-section.unsaved { border-color: var(--warn); }
/* gleich nach dem Titel; rechts bleiben Stand und Knöpfe der Karte */
.settings-section.unsaved > .card-head h2::after { content: 'Nicht gespeichert'; flex: none; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: .74rem; font-weight: 650; white-space: nowrap; }
@media (max-width: 640px) {
  /* Handy: auf eigener Zeile unter dem Titel, bündig mit dem Text (neben einem langen Titel liefe es über den Rand) */
  .settings-section.unsaved > .card-head h2 { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 9px; }
  .settings-section.unsaved > .card-head h2::after { grid-column: 2; justify-self: start; }
  .settings-section.unsaved > .card-head-toggle h2 { grid-template-columns: minmax(0, 1fr); }
  .settings-section.unsaved > .card-head-toggle h2::after { grid-column: 1; margin-left: 51px; }
}
.settings-section .card-body { display: flex; flex-direction: column; gap: 14px; }
/* grosse Bildschirme: Erklärtexte nicht über die ganze Breite (gut lesbare Zeilenlänge) */
.settings-section .card-body :is(p, .field > small) { max-width: 85ch; }
.integration { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
/* Karten der Verbindungen: Name und Stand stehen im Kopf, hier nur Text und Knöpfe */
.integration.plain { grid-template-columns: minmax(0, 1fr) auto; }
.integration-logo { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); }
@media (max-width: 640px) {
  /* Handy: Knöpfe unter den Text statt daneben */
  .integration { grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: start; }
  .integration.plain { grid-template-columns: minmax(0, 1fr); }
  .integration-logo { width: 34px; height: 34px; }
  .integration > .btn-group { grid-column: 1 / -1; }
  .integration > .btn-group:empty { display: none; }
  .integration > div { overflow-wrap: anywhere; }
}
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); margin-right: 6px; }
.status-dot.on { background: var(--success); }
.status-dot.off { background: var(--danger); }
/* Einstellungen: Abschnitte der Tagesübersicht mit «i» */
.brief-sections { display: flex; flex-wrap: wrap; gap: 6px 16px; }
/* Einstellungen → Benachrichtigungen: Was wohin kommt (Art × Weg) */
.notify-scroll { overflow-x: auto; max-width: 760px; border: 1px solid var(--border); border-radius: 10px; } /* Häkchen nahe bei der Art */
.notify-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.notify-table th, .notify-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: center; }
.notify-table tbody tr:last-child th, .notify-table tbody tr:last-child td { border-bottom: 0; }
.notify-table thead th { font-size: .8rem; font-weight: 600; color: var(--text-3); background: var(--surface-2); white-space: nowrap; }
.notify-table tbody th { text-align: left; font-weight: 400; }
.notify-table td { width: 76px; }
.notify-table input[type=checkbox] { width: 18px; height: 18px; margin: 0; vertical-align: middle; cursor: pointer; }
.nt-hit { display: grid; place-items: center; min-height: 36px; margin: -6px 0; cursor: pointer; }
.nt-kind { display: block; font-weight: 600; }
.nt-desc { display: block; font-size: .8rem; color: var(--text-3); line-height: 1.35; }
.nt-way-icon, .nt-legend { display: none; }
@media (max-width: 640px) {
  .notify-table th, .notify-table td { padding: 8px 5px; }
  .notify-table td { width: 40px; }
  .nt-way { display: none; }
  @media (max-width: 360px) { .notify-table th, .notify-table td { padding: 8px 2px; } .notify-table td { width: 34px; } }
  .nt-way-icon { display: inline-flex; vertical-align: middle; }
  .nt-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; }
  .nt-legend span { display: inline-flex; align-items: center; gap: 4px; }
}
.brief-section { display: inline-flex; align-items: center; gap: 2px; }
/* Info-Symbol mit Hinweis direkt daneben (infoTip in ui.js) */
.info-tip { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-3); cursor: pointer; }
.info-tip:hover, .info-tip[aria-expanded="true"] { color: var(--accent); background: var(--surface-2); }
.tip-pop { position: fixed; z-index: 10060; max-width: min(300px, calc(100vw - 16px)); padding: 9px 12px; border-radius: 10px; background: var(--text); color: var(--surface); font-size: .84rem; line-height: 1.45; box-shadow: var(--shadow-lg); animation: sb-in .12s ease-out; }
.tip-pop::before { content: ''; position: absolute; top: -5px; left: var(--ax, 50%); width: 10px; height: 10px; margin-left: -5px; background: inherit; border-radius: 2px; transform: rotate(45deg); }
.tip-pop.above::before { top: auto; bottom: -5px; }
/* Jahresübersicht ohne Maus: ganzer Name eines Themas mit «In der Jahresplanung öffnen» */
.tl-tip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.tl-tip strong { font-size: .9rem; }
.tl-tip-line { opacity: .85; }
.tl-tip .tl-tip-open { margin-top: 8px; border-color: transparent; background: var(--surface); color: var(--text); }
.weekday-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 42px)); gap: 6px; } /* sieben in einer Zeile, auch auf dem Handy */
.weekday-picker label { position: relative; cursor: pointer; }
/* Häkchen unsichtbar, aber mit der Tastatur erreichbar (Tab, Leertaste) */
.weekday-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.weekday-picker span { display: grid; place-items: center; width: 100%; height: 36px; border-radius: 9px; border: 1px solid var(--border-strong); font-weight: 600; font-size: .88rem; color: var(--text-2); }
.weekday-picker input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.weekday-picker input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Termine wiederholen (eventrepeat.js): Art, Wochentage, «Bis», Regel als Text; bei einer Reihe nur diesen oder alle folgenden */
.rp-more { gap: 8px; margin-top: 8px; }
.rp-more:empty { display: none; }
.rp-until { gap: 6px 14px; align-items: end; }
.rp-until .field { flex: 0 1 190px; }
.rp-until .checkbox { padding-bottom: 8px; }
.rp-summary { display: flex; align-items: center; gap: 4px; }
.rp-series > .small { display: flex; align-items: center; gap: 4px; }
.rp-scope { gap: 6px 16px; }
.rp-series > .rp { margin-top: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.student-table { width: 100%; border-collapse: collapse; }
.student-table th { text-align: left; font-size: .78rem; color: var(--text-3); font-weight: 650; padding: 6px 6px; text-transform: uppercase; letter-spacing: .04em; }
.student-table td { padding: 4px 6px; }
.student-table .input { min-height: 34px; padding: 6px 10px; }
.student-table .only-narrow { display: none; }
.student-table .input.invalid { border-color: var(--danger); }
.student-table.students td:nth-child(6) .input { width: 9.5em; }
/* Nummer des Kindes: schmal; ohne eigene Nummer steht die Stelle in der Liste grau darin, doppelte sind markiert */
.student-table .input.student-nr { width: 2.6em; padding: 6px 2px; text-align: center; font-variant-numeric: tabular-nums; }
/* «(Halbklasse)» ganz lesbar: lieber schmalere Namensfelder */
.student-table.students td:nth-child(4) .select { min-width: 7.5em; }
.student-table.students td:nth-child(5) .select { min-width: 8.8em; }
.student-table .input.student-nr.dup:not(.invalid) { border-color: var(--warn); }
.students-dup { color: var(--warn); }
/* Zeile mit Nummer und Name: nur auf dem Handy */
.student-table.students td.st-sum-cell { display: none; }
.st-sum { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 2px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.st-sum-nr { flex: none; min-width: 2.2em; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: .85rem; text-align: center; font-variant-numeric: tabular-nums; }
.st-sum-nr.dup { background: var(--warn-soft); color: var(--warn); }
.st-sum-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.st-sum-name, .st-sum-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-sum-name { font-weight: 600; }
.st-sum-meta { color: var(--text-3); font-size: .8rem; }
.st-sum-meta:empty { display: none; }
.st-sum-chevron { flex: none; display: inline-flex; color: var(--text-3); }
.student-table.students tr.inactive .st-sum-name { color: var(--text-3); }
/* schmal (Handy, Tablet mit Seitenleiste): jedes Kind als Zeile (Nummer, Name); angetippt darunter seine Felder
   (Vorname/Nachname, Geschlecht/Halbklasse, Geburtstag/aktiv) statt einer zu schmalen Tabelle */
.students-wrap { overflow-x: auto; container: students / inline-size; }
@container students (max-width: 760px) {
  .student-table.students thead { display: none; }
  .student-table.students tr { display: grid; grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; padding: 0 0 10px; border-bottom: 1px solid var(--border); align-items: center; }
  .student-table.students tr:not(.open) { padding: 0; }
  .student-table.students tr:not(.open) > td:not(.st-sum-cell) { display: none; }
  .student-table.students td { padding: 0; min-width: 0; }
  .student-table.students td.st-sum-cell { display: block; grid-area: 1 / 1 / 2 / -1; }
  .student-table.students td:first-child { grid-row: 2 / span 3; grid-column: 1; align-self: start; }
  .student-table.students .input.student-nr { width: 100%; }
  .student-table.students td:nth-child(4) .select, .student-table.students td:nth-child(5) .select { min-width: 0; }
  .student-table.students td:nth-child(2) { grid-area: 2 / 2; }
  .student-table.students td:nth-child(3) { grid-area: 2 / 3; }
  .student-table.students td:nth-child(4) { grid-area: 3 / 2; }
  .student-table.students td:nth-child(5) { grid-area: 3 / 3; }
  .student-table.students td:nth-child(6) { grid-area: 4 / 2; }
  .student-table.students td:nth-child(7) { grid-area: 4 / 3; }
  .student-table.students td:nth-child(8) { grid-area: 2 / 4; }
  .student-table.students td:nth-child(6) .input { width: 100%; }
  .student-table.students .input, .student-table.students .select { width: 100%; }
  /* «Geschlecht», «Halbklasse» ganz lesbar: weniger Innenabstand neben dem Pfeil */
  .student-table.students .select { padding-left: 8px; padding-right: 4px; }
  .student-table .only-narrow { display: inline; margin-left: 6px; font-size: .88rem; color: var(--text-2); }
}
/* Handy: ohne eigene Spalte für «Löschen» (steht unten links unter der Nummer), sonst ist «Geschlecht» abgeschnitten */
@container students (max-width: 420px) {
  .student-table.students tr { grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr); }
  .student-table.students td:first-child { grid-row: 2; }
  .student-table.students td:nth-child(8) { grid-area: 4 / 1; justify-self: center; }
}
.color-legend-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; }
/* «Darstellung & Legende»: Felder untereinander gleich breit */
.legend-rows .color-legend-row { grid-template-columns: 30px minmax(0, 1fr) 6.5em; }
/* schmal: der Name der Farbe nur so breit wie nötig, damit «Sitzung / Gespräch» ganz ins Feld passt */
@media (max-width: 420px) { .legend-rows .color-legend-row { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; } }
/* Karte «Kalender»: Zeile «Kalender-Abo», der Knopf bricht nicht um */
.cal-feed { align-items: center; margin-top: 10px; }
.cal-feed .btn { flex: none; white-space: nowrap; }
.color-swatch { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); }
.steps { margin: 0; padding-left: 20px; color: var(--text-2); font-size: .9rem; }
.steps li { margin: 4px 0; }
.copy-field { display: flex; gap: 6px; }
.link-open { display: flex; gap: 6px; }
.link-open .input { flex: 1; min-width: 0; }
.copy-field .input { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; }

/* Dateiauswahl Dropbox */
/* Dateianzeige (Dateien, Linkliste): fast bildschirmfüllend, auf dem Handy ganz */
.modal.fv { width: min(1100px, 100%); height: min(calc(100vh - 32px), 1200px); }
.modal.fv .modal-body { flex: 1; min-height: 0; padding: 0; position: relative; overflow: hidden; }
.fv-stage { position: absolute; inset: 0; overflow: auto; background: var(--surface-3); overscroll-behavior: contain; }
.fv-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.fv-image { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; }
.fv-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fv-pages { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px; }
.fv-page { width: 100%; max-width: 900px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.fv-page canvas { display: block; width: 100%; height: 100%; }
.fv-counter { position: absolute; right: 14px; bottom: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(17, 24, 39, .75); color: #fff; font-size: .8rem; font-weight: 600; pointer-events: none; }
.fv-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; color: var(--text-2); }
.fv-center p { margin: 0; max-width: 480px; }
.fv-error { width: 52px; height: 52px; border-radius: 30%; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }
.fv-source { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.modal.fv.has-fix .modal-body { display: flex; flex-direction: column; }
.modal.fv.has-fix .fv-stage { position: relative; inset: auto; flex: 1; min-height: 0; }
.fv-fix { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.fv-fix > .icon { color: var(--accent); flex: none; }
.fv-fix-field { display: inline-flex; align-items: center; gap: 8px; }
.fv-fix-field .input { width: 84px; padding-top: 5px; padding-bottom: 5px; min-height: 32px; }
.fv-fix-hint { flex-basis: 100%; }
/* Audio: kleiner Dialog mit Player */
.modal.fv.audio { width: min(560px, 100%); height: auto; }
.modal.fv.audio .fv-stage { position: relative; min-height: 210px; background: var(--surface); }
.fv-audio { min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 28px 20px; }
.fv-audio-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.fv-audio-icon .icon { width: 30px; height: 30px; }
.fv-audio audio { width: 100%; max-width: 460px; }
.fv-player { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.fv-video { display: block; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 640px) {
  .modal-backdrop:has(.modal.fv:not(.audio)) { padding: 0; }
  .modal.fv:not(.audio) { width: 100%; height: 100dvh; max-height: none; border-radius: 0; }
  /* unten eine Zeile, die Knöpfe teilen sich die Breite (die Quelle steht schon in «In … öffnen»); mit mehr als einer
     Aktion (Datei aus dem Wissen, Seitenangabe) schliesst man oben rechts, «Im Screen zeigen» als Symbol */
  .modal.fv .modal-foot { flex-wrap: nowrap; gap: 6px; padding: 10px 12px; }
  .modal.fv:not(.audio) .modal-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .modal.fv .modal-foot > :is(.fv-source, .grow) { display: none; }
  .modal.fv .modal-foot > .btn:not(.icon-only, .fv-screen) { flex: 1 1 auto; min-width: 0; padding-left: 10px; padding-right: 10px; }
  .modal.fv .modal-foot:has(.fv-screen, [aria-haspopup="menu"]) .fv-close { display: none; }
  .modal.fv .fv-screen { font-size: 0; gap: 0; padding: 7px; min-width: 38px; }
}

/* An Lektion anhängen (Datei aus dem Wissen): Woche wählen, nach Fach filtern, Lektion antippen */
.modal.al { width: min(560px, 100%); }
.al-nav { display: flex; align-items: center; gap: 4px; }
.al-week { font-weight: 650; }
.al-subjects { display: flex; flex-wrap: wrap; gap: 6px; }
.al-subjects:empty { display: none; }
.al-list { max-height: min(52vh, 460px); }
.al-day { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .8rem; font-weight: 650; color: var(--text-2); }
.al-row { width: 100%; }
.al-row.past, .al-day.past { color: var(--text-3); }
.al-row:disabled { opacity: .75; }
.al-time { flex: none; width: 3.1em; font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--text-2); }
.al-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.al-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.al-subj { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 600; }
.al-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .8rem; color: var(--text-2); }
.al-has, .al-files { flex: none; display: inline-flex; align-items: center; gap: 3px; }
.al-has { color: var(--success); font-weight: 600; }

/* Wissen: mehrere Ordner wählen */
.picker-row.folder-pick { cursor: default; padding: 0 0 0 12px; gap: 4px; }
.folder-pick > input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
/* Teams und Team (keine Ordner): ohne Häkchen, gleich eingerückt */
.folder-pick > .pick-spacer { width: 18px; flex: none; }
.folder-open-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 6px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.pick-basket { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pick-basket .chip { max-width: 100%; }
.chip-x { display: inline-grid; place-items: center; margin-left: 2px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; opacity: .7; }
.chip-x:hover { opacity: 1; }
/* Dateien an einer Lektion (Material): Chips mit Symbol und Name, ein Klick zeigt die Datei */
.lf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lf-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 3px 6px 3px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: .82rem; }
.lf-chip a { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--accent-strong); text-decoration: none; }
.lf-chip a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 26ch; }
.lf-chip a:hover span { text-decoration: underline; }
.lesson-files-box { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.lesson-files-box .lf-chips { margin: 2px 0 4px; align-self: stretch; min-width: 0; }
/* Passende Unterlagen aus dem Wissen (Planung): ein Klick hängt sie an */
.lf-tips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; font-size: .8rem; }
.lf-tips-label { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.lf-tip { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; padding: 2px 8px 2px 5px; border: 1px dashed var(--border); border-radius: 999px; background: none; color: var(--accent-strong); font: inherit; cursor: pointer; }
.lf-tip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30ch; }
.lf-tip:hover { border-style: solid; background: var(--surface-2); }
.lesson .lesson-files { margin-top: 4px; }
.wg-files { display: inline-flex; align-items: center; gap: 2px; margin-top: 2px; font-size: .72rem; color: var(--text-2); }
/* Büroklammer: öffnet die angehängte Datei (mehrere zur Wahl), nicht die Lektion */
.wg-clip { cursor: pointer; border-radius: 6px; padding: 1px 4px; margin-left: -4px; }
.wg-clip:hover, .wg-clip:focus-visible { color: var(--accent-strong); background: var(--accent-soft); }
.ss-tools { display: flex; align-items: flex-start; }
.ss-print-files { margin-top: 3px; color: var(--text-2); font-size: .9em; }

/* Verbindungen: Outlook-Kalender */
.outlook-box { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }

/* Übersicht: Zusatz neben dem Titel (z. B. Datum der Woche) */
.ov-sub { margin-left: 4px; color: var(--text-3); font-size: .82rem; font-weight: 500; white-space: nowrap; }
/* schmal: der Zeitraum unter den Titel statt über den Rand */
.card-head h2:has(> .ov-sub) { flex-wrap: wrap; row-gap: 2px; }

/* Sitzungsnotizen */
.modal.meeting { width: min(900px, 100%); }
@media (max-width: 640px) {
  .modal.meeting .modal-foot { flex-wrap: wrap; }
  .modal.meeting .modal-foot > .grow, .modal.meeting .modal-foot > .btn.ghost:not(:first-child) { display: none; }
  .modal.meeting .modal-foot > .btn { flex: 1 1 auto; justify-content: center; }
}
/* Stichworte und Protokoll formatiert wie eine Lektion (richBox); Beispiel in den leeren Stichworten */
.we-box.meeting-notes .we-editor { position: relative; min-height: 240px; }
.we-box.meeting-notes .we-editor.is-empty::before { content: attr(data-placeholder); position: absolute; left: 15px; top: 12px; right: 15px; color: var(--text-3); pointer-events: none; }
.we-box.meeting-protocol .we-editor { min-height: 280px; }
.meeting-tasks { display: flex; flex-direction: column; gap: 6px; }
.meeting-task { display: grid; grid-template-columns: auto minmax(0, 1fr) 160px; gap: 8px; align-items: center; }
.meeting-task > input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
@media (max-width: 640px) { .meeting-task { grid-template-columns: auto minmax(0, 1fr); } .meeting-task > input[type=date] { grid-column: 2; } }

/* Word-Lektionen in Lehrerpult bearbeiten */
.modal.we { width: min(760px, 100%); }
.we-box { border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.we-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.we-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.we-tool { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text); cursor: pointer; font: inherit; font-size: .8rem; }
.we-tool:hover { background: var(--surface-3); border-color: var(--border); }
.we-dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .18); flex: none; }
.we-swatch-label { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.we-sep { width: 1px; height: 22px; background: var(--border); margin: 0 3px; }
.we-linkrow { display: flex; gap: 6px; align-items: center; padding: 6px; border-bottom: 1px solid var(--border); }
.we-linkrow[hidden] { display: none; }
/* Handy: das Feld für die Adresse über die ganze Breite, die Knöpfe darunter */
@media (max-width: 480px) { .we-linkrow { flex-wrap: wrap; justify-content: flex-end; } .we-linkrow > .grow, .we-linkrow > .input { flex: 1 1 100%; } }
.we-editor { min-height: 160px; max-height: 50vh; overflow: auto; padding: 12px 14px; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
/* eingebetteter Editor (richBox), z. B. bei wiederkehrenden Inhalten: kleiner, mit Platzhalter */
.we-box.compact .we-editor { position: relative; min-height: 64px; max-height: 30vh; padding: 8px 12px; }
.we-box.compact .we-editor.is-empty::before { content: attr(data-placeholder); position: absolute; left: 13px; top: 8px; color: var(--text-3); pointer-events: none; }
.we-editor div { min-height: 1.5em; }
.we-editor a { color: var(--accent); text-decoration: underline; }
.we-view { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.we-view div { min-height: 1.5em; }
.we-view a { color: var(--accent); text-decoration: underline; }
/* Seitenangabe im Lektionsinhalt («Zahlenbuch S. 34»): öffnet das PDF aus dem Wissen auf dieser Seite */
a.page-ref { color: var(--accent); text-decoration: underline dotted; text-underline-offset: 2px; cursor: pointer; }
a.page-ref:hover { text-decoration-style: solid; }
.lesson-note { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; display: flex; flex-direction: column; gap: 4px; }
/* Rückblick nach der Lektion: Anzeige in der Planung, Dialog, offene Rückblicke in der Übersicht */
.review-chip { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; font-size: .8rem; color: var(--text-2); overflow-wrap: anywhere; }
.review-chip > svg { flex: none; margin-top: 2px; }
.review-chip.done > svg { color: var(--success); }
.review-chip.partial > svg { color: var(--warn); }
.review-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.review-choice { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.review-choice:hover { border-color: var(--accent); }
.review-choice.done[aria-pressed="true"] { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.review-choice.partial[aria-pressed="true"] { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.review-pending { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.review-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.review-head > .btn { margin-left: auto; }
.review-list { margin: 6px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; } /* minmax: ein langer Inhalt wird gekürzt, statt die Karte zu sprengen */
.review-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; padding: 4px 0; }
/* schmal: Knöpfe unter den Text statt Fach und Inhalt in einer Spalte von wenigen Buchstaben */
.review-row > .grow { flex: 1 1 200px; }
.review-row > .btn:first-of-type { margin-left: auto; }
.review-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-head > .btn ~ .btn { margin-left: 0; }
/* Übersicht: ab der Erinnerung an den Tagesrückblick hervorgehoben */
.review-pending.due { padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 12px; background: var(--accent-soft); }
/* Tagesrückblick: oben der Tag mit ‹ ›, dann eine Zeile pro Lektion (Zeit, Fach und Inhalt, Wahl), darunter Rest und Notiz */
.dr-nav { display: flex; align-items: center; gap: 8px; }
.dr-nav .btn { position: relative; }
.dr-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.dr-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; }
.dr-list { display: flex; flex-direction: column; }
/* Kinder im Blick (Journal) unten im Tagesrückblick */
.dr-focus { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
/* gleich hoch in einer Zeile: auch erledigte Kinder (nicht antippbar) so hoch wie die Knöpfe daneben */
.dr-focus-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.dr-focus-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: .9rem; }
.dr-focus-label .icon { color: var(--accent); }
.dr-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: start; gap: 6px 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.dr-row:first-child { border-top: 0; }
.dr-row.slim { padding: 8px 0; }
.dr-row.slim:not(:has(.dr-side)) { color: var(--text-3); }
.dr-time { display: flex; flex-direction: column; font-size: .8rem; line-height: 1.35; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dr-time span { color: var(--text-3); }
.dr-main { min-width: 0; }
.dr-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; margin-top: 2px; }
.dr-side .review-choices { grid-template-columns: auto auto; }
.dr .review-choice { padding: 8px 12px; }
.dr-extra { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 8px; }
.dr-extra:not(:has(> :not([hidden]))) { display: none; }
/* Einstellungen der Planung: Tagesrückblick eingerückt unter dem Rückblick, Uhrzeiten Mo-Fr nebeneinander */
.sub-setting { margin-left: 22px; padding-left: 12px; border-left: 2px solid var(--border); }
.day-times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 8px; } /* drei, damit auch «04:00 PM» Platz hat */
.day-times label { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .8rem; color: var(--text-2); }
.day-times .input { min-width: 0; padding-left: 8px; padding-right: 6px; }
@media (max-width: 640px) { .day-times { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Stundenplan auf dem Handy: «Tagesrückblick» unter dem Tag */
.sp-day-review { display: flex; justify-content: center; margin-top: 12px; }
@media (max-width: 640px) {
  .dr-row { grid-template-columns: 42px minmax(0, 1fr); }
  .dr-row:not(.slim) .dr-side { grid-column: 1 / -1; }
  /* Lektion ohne Inhalt: «+ Notiz» unter das Fach, nicht in die schmale Spalte der Zeit */
  .dr-row.slim .dr-side { grid-column: 2; justify-self: start; }
  .dr-side .review-choices { grid-template-columns: 1fr 1fr; }
  .dr-extra { grid-column: 1 / -1; }
  .dr .review-choice { min-height: 40px; }
}
/* Markierungen sind hell: Text darauf dunkel, auch im dunklen Modus, im Editor wie in der Ansicht */
:is(.we-view, .we-editor) span[style*="background"] { color: #1c2430; border-radius: 3px; }
/* Stundenplan teilen: nur ansehen oder auch bearbeiten */
.share-mode { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.share-mode-opt { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); }
.share-mode-opt input { margin: 3px 0 0; accent-color: var(--accent); }
.share-mode-opt .icon { margin-top: 2px; color: var(--text-2); flex: none; }
.share-mode-opt span { display: flex; flex-direction: column; gap: 2px; }
.share-mode-opt small { color: var(--text-2); font-size: .8rem; }
.share-mode-opt.active { border-color: var(--accent); background: var(--accent-soft); }
/* Kalender, die ein Link zeigt */
.share-cals { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.share-cals > .small { margin-right: 4px; }
.share-cal { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: .875rem; overflow-wrap: anywhere; }
.share-cal input { margin: 0; accent-color: var(--accent); flex: none; }
.share-cal .icon { color: var(--text-2); flex: none; }
.share-cal.active { border-color: var(--accent); background: var(--accent-soft); }
.share-hl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.share-hl > .small { flex: 1 1 260px; }
.share-hl .row { gap: 8px; }
.share-hl .select { width: auto; max-width: 220px; }
@media (max-width: 640px) { .share-hl .row { flex: 1 1 100%; min-width: 0; } .share-hl .select { flex: 1 1 100%; min-width: 0; width: 100%; max-width: none; } }
.share-links { display: flex; flex-direction: column; gap: 10px; }
.plan-validity { display: grid; grid-template-columns: repeat(2, minmax(0, 200px)); gap: 12px; }
@media (max-width: 480px) { .plan-validity { grid-template-columns: minmax(0, 1fr); } }
.share-link { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.share-link.expired { opacity: .85; }
.share-link-head, .share-link-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.share-link-head strong { flex: 1 1 10em; min-width: 0; overflow-wrap: break-word; }
.share-link-foot .muted { min-width: 12em; }
.share-link .share-mode-opt { background: var(--surface); padding: 8px 10px; }
.share-new { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.share-new h3 { margin: 0; font-size: .95rem; }
/* schmal: «Link erstellen» unter den Hinweis, ganze Breite (sonst steht der Hinweis in fünf Zeilen daneben) */
@media (max-width: 480px) { .share-create { flex-wrap: wrap; } .share-create > .btn { flex: 1 1 100%; justify-content: center; } }
@media (max-width: 600px) { .share-link .copy-field .btn { padding-inline: 10px; } }
/* Details einer Lektion: Aktionen als geordnete Liste statt umbrechender Fusszeile */
.lesson-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.lesson-actions:first-child { padding-top: 0; border-top: 0; }
.lesson-actions .btn { width: 100%; justify-content: flex-start; white-space: normal; text-align: left; background: var(--surface-2); border: 1px solid var(--border); }
.lesson-actions .btn:hover { border-color: var(--border-strong); background: var(--surface-3); }
.lesson-actions .btn.danger { color: var(--danger); }
/* Möglichkeiten als Liste, jede mit kurzer Erklärung (z. B. «⋯» bei einer Lektion in der Planung) */
/* Lektionen ziehen (lessondrag.js): gefasste Lektion blass, ein Abbild folgt dem Zeiger, das Ziel ist hervorgehoben */
.draggable { touch-action: manipulation; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.drag-source { opacity: .35; }
.drag-ghost { position: fixed; z-index: 10050; pointer-events: none; margin: 0; opacity: .75; box-shadow: var(--shadow-lg); transform: rotate(-1.5deg) scale(.96); }
body.lesson-dragging, body.lesson-dragging * { cursor: grabbing !important; }
.wg-drop { position: relative; z-index: 1; margin: 3px; border: 2px dashed var(--accent); border-radius: 8px; background: color-mix(in srgb, var(--accent-soft) 70%, transparent); pointer-events: none; display: flex; align-items: flex-start; justify-content: flex-end; padding: 3px; min-width: 0; }
.wg-drop > span { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: .7rem; font-weight: 650; white-space: nowrap; overflow: hidden; }
.wg-drop .icon { width: 12px; height: 12px; flex: none; }
.wg-drop.swap { border-color: var(--warn); background: color-mix(in srgb, var(--warn-soft) 70%, transparent); }
.wg-drop.swap > span { background: var(--warn); color: var(--on-color); }
.move-blocked { color: var(--danger); }
.toast-action { margin-left: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 650; text-decoration: underline; white-space: nowrap; cursor: pointer; }
/* leeres Feld im Wochenraster: antippen erstellt dort einen Eintrag */
.wg-add { width: 100%; height: 100%; min-height: 34px; border: 1px dashed transparent; border-radius: 7px; background: none; color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s; }
.wg-cell:hover .wg-add, .wg-add:focus-visible { opacity: 1; border-color: var(--border-strong); color: var(--text-2); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.wg-add:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
@media (hover: none) { .wg-add { opacity: .35; } }
/* Handy: freie Lektionszeit */
.tl-free-btn { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px dashed var(--border-strong); border-radius: 10px; background: none; color: var(--text-3); font: inherit; font-size: .84rem; cursor: pointer; text-align: left; }
.tl-free-btn:hover, .tl-free-btn:focus-visible { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.we-legend { display: none; flex-wrap: wrap; gap: 4px 12px; }
.we-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.we-legend .we-dot { width: 11px; height: 11px; }
@media (max-width: 640px) { .we-swatch-label { display: none; } .we-editor { max-height: 42vh; } .we-legend { display: flex; } }
/* schmales Handy: Leiste als eine Zeile zum Wischen statt zwei (spart Höhe, kein Trennstrich am Zeilenende) */
@media (max-width: 480px) {
  .we-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .we-toolbar::-webkit-scrollbar { display: none; }
  .we-toolbar > * { flex: none; }
}
@media (pointer: coarse) { .we-tool { min-width: 40px; height: 40px; } }

/* Eingebundene Kalender */
.cal-allday { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); font-size: .78rem; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-allday.cancelled { text-decoration: line-through; opacity: .6; }
button.cal-allday { color: inherit; font-family: inherit; cursor: pointer; text-align: left; max-width: 100%; }
button.cal-allday:hover { border-color: var(--accent); }
.day-allday { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.hidden-list .holiday-item { align-items: center; }
.wg-time.extra { color: var(--text-3); font-style: italic; }
.cal-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; border: 1px solid rgba(0, 0, 0, .12); }
.cal-swatch { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.cal-swatch .cal-dot { width: 16px; height: 16px; }
.cal-swatch.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* Geteilter Stundenplan (Link für Team-Lehrpersonen) */
.team-page { min-height: 100vh; background: var(--bg); }
.team-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px clamp(16px, 3vw, 40px); background: var(--surface); border-bottom: 1px solid var(--border); }
.team-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); text-decoration: none; }
.team-logo { width: 26px; height: 26px; flex: none; border-radius: 7px; }
.team-me { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.team-main { margin: 0 auto; }
@media (max-width: 520px) { .team-brand span { display: none; } }

/* Push: angemeldete Geräte */
.device-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; }
.device-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.device-row:last-child { border-bottom: 0; }
/* Einstellungen → E-Mail und WhatsApp: Wege durch eine Linie getrennt */
.channel + .channel { border-top: 1px solid var(--border); padding-top: 16px; }
.channel h3 { display: flex; align-items: center; gap: 6px; }
.device-row > .icon { color: var(--text-3); }
/* Als App installieren: Anleitung mit einem Symbol pro Schritt */
.install-steps { display: flex; flex-direction: column; gap: 12px; margin: 0 0 14px; padding: 0; list-style: none; }
.install-steps li { display: flex; align-items: flex-start; gap: 12px; }
.install-step-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); }
.install-steps li > span:last-child { padding-top: 6px; }
.class-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.class-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--border); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.class-row:last-child { border-bottom: 0; }
.class-row:hover { background: var(--surface-2); }
.class-row.active { background: var(--accent-soft); }
.class-row > .icon { color: var(--text-3); flex: none; }
.class-row.active > .icon { color: var(--accent-strong); }
.class-row.active .chip.accent { background: var(--surface); }
.class-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.class-name { display: flex; align-items: center; gap: 8px; font-weight: 600; overflow-wrap: anywhere; }
.device-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.picker-list { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.picker-row { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; cursor: pointer; color: inherit; }
.picker-row:hover { background: var(--surface-2); }
.picker-row:disabled { opacity: .45; cursor: default; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: .88rem; margin-bottom: 8px; }
.breadcrumbs button { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 2px 4px; }
/* Dateiauswahl: Brotkrumen mit Stern für Lieblingsordner, Lieblingsordner als Tabs */
.picker-bar { display: flex; align-items: flex-start; gap: 8px; }
.picker-bar .breadcrumbs { flex: 1; min-width: 0; }
.picker-bar .picker-star { margin-top: -4px; color: var(--text-3); }
.picker-star.on, .tab.fav .icon { color: #d99a00; }
.picker-star.on .icon, .tab.fav .icon { fill: currentColor; }

/* Glocke */

@media print {
  .sidebar, .bottom-nav, .m-top, .app-foot, .page-actions, .btn { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
}

/* Stundenplan: Druckansicht (Vorschau A4 quer) und Druckseite, auch Grundlage fürs PDF */
.print-view { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; background: #5b6168; }
.print-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
/* am Computer eine Leiste: Titel, einfache Optionen, Knöpfe rechts, darunter Hinweis und Gruppen */
.print-top, .print-settings { display: contents; }
.print-actions { order: 1; margin-left: auto; display: flex; gap: 8px; }
.print-close { order: 1; }
.print-options { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .88rem; }
/* Gruppe von Einstellungen (z. B. «Fächer») auf einer eigenen Zeile */
.print-group { flex-basis: 100%; align-items: center; order: 2; }
.print-group-title { font-weight: 650; color: var(--text-2); min-width: 72px; }
/* kurzer Hinweis in der Leiste (z. B. in tatsächlicher Grösse drucken) */
.print-hint { flex-basis: 100%; order: 2; }
/* Tablet: Optionen in eine eigene Zeile, damit «PDF», «Drucken» und «×» oben beim Titel bleiben */
@media (min-width: 641px) and (max-width: 1100px) { .print-options { order: 2; flex-basis: 100%; } }
.print-scroll { flex: 1; overflow: auto; padding: 16px 12px 40px; }
/* Handy: die ganze Ansicht scrollt; oben bleibt der Kopf mit Titel und Knöpfen stehen, darunter die Einstellungen und
   die Seiten (sonst füllt die Leiste mit allen Optionen den Bildschirm) */
@media (max-width: 640px) {
  .print-view { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .print-bar { display: contents; }
  .print-top { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 8px 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .print-title { overflow-wrap: break-word; }
  .print-actions { grid-column: 1 / -1; grid-row: 2; margin: 0 6px 0 0; }
  .print-actions > .btn { flex: 1 1 0; justify-content: center; }
  .print-settings { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .print-group-title { flex-basis: 100%; }
  .print-scroll { overflow: visible; }
}
/* echte Seiten (paginate()): jede Seite ein Blatt A4 mit Rand, darauf ein Ausschnitt des Blatts; darunter die Nummer,
   die nicht mitgedruckt wird. Das Blatt wird vorher unsichtbar in der Breite der Seite ohne Rand gemessen. Verkleinert
   wird nur gezeichnet (transform), .print-fit und .print-page-fit halten den Platz */
.print-fit { margin: 0 auto; }
.print-paper { width: 297mm; margin: 0 auto; transform-origin: 0 0; }
.print-paper.portrait { width: 210mm; }
.print-page-fit > .print-page-body { transform-origin: 0 0; }
.print-frame { visibility: hidden; }
.print-offscreen { position: fixed; left: -20000px; top: 0; }
.print-page { position: relative; width: 297mm; height: 210mm; padding: 10mm; box-sizing: border-box; background: #fff; box-shadow: 0 4px 24px rgba(0, 0, 0, .35); }
.print-page.portrait { width: 210mm; height: 297mm; }
.print-page + .print-page { margin-top: calc(34px / var(--print-zoom, 1)); }
.print-window { overflow: hidden; }
.print-page-no { position: absolute; left: 0; right: 0; top: 100%; padding-top: calc(8px / var(--print-zoom, 1)); text-align: center; font-size: calc(12px / var(--print-zoom, 1)); color: #e9ecef; }
.print-sheet {
  --bg: #f4f2ed; --surface: #ffffff; --surface-2: #faf8f4; --surface-3: #f0ede6; --border: #e3dfd5; --border-strong: #cfc9bc;
  --text: #1c2430; --text-2: #586371; --text-3: #616a76; --accent: #1f5f73; --accent-soft: #e2eef1; --accent-strong: #174a59;
  --mark-red: #d63a3a; --mark-green: #2f9e44; --mark-magenta: #b23cbf; --mark-yellow: #c99a00;
  width: 277mm; box-sizing: border-box; background: #fff; color: var(--text); color-scheme: light;
  font-family: var(--font); line-height: 1.35;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.ps-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.ps-title { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; }
.ps-sub { font-size: .9rem; color: var(--text-2); margin-top: 3px; }
.ps-who { font-size: .9rem; color: var(--text-2); }
/* wie auf der Stundenplan-Seite, auf Papier etwas dichter; ganzer Text statt abgeschnitten und ohne «heute» */
.print-sheet .wg-head { position: static; padding: 6px 8px; font-size: .8rem; }
.print-sheet .wg-head .date { font-size: .72rem; }
.print-sheet .wg-time { padding: 5px 6px; font-size: .7rem; }
.print-sheet .wg-cell { min-height: 0; padding: 3px; gap: 3px; }
.print-sheet .wg-lesson { font-size: .66rem; padding: 4px 5px 4px 8px; line-height: 1.3; }
.print-sheet .wg-lesson .g { font-size: .92em; }
/* beim Messen langer Wörter (fitWords in schedule.js) nicht mitten im Wort umbrechen */
.print-sheet.ps-measure * { overflow-wrap: normal; word-break: normal; }
.print-sheet .wg-head.today { background: var(--surface-2); color: inherit; }
.print-sheet .wg-cell.today { background: none; }
.print-sheet .wg-lesson { display: block; cursor: default; }
.print-sheet .wg-lesson .t { white-space: normal; }
.print-sheet .wg-lesson .p.pr { float: right; margin: 0 0 0 4px; }
.print-sheet .wg-lesson .d { display: block; -webkit-line-clamp: unset; overflow: visible; }
.print-sheet .wg-lesson .we-view { line-height: 1.35; margin-top: 1px; }
.print-sheet .wg-lesson > .we-view > div:first-child { font-weight: 640; }
.print-sheet .ps-note { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--border-strong); color: var(--text); }
.print-sheet .cal-allday { white-space: normal; overflow: visible; font-size: .66rem; padding: 2px 6px; }
.print-sheet .mark { font-size: .68rem; padding: 1px 6px 1px 5px; gap: 5px; }
.print-sheet .mark::before { width: 6px; height: 6px; }
/* Legende: Gruppen mit Bezeichnung nebeneinander, so klein wie die Lektionen */
.ps-legend { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 8px; font-size: .66rem; line-height: 1.35; color: var(--text-2); }
.ps-leg { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.ps-leg-label { font-weight: 650; color: var(--text); white-space: nowrap; }
.ps-leg-items { display: flex; flex-wrap: wrap; gap: 2px 12px; min-width: 0; }
.ps-leg-items > span { display: inline-flex; align-items: center; gap: 4px; }
.ps-leg-items b { font-weight: 650; color: var(--text); }
.ps-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; border: 1px solid var(--border); }
.ps-legend i.cal-dot { border-radius: 50%; }
.dossier:not(.print-sheet) .ps-legend { font-size: .85rem; }
/* im PDF gibt es nur aufrechte Schrift */
.print-sheet .wg-time.extra, .ps-weeknote { font-style: normal; }
@media print {
  body.print-open { background: #fff; }
  body.print-open > :not(.print-view) { display: none !important; }
  body.print-open .print-view { position: static; display: block; background: none; }
  body.print-open .print-bar { display: none !important; }
  body.print-open .print-scroll { padding: 0; overflow: visible; }
  body.print-open .print-fit { width: auto !important; height: auto !important; margin: 0; }
  body.print-open .print-paper { transform: none !important; width: auto; margin: 0; }
  /* echte Seiten: jede auf ein eigenes Blatt, wie in der Vorschau; darin trennt der Browser nichts mehr */
  body.print-open .print-page { width: auto; height: var(--print-h); overflow: hidden; padding: 0; margin: 0; box-shadow: none; break-after: page; }
  body.print-open .print-page:last-child { break-after: auto; }
  body.print-open .print-page-body * { break-before: auto !important; break-after: auto !important; }
  body.print-open .print-page-no { display: none; }
}

/* Stellvertretungs-Dossier (Seite, Druck und PDF) */
.dossier { display: flex; flex-direction: column; gap: 18px; }
.dz-main { max-width: 980px; margin: 0 auto; }
.print-sheet.portrait { width: 190mm; font-size: 12.5px; }
.dz-sec h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; font-size: 1.05rem; }
.dz-sec h3 .icon { color: var(--text-3); }
.dz-text { white-space: pre-wrap; font-size: .92rem; line-height: 1.45; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.dz-day > .bdays { margin-bottom: 8px; }
.dz-table { width: 100%; border-collapse: collapse; font-size: .88rem; table-layout: fixed; }
.dz-c-time { width: 4.6rem; }
.dz-c-subj { width: 30%; }
.dz-table td { overflow-wrap: anywhere; }
.dz-table td { padding: 7px 8px; border-top: 1px solid var(--border); vertical-align: top; }
.dz-table tr:last-child td { border-bottom: 1px solid var(--border); }
.dz-time { width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-2); }
.dz-time span { display: block; font-size: .82em; color: var(--text-3); }
.dz-subj { width: 30%; }
.dz-subj { position: relative; padding-left: 14px !important; }
.dz-color { position: absolute; left: 0; top: 7px; bottom: 7px; width: 4px; border-radius: 2px; background: var(--border-strong); }
.dz-group { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 99px; border: 1px solid var(--border); font-size: .76rem; font-weight: 650; color: var(--text-2); }
.dz-meta { font-size: .8rem; color: var(--text-2); margin-top: 2px; }
.dz-meta .icon { width: 12px; height: 12px; vertical-align: -1px; }
.dz-row.cancelled .dz-subj strong { text-decoration: line-through; }
.dz-row.cancelled .dz-prog { opacity: .6; }
.dz-off { color: var(--danger); font-size: .78rem; font-weight: 650; margin-top: 2px; }
.dz-prog .we-view { line-height: 1.4; }
.dz-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: .84rem; }
.dz-break td { background: var(--surface-2); color: var(--text-3); font-size: .78rem; padding: 3px 8px; }
.dz-after { font-size: .85rem; color: var(--text-2); margin-top: 8px; }
.dz-group-block + .dz-group-block { margin-top: 10px; }
.dz-group-title { font-weight: 650; font-size: .88rem; margin-bottom: 4px; }
.dz-students { columns: 3 160px; column-gap: 24px; margin: 0; padding-left: 1.6em; font-size: .9rem; }
.dz-students li { break-inside: avoid; padding: 1px 0; }
.dz-qr { width: 180px; padding: 8px; background: #fff; border-radius: 10px; border: 1px solid var(--border); }
.dz-qr svg { display: block; width: 100%; height: auto; }
.print-sheet .dz-table { font-size: .82rem; }
.print-sheet .dz-text { font-size: .85rem; }
@media (max-width: 640px) {
  /* Handy: jede Lektion als Block (Zeit und Fach nebeneinander, Inhalt darunter) */
  .dossier:not(.print-sheet) .ps-head { flex-wrap: wrap; }
  .dossier:not(.print-sheet) .ps-title { font-size: 1.25rem; }
  .dossier:not(.print-sheet) .dz-table, .dossier:not(.print-sheet) .dz-table tbody { display: block; }
  /* die Zeitspalte so breit wie nötig («ganztägig»), sonst läuft sie in Farbbalken und Fach */
  .dossier:not(.print-sheet) .dz-table tr { display: grid; grid-template-columns: minmax(52px, max-content) minmax(0, 1fr); border-top: 1px solid var(--border); }
  .dossier:not(.print-sheet) .dz-table tr:last-child { border-bottom: 1px solid var(--border); }
  .dossier:not(.print-sheet) .dz-table td { display: block; width: auto; border: 0 !important; }
  .dossier:not(.print-sheet) .dz-table .dz-prog { grid-column: 2; padding-top: 0; padding-left: 14px; } /* bündig mit dem Fach */
  .dossier:not(.print-sheet) .dz-table .dz-prog:empty { display: none; }
  .dz-students { columns: 2 120px; }
}

/* Vorlagen importieren */
.import-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.import-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius, 12px); max-height: 55vh; overflow-y: auto; }
.import-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 14px; border-bottom: 1px solid var(--border); opacity: .6; }
.import-row:last-child { border-bottom: 0; }
.import-row.selected { opacity: 1; }
.import-row input[type=checkbox] { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.import-title { font-weight: 650; cursor: pointer; overflow-wrap: anywhere; }
.import-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.import-meta:empty { display: none; }
.import-row details { margin-top: 4px; font-size: .85rem; }
.import-row summary { cursor: pointer; color: var(--accent); }
.import-text { white-space: pre-wrap; font: inherit; font-size: .85rem; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin: 6px 0 0; max-height: 260px; overflow-y: auto; }
.import-row .select { width: auto; min-width: 150px; min-height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: .88rem; }
.import-selects { display: flex; flex-direction: column; gap: 6px; }
.import-row.changed { background: var(--accent-soft); }
.organize-list .import-row { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; opacity: 1; }
.organize-title { font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .import-row { grid-template-columns: auto minmax(0, 1fr); }
  .import-selects { grid-column: 2; }
  .organize-list .import-row { grid-template-columns: 1fr; }
}

/* Vorlagen: Ansichten Schuljahr/Thema, aufklappbare Gruppen */
.list-tools { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 4px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 10px; }
.seg-btn { flex: 1; border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: .86rem; color: var(--text-2); cursor: pointer; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.list-nav .group-toggle { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; cursor: pointer; text-align: left; border-radius: 8px; }
.list-nav .group-toggle:hover { background: var(--surface-3); }
.list-nav .group-toggle.now { color: var(--accent-strong); }
.list-nav .group-toggle .chip { text-transform: none; letter-spacing: 0; font-size: .7rem; padding: 1px 7px; }
.group-count { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-3); }
.list-meta { font-size: .75rem; color: var(--text-3); white-space: nowrap; }
.list-item.active .list-meta { color: inherit; }
.tpl-head { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tpl-head h2 { margin: 0; }

/* Wissen: Dateien und Ordner */
.source-list { display: flex; flex-direction: column; gap: 4px; }
.source-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--border); }
/* schmal: Knöpfe unter die Angaben, damit Pfad und Hinweise die ganze Breite haben */
@media (max-width: 640px) {
  .source-row { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .source-row > .btn-group { grid-column: 2; }
}
.source-row:last-child { border-bottom: 0; }
.source-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; flex: none; }
.source-row strong { overflow-wrap: anywhere; }
.spinner.sm { width: 11px; height: 11px; border-width: 2px; vertical-align: -1px; }
.section-label { display: flex; align-items: center; gap: 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 26px 0 10px; }
.file-list { display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
/* Dateiliste im Wissen (nicht die Treffer der Dateiseite) */
.file-list .file-row { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.file-list .file-row:last-child { border-bottom: 0; }
.file-list .file-row > .icon { color: var(--text-3); flex: none; }
@media (max-width: 640px) {
  .file-list .file-row { flex-wrap: wrap; }
  .file-list .file-row > .grow { flex: 1 1 calc(100% - 34px); min-width: 0; }
  .file-list .file-row > .btn-group { margin-left: auto; }
}
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-list .file-name { white-space: normal; overflow: visible; } /* in der Dateiliste lange Namen ganz zeigen (mit Art-Markierung) */
.text-danger { color: var(--danger); }
.file-section { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); }
.file-section h4 { margin: 0 0 6px; }
.file-section.hit { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.progress-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.error-list { margin: 0; padding-left: 18px; color: var(--danger); max-height: 160px; overflow-y: auto; }
.error-list:empty { display: none; }
.drop-target { outline: 3px dashed var(--accent); outline-offset: 6px; border-radius: 12px; }

/* Einstellungen: Daten löschen */
.delete-list { display: flex; flex-direction: column; }
.delete-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.delete-row > .grow { flex: 1 1 14em; }
.delete-row > .btn { margin-left: auto; }
.delete-row:last-child { border-bottom: 0; }
/* «Daten löschen» (zugeklappt): Bereiche als Abschnitte in einer Karte */
.delete-group { padding-top: 14px; margin-top: 10px; border-top: 1px solid var(--border); }
.delete-group-title { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: .95rem; font-weight: 650; }
.delete-group-title .icon { color: var(--text-2); }
.btn.ghost.danger:not(:disabled) { color: var(--danger); }

/* Jahresbalken (yearplan.js → yearBar(), oben auf der Seite eines Fachs): Wochen mit Lektionen in der Farbe ihres Themas */
.yp-bar { display: flex; align-items: flex-end; gap: 2px; overflow-x: auto; padding-bottom: 2px; }
.yp-week { flex: 1 0 9px; display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 9px; }
.yp-stack { display: flex; flex-direction: column; gap: 5px; border-radius: 3px; }
.yp-cells { display: flex; flex-direction: column-reverse; gap: 2px; min-height: 46px; justify-content: flex-start; }
.yp-cell { display: block; height: 9px; border-radius: 2px; }
.yp-cell.free { background: var(--surface-2, #ece9e2); box-shadow: inset 0 0 0 1px var(--border); }
.yp-cell.past { opacity: .45; }
.yp-week.off .yp-stack { background: repeating-linear-gradient(135deg, var(--warn-soft) 0 4px, transparent 4px 8px); }
.yp-week.now .yp-stack { box-shadow: 0 0 0 2px var(--accent); }
/* mit Bereichen: eine Spur pro Bereich (Höhe aus dem Skript), links ihre Namen */
.yp-bar.lanes .yp-cells { min-height: 0; overflow: hidden; }
.yp-lanes { position: sticky; left: 0; z-index: 1; flex: none; display: flex; flex-direction: column; gap: 3px; max-width: 34%; padding-right: 6px; background: var(--surface); }
.yp-lanes .yp-stack > span { display: flex; align-items: center; justify-content: flex-end; min-width: 0; font-size: .68rem; line-height: 1.1; color: var(--text-2); }
.yp-lane-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.yp-month { height: 14px; font-size: .68rem; color: var(--text-2); white-space: nowrap; overflow: visible; }
.yp-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; color: var(--text-2); }
.yp-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.yp-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
/* Panel der Lektion: Thema als Text, der Punkt steht vor dem ersten Wort, «Zum Thema» folgt dahinter */
.lesson-theme .yp-dot { margin-right: 6px; vertical-align: -1px; }
.lesson-theme .linklike { margin-left: 8px; white-space: nowrap; }
.yp-dot.free { background: var(--surface-2, #ece9e2); box-shadow: inset 0 0 0 1px var(--border); border-radius: 2px; }
.yp-dot.off { background: repeating-linear-gradient(135deg, var(--warn) 0 2px, var(--warn-soft) 2px 4px); border-radius: 2px; }
/* ein Thema kurz hervorheben, z. B. nach einem Sprung aus der Jahresübersicht (der Schatten gibt der Farbe Luft) */
@keyframes yp-flash { 0%, 35% { background: color-mix(in srgb, var(--mark-yellow) 40%, transparent); box-shadow: 0 0 0 8px color-mix(in srgb, var(--mark-yellow) 40%, transparent); } }
.yp-progress { display: block; height: 5px; max-width: 260px; margin-top: 2px; border-radius: 3px; background: var(--surface-2, #ece9e2); overflow: hidden; }
.yp-progress > i { display: block; height: 100%; border-radius: 3px; }
.yp-drift { flex: 1 1 100%; max-width: calc(100% - 22px); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-left: 22px; padding: 6px 10px; border-radius: 8px; background: var(--warn-soft); font-size: .86rem; }
.yp-drift > .grow { min-width: 12rem; }
.yp-drift.yp-open { max-width: none; margin: 0 0 10px; background: var(--accent-soft); }
.yp-drift.yp-next { background: var(--accent-soft); }
.yp-steps { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; font-size: .9rem; color: var(--text-2); }
.yp-steps strong { color: var(--text); }
.yp-when { display: block; margin-top: 2px; }
.yp-when.short { color: var(--warn); }
.yp-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.yp-swatch { width: 28px; height: 28px; padding: 0; border: 2px solid transparent; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 2px var(--surface); }
.yp-swatch.on { border-color: var(--text); }
.yp-swatch.auto { background: var(--surface-2, #ece9e2); color: var(--text-2); font-size: .72rem; font-weight: 700; }
/* «Weitere Angaben» in einem Dialog (Neues Thema): eingeklappt eine Zeile, aufgeklappt die Felder darunter */
.more-fields > summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; color: var(--accent); font-weight: 600; font-size: .9rem; }
.more-fields > summary::-webkit-details-marker { display: none; }
.more-fields > summary > .icon { transition: transform .15s; }
.more-fields[open] > summary > .icon { transform: rotate(90deg); }
.more-fields > .stack { margin-top: 12px; }
/* «Mehr dazu» unter einer kurzen Erklärung */
.more-info > summary { font-size: .85rem; }
.more-info > .stack { margin-top: 6px; gap: 8px; }
.notice .more-info { margin-top: 4px; }
/* Themen-Dialog (themedialog.js): Reiter ohne eigenen Abstand darunter, Klassenstufe schmal */
.theme-tabs { margin-bottom: 0; }
/* schmal: Breite nach Inhalt («Inhalte und Material» ist länger als «Planung»), so bleiben beide einzeilig */
@media (max-width: 480px) { .theme-tabs .tab { flex: 1 1 auto; min-width: 0; padding-inline: 8px; justify-content: center; white-space: nowrap; } }
@media (max-width: 400px) { .theme-tabs .tab > .icon { display: none; } }
.theme-grade { max-width: 240px; }
@media (max-width: 560px) {
}
/* Sequenz teilen: E-Mail und «Senden» nebeneinander */
.share-send { flex-wrap: nowrap; gap: 8px; }
.share-send > .input { flex: 1; min-width: 0; }
@media (max-width: 400px) { .share-send { flex-wrap: wrap; } .share-send > .input { flex: 1 1 100%; } }
/* Vorschau beim Importieren gespeicherter Sequenzen */
/* Jahresplanung: gespeicherte Sequenzen wählen (Hinzufügen) und im Block (Bearbeiten) */
.yp-pick { display: flex; flex-direction: column; max-height: min(46vh, 360px); overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.yp-pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); cursor: pointer; overflow-wrap: anywhere; }
.yp-pick-row:first-child { border-top: 0; }
.yp-pick-row:has(input:checked) { background: var(--accent-soft); }
.yp-pick-row input { flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.yp-pick-row:has(input:disabled) { cursor: default; color: var(--text-3); }
.yp-pick-head { position: sticky; top: 0; z-index: 1; padding: 8px 12px 6px; border-top: 1px solid var(--border); background: var(--bg); font-weight: 600; }
.yp-pick-head:first-child { border-top: 0; }
/* «Mehrere Themen»: Total unter der Liste */
.yp-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 0 12px; }
.yp-total .grow { flex: 1 0 auto; } /* nicht zusammendrücken: zu wenig Breite → der Platz rutscht auf eine eigene Zeile */
.yp-total .warn { color: var(--warn); font-weight: 600; }
/* «Screen öffnen» bei der Lektion (screenlink.js): der Knopf erscheint nachgeladen, ohne Lücke in einer Knopfliste */
.screen-link { display: contents; }
.ov-now-screen { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; padding: 6px 6px 6px 12px; border-radius: 10px; background: var(--accent-soft); }
.ov-now-screen .screen-link:empty { display: none; }

/* ------------------------------------------------------------- Finger (Handy, Tablet) */
/* Elterngespräche (pages/parent-meetings.js): Runden, Kinder mit Status, Zeiten nach Tagen, Einladung */
.pm-rounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pm-round { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; color: inherit; text-decoration: none; transition: border-color .12s, transform .12s; }
.pm-round:hover { border-color: var(--accent); transform: translateY(-1px); }
.pm-round-head { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.pm-round-head .icon { color: var(--accent); }
.pm-round-head strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pm-round-foot { margin-top: auto; }
.pm-progress { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pm-bar { flex: 1 1 120px; max-width: 260px; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
/* Liste der Runden: der Text über dem Balken statt auf zwei Zeilen daneben */
.pm-round .pm-progress { flex-direction: column; align-items: stretch; gap: 4px; }
.pm-round .pm-bar { flex: none; max-width: none; }
.pm-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.pm-intro .empty { padding-bottom: 12px; } /* unter dem Knopf so viel Platz wie darüber (Abstand des Texts) */
.pm-steps { display: grid; gap: 10px; max-width: 640px; margin: 0 auto; padding-left: 22px; color: var(--text-2); line-height: 1.5; }
.pm-steps strong { color: var(--text); }
.pm-status { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pm-status .pm-progress { flex: 1 1 260px; }
.pm-status + .notice, .pm-status ~ .notice { margin-bottom: 14px; }
.pm-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pm-kids { list-style: none; margin: 0; padding: 0; }
.pm-kid { display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 18px; border-bottom: 1px solid var(--border); }
.pm-kid:last-child { border-bottom: 0; }
.pm-kid-main { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.pm-kids-card .seg-btn, .cl-card .seg-btn { white-space: nowrap; }
/* Abhakliste: «Kind suchen» rechts neben dem Filter, auf dem Handy auf eigener Zeile */
.cl-search-wrap { width: 200px; }
.cl-search { min-height: 36px; padding-block: 6px; }
.cl-nr { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .cl-card .cl-search-wrap { flex: 1 1 100%; width: auto; }
  /* mit «Zu spät» vier Filter: über die ganze Breite, etwas enger, damit sie ohne Schieben Platz haben */
  .cl-card .seg { display: flex; width: 100%; }
  .cl-card .seg-btn { flex: 1 1 auto; padding: 6px 6px; font-size: .82rem; }
}
.pm-kid-main strong { overflow-wrap: anywhere; }
.pm-kid-state { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.pm-kid-state .small { display: inline-flex; align-items: center; gap: 3px; }
.pm-kid-actions { display: flex; gap: 2px; flex: none; }
.pm-days { display: flex; flex-direction: column; gap: 16px; }
.pm-day.past { opacity: .6; }
.pm-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.pm-slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pm-slot { display: flex; align-items: center; gap: 10px; padding: 2px 4px 2px 10px; border-radius: 8px; background: var(--surface-2); }
.pm-slot.taken { background: var(--success-soft); }
.pm-time { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.pm-who { flex: 1; min-width: 2.2em; overflow-wrap: break-word; color: var(--text-3); }
@media (max-width: 360px) { .pm-slot { gap: 6px; padding-left: 8px; } }
.pm-slot.taken .pm-who { color: var(--text); }
.pm-win { display: flex; flex-direction: column; gap: 4px; }
.pm-win-fields { display: grid; grid-template-columns: minmax(140px, 1.4fr) minmax(96px, 1fr) minmax(96px, 1fr) auto; gap: 8px; align-items: end; }
.pm-win-fields .pm-win-x { margin-bottom: 2px; }
.pm-win-preview { min-height: 1.3em; }
.pm-win-warn { display: flex; align-items: flex-start; gap: 6px; color: var(--warn); }
.pm-win-warn[hidden] { display: none; }
.pm-win-warn .icon { flex: none; margin-top: 2px; }
.pm-wins:empty { display: none; }
/* Summe der Gespräche aller Zeitfenster; über der Grenze einer Runde rot */
.pm-win-sum { margin: 0; color: var(--text-2); }
.pm-win-sum[hidden] { display: none; }
.pm-win-sum.pm-win-over { color: var(--danger); font-weight: 600; }
/* Wochenansicht zum Wählen der Zeitfenster (meetingweek.js): 48 px pro Stunde, Spalten setzt das Skript */
.mw { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.mw-head { display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; padding: 6px 10px 6px 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mw-label { font-variant-numeric: tabular-nums; }
.mw-count { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--text-2); font-size: .85rem; white-space: nowrap; }
@media (max-width: 400px) { .mw-count { flex: 1 1 100%; } } /* «‹ Datum ›» bleibt zusammen in der ersten Zeile */
.mw-foot { padding: 6px 10px; border-top: 1px solid var(--border); background: var(--surface-2); line-height: 1.4; }
.mw-scroll { max-height: 380px; overflow-y: auto; overscroll-behavior: contain; }
.mw-grid { display: grid; }
.mw-corner, .mw-day { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--border); }
.mw-day { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 5px 4px; border-left: 1px solid var(--border); font-size: .82rem; line-height: 1.25; text-align: center; }
.mw-day strong { white-space: nowrap; }
.mw-day.today strong { color: var(--now); }
.mw-sub { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-3); font-size: .72rem; }
.mw-axis { position: relative; }
.mw-axis span { position: absolute; right: 6px; transform: translateY(-50%); font-size: .7rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mw-axis span:first-child { transform: none; }
.mw-col { position: relative; border-left: 1px solid var(--border); cursor: pointer;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(color-mix(in srgb, var(--border) 50%, transparent) 1px, transparent 1px);
  background-size: 100% 48px, 100% 24px; }
@media (hover: hover) { .mw-col:not(.past):hover { background-color: color-mix(in srgb, var(--accent) 5%, transparent); } }
.mw-col.off { background-image: linear-gradient(var(--border) 1px, transparent 1px), repeating-linear-gradient(135deg, var(--surface-3) 0 6px, transparent 6px 12px); background-size: 100% 48px, auto; }
.mw-col.past { cursor: default; background-color: var(--surface-2); }
.mw-col.past > * { opacity: .55; }
.mw-gone { position: absolute; top: 0; left: 0; right: 0; z-index: 3; pointer-events: none; border-bottom: 2px solid var(--now); background: color-mix(in srgb, var(--surface-3) 60%, transparent); }
.mw-busy { position: absolute; left: 2px; right: 2px; z-index: 1; overflow: hidden; padding: 1px 5px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface-3); color: var(--text-2); font-size: .72rem; line-height: 1.3; cursor: help; }
.mw-busy > span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mw-time { font-variant-numeric: tabular-nums; }
.mw-busy > .mw-time { opacity: .85; }
.mw-event { border-style: dashed; }
.mw-meeting { background-image: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--border-strong) 45%, transparent) 5px 7px); }
.mw-own { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); color: var(--accent-strong); }
.mw-own.booked { border-color: color-mix(in srgb, var(--success) 50%, var(--border)); background: var(--success-soft); color: var(--success); }
.mw-win { position: absolute; left: 3px; right: 3px; z-index: 2; overflow: hidden; border: 2px solid var(--accent); border-radius: 6px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: var(--shadow-sm); cursor: grab; touch-action: none; user-select: none; transition: box-shadow .12s, opacity .12s; }
@media (hover: hover) {
  .mw-win:hover { box-shadow: var(--shadow); }
  .mw-busy:hover { border-color: var(--text-3); color: var(--text); }
}
.mw-win.moving { opacity: .35; }
/* Kopie beim Ziehen, darüber Beginn und Ende */
.mw-win.mw-drag { z-index: 3; overflow: visible; pointer-events: none; box-shadow: var(--shadow-lg); }
.mw-win.mw-drag::before { content: attr(data-range); position: absolute; left: -2px; bottom: calc(100% + 4px); padding: 2px 7px; border-radius: 6px; background: var(--text); color: var(--surface); font-size: .72rem; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mw-win.mw-drag.nope { border-color: var(--danger); border-style: dashed; background: color-mix(in srgb, var(--danger) 8%, transparent); }
.mw-dragging, .mw-dragging * { cursor: grabbing !important; user-select: none; }
/* Vorschau beim Darüberfahren: das Fenster, das ein Klick anlegt */
.mw-preview { position: absolute; left: 3px; right: 3px; z-index: 2; display: flex; flex-direction: column; gap: 1px; overflow: hidden; padding: 3px 7px; border: 2px dashed var(--accent); border-radius: 6px; background: color-mix(in srgb, var(--accent) 7%, transparent); color: var(--accent-strong); font-size: .72rem; line-height: 1.25; pointer-events: none; }
.mw-preview strong { font-variant-numeric: tabular-nums; }
.mw-preview.short { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, transparent); color: var(--warn); }
.mw-win.clash { border-style: dashed; border-color: var(--warn); background: transparent; box-shadow: none; }
.mw-win.clash .mw-slot { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--text); }
.mw-win.clash .mw-x { background: var(--warn); }
.mw-slot { position: absolute; left: 3px; right: 3px; overflow: hidden; padding: 2px 5px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 24%, var(--surface)); color: var(--accent-strong); font-size: .7rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mw-x { position: absolute; top: 3px; right: 3px; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-text); cursor: pointer; }
.mw-x:hover { background: var(--accent-strong); }
.mw-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mw-x .icon { width: 14px; height: 14px; }
.mw-grid.loading { opacity: .45; pointer-events: none; transition: opacity .15s .1s; }
.mw-wait { grid-column: 1 / -1; display: grid; place-items: center; min-height: 380px; padding: 16px; text-align: center; color: var(--text-3); }
.mw-wait.mw-error { min-height: 120px; }
@media (max-width: 640px) {
  .mw-scroll { max-height: 320px; overscroll-behavior: auto; } /* am Ende der Woche weiter im Dialog */
  .mw-wait { min-height: 320px; }
}
.pm-inv-nav { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.pm-inv-tpl { gap: 8px; flex-wrap: nowrap; }
.pm-inv-tpl .select { flex: 1 1 auto; min-width: 0; }
@media (max-width: 480px) { .pm-inv-tpl { flex-wrap: wrap; } .pm-inv-tpl .select { flex: 1 1 100%; } }
.pm-allow { column-gap: 18px; row-gap: 4px; }
/* Wunschzeiten: Art der Terminwahl, Schritte bis zum Bekanntgeben, Vorschlag */
.pm-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pm-modes .radio-card:has(input:disabled) { cursor: not-allowed; opacity: .55; }
.pm-wish-panel { flex-wrap: wrap; align-items: center; }
.pm-wish-panel .grow { flex: 1 1 280px; }
.pm-wish-actions { gap: 8px; }
.notice .btn.primary .icon { color: inherit; }
.pm-who:has(.pm-wishes) { display: flex; flex-wrap: wrap; column-gap: 8px; }
.pm-wishes { color: var(--accent-strong); font-weight: 600; white-space: nowrap; }
/* ganz schmal: «3 angekreuzt» bricht um, statt unter die Knöpfe zu laufen; der Filter über den Kindern passt in die Karte */
@media (max-width: 380px) {
  .pm-wishes { white-space: normal; }
  .pm-kids-card .seg { display: flex; width: 100%; }
  .pm-kids-card .seg-btn { padding-inline: 6px; white-space: normal; }
}
.pm-proposal { max-height: 46vh; overflow: auto; }
.pm-proposal-rest { margin: 0; font-size: .92rem; color: var(--text-2); }
.pm-inv-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.pm-inv-who .small { display: inline-flex; align-items: center; gap: 3px; }
.pm-inv-count { text-align: right; }
.pm-inv-subject { min-height: auto; padding: 10px 14px; font-weight: 600; }
/* Link für alle: Link, Text für die Eltern und QR-Code (der bleibt hell, sonst lässt er sich schlecht scannen) */
.pm-share-points { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.pm-share-link { gap: 8px; flex-wrap: nowrap; }
.pm-share-link .input { flex: 1 1 auto; min-width: 0; font-variant-numeric: tabular-nums; }
.pm-share-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.pm-share-text { min-height: auto; font-size: .92rem; }
.pm-share-figure { margin: 26px 0 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pm-share-qr { width: 176px; height: 176px; padding: 6px; border-radius: 10px; background: #ffffff; border: 1px solid var(--border); }
.pm-share-qr svg { display: block; width: 100%; height: 100%; }
/* Einladungslink (Einstellungen → Allgemein): QR-Code zum Scannen, auch im dunklen Modus auf Weiss */
.invite-qr { width: 176px; height: 176px; padding: 6px; border-radius: 10px; background: #ffffff; border: 1px solid var(--border); }
.invite-qr svg { display: block; width: 100%; height: 100%; }
@media (max-width: 640px) {
  .pm-share-grid { grid-template-columns: minmax(0, 1fr); }
  .pm-share-figure { margin-top: 0; }
}
@media (max-width: 900px) { .pm-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .pm-modes { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .pm-win-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .pm-win-fields .pm-win-date { grid-column: 1 / -1; }
  .pm-inv-who .pm-inv-count, .pm-inv-next-label { display: none; }
  .pm-inv-next { min-width: 40px; padding-inline: 8px; justify-content: center; }
}

/* Abhaklisten (pages/check-lists.js): grosse Zeilen zum Abhaken, auch auf dem Handy; Übersicht im Bereich «Aufgaben» */
.cl-items { list-style: none; margin: 0; padding: 0; }
.cl-item { display: flex; align-items: center; gap: 4px; padding: 0 8px 0 0; border-bottom: 1px solid var(--border); }
.cl-item:last-child { border-bottom: 0; }
.cl-check { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px 8px 18px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cl-check:hover .cl-box { border-color: var(--accent); }
.cl-check:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.cl-box { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--border-strong); border-radius: 7px; background: var(--surface); color: var(--accent-text); transition: background .12s, border-color .12s; }
.cl-item.done .cl-box { background: var(--success); border-color: var(--success); }
.cl-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.cl-item.done .cl-name > span { color: var(--text-2); }
/* «zu spät» unter dem Namen, auch bei abgehakten Kindern gut sichtbar; mit Journal-Symbol, wenn ein Eintrag dazu angelegt ist */
.cl-name > .cl-late, .cl-item.done .cl-name > .cl-late { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; padding: 1px 8px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.cl-late .icon { width: 13px; height: 13px; }
/* Knopf «Zu spät» in der Zeile (zwischen Notiz und «…»): ruhig, bei einem Kind, das zu spät ist, in der Farbe von «zu spät» */
.btn.cl-late-btn { color: var(--text-3); }
.btn.cl-late-btn:hover { color: var(--warn); }
.btn.cl-late-btn[aria-pressed="true"] { background: var(--warn-soft); color: var(--warn); }
.cl-late-all { align-items: center; gap: 8px 12px; flex-wrap: wrap; }
/* Wiederholung auf der Seite der Liste und als Symbol in ihrer Zeile */
.cl-repeat { margin: 0 0 12px; color: var(--text-2); }
.cl-repeat p { margin: 0; }
.cl-repeat p > .icon { vertical-align: -2px; color: var(--accent); }
.cl-repeat strong { font-weight: 600; color: var(--text); }
.cl-row-repeat { flex: none; display: inline-flex; color: var(--text-3); }
.cl-hist-btn { margin-top: 6px; }
/* Verlauf einer wiederholten Abhakliste: Kind × Runde, Name und Summen bleiben beim seitlichen Scrollen stehen */
.cl-hist-wrap { overflow-x: auto; margin: 4px 0 10px; border: 1px solid var(--border); border-radius: 10px; }
.cl-hist { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .88rem; }
.cl-hist th, .cl-hist td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; background: var(--surface); }
.cl-hist thead th { position: sticky; top: 0; z-index: 1; font-weight: 600; color: var(--text-2); vertical-align: bottom; background: var(--surface-2); }
.cl-hist tbody tr:last-child > * { border-bottom: 0; }
.cl-hist tfoot > tr > * { border-top: 1px solid var(--border-strong); border-bottom: 0; color: var(--text-2); font-weight: 600; }
.cl-hist .cl-hist-kid { position: sticky; left: 0; z-index: 2; text-align: left; font-weight: 600; color: var(--text); max-width: 11rem; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--border); }
.cl-hist thead .cl-hist-kid { z-index: 3; background: var(--surface-2); }
.cl-hist .cl-hist-sum { color: var(--text-2); font-variant-numeric: tabular-nums; }
.cl-hist .cl-hist-sum.warn { color: var(--warn); font-weight: 600; }
.cl-hist .cl-hist-sum.bad { color: var(--danger); font-weight: 600; }
.cl-hist-round a { color: inherit; }
.cl-hist-round small { display: block; font-weight: 400; color: var(--text-3); }
.cl-hist-round.current { color: var(--accent); }
.cl-hist-mark { display: inline-flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.cl-hist-cell.done .cl-hist-mark, .cl-hist-mark.done { color: var(--success); }
.cl-hist-cell.miss .cl-hist-mark, .cl-hist-mark.miss { color: var(--danger); }
.cl-hist-cell.part .cl-hist-mark { color: var(--text-2); font-size: .8rem; }
.cl-hist .cl-hist-late, .cl-hist-mark.late { color: var(--warn); }
.cl-hist-none { background: var(--surface-2) !important; }
.cl-hist-note, .cl-hist-note-key { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cl-hist-note { margin-left: 3px; vertical-align: super; }
.cl-hist-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; }
.cl-hist-legend > span { display: inline-flex; align-items: center; gap: 4px; }
/* Abhakliste wiederholen: Ende (Auswahl und Datum bzw. Anzahl) in einer Zeile, auf dem Handy untereinander */
.cl-rep-end { gap: 8px; flex-wrap: wrap; align-items: center; }
.cl-rep-end > .select { flex: 1 1 170px; }
.cl-rep-end > .input { flex: 1 1 140px; min-width: 0; }
.cl-rep-preview { margin: 0; }
.cl-print-late { font-weight: 400; }
/* Notiz direkt in der Zeile: ruhig auf hellem Grund, Rahmen beim Darüberfahren und Bearbeiten; halb so breit wie die
   Zeile (höchstens 640px), auf dem Handy schmaler (daneben stehen noch «Zu spät» und «…»), damit kurze Namen auf einer
   Zeile bleiben, und 16px, sonst zoomt Safari beim Antippen */
.cl-note-input { flex: 0 1 50%; max-width: 640px; min-width: 0; min-height: 36px; padding: 6px 10px; border-color: transparent; background: var(--surface-2); font-size: .9rem; text-overflow: ellipsis; }
.cl-note-input:hover:not(:focus) { border-color: var(--border-strong); }
@media (max-width: 640px) {
  .cl-check { gap: 10px; padding-left: 14px; }
  .cl-note-input { flex-basis: 26%; font-size: 16px; }
  /* mit Notiz: die Notiz in eine eigene Zeile unter den Namen, so hat der Name die ganze Breite */
  .cl-item:not(.cl-multi):has(> .cl-note-input.has-note) { flex-wrap: wrap; }
  .cl-item:not(.cl-multi) > .cl-note-input.has-note { order: 3; flex: 1 1 calc(100% - 50px); max-width: calc(100% - 50px); margin: -8px 0 10px 50px; }
}
.cl-note { margin: -4px 0 14px; white-space: pre-line; }
.cl-missing { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.cl-suggest { gap: 6px; margin-top: -6px; }
/* Abhakliste drucken: Kästchen als Rahmen mit × (☐ und ☑ fehlen in der Schrift des PDF), mittig in der ersten Zeile, die
   so hoch ist wie bisher mit dem Zeichen ☐; Name und Notiz stehen auf derselben Höhe, eine längere Notiz läuft darunter weiter */
.cl-print { --cl-line: 1.55rem; }
.subject-sheet .cl-print td { padding-top: calc(5px + (var(--cl-line) - 1lh) / 2); }
.subject-sheet .cl-print .cl-print-box { padding-top: 5px; }
.cl-print-check { box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: .95rem; height: .95rem;
  margin: calc((var(--cl-line) - .95rem) / 2) auto; border: 1.5px solid currentColor; border-radius: 3px; font-size: 1rem; font-weight: 600; line-height: 1; }
.subject-sheet .cl-print th.cl-print-head { line-height: 1.2; text-align: center; overflow-wrap: anywhere; hyphens: auto; }
/* Spalten (z. B. «Grundanforderungen» und «Erweiterte Anforderungen»): Kopf mit den Namen, pro Kind ein Kästchen pro
   Spalte; auf dem Handy die Kästchen mit dem Namen in einer eigenen Zeile unter dem Kind, darunter die Notiz */
.cl-col-counts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: -4px 0 12px; }
.cl-head, .cl-multi { --cl-btn: 32px; display: grid; grid-template-columns: minmax(9rem, 1fr) repeat(var(--cl-n), var(--cl-col)) minmax(120px, 1fr) var(--cl-btn) var(--cl-btn);
  align-items: center; gap: 4px 6px; }
@media (pointer: coarse) { .cl-head, .cl-multi { --cl-btn: 40px; } } /* so breit wie die Knöpfe mit Touch */
.cl-head { padding: 8px 8px 6px 18px; border-bottom: 1px solid var(--border); color: var(--text-3); font-size: .78rem; font-weight: 650; line-height: 1.25; }
.cl-head-col { text-align: center; overflow-wrap: anywhere; hyphens: auto; }
.cl-head-late { display: grid; place-items: center; } /* Wecker über der Spalte «Zu spät» */
.cl-multi { padding: 0 8px 0 18px; }
.cl-multi .cl-name { padding: 8px 0; }
.cl-marks { display: contents; }
.cl-mark { display: grid; place-items: center; min-height: 52px; padding: 0; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; cursor: pointer; }
.cl-mark:hover .cl-box { border-color: var(--accent); }
.cl-mark:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cl-mark.on .cl-box { background: var(--success); border-color: var(--success); }
.cl-mark-label { display: none; }
.cl-multi .cl-note-input { max-width: none; }
/* zu schmal für alle Spalten (paintColumns() misst): wie auf dem Handy untereinander */
.cl-stack .cl-head { display: none; }
.cl-stack .cl-multi { grid-template-columns: minmax(0, 1fr) var(--cl-btn) var(--cl-btn); grid-template-areas: 'name late menu' 'marks marks marks' 'note note note';
  row-gap: 6px; padding: 6px 8px 10px 14px; }
.cl-stack .cl-multi .cl-name { grid-area: name; padding: 4px 0 0; }
.cl-stack .cl-multi > .cl-late-btn { grid-area: late; }
.cl-stack .cl-multi > .cl-menu-btn { grid-area: menu; }
.cl-stack .cl-marks { grid-area: marks; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 6px; } /* gleich breit statt Chips nach Länge */
.cl-stack .cl-mark { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; min-height: 40px; padding: 4px 10px 4px 6px; border: 1px solid var(--border); border-radius: 10px; }
.cl-stack .cl-mark .cl-box { width: 24px; height: 24px; }
.cl-stack .cl-mark-label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.cl-stack .cl-multi .cl-note-input { grid-area: note; }
/* Dialog: Spalten untereinander, mit «×»; «Wer fehlt noch?» pro Spalte */
.cl-cols { gap: 6px; }
.cl-col-row { display: flex; align-items: center; gap: 6px; }
.cl-col-row .input { flex: 1; min-width: 0; }
.cl-col-add { align-self: flex-start; }
.cl-missing-col + .cl-missing-col { margin-top: 10px; }
.cl-missing-col .cl-missing { margin-top: 4px; }

/* Drucken aus der Klassenliste (classprint.js): Seiten in Millimetern, Namen passt fitNames() in die Breite ein */
.cp-sheet { box-sizing: border-box; background: #fff; color: #1c2430; color-scheme: light; font-family: var(--font); line-height: 1.2;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cp-page { box-sizing: border-box; overflow: hidden; break-after: page; }
.cp-page:last-child { break-after: auto; }
.cp-fit { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; font-weight: 700; }
.cp-fit.wrap { white-space: normal; overflow-wrap: anywhere; }
.cp-sub { display: block; max-width: 100%; color: #586371; }
/* Namensschilder 85 × 54 mm, Schnittlinien gestrichelt */
.cp-badges { width: 190mm; height: 276mm; display: grid; grid-template-columns: repeat(2, 85mm); grid-auto-rows: 54mm; justify-content: center; align-content: start; padding-top: 3mm; }
.cp-badge { box-sizing: border-box; border: 0 dashed #b9b4a8; border-width: 0 .3mm .3mm 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1mm; padding: 3mm 6mm; text-align: center; overflow: hidden; }
/* Schnittlinien nur einmal (sonst doppelt im PDF): rechts und unten, oben die erste Reihe, links die erste Spalte */
.cp-badge:nth-child(-n+2) { border-top-width: .3mm; }
.cp-badge:nth-child(odd) { border-left-width: .3mm; }
.cp-badge .cp-fit { font-size: 12mm; }
.cp-badge .cp-last { font-size: 5mm; font-weight: 600; }
.cp-badge .cp-class { font-size: 3.5mm; margin-top: 1.5mm; }
/* Pultkarten: zwei pro Seite, in der Mitte gefaltet; die obere Hälfte steht kopf, damit der Name hinten richtig steht */
.cp-tents { width: 190mm; height: 276mm; }
.cp-tent { box-sizing: border-box; height: 138mm; border: .3mm dashed #b9b4a8; display: grid; grid-template-rows: 1fr 1fr; }
.cp-tent + .cp-tent { border-top: 0; }
.cp-tent-half { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2mm; padding: 6mm 10mm; text-align: center; overflow: hidden; }
.cp-tent-half.flip { transform: rotate(180deg); }
.cp-tent-half + .cp-tent-half { border-top: .3mm dotted #cfc9bc; }
.cp-tent .cp-fit { font-size: 24mm; }
.cp-tent .cp-last { font-size: 9mm; font-weight: 600; }
/* Etiketten: Bogen bis an den Rand (Rand 0), Grösse und Zeilen aus LABEL_SHEETS; die Umrisse nur am Bildschirm */
.cp-labels { width: 210mm; display: grid; justify-content: center; align-content: start; }
.cp-label { box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; gap: .8mm; padding: 3mm 7mm; overflow: hidden; }
@media screen { .cp-label { box-shadow: inset 0 0 0 1px #ebe7de; } }
.cp-label .cp-fit { font-size: 6mm; }
.cp-label .cp-class { font-size: 3.4mm; }
.cp-label .cp-subject { font-size: 3.4mm; margin-top: 1.5mm; padding-bottom: .6mm; border-bottom: .25mm solid #9a948a; }
/* leere Abhakliste: Namen und leere Spalten zum Beschriften und Abhaken von Hand */
.print-sheet.cp-list { font-size: 3.6mm; }
.cp-check .cp-fit { font-weight: 400; }
.cp-check .cp-fit.wrap { line-height: 1.05; }
.cp-list .ps-head { align-items: flex-end; }
.cp-blank { width: 110mm; height: 9mm; border-bottom: .3mm solid #9a948a; }
.cp-date { font-size: 3.6mm; color: #586371; white-space: nowrap; }
.cp-check { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
/* jede Linie einmal (sonst doppelt im PDF), oben am Kopf, damit sie auf jeder Seite mitkommt */
.cp-check th, .cp-check td { border: 0 solid #9a948a; border-width: 0 .25mm .25mm 0; padding: 0 1.5mm; height: 7.5mm; text-align: left; font-weight: 400; overflow: hidden; white-space: nowrap; }
.cp-check thead th { height: 22mm; vertical-align: bottom; padding-bottom: 1mm; font-weight: 650; border-top-width: .25mm; }
.cp-check .cp-n { color: #7a828c; text-align: right; border-left-width: .25mm; }
/* Abhaklisten als Zeilen (checkListLinks() in components.js): in der Übersicht und bei den Aufgaben; jede abgehoben auf
   hellem Grund, mit etwas Abstand dazwischen */
.cl-rows { display: flex; flex-direction: column; gap: 4px; }
.cl-rows-list { display: flex; flex-direction: column; gap: 8px; }
.cl-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); color: inherit; text-decoration: none; }
.cl-row:hover { background: var(--accent-soft); }
.cl-row .icon { color: var(--accent); }
.cl-row.archived .icon { color: var(--text-3); }
.cl-row-title { flex: 1 1 140px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.cl-row-folder { color: var(--accent); }
.cl-row .cl-row-folder .icon { width: 13px; height: 13px; }
.cl-row .cl-row-late .icon { width: 13px; height: 13px; color: inherit; } /* «2 zu spät» */
/* bei den Aufgaben mit Stift und Papierkorb rechts wie eine Aufgabe (onEdit, onDelete): Link und Knöpfe nebeneinander,
   der Link füllt den Rest der Zeile */
.cl-row-edit { flex-wrap: nowrap; gap: 2px; padding: 0 4px 0 0; }
.cl-row-link { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.cl-row-edit .task-actions { flex: none; }
.cl-row-edit:hover .task-actions, .cl-row-edit:focus-within .task-actions { opacity: 1; }
.cl-row .task-actions .icon { color: inherit; }
/* sehr schmal: Symbol und Titel bleiben auf einer Zeile */
@media (max-width: 360px) { .cl-row-link .cl-row-title { flex-basis: 100px; } }
.cl-more { align-self: flex-start; padding: 4px 2px; }
/* Übersicht: abgehoben vom Eingabefeld darüber und von den Aufgaben darunter */
.ov-checklists { margin: 14px 0 6px; }

/* Journal (pages/journal.js, journaldialog.js): Beobachtungen pro Kind. Stufen tragen ihre Farbe als --jn-c (Farben wie in
   Lernspiegel); Chips zum Antippen gross genug fürs Handy */
.jn-chip-level, .jn-level { --jn-c: var(--text-3); }
.jn-chip-level { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--jn-c) 16%, transparent); color: color-mix(in srgb, var(--jn-c) 55%, var(--text)); } /* Schrift mindestens 4,5:1, auch bei Orange und Grün */
.jn-chip-level::before, .jn-level::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--jn-c); flex: none; }
.jn-chip-level.icon-level::before, .jn-level.icon-level::before { display: none; }
/* Dialog «Eintrag»: auf dem Handy ein Blatt von unten */
.modal.jn-dialog { width: min(680px, 100%); }
.modal.jn-dialog:focus { outline: none; }
.jn-form { display: flex; flex-direction: column; gap: 16px; }
.jn-block { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.jn-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .82rem; font-weight: 700; color: var(--text-2); }
.jn-label .grow { min-width: 120px; }
.jn-label .jn-search { font-size: 15px; font-weight: 400; }
.jn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.jn-groups { align-self: flex-start; margin-bottom: 8px; white-space: nowrap; max-width: 100%; overflow-x: auto; }
.jn-chips .chip { font-size: .86rem; padding: 4px 11px; }
/* Rückfrage «Für wen ändern?»: «Nur bei» mit einem Knopf pro Kind */
.jn-which { display: flex; flex-direction: column; gap: 8px; }
.jn-kid .jn-num { color: var(--text-3); font-variant-numeric: tabular-nums; font-weight: 600; }
.jn-kid.active .jn-num { color: inherit; opacity: .85; }
/* Kinder im Blick: zuerst, mit Auge (bzw. Haken, wenn es schon einen Eintrag gibt), hell mit Rand (auch im Tagesrückblick und in der Übersicht) */
.jn-kid.jn-focus-kid { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.jn-kid.jn-focus-kid .icon { color: var(--accent); }
.jn-kid.jn-focus-kid.active .icon { color: inherit; }
.jn-sit { position: relative; padding-left: 20px !important; }
.jn-sit::before { content: ""; position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--jn-c, var(--border-strong)); }
.jn-level { gap: 6px; }
/* gewählt: gefärbt wie die Stufe in der Liste (.jn-chip-level), dazu ein Rahmen in ihrer Farbe */
.jn-level.on, .jn-level.on:hover { background: color-mix(in srgb, var(--jn-c) 16%, transparent); border-color: var(--jn-c); color: color-mix(in srgb, var(--jn-c) 55%, var(--text)); font-weight: 650; }
.jn-level .jn-icon { font-size: 1rem; line-height: 1; }
/* mehrere Situationen: pro Situation ihr Name und darunter ihre Stufen */
.jn-chips.jn-level-rows { flex-direction: column; align-items: stretch; gap: 10px; }
.jn-level-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.jn-level-sit { flex: 0 0 100%; font-size: .86rem; font-weight: 650; overflow-wrap: anywhere; }
.jn-search-wrap { flex: 0 1 220px; min-width: 0; }
.jn-comps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .84rem; color: var(--text-2); }
.jn-comps button { padding: 2px 0; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; text-align: left; }
.jn-comps button:hover { text-decoration: underline; }
.jn-new-sit { align-self: flex-start; }
/* ausgeblendete Situationen (aufgeklappt mit «Ausgeblendete»): gestrichelt, ohne Fläche */
button.chip.jn-sit-off:not(.active) { background: transparent; border: 1px dashed var(--border-strong); }
.jn-more-sits { align-self: flex-start; }
.jn-when { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.jn-when-picks { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.jn-when-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; width: 100%; }
.jn-note { min-height: 44px; resize: none; overflow: hidden; }
.jn-more-kids { align-self: flex-start; }
.jn-pick-list { display: flex; flex-direction: column; gap: 14px; }
.jn-pick-area h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin: 0 0 6px; }
.jn-pick-comp { border: 1px solid var(--border); border-radius: 10px; margin: 0 0 8px; }
.jn-pick-comp > .checkbox { padding: 8px 12px; font-weight: 650; }
.jn-pick-subs { display: flex; flex-direction: column; padding: 0 12px 8px 34px; }
.jn-pick-subs .checkbox { align-items: flex-start; padding: 4px 0; }
@media (max-width: 640px) { .jn-pick-subs { padding-left: 12px; } }
.jn-pick-subs .checkbox small { display: block; color: var(--text-3); font-size: .78rem; }
@media (max-width: 640px) {
  .modal-backdrop:has(> .modal.jn-dialog) { place-items: end center; padding: 0; }
  .modal.jn-dialog { width: 100%; max-height: 94dvh; border-radius: 16px 16px 0 0; animation: jn-sheet .2s ease-out; } /* dvh: mit eingeblendeter Leiste des Browsers */
  .modal.jn-dialog .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .jn-search-wrap { flex: 1 1 100%; }
}
@keyframes jn-sheet { from { transform: translateY(40px); opacity: 0; } }

/* Seite «Journal» */
/* Klasse (mehrere Klassen): Knopf mit Rahmen im Untertitel, daneben Schuljahr und Stufen */
.jn-sub { display: flex; align-items: center; gap: 10px; min-width: 0; }
.jn-sub-rest { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Auswahl der Klasse im Untertitel (Journal, Sitzplan) */
.page-head .sub .select-btn.class-pick { flex: none; min-height: 32px; padding: 4px 10px 4px 9px; margin: 4px 0 2px; gap: 6px; border-color: var(--border-strong); background: var(--surface); color: var(--text); font-weight: 650; }
.page-head .sub .select-btn.class-pick:hover { background: var(--surface-3); }
.class-pick > .icon:first-child { color: var(--accent); }
.class-pick .select-btn-text { max-width: 220px; }
/* im Untertitel wie Text, mit Pfeil; die Fläche zum Antippen reicht über den Rand hinaus */
.page-head .sub .select-btn { min-height: 0; padding: 3px 6px; margin: -3px 0 -3px -6px; gap: 4px; color: var(--text); font-weight: 600; vertical-align: baseline; }
@media (pointer: coarse) { .page-head .sub .select-btn > select { inset: -9px -4px; } } /* Finger: höher antippbar */
@media (max-width: 640px) { .page-head .sub { overflow: clip; overflow-clip-margin: 10px; } } /* … ohne die Fläche abzuschneiden */
/* Handy: die vier Reiter ohne Symbole und etwas enger, damit alle Platz haben (auch bei 360 px) */
@media (max-width: 640px) {
  .jn-tabs { gap: 0; }
  .jn-tabs .tab { flex: 1 1 auto; padding: 9px 5px; font-size: .9rem; }
  .jn-tabs .tab .icon { display: none; }
}
@media (max-width: 359px) { .jn-tabs .tab { padding: 9px 3px; font-size: .84rem; } }
/* Übersicht, Bereich «Journal»: Kinder im Blick pro Klasse, die Namen erst nach Antippen */
.ov-focus-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.ov-focus { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ov-focus-class { font-weight: 650; font-size: .86rem; min-width: 2.5em; }
.ov-focus-label { font-size: .86rem; color: var(--text-2); }
/* Leiste «Im Blick heute»: jedes Kind ein Knopf für den Eintrag und ein «…» */
.jn-focus { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px 10px 14px; margin: 0 0 14px; border-radius: 12px; background: var(--accent-soft); }
.jn-focus > .icon { color: var(--accent); }
.jn-focus-label { font-weight: 650; }
.jn-focus-kids { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.jn-focus-item { display: inline-flex; align-items: stretch; max-width: 100%; border-radius: 999px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); overflow: hidden; }
.jn-focus-item button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
.jn-focus-item button:hover { background: var(--surface-2); }
.jn-focus-name { padding: 4px 4px 4px 12px; font-size: .88rem; font-weight: 600; overflow-wrap: anywhere; }
.jn-focus-more { padding: 4px 9px 4px 5px; color: var(--text-3) !important; }
.jn-focus-item.done .jn-focus-name .icon { color: var(--success); }
.jn-focus-set { margin-left: auto; }
@media (max-width: 640px), (pointer: coarse) { .jn-focus-name, .jn-focus-more { min-height: 40px; } } /* Tippziel wie die anderen Knöpfe */
/* Handy: oben «Im Blick heute» mit dem Zahnrad, darunter die Kinder */
@media (max-width: 640px) { .jn-focus-set { order: 1; } .jn-focus-kids, .jn-focus > .small { order: 2; flex-basis: 100%; } }
.jn-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.jn-tools .select { width: auto; max-width: min(260px, 100%); }
.jn-count { white-space: nowrap; padding-inline: 4px; }
.jn-select-all { align-items: center; white-space: nowrap; font-size: .9rem; }
.jn-select-all input { margin-top: 0; }
.jn-select-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; margin-left: auto; }
/* Handy: Filter zu zweit nebeneinander statt vier Auswahllisten untereinander */
@media (max-width: 640px) {
  .jn-filter-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jn-filter-bar .select, .jn-filter-bar .select-btn { width: 100%; max-width: none; min-width: 0; }
  .jn-filter-bar .select-btn-text { flex: 1; min-width: 0; }
  .jn-filter-bar > .grow { display: none; }
  .jn-filter-bar > .btn, .jn-select-tools > .btn { justify-content: center; }
  .jn-filter-bar > .jn-select-tools { display: contents; }
}
.jn-remind { display: flex; flex-wrap: wrap; gap: 8px; }
.jn-remind .select, .jn-remind .input { width: auto; min-width: 0; }
.jn-kid-nav { display: flex; align-items: center; gap: 4px; min-width: 0; }
.jn-kid-nav .select { width: 14rem; min-width: 0; }
.jn-day { margin: 0 0 14px; }
.jn-day-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; padding: 10px 18px; border-bottom: 1px solid var(--border); font-weight: 650; }
.jn-day-head .small { font-weight: 500; white-space: nowrap; }
.jn-entry { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 10px 18px; border-bottom: 1px solid var(--border); cursor: pointer; }
.jn-entry:last-child { border-bottom: 0; }
.jn-entry:hover { background: var(--surface-2); }
.jn-entry.select-mode { grid-template-columns: 28px 6.5rem minmax(0, 1fr) auto; }
.jn-entry.highlight { background: var(--accent-soft); }
.jn-when-cell { color: var(--text-3); font-size: .84rem; font-variant-numeric: tabular-nums; padding-top: 1px; overflow-wrap: normal; hyphens: auto; } /* Fächer nicht mitten im Wort trennen */
.jn-when-cell .jn-date { color: var(--text-2); font-weight: 600; }
.jn-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.jn-head-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.jn-kids-names { font-weight: 650; overflow-wrap: anywhere; }
.jn-sit-label { color: var(--text); overflow-wrap: anywhere; }
/* in Lernspiegel erfasst (Einträge in beide Richtungen) */
.jn-from-ls { padding: 0 6px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-3); font-size: .72rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.jn-comp-small { font-size: .8rem; color: var(--text-3); overflow-wrap: anywhere; }
.jn-note-text { white-space: pre-line; overflow-wrap: anywhere; color: var(--text-2); }
.jn-author { font-size: .78rem; color: var(--text-3); }
@media (max-width: 640px) {
  .jn-entry { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 14px; }
  /* Zeit und Stufe oben, der Eintrag in voller Breite darunter */
  .jn-entry .jn-when-cell { grid-column: 1; grid-row: 1; }
  .jn-entry > .jn-chip-level { grid-column: 2; grid-row: 1; align-self: center; }
  .jn-entry .jn-main { grid-column: 1 / -1; }
  /* Auswählen: das Kästchen links über beide Zeilen, Zeit oben, der Eintrag darunter */
  .jn-entry.select-mode { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .jn-entry.select-mode > input { grid-row: 1 / span 2; }
  .jn-entry.select-mode .jn-when-cell { grid-column: 2; grid-row: 1; }
  .jn-entry.select-mode > .jn-chip-level { grid-column: 3; }
  .jn-entry.select-mode .jn-main { grid-column: 2 / -1; grid-row: 2; }
  .jn-day-head { padding: 10px 14px; }
}
/* Reiter «Kinder»: Balken mit den Stufen in ihren Farben */
.jn-kids { width: 100%; border-collapse: collapse; }
.jn-kids th { text-align: left; font-size: .8rem; color: var(--text-3); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.jn-kids td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.jn-kids tr.jn-kid-row { cursor: pointer; }
.jn-kids tr.jn-kid-row:hover td { background: var(--surface-2); }
.jn-kids .jn-n { width: 1%; color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; }
.jn-kids .jn-count { width: 1%; font-variant-numeric: tabular-nums; text-align: right; font-weight: 650; }
.jn-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-3); min-width: 80px; }
.jn-bar span { display: block; height: 100%; background: var(--jn-c, var(--border-strong)); }
.jn-last { white-space: nowrap; color: var(--text-2); font-size: .86rem; }
.jn-last.never { color: var(--warn); font-weight: 600; }
.jn-last-m { display: none; }
@media (max-width: 640px) {
  .jn-kids th, .jn-kids td { padding: 8px; }
  .jn-kids .jn-col-last { display: none; }
  .jn-last-m { display: block; font-size: .78rem; }
  .jn-bar { min-width: 48px; }
}
/* Reiter «Kompetenzen»: Kinder × Kompetenzen mit Anzahl und Farbe der Tendenz */
.jn-matrix-wrap { overflow-x: auto; }
.jn-matrix { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: .86rem; }
.jn-matrix th, .jn-matrix td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.jn-matrix thead th { font-size: .74rem; font-weight: 650; color: var(--text-2); vertical-align: bottom; white-space: normal; min-width: 72px; max-width: 120px; hyphens: auto; overflow-wrap: anywhere; } /* «Fremd-einschätzung» statt in die Spalte daneben */
.jn-matrix thead th button { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: center; }
.jn-matrix thead th button:hover { color: var(--accent); }
.jn-matrix .jn-area-row th { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); border-bottom: 0; }
.jn-matrix th.jn-name, .jn-matrix td.jn-name { position: sticky; left: 0; z-index: 1; min-width: 8em; max-width: 12em; background: var(--surface); text-align: left; font-weight: 600; white-space: normal; }
.jn-matrix tbody tr { cursor: pointer; }
.jn-matrix tbody tr:hover td { background: var(--surface-2); }
.jn-cell { display: inline-flex; min-width: 34px; justify-content: center; padding: 2px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; font-weight: 650;
  background: color-mix(in srgb, var(--jn-c, transparent) 22%, transparent); color: color-mix(in srgb, var(--jn-c, var(--text-3)) 70%, var(--text)); }
.jn-cell.empty { color: var(--text-3); font-weight: 500; background: none; }
.jn-cards-mobile { display: none; }
@media (max-width: 640px) {
  .jn-matrix-wrap { display: none; }
  .jn-cards-mobile { display: flex; flex-direction: column; }
  .jn-mrow { border-bottom: 1px solid var(--border); }
  .jn-mrow > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
  /* Name, Anzahl und Pfeil in einer Zeile; der Name bricht um, nicht der Pfeil */
  .jn-mrow > button > .grow { min-width: 0; overflow-wrap: anywhere; }
  .jn-mrow > button > :not(.grow) { flex: none; white-space: nowrap; }
  .jn-mrow .jn-mcomps { display: flex; flex-direction: column; gap: 6px; padding: 0 14px 12px; }
  .jn-mcomp { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
  .jn-mcomp > :first-child { min-width: 0; }
  .jn-mcomp > :last-child { flex: none; white-space: nowrap; } /* «noch nichts» in einer Zeile */
}
@media (max-width: 380px) { .jn-mcount-word { display: none; } } /* «5 von 9» statt «5 von 9 Kompetenzen» */
/* Seite eines Kindes */
.jn-child-comps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; gap: 12px; margin: 0 0 18px; }
.jn-comp-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; min-width: 0; }
.jn-comp-card h3 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; margin: 0; font-size: .95rem; }
.jn-comp-card h3 > span:first-child { min-width: 0; }
.jn-comp-card.empty-card { background: var(--surface-2); box-shadow: none; } /* leer: ruhiger, aber ohne blasse Schrift (Kontrast) */
.jn-subs { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; color: var(--text-2); }
.jn-subs div { display: flex; justify-content: space-between; gap: 8px; }
/* Seite eines Kindes: Einträge einer Kompetenz zum Aufklappen */
.jn-comp-toggle { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin: -3px 0 -3px -4px; padding: 3px 8px 3px 4px;
  border: 0; border-radius: 6px; background: none; color: var(--text-2); font: inherit; font-size: .84rem; cursor: pointer; }
.jn-comp-toggle:hover { background: var(--surface-2); color: var(--text); }
.jn-comp-toggle .icon { transition: transform .15s ease; }
.jn-comp-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .jn-comp-toggle .icon { transition: none; } }
.jn-comp-entries { display: flex; flex-direction: column; margin: 2px -8px 0; }
.jn-comp-entries[hidden] { display: none; }
.jn-ce { display: flex; flex-direction: column; gap: 2px; padding: 7px 8px; border-radius: 8px; font-size: .84rem; cursor: pointer; }
.jn-ce + .jn-ce { border-top: 1px solid var(--border); border-top-left-radius: 0; border-top-right-radius: 0; }
.jn-ce:hover { background: var(--surface-2); }
.jn-ce-head { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; }
.jn-ce-date { color: var(--text-2); font-variant-numeric: tabular-nums; }
.jn-ce-sit { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.jn-ce-head .jn-chip-level { margin-left: auto; }
.jn-ce-sub { color: var(--text-2); font-size: .8rem; overflow-wrap: anywhere; }
.jn-ce-note { overflow-wrap: anywhere; white-space: pre-line; }
.jn-all-toggle { margin-left: auto; }
/* Fenster «Mit KI erstellen» */
.jn-ai-purposes { display: flex; flex-wrap: wrap; max-width: 100%; }
.jn-ai-purposes .seg-btn { flex: 0 1 auto; }
.jn-ai-text { min-height: 240px; line-height: 1.5; resize: vertical; }
/* Situationen verwalten */
.jn-sit-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; }
.jn-sit-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface); }
.jn-sit-row:last-child { border-bottom: 0; }
.jn-sit-row .grow { display: flex; flex-direction: column; gap: 2px; }
.jn-sit-row .jn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--jn-c, var(--border-strong)); flex: none; }
/* Griff zum Ziehen (wie bei den Aufgaben); die gezogene Zeile schwebt über den anderen */
.jn-sit-grip { display: grid; place-items: center; flex: none; width: 24px; height: 30px; margin: 0 -4px 0 -4px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-3); cursor: grab; touch-action: none; }
.jn-sit-grip:hover, .jn-sit-grip:focus-visible { color: var(--accent); background: var(--surface-2); }
.jn-sit-row.dragging { position: relative; z-index: 2; box-shadow: 0 6px 18px rgba(0, 0, 0, .14); border-radius: 10px; }
.jn-sit-row.dragging .jn-sit-grip { cursor: grabbing; }
/* «Ansichten …»: Reiter des Journals ordnen (gleiche Zeilen wie die Situationen, auch auf dem Handy in einer Zeile) */
.jn-tab-list .jn-sit-row { flex-wrap: nowrap; }
.jn-tab-list .jn-sit-row .grow { flex: 1 1 auto; }
/* Handy: der Name über die ganze Breite, die Knöpfe darunter rechts */
@media (max-width: 640px) {
  .jn-sit-row { flex-wrap: wrap; row-gap: 2px; }
  .jn-sit-row .grow { flex: 1 1 calc(100% - 19px); }
  .jn-sit-grip ~ .grow { flex-basis: calc(100% - 45px); }
  .jn-sit-row .grow + .btn { margin-left: auto; }
}
/* Journal teilen: Freigaben und neue Freigabe */
.jn-share-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; }
.jn-share-list > p { margin: 0; padding: 10px 12px; }
.jn-share-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.jn-share-row:last-child { border-bottom: 0; }
.jn-share-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.jn-share-row .checkbox { margin-top: 4px; }
.jn-share-row .select, .jn-share-form .select { width: auto; }
.jn-share-head { margin: 6px 0 0; font-size: 1rem; }
.jn-share-form { display: flex; gap: 8px; flex-wrap: wrap; }
.jn-share-form .input { flex: 1 1 220px; }
/* schmal: E-Mail über die ganze Breite, darunter Rolle und «Weiter» nebeneinander */
@media (max-width: 480px) { .jn-share-form .input { flex-basis: 100%; } .jn-share-form .select { flex: 1 1 auto; min-width: 0; } }
@media (max-width: 640px) {
  .jn-share-row { flex-wrap: wrap; }
  .jn-share-row .grow { flex-basis: 100%; }
}
/* Druck */
.jn-print h2 { font-size: 13pt; margin: 6mm 0 2mm; }
.jn-print .ss-table { table-layout: fixed; }
.jn-print .ss-table td { overflow-wrap: anywhere; }

/* Reiter «Bericht» (journalreport.js): links die Einstellungen, rechts die Vorschau eines Kindes */
.jr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 14px; }
.jr-tpl-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.jr-tpl { width: auto; max-width: min(300px, 58vw); }
.jr-dirty { padding: 1px 9px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.jr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.jr-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.jr-card-form { padding: 2px 18px; }
.jr-sec { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.jr-sec:last-child { border-bottom: 0; }
.jr-sec h3 { margin: 0; font-size: .82rem; font-weight: 700; color: var(--text-2); }
.jr-sec .field { margin: 0; }
.jr-radios { display: flex; flex-direction: column; gap: 8px; }
.jr-radio { align-items: flex-start; }
.jr-radio input { margin-top: 1px; flex: none; }
.jr-radio small { display: block; color: var(--text-3); font-size: .8rem; }
.jr-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 10px; background: var(--surface-3);
  color: var(--text-2); font-size: .74rem; font-weight: 650; vertical-align: 1px; }
.jr-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.jr-dates .input { width: auto; }
.jr-range { display: block; margin: 0; }
.jr-range > .icon { margin-right: 4px; vertical-align: -2px; }
.jr-pick { display: flex; flex-direction: column; gap: 10px; padding-left: 27px; }
.jr-pick-group { display: flex; flex-direction: column; gap: 6px; }
.jr-pick-all { gap: 4px; }
.jr-sit { position: relative; padding-left: 20px !important; }
.jr-sit::before { content: ""; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--jr-c); }
.jr-sit.active::before { background: currentColor; }
.jr-chip-n { margin-left: 4px; opacity: .7; font-variant-numeric: tabular-nums; }
.jr-warn { margin: 0; color: var(--warn); font-weight: 600; }
.jr-comp-list { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-left: 27px; }
.jr-comp-list ul { margin: 0; padding-left: 16px; font-size: .88rem; color: var(--text-2); }
.jr-switches { display: flex; flex-direction: column; gap: 10px; }
.jr-textarea { min-height: 0; resize: vertical; }
.jr-ph { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.jr-side { position: sticky; top: 16px; min-width: 0; }
.jr-preview { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; }
.jr-preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.jr-preview-head h3 { margin: 0; font-size: 1rem; }
.jr-stepper { display: flex; flex: 1 1 auto; max-width: 100%; justify-content: flex-end; align-items: center; gap: 2px; min-width: 0; }
.jr-stepper .select { flex: 0 1 auto; width: auto; min-width: 0; max-width: 200px; }
/* das Blatt wie gedruckt: Kärtchen in ihrer Breite, eine Seite verkleinert (fitPreview()) */
.jr-paper.print-sheet { width: auto; padding: 18px; border: 1px solid var(--border); border-radius: 10px; overflow: auto; max-height: min(72vh, 900px); }
.jr-paper .jr-cards { width: 92.5mm; margin: 0 auto; }
.jr-paper .jr-pages { width: 190mm; }
.jr-none { margin: 4px 0; }
.jr-preview-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.jr-preview-foot > .grow { flex: 1 1 10em; }
.jr-bar > .btn.primary { margin-left: auto; }
@media (max-width: 700px) {
  .jr-grid { grid-template-columns: minmax(0, 1fr); }
  .jr-side { position: static; }
}
@media (max-width: 640px) {
  .jr-card-form { padding: 2px 14px; }
  .jr-pick, .jr-comp-list { padding-left: 0; }
  .jr-bar > .grow { display: none; }
  .jr-bar > .btn.primary { flex: 1 1 100%; justify-content: center; }
  .jr-paper.print-sheet { padding: 10px; }
  .jr-paper .jr-pages { width: auto; }
}

/* Bericht auf Papier (Vorschau, Druck, PDF): pro Situation ein Punkt in der Farbe ihrer Art («gelingt» grün, «gelingt
   noch nicht» orange), darunter die Einträge; das PDF zeichnet Punkte über ::before (pdf.js), Zeichen hat die Schrift keine */
.jr-sheet { --jr-plus: #2f9e44; --jr-minus: #f08c00; --jr-none: #9aa1a9; }
.jr-cards { font-size: 12px; }
.jr-pages { font-size: 14px; }
.jr-cards .jr-row { display: flex; gap: 5mm; }
.jr-cards .jr-row + .jr-row { margin-top: 5mm; }
.jr-card { flex: 1 1 0; min-width: 0; padding: 4mm 4.5mm; border: 1px dashed #b5afa3; }
.jr-card.jr-blank { border-color: transparent; }
/* eines pro Zeile: gleich breit wie zwei nebeneinander, so hoch wie sein Inhalt */
.jr-single .jr-row { justify-content: center; }
.jr-single .jr-card { flex: 0 0 92.5mm; }
.jr-report { display: flex; flex-direction: column; gap: 2.4mm; line-height: 1.38; color: var(--text); }
.jr-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1mm 6mm; }
.jr-title { font-weight: 700; font-size: 1.12em; }
.jr-name { font-weight: 700; }
.jr-cards .jr-head { display: block; }
.jr-cards .jr-name { font-weight: 500; color: var(--text-2); }
.jr-pages .jr-title { font-size: 1.45em; }
.jr-pages .jr-name { font-size: 1.25em; }
.jr-period { font-weight: 650; font-size: .92em; }
.jr-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.jr-groups { display: flex; flex-direction: column; gap: 1.8mm; }
.jr-group { position: relative; padding-left: 4.6mm; overflow-wrap: anywhere; }
.jr-group::before { content: ""; position: absolute; left: 0; top: .38em; width: 2.6mm; height: 2.6mm; border-radius: 50%; background: var(--jr-none); }
.jr-group.jr-plus::before { background: var(--jr-plus); }
.jr-group.jr-minus::before { background: var(--jr-minus); }
.jr-group.jr-zero { color: var(--text-2); }
.jr-group.jr-zero::before { background: #d3d6da; }
.jr-glabel strong { font-weight: 700; }
.jr-gcomps { font-size: .84em; color: var(--text-3); }
.jr-lines { display: flex; flex-direction: column; gap: .3mm; margin: .6mm 0 0; padding: 0; list-style: none; font-size: .88em; color: var(--text-2); }
.jr-lines li { position: relative; padding-left: 3mm; }
.jr-lines li::before { content: ""; position: absolute; left: .3mm; top: .62em; width: 1.2mm; height: 1.2mm; border-radius: 50%; background: #a9aeb5; }
.jr-sign { display: flex; align-items: flex-end; gap: 3mm; margin-top: 2mm; font-size: .88em; color: var(--text-2); }
.jr-sign-line { flex: 1 1 auto; height: 6mm; border-bottom: 1px solid #8a8f96; }
.jn-chips .jr-sit.jr-plus { --jr-c: #2f9e44; }
.jn-chips .jr-sit.jr-minus { --jr-c: #f08c00; }
.jn-chips .jr-sit.jr-none { --jr-c: var(--border-strong); }

/* Lernspiegel (lernspiegel.js): Fenster «Mit Lernspiegel verknüpfen …» und das Zeichen am Eintrag */
.jn-ls { margin-bottom: 14px; gap: 8px; }
.jn-ls-tend { display: block; font-size: .8rem; color: var(--text-2); }
.jn-ls-tend .icon { margin-right: 5px; vertical-align: -2px; color: var(--accent); }
.jn-scale-group { margin: 8px 0 0; font-size: .86rem; color: var(--text-2); }
.ls-link { display: flex; flex-direction: column; gap: 18px; }
.ls-sec { display: flex; flex-direction: column; gap: 10px; }
.ls-sec + .ls-sec { padding-top: 16px; border-top: 1px solid var(--border); }
.ls-sec > h3 { margin: 0; font-size: .95rem; }
.ls-hint { display: block; margin-top: 2px; color: var(--text-3); font-size: .82rem; font-weight: 400; line-height: 1.4; }
.ls-check { align-items: flex-start; }
.ls-check input { margin-top: 1px; flex: none; }
.ls-sub { padding-left: 27px; }
.ls-actions { gap: 8px; flex-wrap: wrap; }
.ls-from { gap: 8px; }
.ls-from .checkbox { flex-wrap: wrap; }
.ls-date { width: auto; max-width: 180px; }
.ls-linked { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.ls-linked > .icon { color: var(--accent); margin-top: 2px; }
.ls-progress { display: flex; flex-direction: column; gap: 6px; }
.ls-progress-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ls-progress-line > .grow { flex: 1 1 14em; }
.ls-kids { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ls-kid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 230px) 170px; gap: 6px 12px; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--border); }
.ls-kid:last-child { border-bottom: 0; }
.ls-kid.open { box-shadow: inset 3px 0 0 var(--warn); }
.ls-kid-name { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.ls-kid-state { font-size: .8rem; color: var(--text-3); }
.ls-kid-state.ls-ok { color: var(--success); }
.ls-kid-state.ls-warn { color: var(--warn); }
.ls-confirm { display: flex; flex-direction: column; gap: 6px; }
.ls-confirm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ls-confirm-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; }
.ls-confirm-head > .grow, .ls-confirm-row > .grow { flex: 1 1 12em; min-width: 0; }
/* Karte «Lernspiegel»: neue Klassen auf beiden Seiten */
.ls-new { gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ls-new-group { display: flex; flex-direction: column; gap: 6px; }
.ls-new-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.ls-new-row > .grow { min-width: min(100%, 220px); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .ls-kid { grid-template-columns: minmax(0, 1fr); padding: 8px 10px; }
  .ls-kid-state { grid-row: 2; }
  .ls-kid .select { grid-row: 3; }
  .ls-sub { padding-left: 0; }
}
.ls-badge { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-3); cursor: pointer; vertical-align: middle; }
.ls-badge:hover, .ls-badge:focus-visible { background: var(--surface-3); }
.ls-badge.ls-ok { color: var(--success); }
.ls-badge.ls-skipped { color: var(--warn); }
.ls-badge.ls-failed { color: var(--danger); }

/* Buchungsseite der Eltern (parent-booking.js) */
.pb-main { max-width: 640px; margin: 0 auto; }
@media (max-width: 860px) { .pb-main { padding-top: 12px; } } /* Seite der Eltern: die Karte klebt nicht am oberen Rand */
.pb-card { display: flex; flex-direction: column; gap: 14px; }
.pb-card h1 { font-size: 1.45rem; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.pb-lead { margin: -6px 0 0; color: var(--text-2); font-size: 1.05rem; }
.pb-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pb-facts li { display: flex; align-items: flex-start; gap: 8px; }
.pb-facts .icon { color: var(--text-3); margin-top: 2px; flex: none; }
.pb-note { white-space: pre-line; }
/* lange Wörter und Adressen (Ort, Hinweis der Lehrperson) brechen um, statt über den Rand zu laufen */
.pb-lead, .pb-note, .pb-facts li > span { min-width: 0; overflow-wrap: anywhere; }
.pb-booked { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 12px; background: var(--success-soft); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); }
.pb-booked-label { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--success); }
.pb-booked-when { font-size: 1.2rem; font-weight: 700; }
.pb-booked-actions { gap: 8px; }
.pb-choose { display: flex; flex-direction: column; gap: 10px; }
.pb-choose h2 { font-size: 1.1rem; margin: 4px 0 0; }
.pb-choose > .small { margin: -6px 0 0; }
.pb-day h3 { font-size: .95rem; margin: 6px 0 8px; color: var(--text-2); }
.pb-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pb-time { justify-content: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.pb-foot { text-align: center; margin: 16px 0 8px; }
/* Link für alle: Name des Kindes im Fenster, danach der Hinweis auf den eigenen Link */
.pb-child-when { margin: 0; font-size: 1.05rem; font-weight: 700; }
.pb-child-error { margin: 0; color: var(--danger); font-size: .9rem; }
.pb-saved-text { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
/* Wunschzeiten: Zeiten antippen (gewählt mit Haken), Speichern bleibt beim Scrollen unten sichtbar */
.pb-pick { gap: 4px; }
.pb-pick .icon { display: none; }
.pb-pick.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.pb-pick.on:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.pb-pick.on .icon { display: inline-block; }
.pb-wish-save { position: sticky; bottom: 0; z-index: 1; gap: 12px; flex-wrap: nowrap; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
/* die Anzahl («Keine Zeit angekreuzt») bleibt rechts vom Knopf und bricht auf schmalen Handys dort um, statt darunter zu rutschen */
.pb-wish-save > .btn { flex: none; }
.pb-wish-save > span { min-width: 0; }
/* Meldungen oben: unten verdeckten sie die Leiste mit «Speichern» (sie klebt unten oder steht je nach Länge der Liste weiter oben) */
body:has(.pb-wish-save) .toasts { top: max(16px, env(safe-area-inset-top)); bottom: auto; }
.pb-wish-more { gap: 8px; margin-top: -4px; }
.pb-wished { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 12px; background: var(--success-soft); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); }
.pb-wished-label { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--success); }
.pb-wished-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.pb-wished-list li { font-variant-numeric: tabular-nums; }
.pb-wished-none { margin: 0; font-weight: 600; }
.pb-wished > p { margin: 0; }
/* Seite der Eltern: ohne Leiste oben, «Lehrerpult» ganz unten */
.pb-page { display: flex; flex-direction: column; }
.pb-page > .pb-main { flex: 1 0 auto; width: 100%; }
.pb-brand { display: flex; justify-content: center; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.pb-brand a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: .78rem; font-weight: 600; text-decoration: none; }
.pb-brand a:hover { color: var(--accent); }
.pb-brand .team-logo { width: 15px; height: 15px; border-radius: 4px; }

/* Tippziele mindestens 40 px: Knöpfe, Reiter, Felder und Zeilen werden so hoch; kleine Kästchen und Symbole behalten ihr
   Bild und bekommen eine grössere Fläche zum Antippen. Mit Maus und Touchpad bleibt alles, wie es ist. Im Kopf der Seite
   sind die Knöpfe auf dem Handy etwas kleiner (36 px, .page-head) */
@media (pointer: coarse) {
  .btn, .btn.sm, .tab, .seg-btn, .nav-link, .list-item, .group-toggle, .ov-week-day, .ov-week-short, .week-title, .task-folder-chip, button.chip, .sb-opt, .nm-item { min-height: 40px; }
  .btn.icon-only, .btn.sm.icon-only { min-width: 40px; }
  .input, .select { min-height: 40px; }
  /* Stellen, die auf dem Handy sonst kompakter sind */
  .select.sm, .student-table .input, .import-row .select { min-height: 40px; }
  /* Reihenfolge der Aufgaben: so klein gezeichnet wie mit der Maus, damit sie in der Zeile der Reiter Platz hat; die
     Tippfläche reicht darüber und darunter bis 44 px */
  .task-order .seg-btn { position: relative; min-height: 32px; min-width: 40px; justify-content: center; }
  .task-order .seg-btn::after { content: ''; position: absolute; inset: -6px 0; }
  /* Woche (Tablet): Werkzeuge als Ganzes in die zweite Zeile statt «…» allein darunter */
  .wn-tools { flex: 1 1 auto; flex-wrap: nowrap; }
  .checkbox { min-height: 40px; padding-block: calc((40px - 1.5em) / 2); } /* eine Zeile mittig, mehrere oben bündig */
  .people-pick { row-gap: 0; }
  .ss-menu, .ov-grip { width: 40px; height: 40px; margin-top: 0; }
  .task-check::after { inset: -11px; }
  .up-row > input { width: 24px; height: 24px; margin-top: 8px; }
  /* «Nicht mehr anhängen» im Datei-Chip: grösser, ohne den Chip höher zu machen */
  .chip-x { width: 32px; height: 32px; margin: -8px -10px -8px -4px; }
  /* «Rückgängig» in der Meldung: höhere Fläche, die Meldung bleibt gleich hoch */
  .toast-action { padding: 12px 10px; margin: -12px -10px -12px -2px; }
  /* kleine Ziele: grössere Fläche zum Antippen, ohne Bild und Abstände zu ändern */
  .notice-toggle, .crumbs a, .jn-comps button, .ls-badge, .info-tip, .jn-sit-grip, .up-use, .fb-crumbs a { position: relative; }
  :is(.notice-toggle, .crumbs a, .jn-comps button)::after { content: ''; position: absolute; inset: -10px 0; }
  /* Dateien: «Im Wissen», «Lektion …» unter der Datei und der Pfad im Ordner */
  :is(.up-use, .fb-crumbs a)::after { content: ''; position: absolute; inset: -7px 0; }
  :is(.ls-badge, .info-tip, .jn-sit-grip, .offline-pill.reload)::after { content: ''; position: absolute; inset: -8px; }
  button.cal-allday, .lf-chip { min-height: 36px; }
  .more-fields > summary, .nt-hit { min-height: 40px; }
  .jn-focus-more { min-width: 40px; justify-content: center; }
  /* Fusszeile auch auf dem Tablet mit höheren Links (Handy: siehe oben) */
  :is(.app-foot, .start-foot, .signin-foot) a { display: inline-flex; align-items: center; min-height: 32px; }
  .signin-row > a { display: inline-flex; align-items: center; min-height: 40px; } /* «Passwort vergessen?» so hoch wie das Kästchen daneben */
  details > summary { padding-block: 8px; } /* Aufklapper («Eigene Dropbox-App einrichten» …) höher zum Antippen */
  /* Ziehgriff der Aufgaben: grössere Fläche, ohne in die des Kästchens daneben zu reichen */
  .task-grip { position: relative; }
  .task-grip::after { content: ''; position: absolute; inset: -8px -2px -8px -8px; }
  .task.has-grip .task-check::after { left: -2px; }
  /* ohne Tastatur keine Tastenhinweise (Strg+K, Buchstaben und «Taste N» im Menü «Neu») */
  .nav-search kbd, .nm-panel kbd, .nm-foot { display: none; }
}
/* Ordner wählen (Aufgaben, Abhaklisten, Wissen): gewählte als Chips, dazu die Auswahl für einen weiteren */
.folder-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.folder-chips .chip { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.folder-chips-add { width: auto; max-width: 100%; min-width: 12rem; flex: 0 1 auto; }

/* ---------------------------------------------------------------- Belohnungssystem im Journal (journal-points.js, pointsdialog.js, pointsui.js) */
/* Farben der Einheit: die Farbe trägt --pt, Symbole sind gefüllt, verlorene ein gestrichelter Umriss */
.pt-c-grey { --pt: #8a919c; } .pt-c-gold { --pt: #e3a41b; } .pt-c-red { --pt: #e5484d; } .pt-c-orange { --pt: #f08a2e; }
.pt-c-green { --pt: #34a35a; } .pt-c-teal { --pt: #17958f; } .pt-c-blue { --pt: #3b7ff0; } .pt-c-violet { --pt: #8b5cf6; }
.pt-sym { width: 18px; height: 18px; flex: none; fill: var(--pt, var(--accent)); stroke: color-mix(in srgb, var(--pt, var(--accent)) 70%, #000); stroke-width: 1; stroke-linejoin: round; }
.pt-sym.lost { fill: none; stroke: var(--pt, var(--accent)); stroke-width: 1.5; stroke-dasharray: 2.5 2; opacity: .75; }
.pt-sym .pt-face { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }
.pt-sym.lost .pt-face { stroke: var(--pt); stroke-dasharray: none; }
.pt-sym .pt-shine { fill: none; stroke: rgba(255, 255, 255, .75); stroke-width: 1.6; stroke-linecap: round; }
.pt-sym.lost .pt-shine { display: none; }
.pt-sym .pt-core { fill: #fff; stroke: none; opacity: .85; }
.pt-sym.lost .pt-core { fill: none; stroke: var(--pt); opacity: 1; }
.pt-sym .pt-ray { fill: none; stroke: var(--pt, var(--accent)); stroke-width: 2.2; stroke-linecap: round; }
.pt-sym.lost .pt-ray { stroke-width: 1.5; stroke-dasharray: none; }
.pt-emoji { display: inline-block; width: auto; height: auto; font-size: 16px; line-height: 1; fill: none; stroke: none; }
.pt-emoji.lost { opacity: .3; filter: grayscale(1); }
.pt-stand { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.pt-syms { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.pt-num { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.pt-num.neg { color: var(--danger); }
.pt-stand.big { justify-content: center; }
.pt-stand.big .pt-sym { width: 30px; height: 30px; }
.pt-stand.big .pt-emoji { font-size: 28px; }
.pt-stand.big .pt-num { font-size: 1.6rem; }
.pt-delta { display: inline-block; min-width: 2.2em; padding: 1px 6px; border-radius: 999px; font-size: .78rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.pt-delta.minus { background: var(--danger-soft); color: var(--danger); }
.pt-delta.plus { background: var(--success-soft); color: var(--success); }
.pt-delta.none { background: var(--surface-3); color: var(--text-3); }

/* Reiter: Kopf mit Zeitraum, Werkzeuge, Kacheln */
.pt-head-card { margin-bottom: 10px; }
.pt-systems { display: flex; justify-content: center; padding: 8px 10px 0; }
.pt-systems .seg { max-width: 100%; overflow-x: auto; }
.pt-systems .seg-btn { white-space: nowrap; }
.pt-systems-off { font-weight: 400; color: var(--text-3); }
.pt-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.pt-head-text { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; text-align: center; }
.pt-tools { margin: 10px 0; }
.pt-grid-kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pt-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 84px; padding: 10px 12px; overflow: hidden;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pt-tile:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.pt-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-tile.selected { border-color: var(--accent); background: var(--accent-soft); }
.pt-tile-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.pt-tile-name .jn-num { color: var(--text-3); font-variant-numeric: tabular-nums; font-weight: 600; }
.pt-goals { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-weight: 600; }
.pt-today { display: flex; flex-direction: column; gap: 1px; font-size: .76rem; color: var(--text-3); }
.pt-today .minus { color: var(--danger); }
.pt-today .plus { color: var(--success); }
.pt-selbar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); }
.pt-off { margin-top: 18px; }
.pt-off h3 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.pt-off-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-off-list .chip { gap: 8px; }

/* Blatt eines Kindes: Stand, grosse Knöpfe, Regeln als Chips, Verlauf */
.pt-sheet { width: min(560px, 100%); }
.pt-sheet-stand { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; text-align: center; }
.pt-big-buttons { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.pt-big { display: flex; align-items: center; justify-content: center; gap: 6px; height: 56px; border: 1px solid transparent; border-radius: 14px; font: inherit;
  font-size: 1.3rem; font-weight: 700; cursor: pointer; }
.pt-big .icon { width: 24px; height: 24px; }
.pt-big.minus { background: var(--danger-soft); color: var(--danger); }
.pt-big.plus { background: var(--success-soft); color: var(--success); }
.pt-big:hover { border-color: currentColor; }
.pt-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pt-chips-label { flex-basis: 100%; font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.pt-rule-chip { gap: 6px; padding: 6px 12px; font-size: .88rem; }
.pt-rule-chip strong { font-variant-numeric: tabular-nums; }
.pt-rule-chip.minus { background: var(--danger-soft); color: var(--danger); }
.pt-rule-chip.plus { background: var(--success-soft); color: var(--success); }
.pt-rule-chip:hover { border-color: currentColor; }
.pt-note { min-height: 40px; resize: vertical; }
.pt-changes, .pt-card-changes { display: flex; flex-direction: column; }
.pt-card-changes { margin-top: 6px; }
.pt-change { display: grid; grid-template-columns: auto auto 1fr auto; align-items: baseline; gap: 4px 10px; padding: 6px 0; border-top: 1px solid var(--border); font-size: .86rem; }
.pt-change.none { color: var(--text-3); }
.pt-change-when { color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-change-main { min-width: 0; overflow-wrap: anywhere; }
.pt-change-note { display: block; color: var(--text-2); }
.pt-change-author { display: block; font-size: .78rem; color: var(--text-3); }
.pt-change .btn { align-self: center; }

/* Fenster «Belohnungssystem …» */
.pt-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pt-template { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pt-template:hover, .pt-template:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface)); }
.pt-template-sym { display: flex; gap: 3px; margin-bottom: 4px; }
.pt-template-sym .pt-sym { width: 22px; height: 22px; }
.pt-template-last { border-style: dashed; }
.pt-chosen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text-2); }
.pt-guide summary { display: flex; align-items: center; gap: 6px; font-weight: 650; color: var(--text-2); cursor: pointer; }
.pt-guide ul { margin: 6px 0 0; padding-left: 20px; color: var(--text-2); font-size: .88rem; }
.pt-card { padding: 0; }
.pt-card.collapsed { box-shadow: none; }
.pt-card-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pt-card-head strong { white-space: nowrap; }
.pt-card-head .card-summary { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.pt-card > .card-body { padding: 0 14px 14px; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.pt-grid-4 { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.pt-symbols { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-symbol-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text); font: inherit; font-size: .86rem; cursor: pointer; }
.pt-symbol-btn.active { border-color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.pt-emoji-input { max-width: 120px; margin-top: 6px; }
.pt-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pt-color { width: 28px; height: 28px; padding: 0; border: 2px solid var(--surface); border-radius: 50%; background: var(--pt); box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.pt-color.active { box-shadow: 0 0 0 2px var(--accent); }
.pt-color.auto { width: auto; padding: 0 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font: inherit; font-size: .78rem; font-weight: 650; }
.pt-sample { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.pt-preview { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); }
.pt-preview.error { background: var(--danger-soft); }
.pt-dates { display: flex; flex-direction: column; gap: 6px; }
.pt-date-row { display: flex; align-items: center; gap: 6px; }
.pt-date-row .input { width: auto; }
.pt-rule-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 4px; border-bottom: 2px solid; }
.pt-rule-head.minus { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.pt-rule-head.plus { border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.pt-rules { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.pt-rule { display: grid; grid-template-columns: auto 64px minmax(140px, 1fr) minmax(140px, 1fr) auto auto auto; align-items: center; gap: 6px; }
.pt-rule.hidden-rule { opacity: .55; }
.pt-rule.dragging { opacity: .6; }
.pt-rule-grip { display: inline-grid; place-items: center; color: var(--text-3); cursor: grab; touch-action: none; }
.pt-rule-journal { font-size: .82rem; white-space: nowrap; }
.pt-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pt-suggest-chip.minus { color: var(--danger); }
.pt-suggest-chip.plus { color: var(--success); }
.pt-switches { display: flex; flex-direction: column; gap: 10px; }
.pt-switch small { display: block; margin: 2px 0 0 50px; }
.pt-inline { display: flex; align-items: center; gap: 8px; margin-left: 50px; }
.pt-inline .select { width: auto; }
.pt-kids { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow: auto; }
.pt-kid-row { display: grid; grid-template-columns: 1fr 90px 90px; align-items: center; gap: 8px; }
.pt-kid-row.off .checkbox span { color: var(--text-3); }
.pt-kid-head { font-weight: 650; }
.pt-end-opt { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
/* Eigene Vorlagen und «Stufen am Ende» */
.pt-own-title { margin: 6px 0 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.pt-template-wrap { position: relative; display: flex; }
.pt-template-wrap .pt-template { flex: 1; padding-right: 40px; }
.pt-template-own { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.pt-template-more { position: absolute; top: 6px; right: 6px; }
.pt-levels { display: flex; flex-direction: column; gap: 6px; }
.pt-level { display: grid; grid-template-columns: 112px 92px 110px minmax(120px, 1fr) auto; align-items: center; gap: 6px; }
.pt-level-chip { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 2px 8px; border-radius: 999px; font-weight: 700; white-space: nowrap;
  font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--pt) 18%, var(--surface)); color: color-mix(in srgb, var(--pt) 70%, var(--text)); }
.pt-level-to { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pt-level-to .input { width: 64px; }
.pt-level-color { width: auto; }
/* Verteilung im Reiter und Abschluss */
.pt-dot { display: inline-block; width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--pt, var(--accent)); }
.pt-dist { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; width: 100%; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; text-align: left; cursor: pointer; }
.pt-dist:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.pt-dist-item { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.pt-dist-more { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; color: var(--text-3); }
.pt-close-group { padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--pt, var(--accent)); border-radius: 10px; }
.pt-close-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 8px; }
.pt-close-n { margin-left: auto; }
.pt-close-kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.pt-close-kid { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
/* Drucken: Kreise statt Symbolen (das PDF zeichnet Rahmen und Flächen, keine SVG) */
.pt-pstand { display: inline-flex; align-items: center; gap: 6px; }
.pt-pdots { display: inline-flex; flex-wrap: wrap; gap: 1.2mm; vertical-align: middle; }
.pt-pdot { display: inline-block; width: 3.2mm; height: 3.2mm; border: .3mm solid var(--pt, #1f5f73); border-radius: 50%; background: var(--pt, #1f5f73); box-sizing: border-box; }
.pt-pdot.lost { background: #fff; }
.pt-strike .pt-pdot { width: 4.6mm; height: 4.6mm; border-width: .35mm; }
.pt-print h2 { display: flex; align-items: center; gap: 2mm; font-size: 12.5pt; margin: 5mm 0 2mm; }
.pt-print .ss-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .82rem; }
.pt-print .ss-table th { text-align: left; padding: 5px 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: .76rem; }
.pt-print .ss-table td { padding: 5px 8px; border: 1px solid var(--border); vertical-align: middle; overflow-wrap: anywhere; }
.pt-strike td { height: 11mm; }
.pt-print-kids { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2mm; }
.pt-print-kid { display: flex; flex-direction: column; gap: 1.5mm; padding: 2.5mm 3mm; border: 1px solid var(--border); border-radius: 2mm; font-size: 11pt; font-weight: 650; }

/* Seite eines Kindes: Karte über den Kompetenzen */
.pt-kid-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; margin-bottom: 12px; }
.pt-kid-stand { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pt-bars { display: flex; align-items: flex-end; gap: 4px; height: 64px; }
.pt-bar { display: flex; flex-direction: column-reverse; align-items: center; justify-content: flex-start; gap: 2px; flex: 0 0 20px; height: 100%; }
.pt-bar-fill { width: 100%; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--accent) 75%, transparent); }
.pt-bar-fill[class*="pt-c-"] { background: color-mix(in srgb, var(--pt) 80%, transparent); }
.pt-bar-num { font-size: .7rem; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Übersicht (Karte «Journal») und Tagesrückblick: Steine von heute, Abschluss nach einem Neubeginn */
.ov-points-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.ov-points { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: .9rem; }
.ov-points > a:first-child { font-weight: 650; }
.ov-points-close { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: .86rem; }
.dr-points { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.dr-points-class { display: flex; flex-direction: column; gap: 6px; }
.dr-points-class .dr-focus-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.dr-points-link { margin-left: auto; font-size: .86rem; }
.dr-points-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* Dialog «Eintrag»: Steine zur Situation, antippen nimmt sie für diesen Eintrag weg */
.jn-points { display: flex; flex-wrap: wrap; gap: 6px; }
.jn-point { gap: 5px; padding: 4px 10px; font-size: .84rem; }
.jn-point.active.minus { background: var(--danger-soft); color: var(--danger); }
.jn-point.active.plus { background: var(--success-soft); color: var(--success); }
.jn-point:not(.active) { background: none; border-color: var(--border); color: var(--text-3); text-decoration: line-through; }

@media (max-width: 640px) {
  .pt-grid-kids { grid-template-columns: 1fr; gap: 6px; }
  .pt-tile { flex-direction: row; flex-wrap: wrap; align-items: center; min-height: 0; padding: 8px 10px; }
  .pt-tile-name { flex: 1 1 auto; }
  .pt-today, .pt-goals { flex-basis: 100%; }
  .pt-head { padding: 6px; }
  .modal-backdrop:has(> .modal.pt-sheet) { place-items: end center; padding: 0; }
  .modal.pt-sheet { width: 100%; max-height: 94dvh; border-radius: 16px 16px 0 0; animation: jn-sheet .2s ease-out; }
  .modal.pt-sheet .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .pt-rule { grid-template-columns: auto 56px 1fr auto auto; }
  .pt-rule .pt-rule-hide, .pt-rule .pt-rule-del { order: 1; }
  .pt-rule .pt-rule-sit { order: 2; grid-column: 2 / -1; }
  .pt-rule .pt-rule-journal { order: 3; grid-column: 2 / -1; }
  .pt-kid-row { grid-template-columns: 1fr 70px 70px; }
  .pt-level { grid-template-columns: auto minmax(0, 1fr) auto; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
  .pt-level > * { grid-row: 1; }
  .pt-level .pt-level-color { grid-row: 2; grid-column: 1; width: 100%; }
  .pt-level .pt-level-text { grid-row: 2; grid-column: 2 / -1; min-width: 0; }
  .pt-close-kids { grid-template-columns: 1fr; }
  .pt-switch small, .pt-inline { margin-left: 0; }
  .pt-inline { flex-wrap: wrap; }
  .pt-inline .select, .pt-inline .input { flex: 1 1 100%; min-width: 0; }
  .pt-card-head .card-summary { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .modal.pt-sheet { animation: none; }
}

/* Seite «Sitzplan» (pages/seating.js): Raum mit Plätzen, Sicht der Klasse oder der Lehrperson, Bearbeiten, Regeln */
.st-sub { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.st-card { margin-bottom: 18px; }
.st-chips, .st-missing { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.st-missing { margin: 0; }
.st-chips .chip, .st-missing .chip { cursor: pointer; padding: 4px 11px; font-size: .84rem; }
.st-chips .chip.active, .st-missing .chip.active { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); }
.st-room { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 780px; margin: 0 auto; container-type: inline-size; }
.st-view { display: flex; align-items: center; gap: 10px; }
.st-view .seg { width: auto; }
.st-board { align-self: center; min-width: 7.5em; padding: 5px 0; border-radius: 8px; background: var(--surface-3); color: var(--text-2); text-align: center; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.st-area { position: relative; width: 100%; }
.st-desk { position: absolute; border-radius: 6px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.st-seat { position: absolute; display: flex; align-items: center; justify-content: center; padding: 0 3px; border: 0; border-radius: 8px; background: var(--surface); color: var(--text);
  box-shadow: 0 0 0 1.5px var(--border-strong, var(--border)); font-weight: 600; line-height: 1.1; text-align: center; overflow: hidden; touch-action: manipulation;
  /* Schrift nach der Breite des Platzes; ein langer Name (--n: seine Breite in em auf zwei Zeilen, drawRoom()) wird kleiner */
  font-size: max(6px, min(clamp(9px, calc(100cqi / var(--cols) / 6), var(--st-fs, 16px)), calc((100cqi / var(--cols) - 8px) / var(--n, 1)))); }
/* umbrechen nur beim Leerschlag oder Bindestrich, nie mitten im Wort; eine dritte Zeile nur, wenn die kleinste Schrift nicht reicht */
.st-seat span { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: normal; }
/* langes Drücken hebt das Kind an (Ziehen mit dem Finger), ohne Textauswahl oder Menü des Browsers */
button.st-seat { cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.st-seat.lifted { box-shadow: 0 0 0 3px var(--accent); transform: scale(1.06); z-index: 1; }
.st-seat.empty { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border); }
.st-seat.blocked { background: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--text) 9%, transparent) 6px 12px); box-shadow: inset 0 0 0 1.5px var(--border); }
.st-seat.picked { box-shadow: 0 0 0 3px var(--accent); background: var(--accent-soft); }
.st-seat.drop { box-shadow: 0 0 0 3px var(--accent); }
.st-seat.dragging { opacity: .35; }
.st-seat.pinned .icon { position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; opacity: .85; }
/* Kind, das nicht mehr aktiv ist: Name blass und kursiv */
.st-seat.former { color: var(--text-3); font-style: italic; }
.st-ghost { position: fixed; z-index: 1000; pointer-events: none; padding: 4px 10px; border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-md, 0 8px 22px rgba(0,0,0,.25)); font-weight: 600; }
.st-pickbar { margin-top: 0; }
/* Name und Platz kürzen statt umbrechen: die Leiste bleibt auch auf dem Handy eine Zeile */
.st-pick-who { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: .88rem; }
.st-warn ul { margin: 4px 0 0; padding-left: 18px; }
.st-ok { display: flex; align-items: center; gap: 6px; color: var(--success); }
/* Plan: leere und gesperrte Plätze sind keine Knöpfe; Zeile «… Regeln aus dem Vorjahr: noch nötig?» in Plan und Editor */
button.st-seat:disabled { cursor: default; }
.st-carried { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.st-carried .icon { flex: none; }
.card-pad > .st-carried { margin-bottom: 4px; }
.st-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.st-rule { gap: 8px; align-items: center; }
.st-rule-acts { display: flex; align-items: center; gap: 8px; }
.st-plan-acts { flex-wrap: nowrap; }
/* Handy: «Wieder verwenden …» bzw. «Ändern ab …» ohne Symbol und engere Lücken, damit die Leiste in einer Zeile bleibt */
@media (max-width: 640px) { .st-plan-acts { gap: 4px; } .st-plan-acts .st-from > .icon { display: none; } }
/* Regel mit einem Kind, das nicht mehr aktiv ist: wirkt nicht */
.st-rule.gone > .grow { color: var(--text-3); }
.st-rule-search { max-width: 280px; }
.st-card .field .select { max-width: 340px; }
.st-strength { width: auto; min-width: 0; padding: 4px 8px; font-size: .84rem; }
.st-seat.st-mini { font-size: 0; }
/* eigene Anordnung beim Ziehen: Raster (halber Platz) und Hilfslinien wie im Screen */
.st-grid { position: absolute; inset: 0; pointer-events: none; }
.st-grid svg { display: block; width: 100%; height: 100%; overflow: visible; }
.st-grid line.g { stroke: var(--border); stroke-width: 1; stroke-opacity: .7; }
.st-guides { z-index: 2; }
.st-guides line.snap { stroke: #ec4899; stroke-width: 2; }
/* scroll-margin: in den Blick geholt (Tastatur, neuer Tisch), steht ein Tisch nicht unter der haftenden Leiste (.st-freebar) */
.st-handle { position: absolute; padding: 0; border: 0; border-radius: 10px; background: none; cursor: grab; touch-action: none; outline: 1.5px dashed transparent; outline-offset: 0; scroll-margin-top: 64px; }
.st-handle:hover { outline-color: var(--border-strong, var(--border)); }
.st-handle:active { cursor: grabbing; }
.st-handle.sel { outline: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.st-handle.bad { outline: 2px solid var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); } /* liegt beim Ziehen auf einem anderen Tisch */
.st-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.st-handle b { position: absolute; top: -8px; left: -8px; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--surface); color: var(--text-2); box-shadow: 0 0 0 1px var(--border); font-size: .7rem; line-height: 18px; text-align: center; }
.st-handle.sel b { background: var(--accent); color: var(--on-color, #fff); box-shadow: none; }
.st-typeseg { display: flex; }
.st-hist-list { display: grid; }
.st-hist { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.st-hist:first-child { border-top: 0; padding-top: 0; }
.st-hist-pic { display: block; width: 150px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.st-hist-pic:hover { border-color: var(--accent); }
.st-hist-pic .st-room { gap: 4px; }
.st-hist-pic .st-board { padding: 1px 0; font-size: 0; }
.st-hist-pic .st-seat { box-shadow: inset 0 0 0 1px var(--border); border-radius: 3px; }
.st-hist-pic .st-seat:not(.empty) { background: var(--accent-soft); }
.st-hist-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-hist-kid .select { max-width: 280px; }
.st-fb { flex-wrap: wrap; gap: 6px 10px; }
/* «Als Regel» links der Auswahl; reicht der Platz nicht, darunter (wrap-reverse, oben ausgerichtet): die Auswahl bleibt stehen */
.st-fb-acts { display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; align-items: flex-end; gap: 6px; }
@media (max-width: 767px) { .st-fb > .grow { flex-basis: 100%; } }
@media (max-width: 400px) { .st-fb .seg-btn .icon, .st-fb-acts > .btn .icon { display: none; } .st-fb .seg-btn { padding-inline: 8px; } }
.st-fb .seg-btn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.st-fb .seg-btn.st-fb-good.active { background: var(--success-soft, var(--accent-soft)); color: var(--success); }
.st-fb .seg-btn.st-fb-bad.active { background: var(--danger-soft, var(--warn-soft)); color: var(--danger); }
.chip.st-fb-good { color: var(--success); }
.chip.st-fb-bad { color: var(--danger); }
.st-mixbar { align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.st-mixbar .checkbox { margin: 0; }
/* ‹ Mischen › und die Angabe zur gezeigten Mischung; Vorschläge unter «Gilt ab» */
.st-mixnav { display: inline-flex; align-items: center; gap: 2px; }
.st-days { margin: 2px 0 0; }
/* «Alle Paare»: Kind × Kind */
.st-matrix-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: 10px; }
.st-matrix { border-collapse: separate; border-spacing: 0; font-size: .8rem; }
.st-matrix th, .st-matrix td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.st-matrix thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); vertical-align: bottom; padding: 6px 0; font-weight: 600; }
.st-matrix thead th span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); max-height: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-matrix tbody th { position: sticky; left: 0; background: var(--surface); text-align: left; padding: 0 8px; white-space: nowrap; font-weight: 600; }
.st-matrix thead th:first-child { left: 0; z-index: 2; }
.st-matrix tbody th .linklike { font: inherit; color: inherit; }
.st-matrix td { width: 28px; min-width: 28px; height: 28px; text-align: center; color: var(--text-2); }
.st-matrix td.self { background: var(--surface-3); }
.st-matrix td.sat { background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }
.st-matrix td.good { background: var(--success-soft); color: var(--success); }
.st-matrix td.bad { background: var(--danger-soft); color: var(--danger); }
.st-matrix tr:hover > td:not(.self) { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--text) 4%, transparent); }
.st-matrix-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
/* gedruckt: feste helle Farben, kleinere Felder, nichts klebt */
.st-matrix.print { font-size: .8rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.st-matrix.print th, .st-matrix.print td { border-color: #d1d5db; }
.st-matrix.print thead th, .st-matrix.print tbody th { position: static; background: #fff; color: #111827; }
.st-matrix.print thead th { border-top: 1px solid #d1d5db; }
.st-matrix.print tr > :first-child { border-left: 1px solid #d1d5db; }
.st-matrix.print td { width: 28px; min-width: 28px; height: 26px; color: #374151; }
.st-matrix.print td.self { background: #e5e7eb; }
.st-matrix.print td.sat { background: #dbeafe; color: #1e3a8a; }
.st-matrix.print td.good { background: #dcfce7; color: #166534; }
.st-matrix.print td.bad { background: #fee2e2; color: #991b1b; }
.st-matrix-nr { display: inline-block; min-width: 1.7em; color: #6b7280; font-weight: 500; }
.st-matrix-name { display: inline-block; max-width: 14em; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.st-print .st-matrix-legend { margin-top: 10px; color: #4b5563; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.st-print .st-matrix-legend i.sat { background: #dbeafe; }
.st-print .st-matrix-legend i.good { background: #dcfce7; }
.st-print .st-matrix-legend i.bad { background: #fee2e2; }
.st-matrix-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.st-matrix-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-matrix-legend i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border); }
.st-matrix-legend i.sat { background: var(--accent-soft); }
.st-matrix-legend i.good { background: var(--success-soft); }
.st-matrix-legend i.bad { background: var(--danger-soft); }
@media (max-width: 560px) {
  .st-hist { grid-template-columns: 96px minmax(0, 1fr); }
  .st-hist-pic { width: 96px; padding: 4px; }
  .st-hist .btn-group { grid-column: 1 / -1; }
}
@media (max-width: 560px) { .st-typeseg { display: grid; grid-template-columns: 1fr 1fr; } }
/* eigene Anordnung: Leiste des gewählten Tisches über dem Raum; haftet oben im Fenster (bündig, auch über dem Rand von
   .modal-body), so bleiben ihre Knöpfe beim Raum. Schmal hat sie zwei Zeilen: Tische, die in den Blick kommen, weiter unten */
.st-freebar { position: sticky; top: -18px; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 0 10px; background: var(--surface); }
@media (max-width: 640px) { .st-handle { scroll-margin-top: 116px; } }
@media (max-width: 420px) { .st-freebar { top: -14px; } }
.st-stepper { display: inline-flex; align-items: center; gap: 4px; }
/* gedruckt: die Breite begrenzt printPlan() (eine Seite); Rahmen statt Schatten und Wandtafel ohne Grossbuchstaben, wie im PDF */
.st-print .st-room { max-width: none; }
.st-print .st-seat { --st-fs: 15px; box-shadow: none; border: 1px solid #9ca3af; }
.st-print .st-board { background: #e5e7eb; color: #374151; text-transform: none; letter-spacing: 0; }
@media (max-width: 640px) {
  .st-foot { padding: 12px 14px; }
  .st-foot .btn { flex: 1 1 auto; }
  .st-board { font-size: .66rem; }
}
/* Hervorhebung auf dem Papier: das Übrige blass, aber lesbar */
.print-sheet .subject-on .wg-cell > :not(.hit, .wg-add) { opacity: .4; }
/* Stundenplan «Für die Klasse» (Druck): nur das Fach, etwas grösser; ganze Wörter (fitWords() setzt lange kleiner) statt
   Trennungen wie «Ma-the-matik» in den schmalen Spalten der Halbklassen */
.print-sheet .wg-lesson.for-class { font-size: .78rem; padding: 5px 6px 5px 9px; hyphens: manual; overflow-wrap: break-word; }
.print-sheet .wg-lesson.for-class .g { font-size: .8em; font-weight: 500; margin-top: 1px; }
