/* ==========================================================================
   Bonn Pendler — Verkehrsprognose-Dashboard
   Verbindliche Design-Referenz: design_reference/ (High-Fidelity-Handoff).
   Flach, ruhig, belegbar. Severity über Farbe UND Form/Glyphe (WCAG-AA).
   Schrift: Hanken Grotesk (400/500, self-hosted). Hell + Dunkel gleichwertig.
   ========================================================================== */

/* --- Design-Tokens: Hell (Default) --------------------------------------- */
:root {
  --bg: #F4F1EB;
  --surface: #FFFFFF;
  --surface-2: #F0ECE3;
  --hairline: rgba(34, 28, 22, .10);
  --hairline-strong: rgba(34, 28, 22, .17);
  --text: #1C1E22;
  --text-2: #6B7077;
  --text-3: #9DA2A8;
  --accent: #2E6CA8;
  --accent-weak: rgba(46, 108, 168, .10);
  --accent-ink: #FFFFFF;

  /* Severity-Skala (hell = dunkel, trägt Bedeutung) */
  --sev0: #1D9E75;  --sev0-ink: #FFFFFF;   /* frei */
  --sev1: #EF9F27;  --sev1-ink: #3A2A00;   /* zäh  */
  --sev2: #D85A30;  --sev2-ink: #FFFFFF;   /* stockend */
  --sev3: #E24B4A;  --sev3-ink: #FFFFFF;   /* Stau / gesperrt */
  /* Textvariante der Severity-Farben für TEXT AUF HELLEM GRUND. Die Flächenfarben oben sind
     für gefüllte Badges gedacht und erreichen als Schriftfarbe auf Weiß den WCAG-AA-Kontrast
     nicht: gemessen 2,17:1 (zäh), 3,87:1 (stockend), 3,96:1 (Stau) gegen die nötigen 4,5:1 —
     und die Hauptkennzahl „+X %" wird in genau dieser Farbe gesetzt (22 px, weight 500).
     Diese Töne sind abgedunkelt bis mindestens 4,5:1 und behalten den Farbcharakter. */
  --sev0-text: #14795A;
  --sev1-text: #8A5A00;
  --sev2-text: #A8390F;
  --sev3-text: #B32B2A;
  --live: #1D9E75;

  --font: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --maxw: 1180px;

  /* Layout (Desktop) */
  --pad: 30px;
  --gap: 18px;
  --cardpad: 20px;
  --maph: 460px;
  --hlfs: 27px;     /* Schlagzeile */
  --ttfs: 22px;     /* Listen-Fahrzeit */
  --heat-h: 46px;
  --bottomcols: 1fr 1fr;
  --controlsdir: row;
  --subdisp: block;

  color-scheme: light;
}

/* --- Design-Tokens: Dunkel ----------------------------------------------- */
:root[data-theme="dark"] {
  --bg: #131519;
  --surface: #1B1E23;
  --surface-2: #23272E;
  --hairline: rgba(255, 255, 255, .10);
  --hairline-strong: rgba(255, 255, 255, .17);
  --text: #EDEFF2;
  --text-2: #A2A8B0;
  --text-3: #727981;
  --accent: #5E97D6;
  --accent-weak: rgba(94, 151, 214, .18);
  --accent-ink: #0E1217;
  /* Im Dunkelmodus haben die Flächenfarben auf der dunklen Karte reichlich Kontrast —
     die abgedunkelten Hell-Varianten wären dort kaum lesbar. */
  --sev0-text: var(--sev0); --sev1-text: var(--sev1);
  --sev2-text: var(--sev2); --sev3-text: var(--sev3);
  color-scheme: dark;
}

