/* hvv Abfahrtstafel – Theme-Definitionen
   Ausgelagert aus app.php. Wird NACH dem Inline-<style> eingebunden,
   damit Theme-Regeln den Dark-Mode bei gleicher Spezifität überschreiben
   (Quellenreihenfolge). Pfad: /shared/themes.css */

  /* ══════════════════════════════════════════
     THEME: HOCHBAHN (LED-Anzeigetafel)
  ══════════════════════════════════════════ */
  [data-theme="hochbahn"] {
    --bg:        #0d0800;
    --white:     #0d0800;
    --text:      #ffa020;
    --muted:     #7a4a00;
    --border:    #3a2000;
    --alt:       #150e00;
    --hvv-red:   #ffa020;
    --hvv-green: #ffa020;
    --font: 'VT323', 'Courier New', monospace;
  }
  html.board[data-theme="hochbahn"] {
    font-size: 1.45em;
  }
  html[data-theme="hochbahn"],
  html[data-theme="hochbahn"] body {
    background: #0d0800;
    color: #ffa020;
    font-family: 'VT323', 'Courier New', monospace;
    letter-spacing: .04em;
  }
  /* Dot-Matrix-Overlay (nur Board-Anzeige) */
  html.board[data-theme="hochbahn"] body::before {
    content: '';
    position: fixed; inset: 0;
    pointer-events: none; z-index: 9999;
    background-image: radial-gradient(circle at center, transparent 46%, rgba(13,8,0,.55) 48%);
    background-size: 2px 2px;
  }
  html[data-theme="hochbahn"] .tab-bar         { border-bottom: 1px solid #3a2000; }
  html[data-theme="hochbahn"] .tab-btn          { background:#0d0800; border-color:#3a2000; color:#7a4a00; }
  html[data-theme="hochbahn"] .tab-btn.active   { background:#150e00; border-color:#ffa020; color:#ffa020; box-shadow: 0 0 10px rgba(255,160,32,.2); }
  html[data-theme="hochbahn"] .tab-btn:hover    { border-color:#c87800; color:#ffa020; }
  html[data-theme="hochbahn"] .board-wrap        { background:#0d0800; border-color:#3a2000; }
  html[data-theme="hochbahn"] .stop-header       { background:#0d0800; border-bottom: 2px solid #ffa020; }
  html[data-theme="hochbahn"] .stop-header-name  { color:#ffa020; text-shadow: 0 0 14px rgba(255,160,32,.6); }
  html[data-theme="hochbahn"] .walk-time         { color:#7a4a00; }
  html[data-theme="hochbahn"] .col-head          { background:#0d0800; border-bottom: 2px solid #c87800; color:#7a4a00; grid-template-columns:44px 1fr 56px 32px; }
  html[data-theme="hochbahn"] .dep-row           { border-bottom-color: #3a2000; background:#0d0800; grid-template-columns:44px 1fr 56px 32px; }
  html[data-theme="hochbahn"] .board-wrap.show-platform .col-head,
  html[data-theme="hochbahn"] .board-wrap.show-platform .dep-row { grid-template-columns:44px 1fr 30px 56px 32px; }
  html[data-theme="hochbahn"] .dep-row:nth-child(even) { background:#150e00; }
  html[data-theme="hochbahn"] .multi-board .col-head { grid-template-columns:40px 1fr 52px 30px; }
  html[data-theme="hochbahn"] .multi-board .dep-row  { grid-template-columns:40px 1fr 52px 30px; }
  html[data-theme="hochbahn"] .multi-board .board-wrap.show-platform .col-head,
  html[data-theme="hochbahn"] .multi-board .board-wrap.show-platform .dep-row { grid-template-columns:40px 1fr 28px 50px 30px; }
  html[data-theme="hochbahn"] .dest              { color:#ffa020; text-shadow: 0 0 8px rgba(255,160,32,.4); }
  html[data-theme="hochbahn"] .via               { color:#7a4a00; }
  html[data-theme="hochbahn"] .sched-t           { color:#7a4a00; }
  html[data-theme="hochbahn"] .cnt,
  html[data-theme="hochbahn"] .cnt-ok,
  html[data-theme="hochbahn"] .cnt-soon          { color:#ffa020 !important; text-shadow: 0 0 10px rgba(255,160,32,.6); }
  /* Abfahrt jetzt → rot (wie auf echten DFI-Anzeigen) */
  html[data-theme="hochbahn"] .cnt-now           { color:#ff453a !important; text-shadow: 0 0 10px rgba(255,69,58,.7); }
  html[data-theme="hochbahn"] .cnt-plan          { color:#7a4a00 !important; text-shadow: none; }
  /* Verspätung rot, pünktlich grün */
  html[data-theme="hochbahn"] .delay.d-ok        { color:#3ee04e !important; text-shadow: 0 0 8px rgba(62,224,78,.6); }
  html[data-theme="hochbahn"] .delay.d-warn      { color:#ffa020 !important; text-shadow: 0 0 8px rgba(255,160,32,.6); }
  html[data-theme="hochbahn"] .delay.d-late      { color:#ff453a !important; text-shadow: 0 0 8px rgba(255,69,58,.65); }
  html[data-theme="hochbahn"] .d-cancelled       { color:#ff453a !important; text-shadow: 0 0 8px rgba(255,69,58,.65); }
  html[data-theme="hochbahn"] .cnt-cancelled     { color:#ff453a !important; text-shadow: 0 0 10px rgba(255,69,58,.7); }
  /* Badges: Amber-Fill + dunkler Text, Formen (clip-path/border-radius) unangetastet */
  html[data-theme="hochbahn"] .badge,
  html[data-theme="hochbahn"] [class*="chip-"]   { background:#ffa020 !important; color:#0d0800 !important; text-shadow:none; filter: drop-shadow(0 0 5px rgba(255,160,32,.7)); }
  html[data-theme="hochbahn"] .badge             { width:42px; height:22px; font-size:.74rem; }
  html[data-theme="hochbahn"] .badge.badge-sm    { font-size:.58rem; }
  html[data-theme="hochbahn"] .multi-board .badge { width:38px; height:21px; font-size:.68rem; }
  html[data-theme="hochbahn"] .cnt               { font-size:.84rem; }
  /* Mode-Badge: LIVE grün, ERROR rot – Akzentfarben echter Anzeigen */
  html[data-theme="hochbahn"] .mode-badge        { border-color:#ffa020; color:#ffa020; background:transparent; }
  html[data-theme="hochbahn"] .mode-badge.live   { border-color:#3ee04e; color:#3ee04e; }
  html[data-theme="hochbahn"] .mode-badge.error  { border-color:#ff453a; color:#ff453a; }
  html[data-theme="hochbahn"] .live-dot          { background:#3ee04e; box-shadow: 0 0 6px rgba(62,224,78,.8); }
  html[data-theme="hochbahn"] .error-dot         { background:#ff453a; box-shadow: 0 0 6px rgba(255,69,58,.8); }
  html[data-theme="hochbahn"] .clock             { color:#ffa020; text-shadow: 0 0 18px rgba(255,160,32,.65); }
  html[data-theme="hochbahn"] .hvv-arrow,
  html[data-theme="hochbahn"] .hvv-word          { color:#ffa020 !important; text-shadow: 0 0 10px rgba(255,160,32,.4); }
  html[data-theme="hochbahn"] .footer            { background:#0d0800; border-top: 1px solid #3a2000; }
  html[data-theme="hochbahn"] .footer-date       { color:#7a4a00; }
  html[data-theme="hochbahn"] .empty             { color:#7a4a00; }

  /* ══════════════════════════════════════════
     THEME: FALLBLATT (Solari Split-Flap)
  ══════════════════════════════════════════ */
  [data-theme="fallblatt"] {
    --bg:        #0d0d0b;
    --white:     #0d0d0b;
    --text:      #ede8d8;
    --muted:     #6a6860;
    --border:    #1e1e1a;
    --alt:       #131310;
    --hvv-red:   #ffd060;
    --hvv-green: #ffd060;
    --font: 'B612 Mono', 'Courier New', monospace;
  }
  html.board[data-theme="fallblatt"] { font-size: 1.05em; }
  html[data-theme="fallblatt"],
  html[data-theme="fallblatt"] body {
    background: #0d0d0b; color: #ede8d8;
    font-family: 'B612 Mono', 'Courier New', monospace;
    letter-spacing: .04em;
  }
  /* Vignette (nur Board-Anzeige) */
  html.board[data-theme="fallblatt"] body::before {
    content: ''; position: fixed; inset: 0;
    pointer-events: none; z-index: 9999;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.5) 100%);
  }
  html[data-theme="fallblatt"] .tab-bar          { border-bottom: 2px solid #0d0d0b; background:#0d0d0b; }
  html[data-theme="fallblatt"] .tab-btn           { background:#111; border-color:#1e1e1a; color:#6a6860; }
  html[data-theme="fallblatt"] .tab-btn.active    { background:#1a1a18; border-color:#ffd060; color:#ede8d8; box-shadow:none; }
  html[data-theme="fallblatt"] .tab-btn:hover     { border-color:#8a8870; color:#ede8d8; }
  html[data-theme="fallblatt"] .board-wrap         { background:#0d0d0b; border-color:#1e1e1a; }
  html[data-theme="fallblatt"] .stop-header        { background:#0d0d0b; border-bottom: 2px solid #1e1e1a; }
  html[data-theme="fallblatt"] .stop-header-name   { color:#ede8d8; text-transform:uppercase; letter-spacing:.06em; font-size:1rem; }
  html[data-theme="fallblatt"] .walk-time          { color:#6a6860; text-transform:uppercase; }
  html[data-theme="fallblatt"] .col-head           { background:#0a0a08; border-bottom: 2px solid #0d0d0b; color:#6a6860; text-transform:uppercase; letter-spacing:.06em; }
  /* Jede Spalte ist eine eigene Fallblattkarte – Zeile = Lückenträger */
  html[data-theme="fallblatt"] .dep-row {
    background: #0d0d0b;
    background-image: none;
    column-gap: 2px;
    padding: 2px;
    border-bottom: 3px solid #0d0d0b;
    align-items: stretch;
    grid-template-columns: 54px 1fr 62px 58px;
  }
  html[data-theme="fallblatt"] .board-wrap.show-platform .dep-row {
    grid-template-columns: 54px 1fr 38px 62px 58px;
  }
  html[data-theme="fallblatt"] .dep-row:nth-child(even) { background: #0d0d0b; }
  html[data-theme="fallblatt"] .dep-row:last-child { border-bottom: none; }
  /* Jede Zelle: eigene Karte mit Mittellinie */
  html[data-theme="fallblatt"] .dep-row > div {
    background-color: #111110;
    background-image: linear-gradient(to bottom, #161614 0%, #111110 45%, #080806 50%, #111110 55%, #161614 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 0 6px; overflow: hidden;
  }
  /* Die Karten-Regel oben würde sonst auch die ausgeblendete Plattform-Zelle
     auf display:flex zwingen (höhere Spezifität als .platform-cell{display:none}).
     Dann landen an Boards OHNE Plattform 5 Zellen in einem 4-Spalten-Grid:
     Plan rutscht in die Min-Spalte, Min bricht unter die Linien-Spalte um.
     Darum hier explizit nur bei show-platform anzeigen. */
  html[data-theme="fallblatt"] .dep-row > .platform-cell { display: none; }
  html[data-theme="fallblatt"] .board-wrap.show-platform .dep-row > .platform-cell { display: flex; }
  html[data-theme="fallblatt"] .dep-row > div:nth-child(2) { justify-content: flex-start; padding: 0 10px; }
  /* Zeit-Karte: Delay oben (über Mittellinie), Uhrzeit unten.
     Die Plattform-Zelle ist immer das 3. Kind (auch ausgeblendet), die
     Zeit-Karte also immer das 4. – sonst würde diese Stapelung an Boards
     ohne Plattform die (versteckte) Plattform-Zelle treffen und die Zeit
     liefe inline neben dem Delay (Uhrzeit wird abgeschnitten). */
  html[data-theme="fallblatt"] .dep-row > div:nth-child(4) { justify-content: space-around; flex-direction: column; align-items: center; padding: 0 8px; }
  html[data-theme="fallblatt"] .board-wrap.show-platform .dep-row > div:nth-child(3) { justify-content: center; flex-direction: row; align-items: center; padding: 0 6px; }
  html[data-theme="fallblatt"] .board-wrap.show-platform .dep-row > div:nth-child(4) { justify-content: space-around; flex-direction: column; align-items: center; padding: 0 8px; }
  html[data-theme="fallblatt"] .dep-row > .cnt             { justify-content: flex-end; padding: 0 8px; }
  html[data-theme="fallblatt"] .delay { display: block; font-size: .52rem; text-transform: uppercase; letter-spacing: .03em; }
  html[data-theme="fallblatt"] .d-ok  { color: #6a6860; }
  /* Multi-Board: angepasste Spaltenbreiten */
  html[data-theme="fallblatt"] .multi-board .dep-row { grid-template-columns: 50px 1fr 58px 54px; }
  html[data-theme="fallblatt"] .multi-board .board-wrap.show-platform .dep-row { grid-template-columns: 50px 1fr 34px 54px 50px; }
  html[data-theme="fallblatt"] .dest     { color:#ede8d8; text-transform:uppercase; letter-spacing:.05em; }
  html[data-theme="fallblatt"] .via      { color:#6a6860; text-transform:uppercase; }
  html[data-theme="fallblatt"] .sched-t  { color:#6a6860; }
  html[data-theme="fallblatt"] .delay    { color:#ffd060; }
  html[data-theme="fallblatt"] .cnt,
  html[data-theme="fallblatt"] .cnt-ok,
  html[data-theme="fallblatt"] .cnt-soon,
  html[data-theme="fallblatt"] .cnt-now  { color:#ede8d8 !important; text-shadow:none; }
  html[data-theme="fallblatt"] .cnt-plan { color:#6a6860 !important; text-shadow:none; }
  /* Badges: goldgelb mit schwarzem Text, Originalform erhalten */
  html[data-theme="fallblatt"] .badge,
  html[data-theme="fallblatt"] [class*="chip-"] { background:#ffd060 !important; color:#0d0d0b !important; text-transform:uppercase; filter:none; text-shadow:none; }
  html[data-theme="fallblatt"] .mode-badge       { border-color:#3a3a38; color:#6a6860; background:transparent; }
  html[data-theme="fallblatt"] .mode-badge.live  { border-color:#ffd060; color:#ffd060; }
  html[data-theme="fallblatt"] .mode-badge.error { border-color:#ffd060; color:#ffd060; }
  html[data-theme="fallblatt"] .live-dot,
  html[data-theme="fallblatt"] .error-dot        { background:#ffd060; box-shadow:none; }
  html[data-theme="fallblatt"] .clock            { color:#ede8d8; }
  html[data-theme="fallblatt"] .hvv-arrow,
  html[data-theme="fallblatt"] .hvv-word         { color:#ffd060 !important; text-shadow:none; }
  html[data-theme="fallblatt"] .footer           { background:#0d0d0b; border-top: 2px solid #1e1e1a; }
  html[data-theme="fallblatt"] .footer-date      { color:#6a6860; text-transform:uppercase; letter-spacing:.06em; }
  html[data-theme="fallblatt"] .empty            { color:#6a6860; text-transform:uppercase; }
  /* Fallblatt blättert jetzt per JS durch echte Werte (siehe fbAnimateRow in
     shared/app.js) – kein CSS-Keyframe mehr nötig. */

  /* ══════════════════════════════════════════
     THEME: FALLKARTE (Modern Split-Flap, hell)
     Schwarzer Text auf Off-White; jeder Buchstabe liegt auf einer
     eigenen Fallkarte (wie Flughafen-Anzeigen). Die Einzelkarten werden
     per JS (flapize) als <span class="flap"> erzeugt.
  ══════════════════════════════════════════ */
  /* Dunkles Gehäuse – die hellen Fallkarten heben sich davon ab (wie bei
     echten Splitflap-/Flughafenanzeigen). Nur die Karten bleiben hell. */
  [data-theme="fallkarte"] {
    --bg:        #16140f;
    --white:     #1f1c17;
    --text:      #e9e6dc;
    --muted:     #908b7d;
    --border:    #34302a;
    --alt:       #1a1713;
    --hvv-red:   #ef5350;
    --hvv-green: #66bb6a;
    --font: 'B612 Mono', 'Courier New', monospace;
    /* Zentrale Kartengröße – klein halten, damit in der Breite mehr passt
       (Ziel wird sonst stark abgeschnitten). */
    --fk-card: .76rem;
  }
  html.board[data-theme="fallkarte"] { font-size: 1.04em; }
  html[data-theme="fallkarte"],
  html[data-theme="fallkarte"] body {
    background: #16140f; color: #e9e6dc;
    font-family: 'B612 Mono', 'Courier New', monospace;
    letter-spacing: .02em;
  }
  html[data-theme="fallkarte"] .tab-bar        { background:#1a1713; border-bottom: 1px solid #34302a; }
  html[data-theme="fallkarte"] .tab-btn        { background:#211e18; border-color:#34302a; color:#908b7d; }
  html[data-theme="fallkarte"] .tab-btn.active { background:#2b2820; border-color:#e9e6dc; color:#e9e6dc; box-shadow:none; }
  html[data-theme="fallkarte"] .tab-btn:hover  { border-color:#6a6557; color:#e9e6dc; }
  html[data-theme="fallkarte"] .board-wrap     { background:#1f1c17; border-color:#34302a; }
  html[data-theme="fallkarte"] .stop-header     { background:#1a1713; border-bottom: 1px solid #34302a; }
  html[data-theme="fallkarte"] .stop-header-name { color:#e9e6dc; text-transform:uppercase; letter-spacing:.05em; font-size:1rem; }
  html[data-theme="fallkarte"] .walk-time        { color:#908b7d; text-transform:uppercase; }
  /* MIN-Spalte entfällt (Platz sparen). Auch .cnt-plan ausblenden:
     updateCountdowns() setzt bei weit entfernten Abfahrten className="cnt-plan"
     OHNE die cnt-Klasse, sonst würde dort die Planuhrzeit wieder auftauchen. */
  html[data-theme="fallkarte"] .cnt,
  html[data-theme="fallkarte"] .cnt-plan   { display:none !important; }
  html[data-theme="fallkarte"] .col-head .r { display:none; }
  /* Linie + Richtung sind in EINEM Feld kombiniert (flapize stellt die Linie
     dem Ziel voran). Eigene Linien-Spalte und LINIE-Überschrift entfallen. */
  html[data-theme="fallkarte"] .dep-row > div:first-child { display:none; }
  html[data-theme="fallkarte"] .col-head > span:first-child { display:none; }
  /* Spaltenüberschrift „Plan" → „Ankunft" (nur dieses Theme). Der Plan-Header
     ist das 4. span (Linie, Richtung, St., Plan, Min). */
  html[data-theme="fallkarte"] .col-head > span:nth-child(4) { font-size:0; }
  html[data-theme="fallkarte"] .col-head > span:nth-child(4)::before {
    content:"Ankunft"; font-size:.58rem; letter-spacing:.12em;
  }
  html[data-theme="fallkarte"] .col-head,
  html[data-theme="fallkarte"] .dep-row { grid-template-columns: 1fr 104px; }
  html[data-theme="fallkarte"] .board-wrap.show-platform .col-head,
  html[data-theme="fallkarte"] .board-wrap.show-platform .dep-row { grid-template-columns: 1fr 26px 104px; }
  html[data-theme="fallkarte"] .multi-board .col-head,
  html[data-theme="fallkarte"] .multi-board .dep-row { grid-template-columns: 1fr 92px; }
  html[data-theme="fallkarte"] .multi-board .board-wrap.show-platform .col-head,
  html[data-theme="fallkarte"] .multi-board .board-wrap.show-platform .dep-row { grid-template-columns: 1fr 24px 92px; }
  html[data-theme="fallkarte"] .col-head         { background:#1a1713; border-bottom: 1px solid #34302a; color:#908b7d; text-transform:uppercase; letter-spacing:.06em; }
  html[data-theme="fallkarte"] .dep-row          { background:#1f1c17; border-bottom: 1px solid #2a2620; }
  html[data-theme="fallkarte"] .dep-row:nth-child(even) { background:#1a1713; }
  html[data-theme="fallkarte"] .dep-row:last-child { border-bottom: none; }
  /* Einheitliche Kartengröße in allen Spalten über --fk-card. Schriftfarbe
     der Karten bleibt dunkel – sie liegen auf hellen Karten. */
  html[data-theme="fallkarte"] .dest   { color:#1b1a16; text-transform:uppercase; white-space:nowrap; overflow:hidden; text-overflow:clip; font-size:var(--fk-card); }
  html[data-theme="fallkarte"] .via    { color:#908b7d; text-transform:uppercase; }
  html[data-theme="fallkarte"] .sched-t { color:#1b1a16; white-space:nowrap; font-size:var(--fk-card); }
  html[data-theme="fallkarte"] .platform-cell { font-size:var(--fk-card); }

  /* Plan-Zelle: Zeit + Status-Karte NEBENEINANDER (eine Zeile – die Zeilenhöhe
     ist fix, gestapelte volle Karten würden überlaufen). */
  html[data-theme="fallkarte"] .dep-row > div:nth-child(4) {
    display:flex; flex-direction:row; align-items:center; justify-content:center; gap:.5em;
  }
  /* Status: 3 Karten fester Größe (Vorzeichen + 2 Ziffern), grün (pünktlich/
     früher) bzw. rot (verspätet). Bewusst KEINE dynamische Breite – das würde
     das Karten-Raster sprengen. */
  html[data-theme="fallkarte"] .delay { font-size:var(--fk-card); display:inline-flex; }
  html[data-theme="fallkarte"] .flap.flap-ok   { color:#2e7d32; }
  html[data-theme="fallkarte"] .flap.flap-late { color:#b00020; }

  /* Multiboard (Desktop, mehrere Boards nebeneinander): noch etwas kleiner –
     die Spalten sind dort schmaler. Eine Variable steuert alle Karten. */
  html[data-theme="fallkarte"] .multi-board { --fk-card:.7rem; }

  /* Einzelne Buchstaben-Fallkarte */
  html[data-theme="fallkarte"] .flap {
    display:inline-flex; align-items:center; justify-content:center;
    width:.88em; height:1.34em; vertical-align:middle;
    margin:0 .4px; line-height:1; font-weight:700;
    color:#1b1a16; border-radius:2.5px;
    background:#f7f5ef;
    background-image:linear-gradient(to bottom,
      #ffffff 0%, #f3f1e9 49.3%,
      #d6d3c7 49.7%, #d6d3c7 50.3%,
      #efece3 50.7%, #f7f5ef 100%);
    box-shadow:0 1px 0 rgba(0,0,0,.2), inset 0 0 0 .5px rgba(0,0,0,.06);  /* scharfe Kante statt Blur (FF-günstiger beim Repaint) */
  }
  /* Leerzeichen / Auffüllung: leere Karte (gleiche Optik, ohne Buchstabe) */
  html[data-theme="fallkarte"] .flap-blank { color:transparent; }
  /* Doppelpunkt in Uhrzeiten/Uhr: KEINE Karte – zwei exakt zentrierte Punkte
     direkt auf dem dunklen Gehäuse (wie bei echten Anzeigen). Als CSS-Punkte
     statt Schriftzeichen, damit sie horizontal UND vertikal perfekt mittig
     sitzen (das Glyph ":" der Schrift ist leicht außermittig). */
  html[data-theme="fallkarte"] .flap-colon {
    width:.42em; margin:0 .14em;
    flex-direction:column; gap:.2em;        /* überschreibt die Zeilen-Zentrierung von .flap */
    background:none; background-image:none; box-shadow:none; border-radius:0;
  }
  html[data-theme="fallkarte"] .flap-colon::before,
  html[data-theme="fallkarte"] .flap-colon::after {
    content:""; width:.15em; height:.15em; border-radius:50%; background:#ece9df;
  }
  /* Trennkarte zwischen Linie und Ziel: schwarze Fallkarte (klare Trennung). */
  html[data-theme="fallkarte"] .flap-sep {
    color:transparent;
    background:#15130f;
    background-image:linear-gradient(to bottom,
      #2c2922 0%, #201d18 49.3%,
      #050504 49.7%, #050504 50.3%,
      #1d1a15 50.7%, #2c2922 100%);
    box-shadow:0 1px 0 rgba(0,0,0,.4), inset 0 0 0 .5px rgba(255,255,255,.05);  /* scharfe Kante statt Blur */
  }
  /* Min-Countdown: eine einzelne Kachel (wird regelmäßig neu gesetzt,
     daher NICHT per Buchstabe – sonst würden die Karten ständig zerfallen) */
  html[data-theme="fallkarte"] .cnt,
  html[data-theme="fallkarte"] .cnt-ok,
  html[data-theme="fallkarte"] .cnt-soon,
  html[data-theme="fallkarte"] .cnt-now,
  html[data-theme="fallkarte"] .cnt-plan {
    color:#1b1a16 !important; text-shadow:none; font-weight:700; text-align:center;
    justify-self:center; min-width:1.5em; font-size:1.2rem;
    background:#f7f5ef;
    background-image:linear-gradient(to bottom,
      #ffffff 0%, #f3f1e9 49.3%, #d6d3c7 49.7%, #d6d3c7 50.3%, #efece3 50.7%, #f7f5ef 100%);
    border-radius:2.5px; padding:.08em .34em;
    box-shadow:0 1px 0 rgba(0,0,0,.2), inset 0 0 0 .5px rgba(0,0,0,.06);  /* scharfe Kante statt Blur (FF-günstiger beim Repaint) */
  }
  html[data-theme="fallkarte"] .cnt-now  { color:#b00020 !important; }
  html[data-theme="fallkarte"] .cnt-cancelled { color:#b00020 !important; background:none; box-shadow:none; }

  html[data-theme="fallkarte"] .mode-badge       { border-color:#34302a; color:#908b7d; background:#211e18; }
  html[data-theme="fallkarte"] .mode-badge.live  { border-color:#66bb6a; color:#66bb6a; background:#16140f; }
  html[data-theme="fallkarte"] .mode-badge.error { border-color:#ef5350; color:#ef5350; background:#16140f; }
  html[data-theme="fallkarte"] .live-dot         { background:#66bb6a; box-shadow:none; }
  html[data-theme="fallkarte"] .error-dot        { background:#ef5350; box-shadow:none; }
  /* Uhr als Fallkarten (flapText). nowrap, damit die Karten in der schmalen
     Footer-Zelle nicht auf zwei Zeilen umbrechen. Etwas kleiner als der reine
     Text, damit alle Karten in einer Zeile in den Footer passen. */
  html[data-theme="fallkarte"] .clock            { color:#e9e6dc; white-space:nowrap; font-size:1.25rem; }
  html[data-theme="fallkarte"] .hvv-arrow        { color:#66bb6a !important; text-shadow:none; }
  html[data-theme="fallkarte"] .hvv-word         { color:#ef5350 !important; text-shadow:none; }
  html[data-theme="fallkarte"] .footer           { background:#1a1713; border-top: 1px solid #34302a; }
  html[data-theme="fallkarte"] .footer-date      { color:#908b7d; text-transform:uppercase; letter-spacing:.06em; }
  html[data-theme="fallkarte"] .empty            { color:#908b7d; text-transform:uppercase; }
  html[data-theme="fallkarte"] .disruptions      { background:#2a2412; color:#e8d9a0; border-color:#4a4220; }

  /* „Durchblätter"-Effekt: der schnelle Buchstabenwechsel (per JS in animateRow)
     erzeugt die Klappen-Optik. Bewusst KEINE fortlaufende 3D-Transform-Animation
     pro Karte – die würde im Desktop-Multiboard hunderte/tausende Karten 60×/s
     als eigene GPU-Ebene kippen lassen (Hauptursache für hohe Last/Hitze). */

  /* ══════════════════════════════════════════
     THEME: DB REGIO
  ══════════════════════════════════════════ */
  [data-theme="db"] {
    --bg: #1a1a1a; --white: #1a1a1a; --text: #ffffff;
    --muted: #9a9a9a; --border: #2e2e2e; --alt: #202020;
    --hvv-red: #ec0016; --hvv-green: #63a615;
  }
  html[data-theme="db"],
  html[data-theme="db"] body              { background:#1a1a1a; color:#ffffff; }
  html[data-theme="db"] .tab-bar          { border-bottom:2px solid #2e2e2e; }
  html[data-theme="db"] .tab-btn           { background:#222; border-color:#2e2e2e; color:#9a9a9a; }
  html[data-theme="db"] .tab-btn.active    { background:#1a1a1a; border-color:#ec0016; color:#fff; box-shadow:none; }
  html[data-theme="db"] .tab-btn:hover     { border-color:#666; color:#fff; }
  html[data-theme="db"] .board-wrap         { background:#1a1a1a; border-color:#2e2e2e; }
  html[data-theme="db"] .stop-header        { background:#1a1a1a; border-bottom:3px solid #ec0016; }
  html[data-theme="db"] .stop-header-name   { color:#ffffff; }
  html[data-theme="db"] .walk-time          { color:#9a9a9a; }
  html[data-theme="db"] .col-head           { background:#111; border-bottom:1px solid #2e2e2e; color:#9a9a9a; }
  html[data-theme="db"] .dep-row            { background:#1a1a1a; border-bottom:1px solid #2e2e2e; }
  html[data-theme="db"] .dep-row:nth-child(even) { background:#202020; }
  html[data-theme="db"] .dest              { color:#ffffff; }
  html[data-theme="db"] .sched-t           { color:#9a9a9a; }
  html[data-theme="db"] .d-ok              { color:#63a615; }
  html[data-theme="db"] .cnt,
  html[data-theme="db"] .cnt-ok            { color:#ffffff !important; }
  html[data-theme="db"] .cnt-soon          { color:#f09000 !important; }
  html[data-theme="db"] .cnt-now           { color:#ec0016 !important; }
  html[data-theme="db"] .cnt-plan          { color:#9a9a9a !important; }
  html[data-theme="db"] .mode-badge.live   { border-color:#63a615; color:#63a615; background:transparent; }
  html[data-theme="db"] .mode-badge.error  { border-color:#ec0016; color:#ec0016; background:transparent; }
  html[data-theme="db"] .live-dot          { background:#63a615; box-shadow:none; }
  html[data-theme="db"] .error-dot         { background:#ec0016; box-shadow:none; }
  html[data-theme="db"] .clock             { color:#ec0016; }
  html[data-theme="db"] .hvv-arrow,
  html[data-theme="db"] .hvv-word          { color:#ec0016 !important; text-shadow:none; }
  html[data-theme="db"] .footer            { background:#111; border-top:1px solid #2e2e2e; }
  html[data-theme="db"] .footer-date       { color:#9a9a9a; }
  html[data-theme="db"] .empty             { color:#9a9a9a; }

  /* ══════════════════════════════════════════
     THEME: SBB (Schweizer Bundesbahn)
  ══════════════════════════════════════════ */
  [data-theme="sbb"] {
    --bg: #f0f0f0; --white: #ffffff; --text: #000000;
    --muted: #767676; --border: #d0d0d0; --alt: #f8f8f8;
    --hvv-red: #eb0000; --hvv-green: #018a18;
    --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  }
  /* SBB ist immer hell – überschreibt Dark Mode (gleiche Spezifität, spätere Quelle) */
  html[data-theme="sbb"],
  html[data-theme="sbb"] body              { background:#f0f0f0; color:#000000; }
  /* Tab-Bar */
  html[data-theme="sbb"] .tab-bar          { background:#ffffff; border-bottom:2px solid #d0d0d0; }
  html[data-theme="sbb"] .tab-btn          { background:#fff; border-color:#d0d0d0; color:#767676; }
  html[data-theme="sbb"] .tab-btn.active   { background:#8a0000; border-color:#8a0000; color:#fff; box-shadow:none; }
  html[data-theme="sbb"] .tab-btn:hover    { border-color:#999; color:#000; }

  /* Board */
  html[data-theme="sbb"] .board-wrap       { background:#fff; border-color:#d0d0d0; }
  /* Stop-Header: roter Balken, weißer Text – wie echte SBB-Anzeigetafeln */
  html[data-theme="sbb"] .stop-header      { background:#eb0000; border-bottom:none; }
  html[data-theme="sbb"] .stop-header-name { color:#ffffff; }
  html[data-theme="sbb"] .walk-time        { color:rgba(255,255,255,.82); }
  html[data-theme="sbb"] .mode-badge       { border-color:rgba(255,255,255,.55); color:rgba(255,255,255,.75); }
  html[data-theme="sbb"] .mode-badge.live  { border-color:#fff; color:#fff; background:transparent; }
  html[data-theme="sbb"] .mode-badge.error { border-color:rgba(255,255,255,.4); color:rgba(255,255,255,.5); background:transparent; }
  html[data-theme="sbb"] .live-dot         { background:#fff; box-shadow:none; }
  html[data-theme="sbb"] .error-dot        { background:rgba(255,255,255,.5); box-shadow:none; }
  /* Spalten-Header: dunkleres Rot */
  html[data-theme="sbb"] .col-head         { background:#c40000; color:rgba(255,255,255,.82); border-bottom:none; letter-spacing:.14em; }
  /* Abfahrtszeilen */
  html[data-theme="sbb"] .dep-row          { background:#ffffff; border-bottom:1px solid #ebebeb; }
  html[data-theme="sbb"] .dep-row:nth-child(even) { background:#f8f8f8; }
  html[data-theme="sbb"] .dest             { color:#000000; }
  html[data-theme="sbb"] .sched-t          { color:#444444; }
  html[data-theme="sbb"] .d-ok             { color:#018a18; }
  html[data-theme="sbb"] .d-late           { color:#eb0000; }
  /* Countdown */
  html[data-theme="sbb"] .cnt,
  html[data-theme="sbb"] .cnt-ok           { color:#000000 !important; }
  html[data-theme="sbb"] .cnt-soon         { color:#c44b00 !important; }
  html[data-theme="sbb"] .cnt-now          { color:#eb0000 !important; }
  html[data-theme="sbb"] .cnt-plan         { color:#767676 !important; }
  /* Uhr & Footer */
  html[data-theme="sbb"] .clock            { color:#000000; }
  html[data-theme="sbb"] .hvv-arrow,
  html[data-theme="sbb"] .hvv-word         { color:#eb0000 !important; text-shadow:none; }
  html[data-theme="sbb"] .footer           { background:#ffffff; border-top:2px solid #d0d0d0; }
  html[data-theme="sbb"] .footer-date      { color:#767676; }
  html[data-theme="sbb"] .empty            { color:#767676; }

  /* ══════════════════════════════════════════
     THEME: LONDON UNDERGROUND
  ══════════════════════════════════════════ */
  [data-theme="lu"] {
    --bg: #003b8e; --white: #002d70; --text: #ffffff;
    --muted: #8fb0e0; --border: #1a52a8; --alt: #002878;
    --hvv-red: #ffd300; --hvv-green: #ffd300;
    --font: 'Nunito', 'Gill Sans', Arial, sans-serif;
  }
  html[data-theme="lu"],
  html[data-theme="lu"] body              { background:#003b8e; color:#ffffff; font-family:'Nunito',Arial,sans-serif; }
  html[data-theme="lu"] .tab-bar          { border-bottom:2px solid #1a52a8; background:#003b8e; }
  html[data-theme="lu"] .tab-btn           { background:#002d70; border-color:#1a52a8; color:#8fb0e0; }
  html[data-theme="lu"] .tab-btn.active    { background:#003b8e; border-color:#ffd300; color:#fff; box-shadow:none; }
  html[data-theme="lu"] .tab-btn:hover     { border-color:#8fb0e0; color:#fff; }
  html[data-theme="lu"] .board-wrap         { background:#003b8e; border-color:#1a52a8; }
  html[data-theme="lu"] .stop-header        { background:#003b8e; border-bottom:3px solid #e32017; }
  /* Roundel vor dem Haltestellennamen */
  html[data-theme="lu"] .stop-header-name   { color:#ffffff; display:flex; align-items:center; gap:8px; }
  html[data-theme="lu"] .stop-header-name::before {
    content:''; flex-shrink:0;
    width:22px; height:22px; border-radius:50%;
    border:3px solid #e32017;
    background:linear-gradient(transparent 35%, #e32017 35%, #e32017 65%, transparent 65%);
  }
  html[data-theme="lu"] .walk-time          { color:#8fb0e0; }
  html[data-theme="lu"] .col-head           { background:#002878; border-bottom:2px solid #1a52a8; color:#8fb0e0; }
  html[data-theme="lu"] .dep-row            { background:#003b8e; border-bottom:1px solid #1a52a8; }
  html[data-theme="lu"] .dep-row:nth-child(even) { background:#002878; }
  html[data-theme="lu"] .dest              { color:#ffffff; }
  html[data-theme="lu"] .sched-t           { color:#8fb0e0; }
  html[data-theme="lu"] .cnt,
  html[data-theme="lu"] .cnt-ok            { color:#ffffff !important; }
  html[data-theme="lu"] .cnt-soon,
  html[data-theme="lu"] .cnt-now           { color:#ffd300 !important; }
  html[data-theme="lu"] .cnt-plan          { color:#8fb0e0 !important; }
  html[data-theme="lu"] .mode-badge        { border-color:#8fb0e0; color:#8fb0e0; background:transparent; }
  html[data-theme="lu"] .mode-badge.live   { border-color:#ffd300; color:#ffd300; }
  html[data-theme="lu"] .mode-badge.error  { border-color:#e32017; color:#e32017; }
  html[data-theme="lu"] .live-dot          { background:#ffd300; box-shadow:none; }
  html[data-theme="lu"] .error-dot         { background:#e32017; box-shadow:none; }
  html[data-theme="lu"] .clock             { color:#ffd300; }
  html[data-theme="lu"] .hvv-arrow         { color:#e32017 !important; text-shadow:none; }
  html[data-theme="lu"] .hvv-word          { color:#ffd300 !important; text-shadow:none; }
  html[data-theme="lu"] .footer            { background:#002060; border-top:2px solid #1a52a8; }
  html[data-theme="lu"] .footer-date       { color:#8fb0e0; }
  html[data-theme="lu"] .empty             { color:#8fb0e0; }

  /* ══════════════════════════════════════════════════════════
     LANDING PAGE (index.php) – seiten-spezifische Theme-Regeln
     Eigene Selektoren (.card, .theme-btn, .site-*), disjunkt zu
     den Board-Regeln oben. Seiten-Hintergrund, --Variablen und
     .hvv-arrow/.hvv-word kommen aus den gemeinsamen Blöcken oben.
  ══════════════════════════════════════════════════════════ */
  /* ── HOCHBAHN ── */
  html[data-theme="hochbahn"] .card   { background:#150e00; border-color:#3a2000; color:#ffa020; }
  html[data-theme="hochbahn"] .card:hover,
  html[data-theme="hochbahn"] .card:focus { border-color:#ffa020; box-shadow:0 0 16px rgba(255,160,32,.2); }
  html[data-theme="hochbahn"] .card-name  { color:#ffa020; text-shadow:0 0 8px rgba(255,160,32,.4); }
  html[data-theme="hochbahn"] .card-arrow { color:#ffa020; }
  html[data-theme="hochbahn"] .site-title { color:#7a4a00; border-color:#3a2000; }
  html[data-theme="hochbahn"] .site-footer { color:#7a4a00; }
  html[data-theme="hochbahn"] .theme-btn  { background:#150e00; border-color:#3a2000; color:#ffa020; font-family:'VT323',monospace; }
  html[data-theme="hochbahn"] .theme-btn.active { border-color:#ffa020; box-shadow:0 0 10px rgba(255,160,32,.2); }
  html[data-theme="hochbahn"] .themes-label { color:#7a4a00; }

  /* ── FALLBLATT ── */
  html[data-theme="fallblatt"] .card  { background:#111110; border-color:#1e1e1a; color:#ede8d8; }
  html[data-theme="fallblatt"] .card:hover,
  html[data-theme="fallblatt"] .card:focus { border-color:#ffd060; box-shadow:none; }
  html[data-theme="fallblatt"] .card-name  { color:#ede8d8; text-transform:uppercase; letter-spacing:.06em; }
  html[data-theme="fallblatt"] .card-arrow { color:#ffd060; }
  html[data-theme="fallblatt"] .site-title { color:#6a6860; border-color:#1e1e1a; text-transform:uppercase; letter-spacing:.06em; }
  html[data-theme="fallblatt"] .site-footer { color:#6a6860; text-transform:uppercase; letter-spacing:.04em; }
  html[data-theme="fallblatt"] .theme-btn  { background:#111110; border-color:#1e1e1a; color:#ede8d8; font-family:'B612 Mono',monospace; }
  html[data-theme="fallblatt"] .theme-btn.active { border-color:#ffd060; }
  html[data-theme="fallblatt"] .themes-label { color:#6a6860; text-transform:uppercase; letter-spacing:.06em; }

  /* ── FALLKARTE (dunkles Gehäuse) ── */
  html[data-theme="fallkarte"] .card  { background:#1f1c17; border-color:#34302a; color:#e9e6dc; }
  html[data-theme="fallkarte"] .card:hover,
  html[data-theme="fallkarte"] .card:focus { border-color:#e9e6dc; box-shadow:none; }
  html[data-theme="fallkarte"] .card-name  { color:#e9e6dc; text-transform:uppercase; letter-spacing:.06em; }
  html[data-theme="fallkarte"] .card-arrow { color:#908b7d; }
  html[data-theme="fallkarte"] .site-title { color:#908b7d; border-color:#34302a; text-transform:uppercase; letter-spacing:.06em; }
  html[data-theme="fallkarte"] .site-footer { color:#908b7d; text-transform:uppercase; letter-spacing:.04em; }
  html[data-theme="fallkarte"] .theme-btn  { background:#1f1c17; border-color:#34302a; color:#e9e6dc; font-family:'B612 Mono',monospace; }
  html[data-theme="fallkarte"] .theme-btn.active { border-color:#e9e6dc; }
  html[data-theme="fallkarte"] .themes-label { color:#908b7d; text-transform:uppercase; letter-spacing:.06em; }

  /* ── DB REGIO ── */
  html[data-theme="db"] .card  { background:#222; border-color:#2e2e2e; color:#ffffff; }
  html[data-theme="db"] .card:hover,
  html[data-theme="db"] .card:focus { border-color:#ec0016; box-shadow:none; }
  html[data-theme="db"] .card-name  { color:#ffffff; }
  html[data-theme="db"] .card-arrow { color:#ec0016; }
  html[data-theme="db"] .site-title { color:#9a9a9a; border-color:#2e2e2e; }
  html[data-theme="db"] .site-footer { color:#9a9a9a; }
  html[data-theme="db"] .theme-btn  { background:#222; border-color:#2e2e2e; color:#ffffff; }
  html[data-theme="db"] .theme-btn.active { border-color:#ec0016; }
  html[data-theme="db"] .themes-label { color:#9a9a9a; }

  /* ── SBB ── */
  html[data-theme="sbb"] .card  { background:#ffffff; border-color:#d8d8d8; color:#000000; }
  html[data-theme="sbb"] .card:hover,
  html[data-theme="sbb"] .card:focus { border-color:#eb0000; box-shadow:none; }
  html[data-theme="sbb"] .card-name  { color:#000000; }
  html[data-theme="sbb"] .card-arrow { color:#eb0000; }
  html[data-theme="sbb"] .site-title { color:#767676; border-color:#d8d8d8; }
  html[data-theme="sbb"] .site-footer { color:#767676; }
  html[data-theme="sbb"] .theme-btn  { background:#ffffff; border-color:#d8d8d8; color:#000000; }
  html[data-theme="sbb"] .theme-btn.active { border-color:#eb0000; }
  html[data-theme="sbb"] .themes-label { color:#767676; }

  /* ── LONDON UNDERGROUND ── */
  html[data-theme="lu"] .card  { background:#002d70; border-color:#1a52a8; color:#ffffff; }
  html[data-theme="lu"] .card:hover,
  html[data-theme="lu"] .card:focus { border-color:#ffd300; box-shadow:none; }
  html[data-theme="lu"] .card-name  { color:#ffffff; }
  html[data-theme="lu"] .card-arrow { color:#ffd300; }
  html[data-theme="lu"] .site-title { color:#8fb0e0; border-color:#1a52a8; }
  html[data-theme="lu"] .site-footer { color:#8fb0e0; }
  html[data-theme="lu"] .theme-btn  { background:#002d70; border-color:#1a52a8; color:#ffffff; font-family:'Nunito',Arial,sans-serif; }
  html[data-theme="lu"] .theme-btn.active { border-color:#ffd300; }
  html[data-theme="lu"] .themes-label { color:#8fb0e0; }
