/* BLINK — prototype PWA. Mobile d'abord.
   Noir et blanc, traits fins, angles droits. La couleur est réservée aux typologies ;
   le jaune n'apparaît qu'en touche ponctuelle. */

:root {
  --ink: #121212;
  --ink-2: #3A3A3A;
  --ink-3: #6B6B6B;
  --white: #FFFFFF;
  --paper: #F5F5F4;
  --line: #E4E4E2;
  --line-2: #BDBDB8;
  --map: #EDEDEB;
  --yellow: #FAF15A;
  --night: #0B0B0B;
  --night-ink: #F2F2F0;
  --night-ink-2: #A8A8A4;
  --night-line: #3A3A3A;
  --border: 1px solid var(--ink);
  --font-display: 'Urbanist', system-ui, sans-serif;
  --font-body: 'Raleway', system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: calc(72px + var(--safe-bottom));
  /* Accent des fiches : noir sur fond clair, jaune sur fond sombre */
  --accent: var(--ink);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: var(--tabbar-h);
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; }
.icon { flex: none; stroke-width: 1; }
/* Même trait que les cadres, quelle que soit la taille de l'icône */
.icon * { vector-effect: non-scaling-stroke; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Photos en noir et blanc sur les écrans de l'app (pas dans les fiches ni sur les couvertures de visites) */
.bw, .preview-media img, .list-item img,
.vstep img, .guide-step img, .gate-cover img, .sim-item img, .visit-bar img, .end-steps img {
  filter: grayscale(1) contrast(1.05);
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 0; border: 0;
  font: 600 16px var(--font-display); letter-spacing: .02em; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, color .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { background: var(--line); color: var(--ink-3); cursor: not-allowed; }
.btn-xl { min-height: 54px; }
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: #000; }
.btn-soft { background: var(--white); color: var(--ink); border: var(--border); }
.btn-soft:hover { background: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink-3); font-size: 14px; min-height: 44px; }
.btn-ghost:disabled { background: transparent; }
.btn-ghost-dark { background: var(--white); color: var(--ink); border: var(--border); }
.btn-link { background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; min-height: 40px; font-size: 15px; }
.soon { font: 700 10px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; padding: 4px 7px; border: 1px solid currentColor; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 0; border: 0; background: transparent; cursor: pointer; text-decoration: none; color: var(--ink);
}
.icon-btn:hover { background: var(--paper); }
.icon-btn.on-dark { color: var(--white); background: transparent; border: 1px solid var(--white); }
.icon-btn.on-dark:hover { background: rgba(255, 255, 255, .08); }
.icon-btn.raised { background: var(--white); color: var(--ink); border: var(--border); }

.kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font: 700 12px/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3);
}
.kicker i { width: 9px; height: 9px; background: var(--c, var(--ink)); border: 1px solid var(--ink); }
/* Étiquette de typologie : seule zone colorée */
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 0;
  background: var(--c, var(--white)); color: var(--ink);
  font: 700 10px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase;
}
/* Étiquettes d'état : noir et blanc, jaune pour « en cours » */
.tag.state { background: transparent; border: 1px solid currentColor; }
.tag.live { background: var(--yellow); }

/* ---------- Barre d'onglets ---------- */
#tabbar {
  position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0; height: var(--tabbar-h);
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 0 0 var(--safe-bottom);
  background: var(--white); border-top: 1px solid var(--ink);
}
/* Chrome sur iPhone laisse une bande sous les éléments fixés en bas : on la prolonge avec la barre. */
#tabbar::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 240px; background: inherit; }
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--ink-3); text-decoration: none; font: 600 11px/1.2 var(--font-display);
}
.tab.active { color: var(--ink); font-weight: 700; }
#tab-play { border: 0; padding: 0; background: none; cursor: pointer; }
#tab-play[hidden] { display: none; }
.tab.active::before { content: ''; position: absolute; top: -1px; left: 30%; right: 30%; height: 3px; background: var(--yellow); }
body.theme-dark #tabbar { background: var(--night); border-top-color: var(--night-line); }
body.theme-dark .tab { color: var(--night-ink-2); }
body.theme-dark .tab.active { color: var(--night-ink); }

/* ---------- Badge démo et toast ---------- */
#demo-badge {
  display: none; position: fixed; z-index: 1200; top: calc(var(--safe-top) + 12px); left: 50%; transform: translateX(-50%);
  height: 28px; padding: 0 10px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--yellow); color: var(--ink); font: 700 11px/28px var(--font-display); letter-spacing: .08em; text-transform: uppercase;
}
body.demo-on #demo-badge { display: block; }
body.page-map #demo-badge { top: auto; bottom: calc(var(--tabbar-h) + 22px); left: 16px; transform: none; }
body.page-map.preview-open #demo-badge, body.page-map.list-open #demo-badge { display: none; }
body.page-scan #demo-badge { top: calc(var(--safe-top) + 64px); }
body.page-home #demo-badge { top: calc(var(--safe-top) + 20px); left: auto; right: 72px; transform: none; }
body.page-story #demo-badge, body.page-gate #demo-badge { top: calc(var(--safe-top) + 64px); }
body.page-guide #demo-badge { top: calc(var(--safe-top) + 96px); }

#toast {
  position: fixed; z-index: 1300; left: 50%; bottom: calc(var(--tabbar-h) + 16px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 420px); padding: 12px 18px; border-radius: 0;
  background: var(--ink); color: var(--white); font-size: 14px; text-align: center;
  transition: opacity .25s, transform .25s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Écran d'arrivée ---------- */
