/* =========================================================================
   base.css — reset, typography, page shell, section rhythm.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html {
  /* NOTE: no `scroll-behavior: smooth` here. It breaks ScrollTrigger's
     position measurements (GSAP measures by scrolling to 0 and back, which
     CSS smooth scrolling turns into an async operation), and the whole
     scrollytelling engine then activates the wrong steps. Anchor jumps are
     instant instead; `scroll-margin-top` on .act keeps them landing right. */
  scrollbar-color: var(--c-bg-3) var(--c-bg-0);
}

body {
  margin: 0;
  background: var(--c-bg-0);
  color: var(--c-text-0);
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-wrap: break-word;  /* raw TeX before KaTeX would widen a phone viewport and abort the page transition (Plan 34/E21b) */
  --achse-text: calc(var(--measure) + 2 * var(--sp-5));  /* tokens.css */
}

/* Very fine film grain — adds depth to large flat dark areas.
   Pointer-events none, fixed, sits above everything but the topbar. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--c-z); color: var(--c-bg-0); }

/* ---- Headings --------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.015em;
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
/* One ladder for every area (Root-D136): h1 in two sizes — --fs-hero for the
   opener of /, /me and a subject hub, --fs-h1 everywhere else — one h2, one h3. */
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }
/* Every running text holds the reading measure (Root-D136) — also lists and
   the paragraphs under a stage. A role that must be narrower says so itself;
   none may be wider. A list item with a class is a built row (a timeline, a
   card), not a line of text: its text parts carry the measure themselves.
   Specificity of one element, so any class rule of a role wins. One tone
   too: running text is --c-text-1 in every area (Root-D137) — chapter pages
   read brighter, see the end of components.css (Root-D141). */
main :where(p, dd, li:not([class])) { max-width: var(--measure); color: var(--c-text-1); }

strong { color: #fff; font-weight: 600; }
em { color: var(--c-text-0); }

/* Textlink (Übergabe 1c): Blatt, der Strich trägt die Linkfarbe — bei 40 %,
   beim Überfahren voll, die Schrift dann eine Stufe heller (Root-D137). */
a {
  color: var(--c-text-0);
  text-decoration-color: color-mix(in srgb, var(--c-link) 40%, transparent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: color var(--dur-1) var(--ease), text-decoration-color var(--dur-1) var(--ease);
}
a:hover { color: var(--c-link-hover); text-decoration-color: var(--c-link); }

/* Tastatur-Fokus, global. Vorher gab es in fuenf Stylesheets genau eine
   :focus-visible-Regel (site.css, nur /links) — ein Tab-Durchlauf ueber die
   Landing war damit blind.

   Der Ring nimmt --c-w, nicht --c-z: auf den Shell-Seiten IST --c-z die
   Linkfarbe, ein Ring in der Linkfarbe um Linktext liest sich nicht. Auf den
   Fachseiten ist --c-w die Bildfarbe und ebenfalls deutlich vom
   Ueberwiegenden abgesetzt.

   :focus-visible statt :focus, damit ein Mausklick auf einen Link keinen Ring
   hinterlaesst; der Browser entscheidet, ob die Eingabe eine Tastatur war. */
:focus-visible {
  outline: 2px solid var(--c-w);
  outline-offset: 3px;
}
/* Ziele, die nur per Skript fokussiert werden (Skip-Link-Anker), sollen den
   Ring nicht bekommen — sie sind nicht per Tab erreichbar. */
[tabindex='-1']:focus { outline: none; }

code, .mono, .num {
  font-family: var(--f-mono);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}

hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-line), transparent);
  margin: var(--sp-7) 0;
}

/* ---- Layout primitives ------------------------------------------------ */
.page {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

/* The centre axis (Plan 23/E9c): opt-in, never on .page itself — .page also
   carries the acts, whose own rule in components.css sets the same margin
   (E9d), and /links, which stays on the left edge. Every child of .achse starts where the middle span
   --achse-text starts, so the block of text is centred while its lines stay
   ragged right; it may run on to the right, as a lead in a larger size
   holds --measure in its own font. Wide children (stages, tile rows) take the
   whole column: .achse__voll, or their own sheet sets the margin back to 0.
   A margin, not a grid: the children stay in block flow and their margins
   still collapse. Two class names in the selector, so a later sheet's
   margin shorthand on one class does not undo it. The percentage counts
   against the column; below the span width it is 0, phones do not change.
   A head that spans the column — act, band, the heads of /lab and /map —
   is an axis of its own for its lines (Plan 23/E11a). */
:is(.achse, .act__head, .band__head, .lab-head, .maphead) > :not(.achse__voll) {
  margin-inline-start: max(0px, (100% - var(--achse-text)) / 2);
}
/* Headings stand in the middle of the screen, wider than the text (Plan
   23/E11a, Root-D147): h1, h2 and the small line right above them take the
   whole column and centre their lines; paragraphs, leads and boxes stay
   ragged right on the axis. No width in ch: a heading breaks only where the
   column ends, and text-wrap: balance evens the lines. h3 stays with its
   text. Three class names, so no sheet's rule on h1 or .eyebrow undoes it. */
:is(.achse, .act__head, .band__head, .lab-head, .maphead) > :is(h1, h2,
  :is(.eyebrow, .eyebrow--lower, .act__n, .chapter-head__num, .notfound__code):has(+ :is(h1, h2))):not(.achse__voll) {
  margin-inline: 0; max-width: none; text-align: center;
}
:is(.achse, .act__head, .band__head, .lab-head, .maphead) > :is(.eyebrow, .eyebrow--lower, .act__n):has(+ :is(h1, h2)) {
  display: flex; justify-content: center;
}
/* The marker in front (dot, line) hangs to the left: padding of its width
   plus the gap on the other side, so the words stand on the middle. */
:is(.achse, .lab-head, .maphead) > .eyebrow:has(+ :is(h1, h2)) { padding-inline-end: calc(6px + var(--sp-2)); }
.act__head > .act__n:has(+ h2) { padding-inline-end: calc(22px + var(--sp-2)); }
/* Short text under a heading stands in the middle like the heading
   (Root-D197, Johannes 2026-10-19): the lead of a chapter, an act or a
   section, the head of /lab and /map, the hero line. Two to five lines
   each, measured on every kind of page. Running text after it stays ragged
   right on the axis: a long centred paragraph makes the eye hunt for each
   line's start. Three class names beat the axis rule above. */
:is(.achse, .act__head, .band__head, .lab-head, .maphead) > :is(:is(h1, h2) + p,
  .chapter-head__sub, .act__lead, .hero__sub):not(.achse__voll) {
  max-width: var(--measure);
  margin-inline: auto;
  text-align: center;
  text-wrap: balance;
}

.prose { max-width: var(--measure); }
/* Room for a maths box around the measure: its padding (Root-D183). */
.prose--wide { max-width: calc(var(--measure) + 2 * var(--box-pad-x)); }

.section {
  padding-block: var(--sp-9);
  position: relative;
}
.section--tight { padding-block: var(--sp-8); }

/* Small numbered eyebrow above a section heading */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--f-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-2);
  margin-bottom: var(--sp-3);
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-z);
}

