/* Das Frontend mit den Komponenten der Library DIBS-DesignSystem.lib.pen
   (Carlo, 19. Oktober 2026), nach den Frames 4, 4b, 4c, 4d und 4e im
   AnmeldeTool.pen. Werte kommen nur aus stil/tokens.css.
   Schrift und Raum laufen über die drei Grössen der Website, Handy unter 768,
   iPad von 768 bis 1099 und Desktop ab 1100.

   Die Reihenfolge folgt der Seite: Grundlagen, Knöpfe und Felder, dann Header,
   Seitenkopf, Reiter, Formular, die Blöcke und zuletzt der Footer. */

/* ---------- Grundlagen ---------- */

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
}
body.frontend {
  font: 400 var(--type-body)/1.5 var(--font-sans);
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p,
ul {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
}
button,
input {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: var(--stroke-2) solid var(--focus-ring);
  outline-offset: 2px;
}
.icon {
  flex: none;
  display: block;
}

/* Der Rand der Seite. Nie weniger als page-margin, und der Inhalt wird nie
   breiter als 1312, auch auf sehr breiten Bildschirmen nicht. */
.frontend {
  --rand: max(var(--page-margin), calc((100% - var(--inhalt-max)) / 2));
}

/* Eine dunkle Fläche schaltet die Farben über die Klasse «dunkel» aus den
   Tokens, sie braucht dazu nur ihren eigenen Hintergrund. */
.dunkel {
  background: var(--surface);
  color: var(--text);
}

/* Der Sprung zum Inhalt erscheint nur mit der Tastatur. */
.sprung {
  position: absolute;
  left: var(--space-8);
  top: -100px;
  z-index: 50;
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-4);
  background: var(--action);
  color: var(--on-action);
  font-weight: 500;
  text-decoration: none;
}
.sprung:focus {
  top: var(--space-8);
}

/* Was nur ein Screenreader hört, etwa die Ansage nach einem Wechsel der Reiter. */
.vorlesen {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Nach dem Abschicken bekommt der Titel des neuen Teils den Fokus, damit ein
   Screenreader dort weiterliest. Bedienen lässt er sich nicht, darum ohne Ring. */
.teil h2[tabindex="-1"]:focus {
  outline: none;
}

/* Das Feld, das nur Programme ausfüllen, liegt ausserhalb des Bildschirms. */
.falle {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Der Umschalter zwischen Frontend und Backend gibt es nur im Prototyp. */
.schalter {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-16);
  border-bottom: var(--stroke-1) solid var(--line);
}
.schalter a {
  padding: var(--space-2) var(--space-8);
  border: var(--stroke-1) solid var(--line-strong);
  border-radius: var(--radius-4);
  font-size: var(--type-micro);
  font-weight: 500;
  line-height: 1.45;
  text-decoration: none;
}
.schalter a.an {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}
.schalter .hinweis {
  font-size: var(--type-micro);
  color: var(--text-muted);
}
.seitenmeldung {
  padding: var(--space-12) var(--rand);
  background: var(--surface-subtle);
  font-size: var(--type-micro);
}

/* ---------- Knöpfe ---------- */

/* Knopf / Primär, Sekundär und Tertiär. Hover in periwinkle-500 mit schwarzer
   Schrift, Aktiv in Deep Blue mit weisser, wie auf der Website. Der Rand des
   sekundären sitzt innen, darum ist sein Polster um eins kleiner. */
.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-16);
  border: 0;
  border-radius: var(--radius-4);
  font-size: var(--type-body);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 150ms,
    color 150ms,
    border-color 150ms;
}
.knopf.primaer {
  background: var(--action);
  color: var(--on-action);
}
.knopf.sekundaer {
  padding: calc(var(--space-12) - 1px) calc(var(--space-16) - 1px);
  border: var(--stroke-1) solid var(--text);
  background: var(--surface);
  color: var(--text);
}
.knopf.tertiaer {
  background: transparent;
  color: var(--text);
}
.knopf:hover {
  background: var(--periwinkle-500);
  color: var(--neutral-900);
}
.knopf:active {
  background: var(--action);
  border-color: var(--action);
  color: var(--on-action);
}
.knopf:disabled {
  background: var(--neutral-200);
  color: var(--text-min);
  cursor: default;
}

