/* =============================================
   CarbuRadar — styles propres, par-dessus assets/css/app.css
   =============================================

   Rapatriée dans le hub, l'appli en prend la charpente : Manrope, la palette
   commune (fond, surfaces, encres, filets), la barre d'appli avec son retour
   au hub, le bouton lune / soleil. Elle garde son identité : le cyan et
   l'orange de son icône, passés au pastel comme le reste du hub — un jeton
   soutenu pour le texte et les filets, une pastille pastel sous une encre
   sombre pour les boutons pleins.

   Aucune couleur de thème ici : elles sont dans themes/dark/dark.css et
   themes/light/light.css, avec leurs relevés de contraste. Les seules teintes
   en dur sont celles qui ne dépendent pas du thème : les paliers de prix des
   marqueurs, posés sur la carte, et le bleu de Waze.                          */

/* ------------------------------------------------------------ remise à plat
   :where() ramène la spécificité à zéro : ces règles ne passent jamais devant
   les composants du hub (.btn, .icon-btn…), qui gardent leurs bordures.      */

:where(.carbu) :where(button) {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

:where(.carbu) :where(input) { font: inherit; color: inherit; }
:where(.carbu) :where(h1, h2, h3, p) { margin: 0; }

/* ------------------------------------------------------------------ la page */

body.carbu {
  /* La page épouse la fenêtre par position: fixed, JAMAIS par une unité de
     hauteur d'écran. Dans la fenêtre du hub installé, sur Android, 100dvh
     et 100vh se résolvaient à 56 px de plus que la zone visible — la hauteur
     de la barre d'outils de Chrome, pourtant absente : le bas de la page
     tombait hors de l'écran, et la poignée de la liste n'en montrait que
     4 px sur 60. position: fixed suit la zone réellement visible, comme les
     panneaux de l'appli. */
  position: fixed;
  inset: 0;
  min-height: 0;          /* app.css pose min-height: 100dvh sur body */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Là où Chrome dessine la page SOUS la barre de navigation du téléphone
     (viewport-fit=cover, navigation par gestes), la zone sûre en donne la
     hauteur et la page s'arrête au-dessus. Là où il n'y a rien à éviter, elle
     vaut 0 et rien ne bouge. Les panneaux en position fixe (fiche, favoris,
     filtres) gèrent la leur au pied de leur bouton Fermer. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  /* Le double appui ne zoome plus la page ; le pincement, si. */
  touch-action: manipulation;
}

/* Les bandeaux du haut suivent la gouttière du hub, encoches comprises. */
.carbu-entete,
.search-panel,
.filters-bar {
  padding-left: calc(env(safe-area-inset-left) + var(--gutter));
  padding-right: calc(env(safe-area-inset-right) + var(--gutter));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

/* ------------------------------------------------------------------ en-tête */

.carbu .carbu-entete {
  position: relative;
  z-index: 1000;
  gap: 0.625rem;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}

.carbu-favoris { position: relative; }
.carbu-favoris__icone { display: grid; place-items: center; }
.carbu-favoris__icone svg { width: 1.125rem; height: 1.125rem; }
.carbu-favoris.has-favorites { color: var(--orange); }

.carbu-favoris__compte {
  position: absolute;
  top: -0.375rem;
  right: -0.375rem;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.3125rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--orange-fill);
  color: var(--orange-ink);
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- recherche */

.search-panel {
  position: relative;
  z-index: 999;
  padding-top: 0.625rem;
  padding-bottom: 0.75rem;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}

.search-bar__input-wrapper {
  flex: 1;
  position: relative;
}

.search-bar__icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  color: var(--ink-2);
  pointer-events: none;
}

.search-bar__icon svg { width: 1.0625rem; height: 1.0625rem; }

/* 16 px au moins : en dessous, Safari sur iPhone zoome la page au toucher. */
.search-bar__input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.875rem 0.625rem 2.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 1rem;
  box-shadow: var(--shadow-1);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-bar__input::placeholder { color: var(--ink-2); }

.search-bar__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.search-bar__gps {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-2);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.search-bar__gps svg { width: 1.25rem; height: 1.25rem; }

.search-bar__gps.locating {
  color: var(--brand);
  border-color: var(--brand);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---------------------------------------------------------------- le rayon */

.search-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.radius-selector {
  display: flex;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.radius-btn,
.radius-custom-input {
  width: 100%;
  min-height: 2.375rem;
  padding: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.radius-btn {
  flex: 1;
  color: var(--ink-2);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.radius-btn.active {
  background: var(--brand-fill);
  border-color: transparent;
  color: var(--brand-ink);
  font-weight: 700;
}

.radius-custom-wrapper {
  flex: 1;
  min-width: 0;
}

/* 16 px ici aussi, pour la même raison que le champ de recherche. */
.radius-custom-input {
  color: var(--ink);
  font-size: 1rem;
  -moz-appearance: textfield;
}

.radius-custom-input::placeholder { color: var(--ink-2); font-size: 0.8125rem; }

.radius-custom-input::-webkit-inner-spin-button,
.radius-custom-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.radius-custom-wrapper.active .radius-custom-input,
.radius-custom-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.search-btn {
  flex: 0 0 auto;
  min-height: 2.375rem;
  padding: 0.375rem 1rem;
}

@media (hover: hover) {
  .search-bar__gps:hover,
  .radius-btn:hover { border-color: var(--brand); color: var(--brand); }
  .radius-btn.active:hover { border-color: transparent; color: var(--brand-ink); }
}

/* ---------------------------------------------------------------- les filtres */

.filters-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  overflow-x: auto;
  z-index: 998;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filters-bar::-webkit-scrollbar { display: none; }

.filter-modal-btn,
.sort-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.25rem;
  padding: 0.375rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-2);
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.filter-modal-btn.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 700;
}

.sort-btn.active {
  background: var(--orange-soft);
  border-color: var(--orange);
  color: var(--orange);
  font-weight: 700;
}

.sort-btn__arrow {
  font-size: 0.625rem;
  transition: transform 0.2s;
}

.sort-btn__arrow.desc { transform: rotate(180deg); }

.filters-divider {
  width: 1px;
  height: 1.25rem;
  background: var(--line);
  flex-shrink: 0;
}

@media (hover: hover) {
  .filter-modal-btn:hover { border-color: var(--brand); color: var(--ink); }
  .sort-btn:hover { border-color: var(--orange); }
}

/* --------------------------------------------------- les fenêtres de filtre */

.filter-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 28, 0.45);
  z-index: 2000;
  backdrop-filter: blur(2px);
}

.filter-modal-backdrop.open { display: block; }

.filter-modal {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 2001;
  max-height: 75vh;
  max-width: 32.5rem;
  margin: 0 auto;
  flex-direction: column;
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.filter-modal.open { display: flex; }

.filter-modal__header,
.favorites-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.filter-modal__title,
.favorites-panel__title {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.filter-modal__close,
.favorites-panel__close {
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-2);
  transition: all 0.15s ease;
}

.filter-modal__close svg,
.favorites-panel__close svg { width: 1rem; height: 1rem; }

.filter-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
}

.filter-modal__footer {
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

/* ---- Les cases à cocher des fenêtres ---- */

.modal-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.modal-option.active { background: var(--brand-soft); }

.modal-option__check {
  width: 1.375rem;
  height: 1.375rem;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brand-ink);
  flex-shrink: 0;
  transition: all 0.15s;
}

.modal-option.active .modal-option__check {
  background: var(--brand-fill);
  border-color: var(--brand-fill);
}

.modal-option__label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}

