/* =========================================================================
   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-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  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; }

/* Desktop wide: stack verticale invece di scroll orizzontale (le card si vedono tutte) */
@media (min-width: 760px) {
  .live-strip {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: visible;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .live-strip .dep-card { min-width: 0; width: 100%; }
}

/* Microcopy CTA dentro la dep-card (home strip) */
.dep-card-cta {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}
.dep-card-cta::before {
  content: "→ ";
  font-size: 14px;
  line-height: 1;
}

/* Hint sopra la lista corse dello stop-sheet */
.dep-row-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 10px 0;
  text-align: center;
  letter-spacing: 0.1px;
}

/* Visual cue di azionabilità sulle dep-row dello stop-sheet */
.dep-row[data-boarding-trigger] {
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}
.dep-row[data-boarding-trigger]:hover {
  background: var(--surface-alt);
}
.dep-row[data-boarding-trigger]:active {
  transform: scale(0.98);
}

.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; }
/* Badge prezzo biglietto NSTR sulla card itinerario */
.it-price { margin-top: 7px; }
.it-price:empty { display: none; }
.it-price-amt {
  display: inline-block;
  background: var(--good-bg);
  color: var(--good);
  font-weight: 800;
  font-size: 15px;
  border-radius: 10px;
  padding: 4px 9px;
  font-variant-numeric: tabular-nums;
}
.it-price-lab {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* ===== Cerca prezzi — modale tariffe NSTR ===== */
.prezzi-modal { position: fixed; inset: 0; z-index: 1200; display: none; }
.prezzi-modal[aria-hidden="false"] { display: block; }
.prezzi-modal-backdrop { position: absolute; inset: 0; background: rgba(14,14,16,.45); }
.prezzi-modal-sheet {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 18px 18px 28px; box-shadow: 0 -6px 30px rgba(0,0,0,.2);
}
.prezzi-modal-head { display: flex; justify-content: space-between; align-items: center; }
.prezzi-modal-head h3 { margin: 0; font-size: 18px; }
.prezzi-modal-close { border: 0; background: #f0ede7; width: 32px; height: 32px; border-radius: 50%; font-size: 15px; cursor: pointer; }
.pz-intro { font-size: 13px; color: var(--ink-muted); margin: 6px 0 12px; }
.pz-field { position: relative; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin: 8px 0; background: #fbfaf8; }
.pz-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pz-dot.p { background: var(--ink); }
.pz-dot.a { background: var(--accent); }
.pz-field input { border: 0; background: transparent; font-size: 15px; width: 100%; outline: none; color: var(--ink); }
.pz-sugg { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 5; max-height: 240px; overflow-y: auto; }
.pz-sugg-item { padding: 11px 14px; font-size: 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pz-sugg-item:last-child { border-bottom: 0; }
.pz-sugg-item:active { background: #f4f2ee; }
.pz-cta { width: 100%; background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 13px; font-size: 15px; font-weight: 800; margin-top: 8px; cursor: pointer; }
.pz-msg { text-align: center; color: var(--ink-muted); font-size: 13px; padding: 16px 0; }
.pz-res-ctx { font-size: 12px; color: var(--ink-muted); margin: 14px 0 0; }
.pz-res-big { background: var(--good-bg); border-radius: 14px; padding: 14px; text-align: center; margin: 8px 0; }
.pz-amt { font-size: 34px; font-weight: 800; color: var(--good); line-height: 1; font-variant-numeric: tabular-nums; }
.pz-lab { font-size: 12px; color: var(--good); font-weight: 700; margin-top: 4px; }
.pz-bordo { font-size: 11px; color: var(--ink-muted); margin-top: 6px; }
.pz-toggle { display: flex; gap: 6px; margin-top: 6px; }
.pz-toggle button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px; font-size: 12px; font-weight: 700; color: var(--ink-muted); cursor: pointer; }
.pz-toggle button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pz-tables table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.pz-tables td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.pz-tables td.r { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pz-sect { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-muted); font-weight: 700; margin: 14px 2px 2px; }
.pz-src { font-size: 10.5px; color: var(--ink-muted); margin-top: 12px; line-height: 1.4; }
.pz-buy { background: #fff8f1; border: 1px solid #ffe2cf; border-radius: 12px; padding: 11px 13px; margin: 10px 0; font-size: 12.5px; color: var(--ink-muted); line-height: 1.5; }
.pz-buy-name { color: var(--accent); font-size: 14px; }
.pz-perte { background: #eef7f1; border: 1px solid #cde9d8; color: #1e6b46; font-size: 12px; font-weight: 700; border-radius: 9px; padding: 7px 10px; margin-top: 8px; }
/* Riga "dove acquistare" sulla card itinerario */
.it-buy { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--ink-muted); }
.it-buy:empty { display: none; }
.it-buy b { color: var(--ink); font-family: var(--font-mono); }

/* ===== Suggerimento intelligente nel calcolatore prezzi ===== */
.pz-tip { background: #eef7f1; border: 1px solid #cde9d8; border-radius: 12px; padding: 11px 13px; margin-top: 12px; font-size: 12.5px; color: #1e6b46; line-height: 1.55; }
.pz-tip b { color: #14512f; }

/* ===== Menù bottom-sheet ===== */
.app-menu { position: fixed; inset: 0; z-index: 1250; display: none; }
.app-menu[aria-hidden="false"] { display: block; }
.app-menu-backdrop { position: absolute; inset: 0; background: rgba(14,14,16,.45); }
.app-menu-sheet { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; background: var(--surface); border-radius: 20px 20px 0 0; padding: 8px 14px 26px; box-shadow: 0 -6px 30px rgba(0,0,0,.2); }
.app-menu-grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 6px; }
.app-menu-title { margin: 4px 4px 10px; font-size: 16px; }
.app-menu-item { display: flex; align-items: center; gap: 13px; width: 100%; border: 0; background: transparent; padding: 13px 8px; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; }
.app-menu-item:last-child { border-bottom: 0; }
.ami-ic { font-size: 22px; flex: none; width: 30px; text-align: center; }
.ami-txt { flex: 1; display: flex; flex-direction: column; }
.ami-txt b { font-size: 15px; color: var(--ink); }
.ami-txt small { font-size: 12px; color: var(--ink-muted); }
.ami-arrow { color: var(--ink-muted); font-size: 20px; }
.ami-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; background: #f0ede7; color: var(--ink-muted); border-radius: 6px; padding: 3px 7px; }
.app-menu-item.ami-soon { opacity: .55; cursor: default; }
body[data-brand="arst"] .ami-beaches { display: none; }

/* ===== Simulatore viaggio a tappe / diario ===== */
.screen-sim { background: var(--bg); overflow-y: auto; }
.sim-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sim-title { margin: 0; font-size: 18px; }
.sim-body { padding: 14px 14px 44px; }
.sim-intro { font-size: 12.5px; color: var(--ink-muted); margin: 0 0 12px; line-height: 1.5; }
.sim-nome { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 15px; margin-bottom: 12px; background: #fbfaf8; }
.sim-tappa { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: var(--surface); }
.sim-tappa-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sim-tappa-n { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .4px; }
.sim-rm { border: 0; background: #f0ede7; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 12px; }
.sim-dt { display: flex; gap: 8px; margin-top: 8px; }
.sim-dt input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px; font-size: 14px; background: #fbfaf8; }
.sim-add { width: 100%; border: 1px dashed var(--line); background: transparent; border-radius: 12px; padding: 11px; font-size: 14px; font-weight: 700; color: var(--ink-muted); cursor: pointer; margin-bottom: 10px; }
.sim-result { margin-top: 14px; }
.sim-tot { display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.sim-tot-lab { display: block; font-size: 13px; font-weight: 700; }
.sim-tot-sub { font-size: 11px; opacity: .7; }
.sim-tot-r { text-align: right; }
.sim-tot-cost { display: block; font-size: 22px; font-weight: 800; }
.sim-tot-dur { font-size: 11px; opacity: .8; }
.sim-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; background: var(--surface); }
.sim-card-top { display: flex; justify-content: space-between; align-items: center; }
.sim-card-n { font-size: 11px; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; }
.sim-card-price { font-size: 17px; font-weight: 800; color: var(--good); }
.sim-card-route { font-size: 15px; font-weight: 700; margin: 4px 0; }
.sim-card-meta { font-size: 12px; color: var(--ink-muted); }
.sim-card-buy { font-size: 11.5px; color: var(--ink-muted); margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); }
.sim-card-buy b { color: var(--ink); font-family: var(--font-mono); }
.sim-card-ko { background: #fdf6f5; }
.sim-ko { font-size: 12.5px; color: #b5443a; margin-top: 4px; }
.sim-actions { display: flex; gap: 8px; margin-top: 6px; }
.sim-actions button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 11px; font-size: 13px; font-weight: 700; cursor: pointer; }
.sim-saved-wrap { margin-top: 20px; }
.sim-saved-title { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-muted); font-weight: 700; margin-bottom: 8px; }
.sim-diario { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 6px; overflow: hidden; }
.sim-diario-open { flex: 1; border: 0; background: transparent; text-align: left; padding: 11px 13px; cursor: pointer; display: flex; flex-direction: column; }
.sim-diario-open small { font-size: 11px; color: var(--ink-muted); }
.sim-diario-del { border: 0; background: transparent; padding: 11px 13px; cursor: pointer; font-size: 15px; }
.sim-empty { font-size: 12.5px; color: var(--ink-muted); padding: 6px 2px; }
.sim-toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 13px; z-index: 1400; }
.sim-prezzi-link { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 1px solid var(--line); background: #fff8f1; border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 700; color: var(--accent); cursor: pointer; margin-bottom: 12px; }
.sim-prezzi-link span { color: var(--ink-muted); font-size: 18px; }

/* 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); }

/* ==================== FAVORITES: empty state + remove button ==================== */
.quick-chip-empty {
  background: transparent;
  border: 1.5px dashed var(--hairline-2);
  opacity: 0.85;
}
.quick-chip-empty .quick-label { color: var(--ink-muted); font-weight: 500; }
.quick-chip-empty .quick-time { display: none; }
.quick-chip-edit {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(14,14,16,0.42);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  padding: 0;
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s;
}
.quick-chip { position: relative; }
.quick-chip:hover .quick-chip-edit,
.quick-chip-edit:hover,
.quick-chip-edit:focus { opacity: 1; background: rgba(14,14,16,0.85); }
.quick-chip-empty .quick-chip-edit { display: none; }

/* ==================== FAVORITES MODAL ==================== */
.fav-modal {
  position: fixed; inset: 0;
  display: none;
  z-index: 1000;
}
.fav-modal.is-open { display: block; }
.fav-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(14,14,16,0.42);
  backdrop-filter: blur(2px);
}
.fav-modal-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 20px;
  padding: 20px 22px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
  animation: favSheetFadeIn 0.18s ease-out;
}
@keyframes favSheetFadeIn {
  from { transform: translate(-50%, -48%); opacity: 0; }
  to   { transform: translate(-50%, -50%); opacity: 1; }
}
/* Mobile: torna a bottom-sheet */
@media (max-width: 640px) {
  .fav-modal-sheet {
    top: auto;
    bottom: 0;
    transform: translateX(-50%);
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
  }
  @keyframes favSheetFadeIn {
    from { transform: translate(-50%, 30%); opacity: 0; }
    to   { transform: translateX(-50%); opacity: 1; }
  }
}
.fav-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.fav-modal-head h3 {
  margin: 0;
  font-size: 18px;
  font-family: var(--font-display);
  font-weight: 700;
}
.fav-modal-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.fav-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 14px;
  background: var(--surface-alt, rgba(14,14,16,0.04));
  border: 1px solid var(--hairline);
  cursor: pointer;
  font-family: var(--font-ui);
  color: var(--ink);
  transition: transform 0.1s;
}
.fav-type-btn:active { transform: scale(0.95); }
.fav-type-btn.is-selected {
  background: rgba(255,91,46,0.12);
  border-color: var(--accent);
  color: var(--accent);
}
.fav-type-btn-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(14,14,16,0.06);
}
.fav-type-btn-label {
  font-size: 11.5px;
  font-weight: 600;
}
.fav-modal-search {
  position: relative;
  margin-bottom: 12px;
}
.fav-modal-search .point-input {
  width: 100%;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  outline: none;
}
.fav-modal-search .autocomplete-panel {
  display: block;
  position: static;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 8px;
  border-radius: 12px;
}
.fav-modal-search .autocomplete-panel:empty { display: none; }
.fav-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--alert, #c34a2c);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-ghost:hover { background: rgba(195,74,44,0.08); }

/* ==================== ENDPOINT MARKERS (P = partenza, A = arrivo) ==================== */
.endpoint-marker {
  background: transparent !important;
  border: none !important;
}
.endpoint-marker-inner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.28);
  border: 3px solid #fff;
}

/* ==================== DETAIL: transfer banner + timeline redesign ==================== */
.detail-transfer-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--accent-bg), var(--surface));
  border: 1px solid rgba(255, 91, 46, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 16px 12px;
}
.detail-transfer-banner[hidden] { display: none; }
.transfer-banner-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.transfer-banner-text h3 {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}
.transfer-banner-text p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.transfer-banner-text b { color: var(--ink); }