/* Eine Wahl, die aussieht wie ein Knopf. Das Radio bleibt bedienbar und ist
   nur unsichtbar, gewählt sieht sie aus wie der primäre Knopf. */
.wahl {
  position: relative;
  display: inline-flex;
}
.wahl input {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}
.wahl span {
  display: inline-flex;
  align-items: center;
  padding: calc(var(--space-12) - 1px) calc(var(--space-16) - 1px);
  border: var(--stroke-1) solid var(--text);
  border-radius: var(--radius-4);
  background: var(--surface);
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 150ms,
    color 150ms,
    border-color 150ms;
}
.wahl:hover span {
  background: var(--periwinkle-500);
  color: var(--neutral-900);
}
.wahl input:checked + span {
  background: var(--action);
  border-color: var(--action);
  color: var(--on-action);
}
.wahl input:focus-visible + span {
  outline: var(--stroke-2) solid var(--focus-ring);
  outline-offset: 2px;
}

/* Link / Weiter, Zurück und Extern. Im Hover eine Haarlinie unter Text und
   Pfeil, in neutral-700, weil line auf Weiss kaum zu sehen wäre. */
.link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--space-4);
  padding: var(--space-8) 0;
  border-bottom: var(--stroke-1) solid transparent;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}
.link:hover {
  border-bottom-color: var(--neutral-700);
}

/* ---------- Felder ---------- */

/* Feld / Text. Das Label steht immer darüber. Ein Fehler hat die Kante 2 in
   alert-500 und den Text in alert-700, nie nur Farbe. */
.feld {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 0;
}
.feld label {
  font-weight: 500;
  line-height: 1.5;
}
.eingabe {
  width: 100%;
  height: 44px;
  padding: 0 calc(var(--space-12) - 1px);
  border: var(--stroke-1) solid var(--line-strong);
  border-radius: var(--radius-4);
  background: var(--surface);
  font-size: var(--type-body);
  line-height: 1.5;
  color: var(--text);
}
.eingabe::placeholder {
  color: var(--text-min);
}
.eingabe:focus {
  border-color: var(--text);
  outline: var(--stroke-2) solid var(--focus-ring);
  outline-offset: 2px;
}
.eingabe.fehler {
  padding: 0 calc(var(--space-12) - 2px);
  border: var(--stroke-2) solid var(--alert-500);
}
.feld .meldung {
  font-size: var(--type-micro);
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-secondary);
}
.feld .meldung.fehler {
  color: var(--alert-700);
}
/* Auf dem Desktop, iPad und Handy setzen ihre Blöcke eigene Breiten. */
.feld:has(.codefeld) {
  max-width: 300px;
}
.codefeld {
  text-transform: uppercase;
}

/* Einwilligung. Der ganze Satz ist klickbar. Gewählt folgt der Primäraktion,
   also action mit dem Haken in on-action. */
.einwilligung {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  line-height: 1.5;
  cursor: pointer;
}
.einwilligung input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: var(--stroke-1) solid var(--text);
  border-radius: var(--radius-4);
  background: var(--surface);
  cursor: pointer;
}
.einwilligung input:checked {
  border-color: var(--action);
  background: var(--action)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center no-repeat;
}

/* Hinweisbox. Ein Hinweis, der sich vom Fliesstext abhebt. Als Warnung auf
   signal-danger mit weisser Schrift (Carlo, 19. Oktober 2026), beim Resultat
   mit dem formatierten Text des DIBS (Carlo, 27. Oktober 2026). Auf Desktop
   und iPad stehen zwischen Icon und Inhalt 32 statt 12 wie in der Library
   (Carlo, 20. Oktober 2026). Auf dem Handy gilt wieder die Library, siehe
   unten. */
