/* Wandra – Stylesheet
   Mobile first · helles und dunkles Farbschema · keine externen Schriften (offline-tauglich) */

:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #efebe3;
  --surface-3: #e6e0d4;
  --text: #1c2622;
  --muted: #5d6a65;
  --faint: #8a948f;
  --line: #ddd6c9;
  --brand: #0b6e5f;
  --brand-strong: #075447;
  --brand-soft: #d9ede8;
  --brand-ink: #ffffff;
  --accent: #e0702b;
  --accent-soft: #fbe6d7;
  --route: #e4572e;
  --ok: #2d8a55;
  --ok-soft: #dcf0e3;
  --warn: #b88400;
  --warn-soft: #fbf0cf;
  --danger: #c3362b;
  --danger-soft: #f8dcd8;
  --info: #2f6fb3;
  --info-soft: #dde9f6;
  --c1: #2f9e6b; --c2: #8dbb3e; --c3: #e8b92a; --c4: #ec8a2e; --c5: #d6412b;
  --back: #ea580c; --back-strong: #c2410c; /* Zurück-Knopf (24.10.2026): orange in hell und dunkel */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 6px 20px rgba(20, 30, 25, .07);
  --shadow-lg: 0 10px 40px rgba(20, 30, 25, .18);
  --tabbar-h: 64px;
  --topbar-h: 56px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1513;
    --surface: #18211e;
    --surface-2: #1f2a26;
    --surface-3: #283530;
    --text: #e8eeeb;
    --muted: #a3b1ab;
    --faint: #75847e;
    --line: #2d3a35;
    --brand: #29a58f;
    --brand-strong: #3cc2aa;
    --brand-soft: #173b34;
    --brand-ink: #06231d;
    --accent: #f0914f;
    --accent-soft: #3d2718;
    --route: #ff7a52;
    --ok: #4fc285; --ok-soft: #173427;
    --warn: #e6b73a; --warn-soft: #3a3016;
    --danger: #f06a5d; --danger-soft: #3d1c19;
    --info: #6aa7e8; --info-soft: #172a3d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1513; --surface: #18211e; --surface-2: #1f2a26; --surface-3: #283530; --text: #e8eeeb;
  --muted: #a3b1ab; --faint: #75847e; --line: #2d3a35; --brand: #29a58f; --brand-strong: #3cc2aa;
  --brand-soft: #173b34; --brand-ink: #06231d; --accent: #f0914f; --accent-soft: #3d2718; --route: #ff7a52;
  --ok: #4fc285; --ok-soft: #173427; --warn: #e6b73a; --warn-soft: #3a3016; --danger: #f06a5d;
  --danger-soft: #3d1c19; --info: #6aa7e8; --info-soft: #172a3d; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--brand); }
img, svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 20px; height: 20px; flex: none; }
.ico-sm { width: 16px; height: 16px; flex: none; }
.ico-lg { width: 24px; height: 24px; flex: none; }

/* ------------------------------------------------------------------ Layout */
.app { min-height: 100vh; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.brand svg { width: 32px; height: 32px; }
.brand b { font-size: 21px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 12px; font-weight: 500; display: none; }
.topbar .spacer { flex: 1; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font-weight: 600; font-size: 14px;
}
.net-badge { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 4px 10px; }

.view {
  padding: 16px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
  max-width: 720px; margin: 0 auto;
  outline: none;
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .01em;
}
.tab .ico { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--brand); }
.tab[aria-current="page"] .tab-pill { background: var(--brand-soft); }
.tab-pill { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; transition: background .2s; }

