/* Layout app utente (mobile-first) */
.topbar { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(18px); background: rgba(247, 248, 243, 0.88); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 0; gap: 1rem; }
.brand { font-weight: 800; letter-spacing: -0.03em; }
.nav-links { display: flex; gap: 1rem; font-size: 0.95rem; flex-wrap: wrap; justify-content: flex-end; }
.nav-links--compact { gap: 0.75rem; font-size: 0.9rem; }

.page-shell--with-tabbar {
  padding-bottom: calc(5.85rem + env(safe-area-inset-bottom, 0px));
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  left: max(0.6rem, env(safe-area-inset-left));
  right: max(0.6rem, env(safe-area-inset-right));
  bottom: max(0.45rem, env(safe-area-inset-bottom));
  width: auto;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: 0.15rem;
  padding: 0.38rem 0.3rem 0.42rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  min-width: 0;
  text-align: center;
  padding: 0.42rem 0.18rem;
  border-radius: 16px;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.bottom-nav__item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(186, 203, 169, 0.65);
}
.bottom-nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  flex-shrink: 0;
  color: var(--dry-sage);
}
.bottom-nav__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.bottom-nav__glyph :is(path, circle, line, polyline) {
  stroke: currentColor;
  stroke-width: 1.3px;
  fill: none;
  vector-effect: non-scaling-stroke;
}
.bottom-nav__label {
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--dim-grey);
}
.bottom-nav__item.is-active {
  background: rgba(225, 244, 203, 0.72);
  border-color: rgba(186, 203, 169, 0.45);
}
.bottom-nav__item.is-active .bottom-nav__icon {
  color: var(--charcoal-brown);
}
.bottom-nav__item.is-active .bottom-nav__label {
  color: var(--charcoal-brown);
  font-weight: 700;
}

.home-welcome h1 { font-size: clamp(1.5rem, 5vw, 2.25rem); }
.home-cta-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.home-cta-card--soft {
  background: linear-gradient(135deg, rgba(241, 191, 152, 0.2), rgba(225, 244, 203, 0.65));
}
.home-route-title { font-size: 1.1rem; font-weight: 700; margin: 0.25rem 0 0; }
.section-head { margin-bottom: 0.75rem; }
.home-suggestions { margin-top: 0.5rem; }
.home-more { margin: 1rem 0 0; }
.home-rent-shortcut {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(225, 244, 203, 0.4), rgba(255, 255, 255, 0.95));
}
.empty-hint { grid-column: 1 / -1; }

.history-stack {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.history-stack__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.history-stack__row:last-child { border-bottom: none; }

.profile-dl {
  margin: 0.75rem 0 0;
  display: grid;
  gap: 0.85rem;
}
.profile-dl dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim-grey);
  margin-bottom: 0.2rem;
}
.profile-dl dd { margin: 0; font-weight: 600; }
.profile-actions { display: flex; justify-content: flex-start; }

.back-row { margin: 0 0 0.75rem; }
.back-row a { font-weight: 600; }

.booking-header { margin-bottom: 0; }
.booking-header h1 { font-size: clamp(1.5rem, 5vw, 2.25rem); }

.booking-context-card { margin-top: 0; }
.booking-context-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.booking-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.booking-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--charcoal-brown);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}
.booking-step__sep {
  flex: 1;
  min-width: 1rem;
  height: 1px;
  background: var(--border);
}
.booking-context-hint {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.booking-widget-shell {
  padding: 1.25rem;
  min-height: 320px;
}
.booking-widget-shell #ESKbookingBox {
  width: 100%;
}

.booking-fallback {
  display: grid;
  gap: 0.65rem;
  padding: 0.5rem 0;
}

.route-card--pick {
  border-color: rgba(186, 203, 169, 0.45);
  box-shadow: 0 12px 36px rgba(63, 71, 57, 0.1);
}
.route-card-badge { margin: 0 0 0.15rem; }
.eyebrow { text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.14em; color: var(--dim-grey); margin-bottom: .35rem; }
.hero { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1rem; background: linear-gradient(135deg, rgba(241,191,152,.25), rgba(225,244,203,.7)); }
.filters { display: grid; gap: 1rem; margin-bottom: 1rem; }
.status-card { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.route-card { overflow: hidden; padding: 0; }
.route-card img { height: 180px; width: 100%; object-fit: cover; }
.route-card-body { padding: 1rem; display: grid; gap: .8rem; }
.stats-row.large { font-size: 1rem; margin-bottom: 1rem; }
.route-detail-card { display: grid; gap: 1rem; }
.route-detail-header { display: grid; gap: 1rem; grid-template-columns: 1.5fr 1fr; align-items: start; }
.route-detail-image { height: 220px; width: 100%; object-fit: cover; border-radius: 18px; }
.route-preview-label { margin: 0; font-size: .9rem; }
.route-preview-map#routePreviewMap { min-height: 260px; max-height: 360px; }
.route-detail-cta { display: grid; gap: .65rem; }
.tracking-panel { display: grid; gap: 1rem; }
.tracking-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.tracking-stats div { background: rgba(225,244,203,.45); border-radius: 18px; padding: .9rem 1rem; }
.tracking-stats small { display: block; color: var(--dim-grey); margin-bottom: .2rem; }
.tracking-stats strong { font-size: 1.2rem; }

/* Pagina live: mappa a tutto schermo (area utente) */
main.container.page-shell.route-live-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 1.5rem;
}
.route-live-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 4.25rem);
}
.route-live-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1rem;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2000;
}
.route-live-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 700;
}
.route-live-bar-text { display: grid; gap: .1rem; min-width: 0; }
.route-live-eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--dim-grey); }
.route-live-title { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-live-map-wrap {
  position: relative;
  flex: 1;
  min-height: min(72vh, 640px);
}
.route-live-map#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: 0;
  border: none;
}
.route-live-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  padding: .65rem .75rem calc(.65rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, rgba(247, 248, 243, 0.97) 28%);
  pointer-events: none;
}
.route-live-hud .route-live-stat {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: .55rem .65rem;
  box-shadow: var(--shadow);
}
.route-live-hud small { display: block; color: var(--dim-grey); font-size: .68rem; margin-bottom: .15rem; }
.route-live-hud strong { font-size: .95rem; }
.route-live-actions {
  padding: .85rem 1rem 0;
  display: grid;
  gap: .5rem;
  justify-items: center;
}
.route-live-hint { text-align: center; font-size: .85rem; margin: 0; max-width: 36rem; }
.route-live-conflict { max-width: 560px; margin: 2rem auto; }
@media (max-width: 640px) {
  .route-live-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero, .status-card, .route-detail-header { grid-template-columns: 1fr; display: grid; }
  .nav-links { gap: .7rem; font-size: .88rem; }
}

/* Pagina offline PWA (static/pwa/offline.html) */
.offline-card { margin-top: 0.5rem; }
.offline-card__actions { margin-top: 1rem; }