.lead {
  font-size: 1.22rem;
  line-height: 1.6;
  color: var(--c-text-1);
}

/* ---- Top bar -----------------------------------------------------------
   Die Leiste (Plan 34/E8, Root-D184): eine schwebende Kohle-Fläche, 56 px
   hoch, Radius 16, mittig, klebt 12 px unter der Oberkante. Das Element selbst
   ist so breit wie die Fläche und 68 px hoch — oben 12 px Luft; `--topbar-h`
   misst genau diesen Raum, damit Sprungziele und gepinnte Bühnen ohne Änderung
   darunter beginnen. Die Fläche ist `::before`. Markup unverändert (Root-D155).

   Die Breite ist fest, die der Seite (`--page-max`), nicht die des Inhalts:
   so stehen die Bereiche auf jeder Seite am selben Fleck, rechts, und das Weiß
   gleitet nur, wenn man den Bereich wechselt. Inhaltsbreit sprangen sie bei
   1440 px um bis zu 240 px (Startseite gegen Kapitel, Review E8). */
.topbar {
  position: sticky;
  top: 0;
  z-index: 950;
  height: var(--topbar-h);
  width: min(var(--page-max), 100% - 2 * var(--page-pad));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: calc(var(--topbar-h) - 56px + 6px) 6px 6px;
}
.topbar::before {
  content: '';
  position: absolute;
  inset: calc(var(--topbar-h) - 56px) 0 0 0;
  z-index: -1;
  background: var(--c-bg-2);
  border-radius: var(--r-lg);
}
/* Die Fläche steht allein: kein Seitengrund daneben oder darüber, was darunter
   scrollt, läuft im Spalt und neben ihr sichtbar weiter (Johannes, 2026-10-15,
   D194 präzisiert D184). */
/* Ein Punkt der Leiste: 44 px hoch, Radius 11, Host Grotesk. Hover Fläche. */
.topbar__home,
.topbar__nav a,
.topbar__term {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 11px;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.topbar__home {
  font-family: var(--f-display);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--c-text-0);
}
.topbar__home:hover { background: var(--c-bg-3); color: var(--c-text-0); }
.topbar__dot { color: var(--c-mark); }  /* one mark everywhere, not the area colour (Root-D138) */
/* Zwischen Ortsangabe und Bereichen ein Strich; ohne Ortsangabe nichts. */
.topbar__spacer { flex: none; width: 1px; height: 22px; margin-inline: 10px 8px; background: var(--c-line-2); }
.topbar:not(:has(.topbar__crumbs)) .topbar__spacer { display: none; }

/* Ortsangabe und Bereiche in einer Schrift (präzisiert Root-D155: früher Mono,
   versal, gesperrt). Die Ortsangabe ist leiser und ohne Fläche. */
.topbar__crumbs,
.topbar__nav {
  display: flex;
  align-items: center;
  font-family: var(--f-body);
  white-space: nowrap;
}
/* Die Ortsangabe nimmt den freien Platz; ohne sie schiebt der Rand die Bereiche nach rechts. */
.topbar__crumbs { flex: 1 1 auto; gap: 0.5em; min-width: 0; padding-left: 14px; font-size: var(--fs-small); color: var(--c-text-2); }
.topbar__nav { margin-left: auto; gap: 2px; font-size: 1rem; }
.topbar__crumbsep { color: var(--c-text-2); }
.topbar__crumbs a { color: var(--c-text-2); text-decoration: none; transition: color var(--dur-1) var(--ease); }
.topbar__crumbs a:hover,
.topbar__crumbs a:focus-visible { color: var(--c-text-0); }
.topbar__crumbs [aria-current] { color: var(--c-text-1); }
.topbar__nav a { color: var(--c-text-1); }
.topbar__nav a:hover { background: var(--c-bg-3); color: var(--c-text-0); }

