/* ============ PERSONNALISATION DE LA MARQUE ============ */
:root {
  --brand-bg: #0d0d0f;          /* fond des écrans */
  --brand-surface: #17161a;     /* cartes, fiches */
  --brand-text: #f4efe6;        /* texte principal */
  --brand-muted: #a49f96;       /* texte secondaire */
  --brand-accent: #c9a45c;      /* couleur d'accent */
  --brand-accent-text: #0d0d0f; /* texte sur l'accent */
  --font-title: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
/* ======================================================= */

:root {
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --tabbar-h: calc(68px + var(--safe-bottom));
  --topbar-h: calc(54px + var(--safe-top));
  --ease-out: cubic-bezier(.2, .9, .25, 1);
  --glass: rgba(13, 13, 15, .72);
  --line: rgba(255, 255, 255, .08);
  --track: var(--brand-accent);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--brand-bg); color: var(--brand-text);
             font-family: var(--font-body); overflow: hidden; -webkit-font-smoothing: antialiased;
             overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
svg { display: block; }
img { display: block; max-width: 100%; }

/* ---------- Écrans plein écran ---------- */
.screen { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
          align-items: center; justify-content: center; gap: 26px; padding: 32px; text-align: center;
          background: radial-gradient(120% 80% at 50% 0%, #1c1a17 0%, var(--brand-bg) 60%);
          transition: opacity .7s ease, visibility .7s; }
.screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#splash .logo { animation: tick 1.2s var(--ease-out) both; }
@keyframes tick { from { transform: rotate(-90deg) scale(.8); opacity: 0 } }
.logo { width: 84px; height: 84px; color: var(--brand-accent); }
.brand { font-family: var(--font-title); font-size: 34px; letter-spacing: .18em; margin: 0; font-weight: 400; }
.tagline { color: var(--brand-muted); font-size: 15px; line-height: 1.5; max-width: 300px; margin: 0; }
.rule { width: 48px; height: 1px; background: var(--brand-accent); }
.btn { appearance: none; border-radius: 999px; padding: 15px 34px; font-weight: 600; font-size: 14px;
       letter-spacing: .12em; text-transform: uppercase; color: var(--brand-accent-text);
       background: var(--brand-accent); box-shadow: 0 10px 30px -10px var(--brand-accent);
       transition: transform .15s; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--brand-accent); box-shadow: inset 0 0 0 1px var(--brand-accent); }
.url { font-family: ui-monospace, monospace; color: var(--brand-accent); font-size: 15px; word-break: break-all; }
.spinner { width: 42px; height: 42px; border: 2px solid rgba(255,255,255,.12);
           border-top-color: var(--brand-accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- Barre du haut ---------- */
#topbar { position: fixed; z-index: 80; top: 0; left: 0; right: 0; height: var(--topbar-h);
          padding: var(--safe-top) 16px 0 20px; display: flex; align-items: center; gap: 10px;
          font-family: var(--font-title); letter-spacing: .18em; font-size: 14px;
          background: linear-gradient(var(--brand-bg) 40%, rgba(13,13,15,0)); }
body[data-tab="scan"] #topbar { background: linear-gradient(rgba(0,0,0,.55), transparent); }
#topbar > svg { width: 22px; height: 22px; color: var(--brand-accent); }
.progress { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px;
            border-radius: 999px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
            font-family: var(--font-body); letter-spacing: 0; font-size: 13px; border: 1px solid var(--line); }
.progress-ring { --p: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
                 background: conic-gradient(var(--brand-accent) calc(var(--p) * 1turn), rgba(255,255,255,.15) 0); }
.progress-ring i { width: 16px; height: 16px; border-radius: 50%; background: var(--brand-bg); }

/* ---------- Barre d'onglets ---------- */
#tabbar { position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; height: var(--tabbar-h);
          padding-bottom: var(--safe-bottom); display: flex; align-items: center; background: var(--glass);
          backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
          border-top: 1px solid var(--line); }
#tabbar button { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
                 gap: 4px; font-size: 11px; letter-spacing: .04em; color: var(--brand-muted); transition: color .2s; text-align: center; }
#tabbar svg { width: 24px; height: 24px; }
#tabbar .tab-scan span { width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center;
                         background: var(--brand-accent); color: var(--brand-accent-text);
                         box-shadow: 0 8px 24px -6px var(--brand-accent), 0 0 0 5px var(--brand-bg); transition: transform .2s; }
#tabbar .tab-scan:active span { transform: scale(.94); }
body[data-tab="hub"] #tabbar [data-tab="hub"],
body[data-tab="scan"] #tabbar [data-tab="scan"],
body[data-tab="about"] #tabbar [data-tab="about"] { color: var(--brand-accent); }

/* ---------- Vues (hub, à propos) ---------- */
.view { position: fixed; inset: 0; z-index: 70; overflow-y: auto; -webkit-overflow-scrolling: touch;
        background: var(--brand-bg); padding: calc(var(--topbar-h) + 8px) 20px calc(var(--tabbar-h) + 28px);
        opacity: 0; transform: translateY(14px); pointer-events: none; visibility: hidden;
        transition: opacity .35s var(--ease-out), transform .35s var(--ease-out), visibility .35s;
        user-select: text; scrollbar-width: none; }
.view::-webkit-scrollbar { display: none; }
body[data-tab="hub"] #view-hub, body[data-tab="about"] #view-about { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.view-inner { max-width: 600px; margin: 0 auto; }
.eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--brand-accent); margin: 0; }
.view-title { font-family: var(--font-title); font-weight: 600; font-size: 32px; margin: 8px 0 12px; line-height: 1.1; letter-spacing: -.02em; }
.hub-title { font-size: 38px; letter-spacing: .06em; }
.muted { color: var(--brand-muted); font-size: 15px; line-height: 1.6; margin: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-label { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--brand-muted); margin: 0 0 12px; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--brand-muted); margin: 0; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

/* Bouton Scanner du hub */
.scan-cta { width: 100%; display: flex; align-items: center; gap: 14px; margin: 24px 0 30px; padding: 16px;
            border-radius: 20px; background: linear-gradient(135deg, rgba(201,164,92,.22), rgba(201,164,92,.06));
            border: 1px solid rgba(201,164,92,.45); transition: transform .15s; }