.hinweisbox {
  display: flex;
  gap: var(--space-32);
  padding: var(--space-24);
  border-radius: var(--radius-4);
  background: var(--surface-subtle);
}
.hinweisbox > .icon {
  color: var(--text);
}
.hinweisbox .inhalt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.hinweisbox .titel {
  font-weight: 700;
  line-height: 1.5;
}
.hinweisbox .text {
  line-height: 1.5;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.hinweisbox .text p + p,
.hinweisbox .text p + ul,
.hinweisbox .text ul + p {
  margin-top: var(--space-8);
}
.hinweisbox .text ul,
.hinweisbox .text ol {
  margin: var(--space-4) 0;
  padding-left: 20px;
  list-style: disc;
}
.hinweisbox .text ol {
  list-style: decimal;
}
.hinweisbox.warnung {
  background: var(--signal-danger);
}
.hinweisbox.warnung > .icon,
.hinweisbox.warnung .titel,
.hinweisbox.warnung .text {
  color: var(--on-action);
}
.hinweisbox .text a {
  color: inherit;
}

/* ---------- Header ---------- */

/* Die Navigation sieht aus wie auf der Website von DIBS (Carlo, 19. Oktober
   2026). Jeder Zustand läuft über die 2er-Linie unter dem Text. */
.header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-48);
  padding: var(--space-20) var(--rand);
  background: var(--surface);
  border-bottom: var(--stroke-1) solid var(--line);
}
.wortmarke {
  font-size: var(--type-lead);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.2px;
  text-decoration: none;
  white-space: nowrap;
}
.navigation {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  gap: var(--space-24);
}
.navigation .punkt {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-8) 0;
  border-bottom: var(--stroke-2) solid transparent;
  line-height: 1.2;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}
.navigation .punkt:hover,
.untermenue:hover > .punkt,
.untermenue:focus-within > .punkt {
  color: var(--text);
  border-bottom-color: var(--line);
}
.navigation .punkt.an,
.untermenue:hover > .punkt.an,
.untermenue:focus-within > .punkt.an {
  color: var(--text);
  font-weight: 700;
  border-bottom-color: var(--text);
}
/* Das Untermenü öffnet beim Hover und steht 16 unter der Leiste, wie auf der Website
   (Carlo, 17. September 2026). Mit der Tastatur öffnet es mit dem Fokus. Die Brücke
   ::before hält es offen, solange die Maus den Weg über den Abstand nimmt. */
.untermenue {
  position: relative;
  display: flex;
}
.unterpunkte {
  position: absolute;
  left: calc(-1 * var(--space-8) - var(--stroke-1));
  top: calc(100% + var(--space-20) + var(--space-16));
  display: none;
  flex-direction: column;
  padding: var(--space-8);
  background: var(--surface);
  border: var(--stroke-1) solid var(--line);
  border-radius: var(--radius-4);
}
.unterpunkte::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: calc(var(--space-20) + var(--space-16));
}
.untermenue:hover > .unterpunkte,
.untermenue:focus-within > .unterpunkte {
  display: flex;
}
.untermenue:hover > .punkt .icon,
.untermenue:focus-within > .punkt .icon {
  transform: rotate(180deg);
}
.untermenue.zu > .unterpunkte {
  display: none;
}
.untermenue.zu > .punkt .icon {
  transform: none;
}
.unterpunkt {
  padding: var(--space-8);
  border-bottom: var(--stroke-2) solid transparent;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}
.unterpunkt:hover {
  border-bottom-color: var(--line);
}
.unterpunkt.an {
  font-weight: 500;
}
.header .menue {
  display: none;
}

/* ---------- Seitenkopf ---------- */

/* Kein Hero wie auf der Website von DIBS, sondern der Seitenkopf. Links der
   Titel auf dunkler Fläche, rechts das Motiv. */
