/* out&go — full-bleed map of the lake; all controls float above it as glass.
   Phone: one bottom sheet (peek / half / full). Desktop: a floating sidebar. */
:root {
  /* Lake palette: deep Obersee blue as accent, neutrals biased toward the water. */
  --bg: #eef3f6;
  --surface: #ffffff;
  --fill: rgb(118 128 140 / 14%);
  --fill-strong: rgb(118 128 140 / 22%);
  --text: #0f1e28;
  --muted: #5b6b77;
  --separator: rgb(60 75 90 / 16%);
  --accent: #0b5f8a;
  --accent-text: #ffffff;
  --accent-soft: #dcecf5;
  --warn: #8a5a00;
  --warn-bg: #fff3d6;
  --error: #c0261b;
  --good: #23824a;
  --glass: rgb(250 252 253 / 76%);
  --glass-edge: rgb(255 255 255 / 60%);
  --glass-shadow: 0 0.5px 0 rgb(0 0 0 / 6%), 0 8px 32px rgb(15 30 40 / 14%);
  --tile-filter: none;
  --thumb: #ffffff;

  /* Transport modes stay recognisable across themes. */
  --train: #c8102e; --ship: #1673c2; --bus: #d98b00; --cablecar: #2e8540; --walk: #6b7780; --bike: #7a4fc4;

  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-brand: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;

  /* Springs as CSS easing. damping 1 / response .35 s (default) and damping .8 / response .3 s (lively). */
  --spring: linear(0, 0.073, 0.212, 0.363, 0.502, 0.62, 0.714, 0.788, 0.845, 0.887, 0.918, 0.941, 0.958, 0.97, 0.979, 0.985, 0.989, 0.992, 0.995, 0.996, 0.997, 0.998, 0.999, 0.999, 1);
  --spring-t: 550ms;
  --spring-bounce: linear(0, 0.074, 0.221, 0.38, 0.54, 0.678, 0.788, 0.866, 0.926, 0.966, 0.99, 1.004, 1.011, 1.014, 1.013, 1.012, 1.009, 1.007, 1.005, 1.004, 1.002, 1.001, 1.001, 1, 1);
  --spring-bounce-t: 450ms;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1419; --surface: #16222a; --fill: rgb(130 150 165 / 18%); --fill-strong: rgb(130 150 165 / 28%);
    --text: #e8f0f4; --muted: #9aaebb; --separator: rgb(180 200 215 / 14%);
    --accent: #5cb8e6; --accent-text: #04202e; --accent-soft: #15384a;
    --warn: #f2c46d; --warn-bg: #3a2e12; --error: #ff8a80; --good: #6fd39a;
    --glass: rgb(20 31 39 / 74%); --glass-edge: rgb(255 255 255 / 8%);
    --glass-shadow: 0 0.5px 0 rgb(255 255 255 / 6%), 0 10px 36px rgb(0 0 0 / 45%);
    --tile-filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.7);
    --thumb: #3b4c58;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1419; --surface: #16222a; --fill: rgb(130 150 165 / 18%); --fill-strong: rgb(130 150 165 / 28%);
  --text: #e8f0f4; --muted: #9aaebb; --separator: rgb(180 200 215 / 14%);
  --accent: #5cb8e6; --accent-text: #04202e; --accent-soft: #15384a;
  --warn: #f2c46d; --warn-bg: #3a2e12; --error: #ff8a80; --good: #6fd39a;
  --glass: rgb(20 31 39 / 74%); --glass-edge: rgb(255 255 255 / 8%);
  --glass-shadow: 0 0.5px 0 rgb(255 255 255 / 6%), 0 10px 36px rgb(0 0 0 / 45%);
  --tile-filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.7);
  --thumb: #3b4c58;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); overflow: hidden;
  font: 17px/1.4 var(--font); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input, select { font: inherit; letter-spacing: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* ---------- Map ---------- */
#map { position: fixed; inset: 0; z-index: 0; background: var(--bg); }
.leaflet-container { background: var(--bg); font: 14px/1.4 var(--font); }
.leaflet-tile-pane { filter: var(--tile-filter); }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--glass-shadow) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-control-zoom a { background: var(--glass) !important; color: var(--text) !important; backdrop-filter: blur(20px); border-color: var(--separator) !important; }
.leaflet-top.leaflet-right { top: calc(env(safe-area-inset-top, 0px) + 76px); }
.leaflet-control-attribution { background: var(--glass) !important; color: var(--muted) !important; border-radius: 8px 0 0 0; backdrop-filter: blur(12px); }
.leaflet-control-attribution a { color: var(--accent) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); box-shadow: var(--glass-shadow); }
.leaflet-popup-content-wrapper { border-radius: var(--r-md); }
.map-popup { display: flex; flex-direction: column; gap: 4px; }
.map-popup .actions { display: flex; gap: 6px; margin-top: 6px; }

