:root {
  --tunnel-primaire: #1a1a2e;
  --tunnel-primaire-clair: #2d5aa0;
  --tunnel-accent: #e8952f;
  --tunnel-fond: #f5f7fa;
  --tunnel-texte: #2c2c2c;
  --tunnel-texte-clair: #6b7280;
  --tunnel-bordure: #e2e5ea;
  --tunnel-succes: #2e9e5b;
  --tunnel-rayon: 14px;
  --tunnel-ombre: 0 8px 24px rgba(26, 60, 110, 0.08);
}

* {
  box-sizing: border-box;
}


html {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  overflow: hidden;
  background: var(--tunnel-fond);
  color: var(--tunnel-texte);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
}

/* Page sans scroll global, sur tous les écrans : la carte garde toujours sa
   taille, seule la colonne formulaire défile en interne si nécessaire. */
.tunnel-page {
  display: flex;
  flex-direction: column;
  height: 100vh; /* repli pour les navigateurs sans support de dvh */
  height: 100dvh;
  overflow: hidden;
}

/* Espace réservé pour le futur logo (hauteur type barre de menu). */
.tunnel-logo-bar {
  flex: 0 0 auto;
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.tunnel-header {
  flex: 0 0 auto;
  padding: 16px 16px 0;
}

.tunnel-etape-label {
  font-weight: 700;
  color: var(--tunnel-primaire);
  margin-bottom: 10px;
  font-size: 0.95rem;
}

/* Barre de progression plein-bord (edge-to-edge), en dehors du padding du header. */
.tunnel-progress {
  height: 6px;
  background: #dfe4ec;
  overflow: hidden;
}

.tunnel-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--tunnel-primaire), var(--tunnel-primaire-clair));
  transition: width 0.4s ease;
}

/* Layout 2 colonnes : formulaire + carte persistante.
   Mobile : carte au-dessus (column-reverse inverse l'ordre visuel
   sans toucher au DOM), formulaire en dessous. */
.tunnel-layout {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column-reverse;
  min-height: 0;
}

.tunnel-colonne-form {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tunnel-colonne-carte {
  /* Désactivée sur mobile (voir media query desktop plus bas) : la carte, le
     récap, le teaser agent et le bouton replier causaient des sauts de mise
     en page liés au clavier/à la barre d'adresse Safari sur cette colonne
     fixe. Gardée en desktop où le problème ne se posait pas (pas de clavier
     virtuel ni de barre d'adresse qui bouge). */
  display: none;
}

#tunnelForm {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tunnel-step {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  animation: tunnel-fade-in 0.35s ease;
}

.tunnel-step.active {
  display: flex;
}

/* Contenu défilant de l'étape : le bouton (.tunnel-etape-nav) reste toujours
   calé en bas de la colonne, même quand le contenu est court. */
.tunnel-step-contenu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px 0;
}

#etapeFinaleForm {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

@keyframes tunnel-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.tunnel-titre {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--tunnel-primaire);
  margin-bottom: 6px;
}

.tunnel-soustitre {
  color: var(--tunnel-texte-clair);
  margin-bottom: 24px;
}

.tunnel-facultatif {
  color: var(--tunnel-texte-clair);
  font-weight: 400;
  font-size: 1rem;
}

.tunnel-requis {
  color: var(--tunnel-accent);
  font-weight: 400;
  font-size: 0.85rem;
}

/* Note explicative : rappelle que les caractéristiques déclarées influencent
   le calcul, pour inciter à répondre objectivement. */
.tunnel-note-algo {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(232, 149, 47, 0.08);
  border: 1px solid var(--tunnel-accent);
  border-radius: var(--tunnel-rayon);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--tunnel-texte-clair);
}

.tunnel-note-algo i {
  color: var(--tunnel-primaire);
  margin-top: 2px;
}

.tunnel-note-algo-resultat {
  margin-top: 6px;
  font-style: italic;
}

/* Navigation bas de sous-étape : "Retour" à gauche, action principale à droite.
   Toujours calée tout en bas de la colonne formulaire (flex item fixe),
   même quand le contenu de l'étape est court. */