/* Das Weiß (Johannes, 2026-10-09): Blatt-Fläche, Tusche-Schrift auf dem
   Bereich, in dem man ist — auf der Startseite auf dem Namen. 404 und
   Impressum haben keinen Bereich, dort steht kein Weiß. Auf Weiß ist der
   Kaugummi-Punkt unlesbar (≈ 1,6 : 1), er nimmt dort die Schrift (Root-D184). */
.topbar__nav a[aria-current],
html:has(.intro) .topbar__home {
  background: var(--c-text-0);
  color: var(--c-bg-0);
  font-weight: 600;
}
html:has(.intro) .topbar__home { font-weight: 800; }
html:has(.intro) .topbar__home .topbar__dot { color: currentColor; }

/* Beim Seitenwechsel gleitet das Weiß an seinen neuen Ort (View Transitions
   über Dokumente: Brave, Chrome, Safari; Firefox und `file://` springen).
   Die Seite selbst wechselt ohne Überblendung; bei `reduce` springt alles.
   FALLE: die Freischaltung `@view-transition` steht NICHT hier, sondern als
   Inline-`<style>` direkt nach dem Link auf diese Datei in jeder Seite. Aus
   einem verlinkten Blatt verwirft Chromium 152 sie, sobald die neue Seite
   zwei synchrone Skripte am Ende trägt („ViewTransition opt-in disabled",
   gemessen Plan 34/E8); inline gleitet es. */
.topbar__nav a[aria-current],
html:has(.intro) .topbar__home { view-transition-name: rq-weiss; }
/* Auf der Startseite steht die Leiste unten im ersten Bild (site.css, Root-D186).
   Das gleitende Weiß nur, solange sie oben klebt: unten liefe es beim Wechsel
   quer über den Schirm. Ohne `scroll-state` (Firefox, Safari) bleibt es aus —
   kein Bruch, nur weniger. */
html:has(.intro) header.topbar { container-type: scroll-state; }
@container not scroll-state(stuck: top) {
  html:has(.intro) .topbar__home { view-transition-name: none; }
}
@supports not (container-type: scroll-state) {
  html:has(.intro) .topbar__home { view-transition-name: none; }
}
::view-transition-old(root),
::view-transition-new(root) { animation: none; }
::view-transition-group(rq-weiss) { animation-duration: 220ms; animation-timing-function: var(--ease); }
/* Beide Bilder füllen die Gruppe ganz. Vorgabe ist volle Breite, Höhe nach
   Seitenverhältnis: von einem breiten Bereich auf einen schmalen startete das
   neue Bild doppelt so hoch und schrumpfte dann — das Weiß pumpte beim Gleiten. */
::view-transition-old(rq-weiss),
::view-transition-new(rq-weiss) { width: 100%; height: 100%; }

/* Der Kapitel-Umschalter (Plan 23/E4): `core/boot.js` ersetzt auf Kapiteln
   das letzte Glied der Ortsangabe durch ‹ 11 · 12 · Kurzname ▾ · 13 ›.
   Die Liste haengt absichtlich nicht am Umschalter, sondern an der Leiste
   (`.chswitch` ist nicht positioniert): so beginnt sie genau unter deren
   Unterkante, links buendig mit dem Umschalter. */
.chswitch { display: inline-flex; align-items: center; gap: 0.9em; min-width: 0; }
/* Mindestens 24 px breit: ein Schritt auf eine Seite desselben Kapitels zeigt
   nur den Pfeil (DGL-D8), und der allein waere 4 px schmal. */
.chswitch__step { display: inline-flex; justify-content: center; gap: 0.4em; min-width: 24px; }
.chswitch__arrow { letter-spacing: 0; }
.chswitch__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--c-text-1);
  cursor: pointer;
}
.chswitch__toggle:hover,
.chswitch__toggle[aria-expanded='true'] { color: var(--c-text-0); }
.chswitch__caret { letter-spacing: 0; color: var(--c-text-2); transition: transform var(--dur-2) var(--ease); }
.chswitch__toggle:hover .chswitch__caret,
.chswitch__toggle[aria-expanded='true'] .chswitch__caret { color: var(--c-z); }
.chswitch__toggle[aria-expanded='true'] .chswitch__caret { transform: rotate(180deg); }

