/* ==========================================================================
   bussy — High Valley Transit live map
   Design: deep-ink glass, champagne accent, route-colour data layer.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/vendor/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/vendor/fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */

:root {
  --bg: #05070c;
  --bg-elev: #0a0e16;
  --surface: rgba(16, 21, 31, 0.72);
  --surface-solid: #0e131d;
  --surface-soft: rgba(255, 255, 255, 0.035);
  --surface-softer: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);

  --text: #eef2f8;
  --text-dim: #9aa7b8;
  --text-faint: #6b7889;

  --gold: #ecdcae;
  --gold-deep: #c9b477;
  --mint: #7cf0c8;
  --amber: #ffc86b;
  --coral: #ff7a70;
  --sky: #7fb0ff;

  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #fb7185;

  --radius-xl: 26px;
  --radius-l: 20px;
  --radius-m: 14px;
  --radius-s: 10px;

  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.35);
  --shadow-deep: 0 28px 80px rgba(0, 0, 0, 0.55);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable",
    "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", -apple-system, "Segoe UI", sans-serif;

  --sheet-peek: 224px;
  --sheet-ty: calc(100dvh - var(--sheet-peek));
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 82% -12%, rgba(201, 180, 119, 0.13), transparent 62%),
    radial-gradient(900px 600px at -10% 108%, rgba(88, 118, 255, 0.14), transparent 60%),
    linear-gradient(180deg, #06090f 0%, #05070c 100%);
  z-index: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 8px;
}

::selection {
  background: rgba(236, 220, 174, 0.28);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

.map {
  position: absolute;
  inset: 0;
  background: #070a10;
  z-index: 1;
}

.map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(600px 400px at 50% 40%, #0b111c, #05070c 70%);
  z-index: 2;
  transition: opacity 0.5s var(--ease-out);
}

.map-loading-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13.5px;
  letter-spacing: 0.01em;
}

.map-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(236, 220, 174, 0.24);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}

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

/* --------------------------------------------------------------------------
   HUD — floating brand + actions over the map
   -------------------------------------------------------------------------- */

.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 600;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 0;
  pointer-events: none;
}

.hud > * {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px 0 10px;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(26, 33, 47, 0.86), rgba(10, 14, 22, 0.9));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  transition: transform 0.25s var(--ease-out), border-color 0.25s;
}

.brand:hover {
  border-color: var(--line-strong);
}

.brand:active {
  transform: scale(0.97);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(145deg, #f4e7c0, var(--gold-deep));
  color: #1a1608;
  box-shadow: 0 2px 10px rgba(201, 180, 119, 0.28);
}

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

.brand-word {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  padding-bottom: 2px;
}

.brand-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
  padding: 4px 8px 4px 7px;
  border-radius: 999px;
  background: rgba(124, 240, 200, 0.1);
  color: var(--mint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.brand-live .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(124, 240, 200, 0.6);
  animation: pulse 2.4s infinite;
}

.brand-live.is-stale {
  background: rgba(255, 200, 107, 0.12);
  color: var(--amber);
}

.brand-live.is-stale .dot {
  background: var(--amber);
  animation: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(124, 240, 200, 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(124, 240, 200, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(124, 240, 200, 0);
  }
}

.hud-actions {
  display: flex;
  gap: 8px;
  padding-top: 2px;
}

.hud-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  color: var(--text);
  background: linear-gradient(150deg, rgba(26, 33, 47, 0.86), rgba(10, 14, 22, 0.9));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  transition: transform 0.2s var(--ease-out), background 0.2s, border-color 0.2s;
}

.hud-btn svg {
  width: 21px;
  height: 21px;
}

.hud-btn:hover {
  border-color: var(--line-strong);
}

.hud-btn:active {
  transform: scale(0.93);
}

.hud-btn.is-active {
  color: #1a1608;
  background: linear-gradient(150deg, #f4e7c0, var(--gold-deep));
  border-color: transparent;
}

.hud-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--gold);
  border: 2px solid #101620;
}

.hud-badge:empty {
  display: none;
}

/* --------------------------------------------------------------------------
   Sheet
   -------------------------------------------------------------------------- */

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background:
    linear-gradient(180deg, rgba(20, 26, 38, 0.92), rgba(9, 12, 19, 0.96) 34%),
    var(--surface-solid);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(34px) saturate(150%);
  -webkit-backdrop-filter: blur(34px) saturate(150%);
  transform: translate3d(0, var(--sheet-ty), 0);
  transition: transform 0.46s var(--ease-out);
  will-change: transform;
  overflow: hidden;
}