.tunnel-etape-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 16px;
  border-top: 1px solid var(--tunnel-bordure);
}

.tunnel-etape-nav .tunnel-btn {
  width: auto;
  min-width: 160px;
}

.tunnel-retour {
  background: none;
  border: none;
  color: var(--tunnel-texte-clair);
  font-weight: 600;
  cursor: pointer;
  padding: 10px 4px;
}

.tunnel-retour:hover {
  color: var(--tunnel-primaire);
}

.tunnel-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  cursor: pointer;
}

.tunnel-checkbox input {
  width: 18px;
  height: 18px;
}

.tunnel-checkbox a {
  color: var(--tunnel-primaire);
  text-decoration: underline;
}

.tunnel-checkbox-inline {
  margin-top: 10px;
  font-size: 0.88rem;
}

/* Case "être recontacté" mise en avant (facilement manquée en bas du
   formulaire) — pas cochée par défaut (RGPD : le consentement pré-coché
   n'est pas valable), juste plus visible. */
.tunnel-champ-recontact {
  background: rgba(232, 149, 47, 0.08);
  border: 1px solid var(--tunnel-accent);
  border-radius: var(--tunnel-rayon);
  padding: 14px 16px;
}

/* Sélecteur de lettres DPE/GES */
.tunnel-lettres {
  display: flex;
  gap: 6px;
}

