/* AtoB – Design "Klar rund": klare Typografie, dünne Linien, weiche Rundungen */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../vendor/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../vendor/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #F5F5F3;
  --surface-2: #ECECE8;
  --text: #111111;
  --muted: #5C5C57;
  --border: #E2E2DE;
  --accent: #1D4ED8;
  --delay: #B45309;
  --ok: #15803D;
  --danger: #B91C1C;
  --star: #B45309;
  --live-soft: #DCF3E3;
  --est-soft: #F1F1EE;
  --shadow: 0 4px 18px rgba(17, 17, 17, .10);
  --mot-tram: #C62828;
  --mot-bus: #1F5FBF;
  --mot-sbahn: #117A41;
  --mot-train: #4B5563;
  --mot-ferry: #0E7490;
  --mot-cable: #6D28D9;
  --mot-other: #57534E;
  --radius: 22px;
  --nav-h: 76px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F0F10;
  --surface: #18181A;
  --surface-2: #222225;
  --text: #F2F2F0;
  --muted: #A3A39D;
  --border: #2C2C2F;
  --accent: #8AB0FF;
  --delay: #F5A524;
  --ok: #4ADE80;
  --danger: #F87171;
  --star: #F5A524;
  --live-soft: #123222;
  --est-soft: #222225;
  --shadow: 0 4px 18px rgba(0, 0, 0, .45);
  --mot-tram: #C62828;
  --mot-bus: #2563C9;
  --mot-sbahn: #15803D;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.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: absolute; left: 12px; top: -48px; z-index: 2000; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 999px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.noscript { padding: 24px; }