/* No-JS-Fallback: Systemwunsch dunkel, solange kein manuelles Theme gesetzt ist. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #131519; --surface: #1B1E23; --surface-2: #23272E;
    --hairline: rgba(255,255,255,.10); --hairline-strong: rgba(255,255,255,.17);
    --text: #EDEFF2; --text-2: #A2A8B0; --text-3: #727981;
    --accent: #5E97D6; --accent-weak: rgba(94,151,214,.18); --accent-ink: #0E1217;
    --sev0-text: var(--sev0); --sev1-text: var(--sev1);
    --sev2-text: var(--sev2); --sev3-text: var(--sev3);
    color-scheme: dark;
  }
}

/* --- Severity-Helfer: setzen --sev / --sev-ink für Punkte/Balken/Pillen ---- */
.lv0, .st-frei       { --sev: var(--sev0); --sev-ink: var(--sev0-ink); --sev-text: var(--sev0-text); }
.lv1, .st-zaeh       { --sev: var(--sev1); --sev-ink: var(--sev1-ink); --sev-text: var(--sev1-text); }
.lv2, .st-stockend   { --sev: var(--sev2); --sev-ink: var(--sev2-ink); --sev-text: var(--sev2-text); }
.lv3, .st-gesperrt, .st-stau { --sev: var(--sev3); --sev-ink: var(--sev3-ink); --sev-text: var(--sev3-text); }
.st-unbekannt        { --sev: var(--text-3); --sev-ink: #fff; }
.st-info             { --sev: var(--accent); --sev-ink: var(--accent-ink); }

/* --- Reset / Basis -------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .25s, color .25s;
}
::selection { background: var(--accent-weak); }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
.tnum { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-3); margin: 0;
}

/* --- Seitengerüst --------------------------------------------------------- */
.bp-wrap {
  max-width: var(--maxw); margin: 0 auto; padding: var(--pad);
  display: flex; flex-direction: column; gap: var(--gap);
}
.card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 14px; padding: var(--cardpad);
}

