/* ==========================================================================
   Stadtbus Eisenstadt · Designsystem v5
   Aufbau: Tokens → Basis → Layout → Karte → Panel-Inhalte → Dialoge → Responsive
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  --bg: #e7eeec;
  --surface: #ffffff;
  --surface-2: #f4f7f6;
  --surface-3: #e9efed;
  --glass: rgba(250, 252, 251, .8);
  --glass-strong: rgba(253, 254, 254, .92);
  --glass-edge: rgba(255, 255, 255, .8);

  --ink: #0e2427;
  --ink-2: #3a5054;
  --muted: #62777b;
  --faint: #97a9ab;
  --hair: rgba(14, 36, 39, .08);
  --hair-2: rgba(14, 36, 39, .14);
  --hover: rgba(14, 36, 39, .05);

  --brand: #0a7a6e;
  --brand-ink: #06584f;
  --brand-soft: rgba(10, 122, 110, .1);
  --brand-grad: linear-gradient(135deg, #0a7a6e, #0c8a7c 70%, #0f9585);
  --brand-glow: rgba(10, 122, 110, .32);
  --on-brand: #ffffff;

  --live: #10a77c;
  --live-ink: #067a57;
  --live-soft: rgba(16, 167, 124, .12);
  --warn: #975a00;
  --warn-soft: #fff2d9;
  --warn-edge: #f1d197;
  --gold: #e0a000;
  --alert-badge: #e0553a;

  --shadow-sm: 0 1px 2px rgba(14, 36, 39, .05), 0 2px 8px rgba(14, 36, 39, .05);
  --shadow: 0 1px 3px rgba(14, 36, 39, .06), 0 10px 30px rgba(14, 36, 39, .1);
  --shadow-lg: 0 2px 8px rgba(14, 36, 39, .06), 0 24px 64px rgba(14, 36, 39, .16);

  --r-xl: 26px;
  --r-l: 18px;
  --r-m: 14px;
  --r-s: 10px;

  --gap: 12px;
  --rail-w: 80px;
  --panel-w: 408px;
  --tabbar-h: 66px;
  --sheet-h: 46vh;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --chart: #0a7a6e;
  --chart-area: rgba(10, 122, 110, .12);
  --grid: rgba(14, 36, 39, .08);

  --board-bg: #0a1317;
  --board-ink: #e9f2f3;
  --board-dim: #86a1a6;
  --board-amber: #ffc857;
  --board-mint: #5ef2c6;
}

:root[data-theme=dark] {
  --bg: #070f13;
  --surface: #0f1b21;
  --surface-2: #14232a;
  --surface-3: #1a2c34;
  --glass: rgba(12, 22, 27, .8);
  --glass-strong: rgba(12, 22, 28, .92);
  --glass-edge: rgba(255, 255, 255, .07);

  --ink: #e6f1f2;
  --ink-2: #b4c7ca;
  --muted: #8ba2a7;
  --faint: #5f787d;
  --hair: rgba(255, 255, 255, .07);
  --hair-2: rgba(255, 255, 255, .13);
  --hover: rgba(255, 255, 255, .06);

  --brand: #3fd5c1;
  --brand-ink: #8aeede;
  --brand-soft: rgba(63, 213, 193, .12);
  --brand-grad: linear-gradient(135deg, #2fc4b0, #45d4bd 70%, #5adfc6);
  --brand-glow: rgba(63, 213, 193, .25);
  --on-brand: #03211d;

  --live: #3be0a6;
  --live-ink: #6ff0c0;
  --live-soft: rgba(59, 224, 166, .12);
  --warn: #f5c56b;
  --warn-soft: rgba(245, 197, 107, .1);
  --warn-edge: rgba(245, 197, 107, .28);
  --gold: #f5c542;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, .35), 0 28px 70px rgba(0, 0, 0, .5);

  --chart: #3fd5c1;
  --chart-area: rgba(63, 213, 193, .14);
  --grid: rgba(255, 255, 255, .08);

  --board-bg: #050b0e;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button {
  background: none; border: 0; padding: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
a { color: var(--brand); }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { text-wrap: balance; }
.icon {
  width: 20px; height: 20px; flex: none; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.icon.filled { fill: currentColor; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 14px;
  border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 700;
}
.skip-link:focus { top: 12px; }
kbd {
  display: inline-block; min-width: 20px; text-align: center;
  font: 600 10.5px/1 var(--mono); padding: 4px 6px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--hair-2); border-bottom-width: 2px; color: var(--ink-2);
}
mark { background: color-mix(in srgb, var(--brand) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
[hidden] { display: none !important; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .rail, .panel { background: var(--surface); }
}

/* Punkte & Chips */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.live { background: var(--live); animation: ping 2.2s var(--ease) infinite; }
.dot.sim { background: var(--brand); }
.dot.idle { background: var(--faint); }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); }
  75%, 100% { box-shadow: 0 0 0 8px transparent; }
}
.live-chip, .soft-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; letter-spacing: .01em;
}
.live-chip { background: var(--live-soft); color: var(--live-ink); }
.live-chip .dot { width: 6px; height: 6px; }
.soft-chip { background: var(--surface-3); color: var(--muted); }

/* Linien-Badges */
.badge {
  --size: 40px;
  width: var(--size); height: var(--size); flex: none;
  display: inline-grid; place-items: center;
  border-radius: calc(var(--size) * .31);
  background: var(--line); color: var(--on-line, #fff);
  font: 800 calc(var(--size) * .46)/1 var(--font); letter-spacing: -.02em;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12), 0 4px 12px color-mix(in srgb, var(--line) 30%, transparent);
}
.badge.sm { --size: 26px; box-shadow: inset 0 -1.5px 0 rgba(0, 0, 0, .12); }
.badge.xs { --size: 20px; box-shadow: none; font-weight: 800; }
.badge.xl { --size: 58px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 13px;
  font-size: 13.5px; font-weight: 700; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--hair-2); color: var(--ink);
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, border-color .2s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn .icon { width: 17px; height: 17px; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 12.5px; border-radius: 11px; }
.btn-primary {
  background: var(--brand-grad); border-color: transparent; color: var(--on-brand);
  box-shadow: 0 6px 18px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background: var(--brand-grad); filter: brightness(1.06); }
.btn[aria-pressed=true] { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 45%, transparent); color: var(--brand-ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: var(--ink-2); transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.link { color: inherit; text-align: left; text-decoration: underline; text-decoration-color: var(--hair-2); text-underline-offset: 3px; }
.link:hover { text-decoration-color: currentColor; }

.segmented { display: flex; gap: 2px; padding: 3px; border-radius: 13px; background: var(--surface-3); }
.segmented button {
  flex: 1; height: 32px; padding: 0 10px; border-radius: 10px;
  font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .2s;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed=true] {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 2px 8px rgba(0, 0, 0, .06);
}

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--hair-2);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--faint); }
.chip .icon { width: 14px; height: 14px; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--line, var(--brand)); }
.chip[aria-pressed=true] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip.sm { height: 28px; padding: 0 10px; font-size: 12px; }

