/* ÖPNV-Monitor Bonn — Startseite „Bonn fährt" (20.11.2026, docs/DESIGN.md)
   Umgestylt 22.11.2026 (Loop-Auftrag): Das Statistik-Design folgt jetzt der
   „Ankommen"-Welt — Inter + Space Grotesk, kühles Off-White, feine Ränder,
   gleiche Ampel-Töne wie die Fahrgast-Seiten. Die Variablen-NAMEN bleiben
   (783 Zeilen nutzen sie), nur die WERTE sind die Ankommen-Tokens. */

@font-face {
  font-family: Inter;
  src: url("/fonts/inter-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/inter-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/inter-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/inter-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  /* Ankommen-Tokens (ankommen.css), gemappt auf die bisherigen Namen */
  --papier: #F4F3EF;          /* Ankommen --grund */
  --flaeche: #FFFFFF;
  --flaeche-2: #EEECE7;       /* Ankommen --trenner */
  --strich: #E2E0DA;          /* Ankommen --rand */
  --tinte: #15181C;
  --tinte-2: #5E6470;         /* Ankommen --gedaempft */
  --rhein: #1F5FAD;           /* Ankommen --link */
  --rhein-hell: #E8EFF8;      /* Ankommen --info-grund */
  --gut: #16794A;             /* Ankommen --gps */
  --mittel: #8A5A00;           /* Ankommen --erwartung */
  --schlecht: #B42318;        /* Ankommen --ausfall */
  --gut-flaeche: #E3F1E9;     /* Ankommen --lage-gut-grund */
  --mittel-flaeche: #F2DDBF;  /* Ankommen --umstieg-balkengrund */
  --schlecht-flaeche: #FBF4F3;/* Ankommen --ausfall-grund */
  --bahn: #1F5FAD;
  --bus: #15181C;
  --nacht: #5B3FA0;
  --schatten: 0 1px 2px rgb(21 24 28 / .05), 0 6px 20px rgb(21 24 28 / .07);
  --radius: 14px;             /* Ankommen --radius-knopf */
  --schrift: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --schrift-titel: "Space Grotesk", var(--schrift);
  /* Ankommen-Primaer (ankommen.css): Anthrazit statt Vollblau fuer aktive Knoepfe */
  --primaer-grund: #15181C;
  --primaer-text: #FFFFFF;
  --primaer-rand: #15181C;
  --primaer-rand-aktiv: #657080;
  --radius-karte: 18px;       /* Ankommen --radius-karte */
  font-variant-numeric: tabular-nums;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-thema="hell"]):not([data-theme="light"]) {
    --papier: #0F1115; --flaeche: #1A1D23; --flaeche-2: #262A31; --strich: #2A2E36;
    --tinte: #ECEAE4; --tinte-2: #9AA1AC; --rhein: #7FB0F0; --rhein-hell: #152238;
    --gut: #4CC38A; --mittel: #E0A84A; --schlecht: #F97066;
    --gut-flaeche: #12301F; --mittel-flaeche: #4A3A20; --schlecht-flaeche: #2E1715;
    --bahn: #2E6FBF; --bus: #4A505A; --nacht: #6B4FC4;
    --primaer-grund: #262B35; --primaer-rand: #6D7789; --primaer-rand-aktiv: #A1AEBD;
    --schatten: 0 1px 2px rgb(0 0 0 / .3), 0 8px 28px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}
:root[data-thema="dunkel"], :root[data-theme="dark"] {
  --papier: #0F1115; --flaeche: #1A1D23; --flaeche-2: #262A31; --strich: #2A2E36;
  --tinte: #ECEAE4; --tinte-2: #9AA1AC; --rhein: #7FB0F0; --rhein-hell: #152238;
  --gut: #4CC38A; --mittel: #E0A84A; --schlecht: #F97066;
  --gut-flaeche: #12301F; --mittel-flaeche: #4A3A20; --schlecht-flaeche: #2E1715;
  --bahn: #2E6FBF; --bus: #4A505A; --nacht: #6B4FC4;
  --primaer-grund: #262B35; --primaer-rand: #6D7789; --primaer-rand-aktiv: #A1AEBD;
  --schatten: 0 1px 2px rgb(0 0 0 / .3), 0 8px 28px rgb(0 0 0 / .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 4rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papier); color: var(--tinte);
  font: 16px/1.5 var(--schrift);
}
h1, h2, h3 { font-family: var(--schrift-titel); }
a { color: var(--rhein); }
:focus-visible { outline: 3px solid var(--rhein); outline-offset: 2px; border-radius: 6px; }
button { font: inherit; color: inherit; }
.nur-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.springen { position: absolute; left: -999px; top: .5rem; z-index: 2000; background: var(--tinte); color: var(--papier); padding: .6rem 1rem; border-radius: 8px; }
.springen:focus { left: 1rem; }
.zahl, .wert, .ring-zahl, .quote { font-variant-numeric: tabular-nums; }
/* Ankommen setzt Uhrzeiten und Kennzahlen in die Titelschrift — die grossen Statistik-Zahlen folgen dem */
.ring-zahl, .kachel .wert, .stunden-zahl { font-family: var(--schrift-titel); }

main, .kopf, .fuss { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }

/* ---------- Kopf & Antwortsatz ---------- */
.kopf { padding-top: max(1rem, env(safe-area-inset-top)); }
.kopf-zeile { display: flex; align-items: center; justify-content: space-between; }
.marke { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--tinte); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.marke-bild { width: 2rem; height: 2rem; color: var(--rhein); }
.knopf-rund { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid var(--strich); background: var(--flaeche); cursor: pointer; font-size: 1.2rem; }

