/* Clippie web — same design system as the Android app.
   Layout: one phone-width column (max 640px) with a floating bottom tab bar; a two-pane list + map on wide screens for Nearby. */

@font-face { font-family: "Clippie Text"; src: url(fonts/regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Clippie Text"; src: url(fonts/semibold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Clippie Text"; src: url(fonts/bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Clippie Display"; src: url(fonts/display.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --bg: #F4F1EC; --surface: #FFFFFF; --surface2: #EFEBE4; --text: #16181D; --text2: #666A73; --text3: #9EA1A8;
  --line: #E5E0D7; --accent: #D9262E; --accent-soft: rgba(217,38,46,.10); --on-accent: #FFFFFF;
  --good: #168A55; --good-soft: rgba(22,138,85,.12); --warn: #A86F00; --warn-soft: rgba(227,155,18,.16); --bad-soft: rgba(217,38,46,.12);
  --skeleton: #E9E4DB; --nav: rgba(255,255,255,.94); --shadow: 0 1px 2px rgba(22,24,29,.06), 0 2px 8px rgba(22,24,29,.05);
  --shadow-float: 0 10px 30px rgba(22,24,29,.16), 0 2px 6px rgba(22,24,29,.08);
  --plate: #F7D117;
  --font: "Clippie Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Clippie Display", "Clippie Text", system-ui, sans-serif;
  --r-card: 20px; --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0F12; --surface: #181A1F; --surface2: #23262D; --text: #F3F1EC; --text2: #A2A7B1; --text3: #6C717B;
    --line: #2A2D34; --accent: #EF3B42; --accent-soft: rgba(239,59,66,.20); --on-accent: #FFFFFF;
    --good: #3CC685; --good-soft: rgba(60,198,133,.15); --warn: #F2B33D; --warn-soft: rgba(242,179,61,.15); --bad-soft: rgba(239,59,66,.18);
    --skeleton: #23262D; --nav: rgba(28,30,36,.95); --shadow: none; --shadow-float: 0 10px 30px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0F12; --surface: #181A1F; --surface2: #23262D; --text: #F3F1EC; --text2: #A2A7B1; --text3: #6C717B;
  --line: #2A2D34; --accent: #EF3B42; --accent-soft: rgba(239,59,66,.20); --on-accent: #FFFFFF;
  --good: #3CC685; --good-soft: rgba(60,198,133,.15); --warn: #F2B33D; --warn-soft: rgba(242,179,61,.15); --bad-soft: rgba(239,59,66,.18);
  --skeleton: #23262D; --nav: rgba(28,30,36,.95); --shadow: none; --shadow-float: 0 10px 30px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 400 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.page {
  padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--nav-h) + 40px);
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
  animation: pageIn .22s ease-out;
}
@keyframes pageIn { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tabbar {
  position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  width: min(608px, calc(100% - 32px)); height: var(--nav-h);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px;
  background: var(--nav); border-radius: 24px; box-shadow: var(--shadow-float);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
:root[data-theme="dark"] .tabbar { border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabbar { border: 1px solid var(--line); } }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 18px; color: var(--text2); font-size: 11px; font-weight: 600; }
.tab svg { width: 22px; height: 22px; fill: currentColor; }
.tab[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 700; }

/* ---------- headers ---------- */
.head { display: flex; align-items: flex-end; gap: 6px; padding: 12px 0 18px; }
.head .titles { flex: 1; min-width: 0; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.title { font: 800 32px/1.08 var(--display); letter-spacing: -.025em; margin: 0; text-wrap: balance; }
.label { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text2); padding: 18px 4px 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px;
  padding: calc(env(safe-area-inset-top, 0px) + 4px) max(8px, env(safe-area-inset-right, 0px)) 6px max(8px, env(safe-area-inset-left, 0px));
  margin: calc(-12px - env(safe-area-inset-top, 0px)) calc(-1 * max(20px, env(safe-area-inset-left, 0px))) 0;
  background: var(--bg); transition: box-shadow .2s;
}
.topbar.scrolled { box-shadow: 0 1px 0 var(--line); }
.topbar .bt { flex: 1; min-width: 0; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.topbar.scrolled .bt { opacity: 1; }

.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text); flex: none; }
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.icon-btn.filled { background: var(--surface); box-shadow: var(--shadow); }
.icon-btn:hover { background: var(--surface2); }
.icon-btn.on { color: var(--accent); }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); }
:root[data-theme="dark"] .card { box-shadow: inset 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card { box-shadow: inset 0 0 0 1px var(--line); } }
.list { display: flex; flex-direction: column; gap: 12px; }
.tap { cursor: pointer; transition: transform .08s ease, background-color .15s; }
.tap:active { transform: scale(.985); }