.arrival {
  position: fixed; inset: 0; z-index: 2000; overflow: hidden; background: var(--night); color: var(--white);
  display: flex; flex-direction: column; align-items: center;
  transition: opacity .45s ease, transform .45s ease;
  /* Couvre aussi la bande que Chrome sur iPhone laisse sous les éléments fixés. */
  box-shadow: 0 0 0 100vmax var(--night);
}
.arrival.leaving { opacity: 0; transform: scale(1.03); pointer-events: none; }
.arrival-body { position: relative; z-index: 1; flex: none; margin-bottom: 28px; margin-top: calc(var(--safe-top) + clamp(40px, 23svh - 60px, 23svh)); display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 0 24px; text-align: center; }
.blink-eye { animation: arrival-blink 4.5s ease-in-out 1.2s infinite; transform-origin: center; }
@keyframes arrival-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
.arrival-name { font: 800 40px/1 var(--font-display); letter-spacing: .22em; padding-left: .22em; }
.arrival-tagline { margin: 10px 0 0; font: 500 15px/1.4 var(--font-body); letter-spacing: .04em; color: var(--line); }
.arrival-form { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.arrival-password {
  width: 200px; height: 50px; padding: 0 14px; border: 1px solid var(--white); border-radius: 0; background: transparent; color: var(--white);
  font: 500 16px var(--font-body); text-align: center; outline: none;
}
.arrival-password::placeholder { color: var(--line); }
.arrival-password:focus { box-shadow: inset 0 0 0 1px var(--white); }
.arrival-error { min-height: 18px; margin: 0; font: 500 13px/18px var(--font-body); color: var(--line); }
.arrival-enter {
  display: flex; align-items: center; justify-content: center; width: 200px; height: 50px; border: 1px solid var(--white);
  background: transparent; color: var(--white); font: 600 15px var(--font-display); letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
}
.arrival-enter:hover { background: var(--white); color: var(--night); }
.arrival-drawing { flex: 0 1 300px; min-height: 0; width: min(100%, 520px); margin-top: auto; pointer-events: none; }

/* ---------- Feuilles (bottom sheets) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 1100; background: rgba(18, 18, 18, 0); display: flex; align-items: flex-end; justify-content: center;
  transition: background .25s;
}
.sheet-backdrop.open { background: rgba(18, 18, 18, .4); }
.sheet {
  width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  background: var(--white); color: var(--ink); border-radius: 0; border-top: var(--border);
  padding: 8px 24px calc(var(--safe-bottom) + 24px);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.sheet-backdrop.open .sheet { transform: none; }
.sheet-grip { width: 36px; height: 3px; background: var(--ink); margin: 6px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h2 { font: 700 24px/1.2 var(--font-display); }
.sheet-sub { font: 700 12px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 22px 0 12px; }
.sheet-text { color: var(--ink-2); margin: 0 0 16px; }
.sheet-foot { color: var(--ink-3); font-size: 12px; margin: 22px 0 0; }
.sheet-actions { display: flex; gap: 10px; margin-top: 24px; }
.sheet-actions .btn { flex: 1; }

.switch-row, .row-link {
  display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; cursor: pointer;
}
.switch-row strong, .row-link strong { font: 700 15px var(--font-display); }
.switch-row > span, .row-link > span { flex: 1; }
.switch-row small, .row-link small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; width: 48px; height: 28px; border-radius: 0; margin: 0;
  background: var(--white); border: var(--border); position: relative; cursor: pointer; transition: background .2s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; background: var(--ink); transition: transform .2s, background .2s;
}
.switch:checked { background: var(--ink); }
.switch:checked::after { transform: translateX(20px); background: var(--yellow); }

/* ---------- Accueil ---------- */
.home { min-height: calc(100svh - var(--tabbar-h)); display: flex; flex-direction: column; gap: 18px; background: var(--white); padding: calc(var(--safe-top) + 14px) 24px 20px; }
.home-top { display: flex; justify-content: space-between; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 20px/1 var(--font-display); letter-spacing: .2em; color: var(--ink); }
.home-top .icon-btn { border: var(--border); }
.home-eye { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 236px; flex-shrink: 0; color: var(--ink); }
.home-body { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.home-title { font: 700 31px/1.12 var(--font-display); letter-spacing: -.01em; margin: 0; color: var(--ink); }
.home-title em { font-style: normal; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.home-lede { color: var(--ink-2); font-size: 15px; margin: 0; max-width: 38ch; }
.home-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; max-width: 560px; width: 100%; }
@media (min-width: 900px) {
  .home { display: grid; grid-template-columns: 1.1fr 1fr; grid-template-rows: auto 1fr auto; column-gap: 48px; padding: 28px 48px 40px; }
  .home-top { grid-column: 1 / -1; }
  .home-eye { grid-row: 2 / 4; height: auto; min-height: 420px; }
  .home-body { align-self: end; }
  .home-actions { margin: 0; max-width: 460px; }
}

/* ---------- Carte ---------- */
body.page-map { overflow: hidden; padding-bottom: 0; }
.mapview { position: fixed; inset: 0 0 var(--tabbar-h) 0; }
.map { position: absolute; inset: 0; background: var(--map); }
.leaflet-container { font-family: var(--font-body); background: var(--map); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, .8) !important; }

.map-top { position: absolute; z-index: 500; top: 0; left: 0; right: 0; padding: calc(var(--safe-top) + 12px) 16px 0; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.searchbar { display: flex; align-items: stretch; gap: 8px; max-width: 560px; margin: 0 auto; }
.searchbar > .icon-btn { width: 46px; height: 46px; background: var(--white); border: var(--border); }
.search-field { flex: 1; min-width: 0; height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--white); border: var(--border); color: var(--ink); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 15px var(--font-body); color: var(--ink); height: 40px; }
.search-field input::placeholder { color: var(--ink-3); }
.filter-btn { position: relative; background: var(--ink) !important; color: var(--white) !important; border-color: var(--ink) !important; }
.filter-btn .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--yellow); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px 4px; max-width: 560px; margin: 0 auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 0;
  border: var(--border); background: var(--white); color: var(--ink); font: 700 12px var(--font-display); letter-spacing: .04em; cursor: pointer;
  transition: background .2s;
}
.chip.on { background: var(--c); border-width: 2px; }
/* Filtres de typologie : même allure que l'étiquette `.tag`, un contour noir marque la sélection */
.chip[data-typo] {
  gap: 0; border: 0; background: var(--c); font: 700 11px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase;
}
.chip[data-typo].on { box-shadow: inset 0 0 0 1px var(--ink); }