/* ---------- Layout ---------- */
.app { position: fixed; inset: 0; overflow: hidden; }
#map { position: absolute; inset: 0; background: var(--bg); }
#fallback {
  position: absolute; inset: 0; display: none;
  padding: 80px 30px 110px calc(var(--gap) * 3 + var(--rail-w) + var(--panel-w) + 20px);
  background:
    radial-gradient(circle at 1px 1px, var(--hair-2) 1px, transparent 0) 0 0 / 26px 26px,
    radial-gradient(ellipse at 65% 45%, var(--surface-2), var(--bg) 70%);
}
#fallback.visible { display: block; }
#network { width: 100%; height: 100%; overflow: visible; }
#network .fb-route { fill: none; stroke-linecap: round; stroke-linejoin: round; }
#network .fb-casing { fill: none; stroke: var(--surface); stroke-linecap: round; stroke-linejoin: round; }
#network text { font-family: var(--font); fill: var(--ink-2); }
#network .fb-title { font-size: 30px; font-weight: 800; fill: var(--ink); letter-spacing: -.02em; }
#network .fb-sub { font-size: 13px; fill: var(--muted); font-weight: 600; }
#network .fb-bus text { fill: #fff; font-weight: 800; font-size: 15px; }

/* Navigationsleiste */
.rail {
  position: absolute; z-index: 30;
  left: var(--gap); top: var(--gap); bottom: var(--gap); width: var(--rail-w);
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0 12px;
  border-radius: var(--r-xl);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
}
.rail-brand {
  width: 48px; height: 48px; border-radius: 16px; margin-bottom: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #0a7a6e, #14a896 60%, #39c9a8); color: #fff;
  box-shadow: 0 8px 22px rgba(10, 122, 110, .38), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .35s var(--ease);
}
.rail-brand .icon { width: 26px; height: 26px; stroke-width: 2; }
.rail-brand:hover { transform: rotate(-6deg) scale(1.06); }
.rail-items { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.rail-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 70px; padding: 2px 0 6px; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: -.005em;
  transition: color .2s;
}
.ri-icon {
  width: 52px; height: 32px; border-radius: 16px; display: grid; place-items: center;
  transition: background .3s var(--ease), color .2s, transform .3s var(--ease);
}
.ri-icon .icon { width: 21px; height: 21px; }
.rail-item:hover { color: var(--ink); }
.rail-item:hover .ri-icon { background: var(--hover); }
.rail-item.active { color: var(--ink); }
.rail-item.active .ri-icon { background: var(--brand-soft); color: var(--brand); }
.rail-item.active .ri-icon .icon { stroke-width: 2.1; }
.ri-count {
  position: absolute; top: -3px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--alert-badge); color: #fff;
  font: 800 10px/18px var(--font); text-align: center; box-shadow: 0 0 0 2.5px var(--glass-strong);
}
.rail-foot { display: flex; flex-direction: column; gap: 4px; }
.rail-tool {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: var(--muted);
  transition: background .2s, color .2s;
}
.rail-tool:hover { background: var(--hover); color: var(--ink); }

/* Seitenpanel */
.panel {
  position: absolute; z-index: 20;
  top: var(--gap); bottom: var(--gap); left: calc(var(--gap) * 2 + var(--rail-w)); width: var(--panel-w);
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow-lg);
  transition: transform .5s var(--ease), opacity .35s;
}
.app.collapsed .panel { transform: translateX(calc(-100% - var(--gap) - var(--rail-w))); opacity: 0; pointer-events: none; }
.sheet-handle { display: none; }
.panel-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; outline: none;
  scrollbar-width: thin; scrollbar-color: var(--hair-2) transparent;
}
.panel-foot {
  display: flex; align-items: center; gap: 9px; padding: 11px 20px;
  border-top: 1px solid var(--hair); font-size: 11px; font-weight: 600; color: var(--muted);
}
.panel-foot .dot { width: 6px; height: 6px; }

/* Ebene über der Karte */
.map-ui {
  position: absolute; z-index: 10;
  top: var(--gap); bottom: var(--gap); right: var(--gap);
  left: calc(var(--gap) * 3 + var(--rail-w) + var(--panel-w));
  pointer-events: none; transition: left .5s var(--ease);
}
.app.collapsed .map-ui { left: calc(var(--gap) * 2 + var(--rail-w)); }
.app.collapsed #fallback { padding-left: calc(var(--gap) * 2 + var(--rail-w) + 30px); }
.map-ui > * { pointer-events: auto; }
.mobile-top { display: none; }

.legend {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 16px;
}
.legend-title {
  font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding: 0 8px 0 9px;
}
.legend-chip {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px 0 9px; border-radius: 11px;
  font-size: 12.5px; font-weight: 650; color: var(--ink-2); transition: background .2s, opacity .2s;
}
.legend-chip i { width: 16px; height: 5px; border-radius: 3px; background: var(--line); transition: background .2s, box-shadow .2s; }
.legend-chip b { font-weight: 800; color: var(--ink); }
.legend-chip:hover { background: var(--hover); }
.legend-chip[aria-pressed=false] { opacity: .5; }
.legend-chip[aria-pressed=false] i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.legend-chip[aria-pressed=false] span { text-decoration: line-through; }

.map-tools { position: absolute; right: 0; top: 0; display: flex; gap: 8px; pointer-events: none; }
.map-tools > * { pointer-events: auto; }
.cmd-btn {
  display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 9px 0 14px; border-radius: 15px;
  font-size: 13px; font-weight: 600; color: var(--muted); min-width: 250px; transition: color .2s, box-shadow .2s;
}
.cmd-btn:hover { color: var(--ink); box-shadow: var(--shadow-lg); }
.cmd-btn .icon { width: 18px; height: 18px; }
.cmd-btn kbd { margin-left: auto; }
.view-switch { display: flex; padding: 5px; border-radius: 15px; gap: 2px; }
.view-switch button {
  height: 34px; padding: 0 13px; border-radius: 10px; display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 800; color: var(--muted); transition: background .25s, color .2s, box-shadow .25s;
}
.view-switch .icon { width: 16px; height: 16px; }
.view-switch button:hover { color: var(--ink); }
.view-switch button[aria-pressed=true] { background: var(--brand-grad); color: var(--on-brand); box-shadow: 0 4px 12px var(--brand-glow); }

.map-controls {
  position: absolute; right: 0; top: 60px;
  display: flex; flex-direction: column; gap: 2px; padding: 5px; border-radius: 16px;
}
.map-controls button {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--ink-2);
  transition: background .2s, color .2s;
}
.map-controls button:hover { background: var(--hover); color: var(--ink); }
.map-controls .sep { height: 1px; margin: 3px 7px; background: var(--hair-2); }
#compass .icon { transition: transform .15s linear; }
#compass .icon path { fill: color-mix(in srgb, #e0553a 85%, transparent); stroke: none; }