.stop-card { display: block; padding: 16px 12px 16px 16px; }
.stop-card .top { display: flex; gap: 12px; align-items: flex-start; }
.stop-card .mid { flex: 1; min-width: 0; padding-top: 1px; }
.stop-card .name { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-card .sub { color: var(--text2); font-size: 13.5px; margin-top: 4px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stop-card .dist { text-align: right; padding-right: 4px; }
.stop-card .dist b { font-size: 14px; display: block; }
.stop-card .dist span { font-size: 12px; font-weight: 600; color: var(--text3); display: inline-flex; gap: 2px; align-items: center; margin-top: 4px; }
.stop-card .dist svg { width: 13px; height: 13px; fill: currentColor; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 12px 0 0 56px; }
.chips::-webkit-scrollbar { display: none; }
.live { margin: 12px 0 0 56px; }
.live:empty { display: none; }

.badge { flex: none; width: 44px; height: 44px; border-radius: 13px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 800 21px/1 var(--display); }
.badge.l2 { font-size: 17px; } .badge.l3 { font-size: 13px; }
.badge svg { width: 52%; height: 52%; fill: currentColor; }
.badge.station { background: var(--text); color: var(--bg); }
.badge.big { width: 58px; height: 58px; border-radius: 17px; font-size: 28px; }
.badge.big.l2 { font-size: 22px; }

.chip { flex: none; font-size: 12px; font-weight: 700; padding: 3px 6px; min-width: 30px; text-align: center; border-radius: 6px; background: var(--surface2); }
.line-chip { flex: none; font-size: 12px; font-weight: 700; padding: 3px 7px; border-radius: 6px; color: #fff; white-space: nowrap; }
.line-chip.light { color: #111; }

.pill { display: inline-grid; place-items: center; min-width: 44px; padding: 5px 7px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font: 800 16px/1 var(--display); font-variant-numeric: tabular-nums; }

.live-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.live-row::-webkit-scrollbar { display: none; }
.live-chip { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border-radius: 10px; background: var(--surface2); font-size: 13px; font-weight: 700; }
.live-chip .pill { min-width: 32px; padding: 3px 5px; font-size: 12px; border-radius: 6px; }
.due { color: var(--accent); }
.muted { color: var(--text3); font-size: 12.5px; font-weight: 600; }
.train-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.train-line + .train-line { margin-top: 7px; }
.train-line .bar { width: 4px; height: 16px; border-radius: 2px; flex: none; }
.train-line .d { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.train-line .t { font-weight: 700; }

/* ---------- skeleton & messages ---------- */
.sk { background: var(--skeleton); border-radius: 20px; animation: pulse 1.5s ease-in-out infinite; }
.sk.inline { height: 26px; border-radius: 8px; }
@keyframes pulse { 50% { opacity: .45; } }
.msg { text-align: center; padding: 28px 24px 24px; }
.msg .ic { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.msg .ic.neutral { background: var(--surface2); color: var(--text2); }
.msg .ic svg { width: 28px; height: 28px; fill: currentColor; }
.msg h3 { font: 800 19px/1.2 var(--display); margin: 16px 0 0; text-wrap: balance; }
.msg p { color: var(--text2); margin: 8px auto 0; line-height: 1.45; max-width: 36ch; }
.btn { display: block; width: 100%; padding: 14px 20px; border-radius: 14px; font-weight: 700; font-size: 15px; text-align: center; background: var(--surface2); color: var(--text); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.msg .btn { margin-top: 20px; }
.btn + .btn { margin-top: 12px; }

/* ---------- stop page ---------- */
.stop-head { display: flex; gap: 14px; align-items: flex-start; }
.stop-head h2 { font: 800 26px/1.08 var(--display); letter-spacing: -.02em; margin: 2px 0 0; text-wrap: balance; }
.stop-head p { color: var(--text2); margin: 6px 0 0; font-size: 15px; line-height: 1.3; }
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 18px -20px 6px; padding: 0 20px; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; display: inline-flex; align-items: center; gap: 7px; min-width: 48px; justify-content: center; padding: 8px 14px; border-radius: 20px; font-weight: 700; font-size: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.filter[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; }
.filter .dot { width: 10px; height: 10px; border-radius: 50%; }

.hero { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-radius: 24px; background: var(--accent); color: #fff; box-shadow: 0 8px 22px rgba(217,38,46,.28); margin-top: 10px; width: 100%; text-align: left; }
.hero .l { flex: 1; min-width: 0; }
.hero .eb { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .82; }
.hero .r1 { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.hero .wp { min-width: 52px; padding: 6px 8px; border-radius: 9px; background: #fff; color: #D9262E; font: 800 18px/1 var(--display); text-align: center; }
.hero .dest { font-weight: 700; font-size: 17px; line-height: 1.25; }
.hero .hint { font-size: 12.5px; font-weight: 600; opacity: .82; margin-top: 10px; }
.hero .big { font: 800 50px/1 var(--display); letter-spacing: -.04em; text-align: right; font-variant-numeric: tabular-nums; }
.hero .big.due-t { font-size: 34px; }
.hero .unit { font-size: 12.5px; font-weight: 600; opacity: .82; text-align: right; margin-top: 2px; }

.rows { padding: 6px 0; }
.rrow { display: flex; align-items: center; gap: 14px; padding: 14px 16px; width: 100%; text-align: left; }
.rrow:hover { background: color-mix(in srgb, var(--surface2) 55%, transparent); }
.rrow + .rrow { border-top: 1px solid var(--line); margin-left: 0; }
.rrow .m { flex: 1; min-width: 0; }
.rrow .d { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .s { color: var(--text2); font-size: 13px; margin-top: 4px; }
.rrow .t { display: flex; align-items: baseline; gap: 2px; }
.rrow .t b { font: 800 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.rrow .t b.due { font-size: 19px; }
.rrow .t span { font-size: 12.5px; font-weight: 600; color: var(--text2); }
.rrow .lbar { width: 5px; height: 34px; border-radius: 3px; flex: none; }
.ldot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; margin-right: 6px; animation: pulse 1.8s infinite; align-self: center; }

.status-line { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; font-size: 12.5px; font-weight: 600; color: var(--text2); text-align: center; }
.status-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: pulse 1.8s infinite; flex: none; }

.route-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.route-tile { display: flex; align-items: center; justify-content: center; gap: 2px; padding: 10px 6px 10px 10px; border-radius: 14px; font: 800 15px/1 var(--display); }
.route-tile svg { width: 16px; height: 16px; fill: var(--text3); }

/* ---------- search ---------- */
.searchbox { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
:root[data-theme="dark"] .searchbox { box-shadow: inset 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .searchbox { box-shadow: inset 0 0 0 1px var(--line); } }
.searchbox svg { width: 22px; height: 22px; fill: var(--text2); flex: none; }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16.5px; font-weight: 600; padding: 12px 8px; }
.searchbox input::placeholder { color: var(--text3); }
.tips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tip { padding: 12px 14px; text-align: left; border-radius: 16px; }
.tip b { display: block; font-size: 15px; }
.tip span { font-size: 12px; color: var(--text2); display: block; margin-top: 4px; }
.lrow { display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 14px; width: 100%; text-align: left; }
.lrow + .lrow { border-top: 1px solid var(--line); }
.lrow:hover { background: color-mix(in srgb, var(--surface2) 55%, transparent); }
.lrow .m { flex: 1; min-width: 0; }
.lrow .m b { display: block; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .m span { display: block; font-size: 13px; color: var(--text2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .badge { width: 38px; height: 38px; border-radius: 11px; font-size: 18px; }
.lrow .badge.l2 { font-size: 15px; } .lrow .badge.l3 { font-size: 11px; }
.chev { width: 20px; height: 20px; fill: var(--text3); flex: none; }
.link-btn { font-size: 13px; font-weight: 700; color: var(--accent); padding: 18px 4px 10px; }

/* ---------- status ---------- */
.summary { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 22px; }
.summary .ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.summary .ic svg { width: 22px; height: 22px; fill: currentColor; }
.summary h3 { font: 800 17px/1.2 var(--display); margin: 0; }
.summary p { margin: 4px 0 0; font-size: 13px; color: var(--text2); }
.line { width: 100%; text-align: left; }
.line + .line { border-top: 1px solid var(--line); }
.line .lr { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.line .lbar { width: 8px; height: 30px; border-radius: 4px; flex: none; }
.line .nm { flex: 1; min-width: 0; font-weight: 700; font-size: 15.5px; }
.sev { font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 10px; max-width: 170px; text-align: right; }
.sev.g { color: var(--good); background: var(--good-soft); }
.sev.w { color: var(--warn); background: var(--warn-soft); }
.sev.b { color: var(--accent); background: var(--bad-soft); }
.line .reason { padding: 0 16px 14px 34px; color: var(--text2); font-size: 13.5px; line-height: 1.45; }

/* ---------- timelines (route & tracking) ---------- */
.tl { padding: 10px 12px; }
.tl-row { display: flex; align-items: center; min-height: 50px; width: 100%; text-align: left; border-radius: 12px; }
button.tl-row:hover { background: color-mix(in srgb, var(--surface2) 55%, transparent); }
.tl-rail { position: relative; width: 30px; align-self: stretch; flex: none; }
.tl-rail::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.tl-row:first-child .tl-rail::before { top: 50%; }
.tl-row:last-child .tl-rail::before { bottom: 50%; }
.tl-rail.after::before { background: var(--line); }
.tl-node { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.tl-node.end, .tl-node.mine { width: 16px; height: 16px; background: var(--accent); border: 0; }
.tl-node.after { border-color: var(--line); }
.tl-name { flex: 1; min-width: 0; padding: 10px 8px; font-weight: 600; font-size: 14.5px; }
.tl-name.end { font-weight: 700; font-size: 15.5px; }
.tl-name.after { color: var(--text3); }
.tl-time { width: 56px; text-align: right; flex: none; }
.tl-time b { display: block; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tl-time span { display: block; font-size: 11px; color: var(--text3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.your-stop { display: inline-block; margin-top: 5px; padding: 3px 7px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; }
.letter-tag { font: 800 11.5px/1 var(--display); color: var(--text2); background: var(--surface2); border-radius: 6px; padding: 4px 5px; min-width: 26px; text-align: center; }
.plate { display: inline-block; margin-top: 14px; padding: 5px 10px; border-radius: 5px; background: var(--plate); color: #111; font: 800 14px/1 var(--display); letter-spacing: .08em; box-shadow: inset 0 0 0 1px #111; }
.eta { display: flex; align-items: center; gap: 12px; padding: 18px 20px; }
.eta .l { flex: 1; min-width: 0; }
.eta .big { font: 800 44px/1 var(--display); text-align: right; font-variant-numeric: tabular-nums; }
.eta .big.due { font-size: 30px; }

.seg { display: flex; gap: 0; padding: 4px; border-radius: 14px; background: var(--surface2); }
.seg button { flex: 1; min-width: 0; padding: 10px; border-radius: 11px; font-size: 13.5px; font-weight: 700; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.notice { padding: 14px 16px; border-radius: 16px; display: flex; flex-direction: column; gap: 8px; }
.notice .h { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 15px; }
.notice .h svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.notice p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text); }

/* ---------- map ---------- */
.map { height: 220px; border-radius: 22px; overflow: hidden; background: var(--surface2); margin-top: 16px; isolation: isolate; }
.mapview { position: fixed; inset: 0; z-index: 40; background: var(--bg); }
.mapview .leaflet-container { position: absolute; inset: 0; background: var(--surface2); }
.mapview .mtop { position: absolute; z-index: 500; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 10px); display: flex; gap: 8px; align-items: center; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.mapview .mtop > * { pointer-events: auto; }
.mapview .mpill { padding: 12px 16px; border-radius: 22px; background: var(--surface); font-weight: 700; box-shadow: var(--shadow-float); }
.mapview .icon-btn { background: var(--surface); box-shadow: var(--shadow-float); }
.mapview .here { position: absolute; z-index: 500; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 74px); padding: 11px 18px; border-radius: 22px; background: var(--accent); color: #fff; font-weight: 700; box-shadow: var(--shadow-float); }
.mapview .mcard { position: absolute; z-index: 500; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(env(safe-area-inset-bottom, 0px) + var(--nav-h) + 24px); max-width: 608px; margin: 0 auto; }
.mapview .mcard .card { box-shadow: var(--shadow-float); }
.mk-stop { width: 30px; height: 30px; border-radius: 9px; background: #D9262E; color: #fff; font: 800 13px/26px var(--display); text-align: center; border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.3); transition: transform .15s; }
.mk-stop.st { background: #16181D; }
.mk-stop.sel { transform: scale(1.25); background: #16181D; }
.mk-me { width: 18px; height: 18px; border-radius: 50%; background: #2F7BF6; border: 3px solid #fff; box-shadow: 0 0 0 10px rgba(47,123,246,.18); }
.mk-route { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid #D9262E; }
.leaflet-control-attribution { font-size: 10px !important; }

/* ---------- settings & footer ---------- */
.set-row { display: flex; align-items: center; gap: 8px; padding: 15px 12px 15px 16px; width: 100%; text-align: left; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row b { flex: 1; font-weight: 600; font-size: 15.5px; }
.set-row span { color: var(--text3); font-size: 13px; }
.legal { color: var(--text2); font-size: 12.5px; line-height: 1.5; margin: 20px 4px 0; }
.credit { text-align: center; color: var(--text3); font-size: 11.5px; font-weight: 600; margin-top: 18px; }
.app-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-top: 12px; }
.app-banner img { width: 40px; height: 40px; border-radius: 10px; }
.app-banner div { flex: 1; min-width: 0; }
.app-banner b { display: block; font-size: 14.5px; }
.app-banner span { display: block; font-size: 12.5px; color: var(--text2); margin-top: 2px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + var(--nav-h) + 28px); transform: translateX(-50%) translateY(10px); opacity: 0; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%); }

.enter { animation: enter .26s ease-out both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* sheet (rename / options) */
.sheet-bg { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(640px, 100%); background: var(--surface); border-radius: 26px 26px 0 0; padding: 10px max(20px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 20px) max(20px, env(safe-area-inset-left, 0px)); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.sheet .handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto; }
.sheet h3 { font: 800 20px/1.2 var(--display); margin: 18px 4px 12px; }
.sheet .opt { display: flex; align-items: center; gap: 16px; padding: 14px 12px; width: 100%; text-align: left; font-weight: 600; font-size: 16px; border-radius: 14px; }
.sheet .opt:hover { background: var(--surface2); }
.sheet .opt svg { width: 22px; height: 22px; fill: currentColor; }
.sheet .opt.danger { color: var(--accent); }
.sheet input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 0; background: var(--surface2); color: var(--text); font-size: 16px; font-weight: 600; outline: none; margin-bottom: 14px; }

@media (min-width: 1000px) {
  #app { max-width: 680px; }
  .title { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.searchbox input::-webkit-search-cancel-button, .searchbox input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }

/* ---------- journey planner ---------- */
.where { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; margin-bottom: 4px; }
.where > svg { width: 24px; height: 24px; fill: var(--accent); flex: none; }
.where > b { flex: 1; font-size: 16.5px; }
.qchip { display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px 7px 10px; border-radius: 16px; background: var(--surface2); font-size: 13px; font-weight: 700; }
.qchip svg { width: 16px; height: 16px; fill: currentColor; }
.ends { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; }
.ends .fields { flex: 1; min-width: 0; }
.end { display: flex; align-items: center; gap: 12px; }
.end svg { width: 20px; height: 20px; flex: none; }
.end input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; font-weight: 600; padding: 14px 4px; }
.end input::placeholder { color: var(--text3); }
.end input.here { color: #2F7BF6; }
.ends .sep { height: 1px; background: var(--line); margin-left: 32px; }
.ends .icon-btn { background: var(--surface2); }
.when { margin-top: 12px; }
.when-time { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--text2); }
.when-time input { font: inherit; font-weight: 700; color: var(--text); background: var(--surface); border: 0; border-radius: 10px; padding: 8px 10px; box-shadow: inset 0 0 0 1px var(--line); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { padding: 12px 14px; text-align: left; border-radius: 16px; min-width: 0; }
.tile .h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.tile .h svg { width: 18px; height: 18px; fill: var(--accent); }
.tile span { display: block; font-size: 12.5px; color: var(--text2); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow svg.k { width: 20px; height: 20px; fill: var(--text2); flex: none; }
.jcard { display: block; padding: 14px 16px; width: 100%; text-align: left; }
.jtop { display: flex; align-items: flex-end; gap: 4px; }
.jtop .m { font: 800 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.jtop .u { font-size: 14px; font-weight: 600; color: var(--text2); margin-bottom: 2px; }
.jtop .fast { margin: 0 0 4px 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--good); background: var(--good-soft); padding: 3px 7px; border-radius: 6px; }
.jtop .r { margin-left: auto; text-align: right; }
.jtop .r b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.jtop .r span { display: block; font-size: 12.5px; color: var(--text2); font-weight: 600; margin-top: 3px; }
.legs { display: flex; align-items: center; gap: 2px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.legs::-webkit-scrollbar { display: none; }
.legs > svg.sepc { width: 16px; height: 16px; fill: var(--text3); flex: none; }
.lg-walk { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--text2); flex: none; }
.lg-walk svg { width: 16px; height: 16px; fill: currentColor; }
.lg-ride { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.lg-ride > svg { width: 15px; height: 15px; fill: var(--text2); }
.lg-pill { color: #fff; border-radius: 6px; padding: 4px 7px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.lg-pill.bus { font: 800 13px/1.1 var(--display); min-width: 34px; text-align: center; }
.lg-pill.light { color: #111; }
.jinfo { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--text2); }
.jinfo .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: pulse 1.8s infinite; flex: none; }
.jinfo.live { color: var(--text); }
.jwarn { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; font-weight: 700; color: var(--warn); }
.jwarn svg { width: 15px; height: 15px; fill: currentColor; }
.livebox { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--good-soft); font-weight: 700; font-size: 14px; margin-top: 14px; }
.livebox .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: pulse 1.8s infinite; flex: none; }
.steps { padding: 12px 14px 12px 10px; }
.st { display: flex; align-items: stretch; }
.st .tm { width: 46px; flex: none; text-align: right; padding-top: 15px; font-size: 13.5px; font-weight: 600; color: var(--text2); font-variant-numeric: tabular-nums; }
.st .tm.b { font-weight: 700; color: var(--text); }
.st .rl { width: 30px; flex: none; position: relative; }
.st .rl::before { content: ""; position: absolute; left: 50%; transform: translateX(-50%); top: 0; bottom: 0; width: 5px; background: var(--c, var(--line)); }
.st .rl.walk::before { width: 3px; background: radial-gradient(circle, var(--text3) 1.5px, transparent 1.6px) 0 0 / 3px 9px repeat-y; }
.st.first .rl::before { top: 22px; }
.st.last .rl::before { bottom: auto; height: 22px; }
.st .nd { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c); box-sizing: border-box; }
.st .nd.end { width: 16px; height: 16px; top: 14px; background: var(--text); border: 0; }
.st .bd { flex: 1; min-width: 0; padding: 12px 0 14px 8px; }
.st .k { font-size: 11.5px; font-weight: 700; color: var(--text2); }
.st .n { font-weight: 700; font-size: 15.5px; margin-top: 3px; }
.st .w { font-weight: 600; font-size: 14.5px; }
.st .sub { font-size: 12.5px; color: var(--text2); margin-top: 4px; }
.st .hd { display: flex; align-items: center; gap: 10px; }
.st .hd .tw { font-size: 13.5px; font-weight: 600; color: var(--text2); min-width: 0; }
.st .from { display: flex; align-items: center; gap: 4px; margin: 8px 0 6px; font-weight: 700; font-size: 15px; border-radius: 10px; }
.st a.from:hover { background: color-mix(in srgb, var(--surface2) 55%, transparent); }
.st .off { font-size: 13.5px; font-weight: 600; margin-top: 6px; }
.st .dis { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--warn-soft); font-size: 12.5px; line-height: 1.4; }
.st .dis b { color: var(--warn); display: flex; align-items: center; gap: 6px; }
.st .dis b svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- about Clippie (home screens; readable without JavaScript) ---------- */
body.home .page { padding-bottom: 8px; }
.about {
  padding: 28px max(20px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + var(--nav-h) + 40px) max(20px, env(safe-area-inset-left, 0px));
  color: var(--text2); font-size: 14.5px; line-height: 1.55;
}
.about h1 { font: 800 22px/1.2 var(--display); color: var(--text); margin: 0 0 8px; letter-spacing: -.015em; text-wrap: balance; }
.about h2 { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text2); margin: 24px 0 10px; }
.about p { margin: 0; max-width: 62ch; text-wrap: pretty; hyphens: none; }
.about .lead { color: var(--text); }
.about .feat { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.about .feat li { position: relative; text-wrap: pretty; hyphens: none; }
/* bullets hang in the margin so every line of text starts at the same edge as the headings */
.about .feat li::before { content: ""; position: absolute; left: -14px; top: .62em; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.about .feat b { color: var(--text); font-weight: 700; }
.about .faq { border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
:root[data-theme="dark"] .about .faq { box-shadow: inset 0 0 0 1px var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .about .faq { box-shadow: inset 0 0 0 1px var(--line); } }
.about details + details { border-top: 1px solid var(--line); }
.about summary { cursor: pointer; padding: 13px 16px; font-weight: 700; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.about summary::-webkit-details-marker { display: none; }
.about summary::after { content: "+"; color: var(--text3); font-weight: 700; flex: none; }
.about details[open] summary::after { content: "–"; }
.about details p { padding: 0 16px 14px; }
.about .foot { margin-top: 18px; font-size: 12.5px; color: var(--text3); }
.about .foot + .foot { margin-top: 6px; }
.about a { color: var(--accent); font-weight: 600; }
.nojs { color: var(--text2); text-align: center; margin: 20px 0 0; }