.tunnel-lettre {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border: 2px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

/* Échelle de couleurs DPE/GES officielle (A = vert foncé → G = rouge). */
.tunnel-lettre[data-lettre="A"] { background: #16a34a; }
.tunnel-lettre[data-lettre="B"] { background: #22c55e; }
.tunnel-lettre[data-lettre="C"] { background: #84cc16; }
.tunnel-lettre[data-lettre="D"] { background: #eab308; }
.tunnel-lettre[data-lettre="E"] { background: #f97316; }
.tunnel-lettre[data-lettre="F"] { background: #ea580c; }
.tunnel-lettre[data-lettre="G"] { background: #dc2626; }

.tunnel-lettre:hover {
  transform: translateY(-2px);
}

.tunnel-lettre.selected {
  border-color: var(--tunnel-texte);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.tunnel-lettres.desactive {
  opacity: 0.4;
  pointer-events: none;
}

/* Toggle Oui/Non (ex: "Êtes-vous propriétaire ?") */
.tunnel-toggle {
  display: flex;
  gap: 10px;
}

.tunnel-toggle-option {
  flex: 0 0 auto;
  min-width: 90px;
  text-align: center;
  padding: 10px 20px;
  border: 2px solid var(--tunnel-bordure);
  border-radius: 24px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.tunnel-toggle-option:hover {
  border-color: var(--tunnel-primaire-clair);
}

.tunnel-toggle-option.selected {
  border-color: var(--tunnel-primaire);
  background: var(--tunnel-primaire);
  color: #fff;
}

/* Widget d'avis sur l'estimation (étape résultat) */
.tunnel-avis {
  margin-bottom: 20px;
}

.tunnel-avis label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
}

.tunnel-avis-boutons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tunnel-avis-bouton {
  padding: 8px 16px;
  border: 2px solid var(--tunnel-bordure);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.tunnel-avis-bouton:hover {
  border-color: var(--tunnel-primaire-clair);
}

.tunnel-avis-bouton.selected {
  border-color: var(--tunnel-primaire);
  background: var(--tunnel-primaire);
  color: #fff;
}

/* Sélecteurs visuels (type de bien, état général) */
.tunnel-choix-grille {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.tunnel-choix-grille-3 {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 480px) {
  .tunnel-choix-grille-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Élément de la grille "Autres caractéristiques" */
.tunnel-carac-item {
  display: flex;
  flex-direction: column;
}

.tunnel-choix {
  border: 2px solid var(--tunnel-bordure);
  border-radius: var(--tunnel-rayon);
  background: #fff;
  padding: 18px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.tunnel-choix:hover {
  border-color: var(--tunnel-primaire-clair);
  transform: translateY(-2px);
}

.tunnel-choix.selected {
  border-color: var(--tunnel-primaire);
  background: #eef3fb;
}

.tunnel-choix .icone {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 6px;
  color: #d1d5dc;
  transition: color 0.2s ease;
}

.tunnel-choix.selected .icone {
  color: var(--tunnel-primaire);
}

.tunnel-choix .label {
  font-weight: 600;
  font-size: 0.95rem;
}

.tunnel-choix .label-exemple {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--tunnel-texte-clair);
  margin-top: 2px;
}

/* Champs de formulaire */
.tunnel-champ {
  margin-bottom: 18px;
}

.tunnel-champ label:not(.tunnel-checkbox) {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

/* Icône d'info avec infobulle (ex: précisions sur "Nombre de pièces") */
.tunnel-info {
  display: inline-flex;
  position: relative;
  color: var(--tunnel-texte-clair);
  font-size: 0.85em;
  font-weight: 400;
  cursor: help;
  margin-left: 2px;
  vertical-align: middle;
}

.tunnel-info:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 135%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.3;
  white-space: normal;
  width: 200px;
  text-align: center;
  z-index: 20;
  box-shadow: var(--tunnel-ombre);
}

.tunnel-info:hover::before {
  content: '';
  position: absolute;
  bottom: 118%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #333;
  z-index: 20;
}

.tunnel-champ input:not([type="checkbox"]),
.tunnel-champ select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--tunnel-bordure);
  border-radius: 10px;
  font-size: 1rem;
}

.tunnel-champ input:not([type="checkbox"]):focus,
.tunnel-champ select:focus {
  outline: none;
  border-color: var(--tunnel-primaire-clair);
}

.tunnel-champ-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Autocomplétion adresse */
.tunnel-autocomplete {
  position: relative;
}

.tunnel-suggestions {
  position: absolute;
  z-index: 10;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--tunnel-bordure);
  border-top: none;
  border-radius: 0 0 10px 10px;
  box-shadow: var(--tunnel-ombre);
  max-height: 220px;
  overflow-y: auto;
}

.tunnel-suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.92rem;
}

.tunnel-suggestions button:hover {
  background: var(--tunnel-fond);
}

#tunnelCarte {
  position: relative;
  z-index: 0;
  height: 260px;
  border-radius: var(--tunnel-rayon);
  border: 1px solid var(--tunnel-bordure);
  background: #e9edf3;
  transition: height 0.3s ease;
  overflow: hidden;
}

.tunnel-carte-placeholder {
  height: 260px;
  border-radius: var(--tunnel-rayon);
  border: 1px solid var(--tunnel-bordure);
  background: #e9edf3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: var(--tunnel-texte-clair);
  transition: height 0.3s ease;
  overflow: hidden;
}

/* Bouton replier/déplier la carte (mobile uniquement, voir media query desktop
   plus bas qui le masque). Utile surtout à l'étape résultat, où la carte prend
   trop de place fixe par rapport à ce qu'elle apporte encore. */
.tunnel-toggle-carte {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  z-index: 10;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: var(--tunnel-ombre);
  color: var(--tunnel-primaire);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
}

.tunnel-toggle-carte i {
  transition: transform 0.2s ease;
}

/* Carte repliée : complètement masquée, ne garde qu'une bande fine avec le
   bouton pour la ré-ouvrir. */
.tunnel-colonne-carte.tunnel-carte-reduite {
  flex: 0 0 44px;
}

.tunnel-colonne-carte.tunnel-carte-reduite #tunnelCarte,
.tunnel-colonne-carte.tunnel-carte-reduite .tunnel-carte-placeholder {
  /* !important nécessaire : leur display est fixé en style inline par le JS
     (afficherCarte/initCarteFrance), qui passerait sinon devant cette règle. */
  display: none !important;
}

.tunnel-colonne-carte.tunnel-carte-reduite .tunnel-recap-bien,
.tunnel-colonne-carte.tunnel-carte-reduite .tunnel-teaser-agent,
.tunnel-colonne-carte.tunnel-carte-reduite .tunnel-bloc-secteur {
  /* !important nécessaire : ces blocs ont leur display fixé en style inline par le JS
     (mettreAJourRecap/afficherTeaserAgent/chargerEstimationSecteur), qui passerait
     sinon devant une règle CSS classique. */
  display: none !important;
}

.tunnel-colonne-carte.tunnel-carte-reduite .tunnel-toggle-carte i {
  transform: rotate(180deg);
}

/* Leaflet met ses panneaux/contrôles à z-index jusqu'à 1000 par défaut,
   ce qui passe au-dessus du menu du site (sticky/fixed) au scroll.
   On les recale bien en dessous, en gardant leur ordre interne. */
#tunnelCarte .leaflet-pane { z-index: 1; }
#tunnelCarte .leaflet-tile-pane { z-index: 1; }
#tunnelCarte .leaflet-overlay-pane { z-index: 2; }
#tunnelCarte .leaflet-shadow-pane { z-index: 3; }
#tunnelCarte .leaflet-marker-pane { z-index: 4; }
#tunnelCarte .leaflet-tooltip-pane { z-index: 5; }
#tunnelCarte .leaflet-popup-pane { z-index: 6; }
#tunnelCarte .leaflet-control { z-index: 7; }
#tunnelCarte .leaflet-top,
#tunnelCarte .leaflet-bottom { z-index: 8; }

/* Récap du bien, en incrustation sur la carte : se remplit au fur et à
   mesure que le visiteur avance dans le tunnel. */
.tunnel-recap-bien {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 9;
  background: #fff;
  border-radius: var(--tunnel-rayon);
  box-shadow: var(--tunnel-ombre);
  padding: 16px 18px;
  max-height: 200px;
  overflow-y: auto;
}

.tunnel-recap-titre {
  font-weight: 700;
  color: var(--tunnel-primaire);
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.tunnel-recap-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tunnel-recap-liste li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--tunnel-texte);
}

.tunnel-recap-liste li i {
  color: var(--tunnel-primaire);
  width: 16px;
  text-align: center;
  margin-top: 2px;
  flex: 0 0 auto;
}

/* Teaser expert, en incrustation en bas à droite de la carte : rassure dès
   que la zone (code postal) est connue, avant même d'arriver à l'étape 6. */
.tunnel-teaser-agent {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 260px;
  background: #fff;
  border-radius: 999px;
  box-shadow: var(--tunnel-ombre);
  padding: 8px 16px 8px 8px;
}

.tunnel-teaser-agent img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.tunnel-teaser-agent p {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--tunnel-texte);
}

/* Version mobile du teaser expert : la carte étant désactivée sur mobile
   (voir .tunnel-colonne-carte), ce bandeau vit dans la colonne formulaire à
   la place, juste sous l'en-tête d'étape — visible sur toutes les étapes
   1 à 5 comme la version desktop en incrustation sur la carte. */
.tunnel-teaser-agent-mobile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 12px;
  background: #fff;
  border-radius: var(--tunnel-rayon);
  box-shadow: var(--tunnel-ombre);
  padding: 10px 14px;
}

.tunnel-teaser-agent-mobile img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.tunnel-teaser-agent-mobile p {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--tunnel-texte);
}

/* Bloc DVF secteur */
.tunnel-bloc-secteur {
  background: #fff;
  border-radius: var(--tunnel-rayon);
  box-shadow: var(--tunnel-ombre);
  padding: 18px;
  margin-bottom: 20px;
}

.tunnel-bloc-secteur .chiffre {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--tunnel-primaire);
}

/* Légende "Vie de quartier" sous la carte persistante (desktop) : les points
   d'intérêt sont ajoutés directement sur #tunnelCarte (voir tunnel.js), pas
   de carte séparée ici — seulement la légende. */
.tunnel-quartier-legende-carte {
  background: #fff;
  border-radius: var(--tunnel-rayon);
  box-shadow: var(--tunnel-ombre);
  padding: 14px 18px;
  margin-bottom: 20px;
}

.tunnel-quartier-legende-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

.tunnel-quartier-legende-toggle .tunnel-bloc-titre {
  margin-bottom: 0;
}

.tunnel-quartier-legende-toggle i.fa-chevron-up {
  color: var(--tunnel-primaire);
  transition: transform 0.2s ease;
}

/* Replié par défaut : seul le bandeau titre est visible, la légende se
   charge tranquillement en arrière-plan pendant ce temps (voir tunnel.js) —
   le prospect déplie lui-même quand il veut, pas de pop-in automatique. */
.tunnel-quartier-legende-carte.est-reduit .tunnel-quartier-legende {
  display: none;
}

.tunnel-quartier-legende-carte:not(.est-reduit) .tunnel-quartier-legende-toggle i.fa-chevron-up {
  transform: rotate(180deg);
}

.tunnel-quartier-legende-carte:not(.est-reduit) .tunnel-quartier-legende {
  margin-top: 12px;
}

/* Dans l'incrustation sur la carte (desktop), la légende s'étale sur toute
   la largeur disponible du bandeau (déplié = plus de contrainte de largeur,
   voir media query desktop) et retourne à la ligne au besoin — pas de
   défilement horizontal. */
.tunnel-quartier-legende-carte .tunnel-quartier-legende {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 18px;
}

.tunnel-quartier-legende-carte .tunnel-quartier-legende-groupe {
  flex: 0 0 auto;
  min-width: 140px;
}

/* Étape 3 : résultat */
.tunnel-resultat {
  background: #fff;
  border-radius: var(--tunnel-rayon);
  box-shadow: var(--tunnel-ombre);
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 20px;
}

.tunnel-resultat-label {
  font-weight: 700;
  color: var(--tunnel-primaire);
  font-size: 1.05rem;
}

.tunnel-resultat .fourchette {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--tunnel-primaire);
  margin: 6px 0;
}

.tunnel-resultat-m2 {
  color: var(--tunnel-texte-clair);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.tunnel-resultat-plage {
  display: flex;
  justify-content: space-around;
  gap: 16px;
  margin-bottom: 16px;
}

.tunnel-resultat-plage-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tunnel-resultat-plage-item .fleche {
  font-size: 1.3rem;
  color: var(--tunnel-texte-clair);
}

.tunnel-resultat-plage-item .label {
  font-size: 0.78rem;
  color: var(--tunnel-texte-clair);
  text-align: left;
}

.tunnel-resultat-plage-item .valeur {
  font-weight: 700;
  color: var(--tunnel-texte);
  text-align: left;
}

.tunnel-resultat .details {
  font-size: 0.85rem;
  color: var(--tunnel-texte-clair);
}

/* Détails secteur (étape résultat) : transactions similaires + évolution du prix.
   Empilés en mobile, côte à côte à partir de 768px. */
.tunnel-secteur-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
  min-width: 0;
}

@media (min-width: 768px) {
  .tunnel-secteur-details {
    flex-direction: row;
  }
  .tunnel-transactions,
  .tunnel-evolution {
    flex: 1 1 50%;
    min-width: 0;
  }
}

.tunnel-bloc-titre {
  font-weight: 700;
  color: var(--tunnel-primaire);
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.tunnel-bloc-titre i {
  margin-right: 6px;
}

.tunnel-transactions {
  background: #fff;
  border-radius: var(--tunnel-rayon);
  box-shadow: var(--tunnel-ombre);
  padding: 18px;
}

.tunnel-transactions-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tunnel-transactions-liste li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--tunnel-bordure);
  font-size: 0.85rem;
}

