:root {
  --green: #0b6e4f;
  --green-2: #15a36f;
  --walk: #2563eb;
  --bike: #0b6e4f;
  --ebike: #7c3aed;
  --share: #e11d48;
  --ink: #111827;
  --muted: #5b6472;
  --bg: #ffffff;
  --soft: #f2f5f4;
  --line: #e3e7ea;
  --radius: 18px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #eef2f5; --muted: #a2adb8; --bg: #14181c; --soft: #1d2328; --line: #2a3238; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--green-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

#map { position: fixed; inset: 0; }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px;
  padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); text-decoration: none;
  box-shadow: 0 2px 8px rgb(0 0 0 / .12);
}
.pill[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.topright { position: fixed; top: calc(env(safe-area-inset-top) + 10px); right: 10px; display: flex; gap: 8px; z-index: 5; }
.topright select { min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); padding: 0 10px; box-shadow: 0 2px 8px rgb(0 0 0 / .12); }

/* bottom sheet */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; max-height: 62vh; overflow-y: auto;
  background: var(--bg); border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 -4px 24px rgb(0 0 0 / .18);
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 12px);
}
@media (min-width: 900px) {
  .sheet { top: 12px; bottom: 12px; left: 12px; right: auto; width: 400px; max-height: none; border-radius: var(--radius); }
}
.grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.search { position: relative; display: grid; gap: 8px; }
.field { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 14px; padding: 4px 6px 4px 14px; }
.field input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 0; font-size: 17px; }
.field input:focus { outline: none; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot.from { background: var(--walk); }
.dot.to { background: var(--share); }
.icon { border: 0; background: transparent; min-width: 44px; min-height: 44px; font-size: 20px; border-radius: 12px; }
.go { min-height: 50px; border: 0; border-radius: 14px; background: var(--green); color: #fff; font-weight: 700; font-size: 17px; }
.suggestions { position: absolute; z-index: 3; left: 0; right: 0; top: 112px; margin: 0; padding: 6px; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgb(0 0 0 / .18); }
.suggestions li { padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.suggestions li:hover, .suggestions li[aria-selected="true"] { background: var(--soft); }
.suggestions small { display: block; color: var(--muted); }
.status { color: var(--muted); min-height: 22px; margin: 8px 0; }

/* trip options */
.options { display: grid; gap: 8px; }
.option {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; text-align: left;
  border: 2px solid var(--line); background: var(--bg); border-radius: 14px; padding: 10px 12px;
}
.option.on { border-color: var(--green); background: var(--soft); }
.option .em { font-size: 26px; text-align: center; }
.option b { display: block; }
.option small { color: var(--muted); }
.option .mins { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.option .mins small { font-size: 13px; font-weight: 500; }
.unavail { color: var(--muted); font-size: 14px; margin: 6px 2px; }

/* details */
.card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 10px 0; }
.legs { list-style: none; margin: 0; padding: 0; }
.legs li { display: flex; gap: 10px; padding: 6px 0; }
.legs .bar { width: 6px; border-radius: 3px; flex: none; }
.steps { list-style: none; margin: 6px 0 0; padding: 0; max-height: 40vh; overflow-y: auto; }
.steps li { display: grid; grid-template-columns: 32px 1fr auto; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); align-items: center; }
.steps li:first-child { border-top: 0; }
.steps .arrow { font-size: 20px; text-align: center; }
.steps .d { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.big { min-height: 50px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--green); color: #fff; font-weight: 700; }
.elev { width: 100%; height: 70px; display: block; }
.elev path.fill { fill: color-mix(in srgb, var(--green-2) 25%, transparent); }
.elev path.line { fill: none; stroke: var(--green-2); stroke-width: 2; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.quick { margin-top: 10px; }
.dep { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.dep:first-child { border-top: 0; }
.line-badge { font-weight: 800; background: var(--green); color: #fff; border-radius: 6px; padding: 0 6px; }
.late { color: #dc2626; font-weight: 700; }

/* live guidance banner */
.guide {
  position: fixed; z-index: 7; top: calc(env(safe-area-inset-top) + 10px); left: 10px; right: 10px; max-width: 560px;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--green); color: #fff;
  box-shadow: 0 6px 20px rgb(0 0 0 / .25);
}
.guide-arrow { font-size: 36px; line-height: 1; width: 44px; text-align: center; }
.guide-text { flex: 1; display: flex; flex-direction: column; }
.guide-text b { font-size: 24px; }
.guide .pill { background: rgb(255 255 255 / .15); color: #fff; border-color: transparent; box-shadow: none; }
.maplibregl-popup-content { color: #111; border-radius: 12px; }

/* ---------- v2: destination-first, personalised, comfort mode ---------- */
html.large { font-size: 19px; }
html.large .pill, html.large .icon, html.large .go, html.large .big, html.large .chip-btn { min-height: 56px; min-width: 56px; }
html.large .where input { font-size: 21px; }
.where { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 16px; padding: 4px 14px; border: 2px solid transparent; }
.where:focus-within { border-color: var(--green-2); }
.where input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 13px 0; font-size: 18px; font-weight: 600; }
.where input:focus { outline: none; }
.fromrow { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; padding: 2px 4px; flex-wrap: wrap; }
.fromrow input { flex: 1; min-width: 140px; border: 1px solid var(--line); background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.link { border: 0; background: transparent; color: var(--green-2); font-weight: 700; padding: 8px 4px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.recents { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; }
.recents:empty { display: none; }
.chip-btn { white-space: nowrap; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 0 14px; min-height: 44px; }
.suggestions { top: 64px; }

/* setup (2 questions) */
.setup { border: 2px solid var(--green-2); border-radius: 16px; padding: 14px; margin-bottom: 12px; background: var(--soft); }
.setup h2 { font-size: 18px; margin: 0 0 4px; }
.setup p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.setup .choices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.setup .chip-btn[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.setup .row { justify-content: space-between; }

/* results */
.best { border: 2px solid var(--green); border-radius: 18px; padding: 14px; background: var(--soft); }
.best .tag { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: #fff; background: var(--green); padding: 2px 8px; border-radius: 6px; }
.best .head { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px; margin-top: 8px; }
.best .em { font-size: 34px; text-align: center; }
.best .title { font-size: 19px; font-weight: 800; display: block; }
.best .why { color: var(--green-2); font-weight: 700; font-size: 14px; }
.best .mins { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; }
.best .mins small { font-size: 15px; font-weight: 600; }
.best .meta { color: var(--muted); font-size: 14px; margin-top: 6px; }
.more { margin-top: 10px; }
.more > summary { cursor: pointer; padding: 10px 2px; font-weight: 700; min-height: 44px; }
.alt { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px; margin: 6px 0; min-height: 52px; }
.alt .em { font-size: 22px; text-align: center; }
.alt b { font-variant-numeric: tabular-nums; }
.note { font-size: 14px; color: var(--muted); margin: 6px 2px; }
.actionbar { position: sticky; bottom: calc(-1 * env(safe-area-inset-bottom) - 12px); display: flex; gap: 8px; padding: 10px 0 calc(env(safe-area-inset-bottom) + 12px); margin: 8px -16px -12px; padding-left: 16px; padding-right: 16px; background: var(--bg); border-top: 1px solid var(--line); }
.actionbar .big { flex: 1; font-size: 18px; }

/* ---------- v3: public transport lines and parking ---------- */
.transit { margin-top: 8px; }
.transit .tline { font-weight: 700; }
.transit .board { margin-top: 6px; font-weight: 700; }
.transit .countdown { margin-top: 4px; font-size: 18px; font-variant-numeric: tabular-nums; }
.transit .countdown s { color: var(--muted); font-size: 14px; }
.sub > summary { cursor: pointer; padding: 11px 2px; font-weight: 700; min-height: 44px; }
.dep small { font-weight: 400; }
.stop-pin { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; background: #f59e0b; color: #111; font: 800 13px/30px system-ui, sans-serif; text-align: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .3); }
.parking b { display: block; margin-bottom: 4px; }
.pk { min-width: 40px; text-align: center; font-weight: 800; color: #fff; border-radius: 6px; padding: 0 6px; align-self: start; font-variant-numeric: tabular-nums; }
.pk.ok, .pk.low { background: var(--parking); } .pk.bad, .pk.unknown { background: #6b7280; }

/* map markers: blue = parking, red = Vel'OH! */
:root { --parking: #1d4ed8; --veloh: #e11d48; }
.poi { display: inline-flex; align-items: center; gap: 2px; min-height: 26px; padding: 0 7px; border-radius: 13px; border: 2px solid #fff; color: #fff; font: 800 12px/1 system-ui, sans-serif; white-space: nowrap; box-shadow: 0 2px 6px rgb(0 0 0 / .3); cursor: pointer; }
.poi.parking { background: var(--parking); border-radius: 6px; }
.poi.veloh { background: var(--veloh); }
.poi.dim { opacity: .55; }
.legend { position: fixed; z-index: 5; right: 10px; bottom: calc(env(safe-area-inset-bottom) + 40px); display: grid; gap: 6px; padding: 8px 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 2px 8px rgb(0 0 0 / .15); font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend .poi { min-height: 22px; cursor: default; box-shadow: none; }
@media (max-width: 899px) {
  .legend { top: calc(env(safe-area-inset-top) + 62px); bottom: auto; grid-auto-flow: column; gap: 10px; padding: 5px 8px; font-size: 12px; }
  .legend .lg-detail { display: none; }
}

/* voice */
.mic[aria-pressed="true"] { background: var(--share); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.best .link { margin-top: 6px; }

/* ---------- v4: mode buttons, platform first, navigation ---------- */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 6px; margin-bottom: 10px; }
.mode { position: relative; display: grid; justify-items: center; gap: 1px; padding: 8px 4px 6px; min-height: 64px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); }
.mode .mi { font-size: 22px; line-height: 1; }
.mode b { font-size: 17px; font-variant-numeric: tabular-nums; }
.mode small { font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode[aria-checked="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--bg)); box-shadow: inset 0 -4px 0 var(--c); }
.mode .star { position: absolute; top: 2px; right: 6px; color: #f59e0b; font-size: 14px; }
.best { border-color: var(--c, var(--green)); }
.best .tag { background: var(--c, var(--green)); }

.platform-row { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; padding: 8px; border-radius: 12px; background: var(--bg); border: 2px solid var(--line); }
.platform-row.changed { border-color: #dc2626; }
.plat-box { display: grid; justify-items: center; min-width: 64px; padding: 4px 8px; border-radius: 10px; background: #111827; color: #fff; font-size: 30px; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.plat-box small { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; opacity: .85; }
.platform-row b { display: block; }
.stop-pin { display: grid; justify-items: center; height: auto; line-height: 1.2; padding: 3px 8px; color: #fff; border-radius: 10px; }
.pin-plat { font-size: 11px; font-weight: 800; background: #111827; border-radius: 6px; padding: 0 5px; margin-top: 2px; }
.alight-pin { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 4px solid; display: grid; place-items: center; font-size: 12px; color: #111; }
.swatch { display: inline-block; width: 22px; height: 6px; border-radius: 3px; background: var(--c); }
.swatch.dash { background: repeating-linear-gradient(90deg, var(--c) 0 4px, transparent 4px 8px); }

/* navigation mode: the map is the screen */
body.navigating .sheet, body.navigating .topright, body.navigating .legend, body.navigating .maplibregl-ctrl-top-left { display: none !important; }
.nav { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
.nav > * { pointer-events: auto; }
.nav-top { position: absolute; top: calc(env(safe-area-inset-top) + 10px); left: 10px; right: 10px; max-width: 560px; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--green); color: #fff; box-shadow: 0 6px 20px rgb(0 0 0 / .3); }
.nav-arrow { font-size: 44px; line-height: 1; min-width: 52px; text-align: center; }
.nav-main { display: flex; flex-direction: column; min-width: 0; }
.nav-main b { font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.nav-main span { font-size: 19px; font-weight: 600; }
.nav-then { position: absolute; top: calc(env(safe-area-inset-top) + 104px); left: 22px; max-width: 520px; padding: 6px 12px; border-radius: 0 0 12px 12px; background: #111827; color: #fff; font-weight: 600; }
.nav-platform { position: absolute; top: calc(env(safe-area-inset-top) + 142px); left: 10px; right: 10px; max-width: 560px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--bg); border: 3px solid #111827; box-shadow: 0 4px 14px rgb(0 0 0 / .2); }
.nav-platform.changed { border-color: #dc2626; animation: pulse 1s ease-in-out infinite; }
.nav-platform .plat-text { display: flex; flex-direction: column; }
.nav-transit { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 92px); left: 10px; right: 10px; max-width: 560px; padding: 10px 14px; border-radius: 14px; font-weight: 700; color: #fff; background: #15803d; }
.nav-transit.hurry { background: #d97706; }
.nav-transit.missed { background: #dc2626; }
.nav-recentre { position: absolute; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 150px); min-height: 48px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--bg); color: var(--ink); font-weight: 700; box-shadow: 0 2px 10px rgb(0 0 0 / .25); }
.nav-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px); background: var(--bg); border-radius: 18px 18px 0 0; box-shadow: 0 -4px 20px rgb(0 0 0 / .2); }
.nav-eta { flex: 1; display: flex; flex-direction: column; align-items: center; }
.nav-eta b { font-size: 22px; color: var(--green-2); }
.nav-eta span { color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-btn { min-width: 56px; min-height: 56px; border-radius: 50%; border: 1px solid var(--line); background: var(--soft); font-size: 22px; }
.me-arrow { width: 26px; height: 26px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 6px rgb(37 99 235 / .25); position: relative; }
.me-arrow::after { content: ""; position: absolute; left: 50%; top: -12px; transform: translateX(-50%); border: 7px solid transparent; border-bottom: 11px solid #2563eb; }
@media (min-width: 900px) { .nav-top, .nav-platform, .nav-transit { left: 24px; right: auto; width: 520px; } .nav-bottom { left: 24px; right: auto; width: 520px; bottom: 16px; border-radius: 18px; } }
.priorities { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; }
.priorities .chip-btn { font-size: 14px; min-height: 40px; }
.priorities .chip-btn[aria-checked="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- safety: SOS, emergency screen, trail mode ---------- */
.sos { position: fixed; z-index: 30; top: calc(env(safe-area-inset-top) + 10px); left: 10px; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: #dc2626; color: #fff; font: 900 22px/1 system-ui, sans-serif; letter-spacing: 1px; text-decoration: none; border: 4px solid #fff; box-shadow: 0 0 0 4px #dc2626, 0 6px 18px rgb(220 38 38 / .55); }
.sos:active { transform: scale(.95); }
.maplibregl-ctrl-top-left { top: 92px; }
@media (min-width: 900px) { .sos { left: 424px; } }
body.navigating .sos { top: auto; bottom: calc(env(safe-area-inset-bottom) + 168px); left: 12px; }
@media (min-width: 900px) { body.navigating .sos { left: 560px; bottom: 24px; } }

.sos-panel { position: fixed; inset: 0; z-index: 40; overflow-y: auto; background: #b91c1c; color: #fff; padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 16px); }
.sos-inner { max-width: 520px; margin: 0 auto; display: grid; gap: 12px; }
.sos-inner h2 { margin: 0; font-size: 28px; }
.sos-call { display: grid; justify-items: center; padding: 16px; border-radius: 20px; background: #fff; color: #b91c1c; font: 900 48px/1 system-ui, sans-serif; text-decoration: none; }
.sos-call small { font-size: 16px; font-weight: 700; margin-top: 6px; }
.sos-where { display: grid; gap: 2px; padding: 14px; border-radius: 16px; background: rgb(0 0 0 / .25); }
.sos-where small { opacity: .9; }
.sos-coords { font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.sos-send, .sos-share { display: block; text-align: center; padding: 16px; border-radius: 16px; border: 0; background: #111827; color: #fff; font: 800 19px system-ui, sans-serif; text-decoration: none; }
.sos-share { background: rgb(255 255 255 / .18); font-size: 17px; }
.sos-hint { margin: 0; font-size: 15px; opacity: .95; }
.sos-contacts { background: rgb(0 0 0 / .18); border-radius: 14px; padding: 8px 12px; }
.sos-contacts summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.sos-contact { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px solid rgb(255 255 255 / .2); }
.sos-contact button, .sos-add button { min-height: 44px; min-width: 44px; border-radius: 10px; border: 0; background: #fff; color: #b91c1c; font-weight: 800; }
.sos-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin: 8px 0; }
.sos-add input { min-width: 0; min-height: 44px; border-radius: 10px; border: 0; padding: 0 10px; color: #111; }
.sos-close { min-height: 50px; border-radius: 14px; border: 2px solid #fff; background: transparent; color: #fff; font-weight: 800; }

.trail-bar { position: fixed; z-index: 25; left: 92px; right: 10px; top: calc(env(safe-area-inset-top) + 66px); display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 8px 12px; border-radius: 14px; background: #15803d; color: #fff; box-shadow: 0 4px 14px rgb(0 0 0 / .25); }
.trail-bar small { grid-column: 1; opacity: .9; font-size: 12px; }
.trail-bar button { grid-row: 1 / span 2; grid-column: 2; min-height: 44px; border-radius: 10px; border: 0; background: #fff; color: #15803d; font-weight: 800; padding: 0 14px; }
@media (min-width: 900px) { .trail-bar { left: 510px; right: auto; width: 440px; top: 12px; } }
#trail-toggle[aria-pressed="true"] { background: #15803d; color: #fff; border-color: #15803d; }

.trail-alarm { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: #b91c1c; color: #fff; padding: 16px; animation: flash 1s steps(2) infinite; }
.trail-alarm * { color: #fff; }
/* Flashes between two dark reds so white text always reads. */
@keyframes flash { 50% { background: #7f1d1d; } }
.alarm-inner { max-width: 480px; width: 100%; display: grid; gap: 12px; text-align: center; }
.alarm-inner h2 { font-size: 40px; margin: 0; }
.alarm-count { font-size: 96px; line-height: 1; font-variant-numeric: tabular-nums; }
.alarm-ok { min-height: 96px; border-radius: 24px; border: 4px solid #fff; background: #15803d; color: #fff; font: 900 32px system-ui, sans-serif; }
.alarm-help { display: block; padding: 18px; border-radius: 18px; background: #111827; color: #fff; font: 800 20px system-ui, sans-serif; text-decoration: none; }

/* map layers: labelled, so nobody has to guess what an icon means */
.layers { position: fixed; z-index: 5; right: 10px; top: calc(env(safe-area-inset-top) + 64px); display: grid; gap: 8px; justify-items: end; }
.layer { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg); font-weight: 700; box-shadow: 0 2px 8px rgb(0 0 0 / .15); }
.layer.veloh[aria-pressed="true"] { background: var(--veloh); border-color: var(--veloh); color: #fff; }
.layer.parking[aria-pressed="true"] { background: var(--parking); border-color: var(--parking); color: #fff; }
body.navigating .layers { display: none; }
@media (max-width: 899px) { .legend { top: calc(env(safe-area-inset-top) + 172px); } }

/* changes and alternatives */
.change { margin: 10px 0; padding: 8px 12px; border-radius: 12px; background: var(--bg); border: 2px dashed var(--line); font-weight: 700; }
.alts { margin-top: 8px; }
.alt-conn { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; padding: 10px; margin: 6px 0; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); min-height: 56px; }
.alt-conn[aria-pressed="true"] { border-color: var(--c, var(--green)); box-shadow: inset 0 -3px 0 var(--c, var(--green)); }
.alt-lines { font-weight: 800; font-size: 16px; }
.alt-meta { grid-column: 1; color: var(--muted); font-size: 13px; }
.alt-min { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 22px; font-variant-numeric: tabular-nums; }
.alt-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.alt-label { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--soft); color: var(--ink); }

/* accessibility badge */
.access { display: grid; gap: 2px; margin-top: 8px; padding: 8px 10px; border-radius: 12px; font-size: 14px; border: 2px solid; }
.access.good { border-color: #15803d; background: color-mix(in srgb, #15803d 12%, var(--bg)); }
.access.care { border-color: #d97706; background: color-mix(in srgb, #d97706 12%, var(--bg)); }
.access.no { border-color: #dc2626; background: color-mix(in srgb, #dc2626 12%, var(--bg)); }
.access span { color: var(--muted); }
.mode .warn { position: absolute; top: 2px; left: 6px; font-size: 13px; }
.stop-acc { display: block; font-size: 13px; font-weight: 700; margin-top: 2px; }
.stop-acc.ok { color: #15803d; } .stop-acc.bad { color: #dc2626; } .stop-acc.unknown { color: var(--muted); font-weight: 400; }
