/* ═══════════════════════════════════════════════════════
   Phantour Web Viewer — Mobile-first responsive
   ═══════════════════════════════════════════════════════ */

:root {
  /* ─── Palette (fallback si config.palette non injectée) ─── */
  /* viewer.js injecte config.palette au démarrage → override ces valeurs.
     Source de vérité = DesignSystem/Colors.swift natif. */
  --accent: #C9A961;         /* Or Patiné */
  --amber:  #A0632D;         /* Ambre Cuivre (hotspot visited + info) */
  --nuit:   #1B2A4E;         /* Nuit Phantour */
  --ivoire: #E8DCC4;         /* Ivoire Papier */
  --accent-hover: #D4B76F;
  --accent-dark: #A88E4F;
  --bg: #0F0F14;
  --glass: rgba(0,0,0,0.55);
  --glass-strong: rgba(0,0,0,0.75);
  --border: rgba(255,255,255,0.12);
  --text: #ffffff;
  --text-dim: rgba(255,255,255,0.78);   /* ~4.6:1 sur fond noir — passe WCAG AA normal */
  --text-mute: rgba(255,255,255,0.65);  /* ~3.5:1 — passe WCAG AA texte large + éléments UI */
  --easing: cubic-bezier(0.22,0.61,0.36,1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;

  /* ─── Dimensions hotspot dynamiques (projection perspective 3D) ───
     Mises à jour par updateHotspotProjection() à chaque zoomchange/resize.
     Formule : px = h × worldSize / (2 × R × tan(FOV/2))
     Fallbacks ci-dessous = valeurs à FOV 75° sur écran 900px. Le vrai
     rendu = calcul runtime miroir SCNPlane vu par SCNCamera FOV°. */
  --hs-dot-halo:          18px;   /* dotPlane 0.28 halo */
  --hs-ring-halo:         17px;   /* ringPlane 0.26 halo (rings ripple) */
  --hs-classic:           55px;   /* ringPlane 0.85 classic (dot + border) */
  --hs-halo-classic:      96px;   /* halo diffus 1.5 classic */
  --hs-info:              32px;   /* dot info 0.5 */
  --hs-label-h:           26px;   /* SCNPlane 0.4 hauteur label */
  --hs-label-off-halo:    21px;   /* offset Y label mode halo (0.32) */
  --hs-label-off-classic: 45px;   /* offset Y label mode classic (0.7) */

  /* Safe areas iOS notch/dynamic island */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  height: 100dvh; /* dynamic viewport height (iOS 15+) */
  overflow: hidden;
  background: #000;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* évite double-tap zoom mobile */
}
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Tap target min 44px iOS / 48px Android */
.tap-target { min-width: 44px; min-height: 44px; }

/* ═══════════════════════════════════════════════════════
   PASSWORD GATE
   ═══════════════════════════════════════════════════════ */

.password-gate {
  position: fixed; inset: 0;
  z-index: 200;
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 400ms var(--easing);
}
.password-gate[hidden] { display: none; }

.password-content {
  max-width: 380px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.password-icon {
  width: 82px; height: 82px;
  border-radius: 50%;
  background: rgba(124,58,237,0.15);
  color: var(--accent);
  display: grid; place-items: center;
  margin-bottom: 6px;
}

.password-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}
.password-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
  padding: 0 8px;
}

.password-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.password-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 150ms;
}
.password-input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.12);
}
.password-input.shake {
  animation: shake 400ms;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.password-submit {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: background 150ms;
}
.password-submit:hover { background: var(--accent-hover); }

.password-error {
  font-size: 13px;
  color: #ff6b6b;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════
   COVER PAGE (mobile-first)
   ═══════════════════════════════════════════════════════ */

.cover {
  position: fixed; inset: 0;
  z-index: 100;
  overflow: hidden;
  animation: fadeIn 500ms var(--easing);
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}
.cover[hidden] { display: none; }

/* Background : miroir ClassicCoverBackground natif — image .fill + blur(18)
   (le natif applique un blur SwiftUI de 18pt sur l'image, ScrollView par-dessus). */
.cover-bg {
  position: absolute; inset: -30px;   /* -30px pour éviter les bords blancs après blur */
  background-size: cover;
  background-position: center;
  filter: blur(18px);
  transform: scale(1.05);              /* évite les bords blancs du blur */
}
/* Veil : LinearGradient noir 0.55 (haut) → 0.85 (bas), miroir exact natif */
.cover-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0.85));
}

.cover-close {
  position: absolute;
  top: calc(12px + var(--safe-top));
  right: calc(16px + var(--safe-right));
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  display: grid; place-items: center;
  z-index: 10;
  transition: background 150ms;
}
.cover-close:hover, .cover-close:active { background: rgba(0,0,0,0.8); }

/* Contenu : miroir ScrollView { VStack(spacing: 22) } natif.
   Frame max-width 720, padding horizontal 32, centrée horizontalement. */
.cover-content {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;                            /* VStack spacing: 22 */
  padding: 40px 32px 16px;              /* Spacer(40) top, 32 horizontal, Spacer(16) bottom */
  text-align: center;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
/* Contraint la largeur à 720 max (miroir .frame(maxWidth: 720)) — enfants centrés */
.cover-content > * { max-width: 720px; width: 100%; }

/* ─── headerBlock (miroir SwiftUI VStack(spacing: 12)) ─── */
.cover-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.cover-brand[hidden] { display: none; }
/* Logo agence : max height 60 (miroir .frame(maxHeight: 60)) */
.cover-brand-logo {
  max-height: 60px;
  width: auto;
  object-fit: contain;
}
.cover-brand-logo[hidden] { display: none; }
.cover-brand-txt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
/* Nom agence : SF 15pt semibold, white opacity 0.85 (miroir exact) */
.cover-brand-name {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.cover-brand-name[hidden] { display: none; }
/* Contact links : HStack(spacing: 14), icônes 11pt, texte 12pt, opacity 0.78 */
.cover-brand-contact {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.cover-brand-contact a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
  transition: color 150ms;
}
.cover-brand-contact a:hover { color: rgba(255,255,255,0.95); }
.cover-brand-contact .ci {
  width: 11px; height: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
  opacity: 0.9;
}
.cover-brand-contact .ci svg { width: 11px; height: 11px; display: block; }

/* ─── titleBlock (VStack spacing: 6) ─── */
.cover-title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
/* Titre : SF 38pt bold, tracking natif SwiftUI (~-0.02em à cette taille) */
.cover-title {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;                    /* équivalent SwiftUI .system tight */
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  /* lineLimit(3) + minimumScaleFactor(0.6) → couvert par CSS overflow */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Adresse sous titre : SF 14, opacity 0.7 (miroir exact) */
.cover-address {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  line-height: 1.35;                    /* spacing géré par .cover-title-block gap:6 */
}
.cover-address:empty { display: none; }

/* ─── metaChips (HStack spacing: 8) ─── */
.cover-chips {
  display: flex;
  gap: 8px;                             /* spacing: 8 exact */
  flex-wrap: wrap;
  justify-content: center;
}
/* Chaque chip : capsule background white 0.10, padding H12 V6, text 12pt medium opacity 0.85 */
.cover-chip {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  padding: 6px 12px;
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
  line-height: 1;
}

/* Description : SF 15, opacity 0.82, padding H 40, center align */
.cover-description {
  font-size: 15px;
  color: rgba(255,255,255,0.82);
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  line-height: 1.45;
  text-align: center;
  padding: 0 40px;
}
.cover-description[hidden] { display: none; }

/* ─── buttonsRow (HStack spacing: 12), padding.top: 8 sur launch ─── */
.cover-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  padding-top: 8px;                     /* .padding(.top, 8) sur le bouton launch */
}

/* Bouton Launch : play.fill 13pt bold + label 15pt semibold, padding H28 V14
   background accent capsule, shadow accent 0.4 radius 12 y 6 */
.btn-launch {
  display: inline-flex;
  align-items: center;
  gap: 10px;                            /* HStack(spacing: 10) */
  padding: 14px 28px;                   /* padding H 28 V 14 exact */
  min-height: 48px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 6px 12px rgba(201,169,97,0.4);
  transition: transform 150ms var(--easing), background 150ms, box-shadow 150ms;
}
.btn-launch svg { width: 13px; height: 13px; }
.btn-launch span { line-height: 1; }
.btn-launch:hover { background: var(--accent-hover); box-shadow: 0 8px 16px rgba(201,169,97,0.5); }
.btn-launch:active { transform: scale(0.97); }
.btn-launch:disabled { opacity: 0.4; cursor: not-allowed; }

/* Bouton Contact : padding H20 V12, background white 0.15, stroke white 0.25 capsule
   envelope 12pt semibold + label 14pt semibold */
.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;                             /* HStack(spacing: 8) */
  padding: 12px 20px;                   /* padding H 20 V 12 exact */
  min-height: 44px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  transition: transform 150ms var(--easing), background 150ms, border-color 150ms;
}
.btn-contact svg { width: 12px; height: 12px; }
.btn-contact span { line-height: 1; }
.btn-contact:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.4);
}
.btn-contact:active { transform: scale(0.97); }