.mapwrap { position: relative; background: var(--surface-2); display: none; }
.mapwrap.on { display: block; }
#map { position: absolute; inset: 0; }
.map-slot { position: relative; height: 42vh; min-height: 260px; margin: 0 -16px 16px; border-bottom: 1px solid var(--line); }
.map-slot .mapwrap { position: absolute; inset: 0; }
.map-slot.tall { height: 50vh; }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: minmax(420px, 480px) 1fr; grid-template-rows: auto 1fr auto; height: 100vh; }
  .topbar { grid-column: 1; grid-row: 1; position: relative; }
  .view { grid-column: 1; grid-row: 2; overflow-y: auto; max-width: none; margin: 0; padding-bottom: 28px; }
  .tabbar { grid-column: 1; grid-row: 3; position: relative; }
  .mapwrap, .mapwrap.on { grid-column: 2; grid-row: 1 / span 3; display: block; position: relative; border-left: 1px solid var(--line); }
  .map-slot { display: none; }
  .brand small { display: inline; }
}

/* ------------------------------------------------------------------ Typo */
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 750; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
.lead { color: var(--muted); font-size: 16px; margin-top: 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 6px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head h2 { font-size: 19px; }
.section-head h2 .ico { display: inline-block; vertical-align: -3px; margin-right: 4px; } /* Symbol in der Titelzeile (Schiff, Wandern) */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }

/* ------------------------------------------------------------------ Cards */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
.card.flat { box-shadow: none; }
.card.tint { background: var(--surface-2); box-shadow: none; border-color: transparent; }
.card-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-title h3 { flex: 1; }

.hero { padding: 6px 2px 16px; }
.install-banner { margin-bottom: 12px; padding: 12px; }
.install-banner p { margin-top: 2px; }
.hero h1 { font-size: 34px; }
@media (max-width: 380px) { .hero h1 { font-size: 28px; } }