.antwort { display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.25rem; align-items: center; padding: 1.4rem 0 1.2rem; }
.ring { position: relative; width: 6.5rem; height: 6.5rem; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-spur { fill: none; stroke: var(--flaeche-2); stroke-width: 12; }
.ring-wert { fill: none; stroke: var(--gut); stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray .9s ease; }
.ring-zahl { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 1.55rem; letter-spacing: -.02em; }
.vorzeile { margin: 0; color: var(--tinte-2); font-weight: 600; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }
.antwort :is(h1, h2) { margin: .15rem 0 .35rem; font-size: clamp(1.45rem, 5.4vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; }
.antwort :is(h1, h2) em { font-style: normal; color: var(--rhein); }
.antwort-unter { margin: 0; color: var(--tinte-2); max-width: 44rem; }
.fakten { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: .9rem 0 0; list-style: none; }
.fakten li { background: var(--flaeche); border: 1px solid var(--strich); border-radius: 999px; padding: .35rem .8rem; font-size: .9rem; }
.fakten b { font-variant-numeric: tabular-nums; }
.antwort-text { display: contents; }
.antwort-text > p:first-child, .antwort :is(h1, h2), .antwort-unter { grid-column: 2; }
.antwort .vorzeile { align-self: end; }
@media (max-width: 599px) {
  .antwort { grid-template-columns: 5.2rem 1fr; }
  .ring { width: 5.2rem; height: 5.2rem; grid-row: span 2; }
  .ring-zahl { font-size: 1.25rem; }
  .antwort-unter { grid-column: 1 / -1; }
  .antwort { padding: 1rem 0 .8rem; }
  .fakten { flex-wrap: nowrap; overflow-x: auto; margin: .7rem -1rem 0; padding: 0 1rem .2rem; scrollbar-width: none; }
  .fakten li { flex: none; }
}

/* ---------- Sprungleiste ---------- */
.sprung {
  position: sticky; top: 0; z-index: 1100; display: flex; gap: .25rem; overflow-x: auto;
  padding: .5rem max(1rem, calc((100vw - 72rem) / 2 + 1rem)); scrollbar-width: none;
  background: color-mix(in srgb, var(--papier) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--strich);
}
.sprung::-webkit-scrollbar { display: none; }
.sprung a { flex: none; padding: .55rem .85rem; border-radius: 999px; text-decoration: none; color: var(--tinte); font-weight: 600; font-size: .92rem; min-height: 2.75rem; display: inline-flex; align-items: center; }
.sprung a:hover { background: var(--flaeche-2); }
/* Aktiv im Ankommen-Primaer (Anthrazit), wie die Zeitchips der Fahrgast-Seiten */
.sprung a[aria-current="page"], .sprung a.seiten-link { background: var(--primaer-grund); color: var(--primaer-text); }

/* ---------- Abschnitte ---------- */
.abschnitt, .karte-bereich { margin-top: 2.2rem; }
.abschnitt-kopf h2 { margin: 0; font-size: clamp(1.2rem, 3.6vw, 1.55rem); letter-spacing: -.01em; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.erklaer { margin: .3rem 0 .9rem; color: var(--tinte-2); max-width: 46rem; }
.dynamisch { color: var(--tinte-2); font-size: .85rem; font-weight: 500; }
.hinweis { color: var(--tinte-2); font-size: .9rem; }
.karte, .kachel, .tagebuch, .verlauf, .verteilung, .hotspot-liste, .linien-liste, .nachtexpress, .linienwechsel, .heat-box, .bahnhof, .faq details { background: var(--flaeche); border: 1px solid var(--strich); border-radius: var(--radius-karte); }

/* ---------- Live-Karte ---------- */
.live-punkt { width: .7rem; height: .7rem; border-radius: 50%; background: var(--gut); display: inline-block; align-self: center; animation: puls 2s infinite; }
@keyframes puls { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gut) 60%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.live-stand { margin: .3rem 0 .8rem; color: var(--tinte-2); }
.live-stand b { color: var(--tinte); }
.karte-rahmen { position: relative; margin: 0 -1rem; }
.karte { height: 72vh; min-height: 22rem; max-height: 46rem; border-radius: 0; border-left: 0; border-right: 0; overflow: hidden; background: var(--flaeche-2); }
@media (min-width: 720px) {
  .karte-rahmen { margin: 0; }
  .karte { border-radius: var(--radius-karte); border: 1px solid var(--strich); height: 68vh; }
}
.karte-rahmen.vollbild { position: fixed; inset: 0; z-index: 1500; margin: 0; }
.karte-rahmen.vollbild .karte { height: 100%; max-height: none; border-radius: 0; }
body.hat-vollbild { overflow: hidden; }

.karte-werkzeuge { position: absolute; top: .75rem; right: .75rem; z-index: 800; display: flex; flex-direction: column; gap: .5rem; }
.werkzeug {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; padding: 0 .85rem;
  background: var(--flaeche); color: var(--tinte); border: 1px solid var(--strich); border-radius: 999px;
  box-shadow: var(--schatten); cursor: pointer; font-weight: 600; font-size: .9rem; justify-content: flex-start; white-space: nowrap;
}
.werkzeug[aria-pressed="true"] { background: var(--primaer-grund); color: var(--primaer-text); border-color: var(--primaer-rand); }
@media (max-width: 599px) { .werkzeug-text { display: none; } .werkzeug { width: 2.75rem; justify-content: center; padding: 0; font-size: 1.15rem; } }

/* Fahrzeug-Infokarte: mobil Blatt von unten, ab 900 px rechts oben */
.info {
  position: absolute; z-index: 1001; left: .5rem; right: .5rem; bottom: .5rem; max-height: 62%; overflow: auto;
  background: var(--flaeche); color: var(--tinte); border: 1px solid var(--strich); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 1rem 1rem .9rem; animation: hoch .2s ease-out;
}
@keyframes hoch { from { transform: translateY(12px); opacity: 0; } }
@media (min-width: 900px) { .info { left: auto; right: .75rem; top: 7.5rem; bottom: auto; width: 22rem; max-height: calc(100% - 8.5rem); } }
.info-zu { position: absolute; top: .4rem; right: .4rem; width: 2.75rem; height: 2.75rem; border: 0; background: transparent; cursor: pointer; font-size: 1.1rem; color: var(--tinte-2); border-radius: 50%; }
.info h3 { margin: 0 2.5rem .2rem 0; font-size: 1.15rem; display: flex; align-items: center; gap: .5rem; }
.info-ziel { margin: 0 0 .7rem; color: var(--tinte-2); }
.info-werte { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .6rem 0; }
.info-werte div { background: var(--flaeche-2); border-radius: 10px; padding: .45rem .5rem; }
.info-werte b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.info-werte span { font-size: .78rem; color: var(--tinte-2); line-height: 1.25; display: block; }
.info-satz { margin: .5rem 0; }
.info-warnung { background: var(--schlecht-flaeche); color: var(--tinte); border-radius: 10px; padding: .5rem .7rem; margin: .5rem 0; font-size: .92rem; }
.info-knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .7rem; }
.info-knoepfe button { min-height: 2.75rem; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--strich); background: var(--flaeche-2); cursor: pointer; font-weight: 600; }
.info-knoepfe button[aria-pressed="true"] { background: var(--primaer-grund); color: var(--primaer-text); border-color: var(--primaer-rand); }
.halte-liste { margin: .6rem 0 0; padding: 0 0 0 1.1rem; font-size: .9rem; color: var(--tinte-2); max-height: 11rem; overflow: auto; }
.halte-liste li::marker { color: var(--rhein); }

.karte-leiste { margin-top: .8rem; }
.suche-zeile { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.suche { flex: 1 1 14rem; }
.suche input {
  width: 100%; min-height: 2.9rem; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--strich);
  background: var(--flaeche); color: var(--tinte); font: inherit;
}
/* Ebenen-Chips umbrechen statt über die Kartenkante ragen —
   bei 375 px sind drei Chips + Lücke 6 px breiter als die Kartenbox. */
.ebenen { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-schalter, .linien-chip {
  min-height: 2.75rem; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--strich);
  background: var(--flaeche); cursor: pointer; font-weight: 600; font-size: .9rem; white-space: nowrap;
}
.chip-schalter[aria-pressed="true"] { background: var(--tinte); color: var(--papier); border-color: var(--tinte); }
.linien-chips { display: flex; gap: .4rem; overflow-x: auto; padding: .7rem 0 .3rem; scrollbar-width: thin; }
.linien-chip { display: inline-flex; align-items: center; gap: .35rem; padding: 0 .55rem 0 .35rem; flex: none; }
.linien-chip .n { color: var(--tinte-2); font-weight: 500; font-size: .82rem; font-variant-numeric: tabular-nums; }
.linien-chip[aria-pressed="true"] { border-color: var(--rhein); box-shadow: inset 0 0 0 2px var(--rhein); }
.legende { display: flex; flex-wrap: wrap; gap: .4rem 1rem; list-style: none; padding: 0; margin: .4rem 0 0; font-size: .85rem; color: var(--tinte-2); }
.legende li { display: inline-flex; align-items: center; gap: .35rem; }
.leg-kreis { width: 1rem; height: 1rem; border-radius: 50%; background: radial-gradient(circle, #e0443a 30%, #f2b443 70%); opacity: .8; }

/* Linienschilder (Karte, Listen, Legende) */
.schild, .leg-schild {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2.3rem; height: 1.6rem; padding: 0 .4rem;
  border-radius: 6px; font-weight: 800; font-size: .82rem; color: #fff; background: var(--bus); letter-spacing: .01em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.schild.bahn, .leg-bahn { background: var(--bahn); border-radius: 999px; }
.schild.nacht, .leg-nacht { background: var(--nacht); }
.schild.auff, .leg-auff { background: var(--schlecht); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--schlecht); }

.fahrzeug-marker { background: none; border: 0; }
.fahrzeug-marker .schild { box-shadow: 0 1px 3px rgb(0 0 0 / .45); border: 1.5px solid #fff; height: 1.45rem; min-width: 2rem; font-size: .76rem; cursor: pointer; position: relative; }
/* Touch-Ziel 44 px ohne die Optik zu ändern: unsichtbare Klickfläche
   um das kleine Schild (effektive Zone geprüft via elementFromPoint). */
.fahrzeug-marker .schild::after { content: ""; position: absolute; inset: -11px -6px; }
.fahrzeug-marker .schild.auff { box-shadow: 0 0 0 3px var(--schlecht), 0 1px 3px rgb(0 0 0 / .45); }
.fahrzeug-marker.gewaehlt .schild { transform: scale(1.35); box-shadow: 0 0 0 3px var(--rhein), 0 2px 6px rgb(0 0 0 / .5); }
.fahrzeug-marker.blass { opacity: .25; }
/* Fahrzeuge gleiten zur neuen Position (nicht beim Zoomen) */
.karte.gleitend .leaflet-marker-pane > .fahrzeug-marker { transition: transform 2.5s linear, opacity .3s; }
.leaflet-zoom-anim .leaflet-marker-pane > .fahrzeug-marker { transition: none !important; }

.leaflet-container { font: inherit; background: var(--flaeche-2); }
.leaflet-tooltip { font: 600 .85rem/1.35 system-ui, sans-serif; border-radius: 8px; }
.leaflet-bar a { width: 2.75rem !important; height: 2.75rem !important; line-height: 2.75rem !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-thema="hell"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.6); }
  :root:not([data-thema="hell"]) .leaflet-control-attribution,
  :root:not([data-thema="hell"]) .leaflet-control-scale-line { background: rgb(14 20 25 / .9); color: var(--tinte-2); }
  :root:not([data-thema="hell"]) .leaflet-control-attribution a { color: var(--rhein); }
}
:root[data-thema="dunkel"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.6); }
:root[data-thema="dunkel"] .leaflet-control-attribution,
:root[data-thema="dunkel"] .leaflet-control-scale-line { background: rgb(14 20 25 / .9); color: var(--tinte-2); }
:root[data-thema="dunkel"] .leaflet-control-attribution a { color: var(--rhein); }

/* ---------- Zeitraum ---------- */
.zeitraum {
  position: sticky; top: 3.6rem; z-index: 1000; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin: 2rem -1rem 0; padding: .6rem 1rem; background: color-mix(in srgb, var(--papier) 92%, transparent); backdrop-filter: blur(10px);
}
.zeitraum-label { font-weight: 700; font-size: .92rem; }
.segment { display: inline-flex; background: var(--flaeche-2); border-radius: 999px; padding: 3px; }
.seg {
  appearance: none; border: 0; background: transparent; color: var(--tinte-2); min-height: 2.6rem;
  padding: 0 1rem; border-radius: 999px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.seg[aria-pressed="true"] { background: var(--flaeche); color: var(--tinte); box-shadow: 0 1px 3px rgb(0 0 0 / .15); }
.seg.klein { min-height: 2.4rem; font-size: .88rem; }
.tag-wahl { min-height: 2.6rem; border-radius: 999px; border: 1px solid var(--strich); background: var(--flaeche); color: var(--tinte); padding: 0 .8rem; font: inherit; }
.tag-weg { background: var(--rhein-hell); color: var(--tinte); }

/* ---------- Kacheln „Was wir messen" ---------- */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); gap: .75rem; }
.kachel { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1rem .9rem; text-decoration: none; color: inherit; position: relative; transition: transform .15s, box-shadow .15s; }
a.kachel:hover { transform: translateY(-2px); box-shadow: var(--schatten); }
.kachel-titel { font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: .45rem; }
.kachel-titel .ico { width: 1.9rem; height: 1.9rem; border-radius: 9px; display: grid; place-items: center; background: var(--rhein-hell); color: var(--rhein); font-size: 1rem; flex: none; }
.kachel .wert { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: .35rem; }
.kachel .wert small { font-size: 1rem; font-weight: 600; color: var(--tinte-2); letter-spacing: 0; }
.kachel .bedeutung { margin: .2rem 0 0; color: var(--tinte-2); font-size: .92rem; }
.kachel.gut .wert { color: var(--gut); }
.kachel.mittel .wert { color: var(--mittel); }
.kachel.schlecht .wert { color: var(--schlecht); }
.kachel-name { min-width: 0; }
.kachel .pfeil { margin-left: auto; color: var(--tinte-2); padding-left: .3rem; }