/* Endpoint markers P/A nella timeline */
.tl-step-endpoint { align-items: flex-start; }
.tl-endpoint {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  flex-shrink: 0;
}
.tl-endpoint-p { background: var(--ink); }
.tl-endpoint-a { background: var(--accent); }

/* Blocco "Cambia bus qui" */
.tl-step-change { align-items: center; }
.tl-change-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--warn-bg);
  border: 2px solid var(--warn);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tl-change-block {
  flex: 1;
  background: linear-gradient(180deg, #FFFBE3, #FAF8F3);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--warn);
  margin-left: -2px;
}
.tl-change-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.tl-change-head strong {
  font-family: var(--font-display);
  font-size: 13.5px;
  color: var(--warn);
  font-weight: 700;
}
.tl-change-meta {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.tl-change-meta b { color: var(--ink); }

/* Status live INLINE dentro la transit card */
.tl-leg-live:empty { display: none; }
.tl-leg-live-inner {
  margin-top: 10px;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.tl-leg-live-ok      { background: var(--good-bg); }
.tl-leg-live-pending { background: var(--surface-alt, rgba(14,14,16,0.04)); border: 1px solid var(--hairline); }
.tl-leg-live-unknown { background: var(--warn-bg); }
.tl-leg-live-past    { background: var(--surface-alt, rgba(14,14,16,0.04)); opacity: 0.75; }

.tl-leg-live-eta {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  min-width: 40px;
}
.tl-leg-live-ok .tl-leg-live-eta      { color: var(--good); }
.tl-leg-live-pending .tl-leg-live-eta { color: var(--ink-muted); }
.tl-leg-live-eta small {
  font-size: 10px;
  font-weight: 500;
  margin-left: 2px;
  text-transform: lowercase;
}
.tl-leg-live-text {
  flex: 1;
  line-height: 1.4;
}
.tl-leg-live-text b {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}
.tl-leg-live-meta {
  display: block;
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.4;
}

/* ============================================================
   AVVISAMI QUANDO SCENDERE — push alert UI
   ============================================================ */
.tl-alert-slot { font-family: inherit; }

.alert-slot-idle {
  display: flex; flex-direction: column; gap: 6px;
}
.alert-slot-btn {
  appearance: none; border: 0;
  background: var(--accent-bg);
  color: var(--accent);
  font: 600 13px/1 inherit;
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  text-align: left;
  transition: background .15s ease;
}
.alert-slot-btn:hover { background: #FFD9C8; }

/* CTA "Sto a bordo" dentro tl-transit-card (Caso A post-plan) */
.tl-board-cta {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: 700 13px/1 inherit;
  letter-spacing: 0.02em;
  transition: transform 0.15s, background 0.15s;
  align-self: stretch;
}
.tl-board-cta:hover { background: #2a2a2c; }
.tl-board-cta:active { transform: scale(0.98); }
.tl-board-cta svg { flex-shrink: 0; }

.alert-slot-picker {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding-left: 2px;
}
.alert-slot-picker-label {
  font: 500 12px/1 inherit;
  color: var(--ink-muted);
  margin-right: 4px;
}
.alert-slot-chip {
  appearance: none; border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font: 600 12px/1 inherit;
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.alert-slot-chip:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.alert-slot-active {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 9px 12px;
  border-radius: 999px;
  font: 600 13px/1 inherit;
}
.alert-slot-icon { filter: grayscale(0); }
.alert-slot-label { flex: 1; }
.alert-slot-cancel {
  appearance: none; border: 0;
  background: rgba(255,255,255,.25);
  color: var(--accent-ink);
  font: 600 11px/1 inherit;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.alert-slot-cancel:hover { background: rgba(255,255,255,.4); }

.alert-slot-msg {
  font: 400 11.5px/1.3 inherit;
  color: var(--ink-muted);
  padding-left: 4px;
  min-height: 1em;
}

.alert-slot-ios {
  font: 500 12px/1.4 inherit;
  color: var(--ink-muted);
  background: #FFF7F2;
  padding: 8px 10px;
  border-radius: 10px;
}

/* =========================================================================
   STOP MARKER — paletta verticale (asta + tabellina "P" + base).
   Riusato come L.divIcon su tutte le fermate cliccabili della mappa home.
   ========================================================================= */
.leaflet-marker-icon.stop-paletta {
  background: transparent;
  border: none;
  width: 24px !important;
  height: 30px !important;
  position: relative;
  pointer-events: auto;
  cursor: pointer;
}
.stop-paletta .sp-asta {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 1.5px;
  height: 18px;
  background: var(--ink);
  border-radius: 1px;
}
.stop-paletta .sp-tabella {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 14px;
  background: var(--accent);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 9px;
  line-height: 1;
  color: #fff;
  letter-spacing: 0.4px;
}
.stop-paletta .sp-base {
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}

/* =========================================================================
   MODALITÀ SPIAGGIA — hero card + screen Spiagge + cards (SM-only)
   ========================================================================= */
:root {
  --beach: #00a0c8;
  --beach-bg: #D6F2F9;
  --beach-grad: linear-gradient(135deg, #00a0c8 0%, #00567a 100%);
}

/* HERO "Vai al mare" in home */
.beach-hero {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 88px;
  border: none;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 14px;
  cursor: pointer;
  background: var(--beach-grad);
  box-shadow: 0 8px 24px rgba(0, 160, 200, 0.32);
  padding: 0 16px;
  color: #fff;
  font-family: var(--font-ui);
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.beach-hero:active {
  transform: scale(0.98);
  box-shadow: 0 4px 14px rgba(0, 160, 200, 0.28);
}
.beach-hero::before {
  /* Onde decorative */
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 88' preserveAspectRatio='none'><path fill='rgba(255,255,255,0.10)' d='M0,40 Q50,20 100,40 T200,40 V88 H0 Z'/><path fill='rgba(255,255,255,0.08)' d='M0,55 Q50,35 100,55 T200,55 V88 H0 Z'/></svg>");
  background-size: cover;
  pointer-events: none;
}
.beach-hero-eyebrow {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 1;
}
.beach-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 14px;
  z-index: 1;
}
.beach-hero-text {
  flex: 1;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.beach-hero-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 1;
}
.beach-hero-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}
.beach-hero-chevron {
  z-index: 1;
  margin-left: 8px;
  display: flex;
  align-items: center;
}

/* Screen Spiagge: parallela alle altre screen, slide-in da destra */
.screen-beaches { z-index: 5; overflow: hidden; }

.beach-list-header {
  background: var(--bg);
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}
.beach-list-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.beach-list-title-wrap { flex: 1; }
.beach-list-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin: 0;
  line-height: 1;
}
.beach-list-count {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.beach-search-input {
  width: 100%;
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  margin-bottom: 10px;
}
.beach-search-input:focus {
  border-color: var(--accent);
}
.beach-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 0 16px 4px;
  scrollbar-width: none;
}
.beach-filters::-webkit-scrollbar { display: none; }
.beach-filter-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.beach-filter-chip:active { transform: scale(0.96); }
.beach-filter-chip.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.beach-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 30px;
  -webkit-overflow-scrolling: touch;
}
.beach-list-empty {
  padding: 36px 14px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
}

.beach-card {
  display: flex;
  gap: 12px;
  width: 100%;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--hairline);
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: left;
  transition: transform 0.15s ease;
}
.beach-card:active { transform: scale(0.985); }
.beach-card-photo {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  background: var(--beach-bg);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.beach-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.beach-card-photo .photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--beach);
  font-size: 22px;
}
.beach-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.beach-card-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.beach-card-where {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.beach-card-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.beach-chip {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
}
.beach-chip-walk { background: var(--good-bg); color: var(--good); }
.beach-chip-near { background: var(--beach-bg); color: var(--beach); }
.beach-chip-stop { background: var(--hairline); color: var(--ink-soft); }

/* Beach destination card: arricchita con foto */
.beach-dest-icon-photo {
  width: 56px;
  height: 56px;
  padding: 0;
  overflow: hidden;
  background: var(--beach-bg);
}
.beach-dest-icon-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.beach-dest-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--beach);
  font-size: 22px;
}

/* =========================================================================
   SPIAGGE — autocomplete sezione + voce + card destinazione (solo SM)
   [LEGACY: la sezione spiagge nell'autocomplete è stata rimossa.
    Le regole .ac-icon-beach/.ac-section-label.is-beach restano per non
    rompere stili eventualmente in cache.]
   ========================================================================= */
:root {
  --beach: #00a0c8;
  --beach-bg: #D6F2F9;
}
.ac-section-label.is-beach {
  color: var(--beach);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ac-section-label .ac-section-badge {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: var(--beach-bg);
  color: var(--beach);
  padding: 1.5px 6px;
  border-radius: 999px;
  text-transform: uppercase;
}
.ac-icon.ac-icon-beach {
  background: var(--beach-bg);
  color: var(--beach);
}
.ac-meta-walk {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--good);
  font-weight: 600;
}

/* Card "destinazione spiaggia" sotto i campi from/to */
.beach-dest-card {
  margin-top: 12px;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--hairline);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-family: var(--font-ui);
  animation: beachCardIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes beachCardIn {
  from { transform: translateY(6px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
.beach-dest-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--beach-bg);
  color: var(--beach);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.beach-dest-body {
  flex: 1;
  min-width: 0;
}
.beach-dest-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.beach-dest-where {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.beach-dest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
.beach-dest-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.beach-dest-chip-stop {
  background: var(--hairline);
  color: var(--ink-soft);
}
.beach-dest-chip-stop b {
  color: var(--ink);
  font-weight: 700;
  margin-left: 3px;
}
.beach-dest-chip-walk {
  background: var(--good-bg);
  color: var(--good);
  font-weight: 600;
}

/* =========================================================================
   PROSSIMI ARRIVI — RT pill (sostituisce il vecchio crowd indicator)
   ========================================================================= */
.rt-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.1px;
  white-space: nowrap;
}
.rt-pill-ok       { color: var(--good);  background: var(--good-bg); }
.rt-pill-late     { color: var(--alert); background: var(--alert-bg); }
.rt-pill-early    { color: var(--good);  background: var(--good-bg); }
.rt-pill-sched    { color: var(--ink-muted); background: var(--hairline); }
.rt-pill-canceled { color: var(--alert); background: var(--alert-bg); }

/* Live dot pulsante nel meta della live-strip ("aggiornato Xs fa") */
.live-head-meta .live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  margin-right: 5px;
  vertical-align: middle;
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

.live-strip-empty {
  padding: 16px 4px;
  font-size: 13px;
  color: var(--ink-muted);
  font-family: var(--font-ui);
}

/* big-time stati ritardo / cancellata sulla home strip */
.big-time-val.is-late     { color: var(--alert); }
.big-time-val.is-now      { color: var(--accent); }
.big-time-val.is-canceled { color: var(--alert); text-decoration: line-through; }

/* =========================================================================
   STOP SHEET — modal full per tap su fermata (mappa o card home)
   ========================================================================= */
.stop-sheet {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  transition: background 0.25s ease;
}
.stop-sheet.is-open {
  display: flex;
  background: rgba(0, 0, 0, 0.32);
}
.stop-sheet-backdrop {
  position: absolute;
  inset: 0;
}
.stop-sheet-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 12px 18px 22px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  animation: stopPanelUp 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes stopPanelUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@media (min-width: 760px) {
  .stop-sheet { align-items: center; }
  .stop-sheet-panel {
    border-radius: 22px;
    margin: 0 auto;
    max-height: 78vh;
  }
}
.stop-sheet-grabber {
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: var(--hairline-2);
  margin: 0 auto 12px;
}
.stop-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.stop-sheet-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--ink);
}
.stop-sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--hairline);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
}
.stop-sheet-close:active { transform: scale(0.92); }
.stop-sheet-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.stop-sheet-empty {
  padding: 24px 8px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
}