.chswitch__list {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 1;
  display: grid;
  margin: 0;
  padding: var(--sp-2);
  list-style: none;
  max-height: calc(100vh - var(--topbar-h) - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--c-bg-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
}
.chswitch__list[hidden] { display: none; }
.topbar__crumbs .chswitch__item {
  display: flex;
  gap: 1em;
  padding: 0.5em 0.9em;
  border-radius: var(--r-sm);
  color: var(--c-text-1);
  text-decoration: none;
}
.topbar__crumbs a.chswitch__item:hover,
.topbar__crumbs a.chswitch__item:focus-visible { background: var(--c-bg-3); color: var(--c-text-0); }
.topbar__crumbs .chswitch__item[aria-current] { color: var(--c-text-0); box-shadow: inset 2px 0 0 var(--c-z); }
.chswitch__item.is-stub { color: var(--c-text-2); opacity: 0.6; cursor: default; }
.chswitch__itemnum { min-width: 2ch; color: var(--c-text-2); }

/* Kurzform des Kapitel-Umschalters: nur ‹ ▾ ›. Voll braucht die Leiste mit
   dem laengsten Kurznamen (07 · Maximumsprinzip) rund 1230 px (gemessen,
   Plan 23/E4); darunter schob sie sich unter die Bereiche. Zahlen und
   Kurzname nur optisch weg, damit Knopf und Schritte ihren Namen behalten —
   der Titel steht ohnehin gross darunter. Seit dem Konto in der Leiste (Root-D238)
   schon unter 1280 px: bei 1241 lag die Drehstreckung 24 px unter den Bereichen. */
@media (max-width: 1279px) {
  .chswitch__num,
  .chswitch__label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* Knapp über der Zwei-Zeilen-Schwelle braucht die längste Ortsangabe (der
   gekachelte Abgrund) 906 px; bei 980 px stehen 900 zur Verfügung. */
@media (max-width: 1100px) {
  .topbar__nav a { padding-inline: 12px; }
  /* Seit dem Kontoknopf (Root-D238) reicht der Platz hier nicht mehr für „Terminal“ hinter `>_`. */
  .topbar__term::after { display: none; }
}

/* Zwei Zeilen: oben Logo, Ortsangabe, `>_`, unten die vier Bereiche. Kein
   weiteres Markup — `order` zieht `.topbar__nav` in die zweite Zeile, deshalb
   steht sie vor `>_`. Unter 980 px schwebt die Leiste nicht: sie liegt bündig
   oben über die ganze Breite (Plan 34/E8), sonst kostete sie am Handy 112 px.
   Alles, was an `--topbar-h` haengt — Sprungziele, gepinnte Buehnen, die
   Liste des Umschalters —, rechnet mit; die Schublade des Terminals und ihre
   Knoepfe stehen in `terminal.css` fest daneben, ohne Kommentar: dort ist
   das Buendel am Deckel (Root-D113, Root-D116).

   Jedes Ziel hier ist mindestens 40 × 40 px gross (F-032). Zwei Zeilen zu
   40 px, 8 px Luft dazwischen und je 6 px oben und unten ergeben 100 px —
   bei 88 stiessen `>_` an die Bildkante und das Weiss an die Unterkante
   (Review E8). */
@media (max-width: 979px) {
  :root { --topbar-h: 100px; }
  .topbar {
    width: auto;
    max-width: none;
    margin-inline: 0;
    flex-wrap: wrap;
    align-content: center;
    row-gap: var(--sp-2);
    column-gap: var(--sp-2);
    padding: 0 var(--page-pad);
  }
  .topbar::before { inset: 0; border-radius: 0; }
  .topbar__spacer { display: none; }
  /* `>_` steht rechts in der oberen Zeile direkt hinter dem Konto, das sich mit `auto` nach rechts
     schiebt (bei „Eng“ unten); 0 schlägt die 6 px der Grundregel weiter unten. */
  .topbar > .topbar__term { margin-left: 0; }
  /* Die Fläche füllt hier das ganze Element: das Feld hängt 8 px darunter oder darüber. */
  .topbar > .konto-pop { right: var(--page-pad); }
  .topbar > .konto-pop--oben { bottom: calc(100% + 8px); }
  .topbar__nav { order: 1; flex-basis: 100%; }
  .topbar__crumbs { gap: var(--sp-2); padding-left: 0; }
  .topbar__home,
  .topbar__nav a,
  .topbar__term { height: 40px; padding: 0 12px; min-width: 40px; justify-content: center; }
  /* Die obere Zeile trägt auf Kapiteln Logo, ‹ ▾ › und `>_`: dort zählt jedes Pixel. */
  .topbar__home { padding-inline: 6px; }
  .topbar__term { padding-inline: 10px; }
  .topbar__crumbs > a,
  .chswitch__step,
  .chswitch__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
  }
  /* Die offene Liste haengt an der linken Kante der Leiste und bricht ihre
     Titel um: am Umschalter haengend liefe sie rechts aus dem Bild. */
  .chswitch__list { left: var(--page-pad); right: var(--page-pad); white-space: normal; }
  .topbar__crumbs .chswitch__item { align-items: center; min-height: 40px; }
}

/* Handy: die Bereiche fuellen ihre Zeile, und die Ortsangabe kuerzt sich
   selbst — kein Menueknopf, kein `ellipsis`. Zuerst faellt das letzte Glied,
   der Seitentitel steht direkt darunter gross. Auf Kapiteln ist der
   Umschalter das letzte Glied: er bleibt als ‹ ▾ ›, nur der Trenner davor
   faellt; ohne JavaScript faellt das statische Glied wie ueberall. Der Knopf
   des Terminals verliert sein Wort. */
@media (max-width: 720px) {
  .topbar__nav { justify-content: space-between; }
  .topbar__crumbs > a ~ [aria-current],
  .topbar__crumbs > a ~ .topbar__crumbsep:nth-last-child(2) { display: none; }
  .topbar__term::after { display: none; }
}
/* Dann die Mitte: nur das erste Glied bleibt, auf Kapiteln dazu ‹ ▾ ›. */
@media (max-width: 599px) {
  .topbar__crumbs > a:first-child ~ :not(.chswitch) { display: none; }
}
/* Die Bereichszeile in 16 px braucht bei 390 px ihre ganze Breite; darunter
   werden die Punkte schmaler, unter 360 px auch die Schrift. */
@media (max-width: 400px) {
  .topbar__nav a { padding-inline: 8px; }
}
/* Unter 360 px werden die Bereiche schmaler und kleiner. */
@media (max-width: 359px) {
  .topbar__nav { font-size: var(--fs-small); }
  .topbar__nav a { padding-inline: 6px; }
}
/* Unter 420 px reicht die obere Zeile auf Kapiteln nur noch fuer Logo, ‹ ▾ ›, das Konto
   und `>_`: dort faellt auch das erste Glied. Bis zum Kontoknopf (Root-D238) galt das unter
   360 px, und bei 360 brach die Zeile auf manchem Kapitel schon damals um. */
@media (max-width: 419px) {
  .topbar__crumbs > a:first-child:has(~ .chswitch) { display: none; }
  .chswitch { gap: var(--sp-2); }
}

/* Der Knopf des Terminals, `>_`, letztes Element der Leiste (Plan 20/E1,
   Root-D113): Butter-Fläche, `>_` in der Messwert-Schrift, dahinter „Terminal"
   (Übergabe 1c). Unsichtbar, bis `core/terminal.js` die Schublade gebaut
   hat — ohne JavaScript ist ein Knopf, der nichts oeffnet, schlimmer als
   keiner. Das Fenster selbst ist E9. */
.topbar__term {
  display: none;
  gap: 10px;
  margin-left: 6px;
  border: 0;
  background: var(--c-butter);
  color: var(--c-bg-0);
  font-family: var(--f-mess);
  font-size: 1.0625rem;
  font-weight: 500;
  cursor: pointer;
}
/* „Terminal" ist Kleid, nicht Name: `/ ''` hält es aus dem Namen des Knopfs, den sonst
   ein Screenreader „>_Terminal" läse. Ohne Unterstützung dafür gilt die Zeile davor. */
.topbar__term::after { content: 'Terminal'; content: 'Terminal' / ''; font-family: var(--f-body); font-size: 1rem; font-weight: 700; }
.rqt-bereit .topbar__term { display: inline-flex; }
.topbar__term:hover,
.topbar__term[aria-expanded='true'] { background: color-mix(in srgb, var(--c-butter) 60%, var(--c-text-0)); color: var(--c-bg-0); }

/* Das Konto (Plan 54/E2, Root-D238): zwischen den Bereichen und `>_` ein Link auf die
   Konto-Seite, den `core/konto.js` zum Knopf macht — abgemeldet „Anmelden“ mit dem Feld
   darunter, angemeldet Punkt und Name mit Menü. Fest breit, in beiden Zuständen gleich:
   so stehen die Bereiche angemeldet wie abgemeldet am selben Fleck, und nichts springt,
   wenn der Server den Namen nennt. Ohne JavaScript bleibt es der Link. */
.topbar__konto {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
  width: 8.5rem;
  height: 44px;
  margin-left: 6px;
  padding: 0 12px;
  border: 1px solid var(--c-line-2);
  border-radius: 11px;
  background: none;
  color: var(--c-text-0);
  font: 600 1rem var(--f-body);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease);
}
.topbar__konto:hover,
.topbar__konto[aria-expanded='true'] { background: var(--c-bg-3); }
.topbar__konto.is-an { justify-content: flex-start; padding-inline: 8px 12px; border-color: transparent; }
.topbar__konto.is-fragt { color: transparent; }  /* die Frage läuft: kein „Anmelden“, das gleich verschwindet */
.topbar__punkt {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c-mark);
  color: var(--c-bg-0);
  font-size: 0.8rem;
  font-weight: 800;
}
.topbar__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar__konto.is-an::after { content: '▾'; content: '▾' / ''; flex: none; margin-left: -4px; color: var(--c-text-2); font-size: 0.7rem; }