/* --- Kopfzeile ------------------------------------------------------------ */
.bp-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.bp-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bp-brand__mark {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-weak); color: var(--accent);
}
.bp-brand__name { font-size: 18px; font-weight: 500; letter-spacing: -.01em; }
.bp-brand__sub  { display: var(--subdisp); font-size: 12.5px; color: var(--text-2); }
.bp-head-right { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.bp-date { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.bp-date__d { font-size: 13px; font-weight: 500; }
.bp-date__w { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.icon-btn {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--hairline); color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); }

/* --- Steuerleiste: Richtungs-Toggle + Jetzt ------------------------------- */
.bp-controls { display: flex; flex-direction: var(--controlsdir); gap: 12px; align-items: stretch; }
.seg {
  position: relative; flex: 1; display: flex; padding: 4px; min-height: 54px;
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 14px;
}
.seg__ind {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: 10px; background: var(--surface); border: 1px solid var(--hairline);
  box-shadow: 0 1px 2px rgba(0,0,0,.06); pointer-events: none;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.seg[data-dir="out"] .seg__ind { transform: translateX(100%); }
.seg__btn {
  position: relative; z-index: 1; flex: 1; display: flex; align-items: center;
  justify-content: center; gap: 9px; padding: 13px 8px; cursor: pointer;
  background: none; border: 0; border-radius: 10px; font-size: 15px; font-weight: 500;
  color: var(--text-2); transition: color .2s;
}
.seg[data-dir="in"]  .seg__btn[data-set="in"],
.seg[data-dir="out"] .seg__btn[data-set="out"] { color: var(--text); }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 22px; min-height: 54px; white-space: nowrap; cursor: pointer;
  background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: 14px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.btn:hover { background: var(--surface-2); }

/* --- Status-Schlagzeile --------------------------------------------------- */
.bp-headline { display: flex; flex-direction: column; gap: 13px; }
.bp-headline__row { display: flex; align-items: center; gap: 14px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 22px; flex: 0 0 auto; }
.bars span { width: 4px; border-radius: 2px; background: var(--surface-2); }
.bars span:nth-child(1) { height: 8px; }
.bars span:nth-child(2) { height: 12px; }
.bars span:nth-child(3) { height: 16px; }
.bars span:nth-child(4) { height: 20px; }
.bars[data-level="0"] span:nth-child(-n+1),
.bars[data-level="1"] span:nth-child(-n+2),
.bars[data-level="2"] span:nth-child(-n+3),
.bars[data-level="3"] span:nth-child(-n+4) { background: var(--sev); }
.bp-headline__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bp-headline__h { font-size: var(--hlfs); font-weight: 500; letter-spacing: -.015em; line-height: 1.12; text-wrap: pretty; }
.bp-headline__sub { font-size: 14px; color: var(--text-2); }
/* Abfahrtsempfehlung (AP2) — eigene Zeile unter der Schlagzeile, Akzent statt Alarm. */
.bp-headline__reco { font-size: 13px; font-weight: 500; color: var(--sev0); }
/* Gute-Fenster-Band unter dem Scrubber (AP2): frei-Abschnitte über alle Korridore. */
.scrub-good { position: absolute; left: 0; right: 0; bottom: -7px; height: 3px; pointer-events: none; }
.scrub-good__seg { position: absolute; top: 0; height: 100%; background: var(--sev0); border-radius: 2px; opacity: .8; }
/* Empfehlungszeile im Korridor-Detail-Hero (AP2). */
.kd-reco { font-size: 13.5px; font-weight: 500; color: var(--sev0); margin: -8px 0 0; }
/* Wochentag-Cluster-Auswahl der Prognosematrix (AP2, ehrliche 4 Cluster Mo–Do/Fr/Sa/So). */
.daysel { display: inline-flex; gap: 4px; }
.daysel__btn { border: 1px solid var(--hairline-strong); background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.daysel__btn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 500; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--accent-weak); color: var(--accent);
}
.chip--live { background: rgba(29,158,117,.16); color: var(--live); }
.chip__pulse { width: 7px; height: 7px; border-radius: 999px; background: var(--live); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.linkbtn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 0; background: none; border: 0; cursor: pointer;
  color: var(--text-2); font-size: 13px;
}
.linkbtn:hover { color: var(--accent); }

/* --- Belege-Panel --------------------------------------------------------- */
.belege {
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 11px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 12px;
}
.belege__head {
  display: flex; align-items: center; gap: 7px; color: var(--text-3);
  font-size: 11px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase;
}
.belege__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 22px; }
.belege__k { font-size: 11px; color: var(--text-3); }
.belege__v { font-size: 13px; color: var(--text-2); }
.belege__src { display: flex; flex-wrap: wrap; gap: 6px; }
.belege__src span {
  font-size: 11.5px; color: var(--text-2); background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 999px; padding: 4px 10px;
}

/* --- Zeit-Scrubber (Heat-Streifen) ---------------------------------------- */
.bp-scrub__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.bp-scrub__time { font-size: 34px; font-weight: 500; letter-spacing: -.02em; line-height: 1; }
.bp-scrub__track { position: relative; touch-action: none; cursor: pointer; user-select: none; margin-top: 14px; }
.heat { position: relative; display: flex; gap: 3px; height: var(--heat-h); }
.heat__cell { flex: 1; border-radius: 3px; background: var(--surface-2); transition: background .25s, opacity .25s; }
.heat__cell.lv0 { opacity: .55; } .heat__cell.lv0,
.heat__cell.lv1, .heat__cell.lv2, .heat__cell.lv3 { background: var(--sev); }
.heat__cell.is-empty { background: var(--surface-2); opacity: 1; }
.heat__head { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); transform: translateX(-1px); border-radius: 2px; pointer-events: none; z-index: 2; }
.bp-scrub__rail { position: relative; height: 20px; margin-top: 9px; }
.bp-scrub__rail::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); height: 4px; border-radius: 999px; background: var(--surface-2); }
.bp-scrub__handle { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 999px; background: var(--surface); border: 2px solid var(--text); transform: translate(-50%,-50%); box-shadow: 0 1px 3px rgba(0,0,0,.2); pointer-events: none; }
.bp-scrub__ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 8px; }

