/* =========================================================
   NextFuel – feuille de style
   Thème sombre noir / bleu nuit, carte en niveaux de gris
   en arrière-plan, cartes « verre dépoli », mobile d'abord.
   ========================================================= */

/* ---------- Palette ---------- */
:root {
  --fond: #060a13;
  --fond-2: #0b1222;
  --verre: rgba(13, 20, 38, .78);
  --verre-fort: rgba(13, 20, 38, .92);
  --ligne: rgba(148, 163, 184, .14);
  --ligne-forte: rgba(148, 163, 184, .26);
  --texte: #f1f5ff;
  --doux: #93a1b8;
  --tres-doux: #64748b;
  --accent: #38bdf8;
  --accent-fonce: #2563eb;
  --degrade: linear-gradient(135deg, #5eead4 0%, #38bdf8 45%, #2563eb 100%);
  --vert: #34d399;
  --vert-fond: rgba(52, 211, 153, .12);
  --ambre: #fbbf24;
  --rouge: #f87171;
  --ombre: 0 10px 30px rgba(0, 0, 0, .45);
  --rayon: 22px;
  --haut-sur: env(safe-area-inset-top, 0px);
  --bas-sur: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--fond);
  color: var(--texte);
  font-family: "Manrope Variable", "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; }
h1, h2 { margin: 0; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Carte en arrière-plan ---------- */
.carte {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--fond-2);
}
.carte.leaflet-container { background: var(--fond-2); font-family: inherit; }

/* Tuiles en niveaux de gris inversés, atténuées : la carte reste un décor */
.carte .leaflet-tile-pane {
  filter: grayscale(1) invert(1) brightness(.9) contrast(.95);
  opacity: .42;
}

/* Dégradé : lisibilité de l'en-tête et de la liste */
.voile {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(6, 10, 19, .92) 0%,
      rgba(6, 10, 19, .35) 26%,
      rgba(6, 10, 19, 0) 40%,
      rgba(6, 10, 19, .55) 58%,
      rgba(6, 10, 19, .96) 78%);
}

/* ---------- Structure ---------- */
.appli {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  pointer-events: none;           /* la carte reste manipulable dans la fenêtre */
}
.appli > * { pointer-events: auto; }
body:not(.en-suivi) .appli { visibility: hidden; } /* l'accueil seul avant le suivi */
.appli > .fenetre-carte { pointer-events: none; flex: 1; min-height: 120px; }

/* ---------- En-tête ---------- */
.entete {
  padding: calc(var(--haut-sur) + 10px) 14px 0;
}

.barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
}

.marque {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -.02em;
}
.marque-logo { width: 26px; height: 26px; }

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Pastille GPS */
.pastille-gps {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--verre);
  border: 1px solid var(--ligne);
  font-size: .8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--doux);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.pastille-gps i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ambre);
}
.pastille-gps.recherche i { animation: pulsation 1.4s ease-in-out infinite; }
.pastille-gps.ok i { background: var(--vert); box-shadow: 0 0 0 3px rgba(52, 211, 153, .25); }
.pastille-gps.erreur i { background: var(--rouge); }

/* Bouton carburant */
.puce-carburant {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--ligne-forte);
  background: var(--verre);
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.puce-carburant i,
.puce i,
.choix-carburant i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  background: var(--c, var(--accent));
}
.puce-carburant svg { width: 12px; height: 12px; color: var(--doux); }

.btn-rond {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--ligne-forte);
  background: var(--verre);
  color: var(--texte);
  cursor: pointer;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.btn-rond svg { width: 22px; height: 22px; }