.modal-option__brand-logo {
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.modal-option__brand-initial {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.modal-option-divider {
  height: 1px;
  background: var(--line);
  margin: 0.25rem 1.25rem;
}

@media (hover: hover) {
  .modal-option:hover { background: var(--surface-2); }
  .modal-option.active:hover { background: var(--brand-soft); }
}

/* ---- « Fermer », au pied des panneaux ---- */

.panel-close-bottom {
  display: block;
  width: calc(100% - 2rem);
  min-height: 3rem;
  margin: 0 1rem max(1rem, env(safe-area-inset-bottom));
  padding: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

@media (hover: hover) {
  .filter-modal__close:hover,
  .favorites-panel__close:hover,
  .panel-close-bottom:hover {
    background: var(--rouge-soft);
    border-color: var(--rouge);
    color: var(--rouge);
  }
}

/* ---------------------------------------------------------------- la carte */

.main-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

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

/* Les tuiles OpenStreetMap n'existent qu'en clair : en sombre, le thème les
   inverse (--carte-filtre). Les marqueurs, dans un autre calque, restent tels
   quels. */
.leaflet-tile-pane { filter: var(--carte-filtre); }

.carbu .leaflet-control-zoom {
  border: none;
  box-shadow: var(--shadow-2);
}

.carbu .leaflet-control-zoom a {
  width: 2.25rem;
  height: 2.25rem;
  line-height: 2.25rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 1rem;
}

.carbu .leaflet-control-zoom a:hover { background: var(--surface-2); }

.carbu .leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--ink-2);
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 6px 0 0 0;
}

.carbu .leaflet-control-attribution a { color: var(--brand); }

/* ---- Le cercle du rayon et la position de l'utilisateur ---- */

.carbu-rayon {
  stroke: var(--brand);
  fill: var(--brand);
}

.user-marker__point {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid #FFFFFF;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 12px color-mix(in srgb, var(--brand) 60%, transparent);
}

.user-marker__onde {
  position: absolute;
  top: -9px;
  left: -9px;
  width: 30px;
  height: 30px;
  border: 2px solid var(--brand);
  border-radius: 50%;
  opacity: 0.3;
  animation: userPulse 2s infinite;
}

@keyframes userPulse {
  0% { transform: scale(1); opacity: 0.3; }
  100% { transform: scale(2); opacity: 0; }
}

/* ---- Les marqueurs de station ----
   Leurs couleurs disent le prix — vert, ambre, rouge — et restent les mêmes
   dans les deux thèmes : elles se posent sur la carte, pas sur la page.      */

.station-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid var(--brand);
  background: var(--brand);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}