/* ---------- Tagebuch ---------- */
/* Heatmap Wochentag × Stunde (Linien-Steckbrief): 25 Spalten (Label + 24 Stunden) */
.woche-raster { display: grid; grid-template-columns: 2.6rem repeat(24, minmax(0, 1fr)); gap: 2px; padding: 1rem; align-items: stretch; }
.woche-raster .woche-tag, .woche-achse .woche-tag { grid-column: 1; font-size: .75rem; color: var(--tinte-2); align-self: center; }
.woche-raster .woche-zelle { height: 1.1rem; border-radius: 3px; }
.woche-achse { display: grid; grid-template-columns: 2.6rem repeat(24, minmax(0, 1fr)); gap: 2px; padding: 0 1rem .7rem; }
.woche-achse .woche-stunde { grid-column: span 3; font-size: .7rem; color: var(--tinte-2); }
.woche-hinweis { margin: 0 .75rem .2rem; }
.woche-legende { display: flex; flex-wrap: wrap; gap: .15rem .55rem; margin: 0 .75rem .75rem; font-size: .75rem; }
.woche-legende span { white-space: nowrap; }
.tagebuch { display: flex; align-items: flex-end; gap: .35rem; padding: 1rem; overflow-x: auto; min-height: 9rem; }
/* Lange ungetrennte Wörter (CSV-Spaltenzeile der Berichte) brechen um,
   statt die Seite auf dem Handy um 148 px zu verbreitern. */
code { overflow-wrap: anywhere; }
.tag-balken {
  flex: 0 0 2.75rem; height: 7rem; border: 0; border-radius: 8px; cursor: pointer; position: relative; padding: 0;
  background: linear-gradient(to top, var(--farbe, var(--strich)) var(--anteil, 0%), var(--flaeche-2) var(--anteil, 0%));
}
.tag-balken.leer { cursor: default; opacity: .5; }
.tag-balken.aktuell { box-shadow: 0 0 0 3px var(--rhein); }
.tag-balken .tag-wert { position: absolute; top: .3rem; left: 0; right: 0; font-size: .75rem; font-weight: 700; color: var(--tinte); }
.tag-balken .tag-label { position: absolute; bottom: -1.35rem; left: -.3rem; right: -.3rem; font-size: .75rem; color: var(--tinte-2); white-space: nowrap; text-align: center; }
.tagebuch { padding-bottom: 2rem; }