/* Carte « route actuelle » */
.route {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: var(--rayon);
  background: var(--verre);
  border: 1px solid var(--ligne);
  box-shadow: var(--ombre);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
}
.route-panneaux {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: none;
  max-width: 55%;
}
.route-textes { min-width: 0; flex: 1; }
.route-titre {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-sous {
  margin-top: 2px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--doux);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-sous .approx { color: var(--ambre); }

/* Panneaux routiers façon signalisation */
.bouclier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 2px var(--b, #1d4ed8), 0 6px 16px rgba(0, 0, 0, .35);
  background: var(--b, #1d4ed8);
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: .01em;
  white-space: nowrap;
}
.bouclier.b-a, .bouclier.b-n { --b: #d32f3a; }   /* autoroutes et nationales (France) */
.bouclier.b-e { --b: #0f8a4a; }                  /* routes européennes */
.bouclier.b-d { --b: #f2c230; color: #111; }      /* départementales */
.bouclier.b-x { --b: #1d4ed8; }
.bouclier.secondaire { min-width: 0; height: 32px; font-size: 1rem; }
.bouclier.inconnu {
  --b: #1e293b;
  border-color: var(--ligne-forte);
  box-shadow: none;
  color: var(--doux);
}
.bouclier.chargement::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .25);
  border-top-color: var(--accent);
  animation: rotation .9s linear infinite;
}

/* Messages */
.toast {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: .88rem;
  font-weight: 700;
  background: rgba(56, 189, 248, .12);
  border: 1px solid rgba(56, 189, 248, .3);
  color: #bae6fd;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.toast.erreur {
  background: rgba(248, 113, 113, .12);
  border-color: rgba(248, 113, 113, .35);
  color: #fecaca;
}

/* ---------- Liste des stations ---------- */
.stations {
  /* --hauteur-pied : hauteur réelle du pied de page (mentions variables), mise à jour par app.js */
  padding: 0 12px calc(var(--hauteur-pied, 44px) + 8px);
}
.stations-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 6px 10px;
}
.stations-tete h2 {
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--doux);
}
.stations-tete > span,
#stations-info {
  font-size: .78rem;
  font-weight: 700;
  color: var(--tres-doux);
}
#stations-info.approx { color: var(--ambre); }

.liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.station {
  position: relative;
  border-radius: var(--rayon);
  background: var(--verre-fort);
  border: 1px solid var(--ligne);
  box-shadow: var(--ombre);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
/* Apparition : uniquement pour une station qui vient d'entrer dans la liste
   (classe posée par UI.majListe), jamais lors d'un simple rafraîchissement */
.station.entree,
.vide.entree { animation: apparition .35s ease-out both; }

/* Numéro (identique au repère sur la carte) */
.st-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(56, 189, 248, .14);
  color: var(--accent);
  font-weight: 800;
  font-size: .95rem;
}

.st-nom { min-width: 0; }
.st-nom strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-nom > span {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--doux);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station small {
  font-size: .42em;
  font-weight: 700;
  margin-left: 3px;
  color: var(--doux);
  letter-spacing: 0;
}

/* -- Première station : grande carte -- */
.station.hero { padding: 14px 16px 16px; }
.st-tete {
  display: flex;
  align-items: center;
  gap: 10px;
}
.st-tete .st-nom { flex: 1; }
.st-badge {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--vert);
  color: #04261a;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.st-chiffres {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  margin-top: 8px;
}
.st-valeur {
  font-size: 3.1rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.st-bloc.droite { text-align: right; }
.st-legende {
  margin-top: 4px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--doux);
  white-space: nowrap;
}
.st-indispo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--doux);
  line-height: 1.2;
}