/* Header con info fermata sorgente */
.stop-source {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 12px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 12px;
}
.stop-source-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stop-source-text {
  flex: 1;
  min-width: 0;
}
.stop-source-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stop-source-meta {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 1px;
}

/* Lista "Departure rows" nello stop sheet */
.dep-row-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}
.dep-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--hairline);
}
.dep-row-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dep-row-headsign {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dep-row-meta {
  font-size: 11px;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dep-row-meta .mono {
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.dep-row-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}
.dep-row-min {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.dep-row-min.is-late      { color: var(--alert); }
.dep-row-min.is-now       { color: var(--accent); }
.dep-row-min.is-canceled  { color: var(--ink-muted); }
.dep-row-min-unit {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 600;
  letter-spacing: 0;
}
.dep-row-time-clock {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}
.dep-row-time-clock.is-strike { text-decoration: line-through; }

/* Azioni in fondo allo stop sheet */
.dep-row-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-shrink: 0;
}
.dep-row-action-btn {
  flex: 1;
  padding: 11px 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s ease;
}
.dep-row-action-btn:active { transform: scale(0.97); }
.dep-row-action-btn-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* =========================================================================
   CRONOLOGIA RICERCHE — sezione nello screen-search sotto "Cerca itinerari"
   ========================================================================= */
.history-section {
  margin-top: 18px;
}
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
}
.history-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.history-clear {
  font-size: 11px;
  color: var(--ink-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  font-family: var(--font-ui);
  font-weight: 500;
}
.history-clear:hover { color: var(--alert); }

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--hairline);
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: left;
  width: 100%;
  transition: transform 0.15s ease;
}
.history-item:active { transform: scale(0.98); }
.history-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--hairline);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.history-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.history-pair {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.history-pair-from,
.history-pair-to {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.history-pair-arrow {
  color: var(--ink-muted);
  font-weight: 500;
  flex-shrink: 0;
}
.history-meta {
  font-size: 11px;
  color: var(--ink-muted);
}

/* =========================================================================
   SHARE BUTTON — pulsante condividi nel detail header
   ========================================================================= */
.icon-btn.share-btn {
  background: var(--surface);
}
.icon-btn.share-btn:active { transform: scale(0.92); }

/* =========================================================================
   TOAST — feedback "Link copiato" e simili
   ========================================================================= */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 30px);
  background: var(--ink);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.is-error {
  background: var(--alert);
}
.toast .toast-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--good);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.toast .toast-icon-err {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
}