/* Cover map : height 180 fixe, max-width 420 (miroir .frame(maxWidth: 420, height: 180))
   radius 12, stroke white 0.15 border overlay */
.cover-map {
  width: 100%;
  max-width: 420px;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: #2a2a2a;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 20px 50px rgba(0,0,0,0.55);
}
.cover-map:empty { display: none; }

/* Wrapper carte + caption adresse SOUS la carte (position stable, aucun
   conflit avec Leaflet/positionning overlay). */
.cover-map-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.cover-map-address {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 0 12px;
  line-height: 1.35;
  max-width: 100%;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.cover-map-address:empty { display: none; }

.leaflet-control-attribution,
.leaflet-control-zoom { display: none !important; }

/* Popup adresse style Apple Maps (bulle blanche pointant vers le pin) */
.leaflet-popup.phantour-address-popup .leaflet-popup-content-wrapper {
  background: #fff;
  color: #000;
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.leaflet-popup.phantour-address-popup .leaflet-popup-content {
  margin: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  color: #1c1c1e;
}
.leaflet-popup.phantour-address-popup .leaflet-popup-tip {
  background: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.leaflet-popup.phantour-address-popup .addr-popup {
  min-width: 220px;
  max-width: 300px;
  white-space: normal;
  word-break: keep-all;
}

/* Tooltip permanent — bulle blanche pointant vers le pin (position auto). */
.leaflet-tooltip.phantour-address-tip {
  background: #fff;
  color: #1c1c1e;
  border: none;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  max-width: 280px;
  white-space: normal;
}
.leaflet-tooltip.phantour-address-tip:before {
  border-top-color: #fff;
}

.cover-stats {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  padding: 3px 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  margin-top: 4px;
}
.cover-stats[hidden] { display: none; }

/* Footer badge — miroir footerBadge natif (HStack spacing 6, image 22px, texte 11pt opacity 0.35).
   Précédé d'un Spacer(minLength: 24) en natif → padding-top 24 sur ce bloc via order flex. */
.cover-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  padding-top: 24px;                    /* Spacer(minLength: 24) natif */
  line-height: 1;
}
/* Image PhantourMark : height 22, opacity 0.7 (miroir exact) */
.phantour-ghost {
  height: 22px;
  width: auto;
  opacity: 0.7;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

/* Responsive : la version native est desktop-only mais web sert mobile.
   On garde la spec native jusqu'à 720px, on ajuste finement en dessous. */
@media (max-width: 719px) {
  .cover-content {
    padding: 30px 20px 16px;            /* Padding H réduit sur mobile */
    gap: 18px;                          /* Un peu resserré */
  }
  .cover-title { font-size: 30px; }
  .cover-description { padding: 0 10px; }
  .cover-map { height: 160px; max-width: 100%; }
}

/* Tablette (mobile large / iPad portrait) : titre plus grand */
@media (min-width: 720px) {
  .cover-title { font-size: 42px; }
}

/* Desktop : matche exactement le natif à 38pt.
   On monte à 44pt pour laisser une signature un peu plus généreuse. */
@media (min-width: 1024px) {
  .cover-title { font-size: 44px; }
}

/* ═══════════════════════════════════════════════════════
   TOUR (viewer 360°)
   ═══════════════════════════════════════════════════════ */

.tour {
  position: fixed; inset: 0;
  background: #000;
  animation: fadeIn 400ms var(--easing);
}
.tour[hidden] { display: none; }

#pano {
  position: absolute; inset: 0;
  background: #000;
  touch-action: none; /* Marzipano gère lui-même */
}

.transition-veil {
  position: absolute; inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 300ms var(--easing);
}
.transition-veil.active { opacity: 1; transition-duration: 180ms; }

/* ─── BARRE HAUTE — miroir exact PhantourViewerSheet.topBar ─── */

/* HStack(spacing: 12), .padding(.horizontal, 20), .padding(.top, 16).
   Le natif utilise un Color.clear(60x1) en début pour réserver
   la place du VisitorLanguagePicker (drapeau langue en top-left).
   Sur le web, le drapeau est en position fixed top-left → on décale
   la topbar de 60px pour ne pas se chevaucher. */
.top-bar {
  position: absolute;
  top: calc(16px + var(--safe-top));               /* padding.top: 16 exact */
  left: calc(80px + var(--safe-left));             /* 20 (H padding) + 60 (Color.clear langue) */
  right: calc(20px + var(--safe-right));           /* padding.horizontal: 20 exact */
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 30;
  gap: 12px;                                       /* HStack(spacing: 12) exact */
  pointer-events: none;
}
.top-bar > *, .top-bar button, .top-bar .pill-btn, .top-bar .round-btn { pointer-events: auto; }

/* Groupe left : historyBack · historyFwd · stationNamePill · topbarBranding
   HStack(spacing: 12) hérité, mais SwiftUI natif utilise le même gap 12
   entre chaque enfant du HStack parent → le groupe left = wrapper avec gap 12. */
.top-left {
  display: flex;
  align-items: center;
  gap: 12px;                                       /* même spacing que HStack parent */
  min-width: 0;                                    /* permet overflow ellipsis */
}

/* Pill branding topbar — miroir topbarBranding natif :
   HStack(spacing: 8) { logo max22, name SF 12 semibold white 0.9 }
   .padding(.horizontal, 10) .padding(.vertical, 6)
   .background(Color.black.opacity(0.5)) .clipShape(Capsule()) */
.top-brand-pill {
  display: flex;
  align-items: center;
  gap: 8px;                                        /* HStack(spacing: 8) */
  padding: 6px 10px;                               /* H 10 V 6 exact */
  background: rgba(0,0,0,0.5);
  border-radius: 999px;
  max-width: 260px;
  min-width: 0;
}
.top-brand-pill[hidden] { display: none; }
.top-brand-logo {
  max-height: 22px;                                /* .frame(maxHeight: 22) exact */
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.top-brand-logo[hidden] { display: none; }
.top-brand-name {
  font-size: 12px;                                 /* SF 12 semibold */
  font-weight: 600;
  color: rgba(255,255,255,0.9);                    /* white opacity 0.9 exact */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.top-brand-name[hidden] { display: none; }

/* Station name pill — miroir stationNamePill natif :
   SF 14 semibold white .padding(H14 V8) .background(black.opacity(0.55)) .capsule() */
.station-label {
  font-size: 14px;                                 /* SF 14 semibold exact */
  font-weight: 600;
  color: #fff;
  padding: 8px 14px;                               /* H 14 V 8 exact */
  background: rgba(0,0,0,0.55);                    /* black opacity 0.55 exact */
  border-radius: 999px;                            /* capsule */
  line-height: 1.2;
  max-width: 40vw;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Groupe right : Info pill · Close X (spacer flex pousse le groupe à droite) */
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;                                       /* HStack(spacing: 12) parent */
  flex-shrink: 0;
}

/* Info button — miroir infoButton natif :
   HStack(spacing: 6) { info.circle.fill 12pt, "Info" SF 13 semibold }
   .padding(H12 V8) .background(black.opacity(0.55)) .capsule() */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;                                        /* HStack(spacing: 6) exact */
  padding: 8px 12px;                               /* H 12 V 8 exact */
  min-height: 32px;
  background: rgba(0,0,0,0.55);                    /* black opacity 0.55 exact */
  color: #fff;
  font-size: 13px;                                 /* SF 13 semibold */
  font-weight: 600;
  border-radius: 999px;
  line-height: 1;
  transition: background 150ms;
}
.pill-btn:hover, .pill-btn:active { background: rgba(0,0,0,0.75); }
.pill-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
/* Le .lang-btn a sa propre définition ~ligne 1144 (fixed top-left), l'ordre CSS
   fait qu'elle override ces règles .pill-btn pour le drapeau langue. */

/* Round buttons — miroir historyButton + closeButton natifs :
   Chevrons back/fwd : .frame(width: 30, height: 30) black opacity 0.55 circle
   Close X          : .frame(width: 32, height: 32) black opacity 0.55 circle
   On unifie à 32 par simplicité (~1px de diff invisible), l'icône chevron
   reste à 11pt bold, l'X reste à 13pt semibold (miroir natif). */
.round-btn {
  width: 32px; height: 32px;                       /* miroir closeButton frame */
  border-radius: 50%;
  background: rgba(0,0,0,0.55);                    /* black opacity 0.55 exact */
  color: #fff;
  display: grid; place-items: center;
  transition: background 150ms;
  flex-shrink: 0;
}
.round-btn:hover, .round-btn:active { background: rgba(0,0,0,0.75); }
.round-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.round-btn svg { width: 12px; height: 12px; }
/* Chevron back/fwd = 11pt bold natif → SVG 11px */
#btnHistoryBack svg, #btnHistoryForward svg { width: 11px; height: 11px; }
/* Close X = 13pt semibold */
#btnCloseTour svg { width: 13px; height: 13px; }

/* Cacher label Infos sur mobile (garde l'icône) */
@media (max-width: 479px) {
  .pill-label { display: none; }
  .pill-btn { padding: 8px 10px; }
  .top-bar { top: calc(12px + var(--safe-top)); gap: 8px; }
  .top-left { gap: 8px; }
  .top-actions { gap: 8px; }
  .station-label { max-width: 38vw; padding: 6px 10px; font-size: 13px; }
}

/* ═══════════════════════════════════════════════════════
   CONTROLS (sidebar desktop, barre bas mobile)
   ═══════════════════════════════════════════════════════ */

/* MOBILE : barre horizontale en bas (compromise tactile — le natif est
   desktop-only, sur mobile on garde la logique iPhone existante). */
.controls {
  position: absolute;
  bottom: calc(12px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  gap: 6px;
  z-index: 35;
  padding: 8px 10px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 24px;
  border: 1px solid var(--border);
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  scrollbar-width: none;
}
.controls::-webkit-scrollbar { display: none; }

/* Boutons — mobile : tap target 44px iOS Human Interface (accessibilité).
   Le natif desktop est 34x34, mais un doigt a besoin de 44px min sur mobile. */
.ctrl {
  width: 44px; height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  display: grid; place-items: center;
  transition: background 150ms;
  flex-shrink: 0;
}
.ctrl:hover, .ctrl:active { background: rgba(201,169,97,0.55); }
.ctrl svg { width: 18px; height: 18px; display: block; }

/* Sur mobile, cacher les boutons zoom (pinch gère) */
@media (max-width: 479px) {
  .hide-mobile { display: none; }
}

/* Cacher automatiquement les boutons 360°-only en mode classic (photos).
   Le natif condition ces boutons sur `!isClassicMode` — on ajoute la
   classe body.mode-classic dans viewer.js quand config.renderMode==="classic". */
body.mode-classic .hide-classic { display: none; }

/* ─── DESKTOP (souris précise) : sidebar verticale gauche — miroir natif ───
   VStack(spacing: 8) { boutons 34x34 circle black opacity 0.6 }
   .padding(.leading, 20), alignement bas (mais on centre vertical pour éviter
   chevauchement avec le bandeau miniatures qui monte du bas). */
@media (min-width: 720px) and (hover: hover) and (pointer: fine) {
  .controls {
    top: calc(60px + var(--safe-top));
    bottom: calc(20px + var(--safe-bottom));
    left: calc(20px + var(--safe-left));         /* padding.leading: 20 exact */
    right: auto;
    transform: none;
    flex-direction: column;
    gap: 8px;                                     /* VStack(spacing: 8) exact */
    padding: 0;                                   /* natif : pas de background/padding container */
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    max-width: none;
    height: auto;
    max-height: none;
    justify-content: center;                      /* Spacer top/bottom + VStack centré */
    align-items: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    width: 34px;                                  /* largeur du bouton = largeur sidebar */
  }
  .controls::-webkit-scrollbar { display: none; }
  /* Bouton 34x34 circle black 0.6 (miroir overlayButton exact) */
  .ctrl {
    width: 34px; height: 34px;
    min-width: 34px;
    background: rgba(0,0,0,0.6);                  /* black opacity 0.6 exact */
    border-radius: 50%;
  }
  .ctrl:hover { background: rgba(0,0,0,0.8); }
  .ctrl:active { background: rgba(201,169,97,0.75); transform: scale(0.95); }
  .ctrl svg { width: 13px; height: 13px; }        /* SF 13pt semibold exact */
}

/* ═══════════════════════════════════════════════════════
   HOTSPOTS — Style CLASSIC (par défaut)
   ═══════════════════════════════════════════════════════
   Miroir du rendu SceneKit natif Panorama360ViewerView :
     • haloPlane 1.5 unit : pulse scale 1→1.35 + opacity 0.7→0.15,
       2.2s cycle (1.1s expand + 1.1s contract, easeInEaseOut)
     • ringPlane 0.85 unit : ring central blanc stable + icône chevron/check
     • Couleur = accent projet (Or Patiné #C9A961 par défaut, ou custom hex)
     • État visited : bascule ambre (phantourAmber) + icône check
   Le halo est simulé en CSS via box-shadow expandable (SceneKit → box-shadow
   n'est pas 1:1 mais rend un effet halo visuellement équivalent). */

.hotspot-nav-wrap {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* gap dot↔label défini par --hs-label-off-halo ou --hs-label-off-classic
     selon le style actif (voir règles body.hotspot-style-halo plus bas) */
  touch-action: manipulation;
}

/* Ring central blanc — miroir ringPlane 0.85 SceneKit.
   Dimensions calculées par projection perspective (updateHotspotProjection).
   → À FOV 75° écran 900px ≈ 55px ; à FOV 30° ≈ 137px ; à FOV 120° ≈ 32px. */
.hotspot-nav {
  width: var(--hs-classic); height: var(--hs-classic);
  border-radius: 50%;
  background: var(--accent);                       /* Or Patiné par défaut, custom si projet */
  backdrop-filter: blur(6px);
  border: 2px solid rgba(255,255,255,0.95);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  /* pulseHalo 2.2s = 1.1s expand + 1.1s contract (miroir natif cycle) */
  animation: pulseHalo 2.2s ease-in-out infinite;
  transition: transform 180ms var(--easing), background 180ms;
}
.hotspot-nav-wrap:hover .hotspot-nav,
.hotspot-nav-wrap:active .hotspot-nav {
  transform: scale(1.12);
  filter: brightness(1.1);
}
.hotspot-nav svg {
  width: 28px; height: 28px;
}

/* Chevron par défaut, coche cachée (basculé par .visited) */
.hotspot-nav .icon-check { display: none; }
.hotspot-nav .icon-chevron { display: block; }

/* État VISITED : bascule vers ambre (miroir accentColor phantourAmber natif
   quand hotspot.kind == .navigation && visitedStationIDs.contains(target)).
   Couleur = variable --amber injectée depuis config.palette (Swift). */
.hotspot-nav-wrap.visited .hotspot-nav {
  background: var(--amber);
  animation: pulseHaloVisited 2.2s ease-in-out infinite;
}
.hotspot-nav-wrap.visited .hotspot-nav .icon-chevron { display: none; }
.hotspot-nav-wrap.visited .hotspot-nav .icon-check { display: block; }
.hotspot-nav-wrap.visited:hover .hotspot-nav {
  filter: brightness(1.1);
}

/* Pulse animations : cycle 2.2s exact (natif = 1.1s expand + 1.1s contract).
   Le box-shadow simule le haloPlane 1.5 (expand 1→1.35 = radius croissant,
   opacity 0.7→0.15 = fade). */
@keyframes pulseHalo {
  0%, 100% { box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 0 rgba(201,169,97,0.7); }
  50%      { box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 16px rgba(201,169,97,0.05); }
}
@keyframes pulseHaloVisited {
  0%, 100% { box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 0 rgba(180,83,9,0.7); }
  50%      { box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 14px rgba(180,83,9,0.05); }
}

.hotspot-nav-label {
  /* Label hotspot — miroir SCNPlane 0.4 unités hauteur (natif SF Pro Medium 16pt).
     Font-size = ~54% de la hauteur logique (ratio texte/plane natif).
     Padding vertical = ratio proportionnel. Toutes valeurs varient avec le FOV. */
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  color: #fff;
  padding: calc(var(--hs-label-h) * 0.20) calc(var(--hs-label-h) * 0.42);
  border-radius: calc(var(--hs-label-h) * 0.55);
  font-size: calc(var(--hs-label-h) * 0.54);
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  line-height: 1.15;
}

/* ═══════════════════════════════════════════════════════
   HOTSPOT STYLE : HALO RIPPLE (signature v3 Or Patiné)
   ═══════════════════════════════════════════════════════
   Activé quand <body> a la classe .hotspot-style-halo.
   Réplique du rendu SceneKit natif :
     • Point Or plein central stable (petit, respire léger)
     • 2 anneaux Or fins qui pulsent en boucle (sonar), décalés 1.3s
     • Palette : Or Patiné #C9A961 (jamais violet)
   Le label texte reste géré par la même classe .hotspot-nav-label
   (position ajustée un peu plus haut car halo plus petit).             */

/* ─── Style HALO RIPPLE — miroir SceneKit natif exact ─────────────────
   Signature v3 22 août 2026. Réplique du rendu Panorama360ViewerView :
     • dotPlane 0.28 unit : Or plein, breathing scale 1→1.08 (1.5s cycle
       chaque phase, easeInEaseOut = 3s aller-retour total)
     • 2 ringPlanes 0.26 unit : Or fin, ripple scale 1→3.0 + opacity
       0.75→0, 2.6s cycle easeOut, décalés 0s et 1.3s (effet sonar)
     • Palette Or Patiné #C9A961 uniquement (pas de switch ambre visited) */

body.hotspot-style-halo .hotspot-nav {
  /* Point Or — miroir SCNPlane dotPlane 0.28 unités SceneKit.
     Dimension calculée par updateHotspotProjection() (variable --hs-dot-halo).
     À FOV 75° écran 900px ≈ 18px, varie avec le zoom comme le natif. */
  width: var(--hs-dot-halo); height: var(--hs-dot-halo);
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.15) 30%, transparent 60%), var(--accent);
  border: none;
  box-shadow:
    0 0 0 3px rgba(0,0,0,0.25),
    0 0 10px 3px rgba(0,0,0,0.4),
    0 0 8px rgba(201,169,97,0.85);
  animation: haloDotBreathe 3s ease-in-out infinite;
  position: relative;
}
/* Masque le chevron SVG intérieur — inutile en mode halo */
body.hotspot-style-halo .hotspot-nav svg { display: none; }
/* Les 2 anneaux ripple sur le WRAP (positionné par Pannellum au bon endroit).
   Miroir ringPlane 0.26 : ripple 2.6s easeOut, scale 1→3.0, opacity 0.75→0.
   Delays : 0s (::before) et 1.3s (::after) = effet sonar décalé. */
/* Les anneaux ripple doivent être centrés SUR LE POINT (pas au milieu du
   wrap qui contient aussi le label texte, ce qui décentrait visuellement).
   On les attache au .hotspot-nav (le dot) et non au wrap. */
body.hotspot-style-halo .hotspot-nav::before,
body.hotspot-style-halo .hotspot-nav::after {
  /* Anneaux ripple — miroir SCNPlane ringPlane 0.26 unités SceneKit.
     Dimensions calculées runtime (var --hs-ring-halo, projection perspective).
     Centrés sur le dot via margin négatif = -50% de leur taille. */
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: var(--hs-ring-halo); height: var(--hs-ring-halo);
  margin-top: calc(var(--hs-ring-halo) / -2);
  margin-left: calc(var(--hs-ring-halo) / -2);
  border: 1px solid var(--accent);
  border-radius: 50%;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
  opacity: 0;
  pointer-events: none;
  animation: haloRipple 2.6s ease-out infinite;
}
body.hotspot-style-halo .hotspot-nav::after {
  animation-delay: 1.3s;
}
/* Ancien wrap::after retiré — le décalage 1.3s est maintenant sur .hotspot-nav::after */
/* Hover : le point grossit légèrement (feedback subtil, cohérent natif) */
body.hotspot-style-halo .hotspot-nav-wrap:hover .hotspot-nav,
body.hotspot-style-halo .hotspot-nav-wrap:active .hotspot-nav {
  transform: scale(1.3);
  background: #C9A961;
}
/* Visited : reste Or Patiné (pas de switch ambre — décision signature v3) */
body.hotspot-style-halo .hotspot-nav-wrap.visited .hotspot-nav {
  background: #C9A961;
  animation: haloDotBreathe 3s ease-in-out infinite;
}
/* Distance dot ↔ label (miroir offsetY natif : -0.32 halo / -0.7 classic).
   Valeur runtime dépendante FOV — plus le zoom fort, plus l'écart pixel grandit. */
body.hotspot-style-halo .hotspot-nav-wrap {
  gap: var(--hs-label-off-halo);
}
body:not(.hotspot-style-halo) .hotspot-nav-wrap {
  gap: var(--hs-label-off-classic);
}

/* Animations halo — valeurs miroir exactes du natif SceneKit */
@keyframes haloDotBreathe {
  /* scale 1 → 1.08 → 1, easeInEaseOut, 1.5s chaque phase (miroir breatheOut/In) */
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
@keyframes haloRipple {
  /* scale 1 → 3.0, opacity 0.75 → 0, 2.6s easeOut (miroir ripple action) */
  0%   { opacity: 0.75; transform: scale(1); }
  100% { opacity: 0;    transform: scale(3); }
}

/* Toggle "afficher le nom de la destination" — indépendant du style.
   Quand <body> a .hotspot-labels-hidden, on masque tous les labels. */
body.hotspot-labels-hidden .hotspot-nav-label { display: none; }

/* Wrapper positionné par Marzipano — le hotspot-info à l'intérieur est décalé
   via margin négatif (pas transform car Marzipano l'écrase). */
.hotspot-info-wrap {
  cursor: pointer;
  touch-action: manipulation;
}

.hotspot-info {
  /* Hotspot info — miroir SCNPlane 0.5 unités natif.
     Dimension calculée runtime (--hs-info) = projection perspective.
     Couleur Ambre Cuivre = --amber depuis palette Swift (miroir strict). */
  position: relative;
  width: var(--hs-info); height: var(--hs-info);
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid rgba(255,255,255,0.95);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  animation: pulseHaloInfo 2.6s ease-in-out infinite;
  transition: transform 180ms, background 180ms;
  transform-origin: center center;
  padding: 0;
  line-height: 0;
  /* Centrage sur position hotspot : margin négatif = -50% de la taille */
  margin-top: calc(var(--hs-info) / -2);
  margin-left: calc(var(--hs-info) / -2);
}
/* Étend la zone de hit test de 12px dans chaque direction (transparent).
   Corrige le jitter au hover : quand la souris entre par le bord et que
   l'élément scale(1.15), le bord du visuel dépasse la position souris
   → mouseleave → boucle. Le pseudo étend la surface capturable sans
   changer le layout ni le rendu. */
.hotspot-info::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
}
.hotspot-info svg {
  /* SVG interne = ~57% de la taille du dot (ratio miroir natif) */
  width: calc(var(--hs-info) * 0.57);
  height: calc(var(--hs-info) * 0.57);
  display: block;
}
.hotspot-info:hover, .hotspot-info:active {
  /* Scale only — margin-top/left assurent le centrage (pas de translate) */
  transform: scale(1.15);
  filter: brightness(1.15);
}

@keyframes pulseHaloInfo {
  0%, 100% { box-shadow: 0 4px 14px rgba(0,0,0,0.45), 0 0 0 0 rgba(180,83,9,0.55); }
  50%      { box-shadow: 0 4px 14px rgba(0,0,0,0.45), 0 0 0 14px rgba(180,83,9,0); }
}

/* Hotspots mobile : PAS d'override de taille — la projection perspective
   dynamique adapte déjà les dimensions au viewport (viewportHeight change).
   Sur téléphone, le calcul px = h × worldSize / (2R × tan(FOV/2)) donne
   automatiquement des hotspots proportionnels au viewport. */

/* ═══════════════════════════════════════════════════════
   BANDEAU MINIATURES BAS
   ═══════════════════════════════════════════════════════ */

.thumb-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 10px 14px calc(12px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
  z-index: 25;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  align-items: flex-end;
  transition: transform 280ms var(--easing), opacity 200ms;
  -webkit-overflow-scrolling: touch;
}
.thumb-bar::-webkit-scrollbar { display: none; }
.thumb-bar.hidden {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

/* Quand les controls sont en barre horizontale bas (tous les devices
   tactiles + petits desktops), le thumb-bar remonte pour ne pas recouvrir
   la pilule d'icônes. Ne s'applique PAS aux desktops souris (>= 1024px
   avec pointer fine) où la sidebar est verticale à gauche. */
@media not all and (min-width: 720px) and (hover: hover) and (pointer: fine) {
  .thumb-bar {
    bottom: calc(70px + var(--safe-bottom));
    padding-bottom: 8px;
  }
}

.thumb-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.thumb-group-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding-left: 2px;
}
.thumb-group-items {
  display: flex;
  gap: 8px;
}

.thumb {
  position: relative;
  width: 68px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}
.thumb-img {
  width: 68px;
  height: 38px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  border: 2px solid transparent;
  transition: border-color 150ms, transform 150ms;
  position: relative;
  overflow: hidden;
}
.thumb:hover .thumb-img { transform: scale(1.05); }
.thumb.active .thumb-img {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(124,58,237,0.5);
}
.thumb-num {
  position: absolute;
  top: 3px; left: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  z-index: 2;
}
.thumb-star {
  position: absolute;
  top: 3px; left: 4px;
  color: #fff;
  font-size: 10px;
  z-index: 2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.thumb-name {
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 68px;
}
.thumb.active .thumb-name { color: var(--accent); }

/* Tablette+ : miniatures plus grandes */
@media (min-width: 720px) {
  .thumb { width: 78px; }
  .thumb-img { width: 78px; height: 44px; }
  .thumb-name { max-width: 78px; font-size: 11px; }
  .thumb-bar { gap: 20px; padding: 12px 20px calc(14px + var(--safe-bottom)); }
  .thumb-group-items { gap: 10px; }
}

/* Sur mobile portrait, réduire opacité controls quand thumb visible */
@media (max-width: 719px) {
  .thumb-bar:not(.hidden) {
    padding-bottom: calc(70px + var(--safe-bottom)); /* laisse place aux controls */
  }
}

/* ═══════════════════════════════════════════════════════
   SÉLECTEUR LANGUE (fixed global, visible partout)
   ═══════════════════════════════════════════════════════ */

.lang-selector {
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: calc(14px + var(--safe-left));
  z-index: 300; /* au-dessus de tout : cover, password, tour */
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 12px;
  min-height: 38px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  border-radius: 999px;
  transition: background 150ms;
}
.lang-btn:hover { background: var(--glass-strong); }
.lang-btn svg { opacity: 0.6; }

.lang-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: rgba(15,15,20,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  z-index: 40;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  min-width: 170px;
  animation: fadeIn 200ms var(--easing);
}
.lang-menu[hidden] { display: none; }

.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #fff;
  transition: background 150ms;
  text-align: left;
  cursor: pointer;
}
.lang-item:hover { background: rgba(255,255,255,0.08); }
.lang-item span { font-size: 18px; }

/* ═══════════════════════════════════════════════════════
   BOUTON MUTE (audio ambiance/commentary)
   ═══════════════════════════════════════════════════════ */

.mute-btn {
  position: absolute;
  top: calc(60px + var(--safe-top));
  right: calc(14px + var(--safe-right));
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  display: grid; place-items: center;
  z-index: 32;
  transition: background 150ms;
}
.mute-btn:hover { background: var(--glass-strong); }

@media (min-width: 720px) {
  .mute-btn {
    top: calc(66px + var(--safe-top));
    right: calc(20px + var(--safe-right));
  }
}

/* ═══════════════════════════════════════════════════════
   SOUS-TITRES AUDIO COMMENTARY
   ═══════════════════════════════════════════════════════ */

.subtitle-bar {
  position: absolute;
  bottom: calc(150px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: 88vw;
  padding: 10px 18px;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  border-radius: 8px;
  text-align: center;
  z-index: 25;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  animation: fadeIn 300ms var(--easing);
}

@media (max-width: 719px) {
  .subtitle-bar {
    font-size: 13px;
    padding: 8px 14px;
    max-width: 92vw;
    bottom: calc(170px + var(--safe-bottom));
  }
}

/* ═══════════════════════════════════════════════════════
   MINI-PLAN FLOTTANT (bas-droit permanent)
   ═══════════════════════════════════════════════════════ */

/* Wrapper contient le mini-plan + le bouton toggle (miroir natif MiniFloorplanOverlay) */
.mini-floorplan-wrapper {
  position: absolute;
  bottom: calc(90px + var(--safe-bottom));
  right: calc(14px + var(--safe-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 30;
}

.mini-floorplan {
  width: 220px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  animation: miniPlanIn 300ms var(--easing);
}
.mini-floorplan[hidden] { display: none; }

/* Bouton toggle mini-plan (miroir natif : cercle 34x34 map/map.fill) */
.mini-floorplan-toggle {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: background 150ms;
}
.mini-floorplan-toggle:hover { background: rgba(0,0,0,0.85); }
.mini-floorplan-toggle[hidden] { display: none; }

@keyframes miniPlanIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.mini-floorplan-header {
  padding: 8px 12px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.mini-floorplan-body {
  position: relative;
  background: #f5f5f0;
  padding: 8px;
}

.mini-floorplan-img {
  width: 100%;
  height: auto;
  display: block;
}

.mini-floorplan-overlay {
  position: absolute;
  inset: 8px;
}

.mini-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.75);
  border: 2px solid #fff;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform 150ms, background 150ms;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.mini-pin:hover {
  transform: translate(-50%, -50%) scale(1.15);
  background: var(--accent);
}
.mini-pin.active {
  background: var(--accent);
  width: 26px; height: 26px;
  font-size: 12px;
  animation: miniPinPulse 2s ease-in-out infinite;
}
@keyframes miniPinPulse {
  0%, 100% { box-shadow: 0 2px 6px rgba(0,0,0,0.4), 0 0 0 0 rgba(124,58,237,0.55); }
  50%      { box-shadow: 0 2px 6px rgba(0,0,0,0.4), 0 0 0 8px rgba(124,58,237,0); }
}

/* Mobile : mini-plan un peu plus petit et repositionné */
@media (max-width: 719px) {
  .mini-floorplan {
    width: 160px;
    bottom: calc(100px + var(--safe-bottom));
  }
  .mini-pin { width: 16px; height: 16px; font-size: 9px; }
  .mini-pin.active { width: 20px; height: 20px; font-size: 10px; }
}

/* Cacher les miniatures en bas doit remonter le mini-plan */
.thumb-bar.hidden + .mini-floorplan,
.thumb-bar.hidden ~ .mini-floorplan {
  bottom: calc(76px + var(--safe-bottom));
}

/* ═══════════════════════════════════════════════════════
   BANNER KIOSQUE (mode auto-play actif)
   ═══════════════════════════════════════════════════════ */

.kiosk-banner {
  position: absolute;
  top: calc(60px + var(--safe-top));
  left: 50%;
  transform: translate(-50%, -20px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(124,58,237,0.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms, transform 300ms var(--easing);
}
.kiosk-banner.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 720px) {
  .kiosk-banner { font-size: 13px; padding: 9px 16px; }
}

/* Mode kiosque immersif : cache tous les boutons/UI. Le panorama tourne
   en rotation continue, seul le banner "Visite automatique" reste visible.
   Sortie du mode : Esc, clic n'importe où, ou re-clic sur le bouton kiosque. */
body.kiosk-mode .top-bar,
body.kiosk-mode .controls,
body.kiosk-mode .thumb-bar,
body.kiosk-mode .info-panel,
body.kiosk-mode .mini-floorplan,
body.kiosk-mode .watermark,
body.kiosk-mode .hotspot-nav-wrap,
body.kiosk-mode .hotspot-info-wrap {
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms;
}

/* ═══════════════════════════════════════════════════════
   WATERMARK
   ═══════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════
   WIDGET AUDIO-GUIDE (haut-gauche, sous LangSwitcher)
   ═══════════════════════════════════════════════════════
   Visible quand station a un audio (config.audio non nul). Click = play/pause.
   Résout la limite autoplay Firefox/Safari (user gesture requis). */
.audio-guide-btn {
  position: absolute;
  top: calc(64px + var(--safe-top));
  left: calc(14px + var(--safe-left));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 169, 97, 0.35);
  border-radius: 999px;
  color: var(--ivoire);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  z-index: 35;
  transition: transform 150ms var(--easing), background 150ms;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.audio-guide-btn:hover { background: rgba(0, 0, 0, 0.8); transform: translateY(-1px); }
.audio-guide-btn:active { transform: translateY(0); }
.audio-guide-btn[hidden] { display: none; }
.audio-guide-btn.playing { background: rgba(201, 169, 97, 0.28); border-color: var(--accent); }
.audio-guide-btn svg { display: block; }
.audio-guide-btn svg[hidden] { display: none !important; }
.ag-label { letter-spacing: 0.3px; }
@media (max-width: 479px) {
  .audio-guide-btn { top: calc(58px + var(--safe-top)); font-size: 11px; padding: 7px 11px 7px 9px; }
  .ag-label { display: none; }  /* icône seule sur mobile */
}

.watermark {
  /* Coin bas-droite absolu — miroir natif (visible sous tout, y compris
     mini-plan si présent). Z-index > mini-floorplan-wrapper (30). */
  position: absolute;
  bottom: calc(8px + var(--safe-bottom));
  right: calc(10px + var(--safe-right));
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  font-weight: 600;
  letter-spacing: 0.5px;
  z-index: 35;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85);
  text-transform: uppercase;
}

@media (min-width: 720px) {
  .watermark {
    bottom: calc(10px + var(--safe-bottom));
    right: calc(14px + var(--safe-right));
    font-size: 11px;
  }
}

/* ═══════════════════════════════════════════════════════
   PANEL INFO (droite, side)
   ═══════════════════════════════════════════════════════ */

.info-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 100%;
  max-width: 100vw;
  background: rgba(15,15,20,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 300ms var(--easing);
  padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom));
  overflow-y: auto;
}
.info-panel.open { transform: translateX(0); }

.info-close {
  position: absolute;
  top: calc(14px + var(--safe-top));
  right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: grid; place-items: center;
  transition: background 150ms;
}
.info-close:hover { background: rgba(255,255,255,0.15); }

.info-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 12px;
  padding-right: 50px;
}

.info-title {
  font-size: 22px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.tts-btn {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(124,58,237,0.15);
  color: var(--accent);
  display: grid;
  place-items: center;
  transition: background 150ms, color 150ms;
}
.tts-btn:hover {
  background: rgba(124,58,237,0.35);
  color: #fff;
}

.info-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-dim);
}