/* --- Karte ---------------------------------------------------------------- */
.bp-map-sec { display: flex; flex-direction: column; gap: 9px; }
.bp-map-frame { position: relative; border: 1px solid var(--hairline); border-radius: 16px; overflow: hidden; }
#map, #cmap { width: 100%; height: var(--maph); background: var(--surface-2); }
.bp-map-hint { display: flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 12.5px; padding-left: 2px; }
.maplibregl-ctrl-attrib { font-size: 10px !important; }

/* Karten-Overlays: Fahrzeit-Pille, Brücke, Zentrum, Legende */
/* Pille = neutrale Fläche mit farbigem Zustands-Pip (Glyph) + neutraler Zahl: die Farbe
   codiert den längennormierten Zustand, die Zahl die absoluten Zeitkosten — getrennt lesbar. */
.mappill {
  display: flex; align-items: center; gap: 5px; min-width: 40px; height: 22px;
  padding: 0 9px 0 4px; border-radius: 999px; font: 500 12px/1 var(--font); white-space: nowrap;
  background: var(--surface); color: var(--text);
  box-shadow: 0 0 0 1.5px var(--surface), 0 1px 3px rgba(0,0,0,.18);
}
.mappill__pip {
  flex: 0 0 auto; width: 15px; height: 15px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--sev, var(--text-3)); color: var(--sev-ink, #fff); font-size: 10px; line-height: 1;
}
.mappill__num { font-variant-numeric: tabular-nums; }
.mappill.is-sel { outline: 2px solid var(--text); outline-offset: 1.5px; }
.mapnode { display: flex; flex-direction: column; align-items: center; white-space: nowrap; pointer-events: none; transform: translate(-50%,-50%); }
.mapnode__d { width: 8px; height: 8px; background: var(--surface); border: 2px solid var(--text-2); transform: rotate(45deg); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.mapnode__c { width: 13px; height: 13px; border-radius: 999px; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--accent); }
.mapnode__lbl { margin-top: 4px; font: 500 9.5px/1 var(--font); color: var(--text-2); background: var(--surface); padding: 2px 5px; border-radius: 5px; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.bp-legend {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px;
  padding: 9px 12px; font: 400 11.5px/1.2 var(--font); box-shadow: 0 1px 4px rgba(0,0,0,.12);
  display: grid; grid-template-columns: auto auto; gap: 6px 16px;
}
.bp-legend__t { grid-column: 1/3; color: var(--text-3); font-weight: 500; }
.bp-legend__row { display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.bp-legend__sw { width: 15px; height: 6px; border-radius: 999px; display: inline-block; }
/* Sperrung: rot-weißes Absperrband-Muster (Status nie nur über Farbe) */
.bp-legend__sw--closed {
  background: repeating-linear-gradient(90deg, var(--sev3) 0 4px, #fff 4px 8px);
  box-shadow: 0 0 0 1px var(--hairline);
}

/* „Alle Straßen"-Toggle (Karten-Control oben links): schaltet die flächige
   Einzelstrecken-Einfärbung zu (live + scrubber-synchron). */
.bp-maptoggle-ctrl { margin: 10px !important; }
.bp-maptoggle {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 12.5px/1 var(--font); color: var(--text-2);
  padding: 8px 12px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--hairline);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .14);
}
.bp-maptoggle:hover { color: var(--text); }
.bp-maptoggle__dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-3); transition: background .15s, box-shadow .15s;
}
.bp-maptoggle.is-on { color: var(--text); border-color: var(--sev0); }
.bp-maptoggle.is-on .bp-maptoggle__dot {
  background: var(--sev0); box-shadow: 0 0 0 3px rgba(29, 158, 117, .22);
}