/* ------------------------------------------------------------------ Form */
.field { display: block; }
.field + .field { margin-top: 14px; }
.label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 6px 2px; }
.input, .select {
  width: 100%; height: 48px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); padding: 0 14px; font-size: 16px; outline: none;
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-wrap .in-btn {
  position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); border: 0; cursor: pointer;
}
.suggest {
  position: absolute; left: 0; right: 0; top: 52px; z-index: 50; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  max-height: 280px; overflow: auto;
}
.suggest li { padding: 10px 10px; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--surface-2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type="time"].input, input[type="date"].input { padding: 0 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; white-space: nowrap;
  font-size: 14px; font-weight: 600; color: var(--text); user-select: none;
}
.chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.chip .ico-sm { opacity: .85; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); padding: 4px; border-radius: 12px; gap: 4px; }
.seg button {
  border: 0; background: transparent; border-radius: 9px; min-height: 40px; padding: 4px 6px; cursor: pointer;
  font-size: 14px; font-weight: 650; color: var(--muted); line-height: 1.15;
}
.seg button small { display: block; font-size: 11px; font-weight: 600; opacity: .8; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.switch { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.switch input { width: 44px; height: 26px; appearance: none; -webkit-appearance: none; background: var(--surface-3); border-radius: 999px; position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(18px); }

/* ------------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 14px; border: 1px solid transparent; cursor: pointer; font-weight: 700; font-size: 16px;
  text-decoration: none; transition: transform .06s ease, background .2s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn[disabled] { opacity: .55; cursor: default; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
}
.btn-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.btn-row .btn { min-height: 44px; font-size: 14px; padding: 0 10px; white-space: nowrap; }
.btn-row.tight { grid-template-columns: repeat(3, 1fr); }
.btn-row.tight .btn { flex-direction: column; gap: 2px; min-height: 54px; font-size: 12px; padding: 4px; white-space: normal; line-height: 1.15; text-align: center; }
/* Zurück (24.10.2026, Andreas: «Zurück-Button grösser, orange»): überall derselbe grosse orange Knopf mit weisser, fetter Schrift
   (19 px fett = grosse Schrift nach WCAG, Kontrast weiss auf #ea580c 3,6 : 1) – Planer, Tour, Schiff, Verbindungen, Mehr, Unterwegs */
.back-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 20px 0 12px; margin-bottom: 12px;
  border-radius: 14px; border: 0; background: var(--back); color: #fff; text-decoration: none; font-weight: 800; font-size: 19px;
  line-height: 1.15; box-shadow: 0 2px 8px color-mix(in srgb, var(--back) 35%, transparent); cursor: pointer;
}
.back-link:hover, .back-link:active { background: var(--back-strong); color: #fff; }
.back-link:active { transform: scale(.98); }
.back-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--back) 50%, transparent); outline-offset: 2px; }
.back-link .ico, .back-link .ico-sm { width: 24px; height: 24px; stroke-width: 2.8; }
.trail-top .back-link { margin: 0; min-height: 48px; padding: 0 14px 0 8px; font-size: 18.7px; box-shadow: var(--shadow); }
/* Auswahl in den Vorschlägen (24.10.2026): Schiff, Wanderungen, Uferwege mit anderer Wanderzeit – nie eine Sackgasse */
.choice { margin: 0 0 14px; }
#boatSection, #hikeSection { scroll-margin-top: calc(var(--topbar-h) + 12px + env(safe-area-inset-top)); } /* Sprung aus der Auswahl: Titel nicht unter der Kopfzeile */
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.choice-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 14px; cursor: pointer;
  border: 2px solid var(--brand); background: var(--surface); color: var(--brand); font-weight: 800; font-size: 15.5px; text-decoration: none;
}
.choice-btn.primary { background: var(--brand); color: var(--brand-ink); }
.choice-btn:active { transform: scale(.98); }
.choice-btn b { font-weight: 800; }
.time-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.time-chips .chip { height: 44px; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.time-chips .chip[disabled] { opacity: .45; cursor: default; }
.time-chips .chip small { font-weight: 700; opacity: .85; margin-left: 4px; }
.boat-card .btns { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
@media (min-width: 420px) { .boat-card .btns { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------------ Badges */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--text); white-space: nowrap;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.c1 { background: color-mix(in srgb, var(--c1) 16%, var(--surface)); color: var(--c1); }
.badge.c2 { background: color-mix(in srgb, var(--c2) 18%, var(--surface)); color: color-mix(in srgb, var(--c2) 70%, var(--text)); }
.badge.c3 { background: color-mix(in srgb, var(--c3) 20%, var(--surface)); color: color-mix(in srgb, var(--c3) 55%, var(--text)); }
.badge.c4 { background: color-mix(in srgb, var(--c4) 18%, var(--surface)); color: color-mix(in srgb, var(--c4) 80%, var(--text)); }
.badge.c5 { background: color-mix(in srgb, var(--c5) 16%, var(--surface)); color: var(--c5); }
.lvl { display: inline-flex; gap: 2px; margin-left: 2px; }
.lvl i { width: 5px; height: 11px; border-radius: 2px; background: currentColor; opacity: .25; }
.lvl i.on { opacity: 1; }

/* ------------------------------------------------------------------ Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font-size: 19px; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
@media (max-width: 360px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------------------------------------------ Route cards / lists */
.rcard { display: block; text-decoration: none; color: inherit; }
.rcard .card { transition: transform .08s ease; }
.rcard:active .card { transform: scale(.99); }
.rcard h3 { font-size: 17px; }
.rcard .sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.rmeta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.rmeta span { display: inline-flex; align-items: center; gap: 4px; }

.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent); text-decoration: none; color: inherit;
}
.list-item + .list-item { margin-top: 8px; }
.list-item .thumb {
  width: 54px; height: 54px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); position: relative; overflow: hidden;
}
.list-item .thumb svg.spark { position: absolute; inset: auto 0 0 0; width: 100%; height: 26px; }
.list-item .thumb b { font-size: 12px; font-weight: 800; z-index: 1; margin-top: -10px; }