.search-results { max-width: 560px; margin: 8px auto 0; background: var(--white); border: var(--border); overflow: hidden; }
.result { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: var(--ink); }
.result:last-child { border-bottom: 0; }
.result strong { font: 700 15px var(--font-display); }
.result:hover { background: var(--paper); }
.result small { display: block; color: var(--ink-3); font-size: 12px; }
.result-ic { display: grid; place-items: center; width: 36px; height: 36px; border: var(--border); color: var(--ink); }
.result-empty { padding: 16px; margin: 0; color: var(--ink-3); font-size: 14px; list-style: none; }

.map-fabs { position: absolute; z-index: 500; right: 16px; bottom: 18px; display: grid; gap: 8px; transition: opacity .2s; }
.fab { width: 44px; height: 44px; border-radius: 0; border: var(--border); background: var(--white); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.mapview.has-preview .map-fabs { opacity: 0; pointer-events: none; }
.mapview.list-mode .leaflet-control-attribution { display: none; }

/* Marqueur : pastille de la couleur de la typologie, cerclée de noir, sur une tige */
.poi-marker { background: none; border: 0; }
.pin {
  position: relative; display: block; width: 26px; height: 26px; border-radius: 50%;
  background: var(--c); border: 1px solid var(--ink); transition: transform .2s;
  transform-origin: 50% 150%;
}
.pin::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 12px; margin-left: -.5px; background: var(--ink); }
.pin span { display: none; }
.poi-marker.selected .pin { transform: scale(1.3); border-width: 2.5px; }
.poi-marker.dimmed { opacity: .25; filter: grayscale(1); }
.pin-label {
  position: absolute; left: 32px; top: 2px; white-space: nowrap; padding: 3px 8px;
  background: var(--white); border: 1px solid var(--ink); font: 700 12px/1.3 var(--font-display); color: var(--ink);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.show-labels .pin-label, .poi-marker.selected .pin-label { opacity: 1; }
.me-marker span { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--ink); }
.me-accuracy { fill: var(--ink); fill-opacity: .05; stroke: var(--ink); stroke-opacity: .25; stroke-width: 1; }