/* ---------- Glass material ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border: 0.5px solid var(--glass-edge); box-shadow: var(--glass-shadow);
}
@media (prefers-reduced-transparency: reduce) { .glass { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media (prefers-contrast: more) { .glass { background: var(--surface); border: 1px solid var(--text); } }

/* ---------- Header ---------- */
.top {
  position: fixed; z-index: 20; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 16px;
  display: flex; align-items: center; gap: 16px; padding: 8px 8px 8px 16px; border-radius: 999px;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.wordmark { font: 800 1.45rem/1 var(--font-brand); letter-spacing: -0.04em; }
.wordmark .amp { color: var(--accent); font-weight: 700; margin: 0 0.02em; }
.tagline { color: var(--muted); font-size: .82rem; font-weight: 500; white-space: nowrap; }
.top-controls { display: flex; gap: 6px; }
.pill-select select {
  appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; padding: 7px 12px;
  background: var(--fill); font-size: .82rem; font-weight: 600; cursor: pointer;
}

/* ---------- Panel (desktop: floating sidebar) ---------- */
.panel {
  position: fixed; z-index: 10; left: 16px; top: calc(env(safe-area-inset-top, 0px) + 76px); bottom: 16px;
  width: min(420px, calc(100vw - 32px)); border-radius: var(--r-lg);
  overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.sheet-grab { display: none; }

/* ---------- Phone: bottom sheet ---------- */
@media (max-width: 860px) {
  .top { left: 12px; right: 12px; padding-left: 14px; justify-content: space-between; }
  .tagline { display: none; }
  .leaflet-top.leaflet-right { top: calc(env(safe-area-inset-top, 0px) + 68px); }
  .leaflet-control-zoom { display: none; }
  .panel {
    left: 0; right: 0; width: auto; bottom: 0; top: calc(env(safe-area-inset-top, 0px) + 72px);
    border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0;
    padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
    overflow-y: hidden; will-change: transform; touch-action: pan-y;
  }
  .panel.is-full { overflow-y: auto; }
  .sheet-grab {
    display: flex; justify-content: center; position: sticky; top: 0; z-index: 2;
    margin: 0 -16px -6px; padding: 8px 0 12px; cursor: grab; touch-action: none;
    background: var(--glass); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  }
  .grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--fill-strong); transition: transform 200ms var(--spring), background 200ms; }
  .panel.is-dragging .grabber { transform: scaleX(1.25); background: var(--muted); }
  .panel.is-dragging { cursor: grabbing; }
}

/* ---------- Press feedback: instant on pointer-down, spring back on release ---------- */
.press, .seg label, .seg button, .counter button, .secondary, .tour-card {
  transition: transform var(--spring-bounce-t) var(--spring-bounce);
}
.press:active:not(:disabled), .seg label:active, .seg button:active, .counter button:active:not(:disabled), .secondary:active {
  transform: scale(.96); transition-duration: 0s;
}

/* ---------- Segmented controls with sliding thumb ---------- */
.seg {
  --n: 2; --i: 0; --pad: 2px;
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: var(--pad); border-radius: 11px; background: var(--fill); isolation: isolate;
}
.seg:has(> :nth-child(3)) { --n: 3; }
.seg:has(> :nth-child(2) input:checked), .seg:has(> :nth-child(2)[aria-selected="true"]) { --i: 1; }
.seg:has(> :nth-child(3) input:checked), .seg:has(> :nth-child(3)[aria-selected="true"]) { --i: 2; }
.seg::before {
  content: ""; position: absolute; z-index: -1; top: var(--pad); bottom: var(--pad); left: var(--pad);
  width: calc((100% - 2 * var(--pad)) / var(--n)); border-radius: 9px;
  background: var(--thumb); box-shadow: 0 1px 2px rgb(0 0 0 / 8%), 0 3px 8px rgb(0 0 0 / 10%);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform var(--spring-bounce-t) var(--spring-bounce);
}
.seg label, .seg button {
  position: relative; display: flex; justify-content: center; align-items: center; gap: 4px; min-width: 0;
  padding: 7px 6px; border: 0; background: none; cursor: pointer; border-radius: 9px;
  font-size: .9rem; font-weight: 600; text-align: center; line-height: 1.2;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.seg button[aria-selected="false"], .seg label:not(:has(input:checked)) { color: var(--muted); }
.tabs { flex: none; }
.tabs button { padding: 8px 4px; font-size: .88rem; }

/* ---------- Groups and fields ---------- */
.pane { display: flex; flex-direction: column; gap: 14px; }
.pane[hidden] { display: none; }
.group { display: flex; flex-direction: column; gap: 16px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .field > span:first-child {
  font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 6px; padding: 0 4px;
}
.field { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.field input {
  font-size: 1.0625rem; padding: 11px 12px; border-radius: 12px; border: 0; background: var(--fill);
  min-width: 0; width: 100%; transition: background 150ms;
}
.field input:focus { outline: 0; background: var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.stops { display: grid; grid-template-columns: 1fr auto; gap: 10px 10px; align-items: end; }
.stops .field:first-child { grid-column: 1; grid-row: 1; }
.stops .field:last-of-type { grid-column: 1; grid-row: 2; }
.swap {
  grid-column: 2; grid-row: 1 / span 2; align-self: center; margin-top: 18px;
  width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--fill); color: var(--accent); cursor: pointer;
}
.row { display: flex; gap: 10px; }

.profile-hint { margin: 6px 4px 0; font-size: .8rem; color: var(--muted); }
.profile:has(input[value="fast"]:checked) .hint-scenic, .profile:has(input[value="scenic"]:checked) .hint-fast { display: none; }

.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.counter {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; justify-items: center; gap: 6px 2px;
  padding: 8px 6px 10px; border-radius: 14px; background: var(--fill);
}
.counter-label { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; font-size: .75rem; font-weight: 600; color: var(--muted); }
.counter-icon { font-size: 1.4rem; line-height: 1.2; }
.counter button {
  width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--surface);
  font-size: 1.05rem; font-weight: 600; line-height: 1; cursor: pointer; padding: 0; color: var(--accent);
  box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
}
.counter button:disabled { opacity: .35; cursor: default; }
.counter output { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: .92rem; padding: 0 4px; }

/* iOS-style switch */
.switch {
  appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; border-radius: 999px; margin: 0;
  background: var(--fill-strong); position: relative; cursor: pointer; transition: background 200ms;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
  transition: transform var(--spring-bounce-t) var(--spring-bounce);
}
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(18px); }

.primary {
  padding: 14px; border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-text);
  font-weight: 650; font-size: 1.0625rem; cursor: pointer;
}
.primary:disabled { opacity: .6; cursor: progress; }
.secondary {
  padding: 7px 12px; border: 0; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-weight: 600; font-size: .88rem; cursor: pointer;
}
.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; }
.error { color: var(--error); margin: 0; font-weight: 600; font-size: .92rem; }
.muted { color: var(--muted); margin: 0; font-size: .92rem; }
.beta { font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); text-transform: uppercase; letter-spacing: .05em; }