/* -- Stations suivantes : lignes compactes -- */
.station.compacte {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 12px;
}
.st-dist, .st-prix {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.st-prix { min-width: 4.6em; }
.st-prix .ecart {
  display: block;
  margin: 3px 0 0;
  font-size: .7rem;
  font-weight: 700;
  color: var(--tres-doux);
  letter-spacing: 0;
}
.st-prix.absent {
  font-size: .8rem;
  font-weight: 700;
  color: var(--tres-doux);
  letter-spacing: 0;
}

/* -- Meilleur prix -- */
.station.best {
  border-color: rgba(52, 211, 153, .55);
  background:
    linear-gradient(135deg, rgba(52, 211, 153, .16), rgba(52, 211, 153, 0) 60%),
    var(--verre-fort);
  box-shadow: var(--ombre), 0 0 0 1px rgba(52, 211, 153, .25), 0 0 32px rgba(52, 211, 153, .12);
}
.station.best .st-num { background: var(--vert); color: #04261a; }
.station.best .prix-valeur { color: var(--vert); }

/* -- Type de prix : réel, plafond officiel, moyenne nationale -- */
.badge-prix {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}
.badge-prix::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge-prix.reel { color: var(--vert); }
.badge-prix.plafond { color: var(--ambre); }
.badge-prix.moyenne { color: #a5b4fc; }
.badge-prix.inconnu, .badge-prix.chargement { color: var(--tres-doux); }
.badge-prix.chargement::before { animation: pulsation 1.4s ease-in-out infinite; }

/* Une estimation ne doit jamais ressembler à un prix réel : chiffres atténués */
.prix-valeur.plafond { color: #fde68a; }
.prix-valeur.moyenne { color: #c7d2fe; }
.st-valeur.prix-valeur.moyenne,
.st-valeur.prix-valeur.plafond { font-size: 2.5rem; }
.ecart.plafond { color: var(--ambre); }
.ecart.moyenne { color: #a5b4fc; }
.note-prix {
  margin-right: 8px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--doux);
}
.st-legende .badge-prix { font-size: .82rem; }

/* -- Coût d'un plein moyen -- */
.st-plein {
  margin-top: 4px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--doux);
  white-space: nowrap;
}
.st-prix .plein {
  display: block;
  margin-top: 2px;
  font-size: .7rem;
  font-weight: 700;
  color: var(--tres-doux);
  letter-spacing: 0;
}

/* -- Conseil « frontière » -- */
.conseil {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border-radius: var(--rayon);
  background: var(--verre-fort);
  border: 1px solid var(--ligne-forte);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: apparition .35s ease-out both;
}
.conseil-icone {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.conseil-icone svg { width: 22px; height: 22px; }
.conseil-texte { min-width: 0; }
.conseil-texte strong { display: block; font-size: 1rem; font-weight: 800; }
.conseil-texte span { display: block; font-size: .8rem; font-weight: 600; color: var(--doux); }
.conseil.moins-cher { border-color: rgba(52, 211, 153, .5); }
.conseil.moins-cher .conseil-icone { background: var(--vert-fond); color: var(--vert); }
.conseil.moins-cher strong { color: var(--vert); }
.conseil.plus-cher { border-color: rgba(251, 191, 36, .5); }
.conseil.plus-cher .conseil-icone { background: rgba(251, 191, 36, .12); color: var(--ambre); }
.conseil.plus-cher strong { color: var(--ambre); }

/* -- Stations proches des sorties -- */
.bloc-sorties { margin-top: 14px; }
.station.sortie { border-style: dashed; border-color: var(--ligne-forte); }
.station.sortie .st-num {
  width: auto;
  min-width: 30px;
  padding: 0 6px;
  background: rgba(251, 191, 36, .12);
  color: var(--ambre);
  font-size: .85rem;
}
.ecart.economie { color: var(--vert); }
.epingle.sortie { border-color: var(--ambre); border-style: dashed; }
.epingle.sortie span { font-size: 12px; }

/* -- États vides et chargement -- */
.vide {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--rayon);
  background: var(--verre-fort);
  border: 1px solid var(--ligne);
  color: var(--doux);
  font-weight: 600;
}
.vide-icone {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(56, 189, 248, .12);
  color: var(--accent);
}
.vide-icone svg { width: 24px; height: 24px; }

.squelette {
  height: 76px;
  border-radius: var(--rayon);
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .06) 50%, rgba(255, 255, 255, 0) 70%) 0 0 / 200% 100%,
    var(--verre-fort);
  border: 1px solid var(--ligne);
  animation: reflet 1.4s linear infinite;
}
.squelette.grand { height: 132px; }

/* ---------- Écran d'accueil ---------- */
.accueil {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow-y: auto;
  padding: calc(var(--haut-sur) + 24px) 20px calc(var(--bas-sur) + 52px);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(37, 99, 235, .28), rgba(6, 10, 19, 0) 60%),
    linear-gradient(180deg, rgba(6, 10, 19, .35) 0%, rgba(6, 10, 19, .85) 45%, var(--fond) 70%);
}
.accueil-contenu {
  width: 100%;
  max-width: 440px;
  animation: apparition .5s ease-out both;
}
.accueil-logo {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 8px 24px rgba(56, 189, 248, .45));
}
.accueil h1 {
  margin-top: 18px;
  font-size: clamp(2.1rem, 9vw, 2.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.035em;
}
.accueil h1 span {
  background: var(--degrade);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.accueil-texte {
  margin: 14px 0 26px;
  font-size: 1.02rem;
  color: var(--doux);
  font-weight: 500;
}
.accueil-etiquette {
  margin-bottom: 10px;
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--tres-doux);
}

/* Puces de carburant */
.puces {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.puce {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--ligne-forte);
  background: rgba(15, 23, 42, .7);
  font-weight: 800;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .1s;
}
.puce:active { transform: scale(.97); }
.puce[aria-checked="true"] {
  background: rgba(56, 189, 248, .16);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  margin-top: 26px;
  border: 0;
  border-radius: 20px;
  background: var(--degrade);
  color: #04121f;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.01em;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(37, 99, 235, .45), 0 0 0 1px rgba(255, 255, 255, .15) inset;
  transition: transform .1s, filter .2s;
}
.cta svg { width: 22px; height: 22px; }
.cta:active { transform: scale(.98); }
.cta:disabled { filter: saturate(.4) brightness(.8); cursor: wait; }

.atouts {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: .82rem;
  font-weight: 700;
  color: var(--doux);
}
.atouts li::before {
  content: "✓";
  margin-right: 5px;
  color: var(--vert);
}
.demo-note {
  margin: 14px 0 0;
  text-align: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--ambre);
}