/* ─── Attachments dans panel info ─── */
.info-attachments {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.info-attachments:empty { display: none; }

.att-item {
  border-radius: 10px;
  overflow: hidden;
}

.att-item.att-image img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  border-radius: 10px;
  transition: opacity 150ms;
}
.att-item.att-image img:hover { opacity: 0.9; }

.att-item.att-video video,
.att-item.att-sound audio {
  width: 100%;
  display: block;
  border-radius: 8px;
}
.att-item.att-sound {
  background: rgba(255,255,255,0.05);
  padding: 10px 12px;
}

.att-caption {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}
.att-caption-top {
  padding: 0 0 6px;
  text-align: left;
  font-weight: 500;
  color: #fff;
}

.att-item.att-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 150ms, border-color 150ms;
}
.att-item.att-link:hover {
  background: rgba(124,58,237,0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.att-item.att-text {
  background: rgba(255,255,255,0.04);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
}
.att-item.att-text p { white-space: pre-wrap; }

/* ─── Lightbox images ─── */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  animation: fadeIn 200ms var(--easing);
}
.lightbox.open { display: flex; flex-direction: column; }

.lightbox-img {
  max-width: 100%;
  max-height: calc(100% - 60px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}
.lightbox-caption {
  margin-top: 16px;
  color: #fff;
  font-size: 14px;
  text-align: center;
  max-width: 80vw;
}
.lightbox-close {
  position: absolute;
  top: calc(20px + var(--safe-top));
  right: calc(20px + var(--safe-right));
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  display: grid; place-items: center;
  transition: background 150ms;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }

/* Tablette+ : panneau côté */
@media (min-width: 720px) {
  .info-panel {
    width: 380px;
    max-width: 90vw;
    border-left: 1px solid var(--border);
  }
}

/* ═══════════════════════════════════════════════════════
   MODAL TOC
   ═══════════════════════════════════════════════════════ */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 220;              /* au-dessus de la cover (100) et du password gate (200) */
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  width: 100%;
  max-height: 85vh;
  background: rgba(20,20,28,0.98);
  border-radius: 20px 20px 0 0;
  z-index: 221;              /* au-dessus du backdrop 220, cover 100, password 200 */
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  transition: opacity 200ms, transform 300ms var(--easing);
  transform: translateY(100%);
  overflow: hidden;
  padding-bottom: var(--safe-bottom);
}
.modal.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-size: 17px;
  font-weight: 600;
}