/* Eng (Root-D238): unter 1240 px und auf Seiten mit Kapitel-Umschalter (`data-chapter`,
   `data-frei`), wo die Ortsangabe die Leiste füllt, steht statt des Worts nur ein Zeichen,
   abgemeldet eine Figur, angemeldet der Punkt; das Wort bleibt der Name des Knopfs. Das
   Attribut steht im Markup: ein Wechsel erst nach `boot.js` ließe die Bereiche springen.
   Die Regeln stehen zweimal, einmal je Fall. */
@media (max-width: 1239px) {
  .topbar > .topbar__konto { width: 44px; margin-left: 2px; padding: 0; font-size: 0; }
  .topbar > .topbar__konto:not(.is-an)::before { content: ''; width: 20px; height: 20px; background: currentColor; mask: var(--konto-figur) center / contain no-repeat; }
  .topbar > .topbar__konto.is-fragt::before { visibility: hidden; }
  .topbar > .topbar__konto.is-an { justify-content: center; padding: 0; }
  .topbar > .topbar__konto.is-an::after, .topbar__name { display: none; }
}
:is(body[data-chapter], body[data-frei]) .topbar > .topbar__konto { width: 44px; margin-left: 2px; padding: 0; font-size: 0; }
:is(body[data-chapter], body[data-frei]) .topbar > .topbar__konto:not(.is-an)::before { content: ''; width: 20px; height: 20px; background: currentColor; mask: var(--konto-figur) center / contain no-repeat; }
:is(body[data-chapter], body[data-frei]) .topbar > .topbar__konto.is-fragt::before { visibility: hidden; }
:is(body[data-chapter], body[data-frei]) .topbar > .topbar__konto.is-an { justify-content: center; padding: 0; }
:is(body[data-chapter], body[data-frei]) .topbar > .topbar__konto.is-an::after,
:is(body[data-chapter], body[data-frei]) .topbar__name { display: none; }
/* In zwei Zeilen ist das Konto immer das Zeichen, 40 px wie jedes Ziel dort, rechts oben vor `>_`. */
@media (max-width: 979px) {
  .topbar > .topbar__konto,
  :is(body[data-chapter], body[data-frei]) .topbar > .topbar__konto { width: 40px; height: 40px; margin-left: auto; }
}
.topbar { --konto-figur: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8'%3E%3Ccircle cx='10' cy='6.5' r='3.6'/%3E%3Cpath d='M3 18.2c.6-3.9 3.4-6 7-6s6.4 2.1 7 6'/%3E%3C/svg%3E"); }

/* Feld und Menü hängen unter der Leiste, rechts mit ihr bündig; steht sie unten im
   Bild (Startseite), darüber. */
.konto-pop {
  position: absolute;
  z-index: 1;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, 100vw - 2 * var(--page-pad));
  box-shadow: var(--shadow-3);
  border-radius: var(--r-lg);
}
.konto-pop--oben { top: auto; bottom: calc(100% - var(--topbar-h) + 56px + 8px); }
.konto-pop[hidden] { display: none; }