.foot { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.disclaimer, .legal { color: var(--muted); font-size: .75rem; margin: 0; }
.disclaimer a, .legal a { color: var(--accent); }

/* ---------- Results ---------- */
.card { background: var(--surface); border-radius: 18px; padding: 16px; }
.result { display: flex; flex-direction: column; gap: 14px; animation: rise var(--spring-t) var(--spring) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.summary { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.summary-time { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.summary-dur { color: var(--muted); font-weight: 600; font-size: .92rem; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--fill); font-size: .8rem; font-weight: 500; }
.flag { font-weight: 700; font-size: .68rem; padding: 2px 5px; border-radius: 5px; color: #fff; letter-spacing: .03em; }
.flag-CH { background: #d52b1e; } .flag-DE { background: #3a3a3a; } .flag-AT { background: #c8102e; } .flag-LI { background: #002b7f; }
.meter { display: inline-flex; gap: 3px; vertical-align: middle; }
.meter i { width: 8px; height: 8px; border-radius: 50%; background: var(--fill-strong); }
.meter i.on { background: var(--cablecar); }

.legs { list-style: none; margin: 0; padding: 0; }
.leg { display: grid; grid-template-columns: 50px 14px 1fr; gap: 0 10px; }
.leg-times { display: flex; flex-direction: column; justify-content: space-between; font-variant-numeric: tabular-nums; font-weight: 600; font-size: .9rem; padding: 2px 0; }
.leg-bar { position: relative; }
.leg-bar::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 6px; border-radius: 3px; background: var(--c); }
.leg-bar.dashed::before { background: repeating-linear-gradient(var(--c) 0 5px, transparent 5px 9px); }
.leg-body { padding: 2px 0 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.leg-stop { font-weight: 600; }
.leg-meta { color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.line-badge { display: inline-block; padding: 1px 7px; border-radius: 6px; color: #fff; background: var(--c); font-weight: 700; font-size: .78rem; }
.border-cross { font-size: .82rem; color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: 3px 8px; align-self: flex-start; }
details summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
details ol { margin: 4px 0 0; padding-left: 18px; font-size: .85rem; color: var(--muted); }

.notices { margin: 0; padding: 12px 14px 12px 30px; background: var(--warn-bg); border-radius: 14px; font-size: .86rem; }
.notices li + li { margin-top: 4px; }
.notices-title { font-weight: 700; margin: 0 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.alt { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--fill); border-radius: 14px; padding: 10px 12px; font-size: .88rem; }

.tour-context { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; font-size: .88rem; background: var(--fill); border-radius: 14px; }
.loop-form .tour-context { background: none; padding: 0 4px; }
.loop-form { gap: 14px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 0; padding-top: 8px; border-top: 0.5px solid var(--separator); }
.day-head:first-of-type { border-top: 0; }
.wait { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin: 0 0 10px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: .88rem; }
.night { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--fill); font-weight: 600; }
.tour-card { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.tour-card h3 { margin: 0; font-size: 1.05rem; letter-spacing: -0.02em; }
.tour-card p { margin: 0; color: var(--muted); font-size: .88rem; }
.tour-card .secondary { align-self: flex-start; }
.stay { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin: 4px 0 14px; border-radius: 12px; background: var(--accent-soft); font-weight: 600; font-size: .88rem; }
.segment-head { font-weight: 700; margin: 0 0 8px; font-variant-numeric: tabular-nums; }
h3, h4 { letter-spacing: -0.02em; text-wrap: balance; }

.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; }
.loading-inline { display: flex; align-items: center; gap: 8px; font-size: .86rem; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--fill-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: .86rem; font-weight: 600; }
.source { align-self: flex-start; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .05em; }
.source-live { background: var(--accent-soft); color: var(--accent); }
.source-demo { background: var(--warn-bg); color: var(--warn); }
.delay { color: var(--error); font-size: .8rem; }
.rt { color: var(--good); font-size: .8rem; }

@media (max-width: 340px) {
  .counters { grid-template-columns: repeat(2, 1fr); }
}

/* Reduced motion: no slides or springs, only quick cross-fades. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
  .result { animation: fade 150ms ease both; }
  .press:active, .seg label:active, .seg button:active, .counter button:active, .secondary:active { transform: none; }
  .spinner { animation-duration: 3s; }
}
@keyframes fade { from { opacity: 0; } }
.check[hidden] { display: none; }

/* ---------- Legal pages ---------- */
body.doc { overflow: auto; padding: calc(env(safe-area-inset-top, 0px) + 24px) 16px 48px; }
.doc main { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.doc .wordmark { font-size: 1.6rem; color: var(--text); text-decoration: none; }
.doc h1 { font-size: 2rem; letter-spacing: -0.03em; margin: 24px 0 8px; }
.doc h2 { font-size: 1.1rem; letter-spacing: -0.015em; margin: 22px 0 4px; }
.doc p, .doc li { color: var(--text); font-size: 1rem; line-height: 1.55; margin: 0 0 8px; max-width: 65ch; }
.doc a { color: var(--accent); }
.doc .muted { color: var(--muted); font-size: .88rem; }

/* ---------- Stopover ---------- */
.via { display: grid; grid-template-columns: 1fr 112px auto; gap: 10px; align-items: end; }
.via[hidden] { display: none; }
.field select {
  font-size: 1.0625rem; padding: 11px 10px; border-radius: 12px; border: 0; background: var(--fill); min-width: 0; width: 100%;
}
.via-remove {
  width: 40px; height: 44px; border: 0; border-radius: 12px; background: var(--fill); color: var(--muted); cursor: pointer; font-size: 1rem;
}
.add-via { align-self: flex-start; padding: 0 4px; font-size: .92rem; margin-top: -6px; }
.add-via[hidden] { display: none; }

/* ---------- Connection list ---------- */
.options { padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.options-title { margin: 6px 8px 2px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.options ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.option {
  width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; text-align: left;
  padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; cursor: pointer;
}
.option:hover { background: var(--fill); }
.option.is-selected { background: var(--accent-soft); }
.option-time { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.option-modes { grid-row: span 2; font-size: 1.1rem; letter-spacing: 2px; }
.option-meta { color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.tag { font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--fill-strong); color: var(--text); text-transform: uppercase; letter-spacing: .04em; }
.option.is-selected .tag { background: var(--accent); color: var(--accent-text); }
#results { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Passes ---------- */
.passes { margin-top: 10px; background: var(--fill); border-radius: 14px; }
.passes summary {
  list-style: none; cursor: pointer; padding: 11px 14px; display: flex; justify-content: space-between; gap: 10px;
  font-size: .92rem; font-weight: 600;
}
.passes summary::-webkit-details-marker { display: none; }
.passes summary::after { content: "›"; color: var(--muted); transition: transform 300ms var(--spring); }
.passes[open] summary::after { transform: rotate(90deg); }
.passes-sum { margin-left: auto; color: var(--muted); font-weight: 500; text-align: right; }
.passes-hint { margin: 0 14px 6px; font-size: .8rem; color: var(--muted); }
.passes-list { display: flex; flex-direction: column; padding: 0 6px 6px; }
.pass-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px; }
.pass-row + .pass-row { border-top: 0.5px solid var(--separator); }
.pass-label { display: flex; flex-direction: column; min-width: 0; }
.pass-label strong { font-size: .92rem; font-weight: 600; }
.pass-label small { font-size: .76rem; color: var(--muted); }
.pass-count { display: flex; align-items: center; gap: 8px; flex: none; }
.pass-count output { min-width: 1.2em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.pass-count button {
  width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--surface); color: var(--accent);
  font-size: 1.05rem; font-weight: 600; cursor: pointer; padding: 0; box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
  transition: transform var(--spring-bounce-t) var(--spring-bounce);
}
.pass-count button:active:not(:disabled) { transform: scale(.9); transition-duration: 0s; }
.pass-count button:disabled { opacity: .35; cursor: default; }

/* Coverage per leg and the ticket summary */
.cover { align-self: flex-start; font-size: .8rem; font-weight: 600; padding: 3px 8px; border-radius: 8px; background: var(--fill); color: var(--muted); }
.cover-covered { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.cover-some, .cover-partial, .cover-check { background: var(--warn-bg); color: var(--warn); }
.cover-none, .cover-reduced { background: var(--fill); color: var(--text); }
.tickets-box { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--fill); }
.tickets-box .notices-title { margin: 0; }
.tickets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tickets li { display: flex; flex-direction: column; gap: 1px; font-size: .88rem; }
.tickets-line { font-weight: 600; }
.tickets-who { color: var(--muted); font-size: .82rem; }
.tickets-ok { margin: 0; color: var(--good); font-weight: 600; font-size: .9rem; }
.tickets-note { margin: 2px 0 0; color: var(--muted); font-size: .74rem; }

/* ---------- Icons ---------- */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.seg .ic { width: 1.05em; height: 1.05em; }
.line-badge .ic { width: 1.05em; height: 1.05em; vertical-align: -0.18em; }
.option-modes { display: flex; gap: 6px; color: var(--muted); }
.option-modes .ic { width: 1.2rem; height: 1.2rem; }
.chip .ic, .border-cross .ic, .wait .ic, .stay .ic, .night .ic { width: 1.05em; height: 1.05em; }
.chip .ic { color: var(--accent); }

/* ---------- Grouped list (party, passes, options) ---------- */
.list-group { background: var(--surface); border-radius: 14px; overflow: hidden; }
.list-rows { display: flex; flex-direction: column; }
.list-row {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; cursor: default;
}
label.list-row, summary.list-row { cursor: pointer; }
.list-group .list-row + .list-row::before, .list-group .list-rows + .passes > .list-row::before, .list-group .passes + .list-row::before {
  content: ""; position: absolute; top: 0; right: 0; left: 54px; border-top: 0.5px solid var(--separator);
}
.row-icon {
  flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff;
  background: var(--tint, var(--accent));
}
.row-icon .ic { width: 19px; height: 19px; stroke-width: 2; }
.tint-accent { --tint: var(--accent); }
.tint-teal { --tint: #14958f; }
.tint-amber { --tint: #d98a0b; }
.tint-purple { --tint: var(--bike); }
.tint-green { --tint: #23824a; }
.tint-blue { --tint: #2f6fd6; }
:root[data-theme="dark"] .row-icon { color: #fff; }
.row-label { flex: 1; min-width: 0; font-size: .98rem; font-weight: 500; line-height: 1.25; }
.list-row .switch { margin-left: auto; }

/* Stepper: one pill, − value + */
.stepper { display: inline-flex; align-items: center; flex: none; background: var(--fill); border-radius: 999px; padding: 2px; }
.stepper button {
  width: 34px; height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--accent);
  font-size: 1.2rem; font-weight: 500; line-height: 1; cursor: pointer; padding: 0;
  transition: transform var(--spring-bounce-t) var(--spring-bounce), background 120ms;
}
.stepper button:hover:not(:disabled) { background: var(--fill); }
.stepper button:active:not(:disabled) { transform: scale(.88); transition-duration: 0s; }
.stepper button:disabled { color: var(--muted); opacity: .35; cursor: default; }
.stepper output { min-width: 1.6em; text-align: center; font-weight: 650; font-size: 1rem; font-variant-numeric: tabular-nums; }
.stepper output.is-zero { color: var(--muted); font-weight: 500; }

/* Passes disclosure inside the group */
.list-group .passes { margin: 0; background: none; border-radius: 0; }
.passes summary.list-row { list-style: none; font-size: inherit; font-weight: inherit; justify-content: flex-start; padding: 8px 12px; }
.passes summary.list-row::after { content: none; }
.passes-sum { margin-left: auto; color: var(--muted); font-size: .9rem; font-weight: 500; white-space: nowrap; }
.chev { width: 16px; height: 16px; color: var(--muted); transition: transform 300ms var(--spring); }
.passes[open] .chev { transform: rotate(90deg); }
.passes-body { padding: 0 12px 8px 54px; }
.passes-hint { margin: 0 0 4px; }
.passes-list { padding: 0; }
.pass-row { padding: 8px 0; }

/* Segmented thumb icons inherit text colour */
.seg label .ic { color: currentColor; }
.seg label:has(input[value="fast"]:checked) .ic { color: #e0a100; }
.seg label:has(input[value="scenic"]:checked) .ic { color: var(--good); }
.tint-accent { --tint: #0b6e99; }
.passes summary.list-row, .passes summary.list-row .row-label { color: var(--text); }
.is-updating { opacity: .55; transition: opacity 150ms; pointer-events: none; }

/* ---------- Sights on the map ---------- */
.poi-wrap { background: none; border: 0; }
.poi {
  --c: var(--accent);
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--c); color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / 25%);
  transition: transform var(--spring-bounce-t) var(--spring-bounce);
}
.poi .ic { width: 15px; height: 15px; stroke-width: 2.1; }
.leaflet-marker-icon:hover .poi { transform: scale(1.15); }
.poi-culture { --c: #9a5b2e; }
.poi-museum { --c: #6b4fc4; }
.poi-nature { --c: #2e8540; }
.poi-view { --c: #0b6e99; }
.poi-family { --c: #d98a0b; }
.poi-garden { --c: #c2417a; }
.poi-tip { font: 600 12px/1.3 var(--font); border-radius: 8px; border: 0; box-shadow: var(--glass-shadow); background: var(--surface); color: var(--text); }
.poi-tip::before { display: none; }
.poi-head { display: flex; align-items: center; gap: 8px; }
.poi-head .poi { width: 24px; height: 24px; border-width: 0; box-shadow: none; flex: none; }
.poi-head .poi .ic { width: 13px; height: 13px; }
.poi-text { color: var(--muted); font-size: 13px; max-width: 240px; }
.map-toggle {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0.5px solid var(--glass-edge); border-radius: 999px;
  background: var(--glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--glass-shadow);
  color: var(--muted); font: 600 13px/1 var(--font); cursor: pointer;
}
.map-toggle[aria-pressed="true"] { color: var(--accent); }
.map-toggle .ic { width: 15px; height: 15px; }
@media (max-width: 860px) { .leaflet-top.leaflet-right .map-toggle { margin-top: 0; } }
.poi-wrap { display: grid !important; place-items: center; }
.poi { transition: transform var(--spring-bounce-t) var(--spring-bounce), width 200ms, height 200ms; }
.zoom-far .poi-wrap .poi { width: 13px; height: 13px; border-width: 2px; }
.zoom-far .poi-wrap .poi .ic { display: none; }
.zoom-far .leaflet-marker-icon:hover .poi { transform: scale(1.4); }
.leg-transfer .leg-body { padding: 0 0 14px; }
.transfer-line { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); font-weight: 500; }
.transfer-line .ic { width: 1em; height: 1em; }
.seg-mini { flex: none; width: 150px; }
.seg-mini label { padding: 5px 4px; font-size: .8rem; }
.buffer-row .row-label { min-width: 0; }
.list-row[hidden] { display: none; }

/* Beta badge next to the wordmark */
.beta-badge {
  align-self: center; padding: 3px 8px; border-radius: 6px; background: #e8590c; color: #fff;
  font: 800 .68rem/1 var(--font); letter-spacing: .08em; text-transform: uppercase;
}
.explore-btn { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin: 6px 8px 4px; font-size: .9rem; }
.explore-btn .ic { width: 1.1em; height: 1.1em; }
.est { flex-basis: 100%; font-size: .78rem; color: var(--warn); }
.tagline { display: inline-flex; align-items: center; gap: 4px; }
.tagline .heart { width: 13px; height: 13px; color: #e0245e; stroke-width: 0; }

/* =====================================================================
   Region "Konstanz": signal red to magenta, white solid surfaces, thin
   black pictograms, geometric type. Inspired by the city's public look,
   but clearly out&go (no third-party logos or names).
   ===================================================================== */
@font-face { font-family: "Rubik"; src: url("vendor/fonts/rubik-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("vendor/fonts/rubik-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("vendor/fonts/rubik-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

.tabs[hidden], .region-name:empty { display: none !important; }
.region-name { font: 700 1.05rem/1 var(--font-brand); letter-spacing: -0.02em; }

:root[data-region="konstanz"] {
  --kn-red: #e2001a; --kn-magenta: #c8105f;
  --accent: #e2001a; --accent-text: #ffffff; --accent-soft: #fde8eb;
  --bg: #f4f4f4; --surface: #ffffff; --text: #111111; --muted: #6b6b6b;
  --fill: #f1f1f1; --fill-strong: #e2e2e2; --separator: #e6e6e6;
  --glass: #ffffff; --glass-edge: transparent; --glass-shadow: 0 2px 14px rgb(0 0 0 / 10%);
  --thumb: #e2001a;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-brand: "Rubik", system-ui, sans-serif;
  --ship: #0074b8;
}
@media (prefers-color-scheme: dark) {
  :root[data-region="konstanz"]:not([data-theme="light"]) {
    --accent: #ff3d55; --accent-soft: #3a1219; --bg: #101010; --surface: #1b1b1b; --text: #f2f2f2; --muted: #a3a3a3;
    --fill: #262626; --fill-strong: #333333; --separator: #2c2c2c; --glass: #1b1b1b; --thumb: #e2001a;
  }
}
:root[data-region="konstanz"][data-theme="dark"] {
  --accent: #ff3d55; --accent-soft: #3a1219; --bg: #101010; --surface: #1b1b1b; --text: #f2f2f2; --muted: #a3a3a3;
  --fill: #262626; --fill-strong: #333333; --separator: #2c2c2c; --glass: #1b1b1b; --thumb: #e2001a;
}

/* Header: red-to-magenta band with a soft curved lower edge, white type. */
[data-region="konstanz"] .top {
  background: linear-gradient(105deg, var(--kn-red) 0%, #e0063a 45%, var(--kn-magenta) 100%);
  color: #fff; box-shadow: 0 6px 20px rgb(200 16 95 / 25%); -webkit-backdrop-filter: none; backdrop-filter: none;
  overflow: hidden;
}
[data-region="konstanz"] .top::before {
  content: ""; position: absolute; inset: -60% -10% auto auto; width: 70%; height: 220%; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 255 255 / 14%), transparent); pointer-events: none;
}
[data-region="konstanz"] .brand, [data-region="konstanz"] .wordmark, [data-region="konstanz"] .tagline { color: #fff; }
[data-region="konstanz"] .wordmark .amp { color: #ffd1d8; }
[data-region="konstanz"] .tagline .heart { color: #fff; }
[data-region="konstanz"] .beta-badge { background: #fff; color: var(--kn-red); }
[data-region="konstanz"] .pill-select select { background: rgb(255 255 255 / 20%); color: #fff; }
[data-region="konstanz"] .pill-select option { color: #111; }

/* Panel: solid white sidebar like a city portal, square on the map side. */
@media (min-width: 861px) {
  [data-region="konstanz"] .top { top: 0; left: 0; width: 420px; border-radius: 0; padding: 18px 20px 26px;
    border-bottom-right-radius: 48px 40px; justify-content: space-between; }
  [data-region="konstanz"] .panel { top: 76px; left: 0; bottom: 0; width: 420px; border-radius: 0; box-shadow: 4px 0 18px rgb(0 0 0 / 8%); padding-top: 18px; }
  [data-region="konstanz"] .leaflet-top.leaflet-right { top: 12px; }
}
@media (max-width: 860px) {
  [data-region="konstanz"] .top { top: 0; left: 0; right: 0; border-radius: 0 0 26px 26px; padding-top: calc(env(safe-area-inset-top, 0px) + 10px); }
  [data-region="konstanz"] .panel { top: calc(env(safe-area-inset-top, 0px) + 76px); }
}

/* Thin black pictograms with dividers instead of coloured tiles. */
[data-region="konstanz"] .row-icon { background: none; color: var(--text); width: 34px; height: 34px; }
[data-region="konstanz"] .row-icon .ic { width: 26px; height: 26px; stroke-width: 1.4; }
[data-region="konstanz"] .list-group { border-radius: 10px; box-shadow: 0 1px 6px rgb(0 0 0 / 6%); }
[data-region="konstanz"] .list-group .list-row + .list-row::before,
[data-region="konstanz"] .list-group .list-rows + .passes > .list-row::before,
[data-region="konstanz"] .list-group .passes + .list-row::before { left: 58px; border-top: 1px solid var(--separator); }
[data-region="konstanz"] .row-label { font-weight: 500; }

/* Headings and labels: bold, black, no caps-tracking. */
[data-region="konstanz"] legend, [data-region="konstanz"] .field > span:first-child, [data-region="konstanz"] .options-title,
[data-region="konstanz"] .notices-title {
  text-transform: none; letter-spacing: 0; font-size: .95rem; font-weight: 700; color: var(--text);
}
[data-region="konstanz"] .summary-time { font-weight: 700; }

/* Controls in signal red. */
[data-region="konstanz"] .seg label:has(input:checked), [data-region="konstanz"] .seg button[aria-selected="true"] { color: #fff; }
[data-region="konstanz"] .seg label:has(input:checked) .ic { color: #fff !important; }
[data-region="konstanz"] .primary { border-radius: 8px; font-weight: 700; letter-spacing: .01em;
  background: linear-gradient(105deg, var(--kn-red), var(--kn-magenta)); }
[data-region="konstanz"] .field input, [data-region="konstanz"] .field select { border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--fill-strong); }
[data-region="konstanz"] .field input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
[data-region="konstanz"] .stepper { background: var(--surface); box-shadow: inset 0 0 0 1px var(--fill-strong); }
[data-region="konstanz"] .card { border-radius: 10px; box-shadow: 0 1px 8px rgb(0 0 0 / 8%); }
[data-region="konstanz"] .option.is-selected { background: var(--accent-soft); }
[data-region="konstanz"] .tag { border-radius: 4px; }
[data-region="konstanz"] .option.is-selected .tag { background: var(--accent); }
[data-region="konstanz"] .switch:checked { background: var(--accent); }
[data-region="konstanz"] .link, [data-region="konstanz"] .disclaimer a, [data-region="konstanz"] .legal a { color: var(--accent); }
[data-region="konstanz"] .map-toggle[aria-pressed="true"] { color: var(--accent); }

/* The header stays calm: tagline moves to the panel footer. */
.foot-made { display: none; }
[data-region="konstanz"] .top .tagline { display: none; }
[data-region="konstanz"] .foot-made { display: block; margin: 10px 0 4px; font-weight: 500; color: var(--text); }
[data-region="konstanz"] .foot-made .heart { width: 14px; height: 14px; vertical-align: -2px; color: var(--kn-red); }
[data-region="konstanz"] .region-name { font-weight: 500; opacity: .95; padding-left: 10px; border-left: 1.5px solid rgb(255 255 255 / 55%); }

/* ---------- My location, quick picks, departures ---------- */
.input-wrap { position: relative; display: block; }
.input-wrap input { padding-right: 46px; }
.locate {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
  border: 0; border-radius: 10px; background: none; color: var(--accent); display: grid; place-items: center; cursor: pointer;
}
.locate .ic { width: 22px; height: 22px; }
.locate.busy .ic { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.quick { display: flex; flex-direction: column; gap: 8px; }
.quick[hidden] { display: none; }
.quick-title { margin: 0; padding: 0 4px; font-weight: 700; font-size: .95rem; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px 4px; }
.chip-row:empty { display: none; }
.chip-row::-webkit-scrollbar { display: none; }
.qchip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border: 0; border-radius: 999px;
  background: var(--fill); color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap;
}
.qchip .ic { width: 18px; height: 18px; color: var(--accent); }
.qchip small { color: var(--muted); font-weight: 500; }
.qchip.is-on { background: var(--accent); color: var(--accent-text); }
#quick-row { flex-wrap: wrap; overflow: visible; }
.qchip.is-on small { color: inherit; opacity: .8; }

.dep-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.dep-actions .secondary { display: inline-flex; align-items: center; gap: 6px; padding: 12px 14px; }
.dep-actions .secondary .ic { width: 18px; height: 18px; }
.dep-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.15rem; }
.dep-title .ic { width: 22px; height: 22px; color: var(--accent); }
.dep-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dep-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--separator); }
.dep-row:first-child { border-top: 0; }
.dep-line {
  min-width: 44px; padding: 5px 6px; border-radius: 7px; text-align: center; font-weight: 700; font-size: .95rem;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.dep-dest { display: flex; flex-direction: column; min-width: 0; }
.dep-head { font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.25; }
.dep-dest small, .dep-time small { color: var(--muted); font-size: .8rem; display: inline-flex; align-items: center; gap: 4px; }
.dep-dest small .ic { width: 14px; height: 14px; }
.dep-time { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-variant-numeric: tabular-nums; }
.dep-time b { font-size: 1rem; }
.dep-time b.soon { color: var(--accent); }
.dep-late { color: var(--error); font-weight: 700; }
.dep-rt { width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: inline-block; }
.dep-row.is-cancelled .dep-head, .dep-row.is-cancelled .dep-time small { text-decoration: line-through; opacity: .6; }
.dep-row.is-cancelled .dep-time b { color: var(--error); }
.dep-stamp { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.skeleton { height: 220px; background: linear-gradient(100deg, var(--fill) 30%, var(--surface) 50%, var(--fill) 70%) 0 0 / 300% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* Konstanz: calm grey base map, so lines, stops and the red accent stand out. */
:root[data-region="konstanz"] { --tile-filter: grayscale(1) brightness(1.04) contrast(.92); }
@media (prefers-color-scheme: dark) {
  :root[data-region="konstanz"]:not([data-theme="light"]) { --tile-filter: grayscale(1) invert(1) brightness(.88) contrast(.85); }
}
:root[data-region="konstanz"][data-theme="dark"] { --tile-filter: grayscale(1) invert(1) brightness(.88) contrast(.85); }
[data-region="konstanz"] .qchip { background: var(--surface); box-shadow: inset 0 0 0 1px var(--fill-strong); border-radius: 8px; }
[data-region="konstanz"] .qchip.is-on { background: var(--accent); box-shadow: none; }
[data-region="konstanz"] .dep-actions .secondary { border-radius: 8px; }

/* "Wer reist mit?" folds into one line; open it to change the group. */
.party > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 0 4px; margin-bottom: 6px; }
.party > summary::-webkit-details-marker { display: none; }
.party-title { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; flex: none; }
.party-sum { margin-left: auto; color: var(--muted); font-size: .85rem; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party .chev { width: 16px; height: 16px; flex: none; color: var(--muted); transition: transform 300ms var(--spring); }
.party[open] .chev { transform: rotate(180deg); }
.party[open] .party-sum { display: none; }
[data-region="konstanz"] .party-title { text-transform: none; letter-spacing: 0; font-size: .95rem; font-weight: 700; color: var(--text); }
[data-region="konstanz"] .party:not([open]) > summary {
  margin: 0; padding: 13px 14px; border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--fill-strong);
}
[data-region="konstanz"] .party-sum { color: var(--text); font-weight: 500; font-size: .9rem; }

/* Delays: big and red, timetable time struck through underneath. */
.leg-times .is-late { color: var(--error); font-weight: 700; display: flex; flex-direction: column; line-height: 1.15; }
.leg-times .is-late s { color: var(--muted); font-weight: 500; font-size: .78rem; }
.late-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; background: var(--error); color: #fff; font-weight: 700; font-size: .85rem; }
.dep-late { display: inline-block; padding: 1px 6px; border-radius: 5px; background: var(--error); color: #fff; font-size: .82rem; font-weight: 700; }
.option-late { color: var(--error); font-weight: 700; font-size: .9em; }
.dep-sep { list-style: none; padding: 10px 0 4px; border-top: 1px solid var(--separator); color: var(--muted); font-weight: 700; font-size: .82rem; }
.dep-sep::first-letter { text-transform: uppercase; }
.dep-sep + .dep-row { border-top: 0; }
button.dep-line { border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: .95rem; }
.dep-filter { align-self: flex-start; }

/* Car parks: a pill with the number of free spaces, coloured by how full it is. */
.pk-wrap { background: none; border: 0; }
.pk {
  display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px 3px 4px; border-radius: 8px; white-space: nowrap;
  background: #fff; color: #fff; font: 700 .8rem/1 var(--font); box-shadow: 0 1px 4px rgb(0 0 0 / 30%); border: 2px solid #fff;
}
.pk .ic { width: 16px; height: 16px; }
.pk-free { background: #1f8a4c; } .pk-tight { background: #e08a00; } .pk-full { background: #c0261b; } .pk-unknown { background: #7a7a7a; }
.pk-popup { min-width: 210px; }
.pk-popup .pk-count { font-weight: 800; font-size: 1.15rem; background: none; }
.pk-count.pk-free { color: #1f8a4c; } .pk-count.pk-tight { color: #c47800; } .pk-count.pk-full { color: #c0261b; }
.pk-hours { font-size: .8rem; color: var(--muted); }
.zoom-far .pk b { display: none; }
.field input.flash { box-shadow: 0 0 0 3px var(--accent) !important; transition: box-shadow 200ms; }
.pk.bk { border-radius: 999px; padding: 2px 7px 2px 4px; }
.pk.bk .ic { width: 15px; height: 15px; }

/* Line menu on the departures board and the run of one bus. */
.dep-row { position: relative; cursor: pointer; }
.dep-menu {
  position: absolute; z-index: 5; left: 0; top: calc(100% - 6px); display: flex; flex-direction: column; min-width: 220px;
  background: var(--surface); border-radius: 10px; box-shadow: 0 6px 24px rgb(0 0 0 / 18%), 0 0 0 1px var(--separator); overflow: hidden;
}
.dep-menu button { border: 0; background: none; text-align: left; padding: 12px 14px; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.dep-menu button + button { border-top: 1px solid var(--separator); }
.dep-menu button:hover, .dep-menu button:focus-visible { background: var(--fill); }
.trip-back { align-self: flex-start; }
.trip-card .dep-title .dep-line { min-width: 40px; }
.trip-stops { list-style: none; margin: 0; padding: 0; }
.trip-stop { display: grid; grid-template-columns: 74px 18px 1fr; align-items: center; min-height: 38px; position: relative; }
.trip-stop::before { content: ""; position: absolute; left: 82px; top: 0; bottom: 0; width: 4px; background: var(--c); }
.trip-stop:first-child::before { top: 50%; } .trip-stop:last-child::before { bottom: 50%; }
.trip-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c); position: relative; z-index: 1; margin-left: 0; }
.trip-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .9rem; display: flex; flex-direction: column; line-height: 1.1; }
.trip-time .dep-late { align-self: flex-start; font-size: .7rem; padding: 0 4px; margin-top: 2px; }
.trip-name { border: 0; background: none; padding: 6px 4px 6px 8px; text-align: left; font: inherit; font-weight: 500; color: var(--text); cursor: pointer; }
.trip-name:hover { color: var(--accent); }
.trip-stop.is-past { opacity: .45; }
.trip-stop.is-here .trip-name { font-weight: 800; }
.trip-stop.is-here .trip-dot { width: 16px; height: 16px; background: var(--accent); border-color: #fff; box-shadow: 0 0 0 2px var(--accent); margin-left: -2px; }
.trip-stop.is-here { opacity: 1; }

/* Line badge in a journey: tap to see the vehicle's whole run. */
button.line-badge { border: 0; font: inherit; cursor: pointer; }
.badge-more { font-weight: 800; margin-left: 1px; display: inline-block; transition: transform 200ms; }
button.line-badge[aria-expanded="true"] .badge-more { transform: rotate(90deg); }
.leg-run { margin: 6px 0 4px; padding: 10px 10px 4px; border-radius: 10px; background: var(--fill); }
.leg-run[hidden] { display: none; }
.leg-run-title { margin: 0 0 6px; font-weight: 700; font-size: .85rem; }
.leg-run-skel { height: 160px; border-radius: 8px; }
.trip-stop.is-off-ride { opacity: .45; }
.trip-stop.is-off-ride::before { opacity: .5; }
.trip-stop::before { left: 81px; }
.trip-name { min-width: 0; overflow-wrap: anywhere; }
.leg-run .trip-stop { grid-template-columns: 48px 18px minmax(0, 1fr); }
.leg-run .trip-stop::before { left: 55px; }
.leg-run .trip-time { font-size: .82rem; }
/* Phones: the map toggles are icon-only, so four of them do not cover the map. */
@media (max-width: 860px) {
  .map-toggle span { display: none; }
  .map-toggle { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }
  .map-toggle .ic { width: 19px; height: 19px; }
  .map-toggle[aria-pressed="false"] { opacity: .75; }
}

/* "Wo bin ich?" under the zoom buttons. */
.map-here {
  width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--glass, #fff); color: #1a73e8;
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 5px rgb(0 0 0 / 20%);
}
.map-here .ic { width: 20px; height: 20px; }
.map-here.busy .ic { animation: pulse 1s ease-in-out infinite; }

/* Stops: a small sign per platform, platform number inside; names from zoom 17. */
.stop-wrap { background: none; border: 0; }
.stop-pin {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: #fff; color: #1d6b3a;
  border: 2px solid #1d6b3a; font: 800 .68rem/1 var(--font); box-shadow: 0 1px 3px rgb(0 0 0 / 25%);
}
[data-region="konstanz"] .stop-pin { color: var(--kn-red); border-color: var(--kn-red); }
.stop-label { background: rgb(255 255 255 / 88%); border: 0; box-shadow: none; padding: 1px 5px; font-weight: 600; font-size: .72rem; color: #222; }
.stop-label::before { display: none; }
.sc-group { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; color: #fff; font: 800 .7rem/1 var(--font); box-shadow: 0 1px 3px rgb(0 0 0 / 30%); }
.option-wait { color: var(--muted); }

/* My places: home, work and recent searches. */
.quick-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fav-edit { font-size: .85rem; }
.fav-edit[hidden] { display: none; }
.qchip.fav-empty { color: var(--muted); box-shadow: inset 0 0 0 1px var(--fill-strong); background: transparent; border: 1px dashed var(--fill-strong); }
.qchip.fav-empty .ic { color: var(--muted); }
.qchip.editing { box-shadow: inset 0 0 0 1.5px var(--accent); }
.fav-x { color: var(--accent); font-size: 1rem; margin-left: 2px; }
#mine-row { flex-wrap: wrap; overflow: visible; }

/* Watermark on the map (bottom left), visible in screenshots. */
.map-mark {
  pointer-events: none; font: 800 1.05rem/1 var(--font-brand, var(--font)); letter-spacing: -0.03em; color: #111;
  background: rgb(255 255 255 / 78%); padding: 5px 9px; border-radius: 9px; box-shadow: 0 1px 4px rgb(0 0 0 / 12%);
}
.map-mark span { color: var(--accent); }
.map-mark small { font-weight: 600; font-size: .7rem; letter-spacing: 0; color: #555; margin-left: 2px; }