.modal-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.toc-group { margin-bottom: 18px; }
.toc-group-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 6px 10px 10px 10px;
}
/* Grille miniatures — miroir natif PhantourViewer TOC.
   Auto-fill = s'adapte au nombre de stations et à la largeur modale. */
.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 4px;
}
.toc-item {
  padding: 0;
  cursor: pointer;
  transition: transform 150ms var(--easing);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.toc-item:hover { transform: translateY(-2px); }
.toc-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid transparent;
  transition: border-color 150ms;
}
.toc-item:hover .toc-thumb-wrap { border-color: rgba(255,255,255,0.2); }
.toc-item.active .toc-thumb-wrap {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,169,97,0.25);
}
.toc-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.toc-badge {
  position: absolute;
  top: 6px; left: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid; place-items: center;
  backdrop-filter: blur(4px);
}
.toc-item.active .toc-badge {
  background: var(--accent);
  color: #1B2A4E;
}
.toc-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 0 4px;
  line-height: 1.25;
}
.toc-item.active .toc-name { color: var(--accent); font-weight: 600; }

/* ═══════════════════════════════════════════════════════
   MODAL CONTACT (formulaire)
   ═══════════════════════════════════════════════════════ */

.modal.modal-contact {
  width: 100%;
  max-width: 480px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label,
.form-row label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}
.form-input, .form-textarea,
.form-row input, .form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 150ms, background 150ms;
  -webkit-appearance: none;    /* retire style Safari par défaut */
  appearance: none;
}
.form-input:focus, .form-textarea:focus,
.form-row input:focus, .form-row textarea:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.1);
}
.form-textarea,
.form-row textarea {
  resize: vertical;
  min-height: 90px;
}
.form-checkbox {
  width: 18px; height: 18px;
  accent-color: var(--accent);
}
.form-submit,
.btn-primary {
  width: 100%;
  padding: 14px;
  min-height: 48px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin-top: 6px;
  transition: background 150ms;
  cursor: pointer;
  border: none;
}
.form-submit:hover,
.btn-primary:hover { background: var(--accent-hover); }

