:root {
  --bg: #f3f4f1; --card: #ffffff; --card2: #f7f7f4; --line: #e2e3dd; --text: #15191f; --muted: #646a73;
  --accent: #c2410c; --accent-soft: #fbe9df; --on-accent: #fff; --board: #0d1424; --amber: #f4b13b;
  --ok: #15803d; --ok-bg: #e3f4e8; --late: #b45309; --late-bg: #fdf0d8;
  --bad: #b91c1c; --bad-bg: #fbe3e3; --info: #1d4ed8; --info-bg: #e3ebfc;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1a; --card: #121a2b; --card2: #0f1626; --line: #22304a; --text: #e8ecf3; --muted: #8b97ab;
    --accent: #f59e0b; --accent-soft: #2a2110; --on-accent: #111; --board: #060a12;
    --ok: #4ade80; --ok-bg: #11291b; --late: #fbbf24; --late-bg: #2b2210;
    --bad: #f87171; --bad-bg: #331517; --info: #93b4ff; --info-bg: #15213d;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1a; --card: #121a2b; --card2: #0f1626; --line: #22304a; --text: #e8ecf3; --muted: #8b97ab;
  --accent: #f59e0b; --accent-soft: #2a2110; --on-accent: #111; --board: #060a12;
  --ok: #4ade80; --ok-bg: #11291b; --late: #fbbf24; --late-bg: #2b2210;
  --bad: #f87171; --bad-bg: #331517; --info: #93b4ff; --info-bg: #15213d;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(70px + env(safe-area-inset-bottom)); min-height: 100vh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.hidden { display: none !important; }

.top { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--board); color: #fff; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: .2px; font-size: 18px; }
.logo { width: 28px; height: 28px; border-radius: 7px; }
.logo.big { width: 64px; height: 64px; border-radius: 15px; }
.top-right { display: flex; align-items: center; gap: 8px; }
.badge { font: 700 11px var(--mono); background: var(--amber); color: #111; padding: 3px 6px; border-radius: 4px; letter-spacing: .5px; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 20px; line-height: 1; }
.top .icon-btn { color: #fff; background: rgba(255,255,255,.08); }

main { max-width: 720px; margin: 0 auto; padding: 12px 16px; }
.vh { font-size: 22px; margin: 6px 0 10px; }
.hint { color: var(--muted); font-size: 14px; margin: -4px 0 12px; }

.banner { position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 999; margin: 0; padding: 10px 16px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; }

/* board controls */
.board-controls { display: grid; gap: 8px; margin-bottom: 10px; }
.station-btn { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 10px 14px;
  background: var(--board); color: #fff; border-radius: 12px; text-align: left; }
.station-btn .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #9aa6bb; }
.station-btn .val { font-size: 21px; font-weight: 700; color: var(--amber); font-family: var(--mono); letter-spacing: -.3px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.small { gap: 6px; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { padding: 6px 12px; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--text); color: var(--bg); }
.chip { padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.chip.ghost { background: transparent; }
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.fav-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.fav-chips::-webkit-scrollbar { display: none; }
.fav-chips .chip { white-space: nowrap; font-size: 13px; padding: 6px 10px; }

/* lists */
.list { display: grid; gap: 8px; }
.svc { display: grid; grid-template-columns: 58px 1fr auto; gap: 4px 12px; align-items: center; padding: 11px 14px;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--line); text-align: left; width: 100%; }
.svc.tracked { border-color: var(--accent); }
.svc .t { font: 700 19px var(--mono); letter-spacing: -.5px; }
.svc .t.struck { text-decoration: line-through; color: var(--muted); }
.svc .d { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc .sub { grid-column: 2 / 4; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc .plat { text-align: center; min-width: 44px; }
.svc .plat b { display: block; font: 700 18px var(--mono); }
.svc .plat small { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.svc .reason { grid-column: 1 / 4; font-size: 13px; padding: 6px 9px; border-radius: 8px; background: var(--late-bg); color: var(--late); }
.svc .reason.bad, .reason.bad { background: var(--bad-bg); color: var(--bad); }
.reason b { font-weight: 700; }
.reason.none { font-style: italic; }
.reason.past, .reason.info { background: var(--info-bg); color: var(--info); }
.svc-meta + .reason, .reason + .reason { margin-top: 6px; }
.sheet-body > .reason { font-size: 14px; padding: 8px 11px; border-radius: 9px; background: var(--late-bg); color: var(--late); }
.sheet-body > .reason.bad { background: var(--bad-bg); color: var(--bad); }
.sheet-body > .reason.past, .sheet-body > .reason.info { background: var(--info-bg); color: var(--info); }
.svc .reason + .reason { margin-top: 0; }
.trk-why .reason { margin: 0 14px 8px; }

.st { display: inline-block; font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.st.ontime { color: var(--ok); background: var(--ok-bg); }
.st.late { color: var(--late); background: var(--late-bg); }
.st.delayed { color: var(--late); background: var(--late-bg); }
.st.cancelled { color: var(--bad); background: var(--bad-bg); }
.st.unknown { color: var(--muted); background: var(--card2); }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }

.msg { background: var(--info-bg); color: var(--info); border-radius: 10px; padding: 9px 12px; font-size: 14px; margin-bottom: 8px; }
.msg a { color: inherit; }
.err-box { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 12px; font-size: 14px; }
.foot { color: var(--muted); font-size: 12px; text-align: center; margin: 14px 0 4px; }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: 16px; color: var(--muted); }
.empty strong { color: var(--text); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 14px 2px 2px; }
.skeleton { height: 64px; border-radius: 12px; background: linear-gradient(90deg, var(--card) 0%, var(--card2) 50%, var(--card) 100%);
  background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

/* tracked cards */
.trk { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.trk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 14px 8px; }
.trk-route { font-weight: 700; font-size: 17px; }
.trk-route small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }
.trk-times { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trk-times > div { background: var(--card2); padding: 9px 14px; }
.trk-times .k { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.trk-times .v { font: 700 20px var(--mono); }
.trk-times .v s { color: var(--muted); font-weight: 500; font-size: 15px; margin-right: 6px; }
.trk-times .p { font-size: 13px; color: var(--muted); }
.trk-times .p b { color: var(--text); font-family: var(--mono); font-size: 15px; }
.trk-pos { padding: 9px 14px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.trk-pos .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.trk-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px; padding: 0 8px 8px; }
.trk-foot button { font-size: 14px; font-weight: 600; color: var(--accent); padding: 6px 8px; border-radius: 8px; }
.trk-foot button.rm { color: var(--muted); }
.trk .reason { margin: 0 14px 8px; font-size: 13px; padding: 6px 9px; border-radius: 8px; background: var(--late-bg); color: var(--late); }
.trk .reason.bad { background: var(--bad-bg); color: var(--bad); }
.trk .reason.past, .trk .reason.info { background: var(--info-bg); color: var(--info); }
.bar { height: 4px; background: var(--line); margin: 0 14px 10px; border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .6s; }

/* tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tabs button.on { color: var(--accent); }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.count { position: absolute; top: 4px; left: 54%; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: #fff; font: 700 11px/17px -apple-system, sans-serif; font-style: normal; }
.count.warn { background: var(--bad); }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.sheet-card { position: relative; width: 100%; max-width: 720px; max-height: 88vh; background: var(--bg); border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column; animation: up .22s ease-out; padding-bottom: env(safe-area-inset-bottom); }
@keyframes up { from { transform: translateY(40px); opacity: .3; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; gap: 10px; }
.sheet-head h3 { margin: 0; font-size: 18px; }
.sheet-head .icon-btn { background: var(--card); }
.sheet-body { overflow-y: auto; padding: 0 16px 18px; -webkit-overflow-scrolling: touch; }

.search { width: 100%; font: inherit; font-size: 17px; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); color: var(--text); margin-bottom: 10px; }
.stn-list { display: grid; }
.stn { display: flex; justify-content: space-between; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.stn code { font: 600 13px var(--mono); color: var(--muted); }
.stn small { color: var(--muted); font-size: 13px; margin-left: 6px; }
.primary { background: var(--accent); color: var(--on-accent); font-weight: 700; padding: 12px 16px; border-radius: 12px; width: 100%; font-size: 16px; }
.secondary { background: var(--card); border: 1px solid var(--line); font-weight: 600; padding: 11px 16px; border-radius: 12px; width: 100%; }
.btn-row { display: grid; gap: 8px; margin: 12px 0; }

/* timeline */
.svc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.svc-meta b { color: var(--text); }
.tl { position: relative; margin: 6px 0 0; padding: 0; list-style: none; }
.tl li { position: relative; display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; }
.tl li::before { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl li:first-child::before { top: 50%; }
.tl li:last-child::before { bottom: 50%; }
.tl li.done::before { background: var(--accent); }
.tl .node { position: relative; z-index: 1; width: 12px; height: 12px; margin-left: 6px; border-radius: 50%; border: 2px solid var(--muted); background: var(--bg); }
.tl li.done .node { border-color: var(--accent); background: var(--accent); }
.tl li.now .node { width: 16px; height: 16px; margin-left: 4px; border-color: var(--accent); background: var(--bg); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl li.mine .name { color: var(--accent); }
.tl .name { font-weight: 600; }
.tl .name small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.tl li.done .name { color: var(--muted); font-weight: 500; }
.tl li.cx .name { text-decoration: line-through; color: var(--bad); }
.tl .times { text-align: right; font-family: var(--mono); font-size: 15px; }
.tl .times s { color: var(--muted); margin-right: 6px; font-size: 13px; }
.tl .times .lt { color: var(--late); font-weight: 700; }
.tl .times .ok { color: var(--ok); }
.tl .times .cx { color: var(--bad); font-weight: 700; }

.pick { display: grid; gap: 6px; margin: 8px 0; }
.pick button { text-align: left; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); display: flex; justify-content: space-between; }
.pick button span { font-family: var(--mono); color: var(--muted); }

.help h3 { font-size: 16px; margin: 18px 0 6px; }
.help ul { padding-left: 20px; margin: 0; }
.help li { margin: 6px 0; }
.credit { color: var(--muted); font-size: 13px; margin-top: 20px; }

.login { position: fixed; inset: 0; z-index: 100; background: var(--board); display: grid; place-items: center; padding: 24px; color: #fff; }
.login form { width: 100%; max-width: 320px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.login h2 { margin: 0 0 8px; }
.login input { width: 100%; font-size: 17px; padding: 12px; border-radius: 11px; border: 1px solid #2a3753; background: #121a2b; color: #fff; }
.err { color: #f87171; min-height: 1em; margin: 0; }

/* ---------------- map */
#view-map { position: fixed; left: 0; right: 0; top: var(--map-top, 54px); bottom: var(--map-bottom, 64px); z-index: 1; }
#map { position: absolute; inset: 0; background: var(--card2); }
.map-bar { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 600; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; pointer-events: none; }
.map-bar > * { pointer-events: auto; }
.map-bar .seg, .map-tools .chip { box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.map-tools { display: flex; gap: 6px; }
.map-tools .chip { background: var(--card); padding: 7px 11px; font-size: 13px; }
.map-tools .chip.on { background: var(--accent-soft); }
#mapFollow.on { color: var(--accent); font-weight: 600; }
.map-info { position: absolute; left: 50%; transform: translateX(-50%); bottom: 26px; z-index: 600; background: var(--card); color: var(--muted);
  font-size: 12px; padding: 6px 12px; border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,.18); white-space: nowrap; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; }
.map-info.warn { color: var(--bad); white-space: normal; text-align: center; border-radius: 12px; }
.leaflet-container { font: inherit; background: var(--card2); }
.leaflet-control-attribution { font-size: 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .base-tiles { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.6); } }
:root[data-theme="dark"] .base-tiles { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.6); }

.tm { position: relative; width: 26px; height: 26px; }
.tm-arrow { width: 26px; height: 26px; border-radius: 50%; background: var(--c); display: grid; place-items: center;
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0,0,0,.35); transition: transform .8s linear; }
.tm-arrow svg { width: 15px; height: 15px; fill: var(--fg, #fff); }
.tm.waiting .tm-arrow { opacity: .75; }
.tm.cx .tm-arrow { background: #8a8f98 !important; }
.tm.mine .tm-arrow { box-shadow: 0 0 0 3px var(--accent), 0 0 0 6px rgba(255,255,255,.7), 0 2px 8px rgba(0,0,0,.4); }
.tm-lbl { position: absolute; left: 30px; top: 3px; white-space: nowrap; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 4px 6px; border-radius: 6px; background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.25); border-left: 3px solid var(--c); }
.tm-lbl b { color: var(--late); margin-left: 3px; }
.tm-lbl b.cx { color: var(--bad); }
.zoom-low .tm-lbl { display: none; }
.zoom-low .tm, .zoom-low .tm-arrow { width: 16px; height: 16px; }
.zoom-low .tm-arrow svg { width: 10px; height: 10px; }
.zoom-low .tm-arrow { box-shadow: 0 0 0 1.5px #fff, 0 1px 3px rgba(0,0,0,.35); }
.stn-dot { }
.leaflet-popup-content-wrapper { border-radius: 14px; background: var(--card); color: var(--text); }
.leaflet-popup-tip { background: var(--card); }
.leaflet-popup-content { margin: 12px 14px; font-size: 14px; line-height: 1.35; min-width: 220px; }
.pop h4 { margin: 0 0 2px; font-size: 16px; }
.pop .sub { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.pop .reason { font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--late-bg); color: var(--late); margin: 6px 0; }
.pop .reason.bad { background: var(--bad-bg); color: var(--bad); }
.pop .ln { font-size: 13px; margin: 3px 0; }
.pop .ln span { color: var(--muted); }
.pop .btns { display: flex; gap: 8px; margin-top: 10px; }
.pop .btns button { flex: 1; padding: 8px; border-radius: 9px; font-weight: 700; font-size: 13px; background: var(--card2); border: 1px solid var(--line); }
.pop .btns button.go { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pop .est { color: var(--muted); font-size: 11px; margin-top: 6px; }

/* map layers sheet */
.layer-list { display: grid; gap: 8px; margin-bottom: 6px; }
.layer-opt { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-align: left; }
.layer-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.lo-thumb { width: 52px; height: 40px; border-radius: 8px; flex: none; border: 1px solid var(--line); }
.lo-standard { background: linear-gradient(135deg,#f2efe9 0 40%,#aad3df 40% 55%,#f2efe9 55%), #f2efe9; box-shadow: inset 0 -6px 0 #f6d38a; }
.lo-simple { background: linear-gradient(160deg,#fafaf8 0 60%,#e8ecef 60%); box-shadow: inset 14px 10px 0 -11px #e11d48; }
.lo-terrain { background: radial-gradient(circle at 30% 40%,#c9b48a 0 18%,#d9cfa3 19% 34%,#cfe0b6 35%); }
.lo-satellite { background: linear-gradient(140deg,#2f4a2a,#4d6b3a 40%,#7a8a6a 60%,#2b3f52); }
.lo-txt { flex: 1; display: flex; flex-direction: column; }
.lo-txt small, .layer-tog small { color: var(--muted); font-size: 12px; font-weight: 400; }
.lo-tick { color: var(--accent); font-weight: 800; font-size: 18px; }
.layer-tog { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.layer-tog span { display: flex; flex-direction: column; }
.layer-tog input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.stn-lbl { background: rgba(255,255,255,.88); border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.25); font-size: 11px; font-weight: 600; padding: 1px 5px; border-radius: 4px; color: #15191f; }
.stn-lbl::before { display: none; }

/* delays by distance */
.dgroup { display: grid; gap: 8px; margin-bottom: 14px; }
.dhead { display: flex; align-items: baseline; gap: 8px; margin: 4px 2px 0; flex-wrap: wrap; }
.dhead b { font-size: 16px; }
.dhead .dist { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.dhead .dcount { margin-left: auto; font-size: 13px; color: var(--late); font-weight: 600; }
.dhead .dcount em { color: var(--bad); font-style: normal; }
.notice-toggle { width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; background: var(--info-bg); color: var(--info); font-weight: 600; font-size: 14px; margin-bottom: 8px; }

/* journey planner */
.plan-form { display: grid; gap: 10px; margin-bottom: 14px; }
.plan-stations { position: relative; display: grid; gap: 6px; }
.plan-stations .station-btn { padding-right: 56px; }
.swap { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  background: var(--amber); color: #111; font-size: 20px; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.saved-chip { display: inline-flex; align-items: center; gap: 2px; padding: 0 4px 0 10px; }
.saved-chip button { padding: 6px 2px; font-size: 13px; white-space: nowrap; }
.saved-chip .x { color: var(--muted); padding: 6px 6px; }
.chip.hidden { display: none; }
.jcard { display: grid; gap: 6px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); text-align: left; width: 100%; }
.jcard.risk-missed, .jcard.risk-cancelled { border-color: var(--bad); }
.jcard.risk-tight { border-color: var(--late); }
.jtimes { display: flex; align-items: baseline; gap: 8px; font-family: var(--mono); }
.jtimes b { font-size: 20px; }
.jtimes .arrow { color: var(--muted); }
.jtimes .jdur { margin-left: auto; font-family: inherit; color: var(--muted); font-size: 14px; font-weight: 600; }
.jdate { font-family: -apple-system, sans-serif; font-size: 12px; font-weight: 700; background: var(--info-bg); color: var(--info); padding: 2px 6px; border-radius: 5px; }
.jsub { color: var(--muted); font-size: 14px; }
.jlegs { display: flex; gap: 3px; }
.jleg { flex: 1; height: 5px; border-radius: 3px; background: var(--c); }
.jlive { font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-row.two { grid-template-columns: 1fr 1fr; }
.jhead { font-size: 15px; margin-bottom: 4px; }
.jwalk { color: var(--muted); font-size: 14px; padding: 6px 4px; }
.jchange { margin: 8px 0; }
.jlegcard { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 12px; padding: 10px 12px; margin: 8px 0; display: grid; gap: 6px; }
.jlh { font-size: 14px; }
.jrow { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: baseline; }
.jrow .jt { font-family: var(--mono); font-weight: 700; }
.jrow .jt s { color: var(--muted); font-weight: 500; font-size: 13px; }
.jrow .jt .lt { color: var(--late); }
.jrow .jt .cx { color: var(--bad); font-family: -apple-system, sans-serif; font-size: 13px; }
.jrow .jn small { display: block; color: var(--muted); font-size: 12px; }
.jrow.small { font-size: 13px; color: var(--muted); }
.jrow.small .jt { font-weight: 500; }
.jstops summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 2px 0 2px 100px; }
.trk.pending { opacity: .92; border-style: dashed; }

/* plan ahead */
.when-box { display: grid; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.when-box .seg { justify-self: start; }
.when-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.date-chip { position: relative; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.date-chip input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.time-in { font: 600 17px var(--mono); padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.when-txt { color: var(--muted); font-size: 13px; margin-left: auto; }
.upcard { display: flex; gap: 8px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 10px 8px 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; }
.up-main { flex: 1; display: grid; gap: 3px; }
.up-date { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--accent); }
.up-times { font-family: var(--mono); font-size: 17px; }
.up-times small { font-family: -apple-system, sans-serif; color: var(--muted); font-size: 13px; }
.up-route { font-weight: 600; }
.up-status { font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.upcard .x { color: var(--muted); padding: 4px 8px; font-size: 16px; }
.btn-row.two button.secondary { font-size: 14px; }

/* delay repay */
.repay { display: grid; gap: 3px; margin: 6px 0; padding: 9px 11px; border-radius: 10px; background: #e7f6ec; color: #14532d; text-decoration: none; font-size: 13px; border: 1px solid #b7e1c4; }
.repay b { font-size: 14px; }
.trk-why .repay { margin: 0 14px 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .repay { background: #10291a; color: #86efac; border-color: #1f4d30; } }
:root[data-theme="dark"] .repay { background: #10291a; color: #86efac; border-color: #1f4d30; }
.repay-list { columns: 2; column-gap: 16px; font-size: 14px; }
.repay-list li { break-inside: avoid; margin: 4px 0; }
.repay-list a { color: var(--accent); }

.svc.past { opacity: .62; }
.svc.past .t { color: var(--muted); }
#offSeg button { font-size: 13px; padding: 6px 10px; }