.sheet.is-dragging {
  transition: none;
}

.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 120px);
  mask-image: linear-gradient(180deg, #000, transparent 140px);
}

.sheet-grabber {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  height: 26px;
  padding-top: 9px;
  cursor: grab;
  touch-action: none;
}

.sheet-grabber span {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.sheet.is-dragging .sheet-grabber {
  cursor: grabbing;
}

.sheet-header {
  flex: 0 0 auto;
  padding: 0 14px 10px;
  position: relative;
  z-index: 1;
}

.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 2px 16px calc(30px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
  position: relative;
  z-index: 1;
}

.sheet-body::-webkit-scrollbar {
  width: 8px;
}

.sheet-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.sheet-body:focus {
  outline: none;
}

/* Desktop brand row inside the panel */
.sheet-brand {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 2px 14px;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.live-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  animation: pulse 2.4s infinite;
}

.live-status.is-stale .dot {
  background: var(--amber);
  animation: none;
}

/* --------------------------------------------------------------------------
   Tabs + headers
   -------------------------------------------------------------------------- */

.tabs {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 3px;
  padding: 4px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tabs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tab-search {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  flex: 0 0 auto;
}

[hidden] {
  display: none !important;
}

.tab {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 4px;
  border-radius: 11px;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  transition: background 0.24s var(--ease-out), color 0.2s, transform 0.2s;
}

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

.tab svg {
  width: 16px;
  height: 16px;
  opacity: 0.85;
}

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

.tab.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.tab:active {
  transform: scale(0.97);
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 2px 0;
}

.icon-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  transition: background 0.2s, transform 0.2s, color 0.2s;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn.is-starred {
  color: var(--gold);
  background: rgba(236, 220, 174, 0.12);
  border-color: rgba(236, 220, 174, 0.24);
}

.detail-head .head-text {
  min-width: 0;
  flex: 1;
}

.detail-head .eyebrow {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1px;
}

.detail-head .head-title {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Generic content
   -------------------------------------------------------------------------- */

.view {
  animation: view-in 0.42s var(--ease-out) both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.section {
  margin-top: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.section-title .meta {
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--text-faint);
}

.page-title {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 6px 2px 2px;
}

.page-sub {
  margin: 0 2px 4px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

.hint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.5;
}

.hint svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--gold);
}

/* --------------------------------------------------------------------------
   Cards + rows
   -------------------------------------------------------------------------- */

.card {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-l);
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  transition: background 0.22s var(--ease-out), border-color 0.22s,
    transform 0.22s var(--ease-out);
}

button.card:hover,
a.card:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.12);
}

button.card:active {
  transform: scale(0.988);
}

.card + .card {
  margin-top: 8px;
}

.card-main {
  flex: 1;
  min-width: 0;
}

.card-title {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.006em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card.is-idle .badge {
  opacity: 0.62;
  filter: saturate(0.6);
}

.card.is-idle .card-title {
  color: var(--text-dim);
}

.badge svg {
  width: 20px;
  height: 20px;
}

.card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: 0 0 auto;
}