.map-notice {
  position: absolute; left: 50%; top: 64px; transform: translateX(-50%);
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px;
  font-size: 12.5px; font-weight: 650; max-width: min(440px, 100%); color: var(--ink-2);
}
.spin {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--hair-2); border-top-color: var(--brand); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Live-Statusleiste */
.statusbar {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(640px, calc(100% - 250px));
  display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 18px;
}
.sb-live {
  display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 12px; flex: none;
  font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: var(--surface-3); color: var(--muted);
}
.statusbar[data-state=ok] .sb-live { background: rgba(224, 69, 58, .1); color: #c7372d; }
.statusbar[data-state=ok] .sb-live .dot { background: #e0453a; animation: ping-red 2s var(--ease) infinite; }
.statusbar[data-state=error] .sb-live { background: var(--warn-soft); color: var(--warn); }
.statusbar[data-state=error] .sb-live .dot { background: var(--warn); }
.statusbar[data-state=checking] .sb-live .dot { background: var(--brand); animation: ping 1.4s var(--ease) infinite; }
[data-theme=dark] .statusbar[data-state=ok] .sb-live { background: rgba(255, 110, 96, .14); color: #ff8a7d; }
.sb-clock { font: 700 20px/1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; flex: none; }
.sb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#sb-info { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sb-updated { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
#sb-updated:empty { display: none; }
.sb-src { flex: none; font-size: 11.5px; font-weight: 700; color: var(--muted); text-decoration: none; padding: 6px 8px; border-radius: 9px; }
.sb-src:hover { color: var(--ink); background: var(--hover); }

/* Schwebende Info-Karte (ausgewählter Bus) */
.float-card {
  position: absolute; left: 0; bottom: 80px; width: 340px; padding: 14px; border-radius: 22px;
  animation: pop .4s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.fc-head { display: flex; align-items: center; gap: 12px; }
.fc-title { flex: 1; min-width: 0; }
.fc-title strong { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.fc-title small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.fc-next { margin: 12px 0 10px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.fc-next small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fc-next strong { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin: 2px 0; }
.fc-next span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.fc-next b { color: var(--brand); }
.fc-progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.fc-progress div { height: 100%; border-radius: 3px; background: var(--line); transition: width .3s linear; }
.fc-row { display: flex; justify-content: space-between; margin: 6px 0 12px; font: 600 10.5px var(--mono); color: var(--muted); }
.fc-note { margin: 10px 2px 0; font-size: 11px; color: var(--muted); }

#toast {
  position: absolute; left: 50%; top: 62px; z-index: 5; transform: translate(-50%, -10px);
  opacity: 0; pointer-events: none; max-width: min(460px, 92%); text-align: center;
  background: var(--ink); color: var(--surface); padding: 11px 16px; border-radius: 14px;
  font-size: 13px; font-weight: 650; box-shadow: var(--shadow-lg); transition: opacity .3s, transform .35s var(--ease);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Karten-Marker ---------- */
.bus-marker { position: relative; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; }
.bm-halo {
  position: absolute; inset: 4px; border-radius: 50%; background: var(--line); opacity: .28;
  animation: halo 2.6s var(--ease) infinite;
}
@keyframes halo { 0% { transform: scale(.7); opacity: .4; } 100% { transform: scale(1.7); opacity: 0; } }
.bm-arrow { position: absolute; inset: -9px; pointer-events: none; transition: transform .2s linear; }
.bm-arrow::before {
  content: ''; position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 8px solid var(--line);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25));
}
.bm-chip {
  position: relative; display: flex; align-items: center; gap: 3px; height: 30px; padding: 0 8px 0 6px;
  border-radius: 11px; background: var(--line); color: var(--on-line, #fff); border: 2.5px solid #fff;
  font: 800 14px/1 var(--font);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--line) 45%, transparent), 0 2px 4px rgba(0, 0, 0, .2);
  transition: transform .25s var(--ease);
}
.bm-chip .icon { width: 15px; height: 15px; stroke-width: 2.3; }
.bm-label {
  position: absolute; left: calc(100% + 2px); top: 50%; transform: translate(-4px, -50%);
  white-space: nowrap; pointer-events: none; opacity: 0;
  background: var(--glass-strong); color: var(--ink); font-size: 11.5px; font-weight: 700;
  padding: 5px 9px; border-radius: 9px; box-shadow: var(--shadow); transition: opacity .2s, transform .25s var(--ease);
}
.bus-marker:hover .bm-label, .bus-marker.selected .bm-label { opacity: 1; transform: translate(0, -50%); }
.bus-marker:hover .bm-chip { transform: scale(1.08); }
.bus-marker.selected .bm-chip { transform: scale(1.14); box-shadow: 0 0 0 5px color-mix(in srgb, var(--line) 30%, transparent), 0 8px 20px rgba(0, 0, 0, .25); }
.bus-marker.dim { opacity: .38; filter: saturate(.5); }
.bus-marker.off { display: none; }
.bus-marker.enter .bm-chip { animation: pop .5s var(--ease); }
.bus-marker.at-stop .bm-halo { animation-duration: 1.2s; }
.bus-marker.model .bm-halo, .bus-marker.model .bm-arrow, .bus-marker.model .bm-chip .icon { display: none; }
.bus-marker.model .bm-chip { height: 24px; padding: 0 7px; font-size: 12px; border-width: 2px; }
.bus-marker.model::after {
  content: ''; position: absolute; left: calc(50% - 1px); top: calc(50% + 12px); width: 2px; height: 12px;
  background: linear-gradient(var(--line), transparent);
}
[data-theme=dark] .bm-chip { border-color: #dfeceb; }

.hub-marker {
  display: flex; align-items: center; gap: 7px; padding: 4px 11px 4px 4px; border-radius: 999px; cursor: pointer;
  background: var(--glass-strong); color: var(--ink); border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow); font-size: 12px; font-weight: 800;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.hub-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--surface); }
.hub-icon .icon { width: 15px; height: 15px; stroke-width: 2.1; }
.hub-marker small { display: block; font-size: 9.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.me-marker {
  width: 18px; height: 18px; border-radius: 50%; background: #2f7de1; border: 3px solid #fff;
  box-shadow: 0 0 0 0 rgba(47, 125, 225, .5); animation: me 2s infinite;
}
@keyframes me { 0% { box-shadow: 0 0 0 0 rgba(47, 125, 225, .5); } 80%, 100% { box-shadow: 0 0 0 16px rgba(47, 125, 225, 0); } }

.maplibregl-ctrl-bottom-right { right: var(--gap) !important; bottom: var(--gap) !important; transition: bottom .35s var(--ease); }
.maplibregl-ctrl-scale {
  background: var(--glass) !important; border-color: var(--ink-2) !important; color: var(--ink-2) !important;
  font: 600 10px var(--font) !important; border-radius: 0 0 4px 4px;
}
.maplibregl-ctrl-attrib { background: var(--glass) !important; color: var(--muted) !important; font-size: 10px !important; border-radius: 10px !important; }
.maplibregl-ctrl-attrib a { color: var(--ink-2) !important; }
.maplibregl-ctrl-attrib.maplibregl-compact { min-height: 24px; }
[data-theme=dark] .maplibregl-ctrl-attrib-button { filter: invert(1); }

/* ---------- Panel-Inhalte ---------- */
#view.enter > * { animation: rise .5s var(--ease) both; }
#view.enter > *:nth-child(2) { animation-delay: .04s; }
#view.enter > *:nth-child(3) { animation-delay: .08s; }
#view.enter > *:nth-child(4) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.view-head { padding: 26px 22px 6px; }
.eyebrow { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.view-head h1 { margin: 6px 0; font-size: 29px; line-height: 1.1; font-weight: 800; letter-spacing: -.035em; }
.lede { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.view-body { padding: 12px 18px 26px; display: flex; flex-direction: column; gap: 18px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 4px 10px; }
.block-head h2 { margin: 0; font-size: 13.5px; font-weight: 800; letter-spacing: -.005em; }
.muted-sm { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.note { margin: 0 4px; font-size: 12px; line-height: 1.65; color: var(--muted); }
.empty { padding: 34px 12px; text-align: center; color: var(--muted); }
.empty .icon { width: 28px; height: 28px; margin: 0 auto 10px; color: var(--faint); }
.empty p { margin: 0; font-weight: 700; color: var(--ink-2); }
.empty small { font-size: 12.5px; }

.search-trigger {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 9px 0 14px;
  border-radius: 15px; background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow-sm);
  color: var(--muted); font-size: 14px; font-weight: 550; transition: border-color .2s, box-shadow .2s;
}
.search-trigger .icon { width: 18px; height: 18px; }
.search-trigger:hover { border-color: var(--hair-2); box-shadow: var(--shadow); }
.search-trigger kbd { margin-left: auto; }

/* Live-Übersicht */
.pulse {
  position: relative; overflow: hidden; padding: 16px; border-radius: var(--r-l);
  background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow-sm);
}
.pulse::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 100% at 100% 0%, var(--brand-soft), transparent 55%);
}
.pulse > * { position: relative; }
.pulse-top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pulse-top .mode { margin-left: auto; font: 700 10.5px var(--mono); padding: 3px 7px; border-radius: 7px; background: var(--surface-3); color: var(--ink-2); }
.pulse-main strong { display: block; margin-top: 8px; font-size: 21px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.pulse-main span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.pulse-buses { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.pulse-bus {
  display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 13px; min-width: 0;
  background: var(--surface-2); text-align: left; transition: background .2s, transform .2s var(--ease);
}
.pulse-bus:hover { background: var(--surface-3); transform: translateY(-1px); }
.pulse-bus > span:last-child { min-width: 0; }
.pulse-bus b { display: block; font-size: 12.5px; font-weight: 800; }
.pulse-bus small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse .btn { margin-top: 14px; width: 100%; }

.fav-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.fav-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--hair); font-size: 12.5px; font-weight: 700;
}
.fav-chip .icon { width: 14px; height: 14px; color: var(--gold); }
.fav-chip:hover { border-color: var(--hair-2); }

/* Linienkarten */
.line-list { display: flex; flex-direction: column; gap: 10px; }
.line-card {
  position: relative; padding: 6px 6px 12px; border-radius: var(--r-l); cursor: pointer;
  background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
  animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms);
}
.line-card::before {
  content: ''; position: absolute; left: -1px; top: 16px; bottom: 16px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--line);
}
.line-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--line) 45%, var(--hair)); }
.lc-main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 8px 6px 10px; text-align: left; border-radius: 12px; }
.lc-title { flex: 1; min-width: 0; }
.lc-title strong { display: block; font-size: 16.5px; font-weight: 800; letter-spacing: -.015em; }
.lc-title small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.lc-chev { width: 18px; height: 18px; color: var(--faint); transition: transform .25s var(--ease), color .2s; }
.line-card:hover .lc-chev { transform: translateX(3px); color: var(--ink-2); }
.lc-spark { padding: 6px 12px 0 14px; }
.spark { display: block; width: 100%; height: auto; overflow: visible; }
.spark .bar { fill: var(--line); opacity: .38; transition: opacity .2s; }
.spark .bar.now { opacity: 1; }
.spark .hit { fill: transparent; }
.spark .bar-empty { fill: var(--hair-2); }
.spark g:hover .bar { opacity: .85; }
.spark .axis-t { font: 600 9px var(--mono); fill: var(--muted); }
.lc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 14px 0; font-size: 11.5px; font-weight: 650; color: var(--muted); }
.lc-meta span { display: flex; align-items: center; gap: 5px; }
.lc-meta .icon { width: 13px; height: 13px; }
.lc-next {
  display: flex; align-items: center; gap: 8px; margin: 10px 8px 0 12px; padding: 9px 11px;
  border-radius: 11px; background: var(--surface-2); font-size: 12px; color: var(--ink-2); font-weight: 600;
}
.lc-next .icon { width: 14px; height: 14px; color: var(--muted); }
.lc-next b { font: 700 12.5px var(--mono); color: var(--ink); }
.lc-next .cd { margin-left: auto; font-weight: 800; color: var(--brand); white-space: nowrap; }