.seitenkopf {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.titelzelle {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-16);
  padding: var(--space-96) var(--page-margin) var(--space-96) var(--rand);
}
.titelzelle h1 {
  font-size: var(--type-display-s);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: var(--track-display-s);
}
.titelzelle .einleitung {
  line-height: 1.5;
  color: var(--text-secondary);
}
.motiv {
  position: relative;
  overflow: hidden;
  min-height: 160px;
  background: var(--surface) url("../bilder/blatt-ascii.png") center / cover
    no-repeat;
}
/* Mit Skript dreht sich das Blatt auf einer Leinwand, siehe skript/motiv.js.
   Das Standbild ist der Rückfall ohne Skript und bei reduzierter Bewegung. */
.motiv.lebt {
  background-image: none;
}
.motiv-bild {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Reiter ---------- */

/* Die drei Wege unter dem Seitenkopf (Carlo, 27. Oktober 2026). Ein Reiter
   folgt dem sekundären Knopf, der gewählte ist Deep Blue und hat keinen Hover.
   Der Rand sitzt innen, darum ist das Polster um eins kleiner. Auf iPad und
   Handy steht die Schrift in Lead, auf dem Handy das kurze Wort, siehe unten. */
.reitergruppe {
  display: flex;
  gap: var(--space-24);
  padding: var(--section-space) var(--rand);
}
.reiter {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: calc(var(--space-24) - 1px) calc(var(--space-40) - 1px);
  border: var(--stroke-1) solid var(--text);
  border-radius: var(--radius-4);
  background: var(--surface);
  color: var(--text);
  font-size: var(--type-headline);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: var(--track-headline);
  text-decoration: none;
  transition:
    background-color 150ms,
    color 150ms,
    border-color 150ms;
}
.reiter:hover {
  background: var(--periwinkle-500);
  color: var(--neutral-900);
}
.reiter.gewaehlt,
.reiter.gewaehlt:hover {
  background: var(--action);
  border-color: var(--action);
  color: var(--on-action);
  cursor: default;
}
.reiter .kurz {
  display: none;
}

/* ---------- Formular ---------- */

/* Eine Spalte von 720 in der Mitte, damit klar ist, dass hier etwas zu tun
   ist (Carlo, 19. Oktober 2026). */
.formular {
  display: flex;
  justify-content: center;
  padding: var(--section-space) var(--page-margin);
}
.formular .spalte {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: var(--space-40);
}
.formular .spalte > .text {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}
.formular h2 {
  font-size: var(--type-headline);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: var(--track-headline);
}
.formular .felder,
.anmeldeformular,
.codeformular {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}
fieldset.gruppe {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
fieldset.gruppe legend {
  padding: 0;
  margin-bottom: var(--space-8);
  font-weight: 500;
  line-height: 1.5;
}
.wahlen {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  padding-top: var(--space-4);
}
.nur-buchbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}
.paar {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}
.bestaetigungen {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}
.abschicken {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-12);
}
.fussnote {
  font-size: var(--type-micro);
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Datum und Zeit wählen, nach der Tafel «Frontend – Kalender». Welcher Monat und
   welche Zeiten zu sehen sind, steht im style von lib_zeitwahl(). */
fieldset.zeitwahl > legend {
  margin-bottom: var(--space-12);
}
.datum-und-zeit {
  position: relative;
  display: grid;
  grid-template-columns: 332px minmax(0, 1fr);
  gap: var(--space-32);
  align-items: start;
}
.tagwahl {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}
.monat,
.tagteil {
  display: none;
}
.monatskopf {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  padding-bottom: var(--space-8);
}
.monatsname {
  font-weight: 500;
  text-align: center;
}
.pfeil {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: var(--radius-4);
  cursor: pointer;
}
.pfeil.aus {
  color: var(--text-min);
  cursor: default;
}
.wochentage,
.monatstage {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-4);
}
.wochentage {
  padding-bottom: var(--space-8);
  font-size: var(--type-micro);
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  color: var(--text-secondary);
}
.kalendertag {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: var(--stroke-1) solid transparent;
  border-radius: var(--radius-4);
  line-height: 1.2;
  color: var(--text-muted);
}
.kalendertag.buchbar {
  border-color: var(--text);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.kalendertag.nicht-buchbar {
  border-color: var(--line);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  cursor: pointer;
}
label.kalendertag:hover,
label.pfeil:hover {
  background: var(--periwinkle-500);
  color: var(--neutral-900);
}
fieldset.gruppe legend.tagkopf {
  margin-bottom: var(--space-12);
  font-weight: 400;
}
.tagkopf span {
  display: block;
}
.tagkopf .datum {
  font-weight: 500;
}
.tagkopf .ort {
  color: var(--text-secondary);
}
.tagteile .wahlen.zeiten {
  flex-direction: column;
  align-items: stretch;
  padding-top: 0;
}
.tagteile .wahl {
  display: flex;
}
.tagteile .wahl span {
  width: 100%;
  justify-content: center;
}
.tagteile .hinweisbox {
  gap: var(--space-12);
}
.codeanzeige {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  padding: var(--space-32);
  border-radius: var(--radius-4);
  background: var(--surface-periwinkle);
}
.codeanzeige .codekopf {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.codeanzeige .label {
  font-weight: 500;
}
.codeanzeige .code {
  font-size: var(--type-display-m);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}
.uebermittlung {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

/* In der Übermittlung ist der Text das Wichtigste der ganzen Seite und steht
   darum in text statt text-secondary, eine Überschreibung an den Instanzen
   wie im AnmeldeTool.pen (Carlo, 28. Oktober 2026). Die Warnung behält ihre
   eigene Farbe. */
.uebermittlung .resultat .text,
.uebermittlung .baustein .text {
  color: var(--text);
}
.abschluss {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

/* ---------- Blöcke ---------- */

/* Kartengruppe auf der Startseite, die drei Wege als Karten (Carlo,
   27. Oktober 2026). Die ganze Karte ist der Link und folgt dem primären
   Knopf, im Hover periwinkle-500 mit schwarzer Schrift. */
.kartengruppe {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
  padding: var(--space-96) var(--rand);
}
.kartengruppe h2 {
  font-size: var(--type-headline);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: var(--track-headline);
}
.karten {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-24);
}
.karte {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  padding: var(--space-40);
  border-radius: var(--radius-4);
  background: var(--action);
  color: var(--on-action);
  text-decoration: none;
  transition:
    background-color 150ms,
    color 150ms;
}
.karte .titel {
  font-size: var(--type-headline);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: var(--track-headline);
}
.karte .text {
  line-height: 1.5;
}
/* Eigene Klasse wie in der Library, damit die Regel der Monatspfeile im
   Kalender hier nicht greift (Carlo, 26. November 2026). */
.karte .pfeilzeile {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding: var(--space-8) 0;
}
.karte:hover {
  background: var(--periwinkle-500);
  color: var(--neutral-900);
}
.karte:active {
  background: var(--action);
  color: var(--on-action);
}

.band,
.aufklappgruppe,
.linkgruppe,
.textgruppe {
  padding: var(--section-space) var(--rand);
}
.band h2,
.aufklappgruppe h2,
.linkgruppe h2,
.textgruppe h2,
.cta h2 {
  font-size: var(--type-headline);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: var(--track-headline);
}

/* Band. Erklärung links, Fakten rechts, auf surface-blossom. */
.band {
  background: var(--surface-blossom);
}
.band .zeile {
  display: flex;
  align-items: center;
  gap: var(--space-64);
}
.band .erklaerung {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}
.band .kern {
  font-size: var(--type-lead);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.2px;
}
.fakten {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.fakt {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12);
  border-radius: var(--radius-4);
  background: var(--surface-subtle);
  line-height: 1.45;
  color: var(--text-muted);
}
.fakt .icon {
  color: var(--text-min);
}

/* Aufklappgruppe. Jeder Aufklapper geht über details auf, das Plus wird zum
   Minus, die Antwort steht rechts. */
.aufklappgruppe,
.linkgruppe,
.textgruppe {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}
.aufklappgruppe .liste,
.textgruppe .liste,
.linkgruppe .zeilen {
  border-top: var(--stroke-1) solid var(--line);
}
.aufklapper {
  border-bottom: var(--stroke-1) solid var(--line);
}
.aufklapper > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-16) 0;
  cursor: pointer;
}
.aufklapper > summary::-webkit-details-marker {
  display: none;
}
.aufklapper .titel {
  flex: 1 1 auto;
  font-size: var(--type-lead);
  font-weight: 700;
  line-height: 1.3;
}
.aufklapper .minus,
.aufklapper[open] .plus {
  display: none;
}
.aufklapper[open] .minus {
  display: block;
}
.aufklapper .inhalt {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-48);
  padding: var(--space-4) 0 var(--space-24);
}
.listenpunkt {
  grid-column: 2;
  display: flex;
  gap: var(--space-12);
}
.listenpunkt .punkt {
  position: relative;
  flex: none;
  width: 24px;
  height: 20px;
}
.listenpunkt .punkt::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--text-min);
}
.listenpunkt .bezeichnung {
  font-weight: 700;
}
.listenpunkt p:not(.bezeichnung) {
  color: var(--text-secondary);
}
/* Unter der Bezeichnung steht der Gap aus «Listenpunkt mit Titel» in der
   Library. Eine längere Antwort hat mehrere Absätze, mit demselben Abstand wie
   im Textblock (Carlo, 23. November 2026). */
