/* =========================================================================
   SardiniaMobility — Travel Planner
   Editorial design system ispirato al mockup React (mockup/travel-planner).
   Palette, tipografia e layout sono vanilla CSS — nessun framework.
   ========================================================================= */

:root {
  /* Editorial palette */
  --bg:          #F4F2EE;
  --surface:     #FFFFFF;
  --surface-alt: #FAF8F3;
  --ink:         #0E0E10;
  --ink-soft:    #4B4A48;
  --ink-muted:   #8A8884;
  --hairline:    rgba(14, 14, 16, 0.08);
  --hairline-2:  rgba(14, 14, 16, 0.14);

  --accent:      #FF5B2E;
  --accent-ink:  #FFFFFF;
  --accent-bg:   #FFEBE2;

  --good:        #00785A;
  --good-bg:     #DAF0E7;

  --warn:        #C99400;
  --warn-bg:     #FAF0CC;

  --alert:       #E11900;
  --alert-bg:    #FFDFD8;

  /* Transit mode colors (mockup-equivalent) */
  --mode-walk:   #1A1A1A;
  --mode-bus:    #FF5B2E;
  --mode-tram:   #00785A;
  --mode-metro:  #2B3FE6;
  --mode-train:  #8A2BE2;
  --mode-ferry:  #0077B6;

  --mode-bus-bg:   #FFEBE2;
  --mode-tram-bg:  #DAF0E7;
  --mode-metro-bg: #DEE3FF;
  --mode-train-bg: #EDE0FB;
  --mode-walk-bg:  #F4F2EE;

  /* Type */
  --font-display: "Space Grotesk", "Inter", -apple-system, system-ui, sans-serif;
  --font-ui:      "Manrope", "Inter", -apple-system, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

body {
  display: flex;
  justify-content: center;
  overflow: hidden;
}

/* =========================================================================
   SHELL — on desktop a centered column (max 480px), on mobile full-bleed.
   ========================================================================= */
.shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(14, 14, 16, 0.08);
}

