/* Ma station pas chère — feuille de style unique, d'après la maquette.
   Aucun style en ligne : la politique de sécurité (CSP) l'interdit. */

/* --- Polices (hébergées sur le site, licence OFL) ------------------------- */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: optional;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: optional;
  src: url("/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: optional;
  src: url("/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: optional;
  src: url("/fonts/space-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Couleurs de la maquette -------------------------------------------- */

:root {
  color-scheme: light;
  --fond: #F4F6F3;
  --surface: #FFFFFF;
  --encre: #16201B;
  --encre-2: #3E4A44;      /* étiquettes */
  --encre-3: #56635C;      /* texte secondaire */
  --bordure: #DDE3DF;
  --bordure-champ: #C5CEC9;
  --separation: #EEF1EF;
  --accent: #0F5C55;
  --accent-fonce: #0A3F3A;
  --accent-clair: #E7F3F1;
  --bandeau-texte: #F4F6F3;
  --bandeau-texte-2: #B8C4BE;
  /* Niveaux de prix : deux pôles opposés autour d'un gris neutre. */
  --bas: #1E3A8A;
  --moyen: #5B6B63;
  --haut: #C2410C;
  --position: #1D4ED8;
  --danger: #B42318;
  --ombre: 0 8px 24px rgba(22, 32, 27, 0.12);
  --bandeau-fond: #16201B;
  --sur-accent: #FFFFFF;
  --lien: #0F5C55;            /* texte et liens de couleur accent */      /* texte posé sur l'accent ou une couleur de niveau */
  --carte-fond: #E6ECE4;      /* fond affiché avant les tuiles */
  --serie: #0F5C55;           /* courbe d'historique */
  --grille: #E7E7E7;
  --axe: #C2C2C2;
  --ok: #0AAC23;
  --ko: #DC3C3D;
  --titre: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Mode sombre : suit le réglage du système. Couleurs des niveaux de prix revérifiées
   sur fond sombre (contraste >= 3 sur la carte, texte blanc >= 4,5, distinctes en daltonisme). */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --fond: #0F1512;
    --surface: #18211C;
    --encre: #E6ECE8;
    --encre-2: #C2CCC6;
    --encre-3: #93A099;
    --bordure: #29342E;
    --bordure-champ: #3A4741;
    --separation: #222C26;
    --accent: #1F7A70;
    --accent-fonce: #2A8C80;
    --accent-clair: #16302C;
    --bandeau-texte: #E6ECE8;
    --bandeau-texte-2: #93A099;
    --bas: #3E6FE0;
    --moyen: #677670;
    --haut: #C24E1C;
    --position: #4A84F0;
    --danger: #F07A6A;
    --ombre: 0 8px 24px rgba(0, 0, 0, 0.45);
    --bandeau-fond: #0B100D;
    --carte-fond: #1A221E;
    --serie: #5CC2B3;
    --grille: #2A332E;
    --axe: #47524C;
    --ok: #3CC45A;
    --ko: #F06060;
    --lien: #5CC2B3;
  }
  /* Icônes des boutons de zoom de MapLibre (noires par défaut). */
  .zone-carte .maplibregl-ctrl-icon { filter: invert(0.9); }
  /* Attribution de la carte (MapLibre la dessine en blanc par défaut). */
  .zone-carte .maplibregl-ctrl-attrib, .zone-carte .maplibregl-ctrl-attrib.maplibregl-compact { background-color: rgba(24, 33, 28, 0.85); color: var(--encre-3); }
  .zone-carte .maplibregl-ctrl-attrib a { color: var(--encre-2); }
  .zone-carte .maplibregl-ctrl-attrib-button { filter: invert(1); }
}

* { box-sizing: border-box; }
/* L'attribut hidden doit toujours l'emporter (sinon display: flex des composants le neutralise). */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  display: flex; flex-direction: column; min-height: 100%;
  background: var(--fond); color: var(--encre); font-size: 15px;
}
a { color: var(--lien); }
a:hover { color: var(--accent-fonce); }
button, input, select { font-family: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.visuellement-cache {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* --- Bandeau ------------------------------------------------------------- */

.bandeau {
  position: relative; /* contient le titre caché de l'accueil */
  padding-top: max(14px, env(safe-area-inset-top));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; background: var(--bandeau-fond); color: var(--bandeau-texte);
}
.marque {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--bandeau-texte);
  font-family: var(--titre); font-weight: 700; font-size: 22px; letter-spacing: -0.02em;
}
.marque:hover { color: var(--bandeau-texte); }
/* Hauteur réservée au bouton « Installer », qui apparaît après coup : pas de saut de l'en-tête. */
.navigation { display: flex; gap: 20px; font-size: 14px; align-items: center; min-height: 30px; }
.navigation a, .navigation button {
  padding: 0; border: 0; background: none; font: inherit; text-decoration: none; color: var(--bandeau-texte-2);
}
.navigation a[aria-current="page"] { color: var(--bandeau-texte); }
.navigation .nav-favoris[aria-pressed="true"] { color: #7FD1C3; }
.navigation .nav-favoris span { color: #7FD1C3; }
.navigation .bouton-installer {
  padding: 4px 12px; border: 1px solid #7FD1C3; border-radius: 999px; color: #7FD1C3; font-weight: 600;
}
.navigation .bouton-installer:hover { background: rgba(127, 209, 195, 0.12); color: #7FD1C3; text-decoration: none; }
.navigation a:hover, .navigation button:hover { color: var(--bandeau-texte); text-decoration: underline; }

/* --- Barre de recherche --------------------------------------------------- */

.barre-recherche {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px;
  padding: 18px 24px; background: var(--surface); border-bottom: 1px solid var(--bordure);
}
.groupe { display: flex; flex-direction: column; gap: 6px; }
.groupe-adresse { flex: 1 1 320px; min-width: 0; }
.etiquette { font-size: 13px; font-weight: 600; color: var(--encre-2); }
.ligne-adresse { display: flex; gap: 8px; }
.champ-adresse { position: relative; flex: 1; min-width: 0; }
.champ {
  height: 44px; padding: 0 14px; border: 1px solid var(--bordure-champ); border-radius: 10px;
  font-size: 15px; color: var(--encre); background: var(--surface);
}
.champ-adresse .champ { width: 100%; }
select.champ { padding: 0 12px; }

.bouton-icone {
  color: var(--lien);
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--bordure-champ); border-radius: 10px; background: var(--surface);
}
.bouton-icone:hover { background: var(--accent-clair); }

.pastilles-carburant { display: flex; flex-wrap: wrap; gap: 6px; }
.pastilles-carburant button {
  min-height: 44px; padding: 0 16px; border-radius: 22px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--bordure-champ); background: var(--surface); color: var(--encre);
}
.pastilles-carburant button:hover { border-color: var(--accent); }
.pastilles-carburant button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--sur-accent); }

.bouton-principal {
  height: 44px; padding: 0 22px; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--sur-accent); font-size: 15px; font-weight: 600;
}
.bouton-principal:hover { background: var(--accent-fonce); }