/* Die Karte des Kontos: dieselbe in der Leiste und auf der Konto-Seite. Jedes Ziel 44 px. */
.konto-karte {
  width: min(360px, 100%);
  padding: 20px;
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-lg);
  background: var(--c-bg-2);
  font-family: var(--f-body);
  text-align: left;
  white-space: normal;
}
.konto-pop > .konto-karte { width: 100%; }
.konto-titel {
  margin: 0 0 14px;
  font-family: var(--f-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--c-text-0);
}
.konto-feld { display: block; margin-bottom: 12px; }
.konto-feld span { display: block; margin-bottom: 5px; font-size: var(--fs-micro); color: var(--c-text-2); }
.konto-feld input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-md);
  background: var(--c-bg-0);
  color: var(--c-text-0);
  font: 1rem var(--f-body);
}
.konto-knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-btn);
  background: var(--c-butter);
  color: var(--c-bg-0);
  font: 700 1rem var(--f-body);
  cursor: pointer;
}
.konto-feld textarea {
  display: block;
  width: 100%;
  height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-md);
  background: var(--c-bg-0);
  color: var(--c-text-0);
  font: 1rem/1.4 var(--f-body);
  resize: none;
}
.konto-feld em { display: block; margin-top: 5px; font-size: var(--fs-micro); font-style: normal; line-height: 1.45; color: var(--c-text-2); }
/* Zugang anfragen (Plan 54/E4): leise unter dem Button, der Weg zurück über dem Titel.
   Beide sind 44 px hoch, auch wenn das Wort klein ist. */
.konto-leise, .konto-zurueck {
  display: block;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-text-2);
  font: var(--fs-micro) var(--f-body);
  cursor: pointer;
}
.konto-leise { width: 100%; margin: 6px 0 -12px; text-align: center; text-decoration: underline; text-decoration-color: var(--c-line-2); text-underline-offset: 3px; }
.konto-zurueck { margin: -12px 0 0; }
.konto-leise:hover, .konto-zurueck:hover { color: var(--c-text-0); }
.konto-text { margin: 0 0 12px; font-size: var(--fs-small); line-height: 1.5; color: var(--c-text-1); }
.konto-text--leise { margin: 0; font-size: var(--fs-micro); color: var(--c-text-2); }
.konto-titel:focus { outline: none; }
/* Wie viele Anfragen warten (nur beim Admin): am Namen oben rechts am Button, im Menü rechts. */
.konto-marke {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--c-mark);
  color: var(--c-bg-0);
  font: 800 0.7rem/1 var(--f-body);
}
.topbar__konto { position: relative; }
.topbar__konto > .konto-marke { position: absolute; top: -4px; right: -4px; }
.konto-menue__punkt > .konto-marke { margin-left: auto; }
.konto-knopf:disabled { opacity: 0.6; cursor: default; }
.konto-knopf--still { background: var(--c-bg-3); color: var(--c-text-0); font-weight: 600; }
.konto-meldung { margin: 0 0 12px; font-size: var(--fs-small); line-height: 1.45; color: var(--c-warn); }
.konto-karte[hidden], .konto-meldung[hidden] { display: none; }
.konto-menue { padding: 8px; }
.konto-menue__wer { margin: 0; padding: 8px 12px 6px; font-size: var(--fs-small); color: var(--c-text-2); overflow-wrap: anywhere; }
.konto-menue__wer b { color: var(--c-text-0); font-weight: 600; }
.konto-menue__punkt {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: var(--c-text-1);
  font: 1rem var(--f-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.konto-menue__punkt:hover { background: var(--c-bg-3); color: var(--c-text-0); }
.konto-menue .konto-meldung { margin: 6px 12px 4px; }

/* Die kleine Leiste „Für dich“ (Plan 54/E7): angemeldet unter der großen, rechts mit ihr bündig,
   mit der Nachricht an alle und den Orten des Kontos, die nur die Antwort des Servers nennt.
   Seit Plan 54/E10 klebt sie 6 px unter der großen und scrollt nicht weg (Johannes: „immer unter
   der normalen leiste“): sie ist ein absolut gesetztes Kind der klebenden Kopfzeile, rechts mit
   ihr bündig, und folgt ihr überallhin, auf der Startseite auch unten im ersten Bild (site.css).
   Außerhalb des Flusses verschiebt sie nichts, wenn sie nach der Antwort erscheint. Steht sie,
   rechnet `--kopf-h` sie mit (unten), und Klebendes der Seite rückt darunter. Unter 980 px, auf
   Inseln und wo sie etwas decken würde (unten) steht alles im Menü am Namen (`.konto-menue__fuer`). */
.fuerdich {
  position: absolute;
  z-index: 0; /* unter Feld und Menü am Namen (`.konto-pop`, 1), die über ihr aufgehen */
  top: calc(100% + 6px);
  right: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  height: 40px;
  padding: 4px 4px 4px 14px;
  border-radius: 12px;
  background: var(--c-bg-2);
  font: var(--fs-small) var(--f-body);
  white-space: nowrap;
}
/* Steht die kleine Leiste (`konto.js` setzt die Klasse, wenn sie nichts deckt), klebt der Kopf
   46 px tiefer: angeheftete Bühnen und Sprungziele lesen `--kopf-h`, nie `--topbar-h`. */
@media (min-width: 980px) {
  html.fuerdich-da { --kopf-h: calc(var(--topbar-h) + 46px); }
}
.fuerdich__nachricht { min-width: 0; max-width: 24rem; overflow: hidden; text-overflow: ellipsis; color: var(--c-mark); }
.fuerdich__strich { flex: none; width: 1px; height: 22px; margin-inline: 8px; background: var(--c-line-2); }
.fuerdich__name { flex: none; margin-right: 6px; color: var(--c-text-2); font-size: var(--fs-micro); letter-spacing: 0.04em; text-transform: uppercase; }
.fuerdich__ort {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--c-text-1);
  text-decoration: none;
}
a.fuerdich__ort:hover { background: var(--c-bg-3); color: var(--c-text-0); }
.fuerdich__ort::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c-butter); }
.fuerdich__ort--admin::before { background: var(--c-mark); }
/* ein geschlossener Bereich: sein Satz, blass, ohne Link und mit leerem Punkt */
.fuerdich__ort--zu { flex: 0 1 auto; min-width: 0; max-width: 18rem; color: var(--c-text-2); }
.fuerdich__ort--zu::before { background: none; box-shadow: inset 0 0 0 1.5px var(--c-text-2); }
.fuerdich__ort-satz { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-micro); }
.fuerdich__ort-name { flex: none; }
.fuerdich .konto-marke { margin-left: 2px; }
.konto-menue__fuer { display: none; }
@media (max-width: 979px) {
  .fuerdich { display: none; }
  .konto-menue__fuer { display: block; }
}
/* Die kleine Leiste deckt nie etwas: liegt unter ihrem Platz ein Ziel oder Text der Seite,
   bleibt sie weg (`core/konto.js`, `pruefe`), und die Klasse am <html> holt alles ins Menü am
   Namen wie am Handy. Auf einer Insel gehört der Platz der Bühne, auch wo dort nur die Leinwand
   liegt, die die Messung nicht zählt. Gemessen wird mit `is-misst`, unsichtbar. */