.tunnel-transactions-liste li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.tunnel-transactions-liste .transaction-date {
  color: var(--tunnel-texte-clair);
}

.tunnel-transactions-liste .transaction-details {
  color: var(--tunnel-texte-clair);
  font-size: 0.8rem;
}

.tunnel-transactions-liste .transaction-prix {
  font-weight: 700;
  color: var(--tunnel-primaire);
  text-align: right;
}

.tunnel-transactions-liste .transaction-prix-m2 {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--tunnel-texte-clair);
}

.tunnel-evolution {
  background: #fff;
  border-radius: var(--tunnel-rayon);
  box-shadow: var(--tunnel-ombre);
  padding: 18px;
  min-width: 0;
}

/* Chart.js peut fixer une largeur en style inline supérieure au conteneur si
   celui-ci n'était pas encore visible à l'initialisation — on la plafonne. */
#graphiqueEvolution {
  max-width: 100% !important;
}

/* Vie de quartier (étape résultat) : carte des points d'intérêt + légende. */
.tunnel-quartier {
  background: #fff;
  border-radius: var(--tunnel-rayon);
  box-shadow: var(--tunnel-ombre);
  padding: 18px;
  margin-top: 20px;
}

.tunnel-quartier-carte {
  width: 100%;
  height: 320px;
  border-radius: 14px;
  overflow: hidden;
}