.tip-box {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 14px;
  background: var(--surface-2); color: var(--muted); font-size: 12.5px; line-height: 1.6;
}
.tip-box .icon { width: 18px; height: 18px; margin-top: 1px; }
.tip-box p { margin: 0; }
.tip-box kbd { font-size: 10px; padding: 2px 5px; }

/* Detailkopf */
.back {
  display: inline-flex; align-items: center; gap: 6px; margin: 16px 0 0 16px; padding: 7px 12px 7px 8px;
  border-radius: 11px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); background: var(--surface-2);
  transition: background .2s;
}
.back:hover { background: var(--surface-3); }
.back .icon { width: 16px; height: 16px; }
.hero {
  position: relative; display: flex; align-items: center; gap: 15px; margin: 12px 16px 0; padding: 18px;
  border-radius: 22px; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--line, var(--brand)) 17%, var(--surface)), var(--surface) 72%);
  border: 1px solid color-mix(in srgb, var(--line, var(--brand)) 24%, var(--hair));
}
.hero::after {
  content: ''; position: absolute; right: -50px; top: -60px; width: 180px; height: 180px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--line, var(--brand)) 28%, transparent), transparent 70%);
}
.hero-text { min-width: 0; }
.hero h1 { margin: 2px 0; font-size: 27px; line-height: 1.12; font-weight: 800; letter-spacing: -.035em; overflow-wrap: anywhere; }
.hero p:not(.eyebrow) { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.hero .eyebrow { color: var(--ink-2); }
.hero .fav { position: absolute; right: 10px; top: 10px; z-index: 1; }
.fav[aria-pressed=true] { color: var(--gold); }
.stop-badge {
  width: 54px; height: 54px; border-radius: 17px; flex: none; display: grid; place-items: center;
  background: var(--ink); color: var(--surface); box-shadow: var(--shadow);
}
.stop-badge .icon { width: 26px; height: 26px; }
.hero-lines { display: flex; align-items: center; gap: 4px; margin-top: 6px !important; }
.hero-lines .badge { margin-right: 1px; }

.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow-sm);
}
.banner > div { flex: 1; min-width: 0; }
.banner strong { display: block; font-size: 14px; font-weight: 800; letter-spacing: -.01em; }
.banner span { font-size: 12px; color: var(--muted); font-weight: 600; }
.banner > .icon { color: var(--muted); }
.banner.run { border-color: color-mix(in srgb, var(--live) 35%, var(--hair)); background: linear-gradient(95deg, var(--live-soft), var(--surface) 65%); }
.banner.warn { border-color: var(--warn-edge); background: var(--warn-soft); }
.banner.warn > .icon { color: var(--warn); }
.banner.warn strong { color: var(--warn); }

.kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden;
  border-radius: 16px; background: var(--hair); border: 1px solid var(--hair);
}
.kpi { background: var(--surface); padding: 11px 6px; text-align: center; }
.kpi b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 10.5px; color: var(--muted); font-weight: 700; }

.course-strip {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 12px 8px; margin: 0 -12px;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--hair-2) transparent;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}
.course-chip {
  flex: none; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 64px; padding: 7px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--hair);
  transition: background .2s, border-color .2s, opacity .2s, transform .2s var(--ease);
}
.course-chip:hover { border-color: var(--hair-2); transform: translateY(-1px); }
.course-chip b { font: 700 13px/1.25 var(--mono); }
.course-chip small { font-size: 10px; color: var(--muted); font-weight: 700; }
.course-chip.past { opacity: .5; }
.course-chip.running { border-color: color-mix(in srgb, var(--live) 55%, transparent); }
.course-chip.running small::before { content: '● '; color: var(--live); }
.course-chip[aria-pressed=true] { background: var(--line); border-color: var(--line); color: var(--on-line); opacity: 1; }
.course-chip[aria-pressed=true] small { color: inherit; opacity: .85; }
.course-chip[aria-pressed=true].running small::before { color: inherit; }