.contact-success {
  text-align: center;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.contact-success-icon {
  width: 82px; height: 82px;
  border-radius: 50%;
  background: rgba(124,58,237,0.15);
  color: var(--accent);
  display: grid; place-items: center;
}
.contact-success-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.contact-success-text {
  font-size: 14px;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════
   MODAL FEEDBACK (étoiles)
   ═══════════════════════════════════════════════════════ */

.modal.modal-feedback {
  width: 100%;
  max-width: 440px;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px;
}

.feedback-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  text-align: center;
}

.feedback-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}
.star {
  font-size: 32px;
  color: rgba(255,255,255,0.2);
  transition: color 150ms, transform 150ms;
  cursor: pointer;
  padding: 4px;
}
.star:hover { transform: scale(1.15); }
.star.hover, .star.active {
  color: #FFB800;
}

/* ═══════════════════════════════════════════════════════
   MODAL PLAN D'ÉTAGE
   ═══════════════════════════════════════════════════════ */

.modal.modal-floorplan {
  width: 100%;
  max-width: 720px;
}

@media (min-width: 720px) {
  .modal.modal-floorplan { width: 720px; }
}

.floorplan-tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
  margin-right: 12px;
}
.floor-tab {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  transition: background 150ms, color 150ms;
}
.floor-tab:hover { background: rgba(255,255,255,0.12); color: #fff; }
.floor-tab.active {
  background: var(--accent);
  color: #fff;
}

.floorplan-body {
  padding: 16px;
}
.floorplan-wrap {
  position: relative;
  width: 100%;
  background: #f5f5f0;
  border-radius: 10px;
  overflow: hidden;
}
.floorplan-img {
  width: 100%;
  height: auto;
  display: block;
}
.floorplan-overlay {
  position: absolute;
  inset: 0;
}
.floor-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 5;
}
.floor-pin-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
  transition: transform 150ms, background 150ms;
}
.floor-pin:hover .floor-pin-num {
  transform: scale(1.15);
  background: var(--accent);
}
.floor-pin.active .floor-pin-num {
  background: var(--accent);
  animation: floorPinPulse 2s ease-in-out infinite;
}
@keyframes floorPinPulse {
  0%, 100% { box-shadow: 0 3px 8px rgba(0,0,0,0.4), 0 0 0 0 rgba(124,58,237,0.5); }
  50%      { box-shadow: 0 3px 8px rgba(0,0,0,0.4), 0 0 0 12px rgba(124,58,237,0); }
}
.floor-pin-label {
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.7);
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 150ms;
}
.floor-pin:hover .floor-pin-label,
.floor-pin.active .floor-pin-label { opacity: 1; }