/* Aperçu d'un lieu */
.preview {
  position: absolute; z-index: 600; left: 12px; right: 12px; bottom: 12px; margin: 0 auto; max-width: 560px;
  background: var(--white); border: var(--border);
  transform: translateY(calc(100% + 24px)); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
  max-height: calc(100% - 140px); overflow: auto;
}
.preview.open { transform: none; }
.preview-head { display: flex; gap: 12px; padding: 14px 14px 0; }
.preview-media { width: 76px; height: 76px; flex-shrink: 0; overflow: hidden; background: var(--ink); }
.preview-media img { width: 100%; height: 100%; object-fit: cover; }
.preview-title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.preview-title h2 { font: 700 19px/1.15 var(--font-display); color: var(--ink); }
.preview-close { width: 32px; height: 32px; align-self: flex-start; }
.preview-body { padding: 10px 14px 14px; }
.preview-dist { font: 700 11px var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.preview-excerpt { margin: 0 0 8px; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.preview-addr { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; font-size: 12px; color: var(--ink-3); }
.preview-actions { display: flex; gap: 8px; }
.preview-actions > :first-child { flex: 1; }
.preview-actions .btn { min-height: 48px; font-size: 15px; padding: 0 14px; }
.preview-actions .btn-soft { flex: none; width: 104px; }
.access-hint { flex: 1; display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; background: var(--paper); font-size: 13px; color: var(--ink-2); }

/* Vue liste */
.listview {
  position: absolute; z-index: 400; inset: 0; overflow: auto; background: var(--white);
  padding: calc(var(--safe-top) + 120px) 0 90px;
}
body.list-open .map-top { background: var(--white); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; max-width: 560px; margin: 0 auto; padding: 8px 24px 6px; }
.list-head h2 { font: 700 26px/1.2 var(--font-display); color: var(--ink); }
.list-sort { font-size: 12px; color: var(--ink-3); }
.list { list-style: none; margin: 0 auto; padding: 0 24px; max-width: 560px; }
.list li { border-bottom: 1px solid var(--line); }
.list-item {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 16px 0; margin: 0; border: 0; border-radius: 0; background: transparent;
  text-align: left; cursor: pointer;
}
.list-item:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.list-item img { width: 72px; height: 88px; object-fit: cover; flex: none; background: var(--ink); }
.list-text { flex: 1; min-width: 0; display: grid; gap: 5px; justify-items: start; }
.list-text strong { font: 700 17px/1.2 var(--font-display); color: var(--ink); }
.list-text small { color: var(--ink-3); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-dist { flex: none; font: 700 12px var(--font-display); color: var(--ink); }

/* ---------- Scan ---------- */
body.page-scan { overflow: hidden; padding-bottom: 0; }
.scan { position: fixed; inset: 0 0 var(--tabbar-h) 0; display: flex; flex-direction: column; background: var(--night); color: var(--white); }
.scan-frame { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #1C1C1C; display: grid; place-items: center; }
.scan-top {
  position: absolute; z-index: 2; left: 16px; right: 16px; top: calc(var(--safe-top) + 12px);
  display: flex; align-items: center; justify-content: space-between;
  font: 700 13px var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: var(--white);
}
.scan-top .icon-btn { color: var(--white); border: 1px solid var(--white); }
.scan-top .icon-btn:hover { background: rgba(255, 255, 255, .08); }
.scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; filter: grayscale(1); }
.scan.live .scan-video { opacity: 1; }
.viewfinder { position: relative; width: min(66vw, 260px); aspect-ratio: 1; }
.viewfinder i { position: absolute; width: 44px; height: 44px; border: 3px solid var(--white); }
.viewfinder i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.viewfinder i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.viewfinder i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.viewfinder i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.laser { position: absolute; left: 7%; right: 7%; height: 2px; background: var(--yellow); animation: laser 2.2s ease-in-out infinite alternate; }
@keyframes laser { from { top: 14%; } to { top: 86%; } }
.scan.found .viewfinder { transform: scale(.94); transition: transform .3s; }
.scan.found .viewfinder i { border-color: var(--yellow); }
.scan-panel { flex-shrink: 0; display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 22px 24px 20px; background: var(--white); color: var(--ink); text-align: center; }
.scan-hint { margin: 0; font: 700 20px/1.25 var(--font-display); }
.scan-sub { margin: -8px 0 0; font-size: 13.5px; color: var(--ink-3); }
.scan-error { margin: 0; text-align: center; font-size: 13px; padding: 10px 14px; background: var(--yellow); color: var(--ink); }
.sim-list { display: grid; gap: 0; }
.sim-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: var(--white); text-align: left; cursor: pointer; }
.sim-item strong { font: 700 15px var(--font-display); }
.sim-item img { width: 52px; height: 52px; object-fit: cover; }
.sim-item small { display: block; color: var(--ink-3); font-size: 12px; }

/* ---------- Écran d'accès (géolocalisation / QR) ---------- */
.gate { position: relative; min-height: calc(100svh - var(--tabbar-h)); display: grid; place-items: center; padding: calc(var(--safe-top) + 72px) 24px 28px; background: var(--white); color: var(--ink); }
.gate-back { position: absolute; top: calc(var(--safe-top) + 12px); left: 16px; z-index: 2; }
.gate-card { width: 100%; max-width: 420px; text-align: center; }
.gate-cover { position: relative; height: 190px; overflow: hidden; margin-bottom: 30px; background: var(--ink); }
.gate-cover img { width: 100%; height: 100%; object-fit: cover; }
.gate-ic { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); display: grid; place-items: center; width: 52px; height: 52px; background: var(--white); color: var(--ink); border: var(--border); border-bottom: 0; }
.gate-card h1 { font: 700 30px/1.1 var(--font-display); margin: 14px 0 10px; letter-spacing: -.01em; }
.gate-card p { color: var(--ink-2); margin: 0; }
.gate-card p strong { font-weight: 700; background: var(--yellow); padding: 0 3px; }
.gate-actions { display: grid; gap: 10px; margin-top: 24px; }
.gate-note { font-size: 12px; color: var(--ink-3) !important; margin-top: 14px !important; }
.spinner { width: 34px; height: 34px; margin: 0 auto 12px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Fiche (scrollytelling) ---------- */
/* Les règles de mise en page et d'animation sont inchangées : seules les couleurs, polices et formes évoluent. */
body.page-story { --bg: var(--white); --fg: var(--ink); --fg-2: var(--ink-3); --card: rgba(255, 255, 255, .97); --card-border: var(--ink); --rule: var(--line); background: var(--bg); color: var(--fg); }
body.page-story.theme-dark {
  --bg: var(--night); --fg: var(--night-ink); --fg-2: var(--night-ink-2); --card: rgba(11, 11, 11, .9); --card-border: var(--night-ink);
  --rule: var(--night-line); --line: var(--night-line); --accent: var(--yellow); color-scheme: dark;
}

/* Barre de lecture : retour, titre avec progression jaune, écoute */
.story-bar {
  position: fixed; z-index: 900; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-top) + 10px) 16px 10px; color: var(--fg); transition: background .3s;
}
.story-bar .icon-btn { width: 44px; height: 44px; color: var(--fg); background: var(--bg); border: 1px solid var(--card-border); }
.story-bar .icon-btn:hover { background: var(--bg); }
.story-bar-title {
  position: relative; flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; padding: 0 12px;
  background: var(--bg); border: 1px solid var(--card-border);
  font: 700 13px/1.2 var(--font-display); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.story-progress { position: absolute; left: 0; right: 0; bottom: -1.5px; height: 3px; background: var(--yellow); transform-origin: 0 50%; transform: scaleX(0); }
.story-bar.solid { background: linear-gradient(var(--bg) 72%, transparent); }

.story { position: relative; }

/* Héros immersif */
.b-hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; color: #fff; background: #000; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .3) 0%, transparent 32%, rgba(11, 11, 11, .6) 66%, rgba(11, 11, 11, .96) 100%); }
.hero-shade.strong { background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, transparent 28%, rgba(11, 11, 11, .78) 56%, rgba(11, 11, 11, .97) 78%); }
.b-hero .hero-text { position: absolute; left: 0; right: 0; bottom: 92px; padding: 0 24px; max-width: 760px; margin: 0 auto; will-change: transform, opacity; }
.b-hero .kicker { color: var(--night-ink-2); font-size: 11px; letter-spacing: .2em; }
.b-hero h1 { font: 800 clamp(42px, 11.5vw, 92px)/1.02 var(--font-display); letter-spacing: -.015em; margin: 14px 0 14px; text-wrap: balance; }
.hero-sub { font: 400 clamp(17px, 4.6vw, 22px)/1.45 var(--font-body); margin: 0; color: var(--line); max-width: 32ch; }
.hero-credit { position: absolute; right: 16px; bottom: 16px; margin: 0; font-size: 11px; color: var(--night-ink-2); max-width: 60%; text-align: right; }
.scroll-cue { position: absolute; left: 24px; bottom: 22px; display: flex; align-items: center; gap: 10px; font: 700 11px var(--font-display); text-transform: uppercase; letter-spacing: .16em; color: var(--night-ink); }
.scroll-cue i { width: 1.5px; height: 34px; background: var(--yellow); transform-origin: top; animation: cue 1.6s ease-in-out infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }
@media (min-width: 900px) { .b-hero .hero-text { left: 64px; right: auto; margin: 0; padding: 0; } .scroll-cue { left: 64px; } }