/* Haltestellen-Zeitleiste */
.tl { position: relative; padding: 2px 0; --rail-x: 67px; }
.tl-rail { position: absolute; left: calc(var(--rail-x) - 2px); top: 0; width: 4px; border-radius: 2px; background: var(--surface-3); }
.tl-fill { position: absolute; left: 0; top: 0; width: 100%; height: 0; border-radius: 2px; background: var(--line); transition: height .25s linear; }
.tl-bus {
  position: absolute; left: var(--rail-x); top: 0; z-index: 2; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border-radius: 9px; display: grid; place-items: center; background: var(--line); color: var(--on-line);
  box-shadow: 0 0 0 3px var(--surface), 0 6px 14px color-mix(in srgb, var(--line) 45%, transparent);
  transition: transform .25s linear;
}
.tl-bus .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.tl-row { display: grid; grid-template-columns: 46px 18px 1fr auto; column-gap: 10px; align-items: start; padding: 5px 0; min-height: 42px; }
.tl-row time { font: 600 12.5px/22px var(--mono); color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.tl-node {
  position: relative; z-index: 1; width: 14px; height: 14px; margin: 4px 2px 0;
  border-radius: 50%; background: var(--surface); border: 3px solid var(--line); transition: background .3s;
}
.tl-row.terminal .tl-node { width: 18px; height: 18px; margin: 2px 0 0; border-width: 4px; }
.tl-body { min-width: 0; }
.tl-name { display: block; text-align: left; font-size: 14px; font-weight: 650; line-height: 1.35; padding: 2px 0; border-radius: 6px; overflow-wrap: anywhere; }
.tl-name:hover { color: var(--brand); }
.tl-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tl-transfer { display: inline-flex; align-items: center; gap: 3px; }
.tl-transfer .icon { width: 13px; height: 13px; margin-right: 2px; }
.tl-alert { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-weight: 800; }
.tl-alert .icon { width: 13px; height: 13px; }
.tl-row.past time, .tl-row.past .tl-name { color: var(--faint); }
.tl-row.past .tl-node { background: var(--line); }
.tl-row.next .tl-name { font-weight: 800; }
.tl-row.next time { color: var(--brand); font-weight: 700; }
.tl-row.skip { opacity: .45; }
.tl-row.skip .tl-node { border-style: dashed; }

/* Haltestellenliste */
.stop-search {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 15px;
  background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow-sm); color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.stop-search .icon { width: 18px; height: 18px; }
.stop-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.stop-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.stop-search input::placeholder { color: var(--faint); font-weight: 550; }
.letter {
  position: sticky; top: 0; z-index: 1; margin: 8px 0 2px; padding: 8px 8px 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--brand);
  background: linear-gradient(var(--glass-strong) 70%, transparent);
}
.stop-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 8px; border-radius: 13px;
  text-align: left; transition: background .15s;
}
.stop-row:hover { background: var(--hover); }
.sr-icon { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.sr-icon .icon { width: 18px; height: 18px; }
.stop-row.hub .sr-icon { background: var(--ink); color: var(--surface); }
.sr-text { flex: 1; min-width: 0; }
.sr-text strong { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-text small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; font-weight: 600; }
.sr-lines { display: flex; gap: 3px; flex: none; }

/* Abfahrtsliste */
.dep-list { list-style: none; margin: 0; padding: 0; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--hair); overflow: hidden; box-shadow: var(--shadow-sm); }
.dep-row { display: grid; grid-template-columns: 46px 26px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--hair); }
.dep-row:first-child { border-top: 0; }
.dep-row time { font: 700 13.5px var(--mono); font-variant-numeric: tabular-nums; }
.dep-main { min-width: 0; text-align: left; }
.dep-main strong { display: block; font-size: 13.5px; font-weight: 800; }
.dep-main small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.dep-main:hover strong { color: var(--brand); }
.dep-cd { font-size: 12px; font-weight: 800; color: var(--brand); white-space: nowrap; }
.dep-empty { padding: 22px 14px; text-align: center; font-size: 13px; color: var(--muted); }
.line-mini-list { display: flex; flex-direction: column; gap: 8px; }
.line-mini {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--hair); transition: border-color .2s, transform .2s var(--ease);
}
.line-mini:hover { border-color: color-mix(in srgb, var(--line) 45%, var(--hair)); transform: translateY(-1px); }
.line-mini > span:nth-child(2) { flex: 1; min-width: 0; }
.line-mini b { display: block; font-size: 14px; }
.line-mini small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.line-mini .icon { width: 16px; height: 16px; color: var(--faint); }