.tunnel-quartier-marqueur-bien {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--tunnel-primaire);
  color: #fff;
  box-shadow: 0 3px 10px rgba(16, 42, 67, .35);
  font-size: 13px;
}

.tunnel-quartier-legende {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.tunnel-quartier-legende-titre {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--tunnel-texte-clair);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}

.tunnel-quartier-legende-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--tunnel-primaire);
  margin-bottom: 6px;
}

.tunnel-quartier-legende-puce {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 12px;
}

.tunnel-quartier-chargement {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--tunnel-texte-clair);
  font-size: 0.85rem;
  text-align: center;
}

.tunnel-choix-parcours {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

/* Fiche agent */
.tunnel-fiche-agent {
  background: #fff;
  border-radius: var(--tunnel-rayon);
  box-shadow: var(--tunnel-ombre);
  padding: 20px;
  text-align: center;
}

.tunnel-fiche-agent img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
}

.tunnel-fiche-agent .nom {
  font-weight: 700;
  font-size: 1.1rem;
}

.tunnel-fiche-agent .certifications {
  color: var(--tunnel-texte-clair);
  font-size: 0.85rem;
  margin: 4px 0 10px;
}

.tunnel-fiche-agent .actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: center;
}

.tunnel-fiche-agent .actions .btn {
  flex: 1;
}