.scan-cta:active { transform: scale(.98); }
.scan-cta-icon { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
                 background: var(--brand-accent); color: var(--brand-accent-text); }
.scan-cta-icon svg { width: 26px; height: 26px; }
.scan-cta strong { display: block; font-size: 17px; }
.scan-cta small { color: var(--brand-muted); font-size: 13px; line-height: 1.4; }
.scan-cta .chev { width: 20px; height: 20px; margin-left: auto; color: var(--brand-accent); flex: none; }

/* Plan de l'exposition */
.plan-wrap { margin-bottom: 34px; }
.plan { position: relative; aspect-ratio: 1 / 1; border-radius: 22px; overflow: hidden; background: var(--brand-surface);
        border: 1px solid var(--line); }
.plan svg.floor { position: absolute; inset: 0; width: 100%; height: 100%; }
.pin { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pin-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-title);
           font-size: 18px; background: var(--brand-bg); color: var(--track); border: 1.5px solid var(--track); position: relative;
           box-shadow: 0 6px 18px rgba(0,0,0,.5); transition: transform .2s; }
.pin:active .pin-dot { transform: scale(.92); }
.pin.found .pin-dot { background: var(--track); color: var(--brand-accent-text); }
.pin-dot::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1px solid var(--track); opacity: 0;
                   animation: pulse 2.6s ease-out infinite; }
.pin.found .pin-dot::before { display: none; }
@keyframes pulse { 0% { transform: scale(.7); opacity: .8 } 100% { transform: scale(1.5); opacity: 0 } }
.pin-label { font-size: 11px; color: var(--brand-text); background: var(--glass); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.plan-entrance { position: absolute; transform: translate(-50%, -50%); font-size: 10px; letter-spacing: .22em;
                 text-transform: uppercase; color: var(--brand-muted); }

/* Parcours */
.track { margin-bottom: 34px; }
.track-head { padding-left: 14px; border-left: 2px solid var(--track); margin-bottom: 16px; }
.track-head .eyebrow { color: var(--track); }
.track-head h3 { font-family: var(--font-title); font-weight: 400; font-size: 26px; margin: 4px 0 6px; }
.track-head p { margin: 0; color: var(--brand-muted); font-size: 14px; line-height: 1.55; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.card { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 18px; width: 100%;
        background: var(--brand-surface); border: 1px solid var(--line); transition: transform .15s; }
.card:active { transform: scale(.98); }
.thumb { flex: none; width: 72px; height: 72px; border-radius: 13px; background-size: cover; background-position: center;
         position: relative; overflow: hidden; display: grid; place-items: center;
         background-image: radial-gradient(circle at 30% 20%, rgba(255,255,255,.08), transparent 60%), linear-gradient(135deg, #26231e, #121114); }
.thumb .num { position: absolute; left: 9px; bottom: 5px; font-family: var(--font-title); font-size: 22px; color: var(--track);
              text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.thumb .glyph { width: 30px; height: 30px; color: var(--track); opacity: .55; }
.card-body { flex: 1; min-width: 0; }
.card-body small { color: var(--brand-muted); font-size: 12px; }
.card-body strong { display: block; font-family: var(--font-title); font-weight: 400; font-size: 18px; margin: 2px 0 5px; line-height: 1.2; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--track);
       border: 1px solid var(--track); padding: 2px 8px; border-radius: 999px; }
.tag svg { width: 12px; height: 12px; }
.badge { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; margin-right: 4px;
         color: var(--brand-muted); }
.badge svg { width: 16px; height: 16px; }
.card.found .badge { color: var(--brand-accent-text); background: var(--track); }

/* ---------- Scanner ---------- */
#scan { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center;
        justify-content: center; gap: 24px; pointer-events: none; transition: opacity .4s; opacity: 0;
        padding-bottom: var(--tabbar-h); }
body[data-state="scanning"][data-tab="scan"] #scan { opacity: 1; }
.viewfinder { position: relative; width: 62vw; max-width: 300px; aspect-ratio: 3 / 4; }
.viewfinder i { position: absolute; width: 34px; height: 34px; border: 2px solid var(--brand-accent); }
.viewfinder i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.viewfinder i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.viewfinder i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.viewfinder i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.viewfinder::after { content: ""; position: absolute; left: 8%; right: 8%; height: 2px; top: 10%;
                     background: linear-gradient(90deg, transparent, var(--brand-accent), transparent);
                     animation: sweep 2.4s ease-in-out infinite; }
@keyframes sweep { 50% { top: 88% } }
.pill { background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
        padding: 10px 18px; border-radius: 999px; font-size: 14px; }
.scan-overlay { position: fixed; inset: 0; z-index: 45; display: none; flex-direction: column; align-items: center;
                justify-content: center; gap: 22px; padding: 32px 32px var(--tabbar-h); text-align: center; background: var(--brand-bg); }
body[data-tab="scan"][data-state="loading"] #scan-loading { display: flex; }
body[data-tab="scan"].desktop #scan-desktop { display: flex; }

/* ---------- Fiche (bottom sheet) ---------- */
#scrim { position: fixed; inset: 0; z-index: 94; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .35s; }
body.sheet-open #scrim { opacity: 1; pointer-events: auto; }
#sheet { --peek: 150px; position: fixed; z-index: 85; left: 0; right: 0; bottom: 0; height: calc(100% - 40px - var(--safe-top));
         max-width: 640px; margin: 0 auto; background: var(--brand-surface); border-radius: 24px 24px 0 0;
         border: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -20px 60px rgba(0,0,0,.5);
         transform: translateY(100%); transition: transform .45s var(--ease-out); display: flex; flex-direction: column; }
#sheet.peek { transform: translateY(calc(100% - var(--peek) - var(--tabbar-h))); }
#sheet.open { transform: translateY(0); z-index: 95; }
#sheet.dragging { transition: none; }
.sheet-grab { flex: none; padding: 10px 0 6px; display: grid; place-items: center; touch-action: none; }
.sheet-grab span { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); }
.sheet-close { position: absolute; top: 14px; right: 14px; z-index: 3; width: 34px; height: 34px; border-radius: 50%;
               display: grid; place-items: center; background: rgba(255,255,255,.1); opacity: 0; transition: opacity .2s; }
.sheet-close svg { width: 16px; height: 16px; }
#sheet.open .sheet-close { opacity: 1; }
.sheet-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 0 22px 48px;
                user-select: text; scrollbar-width: none; }