/* Abfahrtsmonitor */
.board {
  position: relative; overflow: hidden; padding: 4px 16px 10px; border-radius: 22px;
  background: var(--board-bg); color: var(--board-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 18px 44px rgba(0, 0, 0, .22);
}
.board::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 3px);
}
.board::after {
  content: ''; position: absolute; right: -60px; top: -80px; width: 200px; height: 200px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 200, 87, .12), transparent 70%);
}
.board > * { position: relative; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0 12px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.board-title { min-width: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.board-title small { display: block; font: 700 9.5px var(--mono); letter-spacing: .16em; color: var(--board-dim); text-transform: uppercase; margin-bottom: 2px; }
.board-clock { font: 700 24px var(--mono); color: var(--board-amber); letter-spacing: -.02em; text-shadow: 0 0 18px rgba(255, 200, 87, .35); }
.board-clock .colon { animation: blink 1s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.board-cols, .board-row { display: grid; grid-template-columns: 30px 1fr 48px 60px; gap: 10px; align-items: center; }
.board-cols { padding: 9px 0 5px; font: 700 9px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--board-dim); }
.board-cols span:last-child { text-align: right; }
.board-row { padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .06); }
.board-row.enter { animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.board-row .badge { --size: 28px; box-shadow: none; }
.b-dest { min-width: 0; text-align: left; }
.b-dest b { display: block; font-size: 14px; font-weight: 800; color: var(--board-ink); }
.b-dest small { display: block; font-size: 11px; color: var(--board-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.b-dest:hover b { text-decoration: underline; text-underline-offset: 3px; }
.b-time { font: 700 13.5px var(--mono); color: #cfdfe1; }
.b-cd { font: 700 15px var(--mono); color: var(--board-amber); text-align: right; perspective: 200px; }
.b-cd span { display: inline-block; }
.b-cd.now { color: var(--board-mint); }
.b-cd.now span { animation: blink 1.2s steps(2, jump-none) infinite; }
.b-cd .flip { animation: flip .5s var(--ease); }
@keyframes flip { 0% { transform: rotateX(90deg); opacity: .1; } 100% { transform: none; opacity: 1; } }
.board-empty { padding: 30px 0 22px; text-align: center; color: var(--board-dim); font-size: 13px; }
.board-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .06); font: 600 9.5px var(--mono); color: var(--board-dim); letter-spacing: .06em; text-transform: uppercase; }

/* Kombinationsfeld (Haltestellenauswahl) */
.combo { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; }
.combo input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 14.5px; font-weight: 650; color: var(--ink); }
.combo input::placeholder { color: var(--faint); font-weight: 550; }
.combo-list {
  position: absolute; left: -34px; right: -8px; top: calc(100% + 8px); z-index: 40;
  list-style: none; margin: 0; padding: 6px; max-height: 300px; overflow: auto;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--hair-2); box-shadow: var(--shadow-lg);
  animation: pop .25s var(--ease);
}
.combo-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.combo-list li[aria-selected=true], .combo-list li:hover { background: var(--brand-soft); }
.combo-list .icon { width: 16px; height: 16px; color: var(--muted); }
.combo-lines { margin-left: auto; display: flex; gap: 3px; }
.combo-empty { color: var(--muted); cursor: default !important; background: none !important; }

/* Verbindungssuche */
.od { position: relative; padding: 6px 56px 6px 6px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow-sm); }
.od::before { content: ''; position: absolute; left: 21.5px; top: 40px; height: 32px; border-left: 2px dotted var(--faint); }
.od-field { position: relative; display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 10px; border-radius: 12px; transition: background .2s; }
.od-field:focus-within { background: var(--surface-2); }
.od-field + .od-field::before { content: ''; position: absolute; left: 34px; right: 0; top: 0; border-top: 1px solid var(--hair); }
.od-dot { position: relative; z-index: 1; width: 13px; height: 13px; flex: none; border-radius: 50%; border: 3px solid var(--brand); background: var(--surface); }
.od-dot.to { border-radius: 4px; background: var(--brand); border-color: var(--brand); }
.swap {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2); transition: background .2s, transform .35s var(--ease);
}
.swap:hover { background: var(--surface-3); }
.swap:active { transform: translateY(-50%) rotate(180deg); }
.planner-when { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.planner-when .segmented { flex: none; }
.planner-when input[type=time] {
  height: 38px; border-radius: 12px; border: 1px solid var(--hair-2); background: var(--surface);
  padding: 0 10px; font: 600 13.5px var(--mono); color: var(--ink);
}
.planner-when .muted-sm { margin-left: auto; }
.results { display: flex; flex-direction: column; gap: 10px; }
.journey {
  border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: border-color .25s, box-shadow .25s;
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms);
}
.journey:hover { border-color: var(--hair-2); }
.journey.open { border-color: color-mix(in srgb, var(--brand) 45%, var(--hair)); box-shadow: var(--shadow); }
.j-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; padding: 13px 14px 9px; text-align: left; }
.j-times { display: flex; align-items: center; gap: 6px; font: 700 16.5px var(--mono); letter-spacing: -.02em; }
.j-times .icon { width: 15px; height: 15px; color: var(--faint); }
.j-meta { font-size: 12px; color: var(--muted); font-weight: 700; }
.j-cd { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--brand); }
.j-bar { display: flex; gap: 3px; margin: 0 14px 13px; height: 24px; }
.jb-leg {
  display: flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 8px; min-width: 30px; overflow: hidden;
  background: var(--line); color: var(--on-line); font-size: 11px; font-weight: 800; white-space: nowrap;
}
.jb-leg .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.jb-wait { min-width: 12px; border-radius: 8px; background: repeating-linear-gradient(135deg, var(--surface-3) 0 4px, transparent 4px 8px); box-shadow: inset 0 0 0 1px var(--hair); }
.j-steps { list-style: none; margin: 0; padding: 12px 14px 14px; border-top: 1px solid var(--hair); background: var(--surface-2); }
.js-leg { position: relative; padding: 0; }
.js-leg::before { content: ''; position: absolute; left: 59px; top: 16px; bottom: 16px; width: 4px; border-radius: 2px; background: var(--line); }
.js-stop, .js-ride { display: grid; grid-template-columns: 44px 14px 1fr; gap: 10px; align-items: center; }
.js-stop { min-height: 32px; }
.js-stop time { font: 700 12.5px var(--mono); text-align: right; }
.js-dot { position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); }
.js-stop button { text-align: left; font-size: 13.5px; font-weight: 750; }
.js-stop button:hover { color: var(--brand); }
.js-ride { padding: 6px 0; grid-template-columns: 44px 14px 1fr; }
.js-ride > div { grid-column: 3; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 11px; background: var(--surface); border: 1px solid var(--hair); }
.js-ride .ride-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 750; }
.js-ride .ride-top button:hover { color: var(--brand); }
.js-ride small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.js-change { display: flex; align-items: center; gap: 8px; margin: 6px 0 6px 78px; padding: 7px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; color: var(--ink-2); background: repeating-linear-gradient(135deg, var(--surface-3) 0 5px, transparent 5px 10px); }
.js-change .icon { width: 15px; height: 15px; }
.j-actions { display: flex; gap: 8px; padding: 0 14px 14px; background: var(--surface-2); }
.suggest { display: flex; flex-direction: column; gap: 8px; }

/* Meldungen */
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert {
  display: grid; gap: 8px; padding: 15px 16px; border-radius: var(--r-l);
  background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow-sm);
  animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms);
}
.alert.st-aktiv { border-color: var(--warn-edge); box-shadow: inset 4px 0 0 var(--warn), var(--shadow-sm); }
.alert.st-beendet { opacity: .7; }
.alert-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status .icon { width: 13px; height: 13px; }
.status.aktiv { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-edge); }
.status.geplant, .status.beendet { background: var(--surface-3); color: var(--ink-2); }
.status.wiederkehrend { background: var(--brand-soft); color: var(--brand-ink); }
.alert-type { font-size: 11.5px; font-weight: 800; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.alert-lines { margin-left: auto; display: flex; gap: 4px; }
.alert h3 { margin: 2px 0 0; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.alert time { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.alert time .icon { width: 14px; height: 14px; color: var(--muted); }
.alert p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.alt-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }

/* Netz in Zahlen */
.hero-stat {
  position: relative; overflow: hidden; padding: 20px; border-radius: 22px;
  background: var(--brand-grad); color: var(--on-brand); box-shadow: 0 14px 34px var(--brand-glow);
}
.hero-stat::after {
  content: ''; position: absolute; right: -30px; bottom: -60px; width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%);
}
.hero-stat small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.hero-stat b { display: block; margin: 6px 0 2px; font-size: 56px; line-height: 1; font-weight: 800; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: 13.5px; font-weight: 700; opacity: .92; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { padding: 13px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow-sm); }
.stat small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.stat b { display: block; margin-top: 3px; font-size: 20px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.chart-card { padding: 16px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--hair); box-shadow: var(--shadow-sm); }
.cc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.cc-head h2 { margin: 0; font-size: 14px; font-weight: 800; }
.ac { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.ac .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.ac .axis-t { font: 600 9.5px var(--mono); fill: var(--muted); }
.ac .area { fill: var(--chart-area); }
.ac .line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ac .now line { stroke: var(--ink-2); stroke-width: 1; }
.ac .now text { font: 800 9.5px var(--font); fill: var(--ink-2); }
.ac .cross line { stroke: var(--ink-2); stroke-width: 1; }
.ac .cross circle { fill: var(--chart); stroke: var(--surface); stroke-width: 2; }
.ac .hit { fill: transparent; cursor: crosshair; }
.multiples { display: flex; flex-direction: column; gap: 14px; }
.mult-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.mult-head .muted-sm { margin-left: auto; }
.table-toggle { margin-top: 12px; }
.table-toggle summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--brand); list-style: none; }
.table-toggle summary::-webkit-details-marker { display: none; }
.table-toggle summary .icon { width: 15px; height: 15px; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; margin-top: 8px; }
table.data th, table.data td { padding: 8px 6px; border-bottom: 1px solid var(--hair); text-align: right; white-space: nowrap; }
table.data th { font-size: 11px; font-weight: 800; color: var(--muted); }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data td:first-child { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.hubs { display: flex; flex-direction: column; }
.hub-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--hair); text-align: left; font-size: 13.5px; font-weight: 700; }
.hub-row:first-child { border-top: 0; }
.hub-row span:first-child { flex: 1; }
.hub-row:hover span:first-child { color: var(--brand); }

