:root {
  --bg: #0f1011;
  --bg-2: #141516;
  --ink: #e6e0d2;
  --ink-2: rgba(230, 224, 210, .66);
  --ink-3: rgba(230, 224, 210, .40);
  --ink-4: rgba(230, 224, 210, .14);
  --water: #9fbccb;
  --ochre: #c8a464;
  --display: 'Instrument Serif', 'Times New Roman', serif;
  --body: 'Switzer', 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; }
body { font-family: var(--body); font-weight: 400; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible, input:focus-visible, label:focus-within { outline: 1px solid var(--ochre); outline-offset: 3px; }
#map { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#map.drag { cursor: grabbing; }

.kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.kicker.mt { margin-top: 28px; }
.fine { font-size: 12px; color: var(--ink-3); margin: 18px 0 0; max-width: 46ch; }
.fine.credit { margin-top: 8px; }
.row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 26px; }
.row.center { justify-content: center; }
.primary { border: 1px solid var(--ink-2); padding: 10px 20px; border-radius: 999px; font-size: 14px; letter-spacing: .02em; transition: background .4s var(--ease), color .4s var(--ease); }
.primary:hover { background: var(--ink); color: var(--bg); }
.primary.small { padding: 7px 16px; font-size: 13px; }
.quiet { font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--ink-4); padding-bottom: 2px; transition: color .3s, border-color .3s; }
.quiet:hover { color: var(--ink); border-color: var(--ink-2); }
.file { cursor: pointer; position: relative; }
.file input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }

/* marque */
.brand { position: fixed; top: 22px; left: 26px; display: flex; gap: 12px; align-items: center; z-index: 5; pointer-events: none; }
.logo { width: 34px; height: 34px; color: var(--ink); }
.brand-title { font-family: var(--display); font-size: 24px; line-height: 1; letter-spacing: .02em; }
.brand-sub { font-size: 12px; color: var(--ink-3); letter-spacing: .04em; margin-top: 3px; }

.tools { position: fixed; top: 26px; right: 26px; display: flex; gap: 20px; z-index: 6; opacity: 0; pointer-events: none; transition: opacity 1.2s var(--ease); }
.tools button { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); transition: color .3s; }
.tools button:hover, .tools button.on { color: var(--ink); }
body[data-phase="explore"] .tools, body[data-phase="intro"] .tools { opacity: 1; pointer-events: auto; }
body[data-phase="intro"] .tools [data-act="labels"], body[data-phase="intro"] .tools [data-act="carte"] { display: none; }

/* sections plein écran */
#intro, #quest, #bascule, #slider, #reading, #history, #walk { transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
#intro { position: fixed; left: 26px; bottom: 34px; max-width: 520px; z-index: 4; padding: 30px 0 0; text-shadow: 0 0 18px #0f1011, 0 0 4px #0f1011; }
#intro h1 { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 3vw, 40px); line-height: 1.08; margin: 0; letter-spacing: -.005em; }
.lede { color: var(--ink-2); max-width: 52ch; margin: 18px 0 0; }
body:not([data-phase="intro"]) #intro { opacity: 0; transform: translateY(12px); pointer-events: none; }