.listenpunkt .bezeichnung + p {
  margin-top: var(--space-4);
}
.listenpunkt p:not(.bezeichnung) + p {
  margin-top: var(--space-16);
}

/* Linkgruppe aus Themenzeilen. Die ganze Zeile ist der Link. */
.linkgruppe .kopf {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}
.linkgruppe .einleitung {
  max-width: 680px;
  font-size: var(--type-lead);
  line-height: 1.45;
}
.themenzeile {
  display: flex;
  align-items: center;
  gap: var(--space-48);
  padding: var(--space-24) 0;
  border-bottom: var(--stroke-1) solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.themenzeile .titel {
  flex: 1 1 0;
  font-size: var(--type-lead);
  font-weight: 700;
  line-height: 1.3;
}
.themenzeile .rechts {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: var(--space-24);
}
.themenzeile .text {
  flex: 1 1 auto;
  color: var(--text-secondary);
}
.themenzeile:hover .titel {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* Textgruppe aus Textblöcken, Titel links, Text rechts. */
.textblock {
  display: flex;
  gap: var(--space-48);
  padding: var(--space-32) 0;
  border-bottom: var(--stroke-1) solid var(--line);
}
.textblock h3 {
  flex: 1 1 0;
  font-size: var(--type-lead);
  font-weight: 700;
  line-height: 1.3;
}
.textblock .rechts {
  flex: 1 1 0;
}
.textblock .untertitel {
  margin-bottom: var(--space-8);
  font-size: var(--type-heading);
  font-weight: 600;
  line-height: 1.4;
}
.textblock .rechts p + p {
  margin-top: var(--space-16);
}
.textblock .untertitel + p {
  margin-top: 0;
}

/* CTA. Eine Aufforderung mit genau einem Knopf, auf surface-periwinkle. */
.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-48);
  padding: var(--space-48) var(--rand);
  background: var(--surface-periwinkle);
}
.cta .text {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.cta .aktion {
  flex: 1 1 0;
  display: flex;
  justify-content: center;
}

/* ---------- Footer ---------- */

/* Wie auf der Website. Statt der Logos steht die Trägerschaft als Text, bis
   es die Logos gibt (Carlo, 19. Oktober 2026). Die Links laufen wie die
   Navigation über die 2er-Linie, auf dunkler Fläche in neutral-700. */
.footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-48);
  padding: var(--section-space) var(--rand);
}
.footer .oben {
  display: flex;
  gap: var(--page-margin);
}
.footer .adresse {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}
.footer .wortmarke {
  font-size: var(--type-headline);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: var(--track-headline);
}
.footer .anschrift a {
  text-decoration: none;
}
.footer .anschrift a:hover {
  text-decoration: underline;
}
.footer .zeiten {
  font-size: var(--type-micro);
  color: var(--text-secondary);
}
.footer .spalten {
  flex: 1 1 0;
  display: flex;
  gap: var(--space-32);
}
.linkspalte {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}
.linkspalte .titel,
.traegerschaft .titel {
  font-size: var(--type-micro);
  font-weight: 700;
  color: var(--text-secondary);
}
.linkspalte ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}
.linkspalte a {
  border-bottom: var(--stroke-2) solid transparent;
  text-decoration: none;
}
.linkspalte a:hover {
  border-bottom-color: var(--line);
}
.traegerschaft {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  padding-top: var(--space-32);
  border-top: var(--stroke-1) solid var(--line);
}
/* Die Logos unter «Getragen von», einfarbig und hier weiss gefärbt. Die
   Trägerschaft steht zuerst und grösser (Carlo, 21. September und
   23. November 2026). Was nicht in eine Reihe passt, bricht um. */