.fuerdich[hidden] { display: none; }
.fuerdich.is-misst { visibility: hidden; }
body[data-island] .fuerdich { display: none; }
:is(html.fuerdich-im-menue, body[data-island]) .konto-menue__fuer { display: block; }
.konto-menue__fuer h3 { margin: 0; padding: 8px 12px 4px; color: var(--c-text-2); font: var(--fs-micro) var(--f-body); letter-spacing: 0.04em; text-transform: uppercase; }
.konto-menue__fuer p { margin: 0; padding: 6px 12px 8px; font-size: var(--fs-small); line-height: 1.45; color: var(--c-text-1); overflow-wrap: anywhere; }
.konto-menue__fuer .konto-menue__nachricht { color: var(--c-mark); }
/* ein geschlossener Bereich im Menü: kein Link, blass, der Satz darunter */
.konto-menue__punkt--zu { flex-direction: column; align-items: flex-start; justify-content: center; padding-block: 6px; color: var(--c-text-2); cursor: default; }
.konto-menue__punkt--zu:hover { background: none; color: var(--c-text-2); }
.konto-menue__punkt-satz { font-size: var(--fs-micro); line-height: 1.35; }
.konto-menue__fuer hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--c-line-2); }
@media (forced-colors: active) {
  .fuerdich { border: 1px solid CanvasText; }
  .topbar__konto, .konto-knopf { border: 1px solid ButtonText; }
  /* die Figur ist eine Maske über der Fläche, und die Fläche zwänge der Modus auf Canvas;
     die Selektoren sind so stark wie die der Regeln „Eng“, damit ButtonText gewinnt */
  .topbar > .topbar__konto:not(.is-an)::before,
  :is(body[data-chapter], body[data-frei]) .topbar > .topbar__konto:not(.is-an)::before { forced-color-adjust: none; background: ButtonText; }
}
@media print {
  .topbar__konto, .konto-pop, .fuerdich { display: none; }
}

/* ---- Chapter header ---------------------------------------------------- */
/* On a chapter's axis (Plan 23/E9d) head and pager keep the whole column,
   so the line under the head and the two cards lie symmetric around it; the
   head's own .achse puts its lines on the axis. The contents box, 78ch wide,
   stands centred on it. */
