/* Der Brief ist docs/DESIGN.md, die Werte stehen dort in §5. Die Stunde teilt sich die Höhe des
   Rasters (Prozent, kein Skript beim Größerziehen), die Kacheln beschriften Container-Abfragen. */

:root {
  color-scheme: light dark;
  /* Die Flächen und Schriften des Study Style (SP-0420, Silas 18.10.2026: der Styleguide des Study OS):
     hell „dieselbe Ordnung auf Papier“, ein Hauch Tiefblau statt Grau. Werte und Kontraste: DESIGN §5.2, §5.5. */
  --grau-1: #fcfcfd; --grau-2: #f1f2f6; --grau-3: #e8eaf0; --grau-4: #e1e3e8; --grau-5: #d6d8de;
  --grau-6: #bec1c8; --grau-7: #7a8192; --grau-8: #6b7283; --grau-9: #4a5060; --grau-10: #14161c;
  --konflikt: #cc2827; --konflikt-text: #a51f1e; --konflikt-flaeche: #ffebe8;
  --hinweis: #c17a00; --hinweis-text: #7b4c00; --hinweis-flaeche: #fef0d4;
  /* Rollen (V-0236, §5.2). Der Fuß tritt zurück (V-0237), seit V-0243 und V-0246 noch blasser (Silas:
     „noch ein bisschen blasser“): hell #707274 (4,55:1), dunkel #7c7d80 (4,56:1). Blasser geht nicht:
     Darunter fiele kleiner Text unter 4,5:1 (WCAG AA, §5.5), und ops/sicht.py würde rot. */
  --fuss-text: #676e7f;
  --ebene: #ffffff;
  --rand-ebene: var(--grau-5);
  --schatten: 0 1px 2px rgb(16 20 32 / .06), 0 8px 24px rgb(16 20 32 / .12);
  /* Das Neon des Study OS (Violett, gewählt dort am 11.09.2026), hell eine Stufe tiefer wie im Study Style.
     Es gehört der Marke und der Navigation: Zeichen, „planner“, Reiter, gewähltes Segment, Fortschritt,
     Hauptaktion, Wege in Karten. Nie dem Plan (Kacheln, Formate, Modulkacheln, Legende): Dort trägt
     Farbe das Modul (DESIGN §5.1, web/tests/farben.test.mjs). */
  --neon: #7a44e0; --neon-schrift: #6a34d6; --neon-flaeche: #6529d4; --neon-text: #ffffff;
  --neon-weich: rgb(122 68 224 / .16); --raum-linie: rgb(16 20 32 / .035); --raum-licht: rgb(122 68 224 / .07);
  --r-1: 6px; --r-2: 10px; --r-3: 14px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Cascadia Mono", Consolas, monospace;
  --ein: cubic-bezier(.2, 0, 0, 1);
  --aus: cubic-bezier(.3, 0, 1, 1);
  --h-min: 20.5px;
  --ziel: 32px;
  --zm: 28px;
  --rand-x: 24px;
  --m1-hauch: #fcfcfd; --m1-rand: #488acb; --m1-flaeche: #b4d8ff; --m1-tinte: #0e375c;
  --m2-hauch: #fcfcfd; --m2-rand: #ac7d1b; --m2-flaeche: #eecf9c; --m2-tinte: #483000;
  --m3-hauch: #fcfcfd; --m3-rand: #4a9a5e; --m3-flaeche: #b2e3bb; --m3-tinte: #0d401e;
  --m4-hauch: #fcfcfd; --m4-rand: #bb6690; --m4-flaeche: #fbc1db; --m4-tinte: #53223b;
  --m5-hauch: #fcfcfd; --m5-rand: #03999f; --m5-flaeche: #98e4e8; --m5-tinte: #003e41;
  --m6-hauch: #fcfcfd; --m6-rand: #9274c3; --m6-flaeche: #dbcaff; --m6-tinte: #3c2a58;
  --m7-hauch: #fcfcfd; --m7-rand: #bf6e3e; --m7-flaeche: #fec7a9; --m7-tinte: #552707;
  --m8-hauch: #fcfcfd; --m8-rand: #848e2d; --m8-flaeche: #d2dba2; --m8-tinte: #343900;
  /* Eingeplant und Vorschlag je Schema (Silas, 05.10.2026, V-0251): Hell war eingeplant die Tinte, eine
     dunkle, „matschige“ Fläche mit weißer Schrift; jetzt die Pastellfläche wie die Formate links, mit
     Tinte als Schrift, und der Vorschlag noch heller (halb Fläche, halb Weiß). Dunkel bleibt, wie es war. */
  --m1-wahl: var(--m1-flaeche); --m1-wahl-text: var(--m1-tinte); --m1-vor: #d9ebff;
  --m2-wahl: var(--m2-flaeche); --m2-wahl-text: var(--m2-tinte); --m2-vor: #f6e6ce;
  --m3-wahl: var(--m3-flaeche); --m3-wahl-text: var(--m3-tinte); --m3-vor: #d8f0dd;
  --m4-wahl: var(--m4-flaeche); --m4-wahl-text: var(--m4-tinte); --m4-vor: #fcdfed;
  --m5-wahl: var(--m5-flaeche); --m5-wahl-text: var(--m5-tinte); --m5-vor: #caf1f4;
  --m6-wahl: var(--m6-flaeche); --m6-wahl-text: var(--m6-tinte); --m6-vor: #ece4ff;
  --m7-wahl: var(--m7-flaeche); --m7-wahl-text: var(--m7-tinte); --m7-vor: #fee2d2;
  --m8-wahl: var(--m8-flaeche); --m8-wahl-text: var(--m8-tinte); --m8-vor: #e8ecd1;
  --lg-wahl: var(--m1-flaeche);
  font: 14px/20px system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
/* Dunkel (V-0236, §5.2): vier Flächen, je höher, desto heller. Seit SP-0420 die Ebenen des Study OS,
   Tiefblau-Schwarz: Seite 0,13 (E0), eingelassen 0,17, erhöht 0,19 (E2), schwebend 0,22 (E3). Die mögliche Kachel ist neutral (vorher je Modul getönt, ein
   Flickenteppich), eingeplant die hellste Fläche. Hier stehen NUR Tokens (web/tests/farben). */
@media (prefers-color-scheme: dark) {
  :root {
    --grau-1: #11141b; --grau-2: #06070a; --grau-3: #0e1016; --grau-4: #1a1d26; --grau-5: #232733;
    --grau-6: #3d4352; --grau-7: #5e6678; --grau-8: #7c8496; --grau-9: #a4acbd; --grau-10: #e9ecf2;
    --konflikt: #ef675c; --konflikt-text: #f8a59b; --konflikt-flaeche: #3b1c19;
    --hinweis: #e9b452; --hinweis-text: #e9ca89; --hinweis-flaeche: #31240e;
    --fuss-text: #768092;
    --ebene: #181b24;
    --rand-ebene: rgb(255 255 255 / .1);
    --schatten: none;
    --neon: #a06bff; --neon-schrift: #c29bff; --neon-flaeche: #b48aff; --neon-text: #120621;
    --neon-weich: rgb(160 107 255 / .28); --raum-linie: rgb(255 255 255 / .019); --raum-licht: rgb(160 107 255 / .14);
    --m1-hauch: #11141b; --m1-rand: #70a3d8; --m1-flaeche: #233c56; --m1-tinte: #bad8f8;
    --m2-hauch: #11141b; --m2-rand: #bd9857; --m2-flaeche: #4a3716; --m2-tinte: #e8d1ac;
    --m3-hauch: #11141b; --m3-rand: #72af7f; --m3-flaeche: #24432b; --m3-tinte: #bcdfc2;
    --m4-hauch: #11141b; --m4-rand: #cb86a7; --m4-flaeche: #502e3f; --m4-tinte: #f2c6d9;
    --m5-hauch: #11141b; --m5-rand: #48b0b6; --m5-flaeche: #0a4346; --m5-tinte: #aae0e2;
    --m6-hauch: #11141b; --m6-rand: #a791d1; --m6-flaeche: #3f3453; --m6-tinte: #d9cdf4;
    --m7-hauch: #11141b; --m7-rand: #ce8d68; --m7-flaeche: #52321f; --m7-tinte: #f3cbb5;
    --m8-hauch: #11141b; --m8-rand: #9ca65f; --m8-flaeche: #3a3e1a; --m8-tinte: #d2d9b0;
    --m1-wahl: var(--m1-tinte); --m1-wahl-text: var(--grau-1); --m1-vor: var(--m1-flaeche);
    --m2-wahl: var(--m2-tinte); --m2-wahl-text: var(--grau-1); --m2-vor: var(--m2-flaeche);
    --m3-wahl: var(--m3-tinte); --m3-wahl-text: var(--grau-1); --m3-vor: var(--m3-flaeche);
    --m4-wahl: var(--m4-tinte); --m4-wahl-text: var(--grau-1); --m4-vor: var(--m4-flaeche);
    --m5-wahl: var(--m5-tinte); --m5-wahl-text: var(--grau-1); --m5-vor: var(--m5-flaeche);
    --m6-wahl: var(--m6-tinte); --m6-wahl-text: var(--grau-1); --m6-vor: var(--m6-flaeche);
    --m7-wahl: var(--m7-tinte); --m7-wahl-text: var(--grau-1); --m7-vor: var(--m7-flaeche);
    --m8-wahl: var(--m8-tinte); --m8-wahl-text: var(--grau-1); --m8-vor: var(--m8-flaeche);
    --lg-wahl: var(--grau-10);
  }
}
/* Ein Modul bekommt seine Farbe über die Klasse m1 … m8 (Stelle im Plan, reihum, §5.3). */
.m1 { --hauch: var(--m1-hauch); --rand: var(--m1-rand); --flaeche: var(--m1-flaeche); --tinte: var(--m1-tinte); --wahl: var(--m1-wahl); --wahl-text: var(--m1-wahl-text); --vor: var(--m1-vor); }
.m2 { --hauch: var(--m2-hauch); --rand: var(--m2-rand); --flaeche: var(--m2-flaeche); --tinte: var(--m2-tinte); --wahl: var(--m2-wahl); --wahl-text: var(--m2-wahl-text); --vor: var(--m2-vor); }
.m3 { --hauch: var(--m3-hauch); --rand: var(--m3-rand); --flaeche: var(--m3-flaeche); --tinte: var(--m3-tinte); --wahl: var(--m3-wahl); --wahl-text: var(--m3-wahl-text); --vor: var(--m3-vor); }
.m4 { --hauch: var(--m4-hauch); --rand: var(--m4-rand); --flaeche: var(--m4-flaeche); --tinte: var(--m4-tinte); --wahl: var(--m4-wahl); --wahl-text: var(--m4-wahl-text); --vor: var(--m4-vor); }
.m5 { --hauch: var(--m5-hauch); --rand: var(--m5-rand); --flaeche: var(--m5-flaeche); --tinte: var(--m5-tinte); --wahl: var(--m5-wahl); --wahl-text: var(--m5-wahl-text); --vor: var(--m5-vor); }
.m6 { --hauch: var(--m6-hauch); --rand: var(--m6-rand); --flaeche: var(--m6-flaeche); --tinte: var(--m6-tinte); --wahl: var(--m6-wahl); --wahl-text: var(--m6-wahl-text); --vor: var(--m6-vor); }
.m7 { --hauch: var(--m7-hauch); --rand: var(--m7-rand); --flaeche: var(--m7-flaeche); --tinte: var(--m7-tinte); --wahl: var(--m7-wahl); --wahl-text: var(--m7-wahl-text); --vor: var(--m7-vor); }
.m8 { --hauch: var(--m8-hauch); --rand: var(--m8-rand); --flaeche: var(--m8-flaeche); --tinte: var(--m8-tinte); --wahl: var(--m8-wahl); --wahl-text: var(--m8-wahl-text); --vor: var(--m8-vor); }
/* Je Stunde mindestens 20 px, Touch 22 px, plus 0,5 px für die Luft über jeder Kachel (§3.2). */
@media (pointer: coarse) { :root { --h-min: 22.5px; --ziel: 44px; --zm: 44px; } }

*, *::before, *::after { box-sizing: border-box; }
/* [hidden] verliert sonst gegen display:flex der Klassen (Spezifität schlägt Attribut). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--grau-2); color: var(--grau-10); }
body { margin: 0; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
p, h2, ul { margin: 0; }
h2, b, strong { font-size: inherit; font-weight: 600; }
button, select, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; text-underline-offset: 2px; }
/* Der Fokus bleibt Tinte wie an den Knöpfen des Study OS (outline: 2px solid var(--text)): Ein violetter Ring hielte
   an seinen geglätteten Kanten keine 3:1, am Modulnamen fehlten 7 % seiner Fläche (ops/sicht.py #10, SP-0420). */
:focus-visible { outline: 2px solid var(--grau-10); outline-offset: 2px; }
::selection { background: var(--neon-weich); }
/* Knöpfe sind positioniert (für die Überlage); ohne z-index malte der Nachbar über den Fokusring. */
button:focus-visible { z-index: 1; }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.symbole { position: fixed; top: 0; left: 0; width: 0; height: 0; overflow: hidden; }
.nur-sr { position: fixed; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Zeigen und Drücken: eine Überlage auf einem Pseudo-Element, nur ihre Deckkraft bewegt sich (§5.9). */
button { position: relative; }
button::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: currentColor;
  opacity: 0; transition: opacity 100ms linear; pointer-events: none;
}
@media (hover: hover) { button:hover::after { opacity: .08; } }
button:active::after { opacity: .1; }
:disabled::after { display: none; }

/* ── Die Zonen */
.seite {
  height: 100vh; height: 100dvh; max-width: 2448px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 16px; padding: 12px var(--rand-x) 24px;
}
/* Der Fuß steht genau mittig zwischen dem Raster und dem unteren Rand (Silas, V-0246): darüber
   8 px unter der Bühne plus die Lücke, darunter derselbe Abstand als Rand (24, ab 860 px Höhe 32,
   bis 700 px 20). */
@media (min-height: 860px) { .seite { padding-block: 24px 32px; gap: 24px; } }
/* Bis 700 px Höhe (1366 × 657) 12 px zwischen den Zonen: Sonst fehlte mit zweizeiligem Fuß 1 px. */
@media (max-height: 700px) { .seite { gap: 12px; padding-bottom: 20px; } }
/* Die Kopfzeile (Silas' dritter Blick, V-0243): der Schriftzug mittig, links der Studiengang-Reiter,
   rechts die Knöpfe. Drei Spalten 1fr auto 1fr halten den Schriftzug genau in der Mitte des Fensters. */
.kopf {
  flex: none; height: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "sg name rechts"; align-items: center; gap: 24px; min-width: 0;
}
.name { grid-area: name; display: flex; justify-content: center; align-items: flex-start; gap: 8px; color: var(--grau-10); }
/* Der Schriftzug: Sora in zwei Gewichten als Pfad, „stunden“ schwer, „planner“ leicht (index.html,
   #marke, V-0250), Seitenverhältnis aus der viewBox. Die Höhe reicht von der Oberlänge (t, d, l) bis zur
   Unterlänge (p): 22 px am Rechner sind 181 px breit, so breit wie Barlow vorher; am Handy 18 px. */
.wortmarke { display: block; height: 22px; width: auto; aspect-ratio: 7669 / 930; fill: currentColor; }
/* „planner“ im Neon, „stunden“ in Tinte (SP-0420), davor das Zeichen „Raster“ des Study OS, so hoch wie der
   Schriftzug. Der reicht bis zur Unterlänge des p, die Balken sollen aber von der Oberlänge bis zur Grundlinie
   stehen: 9 % nach oben (transform, kein Abstand, den das 4-px-Raster messen würde). */
.wm-planner { fill: var(--neon); }
.zeichen { display: block; flex: none; width: auto; height: 22px; aspect-ratio: 1; fill: var(--neon); transform: translateY(-9%); }
.stand { height: var(--ziel); padding: 0 8px; border-radius: var(--r-1); color: var(--grau-9); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.stand.alt { color: var(--hinweis-text); }
.stand.alt .i, .warn-i { color: var(--hinweis); }
.stand:disabled { cursor: default; }
.kopf-rechts { grid-area: rechts; justify-self: end; display: flex; align-items: center; gap: 8px; min-width: 0; }
/* Knopftexte: ab 1200 px lang, darunter kurz, am Handy nur das Symbol (der Name steht in aria-label).
   Der Stand steht ab 1440 px oben, sonst im Fuß: Sonst reicht die rechte Spalte neben dem Schriftzug
   nicht (gerechnet bei 1366 und 1100 px). */
.t-kurz { display: none; }
@media (max-width: 1199.98px) { .t-lang { display: none; } .t-kurz { display: inline; } }
@media (max-width: 1439.98px) { #stand { display: none; } }
@media (min-width: 1440px) { #stand-fuss { display: none; } }

/* Der Studiengang-Reiter (Silas, 05.10.2026): der offene Plan mit einer Linie darunter, seit SP-0420 im Neon
   wie die Kante am offenen Ort im Study OS (vorher Tinte).
   Seit V-0234 öffnet er den Startbildschirm zum Wechseln (Winkel unten am Namen). */
/* Der Reiter füllt den freien Platz, sonst war der Rand links vom Knopfpaar ein Rest (53 px bei
   865 px Breite, außerhalb des 4-px-Rasters, V-0236). */
.studiengang { grid-area: sg; justify-self: start; max-width: 100%; display: flex; align-items: center; gap: 4px 16px; min-width: 0; }
.sg-reiter {
  display: grid; align-content: center; min-width: 0; min-height: 44px; padding: 4px 8px;
  border-bottom: 2px solid transparent; border-radius: var(--r-1) var(--r-1) 0 0; text-align: left;
}
.sg-reiter { border-bottom-color: var(--neon); }
.sg-name { display: flex; align-items: center; gap: 4px; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-i { color: var(--grau-8); }
.sg-fs { font-size: 12px; line-height: 16px; color: var(--grau-9); white-space: nowrap; }

.knopf {
  height: var(--ziel); min-width: var(--ziel); padding: 0 12px; border-radius: var(--r-1); border: 1px solid var(--grau-6);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.knopf.haupt { background: var(--neon-flaeche); border-color: var(--neon-flaeche); color: var(--neon-text); font-weight: 600; }
/* Ein Link, der wie ein Knopf aussieht: „In eigenen Kalender exportieren“ ist ein echtes <a> mit der Datei
   (V-0270, ics.mjs icsLink), mit derselben Überlage beim Zeigen und Drücken wie ein Knopf. */
a.knopf { position: relative; text-decoration: none; }
a.knopf::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity 100ms linear; pointer-events: none; }
@media (hover: hover) { a.knopf:hover::after { opacity: .08; } }
a.knopf:active::after { opacity: .1; }
.knopf.rund { padding: 0; width: var(--ziel); }
.knopf:disabled, .format:disabled { opacity: .38; cursor: default; }
.leise { display: inline-flex; align-items: center; min-height: 24px; margin: -4px 0; padding: 0 4px; border-radius: 4px; text-decoration: underline; text-underline-offset: 2px; }

/* Je Modul eine Kachel, darunter seine Formate mit der Zahl der Gruppen (V-0225). Am Rechner
   stehen die Kacheln als Spalte links neben der Woche, unter 1024 px oben (Silas, 05.10.2026). */
/* Am Rechner links die Module, darunter klein die Legende, rechts die Bühne (V-0243: die Legende stand
   unter dem Raster; Silas: „an der linken Seite klein und unauffällig“). */
.mitte {
  flex: 1 1 0; display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "module buehne" "legende buehne"; gap: 16px 32px; margin-top: 8px;
}
.module { grid-area: module; display: grid; align-content: start; gap: 12px; }
.buehne { grid-area: buehne; }
.unter { display: none; }
.modul { min-width: 0; display: flex; flex-direction: column; padding: 4px 4px 8px; border-radius: var(--r-2); background: var(--grau-1); border: 1px solid var(--grau-5); }
/* Ab sechs Modulen (V-0243): Kacheln dichter wie vor V-0243, die Legende unter dem Raster. Mit Luft
   und Legende links passen fünf Module bei 1280 × 720 und 1366 × 657 ohne Scrollen, acht (der
   Stressfall, §8 #2) nicht. app.js setzt die Klasse aus den Daten, nicht aus der Fenstergröße. */
.viele-module .module { gap: 8px; }
.viele-module .modul { padding: 2px 4px; }
@media (min-width: 1024px) {
  .viele-module .mitte { grid-template-areas: "module buehne" "module legende"; }
  .viele-module .legende { align-self: start; display: flex; flex-wrap: wrap; gap: 8px 24px; }
  .viele-module .lg-zustand { display: flex; }
  .viele-module .lg-formate { flex-direction: row; }
}
/* Gefiltert (Silas' zweiter Test, V-0237): kein Rahmen mehr um die Modulkachel; der Farbkreis ist ein
   Ring und füllt sich, wenn das Modul aufgeschlagen ist. */
.modul.aktiv .punkt { background: var(--rand); }
/* Der Rahmen um das aufgeschlagene Modul ist zurück (Silas, 05.10.2026, V-0245; in V-0237 entfallen):
   „Sonst ist es manchmal ein bisschen schwierig zu sehen, welches Modul man gerade ausgewählt hat.“
   Tinte, also hell dunkel und dunkel weiß; 2 px aus Rand und outline, ohne dass die Kachel springt. */
.modul.aktiv { border-color: var(--grau-10); outline: 1px solid var(--grau-10); }
.modul-name { display: flex; align-items: center; gap: 8px; min-width: 0; height: var(--zm); padding: 0 8px; border-radius: var(--r-1); font-weight: 600; white-space: nowrap; }
/* Name und Info-Symbol in einer Zeile (V-0251): Das Symbol steht nur in der aufgeschlagenen Kachel, rechts
   oben, und öffnet die Modulkarte. Vorher hieß das „Modul-Infos“ und stand in der Lage über dem Plan. */
.m-kopf { display: flex; align-items: center; gap: 4px; min-width: 0; }
.m-kopf .modul-name { flex: 1 1 auto; }
.m-info { flex: none; width: var(--zm); height: var(--zm); display: grid; place-items: center; border-radius: var(--r-1); color: var(--grau-10); }
.m-kurz { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.punkt { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--rand); flex: none; }
.formate { display: flex; flex-wrap: wrap; gap: 0 4px; padding: 0 4px; }
/* Ein Format: das Ziel ist 28 px (Touch 44 px), sichtbar nur die Pille darin. Überlage, Zustände
   und Ringe liegen auf der Pille, der Fokusring um das Ziel. */
.format { height: var(--zm); min-width: var(--zm); display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-1); }
.format::after { display: none; }
.f-pille {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  height: 24px; min-width: 32px; padding: 0 8px; border-radius: var(--r-1); border: 1px solid var(--rand);
  font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap;
}
.f-pille::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity 100ms linear; pointer-events: none; }
@media (hover: hover) { .format:hover .f-pille::after { opacity: .08; } }
.format:active .f-pille::after { opacity: .1; }
.format:disabled .f-pille::after { display: none; }
.f-pille .i { width: 12px; height: 12px; }
.format.gewaehlt .f-pille { background: var(--flaeche); border-color: var(--flaeche); color: var(--tinte); }
.format[aria-pressed="true"] .f-pille { background: var(--grau-10); border-color: var(--grau-10); color: var(--grau-1); }
/* Die Ringe sind outline mit 1 px Luft, kein Schatten: Schatten haben nur schwebende Ebenen (§5.8). */
.format.konflikt .f-pille { outline: 2px solid var(--konflikt); outline-offset: 1px; }
.format.hinweis .f-pille { outline: 2px solid var(--hinweis); outline-offset: 1px; }

.buehne { min-height: 0; display: flex; flex-direction: column; gap: 12px; }
/* Unter der letzten Stunde (die 20) etwas Luft bis zum Fuß, der Plan wird etwas kürzer (Silas, V-0245). */
@media (min-width: 768px) { .buehne { padding-bottom: 8px; } }

/* Oben im Plan (V-0234): das Schild für Ersatztermine (Bernstein, deutlich) und der ruhige Satz, wenn
   es keine Wahl ohne Überschneidung gibt (neutrale Fläche, nur das Symbol rot). Je eine Zeile, der
   lange Grund steht in einer Karte („Warum“), damit die Woche am Rechner ihre Höhe behält. */
.plan-hinweise { flex: none; display: grid; gap: 8px; }
.ph { display: flex; align-items: flex-start; gap: 8px; min-height: 44px; padding: 12px; border-radius: var(--r-1); border: 1px solid var(--grau-5); background: var(--grau-1); }
.ph > .i { margin-top: 2px; }
.ph-warn { color: var(--konflikt); }
.ph.gelb { border-color: var(--hinweis-flaeche); background: var(--hinweis-flaeche); color: var(--hinweis-text); }
.ph.gelb > .i { color: var(--hinweis); }
.ph .leise { margin-left: 4px; }

.werkzeug { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; min-height: 40px; }
.lage { flex: 1 1 320px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.l-text { min-width: 0; }
.l-titel { font-weight: 600; }
.l-unter { color: var(--grau-9); }
.l-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.steuer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.w-gruppe { display: flex; align-items: center; gap: 4px; }
.segmente, .umschalter { display: inline-flex; padding: 2px; border-radius: var(--r-1); background: var(--grau-3); }
.seg { display: flex; align-items: center; gap: 8px; height: var(--ziel); padding: 0 12px; border-radius: 4px; border: 1px solid transparent; white-space: nowrap; }
/* Gewählt: erhöht, und Wort und Symbol im Neon wie der offene Ort im Study OS (SP-0420). */
.seg[aria-pressed="true"] { background: var(--grau-1); border-color: var(--grau-6); color: var(--neon-schrift); font-weight: 600; }
.i .voll { fill: currentColor; stroke: none; }
.wahl { position: relative; display: inline-flex; align-items: center; }
.wahl select {
  appearance: none; -webkit-appearance: none; height: var(--ziel); max-width: 220px; padding: 0 32px 0 12px;
  border: 1px solid var(--grau-7); border-radius: var(--r-1); background: var(--grau-1); cursor: pointer; text-overflow: ellipsis;
}
.wahl .i { position: absolute; right: 8px; pointer-events: none; color: var(--grau-8); }
@media (pointer: coarse) { .wahl select { font-size: 16px; } }
.marke { display: inline-flex; align-items: center; gap: 4px; height: var(--ziel); padding: 0 8px; border-radius: var(--r-1); font-weight: 600; white-space: nowrap; }
.marke.rot { color: var(--konflikt-text); }
.marke.rot .i { color: var(--konflikt); }
.marke.gelb { color: var(--hinweis-text); }
.marke.gelb .i { color: var(--hinweis); }

.leiste { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 44px; padding: 4px 4px 4px 12px; border-radius: var(--r-1); background: var(--grau-3); }
.leiste p { flex: 1 1 280px; }
.leiste .knoepfe { display: flex; gap: 8px; }

/* ── Raster */
.raster {
  flex: 1 1 0; min-height: calc(32px + var(--stunden, 12) * var(--h-min));
  display: grid; grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: 32px minmax(0, 1fr);
}
.tage { grid-column: 2; display: grid; grid-template-columns: repeat(var(--tage, 5), minmax(0, 1fr)); min-width: 0; }
.tag { display: flex; align-items: center; justify-content: center; gap: 4px; border-radius: var(--r-1); font-weight: 600; white-space: nowrap; overflow: hidden; min-width: 0; }
.tag .datum, .tag .zaehl { font-size: 12px; font-weight: 400; color: var(--grau-9); }
.tag .lang { display: none; }
.ein-tag .tage { padding: 2px; border-radius: var(--r-1); background: var(--grau-3); }
.ein-tag .tag { border: 1px solid transparent; border-radius: 4px; }
.ein-tag .tag[aria-pressed="true"] { background: var(--grau-1); border-color: var(--grau-6); color: var(--neon-schrift); }
@media (min-width: 1280px) { .tag .kurz { display: none; } .tag .lang { display: inline; } }
.koerper { grid-column: 1 / -1; position: relative; display: grid; grid-template-columns: repeat(var(--spalten, 5), minmax(0, 1fr)); padding-left: 32px; min-height: 0; }
.stunden { position: absolute; inset: 0 0 0 32px; pointer-events: none; }
.stunde { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grau-4); }
/* Die Ziffern der Zeitachse in Mono wie die Zahlen des Study OS (SP-0420); sie stehen rechtsbündig, 12 px. */
.stunde span { position: absolute; right: calc(100% + 8px); top: -8px; font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--grau-9); }
.spalte { position: relative; border-left: 1px solid var(--grau-4); }
.spalte:last-child { border-right: 1px solid var(--grau-4); }
.innen { position: absolute; inset: 0 2px 0 4px; }
.raster-text { grid-column: 1 / -1; align-self: center; justify-self: center; max-width: 40ch; padding: 16px; text-align: center; color: var(--grau-9); display: grid; gap: 12px; justify-items: center; }
/* Erst nach 300 ms ohne Daten erscheint „wird geladen“ — ohne Skript und ohne Einblenden (§5.9). */
.spaet { visibility: hidden; animation: zeigen 0s 300ms forwards; }
@keyframes zeigen { to { visibility: visible; } }
/* STARTHINWEIS (V-0241). Startet app.js nicht, blieb „Termine werden geladen …“ für immer stehen:
   So sah es Silas am 05.10.2026 in Safari, als Cloudflare ein altes app.js vier Stunden im
   Browser hielt und es nicht mehr zu den neuen Modulen passte. Nach 10 s ohne Start erscheint
   deshalb ein Ausweg. Nur HTML und CSS, ohne eigenes Skript: Er greift auch, wenn gar kein Skript
   läuft (abgeschaltet, Syntax zu neu für einen alten Browser), und kostet keine Anfrage (§6).
   app.js setzt data-gestartet, sobald es läuft; dann bleibt er verborgen, auch bei langsamem Netz. */
.start-fehler { visibility: hidden; animation: zeigen 0s 10s forwards; font-size: 12px; line-height: 16px; }
:root[data-gestartet] .start-fehler { display: none; }

/* Kacheln sind Container, die Beschriftung folgt ihrer Größe (§3.2). Oben immer das Modul, dann
   die Einheit ausgeschrieben, Gruppe mit Zeit, Raum (Silas, V-0225). M (Modul, Kürzel und Nummer)
   ohne Abfrage, L ab 96 px, ab 240 px der volle Modultitel, S unter 44 px, unter 24 px nur Farbe.
   Die Zustände gelten in beiden Schemata mit derselben Regel (V-0236, §3.2); vorher hatte das
   Dunkle eigene, und eingeplant sah dort aus wie automatisch. */
.kachel { position: absolute; container: kachel / size; color: var(--grau-10); }
.kachel.gewaehlt { color: var(--wahl-text); }
.kachel.zurueck { color: var(--grau-9); }
.kachel:focus-within, .kachel.zeigen { z-index: 2; }
.k-flaeche {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; overflow: hidden;
  padding: 4px; border: 1px solid var(--rand); border-radius: 4px; background: var(--hauch);
  font-size: 12px; line-height: 16px; text-align: left;
}
.k-flaeche:focus-visible { outline-offset: 4px; }
.gewaehlt > .k-flaeche { background: var(--wahl); border-color: var(--wahl); }
/* Legende und Kachel in einer Regel: Sie können nicht auseinanderlaufen (V-0236). */
/* Mit Filter tritt „Mein Stundenplan“ außerhalb ganz zurück (Silas: etwa 20 % Deckkraft, V-0237):
   dieselbe Kachel, nur durchscheinend. Vorher grau gefüllt. */
.kachel.kontext, .lg-k.kontext { opacity: .2; }
.lg-k.kontext { background: var(--grau-10); border-color: var(--grau-10); }
.zurueck > .k-flaeche, .lg-k.zurueck { background: var(--grau-3); border-color: var(--grau-5); }
/* Die übrigen Gruppen eines schon gewählten Formats treten ganz zurück (Silas, 05.10.2026, V-0251: „dass
   die Plus-Symbole auch ausgegraut werden und dass auch die Schrift … an Opacity verlieren muss, sodass
   es visuell ganz klar wird, dass jetzt diese Wahl nicht mehr möglich ist“). Vorher stand dunkel die
   Schrift fast weiß und das Plus in voller Modulfarbe. Wechseln geht weiter: über die Karte oder das
   Plus, das unter dem Zeiger wieder seine Farbe bekommt. */
.zurueck > .k-flaeche > span, .zurueck .k-sym { opacity: .5; }
.zurueck .k-akt { background: var(--grau-5); color: var(--grau-8); }
@media (hover: hover) { .aktionen .kachel.zurueck:hover .k-akt { background: var(--tinte); color: var(--grau-1); } }
.moeglich .k-2 { color: var(--grau-9); }
/* Automatisch eingeplant, die einzige Gruppe eines Formats: gestrichelt (Silas, 05.10.2026). */
/* Ein Vorschlag (V-0237, vorher „automatisch eingeplant“): die einzige Gruppe eines Formats, gestrichelt,
   noch nicht eingeplant. */
.kachel.vorschlag { color: var(--tinte); }
/* Der gestrichelte Rand als outline nach innen: Ein 2-px-Rand nähme schmalen Kacheln den Platz. */
.vorschlag > .k-flaeche { background: var(--vor); border-color: var(--vor); outline: 2px dashed var(--tinte); outline-offset: -2px; }
.format.vorschlag .f-pille { border: 1px dashed var(--tinte); }
/* Der Fokus schlägt den gestrichelten Rand: Sonst blieb die automatisch eingeplante Kachel mit dem
   Fokus unverändert, der Fokus unsichtbar (gemessen am Plan der HU Biologie, §8 #10, V-0234). */
.vorschlag > .k-flaeche:focus-visible { outline: 2px solid var(--grau-10); outline-offset: 4px; }
/* Formate nach Sättigung (Silas' zweiter Test, V-0237): Vorlesung voll, Übung 70 %, alles andere 50 %.
   saturate() hält die Helligkeit, die Kontraste aus §5.5 bleiben; Ringe (Überschneidung, Fokus) liegen
   außerhalb und behalten ihre Farbe. */
.kat-uebung > .k-flaeche, .format.kat-uebung .f-pille { filter: saturate(.7); }
.kat-sonstige > .k-flaeche, .format.kat-sonstige .f-pille { filter: saturate(.5); }
/* Ein offenes Angebot (`gruppen: keine`, V-0234) ist keine Wahl: neutral umrandet, nicht in Modulfarbe. */
.format.frei .f-pille { border-color: var(--grau-6); color: var(--grau-9); }
.kachel.konflikt { outline: 2px solid var(--konflikt); outline-offset: 1px; border-radius: 4px; }
.kachel.zeigen { outline: 2px solid var(--grau-10); outline-offset: 1px; border-radius: 4px; }
.k-flaeche > span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mit-sym > .k-flaeche > span { max-width: calc(100% - 16px); }
.k-typ, .k-mod, .k-titel { font-weight: 600; }
.k-typ, .k-nr, .k-titel, .k-lang, .k-info, .k-ort, .k-akt { display: none; }
.k-sym { position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; }
/* Der Knopf auf der Kachel (Silas' zweiter Test, V-0237): ein abgerundetes Quadrat in der Tinte des
   Moduls mit einem Plus (Einplanen, Wechseln) bzw. hell mit einem Kreuz (Lösen), 24 px. Nur am Rechner
   (feiner Zeiger, .aktionen); er passt auch auf schmale Kacheln, dort unten rechts. */
.k-akt {
  position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; border-radius: 8px;
  place-items: center; background: var(--tinte); color: var(--grau-1);
}
.k-akt .i { width: 16px; height: 16px; stroke-width: 2.25; }
/* Langes Drücken öffnet am Handy die Karte (V-0247): ohne Markieren und ohne das Menü von iOS. */
.k-flaeche[data-act="umschalten"] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.k-akt.kreuz { background: var(--grau-1); color: var(--tinte); }
@container kachel (min-width: 96px) {
  .k-flaeche { padding: 4px 8px; }
  .k-mod, .k-titel { font-size: 14px; line-height: 20px; }
  .k-sym { top: 8px; right: 8px; }
}
/* Das Format ausgeschrieben erst ab 168 px: „Integrierte Veranstaltung“ braucht so viel. Darunter
   „IV 1“ (V-0247: Seit die Woche am Handy Vorgabe ist, stehen Kacheln von 96–167 px auch dort, etwa
   beim Zoomen, und der lange Name endete mit „…“). */
@container kachel (min-width: 168px) { .k-kurz { display: none; } .k-lang { display: block; } }
@container kachel (min-width: 240px) { .k-mod { display: none; } .k-titel { display: block; } }
@container kachel (min-width: 96px) and (min-height: 60px) { .k-info { display: block; } }
@container kachel (min-width: 96px) and (min-height: 76px) { .k-ort { display: block; } }
/* Breit, aber niedrig (unter 52 px, Zoom): beide Zeilen in 12 px statt abgeschnitten (§4.4). */
@container kachel (min-width: 96px) and (max-height: 51.9px) {
  .k-flaeche { padding-block: 2px; }
  .k-mod, .k-titel { font-size: 12px; line-height: 16px; }
}
/* Der Knopf sitzt ruhig oben rechts neben dem Titel, nur auf breiten Kacheln (Silas, V-0225). */
@container kachel (min-width: 96px) and (min-height: 32px) {
  .aktionen .k-akt { display: grid; }
  .aktionen .mit-akt .k-mod, .aktionen .mit-akt .k-titel { max-width: calc(100% - 32px); }
  .aktionen .mit-akt .k-sym { top: auto; bottom: 8px; }
}
/* Schmal, aber hoch genug (parallele Gruppen quetschen die Spur): das Plus unten rechts. */
@container kachel (min-width: 32px) and (max-width: 95.9px) and (min-height: 52px) {
  .aktionen .k-akt { display: grid; top: auto; bottom: 4px; right: 50%; transform: translateX(50%); }
  .aktionen .mit-akt .k-sym { display: none; }
}
/* Schmaler als 80 px passt der Modulname nicht (er hieße „Stati…“): Kürzel und Nummer, fett. */
@container kachel (max-width: 79.9px) { .k-mod, .k-kurz { display: none; } .k-typ, .k-nr { display: block; } }
@container kachel (max-width: 43.9px) {
  .k-flaeche { padding: 4px 2px; }
  .k-nr, .k-sym { display: none; }
  .mit-sym > .k-flaeche > span { max-width: 100%; }
  .k-flaeche span { text-overflow: clip; }
}
@container kachel (max-width: 23.9px) {
  .k-flaeche { padding: 0; }
  .k-flaeche > span { display: none; }
}
/* Niedriger als zwei Zeilen (ein 1,5-h-Termin bei 20 px je Stunde, etwa im Zoom 200 %): nur die erste
   Zeile. Sonst teilten sich beide Zeilen die Höhe und würden beide angeschnitten (§8 #14, gemessen am
   Plan der HU Biologie, V-0234). */
@container kachel (max-height: 39.9px) { .k-kurz, .k-nr, .k-lang, .k-info, .k-ort { display: none; } }
/* Gerade gewählt (Silas, V-0225): die gewählte Kachel setzt sich kurz, die übrigen Gruppen des
   Formats verblassen von der möglichen Kachel ins Hellgrau. Nur transform und opacity, 200 ms. */
.frisch.gewaehlt { animation: setzen 200ms var(--ein); }
.frisch.zurueck > .k-flaeche::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 1px solid var(--rand); background: var(--hauch); animation: verblassen 200ms var(--aus) forwards; }
@keyframes setzen { from { transform: scale(.96); } }
@keyframes verblassen { to { opacity: 0; } }

/* ── Legende und Fuß */
/* Die Formate, die vorkommen, und was gefüllt und umrandet heißt; am Handy die Modulfarben dazu.
   Die Wörter nennen die Rolle („grau“, „blass“), keinen Farbton, der nur in einem Schema stimmt. */
.legende { grid-area: legende; align-self: end; display: grid; gap: 16px; padding: 0 4px; font-size: 12px; line-height: 16px; color: var(--fuss-text); }
.lg-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
/* Die Formate stehen übereinander, als eigener Block über den Zuständen (Silas, V-0251: „übereinander
   stacken, anstatt dass die so geknubbelt sind … ein bisschen höher setzen“). Wo die Legende eine Zeile
   unter dem Raster ist (Tablet, ab sechs Modulen), bleiben sie nebeneinander. */
.lg-formate { flex-direction: column; align-items: flex-start; }
/* Bis 700 px Höhe (1366 × 657) passen fünf Module und vier gestapelte Formate nicht in die Spalte (37 px zu
   hoch, gemessen V-0251): dort zwei Spalten, wie die Kachelarten darunter. */
@media (max-height: 700px) and (min-width: 1024px) {
  .lg-formate { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
  .legende { gap: 8px; }
}
.lg-zeile > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.lg-zeile b { color: var(--grau-9); font-weight: 600; }
/* Am Rechner zwei Spalten in 240 px: Muster links, das Wort daneben. */
.lg-zustand { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.lg-k { width: 14px; height: 10px; border-radius: 3px; border: 1px solid var(--grau-8); flex: none; }
.lg-k.gewaehlt { background: var(--lg-wahl); border-color: var(--lg-wahl); }
.lg-k.vorschlag { border-style: dashed; border-color: var(--grau-10); }
.lg-k.konflikt { outline: 2px solid var(--konflikt); outline-offset: 1px; margin-inline: 4px; }
.lg-zeile .punkt { width: 8px; height: 8px; border: 0; background: var(--rand); }

/* Der Fuß (Silas' zweiter Test, V-0237): links der Hinweis in einem Absatz, klein und zurückgenommen
   (--fuss-text, ≥ 4,5:1), rechts die Links. Vorher drei Teile mit eigener Anordnung je Breite. */
.fuss {
  flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 4px 24px;
  font-size: 12px; line-height: 16px;
}
.fuss-hinweis { max-width: 840px; color: var(--fuss-text); }
/* „Auswahl zurücksetzen“ steht mittig im Fuß (Silas, V-0245: „unten links … komisch gelayoutet“). */
.fuss-mitte { justify-self: center; }
.fuss-mitte .leise { color: var(--grau-9); }
.fuss-links { justify-self: end; }
@media (min-width: 768px) and (max-width: 1023.98px) {
  .fuss { grid-template-columns: minmax(0, 1fr) auto; }
  .fuss-mitte { grid-column: 1 / -1; grid-row: 2; }
}
/* Der Link im Satz (MOSES, V-0243): ohne Polster zur Seite, aber 24 px hoch als Ziel (WCAG 2.5.8). */
.fuss .fuss-hinweis a { display: inline-block; min-height: 0; margin: -4px 0; padding: 4px 0; }
.fuss-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; color: var(--fuss-text); }
.fuss a { display: inline-flex; align-items: center; min-height: 24px; margin: -4px 0; padding: 0 4px; border-radius: 4px; }
.fuss .alt { color: var(--hinweis-text); }
@media (hover: hover) { .fuss a:hover, .h-recht a:hover { color: var(--neon-schrift); } }
@media (pointer: coarse) and (min-width: 768px) { .fuss-links { min-height: 44px; } .fuss a, .fuss .leise { min-height: 44px; margin: 0; } }

/* ── Schwebende Ebenen: Karte, Blatt, Dialog, Meldung (§3.5) */
.hinter { position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / .32); opacity: 0; transition: opacity 200ms var(--ein); }
.hinter.leer { background: none; }
.hinter.da { opacity: 1; }
.ebene {
  position: fixed; z-index: 21; width: 320px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px);
  display: flex; flex-direction: column; background: var(--ebene); border: 1px solid var(--rand-ebene); border-radius: var(--r-3);
  box-shadow: var(--schatten); opacity: 0; transform: translateY(4px); transition: opacity 100ms var(--aus), transform 100ms var(--aus);
}
.ebene.da { opacity: 1; transform: none; transition-duration: 150ms; transition-timing-function: var(--ein); }
.ebene.dialog { inset: 0; margin: auto; width: min(560px, calc(100vw - 32px)); height: fit-content; }
.ebene.blatt { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; max-height: 85dvh; border-radius: var(--r-3) var(--r-3) 0 0; transform: translateY(100%); transition-duration: 200ms; padding-bottom: env(safe-area-inset-bottom); }
.ebene.blatt.karte-g { max-height: 70dvh; }
/* „Für später speichern“ (V-0237) schiebt sich auf jeder Breite von unten herein, am Rechner mittig. */
.ebene.blatt.speichern { margin: 0 auto; max-width: 640px; }
.speichern .feld { font-size: 14px; }
@media (min-width: 768px) { .blatt.speichern .e-aktionen .knopf { flex: 0 1 auto; height: var(--ziel); } }
.ebene.blatt.da { transform: none; transition-duration: 250ms; }
/* Das Bild des fertigen Plans (Silas, 05.10.2026, V-0253) vor „In Kalender übernehmen“ und in „Stundenplan
   speichern“: ein großer Dialog, drei Viertel der Fensterbreite („Picture-in-Picture, 75 % des
   Fullscreens“), der Hintergrund tiefer gedimmt, er schiebt sich von unten herauf. Darin der Plan wie im
   Raster, nur das Eingeplante, ohne Knöpfe (bild.mjs), auf einer eingelassenen Fläche wie ein Bild. */
