:root {
  --bg: #f5f6f8; --card: #fff; --fg: #14171a; --muted: #6b7280; --line: #e5e7eb; --accent: #0a7d3c; --accent-soft: #e6f4ec; --warn: #b45309; --bad: #dc2626;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e0f11; --card: #1a1c1f; --fg: #eceef0; --muted: #9aa0a6; --line: #2a2d31; --accent: #34c26e; --accent-soft: #14301f; --warn: #f59e0b; --bad: #f87171; --shadow: none; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font: 16px/1.35 system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--fg); }
button { font: inherit; color: inherit; cursor: pointer; }
header { display: flex; justify-content: space-between; align-items: baseline; padding: calc(env(safe-area-inset-top) + 10px) 16px 6px; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.3px; }
#updated { color: var(--muted); font-size: 12px; border: 0; background: none; padding: 6px 2px; }
#updated.stale { color: var(--warn); }
main { padding: 4px 14px calc(88px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }

/* bottom tab bar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 1000; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px 0 7px; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; }
.tabs button i { display: flex; }
.tabs button i .ic { width: 24px; height: 24px; }
.tabs button.on { color: var(--accent); font-weight: 600; }
.tabs button.on i .ic { stroke-width: 2.4; }

/* inputs + search suggestions */
input, select { font: inherit; color: var(--fg); }
input[type=search], input[type=datetime-local], input[type=text], input[type=time] { width: 100%; padding: 13px 14px; font-size: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); appearance: none; -webkit-appearance: none; }
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.sbox { position: relative; margin: 8px 0; }
.suggest:empty { display: none; }
.suggest { position: relative; z-index: 5; }
.suggest { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-top: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.12); overflow: hidden; max-height: 36vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sg { display: flex; align-items: center; gap: 10px; padding: 11px 12px; min-height: 52px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sg:last-child { border-bottom: 0; }
.sg:active { background: var(--accent-soft); }
.sg .ico { width: 28px; text-align: center; font-size: 18px; flex: none; }
.sg .t { flex: 1; min-width: 0; }
.sg .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg .t small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg .add { color: var(--accent); font-size: 22px; flex: none; }
.dirs { display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.dirs button { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.dirs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.empty { color: var(--muted); padding: 10px 2px; font-size: 14px; }
.opt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin: 10px 2px; }
.opt select, .opt input[type=datetime-local] { width: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: none; font-size: 14px; }
.opt button { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 12px; font-size: 14px; }

/* cards */
.card { background: var(--card); border-radius: 16px; padding: 14px; margin: 10px 0; box-shadow: var(--shadow); }
.card h2 { font-size: 16px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.card h2 .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card h2 button { border: 0; background: none; color: var(--muted); font-size: 18px; padding: 6px; min-width: 36px; min-height: 36px; border-radius: 8px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 16px 4px 0; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.row.first { border-top: 0; }
.badge { display: inline-block; min-width: 42px; text-align: center; padding: 3px 8px; border-radius: 8px; color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.hs { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.eta { font-weight: 700; font-size: 18px; white-space: nowrap; text-align: right; }
.eta.soon { color: var(--accent); }
.sched { color: var(--muted); font-weight: 400; font-size: 12px; display: block; }
.live { color: var(--accent); font-size: 12px; font-weight: 700; }
.dirhead { font-size: 13px; color: var(--muted); font-weight: 600; margin: 10px 0 0; }
.dirarrow { display: inline-block; color: var(--accent); width: 22px; text-align: center; flex: none; font-size: 18px; }
.btnrow { display: flex; gap: 8px; margin-top: 10px; }
.btn { flex: 1; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px; font-size: 14px; font-weight: 600; }
.chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; }

/* plan */
.route-inputs { position: relative; }
#swap { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 18px; box-shadow: var(--shadow); }
.route-inputs .sbox input { padding-right: 56px; }
.summary { display: flex; align-items: baseline; gap: 10px; font-weight: 700; font-size: 22px; }
.summary .to { color: var(--muted); font-weight: 400; }
.meta { display: flex; gap: 14px; color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.tw { color: var(--muted); font-size: 14px; padding: 6px 0 6px 2px; }
.ride { --c: #444; }
.tr { display: grid; grid-template-columns: 68px 14px 1fr; gap: 8px; align-items: center; padding: 3px 0; }
.tr time { font-weight: 600; font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr .dot { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--c); background: var(--card); box-sizing: border-box; }
.tr b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tb { display: flex; align-items: center; gap: 8px; margin-left: 81px; border-left: 4px solid var(--c); padding: 8px 0 8px 14px; flex-wrap: wrap; }
.tb small { color: var(--muted); font-size: 13px; }
.tb .hs { flex: 0 1 auto; }

/* map */
.mapbar { display: flex; gap: 8px; align-items: center; margin: 6px 0 8px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); flex: none; }
.seg button { border: 0; background: none; padding: 10px 12px; font-size: 14px; }
.seg button.on { background: var(--accent); color: #fff; }
.mapbar input { flex: 1; min-width: 0; padding: 10px 12px; }
.mapbar #locate { border: 1px solid var(--line); background: var(--card); border-radius: 10px; font-size: 18px; width: 44px; height: 42px; flex: none; }
#mapbox { height: calc(100dvh - 210px - env(safe-area-inset-bottom)); min-height: 320px; border-radius: 16px; box-shadow: var(--shadow); }
.leaflet-div-icon { background: none; border: 0; }

/* bus marker: coloured circle (fleet + route number) with an arrow showing the direction of travel */
.bus { position: relative; width: 52px; height: 52px; }
.bus .arrow { position: absolute; inset: 0; transition: transform .6s ease; }
.bus .arrow::before { content: ''; position: absolute; top: 0; left: 50%; margin-left: -10px; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 16px solid var(--c); filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }
.bus .dot { position: absolute; left: 10px; top: 10px; width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.bus .dot small { font-size: 8px; opacity: .9; }
.bus .dot b { font-size: 13px; }
.far .bus .dot small { display: none; }
.stopdot { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); box-sizing: border-box; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.me { width: 16px; height: 16px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(37,99,235,.25); }

/* iOS Safari collapses an empty datetime-local when its native appearance is removed */
input[type=datetime-local] { appearance: auto; -webkit-appearance: auto; min-width: 200px; min-height: 40px; }
.opt button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
/* leave room under the content so results can scroll up above the on-screen keyboard */
body.typing main { padding-bottom: 60vh; }

/* full-screen stop picker: a single scroll area (the list), so it scrolls reliably on iOS */
body.noscroll { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; background: var(--bg); padding-top: env(safe-area-inset-top); }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--card); border-bottom: 1px solid var(--line); }
.sheet-bar b { display: block; font-size: 18px; }
.sheet-bar small { display: block; color: var(--muted); font-size: 13px; }
.sheet-bar .done { border: 0; background: var(--accent); color: #fff; border-radius: 10px; padding: 10px 18px; font-weight: 600; flex: none; }
.sheet .dirs { background: var(--card); flex: none; }
.dirs button small { color: inherit; opacity: .7; }
.sheet-filter { padding: 8px 14px; flex: none; }
.sheet-filter input { margin: 0; }
.sheet-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: var(--card); padding-bottom: env(safe-area-inset-bottom); }
.sheet-list .mark { width: 36px; text-align: center; font-size: 22px; color: var(--accent); flex: none; }
.sheet-list .mark.on { background: var(--accent); color: #fff; border-radius: 50%; font-size: 17px; width: 30px; height: 30px; line-height: 30px; margin-right: 3px; }

/* lucide icons: inline SVG that inherits the text colour; 1em unless a context sets a size */
.ic { width: 1em; height: 1em; vertical-align: -0.14em; flex: none; }
.sbox .lead { position: absolute; left: 14px; top: 14px; z-index: 1; color: var(--muted); pointer-events: none; display: flex; }
.sbox .lead .ic { width: 20px; height: 20px; }
.sbox input[type=search] { padding-left: 42px; }
.sg .ico { display: flex; justify-content: center; color: var(--accent); }
.sg .ico .ic { width: 20px; height: 20px; }
.sg .add .ic, .sheet-list .mark .ic { width: 22px; height: 22px; }
.sheet-list .mark { display: flex; align-items: center; justify-content: center; }
.sheet-list .mark.on .ic { width: 17px; height: 17px; stroke-width: 3; }
.card h2 button .ic { width: 20px; height: 20px; }
.btn .ic { margin-right: 4px; }
.dirarrow .ic { width: 18px; height: 18px; fill: currentColor; }
.dirs button .ic { width: 14px; height: 14px; }
.opt > i { display: flex; } .opt > i .ic { width: 18px; height: 18px; }
.mapbar #locate .ic, #swap .ic { width: 20px; height: 20px; }
.mapbar #locate, #swap { display: flex; align-items: center; justify-content: center; }
.summary .ic { width: 22px; height: 22px; color: var(--muted); vertical-align: -0.2em; }
.meta .ic, .tw .ic { width: 16px; height: 16px; margin-right: 2px; }
.tb small .ic { width: 13px; height: 13px; vertical-align: -0.12em; }
.sched .ic { width: 11px; height: 11px; vertical-align: -0.1em; }
.live { display: inline-flex; align-items: center; gap: 5px; }
/* live dot, shared by stop rows and trip legs */
.pulse { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 5px; vertical-align: 1px; animation: pulse 2s ease-in-out infinite; }
.live .pulse { width: 8px; height: 8px; margin: 0; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.leaflet-popup-content .ic { width: 14px; height: 14px; vertical-align: -0.15em; }

/* iOS: opaque cover over the status-bar area so scrolled content (and the title) never slides under the clock and battery */
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--bg); z-index: 1500; pointer-events: none; }
.sbox { scroll-margin-top: calc(env(safe-area-inset-top) + 12px); }

/* near you + trip timeline */
.card h2 .dist { color: var(--muted); font-size: 12px; font-weight: 400; flex: none; }
.card h2 button.on { color: var(--accent); background: var(--accent-soft); }
.row[data-open] { cursor: pointer; }
.sg.past { opacity: .45; }
.sg.here { background: var(--accent-soft); }
.sg .when { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.sg .when b { font-weight: 600; }
.sg .when small { display: block; color: var(--muted); font-size: 12px; }
.sheet-bar .badge { margin-right: 4px; }
.sched .ic { vertical-align: -0.12em; }

/* Home / Work shortcuts on the Plan tab */
.places { display: flex; gap: 8px; margin: 8px 0; }
.place { flex: 1; min-width: 0; display: flex; background: var(--card); border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.place button { border: 0; background: none; }
.place .go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 12px; text-align: left; }
.place .go > .ic { width: 22px; height: 22px; color: var(--accent); }
.place .go span { flex: 1; min-width: 0; }
.place .go b, .place .go small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place .go small { color: var(--muted); font-size: 12px; }
.place .go em { font-style: normal; font-weight: 700; font-size: 13px; color: var(--accent); }
.place .edit { padding: 0 8px; color: var(--muted); display: flex; align-items: center; }
.place .edit .ic { width: 16px; height: 16px; }

/* routes to show */
header { align-items: center; }
.hdr-r { display: flex; align-items: center; gap: 8px; }
#routes-btn, #devices-btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; }
#devices-btn[hidden] { display: none; }
#routes-btn .ic, #devices-btn .ic { width: 20px; height: 20px; }
.sg.off { opacity: .5; }
.sg .badge { flex: none; }
.filterbar { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin: 6px 2px; }
.filterbar span { flex: 1; }
.filterbar .ic { width: 16px; height: 16px; }
.filterbar button { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 12px; font-size: 14px; }

/* trip options: tap to expand */
.trip-opt { cursor: pointer; }
.trip-opt .legs { display: none; }
.trip-opt.open .legs { display: block; }
.trip-opt .chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
.trip-opt.open .chev { transform: rotate(180deg); }
.trip-opt .chev .ic { width: 20px; height: 20px; }
.meta .rb { margin-left: auto; display: flex; gap: 4px; }
.meta .rb .badge { min-width: 0; padding: 1px 6px; font-size: 12px; }

/* pinned stop cards: next bus only, rest behind a chevron */
.card .more { display: none; }
.card.open .more { display: block; }
.morebtn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; color: var(--muted); font-size: 13px; padding: 10px 0 2px; margin-top: 4px; }
.morebtn .ic { width: 18px; height: 18px; transition: transform .2s; }
.card.open .morebtn .ic { transform: rotate(180deg); }
.card.open .morebtn span { display: none; }
.card h2 .stopbell.on { color: var(--accent); background: var(--accent-soft); }

/* sorting pinned stops */
.sorthead { display: flex; align-items: center; justify-content: space-between; }
.sortbox { display: flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; }
.sortbox select { font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.sortbox button { border: 1px solid var(--line); background: var(--card); border-radius: 8px; width: 30px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.sortbox button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.sortbox button .ic { width: 16px; height: 16px; }
.sg.reorder { cursor: default; }
.sg.reorder button { border: 0; background: none; color: var(--accent); padding: 8px; display: flex; }
.sg.reorder button:disabled { opacity: .25; }
.sg.reorder button .ic { width: 22px; height: 22px; }

/* "soon" is a pill, not only a colour */
.eta .n { display: inline-block; }
.eta.soon .n { background: var(--accent-soft); border-radius: 8px; padding: 0 7px; margin-right: -7px; }
.watched { color: var(--accent); display: flex; flex: none; }
.watched .ic { width: 16px; height: 16px; }
.card h2 .dist .ic { width: 13px; height: 13px; vertical-align: -0.15em; }

/* tab badge: alerts on your routes */
.tabs button { position: relative; }
.tabbadge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }
.tabbadge:empty { display: none; }

/* snackbar */
#snack { position: fixed; left: 50%; bottom: calc(68px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); width: max-content; max-width: calc(100% - 32px); z-index: 3500;
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; background: #1f2328; color: #fff; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#snack.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#snack button { border: 0; background: none; color: #6ee7a0; font-weight: 700; padding: 4px; }
@media (prefers-color-scheme: dark) { #snack { background: #eceef0; color: #14171a; } #snack button { color: #0a7d3c; } }

/* pull to refresh */
#ptr { height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); transition: height .2s; }
#ptr .ic { width: 22px; height: 22px; transition: transform .2s; }
#ptr.ready { color: var(--accent); }
#ptr.ready .ic { transform: rotate(180deg); }
#ptr.spin { height: 44px; }
#ptr.spin .ic { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* loading placeholders */
.skel i { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--line) 25%, var(--bg) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel i:first-child { width: 55%; margin-bottom: 14px; }
.skel i:last-child { width: 85%; height: 22px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* mini sheet: bottom panel over a dimmed backdrop */
.sheet.mini { background: rgba(0,0,0,.45); justify-content: flex-end; padding-top: 0; }
.sheet.mini .panel { background: var(--card); border-radius: 16px 16px 0 0; max-height: 85dvh; display: flex; flex-direction: column; overflow: hidden; }
.sheet.mini .sheet-bar { border-radius: 16px 16px 0 0; }
.alabel { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 14px 14px 6px; }
.seg.wide { display: flex; margin: 0 14px 6px; }
.seg.wide button { flex: 1; }
.seg button.on, .seg.wide button.on { background: var(--accent); color: #fff; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--line); flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); }

/* trip options: when to leave, and actions for the first bus */
.meta .leavein { color: var(--accent); font-weight: 700; }
.meta .leavein:empty { display: none; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.trip-opt .btnrow .btn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#leave button { white-space: nowrap; }

/* keyboard focus on rows that act as buttons */
[role=button]:focus-visible, [role=switch]:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* map follows dark mode: darkened tiles, themed popups and controls */
@media (prefers-color-scheme: dark) {
  #mapbox { background: #1a1c1f; }
  #mapbox .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }
  .leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--fg); }
  .leaflet-bar a { background: var(--card); color: var(--fg); border-color: var(--line); }
  .leaflet-control-attribution { background: rgba(26,28,31,.8) !important; color: var(--muted); }
  .leaflet-control-attribution a { color: var(--muted); }
}

/* how much to trust each arrival */
.hs small em { font-style: normal; }
.hs small .bad { color: var(--bad); font-weight: 600; }
.hs small .early { color: var(--warn); font-weight: 600; }
.row.off .badge, .row.off .hs > :not(small) { opacity: .55; }
.row.off { color: var(--muted); }
.row.dropoff .badge, .row.dropoff .hs > :not(small), .row.dropoff .eta .n { opacity: .55; } /* can't board it here */
.eta.off { color: var(--muted); font-size: 15px; font-weight: 600; }
.eta.muted .n { color: var(--muted); }
.eta.muted.soon .n { background: var(--line); }
.catch { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: -2px 0 4px; }
.catch .ic { width: 14px; height: 14px; }
.catch b { color: var(--accent); }

/* alerts: headline first, tap to read the notice */
.chip.new { background: var(--bad); color: #fff; }
.alert { position: relative; cursor: pointer; }
.alert .peek { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 8px 0 0; } /* one paragraph, so the stop names make the preview */
.alert .desc { display: none; margin: 8px 0 0; }
.alert.open .peek { display: none; }
.alert.open .desc { display: block; }
.alert .readmore { display: flex; justify-content: center; color: var(--muted); padding-top: 4px; }
.alert .readmore .ic { width: 18px; height: 18px; transition: transform .2s; }
.alert.open .readmore .ic { transform: rotate(180deg); }
#pins .filterbar { margin-top: 2px; }

/* commutes + signed-in devices */
.cbtn { border: 0; background: none; color: var(--muted); padding: 6px; min-width: 36px; min-height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; }
.cbtn.on { color: var(--accent); }
.cbtn .ic { width: 20px; height: 20px; }
.cbtn.sure { color: var(--bad); font-size: 13px; font-weight: 600; width: auto; padding: 6px 10px; }
.sg .t b .chip { vertical-align: 1px; }
.cform { padding-bottom: 14px; }
.cform input[type=text] { width: calc(100% - 28px); margin: 0 14px; box-shadow: none; }
.cform .seg.wide button { padding: 10px 0; font-size: 13px; }
.cform .trow { display: flex; align-items: center; gap: 10px; margin: 0 14px; color: var(--muted); }
.cform .trow input { flex: 1; min-width: 0; box-shadow: none; }
.cform .btnrow { margin: 16px 14px 0; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