/* Héros article (fiches simples) */
.b-hero-article figure { margin: 0; position: relative; height: 58svh; min-height: 320px; overflow: hidden; background: var(--ink); }
.b-hero-article img { width: 100%; height: 100%; object-fit: cover; }
.b-hero-article figcaption { position: absolute; left: 0; bottom: 0; max-width: 85%; padding: 7px 12px; background: var(--white); color: var(--ink); font-size: 12px; }
.b-hero-article .hero-text { max-width: 680px; margin: 0 auto; padding: 26px 24px 6px; }
.b-hero-article .kicker { color: var(--ink-3); font-size: 11px; letter-spacing: .2em; }
.b-hero-article h1 { font: 800 clamp(34px, 9.5vw, 54px)/1.04 var(--font-display); letter-spacing: -.015em; margin: 12px 0 0; text-wrap: balance; }
.b-hero-article .hero-sub { color: var(--fg-2); }

/* Texte */
.prose { max-width: 640px; margin: 0 auto; padding: 18px 24px; font: 400 16px/1.65 var(--font-body); }
.prose p { margin: 0 0 1.1em; }
.prose.dropcap > p:first-child::first-letter { float: left; font: 800 4em/.82 var(--font-display); padding: .08em .14em 0 0; color: var(--fg); }
.b-text { padding-top: 34px; padding-bottom: 20px; }
.b-text.dropcap { border-top: 1px solid var(--rule); margin-top: 8px; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* Chapitres : motif des trois paupières, date en jaune */
.b-chapter { max-width: 760px; margin: 0 auto; padding: 18vh 24px 8vh; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; text-align: left; }
.b-chapter .eyelids { color: var(--fg); }
.b-chapter .kicker { color: var(--accent); font-size: 13px; letter-spacing: .2em; }
.b-chapter h2 { font: 800 clamp(32px, 9vw, 64px)/1.08 var(--font-display); letter-spacing: -.01em; text-wrap: balance; }

/* Frise */
.b-timeline { position: relative; max-width: 640px; margin: 0 auto; padding: 10px 24px 60px 24px; }
.tl-line { position: absolute; left: 34px; top: 20px; bottom: 60px; width: 1px; background: var(--rule); }
.tl-line i { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(0); }
.b-timeline ol { list-style: none; margin: 0; padding: 0; }
.b-timeline li { position: relative; padding: 0 0 30px 44px; }
.b-timeline li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 1px solid var(--fg); transition: background .3s, border-color .3s; }
.b-timeline li.passed::before { background: var(--accent); border-color: var(--fg); }
.tl-year { display: block; font: 800 22px/1.2 var(--font-display); color: var(--fg); }
.b-timeline li p { margin: 4px 0 0; font: 400 14.5px/1.55 var(--font-body); color: var(--fg-2); }
body.theme-dark .b-timeline li p { color: var(--line); }

/* Image collante + étapes */
.b-scrolly, .b-sequence { position: relative; }
.b-scrolly .sticky, .b-sequence .sticky, .b-compare .sticky, .b-gallery .sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.stage { position: absolute; inset: 0; overflow: hidden; background: #000; }
.stage .backdrop { position: absolute; inset: -60px; width: calc(100% + 120px); height: calc(100% + 120px); max-width: none; object-fit: cover; filter: blur(28px) brightness(.35) grayscale(.6); }
.stage .pan { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; will-change: transform; }
.marks { position: absolute; inset: 0; pointer-events: none; }
.mark { position: absolute; top: 0; left: 0; opacity: 0; will-change: transform, opacity; }
.mark b { position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: var(--night); }
.mark b::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--yellow); }
.mark em { position: absolute; left: 20px; top: -15px; white-space: nowrap; font: 700 13px/1 var(--font-display); font-style: normal; color: var(--ink); background: var(--white); border: 1px solid var(--ink); padding: 7px 10px; }
.steps { position: relative; margin-top: -100svh; pointer-events: none; }
.b-sequence .steps { padding: 40svh 0 70svh; }
.step { min-height: 100svh; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 14svh; }
.card {
  pointer-events: auto; max-width: 440px; padding: 18px 20px; border-radius: 0;
  background: var(--card); color: var(--fg); border: 1px solid var(--card-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font: 400 16px/1.6 var(--font-body);
}
.card p { margin: 0; }
/* Sur mobile, cartes plus compactes (≈ 30 % plus petites) pour laisser voir l'image */
@media (max-width: 899px) {
  .card { max-width: 310px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; }
}
@media (min-width: 900px) {
  .step { justify-content: flex-start; align-items: center; padding: 0 0 0 6vw; }
  .card { max-width: 400px; }
}
.b-sequence canvas { width: 100%; height: 100%; display: block; background: #0d0b09; }
.seq-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--night-ink-2); font-size: 14px; }
.b-sequence .sticky.contain canvas { background: var(--night); }
.seq-year { position: absolute; left: 16px; top: calc(var(--safe-top) + 108px); font: 800 44px/1 var(--font-display); letter-spacing: .02em; color: var(--white); text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }
.seq-credit { position: absolute; right: 12px; bottom: 10px; margin: 0; font-size: 10px; letter-spacing: .04em; color: var(--night-ink-2); }