.icon { display: inline-flex; flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.delay { color: var(--delay); font-weight: 600; }
.early { color: var(--ok); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
.danger { color: var(--danger); font-weight: 600; }

/* ---------- Grundlayout & Navigation ---------- */

.app { min-height: 100dvh; }
.view { padding: 0 16px calc(var(--nav-h) + 32px + var(--safe-b)); outline: none; }
.page { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-top: 18px; }

.nav {
  position: fixed; z-index: 1000;
  left: 12px; right: 12px; bottom: calc(12px + var(--safe-b));
  background: var(--surface); border: 1px solid var(--border); border-radius: 26px;
  padding: 6px; box-shadow: var(--shadow);
}
.nav-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.nav-link {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0; border-radius: 20px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500;
}
.nav-link[aria-current="page"] { background: var(--text); color: var(--bg); font-weight: 600; }
.nav-brand { align-items: center; gap: 10px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.brand-logo { display: block; flex: none; border-radius: 9px; box-shadow: 0 0 0 1px var(--border); }
.brand-a { color: var(--accent); }
.brand-b { color: #E53935; }
.desktop-only { display: none !important; }

@media (min-width: 900px) {
  .desktop-only { display: inline-flex !important; }
  .mobile-only { display: none !important; }
  .app { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
  .nav {
    position: sticky; top: 0; left: auto; right: auto; bottom: auto;
    height: 100dvh; border-radius: 0; border-width: 0 1px 0 0; box-shadow: none;
    display: flex; flex-direction: column; gap: 24px; padding: 24px 16px; background: var(--bg);
  }
  .nav-links { display: flex; flex-direction: column; gap: 4px; }
  .nav-link { flex-direction: row; gap: 12px; padding: 12px 16px; font-size: 15px; border-radius: 999px; }
  .nav-link:hover:not([aria-current="page"]) { background: var(--surface); color: var(--text); }
  .nav-theme { margin-top: auto; }
  .view { padding: 0 32px 48px; }
  .page { padding-top: 32px; }
}

/* ---------- Kopf, Titel, Knöpfe ---------- */

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.page-head .brand { display: flex; align-items: center; gap: 10px; font-size: 24px; }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 6px; }

.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 14px; text-decoration: none;
}
.icon-btn.round { border-radius: 50%; }
.icon-btn.small { width: 40px; height: 40px; }
.icon-btn:hover { background: var(--surface-2); }
.fav-btn[aria-pressed="true"] { color: var(--star); }
.spinning .icon { animation: spin 0.9s linear infinite; }

.btn {
  min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.btn:hover { background: var(--surface); }
.btn-primary, .btn-dark { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover, .btn-dark:hover { background: var(--text); opacity: .9; }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.link-btn { background: none; border: 0; padding: 6px 4px; color: var(--accent); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.link-btn.small { font-size: 13px; padding: 2px 0; }
.fav-route[aria-pressed="true"] { color: var(--star); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 38px; padding: 0 16px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; white-space: nowrap;
}
.chip:hover { background: var(--surface); }
.chip-on, .chip-primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.chip-on:hover, .chip-primary:hover { background: var(--text); opacity: .9; }
.chip-active { border-color: var(--text); font-weight: 600; }
.chip[aria-expanded="true"] { border-color: var(--text); }

.pill { height: 28px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pill-danger { color: var(--danger); }
.pill-live { background: var(--live-soft); border-color: transparent; color: var(--ok); }
.pill-est { background: var(--est-soft); border-style: dashed; border-color: var(--muted); color: var(--muted); }

.badge {
  min-width: 34px; height: 26px; padding: 0 9px; border-radius: 999px; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.mot-tram { background: var(--mot-tram); }
.mot-bus { background: var(--mot-bus); }
.mot-sbahn { background: var(--mot-sbahn); }
.mot-train { background: var(--mot-train); }
.mot-ferry { background: var(--mot-ferry); }
.mot-cable { background: var(--mot-cable); }
.mot-other, .mot-walk { background: var(--mot-other); }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; flex-shrink: 0; }
.live-dot.off { background: var(--muted); }

/* ---------- Eingaben ---------- */

.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
}
.field { position: relative; display: flex; flex-direction: column; }
.field-label { font-size: 12px; color: var(--muted); }
.field-input { border: 0; background: transparent; color: var(--text); font-size: 16px; font-weight: 600; padding: 4px 0; outline: none; width: 100%; min-width: 0; }
.field-input::placeholder { color: var(--muted); font-weight: 400; }
.field:focus-within .field-label { color: var(--text); }

.suggest {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: -16px; right: -60px; margin: 0; padding: 6px; list-style: none;
  background: var(--bg); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); max-height: 320px; overflow: auto;
}
.suggest-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer; color: var(--muted); }
.suggest-item[aria-selected="true"], .suggest-item:hover { background: var(--surface); }
.suggest-text { display: flex; flex-direction: column; min-width: 0; }
.suggest-name { color: var(--text); font-weight: 600; font-size: 15px; }
.suggest-place { font-size: 12px; }

.search-card {
  display: flex; align-items: stretch; gap: 12px; padding: 6px 6px 6px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 0; }
.rail-start { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--text); }
.rail-line { flex-grow: 1; width: 2px; border-radius: 2px; background: var(--border); }
.rail-end { width: 10px; height: 10px; border-radius: 50%; background: var(--text); }
.search-fields { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }
.search-fields .field { padding: 8px 0; }
.field-sep { height: 1px; background: var(--border); }
.search-card > .icon-btn { align-self: center; background: var(--bg); }

.search-pill {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 6px 0 18px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted);
}
.search-pill .field { flex-grow: 1; }
.search-pill .suggest { left: -46px; right: -6px; }
.search-pill input { font-weight: 500; }

.panel { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel .panel-actions { justify-content: flex-end; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); align-self: flex-start; }
.seg-btn { height: 36px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg-btn[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px 12px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--text); flex-shrink: 0; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.two-col > div { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Listen & Karten ---------- */

.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.card-list { display: flex; flex-direction: column; gap: 10px; }
.quick { display: flex; flex-direction: column; gap: 10px; }
.quick-item {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; width: 100%; text-align: left;
  border: 1px solid var(--border); border-radius: 18px; background: var(--bg); color: var(--text); text-decoration: none; font-size: 15px;
}
.quick-item:hover { background: var(--surface); }
.quick-item > .icon:first-child { color: var(--muted); }
.quick-item > .icon:last-child { color: var(--muted); margin-left: auto; }
.quick-text { flex-grow: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.quick-item .muted.small { white-space: nowrap; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 36px 16px; color: var(--muted); }
.empty strong { color: var(--text); font-size: 16px; }
.empty p { margin: 0; max-width: 340px; font-size: 14px; }
.error-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--danger); color: var(--danger); background: var(--bg); }
.error-box strong { display: block; color: var(--text); font-weight: 600; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px 0; color: var(--muted); font-size: 14px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--text); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Verbindungen ---------- */

.results { display: flex; flex-direction: column; gap: 10px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.results-actions { display: flex; gap: 8px; align-items: center; }
.result { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
.result.expanded { border: 1.5px solid var(--text); }
.result.cancelled .result-times { text-decoration: line-through; color: var(--muted); }
.result-toggle { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 16px 18px; border: 0; background: transparent; text-align: left; }
.result-toggle:hover { background: var(--surface); }
.result-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.result-times { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.result.expanded .result-times { font-size: 24px; }
.result-times .delay, .result-times .early { font-size: 14px; }
.result-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.chain { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.walk-chip { display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 8px 0 4px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; }
.result-meta { font-size: 13px; }
.warn { display: flex; align-items: center; gap: 6px; color: var(--delay); font-size: 13px; font-weight: 600; }
.result-details { padding: 0 18px 18px; }
.legs { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.leg { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.leg.cancelled { opacity: .7; }
.leg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.leg-stop { display: flex; gap: 12px; }
.leg-stop .time, .mid-stops .time, .trip-stops .time { width: 64px; flex-shrink: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.leg-mid { padding-left: 76px; font-size: 13px; }
.mid-stops { list-style: none; margin: 0; padding: 0 0 0 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.mid-stops li { display: flex; gap: 12px; }
.mid-stops .time { font-weight: 500; }
.leg-walk { flex-direction: row; align-items: center; gap: 8px; color: var(--muted); }
.leg-info { font-size: 12px; }
.leg .btn { align-self: flex-start; margin-top: 4px; }

/* ---------- Abfahrten ---------- */

.stop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stop-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.stop-sub { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-top: 2px; }
.stop-actions { display: flex; gap: 8px; }
.dep-ul { list-style: none; margin: 0; padding: 4px 6px; }
.dep-ul li + li { border-top: 1px solid var(--border); }
.dep-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; border: 0; background: transparent; text-align: left; border-radius: 16px; }
.dep-row:hover { background: var(--surface); }
.dep-row .badge { min-width: 42px; height: 28px; font-size: 14px; }
.dep-main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dep-dir { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.rc-flag { color: var(--delay); display: inline-flex; }
.dep-sub { font-size: 13px; }
.dep-min { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dep-row.cancelled .dep-dir { text-decoration: line-through; color: var(--muted); }

.trip-stops { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.trip-stops li { position: relative; display: flex; align-items: center; gap: 12px; min-height: 34px; font-size: 14px; }
.trip-dot { position: relative; width: 14px; align-self: stretch; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.trip-dot::before { content: ''; position: absolute; top: 0; bottom: 0; width: 3px; background: var(--mot-tram); opacity: .9; }
.trip-stops li:first-child .trip-dot::before { top: 50%; }
.trip-stops li:last-child .trip-dot::before { bottom: 50%; }
.trip-dot::after { content: ''; position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2.5px solid var(--mot-tram); }
.trip-stops li.past { color: var(--muted); }
.trip-stops li.past .trip-dot::after { background: var(--mot-tram); }
.trip-stops li.past .trip-dot::before { opacity: .35; }
.trip-stops li.current { font-weight: 600; }
.trip-stops li.current .trip-dot::after { width: 14px; height: 14px; }
.trip-stops li.cancelled .trip-name { text-decoration: line-through; color: var(--muted); }
.trip-name { flex-grow: 1; min-width: 0; }
.trip-messages { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Meldungen ---------- */

.msg { overflow: hidden; }
.msg-toggle { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 16px 18px; border: 0; background: transparent; text-align: left; }
.msg-toggle:hover { background: var(--surface); }
.msg-lines { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.msg-title { font-size: 16px; font-weight: 600; }
.msg-details { padding: 0 18px 16px; font-size: 14px; line-height: 1.55; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.msg-details p { margin: 12px 0 0; }
.msg-details ul, .msg-details ol { padding-left: 20px; }
.msg-details table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.msg-details td, .msg-details th { border: 1px solid var(--border); padding: 4px 8px; text-align: left; }

/* ---------- Panel / Dialog ---------- */

.sheet {
  margin: auto auto 0; width: 100%; max-width: 560px; max-height: 86dvh; padding: 0; border: 0;
  border-radius: 28px 28px 0 0; background: var(--bg); color: var(--text); box-shadow: var(--shadow);
}
.sheet::backdrop { background: rgba(0, 0, 0, .4); }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 8px 20px; background: var(--bg); }
.sheet-head h2 { font-size: 19px; font-weight: 700; }
.sheet-body { padding: 4px 20px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 900px) {
  .sheet { margin: auto; border-radius: 28px; max-height: 80dvh; }
}

.toast {
  position: fixed; z-index: 3000; left: 50%; bottom: calc(var(--nav-h) + 28px + var(--safe-b)); transform: translate(-50%, 20px);
  max-width: min(92vw, 420px); padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* ---------- Karte ---------- */

body[data-view="karte"] .view { padding: 0; }
.map-page { position: fixed; inset: 0; z-index: 1; }
.map-wrap { position: absolute; inset: 0; }
/* Leaflet setzt beim Erzeugen (noch ohne DOM) position: relative inline – hier überschreiben */
.map { position: absolute !important; inset: 0; }
.map { background: var(--surface); }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.6); }
.leaflet-container { font-family: var(--font); }
.leaflet-control-zoom { border: 1px solid var(--border) !important; border-radius: 16px !important; overflow: hidden; box-shadow: var(--shadow) !important; margin-top: 14px !important; margin-right: 12px !important; }
.leaflet-control-zoom a { background: var(--bg) !important; color: var(--text) !important; width: 40px !important; height: 40px !important; line-height: 40px !important; border-color: var(--border) !important; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--bg) 85%, transparent) !important; color: var(--muted) !important; font-size: 10px !important; border-radius: 10px 0 0 0; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip, .leaflet-tooltip { background: var(--bg); color: var(--text); border-radius: 14px; }
.leaflet-tooltip { border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 12px; }
.stop-popup { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

.map-top { position: absolute; z-index: 500; top: 12px; left: 12px; right: 64px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.map-top-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.map-chip { height: 34px; padding: 0 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.map-chip-btn { height: 34px; box-shadow: var(--shadow); font-size: 13px; padding: 0 14px; }
.legend { gap: 14px; color: var(--muted); font-size: 12px; height: 30px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; }
.legend-dot.live { background: var(--mot-tram); }
.legend-dot.est { border: 2px dashed var(--mot-tram); }
.map-fab { position: absolute; z-index: 500; right: 12px; top: 112px; width: 48px; height: 48px; background: var(--bg); color: var(--accent); box-shadow: var(--shadow); }

.map-panel {
  position: absolute; z-index: 600; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 24px + var(--safe-b));
  max-height: 44dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--bg); border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow);
}
.map-panel.collapsed { max-height: 64px; overflow: hidden; }
.panel-handle { position: sticky; top: 0; z-index: 1; display: flex; justify-content: center; width: 100%; height: 22px; padding: 8px 0; border: 0; background: var(--bg); }
.panel-handle span { width: 40px; height: 4px; border-radius: 999px; background: var(--border); }
.map-panel-body { padding: 0 18px 18px; }
.panel-section { display: flex; flex-direction: column; gap: 12px; }
.panel-section p { margin: 0; font-size: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.panel-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.facts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.next-stop { font-size: 14px; }

@media (min-width: 900px) {
  .map-page { left: 232px; }
  .map-panel { left: 16px; right: auto; top: 16px; bottom: 16px; width: 380px; max-height: none; }
  .map-panel.collapsed { max-height: none; }
  .panel-handle { display: none; }
  .map-panel-body { padding-top: 18px; }
  .map-top { left: 412px; }
}

/* Fahrzeug-Markierungen */
.veh-icon { background: none; border: 0; }
.veh {
  display: inline-flex; align-items: center; justify-content: center; transform: translate(-50%, -50%);
  min-width: 32px; height: 26px; padding: 0 8px; border-radius: 999px; border: 2.5px solid var(--bg);
  color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); cursor: pointer;
}
.veh.selected { min-width: 42px; height: 32px; font-size: 14px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--mot-tram) 30%, transparent), 0 3px 10px rgba(0, 0, 0, .35); }
.veh.estimated { background: var(--bg); color: var(--text); border: 2px dashed var(--mot-tram); }
.veh.estimated.mot-bus { border-color: var(--mot-bus); }
.veh.estimated.mot-sbahn { border-color: var(--mot-sbahn); }
.veh.estimated.mot-train { border-color: var(--mot-train); }
.animate-veh .leaflet-marker-icon.veh-icon { transition: transform 1.4s linear; }

@media (prefers-reduced-motion: reduce) {
  .animate-veh .leaflet-marker-icon.veh-icon { transition: none; }
  .spin, .spinning .icon { animation-duration: 2s; }
  .toast { transition: none; }
}

.notice {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 16px; text-align: left;
  border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
}
.notice > .icon:first-child { color: var(--delay); }
.notice > .icon:last-child { margin-left: auto; color: var(--muted); }