/* =========================================================================
   LIVELLI — bottone "Mostra/nascondi fermate" stato attivo
   ========================================================================= */
.glass-icon[data-action="toggle-layers"].is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(255, 91, 46, 0.35);
}
.glass-icon[data-action="toggle-layers"].is-active svg { color: #fff; }

/* Badge campanella con count avvisi */
.glass-badge.has-count {
  width: auto;
  height: 16px;
  min-width: 16px;
  border-radius: 999px;
  padding: 0 5px;
  top: 4px;
  right: 4px;
  background: var(--alert);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

/* =========================================================================
   ALERTS MODAL — campanella avvisi ARST
   ========================================================================= */
.alerts-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  transition: background 0.25s ease;
}
.alerts-modal.is-open {
  display: flex;
  background: rgba(0, 0, 0, 0.36);
}
.alerts-modal-backdrop {
  position: absolute;
  inset: 0;
}
.alerts-modal-panel {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: var(--bg);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 12px 18px 22px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  animation: alertsPanelUp 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes alertsPanelUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@media (min-width: 760px) {
  .alerts-modal { align-items: center; }
  .alerts-modal-panel {
    border-radius: 22px;
    margin: 0 auto;
    max-height: 84vh;
  }
}
.alerts-modal-grabber {
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: var(--hairline-2);
  margin: 0 auto 12px;
}
.alerts-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.alerts-modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--ink);
  line-height: 1;
}
.alerts-modal-subtitle {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 6px;
}
.alerts-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--hairline);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
}
.alerts-modal-close:active { transform: scale(0.92); }
.alerts-modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.alerts-modal-empty {
  padding: 36px 12px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
}
.alerts-modal-empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
  opacity: 0.7;
}
.alerts-modal-empty p {
  margin: 4px 0;
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 600;
}
.alerts-modal-empty small {
  font-size: 12px;
  color: var(--ink-muted);
}