/* Tablette+ : modal centré */
@media (min-width: 720px) {
  .modal {
    bottom: auto;
    left: 50%; top: 50%;
    width: 480px;
    max-width: 92vw;
    max-height: 80vh;
    transform: translate(-50%, -50%) scale(0.95);
    border-radius: 14px;
    padding-bottom: 0;
  }
  .modal.open {
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ═══════════════════════════════════════════════════════
   SPLASH TOUR (fantôme animé au démarrage visite)
   ═══════════════════════════════════════════════════════ */

.tour-splash {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #7C3AED 0%, #4C1D95 100%);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 400ms var(--easing);
}
.tour-splash.show { display: flex; opacity: 1; }
.tour-splash.fade-out { opacity: 0; }

.tour-splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.tour-splash-ghost {
  width: 110px; height: 130px;
  animation: ghostFloat 1.6s ease-in-out infinite;
}
.tour-splash-ghost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,0.35));
}

@keyframes ghostFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

.tour-splash-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 12px rgba(0,0,0,0.25);
  animation: splashTitle 700ms var(--easing);
}
@keyframes splashTitle {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════
   MODAL CHEATSHEET (raccourcis clavier)
   ═══════════════════════════════════════════════════════ */

.modal.modal-cheatsheet {
  width: 100%;
  max-width: 440px;
}

.cheat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px;
}