/* Modèle 3D piloté par le scroll */
.b-model { position: relative; }
.b-model .sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; background: radial-gradient(120% 80% at 50% 30%, #2a2a28 0%, var(--night) 70%); }
.model-stage { position: absolute; inset: 0; pointer-events: none; }
/* Un doigt garde le défilement vertical ; deux doigts sont gérés par la page pour faire pivoter la 3D */
.b-model .sticky { touch-action: pan-y; cursor: grab; }
.b-model .sticky.grabbing { cursor: grabbing; }
.model-hint { position: absolute; left: 50%; top: calc(var(--safe-top) + 112px); transform: translateX(-50%); margin: 0; padding: 6px 12px; white-space: nowrap; font: 600 11px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; color: var(--night-ink); background: rgba(11, 11, 11, .6); border: 1px solid rgba(255, 255, 255, .25); pointer-events: none; transition: opacity .6s; }
.model-hint.used { opacity: 0; }
.model-stage canvas { width: 100%; height: 100%; display: block; }
.model-fallback { width: 100%; height: 100%; object-fit: cover; }
.b-model .marks .mark em { font-size: 12px; padding: 6px 9px; }
.mark.flip em { left: auto; right: 20px; }
/* Cartouche de plusieurs lignes (texte posé sur une image) */
.mark.wide em { white-space: normal; width: max-content; max-width: min(240px, 62vw); font: 700 13px/1.4 var(--font-display); padding: 8px 11px; }
.cmp-frame .mark { transform: none; }
.model-loading { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; justify-items: center; color: var(--night-ink-2); font: 600 13px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.model-loading i { display: block; width: 160px; height: 3px; background: rgba(255, 255, 255, .15); }
.model-loading b { display: block; height: 100%; background: var(--yellow); transform: scaleX(0); transform-origin: 0 50%; transition: transform .2s; }
.model-debug { position: absolute; z-index: 5; left: 8px; bottom: 8px; margin: 0; padding: 6px 8px; font-size: 11px; background: rgba(0, 0, 0, .7); color: #fff; pointer-events: none; }

/* Avant / après */
.b-compare { height: 260svh; }
.b-compare .stage { display: grid; place-items: center; background: var(--bg); }
.cmp-frame { position: relative; overflow: visible; border-radius: 0; }
.cmp { position: absolute; inset: 0; background-size: cover; background-position: center; }
.cmp.half-left { background-size: 200% 100%; background-position: 0 0; }
.cmp.half-right { background-size: 200% 100%; background-position: 100% 0; background-color: #fff; }
.cmp-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--yellow); }
.cmp-line span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(180deg); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: var(--ink); }
.cmp-label { position: absolute; top: calc(var(--safe-top) + 100px); padding: 6px 10px; background: var(--bg); color: var(--fg); border: 1px solid var(--card-border); font: 700 11px var(--font-display); letter-spacing: .12em; text-transform: uppercase; transition: opacity .2s; }
.cmp-label.l { left: 16px; }
.cmp-label.r { right: 16px; opacity: 0; }
.cmp-caption { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-bottom) + 18px); margin: 0 auto; max-width: 420px; padding: 0 24px; text-align: center; font: 400 13px/1.5 var(--font-body); color: var(--fg-2); }

/* Galerie horizontale épinglée */
.b-gallery { height: calc(var(--n) * 75svh + 100svh); }
.b-gallery .sticky { display: flex; flex-direction: column; justify-content: center; }
.gal-title { font: 700 12px/1.2 var(--font-display); letter-spacing: .2em; text-transform: uppercase; color: var(--fg-2); padding: 0 24px 18px; max-width: 1100px; }
.track { display: flex; gap: 12px; padding: 0 24px; will-change: transform; }
.track figure { flex: none; width: min(78vw, 560px); margin: 0; }
.track img { width: 100%; height: min(52svh, 420px); object-fit: cover; border-radius: 0; background: #222; }
.track figcaption { margin-top: 10px; font: 400 13px/1.45 var(--font-body); color: var(--fg-2); }
body.theme-dark .track figcaption { color: #C8C8C4; }
.track figcaption b { font: 800 13px var(--font-display); color: var(--accent); margin-right: 6px; }

/* Figures, grilles, citations */
.b-figure { margin: 48px auto; max-width: 960px; padding: 0 24px; }
.b-figure.narrow { max-width: 320px; }
.b-figure img { width: 100%; border-radius: 0; }
.b-figure figcaption, .b-grid figcaption { margin-top: 10px; font: 400 12.5px/1.5 var(--font-body); color: var(--fg-2); }
.b-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; max-width: 960px; margin: 30px auto; padding: 0 24px; }
.b-grid figure { margin: 0; }
.b-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0; }
.b-quote { max-width: 640px; margin: 48px auto; padding: 0 24px; text-align: left; }
.b-quote > * { max-width: 100%; }
.b-quote p { position: relative; margin: 0; padding: 26px 0 0; border-top: 1px solid var(--fg); font: italic 400 clamp(19px, 5.2vw, 24px)/1.45 var(--font-body); text-wrap: pretty; }
.b-quote p::before { content: '«'; display: block; margin-bottom: 14px; font: 800 56px/.6 var(--font-display); font-style: normal; color: var(--accent); }
.b-quote cite { display: block; padding: 14px 0 26px; border-bottom: 1px solid var(--fg); font: 400 13px/1.5 var(--font-body); color: var(--fg-2); font-style: normal; }
body.theme-light .b-quote p::before { color: var(--ink); background: linear-gradient(transparent 55%, var(--yellow) 55%); display: inline-block; padding: 0 4px; }
.b-note { max-width: 592px; margin: 10px auto 30px; padding: 14px 16px; border: 1px solid var(--fg); background: transparent; font-size: 13px; color: var(--fg-2); }