/* Singola card avviso */
.alert-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--warn);
  border-radius: 12px;
  padding: 14px 14px 12px;
  margin-bottom: 10px;
  font-family: var(--font-ui);
}
.alert-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.alert-type {
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--warn);
  background: var(--warn-bg);
  padding: 3px 8px;
  border-radius: 999px;
}
.alert-dates {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-muted);
}
.alert-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
  line-height: 1.3;
}
.alert-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.alert-line {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 2px 7px;
  border-radius: 5px;
}
.alert-card-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.alert-card-body p {
  margin: 0 0 6px;
}
.alert-card-body p:last-child { margin-bottom: 0; }
.alert-card-body b, .alert-card-body strong {
  color: var(--ink);
  font-weight: 700;
}

/* Avviso "letto" — bordo grigio, contenuto attenuato */
.alert-card { cursor: pointer; transition: opacity 0.18s ease, border-color 0.18s ease; }
.alert-card:active { transform: scale(0.995); }
.alert-card.is-read {
  border-left-color: var(--hairline-2);
  opacity: 0.62;
}
.alert-card.is-read .alert-card-title { font-weight: 600; }
.alert-card.is-read .alert-type {
  background: var(--hairline);
  color: var(--ink-muted);
}

.alert-card-head-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.alert-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--alert);
  box-shadow: 0 0 0 3px rgba(225, 25, 0, 0.18);
  display: inline-block;
  flex-shrink: 0;
}
.alert-read-tag {
  display: inline-flex;
  align-items: center;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--hairline);
  padding: 2px 7px;
  border-radius: 999px;
}