.traegerschaft .logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-24) var(--space-48);
}
.traegerschaft .logos img {
  display: block;
  width: auto;
  height: var(--space-40);
  filter: brightness(0) invert(1);
}
.traegerschaft .logos li:first-child img {
  height: var(--space-48);
}
.rechtliches {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-12) var(--space-24);
  padding-top: var(--space-24);
  border-top: var(--stroke-1) solid var(--line);
  font-size: var(--type-micro);
  color: var(--text-secondary);
}
.rechtliches .links {
  display: flex;
  gap: var(--space-24);
}
.rechtliches a {
  text-decoration: none;
}
.rechtliches a:hover {
  text-decoration: underline;
}

/* ---------- iPad und Handy ---------- */

/* Unter 1100 klappt die Navigation in ein Menü. Es läuft über details und
   braucht kein Skript. */
@media (max-width: 1099px) {
  .header {
    justify-content: space-between;
    padding: var(--space-8) var(--rand);
  }
  .navigation {
    display: none;
  }
  .header .menue {
    display: block;
  }
  .menue > summary {
    list-style: none;
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 var(--space-12);
    margin-right: calc(-1 * var(--space-12));
    border-radius: var(--radius-4);
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
  }
  .menue > summary::-webkit-details-marker {
    display: none;
  }
  .menue > summary span {
    display: flex;
    align-items: center;
    gap: var(--space-8);
  }
  .menue > summary .auf,
  .menue[open] > summary .zu {
    display: none;
  }
  .menue[open] > summary .auf {
    display: flex;
  }
  .bereiche {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: flex;
    flex-direction: column;
    padding: var(--space-8) var(--rand) var(--space-24);
    background: var(--surface);
    border-bottom: var(--stroke-1) solid var(--line);
  }
  .bereich {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-16);
    padding: var(--space-16) 0;
    border-bottom: var(--stroke-1) solid var(--line);
    font-size: var(--type-display-s);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: -0.8px;
    text-decoration: none;
  }
  .bereich .icon {
    color: var(--text-secondary);
  }
  .bereich.an .icon {
    color: var(--text);
  }
  .bereich.an {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
  }
  .bereichgruppe {
    border-bottom: var(--stroke-1) solid var(--line);
  }
  .bereichgruppe > summary {
    list-style: none;
    border-bottom: 0;
    cursor: pointer;
  }
  .bereichgruppe > summary::-webkit-details-marker {
    display: none;
  }
  .bereichgruppe[open] > summary .icon {
    transform: rotate(180deg);
    color: var(--text);
  }
  .unterseiten {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: 0 0 var(--space-16) var(--space-16);
  }
  .unterseite {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-16);
    min-height: 44px;
    font-size: var(--type-lead);
    font-weight: 500;
    text-decoration: none;
  }
  .unterseite .icon {
    color: var(--text-secondary);
  }
  .unterseite.an {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
  }

  .titelzelle {
    padding: var(--space-64) var(--page-margin) var(--space-64) var(--rand);
  }
  .reiter {
    font-size: var(--type-lead);
  }
  /* Unter den Reitern nur 20, damit sie mit dem Formular darunter eine Gruppe
     bilden und nicht im Leeren stehen (Carlo, 28. Oktober 2026). Auf dem
     Desktop stört der volle Abstand nicht. */
  .reitergruppe {
    padding-bottom: var(--space-20);
  }
  .formular .spalte {
    max-width: none;
    /* Die Library hat auf iPad und Handy 32 zwischen Text und Feldern. */
    gap: var(--space-32);
  }
  .footer .oben {
    flex-direction: column;
    gap: var(--space-32);
  }
}