.sheet-scroll::-webkit-scrollbar { display: none; }
#sheet:not(.open) .sheet-scroll { overflow: hidden; }
.sheet-head { display: flex; gap: 14px; align-items: center; padding: 6px 40px 18px 0; touch-action: none; }
.sheet-head .thumb { width: 62px; height: 62px; }
.sheet-head h3 { font-family: var(--font-title); font-weight: 400; font-size: 22px; margin: 4px 0 2px; line-height: 1.15; }
.sheet-head small { color: var(--brand-muted); font-size: 13px; }
.more { color: var(--track); font-size: 13px; margin-top: 3px; }
#sheet.open .more { display: none; }
.hero { margin: 0 -22px 22px; aspect-ratio: 16 / 10; background-size: cover; background-position: center; position: relative; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, var(--brand-surface)); }
.prose p { color: #d9d3c9; font-size: 16px; line-height: 1.65; margin: 0 0 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; margin: 6px 0 26px; }
.fact { padding: 14px 10px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); text-align: center; }
.fact b { display: block; font-family: var(--font-title); font-weight: 400; font-size: 22px; color: var(--track); white-space: nowrap; }
.fact span { font-size: 12px; color: var(--brand-muted); }
.block { margin-bottom: 28px; }
.ar-cta { width: 100%; justify-content: center; margin: 4px 0 28px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { padding: 8px 13px; border-radius: 999px; font-size: 13px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { position: relative; padding: 0 0 18px 44px; counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
                    display: grid; place-items: center; font-family: var(--font-title); color: var(--track); border: 1px solid var(--track); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 32px; bottom: 2px; width: 1px; background: var(--line); }
.steps strong { display: block; margin-bottom: 3px; }
.steps span { color: var(--brand-muted); font-size: 14px; line-height: 1.5; }

.gallery { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -22px; padding: 0 22px; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery figure { flex: none; width: 78%; margin: 0; scroll-snap-align: center; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; }
.gallery figcaption { font-size: 13px; color: var(--brand-muted); margin-top: 8px; }

/* Frise chronologique */
.timeline { margin: 0 -22px; }
.tl-rail { position: relative; height: 54px; margin: 0 28px 6px; }
.tl-rail::before { content: ""; position: absolute; left: 0; right: 0; top: 40px; height: 1px; background: var(--line); }
.tl-fill { position: absolute; left: 0; top: 40px; height: 1px; background: var(--track); transition: width .4s var(--ease-out); }
.tl-dot { position: absolute; top: 34px; width: 13px; height: 13px; margin-left: -6px; border-radius: 50%;
          background: var(--brand-surface); border: 1.5px solid var(--brand-muted); transition: all .3s; padding: 0; }
.tl-dot.past { border-color: var(--track); }
.tl-dot.on { border-color: var(--track); background: var(--track); transform: scale(1.3); }
.tl-year { position: absolute; top: 0; transform: translateX(-50%); font-family: var(--font-title); font-size: 22px; color: var(--track);
           white-space: nowrap; transition: left .4s var(--ease-out); }
.tl-track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 22px 6px; scrollbar-width: none; }
.tl-track::-webkit-scrollbar { display: none; }
.tl-card { flex: none; width: 82%; scroll-snap-align: center; padding: 22px 20px; border-radius: 18px; min-height: 180px;
           background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015)); border: 1px solid var(--line);
           transition: opacity .3s, transform .3s, border-color .3s; opacity: .45; transform: scale(.96); }
.tl-card.on { opacity: 1; transform: none; border-color: var(--track); }
.tl-card b { font-family: var(--font-title); font-weight: 400; font-size: 34px; color: var(--track); display: block; }
.tl-card strong { display: block; font-size: 17px; margin: 6px 0 8px; }
.tl-card p { margin: 0; color: var(--brand-muted); font-size: 14px; line-height: 1.55; }
.tl-hint { text-align: center; font-size: 12px; color: var(--brand-muted); margin-top: 10px; }

/* Montre 3D */
.watch { margin: 0 -22px; }
.watch-stage { position: relative; height: min(58vh, 440px); background: radial-gradient(60% 55% at 50% 45%, #2a2721, var(--brand-surface)); touch-action: none; }
.watch-stage canvas { display: block; width: 100% !important; height: 100% !important; }
.watch-stage .spinner { position: absolute; left: 50%; top: 50%; margin: -21px 0 0 -21px; }
.watch-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 12px; color: var(--brand-muted); pointer-events: none; }
.watch-ui { padding: 16px 22px 0; }
.explode { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--brand-muted); }
.explode input { flex: 1; accent-color: var(--track); }
.parts { display: flex; gap: 8px; overflow-x: auto; margin: 14px -22px 0; padding: 0 22px 4px; scrollbar-width: none; }
.parts::-webkit-scrollbar { display: none; }
.parts button { flex: none; padding: 8px 13px; border-radius: 999px; font-size: 13px; background: rgba(255,255,255,.05);
                border: 1px solid var(--line); transition: all .2s; }
.parts button.on { background: var(--track); color: var(--brand-accent-text); border-color: transparent; }
.part-info { margin-top: 14px; min-height: 84px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.04);
             border: 1px solid var(--line); }
.part-info strong { display: block; font-family: var(--font-title); font-weight: 400; font-size: 19px; color: var(--track); margin-bottom: 4px; }
.part-info p { margin: 0; color: var(--brand-muted); font-size: 14px; line-height: 1.5; }