/* Sperrungs-Popup auf der Karte */
.maplibregl-popup-content {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--hairline); border-radius: 10px;
  padding: 10px 12px; box-shadow: 0 4px 16px rgba(0,0,0,.22);
}
.maplibregl-popup-tip { display: none; }
.mappop { font: 400 12.5px/1.35 var(--font); }
.mappop__tag {
  display: inline-block; margin-bottom: 6px; padding: 3px 7px; border-radius: 5px;
  font: 600 10px/1 var(--font); letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--sev3);
}
.mappop__t { color: var(--text-2); margin-top: 3px; }

/* --- Korridorliste -------------------------------------------------------- */
.bp-corridors { padding: 8px; }
.bp-corridors__cap { padding: 10px 12px 8px; }
.crow { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 12px; cursor: pointer; }
.crow:hover, .crow.is-open { background: var(--surface-2); }
.crow__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.crow__name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crow__name { font-size: 15px; font-weight: 500; }
.crow__sub { font-size: 12px; color: var(--text-3); }
.crow__dir { font-size: 12.5px; color: var(--text-2); }
/* Hinweis, wenn ein Korridor nur richtungsunabhängig gemessen wird (in==out ist dann ehrlich). */
.crow__symnote { font-size: 11px; color: var(--text-3); font-style: italic; cursor: help; }
.crow__symnote::before { content: "ⓘ "; font-style: normal; }
.crow__sev { flex: 0 0 auto; width: 92px; display: flex; flex-direction: column; gap: 6px; }
.crow__sev-top { display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--sev, var(--text-3)); flex: 0 0 auto; }
.crow__sevlabel { font-size: 12px; color: var(--text-2); }
.sevbar { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.sevbar > i { display: block; height: 100%; background: var(--sev, var(--text-3)); border-radius: 999px; transition: width .25s, background .25s; }
.sevbar[data-level="0"] > i { width: 24%; }
.sevbar[data-level="1"] > i { width: 48%; }
.sevbar[data-level="2"] > i { width: 74%; }
.sevbar[data-level="3"] > i { width: 100%; }
.crow__end { flex: 0 0 auto; display: flex; align-items: center; gap: 13px; }
.crow__num { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.crow__extra { font-size: var(--ttfs); font-weight: 500; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.crow__extra small { font-size: 12px; color: var(--text-3); font-weight: 400; }
.crow__extra--zero { color: var(--text-3); }
/* Relative Verzögerung („+65 %") im Zustandston — hier IST die Zahl das Zustandssignal.
   Bewusst --sev-text statt --sev: als Schrift auf hellem Grund erreicht die Flächenfarbe den
   WCAG-AA-Kontrast nicht (zäh 2,17:1). */
.crow__rel { color: var(--sev-text, var(--sev)); }
.crow__delay { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.crow__delay.is-zero { color: var(--text-3); }
/* Mehrzeit-Zusatz unter der absoluten Fahrzeit (AP1: „10 Min · +2") — bewusst neutral,
   nie in Severity-Farbe (README §9: Minuten sind Zeitkosten, kein Zustandssignal). */
.crow__plus { font-size: 12px; font-weight: 500; color: var(--text-2); }
.crow__plus--zero { color: var(--text-3); font-weight: 400; }
.crow__chev { display: flex; color: var(--text-3); transition: transform .2s; }
.crow.is-open .crow__chev { transform: rotate(180deg); }
.crow__none { font-size: 12px; color: var(--text-3); }
.crow-belege { margin: 2px 6px 8px; }
.crow-belege a { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }

/* gesperrt: zusätzliche Form (Schraffur) – Status nie nur über Farbe */
.crow.st-gesperrt .sevbar > i,
.heat__cell.is-closed {
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.45) 0 3px, transparent 3px 6px);
}

/* --- ÖPNV / Events -------------------------------------------------------- */
.bp-bottom { display: grid; grid-template-columns: var(--bottomcols); gap: var(--gap); align-items: start; }
/* Drei Kontext-Panels (ÖPNV/Events/Parken, AP6) — kollabiert mobil wie gewohnt auf 1 Spalte. */
.bp-bottom--three { --bottomcols: 1fr 1fr 1fr; }
@media (max-width: 800px) { .bp-bottom--three { --bottomcols: 1fr; } }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.panel__title { font-size: 15px; font-weight: 500; }
.panel__src { font-size: 11.5px; color: var(--text-3); }
.oepnv-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--hairline); }
.badge {
  display: flex; align-items: center; justify-content: center; min-width: 40px; height: 25px;
  padding: 0 9px; border-radius: 7px; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  flex: 0 0 auto; background: var(--sev, var(--text-3)); color: var(--sev-ink, #fff);
}
.oepnv-row__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.oepnv-row__t { font-size: 13.5px; line-height: 1.3; }
.oepnv-row__m { font-size: 11.5px; color: var(--text-3); }
.evcard { border: 1px solid var(--hairline); border-radius: 11px; padding: 13px 15px; margin-top: 10px; }
.evcard:first-of-type { margin-top: 0; }
.evcard.is-active { border-color: var(--accent); background: var(--accent-weak); }
.evcard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.evcard__t { font-size: 14px; font-weight: 500; }
.evcard__now { display: inline-flex; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.evcard__meta { display: flex; align-items: center; gap: 7px; margin-top: 7px; font-size: 12.5px; color: var(--text-2); }
.evcard__aff { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.panel__empty { font-size: 13px; color: var(--text-3); padding: 8px 0; }

/* --- Alarm-Banner --------------------------------------------------------- */
.alarm {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--sev, var(--accent));
  border-left-width: 4px;
}
.alarm__ic { flex: 0 0 auto; color: var(--sev, var(--accent)); display: flex; }
.alarm__b { display: flex; flex-direction: column; gap: 3px; }
.alarm__h { font-size: 14px; font-weight: 500; }
.alarm__d { font-size: 12.5px; color: var(--text-2); }
.alarm__m { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* --- Fußzeile ------------------------------------------------------------- */
.bp-foot { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: space-between; align-items: center; padding: 4px 2px 2px; font-size: 11.5px; color: var(--text-3); }
.bp-foot a { color: var(--text-2); }
.bp-foot a:hover { color: var(--accent); }
.bp-foot__links { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* --- Detail-/Prognoseseiten ----------------------------------------------- */
.bp-wrap--narrow { max-width: 980px; }
.bp-back { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); padding: 7px 4px; }
.bp-back:hover { color: var(--accent); }
.kd-titlebar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.kd-h1 { margin: 0; font-size: clamp(26px, 4vw, 32px); font-weight: 500; letter-spacing: -.02em; line-height: 1; }
.kd-titlebar .seg { flex: 0 0 auto; min-height: 0; }
.kd-titlebar .seg__btn { min-width: 74px; padding: 9px 16px; font-size: 14px; }

/* Hero */
.kd-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.kd-hero__main { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.kd-hero__travel { font-size: clamp(44px, 9vw, 64px); font-weight: 500; letter-spacing: -.03em; line-height: .95; color: var(--text); }
.kd-hero__travel small { font-size: 18px; color: var(--text-3); font-weight: 400; }
.kd-hero__side { display: flex; flex-direction: column; gap: 8px; padding-bottom: 6px; }
.kd-hero__free { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.kd-hero__delay { font-size: 13.5px; font-weight: 500; color: var(--text-2); }

/* Tagesverlauf-Balken */
.kd-chart-track { position: relative; touch-action: none; cursor: pointer; user-select: none; }
.kd-chart { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.kd-chart__col { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.kd-chart__bar { width: 100%; min-height: 4px; border-radius: 4px 4px 2px 2px; background: var(--sev, var(--surface-2)); }
.kd-chart__bar.is-sel { outline: 2px solid var(--text); outline-offset: 1px; }
.kd-chart__head { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); transform: translateX(-1px); border-radius: 2px; pointer-events: none; }

/* Prognose-Ranking */
.pg-rrow { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 12px; color: var(--text); }
.pg-rrow + .pg-rrow { border-top: 1px solid var(--hairline); }
.pg-rrow:hover { background: var(--surface-2); }
.pg-rank { font-size: 13px; color: var(--text-3); width: 18px; flex: 0 0 auto; }
.pg-sum { display: flex; gap: 26px; }
.pg-sum__v { font-size: 21px; font-weight: 500; }
.pg-sum__v small { font-size: 12px; color: var(--text-3); font-weight: 400; }

/* Prognosematrix */
.pg-matrix-scroll { overflow-x: auto; }
.pg-matrix { min-width: 560px; display: flex; flex-direction: column; gap: 5px; }
.pg-mrow { display: flex; align-items: center; gap: 8px; }
.pg-mrow__lbl { width: 96px; flex: 0 0 auto; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-mrow__cells, .pg-mhead__cells { flex: 1; display: flex; gap: 3px; }
.pg-mhead__cells span { flex: 1; text-align: center; font-size: 10px; color: var(--text-3); }
.pg-cell { flex: 1; height: 22px; border-radius: 3px; background: var(--surface-2); }
.pg-cell.lv0, .pg-cell.lv1, .pg-cell.lv2, .pg-cell.lv3 { background: var(--sev); }
.pg-cell.lv0 { opacity: .5; }
.pg-cell.is-sel { box-shadow: inset 0 0 0 2px var(--text); }
/* Live gesperrte Trasse über die ganze Prognose-Achse: Absperrband statt Level-Farbe
   (Matrix-Zelle + Tagesverlauf-Balken; Zustand nie nur über Farbe). */
.pg-cell.is-closed,
.kd-chart__bar.is-closed { background: repeating-linear-gradient(45deg, var(--sev3) 0 3px, #fff 3px 6px); opacity: 1; }
/* Keine gelernte Verzoegerung: sichtbare Luecke statt erfundener Balkenhoehe (Review K-2).
   Die Stufenfarbe bleibt auf der Grundlinie erhalten, falls eine Stufe bekannt ist. */
.kd-chart__bar--none { height: 100%; min-height: 0; background: none; border-radius: 0;
  border-bottom: 2px dotted var(--sev, var(--text-3)); opacity: .55; }
.pg-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* --- Prose (Rechtsseiten) ------------------------------------------------- */
.prose { line-height: 1.6; color: var(--text-2); }
.prose h1 { font-size: clamp(24px, 4vw, 30px); font-weight: 500; letter-spacing: -.02em; color: var(--text); margin: 0 0 18px; }
.prose h2 { font-size: 16px; font-weight: 500; color: var(--text); margin: 26px 0 8px; }
.prose p, .prose ul, .prose address { margin: 0 0 12px; font-size: 14px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose address { font-style: normal; }
.prose a { color: var(--accent); }
.prose strong { color: var(--text); font-weight: 500; }

/* --- Util ----------------------------------------------------------------- */
.hidden { display: none !important; }
.notice { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 16px; color: var(--text-2); }

/* --- Responsiv (Mobil < 800px) -------------------------------------------- */
@media (max-width: 800px) {
  :root {
    --pad: 14px; --gap: 12px; --cardpad: 15px; --maph: 330px;
    --hlfs: 21px; --ttfs: 19px; --heat-h: 40px;
    --bottomcols: 1fr; --controlsdir: column; --subdisp: none;
  }
  .crow { gap: 10px; padding: 12px 10px; }
  /* Fahrzeit-Pillen auf Mobil aus (Schwerpunkte clustern → Overlap); die Liste trägt die Zeiten. */
  .mappill { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