.hinter.tief { background: rgb(0 0 0 / .48); }
.ebene.dialog.plan-bild { width: min(75vw, 1440px); max-height: calc(100dvh - 32px); transform: translateY(32px); transition-duration: 150ms; }
.ebene.dialog.plan-bild.da { transform: none; transition-duration: 300ms; }
.plan-bild .e-inhalt { gap: 16px; padding: 8px 24px 24px; }
.plan-bild .e-kopf { padding: 16px 16px 0 24px; }
.pb-bild { margin: 0; display: grid; gap: 8px; padding: 12px 16px 16px 8px; border-radius: var(--r-2); background: var(--grau-2); border: 1px solid var(--grau-5); }
.pb-titel { padding-left: 8px; font-size: 12px; line-height: 16px; color: var(--grau-9); }
/* Das Bild nimmt die Höhe, die der Dialog übrig lässt (Kopf, Satz, Knöpfe, Hinweis: etwa 380 px), so passt
   alles auch bei 1366 × 657 ohne Scrollen. */
.raster.bild { flex: none; height: clamp(260px, calc(100dvh - 380px), 720px); }
.pb-zeile { color: var(--grau-9); }
.pb-zeile b { color: var(--grau-10); }
.pb-rot { display: inline-flex; align-items: center; gap: 4px; color: var(--konflikt-text); font-weight: 600; }
.pb-rot .i { color: var(--konflikt); }
.plan-bild .e-aktionen .knopf { height: 44px; padding: 0 20px; }
/* Unter den Abo-Knöpfen leise: Adresse kopieren und die einmalige Datei (V-0271). */
.pb-weitere { display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 12px; line-height: 16px; color: var(--grau-9); }
.e-kopf { display: flex; align-items: flex-start; gap: 8px; padding: 8px 8px 0 16px; }
.e-titel { flex: 1; padding-top: 4px; font-size: 16px; line-height: 24px; font-weight: 600; }
.e-zu { flex: none; width: var(--ziel); height: var(--ziel); display: grid; place-items: center; border-radius: var(--r-1); position: relative; }
.e-inhalt { padding: 4px 16px 16px; overflow: auto; overscroll-behavior: contain; display: grid; gap: 12px; }
.e-inhalt.lesen { max-width: 66ch; font-size: 16px; line-height: 24px; }
.feld { width: 100%; height: var(--ziel); padding: 0 8px; border: 1px solid var(--grau-7); border-radius: var(--r-1); background: var(--grau-1); }
.e-inhalt .klein, .klein { font-size: 12px; line-height: 16px; color: var(--grau-9); }
.e-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.blatt .e-aktionen .knopf { flex: 1 1 100%; height: 48px; }
.zeile { display: flex; gap: 8px; align-items: flex-start; }
.zeile > .i { margin-top: 2px; }
.signal { padding: 8px 12px; border-radius: var(--r-1); display: grid; gap: 8px; }
.signal.rot { background: var(--konflikt-flaeche); color: var(--konflikt-text); }
.signal.gelb { background: var(--hinweis-flaeche); color: var(--hinweis-text); }
.signal .knopf { justify-self: start; border-color: currentColor; }
.termine { max-height: 200px; overflow: auto; font-size: 12px; line-height: 16px; display: grid; gap: 8px; padding-left: 0; list-style: none; }
details > summary { cursor: pointer; min-height: 24px; display: flex; align-items: center; gap: 4px; font-weight: 600; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); margin: 0 4px 0 2px; }
details[open] > summary::before { transform: rotate(45deg); }
.notiz { white-space: pre-line; overflow-wrap: anywhere; margin-top: 4px; }
/* Wege nach draußen (MOSES, ISIS, VVZ) im Neon wie die Links im Study Style, unterstrichen bleiben sie. */
.extern { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; color: var(--neon-schrift); }
.extern .i { width: 14px; height: 14px; }
.links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.meldung {
  position: fixed; left: 50%; bottom: 64px; z-index: 30; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: var(--r-2);
  background: var(--grau-10); color: var(--grau-1); box-shadow: var(--schatten); pointer-events: none;
  opacity: 0; transform: translate(-50%, 4px); transition: opacity 100ms var(--aus), transform 100ms var(--aus);
}
/* Sichtbar fängt sie Klicks: Was sie verdeckt, wird nicht aus Versehen angetippt. */
.meldung.da { opacity: 1; transform: translate(-50%, 0); transition-duration: 150ms; transition-timing-function: var(--ein); pointer-events: auto; cursor: pointer; }
/* Der Pfeiltasten-Tipp (V-0246): eine kleine schwebende Ebene unten mittig, zwei Tasten und ein Satz.
   Seit V-0251 kommt er eine Minute nach dem Plan und bleibt, bis man ihn schließt: mit dem Kreuz, mit
   Esc oder indem man die Pfeile drückt. */