/* À propos */
.about-cover { margin: 0 -20px 24px; aspect-ratio: 16 / 9; background-size: cover; background-position: center; position: relative; }
.about-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, var(--brand-bg)); }
.credits { margin-top: 32px; font-size: 11px; color: #6d6962; line-height: 1.6; }

/* Toast */
#toast { position: fixed; z-index: 120; left: 50%; top: calc(var(--topbar-h) + 6px); transform: translate(-50%, -20px);
         padding: 12px 20px; border-radius: 999px; background: var(--brand-accent); color: var(--brand-accent-text);
         font-weight: 600; font-size: 14px; opacity: 0; transition: opacity .3s, transform .4s var(--ease-out);
         pointer-events: none; white-space: nowrap; box-shadow: 0 10px 30px -8px var(--brand-accent); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; }
}

/* ---------- Scénario AR (bulles, point d'interaction, panneau montre) ---------- */
.ar-layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0; transition: opacity .3s; }
.ar-layer.on { opacity: 1; }
body:not([data-tab="scan"]) .ar-layer { display: none; }
.ar-layer button { pointer-events: auto; }

.ar-sound { position: absolute; top: calc(var(--topbar-h) + 8px); right: 16px; width: 40px; height: 40px; border-radius: 50%;
            background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
            border: 1px solid var(--line); font-size: 18px; display: grid; place-items: center; }

.ar-bubble { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.ar-bubble-dot { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%;
                 background: var(--brand-accent); box-shadow: 0 0 0 4px rgba(201,164,92,.3), 0 0 18px var(--brand-accent);
                 transform: scale(0); transition: transform .35s var(--ease-out); }
.ar-bubble-box { position: absolute; left: -24px; bottom: 22px; width: max-content; max-width: min(210px, 58vw);
                 padding: 10px 13px; border-radius: 16px 16px 16px 4px; background: rgba(13,13,15,.86);
                 backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(201,164,92,.5);
                 color: var(--brand-text); font-size: 14px; line-height: 1.45; box-shadow: 0 12px 30px rgba(0,0,0,.4);
                 opacity: 0; transform: translateY(8px) scale(.94); transform-origin: 24px 100%;
                 transition: opacity .35s, transform .45s var(--ease-out); }
.ar-bubble.left .ar-bubble-box { left: auto; right: -24px; border-radius: 16px 16px 4px 16px; transform-origin: calc(100% - 24px) 100%; }
.ar-bubble.show .ar-bubble-dot { transform: scale(1); }
.ar-bubble.show .ar-bubble-box { opacity: 1; transform: none; }

.ar-hotspot { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; opacity: 0;
              transition: opacity .3s; pointer-events: none !important; }
.ar-hotspot.show { opacity: 1; pointer-events: auto !important; }
.ar-hotspot-ring { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%;
                   border: 2px solid var(--brand-accent); background: rgba(201,164,92,.18); }
.ar-hotspot-ring::before, .ar-hotspot-ring::after { content: ""; position: absolute; inset: -2px; border-radius: 50%;
                   border: 2px solid var(--brand-accent); animation: ring 1.8s ease-out infinite; }
.ar-hotspot-ring::after { animation-delay: .9s; }
@keyframes ring { from { transform: scale(1); opacity: .9 } to { transform: scale(2.1); opacity: 0 } }
.ar-hotspot-label { position: absolute; left: 50%; top: 38px; transform: translateX(-50%); white-space: nowrap;
                    padding: 9px 15px; border-radius: 999px; background: var(--brand-accent); color: var(--brand-accent-text);
                    font-weight: 600; font-size: 13px; box-shadow: 0 8px 24px -6px var(--brand-accent); }

.ar-panel { position: absolute; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px); max-width: 560px; margin: 0 auto;
            padding: 14px; border-radius: 20px; background: rgba(13,13,15,.86); backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); pointer-events: auto;
            transform: translateY(30px); opacity: 0; visibility: hidden; transition: all .45s var(--ease-out); }
.ar-panel.show { transform: none; opacity: 1; visibility: visible; }
.ar-panel-info strong { display: block; font-family: var(--font-title); font-weight: 400; font-size: 19px; color: var(--brand-accent); }
.ar-panel-info p { margin: 4px 0 0; color: var(--brand-muted); font-size: 13px; line-height: 1.45; min-height: 38px; }
.ar-parts { display: flex; gap: 7px; overflow-x: auto; margin: 12px -14px 0; padding: 0 14px 2px; scrollbar-width: none; }
.ar-parts::-webkit-scrollbar { display: none; }
.ar-parts button { flex: none; padding: 7px 12px; border-radius: 999px; font-size: 12px; background: rgba(255,255,255,.06);
                   border: 1px solid var(--line); transition: all .2s; }
.ar-parts button.on { background: var(--brand-accent); color: var(--brand-accent-text); border-color: transparent; }
.ar-actions { display: flex; gap: 8px; margin-top: 12px; }
.ar-actions button { flex: 1; padding: 10px; border-radius: 12px; font-size: 13px; text-align: center;
                     border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.ar-actions .ar-sheet { background: var(--brand-accent); color: var(--brand-accent-text); border-color: transparent; font-weight: 600; }
/* Pendant le scénario, le viseur s'efface */
body[data-state="found"] #scan { opacity: 0; }

/* ---------- Essayage au poignet (VTO) ---------- */
#vto { position: fixed; inset: 0; z-index: 200; background: #000; opacity: 0; transition: opacity .3s; overflow: hidden; }
#vto.on { opacity: 1; }
#vto video, #vto canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#vto video { object-fit: cover; }
#vto.mirror video { transform: scaleX(-1); }
#vto.flash::after { content: ""; position: absolute; inset: 0; background: #fff; animation: flash .3s ease-out forwards; }
@keyframes flash { from { opacity: .8 } to { opacity: 0 } }
.vto-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
           padding: calc(env(safe-area-inset-top) + 12px) 14px 12px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.vto-top button { width: 42px; height: 42px; border-radius: 50%; background: rgba(13,13,15,.6); border: 1px solid var(--line);
                  font-size: 18px; color: var(--brand-text); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.vto-title { font-family: var(--font-title); font-size: 17px; color: var(--brand-text); }
.vto-hint { position: absolute; left: 50%; top: 42%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
            padding: 12px 18px; border-radius: 999px; background: rgba(13,13,15,.72); border: 1px solid rgba(201,164,92,.4);
            backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--brand-text); font-size: 14px;
            white-space: nowrap; transition: opacity .3s; }
.vto-hint.hidden { opacity: 0; pointer-events: none; }
.vto-spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2);
               border-top-color: var(--brand-accent); animation: spin 0.9s linear infinite; }