.achse > :is(.chapter-head.achse, .pager) { margin-inline-start: 0; }
.achse > .toc { margin-inline: auto; }
.chapter-head {
  padding-block: var(--sp-8) var(--sp-7);
  border-bottom: 1px solid var(--c-line);
  position: relative;
}
.chapter-head__num {
  font-family: var(--f-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.2em;
  color: var(--c-text-2);
  text-transform: uppercase;
}
.chapter-head h1 {
  font-size: var(--fs-h1);
  margin-block: var(--sp-3) var(--sp-4);
}
.chapter-head__sub {
  max-width: var(--measure);
  color: var(--c-text-1);
  font-size: 1.1rem;
}
/* A head line set in the middle instead of on the axis, wider, the lines
   balanced (/mathe, Johannes 2026-10-19). Three classes beat the axis rule. */
.chapter-head.achse > .chapter-head__sub--mitte {
  max-width: 82ch;
  margin-inline: auto;
  text-align: center;
  text-wrap: balance;
}

/* ---- Footer / chapter pager -------------------------------------------- */
.pager {
  display: flex;
  flex-wrap: wrap;           /* long neighbour titles stack on a phone instead of widening the page */
  gap: var(--sp-4);
  border-top: 1px solid var(--c-line);
  padding-block: var(--sp-7) var(--sp-9);
}
.pager a {
  flex: 1 1 14rem;
  min-width: 0;
  overflow-wrap: break-word;
  display: block;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--c-bg-2);
  text-decoration: none;
  color: var(--c-text-0);
  transition: background-color var(--dur-1) var(--ease);
}
/* Kohle, Radius 16, Hover nur Fläche (Übergabe 1c). */
.pager a:hover { background: var(--c-bg-3); color: var(--c-text-0); }
.pager a[data-dir='next'] { text-align: right; }
.pager small {
  display: block;
  font-family: var(--f-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-2);
  margin-bottom: var(--sp-1);
}
.pager span { font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; }
.pager a[aria-disabled='true'] { opacity: 0.35; pointer-events: none; }

/* Die Fusszeile (Plan 23/E9, Root-D139): eine Zeile auf jeder Seite, dieselben
   Ziele wie die Kopfzeile. Grau wie die Bereiche oben, beim Ueberfahren hell
   mit Strich in der Bereichsfarbe — ein Hover fuer beide Leisten. Unter 980 px
   wird jeder Link ein Tippziel von 40 × 40 px wie die Kopfzeile (E5), mit 8 px
   Luft zur Zeile darueber; die Zeilenhoehe allein reicht dafuer nicht, ein
   Inline-Link misst nur die Schrift. */
.sitefoot {
  border-top: 1px solid var(--c-line);
  padding-block: var(--sp-6) var(--sp-8);
  color: var(--c-text-2);
  font-size: var(--fs-small);
}
.sitefoot__note { margin: 0 auto var(--sp-3); max-width: var(--measure); text-align: center; }
/* Centred on every page, chapters too (Plan 23/E9c) — the one line set in
   the middle; running text elsewhere stays ragged right. The source note
   above it too, chapters included since E9d. */
.sitefoot__nav { line-height: 2.4; text-align: center; }
.sitefoot__nav a {
  color: var(--c-text-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  text-decoration-color: transparent;
  transition: color var(--dur-2) var(--ease), text-decoration-color var(--dur-2) var(--ease);
}
.sitefoot__nav a[aria-current] { color: var(--c-text-1); }
.sitefoot__nav a:hover,
.sitefoot__nav a:focus-visible {
  color: var(--c-text-0);
  text-decoration-color: var(--c-z);
}
@media (max-width: 979px) {
  .sitefoot__nav a {
    display: inline-block;
    min-width: 40px;
    min-height: 40px;
    line-height: 40px;
    margin-block: 4px;
    text-align: center;
  }
}

/* ---- Utility ----------------------------------------------------------- */
.u-center { text-align: center; }
.u-mt-6 { margin-top: var(--sp-6); }
.u-mt-7 { margin-top: var(--sp-7); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Skip-Link: erster Tab-Stopp jeder Seite, unsichtbar bis er den Fokus
   bekommt. Ohne ihn laeuft ein Tastatur-Durchlauf auf jeder Seite zuerst
   durch die komplette Topbar, bevor der Inhalt drankommt.

   :focus, nicht :focus-visible — ein Skip-Link muss erscheinen, sobald er den
   Fokus hat, unabhaengig davon, woher der kam.
   z-index ueber der Topbar (950) und ueber dem Filmkorn (900), sonst schiebt
   sich der Balken darueber. Die z-Stufen der Site: Filmkorn 900, Topbar 950,
   Skip-Link 1000, Terminal-Schublade 1100 (`terminal.css`, Plan 20/E1). */
.skiplink {
  position: fixed;
  top: var(--sp-3);
  left: var(--sp-4);
  z-index: 1000;
  transform: translateY(calc(-100% - var(--sp-4)));
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-line-2);
  border-radius: var(--r-md);
  background: var(--c-bg-2);
  color: var(--c-text-0);
  font-size: var(--fs-small);
  text-decoration: none;
}
/* Bewusst ohne transition: der Balken soll in dem Moment stehen, in dem er den
   Fokus bekommt. Eine Einblendung ueber 240ms erzeugt nur ein Fenster, in dem
   ein schneller Tab-Durchlauf ihn halb angekommen sieht. */
.skiplink:focus { transform: none; }

/* Sprungziel des Skip-Links. Ohne scroll-margin landet der Anfang des
   Inhalts unter der sticky Topbar. */
main { scroll-margin-top: var(--kopf-h); }

/* Maus oder Finger (Plan 23/E11, F-040): ein Satz, der von der Bedienung
   spricht, steht zweimal da — `.fuer-maus` und `.fuer-finger`, beide als
   <span> —, und die Eingabe entscheidet, welcher zu sehen ist. Kein Skript
   rät das Gerät; ein Laptop mit Touchscreen hat einen feinen Zeiger und
   liest die Maus. Der Druck liest ebenfalls die Maus. */
.fuer-finger { display: none; }
@media (hover: none) and (pointer: coarse) {
  .fuer-maus { display: none; }
  .fuer-finger { display: inline; }
}