@media (min-width: 760px) {
  /* Desktop: mappa fullscreen + pannello sinistro fisso 460px */
  body { background: var(--bg); }
  .shell {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  /* Le 4 screen non si "slidano" più, ma cambiano contenuto del pannello sx.
     La mappa hero diventa fullscreen (sfondo) condivisa fra tutte le screen. */
  .screen {
    inset: 0;
    pointer-events: none;     /* solo i figli interattivi raccolgono eventi */
    transform: none !important;
    transition: opacity .25s ease;
    opacity: 0;
    background: transparent;
  }
  .screen.is-active { opacity: 1; pointer-events: auto; }
  .screen.is-behind { opacity: 0; pointer-events: none; }

  /* La mappa di home è SEMPRE visibile come sfondo globale, anche
     quando l'utente è in search/results/detail. Solo lo sheet di home
     scompare. */
  .screen-home {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .screen-home:not(.is-active) .sheet { display: none; }
  .screen-home:not(.is-active) .map-overlay-top,
  .screen-home:not(.is-active) .map-overlay-right { display: none; }

  /* La map-hero della home riempie lo schermo SOLO come sfondo della home.
     Per le altre screen, riusa #map come sfondo via fixed background.
     Soluzione semplice: estraiamo .map-hero dalla home in posizione fixed full-screen,
     e il bottom-sheet diventa un pannello laterale sinistro che la sovrappone. */
  .screen-home .map-hero {
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    z-index: 1;
  }

  /* Pannello sinistro: bottom-sheet diventa colonna fissa */
  .screen-home .sheet {
    position: fixed;
    top: 16px;
    left: 16px;
    bottom: 16px;
    width: 440px;
    margin-top: 0;
    border-radius: 24px;
    z-index: 100;
    box-shadow: 0 12px 40px rgba(14,14,16,0.18);
    overflow-y: auto;
    background: var(--bg);
    padding: 22px 24px 24px;
    animation: panelIn .35s cubic-bezier(.2,.8,.2,1);
  }
  .screen-home .grabber { display: none; }

  /* Search / Results / Detail diventano anch'essi pannelli a sinistra */
  .screen-search,
  .screen-results,
  .screen-detail {
    position: fixed;
    top: 16px;
    left: 16px;
    bottom: 16px;
    width: 440px;
    border-radius: 24px;
    z-index: 110;
    box-shadow: 0 12px 40px rgba(14,14,16,0.18);
    background: var(--bg);
    overflow: hidden;
  }

  /* Map hero overlay top: solo dentro la mappa visibile, non vicino al pannello */
  .screen-home .map-overlay-top {
    left: 480px;          /* a destra del pannello */
    right: 24px;
    top: 24px;
  }
  .screen-home .map-overlay-right {
    bottom: 30px;
    right: 24px;
  }

  /* Nelle altre screen, mappa interna del componente nascosta, usiamo lo sfondo */
  .screen-results .results-map-mini,
  .screen-detail .detail-map-wrap {
    display: none;
  }
  /* Lista risultati / dettaglio occupa tutta l'altezza del pannello sx */
  .screen-results .results-list-wrap,
  .screen-detail .detail-body {
    margin-top: 0;
    border-radius: 0;
    flex: 1;
    min-height: 0;
  }

  @keyframes panelIn {
    from { transform: translateX(-12px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
  }
}

/* Wide desktop (>1280): pannello un filo più largo + safe area */
@media (min-width: 1280px) {
  .screen-home .sheet,
  .screen-search,
  .screen-results,
  .screen-detail {
    width: 460px;
  }
  .screen-home .map-overlay-top { left: 500px; }
}

/* =========================================================================
   SCREENS (stacked, slide transitions)
   ========================================================================= */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
  overflow: hidden;
}
.screen.is-active {
  transform: translateX(0);
}
.screen.is-behind {
  transform: translateX(-18%);
  pointer-events: none;
}
.screen-home { z-index: 1; }
.screen-search { z-index: 2; overflow-y: auto; }
.screen-results { z-index: 3; }
.screen-detail { z-index: 4; }

/* =========================================================================
   MAP
   ========================================================================= */
.map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #EAE5D9;
}
.leaflet-container {
  font-family: var(--font-ui);
  background: #EAE5D9;
}
.leaflet-control-attribution {
  font-size: 10px !important;
  background: rgba(255, 255, 255, 0.7) !important;
}
.leaflet-control-zoom { display: none !important; }

/* Map pins */
.pin-from, .pin-to {
  background: transparent !important;
  border: none !important;
}
.pin-from .pin-inner, .pin-to .pin-inner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  margin-top: 3px;
  margin-left: 3px;
}
.pin-from .pin-inner { background: var(--ink); }
.pin-to .pin-inner { background: var(--accent); }

/* =========================================================================
   HOME SCREEN
   ========================================================================= */
.map-hero {
  position: relative;
  height: 52%;
  flex-shrink: 0;
  overflow: hidden;
}

.map-overlay-top {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 500;
  pointer-events: none;
}
.map-overlay-top > * { pointer-events: auto; }
.map-overlay-right {
  position: absolute;
  right: 14px;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 500;
}

/* Glass pills */
.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(0, 120, 90, 0.2);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.status-dot.is-stale {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(201, 148, 0, 0.2);
}
.status-dot.is-dead {
  background: var(--alert);
  box-shadow: 0 0 0 3px rgba(225, 25, 0, 0.2);
}
.status-pill-count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-left: 2px;
}

/* Live vehicles toggle pill — same base as .glass-pill but interactive */
.glass-pill-btn {
  border: none;
  cursor: pointer;
  padding: 8px 14px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.glass-pill-btn:active { transform: scale(0.95); }
.glass-pill-btn.is-off {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-muted);
}
.glass-pill-btn .toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 91, 46, 0.2);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.glass-pill-btn.is-off .toggle-icon {
  background: var(--ink-muted);
  box-shadow: 0 0 0 3px rgba(138, 136, 132, 0.2);
}
.glass-cluster { display: flex; gap: 8px; }
.glass-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.glass-icon:active { transform: scale(0.92); }
.glass-icon-small {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.glass-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px #fff;
}