/* Boutons */
.tunnel-btn {
  display: inline-block;
  width: 100%;
  padding: 8px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

/* Même couleur que les boutons du site (.btn-estimmo, navy #102a43) —
   sauf "Faire valider mon estimation par un expert" et "Appeler" (fiche agent),
   qui gardent leur orange d'origine pour rester les CTA les plus visibles. */
.tunnel-btn-primaire {
  background: #102a43;
  color: #fff;
}

.tunnel-btn-primaire:hover {
  background: #081a2b;
  color: #fff;
}

#btnCheminExpert.tunnel-btn-primaire,
#btnAppelerAgent.tunnel-btn-primaire {
  background: var(--tunnel-accent);
}

#btnCheminExpert.tunnel-btn-primaire:hover,
#btnAppelerAgent.tunnel-btn-primaire:hover {
  background: #d1811f;
}

.tunnel-btn-secondaire {
  background: #fff;
  color: var(--tunnel-primaire);
  border-color: var(--tunnel-primaire);
}

.tunnel-btn-secondaire:hover {
  background: var(--tunnel-fond);
}

.tunnel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Popup "Diagnostic DPE non réalisé" */
.tunnel-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.tunnel-modal {
  background: #fff;
  border-radius: var(--tunnel-rayon);
  box-shadow: var(--tunnel-ombre);
  max-width: 420px;
  width: 100%;
  padding: 28px 24px;
  text-align: center;
  animation: tunnel-fade-in 0.2s ease;
}

.tunnel-modal-titre {
  font-weight: 700;
  color: var(--tunnel-primaire);
  margin-bottom: 8px;
}

.tunnel-modal-texte {
  color: var(--tunnel-texte-clair);
  margin-bottom: 20px;
}

.tunnel-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tunnel-modal-actions .tunnel-btn {
  width: 100%;
}

.tunnel-statut-diagnostiqueur {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--tunnel-texte-clair);
}