.tipp {
  position: fixed; z-index: 25; left: 50%; bottom: 24px; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: var(--r-3);
  background: var(--ebene); border: 1px solid var(--rand-ebene); box-shadow: var(--schatten);
  opacity: 0; transform: translate(-50%, 8px); transition: opacity 150ms var(--aus), transform 150ms var(--aus);
}
.tipp.da { opacity: 1; transform: translate(-50%, 0); transition-duration: 250ms; transition-timing-function: var(--ein); }
.tasten { display: flex; gap: 4px; }
.tipp kbd {
  display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--r-1);
  border: 1px solid var(--grau-6); border-bottom-width: 3px; background: var(--grau-1); font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1;
}
.tipp p { max-width: 44ch; }
.tipp-zu { flex: none; width: var(--ziel); height: var(--ziel); display: grid; place-items: center; border-radius: var(--r-1); }
.ohne-js { position: fixed; inset: auto 16px 16px; padding: 12px; border-radius: var(--r-1); background: var(--hinweis-flaeche); color: var(--hinweis-text); }
@media (prefers-reduced-motion: reduce) {
  .ebene, .ebene.blatt, .meldung, .hinter { transform: none !important; transition: opacity 100ms linear !important; }
  .frisch.gewaehlt { animation: none; }
  .frisch.zurueck > .k-flaeche::before { animation-duration: 100ms; }
  .meldung, .meldung.da, .tipp, .tipp.da { transform: translateX(-50%) !important; }
  .tipp { transition: opacity 100ms linear !important; }
}

