/* ===========================================================================
   style.css — Fristenrechner
   ---------------------------------------------------------------------------
   Erscheinungsbild „Messblatt“: kein Radius, kein Schatten, Linien statt
   Flächen, Etiketten in Mono. Am Bildschirm ist die App dunkel (die Seite
   trägt data-thema="dunkel"), der Druck bleibt hell. Die Palette setzt das
   Bauskript der öffentlichen Fassung auf die der Website um.
   =========================================================================== */

:root {
  /* Ohne color-scheme zeichnet der Browser Bildlaufleiste, Schreibcursor,
     Auswahlliste und die Grundfläche eines <button> weiter hell. */
  color-scheme: light;

  /* Verweise auf /gemeinsam/farben.css, vom Bauskript gesetzt */
  --navy: var(--tinte);
  --navy-hell: var(--tinte);
  --navy-zart: var(--marke-zart);
  --blau: var(--marke);
  --blau-text: var(--marke-text);
  --blau-flae: var(--marke);
  --blau-flae-hover: var(--marke-text);
  --auf-navy: var(--auf-akzent);
  --zahl2-schrift: var(--weiss);
  --ziel-zahl2: var(--marke);
  --seite: var(--grund);
  --schatten-karte: var(--schatten);
  --schrift-titel: var(--schrift-gross);

  --gruen:        #1E7A4C;
  --gruen-flae:   #E9F6EE;
  --rot:          #B3261E;
  --rot-flae:     #FDECEA;
  --warn-text:    #8A5A00;
  --warn-flae:    #FFF6E0;

  /* Eine Spalte für alles: Kopfleiste, Inhalt und Fußzeile rücken um
     denselben Betrag ein. */
  --spalte:       1000px;
  --rand:         24px;
  --einzug:       max(var(--rand), calc((100% - var(--spalte)) / 2 + var(--rand)));
}

* { box-sizing: border-box; }

/* Muss vor allem anderen stehen: sonst gewinnt jedes spätere `display`
   gegen das hidden-Attribut. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 {
  font-family: var(--schrift-titel);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.02em;
  margin: 0;
}

/* Erklärtexte sollen keine Wortreste in der letzten Zeile lassen. */
p, li { text-wrap: pretty; }
/* Ein Satz je Zeile: satzweise() in app.js setzt jeden Satz in einen eigenen
   Block. pretty schützt nur die letzte Zeile des ganzen Absatzes, balance
   bricht jeden Satz für sich um, ohne Rest von ein, zwei Wörtern. */
span.satz { display: block; text-wrap: balance; }

/* Kürzel mit Langform (seit 02.11.2026, app.js setzt sie). Leise
   gepunktet, weil WT in fast jeder Regel steht; die Maus zeigt die
   Langform. */
abbr[title] {
  text-decoration: underline dotted;
  text-decoration-color: var(--text-still);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: help;
}
abbr[title]:hover { text-decoration-color: var(--blau-text); }


/* ===== Kopfleiste ======================================================== */

.kopfleiste {
  display: flex; align-items: center; gap: 22px;
  padding: 10px var(--einzug);
  background: var(--weiss);
  border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 20;
}

.marke-block {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 4px 6px;
  cursor: pointer; font-family: var(--schrift); text-align: left;
  flex: none;
}
.marke-block:hover { background: var(--grund); }
.marke-block:focus-visible { outline: 2px solid var(--blau); outline-offset: 1px; }

.marke-strich { width: 22px; height: 6px; background: var(--blau); flex: none; }
.marke-stapel { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.marke-text { font-family: var(--schrift-titel); font-size: 17px; font-weight: 800; color: var(--navy); }
.marke-autor { font-size: 12px; color: var(--text-still); }

.reiter { display: flex; gap: 4px; flex: none; }

.reiter-knopf {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 12px; font-family: var(--schrift, inherit); font-size: 13.5px; font-weight: 600; letter-spacing: .005em; text-transform: none;
  color: var(--text-still); cursor: pointer;
}
.reiter-knopf:hover { color: var(--navy); }
.reiter-knopf.aktiv { color: var(--navy); border-bottom-color: var(--blau); }
.reiter-knopf:focus-visible { outline: 2px solid var(--blau); outline-offset: -2px; }


/* ===== Knöpfe und Felder ================================================= */

.knopf {
  font-family: var(--schrift); font-size: 15px; font-weight: 600;
  padding: 10px 20px;
  border: 1px solid var(--blau-flae); cursor: pointer;
  background: var(--blau-flae); color: var(--auf-akzent);
}
.knopf:hover, .knopf:focus-visible { background: transparent; color: var(--blau-text); }

.knopf-mini {
  font-family: var(--schrift); font-size: 13px; font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--linie-stark); background: transparent;
  color: var(--navy); cursor: pointer;
}
.knopf-mini:hover { border-color: var(--blau); }