/* Bottom sheet */
.sheet {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--bg);
  border-top-left-radius: 32px;
  border-top-right-radius: 32px;
  margin-top: -24px;
  z-index: 10;
  padding: 10px 20px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -6px 30px rgba(14, 14, 16, 0.06);
  animation: sheetUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.grabber {
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: var(--hairline-2);
  margin: 0 auto 14px;
}

.headline { margin-bottom: 14px; }
.eyebrow {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.display {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1.02;
  color: var(--ink);
  letter-spacing: -1.4px;
  margin: 4px 0 0;
  font-weight: 600;
}
.display .accent { color: var(--accent); }

/* Search bar pill */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--surface);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  box-shadow: 0 1px 2px rgba(14, 14, 16, 0.04);
  margin-bottom: 14px;
  cursor: pointer;
  font-family: var(--font-ui);
  color: var(--ink);
  text-align: left;
}
.search-bar-text {
  flex: 1;
  font-size: 15px;
  color: var(--ink-soft);
}
.search-bar-sep {
  width: 1px;
  height: 18px;
  background: var(--hairline-2);
}
.search-bar-sparkle { color: var(--accent); }

/* Quick chips grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.quick-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 10px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-ui);
  color: var(--ink);
  transition: transform 0.15s ease;
}
.quick-chip:active { transform: scale(0.97); }
.quick-chip-dashed {
  background: transparent;
  border: 1.5px dashed var(--hairline-2);
}
.quick-chip-dashed .quick-label { color: var(--ink-muted); }
.quick-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.quick-icon-plain {
  background: transparent;
  color: var(--ink-muted);
}
.quick-label {
  font-size: 12px;
  font-weight: 600;
}
.quick-time {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-muted);
}

/* Live strip (departures) */
.live-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.live-head-title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.live-head-meta {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}
.live-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 14px;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
  scrollbar-width: none;
}
.live-strip::-webkit-scrollbar { display: none; }

.dep-card {
  min-width: 176px;
  flex-shrink: 0;
  background: var(--surface);
  border-radius: 18px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  font-family: var(--font-ui);
  color: var(--ink);
}
.dep-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dep-card-dest {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dep-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

/* Line badge — round for metro/train, rounded-rect for bus/tram */
.line-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}
.line-badge-md { width: 24px; height: 24px; border-radius: 6px; font-size: 13px; }
.line-badge-lg { width: 30px; height: 30px; border-radius: 6px; font-size: 15px; }
.line-badge.is-round { border-radius: 50%; }

/* Big time (BigTime) */
.big-time {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--font-ui);
}
.big-time-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.8px;
  line-height: 1;
}
.big-time-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.2px;
}

/* Crowd indicator (3 bars) */
.crowd {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.crowd-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
}
.crowd-bar {
  width: 3px;
  border-radius: 1px;
  background: rgba(14, 14, 16, 0.15);
}
.crowd-bar-1 { height: 7px; }
.crowd-bar-2 { height: 9px; }
.crowd-bar-3 { height: 11px; }
.crowd-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1px;
}
.crowd-1 .crowd-bar-1 { background: var(--good); }
.crowd-1 .crowd-label { color: var(--good); }
.crowd-2 .crowd-bar-1, .crowd-2 .crowd-bar-2 { background: var(--warn); }
.crowd-2 .crowd-label { color: var(--warn); }
.crowd-3 .crowd-bar-1, .crowd-3 .crowd-bar-2, .crowd-3 .crowd-bar-3 { background: var(--alert); }
.crowd-3 .crowd-label { color: var(--alert); }

/* =========================================================================
   SEARCH SCREEN
   ========================================================================= */
.search-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 14px;
  background: var(--bg);
}
.search-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:active { background: var(--surface-alt); }
.icon-btn-spacer { width: 40px; flex-shrink: 0; }
.display-sm {
  flex: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.8px;
  font-weight: 600;
}