/* Tooltip */
#tip {
  position: fixed; z-index: 200; pointer-events: none; padding: 7px 10px; border-radius: 10px;
  background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 650; line-height: 1.4;
  box-shadow: var(--shadow-lg); transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap;
}
#tip b { font-weight: 800; }

/* ---------- Dialoge ---------- */
dialog {
  border: 1px solid var(--hair-2); border-radius: 24px; padding: 28px;
  max-width: 540px; width: calc(100% - 28px); max-height: calc(100dvh - 40px);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog[open] { animation: pop .3s var(--ease); }
dialog::backdrop { background: rgba(6, 16, 20, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog-close { position: absolute; right: 12px; top: 12px; }
dialog h2 { margin: 8px 0 12px; font-size: 25px; font-weight: 800; letter-spacing: -.035em; padding-right: 30px; }
dialog p { color: var(--ink-2); font-size: 14px; line-height: 1.7; }
dialog .pill { display: inline-flex; font-size: 11px; font-weight: 800; letter-spacing: .1em; padding: 5px 9px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-ink); }
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.feature { display: flex; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface-2); font-size: 12.5px; line-height: 1.45; color: var(--ink-2); font-weight: 600; }
.feature .icon { width: 18px; height: 18px; color: var(--brand); margin-top: 1px; }
.feature b { display: block; color: var(--ink); font-size: 13px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.keys span:nth-child(odd) { display: flex; gap: 4px; justify-content: flex-end; }

.timetable-dialog { max-width: 1180px; }
.tt-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 6px; }
.tt-head h2 { margin: 0; }
.tt-sub { margin: 0 0 14px; font-size: 13px; color: var(--muted); font-weight: 600; }
.timetable-scroll { overflow: auto; max-height: 64dvh; border: 1px solid var(--hair-2); border-radius: 14px; }
.timetable { border-collapse: separate; border-spacing: 0; width: 100%; font: 500 12.5px var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.timetable th, .timetable td { padding: 9px 11px; border-bottom: 1px solid var(--hair); text-align: center; }
.timetable thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-3); color: var(--ink); font: 800 11.5px/1.45 var(--font); }
.timetable thead th small { display: block; font: 700 12.5px var(--mono); }
.timetable th[scope=row] {
  position: sticky; left: 0; z-index: 1; min-width: 220px; max-width: 280px; white-space: normal; text-align: left;
  background: var(--surface); font: 650 12.5px/1.35 var(--font); box-shadow: 1px 0 0 var(--hair);
}
.timetable thead th:first-child { left: 0; z-index: 3; text-align: left; }
.timetable tbody tr:nth-child(even) td, .timetable tbody tr:nth-child(even) th[scope=row] { background: var(--surface-2); }
.timetable .past { color: var(--faint); }
.timetable .sel { background: color-mix(in srgb, var(--line) 14%, var(--surface)) !important; font-weight: 800; }
.timetable thead .sel { background: var(--line) !important; color: var(--on-line); }
.timetable tbody tr:hover td, .timetable tbody tr:hover th[scope=row] { background: var(--brand-soft); }
.timetable caption { caption-side: bottom; text-align: left; padding: 10px 12px; font: 600 12px var(--font); color: var(--muted); }

/* Befehlspalette */
#palette { padding: 0; width: min(640px, calc(100% - 24px)); margin-top: 11vh; border-radius: 22px; overflow: hidden; }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--hair); color: var(--muted); }
.pal-input input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 17px; font-weight: 600; color: var(--ink); }
.pal-input input::placeholder { color: var(--faint); }
.pal-list { list-style: none; margin: 0; padding: 8px; max-height: min(440px, 58dvh); overflow: auto; }
.pal-group { padding: 10px 10px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; cursor: pointer; }
.pal-item[aria-selected=true] { background: var(--brand-soft); }
.pal-ico { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.pal-ico .icon { width: 17px; height: 17px; }
.pal-item .badge { --size: 32px; box-shadow: none; }
.pal-text { flex: 1; min-width: 0; }
.pal-text b { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-text small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pal-item .enter-hint { opacity: 0; font-size: 11px; color: var(--muted); font-weight: 700; }
.pal-item[aria-selected=true] .enter-hint { opacity: 1; }
.pal-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 14px; }
.pal-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--hair); font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pal-foot span { display: flex; align-items: center; gap: 4px; }

/* ---------- Responsive ---------- */
@media (min-width: 1600px) {
  :root { --panel-w: 440px; }
}
@media (max-width: 1380px) {
  .cmd-btn { min-width: 0; }
  .cmd-btn .cmd-label, .cmd-btn kbd { display: none; }
  .cmd-btn { width: 46px; padding: 0; justify-content: center; }
}
@media (max-width: 1100px) {
  :root { --rail-w: 72px; --panel-w: 352px; }
  .rail-item { width: 64px; font-size: 10px; }
  .ri-icon { width: 46px; }
  .legend-chip span, .legend-title { display: none; }
  .legend-chip { padding: 0 10px 0 8px; }
  .statusbar { width: 100%; }
  .map-ui .float-card { bottom: 80px; }
  .maplibregl-ctrl-bottom-right { bottom: calc(var(--gap) + 76px) !important; }
  .view-head h1 { font-size: 26px; }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .legend { top: 56px; }
  .legend-title { display: none; }
  .sb-src { display: none; }
}
@media (max-width: 900px) and (min-width: 761px) {
  :root { --panel-w: 320px; }
}