.suggestions {
  position: absolute; z-index: 2000; top: calc(100% + 4px); left: 0; right: 0;
  margin: 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px; box-shadow: var(--ombre);
}
.suggestions li { padding: 8px 14px; cursor: pointer; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--accent-clair); }
.suggestions .contexte { display: block; font-size: 12px; color: var(--encre-3); }

/* --- Zone principale : liste + carte ------------------------------------- */

.principal { flex: 1; display: flex; min-height: 560px; }

.resultats {
  flex: 1 1 380px; max-width: 460px; min-width: 0; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--bordure);
}
.resultats-entete {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px 12px;
}
.resultats-titre { margin: 0; font-family: var(--titre); font-size: 18px; font-weight: 700; }
/* Deux lignes réservées : le texte change pendant la recherche sans déplacer la liste. */
.resultats-sous-titre { margin: 2px 0 0; font-size: 13px; line-height: 1.4; min-height: 2.8em; color: var(--encre-3); }

.segments { display: flex; border: 1px solid var(--bordure-champ); border-radius: 8px; overflow: hidden; }
.segments button {
  min-height: 36px; padding: 0 14px; border: 0; font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--encre);
}
.segments button[aria-pressed="true"] { background: var(--encre); color: var(--surface); }

.quitter-favoris {
  margin-top: 6px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--lien);
}
.quitter-favoris:hover { text-decoration: underline; }
.station .etoile { color: #E0A100; }
.rang.aucun { background: var(--surface); color: var(--encre-3); box-shadow: inset 0 0 0 1px var(--bordure-champ); }
.fiche-favori {
  flex: none; width: 32px; height: 32px; margin: -6px 0 0; border: 0; border-radius: 50%;
  background: none; color: #E0A100; font-size: 20px; line-height: 1;
}
.fiche-favori:hover { background: var(--fond); }
.fiche-favori[aria-pressed="false"] { color: var(--encre-3); }
.statut { margin: 0; padding: 0 20px 12px; font-size: 13px; color: var(--encre-3); }
.statut:empty { display: none; }
.statut.erreur { color: var(--danger); font-weight: 600; }

/* position: relative : les textes réservés aux lecteurs d'écran (position absolue)
   restent dans la liste au lieu d'allonger la page. */
.liste { position: relative; flex: 1; margin: 0; padding: 0; list-style: none; overflow-y: auto; }
.liste.chargement { opacity: 0.5; }
.station {
  position: relative;
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 20px;
  border: 0; border-top: 1px solid var(--separation); background: var(--surface); text-align: left; color: inherit;
}
.station:hover { background: var(--fond); }
.station.active { background: var(--accent-clair); box-shadow: inset 4px 0 0 var(--accent); }
.station .rang {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: var(--sur-accent);
}
.station .infos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.station .nom { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.station .adresse, .station .detail { font-size: 13px; color: var(--encre-3); }
.station .detail { font-size: 12px; }
.station .tarif { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.station .prix { font-family: var(--titre); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.station .unite { font-size: 12px; color: var(--encre-3); }

.bas { background: var(--bas); }
.moyen { background: var(--moyen); }
.haut { background: var(--haut); }

/* --- Carte ----------------------------------------------------------------- */

.zone-carte { flex: 999 1 560px; min-width: 0; position: relative; background: var(--carte-fond); }
/* Sélecteur plus précis que « .maplibregl-map { position: relative } » de MapLibre,
   dont la feuille de style est ajoutée après la nôtre (chargement différé). */
.zone-carte > .carte { position: absolute; inset: 0; }

/* MapLibre : contrôles de zoom à la façon de la maquette (44 px, coins arrondis). */
.zone-carte .maplibregl-map { font-family: inherit; }
.zone-carte .maplibregl-ctrl-top-right { top: 6px; right: 6px; }
.zone-carte .maplibregl-ctrl-group:not(:empty) {
  display: flex; flex-direction: column; gap: 6px; background: none; box-shadow: none; border-radius: 0;
}
.zone-carte .maplibregl-ctrl-group button {
  width: 44px; height: 44px; border: 1px solid var(--bordure-champ) !important; border-radius: 10px;
  background-color: var(--surface);
}
.zone-carte .maplibregl-ctrl-group button + button { border-top: 1px solid var(--bordure-champ); }
.zone-carte .maplibregl-ctrl-group button:hover { background-color: var(--accent-clair); }
.zone-carte .maplibregl-ctrl-attrib { font-size: 11px; }

/* Épingle : l'élément extérieur est positionné par MapLibre (transform), on n'y touche pas. */
.epingle-marqueur { padding: 0; border: 0; background: none; cursor: pointer; z-index: 1; }
.epingle-marqueur.devant { z-index: 2; }
.epingle-marqueur.active { z-index: 3; }
.epingle-marqueur:focus-visible { outline: none; }
.epingle-marqueur:focus-visible .epingle { outline: 3px solid var(--accent); outline-offset: 2px; }
.epingle {
  display: inline-flex; align-items: center; transform-origin: 50% 100%;
  min-height: 32px; padding: 6px 10px; border-radius: 16px; border: 2px solid #FFFFFF; white-space: nowrap;
  color: var(--sur-accent); font-family: var(--titre); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 10px rgba(22, 32, 27, 0.25); transition: transform 0.15s ease-out;
}
.epingle-marqueur:hover .epingle { transform: scale(1.08); }
/* Épingle réduite à un point quand elle chevauche une moins chère ; le prix revient au survol. */
.epingle-marqueur.reduite .epingle {
  min-height: 0; width: 14px; height: 14px; padding: 0; border-radius: 50%; font-size: 0;
  transform: translateY(7px); box-shadow: 0 1px 4px rgba(22, 32, 27, 0.3);
}
.epingle-marqueur.reduite { z-index: 0; } /* les points restent sous les étiquettes de prix */
.epingle-marqueur.reduite:hover, .epingle-marqueur.reduite:focus-visible { z-index: 4; }
.epingle-marqueur.reduite:hover .epingle, .epingle-marqueur.reduite:focus-visible .epingle {
  min-height: 32px; width: auto; height: auto; padding: 6px 10px; border-radius: 16px; font-size: 14px; transform: none;
}
.epingle-marqueur.active .epingle { transform: scale(1.2); outline: 3px solid var(--encre); }
.position-utilisateur {
  width: 18px; height: 18px; border-radius: 50%; background: var(--position);
  border: 3px solid #FFFFFF; box-shadow: 0 0 0 8px rgba(29, 78, 216, 0.18);
}

.legende {
  position: absolute; z-index: 1000; left: 16px; bottom: 24px;
  display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px; font-size: 13px; color: var(--encre-2);
}
.legende > span { display: flex; align-items: center; gap: 6px; }
.carre { width: 12px; height: 12px; border-radius: 3px; }

.fiche {
  position: absolute; z-index: 1100; right: 16px; bottom: 24px; width: 300px; max-width: calc(100% - 32px);
  display: flex; flex-direction: column; gap: 10px; padding: 16px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 12px; box-shadow: var(--ombre);
}
.fiche-entete { display: flex; justify-content: space-between; gap: 8px; }
.fiche-titre { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fiche-nom { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.fiche-adresse, .fiche-distance, .fiche-services { font-size: 13px; color: var(--encre-3); }
.fiche-distance { white-space: nowrap; font-size: 12px; }
.fiche-source { font-size: 11px; color: var(--encre-3); }
.fiche-fermer {
  flex: none; width: 28px; height: 28px; margin: -6px -6px 0 0; border: 0; border-radius: 50%;
  background: none; color: var(--encre-3); font-size: 15px;
}
.fiche-fermer:hover { background: var(--fond); }
.fiche-prix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fiche-prix > div {
  display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px;
  border-radius: 8px; background: var(--fond); font-size: 13px;
}
.fiche-prix > div.courant { background: var(--accent-clair); box-shadow: inset 0 0 0 1px var(--accent); }
.fiche-prix .libelle { color: var(--encre-2); }
.fiche-prix .valeur { font-weight: 700; font-variant-numeric: tabular-nums; }
.fiche-prix .absent { color: var(--encre-3); font-weight: 400; }
.fiche-actions { display: flex; gap: 8px; }
.fiche-actions a, .fiche-actions button {
  flex: 1; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-weight: 600; font-size: 14px; text-decoration: none;
}
.fiche-actions a, .fiche-actions .bouton-itineraire { background: var(--accent); color: var(--sur-accent); border: 0; }
.fiche-actions a:hover, .fiche-actions .bouton-itineraire:hover { background: var(--accent-fonce); color: var(--sur-accent); }
.fiche-actions button:not(.bouton-itineraire) { background: var(--surface); color: var(--lien); border: 1px solid var(--bordure-champ); }
.fiche-actions .bouton-itineraire { border: 0; color: var(--sur-accent); }
.fiche-actions button:not(.bouton-itineraire):hover { background: var(--accent-clair); }

/* Choix de l'application de navigation. */
.choix-gps { display: flex; flex-direction: column; gap: 8px; }
.choix-gps-applis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.choix-gps-applis a {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 6px;
  border: 1px solid var(--bordure-champ); border-radius: 10px; background: var(--surface);
  color: var(--encre); font-size: 13px; font-weight: 600; text-decoration: none; text-align: center;
}
.choix-gps-applis a:hover { border-color: var(--accent); background: var(--accent-clair); color: var(--encre); }
.choix-gps-retenir { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--encre-2); cursor: pointer; }
.choix-gps-retenir input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.changer-gps { align-self: center; padding: 2px 6px; border: 0; background: none; font-size: 12px; color: var(--encre-3); text-decoration: underline; }

/* --- Ouverture, horaires, ruptures ---------------------------------------- */

/* Pastille de couleur + libellé écrit : l'état ne repose jamais sur la couleur seule. */
.ouverture { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--encre-2); }
.ouverture .point { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ouverture.ouvert .point { background: var(--ok); }
.ouverture.ferme .point { background: var(--ko); }
.ouverture.automate .point { background: var(--accent); }
.ouverture.inconnu { font-weight: 400; color: var(--encre-3); }
.fiche .ouverture { font-size: 13px; }

.fiche-horaires { font-size: 13px; }
.fiche-horaires summary { cursor: pointer; color: var(--lien); font-weight: 600; }
.fiche-horaires table { width: 100%; margin-top: 6px; border-collapse: collapse; }
.fiche-horaires th, .fiche-horaires td { padding: 2px 0; text-align: left; vertical-align: top; font-variant-numeric: tabular-nums; }
.fiche-horaires th { width: 6.5rem; font-weight: 400; color: var(--encre-3); }
.fiche-horaires tr.aujourdhui th, .fiche-horaires tr.aujourdhui td { font-weight: 700; color: var(--encre); }

.fiche-prix .rupture { color: var(--danger); font-weight: 600; }
.fiche-ruptures { font-size: 12px; color: var(--danger); }

/* --- Pied de page --------------------------------------------------------- */

.pied {
  display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 10px 24px;
  font-size: 12px; color: var(--encre-3); background: var(--surface); border-top: 1px solid var(--bordure);
}
.pied-villes { display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* --- Historique (fenêtre) ------------------------------------------------- */

.historique {
  width: min(44rem, calc(100vw - 2rem)); padding: 20px; border: 0; border-radius: 12px;
  background: var(--surface); color: var(--encre); box-shadow: 0 10px 40px rgba(22, 32, 27, 0.3);
}
.historique::backdrop { background: rgba(22, 32, 27, 0.45); }
.historique-entete { display: flex; justify-content: space-between; gap: 16px; }
.historique-titre { margin: 0; font-family: var(--titre); font-size: 18px; }
.historique-sous-titre { margin: 4px 0 0; color: var(--encre-3); font-size: 13px; }
.bouton-fermer {
  align-self: start; width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: none; color: var(--encre-3); font-size: 16px;
}
.bouton-fermer:hover { background: var(--fond); }

.periodes { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 12px; }
.periodes button {
  min-height: 36px; padding: 0 14px; border-radius: 18px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--bordure-champ); background: var(--surface); color: var(--encre);
}
.periodes button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }

.chiffres { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-bottom: 8px; }
.chiffre .libelle { font-size: 12px; color: var(--encre-3); }
.chiffre .valeur { font-family: var(--titre); font-size: 22px; font-weight: 700; }

.graphique { position: relative; min-height: 14rem; }
.graphique.chargement { opacity: 0.5; }
.graphique svg { display: block; width: 100%; overflow: visible; }
.graphique .grille { stroke: var(--grille); stroke-width: 1; }
.graphique .axe { stroke: var(--axe); stroke-width: 1; }
.graphique .graduation { fill: var(--encre-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.graphique .serie { fill: none; stroke: var(--serie); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.graphique .point { fill: var(--serie); stroke: var(--surface); stroke-width: 2; }
.graphique .etiquette-fin { fill: var(--encre); font-size: 12px; font-weight: 600; }
.graphique .reticule { stroke: var(--encre-3); stroke-width: 1; }
.graphique .zone-survol { fill: transparent; cursor: crosshair; }
.graphique .vide { padding: 48px 16px; text-align: center; color: var(--encre-3); }
.infobulle {
  position: absolute; pointer-events: none; padding: 6px 9px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--bordure); box-shadow: var(--ombre);
  font-size: 12px; white-space: nowrap;
}
.infobulle strong { display: block; font-size: 15px; }
.infobulle span { color: var(--encre-3); }

.tableau-donnees { margin-top: 12px; font-size: 13px; }
.tableau-donnees summary { cursor: pointer; color: var(--lien); font-weight: 600; }
.tableau-donnees table { margin-top: 8px; border-collapse: collapse; width: 100%; }
.tableau-donnees th, .tableau-donnees td {
  padding: 4px 8px; border-bottom: 1px solid var(--separation); text-align: left; font-variant-numeric: tabular-nums;
}

/* --- Téléphone ------------------------------------------------------------ */

/* Éléments propres au téléphone, masqués sur ordinateur. */
.poignee, .sources-mobile, .libelle-court { display: none; }

@media (max-width: 860px) {
  /* Écran d'application : rien ne défile hormis la liste ; hauteur réelle (barres du navigateur). */
  /* Page de la carte uniquement : écran d'application, rien ne défile hormis la liste.
     (Les autres pages — à propos, prix par ville… — défilent normalement.) */
  html.page-carte, html.page-carte body { height: 100%; overflow: hidden; }
  body.page-carte { height: 100dvh; min-height: 0; }

  .bandeau { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); gap: 8px; }
  .marque { font-size: 18px; gap: 8px; }
  .marque svg { width: 22px; height: 22px; }
  .navigation .nav-ordinateur, .libelle-long { display: none; }
  .libelle-court { display: inline; }
  .bandeau { flex-wrap: nowrap; }
  .marque { min-width: 0; white-space: nowrap; }
  .navigation { gap: 12px; align-items: center; }

  /* Recherche compacte : adresse + position + rayon, puis carburants défilants. */
  .barre-recherche {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px 12px;
    box-shadow: 0 2px 8px rgba(22, 32, 27, 0.06); position: relative; z-index: 1500;
  }
  .barre-recherche .etiquette {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .groupe-adresse { grid-column: 1; }
  .groupe:has(#rayon) { grid-column: 2; }
  .groupe:has(#carburants) { grid-column: 1 / -1; margin: 0 -12px; }
  .champ { font-size: 16px; } /* 16 px minimum : évite le zoom automatique d'iOS */
  select.champ { padding: 0 8px; }
  .pastilles-carburant {
    flex-wrap: nowrap; overflow-x: auto; padding: 0 12px; gap: 6px;
    scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  }
  .pastilles-carburant::-webkit-scrollbar { display: none; }
  .pastilles-carburant button { flex: none; min-height: 40px; padding: 0 14px; scroll-snap-align: start; }
  .bouton-principal { display: none; } /* Entrée ou choix d'une suggestion lance la recherche */

  /* Carte plein écran, panneau des résultats par-dessus. */
  .principal { position: relative; display: block; flex: 1; min-height: 0; }
  .zone-carte { position: absolute; inset: 0; }
  .zone-carte .maplibregl-ctrl-group { display: none !important; } /* zoom au doigt */

  .resultats {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 1200;
    height: calc(100% - 56px); max-width: none; border-right: 0; border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 24px rgba(22, 32, 27, 0.18);
    transform: translateY(calc(100% - var(--visible, 150px)));
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
  }
  .resultats.glisse { transition: none; }
  .resultats.masque { transform: translateY(100%); }
  .poignee {
    display: flex; justify-content: center; align-items: center; flex: none;
    width: 100%; height: 22px; padding: 0; border: 0; background: none; touch-action: none; cursor: grab;
  }
  .poignee span { width: 40px; height: 5px; border-radius: 3px; background: var(--bordure-champ); }
  .resultats-entete { padding: 0 16px 10px; touch-action: none; }
  .resultats-titre { font-size: 17px; }
  .statut { padding: 0 16px 10px; }
  .liste { overscroll-behavior: contain; }
  .resultats[data-position="replie"] .liste { overflow: hidden; }
  .station { padding: 12px 16px; }
  .sources-mobile {
    display: block; margin: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    font-size: 11px; line-height: 1.5; color: var(--encre-3); border-top: 1px solid var(--separation);
  }
  .page-carte .pied { display: none; } /* remplacé par les sources en bas de la liste */

  /* Fiche station : carte en bas d'écran, à la place du panneau. */
  .fiche {
    z-index: 1300; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto; max-width: none; max-height: 72%; overflow-y: auto; border-radius: 16px;
  }
  .legende { top: 8px; left: 8px; bottom: auto; gap: 10px; padding: 6px 10px; font-size: 11px; }
  .carre { width: 10px; height: 10px; }

  .historique { width: calc(100vw - 16px); max-height: calc(100dvh - 32px); padding: 16px; }
  .chiffre .valeur { font-size: 18px; }
}

/* --- Pages de texte (à propos, mentions légales) ------------------------- */

.page-texte { box-sizing: border-box; width: 100%; min-width: 0; max-width: 46rem; margin: 0 auto; padding: 24px 16px 48px; line-height: 1.6; }
.page-texte h1 { font-family: var(--titre); font-size: 28px; letter-spacing: -0.01em; }
.page-texte h2 { font-family: var(--titre); font-size: 19px; margin-top: 32px; }
.page-texte .a-completer { background: #FBB315; color: #0B0B0B; padding: 0 4px; border-radius: 3px; }

/* --- Pages par ville (annuaire généré par le Worker) ---------------------- */

.page-annuaire { max-width: 60rem; }
.fil-ariane { font-size: 13px; color: var(--encre-3); margin-bottom: 8px; }
.fil-ariane a { color: var(--encre-3); }
.en-bref { padding-left: 20px; }
.en-bref li { margin: 6px 0; }
.liste-annuaire { list-style: none; padding: 0; margin: 16px 0; columns: 3 14rem; column-gap: 24px; }
.liste-annuaire li { break-inside: avoid; display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--separation); }
.liste-annuaire span { font-size: 12px; color: var(--encre-3); white-space: nowrap; }
.bouton-carte {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 10px;
  background: var(--accent); color: var(--sur-accent); font-weight: 600; text-decoration: none;
}
.bouton-carte:hover { background: var(--accent-fonce); color: var(--sur-accent); }
.tableau-defilant { position: relative; overflow-x: auto; margin: 16px 0; border: 1px solid var(--bordure); border-radius: 12px; background: var(--surface); }
.tableau-prix { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau-prix th, .tableau-prix td { padding: 10px 12px; border-bottom: 1px solid var(--separation); text-align: right; vertical-align: top; white-space: nowrap; }
.tableau-prix thead th { font-size: 12px; color: var(--encre-3); font-weight: 600; background: var(--fond); }
.tableau-prix th[scope="row"], .tableau-prix thead th:first-child { text-align: left; white-space: normal; min-width: 14rem; }
.tableau-prix td { font-variant-numeric: tabular-nums; font-weight: 600; }
.tableau-prix td.meilleur { color: var(--accent); background: var(--accent-clair); }
.tableau-prix td.absent { color: var(--encre-3); font-weight: 400; }
.station-nom { display: block; font-weight: 600; }
.station-adresse { display: block; font-size: 12px; font-weight: 400; color: var(--encre-3); }
.note { font-size: 13px; color: var(--encre-3); }
@media (prefers-color-scheme: dark) { .tableau-prix td.meilleur { color: var(--lien); } }

/* Petits téléphones : le nom du site tient sur la ligne de l'en-tête. */
@media (max-width: 430px) {
  .libelle-favoris { display: none; }
  .nav-favoris span[aria-hidden="true"]:first-child { font-size: 20px; line-height: 1; }
  .marque { font-size: 17px; gap: 6px; }
  .bandeau { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 370px) {
  .marque { font-size: 16px; }
  .marque svg { width: 20px; height: 20px; }
}