/* From/To card */
.fromto-card {
  position: relative;
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.point-row {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  gap: 14px;
  position: relative;
}
.point-dot {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.point-dot-from {
  width: 12px;
  height: 12px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  margin: 2px;
}
.point-dot-to {
  color: var(--accent);
}
.point-body { flex: 1; min-width: 0; }
.point-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.point-input-wrap {
  position: relative;
  margin-top: 2px;
  padding-right: 54px;
}
.point-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.2px;
  padding: 0;
}
.point-input::placeholder {
  font-weight: 500;
  color: var(--ink-soft);
}
.point-clear {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--hairline);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: none;
}
.point-input-wrap.has-value .point-clear { display: inline-flex; align-items: center; justify-content: center; }

.point-divider {
  height: 1px;
  background: var(--hairline);
  margin-left: 44px;
}

/* Swap button è fuori dalla fromto-card per non collidere con le X clear */
.fromto-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.fromto-row .fromto-card { flex: 1; min-width: 0; }
.swap-btn {
  flex-shrink: 0;
  align-self: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, background 0.15s ease;
}
.swap-btn:hover { background: var(--surface-alt); color: var(--ink); }
.swap-btn:active { transform: scale(0.92); }

/* Autocomplete panel */
.autocomplete-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(14, 14, 16, 0.08);
}
.autocomplete-panel.is-open { display: block; }
.ac-section-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 10px 14px 4px;
}
.ac-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.ac-item:hover, .ac-item.is-highlight { background: var(--surface-alt); }
.ac-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-alt);
  color: var(--ink-soft);
}
.ac-icon.ac-icon-stop {
  background: var(--accent-bg);
  color: var(--accent);
}
.ac-body { flex: 1; min-width: 0; }
.ac-name {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-meta {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-loading, .ac-empty {
  padding: 14px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
}

/* Filter + time row */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: default;
}
.filter-chip-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.time-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}
.time-input {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 6px 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink);
  outline: none;
}
.time-input:focus { border-color: var(--ink); }
.time-now {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 7px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Primary button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  padding: 0 24px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 14px rgba(255, 91, 46, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(255, 91, 46, 0.25); }
.btn-primary:disabled {
  opacity: 0.55;
  cursor: wait;
}
.btn-primary.is-dark {
  background: var(--ink);
  box-shadow: 0 4px 14px rgba(14, 14, 16, 0.22);
}
.btn-primary.is-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline-2);
  box-shadow: none;
}

.btn-search-submit { margin-top: 4px; }

/* =========================================================================
   RESULTS SCREEN
   ========================================================================= */
.results-header {
  padding: 16px 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
}
.results-header-title { flex: 1; min-width: 0; }
.eyebrow-sm {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.results-subtitle {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.6px;
  font-weight: 600;
  margin-top: 2px;
}
.results-map-mini {
  position: relative;
  height: 34%;
  min-height: 180px;
  flex-shrink: 0;
  overflow: hidden;
}
.results-list-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  margin-top: -16px;
  z-index: 5;
  padding: 14px 16px 20px;
  position: relative;
  box-shadow: 0 -6px 22px rgba(14, 14, 16, 0.06);
}
.results-list-head {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}
.results-list-head .sort-label {
  color: var(--ink-soft);
  font-weight: 600;
}
.results-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}

