/* Visite guidée « Comment ça marche » — styles partagés (voir visite.js).
   Couleurs : theme { accent, anneau, fond, texte } dans visite-scenario.js de chaque démo.
   Règle d'or : le panneau a sa place réservée, la démo n'est jamais recouverte. */
.gfv-voile, .gfv-trou, .gfv-panneau, .gfv-panneau * { box-sizing: border-box; }
.gfv-voile[hidden], .gfv-trou[hidden], .gfv-panneau[hidden] { display: none !important; }
html.gfv-ouvert { scroll-behavior: auto; }

/* Place réservée : la page se resserre pour laisser la colonne (écran large) ou la bande du bas (tablette, téléphone). */
html.gfv-ouvert.gfv-cote { padding-right: var(--gfv-reserve-droite, 352px) !important; }
html.gfv-ouvert.gfv-bas { padding-bottom: var(--gfv-reserve-bas, 200px) !important; }

/* Le voile bloque les clics du visiteur pendant la visite (la visite clique pour lui). Il reste transparent. */
.gfv-voile { position: fixed; inset: 0; z-index: 2147483000; background: transparent; }

/* La zone éclairée : un cadre fin, et un assombrissement léger du reste de la démo. */
.gfv-trou {
  position: fixed; z-index: 2147483001; pointer-events: none; border-radius: 10px;
  box-shadow: 0 0 0 2px var(--gfv-anneau, #8da86b), 0 0 0 9999px rgba(0, 0, 0, .18);
  transition: top .3s ease, left .3s ease, width .3s ease, height .3s ease, opacity .2s;
  opacity: 0;
}
.gfv-trou.vu { opacity: 1; }

/* Le panneau de visite. */
.gfv-panneau {
  position: fixed; z-index: 2147483002; display: flex; flex-direction: column; gap: 10px;
  background: var(--gfv-fond, #fffdf7); color: var(--gfv-texte, #1b1b1b);
  border-radius: 12px; padding: 14px 16px 16px; box-shadow: 0 4px 16px rgba(0, 0, 0, .10), 0 0 0 1px rgba(0, 0, 0, .06);
  font: 14px/20px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; outline: none;
  transition: opacity .2s ease;
}
.gfv-panneau.gfv-cache { opacity: .55; }
/* Écran large : colonne de 320 px à droite, à la hauteur de la zone éclairée. */
html.gfv-cote .gfv-panneau { right: 16px; width: 320px; max-height: calc(100vh - 32px); overflow-y: auto; }
/* Tablette et téléphone : bande en bas, 36 % de la hauteur au plus, le texte long défile dedans. */
html.gfv-bas .gfv-panneau {
  left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); margin: 0 auto; max-width: 680px;
  max-height: 36vh; max-height: 36dvh;
}
html.gfv-bas .gfv-corps { overflow-y: auto; min-height: 0; }
.gfv-panneau .gfv-corps { display: flex; flex-direction: column; gap: 4px; }
.gfv-panneau.gfv-replie .gfv-corps { display: none; }

.gfv-panneau h2, .gfv-panneau p, .gfv-panneau button, .gfv-panneau span { font-family: inherit; letter-spacing: normal; text-transform: none; text-shadow: none; margin: 0; }
.gfv-panneau h2 { font-size: 16px; line-height: 22px; font-weight: 750; color: inherit; overflow-wrap: anywhere; }
.gfv-texte { font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.gfv-note { font-size: 12px; line-height: 16px; opacity: .65; margin-top: 4px !important; }

/* Ligne du haut : compteur et points sur une même ligne, puis réduire et fermer. */
.gfv-tete { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.gfv-compte { font-size: 12px; line-height: 16px; font-weight: 700; opacity: .7; white-space: nowrap; }
.gfv-points { display: flex; gap: 4px; flex: 1; align-items: center; }
.gfv-points i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .2; }
.gfv-points i.on { opacity: .85; width: 16px; border-radius: 3px; }
.gfv-tete .gfv-compte:empty { flex: 1; }
.gfv-icone { width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.gfv-icone:hover { background: rgba(0, 0, 0, .06); }
.gfv-replier { display: none; transition: transform .2s; }
html.gfv-bas .gfv-replier { display: grid; }
.gfv-panneau.gfv-replie .gfv-replier { transform: rotate(180deg); }

.gfv-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.gfv-btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--gfv-accent, #8da86b); background: transparent; color: inherit; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: none; }
.gfv-btn[disabled] { opacity: .35; cursor: default; }
.gfv-btn.gfv-plein[aria-busy="true"] { opacity: .75; cursor: progress; }
.gfv-btn.gfv-plein { background: var(--gfv-accent, #8da86b); color: #fff; }
.gfv-btn:focus-visible, .gfv-icone:focus-visible { outline: 2px solid var(--gfv-texte, #1b1b1b); outline-offset: 2px; }
html.gfv-bas .gfv-actions .gfv-btn { flex: 1; max-width: 260px; }
/* Indicateur « … écrit » que la visite peut poser dans une conversation de démo, le temps d'une réponse simulée. */
.gfv-ecrit { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1.5px dashed currentColor; border-radius: 12px; font-size: 12px; opacity: .8; justify-self: start; }
.gfv-ecrit i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: gfv-ecrit 1s infinite ease-in-out; }
.gfv-ecrit i:nth-child(2) { animation-delay: .15s; } .gfv-ecrit i:nth-child(3) { animation-delay: .3s; }
@keyframes gfv-ecrit { 0%, 80%, 100% { opacity: .2; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .gfv-trou, .gfv-panneau, .gfv-replier { transition: none; } .gfv-ecrit i { animation: none; opacity: .6; } }