.knopf:focus-visible, .knopf-mini:focus-visible,
input:focus-visible, select:focus-visible {
  outline: 2px solid var(--blau); outline-offset: 2px;
}

select, input[type="date"], input[type="number"], input[type="text"] {
  font-family: var(--schrift); font-size: 15px;
  padding: 9px 11px;
  border: 1px solid var(--linie-stark);
  background: var(--weiss); color: var(--text);
  min-width: 0;
}


/* ===== Grundgerüst ======================================================= */

.mitte {
  display: flex; flex-direction: column; gap: 18px;
  padding: 26px var(--einzug) 60px;
}

.ansicht { display: flex; flex-direction: column; gap: 18px; }

.tafel {
  background: var(--weiss);
  border: 1px solid var(--linie-stark);
  padding: 20px 22px;
}

.tafel-titel { font-size: 17px; margin-bottom: 14px; }

.tafel-fuss {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--linie);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.tafel-fuss .knopf-mini { margin-left: auto; }

.held { padding: 8px 2px 0; }
.held h1 { font-size: 29px; margin-bottom: 10px; }
.held-text { max-width: 64ch; margin: 0; color: var(--text-still); }

.augenmarke {
  display: block;
  font-family: var(--schrift, inherit); font-size: 13.5px; font-weight: 600; letter-spacing: .005em; text-transform: none; color: var(--blau-text);
  margin-bottom: 5px;
}

.leermeldung { margin: 0; color: var(--text-still); }


/* ===== Eingabezeile ====================================================== */

/* Prozess und Datum stehen nebeneinander, solange Platz ist. Die Beschriftung
   sitzt über dem Feld: nebeneinander rutschte sie bei langen Prozessnamen
   aus der Zeile. */
.eingabe-zeile { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }

.feld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.feld-weit { flex: 1 1 320px; }
.feld label { font-family: var(--schrift, inherit); font-size: 13.5px; font-weight: 600; letter-spacing: .005em; text-transform: none; color: var(--text-still); }
.feld select, .feld input { width: 100%; }

.anker-hinweis { margin: 12px 0 0; font-size: 14px; color: var(--text-still); max-width: 72ch; }


/* ===== Kopftafel des Fahrplans =========================================== */

.tafel-anker { border-top: 2px solid var(--blau); }

.anker-zeile { display: flex; gap: 28px; flex-wrap: wrap; justify-content: space-between; }

.anker-marke {
  display: block;
  font-family: var(--schrift, inherit); font-size: 13.5px; font-weight: 600; letter-spacing: .005em; text-transform: none; color: var(--blau-text);
  margin-bottom: 2px;
}

.anker-datum { font-family: var(--schrift-titel); font-size: 24px; color: var(--navy); }
.kein-werktag { display: block; margin-top: 2px; font-size: 13.5px; color: var(--text-still); }

.korridor { text-align: right; }
.korridor strong { font-size: 16px; color: var(--navy); }
.korridor .fp-quelle { justify-content: flex-end; }

.feiertagszeile {
  margin: 14px 0 0; padding-top: 12px;
  border-top: 1px solid var(--linie-stark);
  font-size: 13.5px; color: var(--text-still);
}


/* ===== Fahrplan ========================================================== */

.fahrplan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }

.fp-zeile {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 0;
  border-top: 1px solid var(--linie);
}
.fp-zeile:first-child { border-top: 0; padding-top: 0; }

.fp-nr {
  flex: none;
  width: 26px; height: 26px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--navy); color: var(--auf-navy);
  font-family: var(--schrift-titel); font-size: 13px; font-weight: 800;
}

.fp-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fp-name { font-size: 15.5px; color: var(--navy); }
.fp-nachricht { font-size: 12.5px; font-weight: 600; color: var(--blau-text); }
.fp-regel { font-size: 14px; color: var(--text); }
.fp-hinweis { font-size: 13.5px; color: var(--text-still); max-width: 66ch; }
.fp-quelle { display: block; font-size: 12px; color: var(--text-still); }
.fp-quelle a { color: var(--blau-text); text-underline-offset: 2px; }
/* Schrittname, Regel und Fundstelle sind kurze Zeilen ohne Satztrennung.
   balance bricht sie ausgewogen um, am Handy bliebe sonst ein Wort allein
   in der letzten Zeile (Optik-Prüfung 19.10.2026). Hinweis und Nachricht
   stehen schon in span.satz. */
.fp-name, .fp-regel, .fp-quelle { text-wrap: balance; }