.station-marker.cheap { border-color: #16a34a; background: #22c55e; }
.station-marker.mid { border-color: #d97706; background: #f59e0b; }
.station-marker.expensive { border-color: #dc2626; background: #ef4444; }

.station-marker.favorite {
  box-shadow: 0 0 0 2px var(--orange), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.station-marker__inner {
  transform: rotate(45deg);
  width: 23px;
  height: 23px;
  background: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.station-marker__logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  padding: 1px;
}

.station-marker__fallback {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.station-marker__fallback--pump { background: #FFFFFF; }

.station-marker.highlighted {
  width: 44px;
  height: 44px;
  z-index: 1000 !important;
  animation: markerBounce 0.4s ease;
}

.station-marker.highlighted .station-marker__inner { width: 29px; height: 29px; }

.station-marker.highlighted .station-marker__logo,
.station-marker.highlighted .station-marker__fallback { width: 25px; height: 25px; }

@keyframes markerBounce {
  0%, 100% { transform: rotate(-45deg) translateY(0); }
  50% { transform: rotate(-45deg) translateY(-8px); }
}

/* ---- Les bulles de la carte ---- */

.carbu .leaflet-popup-content-wrapper {
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--line);
}

.carbu .leaflet-popup-tip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  border-left: none;
}

.carbu .leaflet-container a.leaflet-popup-close-button { color: var(--ink-2); }

.map-popup__name {
  margin-bottom: 0.25rem;
  font-weight: 800;
  font-size: 0.9375rem;
  color: var(--ink);
}

.map-popup__address {
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-2);
}

.map-popup__prices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.map-popup__price-tag {
  padding: 0.125rem 0.5rem;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------- la liste, en tiroir */

.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  /* 70 % de l'écran, sans jamais dépasser la zone de la carte : si l'unité
     d'écran se trompe (voir body.carbu), la poignée reste visible. */
  max-height: min(70vh, 100%);
  min-height: 60px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: none;
}

.bottom-sheet.collapsed { transform: translateY(calc(100% - 60px)); }
.bottom-sheet.expanded { transform: translateY(0); }

.bottom-sheet__handle {
  padding: 0.625rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  flex-shrink: 0;
}

.bottom-sheet__handle-bar {
  width: 2.25rem;
  height: 4px;
  background: var(--line-strong);
  border-radius: 2px;
}

.bottom-sheet__handle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.25rem;
}

.bottom-sheet__summary {
  font-size: 0.8125rem;
  color: var(--ink-2);
  font-weight: 600;
}

.bottom-sheet__summary strong {
  color: var(--brand);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bottom-sheet__hors-ligne { color: var(--orange); font-weight: 700; }

.bottom-sheet__close {
  width: 1.875rem;
  height: 1.875rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.station-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.75rem 0.5rem;
  -webkit-overflow-scrolling: touch;
}

/* Le bandeau « écran d'accueil » ferme la liste, comme le pied d'une page. */
.carbu-raccourci { margin: 0.75rem 0 0.5rem; }

/* Le tiroir est déjà au-dessus de la barre Android (voir body.carbu) : son
   bouton Fermer n'a pas à s'en écarter une seconde fois. */
.bottom-sheet .panel-close-bottom { margin-bottom: 1rem; }

@media (hover: hover) {
  .bottom-sheet__close:hover {
    background: var(--surface);
    color: var(--brand);
    border-color: var(--brand);
  }
}

/* ---------------------------------------------------------------- les stations */

.station-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
  position: relative;
}

.station-card:active { transform: scale(0.99); }

.station-card.highlighted {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.station-card__rank {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  background: var(--surface-2);
  color: var(--ink-2);
}

.station-card__rank.top {
  background: var(--brand-soft);
  color: var(--brand);
}

.station-card__info {
  flex: 1;
  min-width: 0;
}

.station-card__name {
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-card__address {
  font-size: 0.75rem;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.375rem;
}

.station-card__prices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.price-tag {
  padding: 0.125rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.price-tag.cheapest {
  background: var(--vert-soft);
  color: var(--vert);
  border-color: color-mix(in srgb, var(--vert) 35%, transparent);
}

.price-tag.priciest {
  background: var(--rouge-soft);
  color: var(--rouge);
  border-color: color-mix(in srgb, var(--rouge) 35%, transparent);
}

.station-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.station-card__distance {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.station-card__fav {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-2);
  transition: all 0.15s ease;
}

.station-card__fav svg { width: 1.125rem; height: 1.125rem; }

.station-card__fav.active {
  color: var(--orange);
  background: var(--orange-soft);
}

@media (hover: hover) {
  .station-card:hover {
    border-color: var(--brand);
    background: var(--surface-2);
  }
  .station-card__fav:hover {
    color: var(--orange);
    background: var(--orange-soft);
  }
}

/* ---------------------------------------------------------- fiche d'une station */

.detail-panel {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-panel.open { transform: translateX(0); }

.detail-panel__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem calc(env(safe-area-inset-right) + var(--gutter)) 0.625rem calc(env(safe-area-inset-left) + var(--gutter));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.detail-panel__back,
.detail-panel__fav {
  width: 2.375rem;
  height: 2.375rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.detail-panel__back svg,
.detail-panel__fav svg { width: 1.125rem; height: 1.125rem; }

.detail-panel__fav { color: var(--ink-2); }

.detail-panel__fav.active {
  color: var(--orange);
  border-color: var(--orange);
  background: var(--orange-soft);
}

.detail-panel__title {
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-panel__content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem calc(env(safe-area-inset-right) + var(--gutter)) 1rem calc(env(safe-area-inset-left) + var(--gutter));
}

.detail-section { margin-bottom: 1.25rem; }

.detail-section__title {
  margin-bottom: 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.detail-address {
  padding: 0.75rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.detail-address__text { font-size: 0.9375rem; line-height: 1.45; }

.detail-address__distance {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--brand);
}

.detail-empty { color: var(--ink-2); font-size: 0.875rem; }

.detail-prices {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.detail-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.detail-price-row__name { font-weight: 700; font-size: 0.9375rem; }

.detail-price-row__info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.detail-price-row__price {
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.detail-price-row__update {
  font-size: 0.6875rem;
  color: var(--ink-2);
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
}

.detail-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9375rem;
  transition: filter 0.15s ease, border-color 0.15s ease;
}

.detail-action-btn--primary {
  background: var(--brand-fill);
  color: var(--brand-ink);
}

.detail-action-btn--secondary {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

/* Le bleu de Waze, le même partout : c'est sa marque. */
.detail-action-btn--waze {
  background: #33CCFF;
  color: #000000;
}

@media (hover: hover) {
  .detail-panel__back:hover { border-color: var(--brand); color: var(--brand); }
  .detail-action-btn--primary:hover,
  .detail-action-btn--waze:hover { filter: brightness(0.96); }
  .detail-action-btn--secondary:hover { border-color: var(--brand); }
}

/* ---------------------------------------------------------------- attente */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.loading-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 0.9375rem;
  color: var(--ink-2);
  font-weight: 600;
}

/* ---------------------------------------------------------------- messages */

.toast-container {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  pointer-events: none;
}

/* Un message long passe à la ligne : sur un téléphone, il sortait de l'écran. */
.toast {
  max-width: 100%;
  padding: 0.625rem 1.125rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  box-shadow: var(--shadow-2);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
  pointer-events: auto;
}

.toast--success { border-color: var(--vert); color: var(--vert); }
.toast--error { border-color: var(--rouge); color: var(--rouge); }
.toast--info { border-color: var(--brand); color: var(--brand); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

/* ---------------------------------------------------------------- favoris */

.favorites-panel {
  position: fixed;
  top: 0;
  right: -20rem;
  width: 20rem;
  max-width: 85vw;
  height: 100%;
  background: var(--bg);
  z-index: 2000;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.favorites-panel.open { right: 0; }

.favorites-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 28, 0.45);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.favorites-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.favorites-panel__list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.favorites-empty,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--ink-2);
}

.favorites-empty__icon { margin-bottom: 0.75rem; opacity: 0.6; }
.favorites-empty__icon svg { width: 2.5rem; height: 2.5rem; }
.favorites-empty__text { font-size: 0.875rem; }

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.45;
}

.empty-state__title {
  margin-bottom: 0.25rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.empty-state__text { font-size: 0.8125rem; }

/* ---------------------------------------------------------------- suggestions */

.autocomplete-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 9000;
  box-shadow: var(--shadow-2);
  max-height: 16.25rem;
  overflow-y: auto;
}

.autocomplete-dropdown.open { display: block; }

.autocomplete-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.6875rem 0.875rem;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--line);
}

.autocomplete-item:last-child { border-bottom: none; }

.autocomplete-item:hover,
.autocomplete-item.focused { background: var(--surface-2); }

.autocomplete-item__icon {
  font-size: 0.95rem;
  margin-top: 1px;
  flex-shrink: 0;
}

.autocomplete-item__text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.autocomplete-item__main {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-item__sub {
  font-size: 0.8125rem;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------- grand écran */

@media (min-width: 768px) {
  .bottom-sheet {
    width: 23.75rem;
    right: auto;
    left: 0.75rem;
    bottom: 0.75rem;
    top: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    max-height: calc(100% - 1.5rem);
    box-shadow: var(--shadow-2);
  }

  .bottom-sheet.collapsed { transform: translateY(calc(100% - 60px)); }

  .detail-panel {
    width: 26.25rem;
    left: auto;
    border-left: 1px solid var(--line);
  }
}

@media (min-width: 1024px) {
  .bottom-sheet { width: 25rem; }
}

/* ---------------------------------------------------------------- mouvement */

@media (prefers-reduced-motion: reduce) {
  .user-marker__onde,
  .search-bar__gps.locating,
  .station-marker.highlighted { animation: none; }
}