.cheat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
}
.cheat-row:hover { background: rgba(255,255,255,0.04); }

.cheat-keys {
  min-width: 100px;
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

kbd {
  display: inline-block;
  padding: 3px 8px;
  min-width: 28px;
  text-align: center;
  font-family: -apple-system, ui-monospace, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset;
}

.cheat-desc {
  font-size: 14px;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════
   TOAST (notifications éphémères)
   ═══════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: calc(120px + var(--safe-bottom));
  left: 50%;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  background: rgba(0,0,0,0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms, transform 250ms var(--easing);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ═══════════════════════════════════════════════════════
   Animations globales
   ═══════════════════════════════════════════════════════ */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════
   DIAPORAMA CLASSIQUE (mode Photos classiques)
   ═══════════════════════════════════════════════════════ */

.classic-slideshow {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
  z-index: 5;
}
.classic-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-color: #000;
  transition: background-image 300ms ease-in-out;
}
/* Ken Burns : léger zoom + pan pendant l'affichage de la photo courante */
.classic-stage.kb-active {
  animation: kenBurnsStage var(--classic-duration, 6s) linear both;
}
@keyframes kenBurnsStage {
  0%   { background-size: contain; background-position: 50% 50%; transform: scale(1.00); }
  100% { background-size: contain; background-position: 48% 49%; transform: scale(1.06); }
}
.classic-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  will-change: opacity, transform;
  transition: opacity 900ms var(--easing);
}
.classic-photo.active { opacity: 1; }

/* --- Ken Burns (défaut) : léger zoom + pan pendant l'affichage --- */
.classic-photo.kenburns.active {
  animation: kenBurnsPan var(--classic-duration, 6s) linear both;
}
@keyframes kenBurnsPan {
  0%   { transform: scale(1.00) translate(0, 0); }
  100% { transform: scale(1.08) translate(-1.5%, -1.2%); }
}

/* --- Fondu simple : juste l'opacity (default transition sur .classic-photo) --- */
.classic-photo.fade { transition: opacity 900ms ease-in-out; }

/* --- Slide horizontal : glisse depuis la droite, sort à gauche --- */
.classic-slideshow.slide-mode .classic-photo {
  transition: opacity 500ms ease, transform 700ms var(--easing);
}
.classic-slideshow.slide-mode .classic-photo.enter { transform: translateX(100%); opacity: 0; }
.classic-slideshow.slide-mode .classic-photo.active { transform: translateX(0); opacity: 1; }
.classic-slideshow.slide-mode .classic-photo.exit { transform: translateX(-100%); opacity: 0; }

/* --- Caption overlay bas centré --- */
.classic-caption {
  position: absolute;
  bottom: calc(70px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90vw, 640px);
  padding: 12px 20px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 14px;
  border: 1px solid var(--border);
  color: #fff;
  text-align: center;
  z-index: 20;
  pointer-events: none;
  transition: opacity 250ms;
}
.classic-caption[hidden] { display: none; }
.classic-caption-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.classic-caption-sub {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 4px;
}

/* --- Boutons navigation ← → sur les côtés --- */
.classic-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 22;
  transition: background 150ms, opacity 200ms;
  opacity: 0.6;
}
.classic-nav:hover { background: rgba(0,0,0,0.75); opacity: 1; }
.classic-nav-prev { left: calc(14px + var(--safe-left)); }
.classic-nav-next { right: calc(14px + var(--safe-right)); }
.classic-nav:disabled { opacity: 0.2; cursor: not-allowed; }