/* Itinerary card */
.itinerary {
  background: var(--surface);
  border-radius: 22px;
  border: 1px solid var(--hairline);
  padding: 16px 16px 14px;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: cardIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.itinerary:active { transform: scale(0.99); }
.itinerary.is-active {
  border-color: var(--ink);
  box-shadow: 0 3px 0 0 rgba(14, 14, 16, 0.08);
}
/* Itinerario con bus live attivo per il primo transit leg */
.itinerary.is-live {
  border-color: var(--good);
  background: linear-gradient(135deg, var(--good-bg) 0%, var(--surface) 65%);
  animation: liveCardPulse 1.5s ease-in-out infinite;
}
@keyframes liveCardPulse {
  0%, 100% {
    box-shadow:
      0 4px 16px rgba(0, 120, 90, 0.2),
      0 0 0 0 rgba(0, 120, 90, 0.5);
  }
  50% {
    box-shadow:
      0 4px 22px rgba(0, 120, 90, 0.3),
      0 0 0 10px rgba(0, 120, 90, 0);
  }
}
.itinerary.is-live::before {
  content: 'LIVE';
  position: absolute;
  top: 12px;
  right: 14px;
  background: var(--good);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  padding: 3px 7px;
  border-radius: 6px;
  z-index: 1;
}

/* Card del giorno successivo: leggermente più tenue */
.itinerary.is-tomorrow {
  background: var(--surface-alt);
  opacity: 0.94;
}

.tag-chip.tag-tomorrow {
  background: var(--ink);
  color: #fff;
}

/* Separatore "Domani · giorno mese" */
.day-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 4px 12px;
  color: var(--ink-muted);
}
.day-separator-line {
  flex: 1;
  height: 1px;
  background: var(--hairline-2);
}
.day-separator-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-soft);
}

.itinerary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1px;
}
.tag-chip.tag-fastest { background: var(--accent-bg); color: var(--accent); }
.tag-chip.tag-walk    { background: var(--surface-alt); color: var(--ink-soft); }
.tag-chip.tag-less    { background: var(--surface-alt); color: var(--ink); }
.tag-chip.tag-eco     { background: var(--good-bg); color: var(--good); }
.tag-chip.tag-next    { background: var(--surface-alt); color: var(--ink-muted); }

.itinerary-headline {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.itinerary-min {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--ink);
  letter-spacing: -1px;
  line-height: 1;
  font-weight: 600;
}
.itinerary-min-label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.itinerary-arrival {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-left: 8px;
}
.itinerary-right {
  text-align: right;
  flex-shrink: 0;
}
.itinerary-range {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.itinerary-right .crowd { margin-top: 4px; }

/* Leg timeline (horizontal, colored rails) */
.leg-timeline {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.leg-walk {
  flex: 1;
  height: 12px;
  border-radius: 6px;
  border: 1.5px dashed var(--hairline-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
}
.leg-transit {
  flex: 3;
  min-width: 38px;
  height: 24px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.itinerary-stats {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.itinerary-stats .stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Info banner (prossima corsa) */
.info-banner {
  background: #DEE3FF;
  border: 1px solid rgba(43, 63, 230, 0.2);
  color: #1e2a8f;
  border-radius: 16px;
  padding: 12px 14px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}

/* Loading / errors / empty */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 14px;
}
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--hairline);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.no-results {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  margin-bottom: 10px;
}
.no-results-icon { font-size: 34px; margin-bottom: 8px; }
.no-results-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.no-results-suggest {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.no-results-tip {
  background: var(--warn-bg);
  border: 1px solid rgba(201, 148, 0, 0.25);
  color: #7A5A00;
  border-radius: 16px;
  padding: 12px 14px;
  font-family: var(--font-ui);
  font-size: 13px;
  margin-top: 10px;
}
.error {
  background: var(--alert-bg);
  border: 1px solid rgba(225, 25, 0, 0.25);
  color: #8a1200;
  border-radius: 16px;
  padding: 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
}

/* =========================================================================
   DETAIL SCREEN
   ========================================================================= */
.detail-header {
  padding: 16px 16px 14px;
  background: var(--bg);
  flex-shrink: 0;
}
.detail-hero {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 0.98;
  color: var(--ink);
  letter-spacing: -2px;
  font-weight: 600;
}
.detail-hero .accent { color: var(--accent); }
.detail-hero .sub {
  display: block;
  margin-top: 6px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: -0.2px;
}
.stat-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 14px -16px 0;
  padding: 0 16px;
  scrollbar-width: none;
}
.stat-pills::-webkit-scrollbar { display: none; }
.stat-pill {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.stat-pill-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-pill-icon.is-good { background: var(--good-bg); color: var(--good); }
.stat-pill-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.stat-pill-value {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-ui);
}
.stat-pill-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.stat-pill-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}

.detail-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0 16px 24px;
}
.detail-map-wrap {
  position: relative;
  height: 200px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--hairline);
  flex-shrink: 0;
}

