/* ---------------------------------------------------------------------------
   Rapid Bus Live — monochrome glass
   Two palettes, one layout. Only colour and glass opacity change between
   modes; every measurement below is shared.
--------------------------------------------------------------------------- */

:root {
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  --r-badge: 8px;
  --r-btn: 10px;
  --r-field: 12px;
  --r-panel: 16px;

  --blur: 22px;
  --live: #30d158;

  /* Edge-to-edge insets, 0 in a desktop browser. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #050505;
  --glass: rgba(18, 18, 18, 0.72);
  --glass-raised: rgba(28, 28, 28, 0.76);
  --edge: rgba(255, 255, 255, 0.08);
  --edge-strong: rgba(255, 255, 255, 0.25);
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, 0.65);
  --ink-3: rgba(255, 255, 255, 0.4);
  --rule: rgba(255, 255, 255, 0.08);
  --hover: rgba(255, 255, 255, 0.06);
  --selected: rgba(255, 255, 255, 0.1);
  --invert-bg: #ffffff;
  --invert-ink: #090909;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.62);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.5);
  --map-bg: #0d0d0d;
  --casing: rgba(0, 0, 0, 0.55);
  --progress-ahead: #ffb340;
  --progress-passed: rgba(255, 255, 255, 0.42);
}

html[data-theme="light"] {
  color-scheme: light;
  --page: #f5f5f5;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-raised: rgba(255, 255, 255, 0.88);
  --edge: rgba(0, 0, 0, 0.07);
  --edge-strong: rgba(0, 0, 0, 0.22);
  --ink: #090909;
  --ink-2: rgba(0, 0, 0, 0.62);
  --ink-3: rgba(0, 0, 0, 0.4);
  --rule: rgba(0, 0, 0, 0.07);
  --hover: rgba(0, 0, 0, 0.04);
  --selected: rgba(0, 0, 0, 0.07);
  --invert-bg: #090909;
  --invert-ink: #ffffff;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.14);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.1);
  --map-bg: #ededed;
  --casing: rgba(255, 255, 255, 0.85);
  --progress-ahead: #f57c00;
  --progress-passed: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  background: var(--page);
  color: var(--ink);
  margin: 0;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Focus rings appear on keyboard focus only. The previous rule applied an
   outline to every button and input unconditionally, which drew a blue ring
   around every chip, card and row on the page. */
:focus-visible {
  outline: 1.5px solid var(--edge-strong);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.cap {
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
  margin: 0;
  text-transform: uppercase;
}

.num {
  font-variant-numeric: tabular-nums;
}

.clip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scroll {
  overflow-y: auto;
  scrollbar-color: var(--ink-3) transparent;
  scrollbar-width: thin;
}

.scroll::-webkit-scrollbar {
  width: 6px;
}

.scroll::-webkit-scrollbar-thumb {
  background: var(--ink-3);
  border-radius: 999px;
}

/* ---------------------------------------------------------------------------
   Map — full bleed, the dominant surface
--------------------------------------------------------------------------- */

#map {
  background: var(--map-bg);
  inset: 0;
  position: fixed;
  z-index: 0;
}

.leaflet-container {
  background: var(--map-bg);
  font-family: inherit;
}

.leaflet-control-attribution {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--r-badge) 0 0 0;
  color: var(--ink-3);
  font-size: 9.5px;
  padding: 2px 8px;
}

.leaflet-control-attribution a {
  color: var(--ink-2);
  text-decoration: none;
}

/* The bundled attribution flag is the only stray colour on the page. */
.leaflet-attribution-flag {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   Floating glass rail
--------------------------------------------------------------------------- */

.rail {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  border: 1px solid var(--edge);
  border-radius: var(--r-panel);
  bottom: calc(var(--sp-4) + var(--safe-bottom));
  box-shadow: var(--shadow);
  display: flex;
  left: calc(var(--sp-4) + var(--safe-left));
  overflow: hidden;
  position: fixed;
  top: calc(var(--sp-4) + var(--safe-top));
  width: 648px;
  z-index: 500;
}

.discover {
  display: flex;
  flex: none;
  flex-direction: column;
  min-height: 0;
  padding-top: var(--sp-5);
  width: 304px;
}

/* Route detail lives in its own column and appears only once a route is on. */
.detail {
  background: var(--glass-raised);
  border-left: 1px solid var(--rule);
  display: none;
  flex-direction: column;
  flex-grow: 1;
  min-height: 0;
  min-width: 0;
}

body.has-route .detail,
body.has-journey .detail {
  display: flex;
}

body:not(.has-route):not(.has-journey) .rail {
  width: 336px;
}

body:not(.has-route):not(.has-journey) .discover {
  width: 100%;
}

/* Header */

.brand {
  align-items: flex-start;
  display: flex;
  gap: var(--sp-3);
  padding: 0 var(--sp-5) var(--sp-5);
}

.brand-mark {
  background: var(--invert-bg);
  border-radius: var(--r-badge);
  display: grid;
  flex: none;
  height: 34px;
  place-items: center;
  width: 34px;
}

.brand-mark svg {
  height: 19px;
  width: 19px;
}

.brand-copy {
  flex-grow: 1;
  min-width: 0;
}

h1 {
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0;
}

.eyebrow {
  color: var(--ink-3);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin: 5px 0 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.icon-btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: var(--r-badge);
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  flex: none;
  height: 30px;
  justify-content: center;
  transition: background 0.14s ease, color 0.14s ease;
  width: 30px;
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--ink);
}

