:root {
  --bg: #0a0e13;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, #10202b 0%, #0a0e13 55%);
  --surface: #121922;
  --surface-2: #18212c;
  --surface-3: #202b38;
  --border: #26323f;
  --border-soft: #1d2732;
  --text: #eaf0f6;
  --muted: #8b9aab;
  --muted-2: #5f6d7d;
  --accent: #3ad9b0;
  --accent-ink: #052720;
  --danger: #ff6b6b;
  --warn: #ffc14d;
  --radius: 16px;
  --radius-sm: 11px;
  --tap: rgba(58, 217, 176, 0.14);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100dvh;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------- App scaffold ---------- */
#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

header.top {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: calc(var(--safe-t) + 12px) 16px 12px;
  background: linear-gradient(to bottom, rgba(10, 14, 19, 0.92), rgba(10, 14, 19, 0.72) 70%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .glyph {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #2bb0e0);
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(58, 217, 176, 0.35);
}
.brand .glyph svg { width: 21px; height: 21px; display: block; }
.brand .name { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; line-height: 1; }
.brand .name small { display: block; font-weight: 600; font-size: 10.5px; letter-spacing: 0.14em; color: var(--muted); margin-top: 3px; text-transform: uppercase; }
.top .spacer { flex: 1; }
.clock {
  text-align: right; line-height: 1.1;
}
.clock .t { font-weight: 700; font-size: 15px; }
.clock .d { font-size: 11px; color: var(--muted); margin-top: 2px; }
.svc-pill {
  display: inline-block; margin-top: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 999px;
  background: var(--surface-3); color: var(--accent);
}

main {
  flex: 1;
  padding: 8px 16px calc(96px + var(--safe-b));
}

/* ---------- Bottom nav ---------- */
nav.tabs {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: 100%; max-width: 560px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 6px calc(8px + var(--safe-b));
  background: linear-gradient(to top, rgba(10, 14, 19, 0.97) 60%, rgba(10, 14, 19, 0.6));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-soft);
}
nav.tabs button {
  appearance: none; border: 0; background: none; color: var(--muted-2);
  padding: 6px 4px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em;
  cursor: pointer; transition: color .18s, background .18s;
}
nav.tabs button svg { width: 22px; height: 22px; }
nav.tabs button.active { color: var(--accent); }
nav.tabs button.active .ico { background: var(--tap); }
nav.tabs .ico { padding: 4px 11px; border-radius: 999px; transition: background .18s; }

/* ---------- Generic ---------- */
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin: 18px 2px 10px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
button.ghost {
  appearance: none; font: inherit; cursor: pointer;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 15px; font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s, border-color .15s, transform .05s;
}
button.ghost:active { transform: scale(0.97); background: var(--surface-3); }
button.ghost svg { width: 16px; height: 16px; }

/* ---------- Stop picker ---------- */
.picker {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0 4px;
}
.picker .stopsel {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px; cursor: pointer;
  transition: border-color .15s;
}
.picker .stopsel:active { border-color: var(--accent); }
.picker .stopsel .lbl { min-width: 0; }
.picker .stopsel .lbl .k { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.picker .stopsel .lbl .v { font-size: 16px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker .stopsel .chev { margin-left: auto; color: var(--muted); flex: none; }
.picker .geo {
  flex: none; width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--accent);
  cursor: pointer;
}
.picker .geo:active { background: var(--surface-3); }
.picker .geo.loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Departures board ---------- */
.dep-meta { display: flex; align-items: center; gap: 8px; margin: 12px 2px 6px; flex-wrap: wrap; }
.dep-meta .dist { font-size: 12px; color: var(--muted); }
.dep {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--border-soft);
}
.dep:last-child { border-bottom: 0; }
.dep .badge {
  flex: none; min-width: 46px; height: 34px; padding: 0 9px;
  border-radius: 9px; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; letter-spacing: -0.01em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.dep .info { flex: 1; min-width: 0; }
.dep .info .dest { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep .info .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dep .when { text-align: right; flex: none; }
.dep .when .big { font-weight: 800; font-size: 17px; line-height: 1; }
.dep .when .big.due { color: var(--accent); }
.dep .when .big.soon { color: var(--warn); }
.dep .when .clk { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.dep .when .day { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: 0.04em; color: var(--accent); text-transform: uppercase; margin-top: 3px; }

.empty {
  text-align: center; padding: 40px 20px; color: var(--muted);
}
.empty .big { font-size: 40px; margin-bottom: 8px; }
.empty .msg { font-size: 14px; line-height: 1.5; }

/* ---------- Route cards ---------- */
.route-grid { display: flex; flex-direction: column; gap: 10px; }
.route-card {
  display: flex; align-items: stretch; gap: 0;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 14px; overflow: hidden; cursor: pointer;
  transition: transform .05s, border-color .15s;
}
.route-card:active { transform: scale(0.985); border-color: var(--border); }
.route-card .stripe { width: 6px; flex: none; }
.route-card .body { padding: 13px 14px; flex: 1; min-width: 0; }
.route-card .rname { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.route-card .rsub { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.route-card .chip { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); letter-spacing: 0.02em; }
.route-card .go { align-self: center; color: var(--muted-2); padding-right: 12px; }

/* ---------- Route detail ---------- */
.detail-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; }
.detail-head .back { flex: none; }
.detail-head .rt { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.detail-head .dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.official {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600;
}
.official svg { flex: none; color: var(--accent); }
.official .arr { margin-left: auto; color: var(--muted); }

.svc-block { margin-top: 16px; }
.svc-block h3 { font-size: 13px; font-weight: 800; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.svc-block h3 .tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); background: var(--surface-3); padding: 2px 8px; border-radius: 999px; }
.ttable-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); -webkit-overflow-scrolling: touch; }
table.ttable { border-collapse: collapse; font-size: 12px; width: max-content; min-width: 100%; }
table.ttable th, table.ttable td { padding: 8px 11px; text-align: center; white-space: nowrap; }
table.ttable thead th {
  position: sticky; top: 0;
  background: var(--surface-3); color: var(--text); font-weight: 700; font-size: 11px;
  text-align: left; border-bottom: 1px solid var(--border);
}
table.ttable thead th:first-child { position: sticky; left: 0; z-index: 2; }
table.ttable tbody td:first-child {
  position: sticky; left: 0; text-align: left; font-weight: 700;
  background: var(--surface-2); border-right: 1px solid var(--border-soft);
}
table.ttable tbody tr:nth-child(even) td { background: var(--surface-2); }
table.ttable tbody tr:nth-child(even) td:first-child { background: var(--surface-3); }
table.ttable tbody td { color: var(--text); border-bottom: 1px solid var(--border-soft); }
table.ttable td.blank { color: var(--muted-2); }

/* ---------- Stops list ---------- */
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 11px 14px; margin: 8px 0 4px;
}
.search svg { color: var(--muted); flex: none; }
.search input {
  flex: 1; background: none; border: 0; color: var(--text);
  font: inherit; font-size: 15px; outline: none; min-width: 0;
}
.search input::placeholder { color: var(--muted-2); }
.stop-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 6px; border-bottom: 1px solid var(--border-soft); cursor: pointer;
}
.stop-row:active { background: var(--surface-2); }
.stop-row .pin { flex: none; color: var(--muted); }
.stop-row .sinfo { flex: 1; min-width: 0; }
.stop-row .sinfo .sn { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-row .dots { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.stop-row .dots i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.stop-row .dist2 { font-size: 12px; color: var(--muted); flex: none; }

/* ---------- Map ---------- */
.map-wrap { margin-top: 8px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border-soft); background: #0c141c; box-shadow: var(--shadow); }
.map-wrap svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 12px 2px; }
.map-legend .li { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.map-legend .li i { width: 12px; height: 4px; border-radius: 2px; }
.map-dot { cursor: pointer; }
.map-dot:active circle { stroke: #fff; }

/* ---------- Modal stop sheet / picker ---------- */
.sheet-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 7, 10, 0.6);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sheet-back.open { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-width: 560px;
  background: var(--surface); border-top-left-radius: 22px; border-top-right-radius: 22px;
  border-top: 1px solid var(--border);
  max-height: 82dvh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.9,.3,1);
  padding-bottom: var(--safe-b);
}
.sheet-back.open .sheet { transform: translateY(0); }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 10px auto 4px; }
.sheet .sheet-head { padding: 6px 18px 10px; display: flex; align-items: center; gap: 10px; }
.sheet .sheet-head .h { font-weight: 800; font-size: 17px; }
.sheet .sheet-head .x { margin-left: auto; color: var(--muted); background: var(--surface-3); border-radius: 999px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; cursor: pointer; }
.sheet .sheet-scroll { overflow-y: auto; padding: 0 12px 16px; -webkit-overflow-scrolling: touch; }
.pick-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px; border-radius: 10px; cursor: pointer;
}
.pick-row:active { background: var(--surface-2); }
.pick-row .pn { flex: 1; font-weight: 600; font-size: 15px; }
.pick-row .pd { font-size: 12px; color: var(--muted); }
.pick-row.sel { background: var(--tap); }
.pick-row .pdots { display: flex; gap: 3px; }
.pick-row .pdots i { width: 8px; height: 8px; border-radius: 2px; }