.timeline-card {
  background: var(--surface);
  border-radius: 22px;
  border: 1px solid var(--hairline);
  padding: 10px 0;
  position: relative;
}
.tl-step {
  display: flex;
  gap: 14px;
  padding: 10px 16px;
  position: relative;
  align-items: flex-start;
}
.tl-rail-col {
  width: 24px;
  display: flex;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.tl-rail {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 6px;
  border-radius: 3px;
}
.tl-rail-dashed {
  width: 2px;
  background-image: linear-gradient(to bottom, var(--ink-muted) 50%, transparent 50%);
  background-size: 2px 6px;
  background-repeat: repeat-y;
}
.tl-dot {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  margin-top: 4px;
}
.tl-dot-end { border-radius: 2px; transform: rotate(45deg); }
.tl-dot-ring {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ink);
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.tl-icon-circle {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  margin-top: 2px;
}
.tl-body { flex: 1; min-width: 0; padding-top: 2px; }
.tl-caption {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.tl-name {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.tl-mode-title {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.tl-mode-sub {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 1px;
}
.tl-time-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.tl-transit-card {
  flex: 1;
  border-radius: 14px;
  padding: 12px 14px;
  margin-left: 4px;
  margin-bottom: 6px;
}
.tl-transit-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.tl-transit-name {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.tl-transit-meta {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-soft);
}
.tl-stops-line {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.5;
  padding-left: 4px;
}

/* =========================================================================
   UTILITIES & tight mobile
   ========================================================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 380px) {
  .display { font-size: 32px; }
  .quick-grid { gap: 6px; }
  .quick-chip { padding: 10px 8px; }
  .itinerary-min { font-size: 32px; }
  .detail-hero { font-size: 38px; }
}

/* =========================================================================
   LIVE BUS MARKERS (GTFS-RT vehicle positions)
   ========================================================================= */
.bus-marker {
  background: transparent !important;
  border: none !important;
  /* La transizione sul transform di Leaflet gestisce l'animazione tra fix */
  transition: transform 0.8s ease-out, opacity 0.3s ease;
  will-change: transform;
}
/* Durante l'animazione di zoom/pan di Leaflet, lascia che sia
   Leaflet a gestire il transform (evita lotta tra transizioni) */
.leaflet-zoom-anim .bus-marker,
.leaflet-pan-anim .bus-marker {
  transition: none;
}
.bus-marker-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  pointer-events: auto;
  /* L'iconAnchor (24,32) in Leaflet posiziona il box 48x34 in modo che
     il punto (24, 32) — ovvero bottom-center del dot — coincida con (lat,lon). */
}
.bus-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(14, 14, 16, 0.25);
  position: relative;
  z-index: 2;
  transition: box-shadow 0.25s ease, background 0.25s ease, transform 0.2s ease;
}
/* Bus pin stilizzato (icona bus dentro un pin colorato) */
.bus-pin {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  color: var(--accent);
  border: 2.5px solid #fff;
  box-shadow: 0 3px 8px rgba(14, 14, 16, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-45deg);
  position: relative;
  z-index: 2;
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}
.bus-pin > svg {
  transform: rotate(45deg);
  display: block;
}
.bus-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  padding: 1px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(14, 14, 16, 0.25);
  line-height: 1.2;
  z-index: 2;
}

/* Evidenzia i veicoli sulla stessa route_id dell'itinerario selezionato */
.bus-marker.is-highlight .bus-dot,
.bus-marker.is-highlight .bus-pin {
  box-shadow: 0 0 0 3px var(--good), 0 0 18px var(--good);
}
.bus-marker.is-highlight .bus-pin {
  background: var(--good);
  transform: rotate(-45deg) scale(1.18);
}
.bus-marker.is-highlight .bus-label {
  background: var(--good);
}
/* Veicoli non rilevanti (quando c'è un filtro attivo) */
.bus-marker.is-dim {
  opacity: 0.5;
}
.bus-marker.is-dim .bus-label {
  background: var(--ink-muted);
}

/* Leaflet popup per bus */
.bus-popup .leaflet-popup-content-wrapper {
  border-radius: 14px;
  padding: 4px 4px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(14, 14, 16, 0.15);
}
.bus-popup .leaflet-popup-content {
  font-family: var(--font-ui);
  margin: 10px 14px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}
.bus-popup .leaflet-popup-tip { background: var(--surface); }
.bus-popup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.bus-popup-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.2px;
}
.bus-popup-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
}
.bus-popup-row {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.bus-popup-row b {
  color: var(--ink);
  font-weight: 600;
}
.bus-popup-row .mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

/* =========================================================================
   LIVE TRACKING CARD (banner "il tuo bus" nel detail)
   ========================================================================= */
.live-tracking {
  padding: 10px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.live-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 14px 16px;
  font-family: var(--font-ui);
}
.live-card-ok {
  position: relative;
  border-color: var(--good);
  background: linear-gradient(135deg, var(--good-bg) 0%, var(--surface) 60%);
  box-shadow: 0 4px 16px rgba(0, 120, 90, 0.18);
  overflow: hidden;
  isolation: isolate;
}
.live-card-ok > * { position: relative; z-index: 2; }

/* Aureola che si espande e svanisce (riverbero forte) */
.live-card-ok {
  animation: liveBoxPulse 1.4s ease-in-out infinite;
}
@keyframes liveBoxPulse {
  0%, 100% {
    box-shadow:
      0 4px 16px rgba(0, 120, 90, 0.22),
      0 0 0 0 rgba(0, 120, 90, 0.55);
  }
  50% {
    box-shadow:
      0 4px 22px rgba(0, 120, 90, 0.32),
      0 0 0 12px rgba(0, 120, 90, 0);
  }
}

.live-card-ok::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 3px solid var(--good);
  z-index: 1;
  animation: liveRipple 1.4s cubic-bezier(.2,.6,.2,1) infinite;
  pointer-events: none;
}
@keyframes liveRipple {
  0%   { opacity: 1;    transform: scale(1);    }
  60%  { opacity: 0;    transform: scale(1.14); }
  100% { opacity: 0;    transform: scale(1.14); }
}

