/* Unterricks – Gestaltung „Folie & Aufdecken“: Overhead-Folien im Klassenraum.
 * Fachfarben als getönte Folien, Folienstift-Tinte, gelbe Markerfolie für den Hauptweg, Abdeckblatt am Zwischenstopp.
 * Schriften liegen im Projekt (public/fonts, SIL Open Font License) – nichts wird von außen geladen. */
@font-face { font-family: "Atkinson Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin-wght-normal.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: "Atkinson Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.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: "Atkinson Next"; font-style: italic; font-weight: 200 800; font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin-wght-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: "Atkinson Mono"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2") format("woff2"); }

:root {
  /* Leuchtfläche des Projektors, Folienstift-Tinte */
  --ground: #f2f5fa; --surface: #ffffff; --surface-2: #e9eef6; --paper: #eef2f8; --text: #13213b; --ink: #13213b; --muted: #4d5a73;
  --line: #d5dce8; --line-ui: #7d8aa2;
  /* Folienstift-Farben (Flächen) und ihre Tönungen */
  --blau: #2557c7; --violett: #6a3cc0; --kupfer: #b2490c; --marke: #16264a; --gelb: #ffd43b; --gelb-kante: #e5b80f; --rot: #c8281e; --gruen: #14794a;
  --blau-t: #e5ebf8; --violett-t: #ede8f7; --kupfer-t: #f6e9e2; --marke-t: #e8edf7; --gelb-t: #fff5cf; --rot-t: #fbe9e7; --gruen-t: #e3f2ea;
  /* Fach der Seite (ohne Fach: Marke) */
  --fach: var(--marke); --fach-t: var(--marke-t); --fach-text: var(--marke);
  /* Zustände als Text */
  --ok: var(--gruen); --warn: var(--text); --err: var(--rot); --live: var(--rot);
  /* Folie im Kopfband (Fachfarbe, aufgehellt) und Warnsymbol (Maske, Farbe = Schrift) */
  --foil: color-mix(in srgb, var(--fach) 36%, #fff); --foil-op: 1;
  --ico-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.8 2.8 19.6h18.4L12 3.8zM12 9.6v4.6M12 17.2h.01'/%3E%3C/svg%3E");
  /* ältere Namen, die einzelne Bausteine noch verwenden */
  --brand: var(--fach); --brand-2: var(--fach-text); --accent: var(--gelb); --focus: var(--fach-text);
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 22px -12px rgba(0, 0, 0, .24);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .08), 0 18px 40px -18px rgba(0, 0, 0, .36);
  --radius: 16px; --radius-s: 10px;
  --font: "Atkinson Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Atkinson Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
:root[data-fach="powi"] { --fach: var(--blau); --fach-t: var(--blau-t); --fach-text: var(--blau); }
:root[data-fach="evrel"] { --fach: var(--violett); --fach-t: var(--violett-t); --fach-text: var(--violett); }
:root[data-fach="ethik"] { --fach: var(--kupfer); --fach-t: var(--kupfer-t); --fach-text: var(--kupfer); }
/* Projektor im abgedunkelten Raum */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0b111e; --surface: #131b2c; --surface-2: #1a2438; --paper: #182134; --text: #e8edf6; --muted: #a6b2c7; --line: #26324a; --line-ui: #5a6884;
    --marke: #23396a;
    --blau-t: #1a2a4f; --violett-t: #261d45; --kupfer-t: #3a2216; --marke-t: #1c2436; --gelb-t: #3a3214; --rot-t: #3d1a1a; --gruen-t: #12301f;
    --fach-text: #c9d3e6; --ok: #5fd39a; --warn: var(--text); --err: #ff8a80;
    --foil: color-mix(in srgb, var(--fach) 30%, #c8d0de); --foil-op: .72;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 24px -12px rgba(0, 0, 0, .65);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 20px 44px -18px rgba(0, 0, 0, .75);
    color-scheme: dark;
  }
  :root:not([data-theme="light"])[data-fach="powi"] { --fach-text: #8db0ff; }
  :root:not([data-theme="light"])[data-fach="evrel"] { --fach-text: #bfa6ff; }
  :root:not([data-theme="light"])[data-fach="ethik"] { --fach-text: #ffa766; }
  /* R3: im dunklen Raum endet die Folie an der Bandkante (ein heller Überstand läse sich als Lichtfleck) */
  :root:not([data-theme="light"]) .pagehead .foils { clip-path: inset(0 -100vmax); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: color-mix(in srgb, var(--fach-text) 40%, var(--line)) transparent; accent-color: var(--fach-text); }
body { margin: 0; background: var(--ground); color: var(--text); font: 400 1.0625rem/1.55 var(--font); caret-color: var(--fach-text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--gelb); color: #13213b; }
a { color: var(--fach-text); text-underline-offset: .2em; text-decoration-thickness: from-font; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.18; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 1.25rem + 1.9vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.28rem; font-weight: 800; letter-spacing: -.01em; } h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0 0 .75em; }
strong, b { font-weight: 700; }
:focus-visible { outline: 3px solid var(--ring, var(--fach-text)); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .9rem; } .mono { font-family: var(--mono); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.stack > * + * { margin-top: .8rem; }
.grow { flex: 1 1 auto; min-width: 0; }
svg.ico { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.num, time { font-variant-numeric: tabular-nums; }

/* ---------- Kopfleiste ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 1280px; margin: 0 auto; padding: .5rem 1rem; min-height: 62px; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.topbar nav { margin-left: auto; display: flex; gap: .2rem; flex-wrap: wrap; }
.topbar nav a, .topbar nav button { color: var(--text); background: transparent; border: 0; padding: .5rem .8rem; border-radius: 10px; font: inherit; font-weight: 700; font-size: .98rem; cursor: pointer; text-decoration: none; }
.topbar nav a:hover, .topbar nav button:hover { background: var(--surface-2); }
.topbar nav a[aria-current="page"] { background: var(--fach-t); color: var(--fach-text); }
main { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1rem 3.5rem; }
main.narrow { max-width: 780px; }
.footer { text-align: center; padding: 2rem 1rem 2rem; font-size: .88rem; color: var(--muted); }
.footer a { color: var(--muted); font-weight: 700; }

/* ---------- Kopfband: getönte Folie in der Fachfarbe, randlos ---------- */
.pagehead { --ring: #fff; position: relative; isolation: isolate; color: #fff; background: var(--fach);
  border-image: linear-gradient(var(--fach) 0 0) fill 0 / / 0 100vmax;
  margin: -1.5rem 0 1.9rem; padding: 1.5rem 0 1.65rem; }
/* Folien liegen hinter dem Text und mischen sich mit dem Band (multiply): darüber tiefer, über die Unterkante hinaus hell.
 * Gemischt wird die ganze Folien-Ebene: clip-path macht sie zu einer eigenen Gruppe, darin mischen sich die Folien untereinander. */
.pagehead .foils { position: absolute; z-index: -1; inset: 0; pointer-events: none; clip-path: inset(0 -100vmax -26px); mix-blend-mode: multiply; }
.pagehead .foils i { position: absolute; display: block; border-radius: 20px; }
.pagehead .foils i:nth-child(1) { right: 4%; bottom: -14px; width: min(36%, 460px); height: calc(100% + 64px); background: var(--foil); opacity: var(--foil-op);
  box-shadow: 0 12px 18px -14px rgba(19, 33, 59, .5); transform: rotate(-2deg); transform-origin: 50% 100%; }
.pagehead .foils i + i { display: none; }
/* Seiten ohne Fach (Übersicht, Einstellungen, Planungsgrundlagen, Fachwahl): die drei Fachfolien übereinander, ganz im Band */
:root:not([data-fach]) .pagehead .foils { clip-path: inset(0 -100vmax); mix-blend-mode: normal; opacity: .88; }
:root:not([data-fach]) .pagehead .foils i { display: block; mix-blend-mode: multiply; box-shadow: none; bottom: auto; border-radius: 18px; }
:root:not([data-fach]) .pagehead .foils i:nth-child(1) { background: var(--blau); right: 22%; top: -45%; width: min(22%, 280px); height: 118%; transform: rotate(-7deg); }
:root:not([data-fach]) .pagehead .foils i:nth-child(2) { background: var(--violett); right: 11%; top: 34%; width: min(20%, 250px); height: 120%; transform: rotate(4deg); }
:root:not([data-fach]) .pagehead .foils i:nth-child(3) { background: var(--kupfer); right: -1%; top: -38%; width: min(9%, 120px); height: 108%; transform: rotate(-3deg); }
.pagehead .crumbs { color: #fff; margin-bottom: .45rem; }
.pagehead .crumbs a { color: #fff; } .pagehead .crumbs .sep { opacity: .65; }
.pagehead h1 { margin: 0 0 .6rem; max-width: 34ch; }
/* schmale Seiten ohne Fach (Fachwahl, Einstellungen): Titel und Unterzeile bleiben links neben den drei Folien */
:root:not([data-fach]) main.narrow .pagehead h1 { max-width: 15ch; } :root:not([data-fach]) main.narrow .pagehead .pagesub { max-width: 36ch; }
@media (max-width: 900px) {
  :root:not([data-fach]) main.narrow .pagehead .foils i:nth-child(1) { right: 18%; width: 16%; }
  :root:not([data-fach]) main.narrow .pagehead .foils i:nth-child(2) { right: 9%; width: 14%; }
  :root:not([data-fach]) main.narrow .pagehead .foils i:nth-child(3) { right: -2%; width: 8%; }
}
.pagehead .pagesub { margin: -.2rem 0 .7rem; font-weight: 700; color: #fff; max-width: 70ch; text-wrap: balance; }
.pagehead .row.between { align-items: flex-start; }
.pagehead .btn { --ring: #fff; background: rgba(10, 16, 30, .22); border-color: rgba(255, 255, 255, .55); color: #fff; }
.pagehead .btn:hover { background: rgba(10, 16, 30, .34); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .92rem; line-height: 1.2; padding: .32rem .8rem; border-radius: 999px; background: rgba(10, 16, 30, .2); color: #fff; }
.chip.strong { background: #fff; color: var(--fach); }
.pagehead .badge { background: rgba(255, 255, 255, .94); color: var(--fach); } .pagehead .badge.ok { color: #116a40; }
/* „Folie auflegen“: sichtbar von Anfang an, kurz abgesenkt, der Schatten setzt sich – nur beim ersten Kopfband nach dem Laden */
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-laid]) .pagehead .foils i:nth-child(1) { animation: auflegen .75s var(--ease) both; }
  @keyframes auflegen { from { transform: translate(6px, -14px) rotate(-4deg) scale(1.025); box-shadow: 0 30px 34px -16px rgba(19, 33, 59, .5); } }
}
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .95rem; font-weight: 700; color: var(--muted); margin-bottom: .9rem; }
.crumbs a { color: inherit; text-decoration: none; } .crumbs a:hover { text-decoration: underline; }

/* ---------- Karten, Felder, Knöpfe ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.35rem; }
.card + .card { margin-top: 1.15rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.section-title { display: flex; align-items: center; gap: .6rem; justify-content: space-between; flex-wrap: wrap; margin-bottom: .75rem; }
.section-title h2, .section-title h3 { margin: 0; }
label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: .3rem; }
.field { margin-bottom: .95rem; }
.hint { font-size: .9rem; color: var(--muted); margin-top: .35rem; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-ui); border-radius: var(--radius-s); padding: .6rem .75rem; min-height: 44px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
textarea { resize: vertical; min-height: 5rem; line-height: 1.5; }
::placeholder { color: var(--muted); opacity: .85; }
input.codein { font-family: var(--mono); font-size: 1.3rem; letter-spacing: .12em; text-transform: uppercase; }
input.codein::placeholder { font-family: var(--font); font-size: 1.05rem; letter-spacing: normal; text-transform: none; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fach-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fach-text) 28%, transparent); }
input[type=checkbox], input[type=radio] { width: 1.15rem; height: 1.15rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; min-height: 44px; padding: .6rem 1.05rem;
  border-radius: var(--radius-s); border: 1px solid var(--line-ui); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease); }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 82%, var(--fach)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { background: #e8edf6; border-color: #e8edf6; color: #13213b; } :root:not([data-theme="light"]) .btn.primary:hover { background: #fff; } }
.btn.accent { background: var(--gelb); border-color: var(--gelb-kante); color: #13213b; }
.btn.accent:hover { background: #ffdc5c; }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--rot-t); border-color: color-mix(in srgb, var(--rot) 55%, var(--line-ui)); }
.btn.onair { background: var(--rot); border-color: var(--rot); color: #fff; }
.btn.onair:hover { background: #a81f17; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 36px; padding: .35rem .7rem; font-size: .92rem; gap: .35rem; }
.btn.big { min-height: 54px; padding: .85rem 1.4rem; font-size: 1.1rem; border-radius: 12px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn .spin { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.iconbtn { min-width: 36px; padding-inline: .5rem; }
.err { color: var(--err); font-weight: 700; } .ok { color: var(--ok); } .warnc { color: var(--warn); font-weight: 700; }
.warnc::before, .notice.warn::before { content: ""; display: inline-block; width: 1.05em; height: 1.05em; margin-right: .35em; vertical-align: -.17em; background: currentColor;
  -webkit-mask: var(--ico-alert) center / contain no-repeat; mask: var(--ico-alert) center / contain no-repeat; }
.notice { border-radius: var(--radius-s); padding: .75rem .95rem; background: var(--fach-t); color: var(--text); border: 1px solid color-mix(in srgb, var(--fach) 22%, transparent); font-size: .95rem; }
.notice.warn { background: var(--paper); border-color: color-mix(in srgb, var(--line-ui) 70%, transparent); }
.notice.err { background: var(--rot-t); border-color: color-mix(in srgb, var(--rot) 35%, transparent); color: var(--text); font-weight: 400; }
.notice.ok { background: var(--gruen-t); border-color: color-mix(in srgb, var(--gruen) 35%, transparent); }
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 700; line-height: 1.2; padding: .22rem .62rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.onair { background: var(--rot); color: #fff; }
.badge.ok { background: var(--gruen-t); color: var(--ok); }
.badge.stop { background: var(--rot-t); color: var(--err); }
.badge.ink { background: var(--ink); color: #fff; }
.badge.hw { background: var(--gelb-t); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gelb-kante) 60%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.ink { background: #e8edf6; color: #13213b; } }
.save-state { display: inline-flex; align-items: center; gap: .3rem; } .save-state[data-state="ok"] { color: var(--ok); } .save-state[data-state="err"] { color: var(--err); }
.dot { width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; display: inline-block; }
.badge.onair .dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Anmeldung: drei Fachfolien liegen übereinander ---------- */
.login-wrap { position: relative; isolation: isolate; overflow: hidden; min-height: calc(100vh - 62px); display: grid; place-items: center; padding: 2rem 1rem; }
.login-wrap::before, .login-wrap::after, .login::before { content: ""; position: absolute; z-index: -1; border-radius: 28px; mix-blend-mode: multiply; }
.login-wrap::before { width: 46vmax; height: 30vmax; left: -12vmax; top: 8%; background: #c9d6f4; transform: rotate(-9deg); }
.login-wrap::after { width: 40vmax; height: 30vmax; right: -14vmax; bottom: 2%; background: #f3d5c3; transform: rotate(7deg); }
.login { position: relative; width: 100%; max-width: 440px; }
.login::before { width: 120%; height: 70%; left: -10%; top: -18%; background: #ddd2f3; transform: rotate(4deg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .login-wrap::before, :root:not([data-theme="light"]) .login-wrap::after, :root:not([data-theme="light"]) .login::before { mix-blend-mode: screen; opacity: .42; }
  :root:not([data-theme="light"]) .login-wrap::before { background: var(--blau); }
  :root:not([data-theme="light"]) .login-wrap::after { background: var(--kupfer); }
  :root:not([data-theme="light"]) .login::before { background: var(--violett); }
}
.login.card { box-shadow: var(--shadow-lift); }
.login .logo { display: flex; align-items: center; gap: .75rem; justify-content: center; margin-bottom: 1.3rem; }
.login .logo img { width: 64px; height: 64px; }
.login .logo span { font-size: 2.1rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.login .btn { width: 100%; }

/* ---------- Auswahlkacheln: jedes Fach als eigene Folie ---------- */
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile { --tc: var(--fach); --tt: var(--fach-t); position: relative; isolation: isolate; overflow: hidden; display: block; text-align: left; font: inherit; color: var(--text); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 4.4rem 1.15rem 1.2rem; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease); }
.tile::after { content: ""; position: absolute; z-index: -1; right: -26px; top: -26px; width: 92px; height: 92px; border-radius: 18px; background: var(--tc); opacity: .92; transform: rotate(14deg);
  transition: transform .35s var(--ease); }
.tile[data-fach="powi"] { --tc: var(--blau); --tt: var(--blau-t); } .tile[data-fach="evrel"] { --tc: var(--violett); --tt: var(--violett-t); } .tile[data-fach="ethik"] { --tc: var(--kupfer); --tt: var(--kupfer-t); }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--tc) 45%, var(--line)); }
.tile:hover::after { transform: rotate(6deg) translate(-4px, 4px); }
.tile[aria-pressed="true"] { background: var(--tt); border-color: var(--tc); box-shadow: 0 0 0 2px var(--tc), var(--shadow); }
.tile .t { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; } .tile .s { color: var(--muted); font-size: .92rem; margin-top: .25rem; }
.choose > h2 { margin-bottom: .7rem; }
.class-group { margin-bottom: 1.1rem; }
.class-group h3 { font-size: .98rem; color: var(--muted); font-weight: 700; margin-bottom: .45rem; }
.class-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); }
.class-btn { font: inherit; font-weight: 800; font-size: 1.02rem; padding: .7rem .3rem; min-height: 48px; border-radius: 12px; border: 1px solid var(--line-ui); background: var(--surface); color: var(--text);
  cursor: pointer; position: relative; text-decoration: none; text-align: center; transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease); }
.class-btn:hover { border-color: var(--fach-text); background: var(--fach-t); }
.class-btn:active { transform: translateY(1px); }
.class-btn[aria-pressed="true"] { background: var(--fach); border-color: var(--fach); color: #fff; }
.class-btn .n { position: absolute; top: -7px; right: -7px; background: var(--gelb); color: #13213b; border-radius: 999px; font-size: .74rem; font-weight: 800; padding: .05rem .42rem; }
/* Kurs eines Jahrgangs (Ev. Religion, Ethik): ein Knopf für den Kurs, daneben seine Klassen */
.course-row { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .9rem; }
.class-btn.course { min-width: 9.5rem; padding-inline: .9rem; }
.course-members { font-weight: 700; color: var(--muted); font-size: .95rem; }

/* ---------- Listen ---------- */
.list { display: grid; gap: .55rem; }
.item { display: flex; gap: .85rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; }
.item .main { flex: 1 1 auto; min-width: 0; }
.item .name { font-weight: 700; overflow-wrap: anywhere; }
.item .meta { font-size: .88rem; color: var(--muted); }
.item .acts { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
a.item { color: inherit; text-decoration: none; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
a.item:hover { border-color: color-mix(in srgb, var(--fach-text) 55%, var(--line)); background: var(--fach-t); }
.ficon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: .72rem; flex: 0 0 auto; letter-spacing: .02em;
  color: var(--fach-text); background: var(--fach-t); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fach) 24%, transparent); }
/* Listen in Karten: Zeilen mit Haarlinien statt Kästen in Kästen */
.card .list { gap: 0; }
.card .item { border: 0; border-radius: 0; background: transparent; padding: .75rem .4rem; }
.card .list > .item + .item, .card .list > * + .item { border-top: 1px solid var(--line); }
.card a.item:hover { background: var(--fach-t); }
.card .sub { border: 0; border-radius: 0; padding: .9rem 0; background: transparent; }
.card .sub + .sub { margin-top: 0; border-top: 1px solid var(--line); }
.card .list > .card { box-shadow: none; border: 0; border-radius: 10px; background: var(--paper); margin: 0 0 .65rem; }
/* Fach-Schild am Zeilenanfang (gemischte Listen): flach, immer mit Text */
.ftag { flex: 0 0 auto; min-width: 4.6rem; text-align: center; font-weight: 800; font-size: .78rem; line-height: 1.2; padding: .34rem .5rem; border-radius: 8px; color: #fff; background: var(--marke); white-space: nowrap; }
.ftag[data-fach="powi"] { background: var(--blau); } .ftag[data-fach="evrel"] { background: var(--violett); } .ftag[data-fach="ethik"] { background: var(--kupfer); }
.code-big { font-family: var(--mono); font-weight: 800; font-size: clamp(2.2rem, 1.6rem + 2.2vw, 3.2rem); letter-spacing: .08em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }

/* ---------- Sitzungsansicht der Lehrkraft ---------- */
.session-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
@media (max-width: 1000px) { .session-grid { grid-template-columns: 1fr; } }
.side { position: sticky; top: 78px; display: grid; gap: 1.15rem; }
@media (max-width: 1000px) { .side { position: static; } }
.side > .card + .card, .stack > .card + .card { margin-top: 0; }
.code-box { text-align: center; padding: .9rem .6rem .8rem; border-radius: 12px; background: var(--fach-t); }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.meta-grid .full { grid-column: 1 / -1; }

/* Hauptweg: gelbe Markerfolie */
.claudeplan { background: var(--gelb); border-color: var(--gelb-kante); color: #13213b; }
.claudeplan h2, .claudeplan p, .claudeplan .hint, .claudeplan summary { color: #13213b; }
.claudeplan .hint { opacity: .85; }
.claudeplan .ok, .claudeplan .warnc { color: #13213b; }
.claudeplan a { color: #13213b; font-weight: 700; }
.claudeplan .badge { background: #13213b; color: var(--gelb); }
.claudeplan .btn.primary { --ring: #13213b; background: #13213b; border-color: #13213b; color: #fff; }
.claudeplan .btn.primary:hover { background: #24375c; }
.claudeplan .btn { background: rgba(255, 255, 255, .55); border-color: rgba(19, 33, 59, .45); color: #13213b; }
.claudeplan .btn.big { margin: .3rem 0 .55rem; }
.claudeplan details.box { border-top-color: rgba(19, 33, 59, .22); }
.claudeplan code { background: rgba(255, 255, 255, .65); }
:focus-visible { outline-color: var(--ring, var(--fach-text)); }
.claudeplan :focus-visible { --ring: #13213b; }

/* Unterrichtseinheit in der Sitzung */
.unitbox .unit-row { margin-top: .5rem; }
.unit-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: .9rem; font-size: .97rem; }
.unit-row > div { background: var(--fach-t); border-radius: 12px; padding: .7rem .85rem; }
.unit-row ul { margin: 0; padding-left: 1.1rem; }
@media (max-width: 560px) { .unit-row { grid-template-columns: 1fr; } }
.unit-change { margin-top: .7rem; border: 1px dashed var(--fach-text); border-radius: 12px; padding: .65rem .8rem; background: var(--fach-t); }
.unit-change ul { margin: .2rem 0 .45rem; padding-left: 1.1rem; }
.lp-cap { font-size: .85rem; font-weight: 800; color: var(--fach-text); margin-bottom: .2rem; }

/* ---------- Backup-Chat ---------- */
.chat { display: flex; flex-direction: column; height: min(72vh, 820px); min-height: 420px; }
.chat .msgs { flex: 1 1 auto; overflow-y: auto; padding: .3rem .2rem .9rem; display: flex; flex-direction: column; gap: .75rem; }
.msg { max-width: 92%; border-radius: 16px; padding: .7rem .9rem; border: 1px solid var(--line); background: var(--surface); overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--fach-t); border-color: color-mix(in srgb, var(--fach) 25%, transparent); white-space: pre-wrap; border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; border-bottom-left-radius: 6px; }
.msg .who { font-size: .8rem; color: var(--muted); margin-bottom: .25rem; display: flex; gap: .5rem; justify-content: space-between; align-items: center; }
.msg .tools { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .5rem; }
.msg.pending .body::after { content: ""; display: inline-block; width: .55em; height: 1.05em; margin-left: .15em; vertical-align: -.15em; background: currentColor; animation: pulse 1s infinite; }
.composer { border-top: 1px solid var(--line); padding-top: .75rem; display: grid; gap: .55rem; }
.composer textarea { min-height: 76px; max-height: 260px; }

/* ---------- Markdown ---------- */
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1em 0 .4em; font-size: 1.08rem; } .md h1 { font-size: 1.22rem; }
.md ul, .md ol { padding-left: 1.3rem; margin: .3em 0 .75em; }
.md table { border-collapse: collapse; width: 100%; margin: .5em 0 .85em; font-size: .94rem; display: block; overflow-x: auto; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: .4rem .55rem; text-align: left; vertical-align: top; }
.md th { font-weight: 800; border-bottom: 2px solid var(--line-ui); }
.md code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .05em .3em; border-radius: 5px; }
.md pre { background: var(--surface-2); padding: .75rem; border-radius: 10px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: .5em 0; padding: .45rem .8rem; background: var(--fach-t); border-radius: 10px; color: var(--text); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }

/* ---------- Schulportal-Eintrag mit Abdeckblatt ---------- */
.portal-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 800px) { .portal-wrap { grid-template-columns: 1fr; } }
.portal-text { font-family: var(--mono); font-size: .92rem; min-height: 320px; line-height: 1.55; }
.portal-preview { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; padding: .85rem 1rem; background: var(--surface); min-height: 320px; font-size: 1rem; }
.portal-preview .pl { margin: 0; min-height: 1.45em; }
.portal-preview ul { margin: 0; padding-left: 1.25rem; }
.portal-preview a { overflow-wrap: anywhere; }
.portal-preview strong { font-weight: 800; }
.save-state { font-size: .86rem; color: var(--muted); font-weight: 700; }
/* Der Zwischenstopp ist die Kante des Abdeckblatts: was darunter liegt, ist noch nicht aufgedeckt */
.stopfield { position: relative; z-index: 1; display: inline-flex; gap: .45rem; align-items: center; margin: .55rem 0 0; padding: .32rem .75rem; border-radius: 8px 8px 0 0;
  background: var(--rot); color: #fff; font-size: .9rem; font-weight: 700; }
.stopfield strong { font-weight: 800; }
.stopfield .stopicon { display: inline-flex; }
.covered { position: relative; margin: 0 -1rem -.85rem; padding: .7rem 1rem .95rem; min-height: 2.6rem; background: var(--paper); color: var(--muted); border-top: 3px solid var(--rot);
  box-shadow: 0 -10px 18px -12px rgba(19, 33, 59, .42); }
.covered a { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .covered { animation: aufdecken .45s var(--ease) both; } @keyframes aufdecken { from { transform: translateY(-10px); } } }
.ctxmenu { position: fixed; z-index: 300; min-width: 230px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift); padding: .3rem; display: grid; }
.ctxmenu button { display: flex; align-items: center; gap: .5rem; font: inherit; font-weight: 700; text-align: left; background: transparent; border: 0; padding: .55rem .75rem; border-radius: 8px; cursor: pointer; color: inherit; }
.ctxmenu button:hover, .ctxmenu button:focus-visible { background: var(--surface-2); }
.ctxmenu button.danger { color: var(--err); }
.portal-preview [data-line] { cursor: context-menu; }

/* ---------- Hausaufgabe, voriger Zwischenstopp ---------- */
.homework .due { font-weight: 700; }
main.narrow .homework { background: var(--gelb-t); border-color: color-mix(in srgb, var(--gelb-kante) 55%, var(--line)); }
.hwtext .pl { margin: 0; min-height: 1.25em; } .hwtext ul { margin: 0; padding-left: 1.2rem; } .hwtext { font-size: 1.08rem; }
.prevstop { background: var(--surface); border-color: color-mix(in srgb, var(--rot) 35%, var(--line)); }
.prevstop h2 { color: var(--err); }

/* ---------- Uploads ---------- */
.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 800px) { .zones { grid-template-columns: 1fr; } }
.drop { border: 2px dashed var(--line-ui); border-radius: var(--radius); padding: 1.1rem; text-align: center; background: var(--surface-2); cursor: pointer; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.drop:hover { border-color: var(--fach-text); }
.drop.over { border-color: var(--fach-text); background: var(--fach-t); }
.drop strong { display: block; margin-bottom: .2rem; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--fach); transition: width .2s var(--ease); }
.thumbs { display: flex; gap: .5rem; overflow-x: auto; padding: .3rem 0 .5rem; }
.thumbs img { height: 74px; border-radius: 8px; border: 1px solid var(--line); background: #fff; flex: 0 0 auto; }

/* ---------- Live-Fenster der Schüler:innen: die Projektionsfläche ---------- */
.live { background: #0b111e; border-radius: var(--radius); overflow: hidden; position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; color: #cfd8e6; box-shadow: var(--shadow-lift); }
.live img { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; user-select: none; -webkit-user-drag: none; }
.live .placeholder { text-align: center; padding: 1.5rem; max-width: 34rem; }
.live .placeholder .big { font-size: 1.25rem; font-weight: 800; color: #fff; margin-bottom: .35rem; }
.live .status { position: absolute; top: .65rem; left: .65rem; display: flex; gap: .4rem; }
.live .fs { position: absolute; bottom: .65rem; right: .65rem; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .35); color: #fff; }
.live .fs:hover { background: rgba(255, 255, 255, .24); }
.live.idle { aspect-ratio: auto; place-items: start stretch; background: var(--fach-t); color: var(--text); box-shadow: none; border: 1px solid color-mix(in srgb, var(--fach) 22%, transparent); }
.live.idle .placeholder { text-align: left; max-width: none; padding: .95rem 1.15rem; }
.live.idle .placeholder .big { color: var(--fach-text); font-size: 1.08rem; margin-bottom: .15rem; }
.live.idle .fs, .live.idle .status { display: none; }
.live:fullscreen, .live.max { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }
.live.max { position: fixed; inset: 0; z-index: 60; }

/* ---------- Präsentationsmodus und Beamer-Code ---------- */
.presenter { position: fixed; inset: 0; z-index: 100; background: #000; display: grid; grid-template-rows: 1fr auto; }
.presenter .stage { position: relative; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; }
.presenter .stage img { max-width: 100vw; max-height: 100%; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.presenter .bar { display: flex; gap: .5rem; align-items: center; padding: .55rem .85rem; background: rgba(11, 17, 30, .94); color: #e8edf6; flex-wrap: wrap; transition: opacity .3s var(--ease); }
.presenter .bar .btn { background: #1d2840; color: #fff; border-color: #34405a; }
.presenter .bar .btn.onair { background: var(--rot); border-color: var(--rot); }
.presenter.idle .bar { opacity: 0; } .presenter.idle { cursor: none; }
.presenter .counter { font-variant-numeric: tabular-nums; font-weight: 800; min-width: 5.5rem; text-align: center; }
.codeshow { --ring: #fff; position: fixed; inset: 0; z-index: 90; isolation: isolate; overflow: hidden; background: var(--fach); color: #fff; display: grid; place-items: center; text-align: center; padding: 2rem; }
.codeshow::after { content: ""; position: absolute; z-index: -1; width: 70vmax; height: 46vmax; right: -16vmax; top: -12vmax; border-radius: 48px; background: var(--foil); mix-blend-mode: multiply; transform: rotate(-8deg); }
.codeshow .c { font-family: var(--mono); font-weight: 800; font-size: clamp(3.5rem, 15vw, 12rem); letter-spacing: .1em; line-height: 1; }
.codeshow .btn { background: rgba(10, 16, 30, .25); border-color: rgba(255, 255, 255, .6); color: #fff; }

/* ---------- Dialoge und Hinweise ---------- */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(11, 17, 30, .55); display: grid; place-items: center; padding: 1rem; }
.modal { background: var(--surface); color: var(--text); border-radius: 18px; max-width: 760px; width: 100%; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; box-shadow: 0 24px 64px -12px rgba(0, 0, 0, .45); border: 1px solid var(--line); }
.modal.wide { max-width: 1100px; }
.modal header { padding: 1.1rem 1.3rem .45rem; display: flex; align-items: center; gap: .6rem; }
.modal header h2 { margin: 0; flex: 1; font-size: 1.2rem; }
.modal .body { padding: .45rem 1.3rem 1.05rem; overflow-y: auto; }
.modal footer { padding: .85rem 1.3rem 1.1rem; display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: no-preference) { .modal { animation: auflegen-modal .32s var(--ease) both; } @keyframes auflegen-modal { from { transform: translateY(10px) scale(.99); } } }
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: .5rem; width: min(92vw, 520px); pointer-events: none; }
.toast { background: #13213b; color: #fff; padding: .75rem 1.05rem; border-radius: 12px; box-shadow: var(--shadow-lift); font-size: .96rem; font-weight: 700; pointer-events: auto; }
.toast.err { background: #a81f17; } .toast.ok { background: #116a40; }

/* ---------- Feibeitsblatt ---------- */
.fb-card { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.task-edit { border: 1px solid var(--line); border-radius: 12px; padding: .85rem; background: var(--surface-2); }
.task-edit + .task-edit { margin-top: .75rem; }
.sub { border: 1px solid var(--line); border-radius: 12px; padding: .85rem .95rem; background: var(--surface); }
.sub + .sub { margin-top: .6rem; }
.sub .answer { white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: .55rem .75rem; margin: .3rem 0 .55rem; font-size: .96rem; }
.sub details summary { cursor: pointer; font-weight: 700; }
.fbk { font-size: .92rem; } .fbk .k { font-weight: 800; }

.skeleton { color: var(--muted); padding: 2.5rem; text-align: center; font-weight: 700; }
.kbd { font-family: var(--mono); font-size: .82rem; border: 1px solid var(--line-ui); border-bottom-width: 2px; border-radius: 6px; padding: 0 .32rem; }
details.box { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: .7rem 0 0; margin-top: .8rem; background: transparent; }
details.box > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: .45rem; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary::before { content: ""; width: .55em; height: .55em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s var(--ease); flex: none; }
details.box[open] > summary::before { transform: rotate(45deg); }
details.box[open] > summary { margin-bottom: .55rem; }
@media (max-width: 560px) {
  main { padding: 1.25rem .75rem 2.75rem; }
  .pagehead { margin-top: -1.25rem; padding: 1.2rem 0 1.3rem; }
  .card { padding: 1rem .95rem; }
  .meta-grid { grid-template-columns: 1fr; }
  .item { flex-wrap: wrap; } .item .acts { width: 100%; justify-content: flex-start; }
  .topbar { position: static; }
  .topbar .inner { flex-wrap: wrap; row-gap: .15rem; gap: .5rem; padding-bottom: .35rem; min-height: 0; }
  .topbar nav { order: 3; width: 100%; margin: 0 -.25rem; flex-wrap: wrap; row-gap: .1rem; }
  .topbar nav a, .topbar nav button { padding: .45rem .6rem; font-size: .92rem; white-space: nowrap; }
  .pagehead { margin-bottom: 1.8rem; }
  .pagehead .crumbs { font-size: .84rem; gap: .25rem; }
  .crumbs .cur, .crumbs .cur-sep { display: none; }
  .chip { font-size: .86rem; padding: .28rem .65rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Unterrichtseinheiten ---------- */
.class-grid.q { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.chk { display: inline-flex; gap: .45rem; align-items: center; font-weight: 400; margin-right: .7rem; }
.chk input { width: auto; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; }
.unit-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.unit-table th, .unit-table td { border-bottom: 1px solid var(--line); padding: .55rem .6rem; vertical-align: top; text-align: left; }
.unit-table th { background: var(--fach-t); font-size: .85rem; font-weight: 800; color: var(--fach-text); }
.unit-table td textarea { min-width: 15rem; font-size: .94rem; }
.unit-table tr:last-child td { border-bottom: 0; }
.unit-card h2 a { color: inherit; text-decoration: none; } .unit-card h2 a:hover { text-decoration: underline; }
/* Leupold-Schema: links Ausgangslage, Mitte Lernschritte (Beschreibung | Titel), rechts Lernaufgabe; aktuelle Stunde hervorgehoben */
.leupold { border-radius: 12px; padding: .2rem 0 0; margin-top: .5rem; }
.lp-head { margin-bottom: .6rem; }
.lp-grid { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(0, 3fr) minmax(140px, 1fr); gap: .65rem; align-items: stretch; }
.lp-side { border-radius: 12px; padding: .7rem; font-size: .92rem; display: flex; flex-direction: column; justify-content: center; }
.lp-start { background: var(--fach-t); }
.lp-goal { background: var(--gelb-t); }
.lp-goal .lp-cap { color: var(--text); }
.lp-steps { display: grid; gap: .4rem; }
.lp-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: .4rem; font-size: .9rem; }
.lp-desc, .lp-title { border: 1px solid var(--line); border-radius: 8px; padding: .4rem .55rem; background: var(--surface); }
.lp-title { font-weight: 700; }
.lp-row.current .lp-desc, .lp-row.current .lp-title { font-weight: 800; border-color: var(--fach); background: var(--fach); color: #fff; }
@media (max-width: 800px) { .lp-grid { grid-template-columns: 1fr; } .lp-row { grid-template-columns: 1fr; } }
/* Planungsgrundlagen */
pre.basetext { white-space: pre-wrap; font-size: .85rem; background: var(--surface-2); border-radius: 10px; padding: .65rem; max-height: 40vh; overflow: auto; margin: .2rem 0 0; }
/* Krankheitsvertretung */
.btn.sickbtn { width: 100%; white-space: normal; text-align: left; justify-content: flex-start; font-weight: 800; }
.substitute { background: var(--surface); border: 2px solid var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .substitute { border-color: var(--line-ui); } }
.substitute h3 { margin-top: 1.05rem; }
.sub-steps { padding-left: 1.4rem; margin: .45rem 0; }
.sub-steps > li { margin-bottom: .75rem; }
.sub-steps > li::marker { font-weight: 800; color: var(--fach-text); }
.sub-steps .md { font-size: .97rem; margin-top: .2rem; }
.substitute.student { margin-bottom: 1.1rem; background: var(--gelb-t); border: 1px solid color-mix(in srgb, var(--gelb-kante) 55%, var(--line)); }
img.sub-photo { max-width: 100%; max-height: 60vh; border-radius: 12px; border: 1px solid var(--line); display: block; }

/* ---------- Escape-Room (Gestaltung wie die Escape-Rooms der Lehrkraft: hell, seriös; Petrol/Ocker; dunkle Arena) ---------- */
.escbox { border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border-radius: var(--radius-s); padding: .7rem .9rem; margin: .6rem 0; }
.escbox ol { margin: .4rem 0; padding-left: 1.2rem; }
.er { --er-bg: #f4f1ea; --er-ink: #1d2733; --er-pet: #1f4e5f; --er-och: #a9772a; --er-ok: #2f7d41; --er-err: #b1442f; --er-line: #ddd5c6; --er-mute: #5f6670;
  min-height: 100vh; background: var(--er-bg); color: var(--er-ink); font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color-scheme: light; }
.er-wrap { max-width: 880px; margin: 0 auto; padding: 1.2rem 1rem 3rem; outline: none; }
.er-top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .55rem 1rem; background: #fffdf8; border-bottom: 1px solid var(--er-line); }
.er-brand { display: flex; align-items: center; gap: .6rem; font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 1.05rem; color: var(--er-pet); }
.er-badge { font: 700 .72rem/1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--er-och); border-radius: 999px; padding: .3rem .6rem; }
.er-seals { display: flex; gap: .45rem; }
.er-seal { display: flex; align-items: center; gap: 2px; }
.er-sq { width: 12px; height: 12px; border: 1.5px solid var(--er-pet); border-radius: 2px; } .er-sq.on { background: var(--er-pet); }
.er-ci { width: 24px; height: 24px; border: 1.5px solid var(--er-line); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 800 .8rem/1 Georgia, serif; color: var(--er-och); }
.er-ci.on { border-color: var(--er-och); background: #fff6e8; transform: rotate(-3deg); }
.er-kicker { font: 700 .74rem/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--er-och); margin: 0 0 .4rem; }
.er-title { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.12; margin: .2rem 0 .6rem; color: var(--er-ink); }
.er-title em { color: var(--er-pet); }
.er-lede { font-size: 1.12rem; color: #3b4450; margin-bottom: 1.2rem; }
.er-card { background: #fff; border: 1px solid var(--er-line); border-left: 4px solid var(--er-och); border-radius: 8px; padding: 1rem 1.2rem; margin: 0 0 1rem; box-shadow: 0 1px 2px rgba(29, 39, 51, .05), 0 6px 18px rgba(29, 39, 51, .06); }
.er-card h2 { font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; margin: 0 0 .5rem; }
.er-sec h2 { display: flex; gap: .6rem; align-items: baseline; }
.er-num { font: 800 .9rem/1 ui-monospace, Menlo, monospace; color: #fff; background: var(--er-pet); border-radius: 4px; padding: .25rem .45rem; }
.er-brief { background: #fbf8f1; border: 1px solid var(--er-line); border-left: 4px solid var(--er-pet); border-radius: 8px; padding: .9rem 1.1rem; margin-bottom: 1rem; font-style: italic; }
.er-brief .er-kicker { font-style: normal; color: var(--er-pet); }
.er-field { display: grid; gap: .25rem; } .er-field label { font-weight: 700; font-size: .92rem; }
.er input, .er select { font: inherit; padding: .55rem .7rem; border: 1.5px solid #c9c0ae; border-radius: 6px; background: #fff; color: var(--er-ink); min-height: 44px; }
.er input:focus, .er select:focus { outline: 3px solid color-mix(in srgb, var(--er-pet) 40%, transparent); border-color: var(--er-pet); }
.er-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; margin-bottom: .8rem; }
.er-row { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin: .6rem 0; }
.er-btn { font: 700 1rem/1.2 system-ui, sans-serif; color: #fff; background: var(--er-pet); border: 0; border-radius: 6px; padding: .8rem 1.2rem; min-height: 48px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.er-btn:hover { background: #173d4b; } .er-btn[disabled] { opacity: .55; cursor: not-allowed; }
.er-btn.ghost { background: #fff; color: var(--er-pet); border: 1.5px solid var(--er-pet); } .er-btn.small { min-height: 38px; padding: .45rem .8rem; font-size: .9rem; }
.er-link { background: none; border: 0; color: var(--er-pet); text-decoration: underline; cursor: pointer; font: inherit; padding: .3rem; }
.er-hint { font-size: .88rem; color: var(--er-mute); margin: .3rem 0 0; } .er-muted { color: var(--er-mute); }
.er-err { color: var(--er-err); font-weight: 700; min-height: 1.2em; }
.er-steps { padding-left: 1.3rem; } .er-steps li { margin-bottom: .35rem; }
.er-warnbar { background: #fff3e0; border: 1px solid #e8c48b; color: #6b4a12; border-radius: 6px; padding: .55rem .8rem; margin-bottom: 1rem; font-weight: 600; font-size: .95rem; }
.er-savebar { max-width: 880px; margin: -1.5rem auto 1.5rem; padding: .7rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; font-size: .9rem; color: var(--er-mute); }
.er-foot { max-width: 880px; margin: 0 auto; padding: 1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--er-mute); border-top: 1px solid var(--er-line); }
.er-previewnav { max-width: 880px; margin: .6rem auto 0; padding: .4rem 1rem; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; font-size: .85rem; background: #fff6e8; border: 1px dashed var(--er-och); border-radius: 6px; }
/* Rätsel */
.er-part { border-left-color: var(--er-pet); }
.er-part legend { display: grid; gap: .1rem; padding: 0; margin-bottom: .6rem; float: left; width: 100%; } .er-part legend + * { clear: both; }
.er-q { font-weight: 700; font-size: 1.05rem; }
.er-opt { display: flex; gap: .6rem; align-items: center; border: 1.5px solid var(--er-line); border-radius: 6px; padding: .55rem .7rem; margin-bottom: .45rem; cursor: pointer; font-weight: 400; background: #fff; }
.er-opt input { min-height: 0; width: 1.15rem; height: 1.15rem; flex: none; }
.er-assign, .er-bcard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 1.4rem; gap: .6rem; align-items: center; border: 1.5px solid var(--er-line); border-radius: 6px; padding: .5rem .7rem; margin-bottom: .45rem; background: #fff; }
.er-bcard { grid-template-columns: minmax(0, 1.4fr) auto 1.4rem; }
.er-baskets { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .6rem; }
.er-basket { background: #eef4f5; border: 1.5px dashed var(--er-pet); border-radius: 6px; padding: .45rem .6rem; font-weight: 700; color: var(--er-pet); font-size: .92rem; }
.er-segs { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.er-seg { font: 600 .88rem/1.2 system-ui, sans-serif; border: 1.5px solid var(--er-pet); color: var(--er-pet); background: #fff; border-radius: 999px; padding: .45rem .75rem; min-height: 40px; cursor: pointer; }
.er-seg[aria-pressed="true"] { background: var(--er-pet); color: #fff; }
.er-cloze { line-height: 2.3; }
.er-gap { width: auto; min-width: 9ch; max-width: 100%; padding: .2rem .45rem !important; min-height: 36px !important; margin: 0 .15rem; }
.er-in { min-width: 14rem; }
.er .ok { border-color: var(--er-ok) !important; background: #eef8f0; } .er .bad { border-color: var(--er-err) !important; background: #fcefeb; }
.er-opt.ok .er-mark::after, .er-assign.ok .er-mark::after, .er-bcard.ok .er-mark::after { content: "✓"; color: var(--er-ok); font-weight: 800; }
.er-opt.bad .er-mark::after, .er-assign.bad .er-mark::after, .er-bcard.bad .er-mark::after { content: "✗"; color: var(--er-err); font-weight: 800; }
.er-mark { margin-left: auto; }
.er-status { border-radius: 6px; padding: .6rem .8rem; margin: .4rem 0; font-weight: 700; min-height: 0; }
.er-status:empty { display: none; } .er-status.ok { background: #eef8f0; color: var(--er-ok); border: 1px solid #b8dcc0; } .er-status.warn { background: #fff3e0; color: #7a4f0c; border: 1px solid #e8c48b; }
.er-help { background: #fffbea; border: 1px solid #ead9a6; border-radius: 8px; padding: .7rem 1rem; margin: .5rem 0; }
.er-help-head { display: flex; gap: .5rem; align-items: center; } .er-help-head h3 { margin: 0; font-size: 1rem; }
.er-help ul { margin: .4rem 0; padding-left: 1.2rem; }
/* Buchstabe */
.er-reveal { position: fixed; inset: 0; z-index: 90; background: rgba(13, 22, 34, .72); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.er-reveal-box { background: #fffdf8; border-radius: 12px; padding: 1.6rem 1.8rem; text-align: center; max-width: 420px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.er-letter { font: 800 5.5rem/1 Georgia, "Times New Roman", serif; color: var(--er-och); margin: .3rem 0; animation: er-pop .5s ease-out; }
@keyframes er-pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.er-tiles { display: flex; gap: .35rem; justify-content: center; margin: .8rem 0 1rem; }
.er-tile { width: 2.2rem; height: 2.6rem; border: 1.5px solid var(--er-line); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font: 800 1.2rem/1 Georgia, serif; color: var(--er-ink); background: #fff; }
.er-tile.on { border-color: var(--er-och); background: #fff6e8; }
.er-tiles.big { justify-content: flex-start; } .er-tiles.big .er-tile { width: 3rem; height: 3.5rem; font-size: 1.7rem; }
/* Arena und Tunnel */
.er-arena { background: radial-gradient(ellipse at top, #24364d 0%, #121c2b 70%); color: #eef1f6; border-radius: 10px; padding: 1.4rem 1.4rem 1.2rem; margin: 1.2rem 0; }
.er-arena h2 { font-family: Georgia, serif; color: #d6b25e; margin: .2rem 0 .6rem; } .er-arena .er-kicker { color: #d6b25e; } .er-arena .er-hint { color: #b9c2cf; }
.er-gate { display: grid; justify-items: center; gap: .4rem; width: 100%; background: none; border: 2px solid #d6b25e; border-radius: 10px; padding: 1rem; color: #d6b25e; cursor: pointer; margin-top: .6rem; }
.er-gate:hover:not([disabled]) { background: rgba(214, 178, 94, .08); } .er-gate[disabled] { opacity: .5; cursor: not-allowed; }
.er-tunnel { width: min(260px, 70%); height: auto; }
.er-gate-label { font: 800 1.05rem/1.2 system-ui, sans-serif; letter-spacing: .04em; }
.er-msg { color: #ffb4a6; font-weight: 700; min-height: 1em; }
@media (prefers-reduced-motion: reduce) { .er-letter { animation: none; } }
@media (max-width: 560px) { .er-assign, .er-bcard { grid-template-columns: 1fr; } .er-mark { display: none; } .er-in { min-width: 0; width: 100%; } }