/* ---------- Tagesverlauf ---------- */
.verlauf { padding: .8rem; }
.verlauf svg { width: 100%; height: auto; display: block; overflow: visible; }
.verlauf .achse { stroke: var(--strich); }
.verlauf .flaeche { fill: color-mix(in srgb, var(--rhein) 16%, transparent); }
.verlauf .linie { fill: none; stroke: var(--rhein); stroke-width: 2.5; stroke-linejoin: round; }
.verlauf .ziel { stroke: var(--tinte-2); stroke-dasharray: 4 4; stroke-width: 1; }
.verlauf text { fill: var(--tinte-2); font-size: 11px; }
.verlauf .punkt { fill: var(--flaeche); stroke: var(--rhein); stroke-width: 2; }

/* ---------- Verteilung ---------- */
.verteilung { padding: 1rem; }
.stapel { display: flex; height: 2.4rem; border-radius: 10px; overflow: hidden; margin: .2rem 0 .9rem; }
.stapel span { display: block; height: 100%; }
.balkenzeile { display: grid; grid-template-columns: 1rem 1fr auto; gap: .6rem; align-items: center; padding: .4rem 0; border-top: 1px solid var(--strich); }
.balkenzeile:first-of-type { border-top: 0; }
.farbpunkt { width: .9rem; height: .9rem; border-radius: 4px; }
.balkenzeile .zahl { font-weight: 700; }
.balkenzeile .erkl { display: block; font-size: .8rem; color: var(--tinte-2); line-height: 1.3; }
.f-gut { background: var(--gut); } .f-mittel { background: var(--mittel); } .f-schlecht { background: var(--schlecht); } .f-aus { background: var(--tinte-2); }

/* ---------- Hotspots ---------- */
.hotspot-liste { padding: .3rem 0; }
.hotspot-kachel {
  display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; width: 100%; text-align: left; align-items: center;
  padding: .6rem 1rem; border: 0; border-top: 1px solid var(--strich); background: transparent; cursor: pointer; min-height: 2.75rem;
}
.hotspot-kachel:first-child { border-top: 0; }
.hotspot-kachel .name { font-weight: 600; }
.hotspot-kachel .mini { grid-column: 1; height: .35rem; border-radius: 99px; background: var(--flaeche-2); overflow: hidden; }
.hotspot-kachel .mini i { display: block; height: 100%; }
.hotspot-kachel .zahl { grid-row: 1 / span 2; grid-column: 2; font-weight: 800; text-align: right; }
.hotspot-kachel .zahl small { display: block; font-weight: 500; color: var(--tinte-2); font-size: .78rem; }
.linien-detail { padding: .3rem 1rem .8rem; background: var(--flaeche-2); }
.linien-detail-kopf { font-size: .88rem; color: var(--tinte-2); margin: .3rem 0 .4rem; }
.linien-detail-zeile { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; padding: .2rem 0; font-size: .9rem; }

/* ---------- Linien-Ranking ---------- */
.sortierung { display: inline-flex; max-width: 100%; overflow-x: auto; background: var(--flaeche-2); border-radius: 999px; padding: 3px; margin-bottom: .6rem; scrollbar-width: none; }
.linien-liste { padding: .2rem 0; }
.linien-zeile {
  display: grid; grid-template-columns: minmax(3.2rem, auto) 1fr 4rem; grid-template-rows: auto auto; gap: .15rem .7rem; align-items: center;
  width: 100%; padding: .55rem 1rem; border: 0; border-top: 1px solid var(--strich); background: transparent; text-align: left; cursor: pointer;
}
.linien-zeile:first-child { border-top: 0; }
.linien-zeile:hover { background: var(--flaeche-2); }
.linien-zeile > :is(.schild, .linien-badge) { grid-row: span 2; }
.linien-zeile .schiene { height: .55rem; border-radius: 99px; background: var(--flaeche-2); overflow: hidden; }
.linien-zeile .balken { height: 100%; border-radius: 99px; }
.linien-zeile .quote { grid-row: span 2; text-align: right; font-weight: 800; }
.linien-zeile .unterzeile { font-size: .8rem; color: var(--tinte-2); }
.mehr { margin-top: .6rem; min-height: 2.75rem; padding: 0 1.2rem; border-radius: 999px; border: 1px solid var(--strich); background: var(--flaeche); cursor: pointer; font-weight: 600; }

.heat-box { margin-top: 1rem; padding: 0 1rem; }
.heat-box > summary { cursor: pointer; font-weight: 700; padding: .9rem 0; min-height: 2.75rem; }
.heat-box[open] { padding-bottom: 1rem; }
.scroll { overflow-x: auto; }
.heat { display: grid; gap: 2px; min-width: 40rem; font-size: .75rem; }
.heat .kopf { color: var(--tinte-2); text-align: center; padding: .1rem 0; }
.heat .zelle-linie { font-weight: 700; position: sticky; left: 0; background: var(--flaeche); padding-right: .3rem; }
.heat .zelle { height: 1.5rem; border-radius: 3px; }
.heat .zelle.leer { background: repeating-linear-gradient(45deg, var(--flaeche-2) 0 3px, transparent 3px 6px); }