/* Onda colorata che attraversa la card (shimmer più visibile) */
.live-card-ok::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
    transparent 20%,
    rgba(0, 120, 90, 0.30) 46%,
    rgba(255, 255, 255, 0.65) 52%,
    rgba(0, 120, 90, 0.30) 58%,
    transparent 84%);
  background-size: 220% 100%;
  background-position: -120% 0;
  animation: liveSweep 1.8s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}
@keyframes liveSweep {
  0%   { background-position: -120% 0; }
  100% { background-position: 120% 0;  }
}
.live-card-pending {
  border-style: dashed;
  background: var(--surface-alt);
  color: var(--ink-muted);
}
.live-card-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.live-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--good);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.4px;
}
.live-badge-muted {
  background: var(--ink-muted);
  color: #fff;
}
.live-card-headline {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.live-card-headline b {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.3px;
}
.live-card-eta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 6px 0 8px;
}
.live-eta-num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1.2px;
  color: var(--good);
  line-height: 1;
}
.live-eta-unit {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.live-eta-stop {
  margin-left: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.live-card-meta {
  font-size: 11px;
  color: var(--ink-muted);
  font-family: var(--font-ui);
  letter-spacing: 0.2px;
}
.live-rt {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.rt-ok    { background: var(--good); color: #fff; }
.rt-late  { background: var(--alert); color: #fff; }
.rt-early { background: var(--warn); color: #fff; }
.rt-sched { background: var(--hairline-2); color: var(--ink-soft); }