.fp-daten { flex: none; display: flex; flex-direction: column; gap: 6px; text-align: right; }
.fp-datum strong { font-family: var(--schrift-titel); font-size: 16px; color: var(--navy); white-space: nowrap; }
.fp-datum-marke { display: block; font-family: var(--schrift, inherit); font-size: 13.5px; font-weight: 600; letter-spacing: .005em; text-transform: none; color: var(--text-still); }

.fp-zwischen {
  font-family: var(--schrift, inherit); font-size: 13.5px; font-weight: 600; letter-spacing: .005em; text-transform: none; color: var(--text-still);
  margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--linie-stark);
}

.fahrplan-zusatz .fp-nr { background: transparent; color: var(--blau-text); border: 1px dashed var(--linie-stark); }

/* Lage zum Anker (ZE−13) neben der Marke über dem Datum, auch in der
   Kopftafel. Ohne Großschreibung, damit „bis“ im Korridor lesbar bleibt. */
.fp-lage {
  margin-left: 2px;
  letter-spacing: 0; text-transform: none;
  font-family: var(--schrift); font-size: 12.5px; font-weight: 600;
  color: var(--blau-text);
}

/* Bezug auf heute. Was vorbei ist, tritt über die Schriftfarbe zurück,
   nicht über die Deckkraft: So bleibt der Kontrast über 4,5 : 1. */
.fp-vorbei .fp-name,
.fp-vorbei .fp-regel,
.fp-vorbei .fp-datum strong { color: var(--text-still); }
.fp-vorbei .fp-nr { background: transparent; color: var(--text-still); box-shadow: inset 0 0 0 1px var(--linie-stark); }
.fp-naechster .fp-nr { background: var(--blau-flae); }

.heute-marke {
  display: block; width: fit-content;
  margin-top: 4px; padding: 1px 8px;
  border: 1px solid var(--blau-text);
  font-size: 12.5px; font-weight: 700;
  color: var(--blau-text);
}
.heute-marke.heute-heute  { color: var(--warn-text); border-color: var(--warn-text); }
.heute-marke.heute-vorbei { color: var(--rot); border-color: var(--rot); }
.fp-datum .heute-marke { margin-left: auto; }
.tafel-ergebnis .heute-marke { margin-top: 2px; font-size: 13.5px; }