/* Mention du créateur sur l'écran d'accueil */
.credit {
  margin: 12px 0 0;
  text-align: center;
  font-size: .78rem;
  font-weight: 600;
  color: var(--tres-doux);
}
.credit strong { color: var(--doux); font-weight: 800; }

/* ---------- Feuille « choix du carburant » ---------- */
.feuille {
  width: 100%;
  max-width: 480px;
  margin: auto auto 0;
  padding: 10px 16px calc(var(--bas-sur) + 20px);
  border: 1px solid var(--ligne);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background: var(--fond-2);
  color: var(--texte);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .6);
}
.feuille[open] { animation: montee .28s ease-out; }
.feuille::backdrop {
  background: rgba(2, 6, 14, .7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.poignee {
  width: 42px;
  height: 5px;
  margin: 0 auto 14px;
  border-radius: 3px;
  background: var(--ligne-forte);
}
.feuille h2 {
  margin: 0 4px 14px;
  font-size: 1.15rem;
  font-weight: 800;
}
.grille-carburants {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.choix-carburant {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--ligne-forte);
  background: rgba(15, 23, 42, .8);
  text-align: left;
  cursor: pointer;
}
.choix-carburant strong { display: block; font-size: 1.05rem; font-weight: 800; }
.choix-carburant span { display: block; font-size: .78rem; font-weight: 600; color: var(--doux); }
.choix-carburant[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(56, 189, 248, .14);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

/* ---------- Bouton « ? » et fenêtre de fonctionnement ---------- */
.btn-infos span {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}
/* Sur l'écran d'accueil : en haut à droite */
.btn-infos-accueil {
  position: absolute;
  top: calc(var(--haut-sur) + 12px);
  right: 14px;
  z-index: 1;
}

.feuille-infos {
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.feuille-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 6px;
}
.feuille-entete h2 { margin: 0; }
.feuille-texte {
  padding: 0 4px 8px;
  color: var(--doux);
  font-size: .95rem;
  line-height: 1.5;
}
.feuille-texte h3 {
  margin: 18px 0 6px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--texte);
}
.feuille-texte p { margin: 0 0 8px; }
.feuille-texte ul { margin: 0 0 8px; padding-left: 20px; }
.feuille-texte li { margin-bottom: 4px; }

/* ---------- Pied de page (mentions obligatoires) ---------- */
.pied {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 8px 16px calc(var(--bas-sur) + 8px);
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  color: var(--tres-doux);
  background: linear-gradient(180deg, rgba(6, 10, 19, 0), rgba(6, 10, 19, .95) 45%);
}
.pied a { color: inherit; }

/* ---------- Repères sur la carte ---------- */
.repere-position { position: relative; width: 56px; height: 56px; }
.repere-position .halo {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: rgba(56, 189, 248, .25);
  animation: halo 2s ease-out infinite;
}
.repere-position .fleche {
  position: absolute;
  inset: 0;
  width: 56px;
  height: 56px;
  transition: transform .5s ease-out;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, .7));
}