/* Modal head actions row + Segna tutti come letti */
.alerts-modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.alerts-mark-all {
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.alerts-mark-all:active { transform: scale(0.96); }
.alerts-mark-all:hover { background: var(--hairline); }
@media (max-width: 380px) {
  .alerts-mark-all { font-size: 11px; padding: 6px 9px; }
}

/* =========================================================================
   FIX SCROLL MOBILE — solo home (le altre screen restano slide absolute)

   iOS Safari standalone non scrolla il bottom sheet con flex:1 + overflow:auto
   quando il parent .screen ha transform attivo. Soluzione robusta: su mobile
   la home usa SCROLL DEL DOCUMENTO. La mappa è altezza fissa 52vh in cima,
   il sheet si "stacca" e scrolla con la pagina (pattern Citymapper/Moovit).

   Limitazione: la mappa scrolla via insieme al sheet (non resta sticky).
   Se serve sticky in futuro, useremo position:sticky sulla map-hero.
   ========================================================================= */
@media (max-width: 759px) {
  html, body {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    /* Nasconde la scrollbar (Firefox + IE) */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  body { overflow: auto; }
  /* Nasconde la scrollbar webkit (iOS Safari, Chrome Android) */
  html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }

  .shell {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }
  /* Solo la home cambia layout: scroll naturale del documento */
  .screen-home {
    position: relative !important;
    transform: none !important;
    height: auto !important;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible !important;
    display: flex;
    flex-direction: column;
  }
  /* Mappa sticky in cima: resta visibile mentre il sheet sale */
  .screen-home .map-hero {
    position: sticky;
    top: 0;
    height: 52vh;
    min-height: 320px;
    flex-shrink: 0;
    z-index: 1;
  }
  .screen-home .sheet {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    height: auto;
    max-height: none;
    overflow: visible;
    animation: none;
    transform: none;
    will-change: auto;
    margin-top: -24px;
    padding-bottom: 40px;
  }
  /* Le altre screen mantengono il pattern slide: position absolute + transform.
     Su mobile la screen-home in scroll naturale non sparisce con transform:
     deve essere nascosta esplicitamente quando un'altra screen è attiva. */
  .screen-home:not(.is-active) {
    display: none !important;
  }
  /* Screen Spiagge: overlay fixed che copre il viewport (la home ha layout
     naturale, non absolute, quindi inset:0 della screen base non basta). */
  .screen-beaches {
    position: fixed !important;
    inset: 0 !important;
    background: var(--bg);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .screen-beaches.is-active { transform: translateX(0); }
}
/* =====================================================================
   BoardingFlow (sm-boarding-*) + LiveNav (sm-ln-*)
   Aggiunto 2026-05-16 — flussi "Sto salendo a bordo" + pearl trail
   ===================================================================== */

.sm-boarding-overlay{
  position:fixed; inset:0; background:rgba(14,14,16,.45);
  z-index:10000; display:flex; flex-direction:column; justify-content:flex-end;
  opacity:0; pointer-events:none; transition:opacity .2s ease;
}
.sm-boarding-overlay.is-open{ opacity:1; pointer-events:auto; }

.sm-boarding-sheet{
  background:var(--bg); border-top-left-radius:28px; border-top-right-radius:28px;
  max-height:92vh; display:flex; flex-direction:column; overflow:hidden;
  transform:translateY(100%); transition:transform .3s cubic-bezier(.2,.8,.2,1);
  font-family:var(--font-ui);
}
.sm-boarding-overlay.is-open .sm-boarding-sheet{ transform:translateY(0); }
.sm-boarding-body{ padding:12px 20px 28px; overflow-y:auto; max-width:520px; margin:0 auto; width:100%; }

.sm-bd-grabber{ width:38px; height:5px; border-radius:3px;
  background:var(--hairline2,rgba(14,14,16,.14)); margin:0 auto 14px; }

.sm-bd-head{ display:flex; align-items:flex-start; gap:12px; margin-bottom:14px; }
.sm-bd-badge{ width:54px; height:54px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:22px; flex-shrink:0; box-shadow:0 1px 2px rgba(0,0,0,.12); }
.sm-bd-meta{ flex:1; min-width:0; }
.sm-bd-ey{ font-size:11px; font-weight:700; color:var(--ink-muted,#8A8884);
  letter-spacing:1px; text-transform:uppercase; }
.sm-bd-title{ font-family:var(--font-display,"Space Grotesk");
  font-size:24px; font-weight:600; color:var(--ink,#0E0E10);
  letter-spacing:-.8px; line-height:1.1; margin-top:2px; }
.sm-bd-close{ width:36px; height:36px; border-radius:12px;
  border:1px solid var(--hairline,rgba(14,14,16,.08));
  background:var(--surface,#fff); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  color:var(--ink-soft,#4B4A48); flex-shrink:0; }

.sm-bd-fromto{ background:var(--ink,#0E0E10); color:#fff; border-radius:16px;
  padding:12px 14px; margin-bottom:14px; display:flex; gap:12px; align-items:center; }
.sm-bd-tl{ display:flex; flex-direction:column; align-items:center; padding-top:2px; flex-shrink:0; }
.sm-bd-dot-from{ width:10px; height:10px; border-radius:50%; border:2px solid #fff; }
.sm-bd-seg{ width:2px; flex:1; min-height:22px; margin:3px 0; }
.sm-bd-dot-to{ width:12px; height:12px; border-radius:2px; transform:rotate(45deg); }
.sm-bd-col{ flex:1; display:flex; flex-direction:column; justify-content:space-between; gap:18px; min-width:0; }
.sm-bd-fromto .sm-bd-ey{ color:rgba(255,255,255,.55); }
.sm-bd-val{ font-size:14px; font-weight:700; margin-top:2px; letter-spacing:-.2px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sm-bd-count{ text-align:right; flex-shrink:0; display:flex; flex-direction:column; align-items:flex-end; }
.sm-bd-count > span:first-child{ font-family:var(--font-display,"Space Grotesk");
  font-size:32px; font-weight:600; letter-spacing:-1.4px; line-height:1; }
.sm-bd-count-lbl{ font-size:10px; font-weight:700; opacity:.65; letter-spacing:.6px;
  text-transform:uppercase; margin-top:2px; }

.sm-bd-sec{ font-size:11px; font-weight:700; color:var(--ink-muted,#8A8884);
  letter-spacing:1.2px; text-transform:uppercase; margin:0 0 8px; }

.sm-bd-picker{ background:var(--surface,#fff);
  border:1px solid var(--hairline,rgba(14,14,16,.08));
  border-radius:16px; max-height:220px; overflow-y:auto; margin-bottom:14px; }
.sm-bd-loading{ padding:24px 16px; text-align:center;
  color:var(--ink-muted,#8A8884); font-size:13px; }
.sm-bd-picker-row{ width:100%; display:flex; align-items:center; gap:12px;
  padding:11px 14px; border:none; background:transparent; cursor:pointer; text-align:left;
  border-bottom:1px solid var(--hairline,rgba(14,14,16,.08));
  font-family:var(--font-ui); }
.sm-bd-picker-row:last-child{ border-bottom:none; }
.sm-bd-picker-row.is-active{ background:rgba(255,91,46,.10); }
.sm-bd-pearl{ width:16px; display:flex; justify-content:center; }
.sm-bd-pearl::before{ content:""; width:12px; height:12px; border-radius:50%;
  border:2.5px solid var(--c,#FF5B2E); background:#fff; }
.sm-bd-picker-row.is-active .sm-bd-pearl::before{ background:var(--c,#FF5B2E); }
.sm-bd-name{ flex:1; font-size:14px; font-weight:500; color:var(--ink,#0E0E10);
  letter-spacing:-.2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sm-bd-picker-row.is-active .sm-bd-name{ font-weight:700; }
.sm-bd-chip{ display:inline-flex; align-items:center; padding:3px 8px;
  border-radius:999px; font-size:11px; font-weight:700; letter-spacing:.1px; flex-shrink:0; }
.sm-bd-chip-alert{ background:var(--accent-bg,#FFEBE2); color:var(--accent,#FF5B2E); }
.sm-bd-chip-dest{ background:var(--ink,#0E0E10); color:#fff; }

.sm-bd-stops-grid{ display:grid; grid-template-columns:repeat(4,1fr);
  gap:6px; margin-bottom:14px; }
.sm-bd-stop-btn{ padding:12px 4px; border-radius:14px;
  border:1.5px solid var(--hairline,rgba(14,14,16,.08));
  background:var(--surface,#fff); color:var(--ink,#0E0E10);
  cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:2px;
  font-family:var(--font-ui); }
.sm-bd-stop-btn.is-active{ border-color:var(--ink,#0E0E10);
  background:var(--ink,#0E0E10); color:#fff; }
.sm-bd-big{ font-family:var(--font-display,"Space Grotesk");
  font-size:22px; font-weight:700; letter-spacing:-.9px; line-height:1; }
.sm-bd-lbl{ font-size:9.5px; font-weight:600; opacity:.75;
  text-transform:uppercase; letter-spacing:.3px; margin-top:4px; text-align:center; }

.sm-bd-toggles{ display:flex; gap:8px; margin-bottom:14px; }
.sm-bd-toggle{ flex:1; display:inline-flex; align-items:center; justify-content:center;
  gap:8px; padding:10px 12px; border-radius:12px;
  background:var(--surface,#fff); color:var(--ink-soft,#4B4A48);
  border:1px solid var(--hairline2,rgba(14,14,16,.14)); cursor:pointer;
  font-family:var(--font-ui); font-size:13px; font-weight:600; letter-spacing:-.2px; }
.sm-bd-toggle.is-on{ background:var(--ink,#0E0E10); color:#fff;
  border-color:var(--ink,#0E0E10); }
.sm-bd-tick{ width:14px; height:14px; border-radius:50%;
  border:2px solid var(--hairline2,rgba(14,14,16,.14)); display:inline-flex;
  align-items:center; justify-content:center; }
.sm-bd-toggle.is-on .sm-bd-tick{ border-color:#fff; background:#fff; position:relative; }
.sm-bd-toggle.is-on .sm-bd-tick::after{ content:""; display:block;
  width:7px; height:7px; border-radius:50%; background:var(--ink,#0E0E10); }

.sm-bd-summary{ font-size:12.5px; color:var(--ink-soft,#4B4A48);
  line-height:1.45; margin-bottom:14px; }

.sm-bd-actions{ display:flex; gap:10px; }
.sm-bd-btn{ flex:1; height:56px; padding:0 24px; border-radius:999px;
  cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
  gap:8px; font-family:var(--font-ui); font-size:16px; font-weight:600;
  letter-spacing:-.2px; border:none; }
.sm-bd-btn-primary{ background:var(--ink,#0E0E10); color:#fff; }
.sm-bd-btn-primary:disabled{ opacity:.4; cursor:not-allowed; }

/* ---- LiveNav full-screen ---- */
.sm-livenav{ position:fixed; inset:0; z-index:10100;
  display:flex; flex-direction:column;
  background:var(--ln-color,#FF5B2E);
  font-family:var(--font-ui);
  transform:translateY(100%); transition:transform .3s cubic-bezier(.2,.8,.2,1);
  pointer-events:none;
}
.sm-livenav.is-open{ transform:translateY(0); pointer-events:auto; }

.sm-ln-top{ padding:46px 16px 6px; display:flex; align-items:center;
  justify-content:space-between; color:#fff; flex-shrink:0; }
.sm-ln-back{ width:40px; height:40px; border-radius:12px; border:none;
  background:rgba(255,255,255,.2); backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px); cursor:pointer;
  display:flex; align-items:center; justify-content:center; color:#fff; }
.sm-ln-eyebrow{ font-size:11px; font-weight:700; letter-spacing:1.2px;
  text-transform:uppercase; opacity:.9; }

.sm-ln-hero{ padding:8px 16px 18px; color:#fff; flex-shrink:0; }
.sm-ln-row{ display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.sm-ln-badge{ width:54px; height:54px; border-radius:8px; background:#fff;
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:22px; letter-spacing:-.5px; flex-shrink:0; }
.sm-ln-meta{ flex:1; min-width:0; }
.sm-ln-ey{ font-size:11px; font-weight:700; letter-spacing:1px;
  text-transform:uppercase; opacity:.85; }
.sm-ln-next{ font-family:var(--font-display,"Space Grotesk");
  font-size:30px; letter-spacing:-1px; line-height:1.05; font-weight:500;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sm-ln-count{ display:flex; align-items:baseline; gap:8px; margin-bottom:4px; }
.sm-ln-n{ font-family:var(--font-display,"Space Grotesk");
  font-size:88px; line-height:.9; letter-spacing:-4px; font-weight:600; }
.sm-ln-lbl{ font-family:var(--font-display,"Space Grotesk");
  font-size:26px; opacity:.85; font-weight:500; letter-spacing:-1px; }
.sm-ln-dest{ font-size:13px; opacity:.9; }

.sm-ln-panel{ flex:1; background:var(--bg,#F4F2EE);
  border-top-left-radius:28px; border-top-right-radius:28px;
  padding:18px 0 0; overflow:hidden;
  display:flex; flex-direction:column; }
.sm-ln-panel-head{ padding:0 20px 12px; display:flex;
  align-items:center; justify-content:space-between; }
.sm-ln-h{ font-size:11px; font-weight:700; color:var(--ink-muted,#8A8884);
  letter-spacing:1.2px; text-transform:uppercase; }
.sm-ln-pill{ display:inline-flex; align-items:center; gap:6px;
  padding:4px 10px; border-radius:999px;
  background:rgba(0,120,90,.12); color:var(--good,#00785A);
  font-size:11px; font-weight:700; letter-spacing:.2px; }
.sm-ln-dot{ width:6px; height:6px; border-radius:50%;
  background:var(--good,#00785A); animation:sm-ln-blink 1.5s infinite; }
@keyframes sm-ln-blink{ 0%,100%{opacity:1} 50%{opacity:.35} }

.sm-ln-stops{ flex:1; overflow-y:auto; padding:0 20px 100px; position:relative; }
.sm-ln-stop{ display:flex; align-items:center; padding:10px 0; gap:14px; position:relative; }
.sm-ln-stop .sm-ln-pearl{ width:24px; height:24px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; position:relative; }
.sm-ln-stop .sm-ln-pearl::before{ content:""; width:12px; height:12px;
  border-radius:50%; border:2.5px solid var(--hairline2,rgba(14,14,16,.14));
  background:var(--bg,#F4F2EE); }
.sm-ln-stop.is-past .sm-ln-pearl::before{
  background:var(--ln-color,#FF5B2E); border-color:var(--ln-color,#FF5B2E); }
.sm-ln-stop.is-current .sm-ln-pearl::before{
  width:18px; height:18px; background:var(--ln-color,#FF5B2E);
  border:3px solid var(--bg,#F4F2EE); }
.sm-ln-stop.is-current .sm-ln-pearl::after{
  content:""; position:absolute; width:28px; height:28px; border-radius:50%;
  background:var(--ln-color,#FF5B2E); opacity:.25;
  animation:sm-ln-pulse 1.6s infinite; }
@keyframes sm-ln-pulse{ 0%{transform:scale(1);opacity:.35}
  70%{transform:scale(1.8);opacity:0} 100%{transform:scale(1.8);opacity:0} }
.sm-ln-stop.is-dest .sm-ln-pearl::before{
  width:18px; height:18px; border-radius:4px;
  background:var(--ink,#0E0E10); border-color:transparent; transform:rotate(45deg); }
.sm-ln-name{ flex:1; font-size:15px; font-weight:500; color:var(--ink,#0E0E10);
  letter-spacing:-.2px; display:flex; align-items:center; justify-content:space-between; gap:8px;
  overflow:hidden; }
.sm-ln-stop.is-past .sm-ln-name{ color:var(--ink-muted,#8A8884); text-decoration:line-through; }
.sm-ln-stop.is-current .sm-ln-name,
.sm-ln-stop.is-dest .sm-ln-name{ font-weight:700; font-size:17px; }
.sm-ln-chip-dest{ padding:3px 10px; border-radius:999px;
  background:rgba(255,91,46,.18); color:var(--accent,#FF5B2E);
  font-size:11px; font-weight:700; flex-shrink:0; }

/* ============================================================
   FERMATE PREFERITE — strip home + bottone ⭐ stop-sheet
   ============================================================ */
.stop-fav-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 14px 4px 6px;
}
.stop-fav-head-title {
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 14px; font-weight: 700;
  letter-spacing: -0.2px; color: var(--ink, #0E0E10);
}
.stop-fav-strip {
  display: flex; gap: 10px;
  overflow-x: auto; overflow-y: hidden;
  padding: 2px 4px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.stop-fav-strip::-webkit-scrollbar { height: 0; }
.stop-fav-card {
  all: unset; cursor: pointer;
  flex: 0 0 auto; width: 220px;
  background: var(--surface, #fff);
  border: 1px solid var(--hairline, rgba(14,14,16,0.08));
  border-radius: 14px;
  padding: 12px 12px 10px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  scroll-snap-align: start;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.stop-fav-card:active { transform: scale(0.98); }
.stop-fav-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.stop-fav-star {
  position: absolute; top: 8px; right: 10px;
  color: #F2B900; font-size: 13px;
}
.stop-fav-name {
  font-size: 13px; font-weight: 700; line-height: 1.25;
  padding-right: 18px; margin-bottom: 2px;
  color: var(--ink, #0E0E10);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stop-fav-sub {
  font-size: 10.5px;
  color: var(--ink-muted, #8A8884);
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.stop-fav-arrivals {
  display: flex; flex-direction: column; gap: 4px;
}
.stop-fav-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
}
.stop-fav-row .line-badge-sm {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 18px;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 10px; font-weight: 700;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  flex-shrink: 0;
  position: relative;
}
.stop-fav-row .line-badge-sm.is-live::after {
  content: ""; position: absolute; top: 2px; right: 2px;
  width: 5px; height: 5px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 0 0 1px var(--good, #00785A);
  animation: sm-ln-blink 1.4s infinite;
}
.stop-fav-time {
  font-weight: 700;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 12px;
  color: var(--ink, #0E0E10);
  white-space: nowrap;
}
.stop-fav-time.is-now { color: var(--good, #00785A); }
.stop-fav-time.is-canceled { color: var(--ink-muted, #8A8884); text-decoration: line-through; }
.stop-fav-unit {
  font-size: 9px; font-weight: 600; opacity: 0.65;
  margin-left: 2px;
}
.stop-fav-headsign {
  font-size: 11px; color: var(--ink-muted, #8A8884);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; text-align: left;
}
.stop-fav-loading {
  flex: 0 0 auto; width: 220px;
  padding: 16px;
  background: var(--surface, #fff);
  border: 1px dashed var(--hairline-2, rgba(14,14,16,0.14));
  border-radius: 14px;
  text-align: center;
  font-size: 12px; color: var(--ink-muted, #8A8884);
}
.stop-fav-empty-row {
  font-size: 11.5px; color: var(--ink-muted, #8A8884);
  padding: 4px 0;
}

/* ============================================================
   ACTIVE ALERT BAR — banner persistente con LiveNav handle
   ============================================================ */
.active-alert-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1500;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(14,14,16,0.94) 0%, rgba(14,14,16,0.82) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.18);
  animation: activeAlertSlideIn 0.32s ease-out;
}
.active-alert-bar[hidden] { display: none; }
@keyframes activeAlertSlideIn {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
/* Quando la bar è visibile, spingiamo le screens sotto */
body.has-active-alert .shell { padding-top: 64px; }

.active-alert-card {
  all: unset; cursor: pointer; box-sizing: border-box;
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 8px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: #fff;
  transition: background 0.15s, transform 0.15s;
}
.active-alert-card:active { transform: scale(0.98); }
.active-alert-card:hover { background: rgba(255,255,255,0.10); }

.active-alert-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 26px; border-radius: 6px;
  padding: 0 8px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

.active-alert-body { flex: 1; min-width: 0; }
.active-alert-eyebrow {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(255,255,255,0.62);
  margin-bottom: 1px;
}
.active-alert-eyebrow::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--good, #00785A);
  margin-right: 6px; vertical-align: middle;
  animation: sm-ln-blink 1.4s infinite;
}
.active-alert-title {
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 14px; font-weight: 700; line-height: 1.2;
  letter-spacing: -0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.active-alert-meta {
  font-size: 11px; color: rgba(255,255,255,0.65);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.active-alert-more {
  background: var(--accent, #FF5B2E);
  color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
  flex-shrink: 0;
}

.active-alert-cta {
  font-size: 22px; color: rgba(255,255,255,0.6);
  flex-shrink: 0; line-height: 1;
  padding: 0 4px;
}

/* Bottone ⭐ nello stop-sheet header */
.stop-fav-btn {
  all: unset; cursor: pointer; flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--hairline-2, rgba(14,14,16,0.14));
  background: var(--surface, #fff);
  color: var(--ink-muted, #8A8884);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1;
  transition: all 0.18s;
  box-sizing: border-box;
}
.stop-fav-btn:active { transform: scale(0.92); }
.stop-fav-btn:hover { border-color: #F2B900; color: #F2B900; }
.stop-fav-btn.is-active {
  background: #FFF7D6;
  border-color: #F2B900;
  color: #F2B900;
}