/* Solange die Daten fehlen, halten die Zonen ihren Platz, damit nichts springt (CLS, §6). */

/* ── Tablet, unter 1024 px: Werkzeugzeile und Module dürfen zweizeilig sein */
@media (max-width: 1023.98px) {
  .mitte { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "module" "buehne" "legende"; }
  .module { grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); }
  .legende { align-self: start; display: flex; flex-wrap: wrap; gap: 8px 24px; }
  .lg-zustand { display: flex; }
  .lg-formate { flex-direction: row; }
  /* Unter 1024 px zwei Zeilen: oben der Schriftzug mittig mit den Knöpfen rechts, darunter der Reiter. */
  .kopf { height: auto; grid-template-areas: ". name rechts" "sg sg sg"; row-gap: 8px; }
  /* Gemessen mit dem Bau (V-0243): zwei Reihen Modulkacheln, 865 px Maus 152, 768 px Touch 216. */
  .laedt .module { min-height: 152px; }
  .laedt .werkzeug { min-height: 60px; }
  .lage { flex-basis: 100%; }
  .umschalter { margin-left: auto; }
}

/* ── Handy, unter 768 px (Silas' Test am Handy, 05.10.2026, V-0225) */
/* Die Seite scrollt: Kopf, Studiengang, Module, dann die Bühne auf genau einem Schirm über dem
   schwebenden Umschalter, dann Zeitraum, Legende und mit Abstand der Fuß. Unten bleibt so viel
   Platz, dass der Umschalter nichts verdeckt. */
