/* ============ Farben & Grundwerte ============ */
:root {
  --bg: #f2f3f7;
  --bg2: #e9ebf2;
  --card: #ffffff;
  --card-2: #f6f7fa;
  --pop: #ffffff;
  --border: rgba(15, 20, 35, .08);
  --text: #12151c;
  --muted: #6b7280;
  --faint: #9aa1ad;
  --accent: #e5173f;
  --accent-2: #ff7a3d;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --ok: #059669;
  --warn: #d97706;
  --bad: #dc2626;
  --ok-bg: rgba(5, 150, 105, .12);
  --warn-bg: rgba(217, 119, 6, .14);
  --bad-bg: rgba(220, 38, 38, .12);
  --glass: rgba(255, 255, 255, .72);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .18);
  --glow-1: rgba(229, 23, 63, .10);
  --glow-2: rgba(255, 122, 61, .08);
  --radius: 20px;
  --radius-sm: 12px;
  --tabbar-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07080c;
    --bg2: #0d0f15;
    --card: rgba(255, 255, 255, .045);
    --card-2: rgba(255, 255, 255, .07);
    --pop: #14171e;
    --border: rgba(255, 255, 255, .08);
    --text: #eef1f7;
    --muted: #9099a8;
    --faint: #5f6775;
    --accent: #ff3b5c;
    --accent-2: #ff8a3d;
    --ok: #34d399;
    --warn: #fbbf24;
    --bad: #f87171;
    --ok-bg: rgba(52, 211, 153, .12);
    --warn-bg: rgba(251, 191, 36, .13);
    --bad-bg: rgba(248, 113, 113, .14);
    --glass: rgba(10, 12, 18, .66);
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px -15px rgba(0, 0, 0, .8);
    --glow-1: rgba(255, 59, 92, .16);
    --glow-2: rgba(255, 138, 61, .10);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07080c;
  --bg2: #0d0f15;
  --card: rgba(255, 255, 255, .045);
  --card-2: rgba(255, 255, 255, .07);
  --pop: #14171e;
  --border: rgba(255, 255, 255, .08);
  --text: #eef1f7;
  --muted: #9099a8;
  --faint: #5f6775;
  --accent: #ff3b5c;
  --accent-2: #ff8a3d;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --ok-bg: rgba(52, 211, 153, .12);
  --warn-bg: rgba(251, 191, 36, .13);
  --bad-bg: rgba(248, 113, 113, .14);
  --glass: rgba(10, 12, 18, .66);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px -15px rgba(0, 0, 0, .8);
  --glow-1: rgba(255, 59, 92, .16);
  --glow-2: rgba(255, 138, 61, .10);
  color-scheme: dark;
}