/* ---------- Nachtexpress ---------- */
.nacht-bereich .nachtexpress { background: linear-gradient(160deg, #1b1640, #10162a); color: #eef0ff; border-color: #2c2a55; padding: 1rem; }
.nacht-bereich .hinweis, .nacht-bereich .klein-text { color: #b9bde0; }
.nacht-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .6rem; }
.nacht-kpi { background: rgb(255 255 255 / .07); border-radius: 12px; padding: .7rem .8rem; }
.nacht-kpi b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.nacht-kpi span { font-size: .82rem; color: #b9bde0; }
.nacht-stunden { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; align-items: end; height: 7.5rem; margin: .4rem 0 1.6rem; }
.nacht-balken { position: relative; height: 100%; border-radius: 8px; background: linear-gradient(to top, var(--farbe) var(--anteil), rgb(255 255 255 / .06) var(--anteil)); }
.nacht-wert { position: absolute; top: .3rem; left: 0; right: 0; text-align: center; font-size: .78rem; font-weight: 700; }
.nacht-label { position: absolute; bottom: -1.35rem; left: 0; right: 0; text-align: center; font-size: .75rem; color: #b9bde0; }
.nacht-linien { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: .4rem; }
.nacht-linie { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; align-items: center; padding: .5rem .6rem; background: rgb(255 255 255 / .05); border-radius: 10px; font-size: .88rem; }
.nacht-linie .schild { grid-row: span 2; background: var(--nacht); }
.nacht-linie .klein-text { font-size: .8rem; }

/* ---------- Linienwechsel ---------- */
.linienwechsel { padding: .3rem 0; }
.wechsel-zeile { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .8rem; align-items: center; padding: .55rem 1rem; border-top: 1px solid var(--strich); }
.wechsel-zeile:first-child { border-top: 0; }
.wechsel-paar { display: inline-flex; align-items: center; gap: .3rem; color: var(--tinte-2); }
.wechsel-ort { font-size: .9rem; }
.wechsel-zeiten { grid-column: 2; font-size: .8rem; color: var(--tinte-2); }
.wechsel-n { grid-row: span 2; grid-column: 3; font-weight: 800; }

/* ---------- Züge ---------- */
.bahnhof-reihe { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .75rem; }
.bahnhof { padding: 1rem; }
.bahnhof .name { font-weight: 700; display: flex; gap: .4rem; align-items: center; }
.bahnhof .gross { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.bahnhof .zeile { display: flex; justify-content: space-between; font-size: .88rem; color: var(--tinte-2); padding: .15rem 0; }
.zugliste { margin-top: .5rem; font-size: .82rem; color: var(--tinte-2); line-height: 1.7; }
.zugliste b { color: var(--tinte); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: .5rem; }
.faq details { padding: 0 1rem; }
.faq summary { cursor: pointer; font-weight: 700; padding: .9rem 0; min-height: 2.75rem; }
.faq p { margin: 0 0 1rem; color: var(--tinte-2); max-width: 48rem; }
.faq b { color: var(--tinte); }

/* ---------- Farben nach Bewertung ---------- */
.gut-t { color: var(--gut); } .mittel-t { color: var(--mittel); } .schlecht-t { color: var(--schlecht); }

/* ---------- Fuß ---------- */
.fuss { margin-top: 3rem; padding-top: 1.2rem; padding-bottom: max(2rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--strich); color: var(--tinte-2); font-size: .85rem; }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .zweispalter { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
  .antwort { padding: 2.2rem 0 1.6rem; }
  .ring { width: 8.5rem; height: 8.5rem; grid-row: span 3; }
  .ring-zahl { font-size: 2rem; }
  .fakten { grid-column: 2; }
  .zeitraum { margin-left: 0; margin-right: 0; border-radius: 999px; }
}

/* ---------- Karte: Hinweis für Zwei-Finger-Geste ---------- */
.gesten-hinweis {
  position: absolute; inset: 0; z-index: 950; display: grid; place-items: center; padding: 2rem; text-align: center;
  background: rgb(14 20 25 / .55); color: #fff; font-weight: 700; font-size: 1.05rem; pointer-events: none;
  opacity: 0; transition: opacity .2s;
}
.gesten-hinweis.sichtbar { opacity: 1; }

/* ---------- Unterseiten ---------- */
.seiten-kopf { padding: 1.4rem 0 1.2rem; }
.seiten-kopf h1, .seiten-kopf h2 { margin: .15rem 0 .4rem; font-size: clamp(1.45rem, 5.4vw, 2.4rem); line-height: 1.15; letter-spacing: -.02em; }
.sprung a[aria-current="page"], .sprung a.seiten-link { background: var(--primaer-grund); color: var(--primaer-text); }
.karte.klein { height: 55vh; max-height: 32rem; }
.spur-legende { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .6rem; font-size: .88rem; color: var(--tinte-2); }
.spur-eintrag { display: inline-flex; align-items: center; gap: .4rem; }
.spur-eintrag i { width: 1.4rem; height: .3rem; border-radius: 9px; display: inline-block; }
.fz-zeile { grid-template-columns: auto 1fr auto; }
.fz-zeile .fz-id { border: 0; background: transparent; padding: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.fz-zeile .fz-linien { display: flex; gap: .25rem; flex-wrap: wrap; }
.fz-zeile .schiene { grid-column: 1 / -1; }
.fz-zeile .unterzeile { grid-column: 1 / -1; }
.fz-zeile .quote { grid-row: auto; }
.fz-zeile:has(.fz-id[aria-pressed="true"]) { background: var(--rhein-hell); }

/* ---------- Handy ---------- */
@media (max-width: 599px) {
  /* minmax(0,1fr): ohne die 0 hat jede Spalte die auto-Mindestbreite ihrer
     Kachel (~11rem) — zwei Kacheln sprengten dann die Handyseite quer. */
  .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .kachel { padding: .75rem .75rem .7rem; border-radius: var(--radius-karte); }
  .kachel .wert { font-size: 1.6rem; margin-top: .25rem; }
  .kachel .wert small { font-size: .85rem; }
  .kachel .bedeutung { font-size: .8rem; line-height: 1.35; }
  .kachel-titel { font-size: .82rem; gap: .35rem; line-height: 1.2; }
  .kachel-titel .ico { width: 1.5rem; height: 1.5rem; font-size: .8rem; border-radius: 7px; }
  .karte { height: 62vh; }
  .abschnitt, .karte-bereich { margin-top: 1.8rem; }
  .erklaer { font-size: .95rem; }
  .linien-zeile { padding: .55rem .75rem; gap: .15rem .55rem; }
  .linien-zeile .unterzeile { font-size: .76rem; }
  .hotspot-kachel { padding: .55rem .75rem; }
  .zeitraum { gap: .35rem; }
  .zeitraum-label { display: none; }
  .seg { padding: 0 .8rem; }
  .tag-wahl { max-width: 9.5rem; }
}

/* =====================================================================
   App-Rahmen (20.11.2026): gemeinsamer Kopf mit Hauptnavigation, auf dem
   Handy als Leiste unten. Detailseiten Linien / Haltestellen, Kartenauswahl.
   ===================================================================== */
.app-kopf { border-bottom: 1px solid var(--strich); background: var(--papier); }
.app-kopf-innen { max-width: 72rem; margin: 0 auto; padding: max(.55rem, env(safe-area-inset-top)) 1rem .55rem; display: flex; align-items: center; gap: 1rem; }
.haupt-nav { display: flex; gap: .2rem; margin-left: auto; }
.haupt-link {
  display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 999px; min-height: 2.75rem;
  text-decoration: none; color: var(--tinte); font-weight: 600; font-size: .92rem; white-space: nowrap;
}
.haupt-link svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.haupt-link:hover { background: var(--flaeche-2); }
.haupt-link[aria-current="page"] { background: var(--tinte); color: var(--papier); }
.haupt-link .kurz { display: none; }
@media (max-width: 859px) {
  .haupt-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1400; margin: 0; gap: 0; justify-content: space-around;
    background: color-mix(in srgb, var(--flaeche) 94%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--strich); padding: .2rem .2rem max(.2rem, env(safe-area-inset-bottom));
  }
  .haupt-link { flex: 1 1 0; flex-direction: column; justify-content: center; gap: .12rem; min-height: 3.3rem; padding: .3rem .1rem; border-radius: 12px; font-size: .7rem; color: var(--tinte-2); }
  .haupt-link svg { width: 1.35rem; height: 1.35rem; }
  .haupt-link .lang { display: none; }
  .haupt-link .kurz { display: inline; }
  .haupt-link[aria-current="page"] { background: transparent; color: var(--rhein); }
  .haupt-link[aria-current="page"] svg { stroke-width: 2.6; }
  .app-kopf-innen .knopf-rund { margin-left: auto; }
  body { padding-bottom: calc(3.9rem + env(safe-area-inset-bottom)); }
  body.hat-vollbild .haupt-nav { display: none; }
}
.kopf { padding-top: 0; }

/* Links in Listen: ganze Zeile klickbar, ohne Unterstreichung */
a.linien-zeile, a.schild, .fz-karte, .linien-karte, .knoten-karte, .treffer-link, .nah-zeile, a.tafel-zeile { color: inherit; text-decoration: none; }
a.schild { color: #fff; }
a.schild:hover { filter: brightness(1.18); }
.halte-link { color: var(--rhein); font-weight: 600; text-decoration: none; }
.halte-link:hover { text-decoration: underline; }
.detail-link { display: inline-block; margin-top: .6rem; font-weight: 600; text-decoration: none; }
.knopf-link {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .95rem; border-radius: 999px; border: 1px solid var(--strich);
  background: var(--flaeche-2); color: var(--tinte); font-weight: 600; text-decoration: none; font-size: .92rem;
}
.knopf-link:hover { border-color: var(--rhein); }
.schild.zug, .leg-zug { background: #55606b; }

/* Leaflet-Popups im Seitenstil */
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--flaeche); color: var(--tinte); box-shadow: var(--schatten); }
.leaflet-popup-content { font: .9rem/1.45 system-ui, sans-serif; margin: .7rem .9rem; }
.leaflet-popup-content a { font-weight: 600; }
.leaflet-container a.leaflet-popup-close-button { color: var(--tinte-2); }

/* ---------- Karte: Linienauswahl ---------- */
.chips-hinweis { margin: .7rem 0 0; font-size: .85rem; color: var(--tinte-2); }
.linien-chip[aria-pressed="true"] {
  border-color: var(--chip-farbe, var(--rhein)); box-shadow: inset 0 0 0 2px var(--chip-farbe, var(--rhein));
  background: color-mix(in srgb, var(--chip-farbe, var(--rhein)) 14%, var(--flaeche));
}
.linien-chip[aria-pressed="true"] .schild { background: var(--chip-farbe); }
.auswahl {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .7rem; padding: .5rem .6rem;
  background: var(--flaeche); border: 1px solid var(--strich); border-radius: 14px; box-shadow: var(--schatten);
}
.auswahl-titel { font-weight: 700; font-size: .9rem; margin-right: .2rem; }
.auswahl-chip {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 2.5rem; padding: 0 .6rem 0 .25rem; border-radius: 999px;
  border: 2px solid var(--chip-farbe); background: var(--flaeche); cursor: pointer;
}
.auswahl-chip .weg { color: var(--tinte-2); font-size: .85rem; }
.auswahl-chip:hover .weg { color: var(--schlecht); }
.auswahl-alle { min-height: 2.5rem; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--strich); background: var(--flaeche-2); cursor: pointer; font-weight: 600; font-size: .88rem; }
.auswahl-detail { margin-left: auto; font-weight: 700; text-decoration: none; padding: .4rem .2rem; }
.info-knoepfe .knopf-link { min-height: 2.75rem; }

/* ---------- Plaketten (Verspätung einer Abfahrt) ---------- */
.plakette { display: inline-flex; align-items: center; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plakette.gut { background: var(--gut-flaeche); color: var(--gut); }
.plakette.mittel { background: var(--mittel-flaeche); color: var(--mittel); }
.plakette.schlecht { background: var(--schlecht-flaeche); color: var(--schlecht); }
.plakette.aus { background: var(--schlecht); color: #fff; }
.plakette.leer, .plakette:not(.gut):not(.mittel):not(.schlecht):not(.aus) { background: var(--flaeche-2); color: var(--tinte-2); }

/* ---------- Diagramme ---------- */
.diagramm-box { background: var(--flaeche); border: 1px solid var(--strich); border-radius: var(--radius); }
.saeulen-skala { margin: .65rem .8rem 0; color: var(--tinte-2); font-size: .75rem; }
.saeulen { display: grid; grid-template: minmax(0, 1fr) / repeat(24, minmax(0, 1fr)); gap: 2px; height: 10rem; padding: .15rem .8rem 1.7rem; }
.saeule { position: relative; height: 100%; display: flex; align-items: flex-end; }
.saeule i { display: block; width: 100%; border-radius: 3px 3px 0 0; min-height: 0; }
.saeule:hover i { filter: brightness(1.15); }
.saeule-label { position: absolute; bottom: -1.35rem; left: 0; font-size: .7rem; color: var(--tinte-2); white-space: nowrap; }
.saeule-quote { background: var(--flaeche-2); }
.saeule-leer { background: repeating-linear-gradient(135deg, var(--flaeche-2) 0 3px, var(--strich) 3px 5px); }
.saeule-jetzt { outline: 2px solid var(--tinte); outline-offset: -1px; z-index: 1; }
.diagramm-box > .zahlen-stunden-details { margin: 0 .8rem .25rem; }
.unter-titel { margin: 1.3rem 0 .5rem; font-size: 1rem; }

.fahrzeit-legende { margin: .65rem 0 .25rem; text-align: right; }
.fahrzeit-liste { list-style: none; margin: 0; padding: 0; }
.fahrzeit-zeile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .15rem .65rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--strich);
}
.fahrzeit-wert, .fahrzeit-zeile small { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fahrzeit-zeile small { font-size: .75rem; }
.fahrzeit-schiene { height: .25rem; border-radius: 99px; background: var(--strich); overflow: hidden; }
.fahrzeit-schiene span { display: block; height: 100%; border-radius: inherit; }

/* ---------- Seitenkopf der Detailseiten ---------- */
.detail-kopf { padding: 1.2rem 0 .4rem; }
.brotkrumen { margin: 0 0 .7rem; font-size: .9rem; }
.brotkrumen a { text-decoration: none; font-weight: 600; }
.brotkrumen a::before { content: "← "; }
.detail-titel { display: flex; align-items: center; gap: 1rem; }
.detail-titel :is(h1, h2) { margin: 0; font-size: clamp(1.6rem, 6vw, 2.6rem); line-height: 1.1; letter-spacing: -.02em; }
.detail-weg { margin: .25rem 0 0; color: var(--tinte-2); font-weight: 600; }
.detail-live { margin: .9rem 0 0; color: var(--tinte-2); }
.detail-live .live-punkt { vertical-align: middle; margin-right: .2rem; }
.detail-live b { color: var(--tinte); }
.detail-knoepfe { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.halt-zeichen {
  display: inline-grid; place-items: center; flex: none; width: 3rem; height: 3rem; border-radius: 50%;
  background: #f4c400; color: #17633a; border: 3px solid #17633a; font-weight: 900; font-size: 1.45rem; font-family: system-ui, sans-serif;
}
.halt-marker { background: none; border: 0; }
.halt-marker .halt-zeichen { width: 1.75rem; height: 1.75rem; font-size: .9rem; border-width: 2px; box-shadow: 0 1px 4px rgb(0 0 0 / .4); }
.h-linien { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .9rem; }

/* ---------- Linien-Übersicht ---------- */
.suche.gross { display: block; margin: 1.1rem 0 .3rem; }
.suche.gross input { min-height: 3.3rem; font-size: 1.05rem; padding: 0 1.2rem; }
.linien-gruppe h2 { display: flex; align-items: baseline; gap: .5rem; margin: 0 0 .7rem; font-size: clamp(1.15rem, 3.4vw, 1.45rem); }
.linien-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .6rem; }
.linien-karte, .knoten-karte, .fz-karte {
  display: flex; flex-direction: column; gap: .3rem; padding: .85rem .95rem; background: var(--flaeche);
  border: 1px solid var(--strich); border-radius: var(--radius); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.linien-karte:hover, .knoten-karte:hover, .fz-karte:hover, .treffer-link:hover, .nah-zeile:hover { transform: translateY(-2px); box-shadow: var(--schatten); border-color: var(--rhein); }
.lk-kopf { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.lk-live { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--tinte-2); }
.lk-live .live-punkt, .detail-live .live-punkt { width: .55rem; height: .55rem; }
.lk-weg { margin: .1rem 0 0; font-weight: 600; font-size: .92rem; line-height: 1.3; }
.lk-wert b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.lk-wert span { color: var(--tinte-2); font-size: .9rem; }
.lk-unter { margin: 0; font-size: .8rem; color: var(--tinte-2); }
.linien-karte .schiene { height: .45rem; border-radius: 99px; background: var(--flaeche-2); overflow: hidden; }
.linien-karte .balken { height: 100%; border-radius: 99px; }

/* ---------- Linienband ---------- */
.linienband { list-style: none; margin: 0; padding: .7rem 1rem; background: var(--flaeche); border: 1px solid var(--strich); border-radius: var(--radius); }
.band-legende { max-width: none; font-size: .9rem; }
.band-halt { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; padding: .38rem 0 .38rem 1.7rem; min-height: 2.5rem; }
.band-halt::before { content: ""; position: absolute; left: .58rem; top: 0; bottom: 0; width: 4px; background: var(--rhein); }
.band-halt:first-child::before { top: 50%; }
.band-halt:last-child::before { bottom: 50%; }
.band-halt::after { content: ""; position: absolute; left: .3rem; top: calc(50% - .45rem); width: .9rem; height: .9rem; border-radius: 50%; background: var(--flaeche); border: 3px solid var(--rhein); box-sizing: border-box; }
.band-faltung::before { background: repeating-linear-gradient(to bottom, var(--rhein) 0 4px, transparent 4px 8px); }
.band-faltung::after { content: none; }
.band-faltknopf { margin-top: 0; text-align: left; }
.band-fahrzeug { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem; padding: .1rem .55rem; border-radius: 999px; background: var(--flaeche-2); color: var(--tinte); text-decoration: none; font-size: .82rem; font-weight: 600; }
.band-fahrzeug:hover { text-decoration: underline; }
.band-fahrzeug-symbol { color: var(--linienfarbe-fest, var(--linienfarbe, var(--rhein))); font-size: 1.2rem; line-height: 1; }
.band-fahrzeug .linien-badge { min-inline-size: 0; font-size: inherit; }

/* ---------- Fahrten, Abfahrtstafel, Vorbeifahrten ---------- */
.fahrten-liste, .tafel { background: var(--flaeche); border: 1px solid var(--strich); border-radius: var(--radius); padding: .15rem 0; }
.heat-box .tafel { border: 0; background: transparent; margin: 0 -1rem; }
@media (min-width: 900px) { .fahrten-liste { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; } }
.fahrt-zeile, .tafel-zeile { display: grid; align-items: center; gap: .6rem; padding: .5rem 1rem; border-top: 1px solid var(--strich); min-height: 2.75rem; }
.fahrt-zeile { grid-template-columns: 3.2rem 1fr auto; }
.tafel-zeile { grid-template-columns: 3.2rem auto 1fr auto; }
.fahrt-zeile:first-child, .tafel-zeile:first-child { border-top: 0; }
@media (min-width: 900px) { .fahrten-liste .fahrt-zeile:nth-child(2) { border-top: 0; } }
.fahrt-zeit, .tafel-zeit { font-weight: 700; font-variant-numeric: tabular-nums; }
.fahrt-ziel, .tafel-ziel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tafel-zeile.ausfall .tafel-ziel, .tafel-zeile.ausfall .tafel-zeit { text-decoration: line-through; color: var(--tinte-2); }
.tafel-rechts { display: inline-flex; align-items: center; gap: .45rem; justify-content: flex-end; font-size: .85rem; color: var(--tinte-2); }
.tafel-min { color: var(--tinte); font-variant-numeric: tabular-nums; min-width: 3.2rem; text-align: right; }
a.tafel-zeile:hover { background: var(--flaeche-2); }

.fz-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem; }
.fz-karte { gap: .05rem; padding: .6rem .8rem; border-radius: 12px; }
.fz-karte b { font-variant-numeric: tabular-nums; }
.fz-karte span { font-size: .9rem; font-variant-numeric: tabular-nums; }
.fz-karte small { color: var(--tinte-2); }
.knoten-zeile .knoten-name { grid-row: span 2; font-weight: 600; min-width: 7.5rem; }

/* ---------- Haltestellen ---------- */
.such-kasten { display: flex; gap: .5rem; align-items: center; margin-top: 1.1rem; }
.such-kasten .suche.gross { flex: 1; margin: 0; }
.treffer { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .4rem; }
.treffer-link { display: grid; grid-template-columns: 1fr auto; gap: .35rem .6rem; align-items: center; padding: .65rem .95rem; background: var(--flaeche); border: 1px solid var(--strich); border-radius: 12px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.treffer-link small { grid-row: 1; grid-column: 2; color: var(--tinte-2); }
.treffer-linien { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .25rem; }
.knoten-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: .6rem; }
.knoten-karte .gross { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.knoten-karte small { color: var(--tinte-2); font-size: .82rem; }
.nah-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .4rem; margin-top: .7rem; }
.nah-zeile { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center; padding: .5rem .75rem; background: var(--flaeche); border: 1px solid var(--strich); border-radius: 12px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.nah-ziel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nah-d { color: var(--tinte-2); font-size: .85rem; font-variant-numeric: tabular-nums; }
#h-kein-knoten { margin-top: 1.5rem; }

@media (max-width: 599px) {
  .detail-titel { gap: .75rem; }
  .halt-zeichen { width: 2.6rem; height: 2.6rem; font-size: 1.25rem; }
  .fahrt-zeile, .tafel-zeile { padding: .45rem .75rem; gap: .45rem; }
  .tafel-zeile { grid-template-columns: 2.9rem auto 1fr auto; }
  .tafel-min { min-width: 0; }
  .saeulen { height: 8rem; padding: .15rem .5rem 1.6rem; gap: 1px; }
  .saeulen-skala { margin-inline: .5rem; }
  .such-kasten .werkzeug-text { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Ehrlichkeit (Issue #11) ---------- */
.ehr-streifen { padding-top: .9rem; }
.ehr-kacheln { display: flex; flex-wrap: wrap; gap: .6rem; margin: .6rem 0; }
.ehr-kacheln .kachel {
  background: var(--flaeche); border: 1px solid var(--strich); border-radius: .6rem;
  padding: .5rem .8rem; font-size: .9rem; color: var(--tinte-2);
}
.ehr-kacheln .kachel b { color: var(--tinte); font-size: 1.15rem; }
.zustand { font-size: .78rem; padding: .1rem .4rem; border-radius: 1rem; white-space: nowrap; }
.zustand-gps { background: color-mix(in srgb, var(--gut) 16%, transparent); color: var(--gut); }
.zustand-prognose { background: color-mix(in srgb, var(--mittel) 16%, transparent); color: var(--mittel); }
.zustand-plan { background: color-mix(in srgb, var(--tinte-2) 12%, transparent); color: var(--tinte-2); }
.tafel-zeile { display: grid; grid-template-columns: auto auto 1fr auto; gap: .5rem; align-items: baseline; }
.tafel-zitat {
  grid-column: 1 / -1; font-size: .75rem; color: var(--tinte-2);
  padding-left: .1rem; margin-top: -.15rem;
}
.geist-schild .geist-linie {
  display: inline-block; padding: .1rem .45rem; border-radius: 1rem;
  background: color-mix(in srgb, var(--schlecht) 18%, transparent);
  color: var(--schlecht); font-weight: 700; font-size: .8rem;
  border: 1px dashed var(--schlecht);
}
.leg-geist { filter: grayscale(.3); }
@media (max-width: 599px) {
  .tafel-zeile { grid-template-columns: auto auto 1fr; }
  .tafel-rechts { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: baseline; }
}

/* ---------- Berichte (Roadmap 4.6/4.7) ---------- */
.zitat-kasten { margin: 0; padding: 1rem 1.2rem; border-left: 4px solid var(--rhein); background: var(--flaeche-2); border-radius: 0 10px 10px 0; }
.zitat-kasten p { margin: 0; line-height: 1.55; }
.werkzeuge { display: flex; flex-wrap: wrap; gap: .6rem; }
.werkzeuge a.werkzeug { text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Meine Fahrten (lokal beobachtete Abfahrten) ---------- */
.beobachte { border: 0; background: none; color: var(--tinte-2); font-size: 1rem; padding: .2rem .35rem; border-radius: 6px; cursor: pointer; }
.beobachte:hover { background: var(--flaeche-2); color: var(--rhein); }
.beobachte.gesetzt { color: var(--gut, #2a9d5c); }
.meine-fahrt { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; padding: .65rem .9rem; border-bottom: 1px solid var(--strich); }
.meine-fahrt:last-child { border-bottom: 0; }
.meine-fahrt .meine-lage { flex: 1 1 auto; min-width: 12rem; }
.meine-fahrt .meine-zeit { font-weight: 700; }
.meine-fahrt .meine-warnung { color: var(--schlecht, #b32622); font-weight: 700; }
.meine-fahrt .meine-ok { color: var(--gut, #2a9d5c); font-weight: 700; }
.meine-fahrt button.weg { border: 0; background: none; color: var(--tinte-2); cursor: pointer; padding: .2rem .4rem; border-radius: 6px; }
.meine-fahrt button.weg:hover { background: var(--flaeche-2); color: var(--schlecht, #b32622); }

/* ---------- Fahrt planen (Router) ---------- */
.route-kasten { display: flex; flex-wrap: wrap; gap: .6rem; }
.route-kasten .suche { flex: 1 1 12rem; }
.route-kasten .r-uhr { flex: 0 0 7rem; }
.linie-route { padding: .75rem .9rem; border-bottom: 1px solid var(--strich); }
.linie-route:last-child { border-bottom: 0; }
.linie-route .route-ziel { color: var(--tinte-2); }
.linie-route .route-zeit { color: var(--tinte-2); }
.route-fuss { margin-top: .3rem; font-size: .82rem; color: var(--tinte-2); }
.route-klappt.gut-t { color: var(--gut, #2a9d5c); font-weight: 600; }
.route-klappt.mittel-t { color: #b07d10; font-weight: 600; }
.route-klappt.schlecht-t { color: var(--schlecht, #b32622); font-weight: 600; }

/* Tempo-Kacheln (fahrzeuge) */
.tempo-legende {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem;
  margin-top: 0.6rem; align-items: center;
}
.tempo-eintrag { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; }
.tempo-chip { width: 0.85rem; height: 0.85rem; border-radius: 0.2rem; display: inline-block; }

/* Konto (login) */
.konto-form { display: grid; gap: 0.7rem; max-width: 24rem; }
.konto-form label { display: grid; gap: 0.25rem; font-size: 0.85rem; font-weight: 600; }
.konto-form input { padding: 0.55rem 0.7rem; border: 1px solid var(--strich, #c9c2b4); border-radius: 0.45rem; background: var(--papier, #fff); color: inherit; font: inherit; }
.werkzeug.gefahr { color: #b91c1c; border-color: #b91c1c; }

/* Ankommen-Kopf auf den Statistikseiten (Runde 3: alle Unterseiten). */
body.statistik-ankommen .antwort {
  background: var(--flaeche);
  border: 1px solid var(--strich);
  border-radius: var(--radius-karte);
  padding: 1.1rem;
  margin-block-start: 1.2rem;
}
body.statistik-ankommen .fakten { margin: .7rem 0 0; }
body.statistik-ankommen main,
body.statistik-ankommen .fuss {
  max-width: none;
  inline-size: min(100%, 34rem);
  margin-inline: auto;
  padding-inline: 16px;
}
body.statistik-ankommen .zweispalter { display: block; }
.statistik-kopf {
  width: 100%;
  border-bottom: 1px solid var(--strich);
  background: var(--papier);
  padding: max(.55rem, env(safe-area-inset-top)) 1rem .55rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.statistik-kopf h1 { margin: 0; font-size: 22px; }
.statistik-kopf .knopf, .statistik-ankommen .knopf {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  font: inherit;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}
.statistik-kopf .knopf--zurueck, .statistik-ankommen .knopf--zurueck { font-size: 28px; padding: 0; }
.statistik-kopf .knopf--sekundaer, .statistik-ankommen .knopf--sekundaer { border-color: var(--strich); background: var(--flaeche); }
.statistik-ankommen .planer-link { color: var(--rhein); }
.statistik-ankommen .planer-hinweis { padding: 10px; border: 1px solid var(--strich); border-radius: 14px; }
.statistik-ankommen .dialog {
  width: min(24rem, calc(100% - 2rem));
  border: 1px solid var(--strich);
  background: var(--flaeche);
  color: var(--tinte);
  border-radius: 18px;
}
.statistik-ankommen .dialog h2 { margin: 0 0 10px; }
.statistik-ankommen .dialog form { margin-top: 10px; }
.statistik-ankommen .mehr-links { list-style: none; margin: 0; padding: 0; border: 1px solid var(--strich); border-radius: 18px; }
.statistik-ankommen .mehr-links > li + li { border-block-start: 1px solid var(--strich); }
.statistik-ankommen .listen-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-block-size: 48px; padding: 10px 14px; color: inherit; font-size: 15px; font-weight: 600; text-decoration: none; }
.statistik-ankommen a.listen-zeile::after { content: ""; flex: none; inline-size: 7px; block-size: 7px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.statistik-ankommen .mehr-darstellung { flex-wrap: wrap; padding-block: 4px; }
.statistik-links, .statistik-ankommen :is(.sprung, .linien-chips, .fakten) { display: flex; flex-wrap: wrap; gap: .25rem; }
.statistik-ankommen :is(button, .sprung a, .statistik-links a) { min-height: 44px; min-width: 44px; }
.statistik-links a { display: inline-flex; align-items: center; padding-inline: 8px; }
.statistik-ankommen :is(.tag-wahl:not(.nur-sr), #live-suche, .info-knoepfe a) { min-height: 44px; }
.statistik-ankommen :is(.tagebuch, .sortierung, .segment) { flex-wrap: wrap; }
.statistik-ankommen .tagebuch { row-gap: 1.5rem; padding-bottom: 2rem; }
.statistik-ankommen .sprung { position: static; }
.statistik-ankommen .zeitraum { top: 0; }
.tag-feld { position: relative; display: flex; gap: .5rem; flex-wrap: wrap; }
.tag-chip {
  border: 1px solid var(--rand); border-radius: 999px; padding-inline: .8rem;
  background: var(--flaeche); color: var(--tinte); font-weight: 600; white-space: nowrap;
}
.statistik-ankommen :has(> .detail-verweis) { position: relative; }
.detail-verweis { color: inherit; text-decoration: none; }
.detail-verweis::after { content: ""; position: absolute; inset: 0; }
.detail-verweis:focus-visible::after { outline: 2px solid var(--link); outline-offset: -2px; border-radius: inherit; }
.treffer-name { font-weight: 700; }
.detail-titel > .detail-live { margin-top: 0; }
.fahrzeug-marker .linien-badge {
  display: grid; place-items: center; min-height: 44px; width: max-content;
  border: 1.5px solid #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .45);
  font: 700 1rem var(--schrift-titel);
}
.fahrzeug-marker .linien-badge.auff { box-shadow: 0 0 0 3px var(--schlecht), 0 1px 3px rgb(0 0 0 / .45); }
.heat-gruppen { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr)); }
.heat-gruppen .heat { min-width: 0; }
.heat-gruppen .zelle-linie { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

/* ---------- Handy-Heatmap (Nachtrag S1) ----------
   Muss NACH .heat-gruppen .heat { min-width: 0 } stehen: gleiche Spezifität,
   sonst gewinnt die frühere Regel und die Heatmap bleibt gequetscht.
   24 Stundenzellen brauchen ihre Breite — auf dem Handy eigener Quer-Scroll-
   Container statt die Seite zu sprengen; Zeilennamen bleiben sticky stehen. */
@media (max-width: 599px) {
  .heat-gruppen { overflow-x: auto; }
  .heat-gruppen .heat { min-width: 40rem; }
}