/* Desktop souris : la sidebar controls verticale à gauche occupe la même
   zone que la flèche « précédent ». On décale les flèches pour ne pas
   masquer la nav manuelle. */
@media (min-width: 720px) and (hover: hover) and (pointer: fine) {
  .classic-nav-prev { left: calc(80px + var(--safe-left)); }
}

/* --- Progress compteur (ex: "3 / 12") --- */
.classic-progress {
  position: absolute;
  top: calc(14px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  border: 1px solid var(--border);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  z-index: 20;
  pointer-events: none;
}

/* En mode kiosque immersif, cache tout sauf la scène qui tourne */
body.kiosk-mode .classic-caption,
body.kiosk-mode .classic-nav,
body.kiosk-mode .classic-progress {
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms;
}

/* ═══════════════════════════════════════════════════════
   PANNEAU CARACTÉRISTIQUES (miroir natif — signature v3)
   Distinct de .info-panel (attachments hotspot info)
   ═══════════════════════════════════════════════════════ */
.property-panel {
  /* Panneau caractéristiques — miroir PhantourInfoPanelView.swift natif
     Largeur 380pt (natif) — background gris foncé white(0.11) miroir. */
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 380px;
  max-width: 92vw;
  background: rgba(28, 28, 32, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #FFFFFF;
  padding: calc(20px + var(--safe-top)) 24px 24px 24px;
  box-shadow: -12px 0 40px rgba(0,0,0,0.5);
  overflow-y: auto;
  z-index: 200;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
  border-left: 1px solid rgba(255,255,255,0.08);
}
/* Le hidden natif HTML gère display:none. Quand on retire l'attribut hidden,
   il faut aussi ramener le panel dans le viewport (sinon il reste en
   translateX(100%) donc invisible à droite = "info ne s'ouvre pas"). */
.property-panel[hidden] { display: none; }
.property-panel:not([hidden]) { transform: translateX(0); }

.property-close {
  position: absolute;
  top: calc(14px + var(--safe-top));
  right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(201,169,97,0.15);
  color: #E8DCC4;
  display: grid; place-items: center;
  border: 1px solid rgba(201,169,97,0.3);
  transition: background 150ms;
}
.property-close:hover { background: rgba(201,169,97,0.3); }

.property-title {
  /* Miroir natif : SF Pro 15pt bold blanc, PAS serif italic.
     Natif = PhantourInfoPanelView Text("Informations").font(.headline).bold(). */
  font-family: var(--font);
  font-style: normal;
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 18px 0;
  padding-right: 40px;
}

.property-sections {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.property-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #C9A961;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(201,169,97,0.2);
}

.property-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}
.property-row-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(232,220,196,0.85);
}
.property-row-value {
  color: #E8DCC4;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.property-icon {
  font-size: 14px;
  opacity: 0.8;
}

/* Badge DPE coloré (A à G) */
.info-dpe-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  letter-spacing: 0.5px;
}
.info-dpe-a { background: #009e73; }
.info-dpe-b { background: #4bb552; }
.info-dpe-c { background: #b1cc4a; }
.info-dpe-d { background: #f9d31a; color: #1B2A4E; }
.info-dpe-e { background: #f5a623; color: #1B2A4E; }
.info-dpe-f { background: #ec7522; }
.info-dpe-g { background: #d0021b; }

/* ═══════════════════════════════════════════════════════
   MODAL FEEDBACK (miroir natif VisitorFeedbackSheet — card blanche)
   ═══════════════════════════════════════════════════════ */
.modal-feedback { background: transparent !important; padding: 0 !important; }
.modal-feedback .modal-body {
  background: #fff;
  border-radius: 18px;
  padding: 28px 32px 20px;
  max-width: 480px;
  color: #1B2A4E;
}
.feedback-title {
  font-family: "New York", "Times New Roman", Georgia, serif;
  font-style: italic;
  font-size: 22px;
  font-weight: 500;
  color: #1B2A4E;
  text-align: center;
  margin-bottom: 8px;
}
.feedback-question {
  font-size: 14px;
  color: rgba(27,42,78,0.75);
  text-align: center;
  margin-bottom: 22px;
}
.feedback-thumbs {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 22px;
}
.thumb {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: none;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform 150ms cubic-bezier(0.22,0.61,0.36,1),
              background 200ms;
}
.thumb-up   { background: rgba(56,161,105,0.15); color: #38a169; }
.thumb-down { background: rgba(224,49,49,0.15); color: #e03131; }
.thumb:hover, .thumb.selected { transform: scale(1.08); }
.thumb-up.selected   { background: rgba(56,161,105,0.35); }
.thumb-down.selected { background: rgba(224,49,49,0.35); }

.feedback-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(27,42,78,0.10);
}
.feedback-later {
  background: none;
  border: none;
  color: rgba(27,42,78,0.55);
  font-size: 13px;
  padding: 8px 4px;
  cursor: pointer;
}
.feedback-later:hover { color: #1B2A4E; }
.feedback-send {
  background: #C9A961;
  color: #1B2A4E;
  border: none;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms;
}
.feedback-send:hover:not(:disabled) { background: #D4B76F; }
.feedback-send:disabled { opacity: 0.4; cursor: not-allowed; }

.feedback-success {
  text-align: center;
  padding: 24px 20px 8px;
}
.feedback-success[hidden] { display: none !important; }
.feedback-success-badge {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border-radius: 12px;
  background: #38a169;
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(56,161,105,0.4);
}
.feedback-success-title {
  font-family: "New York", "Times New Roman", Georgia, serif;
  font-style: italic;
  font-size: 22px;
  font-weight: 500;
  color: #1B2A4E;
  margin-bottom: 10px;
}
.feedback-success-text {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(27,42,78,0.7);
  max-width: 340px;
  margin: 0 auto 20px;
}
.feedback-success-close {
  background: none;
  border: none;
  color: #C9A961;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  cursor: pointer;
  transition: color 200ms;
}
.feedback-success-close:hover { color: #B39A5A; }

/* ═══════════════════════════════════════════════════════
   MODAL CONTACT — style clone natif (fond blanc semi-transparent)
   ═══════════════════════════════════════════════════════ */
.modal-contact .modal-body {
  background: #fff;
  color: #1B2A4E;
  border-radius: 18px;
  padding: 24px;
  max-width: 460px;
}
.modal-contact .modal-header {
  background: transparent;
  border-bottom: 1px solid rgba(27,42,78,0.10);
  padding: 20px 24px 14px;
}
.modal-contact .modal-title {
  color: #1B2A4E;
  font-weight: 700;
}
.modal-contact .form-label {
  color: rgba(27,42,78,0.7);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.modal-contact .form-input,
.modal-contact .form-textarea {
  background: rgba(27,42,78,0.05);
  border: 1px solid rgba(27,42,78,0.12);
  color: #1B2A4E;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}
.modal-contact .form-input:focus,
.modal-contact .form-textarea:focus {
  outline: none;
  border-color: #C9A961;
  background: #fff;
}
.modal-contact .form-input::placeholder,
.modal-contact .form-textarea::placeholder {
  color: rgba(27,42,78,0.35);
}
.modal-contact .form-submit {
  background: rgba(27,42,78,0.10);
  color: rgba(27,42,78,0.4);
  border: none;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: not-allowed;
  width: 100%;
  transition: background 200ms, color 200ms;
}
.modal-contact .form-submit.can-submit {
  background: #C9A961;
  color: #1B2A4E;
  cursor: pointer;
}
.modal-contact .form-submit.can-submit:hover {
  background: #D4B76F;
}
/* Le contact-success ne doit JAMAIS s'afficher par défaut */
.contact-success[hidden] { display: none !important; }

/* Réduire les animations si utilisateur le demande */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