.tunnel-statut-diagnostiqueur button {
  background: none;
  border: none;
  padding: 0;
  color: var(--tunnel-primaire-clair);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.tunnel-erreur {
  color: #c0392b;
  font-size: 0.85rem;
  margin-top: 6px;
  display: none;
}

.tunnel-erreur.visible {
  display: block;
}

.tunnel-confirmation {
  text-align: center;
  padding: 40px 20px;
}

.tunnel-confirmation .icone {
  font-size: 3rem;
  color: var(--tunnel-succes);
  margin-bottom: 16px;
}

.tunnel-diag-coordonnees {
  margin: 20px auto 0;
  padding: 16px;
  max-width: 360px;
  background: var(--tunnel-fond);
  border-radius: var(--tunnel-rayon);
  text-align: left;
}

.tunnel-diag-coordonnees p {
  margin: 0 0 4px;
}

.tunnel-diag-coordonnees .tunnel-diag-label {
  color: var(--tunnel-texte-clair);
  font-size: 13px;
  margin-bottom: 8px;
}

/* Étape 6 : demande de diagnostic déjà faite. */
.tunnel-diag-ok {
  color: #2e9e5b;
  font-weight: 600;
  font-size: 14px;
}

/* Photo du diagnostiqueur à gauche de ses coordonnées. */
.tunnel-diag-fiche {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tunnel-diag-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

@media (min-width: 576px) {
  .tunnel-choix-parcours {
    flex-direction: row;
  }

  .tunnel-choix-parcours .tunnel-btn {
    width: auto;
    flex: 1;
  }
}


@media (min-width: 992px) {
  .tunnel-layout {
    flex-direction: row;
    align-items: stretch;
  }

  .tunnel-colonne-form {
    flex: 0 0 54%;
    max-width: 54%;
  }

  .tunnel-colonne-carte {
    display: block;
    min-width: 0;
    position: relative;
  }

  /* La version desktop reste en incrustation sur la carte (.tunnel-teaser-agent).
     !important nécessaire : le JS fixe le display en inline sur cet élément. */
  .tunnel-teaser-agent-mobile {
    display: none !important;
  }

  .tunnel-header {
    padding: 40px 60px 0;
  }

  .tunnel-step-contenu {
    padding: 40px 60px 0;
  }

  .tunnel-etape-nav {
    padding: 16px 60px;
  }

  .tunnel-colonne-carte {
    flex: 1 1 56%;
  }

  /* Carte plein cadre en permanence sur desktop : pas de repli possible. */
  .tunnel-toggle-carte {
    display: none;
  }

  /* Carte plein-bord : colle aux bords de sa colonne, sans marge ni bordure. */
  #tunnelCarte,
  .tunnel-carte-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    border-radius: 0;
    border: none;
  }

  /* Bloc secteur en incrustation flottante sur la carte plutôt qu'en dessous. */
  .tunnel-bloc-secteur {
    position: absolute;
    left: 24px;
    bottom: 24px;
    right: 24px;
    max-width: 320px;
    z-index: 9;
    margin-bottom: 0;
  }

  .tunnel-recap-bien {
    top: 24px;
    left: 24px;
    right: auto;
    max-width: 340px;
    max-height: 360px;
  }

  .tunnel-teaser-agent {
    right: 24px;
    bottom: 24px;
  }

  /* Même emplacement que .tunnel-bloc-secteur (step 5 uniquement, donc pas
     de conflit : "Vie de quartier" n'apparaît qu'à l'étape 6). Replié :
     pastille compacte (largeur au contenu). Déplié : prend toute la largeur
     de la carte. */
  .tunnel-quartier-legende-carte {
    position: absolute;
    left: 24px;
    bottom: 24px;
    right: auto;
    width: auto;
    max-width: calc(100% - 48px);
    max-height: 320px;
    overflow-y: auto;
    z-index: 9;
    margin-bottom: 0;
    transition: right 0.2s ease, width 0.2s ease;
  }

  .tunnel-quartier-legende-carte:not(.est-reduit) {
    right: 24px;
    width: auto;
  }

  .tunnel-btn {
    width: auto;
  }
}