/* Mobil: Karte im Vollbild, Navigation unten, Inhalte im ziehbaren Sheet */
@media (max-width: 760px) {
  :root { --gap: 10px; --r-xl: 24px; }
  .rail {
    left: 0; right: 0; bottom: 0; top: auto; width: auto; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    flex-direction: row; padding: 0 4px env(safe-area-inset-bottom); gap: 0;
    border-radius: 0; border-width: 1px 0 0; box-shadow: 0 -1px 0 var(--hair);
    background: var(--glass-strong);
  }
  .rail-brand, .rail-foot { display: none; }
  .rail-items { flex-direction: row; justify-content: space-around; gap: 0; width: 100%; }
  .rail-item { width: auto; flex: 1; min-width: 0; padding: 6px 0 4px; font-size: 10px; }
  .ri-icon { width: 48px; height: 30px; }
  .ri-count { right: calc(50% - 26px); top: 1px; }

  .panel {
    left: 0; right: 0; top: auto; width: auto;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    height: var(--sheet-h); border-radius: 24px 24px 0 0; border-bottom: 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .12);
    transition: height .4s var(--ease);
  }
  .panel.dragging { transition: none; }
  .app.collapsed .panel { transform: none; opacity: 1; pointer-events: auto; }
  .sheet-handle { display: grid; place-items: center; height: 22px; flex: none; cursor: grab; touch-action: none; }
  .sheet-handle span { width: 42px; height: 5px; border-radius: 3px; background: var(--hair-2); }
  .panel-foot { display: none; }
  .view-head { padding: 6px 18px 4px; }
  .view-head h1 { font-size: 24px; }
  .view-body { padding: 10px 14px 22px; gap: 16px; }
  .back { margin: 4px 0 0 14px; }
  .hero { margin: 10px 14px 0; padding: 16px; }
  .hero h1 { font-size: 23px; }
  .badge.xl { --size: 50px; }

  .map-ui {
    left: var(--gap); right: var(--gap);
    top: calc(var(--gap) + env(safe-area-inset-top));
    bottom: calc(var(--sheet-h) + var(--tabbar-h) + env(safe-area-inset-bottom) + var(--gap));
    transition: bottom .4s var(--ease);
  }
  .app.sheet-dragging .map-ui { transition: none; }
  .mobile-top { display: flex; justify-content: space-between; gap: 8px; position: absolute; left: 0; right: 0; top: 0; pointer-events: none; }
  .mobile-top > * { pointer-events: auto; }
  .m-brand { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px 0 5px; border-radius: 15px; text-decoration: none; color: var(--ink); }
  .m-logo { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #0a7a6e, #14a896 60%, #39c9a8); color: #fff; }
  .m-logo .icon { width: 20px; height: 20px; stroke-width: 2; }
  .m-word { font-size: 16px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
  .m-word small { display: block; font-size: 7.5px; letter-spacing: .32em; font-weight: 700; margin-top: 3px; color: var(--muted); }
  .m-tools { display: flex; padding: 3px; border-radius: 15px; }
  .m-tools button { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); }

  .statusbar {
    left: 0; right: 0; top: 52px; bottom: auto; transform: none; width: auto;
    gap: 8px; padding: 5px 10px 5px 5px; border-radius: 16px;
  }
  .sb-live { height: 34px; padding: 0 10px; font-size: 10.5px; letter-spacing: .05em; }
  .sb-clock { font-size: 16px; }
  #sb-info { font-size: 12px; }
  #sb-updated { font-size: 10px; }
  .sb-src { display: none; }

  .legend { top: 108px; padding: 3px; border-radius: 13px; }
  .legend-chip { height: 30px; padding: 0 8px 0 7px; gap: 5px; font-size: 12px; }
  .legend-chip i { width: 11px; }
  .map-tools { top: 108px; }
  .cmd-btn { display: none; }
  .view-switch { padding: 3px; border-radius: 13px; }
  .view-switch button { height: 30px; padding: 0 10px; font-size: 12px; }
  .map-controls { top: 152px; padding: 3px; border-radius: 14px; }
  .map-controls button { width: 36px; height: 36px; }
  .map-controls [data-action=zoom-in], .map-controls [data-action=zoom-out], .map-controls .sep { display: none; }
  .map-notice { top: 152px; max-width: calc(100% - 60px); font-size: 12px; }
  .float-card { left: 0; right: 0; bottom: 0; width: auto; padding: 12px; }
  .fc-next { margin: 10px 0 8px; padding: 10px; }
  .fc-note { display: none; }
  #toast { top: 152px; max-width: calc(100% - 56px); }
  #fallback { padding: 170px 14px calc(var(--sheet-h) + var(--tabbar-h) + 20px); }
  .maplibregl-ctrl-bottom-right { bottom: calc(var(--sheet-h) + var(--tabbar-h) + env(safe-area-inset-bottom) + 6px) !important; right: 6px !important; }
  .maplibregl-ctrl-scale { display: none; }
  .tip-box { display: none; }
  .search-trigger kbd { display: none; }
  .pulse-buses { grid-template-columns: 1fr; }
  dialog { padding: 22px 18px; }
  .timetable-dialog { padding: 20px 12px; }
  .timetable th[scope=row] { min-width: 150px; max-width: 170px; }
  .feature-grid { grid-template-columns: 1fr; }
  #palette { margin-top: 8vh; }
  .pal-foot { display: none; }
}
@media (hover: none) {
  .tip-box { display: none; }
  .search-trigger kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .badge, .bm-chip, .jb-leg { border: 2px solid CanvasText; }
}

/* ---------- Live-Daten (über server.py) ---------- */
.live-tag {
  display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 5px; vertical-align: 1px;
  background: #e0453a; color: #fff; font: 800 9.5px/1.5 var(--font); letter-spacing: .08em;
}
.pulse-top .mode.is-live { background: rgba(224, 69, 58, .12); color: #c7372d; }
[data-theme=dark] .pulse-top .mode.is-live { background: rgba(255, 110, 96, .14); color: #ff8a7d; }
@keyframes ping-red {
  0% { box-shadow: 0 0 0 0 rgba(224, 69, 58, .55); }
  75%, 100% { box-shadow: 0 0 0 8px transparent; }
}
.delay { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font: 800 11px/1 var(--font); white-space: nowrap; }
.delay.ok { background: var(--live-soft); color: var(--live-ink); }
.delay.late { background: rgba(224, 69, 58, .12); color: #c7372d; }
.delay.early { background: var(--warn-soft); color: var(--warn); }
[data-theme=dark] .delay.late { background: rgba(255, 110, 96, .14); color: #ff8a7d; }
.fc-next span .delay { margin-left: 6px; vertical-align: 1px; }
.repl { font-style: normal; font-size: 11px; font-weight: 800; color: var(--warn); margin-left: 4px; }
.fc-list { list-style: none; margin: 0 0 10px; padding: 0; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.fc-list li { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 7px 10px; font-size: 12.5px; font-weight: 650; border-top: 1px solid var(--hair); }
.fc-list li:first-child { border-top: 0; }
.fc-list time { font: 700 12px var(--mono); color: var(--ink-2); }
.fc-list li.cancelled span:not(.delay) { text-decoration: line-through; color: var(--muted); }
.bus-marker.lost .bm-chip { filter: grayscale(.85); opacity: .7; border-style: dashed; }
.bus-marker.lost .bm-halo, .bus-marker.lost .bm-arrow { display: none; }
.bus-marker.live .bm-chip::after {
  content: ''; position: absolute; right: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%;
  background: #e0453a; box-shadow: 0 0 0 2px #fff;
}
.pulse-bus.lost { opacity: .65; }
dialog code { font: 600 12.5px var(--mono); padding: 2px 6px; border-radius: 6px; background: var(--surface-3); }

/* ---------- v7: nur Live-Daten ---------- */
.dot.live-red { background: #e0453a; animation: ping-red 2s var(--ease) infinite; }
.live-chip.red { background: rgba(224, 69, 58, .1); color: #c7372d; }
[data-theme=dark] .live-chip.red { background: rgba(255, 110, 96, .14); color: #ff8a7d; }
.pulse-top .mode.is-off { background: var(--surface-3); color: var(--muted); }
.pulse code, .banner code { font: 600 11.5px var(--mono); padding: 1px 5px; border-radius: 5px; background: var(--surface-3); }
.day-pick { display: flex; flex-direction: column; gap: 6px; }
.day-pick > .muted-sm { margin-left: 4px; }
.tl-live { display: flex; align-items: center; padding-top: 1px; }
.tl-live .delay { height: 18px; padding: 0 6px; font-size: 10.5px; }
.dep-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.dep-row .delay { height: 18px; font-size: 10.5px; }
.dep-main .live-tag { font-size: 8.5px; padding: 0 5px; margin: 0 0 0 4px; vertical-align: 2px; }
.b-time { display: flex; flex-direction: column; line-height: 1.15; }
.b-delay { font: 700 11px var(--mono); }
.b-delay.late { color: #ff8a7d; }
.b-delay.early { color: var(--board-amber); }
.b-cd.late span { color: #ff8a7d; font-size: 12px; }
[data-tl-caption] .live-tag { font-size: 9px; }
.search-trigger > span { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger kbd { flex: none; }