@media (min-width: 768px) { .nur-handy { display: none !important; } }
@media (max-width: 767.98px) {
  :root {
    --rand-x: 16px;
    /* Umschalter: 44 px in 2 px Schiene mit 1 px Rand, 16 px über dem Rand (und der Home-Leiste). */
    --schalter: 52px;
    --schalter-zone: calc(16px + var(--schalter) + 8px + env(safe-area-inset-bottom, 0px));
  }
  .nur-breit { display: none !important; }
  .seite { height: auto; min-height: 100vh; gap: 0; padding: 12px var(--rand-x) calc(var(--schalter-zone) + 16px); }
  .kopf { gap: 12px 8px; }
  .wortmarke { height: 18px; }
  .zeichen { height: 18px; }
  .kopf-rechts { gap: 4px; }
  .kopf .knopf { width: var(--ziel); padding: 0; }
  .kopf .knopf .t-kurz { display: none; }
  .studiengang { flex-wrap: wrap; }
  .sg-reiter { padding-inline: 0; border-radius: 0; }
  .sg-name { white-space: normal; }
  .plan-hinweise { margin-top: 16px; }
  .mitte { display: block; }
  .module { margin-top: 24px; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .f-pille { height: 28px; padding: 0 4px; }
  .buehne {
    flex: none; margin-top: 32px; gap: 8px;
    min-height: calc(100vh - var(--schalter-zone) - 8px); min-height: calc(100svh - var(--schalter-zone) - 8px);
  }
  .lage { flex-basis: 100%; gap: 8px 16px; }
  .l-text { display: grid; }
  .l-titel { font-size: 16px; line-height: 24px; }
  .werkzeug { min-height: 0; }
  .raster { flex: 1 1 auto; grid-template-rows: 44px minmax(0, 1fr); row-gap: 8px; min-height: calc(52px + var(--stunden, 12) * var(--h-min)); }
  .ein-tag .tage { grid-column: 1 / -1; padding: 0; }
  .ein-tag .tag { border-radius: var(--r-1); }
  .tag { flex-direction: column; gap: 0; line-height: 16px; }
  .umschalter {
    position: fixed; z-index: 15; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
    border: 1px solid var(--rand-ebene); box-shadow: var(--schatten);
  }
  .umschalter .seg { padding: 0 16px; }
  .unter { margin-top: 24px; display: grid; gap: 24px; }
  .unter:has(> .steuer:empty) { display: none; }
  .steuer:empty { display: none; }
  .legende { margin-top: 32px; display: grid; gap: 16px; }
  .lg-formate { flex-direction: column; }
  /* Am Handy steht der Fuß mittig: Hinweis, Zurücksetzen, Stand und Links je eine Zeile (V-0245). */
  .fuss { margin-top: 48px; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 8px; text-align: center; }
  .fuss-links { justify-self: center; justify-content: center; gap: 0 16px; }
  .fuss-mitte .leise { margin: 0; }
  #stand-fuss { flex-basis: 100%; }
  .fuss a, .fuss .leise { min-height: 44px; min-width: 44px; margin: 0; padding: 0; justify-content: center; }
  .meldung { bottom: calc(var(--schalter-zone) + 8px); }
  /* Das Bild am Handy: ein Blatt bis fast nach oben, die Woche gut halb so hoch wie das Fenster. */
  .ebene.blatt.plan-bild { max-height: 92dvh; }
  .plan-bild .e-inhalt { padding: 4px 16px 16px; }
  .plan-bild .e-kopf { padding: 8px 8px 0 16px; }
  .pb-bild { padding: 8px 8px 12px 4px; }
  .raster.bild { height: clamp(320px, 52dvh, 520px); }
  /* Reiter mit zwei Zeilen (V-0234: ohne „Weitere Studiengänge folgen“ darunter), gemessen bei 390 px. */
  .laedt .studiengang { min-height: 46px; }
  .laedt .module { min-height: 330px; }
}
/* Unter 390 px bricht die dritte Pille einer Modulkachel um (WI: BuK), die Module werden höher. */
@media (max-width: 389.98px) { .laedt .module { min-height: 374px; } }
@media (pointer: coarse) and (min-width: 768px) and (max-width: 1023.98px) { .laedt .module { min-height: 216px; } .laedt .werkzeug { min-height: 72px; } }

/* ── Der Reiter kürzt (V-0235, Punkt 42489c1a): Er darf schrumpfen und endet mit „…“, statt unter
   den Stand oder die Knöpfe zu laufen. Wo der Stand steht, regeln seit V-0243 die Regeln an .t-kurz. */
.sg-reiter { min-width: 0; }
.sg-fs { overflow: hidden; text-overflow: ellipsis; }
/* Am Handy steht der Schriftzug links, die Knöpfe rechts (Silas, 05.10.2026, V-0247); am Rechner und
   Tablet bleibt er in der Mitte. Vorher stand er auch am Handy mittig und musste unter 390 px
   schrumpfen, damit die Knöpfe daneben passten. */
@media (max-width: 767.98px) {
  .kopf { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name rechts" "sg sg"; }
  .name { justify-content: flex-start; }
}

/* ── Der Startbildschirm (V-0234, neu in V-0243 nach Silas' drittem Blick; DESIGN §3.6) ──────────
   „Das ist wirklich ziemlich hässlich im Vergleich zu der eigentlichen Seite.“ Jetzt: oben mittig der
   Schriftzug, darunter eine schlanke Linie je Stufe (der Fortschritt, ohne Beschriftung), dann eine
   ruhige Spalte von 440 px. Je Stufe ein kleiner Titel und große Karten; gewählte Stufen bleiben als
   eine Karte mit Haken stehen. Die Karte einer Hochschule trägt deren Farbe (katalog, `farbe`),
   die Schrift darauf ist weiß (≥ 4,5:1, prüft katalog.py). Unten klein der Hinweis und die Links. */
/* Der Raum des Study OS dahinter (SP-0420): sein 46-px-Raster und oben mittig ein ruhiges Licht im Neon, beides
   still, nur hier. Im Plan nicht: Dort tragen die Stundenlinien die Zeit, ein zweites Raster stünde ihnen im Weg. */
.hallo {
  position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 0 var(--rand-x);
  background-image: radial-gradient(ellipse 720px 360px at 50% 0, var(--raum-licht), transparent),
    linear-gradient(var(--raum-linie) 1px, transparent 1px), linear-gradient(90deg, var(--raum-linie) 1px, transparent 1px);
  background-size: auto, 46px 46px, 46px 46px; background-position: 0 0, 50% 0, 50% 0;
}
.h-zum-plan { position: absolute; top: 24px; left: var(--rand-x); gap: 4px; margin: 0; min-height: var(--ziel); text-decoration: none; color: var(--grau-9); }
.h-kopf { flex: none; display: grid; justify-items: center; gap: 24px; padding: 40px 0 32px; }
/* Oben mehr Luft, wo die Höhe es hergibt; in Stufen, nicht in vh (§5.6: Abstände im 4-px-Raster). Seit
   V-0251 steht der Schriftzug höher (vorher 48/96/128 px): „ein kleines Stückchen nach oben, sodass da
   mehr Platz ist“ (Silas), und der Block der Karten steht mittig im Raum darunter. */
@media (min-height: 800px) { .h-kopf { padding-top: 64px; } }
@media (min-height: 1000px) { .h-kopf { padding-top: 96px; } }
.h-marke { margin: 0; display: flex; align-items: flex-start; gap: 12px; color: var(--grau-10); }
.h-marke .wortmarke { height: 34px; }
.h-marke .zeichen { height: 34px; }
.h-striche { display: flex; gap: 8px; }
.h-strich { width: 28px; height: 4px; border-radius: 2px; background: var(--grau-5); transition: background-color 200ms var(--ein); }
.h-strich.hier { background: var(--grau-7); }
.h-strich.voll { background: var(--neon); }
/* Die Spalte wächst und schiebt den Fuß nach unten; ein margin-top: auto ergäbe krumme Maße (§5.6).
   Der Block steht mittig in ihr (Silas, V-0251: „dieser ganze Block soll bitte zentriert werden“), vorher
   oben, und darunter blieb leerer Raum. */
.h-inhalt { flex: 1 0 auto; width: 100%; max-width: 440px; display: grid; align-content: center; gap: 32px; padding-bottom: 32px; }
.h-abschnitt { display: grid; gap: 12px; }
/* Der Titel einer Stufe ist ein Etikett des Study OS (SP-0420): Mono, Versalien, gesperrt, 12 px. */
.h-titel { margin: 0; padding: 0 4px; font-family: var(--mono); font-size: 12px; line-height: 16px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--grau-9); }
.h-titel:focus { outline: none; }
.h-optionen, .h-gruppe { display: grid; gap: 8px; }
.h-g-titel { padding: 0 4px; font-size: 12px; line-height: 16px; color: var(--grau-9); }
.h-option {
  display: grid; align-content: center; gap: 4px; min-height: 72px; padding: 12px 48px 12px 24px;
  border: 1px solid var(--grau-5); border-radius: var(--r-3); background: var(--grau-1); text-align: left;
}
.h-option[aria-current="true"], .h-option.gewaehlt { border-color: var(--neon); }
.h-option.gewaehlt:not(.farbig) .h-o-i { color: var(--neon); }
/* Gewählte Stufen sind kompakter als die Optionen, zwischen denen man gerade wählt. */
.h-option.gewaehlt { min-height: 64px; }
.h-o-label { font-size: 16px; line-height: 24px; font-weight: 600; }
.h-o-zusatz { font-size: 14px; line-height: 20px; color: var(--grau-9); }
.h-o-i { position: absolute; top: calc(50% - 10px); right: 24px; width: 20px; height: 20px; }
.h-option.farbig { background: var(--h-farbe); border-color: var(--h-farbe); color: #fff; }
.h-option.farbig .h-o-zusatz { color: rgb(255 255 255 / .9); }
.h-option.farbig:focus-visible { outline-color: var(--h-farbe); }
.h-aktionen { display: grid; padding-top: 8px; }
.h-aktionen .knopf.haupt { height: 52px; border-radius: var(--r-3); font-size: 16px; }
.h-recht { padding: 32px 0 24px; max-width: 440px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 12px; line-height: 16px; color: var(--fuss-text); text-align: center; }
.h-recht span { flex-basis: 100%; }
.h-recht a { display: inline-flex; align-items: center; min-height: 24px; padding: 0 4px; border-radius: 4px; }
@media (max-width: 767.98px) {
  .h-zum-plan { top: 8px; }
  .h-kopf { padding: 32px 0 32px; gap: 24px; }
  /* Mit „Zurück zum Plan“ oben links (44 px hoch ab 8 px) steht der Schriftzug darunter. */
  .mit-zurueck .h-kopf { padding-top: 64px; }
  .h-marke .wortmarke { height: 28px; }
  .h-marke .zeichen { height: 28px; }
  .h-option { min-height: 68px; }
}
@media (pointer: coarse) { .h-recht a { min-height: 44px; } }

/* Niedrige Fenster (1366 × 657): Mit drei gewählten Stufen und „Stundenplan öffnen“ fehlten 47 px (bis V-0251;
   seitdem öffnet die letzte Wahl den Plan). Steht am Ende, damit es die Regeln oben überschreibt. */
@media (max-height: 700px) and (min-width: 768px) {
  .h-inhalt { gap: 24px; }
  .h-option.gewaehlt { min-height: 56px; }
  .h-kopf { padding-bottom: 24px; }
  .h-recht { padding-block: 16px; }
}

/* Der Umbau-Hinweis (V-0338, Silas 11.10.2026: „Dieses Tool wurde gebaut unter der Annahme, dass Semesterwochenstunden
   das ausschlaggebende Maß … und dass Informationen aus MOSES wahr sind. Diese Annahme wurde widerlegt, deshalb
   befindet sich dieses Tool gerade im Umbau.“): klein, in den Farben der Hinweise, über dem Plan und dem Start. */
.umbau { flex: none; align-self: center; margin: 0; max-width: 760px; padding: 6px 12px; border-radius: var(--r-1); background: var(--hinweis-flaeche); color: var(--hinweis-text); font-size: 12px; line-height: 16px; text-align: center; }
.hallo > .umbau { margin-top: 16px; }