/* Encart de fin « Levez les yeux » */
.b-outro { max-width: 592px; margin: 48px auto 0; padding: 0 24px; }
.outro-box { padding: 36px 24px; border: 1px solid var(--fg); display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.outro-box h3 { font: 800 24px/1.2 var(--font-display); }
.outro-box p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--fg-2); }
body.theme-dark .outro-box p { color: #C8C8C4; }

/* Bloc final */
.b-info { max-width: 640px; margin: 40px auto 0; padding: 30px 24px calc(var(--safe-bottom) + 60px); }
.info-card { padding: 22px; border-radius: 0; background: transparent; border: 1px solid var(--fg); }
.info-card .kicker { padding: 4px 8px; background: var(--c); color: var(--ink); font-size: 10px; letter-spacing: .08em; }
.info-card .kicker i { display: none; }
.info-card h3 { font: 800 22px/1.2 var(--font-display); margin: 12px 0 8px; }
.info-addr { display: flex; gap: 6px; align-items: center; color: var(--fg-2); font-size: 13px; margin: 0 0 16px; }
body.theme-dark .info-card .btn-primary { background: var(--night-ink); color: var(--night); }
.b-info h4 { font: 700 12px/1 var(--font-display); text-transform: uppercase; letter-spacing: .2em; color: var(--fg-2); margin: 36px 0 12px; }
.nearby, .sources { list-style: none; margin: 0; padding: 0; }
.nearby li + li { margin-top: 10px; }
.nearby a { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--rule); border-radius: 0; text-decoration: none; }
.nearby a:hover { border-color: var(--fg); }
.nearby img { width: 64px; height: 64px; border-radius: 0; object-fit: cover; }
.nearby span { flex: 1; }
.nearby strong { font: 700 16px var(--font-display); }
.nearby small { display: block; color: var(--fg-2); font-size: 12.5px; }
.sources li { padding: 4px 0; font-size: 12.5px; }
.sources a { color: var(--fg-2); text-underline-offset: 3px; }
body.theme-dark .sources a { color: #C8C8C4; }

/* Fiches au thème clair (fiches simples, liaisons) : la barre reste sur fond blanc */
body.theme-light .story { padding-top: calc(var(--safe-top) + 64px); }
body.theme-light .story-bar { background: var(--white); border-bottom: 1px solid var(--line); }

/* ---------- Visites ---------- */
.page-head { max-width: 640px; margin: 0 auto; padding: calc(var(--safe-top) + 40px) 24px 0; display: flex; flex-direction: column; gap: 8px; }
.page-head h1 { font: 700 34px/1.1 var(--font-display); letter-spacing: -.01em; }
.page-head p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.visits-filters { padding: 18px 24px 6px; max-width: 640px; gap: 8px; }
.visits-filters .chip { height: 36px; padding: 0 14px; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.visits-filters .chip.on { background: var(--ink); color: var(--white); border-width: 1px; }
.visit-list { list-style: none; margin: 0 auto; padding: 8px 24px 24px; max-width: 640px; display: grid; gap: 0; }
.visit-list > li { border-bottom: 1px solid var(--line); }
.visit-card { display: flex; gap: 14px; padding: 16px 0; border-radius: 0; background: transparent; text-decoration: none; color: var(--ink); }
.visit-card:hover h2 { text-decoration: underline; text-underline-offset: 3px; }
.visit-cover { width: 100px; height: 124px; flex-shrink: 0; margin: 0; border-radius: 0; overflow: hidden; background: var(--ink); }
.visit-cover img { width: 100%; height: 100%; object-fit: cover; }
.visit-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 0; }
.visit-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.visit-body h2 { margin-top: 2px; font: 700 19px/1.15 var(--font-display); color: var(--ink); }
.visit-sub { margin: 0; color: var(--ink-3); font-size: 13px; line-height: 1.4; }
.visit-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: auto 0 0; font: 600 12px var(--font-body); color: var(--ink); }
.visit-meta .icon { display: none; }
.visit-meta i { width: 3px; height: 3px; background: var(--line-2); }
.visit-progress { height: 3px; background: var(--line); margin-top: 6px; overflow: hidden; }
.visit-progress b { display: block; height: 100%; background: var(--ink); }
.visit-card.compact { align-items: center; padding: 12px; border: 1px solid var(--ink); }
.visit-card.compact .visit-cover { width: 88px; height: 88px; }