.distance {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.chev {
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  flex: 0 0 auto;
}

/* Route badge */
.badge {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--rc, #7fb0ff) 16%, #0c111b);
  border: 1px solid color-mix(in srgb, var(--rc, #7fb0ff) 42%, transparent);
  color: color-mix(in srgb, var(--rc, #7fb0ff) 72%, #ffffff);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.badge.is-sm {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  font-size: 13.5px;
}

.badge.is-solid {
  background: var(--rc, #7fb0ff);
  border-color: transparent;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.badge.is-accent {
  background: linear-gradient(145deg, #f4e7c0, var(--gold-deep));
  border-color: transparent;
  color: #1a1608;
  box-shadow: 0 2px 10px rgba(201, 180, 119, 0.22);
}

/* Arrival chips inside stop cards */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.live-routes {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -2px;
  padding: 0 2px 4px;
  scrollbar-width: none;
}

.live-routes::-webkit-scrollbar {
  display: none;
}

.live-route {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px 8px 8px;
  border-radius: 15px;
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.live-route:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.12);
}

.live-route:active {
  transform: scale(0.97);
}

.live-route .badge {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 12px;
}

.live-route-name {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.live-route-sub {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-faint);
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rc, var(--text-faint));
}

.chip .mins {
  color: var(--text);
}

.chip .mins.is-now {
  color: var(--mint);
}

.chip.is-muted {
  color: var(--text-faint);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Nearby / saved
   -------------------------------------------------------------------------- */

.location-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-l);
  background:
    radial-gradient(320px 160px at 90% -20%, rgba(236, 220, 174, 0.16), transparent 70%),
    linear-gradient(160deg, rgba(28, 36, 52, 0.75), rgba(12, 16, 24, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: var(--shadow-soft);
}

.location-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.location-card p {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 13px;
  max-width: 36ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 13px;
  background: linear-gradient(150deg, #f4e7c0, var(--gold-deep));
  color: #191406;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 24px rgba(201, 180, 119, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, filter 0.2s;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn:hover {
  filter: brightness(1.04);
  box-shadow: 0 10px 28px rgba(201, 180, 119, 0.3);
}

.btn:active {
  transform: scale(0.97);
}

.btn.is-ghost {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
  font-weight: 600;
}

.btn.is-block {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Stop detail
   -------------------------------------------------------------------------- */

.stop-hero {
  position: relative;
  margin-top: 4px;
  padding: 16px 16px 15px;
  border-radius: var(--radius-l);
  background:
    radial-gradient(340px 180px at 100% 0%, rgba(236, 220, 174, 0.12), transparent 65%),
    linear-gradient(165deg, rgba(26, 33, 47, 0.7), rgba(11, 15, 23, 0.85));
  border: 1px solid var(--line);
  overflow: hidden;
}

.stop-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 26px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.stop-hero h2 {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.032em;
  line-height: 1.15;
  max-width: 22ch;
}

.hero-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.meta-pill svg {
  width: 13px;
  height: 13px;
  opacity: 0.8;
}

.meta-pill.is-route {
  color: color-mix(in srgb, var(--rc, #7fb0ff) 80%, #fff);
  background: color-mix(in srgb, var(--rc, #7fb0ff) 12%, transparent);
  border-color: color-mix(in srgb, var(--rc, #7fb0ff) 26%, transparent);
}

/* Arrival rows */
.arrivals {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.arrival {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 13px 12px 12px;
  border-radius: 17px;
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  text-align: left;
  width: 100%;
}

.arrival::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--rc, #7fb0ff);
  opacity: 0.9;
}

.arrival:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.12);
}

button.arrival:active {
  transform: scale(0.986);
}

.arrival-when {
  display: block;
  text-align: right;
  min-width: 64px;
}

.arrival-mins {
  display: block;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.arrival-mins small {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  margin-left: 2px;
}

.arrival-mins.is-now {
  color: var(--mint);
}

.arrival-clock {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.arrival-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arrival-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arrival-sub .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: 0 0 auto;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.01em;
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status.is-ok {
  color: var(--ok);
}

.status.is-early {
  color: var(--sky);
}

.status.is-late {
  color: var(--coral);
}

.status.is-now {
  color: var(--mint);
}

/* Schedule */
.schedule {
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.028);
  overflow: hidden;
}

.schedule + .schedule {
  margin-top: 8px;
}

.schedule summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}

.schedule summary::-webkit-details-marker {
  display: none;
}

.schedule summary .count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.schedule summary .chev {
  transition: transform 0.25s var(--ease-out);
}

.schedule[open] summary .chev {
  transform: rotate(90deg);
}

.schedule-body {
  padding: 2px 14px 14px;
}

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

.time {
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.time.is-past {
  opacity: 0.34;
}

.time.is-next {
  color: #1a1608;
  background: var(--gold);
  border-color: transparent;
  font-weight: 650;
}

/* --------------------------------------------------------------------------
   Route detail
   -------------------------------------------------------------------------- */

.route-hero {
  position: relative;
  padding: 18px;
  border-radius: var(--radius-l);
  overflow: hidden;
  background:
    radial-gradient(300px 200px at 88% -10%, color-mix(in srgb, var(--rc) 34%, transparent), transparent 70%),
    linear-gradient(160deg, rgba(26, 33, 47, 0.72), rgba(10, 14, 22, 0.9));
  border: 1px solid color-mix(in srgb, var(--rc) 26%, var(--line));
}

.route-hero .route-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--rc) 65%, #fff);
}

.route-hero .route-kicker .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rc);
}

.route-hero h2 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.route-hero .route-desc {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 12.5px;
}

.route-stat-row {
  display: flex;
  gap: 18px;
  margin-top: 15px;
}

.route-stat {
  min-width: 0;
}

.route-stat .value {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.route-stat .label {
  margin-top: 1px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.seg {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
  color: var(--text-dim);
  transition: background 0.22s, color 0.2s;
}

.seg .seg-name {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seg .seg-sub {
  font-size: 10.5px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seg.is-active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.seg.is-active .seg-sub {
  color: var(--text-dim);
}

/* Stop sequence */
.sequence {
  position: relative;
  padding-left: 6px;
}

.seq-stop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 10px 12px 10px 0;
  border-radius: 12px;
  text-align: left;
  transition: background 0.18s;
}

.seq-stop:hover {
  background: rgba(255, 255, 255, 0.045);
}

.seq-rail {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  display: grid;
  place-items: center;
  align-self: stretch;
}

.seq-rail::before {
  content: "";
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--rc, #7fb0ff) 30%, transparent);
}

.seq-stop:first-child .seq-rail::before {
  top: 50%;
}

.seq-stop:last-child .seq-rail::before {
  bottom: 50%;
}

.seq-dot {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0a0e16;
  border: 2px solid color-mix(in srgb, var(--rc, #7fb0ff) 75%, #fff);
}

.seq-stop.is-first .seq-dot,
.seq-stop.is-last .seq-dot {
  width: 12px;
  height: 12px;
  background: var(--rc, #7fb0ff);
  border-color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--rc, #7fb0ff) 18%, transparent);
}

.seq-body {
  flex: 1;
  min-width: 0;
}

.seq-name {
  display: block;
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seq-sub {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bus list */
.bus-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.055);
  width: 100%;
  text-align: left;
  transition: background 0.2s, border-color 0.2s;
}

.bus-row + .bus-row {
  margin-top: 7px;
}

.bus-row:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.1);
}

.bus-glyph {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--rc, #7fb0ff) 16%, #0c111b);
  color: color-mix(in srgb, var(--rc, #7fb0ff) 78%, #fff);
}

.bus-glyph svg {
  width: 17px;
  height: 17px;
}

.bus-main {
  min-width: 0;
}

.bus-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bus-meta {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bus-load {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-faint);
}

.bus-load .load-bar {
  width: 56px;
}

.load-bar {
  width: 42px;
  height: 4px;
  flex: 0 0 auto;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.load-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--mint);
}

.load-bar i.is-mid {
  background: var(--amber);
}

.load-bar i.is-full {
  background: var(--coral);
}

.bus-when {
  display: block;
  text-align: right;
  min-width: 58px;
}

.bus-eta {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}

.bus-status {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-faint);
  white-space: nowrap;
}

.bus-status.is-ok {
  color: var(--ok);
}

.bus-status.is-early {
  color: var(--sky);
}

.bus-status.is-late {
  color: var(--coral);
}

/* --------------------------------------------------------------------------
   Search
   -------------------------------------------------------------------------- */

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  margin: 8px 0 4px;
}

.search-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.search-head .icon-btn {
  margin-top: 8px;
}

.search-wrap svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-faint);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: var(--text-faint);
}

.search-input:focus {
  outline: none;
  border-color: rgba(236, 220, 174, 0.42);
  background: rgba(255, 255, 255, 0.07);
}

.search-clear {
  position: absolute;
  right: 9px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--text-dim);
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.search-clear svg {
  width: 15px;
  height: 15px;
}

.search-empty {
  padding: 26px 8px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

.result-group + .result-group {
  margin-top: 18px;
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */

.alert {
  display: flex;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

.alert + .alert {
  margin-top: 8px;
}

.alert.is-high {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.22);
  color: #f7e3b8;
}

.alert svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--amber);
}

/* --------------------------------------------------------------------------
   Empty / loading / error states
   -------------------------------------------------------------------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 40px 24px;
  color: var(--text-dim);
}

.empty .empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--gold);
  margin-bottom: 2px;
}

.empty .empty-icon svg {
  width: 24px;
  height: 24px;
}

.empty h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.empty p {
  margin: 0;
  max-width: 30ch;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-faint);
}

.skeleton {
  border-radius: 14px;
  background: linear-gradient(
      100deg,
      rgba(255, 255, 255, 0.04) 30%,
      rgba(255, 255, 255, 0.09) 50%,
      rgba(255, 255, 255, 0.04) 70%
    )
    rgba(255, 255, 255, 0.04);
  background-size: 220% 100%;
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  from {
    background-position: 180% 0;
  }
  to {
    background-position: -40% 0;
  }
}

.sk-card {
  height: 70px;
  margin-bottom: 8px;
}

.sk-line {
  height: 12px;
  margin-bottom: 8px;
}

.sk-line.is-title {
  height: 22px;
  width: 62%;
}

/* Footer */
.data-footer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-faint);
}

.data-footer a {
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding-bottom: 1px;
}

.data-footer a:hover {
  color: var(--gold);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  z-index: 900;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 13px;
  background: rgba(24, 31, 44, 0.94);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   Map — Leaflet overrides
   -------------------------------------------------------------------------- */

.leaflet-container {
  background: #070a10;
  font-family: var(--font-body);
  outline: none;
}

.leaflet-tile-pane {
  /* Intentionally unfiltered: a CSS filter on the tile pane causes a
     compositing seam in Chromium at some viewport sizes. The Esri dark
     basemap is already tuned for this UI. */
  filter: none;
}

.map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 250;
  pointer-events: none;
  box-shadow: inset 0 0 120px 0 rgba(3, 5, 9, 0.5);
  background: linear-gradient(
    180deg,
    rgba(4, 6, 10, 0.28) 0%,
    transparent 16%,
    transparent 74%,
    rgba(4, 6, 10, 0.4) 100%
  );
}

.leaflet-control-attribution {
  background: rgba(7, 10, 16, 0.72) !important;
  color: #6b7889 !important;
  font-size: 9.5px !important;
  padding: 3px 8px !important;
  border-radius: 8px 0 0 0;
  backdrop-filter: blur(10px);
  margin: 0 !important;
}

.leaflet-control-attribution a {
  color: #94a3b8 !important;
}

.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: var(--shadow-soft) !important;
  border-radius: 12px !important;
  overflow: hidden;
  margin-right: 16px !important;
}

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  background: rgba(16, 22, 33, 0.86) !important;
  color: var(--text) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(16px);
}

.leaflet-control-zoom a:hover {
  background: rgba(30, 39, 55, 0.94) !important;
}

/* Stop markers */
.stop-marker {
  background: none;
  border: 0;
  transition: opacity 0.25s ease;
}

.stop-marker.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.stop-dot {
  display: block;
  width: 9px;
  height: 9px;
  margin: 5px;
  border-radius: 50%;
  background: #0a0e16;
  border: 2px solid rgba(214, 226, 241, 0.72);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s var(--ease-spring), background 0.2s, border-color 0.2s;
}

.stop-marker:hover .stop-dot {
  transform: scale(1.35);
  background: var(--gold);
  border-color: #fff;
}

.stop-marker.is-major .stop-dot {
  width: 11px;
  height: 11px;
  margin: 4px;
  border-color: #eef2f8;
}

.stop-marker.is-active .stop-dot {
  background: var(--gold);
  border-color: #fff;
  transform: scale(1.5);
  box-shadow: 0 0 0 5px rgba(236, 220, 174, 0.18), 0 0 18px rgba(236, 220, 174, 0.55);
}

.stop-marker.is-dim .stop-dot {
  opacity: 0.32;
}

/* Selected stop pulse ring */
.pulse-marker {
  background: none;
  border: 0;
}

.pulse-ring {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(236, 220, 174, 0.7);
  animation: ring 2.2s var(--ease-out) infinite;
  pointer-events: none;
}

@keyframes ring {
  0% {
    transform: scale(0.35);
    opacity: 0.9;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* Bus markers */
.bus-marker {
  background: none;
  border: 0;
}

.bus-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 25px;
  padding: 0 7px 0 6px;
  border-radius: 8px;
  background: var(--rc, #7fb0ff);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.55), 0 0 0 1.5px rgba(255, 255, 255, 0.85) inset;
  transform: translate(var(--dx, 0px), var(--dy, 0px));
  transform-origin: 50% 50%;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
  cursor: pointer;
}

.bus-pill:hover {
  transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1.12);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.6), 0 0 0 1.5px #fff inset;
}

.bus-pill .nose {
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-bottom: 6px solid rgba(255, 255, 255, 0.95);
  transform: rotate(var(--h, 0deg));
  transition: transform 0.6s var(--ease-out);
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.4));
}

.bus-marker.is-selected .bus-pill {
  box-shadow: 0 0 0 2.5px #fff, 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* User location */
.me-marker {
  background: none;
  border: 0;
}

.me-dot {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #5b9dff;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 18px rgba(91, 157, 255, 0.6);
}

.me-dot::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 1.5px solid rgba(91, 157, 255, 0.5);
  animation: ring 2.6s var(--ease-out) infinite;
}

/* Route lines */
.route-line {
  transition: opacity 0.3s ease;
}

.route-flow {
  stroke-dasharray: 3 10;
  stroke-linecap: round;
  animation: flow 1.6s linear infinite;
}

@keyframes flow {
  to {
    stroke-dashoffset: -13;
  }
}

/* Vehicle popup */
.leaflet-popup-content-wrapper {
  background: rgba(14, 19, 29, 0.96);
  color: var(--text);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(24px);
  padding: 0;
}

.leaflet-popup-content {
  margin: 0;
  width: 232px !important;
  padding: 13px 14px;
  font-family: var(--font-body);
}

.leaflet-popup-tip {
  background: rgba(14, 19, 29, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.leaflet-container a.leaflet-popup-close-button {
  color: var(--text-dim);
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  font-size: 17px;
  line-height: 20px;
}

.popup-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
  padding-right: 16px;
}

.popup-title {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.popup-sub {
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--text-dim);
}

.popup-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11.5px;
  color: var(--text-dim);
}

.popup-row strong {
  color: var(--text);
  font-weight: 600;
  font-size: 12.5px;
  text-align: right;
}

.popup-eta {
  font-family: var(--font-display);
  font-size: 15px !important;
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   Desktop layout
   -------------------------------------------------------------------------- */

@media (min-width: 900px) {
  :root {
    --sheet-peek: 0px;
  }

  .app {
    display: grid;
    grid-template-columns: 404px minmax(0, 1fr);
    grid-template-rows: 100dvh;
  }

  .map {
    position: relative;
    inset: auto;
    grid-column: 2;
    grid-row: 1;
    height: 100dvh;
  }

  .sheet {
    position: relative;
    inset: auto;
    grid-column: 1;
    grid-row: 1;
    height: 100dvh;
    max-height: none;
    transform: none !important;
    border-radius: 0;
    border-top: 0;
    border-right: 1px solid var(--line);
    background:
      linear-gradient(180deg, rgba(17, 22, 33, 0.9), rgba(8, 11, 17, 0.97) 40%),
      var(--surface-solid);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .sheet-grabber {
    display: none;
  }

  .sheet::before {
    mask-image: linear-gradient(180deg, #000, transparent 200px);
  }

  .sheet-header {
    padding: 18px 18px 10px;
  }

  .sheet-brand {
    display: flex;
    padding: 0 0 16px;
  }

  .sheet-brand .brand {
    height: 44px;
    padding-left: 8px;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .sheet-brand .brand:hover {
    border-color: transparent;
  }

  .sheet-body {
    padding: 4px 18px 28px;
  }

  .brand--float {
    display: none;
  }

  .hud {
    left: 404px;
    padding: 16px 18px 0;
    justify-content: flex-end;
  }

  .hud-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .toast {
    left: calc(404px + (100vw - 404px) / 2);
    bottom: 28px;
  }

  .leaflet-control-zoom {
    margin-right: 18px !important;
  }

  .leaflet-bottom.leaflet-right {
    margin-bottom: 4px;
  }
}

@media (max-width: 899px) {
  .leaflet-control-zoom {
    display: none;
  }

  .leaflet-bottom.leaflet-right {
    margin-right: 2px;
  }
}

/* --------------------------------------------------------------------------
   Small phones + accessibility
   -------------------------------------------------------------------------- */

@media (max-width: 380px) {
  .brand-word {
    font-size: 17px;
  }

  .brand {
    gap: 8px;
    padding-right: 10px;
  }

  .brand-live {
    display: none;
  }

  .page-title {
    font-size: 24px;
  }

  .arrival {
    grid-template-columns: 36px 1fr auto;
    gap: 10px;
    padding: 11px;
  }

  .badge {
    width: 42px;
    height: 42px;
  }
}

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

  .route-flow {
    animation: none;
  }
}

/* Light theme is intentionally not shipped: the map tiles are dark. */