.epingle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #0f172a;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .18), 0 4px 10px rgba(0, 0, 0, .5);
}
.epingle span {
  transform: rotate(45deg);
  color: #fff;
  font: 800 14px/1 "Manrope Variable", system-ui, sans-serif;
}
.epingle.best {
  background: #064e3b;
  border-color: var(--vert);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .22), 0 4px 10px rgba(0, 0, 0, .5);
}

/* ---------- Animations ---------- */
@keyframes pulsation { 50% { opacity: .3; } }
@keyframes rotation { to { transform: rotate(360deg); } }
@keyframes reflet { to { background-position: -200% 0, 0 0; } }
@keyframes apparition { from { opacity: 0; transform: translateY(8px); } }
@keyframes montee { from { transform: translateY(40px); opacity: 0; } }
@keyframes halo {
  0% { transform: scale(.6); opacity: .9; }
  100% { transform: scale(1.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Petits écrans ---------- */
@media (max-width: 430px) {
  .en-suivi .marque span { display: none; } /* logo seul : place pour la vitesse */
}
/* Très petits écrans : 4 boutons dans l'en-tête (zones tactiles conservées à 48 px) */
@media (max-width: 380px) {
  .barre { gap: 6px; }
  .actions { gap: 5px; }
  .puce-carburant { padding: 0 10px; gap: 6px; }
  .puce-carburant svg { display: none; }
  .pastille-gps { padding: 0 7px; }
}
@media (max-width: 360px) {
  .marque span { display: none; }
  .st-valeur { font-size: 2.5rem; }
  .st-dist, .st-prix { font-size: 1.3rem; }
  .bouclier { min-width: 50px; font-size: 1.1rem; }
}

/* ---------- Grands écrans : colonne centrée ---------- */
@media (min-width: 640px) {
  .entete, .stations { width: 100%; max-width: 520px; margin-left: auto; margin-right: auto; }
}

/* =========================================================
   Mode paysage (téléphone à l'horizontale, sur un support)
   Trois colonnes : carte à gauche | route, conseil, sorties | stations.
   Tout tient sans défilement. Même condition que CONFIG.MEDIA_PAYSAGE (app.js).
   ========================================================= */
@media (orientation: landscape) and (max-height: 560px) {
  .appli {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) 330px minmax(0, 330px);
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      ".  entete  titre"
      ".  conseil liste"
      ".  sorties liste";
    column-gap: 10px;
    align-content: start;
    min-height: 0;
    height: 100vh;
    height: 100dvh;
    padding: calc(var(--haut-sur) + 6px) max(12px, env(safe-area-inset-right)) calc(var(--hauteur-pied, 40px) + 4px) 0;
  }
  .appli > .fenetre-carte { display: none; }
  /* La liste se répartit dans la grille sans changer le HTML */
  #stations { display: contents; }
  .entete { grid-area: entete; padding: 0; }
  .stations-tete { grid-area: titre; align-self: end; padding: 0 4px 6px; }
  #conseil { grid-area: conseil; margin: 8px 0 0; }
  #liste-stations { grid-area: liste; align-self: start; }
  #bloc-sorties { grid-area: sorties; margin-top: 8px; align-self: start; }

  /* En-tête compact : logo seul */
  .en-suivi .marque span { display: none; }
  .barre { min-height: 44px; gap: 6px; }
  .actions { gap: 5px; }
  .route { margin-top: 6px; padding: 8px 12px; gap: 10px; }
  .bouclier { height: 32px; min-width: 48px; font-size: 1.05rem; }
  .route-titre { font-size: 1rem; }
  .route-sous { font-size: .78rem; }
  .toast { margin-top: 6px; padding: 6px 10px; font-size: .8rem; }

  /* Cartes plus compactes */
  .liste { gap: 6px; }
  .station.hero { padding: 8px 12px 10px; }
  .st-chiffres { margin-top: 4px; }
  .st-valeur { font-size: 2.2rem; }
  .st-valeur.prix-valeur.moyenne,
  .st-valeur.prix-valeur.plafond { font-size: 1.9rem; }
  .station.compacte { padding: 6px 12px 6px 10px; }
  .st-dist, .st-prix { font-size: 1.25rem; }
  .conseil { padding: 8px 12px; }

  /* Voile : carte visible à gauche, colonnes lisibles à droite */
  .voile {
    background:
      linear-gradient(90deg, rgba(6, 10, 19, 0) 0%, rgba(6, 10, 19, .2) 12%, rgba(6, 10, 19, .9) 26%, rgba(6, 10, 19, .96) 40%),
      linear-gradient(180deg, rgba(6, 10, 19, .5) 0%, rgba(6, 10, 19, 0) 20%);
  }
  .pied {
    left: auto;
    width: 680px;
    max-width: 82vw;
    padding-top: 4px;
  }

  /* Écran d'accueil : contenu centré verticalement */
  .accueil { align-items: center; padding-top: calc(var(--haut-sur) + 16px); }
}

/* =========================================================
   Pages publiques (pays, autoroute, station, éditoriales)
   Réutilisent les composants de l'appli ; règles limitées à
   body.page-contenu pour ne rien changer à l'application.
   ========================================================= */
body.page-contenu {
  background:
    radial-gradient(120% 50% at 50% 0%, rgba(37, 99, 235, .18), rgba(6, 10, 19, 0) 60%),
    var(--fond);
}
.page-contenu .entete,
.page-contenu .page-principal {
  width: 100%;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.page-contenu .marque { color: var(--texte); text-decoration: none; }
.page-contenu .marque span { display: inline; }
.page-contenu .puce-carburant { text-decoration: none; color: var(--texte); min-width: 48px; justify-content: center; }
.page-contenu .puce-carburant.actif { border-color: var(--accent); color: var(--accent); }
.page-principal { padding: 8px 14px 24px; }

.page-contenu a { color: var(--accent); text-underline-offset: 3px; }
.page-contenu .st-nom a { color: var(--texte); text-decoration: underline; text-decoration-color: rgba(56, 189, 248, .5); }
.page-contenu .cta { color: #04121f; text-decoration: none; }
.page-contenu .puce { color: var(--texte); text-decoration: none; }
.page-contenu .station.compacte .route-panneaux { max-width: none; }
.page-contenu .station.compacte .bouclier { min-width: 0; height: 30px; font-size: .95rem; }

.fil-ariane ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 14px;
  padding: 0;
  list-style: none;
  font-size: .8rem;
  font-weight: 600;
  color: var(--tres-doux);
}
.fil-ariane li + li::before { content: "›"; margin-right: 4px; }
.fil-ariane a { color: var(--doux); }

.page-titre {
  margin: 4px 0 6px;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.page-contenu .route { margin: 0 0 4px; }
.page-contenu .route-titre { margin: 0; font-size: 1.25rem; white-space: normal; }
.page-sous { margin: 0 0 10px; color: var(--doux); font-weight: 600; }
.page-intro {
  margin: 14px 0 6px;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--doux);
}
.page-section { margin-top: 22px; }
.page-note { margin: 8px 6px 0; font-size: .85rem; color: var(--doux); }

.page-infos {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--rayon);
  background: var(--verre-fort);
  border: 1px solid var(--ligne);
}
.page-infos dt { font-weight: 800; color: var(--doux); font-size: .85rem; }
.page-infos dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.page-infos code { font-family: inherit; font-size: .9rem; }
.pastille-carburant { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }

.page-voisines { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.page-voisines .station.compacte { grid-template-columns: 1fr; }
.page-voisines .st-nom > span:first-child { text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; }

.page-cta {
  margin-top: 28px;
  padding: 18px;
  border-radius: var(--rayon);
  background: var(--verre-fort);
  border: 1px solid var(--ligne-forte);
  text-align: center;
}
.page-cta p { margin: 0 0 14px; color: var(--doux); font-weight: 600; }
.page-cta .cta { margin-top: 0; }

/* Pied de page dans le flux (pas fixe) sur les pages de contenu */
.page-contenu .pied {
  position: static;
  background: none;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px calc(var(--bas-sur) + 18px);
}