.picks { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.picks::-webkit-scrollbar { display: none; }
@media (min-width: 600px) { .picks { grid-auto-columns: 46%; } }
@media (min-width: 960px) { .picks { grid-auto-columns: 82%; } }
.pick { scroll-snap-align: start; text-decoration: none; color: inherit; }
.pick .card { height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 0; overflow: hidden; }
.pick .art { height: 92px; position: relative; background: linear-gradient(160deg, var(--brand) 0%, #0f8f78 55%, #2fb08f 100%); color: #fff; }
.pick .art svg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70px; }
.pick .art .tag { position: absolute; left: 12px; top: 10px; font-size: 12px; font-weight: 800; background: rgba(0,0,0,.22); padding: 3px 9px; border-radius: 999px; }
.pick .body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.pick p { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feature { background: var(--surface); border-radius: 14px; padding: 12px; border: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.feature .ico-lg { color: var(--brand); margin-bottom: 6px; }
.feature b { display: block; font-size: 14.5px; }
.feature span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ------------------------------------------------------------------ Plan / timeline */
.progress-steps { list-style: none; padding: 0; margin: 0; }
.progress-steps li { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--muted); font-weight: 600; }
.progress-steps li .st { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); flex: none; }
.progress-steps li.active { color: var(--text); }
.progress-steps li.active .st { border-color: var(--brand); border-top-color: transparent; animation: spin .8s linear infinite; }
.progress-steps li.done { color: var(--text); }
.progress-steps li.done .st { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
@keyframes spin { to { transform: rotate(360deg); } }

.timeline { list-style: none; margin: 12px 0 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl { position: relative; display: flex; gap: 12px; padding: 6px 0; }
.tl .tl-ico {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; z-index: 1;
  background: var(--surface-2); color: var(--muted); border: 2px solid var(--surface);
}
.tl.ride .tl-ico { background: var(--info-soft); color: var(--info); }
.tl.hike .tl-ico { background: var(--brand-soft); color: var(--brand); }
.tl.last .tl-ico { background: var(--accent-soft); color: var(--accent); }
.tl.home .tl-ico { background: var(--surface-3); color: var(--text); }
.tl .tl-body { flex: 1; min-width: 0; padding-top: 2px; }
.tl .tl-time { font-weight: 800; font-variant-numeric: tabular-nums; }
.tl .tl-sub { font-size: 13.5px; color: var(--muted); }
.legs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.leg { font-size: 11.5px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text); }
.leg.train { background: #e8eefb; color: #1d4fa6; }
.leg.bus { background: #fdf2d6; color: #8a5a00; }
.leg.cable { background: #fde4e4; color: #a4232b; }
.leg.boat { background: #dff3f7; color: #0d6a80; }
.leg.walk { background: var(--surface-2); color: var(--muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leg.train { background: #1b2b47; color: #9dbbf5; }
  :root:not([data-theme="light"]) .leg.bus { background: #3a2f12; color: #f1c96b; }
  :root:not([data-theme="light"]) .leg.cable { background: #3f1d20; color: #f3a1a6; }
  :root:not([data-theme="light"]) .leg.boat { background: #123640; color: #8fd8ea; }
}
.reasons { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.reasons li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.reasons li .ico-sm { color: var(--ok); margin-top: 2px; }
.reserve-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.reserve-bar i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.rcard-wrap { margin-bottom: 12px; }
.sbb-check { margin-top: 6px; min-height: 48px; } /* Rückfahrt im Fahrplan prüfen (geschätzter Plan): eigener Link unter der Karte */

/* ------------------------------------------------------------------ Weather */
.wx-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 58px; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.wx-h { background: var(--surface-2); border-radius: 12px; padding: 8px 4px; text-align: center; font-size: 12.5px; }
.wx-h.in { background: var(--brand-soft); }
.wx-h .t { font-weight: 800; font-size: 15px; }
.wx-h svg { width: 26px; height: 26px; margin: 4px auto; }
.wx-h .pp { color: var(--info); font-weight: 700; }
.wx-sum { display: flex; gap: 12px; align-items: center; }
.wx-sum svg { width: 44px; height: 44px; }

/* ------------------------------------------------------------------ Crowd */
.crowd-meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 8px 0 4px; }
.crowd-meter i { height: 10px; border-radius: 4px; background: var(--surface-3); }
.crowd-meter i.on:nth-child(1) { background: var(--c1); }
.crowd-meter i.on:nth-child(2) { background: var(--c2); }
.crowd-meter i.on:nth-child(3) { background: var(--c3); }
.crowd-meter i.on:nth-child(4) { background: var(--c4); }
.crowd-meter i.on:nth-child(5) { background: var(--c5); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 70px; margin-top: 10px; }
.bars div { flex: 1; border-radius: 4px 4px 0 0; background: var(--brand); opacity: .75; min-height: 2px; }
.bars div.now { background: var(--accent); opacity: 1; }
.bars-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 4px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 10px; }
.week div { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.week div i { display: block; height: 30px; border-radius: 8px; margin-top: 4px; }

/* ------------------------------------------------------------------ Safety */
.ampel { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; }
.ampel.ok { background: var(--ok-soft); color: var(--ok); }
.ampel.warn { background: var(--warn-soft); color: var(--warn); }
.ampel.danger { background: var(--danger-soft); color: var(--danger); }
.ampel.unknown { background: var(--surface-2); color: var(--text); } /* ohne Wetter: kein Licht */
.ampel b { font-size: 17px; }
.ampel .lights { display: flex; flex-direction: column; gap: 3px; padding: 5px; background: rgba(0,0,0,.08); border-radius: 10px; }
.ampel .lights i { width: 12px; height: 12px; border-radius: 50%; background: rgba(0,0,0,.14); }
.ampel.danger .lights i:nth-child(1) { background: var(--danger); }
.ampel.warn .lights i:nth-child(2) { background: var(--warn); }
.ampel.ok .lights i:nth-child(3) { background: var(--ok); }
.sitems { list-style: none; margin: 10px 0 0; padding: 0; }
.sitem { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.sitem:first-child { border-top: 0; }
.sitem .sico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.sitem.s0 .sico { background: var(--ok-soft); color: var(--ok); }
.sitem.s1 .sico { background: var(--info-soft); color: var(--info); }
.sitem.s2 .sico { background: var(--warn-soft); color: var(--warn); }
.sitem.s3 .sico { background: var(--danger-soft); color: var(--danger); }
.sos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.sos a { text-decoration: none; }

/* ------------------------------------------------------------------ Profile */
.profile { position: relative; width: 100%; touch-action: pan-y; }
.profile svg { width: 100%; height: auto; overflow: visible; }
.profile .tip { position: absolute; top: 4px; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700; padding: 3px 7px; border-radius: 7px; pointer-events: none; white-space: nowrap; }

/* ------------------------------------------------------------------ Highlights */
.hl { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.hl:first-child { border-top: 0; }
.hl .hico { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--brand); flex: none; }
.hl .km { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; font-weight: 700; }

/* ------------------------------------------------------------------ Trail mode */
body.trail .topbar, body.trail .tabbar { display: none; }
body.trail .view { padding: 0; max-width: none; }
.trail-map { position: fixed; inset: 0; }
.trail-map .mapwrap { position: absolute; inset: 0; display: block; }
@media (min-width: 960px) {
  body.trail .app { grid-template-columns: 1fr; }
  body.trail .mapwrap { position: fixed; inset: 0; grid-column: 1; }
}
body.trail .leaflet-top { top: calc(64px + env(safe-area-inset-top)); }
body.trail .leaflet-bottom { bottom: var(--sheet-h, 0px); transition: bottom .2s; } /* Quellen der Karte über dem Blatt */
body.trail .leaflet-bottom .leaflet-control-attribution { margin-bottom: 0; }
.trail-top { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 1000; display: flex; gap: 8px; align-items: center; }
.trail-top .title { flex: 1; min-width: 0; background: var(--surface); border-radius: 14px; padding: 8px 12px; box-shadow: var(--shadow); font-weight: 700; }
.trail-top .title .ico-sm { display: inline-block; vertical-align: -2px; margin-right: 4px; } /* Schiff vor dem Namen, gleiche Zeile */
/* Notruf (24.10.2026, Andreas: «Notruf Tel rot, klein geschrieben Notruf»): rotes Telefon mit kleiner Beschriftung, immer sichtbar
   (auch bei eingeklapptem Blatt); fest #c3362b in hell und dunkel – weiss darauf 5,4 : 1 */
.sos-btn {
  flex: none; min-width: 60px; height: 48px; padding: 3px 8px; border: 0; border-radius: 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: #c3362b; color: #fff; box-shadow: var(--shadow); font-weight: 800; font-size: 11px; line-height: 1.1; letter-spacing: .01em;
}
.sos-btn .ico { width: 22px; height: 22px; stroke-width: 2.3; }
.sos-btn:active { background: #a82c22; transform: scale(.97); }
.sos-btn:focus-visible { outline: 3px solid color-mix(in srgb, #c3362b 45%, transparent); outline-offset: 2px; }
/* Blatt unten (24.10.2026): eingeklappt nur Griff und «Jetzt» (höchstens 30 %), aufgeklappt alles (höchstens 70 %, scrollbar) */
.trail-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; max-width: 560px; margin: 0 auto;
  display: flex; flex-direction: column; max-height: 70vh; max-height: 70dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -6px 26px rgba(20, 30, 25, .2);
  padding: 0 14px calc(12px + env(safe-area-inset-bottom));
}
.trail-panel > * { flex-shrink: 0; }
.trail-panel.zu { max-height: 30vh; max-height: 30dvh; overflow: hidden; }
.trail-panel.zu > :not(.trail-head) { display: none; }
.trail-panel > .trail-foot { order: 2; } /* Hinweis und Quellen zuletzt (nach der Erinnerung der iPhone-App) */
.trail-head { position: sticky; top: 0; z-index: 2; background: var(--surface); padding-bottom: 4px; touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
.trail-grip { display: flex; align-items: center; justify-content: center; width: 100%; height: 22px; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; touch-action: none; }
.trail-grip i { display: block; width: 44px; height: 5px; border-radius: 99px; background: var(--line); }
.trail-grip:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 10px; }
.trail-now { display: flex; gap: 10px; align-items: center; padding: 8px 8px 8px 10px; border-radius: 14px; background: var(--surface-2); }
.trail-now.ok { background: var(--ok-soft); }
.trail-now.warn { background: var(--warn-soft); }
.trail-now.danger { background: var(--danger-soft); }
.now-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.trail-now.ok .now-ico { background: var(--surface); color: var(--ok); }
.trail-now.warn .now-ico { background: var(--surface); color: var(--warn); }
.trail-now.danger .now-ico { background: var(--surface); color: var(--danger); }
.now-txt { flex: 1; min-width: 0; }
.now-main { font-weight: 800; font-size: 15.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.now-main .tm { font-variant-numeric: tabular-nums; }
.now-sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.now-sub b { color: var(--text); font-weight: 800; }
.now-warn { font-size: 13.5px; font-weight: 800; margin-top: 3px; line-height: 1.3; }
.trail-now.warn .now-warn { color: var(--warn); }
.trail-now.danger .now-warn { color: var(--danger); }
.now-sub[hidden], .now-warn[hidden], .now-next[hidden] { display: none; }
.now-next {
  flex: none; min-width: 58px; height: 50px; padding: 3px 6px; border: 0; border-radius: 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 12px; line-height: 1.1;
}
.now-next:active { transform: scale(.97); }
/* Führung nach Standort (24.10.2026): «Weg zum Start/zur Haltestelle/zum Steg», «Nächste Verbindung», «Plan anpassen» –
   in der Zeile «Jetzt», auch bei eingeklapptem Blatt */
.now-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-top: 8px; } /* drei Knöpfe in einer Zeile, auch auf 320 px */
.now-acts[hidden], .now-acts .btn[hidden] { display: none; }
.now-acts .btn { min-height: 44px; padding: 4px 8px; gap: 6px; font-size: 13.5px; line-height: 1.15; white-space: normal; text-align: center; }
.now-acts .btn .ico-sm { flex: none; }
/* Karte folgt dem Standort: Knopf rechts über dem Blatt (an = Markenfarbe); Verschieben der Karte schaltet ihn aus */
.map-follow {
  position: fixed; right: 12px; bottom: calc(var(--sheet-h, 120px) + 30px); z-index: 1000; transition: bottom .2s;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.map-follow[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.map-follow:active { transform: scale(.96); }
.map-follow:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.trail-panel:not(.zu) ~ .map-follow { display: none; } /* aufgeklappt: «Zentrieren» im Blatt, kein Knopf über den Zoom-Knöpfen */
body.trail .map-ctl button[data-a="locate"] { display: none; } /* unterwegs ersetzt «Folgen» den einmaligen Standort-Knopf */
/* Kurzmeldung unterwegs über dem Blatt */
body.trail .toast { bottom: calc(var(--sheet-h, 0px) + 16px); }
.trail-h { font-size: 16px; margin: 14px 0 4px; }
.trail-steps { list-style: none; margin: 0; padding: 0; }
.trail-steps .st {
  width: 100%; display: grid; grid-template-columns: 44px 24px 1fr; gap: 6px; align-items: start; text-align: left;
  padding: 7px 8px; margin: 0; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; cursor: pointer;
}
.trail-steps div.st { cursor: default; }
.trail-steps .st-time { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14.5px; padding-top: 1px; }
.trail-steps .st-ico { color: var(--muted); padding-top: 2px; }
.trail-steps .st-txt { font-weight: 700; font-size: 14.5px; line-height: 1.3; min-width: 0; }
.trail-steps .st-txt small { display: block; font-weight: 600; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.trail-steps li.done { opacity: .55; }
.trail-steps li.done .st-ico { color: var(--ok); }
.trail-steps li.now .st { background: var(--brand-soft); box-shadow: inset 4px 0 0 var(--brand); }
.trail-steps li.now .st-ico { color: var(--brand); }
.trail-foot { margin: 12px 0 0; }
.trail-banner { position: fixed; top: calc(66px + env(safe-area-inset-top)); left: 10px; right: 58px; z-index: 1000; max-width: 560px; margin: 0 auto; } /* rechts frei für Zoom «+» */
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }
.status { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; font-weight: 700; font-size: 14.5px; }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.status.danger { background: var(--danger-soft); color: var(--danger); }
.status.info { background: var(--info-soft); color: var(--info); }

/* ------------------------------------------------------------------ Sheet / toast */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 2000; display: flex; align-items: flex-end; justify-content: center; }
.sheet-card {
  width: 100%; max-width: 560px; background: var(--surface); border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); max-height: 88vh; overflow: auto; animation: up .22s ease;
}
@media (min-width: 600px) { .sheet-backdrop { align-items: center; } .sheet-card { border-radius: 22px; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 12px; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 3000; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* Fenster offen (z. B. Notruf): Kurzmeldung oben, damit sie keine Knöpfe verdeckt */
#sheet:not([hidden]) ~ .toast { top: calc(14px + env(safe-area-inset-top)); bottom: auto; transform: translateX(-50%) translateY(-20px); }
#sheet:not([hidden]) ~ .toast.show { transform: translateX(-50%) translateY(0); }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .ico-lg { margin: 0 auto 10px; width: 40px; height: 40px; color: var(--faint); }
.note { font-size: 12.5px; color: var(--faint); margin-top: 10px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
details.more-box summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.more-box summary::-webkit-details-marker { display: none; }
.src-list { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); }
.src-list li + li { margin-top: 4px; }
.plus-box { background: linear-gradient(150deg, var(--brand) 0%, #13947d 100%); color: #fff; border: 0; }
.plus-box .muted, .plus-box .small { color: rgba(255,255,255,.85); }
.plus-box ul { margin: 8px 0 0; padding-left: 18px; }

/* ------------------------------------------------------------------ Leaflet */
.leaflet-container { font-family: var(--font); background: var(--surface-2); }
.leaflet-control-attribution { font-size: 10.5px; }
.pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pin span { transform: rotate(45deg); color: #fff; font-weight: 800; font-size: 12px; }
.pin-a { background: var(--brand); }
.pin-b { background: var(--route); }
.me-dot { position: relative; width: 18px; height: 18px; border-radius: 50%; background: #2f7bf0; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47,123,240,.25), 0 1px 4px rgba(0,0,0,.4); }
/* Gehrichtung (24.10.2026): Pfeil über dem Punkt, um die Mitte gedreht (Grad ab Nord); ohne Richtung unsichtbar */
.me-dir { position: absolute; left: 0; top: -15px; width: 0; height: 0; display: none; pointer-events: none;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid #2f7bf0; transform-origin: 6px 21px;
  filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.map-popup b { display: block; font-size: 14px; }
.map-popup span { display: block; color: #555; font-size: 12.5px; margin: 2px 0 6px; }
.map-popup a { font-weight: 700; }
.map-ctl { display: flex; flex-direction: column; gap: 6px; }
.map-ctl button { width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; color: var(--text); }

/* Wandra Plus und Rechtliches */
.link-card { display: block; color: inherit; text-decoration: none; }
.link-card .row { align-items: center; }
.link-card:active { transform: scale(.995); }
.plus-list { list-style: none; padding: 0; margin: 12px 0 8px; display: grid; gap: 8px; }
.plus-list li { display: flex; gap: 8px; align-items: flex-start; }
.plus-list .ico-sm { flex: none; margin-top: 2px; color: var(--brand); }
.plus-box .plus-list { padding-left: 0; margin: 12px 0 8px; }
.plus-box .plus-list .ico-sm { color: #fff; }
.plus-box .btn-primary { background: #fff; color: var(--brand); }
.plus-box .btn-soft { background: rgba(255,255,255,.18); color: #fff; }
.plus-box a:not(.btn) { color: #fff; text-decoration: underline; }
.plus-box .plus-note { color: #fff; opacity: .85; }
.legal-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.45; }
.btn.is-busy { opacity: .6; pointer-events: none; }

/* ------------------------------------------------------------------ Wandra-Abo (iPhone-App, Apple, seit 23.10.2026) */
.btn-kauf { background: #EA580C; color: #fff; font-size: 17px; min-height: 52px; }
.btn-kauf:active, .btn-kauf:hover { background: #C2410C; }
.plus-box .btn-ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.45); }
.abo-preis { font-size: 18px; }
.abo-bilder { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 10px; margin-top: 12px; -webkit-overflow-scrolling: touch; }
.abo-bilder img { flex: none; width: 40%; max-width: 190px; aspect-ratio: 1 / 2.17; object-fit: cover; object-position: top; border-radius: 14px; scroll-snap-align: start; background: rgba(255,255,255,.15); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.abo-meldung:empty { display: none; }
.abo-meldung { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.18); color: #fff; }
.abo-meldung.ok { background: rgba(255,255,255,.22); font-weight: 700; }
.abo-links { margin: 12px 4px 0; line-height: 1.6; }
.abo-links a { color: var(--brand); text-decoration: underline; }