/* ---------- Info ---------- */
.info-card { padding: 16px; margin-bottom: 12px; }
.info-card h2 { font-size: 15px; margin: 0 0 10px; font-weight: 800; }
.info-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); text-decoration: none; color: var(--text); }
.info-line:last-child { border-bottom: 0; }
.info-line svg { color: var(--accent); flex: none; }
.info-line .il { flex: 1; }
.info-line .il .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.info-line .il .v { font-size: 15px; font-weight: 600; margin-top: 2px; }
.disclaimer { font-size: 12px; color: var(--muted); line-height: 1.6; }
.disclaimer strong { color: var(--warn); }
.foot { text-align: center; color: var(--muted-2); font-size: 11px; padding: 20px 0 8px; line-height: 1.6; }
.foot .cake { font-size: 15px; }

.header-btn { margin-left: 4px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; flex: none; }
.header-btn:active { background: var(--surface-3); }

.fade-in { animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.offline-banner {
  display: none;
  background: var(--surface-3); color: var(--warn);
  font-size: 12px; font-weight: 600; text-align: center;
  padding: 6px; border-radius: 8px; margin: 6px 0;
}
body.is-offline .offline-banner { display: block; }

/* ---------- route shape tokens ---------- */
.rtoken { display: inline-flex; align-items: center; vertical-align: -3px; margin-right: 8px; line-height: 0; }
.rtoken.lg { margin-right: 0; }
.chip.freq { color: var(--accent); background: rgba(58, 217, 176, 0.12); }
.dots .rdot, .pdots .rdot { display: inline-flex; line-height: 0; }
.map-legend .ltok { display: inline-flex; align-items: center; line-height: 0; }

/* ---------- favorites ---------- */
.picker .geo.star.on { color: var(--warn); }
.fav-card { overflow: hidden; }
.fav-row { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.fav-row:last-child { border-bottom: 0; }
.fav-row:active { background: var(--surface-2); }
.fav-star { flex: none; color: var(--muted-2); display: inline-flex; line-height: 0; }
.fav-star.on { color: var(--warn); }
.fav-name { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-next { display: flex; align-items: center; gap: 9px; flex: none; }
.fav-next.muted { color: var(--muted); font-size: 13px; }
.fav-badge { min-width: 40px; height: 26px; padding: 0 8px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.fav-min { font-weight: 800; font-size: 15px; }
.fav-min.due { color: var(--accent); }
.fav-min.soon { color: var(--warn); }

/* ---------- stop-row extras ---------- */
.stop-fav { flex: none; color: var(--muted-2); display: inline-flex; line-height: 0; padding: 2px; }
.stop-fav.on { color: var(--warn); }
.stop-row .stop-map, .stop-map { flex: none; color: var(--muted); display: inline-flex; line-height: 0; padding: 6px; }
.stop-row .stop-map:active { color: var(--accent); }
.pick-row .stop-fav { margin-right: 2px; }

/* ---------- welcome balloon (first run) ---------- */
.welcome {
  position: relative; margin: 6px 0 14px; padding: 15px 16px 16px;
  background: linear-gradient(180deg, rgba(58,217,176,0.13), var(--surface));
  border: 1px solid rgba(58,217,176,0.4); border-radius: 16px;
}
.welcome::after {
  content: ''; position: absolute; left: 30px; bottom: -9px; width: 16px; height: 16px;
  background: var(--surface); border-right: 1px solid rgba(58,217,176,0.4); border-bottom: 1px solid rgba(58,217,176,0.4);
  transform: rotate(45deg);
}
.welcome .wl-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.welcome .wl-wave { font-size: 20px; }
.welcome .wl-h { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.welcome .wl-body { font-size: 13.5px; line-height: 1.5; color: var(--text); opacity: 0.92; }
.welcome .wl-btn {
  margin-top: 13px; appearance: none; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 9px 20px;
}
.welcome .wl-btn:active { transform: scale(0.97); }

/* ---------- install banner ---------- */
.install-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 12px; padding: 12px 14px;
  background: linear-gradient(180deg, rgba(58,217,176,0.10), var(--surface));
  border: 1px solid rgba(58, 217, 176, 0.35); border-radius: 14px;
}
.install-banner .ib-ico { color: var(--accent); flex: none; }
.install-banner .ib-text { flex: 1; min-width: 0; }
.install-banner .ib-h { font-weight: 800; font-size: 14px; }
.install-banner .ib-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.install-banner .ib-btn {
  flex: none; appearance: none; font: inherit; font-weight: 800; font-size: 13px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 8px 16px;
}
.install-banner .ib-btn:active { transform: scale(0.96); }
.install-banner .ib-x { flex: none; appearance: none; background: none; border: 0; color: var(--muted-2); cursor: pointer; display: inline-flex; padding: 4px; }

/* ---------- trip planner ---------- */
.tp-fields { position: relative; display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.tp-field {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 13px 14px; cursor: pointer; transition: border-color .15s;
}
.tp-field:active { border-color: var(--accent); }
.tp-field .tp-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.tp-field .tp-dot.from { background: var(--accent); box-shadow: 0 0 0 3px rgba(58,217,176,0.18); }
.tp-field .tp-dot.to { background: var(--danger); box-shadow: 0 0 0 3px rgba(255,107,107,0.16); }
.tp-field .tp-lbl { min-width: 0; flex: 1; }
.tp-field .tp-lbl .k { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.tp-field .tp-lbl .v { font-size: 16px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-field .tp-lbl .v.ph { color: var(--muted-2); font-weight: 600; }
.tp-field .chev { color: var(--muted); flex: none; }
.tp-swap {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%; z-index: 2;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--accent);
  display: grid; place-items: center; cursor: pointer;
}
.tp-swap:active { transform: translateY(-50%) scale(0.92); }

.tp-when { display: flex; align-items: center; gap: 8px; margin: 12px 2px 2px; flex-wrap: wrap; }
.tp-when-lbl { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.chip.nowchip { appearance: none; font: inherit; cursor: pointer; border: 1px solid var(--border); color: var(--muted); background: var(--surface-2); font-weight: 700; }
.chip.nowchip.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.tp-day, .tp-time {
  appearance: none; font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
}
.tp-time { color-scheme: dark; }

/* itinerary card */
.journey { padding: 14px 15px; margin-bottom: 12px; }
.journey.best { border-color: rgba(58,217,176,0.4); }
.j-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.j-best { font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 2px 8px; border-radius: 999px; }
.j-arrive { font-size: 17px; font-weight: 800; }
.j-meta { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.j-legs { position: relative; }
.j-leg { display: grid; grid-template-columns: 62px 26px 1fr; align-items: start; gap: 4px; }
.j-time { font-size: 13px; font-weight: 700; padding-top: 1px; text-align: right; padding-right: 8px; }
.j-day { display: block; font-size: 9px; font-weight: 800; color: var(--accent); text-transform: uppercase; }
.j-rail { display: flex; justify-content: center; position: relative; }
.j-rail::before { content: ''; position: absolute; top: -2px; bottom: -20px; width: 3px; background: var(--border); border-radius: 2px; }
.j-leg:last-child .j-rail::before { display: none; }
.j-badge { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); }
.j-node { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--muted-2); margin-top: 3px; }
.j-node.end { border-color: var(--danger); }
.j-body { min-width: 0; padding-bottom: 16px; }
.j-leg.transfer .j-body, .j-leg.arrive .j-body { padding-bottom: 16px; }
.j-line { font-size: 14.5px; }
.j-line b { font-weight: 700; }
.j-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.j-call { color: var(--warn); font-weight: 600; }

/* ---------- riders ticker ---------- */
.ticker {
  display: flex; align-items: center; gap: 9px;
  margin: 4px 0 10px; padding: 10px 13px;
  background: linear-gradient(180deg, rgba(255,193,77,0.10), var(--surface));
  border: 1px solid rgba(255,193,77,0.3); border-radius: 13px; cursor: pointer;
}
.ticker .tk-ico { color: var(--warn); flex: none; display: inline-flex; }
.ticker .tk-lbl { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--warn); flex: none; }
.ticker .tk-body { font-size: 13.5px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; }
.ticker .tk-time { font-size: 11px; color: var(--muted); flex: none; }

/* ---------- dep row report affordance ---------- */
.dep-report {
  flex: none; appearance: none; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  display: grid; place-items: center; margin-left: 2px;
}
.dep-report:active { background: var(--surface-3); color: var(--warn); }
.dep-rider { font-size: 11.5px; color: var(--warn); margin-top: 3px; font-weight: 600; }

/* ---------- report sheet ---------- */
.rpt { padding: 0 4px; }
.rpt-ctx { display: flex; align-items: center; gap: 10px; margin: 2px 4px 14px; font-size: 14px; color: var(--muted); }
.rpt-badge { min-width: 42px; height: 28px; padding: 0 9px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; }
.rpt-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rpt-opt {
  appearance: none; font: inherit; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 10px; padding: 15px 14px;
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 14px;
  color: var(--text); font-weight: 700; font-size: 14.5px; transition: border-color .12s, background .12s;
}
.rpt-opt:active { transform: scale(0.98); }
.rpt-opt.on { border-color: var(--accent); background: var(--tap); }
.rpt-emoji { font-size: 20px; }
.rpt-extra:not(:empty) { margin-top: 14px; }
.rpt-x-lbl { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.rpt-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.rpt-chip { appearance: none; font: inherit; cursor: pointer; font-weight: 700; font-size: 13px; padding: 9px 15px; border-radius: 999px; background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); }
.rpt-chip.on { border-color: var(--accent); background: var(--tap); color: var(--accent); }
.rpt-note { width: 100%; box-sizing: border-box; min-height: 74px; resize: vertical; font: inherit; font-size: 14px; color: var(--text); background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 13px; outline: none; }
.rpt-note:focus { border-color: var(--accent); }
.rpt-submit {
  width: 100%; margin-top: 16px; appearance: none; font: inherit; font-weight: 800; font-size: 15px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 14px; padding: 14px;
}
.rpt-submit:disabled { background: var(--surface-3); color: var(--muted-2); cursor: default; }
.rpt-note-legal { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin: 12px 4px 4px; text-align: center; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b));
  transform: translateX(-50%) translateY(10px);
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
  padding: 12px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow);
  z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- service note (peak-hour / off-line window) ---------- */
.svc-note {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 6px 0 4px; padding: 11px 13px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 12px;
  font-size: 12.5px; line-height: 1.45; color: var(--muted);
}
.svc-note .sn-ico { flex: none; font-size: 15px; line-height: 1.2; }

/* ---------- map note ---------- */
.map-note { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 12px 2px 2px; }
.map-note .mn-hw { color: var(--accent); }
