/* ===== Visite 3D ===== */
.vis-page { padding-top: 78px; background: var(--navy-900); }
.vis { position: relative; height: calc(100vh - 78px); min-height: 560px; overflow: hidden; background: #dfe6f0; isolation: isolate; }
.vis-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.vis-canvas:active { cursor: grabbing; }

/* étiquettes reliées à leur objet par un trait */
.vis-hots { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.vis-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.vis-lines line { stroke: rgba(6, 26, 71, .8); stroke-width: 1.6; stroke-dasharray: 4 3; }
.vis-lines circle { fill: rgba(255, 106, 0, .25); stroke: #fff; stroke-width: 2; }
.vis-lines .is-hover, .vis-lines .is-active { stroke: var(--orange); stroke-dasharray: none; stroke-width: 2.2; }
.vis-lines circle.is-hover, .vis-lines circle.is-active { fill: rgba(255, 106, 0, .55); stroke: #fff; }
.vis-hot { position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; will-change: transform; }
.vis-hot-dot { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: var(--orange); border: 2.5px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .35); }
.vis-hot-dot::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(255, 106, 0, .7); animation: vis-pulse 1.8s ease-out infinite; }
.vis-hot.is-found .vis-hot-dot { background: var(--sky); }
.vis-hot.is-found .vis-hot-dot::after { animation: none; border-color: transparent; }
.vis-hot-name { position: absolute; left: 0; bottom: 14px; transform: translateX(-50%); white-space: nowrap; padding: 6px 11px; border-radius: 9px; background: rgba(6, 26, 71, .92); color: #fff; font: 700 .76rem/1 var(--head); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .6); transition: opacity .2s, background-color .2s; }
.vis-hot.is-found .vis-hot-name::before { content: "✓ "; color: var(--sky); }
.vis-hot.is-far .vis-hot-name { opacity: 0; pointer-events: none; }
.vis-hot.is-far:hover .vis-hot-name, .vis-hot.is-far.is-hover .vis-hot-name { opacity: 1; }
.vis-hot:hover .vis-hot-name, .vis-hot.is-hover .vis-hot-name, .vis-hot.is-active .vis-hot-name { background: var(--orange); }
.vis-hot.is-active .vis-hot-dot { background: var(--orange); }
.vis-hot:hover, .vis-hot.is-hover, .vis-hot.is-active { z-index: 2; }
@keyframes vis-pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }

/* barre du haut */
.vis-top { position: absolute; z-index: 3; top: 18px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; pointer-events: none; }
.vis-title, .vis-progress { pointer-events: auto; padding: 12px 18px; border-radius: 14px; background: rgba(6, 26, 71, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .55); }
.vis-kicker { font: 700 .68rem/1 var(--head); letter-spacing: .12em; text-transform: uppercase; color: #ffb27a; margin-bottom: 6px; }
.vis-title h1 { color: #fff; font-size: 1.15rem; font-weight: 800; }
.vis-progress { display: grid; gap: 8px; font-size: .82rem; color: #c9d4ea; min-width: 250px; }
.vis-progress b { color: #fff; font-family: var(--head); }
.vis-bar { display: block; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.vis-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--sky), var(--orange)); transition: width .5s; }

/* barre du bas : zones */
.vis-bottom { position: absolute; z-index: 3; left: 20px; right: 20px; bottom: 44px; display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; pointer-events: none; }
.vis-zones { display: flex; gap: 4px; padding: 5px; border-radius: 14px; background: rgba(6, 26, 71, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: auto; overflow-x: auto; max-width: 100%; }
.vis-zones button { flex: none; border: 0; background: none; color: #c9d4ea; font: 700 .82rem/1 var(--head); padding: 10px 14px; border-radius: 10px; cursor: pointer; transition: background-color .2s, color .2s; }
.vis-zones button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.vis-zones button[aria-pressed="true"] { background: #fff; color: var(--navy); }
.vis-guide-btn, .vis-btn { border: 0; cursor: pointer; font: 700 .84rem/1 var(--head); color: #fff; padding: 12px 18px; border-radius: 12px; background: linear-gradient(135deg, #ff7a12, var(--orange-600)); box-shadow: 0 12px 26px -12px rgba(255, 106, 0, .8); pointer-events: auto; transition: transform .2s; }
.vis-guide-btn:hover, .vis-btn:hover { transform: translateY(-1px); }
.vis-btn-ghost { border: 1.5px solid #c9d3e6; background: #fff; color: var(--navy); font: 700 .84rem/1 var(--head); padding: 11px 16px; border-radius: 12px; cursor: pointer; }
.vis-btn-ghost:hover { border-color: var(--navy); }
.vis-btn-ghost:disabled { opacity: .4; cursor: default; }
.vis-link { border: 0; background: none; color: var(--muted); font: 600 .82rem/1 var(--head); cursor: pointer; margin-right: auto; padding: 8px 0; }
.is-guided .vis-guide-btn { display: none; }

.vis-help { position: absolute; z-index: 3; left: 0; right: 0; bottom: 14px; text-align: center; font-size: .76rem; color: #4a5672; pointer-events: none; }

/* visite guidée */
.vis-guide { position: absolute; z-index: 4; left: 20px; bottom: 112px; width: min(440px, calc(100% - 40px)); padding: 18px 20px; border-radius: 16px; background: #fff; box-shadow: 0 24px 50px -20px rgba(4, 18, 47, .55); color: var(--text); font-size: .92rem; line-height: 1.55; }
.vis-guide-step { font: 700 .7rem/1 var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--orange); margin-bottom: 8px; }
.vis-guide-items { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.vis-guide-items button { border: 1.5px solid #ffd2b3; background: #fff4ec; color: var(--orange-600); font: 700 .78rem/1 var(--head); padding: 8px 12px; border-radius: 9px; cursor: pointer; }
.vis-guide-items button:hover { background: var(--orange); border-color: var(--orange); color: #fff; }
.vis-guide-items button::before { content: "● "; }
.vis-guide-act { display: flex; gap: 8px; align-items: center; margin-top: 14px; }

/* fiche */
.vis-card { position: absolute; z-index: 5; top: 18px; right: 20px; max-height: calc(100% - 36px); width: min(380px, calc(100% - 40px)); overflow-y: auto; padding: 24px 24px 22px; border-radius: 18px; background: #fff; box-shadow: 0 30px 60px -24px rgba(4, 18, 47, .6); color: var(--text); animation: vis-in .3s ease-out; }
@keyframes vis-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.has-card .vis-progress { visibility: hidden; }
.vis-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--soft); color: var(--navy); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.vis-card-kicker { font: 700 .68rem/1.3 var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--orange); margin: 0 40px 8px 0; }
.vis-card h2 { font-size: 1.35rem; font-weight: 800; margin-bottom: 10px; }
.vis-card-role { font-size: .92rem; line-height: 1.6; }
.vis-card h3 { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.vis-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.vis-parts li { font-size: .8rem; font-weight: 600; color: var(--navy); padding: 5px 10px; border-radius: 8px; background: #eef3fb; }
.vis-keep { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: #fff4ec; border-left: 3px solid var(--orange); font-size: .88rem; line-height: 1.55; }
.vis-keep b { display: block; font: 700 .7rem/1 var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--orange-600); margin-bottom: 6px; }
.vis-job { margin-top: 14px; font-size: .86rem; }
.vis-job span { color: var(--muted); }
.vis-job b { color: var(--ink); }
.vis-card-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.vis-card-act > * { flex: 1 1 auto; }

.vis-toast { position: absolute; z-index: 6; top: 90px; left: 50%; transform: translateX(-50%); padding: 12px 18px; border-radius: 12px; background: var(--navy); color: #fff; font: 700 .86rem/1.3 var(--head); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6); }

@media (max-width: 900px) {
  .vis { height: calc(100svh - 78px); }
  .vis-top { top: 10px; left: 10px; right: 10px; flex-direction: column; gap: 8px; }
  .vis-title, .vis-progress { padding: 10px 14px; }
  .vis-progress { min-width: 0; }
  .vis-bottom { left: 10px; right: 10px; bottom: 34px; }
  .vis-help { display: none; }
  .vis-card { top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 62%; }
  .vis-guide { left: 10px; bottom: 120px; width: calc(100% - 20px); }
}
@media (max-width: 640px) {
  .vis-zones button { padding: 9px 10px; font-size: .76rem; }
}