/* Auf dem Handy steht alles untereinander, das Motiv über dem Titel, und die
   Knöpfe im Formular stehen in der Mitte (Carlo, 19. Oktober 2026). */
@media (max-width: 767px) {
  .feld:has(.codefeld) {
    max-width: none;
  }
  /* Auf dem Handy steht jedes Logo auf einer eigenen Zeile, die Trägerschaft
     40 hoch, die anderen 32. */
  .traegerschaft .logos {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-24);
  }
  .traegerschaft .logos img {
    height: var(--space-32);
  }
  .traegerschaft .logos li:first-child img {
    height: var(--space-40);
  }
  .seitenkopf {
    grid-template-columns: 1fr;
  }
  .motiv {
    order: -1;
    height: 160px;
  }
  .titelzelle {
    padding: var(--section-space) var(--page-margin);
  }
  .reitergruppe {
    gap: var(--space-8);
  }
  .reiter {
    justify-content: center;
    min-height: 44px;
    padding: calc(var(--space-12) - 1px) calc(var(--space-8) - 1px);
    text-align: center;
  }
  .reiter .voll {
    display: none;
  }
  .reiter .kurz {
    display: inline;
  }
  .kartengruppe {
    padding: var(--space-64) var(--rand);
  }
  .karten {
    grid-template-columns: 1fr;
    gap: var(--space-16);
  }
  .karte {
    padding: var(--space-24);
  }
  .wahlen {
    justify-content: center;
  }
  .wahlen.zeiten {
    flex-direction: column;
    align-items: center;
  }
  .datum-und-zeit {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-24);
  }
  .abschicken {
    align-items: center;
  }
  .band .zeile {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-32);
  }
  .aufklapper .inhalt {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }
  .listenpunkt {
    grid-column: 1;
  }
  .themenzeile {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: var(--space-16);
    row-gap: var(--space-4);
    padding: var(--space-16) 0;
  }
  .themenzeile .rechts {
    display: contents;
  }
  .themenzeile .titel,
  .themenzeile .text {
    grid-column: 1;
  }
  .themenzeile .icon {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }
  .textblock {
    flex-direction: column;
    gap: var(--space-12);
    padding: var(--space-24) 0;
  }
  .cta {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-24);
    padding: var(--space-32) var(--rand);
  }
  .footer {
    gap: var(--space-32);
  }
  .footer .spalten {
    flex-wrap: wrap;
    gap: var(--space-32) var(--space-24);
  }
  .linkspalte {
    flex: 1 1 40%;
  }
  .rechtliches {
    flex-direction: column;
  }
  .hinweisbox {
    gap: var(--space-12);
  }
}

@media (min-width: 768px) and (max-width: 1099px) {
  .textblock {
    gap: var(--space-32);
  }
  /* So breit wie eines von zwei Feldern nebeneinander, wie im Entwurf. */
  .feld:has(.codefeld) {
    max-width: calc((100% - var(--space-24)) / 2);
  }
  .cta {
    padding: var(--space-40) var(--rand);
  }
  .reitergruppe {
    gap: var(--space-16);
  }
  .reiter {
    padding: calc(var(--space-16) - 1px) calc(var(--space-24) - 1px);
  }
  .kartengruppe {
    padding: var(--space-64) var(--rand);
  }
  .karten {
    gap: var(--space-16);
  }
  .karte {
    padding: var(--space-24);
  }
}