.icon-btn.small {
  border-radius: 7px;
  height: 26px;
  width: 26px;
}

html[data-theme="dark"] .icon-sun,
html[data-theme="light"] .icon-moon {
  display: none;
}

/* Search */

.search {
  align-items: center;
  background: var(--glass-raised);
  border: 1px solid var(--edge);
  border-radius: var(--r-field);
  display: flex;
  gap: var(--sp-2) 10px;
  height: 44px;
  margin: 0 var(--sp-5) var(--sp-4);
  padding: 0 var(--sp-3);
  position: relative;
  transition: border-color 0.14s ease;
}

.search:focus-within {
  border-color: var(--edge-strong);
}

.search > svg {
  color: var(--ink-3);
  flex: none;
}

.search input {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink);
  flex-grow: 1;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  min-width: 0;
  outline: none;
}

.search input::placeholder {
  color: var(--ink-3);
}

.search input::-webkit-search-cancel-button {
  display: none;
}

kbd {
  border: 1px solid var(--edge);
  border-radius: 5px;
  color: var(--ink-3);
  flex: none;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
}

.clear-btn {
  align-items: center;
  background: var(--selected);
  border: 0;
  border-radius: 999px;
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  flex: none;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.clear-btn:hover {
  color: var(--ink);
}

/* Chip rows */

.block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 var(--sp-5) 18px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-row.compact {
  gap: 5px;
}

.chip {
  align-items: center;
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: var(--r-badge);
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.chip:hover {
  border-color: var(--edge-strong);
  color: var(--ink);
}

.chip.on {
  background: var(--invert-bg);
  border-color: transparent;
  color: var(--invert-ink);
}

.chip small {
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 500;
}

.chip.on small {
  color: var(--invert-ink);
  opacity: 0.6;
}

.chip-row.compact .chip {
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  height: 24px;
  padding: 0 9px;
}

/* Route list */

.list-head {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  padding: 0 var(--sp-5) var(--sp-2);
}

.tally {
  color: var(--ink-3);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.routes {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 0;
  padding: 0 var(--sp-3) var(--sp-4);
}

/* Clean rows with hairline separators — no per-card borders. */
.route-row {
  align-items: flex-start;
  background: transparent;
  border: 0;
  border-radius: var(--r-btn);
  border-top: 1px solid var(--rule);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-family: inherit;
  gap: var(--sp-3);
  padding: var(--sp-3) 10px var(--sp-3) var(--sp-2);
  position: relative;
  text-align: left;
  transition: background 0.14s ease;
  width: 100%;
}

.route-row:hover {
  background: var(--hover);
}

.route-row.active {
  background: var(--selected);
  border-top-color: transparent;
}

/* A short vertical bar marks the selection instead of a coloured border. */
.route-row.active::before {
  background: var(--ink);
  border-radius: 999px;
  content: "";
  height: 26px;
  left: 0;
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 2px;
}

.badge {
  align-items: center;
  background: var(--invert-bg);
  border-radius: var(--r-badge);
  color: var(--invert-ink);
  display: flex;
  flex: none;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  height: 26px;
  justify-content: center;
  min-width: 40px;
  padding: 0 7px;
}

.badge.large {
  font-size: 17px;
  height: 34px;
  min-width: 46px;
  padding: 0 10px;
}

.route-copy {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 3px;
  min-width: 0;
}

.route-origin {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.route-dest {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.route-meta {
  color: var(--ink-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.route-row svg {
  color: var(--ink-3);
  flex: none;
  margin-top: 6px;
}

.rail-foot {
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 10.5px;
  padding: var(--sp-3) var(--sp-5) 14px;
  text-align: center;
}

/* Skeletons */

.sk-row {
  align-items: center;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) 10px var(--sp-3) var(--sp-2);
}

.sk {
  background: var(--hover);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.sk::after {
  animation: shimmer 1.4s infinite;
  background: linear-gradient(90deg, transparent, var(--hover), transparent);
  content: "";
  inset: 0;
  position: absolute;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.sk-badge {
  flex: none;
  height: 26px;
  width: 40px;
}

.sk-lines {
  display: grid;
  flex-grow: 1;
  gap: 7px;
}

.sk-line {
  height: 10px;
  width: 80%;
}

.sk-line.short {
  width: 45%;
}

/* ---------------------------------------------------------------------------
   Selected route
--------------------------------------------------------------------------- */

.detail-top {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-5) 0;
}

.detail-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.live-tag {
  align-items: center;
  color: var(--ink-2);
  display: inline-flex;
  font-size: 10px;
  font-weight: 600;
  gap: 6px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.live-tag::before {
  background: var(--ink-3);
  border-radius: 999px;
  content: "";
  height: 6px;
  width: 6px;
}

/* Green means live data, and nothing else. */
.live-tag[data-tone="live"]::before {
  background: var(--live);
}

.live-tag[data-tone="error"] {
  color: var(--ink-2);
}

/* The body is a flex column: heading, stats, direction and tabs are pinned
   while only the list beneath them scrolls. */
.detail-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 0;
}

.detail-fixed {
  display: flex;
  flex-direction: column;
  flex: none;
}

.detail-head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 18px var(--sp-5) 0;
}

.detail-head .badge {
  align-self: flex-start;
}

.detail-title {
  color: var(--ink);
  font-size: 17.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.32;
}

.detail-title span {
  color: var(--ink-2);
  display: block;
}

.detail-sub {
  color: var(--ink-3);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* Statistics: typography and rules rather than four cards. */
.stats {
  border-bottom: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 18px var(--sp-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: var(--sp-5) var(--sp-5) 0;
  padding: var(--sp-4) 0;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-value {
  color: var(--ink);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat.dim .stat-value {
  color: var(--ink-3);
}

.stat-label {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
}

/* Direction */

.direction {
  align-items: center;
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: var(--r-btn);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-family: inherit;
  gap: 10px;
  margin: var(--sp-4) var(--sp-5) 0;
  padding: 10px var(--sp-3);
  text-align: left;
  transition: background 0.14s ease;
}

.direction:hover {
  background: var(--hover);
}

.direction-copy {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 2px;
  min-width: 0;
}

.direction-copy strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.direction svg {
  color: var(--ink-2);
  flex: none;
}

/* Segmented control */

.tabs {
  border: 1px solid var(--edge);
  border-radius: var(--r-btn);
  display: grid;
  gap: var(--sp-1);
  grid-template-columns: 1fr 1fr;
  margin: 14px var(--sp-5) 0;
  padding: 3px;
}

.tab {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--r-badge);
  color: var(--ink-3);
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  gap: 6px;
  height: 32px;
  justify-content: center;
  transition: color 0.14s ease;
}

.tab:hover {
  color: var(--ink-2);
}

.tab.active {
  background: var(--invert-bg);
  color: var(--invert-ink);
}

.tab-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

.list-title {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5) 10px;
}

.list-title small {
  color: var(--ink-3);
  font-size: 11px;
}

.detail-scroll {
  flex-grow: 1;
  min-height: 0;
  padding: 0 var(--sp-5) var(--sp-5);
}

/* ---------------------------------------------------------------------------
   Stop timeline
--------------------------------------------------------------------------- */

.timeline {
  display: flex;
  flex-direction: column;
}

.stop-row {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--r-badge);
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  font-family: inherit;
  gap: var(--sp-3);
  min-height: 42px;
  padding: var(--sp-2) var(--sp-2) var(--sp-2) 26px;
  position: relative;
  text-align: left;
  transition: background 0.14s ease;
  width: 100%;
}

.stop-row:hover {
  background: var(--hover);
}

/* A thin hairline connects the stops; it stops short at each terminus. */
.stop-row::before {
  background: var(--edge-strong);
  bottom: 0;
  content: "";
  left: 8px;
  opacity: 0.8;
  position: absolute;
  top: 0;
  width: 1px;
}

.stop-row.first::before {
  top: 50%;
}

.stop-row.last::before {
  bottom: 50%;
}

.stop-node {
  background: transparent;
  border: 1.5px solid var(--ink-3);
  border-radius: 999px;
  height: 9px;
  left: 4.5px;
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 9px;
}

.stop-row.active .stop-node,
.stop-row.terminus .stop-node {
  background: var(--ink);
  border-color: var(--ink);
}

.stop-row.active {
  background: var(--selected);
}

.stop-name {
  flex-grow: 1;
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
}

.stop-row.active .stop-name {
  color: var(--ink);
  font-weight: 600;
}

.stop-eta {
  color: var(--ink-2);
  flex: none;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}

.stop-eta.now {
  color: var(--ink);
}

.stop-eta.none {
  color: var(--ink-3);
}

/* Scheduled rather than live: same column, clearly softer. */
.stop-eta.sched {
  color: var(--ink-3);
  font-weight: 400;
}

.stop-flag {
  align-items: center;
  background: var(--selected);
  border-radius: 6px;
  color: var(--ink);
  display: inline-flex;
  flex: none;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  gap: 4px;
  padding: 2px 7px;
}

/* Arrivals */

.arrivals {
  display: flex;
  flex-direction: column;
}

.arrival-row {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--r-badge);
  border-top: 1px solid var(--rule);
  cursor: pointer;
  display: flex;
  font-family: inherit;
  gap: var(--sp-3);
  padding: 11px var(--sp-2);
  text-align: left;
  transition: background 0.14s ease;
  width: 100%;
}

.arrival-row:hover {
  background: var(--hover);
}

.bus-chip {
  align-items: center;
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: 6px;
  color: var(--ink-2);
  display: flex;
  flex: none;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  height: 24px;
  justify-content: center;
  min-width: 34px;
  padding: 0 6px;
}

.arrival-copy {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 2px;
  min-width: 0;
}

.arrival-stop {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.arrival-meta {
  color: var(--ink-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.arrival-eta {
  color: var(--ink-2);
  flex: none;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.arrival-eta.now {
  color: var(--ink);
}

/* Notices, placeholders, errors */

.notice {
  align-items: center;
  border: 1px solid var(--edge);
  border-radius: var(--r-btn);
  color: var(--ink-2);
  display: flex;
  font-size: 11.5px;
  gap: var(--sp-2);
  line-height: 1.45;
  margin-bottom: 10px;
  padding: var(--sp-2) 10px;
}

.notice svg {
  color: var(--ink-3);
  flex: none;
}

/* Notices that sit in the pinned header rather than inside the scroller. */
.notice.pinned {
  align-items: flex-start;
  line-height: 1.4;
  margin: var(--sp-4) var(--sp-5) 0;
}

.placeholder {
  color: var(--ink-3);
  display: grid;
  font-size: 12.5px;
  gap: 6px;
  justify-items: center;
  line-height: 1.55;
  padding: var(--sp-8) var(--sp-4);
  text-align: center;
}

.placeholder strong {
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
}

.placeholder-icon {
  border: 1px solid var(--edge);
  border-radius: var(--r-field);
  color: var(--ink-3);
  display: grid;
  height: 42px;
  margin-bottom: var(--sp-1);
  place-items: center;
  width: 42px;
}

.empty {
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.6;
  padding: 28px 10px;
  text-align: center;
}

.empty strong {
  color: var(--ink-2);
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: var(--sp-1);
}

.error-box {
  border: 1px solid var(--edge);
  border-radius: var(--r-btn);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.55;
  margin: var(--sp-4) var(--sp-5);
  padding: 10px var(--sp-3);
}

/* ---------------------------------------------------------------------------
   Floating status bar & map controls
--------------------------------------------------------------------------- */

.status-bar {
  align-items: center;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--edge);
  border-radius: var(--r-field);
  box-shadow: var(--shadow);
  display: flex;
  gap: var(--sp-3);
  height: 44px;
  padding: 0 6px 0 14px;
  position: fixed;
  right: calc(var(--sp-5) + var(--safe-right));
  top: calc(var(--sp-5) + var(--safe-top));
  z-index: 600;
}

.live-dot {
  background: var(--ink-3);
  border-radius: 999px;
  flex: none;
  height: 6px;
  width: 6px;
}

.live-dot.active {
  background: var(--live);
}

#liveText {
  color: var(--ink);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}

.bar-rule {
  background: var(--rule);
  flex: none;
  height: 20px;
  width: 1px;
}

.pill {
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: var(--r-badge);
  color: var(--ink-2);
  cursor: pointer;
  flex: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  height: 32px;
  padding: 0 var(--sp-3);
  transition: background 0.14s ease, color 0.14s ease;
  white-space: nowrap;
}

.pill:hover {
  background: var(--hover);
  color: var(--ink);
}

.pill.on {
  background: var(--invert-bg);
  border-color: transparent;
  color: var(--invert-ink);
}

.status-bar .icon-btn {
  height: 32px;
  width: 32px;
}

#refreshButton.spin svg {
  animation: spin 0.6s linear;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.map-controls {
  bottom: calc(var(--sp-5) + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  position: fixed;
  right: calc(var(--sp-5) + var(--safe-right));
  z-index: 600;
}

.map-btn {
  align-items: center;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--edge);
  border-radius: var(--r-field);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  height: 40px;
  justify-content: center;
  transition: background 0.14s ease;
  width: 40px;
}

.map-btn:hover {
  background: var(--glass-raised);
}

.map-btn.on {
  background: var(--invert-bg);
  border-color: transparent;
  color: var(--invert-ink);
}

.map-btn.loading svg {
  animation: spin 1s linear infinite;
}

/* Grouped zoom buttons read as one control. */
.map-btn-group {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--edge);
  border-radius: var(--r-field);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-btn-group .map-btn {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.map-btn-group .map-btn + .map-btn {
  border-top: 1px solid var(--rule);
}

/* ---------------------------------------------------------------------------
   Map overlays — popups, markers
--------------------------------------------------------------------------- */

.app-popup .leaflet-popup-content-wrapper {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--edge);
  border-radius: var(--r-field);
  box-shadow: var(--shadow);
  color: var(--ink-2);
}

.app-popup .leaflet-popup-content {
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  margin: 11px 13px;
  min-width: 160px;
}

.app-popup .leaflet-popup-tip {
  background: var(--glass);
  border: 1px solid var(--edge);
}

.popup-title {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: var(--sp-2);
  margin-bottom: 5px;
}

.popup-title strong {
  font-size: 13px;
  font-weight: 600;
}

.popup-rows {
  color: var(--ink-3);
  display: grid;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  gap: 2px;
}

.popup-rows .strong {
  color: var(--ink-2);
}

.app-tooltip {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--edge);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 7px;
}

.app-tooltip::before {
  display: none;
}

/* Live bus: white disc, dark glyph, thin outline, small glass plate. */
.bus-marker {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  height: 34px;
  width: 34px;
}

.bus-puck {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  display: grid;
  flex: none;
  height: 34px;
  place-items: center;
  width: 34px;
}

.bus-puck svg {
  height: 19px;
  width: 19px;
}

.bus-tag {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--edge);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding: 2px 7px;
  white-space: nowrap;
}

.bus-marker.stale {
  opacity: 0.5;
}

.user-dot {
  background: var(--invert-bg);
  border: 2px solid var(--invert-ink);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  height: 14px;
  width: 14px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------------------
   Narrow screens — the rail becomes a bottom sheet
--------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .rail,
  body:not(.has-route) .rail {
    border-radius: var(--r-panel) var(--r-panel) 0 0;
    bottom: 0;
    flex-direction: column;
    left: 0;
    padding-bottom: var(--safe-bottom);
    right: 0;
    top: 48dvh;
    width: auto;
  }

  .discover,
  body:not(.has-route) .discover {
    width: 100%;
  }

  /* No room for two columns: details take over the sheet. */
  body.has-route .discover {
    display: none;
  }

  /* The planner keeps its inputs; steps sit under them instead. */
  body.has-journey .detail {
    border-top: 1px solid var(--rule);
  }

  .detail {
    border-left: 0;
  }

  .status-bar {
    left: calc(var(--sp-3) + var(--safe-left));
    right: calc(var(--sp-3) + var(--safe-right));
    top: calc(var(--sp-3) + var(--safe-top));
  }

  .map-controls {
    bottom: calc(52dvh + var(--sp-3));
    right: calc(var(--sp-3) + var(--safe-right));
  }
}

/* Direction arrows: the accent colour with a casing outline so they read on
   any basemap without adding another hue. */
.route-arrow {
  display: block;
  height: 16px;
  width: 16px;
}

.route-arrow svg {
  display: block;
  height: 16px;
  width: 16px;
}

.route-arrow svg path {
  fill: var(--route-accent, var(--ink));
  paint-order: stroke fill;
  stroke: var(--casing);
  stroke-width: 1.6px;
}

/* ---------------------------------------------------------------------------
   Map legend
   Only symbols the app actually draws. The kiosk's ON/OFF Trip, Contingency
   and Disabled Friendly states are absent from the public GTFS-RT feed, so
   they are deliberately not invented here.
--------------------------------------------------------------------------- */

.legend {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--edge);
  border-radius: var(--r-field);
  bottom: calc(var(--sp-5) + var(--safe-bottom));
  box-shadow: var(--shadow);
  max-width: 208px;
  padding: var(--sp-3) 14px;
  position: fixed;
  right: calc(72px + var(--safe-right));
  z-index: 600;
}

.legend-head {
  align-items: center;
  display: flex;
  gap: var(--sp-4);
  justify-content: space-between;
}

.legend-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  list-style: none;
  margin: var(--sp-3) 0 0;
  padding: 0;
}

.legend-body li {
  align-items: center;
  color: var(--ink-2);
  display: flex;
  font-size: 11.5px;
  font-weight: 500;
  gap: 10px;
}

/* Nothing to tap when the feed carries no vehicles. */
body.no-live-feed .legend-note {
  display: none;
}

.legend-note {
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.45;
  margin: var(--sp-3) 0 0;
  padding-top: 10px;
}

/* Collapsed: the header alone stays, as a compact handle. */
.legend.collapsed .legend-body,
.legend.collapsed .legend-note {
  display: none;
}

.legend .icon-expand {
  display: none;
}

.legend.collapsed .icon-expand {
  display: block;
}

.legend.collapsed .icon-collapse {
  display: none;
}

/* Swatches mirror the real map symbols. */
.lg {
  display: block;
  flex: none;
}

.lg-bus {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  display: grid;
  height: 20px;
  place-items: center;
  width: 20px;
}

.lg-bus svg {
  height: 12px;
  width: 12px;
}

.lg-bus.stale {
  opacity: 0.5;
}

.lg-stop {
  background: #ffffff;
  border: 2px solid var(--route-accent, var(--ink));
  border-radius: 999px;
  height: 11px;
  margin: 0 4px;
  width: 11px;
}

.lg-terminus {
  background: var(--ink);
  border-radius: 999px;
  height: 11px;
  margin: 0 4px;
  width: 11px;
}

.lg-arrow {
  height: 14px;
  width: 18px;
}

.lg-arrow svg {
  display: block;
  height: 14px;
  rotate: 90deg;
  width: 14px;
}

.lg-arrow svg path {
  fill: var(--route-accent, var(--ink));
  paint-order: stroke fill;
  stroke: var(--casing);
  stroke-width: 1.6px;
}

.lg-line {
  border-radius: 999px;
  height: 4px;
  margin: 0 1px;
  width: 18px;
}

.lg-line.ahead {
  background: var(--progress-ahead);
  height: 5px;
}

.lg-line.passed {
  background: repeating-linear-gradient(
    to right,
    var(--progress-passed) 0 3px,
    transparent 3px 8px
  );
  height: 3px;
}

.lg-line.accent {
  background: var(--route-accent, var(--ink-2));
}

.lg-oku {
  color: var(--ink-2);
  height: 15px;
  width: 15px;
}

.lg-oku svg {
  display: block;
  height: 15px;
  width: 15px;
}

/* Only rail feeds flag accessibility, so the row appears only for rail. */
.legend-rail {
  display: none !important;
}

body.mode-rail .legend-rail {
  display: flex !important;
}

.lg-you {
  background: var(--invert-bg);
  border: 2px solid var(--invert-ink);
  border-radius: 999px;
  height: 12px;
  margin: 0 4px;
  width: 12px;
}

@media (max-width: 1100px) {
  .legend {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   Journey planner
--------------------------------------------------------------------------- */

.view-tabs {
  margin: 0 var(--sp-5) var(--sp-4);
}

.journey {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: var(--sp-3);
  min-height: 0;
  padding: 0 var(--sp-5);
}

/* Once a route is on screen the inputs are in the way, so they fold into a
   single line that reopens them. */
.jp-summary {
  align-items: center;
  background: var(--glass-raised);
  border: 1px solid var(--edge);
  border-radius: var(--r-field);
  display: none;
  gap: var(--sp-2);
  min-height: 42px;
  padding: 0 6px 0 var(--sp-3);
}

.journey.collapsed .jp-summary {
  display: flex;
}

.journey.collapsed .jp-field,
.journey.collapsed .jp-go {
  display: none;
}

.jp-summary-text {
  align-items: center;
  color: var(--ink-2);
  display: flex;
  flex-grow: 1;
  font-size: 13px;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.jp-summary-text b {
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-summary-arrow {
  color: var(--ink-3);
  flex: none;
}

.jp-edit {
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: var(--r-badge);
  color: var(--ink-2);
  cursor: pointer;
  flex: none;
  font-family: inherit;
  font-size: 12px;
  min-height: 30px;
  padding: 0 10px;
}

.jp-edit:hover {
  background: var(--hover);
  color: var(--ink);
}

.jp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.jp-row {
  align-items: center;
  background: var(--glass-raised);
  border: 1px solid var(--edge);
  border-radius: var(--r-field);
  display: flex;
  gap: var(--sp-2);
  height: 42px;
  padding: 0 6px 0 var(--sp-3);
  transition: border-color 0.14s ease;
}

.jp-row:focus-within {
  border-color: var(--edge-strong);
}

.jp-row input {
  background: transparent;
  border: 0;
  color: var(--ink);
  flex-grow: 1;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  min-width: 0;
  outline: none;
}

.jp-row input::placeholder {
  color: var(--ink-3);
}

.jp-results {
  display: flex;
  flex-direction: column;
}

.jp-results:empty {
  display: none;
}

.jp-result {
  background: transparent;
  border: 0;
  border-radius: var(--r-badge);
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  padding: 9px var(--sp-2);
  text-align: left;
}

.jp-result:hover {
  background: var(--hover);
  color: var(--ink);
}

.jp-result small {
  color: var(--ink-3);
  display: block;
  font-size: 10.5px;
  margin-top: 2px;
}

.jp-go {
  background: var(--invert-bg);
  border: 0;
  border-radius: var(--r-btn);
  color: var(--invert-ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  min-height: 40px;
}

.jp-go:disabled {
  background: transparent;
  border: 1px solid var(--edge);
  color: var(--ink-3);
  cursor: default;
}

.jp-output {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: var(--sp-2);
  min-height: 0;
  padding-bottom: var(--sp-4);
}

/* An itinerary reads as one block: headline times, then the legs. */
.itin {
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: var(--r-field);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-family: inherit;
  gap: 10px;
  padding: var(--sp-3);
  text-align: left;
  transition: background 0.14s ease, border-color 0.14s ease;
  width: 100%;
}

.itin:hover {
  background: var(--hover);
}

.itin.active {
  background: var(--selected);
  border-color: var(--edge-strong);
}

.itin-head {
  align-items: baseline;
  display: flex;
  gap: var(--sp-2);
  justify-content: space-between;
}

.itin-time {
  color: var(--ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.itin-dur {
  color: var(--ink-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.itin-meta {
  color: var(--ink-3);
  font-size: 11px;
}

.itin-lines {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.itin-arrow {
  color: var(--ink-3);
  font-size: 11px;
}

.itin-legs {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.itin-leg {
  align-items: center;
  color: var(--ink-2);
  display: flex;
  font-size: 12px;
  gap: var(--sp-2);
}

.itin-leg .badge {
  font-size: 11px;
  height: 21px;
  min-width: 32px;
  padding: 0 6px;
}

.itin-leg .walk-icon {
  color: var(--ink-3);
  flex: none;
}

.itin-leg-copy {
  flex-grow: 1;
  min-width: 0;
}

.itin-leg-copy b {
  color: var(--ink);
  font-weight: 500;
}

.itin-leg-time {
  color: var(--ink-3);
  flex: none;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.jp-alert {
  align-items: center;
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: var(--r-btn);
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  font-family: inherit;
  font-size: 12px;
  gap: var(--sp-2);
  justify-content: center;
  min-height: 36px;
  width: 100%;
}

.jp-alert:hover {
  background: var(--hover);
  color: var(--ink);
}

.jp-alert.on {
  background: var(--invert-bg);
  border-color: transparent;
  color: var(--invert-ink);
}

/* Journey drawn on the map */
.jp-pin {
  background: var(--invert-bg);
  border: 2px solid var(--invert-ink);
  border-radius: 999px;
  height: 12px;
  width: 12px;
}

.jp-pin.terminal {
  height: 16px;
  width: 16px;
}

/* ---------------------------------------------------------------------------
   Journey timeline — times in a gutter, one continuous line, every stop on it
--------------------------------------------------------------------------- */

.step-alert {
  margin: var(--sp-4) var(--sp-5) 0;
  width: auto;
}

.tl {
  list-style: none;
  margin: var(--sp-3) 0 0;
  padding: 0;
}

.tl-row {
  display: grid;
  gap: 0 12px;
  grid-template-columns: 42px 16px minmax(0, 1fr);
}

/* Each row paints its own half-slices of the line, so a leg's colour ends
   exactly at the station where the traveller gets off. */
.tl-rail {
  position: relative;
}

.tl-rail::before,
.tl-rail::after {
  content: "";
  left: 50%;
  position: absolute;
  translate: -50% 0;
  width: 3px;
}

.tl-rail::before {
  background: var(--top);
  height: 50%;
  top: 0;
}

.tl-rail::after {
  background: var(--bottom);
  bottom: 0;
  top: 50%;
}

.tl-node {
  background: var(--page);
  border: 3px solid var(--node);
  border-radius: 999px;
  height: 13px;
  left: 50%;
  position: absolute;
  top: 50%;
  translate: -50% -50%;
  width: 13px;
  z-index: 1;
}

.tl-time {
  color: var(--ink);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding-top: 1px;
  text-align: right;
}

.tl-body {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  min-width: 0;
  overflow-wrap: anywhere;
}

.tl-station {
  padding: 7px 0;
}

.tl-stop {
  display: block;
}

.tl-tags {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

/* Rail station codes match what is printed on the platform signage. */
.tl-code {
  border: 1px solid var(--edge);
  border-radius: 5px;
  color: var(--ink-3);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 1px 5px;
}

/* Exact when the feed names it (bus bay, station entrance). */
.tl-platform {
  background: var(--selected);
  border-radius: 5px;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
}

/* Inferred from the direction the platform is signed by, not a feed value —
   outlined rather than filled so it does not read as an official number. */
.tl-platform.inferred {
  background: transparent;
  border: 1px dashed var(--edge-strong);
  color: var(--ink-2);
  font-weight: 500;
}

/* Intermediate stops sit lighter and smaller — present, but not shouting. */
.tl-minor {
  padding: 4px 0;
}

.tl-minor .tl-time {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 400;
}

.tl-minor .tl-body {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 400;
}

.tl-minor .tl-node {
  border-width: 2px;
  height: 8px;
  width: 8px;
}

.tl-seg {
  padding: 6px 0;
}

.tl-seg .tl-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tl-ride {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tl-towards {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
}

.tl-meta {
  color: var(--ink-3);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.tl-walk {
  align-items: center;
  color: var(--ink-2);
  display: flex;
  font-size: 12.5px;
  gap: 7px;
}

.badge.inline {
  display: inline-flex;
  flex: none;
  font-size: 11px;
  height: 20px;
  min-width: 30px;
  padding: 0 7px;
}

/* The reload offer sits out of the way until tapped. */
.update-prompt {
  background: var(--invert-bg);
  border: 0;
  border-radius: var(--r-btn);
  bottom: calc(var(--sp-5) + var(--safe-bottom));
  box-shadow: var(--shadow);
  color: var(--invert-ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  left: 50%;
  min-height: 38px;
  padding: 0 var(--sp-4);
  position: fixed;
  translate: -50% 0;
  z-index: 900;
}

/* ---------------------------------------------------------------------------
   Narrow screens — the planner and its timeline on a phone
--------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  /* Planning needs more sheet than browsing does. */
  body.has-journey .rail {
    top: 22dvh;
  }

  /* The route search duplicates the planner's own fields here. */
  body.has-journey .search {
    display: none;
  }

  body.has-journey .brand {
    padding-bottom: var(--sp-3);
  }

  /* Cap the inputs and let them scroll internally; the timeline then takes
     everything left over without either half forcing the sheet to overflow. */
  body.has-journey .discover {
    flex: 0 0 auto;
    max-height: 42dvh;
    overflow-y: auto;
  }

  body.has-journey .journey {
    flex: none;
  }

  /* The chooser is a picker, not the content — one card's worth, scrollable.
     Everything else goes to the timeline, which is what you actually read. */
  body.has-journey .jp-output {
    flex: none;
    max-height: 104px;
  }

  body.has-journey .detail {
    border-top: 1px solid var(--rule);
    flex: 1 1 auto;
    min-height: 0;
  }

  body.has-journey .detail-head {
    padding-top: var(--sp-3);
  }

  /* On a phone the planner sheet leaves too little map for a floating control
     stack — measured on-device it landed on top of the sheet. Nothing is lost
     by dropping it here: pinch and double-tap zoom work on touch, and the
     planner carries its own "use my location" button. */
  body.has-journey .map-controls {
    display: none;
  }

  /* On a phone the route list would push the planner off screen entirely. */
  body.has-journey .list-head,
  body.has-journey .routes,
  body.has-journey .rail-foot,
  body.has-journey #routesView {
    display: none;
  }

  .update-prompt {
    bottom: auto;
    top: calc(68px + var(--safe-top));
  }
}

/* Very narrow: the time gutter costs more than it gives. */
@media (max-width: 420px) {
  .tl-row {
    gap: 0 9px;
    grid-template-columns: 36px 14px minmax(0, 1fr);
  }

  .tl-time {
    font-size: 11.5px;
  }

  .tl-body {
    font-size: 13px;
  }
}

/* ---------------------------------------------------------------------------
   Journey tracking — progress down the timeline
--------------------------------------------------------------------------- */

/* Behind you: dimmed, so your eye lands on where you are. */
.tracking .tl-row.done .tl-time,
.tracking .tl-row.done .tl-stop,
.tracking .tl-row.done .tl-body {
  opacity: 0.4;
}

.tracking .tl-row.done .tl-node {
  background: var(--ink-3);
  border-color: var(--ink-3);
}

/* Where you are now. */
.tracking .tl-row.current {
  background: var(--selected);
  border-radius: var(--r-badge);
}

.tracking .tl-row.current .tl-stop {
  font-weight: 600;
}

.tracking .tl-row.current .tl-node {
  box-shadow: 0 0 0 4px var(--selected);
}

/* The live "180 m left" counter, only on the current step. */
.tl-left {
  color: var(--ink);
  display: inline-block;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin-top: 3px;
}

.tl-left[hidden] {
  display: none;
}

/* A live journey earns the green dot, same as live vehicles. */
.tracking .live-dot {
  background: var(--live);
}