.vto-hint.spin .vto-spinner { display: block; }
.vto-picto { display: none; width: 30px; height: 48px; flex: none; }
.vto-hint.picto .vto-picto { display: block; }
.vto-picto path { fill: rgba(255,255,255,.12); stroke: #fff; stroke-width: .09; stroke-linejoin: round; }
.vto-picto circle { fill: var(--brand-accent, #c9a45c); stroke: #fff; stroke-width: .06; }
@keyframes spin { to { transform: rotate(360deg) } }
.vto-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 16px;
              padding: 24px 0 calc(env(safe-area-inset-bottom) + 22px); background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.vto-straps { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; padding: 0 16px; scrollbar-width: none; }
.vto-straps::-webkit-scrollbar { display: none; }
.vto-straps button { flex: none; display: flex; align-items: center; gap: 7px; padding: 7px 13px 7px 8px; border-radius: 999px;
                     background: rgba(13,13,15,.6); border: 1px solid var(--line); color: var(--brand-text); font-size: 12px;
                     backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.vto-straps button i { width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 1px solid rgba(255,255,255,.3); }
.vto-straps button.on { border-color: var(--brand-accent); box-shadow: 0 0 0 1px var(--brand-accent) inset; }
.vto-shot { width: 68px; height: 68px; border-radius: 50%; background: #fff; border: 5px solid rgba(255,255,255,.35);
            background-clip: padding-box; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.vto-shot:active { transform: scale(.92); }
.btn-vto { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; padding: 13px;
           border-radius: 14px; border: 1px solid var(--brand-accent); color: var(--brand-accent); background: rgba(201,164,92,.08);
           font-weight: 600; font-size: 14px; }

/* ---------- Suivi étendu / mode détaché ---------- */
body.ar-active #scan { opacity: 0 !important; pointer-events: none; }
.ar-recal { position: absolute; left: 50%; top: calc(var(--topbar-h) + 14px); transform: translate(-50%, -8px); opacity: 0;
            padding: 8px 14px; border-radius: 999px; background: rgba(13,13,15,.75); border: 1px solid var(--line);
            font-size: 12px; color: var(--brand-muted); white-space: nowrap; transition: all .3s; }
.ar-recal.show { opacity: 1; transform: translate(-50%, 0); }
.ar-panel { position: absolute; }
.ar-detach { position: absolute; top: 12px; right: 12px; padding: 6px 11px; border-radius: 999px; font-size: 12px;
             background: rgba(201,164,92,.12); border: 1px solid rgba(201,164,92,.45); color: var(--brand-accent); }
.ar-panel-info { padding-right: 150px; }
.ar-layer.detached .ar-bubble, .ar-layer.detached .ar-hotspot { opacity: 0 !important; }

/* VTO : mode photo (image figée, ajustement au doigt) */
#vto canvas { touch-action: none; }
.vto-frozen { display: none; gap: 10px; }
#vto.frozen .vto-frozen { display: flex; }
#vto.frozen .vto-live, #vto.frozen .vto-straps { display: none; }
.vto-frozen button { padding: 13px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; color: var(--brand-text);
                     background: rgba(13,13,15,.7); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.vto-frozen .vto-share { background: var(--brand-accent); color: var(--brand-accent-text); border-color: transparent; }

/* VTO : gabarit "placez votre main ici" */
.vto-guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .3s; }
.vto-guide path, .vto-guide circle { fill: rgba(255,255,255,.07); stroke: rgba(255,255,255,.85); stroke-width: 2;
  stroke-dasharray: 7 6; vector-effect: non-scaling-stroke; transition: stroke .3s, fill .3s; }
.vto-guide circle { fill: none; stroke: rgba(201,164,92,.8); stroke-dasharray: 3 5; }
#vto.aligned .vto-guide path { stroke: var(--brand-accent); stroke-dasharray: none; fill: rgba(201,164,92,.06); }
#vto.aligned .vto-guide circle { opacity: 0; }
#vto.frozen .vto-guide, #vto.aligned .vto-guide { opacity: 0; }  /* suivi libre : le gabarit s'efface dès que la main est trouvée */
#vto canvas { transition: opacity .3s; }
#vto:not(.aligned):not(.frozen) canvas { opacity: .5; }
#vto .vto-hint { top: auto; bottom: calc(env(safe-area-inset-bottom) + 190px); }
.vto-hand { padding: 7px 14px; border-radius: 999px; font-size: 12px; color: var(--brand-text);
            background: rgba(13,13,15,.6); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#vto.frozen .vto-hand { display: none; }

/* VTO : la 3D prend le léger flou de la caméra pour ne pas "décoller" de la vidéo */
#vto canvas { filter: blur(0.35px) saturate(0.94); }

/* ---------- Prototype wagon (assets/ui/wagon.js) ---------- */
.wg-spots { position: absolute; inset: 0; pointer-events: none; }
.wg-spot.small .ar-hotspot-ring { transform: scale(.72); }
.wg-spot.small .ar-hotspot-label { top: 30px; padding: 7px 12px; font-size: 12px; }
.wg-banner { position: absolute; left: 50%; top: calc(var(--topbar-h) + 60px); transform: translate(-50%, -8px);
             width: max-content; max-width: min(88vw, 420px); padding: 10px 16px; border-radius: 14px;
             background: rgba(13,13,15,.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
             border: 1px solid rgba(201,164,92,.35); color: var(--brand-text); font-size: 14px; line-height: 1.4;
             text-align: center; opacity: 0; transition: opacity .35s, transform .35s var(--ease-out); }
.wg-banner.show { opacity: 1; transform: translate(-50%, 0); }
.wg-banner b { display: block; color: var(--brand-accent); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.wg-banner b:empty { display: none; }
.wg-card { position: absolute; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 80px); max-width: 520px; margin: 0 auto;
           padding: 14px 16px; border-radius: 16px; background: rgba(13,13,15,.88); backdrop-filter: blur(12px);
           -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(201,164,92,.4); color: var(--brand-text);
           opacity: 0; transform: translateY(12px); transition: opacity .3s, transform .4s var(--ease-out); }
.wg-card.show { opacity: 1; transform: none; }
.wg-card strong { display: block; color: var(--brand-accent); font-size: 15px; margin-bottom: 4px; }
.wg-card p { margin: 0; font-size: 14px; line-height: 1.45; }
.wg-nav { position: absolute; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 14px); display: flex; gap: 10px;
          justify-content: center; opacity: 0; transition: opacity .3s; }
.wg-nav.show { opacity: 1; }
.wg-nav:not(.show) button { pointer-events: none !important; }
.wg-nav button { height: 48px; padding: 0 18px; border-radius: 24px; border: 1px solid rgba(201,164,92,.55);
                 background: rgba(13,13,15,.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
                 color: var(--brand-text); font: inherit; font-size: 14px; font-weight: 600; }
.wg-nav .wg-prev, .wg-nav .wg-next { width: 48px; padding: 0; font-size: 16px; }
.wg-nav button:disabled { opacity: .3; }
.wg-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0;
            background: radial-gradient(circle at 50% 45%, rgba(255,236,200,.35) 0%, rgba(18,12,6,.95) 70%); }
.wg-flash.go { animation: wgFlash .9s ease-out; }
@keyframes wgFlash { from { opacity: 1 } to { opacity: 0 } }

/* ---------- POC locomotive-portail (assets/ui/loco.js) ---------- */
.lc-turn { position: absolute; left: 50%; bottom: calc(var(--tabbar-h) + 84px); transform: translate(-50%, 8px); opacity: 0;
           padding: 10px 16px; border-radius: 999px; background: var(--brand-accent); color: var(--brand-accent-text);
           font-size: 14px; font-weight: 600; white-space: nowrap; transition: opacity .3s, transform .3s var(--ease-out);
           box-shadow: 0 8px 24px -6px var(--brand-accent); }
.lc-turn.show { opacity: 1; transform: translate(-50%, 0); animation: lcNudge 1.4s ease-in-out infinite; }
@keyframes lcNudge { 50% { transform: translate(-50%, -4px) } }
.lc-watch { position: absolute; left: 50%; top: 50%; width: min(86vw, 360px); display: flex; flex-direction: column; align-items: center; gap: 10px;
            transform: translate(calc(-50% + var(--ox, 0px)), calc(-50% + var(--oy, 0px))) scale(.08); opacity: 0;
            transition: transform .7s var(--ease-out), opacity .4s; pointer-events: none; }
.lc-watch.show { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.lc-watch-text { padding: 12px 16px; border-radius: 16px; background: rgba(13,13,15,.86); border: 1px solid rgba(201,164,92,.45);
                 backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--brand-text); text-align: center; }
.lc-watch-text b { display: block; color: var(--brand-accent); font-size: 15px; margin-bottom: 4px; }
.lc-watch-text p { margin: 0; font-size: 13.5px; line-height: 1.45; }
.lc-dial { width: min(72vw, 290px); touch-action: none; cursor: grab; filter: drop-shadow(0 18px 30px rgba(0,0,0,.55)); }
.lc-dial svg { display: block; width: 100%; height: auto; }
.lc-dial text { user-select: none; }
.lc-time { display: flex; gap: 10px; align-items: center; padding: 8px 16px; border-radius: 999px; background: rgba(13,13,15,.8);
           color: var(--brand-text); font: 600 18px/1 Georgia, serif; font-variant-numeric: tabular-nums; }
.lc-time i { font-style: normal; color: var(--brand-accent); }
.lc-goal { color: var(--brand-accent); }
.lc-watch.ok .lc-now { color: #7fd28f; }
.lc-watch.ok .lc-glint { animation: lcGlint 1.1s ease-out; }
@keyframes lcGlint { 0% { opacity: .9; stroke-width: 2 } 100% { opacity: 0; stroke-width: 26 } }
.lc-steam { position: absolute; inset: 0; pointer-events: none; opacity: 0;
            background: radial-gradient(circle at 50% 55%, rgba(255,250,240,.96) 0%, rgba(240,236,228,.9) 45%, rgba(200,196,190,.6) 100%); }
.lc-steam.go { animation: lcSteam 1.6s ease-in-out; }
@keyframes lcSteam { 0% { opacity: 0 } 30% { opacity: 1 } 55% { opacity: .9 } 100% { opacity: 0 } }

/* ---------- POC horloger : points clés, visite guidée, finale (assets/ui/scenario.js) ---------- */
.ar-bullets { position: absolute; left: 14px; right: 14px; top: calc(var(--topbar-h) + 58px); max-width: 440px; margin: 0 auto;
              padding: 14px 16px 6px; border-radius: 18px; background: rgba(13,13,15,.8); border: 1px solid rgba(201,164,92,.4);
              backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--brand-text);
              opacity: 0; transform: translateY(-10px); transition: opacity .4s, transform .5s var(--ease-out); }
.ar-bullets.show { opacity: 1; transform: none; }
.ar-bullets b { display: block; color: var(--brand-accent); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 6px; }
.ar-bullets b:empty { display: none; }
.ar-bullets ul { list-style: none; margin: 0; padding: 0; }
.ar-bullets li { position: relative; padding: 0 0 9px 26px; font-size: 14.5px; line-height: 1.4; max-height: 0; overflow: hidden;
                 opacity: 0; transform: translateX(-12px); transition: opacity .45s, transform .55s var(--ease-out), max-height .5s; }
.ar-bullets li.show { opacity: 1; transform: none; max-height: 80px; }
.ar-bullets li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%;
                         background: var(--brand-accent); box-shadow: 0 0 10px var(--brand-accent); }
.ar-tour { display: none; align-items: center; justify-content: space-between; margin-top: 12px; }
.ar-panel.touring .ar-tour { display: flex; }
.ar-panel.touring .ar-parts, .ar-panel.touring .ar-actions, .ar-panel.touring .ar-detach { display: none; }
.ar-tour-step { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-muted); }
.ar-next { padding: 10px 18px; border-radius: 999px; background: var(--brand-accent); color: var(--brand-accent-text);
           border: 0; font: inherit; font-size: 13px; font-weight: 600; }
.ar-panel.invite .ar-actions .ar-vto { background: var(--brand-accent); color: var(--brand-accent-text); border-color: transparent;
                                        font-weight: 700; animation: arPulse 1.6s ease-in-out infinite; }
.ar-panel.finale .ar-actions .ar-sheet { background: rgba(255,255,255,.06); color: var(--brand-text); border-color: var(--line); font-weight: 400; }
@keyframes arPulse { 50% { box-shadow: 0 0 0 6px rgba(201,164,92,.25) } }
/* Sous-titre façon citation (récit en chapitres) */
.ar-bullets.quote li { padding-left: 0; font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-size: 16px; line-height: 1.5; max-height: 220px; }
.ar-bullets.quote li::before { display: none; }

/* Bulles ancrées sur le portrait : intitulé du temps fort */
.ar-bubble-box b { display: block; margin-bottom: 4px; color: var(--brand-accent); font-family: Inter, system-ui, sans-serif; font-style: normal;
                   font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.ar-bubble-box { font-family: Georgia, 'Times New Roman', serif; font-size: 15px; }

/* Nom de la pièce touchée, au-dessus d'elle (exploration du mécanisme) */
.ar-partname { position: absolute; left: 0; top: 0; padding: 7px 14px; border-radius: 999px; background: rgba(13,13,15,.72);
  border: 1px solid var(--brand-accent); color: var(--brand-text); font: 600 13px/1.2 Georgia, serif; letter-spacing: .1em;
  text-transform: uppercase; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .35s; will-change: transform;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ar-partname.show { opacity: 1; }

/* « Assembler la montre » : mis en avant une fois les pièces découvertes */
.ar-next.ready { background: var(--brand-accent); color: var(--brand-accent-text); border-color: transparent;
  box-shadow: 0 0 0 0 rgba(201,164,92,.6); animation: nextReady 1.6s ease-out infinite; }
@keyframes nextReady { from { box-shadow: 0 0 0 0 rgba(201,164,92,.6) } to { box-shadow: 0 0 0 14px rgba(201,164,92,0) } }

/* Repères à toucher sur les pièces de la montre éclatée */
.ar-pins { position: absolute; inset: 0; pointer-events: none; transition: opacity .3s; }
.ar-pins.hide { opacity: 0; }
.ar-pins.hide .ar-pin { pointer-events: none; }
.ar-pin { position: absolute; left: 0; top: 0; width: 56px; height: 56px; margin: -28px 0 0 -28px; padding: 0;
  border: 0; background: none; pointer-events: auto; -webkit-tap-highlight-color: transparent; }
.ar-pin-dot { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: #f3d48a; border: 2px solid #fff; box-shadow: 0 0 12px rgba(243,212,138,.9); }
.ar-pin-dot::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid rgba(243,212,138,.9);
  animation: pinPulse 1.6s ease-out infinite; }
@keyframes pinPulse { from { transform: scale(.6); opacity: 1 } to { transform: scale(1.9); opacity: 0 } }
.ar-pin-label { position: absolute; left: 50%; top: 50%; transform: translate(16px, -50%); white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; background: rgba(13,13,15,.72); color: #f3d48a; border: 1px solid rgba(243,212,138,.6);
  font: 600 11px/1.2 Georgia, serif; letter-spacing: .06em; text-transform: uppercase; }
.ar-pin.done { pointer-events: none; }
.ar-pin.done .ar-pin-dot { background: rgba(243,212,138,.35); box-shadow: none; }
.ar-pin.done .ar-pin-dot::after { animation: none; opacity: 0; }
.ar-pin.done .ar-pin-label { opacity: .55; }

/* Essayage : plus de gabarit, la montre apparaît dès que le dos du poignet est face à la caméra */
#vto .vto-guide { display: none; }

/* Sous-titres de la voix off */
.ar-subs { position: absolute; left: 50%; bottom: calc(var(--tabbar-h, 68px) + 14px);  /* au-dessus de la barre d'onglets */ transform: translateX(-50%);
  width: max-content; max-width: min(90vw, 520px); padding: 7px 14px; border-radius: 10px; text-align: center;
  background: rgba(0,0,0,.58); color: #fff; font: 500 15px/1.35 -apple-system, system-ui, sans-serif;
  text-shadow: 0 1px 2px rgba(0,0,0,.6); opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 5; }
.ar-subs.show { opacity: 1; }

/* ---------- Page d'un totem (QR code dédié, ?t=…) : présentation, puis l'expérience seule ---------- */
body.solo { --tabbar-h: calc(14px + var(--safe-bottom)); }
body.solo #tabbar, body.solo .progress, body.solo #view-hub, body.solo #view-about { display: none; }
body[data-tab="totem"] #view-totem { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
/* Une affiche plein écran : le visuel, le titre, une phrase, la caméra, un bouton. Pas de défilement. */
#view-totem { padding: 0; overflow: hidden; }
#view-totem .view-inner { max-width: none; height: 100%; position: relative; display: flex; flex-direction: column; justify-content: flex-end; }
.tp-cover { position: absolute; inset: 0; background-size: cover; background-position: center 18%; animation: tp-in 1.4s var(--ease-out) both; }
.tp-cover::after { content: ""; position: absolute; inset: 0;
                   background: linear-gradient(rgba(13,13,15,.5), rgba(13,13,15,0) 22%, rgba(13,13,15,0) 34%, rgba(13,13,15,.86) 62%, var(--brand-bg) 82%); }
@keyframes tp-in { from { opacity: 0; transform: scale(1.04); } }
.tp-body { position: relative; width: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column;
           padding: 0 clamp(20px, 6vw, 32px) calc(20px + var(--safe-bottom)); }
.tp-body .eyebrow { font-size: 13px; letter-spacing: .04em; text-transform: none; font-weight: 500; color: var(--brand-accent); }
.tp-body .view-title { font-size: clamp(32px, 9.2vw, 46px); line-height: 1.04; letter-spacing: -.03em; margin: 8px 0 12px; text-wrap: balance; }
.tp-lead { margin: 0 0 22px; font-size: clamp(16px, 4.4vw, 18px); line-height: 1.45; color: var(--brand-text); opacity: .8; }
.tp-perm { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; margin: 0 0 16px;
           border-top: 1px solid rgba(255,255,255,.14); border-bottom: 1px solid rgba(255,255,255,.14); }
.tp-perm span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tp-perm b { font-size: 15px; font-weight: 600; }
.tp-perm small { font-size: 13px; line-height: 1.4; color: var(--brand-muted); }
.tp-perm small.err { color: #ff8a7a; }
.switch { flex: none; position: relative; width: 52px; height: 32px; border-radius: 16px; background: #3a3a3e; transition: background .25s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
                 transition: transform .25s var(--ease-out); }
.switch[aria-checked="true"] { background: var(--brand-accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch.busy { opacity: .6; }
.switch:disabled { opacity: .35; }
.tp-body .btn { width: 100%; justify-content: center; padding: 17px 34px; font-size: 16px; }
.tp-note { margin-top: 12px; text-align: center; color: var(--brand-muted); font-size: 13px; }
@media (max-height: 560px) { .tp-lead { display: none; } .tp-body .view-title { font-size: 28px; } }
.tb-close { display: none; margin-left: auto; width: 38px; height: 38px; border-radius: 50%; place-items: center;
            background: var(--glass); border: 1px solid var(--line); color: var(--brand-text);
            backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tb-close svg { width: 18px; height: 18px; }
body.solo[data-tab="scan"] .tb-close { display: grid; }
body.solo[data-tab="totem"] #topbar { background: none; }

/* ---------- Interface allégée du portrait : à la fin, seul le bouton d'essayage ---------- */
.ar-panel.lite { pointer-events: none; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; }
.ar-panel.lite > :not(.ar-actions), .ar-panel.lite .ar-actions > :not(.ar-vto) { display: none !important; }
.ar-panel.lite .ar-actions { justify-content: center; margin: 0; }
.ar-panel.lite .ar-vto { pointer-events: auto; flex: none; padding: 15px 30px; border-radius: 999px; font-size: 15px; font-weight: 600;
                         background: var(--brand-accent); color: var(--brand-accent-text); border-color: transparent;
                         box-shadow: 0 10px 30px -8px var(--brand-accent); animation: pulse-btn 2.4s ease-in-out infinite; }
@keyframes pulse-btn { 50% { transform: scale(1.04); } }

/* Encart « Design temporaire » (maquette) */
.draft-note { display: flex; flex-direction: column; gap: 4px; margin: 28px 0 8px; padding: 12px 14px; border-radius: 14px;
              border: 1px dashed rgba(201,164,92,.55); background: repeating-linear-gradient(-45deg, rgba(201,164,92,.07) 0 10px, transparent 10px 20px);
              font-size: 12px; line-height: 1.45; color: var(--brand-muted); }
.draft-note b { font-size: 12px; font-weight: 600; color: var(--brand-accent); }

/* Écran de transition de fin du wagon (« Étape 01 — La précision suisse ») */
.lc-end { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
          padding: 32px; text-align: center; background: #000; opacity: 0; visibility: hidden; pointer-events: none;
          transition: opacity 1.4s ease .2s, visibility 1.6s; }
.lc-end.show { opacity: 1; visibility: visible; }
.lc-end small { font-size: 12px; letter-spacing: .4em; text-transform: uppercase; color: var(--brand-accent); }
.lc-end span { width: 48px; height: 1px; background: var(--brand-accent); }
.lc-end h2 { margin: 0; font-family: var(--font-title); font-weight: 400; font-size: 34px; letter-spacing: .12em; text-transform: uppercase; }
.lc-end p { margin: 10px 0 0; max-width: 300px; font-family: var(--font-title); font-size: 17px; line-height: 1.55; color: var(--brand-muted); }
.lc-end.show small, .lc-end.show h2, .lc-end.show p { animation: lc-end-in 1.6s var(--ease-out) both; }
.lc-end.show h2 { animation-delay: .5s; } .lc-end.show p { animation-delay: 1.1s; }
@keyframes lc-end-in { from { opacity: 0; transform: translateY(10px); } }

/* Filigrane « prototype », présent sur tous les écrans */
#watermark { position: fixed; z-index: 200; top: calc(var(--safe-top) + 19px); left: 54px; pointer-events: none;
             font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.62);
             text-shadow: 0 1px 6px rgba(0,0,0,.7); white-space: nowrap; }
#scan-loading.denied .spinner { display: none; }
#scan-loading.denied .tagline { max-width: 300px; text-align: center; line-height: 1.5; }

/* Écrans intermédiaires (pause, chargement, refus caméra, ordinateur) : même composition */
.screen-title { font-family: var(--font-title); font-weight: 600; font-size: 24px; letter-spacing: -.02em; margin: 0; text-align: center; }
.screen .tagline, .scan-overlay .tagline { text-align: center; font-size: 16px; }
.screen .logo, .scan-overlay .logo { width: 64px; height: 64px; }
#scan-loading .denied-only { display: none; }
#scan-loading.denied .denied-only { display: block; }
#scan-loading.denied .btn.denied-only { display: inline-flex; }
/* Modèles 3D encore en cours de chargement : on attend avant de montrer le scanner */
body.preloading[data-tab="scan"]:not([data-state="loading"]):not(.desktop) #scan-preload { display: flex; }
body.preloading[data-tab="scan"] #scan { opacity: 0 !important; }

.tp-credit { font-size: 10px; opacity: .6; }
.tp-credit a { color: inherit; text-decoration: underline; }