/* ============ Basis ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 100% -10%, var(--glow-1), transparent 70%),
    radial-gradient(500px 380px at -10% 30%, var(--glow-2), transparent 70%),
    linear-gradient(var(--bg), var(--bg2));
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }

/* ============ Kopfzeile ============ */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--glass);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.brand img { border-radius: 9px; box-shadow: 0 4px 14px -4px var(--accent); }
.brand b {
  font-weight: 800; margin-left: 2px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.appbar-right { display: flex; align-items: center; gap: 10px; }
.clock { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; letter-spacing: .02em; color: var(--muted); }
/* Hell/Dunkel-Schalter */
.theme-switch {
  position: relative; width: 68px; height: 36px; padding: 0; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card-2);
  display: flex; align-items: center; justify-content: space-between;
}
.theme-switch svg {
  position: relative; z-index: 2; width: 16px; height: 16px; margin: 0 9px;
  fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke .25s;
}
.theme-switch .ts-knob {
  position: absolute; z-index: 1; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #ffd166, #ff9f1c); box-shadow: 0 3px 10px -2px rgba(255, 159, 28, .6);
  transition: transform .3s cubic-bezier(.4, 1.4, .6, 1), background .3s;
}
.theme-switch .ts-sun { stroke: #fff; }
.theme-switch[aria-checked="true"] .ts-knob {
  transform: translateX(32px);
  background: linear-gradient(135deg, #6d7cff, #9b5cff); box-shadow: 0 3px 10px -2px rgba(124, 92, 255, .6);
}
.theme-switch[aria-checked="true"] .ts-sun { stroke: var(--muted); }
.theme-switch[aria-checked="true"] .ts-moon { stroke: #fff; }

/* ============ Untere Tab-Leiste ============ */
.tabbar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  width: min(420px, calc(100% - 24px));
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px; border-radius: 24px;
  background: var(--glass);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, .45);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 6px; border-radius: 18px; color: var(--muted);
  font-size: 11px; font-weight: 600; transition: color .2s, background .2s;
}
.tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tabbar a.active { color: var(--text); background: var(--card-2); }
.tabbar a.active svg { stroke: var(--accent); }
.tabbar a[data-tab="home"].active svg { fill: var(--accent); }

main {
  width: 100%; max-width: 620px; margin: 0 auto; flex: 1;
  padding: 16px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px);
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.foot {
  text-align: center; color: var(--faint); font-size: 11px;
  padding: 0 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
  margin-top: -16px;
}

/* ============ Bausteine ============ */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card + .card { margin-top: 12px; }
.pad { padding: 14px; }
/* Kästen mit Suchfeld: Vorschlagsliste darf über den Rand hinausragen */
.card.pad { overflow: visible; position: relative; z-index: 15; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); margin: 26px 4px 10px;
}
.section-title:first-child { margin-top: 6px; }
.row { display: flex; gap: 8px; align-items: center; }
.row + .row { margin-top: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.hint { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 34px 16px; }
.empty .big-ico { font-size: 40px; display: block; margin-bottom: 8px; filter: grayscale(.2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 12px 16px; min-height: 46px;
  background: var(--grad); color: #fff; font-weight: 700;
  box-shadow: 0 8px 22px -10px var(--accent);
  transition: transform .15s;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--card-2); color: var(--text); box-shadow: none; border: 1px solid var(--border); }
.btn.block { width: 100%; }
.icon-btn {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--card-2);
  display: grid; place-items: center; font-size: 20px; transition: transform .15s, background .2s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.star[aria-pressed="true"] { color: #ffb020; background: rgba(255, 176, 32, .12); border-color: rgba(255, 176, 32, .4); }
.star[aria-pressed="true"] svg { fill: #ffb020; stroke: #ffb020; }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 8px; min-height: 40px; }

.seg { display: inline-flex; background: var(--card-2); border: 1px solid var(--border); border-radius: 14px; padding: 4px; }
.seg button {
  border: 0; background: none; padding: 8px 14px; border-radius: 10px; min-height: 36px;
  color: var(--muted); font-weight: 600; transition: all .2s;
}
.seg button[aria-pressed="true"] { background: var(--grad); color: #fff; box-shadow: 0 6px 16px -8px var(--accent); }

.time-input {
  flex: 1 1 auto; min-width: 0; min-height: 46px; padding: 0 12px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--card-2);
}

/* Status mit Live-Punkt */
.status {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  color: var(--muted); font-size: 12px; font-weight: 500; margin: 12px 4px 10px; min-height: 18px;
}
.status.error { color: var(--bad); }
.status-right { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.35; text-align: right; }
.status-right .ver { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--faint); }
.live { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--ok); letter-spacing: .03em; }
.live::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite;
}
.live.paused { color: var(--muted); }
.live.paused::before { background: var(--faint); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ============ Suchfeld mit Vorschlägen ============ */
.ac { position: relative; }
.search {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px;
  border-radius: 16px; border: 1px solid var(--border); background: var(--card-2);
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.search svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; font-weight: 500; padding: 12px 0; }
.search input::placeholder { color: var(--faint); font-weight: 400; }
.search .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  list-style: none; margin: 0; padding: 6px;
  background: var(--pop); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, .5); max-height: 340px; overflow: auto;
}
.ac-list li { padding: 12px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.ac-list li[aria-selected="true"], .ac-list li[data-i]:hover { background: var(--card-2); }
.ac-list li small { color: var(--muted); }
.ac-list li.ac-near { justify-content: flex-start; gap: 10px; color: var(--accent); font-weight: 700; border-bottom: 1px solid var(--border); border-radius: 10px 10px 0 0; margin-bottom: 4px; }
.ac-list li.ac-near:hover { background: var(--card-2); }
.ac-near svg { width: 18px !important; height: 18px !important; stroke: var(--accent) !important; flex: 0 0 auto; }
.ac-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; cursor: default !important; padding: 8px 12px 4px !important; }