#quest { position: fixed; left: 50%; bottom: 7vh; transform: translateX(-50%); width: min(760px, calc(100% - 40px)); z-index: 4; text-align: center; }
body:not([data-phase="quest"]):not([data-phase="return"]) #quest { opacity: 0; pointer-events: none; transform: translate(-50%, 14px); }
.q-progress { display: flex; gap: 6px; justify-content: center; margin-bottom: 22px; }
.q-progress i { width: 18px; height: 1px; background: var(--ink-4); display: block; transition: background .6s; }
.q-progress i.done { background: var(--ink-2); }
.q-progress i.now { background: var(--ochre); }
.q-text { font-family: var(--display); font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15; margin: 0 auto; max-width: 30ch; text-wrap: balance; }
.q-hint { color: var(--ink-3); font-size: 13px; margin: 10px 0 0; min-height: 1em; }
.q-body { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; }
.opt { padding: 8px 16px; border: 1px solid var(--ink-4); border-radius: 999px; font-size: 14px; color: var(--ink-2); transition: all .35s var(--ease); background: rgba(15,16,17,.6); }
.opt:hover { color: var(--ink); border-color: var(--ink-3); }
.opt.on { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.chips { max-width: 720px; }
.chips .opt { font-size: 13px; padding: 6px 13px; }
.rive { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: center; text-align: left; min-width: min(460px, 100%); }
.rive .nm { font-size: 15px; }
.rive .seg { display: flex; gap: 6px; }
.rive .seg .opt { font-size: 12px; padding: 5px 11px; }
.time { width: min(460px, 100%); }
.time output { font-family: var(--display); font-size: 40px; display: block; line-height: 1; margin-bottom: 8px; }
.time .scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.rose { position: relative; width: 200px; height: 200px; margin: 0 auto; }
.rose .opt { position: absolute; transform: translate(-50%, -50%); padding: 5px 10px; font-size: 12px; }
.rose::before { content: ''; position: absolute; inset: 40px; border: 1px solid var(--ink-4); border-radius: 50%; }
.rose .ctr { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 12px; color: var(--ink-3); }
.q-cert { margin-top: 18px; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.q-cert[hidden] { display: none; }
.q-cert button { padding: 5px 12px; border: 1px solid var(--ink-4); border-radius: 999px; color: var(--ink-2); font-size: 13px; transition: all .3s; }
.q-cert button:hover { color: var(--bg); background: var(--ink); }
.q-foot { margin-top: 22px; display: flex; justify-content: center; gap: 26px; align-items: center; }

#bascule { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 4; text-align: center; padding: 20px; }
body:not([data-phase="bascule"]) #bascule { opacity: 0; pointer-events: none; }
.b-text { text-shadow: 0 0 24px #0f1011; font-family: var(--display); font-size: clamp(30px, 4vw, 54px); line-height: 1.08; max-width: 18ch; margin: 0; text-wrap: balance; }

/* curseur */
#slider { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); width: min(620px, calc(100% - 40px)); z-index: 4; text-align: center; }
body:not([data-phase="explore"]):not([data-phase="reveal"]) #slider { opacity: 0; pointer-events: none; transform: translate(-50%, 12px); }
body.has-panel #slider { left: calc(50% - 190px); }
.s-row { display: flex; align-items: center; gap: 16px; }
.s-end { font-size: 11px; letter-spacing: .16em; color: var(--ink-2); white-space: nowrap; }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 24px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(90deg, var(--ink-3), var(--ochre)); }
input[type=range]::-moz-range-track { height: 1px; background: linear-gradient(90deg, var(--ink-3), var(--ochre)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 1px solid var(--ink); margin-top: -6px; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 1px solid var(--ink); }
.s-lect { display: flex; gap: 18px; justify-content: center; margin-top: 8px; }
.s-lect button { font-size: 12px; color: var(--ink-3); transition: color .3s; border-bottom: 1px solid transparent; padding-bottom: 1px; }
.s-lect button.on { color: var(--ink); border-color: var(--ink-3); }
.s-note { font-size: 12px; color: var(--ink-3); margin: 6px auto 0; max-width: 54ch; min-height: 18px; }

#history { position: fixed; left: 26px; bottom: 30px; z-index: 4; display: flex; flex-direction: column; gap: 6px; }
body:not([data-phase="explore"]) #history { opacity: 0; pointer-events: none; }
#history button { text-align: left; font-size: 11px; letter-spacing: .14em; color: var(--ink-3); transition: color .3s; }
#history button.on { color: var(--ink); }
#history button small { display: block; letter-spacing: .02em; font-size: 12px; color: var(--ink-3); text-transform: none; }
#history .cmp { margin-top: 8px; color: var(--ochre); letter-spacing: .06em; font-size: 12px; }

/* lecture */
#reading { position: fixed; right: 0; top: 0; bottom: 0; width: 380px; z-index: 4; padding: 84px 28px 28px; background: linear-gradient(90deg, rgba(15,16,17,0), rgba(15,16,17,.86) 14%, rgba(15,16,17,.94)); overflow-y: auto; scrollbar-width: thin; }
body:not([data-phase="explore"]) #reading { opacity: 0; pointer-events: none; transform: translateX(20px); }
#reading.closed { transform: translateX(340px); }
#reading.closed .r-inner { opacity: 0; pointer-events: none; }
.r-toggle { position: absolute; top: 80px; left: 2px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); writing-mode: vertical-rl; transform: rotate(180deg); }
.r-inner { padding-left: 14px; transition: opacity .6s; }
#obs p { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
#obs p b { color: var(--ink); font-weight: 500; }
.lis { display: block; width: 100%; text-align: left; padding: 14px 0; border-top: 1px solid var(--ink-4); transition: color .3s; }
.lis:hover .lis-t, .lis.on .lis-t { color: var(--ochre); }
.lis-n { font-size: 11px; letter-spacing: .14em; color: var(--ink-3); }
.lis-t { font-family: var(--display); font-size: 24px; line-height: 1.1; margin: 4px 0; transition: color .3s; }
.lis-d { font-size: 13px; color: var(--ink-3); }

/* invitation */
#walk { position: fixed; left: 26px; top: 96px; width: min(400px, calc(100% - 52px)); z-index: 5; background: rgba(15,16,17,.92); border-left: 1px solid var(--ochre); padding: 22px 24px; max-height: calc(100vh - 260px); overflow-y: auto; }
#walk:empty, body:not([data-phase="explore"]) #walk { opacity: 0; pointer-events: none; transform: translateX(-10px); }
#walk .inv { font-family: var(--display); font-size: 25px; line-height: 1.12; margin: 0 0 10px; }
#walk .meta { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 13px; color: var(--ink-2); margin: 14px 0; }
#walk .meta dt { color: var(--ink-3); }
#walk .meta dd { margin: 0; }
#walk ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
#walk li { margin-bottom: 4px; }
#walk .mission { margin-top: 14px; font-size: 14px; color: var(--ink); }
#walk .mission span { display: block; font-size: 11px; letter-spacing: .14em; color: var(--ochre); text-transform: uppercase; margin-bottom: 3px; }
#walk .row { margin-top: 18px; gap: 16px; }

/* surcouches */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(10,11,12,.86); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.overlay[hidden] { display: none; }
.ov-inner { position: relative; max-width: 720px; max-height: calc(100vh - 48px); overflow-y: auto; padding: 8px 6px 8px 0; }
.ov-inner.small { max-width: 480px; }
.ov-inner h2 { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.1; margin: 0 0 18px; }
.ov-inner h3 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; margin: 26px 0 10px; }
.ov-inner p, .ov-inner li, .ov-inner dd { color: var(--ink-2); font-size: 14px; }
.ov-inner b { color: var(--ink); font-weight: 500; }
.close { position: absolute; right: 0; top: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.four { display: grid; grid-template-columns: 150px 1fr; gap: 8px 18px; margin: 0; }
.four dt { font-family: var(--display); font-size: 20px; }
.four dd { margin: 0; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 8px; }
code { font-size: 12px; color: var(--ochre); }

#tip { position: fixed; z-index: 10; pointer-events: none; font-size: 12px; color: var(--ink); background: rgba(15,16,17,.92); border: 1px solid var(--ink-4); padding: 6px 10px; opacity: 0; transition: opacity .2s; max-width: 240px; }
#tip b { font-weight: 500; display: block; }
#tip span { color: var(--ink-3); }
#measure { position: fixed; z-index: 6; left: 50%; top: 26px; transform: translateX(-50%); font-size: 12px; color: var(--ink-2); letter-spacing: .03em; text-align: center; opacity: 0; transition: opacity .4s; pointer-events: none; }

@media (max-width: 820px) {
  :root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
  body { font-size: 15px; }
  .brand { top: calc(14px + var(--sat)); left: calc(16px + var(--sal)); }
  .brand-title { font-size: 21px; }
  .tools { top: calc(18px + var(--sat)); right: calc(16px + var(--sar)); gap: 16px; }
  .tools button { font-size: 13px; letter-spacing: .1em; }
  body[data-phase="explore"] .tools { top: calc(66px + var(--sat)); left: calc(16px + var(--sal)); right: auto; }
  #intro { left: calc(16px + var(--sal)); right: calc(16px + var(--sar)); bottom: calc(20px + var(--sab)); max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px - var(--sat)); overflow-y: auto; }
  #intro h1 { font-size: clamp(26px, 7.4vw, 34px); }
  .lede { font-size: 15px; }
  .fine { font-size: 13px; }
  #quest { bottom: calc(14px + var(--sab)); width: calc(100% - 28px); max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px - var(--sat) - var(--sab)); overflow-y: auto; }
  .q-text { font-size: clamp(23px, 6.6vw, 30px); }
  .q-hint { font-size: 14px; }
  .q-body { margin-top: 16px; }
  .opt { font-size: 15px; }
  .chips .opt { font-size: 14px; }
  .rive { min-width: 0; width: 100%; gap: 10px 12px; }
  .rive .seg .opt { font-size: 13px; }
  .q-cert, .q-cert button { font-size: 14px; }
  #reading { width: 100%; top: auto; height: 46vh; height: 46dvh; padding: 20px calc(18px + var(--sar)) calc(40px + var(--sab)) calc(18px + var(--sal)); background: rgba(15,16,17,.95); }
  body:not([data-phase="explore"]) #reading { transform: translateY(20px); }
  #reading.closed { transform: translateY(calc(46vh - 44px)); transform: translateY(calc(46dvh - 44px - var(--sab))); }
  .r-toggle { writing-mode: horizontal-tb; transform: none; top: 10px; left: calc(18px + var(--sal)); font-size: 12px; }
  .r-inner { padding-left: 0; padding-top: 18px; }
  #obs p { font-size: 15px; }
  .lis-d { font-size: 14px; }
  #slider { width: calc(100% - 28px); bottom: calc(20px + var(--sab)); }
  body.has-panel #slider { left: 50%; bottom: calc(46vh + 10px); bottom: calc(46dvh + 10px); }
  body.has-panel.panel-closed #slider { bottom: calc(54px + var(--sab)); }
  .s-end { font-size: 11px; letter-spacing: .1em; }
  .s-lect { gap: 20px; }
  .s-lect button { font-size: 14px; }
  .s-note { font-size: 13px; }
  #history { top: calc(102px + var(--sat)); bottom: auto; left: calc(16px + var(--sal)); right: calc(16px + var(--sar)); flex-direction: row; flex-wrap: wrap; gap: 4px 18px; }
  #history button { font-size: 12px; }
  #history button small { display: none; }
  #walk { top: calc(132px + var(--sat)); left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); width: auto; max-height: calc(100vh - 160px); max-height: calc(100dvh - 156px - var(--sat) - var(--sab)); }
  #walk .inv { font-size: 24px; }
  #walk ul, #walk .mission { font-size: 15px; }
  .overlay { padding: calc(20px + var(--sat)) calc(18px + var(--sar)) calc(20px + var(--sab)) calc(18px + var(--sal)); }
  .ov-inner h2 { font-size: 30px; }
  .ov-inner p, .ov-inner li, .ov-inner dd { font-size: 15px; }
  .four { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; } }

/* navigation : retour discret et indication de première utilisation */
#camReset { position: fixed; right: 26px; bottom: 30px; z-index: 5; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--ink-4); color: var(--ink-2); background: rgba(15,16,17,.7); opacity: 0; pointer-events: none; transition: opacity .6s var(--ease), color .3s, border-color .3s, right .9s var(--ease); }
#camReset svg { width: 18px; height: 18px; }
#camReset.show { opacity: 1; pointer-events: auto; }
#camReset.show.off { opacity: .35; }
#camReset:hover { color: var(--ink); border-color: var(--ink-3); opacity: 1; }
body.has-panel:not(.panel-closed) #camReset { right: 400px; }
@media (max-width: 820px) { #camReset, body.has-panel:not(.panel-closed) #camReset { right: calc(16px + var(--sar)); bottom: auto; top: calc(58px + var(--sat)); } }
#navHint { position: fixed; left: 50%; top: 74px; transform: translate(-50%, -6px); z-index: 6; font-size: 12px; letter-spacing: .04em; color: var(--ink-2); background: rgba(15,16,17,.82); padding: 7px 14px; border: 1px solid var(--ink-4); border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .9s var(--ease), transform .9s var(--ease); white-space: nowrap; }
#navHint.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 820px) { #navHint { top: calc(140px + var(--sat)); white-space: normal; text-align: center; width: calc(100% - 40px); font-size: 13px; } }

/* ---------- Téléphone en paysage (tactile, peu haut) — l'ordinateur n'est pas concerné ---------- */
@media (max-height: 520px) and (min-width: 560px) and (pointer: coarse) {
  :root { --pw: min(300px, 40vw); --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
  body { font-size: 14px; }
  .brand { top: calc(10px + var(--sat)); left: calc(16px + var(--sal)); gap: 10px; }
  .logo { width: 28px; height: 28px; }
  .brand-title { font-size: 20px; }
  .brand-sub { font-size: 12px; }
  .tools, body[data-phase="explore"] .tools { top: calc(14px + var(--sat)); right: calc(16px + var(--sar)); left: auto; gap: 18px; }
  .tools button { font-size: 12px; letter-spacing: .1em; }
  body[data-phase="intro"] .tools [data-act="labels"] { display: none; }
  #intro { left: calc(16px + var(--sal)); right: auto; top: calc(58px + var(--sat)); bottom: calc(10px + var(--sab)); width: min(46vw, 440px); max-width: none; max-height: none; padding: 0 8px 0 0; overflow-y: auto; }
  #intro h1 { font-size: 22px; }
  .lede { font-size: 14px; margin-top: 10px; }
  #intro .row { margin-top: 14px; gap: 14px; }
  #intro .fine { margin-top: 10px; font-size: 12px; }
  #quest { left: 45%; right: calc(16px + var(--sar)); top: calc(54px + var(--sat)); bottom: calc(8px + var(--sab)); width: auto; max-height: none; transform: none; overflow-y: auto; padding: 0 2px 8px; }
  body:not([data-phase="quest"]):not([data-phase="return"]) #quest { transform: translateY(14px); }
  .q-progress { margin-bottom: 10px; }
  .q-text { font-size: 21px; max-width: none; }
  .q-hint { font-size: 13px; margin-top: 6px; }
  .q-body { margin-top: 12px; gap: 8px 10px; }
  .opt { font-size: 14px; }
  .chips .opt { font-size: 13px; padding: 6px 12px; }
  .rive { min-width: 0; width: 100%; gap: 6px 14px; }
  .rive .seg .opt { font-size: 12px; }
  .time output { font-size: 32px; }
  .rose { width: 180px; height: 180px; }
  .q-cert, .q-foot { margin-top: 12px; }
  .b-text { font-size: 30px; }
  #reading { width: calc(var(--pw) + var(--sar)); top: 0; bottom: 0; height: auto; padding: calc(56px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) 20px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent calc(42px + var(--sat)), #000 calc(58px + var(--sat))); mask-image: linear-gradient(to bottom, transparent 0, transparent calc(42px + var(--sat)), #000 calc(58px + var(--sat))); }
  #reading.closed { -webkit-mask-image: none; mask-image: none; }
  body:not([data-phase="explore"]) #reading { transform: translateY(12px); }
  #reading.closed { transform: none; width: 38px; overflow: hidden; background: none; }
  .r-toggle { top: calc(56px + var(--sat)); }
  .r-inner { padding-left: 12px; }
  #obs p { font-size: 14px; }
  .lis-t { font-size: 22px; }
  #slider, body.has-panel #slider { left: calc((100% - var(--pw) - var(--sar) + var(--sal)) / 2); bottom: calc(8px + var(--sab)); width: min(520px, calc(100% - var(--pw) - 48px - var(--sal))); }
  body.has-panel.panel-closed #slider { left: 50%; width: min(620px, calc(100% - 120px)); }
  .s-lect { gap: 14px; }
  .s-lect button { font-size: 13px; white-space: nowrap; }
  .s-row { gap: 12px; }
  .s-end { font-size: 11px; letter-spacing: .1em; }
  .s-lect { margin-top: 2px; }
  .s-note { font-size: 12px; margin-top: 2px; }
  #history { top: calc(52px + var(--sat)); bottom: auto; left: calc(16px + var(--sal)); flex-direction: row; flex-wrap: wrap; gap: 4px 16px; max-width: calc(100% - var(--pw) - 90px); }
  #history button small { display: none; }
  #walk { top: calc(84px + var(--sat)); left: calc(16px + var(--sal)); width: min(360px, calc(100% - var(--pw) - 48px)); max-height: calc(100vh - 196px); max-height: calc(100dvh - 196px - var(--sat) - var(--sab)); padding: 16px 18px; }
  #walk .inv { font-size: 22px; }
  #camReset, body.has-panel:not(.panel-closed) #camReset { right: calc(var(--pw) + 16px + var(--sar)); top: calc(48px + var(--sat)); bottom: auto; }
  body.has-panel.panel-closed #camReset { right: calc(52px + var(--sar)); }
  #navHint { top: calc(54px + var(--sat)); left: calc((100% - var(--pw)) / 2); white-space: normal; text-align: center; width: max-content; max-width: calc(100% - var(--pw) - 110px); }
  #measure { top: calc(54px + var(--sat)); left: calc((100% - var(--pw)) / 2); max-width: calc(100% - var(--pw) - 110px); }
  .overlay { padding: calc(16px + var(--sat)) calc(20px + var(--sar)) calc(16px + var(--sab)) calc(20px + var(--sal)); }
  .ov-inner { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
}

/* ---------- Écrans tactiles : cibles d'au moins ~44 px, sans changer le dessin ---------- */
@media (pointer: coarse) {
  button, .opt, label.file, input[type=range] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .tools button, .s-lect button, #history button, .quiet:not(.file), .r-toggle, .close { position: relative; }
  .tools button::after, .s-lect button::after, #history button::after, .quiet:not(.file)::after, .r-toggle::after, .close::after { content: ''; position: absolute; inset: -12px -8px; }
  .file input { inset: -12px -8px; width: auto; height: auto; }
  .primary { min-height: 44px; }
  .opt { min-height: 40px; }
  .chips .opt, .rive .seg .opt, .rose .opt { min-height: 36px; }
  .q-cert button { min-height: 38px; padding: 6px 14px; }
  input[type=range] { height: 40px; }
  input[type=range]::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -12px; }
  input[type=range]::-moz-range-thumb { width: 22px; height: 22px; }
  #camReset { width: 40px; height: 40px; }
  #camReset svg { width: 20px; height: 20px; }
}

/* ---------------- comparer avec un ami ---------------- */
#fin { position: fixed; left: 26px; top: 96px; width: min(400px, calc(100% - 52px)); z-index: 5; background: rgba(15,16,17,.92); border-left: 1px solid var(--water); padding: 22px 24px; max-height: calc(100vh - 260px); overflow-y: auto; transition: opacity .8s var(--ease), transform .8s var(--ease); }
#fin[hidden], body:not([data-phase="explore"]) #fin { display: none; }
#fin .inv { font-family: var(--display); font-size: 25px; line-height: 1.12; margin: 0 0 6px; text-wrap: balance; }
#fin .fine { max-width: none; margin-top: 10px; }
#fin .row { margin-top: 18px; gap: 16px; }
#inviteBanner { border-left: 1px solid var(--water); padding: 2px 0 2px 16px; margin: 0 0 22px; }
#inviteBanner[hidden] { display: none; }
#inviteBanner .kicker { color: var(--water); margin-bottom: 6px; }
#inviteBanner .inv-t { font-family: var(--display); font-size: 22px; line-height: 1.15; margin: 0; }
#inviteBanner .fine { margin-top: 8px; max-width: 52ch; }
.cmp-cta { margin: 26px 0 4px; }
#reading.pairing .cmp-cta { margin-top: 18px; }
.quiet.inline { font-size: inherit; color: var(--ink-2); }
.quiet.danger { color: rgba(214, 150, 130, .9); border-color: rgba(214, 150, 130, .3); }
.quiet.danger:hover { color: #e3a892; border-color: rgba(214, 150, 130, .7); }
button:disabled { opacity: .5; cursor: default; }
.err { color: #e3a892; }
.err[hidden] { display: none; }
.facts { margin: 18px 0 0; padding-left: 18px; }
.facts li { margin-bottom: 8px; }
.alt-wrap { display: none; margin-top: 18px; }
.alt-wrap.on { display: block; }
.share-alt { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.linkbox { width: 100%; margin-top: 14px; background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--ink-4); border-radius: 6px; padding: 9px 11px; font: 12px/1.3 var(--body); }
.draft { border: 1px dashed var(--ochre); color: var(--ochre) !important; padding: 8px 12px; font-size: 13px !important; }
.check { display: flex; gap: 10px; align-items: center; color: var(--ink); cursor: pointer; }
.check input { accent-color: var(--ochre); width: 16px; height: 16px; }
#statsNote { display: block; margin-top: 6px; }
.pair-intro { color: var(--ink-2); font-size: 14px; margin: 0 0 14px; }
.pair-intro b { color: var(--ink); font-weight: 500; }
.pair-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-3); }
.pair-legend span { display: inline-flex; align-items: center; gap: 7px; }
.pair-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pair-legend .dot.me { background: var(--ink); }
.pair-legend .dot.other { border: 1.4px solid var(--water); }
.pair-legend .dash { width: 18px; border-top: 1px dashed var(--ink-2); display: inline-block; }
.pair-list { list-style: none; margin: 0; padding: 0; }
.pair-list li { font-size: 14px; color: var(--ink-2); padding: 7px 0 7px 12px; border-left: 1px solid var(--ink-4); margin-bottom: 4px; transition: border-color .3s, color .3s; }
.pair-list li[data-id]:hover { border-color: var(--ochre); color: var(--ink); }
.pair-list b { color: var(--ink); font-weight: 500; }
.pair-tools { margin-top: 22px; }
#reading.pairing #obs .fine { margin-top: 6px; }
@media (max-width: 820px) {
  #fin { top: calc(132px + var(--sat)); left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); width: auto; max-height: calc(100dvh - 156px - var(--sat) - var(--sab)); }
  body.has-panel:not(.panel-closed) #fin { max-height: calc(54dvh - 150px - var(--sat)); }
  #fin .inv { font-size: 23px; }
  .pair-list li { font-size: 15px; }
  #inviteBanner .inv-t { font-size: 20px; }
}
#reading.pairing #lisK { display: none; }