.merker { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.merker li { font-size: 14px; color: var(--text-still); max-width: 76ch; }


/* ===== Ergebnis einer einzelnen Frist ==================================== */

.tafel-ergebnis { display: flex; flex-direction: column; gap: 4px; }
.ergebnis-datum { font-family: var(--schrift-titel); font-size: 30px; color: var(--navy); line-height: 1.15; }
.ergebnis-regel { margin: 4px 0 0; font-size: 15px; }
.ergebnis-ab { margin: 0; font-size: 14px; color: var(--text-still); }
.ergebnis-ab strong { color: var(--text); }
.ergebnis-feiertage {
  margin: 10px 0 0; padding: 9px 0 0;
  border-top: 1px solid var(--warn-text);
  font-size: 13.5px; color: var(--warn-text);
  text-wrap: balance;
}
/* Ein Feiertag bricht nicht in sich um („1. | Weihnachtstag“) */
.ergebnis-feiertage .am-stueck { white-space: nowrap; }
.ergebnis-feiertage .fei-zeile { display: block; }
.ergebnis-hinweis { margin: 10px 0 0; font-size: 14px; color: var(--text-still); max-width: 72ch; }

/* PIDs: Eingang und Antwort je eine Zeile, die Nummern führen in die
   PID-Karte der MSB-Quellensuche. */
.ergebnis-pid { margin: 6px 0 0; font-size: 13.5px; font-weight: 600; color: var(--blau-text); }
.ergebnis-pid > span { display: block; }
.ergebnis-pid a, .fp-nachricht a { color: inherit; text-underline-offset: 2px; }
.fp-hinweis a, .merker a, .ergebnis-hinweis a, .pid-meldung a { color: var(--blau-text); text-underline-offset: 2px; }

.feld-pid { flex: 0 0 130px; }
.feld-pid input { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.pid-meldung { margin: 12px 0 0; font-size: 14px; color: var(--text-still); max-width: 72ch; }
.pid-meldung strong { color: var(--text); }
/* Regel und PID-Meldung sind kurze Zeilen, am Handy stand das letzte Wort
   allein (Optik-Prüfung 19.10.2026). */
.ergebnis-regel, .pid-meldung { text-wrap: balance; }
.pid-wahl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pid-wahl .knopf-mini[aria-pressed="true"] { border-color: var(--blau); color: var(--blau-text); }


/* ===== Technische Fristen ================================================ */

.tech-zeile {
  display: flex; gap: 20px; justify-content: space-between; align-items: flex-start;
  padding: 13px 0; border-top: 1px solid var(--linie);
}
.tech-zeile:first-child { border-top: 0; padding-top: 0; }
.tech-zeile > div { display: flex; flex-direction: column; gap: 3px; }
.tech-zeile strong { color: var(--navy); }
.tech-frist { text-align: right; flex: none; max-width: 42%; }
.tech-frist strong { font-family: var(--schrift-titel); font-size: 16px; }

.tech-merker {
  margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--linie-stark);
  font-size: 13.5px; color: var(--text-still);
}


/* ===== Werktagsrechner =================================================== */

.rechner-gitter { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rechner-ausgabe { margin-top: 16px; display: flex; flex-direction: column; gap: 2px; }
.rechner-ausgabe .ergebnis-datum { font-size: 24px; }


/* ===== Grafiken ==========================================================
   Zeitstrahl über der Liste im Fahrplan, Werktagsleiste bei Antwortfrist
   und freier Rechnung. Farben nur aus den Token oben, damit der
   Dunkelmodus mitgeht. Heute ist in beiden die Warnfarbe wie bei
   „heute“ in der Liste, der Anker Blau wie die Kopftafel. */

.zeitstrahl { margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--linie); }
.zeitstrahl-svg { display: block; overflow: hidden; }

.zs-frei { fill: var(--grund); }
.zs-feiertag { fill: url(#zs-schraffur); }
.zs-schraffur-grund { fill: var(--grund); }
.zs-schraffur-strich { stroke: var(--linie-stark); stroke-width: 2; }
.zs-achse { stroke: var(--linie-stark); stroke-width: 1; }
.zs-achse-text { font-size: 12px; fill: var(--text-still); }

.zs-anker { stroke: var(--blau); stroke-width: 2; }
.zs-anker-text, .zs-heute-text {
  font-size: 12.5px; font-weight: 700; fill: var(--blau-text);
  paint-order: stroke; stroke: var(--weiss); stroke-width: 4px; stroke-linejoin: round;
}
.zs-korridor { fill: var(--navy-zart); stroke: var(--blau); stroke-width: 1; }
.zs-korridor-text { font-size: 12px; font-weight: 600; fill: var(--blau-text); }
.zs-heute { stroke: var(--warn-text); stroke-width: 1.5; stroke-dasharray: 4 3; }
.zs-heute-text { fill: var(--warn-text); }

.zs-zeile { cursor: pointer; }
.zs-flaeche { fill: transparent; }
.zs-zeile:hover .zs-flaeche, .zs-hervor .zs-flaeche { fill: var(--navy-zart); }
.zs-bezug { fill: none; stroke: var(--linie-stark); stroke-width: 1.25; }
.zs-zeile:hover .zs-bezug, .zs-hervor .zs-bezug { stroke: var(--blau); }

.zs-nr { fill: var(--navy); }
.zs-nr-text { font-family: var(--schrift-titel); font-size: 12px; font-weight: 800; fill: var(--auf-navy); }
.zs-zusatz .zs-nr { fill: var(--weiss); stroke: var(--linie-stark); stroke-dasharray: 2 2; }
.zs-zusatz .zs-nr-text { fill: var(--blau-text); }
.zs-naechster .zs-nr { fill: var(--blau-flae); }
.zs-vorbei .zs-nr { fill: var(--weiss); stroke: var(--linie-stark); }
.zs-vorbei .zs-nr-text { fill: var(--text-still); }
.zs-vorbei .zs-nr-text { fill: var(--text); }

.zs-punkt { fill: var(--navy); }
.zs-naechster .zs-punkt { fill: var(--blau-flae); }
.zs-vorbei .zs-punkt { fill: var(--text-still); }
.zs-punkt-offen { fill: var(--weiss); stroke: var(--navy); stroke-width: 2; }
.zs-fenster { fill: var(--navy-zart); stroke: var(--blau); stroke-width: 1; }
.zs-vorbei .zs-fenster { fill: var(--grund); stroke: var(--linie-stark); }

/* Beschriftung mit einem Rand in der Tafelfarbe, damit sie über Streifen
   und Linien lesbar bleibt */
.zs-text {
  font-size: 12.5px; fill: var(--text);
  paint-order: stroke; stroke: var(--weiss); stroke-width: 4px; stroke-linejoin: round;
}
.zs-text-innen { fill: var(--navy); stroke: var(--navy-zart); }
.zs-name {
  font-size: 12.5px; fill: var(--text-still);
  paint-order: stroke; stroke: var(--weiss); stroke-width: 4px; stroke-linejoin: round;
}
.zs-name-innen { stroke: var(--navy-zart); }
.zs-vorbei .zs-text { fill: var(--text-still); }
.zs-abstand { font-weight: 700; fill: var(--blau-text); }
.zs-abstand-heute { fill: var(--warn-text); }

/* Als Zeilentext mit balance: Reicht eine Zeile nicht, teilen sich zwei
   die Einträge, statt einen allein in die zweite zu stellen. */
.zs-legende {
  margin: 10px 0 0; line-height: 22px; text-wrap: balance;
  font-size: 12.5px; color: var(--text-still);
}
.zs-leg { display: inline-flex; align-items: center; gap: 7px; margin-right: 14px; white-space: nowrap; vertical-align: middle; }
.zs-leg-marke { display: inline-block; flex: none; width: 20px; height: 12px; }
.zs-leg-fenster { background: var(--navy-zart); border: 1px solid var(--blau); }
.zs-leg-bezug { height: 10px; border-left: 1.25px solid var(--linie-stark); border-bottom: 1.25px solid var(--linie-stark); width: 14px; }
.zs-leg-frei { background: var(--grund); border: 1px solid var(--linie); }
.zs-leg-feiertag, .wl-feiertag {
  background: repeating-linear-gradient(135deg, var(--grund) 0 3px, var(--linie-stark) 3px 4.5px);
}
.zs-leg-heute { width: 0; height: 14px; border-left: 1.5px dashed var(--warn-text); }

/* Eintrag in der Liste, über dessen Zeile im Zeitstrahl die Maus steht.
   Negativer Rand und Innenabstand ziehen die Fläche ein Stück über den Rand hinaus. */
.fp-zeile.fp-hervor {
  background: var(--navy-zart);
  margin: 0 -10px; padding-left: 10px; padding-right: 10px;
}
.fp-zeile.fp-blitz { animation: fp-blitz 1.4s ease-out; margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
@keyframes fp-blitz {
  0%, 30% { background: var(--navy-zart); }
}

/* Die Schritte erscheinen in ihrer Reihenfolge, die Fenster wachsen vom
   frühesten zum spätesten Tag. */
.zs-bewegt .zs-zeile { animation: zs-auf .26s ease-out backwards; animation-delay: var(--v, 0ms); }
.zs-bewegt .zs-fenster {
  transform-box: fill-box; transform-origin: left center;
  animation: zs-wachsen .34s ease-out backwards; animation-delay: var(--v, 0ms);
}
@keyframes zs-auf { from { opacity: 0; } }
@keyframes zs-wachsen { from { transform: scaleX(0); } }

/* Ablauf: der Player im Kasten des Zeitstrahls (ablauf.js, app.js).
   Zeitstrahl und Player liegen übereinander und blenden in 150 ms um, der
   Kasten behält die Höhe des Zeitstrahls und wächst nur, wenn der Player
   höher ist. Farben nur aus den Token, damit der Dunkelmodus mitgeht. */
.ablauf-kasten { position: relative; margin: 0 0 16px; }
.ablauf-kasten .zeitstrahl { margin-bottom: 0; }
.ab-a, .ab-b { transition: opacity .15s ease, visibility 0s; }
.ab-b {
  position: absolute; top: 0; left: 0; right: 0;
  visibility: hidden; opacity: 0; pointer-events: none;
  padding-bottom: 14px; border-bottom: 1px solid var(--linie);
  transition: opacity .15s ease, visibility 0s .15s;
}
.ablauf-kasten.ab-an .ab-a {
  position: absolute; top: 0; left: 0; right: 0;
  visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity .15s ease, visibility 0s .15s;
}
.ablauf-kasten.ab-an .ab-b {
  position: static; visibility: visible; opacity: 1; pointer-events: auto;
  transition: opacity .15s ease, visibility 0s;
}

/* Titelzeile der Tafel mit Player: Überschrift links, Knopf rechts. Die
   negativen Ränder des Knopfes halten die Zeile so hoch wie die Überschrift
   allein (Zeilenhöhe 1,55 mal 17 px), die Tafel wird nicht höher. */
.tafel-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tafel-kopf .tafel-titel { margin: 0; min-width: 0; }
.tafel-kopf .ab-start { flex: none; margin: -6px 0; }
.ab-start { display: inline-flex; align-items: center; gap: 7px; }
/* Solange der Player offen ist, bleibt der Knopf nur als Platzhalter stehen (die Titelzeile springt nicht) */
.ab-start.ab-weg { visibility: hidden; }
.ab-ico { display: block; fill: currentColor; }

.ab-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.ab-kopf-text { margin: 0; flex: 1; min-height: 40px; padding-top: 5px; font-size: 14px; font-weight: 600; color: var(--navy); text-wrap: balance; }
.ab-knoepfe { display: flex; gap: 6px; flex: none; }
.ab-haupt { background: var(--blau-flae); border-color: var(--blau-flae); color: var(--auf-akzent); min-width: 88px; }
.ab-haupt:hover, .ab-haupt:focus-visible { background: transparent; color: var(--blau-text); }

.ab-svg { display: block; overflow: hidden; }
.ab-fuss { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; }
/* Eine Zeile der Fußzeile: Teile nebeneinander, getrennt durch „ · “ */
.ab-zeile { display: flex; flex-wrap: wrap; align-items: baseline; }
.ab-zeile > * { min-width: 0; }
.ab-punkt { flex: none; color: var(--text-still); white-space: pre; }
/* Ansage für Screenreader: Kopf und Fuß zusammen, nicht sichtbar */
.ab-ansage { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.ab-nur-text { font-size: 13.5px; font-weight: 700; color: var(--warn-text); }

.ab-bahn { fill: var(--grund); }
.ab-bahn-2 { fill: var(--weiss); }
.ab-trenner { stroke: var(--linie); stroke-width: 1; }
.ab-rolle { font-size: 12.5px; font-weight: 700; fill: var(--navy); }

.ab-zeitlinie { stroke: var(--linie-stark); stroke-width: 1.5; }
.ab-strich { stroke: var(--text-still); stroke-width: 1.25; }
.ab-anker-strich { stroke: var(--blau); stroke-width: 2; }
.ab-anker-text {
  font-size: 12.5px; font-weight: 700; fill: var(--blau-text);
  paint-order: stroke; stroke: var(--weiss); stroke-width: 4px; stroke-linejoin: round;
}
.ab-zeitmarke { fill: var(--blau-flae); }

.ab-umriss { fill: none; stroke: var(--linie-stark); stroke-width: 1; opacity: .7; }
.ab-umriss-linie { stroke: var(--linie-stark); stroke-width: 1; opacity: .7; }
.ab-nur { stroke-dasharray: 4 3; }

.ab-kasten { fill: var(--weiss); stroke: var(--linie-stark); stroke-width: 1; }
.ab-aktion { font-size: 12px; fill: var(--text); }
.ab-feld-voll { fill: var(--navy); }
.ab-feld-leer { fill: none; stroke: var(--navy); stroke-width: 1; }
.ab-pid { font-size: 12px; font-weight: 600; }
.ab-pid-voll { fill: var(--auf-navy); }
.ab-pid-leer { fill: var(--blau-text); }
.ab-pfeil { stroke: var(--navy); stroke-width: 1.5; }
.ab-spitze { fill: var(--navy); }
.ab-umschlag-flaeche { fill: var(--weiss); stroke: var(--blau); stroke-width: 1.25; }
.ab-umschlag-klappe { stroke: var(--blau); stroke-width: 1.25; }

.ab-marken-linie { stroke: var(--navy); stroke-width: 1.75; }
.ab-marken-text {
  font-size: 12px; font-weight: 700; fill: var(--text-still);
  paint-order: stroke; stroke: var(--weiss); stroke-width: 3px; stroke-linejoin: round;
}

/* aktuell: voll, gespielt: gedämpft, kommend: nur blass umrandet */
.ab-aktuell .ab-kasten { fill: var(--navy-zart); stroke: var(--blau); stroke-width: 1.5; }
.ab-aktuell .ab-pfeil { stroke: var(--blau); }
.ab-aktuell .ab-spitze { fill: var(--blau); }
.ab-aktuell .ab-marken-linie { stroke: var(--blau); }
.ab-aktuell .ab-marken-text { fill: var(--blau-text); }
.ab-gespielt { opacity: .55; }
/* fertig: Endstand, alles voll wie eine fertige Tafel, keiner hervorgehoben */
.ab-kommend .ab-marken-text { opacity: .55; }

/* Werktagsleiste: eine Woche je Zeile */
.ergebnis-oben { display: flex; gap: 28px; align-items: flex-start; justify-content: space-between; }
.ergebnis-links { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ergebnis-oben > .werktagsleiste { flex: 0 0 384px; margin-top: 2px; }
.rechner-ausgabe .werktagsleiste { margin-top: 14px; }

.wl-gitter { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.wl-kopf { font-family: var(--schrift, inherit); font-size: 12.5px; font-weight: 600; letter-spacing: .005em; text-transform: none; color: var(--text-still); text-align: center; padding-bottom: 1px; }
.wl-tag {
  position: relative; height: 42px;
  border: 1px solid var(--linie-stark);
  background: var(--weiss);
}
.wl-datum { position: absolute; top: 3px; left: 5px; font-size: 12px; line-height: 14px; color: var(--text-still); }
.wl-zahl {
  position: absolute; right: 6px; bottom: 3px;
  font-family: var(--schrift-titel); font-size: 16px; font-weight: 800; line-height: 18px; color: var(--navy);
}
/* Die zweite Zählung unten links. Zählt ein Tag in beiden, tritt die
   erste Zahl zurück, sie ist dort schon abgeschlossen. */
.wl-zahl2 {
  position: absolute; left: 3px; bottom: 5px; padding: 0 3px;
  font-size: 12px; font-weight: 700; line-height: 16px;
  color: var(--zahl2-schrift); background: var(--blau-text);
}
.wl-doppelt .wl-zahl { font-size: 13px; font-weight: 700; line-height: 16px; color: var(--text-still); bottom: 5px; }
.wl-frei { background: var(--grund); border-color: var(--linie); }
.wl-feiertag { border-color: var(--linie); }
.wl-aus { background: transparent; border: 1px dashed var(--linie); }
.wl-aus .wl-datum { color: var(--text-still); }
.wl-null { border: 2px solid var(--blau); }
.wl-null .wl-zahl { color: var(--blau-text); }
.wl-wende { border: 2px solid var(--blau); }
.wl-ziel { background: var(--blau-flae); border: 2px solid var(--blau-flae); }
.wl-ziel .wl-datum, .wl-ziel .wl-zahl, .wl-ziel.wl-doppelt .wl-zahl { color: var(--auf-akzent); }
.wl-ziel .wl-zahl2 { color: var(--ziel-zahl2); background: var(--auf-akzent); }
.wl-heute { outline: 2px solid var(--warn-text); outline-offset: 2px; z-index: 1; }
.wl-luecke {
  grid-column: 1 / -1; padding: 5px 8px;
  border: 1px dashed var(--linie-stark);
  font-size: 12.5px; color: var(--text-still); text-align: center; text-wrap: balance;
}
.wl-luecke > span { display: inline-block; }

/* Zwei feste Spalten, damit kein Eintrag allein in einer Zeile steht */
.wl-legende {
  margin: 8px 0 0; display: grid; grid-template-columns: max-content max-content; gap: 4px 18px;
  font-size: 12.5px; color: var(--text-still);
}
.wl-leg { display: inline-flex; align-items: center; gap: 6px; }
.wl-leg-marke {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 18px; height: 16px; border: 1px solid var(--linie-stark);
  font-size: 12px; font-weight: 800; color: var(--blau-text); background: var(--weiss);
}
.wl-leg-marke.wl-null { border: 2px solid var(--blau); }
.wl-leg-marke.wl-heute { outline: 2px solid var(--warn-text); outline-offset: 1px; }
.wl-leg-marke.wl-zahl2-marke {
  width: auto; padding: 0 4px; border: 0;
  color: var(--zahl2-schrift); background: var(--blau-text);
}

.wl-bewegt .wl-zahl, .wl-bewegt .wl-zahl2 { animation: wl-auf .2s ease-out backwards; animation-delay: var(--v, 0ms); }
@keyframes wl-auf { from { opacity: 0; transform: translateY(3px); } }


/* ===== Fußzeile ========================================================== */

.fusszeile {
  margin: 0 var(--einzug);
  padding: 16px 0 32px;
  font-size: 13px; color: var(--text-still);
  border-top: 1px solid var(--linie-stark);
  display: flex; flex-direction: column; gap: 4px;
}
/* Link zur Überblicksseite, setzt nur das Bauskript der öffentlichen Fassung */
.fusszeile a { color: inherit; text-underline-offset: 2px; }
.fusszeile a:hover { color: var(--blau-text); }


/* ===========================================================================
   DUNKELMODUS
   Werte wie im MSB-Quiz: die Hausfarben bleiben erkennbar, werden aber
   aufgehellt, weil Blau und Marineblau auf dunklem Grund sonst zu wenig
   Kontrast haben.
   =========================================================================== */

@media screen {
  :root[data-thema="dunkel"] {
    color-scheme: dark;

    --gruen:        #74C995;
    --gruen-flae:   #1A2E27;
    --rot:          #FF8A80;
    --rot-flae:     #35221F;
    --warn-text:    #EADCA4;
    --warn-flae:    #2E2618;
    --schatten-karte: none;
  }

  /* BEIDE Elemente, nicht nur body: der Hintergrund von <html> bemalt die
     gesamte Fläche, <body> nur seinen eigenen Kasten. */
  :root[data-thema="dunkel"],
  :root[data-thema="dunkel"] body { background: var(--seite); }

  /* Die Nummernkreise tragen im Dunkeln helles Blau, die Schrift darauf
     kommt aus --auf-navy. */
  :root[data-thema="dunkel"] .fp-vorbei .fp-nr { color: var(--text); }
  :root[data-thema="dunkel"] .fp-naechster .fp-nr { background: var(--blau); }
  :root[data-thema="dunkel"] .zs-zusatz .zs-nr-text { fill: var(--blau-text); }
  :root[data-thema="dunkel"] .zs-vorbei .zs-nr-text { fill: var(--text); }
  :root[data-thema="dunkel"] .zs-naechster .zs-nr,
  :root[data-thema="dunkel"] .zs-naechster .zs-punkt { fill: var(--blau); }
}


/* ===== Schmale Fenster =================================================== */

@media (max-width: 860px) {
  :root { --rand: 16px; }
  .kopfleiste { gap: 12px; flex-wrap: wrap; }
  .marke-autor { display: none; }
  .rechner-gitter { grid-template-columns: 1fr; }
  .anker-zeile { gap: 14px; }
  .korridor { text-align: left; }
  .korridor .fp-quelle { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .held h1 { font-size: 24px; }
  /* Datum unter den Text, nicht daneben: sonst bleiben für den Namen des
     Schritts zwei Wörter je Zeile. */
  .fp-zeile { flex-wrap: wrap; }
  .fp-daten { flex-direction: row; gap: 16px; text-align: left; margin-left: 40px; }
  .fp-datum .heute-marke { margin-left: 0; }
  .tech-zeile { flex-direction: column; gap: 6px; }
  .tech-frist { text-align: left; max-width: none; }
  .anker-datum { font-size: 21px; }
  .ergebnis-datum { font-size: 25px; }
}


/* ===== Bewegung: wer sie abbestellt hat, bekommt keine =================== */

@media (prefers-reduced-motion: reduce) {
  /* Auch die Verzögerung, sonst stünden Zeitstrahl und Leiste erst nach
     und nach da */
  * { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}


/* ===== Druck ============================================================= */

/* Gedruckt wird der Fahrplan. Reiter, Knöpfe und Eingabefelder haben auf
   Papier nichts zu suchen, die gewählten Werte stehen im Ergebnis. */
@media print {
  .reiter, .tafel-fuss, .eingabe-zeile,
  .anker-hinweis, .held-text { display: none !important; }
  .kopfleiste { position: static; border-bottom: 1px solid #999; }
  html, body { background: #fff; }
  .tafel { border-color: #999; break-inside: avoid; }
  .fp-zeile { break-inside: avoid; }
  .zeitstrahl, .werktagsleiste { break-inside: avoid; }
  /* Gezeichnet ist für die Breite am Bildschirm, die viewBox skaliert */
  .zeitstrahl-svg { width: 100%; height: auto; }
  /* Der Player bleibt auf Papier aus, der Zeitstrahl steht da */
  .ab-b, .ab-start { display: none !important; }
  .ablauf-kasten.ab-an { min-height: 0 !important; height: auto !important; }
  .ablauf-kasten.ab-an .ab-a { position: static; visibility: visible; opacity: 1; }
}


/* Kopf und Fuß der Website (vom Bauskript angehängt) */
/* Kopf, Inhalt und Fuß stehen links auf einer Kante: 1240 px breit, 32 px Rand wie in kopf.css.
   Der Inhalt behält seine Spalte von 1000 px und endet davor. */
:root { --ap-breite: 1240px; --ap-rand: 32px; --einzug: max(32px, calc((100% - 1240px) / 2 + 32px)); }
.mitte { padding-right: max(32px, calc(100% - var(--einzug) - var(--spalte))); }
.ap-kopf { position: sticky; top: 0; z-index: 10; }
.ap-kopf .reiter { align-self: stretch; margin-left: 12px; }
.ap-kopf .reiter-knopf { height: 100%; }
@media print { .ap-kopf { position: static; } }


/* Zeile der App unter dem Kopf der Website (vom Bauskript angehängt, nur msb-wissen.de) */
.app-zeile { background: var(--grund); border-bottom: 1px solid var(--linie); font-family: var(--schrift); }
.app-zeile-innen { display: flex; align-items: center; flex-wrap: wrap; gap: 0 24px; }
.app-name { padding: 12px 0; font: 600 17px/1.4 var(--schrift); color: var(--text); text-decoration: none; }
.app-name:hover { color: var(--marke-text); }
.app-name:focus-visible, .app-zeile .reiter-knopf:focus-visible { outline: 2px solid var(--marke); outline-offset: 2px; border-radius: 6px; }
.app-zeile .reiter { margin-left: auto; gap: 4px; }
.app-zeile .reiter-knopf { padding: 12px; border: 0; background: none; font: 400 16px/1.4 var(--schrift); letter-spacing: 0; color: var(--text); }
.app-zeile .reiter-knopf:hover { color: var(--marke-text); }
.app-zeile .reiter-knopf.aktiv { font-weight: 600; color: var(--marke-text); }
@media (max-width: 720px) { .app-zeile .reiter { margin-left: 0; } }