/* ============ Linien-Abzeichen ============ */
.line {
  --lc: #6b7280;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; padding: 3px 8px; border-radius: 8px;
  font-weight: 800; font-size: 12.5px; letter-spacing: .01em; line-height: 1.35;
  color: #fff; background: var(--lc); white-space: nowrap;
  box-shadow: 0 4px 12px -6px var(--lc);
}
.t-longdistance { --lc: #e5173f; }
.t-regional { --lc: #3b6cf6; }
.t-sbahn { --lc: #0ea5e9; }
.t-tram { --lc: #d6338a; }
.t-bus { --lc: #64748b; }
.t-subway { --lc: #16a34a; }
.t-ship { --lc: #0891b2; }
.t-sev { --lc: #eab308; color: #111; }

/* ============ Abfahrtszeilen ============ */
.deps { list-style: none; margin: 0; padding: 0; }
.dep {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 13px 14px; border-top: 1px solid var(--border);
}
.dep:first-child { border-top: 0; }
.dep .line { min-width: 52px; }
.dep-main { min-width: 0; }
.dep-dir { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.dep-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dep-sub .sep { color: var(--faint); }
.pf-changed { color: var(--bad); font-weight: 700; }

.chip {
  display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.chip.ok { color: var(--ok); background: var(--ok-bg); }
.chip.warn { color: var(--warn); background: var(--warn-bg); }
.chip.bad { color: var(--bad); background: var(--bad-bg); }

.cd {
  text-align: right; min-width: 52px; font-variant-numeric: tabular-nums; line-height: 1.05;
}
.cd b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.cd small { font-size: 11px; color: var(--muted); font-weight: 600; }
.cd.now b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; animation: blink 1.4s infinite; }
.cd.late b { color: var(--warn); }
.cd.verylate b { color: var(--bad); }
@keyframes blink { 50% { opacity: .45; } }

.dep.is-cncl { opacity: .7; }

/* Antippbare Abfahrt + Fahrtverlauf */
.dep[data-jid] { cursor: pointer; transition: background .15s; }
.dep[data-jid]:active, .dep.trip-open { background: var(--card-2); }
.trip { list-style: none; padding: 4px 14px 12px 14px; background: var(--card-2); border-top: 0; animation: fade .2s ease; }
.trip-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 2px 0 6px 26px; }
.trip-stops { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.trip-stops::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--lc, var(--faint)); opacity: .8; }
.trip-stops li { position: relative; display: grid; grid-template-columns: 112px 1fr; gap: 8px; align-items: baseline; padding: 5px 0; }
.trip-stops li::before {
  content: ""; position: absolute; left: -22px; top: 10px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--lc, var(--faint));
}
.trip-stops .tm { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.trip-stops .tm b { font-size: 14px; font-weight: 800; }
.trip-stops .nm { font-size: 14px; font-weight: 600; min-width: 0; }
.trip-stops li.is-cncl .nm { text-decoration: line-through; color: var(--muted); }
.trip-rest { margin-top: 0; }
.trip-rest::before { top: 0; }
.trip-more { display: block; margin: 6px 0 0 26px; border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 13px; padding: 6px 0; text-align: left; }
.trip .note { padding: 8px 0 4px 26px; }
.trip-load .skel { border-top: 0; padding: 8px 0; }
.dep.is-cncl .dep-dir { text-decoration: line-through; text-decoration-color: var(--bad); }

details.msg { margin-top: 6px; font-size: 12.5px; }
details.msg summary {
  cursor: pointer; list-style: none; display: inline-flex; gap: 6px; align-items: center;
  color: var(--warn); font-weight: 600; max-width: 100%;
}
details.msg summary::-webkit-details-marker { display: none; }
details.msg summary::before { content: "⚠"; }
details.msg p { margin: 6px 0 0; white-space: pre-line; color: var(--text); background: var(--warn-bg); padding: 8px 10px; border-radius: 10px; }

/* ============ Haltestellen-Kopf (Abfahrtstafel) ============ */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 18px 16px 16px;
  background: var(--grad); color: #fff; box-shadow: 0 18px 40px -20px var(--accent);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.hero h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; position: relative; z-index: 1; padding-right: 54px; }
.hero .hero-sub { opacity: .85; font-size: 13px; font-weight: 500; margin-top: 4px; position: relative; z-index: 1; }
.hero .icon-btn { position: absolute; right: 12px; top: 12px; z-index: 2; background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .3); color: #fff; }
.hero .star[aria-pressed="true"] { background: #fff; color: #ffb020; }

/* ============ Start: Begrüßung ============ */
.greet { margin: 4px 4px 0; }
.greet h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.035em; }
.greet p { margin: 2px 0 0; color: var(--muted); font-weight: 500; }

/* Favoriten-Gruppen: Stationen | Verbindungen */
.group-tabs {
  position: sticky; top: calc(env(safe-area-inset-top) + 64px); z-index: 20;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  margin: 18px 0 14px; padding: 5px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--border);
  backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
}
.group-tabs button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 10px; border: 0; border-radius: 14px; background: none;
  color: var(--muted); font-weight: 700; font-size: 14.5px; transition: background .2s, color .2s;
}
.group-tabs svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.group-tabs .count {
  min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-variant-numeric: tabular-nums;
  background: var(--card-2); color: var(--muted);
}
.group-tabs button[aria-selected="true"] { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -10px var(--accent); }
.group-tabs button[aria-selected="true"] .count { background: rgba(255, 255, 255, .25); color: #fff; }
.group-body { animation: fade .25s ease; }
.group-body .card + .card { margin-top: 12px; }

.fav-head { display: flex; align-items: center; gap: 10px; padding: 12px 8px 10px 14px; border-bottom: 1px solid var(--border); }
.fav-head .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); color: #fff; flex: 0 0 auto; font-size: 16px; }
.fav-head .ico svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fav-head a { flex: 1; min-width: 0; font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-head .more { color: var(--faint); font-size: 20px; padding: 0 6px; }
.fav-head .rm { width: 34px; height: 34px; border: 0; background: none; color: var(--faint); border-radius: 10px; font-size: 16px; }
.fav-head .rm:hover { background: var(--card-2); color: var(--bad); }
.fav .note { padding: 14px; color: var(--muted); font-size: 13px; }

/* Aufklappbare Stationen in den Favoriten */
.st-fav .fav-head { border-bottom: 0; padding: 6px 8px 6px 6px; }
.st-fav.open .fav-head { border-bottom: 1px solid var(--border); }
.st-toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  border: 0; background: none; padding: 6px 4px 6px 8px; min-height: 48px; text-align: left; border-radius: 12px;
}
.st-toggle:active { background: var(--card-2); }
.st-name { flex: 1; min-width: 0; font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-chev { color: var(--faint); font-size: 18px; line-height: 1; transition: transform .25s; padding: 0 4px; }
.st-fav.open .st-chev { transform: rotate(180deg); color: var(--accent); }
.st-body { animation: fade .2s ease; }
.st-more { display: block; padding: 12px 14px; border-top: 1px solid var(--border); color: var(--accent); font-weight: 700; font-size: 13.5px; text-align: center; }
.group-body .st-fav + .st-fav { margin-top: 10px; }
.route-title { display: flex; flex-direction: column; line-height: 1.25; }
.route-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-title .to { color: var(--muted); font-weight: 600; font-size: 14px; }

/* Optionen auf Strecken-Karten: Richtung + Alternative */
.fav-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.opt {
  border: 1px solid var(--border); background: var(--card-2); color: var(--text);
  border-radius: 999px; padding: 6px 12px; min-height: 34px; font-size: 13px; font-weight: 700;
  transition: all .2s;
}
.opt[aria-pressed="true"] { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px var(--accent); }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); min-height: 34px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--border); flex: 0 0 auto; transition: background .2s; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); transition: transform .2s; }
.switch input:checked + .track { background: var(--grad); border-color: transparent; }
.switch input:checked + .track .knob { transform: translateX(16px); }
.switch input:checked ~ .switch-label { color: var(--text); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Mini-Verbindungen in Favoriten */
.mini { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--border); }
.mini:first-child { border-top: 0; }
.mini .tt { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mini .tt small { color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 4px; }
.mini .chain { margin-top: 4px; }

/* Nähe */
.near-list { list-style: none; margin: 10px 0 0; padding: 0; }
.near-list a { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-top: 1px solid var(--border); font-weight: 600; }
.near-list li:first-child a { border-top: 0; }
.near-list small { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ============ Verbindungssuche ============ */
.route-form { position: relative; }
.route-fields { position: relative; display: grid; gap: 8px; }
.route-fields .dot-from { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.route-fields .dot-to { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.route-fields::before {
  content: ""; position: absolute; left: 18.5px; top: 30px; bottom: 30px; width: 2px;
  background: repeating-linear-gradient(var(--faint) 0 3px, transparent 3px 7px); z-index: 1; pointer-events: none;
}
.route-tools { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; gap: 6px; }
.route-tools .icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--bg2); }
.route-fields .search { padding-right: 58px; }
.swap.spin svg { transition: transform .35s; transform: rotate(180deg); }

/* Verbindungskarte */
.jny { cursor: pointer; transition: transform .15s; }
.jny + .jny { margin-top: 12px; }
.jny.is-cncl { border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.jny-head { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 16px 14px 14px; }
.tl { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 12px; }
.tl-time { font-size: 23px; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1; }
.tl-time.arr { text-align: right; }
.tl-rt { font-size: 12px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; min-height: 16px; }
.tl-rt.arr { text-align: right; }
.tl-mid { position: relative; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); align-self: start; height: 23px; }
.tl-mid::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--ok), var(--accent)); opacity: .55;
}
.tl-mid .dur { position: relative; background: var(--bg2); }

/* Fahrtdauer hh:mm */
.dur {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card-2); color: var(--text);
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dur svg { width: 13px; height: 13px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.mini-dur { margin-top: 5px; }
.jny-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.chain { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.chain .walk { color: var(--muted); font-size: 12px; font-weight: 600; }
.chain .arrow { color: var(--faint); font-size: 12px; }
.jny-meta { color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chev { color: var(--faint); transition: transform .25s; display: inline-block; margin-left: 4px; }
.jny-head[aria-expanded="true"] .chev { transform: rotate(180deg); }

/* Detail-Zeitleiste */
.legs { border-top: 1px solid var(--border); padding: 6px 14px 14px; background: color-mix(in srgb, var(--card-2) 50%, transparent); }
.leg { position: relative; padding: 12px 0 12px 22px; }
.leg.ride::before {
  content: ""; position: absolute; left: 5px; top: 24px; bottom: 24px; width: 3px; border-radius: 3px; background: var(--lc, var(--faint));
}
.leg-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.leg-title .dir { color: var(--muted); font-size: 13px; font-weight: 500; }
.stopline { position: relative; display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: baseline; padding: 3px 0; }
.stopline::before {
  content: ""; position: absolute; left: -21px; top: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--lc, var(--faint));
}
.stopline .tm { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.stopline .tm b { font-size: 15px; font-weight: 800; }
.stopline .tm .chip { margin-top: 2px; align-self: flex-start; }
.stopline .nm { font-weight: 600; }
.stopline .pf { color: var(--muted); font-size: 12px; white-space: nowrap; }
.inter { margin: 4px 0 4px 64px; font-size: 12.5px; color: var(--muted); }
.inter summary { cursor: pointer; font-weight: 600; list-style: none; }
.inter summary::-webkit-details-marker { display: none; }
.inter summary::before { content: "▸ "; }
.inter[open] summary::before { content: "▾ "; }
.inter ul { list-style: none; padding: 0; margin: 6px 0 0; }
.inter li { display: flex; gap: 10px; padding: 3px 0; }
.inter li span:first-child { min-width: 80px; font-variant-numeric: tabular-nums; }
.leg.walk { color: var(--muted); font-size: 13px; font-weight: 500; padding: 8px 0 8px 22px; }
.leg.walk::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 3px; background: repeating-linear-gradient(var(--faint) 0 3px, transparent 3px 7px); }
.pager { display: flex; justify-content: center; margin: 12px 0; }

/* ============ Info & Impressum ============ */
.foot-link { display: inline-block; margin-top: 6px; padding: 6px 10px; color: var(--accent); font-weight: 700; font-size: 12px; }
.info + .info { margin-top: 12px; }
.info h2 { margin: 0 0 8px; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.info p { margin: 0 0 8px; color: var(--text); font-size: 14px; line-height: 1.55; }
.info p:last-child { margin-bottom: 0; }
.info-list { margin: 12px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.55; }
.info-list li + li { margin-top: 6px; }
.link-inline { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.arch { display: grid; gap: 6px; justify-items: stretch; margin-top: 4px; }
.arch-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.arch-box {
  display: flex; flex-direction: column; gap: 2px; text-align: center;
  padding: 10px 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--card-2);
}
.arch-box b { font-size: 13.5px; }
.arch-box span { font-size: 12px; color: var(--muted); }
.arch-arrow { text-align: center; color: var(--accent); font-weight: 800; font-size: 16px; line-height: 1; }

/* ============ Lade-Skelett ============ */
.skel { padding: 14px; display: grid; grid-template-columns: 52px 1fr 44px; gap: 12px; align-items: center; border-top: 1px solid var(--border); }
.skel:first-child { border-top: 0; }
.skel i {
  display: block; height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--card-2) 25%, color-mix(in srgb, var(--card-2) 40%, var(--border)) 50%, var(--card-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
.skel i.b { height: 22px; }
.skel .two { display: grid; gap: 6px; }
.skel .two i:last-child { width: 55%; height: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============ Desktop ============ */
@media (min-width: 700px) {
  main { padding-top: 24px; }
  .greet h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