.visit-detail { max-width: 640px; margin: 0 auto; padding-bottom: 24px; position: relative; }
.visit-back { position: absolute; z-index: 5; top: calc(var(--safe-top) + 14px); left: 16px; border: 0 !important; }
.visit-hero { margin: 0; height: 30svh; min-height: 230px; overflow: hidden; background: var(--ink); }
.visit-hero img { width: 100%; height: 100%; object-fit: cover; }
.visit-intro { padding: 22px 24px 0; display: flex; flex-direction: column; gap: 8px; }
.visit-author { margin: 0; font: 700 12px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.visit-intro h1, .visit-end h1 { font: 700 32px/1.05 var(--font-display); letter-spacing: -.01em; }
.visit-intro .visit-sub { font-size: 15px; color: var(--ink-2); }
.visit-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 12px 0 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.visit-stats span { display: flex; flex-direction: column; gap: 2px; padding: 12px 0 12px 14px; border-left: 1px solid var(--line); text-align: left; }
.visit-stats span:first-child { border-left: 0; padding-left: 0; }
.visit-stats .icon { display: none; }
.visit-stats b { font: 700 20px/1.2 var(--font-display); }
.visit-stats small { font-size: 12px; color: var(--ink-3); }
.visit-excerpt { margin: 10px 0 0; font-size: 15px; color: var(--ink); line-height: 1.6; }
.visit-map { height: 260px; margin: 24px 24px 0; border: var(--border); overflow: hidden; background: var(--map); }
.visit-steps { padding: 28px 24px 0; }
.visit-steps h2 { font: 700 12px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin-bottom: 6px; }
.vstep-list { list-style: none; margin: 0; padding: 0; }
.vstep { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.vstep-num { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: var(--border); background: var(--white); color: var(--ink); font: 700 13px var(--font-display); }
.vstep img { width: 52px; height: 52px; object-fit: cover; flex: none; }
.vstep-text { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.vstep-text strong { font: 700 15.5px/1.2 var(--font-display); }
.vstep-leg { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 0 13px; padding: 4px 0 4px 26px; border-left: 1px dashed var(--line-2); font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.vstep-leg .icon { display: none; }
.vstep-liaison { color: var(--ink); font-style: italic; }
.visit-actions { display: grid; gap: 10px; padding: 26px 24px 0; }
.dl-bar { width: 90px; height: 3px; background: var(--line); overflow: hidden; }
.dl-bar b { display: block; height: 100%; background: var(--ink); }

/* Étapes sur la carte : carrés numérotés */
.step-marker { background: none; border: 0; }
.step-marker span {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 0;
  background: var(--white); color: var(--ink); font: 700 11px/1 var(--font-display);
  border: 1px solid var(--ink); margin: 3px;
}
.step-marker.plain span { background: var(--ink); color: var(--white); }
.step-marker.done span { background: var(--ink); border-color: var(--ink); color: var(--white); }
.step-marker.current span { width: 34px; height: 34px; margin: -2px; background: var(--yellow); border: 1px solid var(--ink); font-size: 14px; font-weight: 800; }

/* Mode guidé */
body.page-guide { overflow: hidden; padding-bottom: 0; }
.guide { position: fixed; inset: 0 0 var(--tabbar-h) 0; }
.guide-map { position: absolute; inset: 0; background: var(--map); }
.guide-top { position: absolute; z-index: 500; top: calc(var(--safe-top) + 12px); left: 16px; right: 16px; display: flex; align-items: stretch; gap: 8px; }
.guide-top .icon-btn { width: 46px; height: auto; min-height: 46px; }
.guide-title { flex: 1; min-width: 0; padding: 9px 12px 10px; background: var(--white); border: var(--border); display: flex; flex-direction: column; gap: 6px; }
.guide-title > div:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.guide-title strong { display: block; font: 700 15px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guide-title small { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.guide-progress { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; }
.guide-progress i { height: 3px; background: var(--line); }
.guide-progress i.done { background: var(--ink); }
.guide-progress i.current { background: var(--yellow); outline: 1px solid var(--ink); }
.guide-card {
  position: absolute; z-index: 500; left: 12px; right: 12px; bottom: 12px; max-width: 560px; margin: 0 auto;
  padding: 14px; background: var(--white); border: var(--border); display: flex; flex-direction: column; gap: 14px;
}
.guide-step { display: flex; gap: 12px; align-items: flex-start; }
.guide-step img { width: 72px; height: 72px; object-fit: cover; flex: none; }
.guide-step > div { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; min-width: 0; }
.guide-kicker { display: flex; align-items: center; gap: 6px; margin: 0; font: 700 11px var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.guide-step h2 { font: 700 21px/1.15 var(--font-display); margin: 0; }
.guide-meta { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--ink-3); }
.guide-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.guide-actions > * { flex: 1 1 140px; }
.guide-actions .btn { min-height: 48px; font-size: 15px; padding: 0 14px; }
.guide-actions .btn-link { flex-basis: 100%; }
.guide-hint { flex-basis: 100%; display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.guide-card.arrived .guide-kicker { background: var(--yellow); padding: 3px 7px; }

/* Barre de visite (fiches et liaisons) */
.visit-bar {
  position: fixed; z-index: 950; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 10px); max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--white); border: var(--border); color: var(--ink);
}
.visit-bar img, .visit-bar-ic { width: 44px; height: 44px; object-fit: cover; flex: none; }
.visit-bar-ic { display: grid; place-items: center; background: var(--yellow); color: var(--ink); }
.visit-bar > span:not(.visit-bar-ic) { flex: 1; min-width: 0; display: grid; }
.visit-bar small { font: 700 10px var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visit-bar strong { font: 700 14px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visit-bar .btn { min-height: 42px; padding: 0 14px; flex: none; font-size: 14px; }
body.has-visit-bar .b-info, body.page-liaison .story { padding-bottom: 110px; }

/* Fin de visite */
.visit-end { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-top) + 48px) 24px 30px; text-align: center; }
.end-badge { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 18px; background: var(--ink); color: var(--yellow); }
.visit-end .visit-author { margin-bottom: 6px; }
.visit-end .visit-sub { margin-top: 8px; color: var(--ink-2); }
.visit-end .visit-stats { margin-top: 24px; }
.end-steps { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 0; text-align: left; }
.end-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.end-steps li.seen { color: var(--ink); }
.end-steps li span { flex: 1; font: 700 14px var(--font-display); }
.end-steps img { width: 40px; height: 40px; object-fit: cover; }
.end-next-title { font: 700 12px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); text-align: left; margin: 32px 0 12px; }
.visit-end .visit-card { text-align: left; }
.visit-end .visit-actions { padding: 22px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .laser, .scroll-cue i, .blink-eye { animation: none; }
  .reveal { transition: none; opacity: 1; transform: none; }
}
