/* خارطة حيفا العربية — concept «بأسمائها» — stylesheet
   Surfaces: limestone (#EDEAE2) for the app and the map land alike; white pages on it.
   Ink #1E1B2E. The 2014 map's purple ruling (#6B3F8F) is the record accent.
   Vermillion is reserved for «نراقب» (threatened). */

:root {
  --banner-h: 28px;
  --paper: #EDEAE2;
  --paper-2: #E4E0D6;
  --sheet: #FFFFFF;
  --ink: #1E1B2E;
  --ink-2: #4B4860;
  --ink-3: #807C92;
  --rule: #6B3F8F;
  --rule-2: #8E6AAE;
  --rule-soft: #EFE7F5;
  --watch: #D6452B;
  --watch-soft: #FBE9E4;
  --emerging: #2E7D5B;
  --emerging-soft: #E3F0E9;
  --altered: #B8862B;
  --lost: #8A8578;
  --line: rgba(30, 27, 46, 0.14);
  --line-2: rgba(30, 27, 46, 0.28);
  --f-name: 'Reem Kufi', 'IBM Plex Sans Arabic', sans-serif;
  --f-ui: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, sans-serif;
  --f-voice: 'Amiri', 'Noto Naskh Arabic', serif;
  --panel-w: 440px;
  --top-h: 56px;
  --radius: 2px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--f-ui);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="en"] body { line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--rule); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.name { font-family: var(--f-name); font-weight: 600; letter-spacing: 0; }
.voice { font-family: var(--f-voice); }
.num { font-variant-numeric: tabular-nums; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.demo-banner { position: sticky; top: 0; z-index: 90; height: var(--banner-h); line-height: var(--banner-h); text-align: center; font-size: 12.5px; font-weight: 600; color: #4a3800; background: #FFF4D6; border-bottom: 1px solid #E2C56E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; }
.top {
  position: sticky; top: var(--banner-h); z-index: 40;
  height: var(--top-h);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 0 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand .name { font-size: 20px; font-weight: 600; }
.brand small { color: var(--ink-3); font-size: 12.5px; }
.menu { display: flex; gap: 16px; justify-content: center; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
html[lang="en"] .menu { gap: 12px; font-size: 13px; }
html[lang="en"] .lens button { padding: 7px 12px; }
html[lang="en"] .brand small { display: none; }
.menu a { padding: 6px 0; border-bottom: 2px solid transparent; }
.menu a.on { color: var(--ink); border-color: var(--rule); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.btn-lang { padding: 4px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 13px; font-weight: 600; min-width: 38px; text-align: center; }
.burger { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; }
.burger span { display: block; width: 20px; height: 2px; background: var(--ink); box-shadow: 0 -6px 0 var(--ink), 0 6px 0 var(--ink); }
.mobile-menu { display: none; }

/* ── Lens control (three registers) ───────────────────────────────────────── */
.lens {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border: 1px solid var(--ink); border-radius: 3px; overflow: hidden; background: var(--sheet);
}
.lens button { padding: 7px 18px; font-weight: 600; font-size: 14px; line-height: 1.2; color: var(--ink-2); border-inline-end: 1px solid var(--line); }
.lens button:last-child { border-inline-end: 0; }
.lens button small { display: block; font-weight: 400; font-size: 11px; color: var(--ink-3); margin-top: 2px; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lens button.on { background: var(--ink); color: #fff; }
.lens button.on small { color: rgba(255,255,255,.7); }
.lens[data-lens="future"] button.on { background: var(--emerging); }
.lens-head { justify-self: center; }

.pp-back svg, .kind svg, .btn svg, .group-h svg { width: 14px; height: 14px; fill: currentColor; flex: none; }
.lens-float { display: none; }

/* ── Views ───────────────────────────────────────────────────────────────── */
.view { display: none; }
.view.on { display: block; }
main { min-height: calc(100vh - var(--top-h) - var(--banner-h)); }

/* ── Map view ────────────────────────────────────────────────────────────── */
.view-map.on { display: grid; grid-template-columns: var(--panel-w) 1fr; height: calc(100vh - var(--top-h) - var(--banner-h)); position: relative; }
.map-wrap { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; }
.maplibregl-ctrl-attrib { font-family: var(--f-ui); font-size: 10px; background: rgba(237,234,226,.85) !important; }
.map-legend {
  position: absolute; bottom: 14px; inset-inline-end: 14px; z-index: 5;
  background: rgba(255,255,255,.94); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 8px 12px; font-size: 12px; max-width: 300px; line-height: 1.5;
}
.map-legend .lg-t { font-weight: 600; margin-bottom: 4px; }
.map-legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.map-legend li { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--ink); flex: none; }
.dot.st-threatened { background: var(--watch); box-shadow: 0 0 0 2px var(--watch-soft); }
.dot.st-altered { background: var(--altered); }
.dot.st-lost { background: transparent; border: 1.5px dashed var(--lost); }
.dot.st-emerging { background: var(--emerging); }
.dot.st-standing { background: var(--ink); }
.map-note { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 5; font-size: 12px; background: rgba(255,255,255,.9); border: 1px solid var(--line); padding: 4px 10px; border-radius: var(--radius); max-width: 320px; }

/* Name-marks (places) */
.nm {
  position: absolute; top: 0; left: 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 8px; background: rgba(255,255,255,.94); border: 1px solid var(--line-2);
  border-radius: var(--radius); font-family: var(--f-name); font-weight: 600; font-size: 13.5px; line-height: 1.25; color: var(--ink);
  white-space: nowrap; cursor: pointer; transition: transform .15s ease, opacity .25s ease; opacity: 0;
  animation: nm-in .5s ease forwards; box-shadow: 0 1px 0 rgba(30,27,46,.08);
}
@keyframes nm-in { to { opacity: 1; } }
.nm:hover, .nm.on { transform: translateY(-1px); border-color: var(--ink); z-index: 10; }
.nm .nm-sub { font-family: var(--f-ui); font-weight: 500; font-size: 10.5px; color: var(--ink-3); }
.nm .nm-badges { display: inline-flex; gap: 4px; margin-inline-start: 2px; }
.nm .nm-badges svg { width: 11px; height: 11px; fill: var(--ink-3); }
.nm.st-lost { border-style: dashed; color: var(--lost); background: rgba(255,255,255,.75); }
.nm.st-lost .dot { border-color: var(--lost); }
.nm.st-threatened { border-color: var(--watch); }
.nm.st-threatened::before { content: ''; position: absolute; inset: -5px; border: 1.5px solid var(--watch); border-radius: 4px; opacity: .7; animation: watch-pulse 2.4s ease-out infinite; pointer-events: none; }
@keyframes watch-pulse { 0% { transform: scale(.96); opacity: .8; } 100% { transform: scale(1.18); opacity: 0; } }
.nm.st-threatened .nm-sub { color: var(--watch); font-weight: 600; }
.nm.st-altered .nm-name { text-decoration: underline; text-decoration-color: var(--altered); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.nm.st-emerging { border-color: var(--emerging); }
.nm.imagine { border-style: dashed; border-color: var(--emerging); color: var(--emerging); }
.nm.imagine .nm-sub { color: var(--emerging); }
.nm.imagine::before { border-color: var(--emerging); }
.nm.dim { opacity: .28 !important; pointer-events: none; }
.nm.hide { display: none; }
.nm.approx .nm-name::after { content: '≈'; font-family: var(--f-ui); font-size: 10px; color: var(--ink-3); margin-inline-start: 4px; vertical-align: super; }
@media (prefers-reduced-motion: reduce) { .nm, .nm.st-threatened::before { animation: none; opacity: 1; } }

/* Masar stop markers */
.sm { width: 26px; height: 26px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--ink); color: var(--ink); font: 600 12px/22px var(--f-ui); text-align: center; cursor: pointer; font-variant-numeric: tabular-nums; }
.sm.done { background: var(--ink); color: #fff; }
.sm.cur { background: var(--rule); border-color: var(--rule); color: #fff; box-shadow: 0 0 0 5px rgba(107,63,143,.28); transform: scale(1.18); }
.sm.approx { border-style: dashed; }

/* ── Panel (desktop column / mobile sheet) ───────────────────────────────── */
.panel { background: var(--sheet); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-handle { display: none; }
.panel-body { overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.panel-head { padding: 14px 20px 10px; border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 20px; font-size: 12.5px; line-height: 1.3; color: var(--ink-2); background: var(--sheet); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on svg { fill: #fff; }
.chip svg { width: 12px; height: 12px; fill: var(--ink-2); }
.chip.watch.on { background: var(--watch); border-color: var(--watch); }
.search { display: flex; align-items: center; gap: 8px; margin-top: 10px; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 7px 10px; color: var(--ink-3); font-size: 13px; }
.search svg { width: 14px; height: 14px; fill: var(--ink-3); }

.sec { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.sec-t { font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin: 0 0 8px; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 9px 0; border-top: 1px solid var(--line); align-items: center; cursor: pointer; }
.row:first-of-type { border-top: 0; }
.row:hover .name { color: var(--rule); }
.row .name { font-size: 16px; font-weight: 600; }
.row .meta { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.row .meta .st { display: inline-flex; align-items: center; gap: 5px; }
.row .badges { display: inline-flex; gap: 8px; color: var(--ink-3); font-size: 12px; }
.row .badges svg { width: 12px; height: 12px; fill: var(--ink-3); vertical-align: -1px; margin-inline-end: 2px; }
.row.hot { border-inline-start: 3px solid var(--watch); padding-inline-start: 10px; }
.row.hot .name { color: var(--watch); }
.row.masar-row .name::before { content: attr(data-n); display: inline-block; min-width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--rule); color: var(--rule); font: 600 12px/20px var(--f-ui); text-align: center; margin-inline-end: 8px; vertical-align: 3px; }
.row.masar-row.drawn .name::before { background: var(--rule); color: #fff; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 20px; border: 1px solid var(--line-2); color: var(--ink-2); line-height: 1.5; white-space: nowrap; }
.tag.approx { border-style: dashed; }
.tag.illus { background: #FFF4D6; border-color: #E2C56E; color: #6B4F00; font-weight: 600; }
.tag.watch { background: var(--watch-soft); border-color: var(--watch); color: var(--watch); font-weight: 600; }
.tag.future { background: var(--emerging-soft); border-color: var(--emerging); color: var(--emerging); }
.tag.old { color: var(--ink-3); border-color: var(--line); }

/* Source chips (citations) */
.src { display: inline-block; font-size: 10.5px; line-height: 1.4; padding: 0 6px; margin: 0 2px; border: 1px solid var(--rule-2); border-radius: 2px; color: var(--rule); background: var(--rule-soft); vertical-align: 2px; white-space: nowrap; cursor: help; font-family: var(--f-ui); font-weight: 500; }
.src-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: var(--ink-2); }
.src-list li { padding: 5px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.src-list li:first-child { border-top: 0; }

/* ── Place page ──────────────────────────────────────────────────────────── */
.pp-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.pp-back { font-size: 13px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.pp-title { font-size: 30px; line-height: 1.15; margin: 0; font-weight: 600; }
.pp-title-en { font-size: 15px; color: var(--ink-3); font-family: var(--f-ui); font-weight: 400; margin-top: 4px; }
.pp-status { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; }
.pp-status .dot { width: 11px; height: 11px; }
.pp-status b { font-weight: 600; }
.pp-status .note { color: var(--ink-2); }
.pp-kv { margin: 12px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 13.5px; }
.pp-kv dt { color: var(--ink-3); }
.pp-kv dd { margin: 0; }
.names-row { display: flex; flex-wrap: wrap; gap: 6px; }
.names-row .nchip { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 2px 6px; padding: 2px 9px; border: 1px solid var(--line-2); border-radius: var(--radius); font-family: var(--f-name); font-weight: 600; font-size: 14px; }
.names-row .nchip b { font-weight: 600; white-space: nowrap; }
.names-row .nchip small { font-family: var(--f-ui); font-weight: 400; font-size: 11px; color: var(--ink-3); }
.regs { display: inline-flex; gap: 10px; font-size: 12.5px; }
.regs span { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-3); }
.regs span.on { color: var(--ink); font-weight: 600; }
.regs i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; display: inline-block; }
.regs span.on i { background: currentColor; }
.regs span.future.on { color: var(--emerging); }

.media-filter { position: sticky; top: 0; z-index: 3; background: var(--sheet); padding: 10px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.media-filter::-webkit-scrollbar { display: none; }
.media-filter .chip { white-space: nowrap; padding: 3px 8px; font-size: 12px; }

/* The record stream: equal-weight cards */
.stream { padding: 10px 20px 30px; display: grid; grid-template-columns: 1fr; gap: 14px; }
.card { background: var(--sheet); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.card.hide { display: none; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.card-h .kind { display: inline-flex; align-items: center; gap: 7px; }
.card-h svg { width: 14px; height: 14px; fill: var(--ink-2); }
.card-b { padding: 14px; }
.card-b p { margin: 0 0 10px; }
.card-b p:last-child { margin-bottom: 0; }
.card.photo .card-b { padding: 0; }
.card.photo img { width: 100%; height: auto; image-rendering: auto; }
.card.photo figcaption, .cap { padding: 10px 14px; font-size: 12.5px; color: var(--ink-2); border-top: 1px solid var(--line); }
.card.voice { border-inline-start: 4px solid var(--rule); }
.card.voice blockquote { margin: 0; font-family: var(--f-voice); font-size: 19px; line-height: 1.85; color: var(--ink); }
html[lang="en"] .card.voice blockquote { font-size: 17px; line-height: 1.6; }
.card.voice .who { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.card.voice .who .name { font-size: 16px; }
.card.voice .who small { color: var(--ink-3); font-size: 12px; }
.audio-ph { margin-top: 12px; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-3); font-size: 12px; }
.audio-ph .play { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; }
.audio-ph .play svg { width: 14px; height: 14px; fill: var(--ink-3); margin-inline-start: 2px; }
.audio-ph .wave { height: 26px; background: repeating-linear-gradient(90deg, var(--line-2) 0 2px, transparent 2px 5px); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); opacity: .6; margin-bottom: 4px; }
.card.doc .scan { background: var(--paper-2); padding: 14px; display: grid; place-items: center; }
.card.doc .scan img { max-height: 420px; width: auto; box-shadow: 0 2px 10px rgba(0,0,0,.18); border: 1px solid rgba(0,0,0,.08); }
.card.doc table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.card.doc td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.card.doc td:first-child { color: var(--ink-3); width: 36%; }
.card.doc tr:first-child td { border-top: 0; }
.card.builder .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card.builder .acct { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.card.builder .acct h4 { margin: 0 0 6px; font-size: 13px; color: var(--ink-3); font-weight: 500; }
.card.builder .acct .who { font-family: var(--f-name); font-weight: 600; font-size: 20px; margin-bottom: 6px; }
.card.builder .acct q { font-family: var(--f-voice); font-size: 15.5px; line-height: 1.75; quotes: '«' '»'; }
.card.builder .note { margin-top: 12px; padding: 10px 12px; background: var(--rule-soft); border-radius: var(--radius); font-size: 13px; }
.card.builder .admits { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.inscription { text-align: center; font-family: var(--f-voice); font-size: 20px; line-height: 2; padding: 10px 0 4px; }
.inscription .tail { font-size: 14px; color: var(--ink-3); }
.outdated { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; background: var(--paper); border-radius: var(--radius); font-size: 13.5px; }
.outdated .tag { background: var(--sheet); }
.events { list-style: none; margin: 0; padding: 0; }
.events li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.events li:first-child { border-top: 0; }
.events .when { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--rule); }
.events li.now .when { color: var(--watch); }
.card.watch { border-color: var(--watch); }
.card.watch .card-h { color: var(--watch); background: var(--watch-soft); }
.card.watch .card-h svg { fill: var(--watch); }
.card.watch .status { font-weight: 600; margin: 6px 0 10px; }
.card.watch .rules { font-size: 12px; color: var(--ink-2); border-top: 1px dashed var(--line-2); padding-top: 8px; margin-top: 10px; }
.card.future { border-style: dashed; border-color: var(--emerging); }
.card.future .card-h { color: var(--emerging); }
.card.future .card-h svg { fill: var(--emerging); }
.card.future .empty { color: var(--ink-2); font-size: 14px; }
.card.three .frame { aspect-ratio: 16 / 10; background: var(--paper-2); position: relative; }
.card.three iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.card.three .poster { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; background: linear-gradient(180deg, #DAD5C8, #CFC9BA); }
.card.three .poster button { padding: 10px 18px; background: var(--ink); color: #fff; border-radius: var(--radius); font-weight: 600; }
.card.three .poster small { display: block; margin-top: 10px; color: var(--ink-2); font-size: 12px; }
.links { list-style: none; margin: 0; padding: 0; }
.links li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.links li:first-child { border-top: 0; }
.links .name { font-size: 16px; }
.links .rel { color: var(--ink-2); font-size: 13px; }

/* ── Masar panel ─────────────────────────────────────────────────────────── */
.ms-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.ms-head .eyebrow { font-size: 12.5px; color: var(--ink-3); }
.ms-head h2 { margin: 2px 0 6px; font-size: 24px; line-height: 1.2; font-weight: 600; }
.ms-head .facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); }
.progress { margin-top: 12px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.progress .bar { height: 4px; background: var(--paper-2); border-radius: 2px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--ink); }
.stop-card { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.stop-card .n { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.stop-card .n i { width: 24px; height: 24px; border-radius: 50%; background: var(--rule); color: #fff; display: inline-grid; place-items: center; font-style: normal; font-size: 12px; }
.stop-card h3 { margin: 6px 0 10px; font-size: 24px; line-height: 1.2; font-weight: 600; }
.stop-card .pics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stop-card .pics.one { grid-template-columns: 1fr; }
.stop-card .pics img { width: 100%; height: 150px; object-fit: cover; border: 1px solid var(--line); }
.stop-card .pics figcaption { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.stop-card p.txt { font-size: 15px; margin: 0 0 10px; }
.stop-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--ink); border-radius: var(--radius); font-weight: 600; font-size: 14px; background: var(--sheet); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.ghost { border-color: var(--line-2); font-weight: 500; }
.btn:disabled { opacity: .4; cursor: default; }
.stop-list { padding: 8px 20px 30px; }
.stop-list .row { grid-template-columns: 28px 1fr auto; }
.stop-list .row .k { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink); color: var(--ink); font: 600 11px/20px var(--f-ui); text-align: center; }
.stop-list .row.done .k { background: var(--ink); color: #fff; }
.stop-list .row.cur .k { background: var(--rule); border-color: var(--rule); color: #fff; }
.stop-list .row .name { font-size: 15px; }
.narr { margin-top: 12px; }

/* ── Names view ──────────────────────────────────────────────────────────── */
.nm-list .row { grid-template-columns: 1fr auto; cursor: pointer; }
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: baseline; }
.pair .old { font-family: var(--f-name); font-weight: 600; font-size: 17px; }
.pair .arrow { color: var(--ink-3); font-size: 13px; }
.pair .now { font-size: 14px; color: var(--ink-2); text-align: end; }
.pair .now b { font-weight: 600; color: var(--ink); }
.pair .now small { display: block; font-size: 11px; color: var(--ink-3); }
.group-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 0 4px; }
.group-h h3 { margin: 0; font-size: 15px; }
.group-h .count { font-size: 12px; color: var(--ink-3); }
.swatch { width: 18px; height: 4px; display: inline-block; background: var(--rule); vertical-align: middle; margin-inline-end: 6px; border-radius: 2px; }
.swatch.kept { background: var(--rule-2); opacity: .5; }
.swatch.masar { background: var(--ink); height: 4px; border-radius: 2px; }

/* ── Home ────────────────────────────────────────────────────────────────── */
.home { display: grid; grid-template-columns: minmax(380px, 520px) 1fr; min-height: calc(100vh - var(--top-h) - var(--banner-h)); }
.home-text { padding: 56px 48px 40px; display: flex; flex-direction: column; gap: 28px; }
.home h1 { font-size: 54px; line-height: 1.1; margin: 0; font-weight: 600; }
.home h1 small { display: block; font-family: var(--f-ui); font-weight: 400; font-size: 16px; color: var(--ink-3); margin-top: 10px; }
.home .def { font-size: 18px; line-height: 1.75; margin: 0; max-width: 34em; }
.home .enter { border-top: 1px solid var(--line-2); }
.home .enter .lead { font-size: 12.5px; color: var(--ink-3); padding: 10px 0 2px; }
.home .enter a { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.home .enter a:hover .name { color: var(--rule); }
.home .enter .name { font-size: 24px; }
.home .enter .hint { color: var(--ink-2); font-size: 14px; }
.home .enter .ex { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.home .enter a.future .name { color: var(--emerging); }
.home .stats { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: var(--ink-2); }
.home .stats b { font-size: 20px; font-weight: 600; color: var(--ink); margin-inline-end: 5px; font-variant-numeric: tabular-nums; }
.home-map { position: relative; border-inline-start: 1px solid var(--line); min-height: 420px; }
.home-map #home-map { position: absolute; inset: 0; }
.home-map .names-note { position: absolute; top: 18px; inset-inline-start: 18px; z-index: 5; max-width: 330px; background: rgba(255,255,255,.94); border: 1px solid var(--line-2); padding: 12px 14px; border-radius: var(--radius); font-size: 13.5px; }
.home-map .names-note b { display: block; font-family: var(--f-name); font-size: 18px; margin-bottom: 4px; }
.home-map .open { position: absolute; bottom: 20px; inset-inline-start: 18px; z-index: 5; }
.home-map .open .btn { box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.home-now { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-2); background: var(--sheet); }
.home-now > div { padding: 22px 28px 26px; border-inline-end: 1px solid var(--line); }
.home-now > div:last-child { border-inline-end: 0; }
.home-now .k { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }
.home-now .k.watch { color: var(--watch); font-weight: 600; }
.home-now blockquote { margin: 0; font-family: var(--f-voice); font-size: 18px; line-height: 1.8; }
.home-now .by { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.home-now .by .name { font-size: 15px; }
.home-now .pair .old { font-size: 26px; }
.home-now .pair .now { font-size: 16px; }
.home-now .hp .name { font-size: 20px; }
.home-now .hp .st { color: var(--watch); font-weight: 600; font-size: 13px; margin: 4px 0 6px; }
.home-now .hp p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.home-now a.more { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--rule); border-bottom: 1px solid var(--rule-2); }

/* ── Full pages (ask / add / about / masarat index) ──────────────────────── */
.page { max-width: 880px; margin: 0 auto; padding: 36px 24px 60px; }
.page h1 { font-size: 40px; line-height: 1.15; margin: 0 0 8px; font-weight: 600; }
.page .lead { font-size: 17px; color: var(--ink-2); margin: 0 0 24px; max-width: 40em; }
.qa { background: var(--sheet); border: 1px solid var(--line-2); border-radius: var(--radius); margin-bottom: 18px; }
.qa .q { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.qa .q .bubble { flex: 1; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 16px; }
.qa .q .ask { padding: 10px 14px; background: var(--ink); color: #fff; border-radius: var(--radius); font-weight: 600; }
.qa .a { padding: 16px 18px; }
.qa .a h4 { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.qa .a p { margin: 0 0 10px; font-size: 15.5px; }
.qa .a .cites { display: grid; gap: 8px; margin-top: 12px; }
.qa .a .cite { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 10px 12px; background: var(--rule-soft); border-radius: var(--radius); font-size: 13.5px; }
.qa .a .cite .n { width: 22px; height: 22px; border-radius: 50%; background: var(--rule); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.qa .a .cite q { font-family: var(--f-voice); quotes: '«' '»'; }
.qa .a .cite small { display: block; color: var(--ink-3); margin-top: 3px; }
.qa.decline .a { background: var(--paper); }
.qa.decline .a h4 { color: var(--watch); }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 18px 0 22px; }
.steps div { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 13px; color: var(--ink-2); background: var(--sheet); }
.steps div.on { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.steps div span { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.form { background: var(--sheet); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 20px; display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.form input, .form textarea, .form select { font: inherit; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--sheet); color: var(--ink); }
.form .flags { display: grid; gap: 10px; }
.form .flag { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.form .flag input { margin-top: 4px; }
.form .flag small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.form .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form .actions small { color: var(--ink-3); font-size: 12.5px; }
.imagine-case { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px 18px; background: var(--sheet); border: 1px dashed var(--emerging); border-radius: var(--radius); margin-bottom: 12px; }
.imagine-case .name { font-size: 22px; }
.imagine-case .st { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.vision { background: var(--sheet); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px; position: relative; }
.vision .tag.illus { position: absolute; top: 12px; inset-inline-end: 12px; }
.vision h3 { margin: 0 0 12px; font-size: 22px; font-weight: 600; }
.vision .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vision .box { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 12px; min-height: 110px; }
.vision .box h4 { margin: 0 0 6px; font-size: 13px; color: var(--emerging); }
.vision .box p { margin: 0; color: var(--ink-3); font-size: 13.5px; }
.vision .draw { margin-top: 14px; height: 90px; border: 1px dashed var(--line-2); border-radius: var(--radius); display: grid; place-items: center; color: var(--ink-3); font-size: 12.5px; background: repeating-linear-gradient(45deg, transparent 0 8px, rgba(30,27,46,.03) 8px 16px); }
.vision .meta { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--line-2); padding: 22px 24px 28px; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; justify-content: space-between; background: var(--paper); }
footer .credit { font-weight: 600; color: var(--ink); }
footer .credit a { border-bottom: 1px solid var(--line-2); }
.view-map.on ~ footer { display: none; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  :root { --top-h: 50px; }
  body { font-size: 14.5px; }
  .top { grid-template-columns: 1fr auto; padding: 0 12px; gap: 8px; }
  .brand .name { font-size: 17px; }
  .brand small { display: none; }
  .menu, .lens-head { display: none; }
  .burger { display: flex; }
  .mobile-menu.open { display: flex; flex-direction: column; position: fixed; top: calc(var(--top-h) + var(--banner-h)); inset-inline: 0; z-index: 39; background: var(--sheet); border-bottom: 1px solid var(--line-2); padding: 6px 0 10px; }
  .mobile-menu a { padding: 11px 18px; font-size: 16px; border-top: 1px solid var(--line); }
  .mobile-menu a.on { color: var(--rule); font-weight: 600; }

  .view-map.on { display: block; height: calc(100vh - var(--top-h) - var(--banner-h)); overflow: hidden; }
  .map-wrap { position: absolute; inset: 0; }
  .nm { font-size: 12.5px; padding: 2px 7px 2px 6px; gap: 5px; }
  .map-legend { display: none; }
  .map-note { top: 10px; inset-inline-start: 10px; max-width: 70vw; font-size: 11px; }
  .lens-float { display: flex; position: fixed; z-index: 31; inset-inline: 0; display: flex; justify-content: center; pointer-events: none; transition: bottom .25s ease; }
  .lens-float .lens { pointer-events: auto; box-shadow: 0 2px 10px rgba(0,0,0,.14); }
  .lens button { padding: 7px 14px; font-size: 13px; }
  .lens button small { display: none; }

  .panel {
    position: fixed; z-index: 30; inset-inline: 0; bottom: 0; top: auto;
    height: calc(100vh - var(--top-h) - var(--banner-h) - 8px); max-height: calc(100vh - var(--top-h) - var(--banner-h) - 8px);
    border: 1px solid var(--line-2); border-bottom: 0; border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,.12);
    transform: translateY(calc(100% - 118px));
    transition: transform .3s cubic-bezier(.2,.8,.2,1);
    touch-action: none;
  }
  .panel[data-sheet="half"] { transform: translateY(46%); }
  .panel[data-sheet="full"] { transform: translateY(0); }
  .panel.dragging { transition: none; }
  .panel-handle { display: grid; place-items: center; height: 22px; cursor: grab; }
  .panel-handle i { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); }
  .panel-body { touch-action: pan-y; }
  .panel-head { padding: 6px 16px 10px; }
  .sec, .stream, .stop-list { padding-inline: 16px; }
  .pp-head, .ms-head, .stop-card { padding-inline: 16px; }
  .pp-title { font-size: 26px; }
  .media-filter { padding-inline: 16px; }
  .card.builder .two { grid-template-columns: 1fr; }
  .events li { grid-template-columns: 90px 1fr; font-size: 13.5px; }
  .card.doc .scan img { max-height: 300px; }

  .home { grid-template-columns: 1fr; }
  .home-text { padding: 28px 20px 20px; gap: 20px; }
  .home h1 { font-size: 40px; }
  .home .def { font-size: 16px; }
  .home .enter a { grid-template-columns: 90px 1fr; }
  .home .enter .ex { grid-column: 2; white-space: normal; }
  .home .enter .name { font-size: 21px; }
  .home-map { min-height: 0; height: auto; border-inline-start: 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; }
  .home-map #home-map { position: relative; inset: auto; height: 320px; }
  .home-map .names-note { position: static; max-width: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--sheet); font-size: 13.5px; padding: 14px 20px; order: 2; }
  .home-map .open { bottom: auto; top: 258px; inset-inline-start: 14px; }
  .pp-kv { grid-template-columns: 1fr; gap: 2px 0; }
  .pp-kv dt { font-size: 12px; margin-top: 6px; }
  .home-now { grid-template-columns: 1fr; }
  .home-now > div { border-inline-end: 0; border-top: 1px solid var(--line); padding: 18px 20px; }
  .page { padding: 24px 16px 48px; }
  .page h1 { font-size: 32px; }
  .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .steps div { padding: 8px 6px; font-size: 11px; }
  .steps div span { display: none; }
  .vision .two { grid-template-columns: 1fr; }
  .qa .q { flex-direction: column; align-items: stretch; }
  footer { justify-content: flex-start; }
}
@media (min-width: 761px) and (max-width: 1100px) { :root { --panel-w: 380px; } .menu { gap: 12px; font-size: 13px; } }
@media (min-width: 1600px) { :root { --panel-w: 500px; } .home h1 { font-size: 62px; } }

/* ── 3D: map mode, entrance, the open visit ─────────────────────────────── */
.map-3d-btn { position: absolute; top: 50px; inset-inline-start: 12px; z-index: 6; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--sheet); border: 1px solid var(--ink); border-radius: var(--radius); font-weight: 600; font-size: 13px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.map-3d-btn svg { width: 15px; height: 15px; fill: currentColor; }
.map-3d-btn.on { background: var(--rule); border-color: var(--rule); color: #fff; }
.map-3d-btn small { font-weight: 400; color: var(--ink-3); }
.map-3d-btn.on small { color: rgba(255,255,255,.8); }
.nm .nm-3d { font-family: var(--f-ui); font-weight: 700; font-size: 10px; letter-spacing: .02em; padding: 1px 6px; border-radius: 10px; background: var(--rule); color: #fff; margin-inline-start: 2px; cursor: pointer; }
.nm .nm-3d:hover { background: var(--ink); }
body.three-d .nm { box-shadow: 0 2px 6px rgba(30,27,46,.18); }
body.three-d .nm.st-standing:not(.has3d) { opacity: .85; }
.row.visit3d { border-inline-start: 3px solid var(--rule); padding-inline-start: 10px; }
.row.visit3d .name { color: var(--rule); }
.row.coming { opacity: .8; }
.row.coming .name { color: var(--ink-3); font-family: var(--f-ui); font-weight: 500; font-size: 14px; border: 1px dashed var(--line-2); padding: 6px 10px; border-radius: var(--radius); }
.btn.visit { background: var(--rule); border-color: var(--rule); color: #fff; }
.btn.visit svg { width: 14px; height: 14px; fill: currentColor; }

body.visiting .panel { display: none; }
body.visiting .view-map.on { grid-template-columns: 1fr; }
body.visiting .lens-float, body.visiting .map-legend, body.visiting .map-note, body.visiting .map-3d-btn { display: none; }
body.visiting .maplibregl-ctrl-top-left, body.visiting .maplibregl-ctrl-top-right { display: none; }

#visit { display: none; }
#visit.on { display: block; position: absolute; inset: 0; z-index: 20; pointer-events: none; }
#visit.on.inside { position: fixed; inset: var(--banner-h) 0 0 0; z-index: 80; pointer-events: auto; background: #0F0D16; }

/* Entrance frame (approach stage) */
.entrance { pointer-events: auto; position: absolute; inset-inline-start: 24px; top: 24px; width: 400px; max-width: calc(100% - 48px); background: var(--sheet); border: 1px solid var(--ink); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(20,16,36,.25); overflow: hidden; animation: ent-in .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: .9s; }
@keyframes ent-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.entrance .poster { position: relative; aspect-ratio: 4 / 3; background: var(--paper-2); overflow: hidden; }
.entrance .poster img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.85); }
.entrance .poster .k { position: absolute; top: 10px; inset-inline-start: 10px; background: rgba(255,255,255,.9); padding: 2px 8px; border-radius: 2px; font-size: 11px; color: var(--ink-2); }
.entrance .poster .enter-dot { position: absolute; inset-inline-end: 14px; bottom: 14px; width: 54px; height: 54px; border-radius: 50%; background: var(--rule); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 8px rgba(107,63,143,.25); animation: watch-pulse 2.4s ease-out infinite; }
.entrance .poster .enter-dot svg { width: 22px; height: 22px; fill: #fff; }
.entrance .body { padding: 14px 16px 16px; }
.entrance .eyebrow { font-size: 12px; color: var(--ink-3); }
.entrance h2 { margin: 2px 0 6px; font-size: 26px; line-height: 1.15; font-weight: 600; }
.entrance .st { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-bottom: 8px; }
.entrance .st .dot { margin-top: 6px; }
.entrance .note { font-size: 12px; color: var(--ink-2); background: var(--paper); padding: 8px 10px; border-radius: var(--radius); margin-bottom: 12px; }
.entrance .actions { display: grid; gap: 8px; }
.entrance .data { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; }

/* The open visit */
.visit-top { position: absolute; top: 0; inset-inline: 0; height: 56px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 0 14px; background: rgba(15,13,22,.92); color: #fff; border-bottom: 1px solid rgba(255,255,255,.12); z-index: 3; }
.visit-top .exit { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.35); border-radius: var(--radius); font-weight: 600; font-size: 13px; color: #fff; }
.visit-top svg { width: 14px; height: 14px; fill: currentColor; flex: none; }
.visit-top .title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.visit-top .title .name { font-size: 20px; white-space: nowrap; }
.visit-top .title .stat { flex: 1; min-width: 0; font-size: 12.5px; color: rgba(255,255,255,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visit-top .title .dot { width: 9px; height: 9px; flex: none; }
.visit-top .tools { display: flex; gap: 8px; }
.visit-top .tools button, .visit-top .tools a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 34px; padding: 0 10px; border: 1px solid rgba(255,255,255,.3); border-radius: var(--radius); font-size: 12.5px; color: #fff; }
.visit-stage { position: absolute; top: 56px; bottom: 0; inset-inline-start: 380px; inset-inline-end: 0; background: #0F0D16; z-index: 1; }
.visit-stage iframe { height: calc(100% - 88px); }
.visit-stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.visit-stage .loading { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.6); font-size: 13px; pointer-events: none; }
.visit-rail { position: absolute; top: 56px; bottom: 0; inset-inline-start: 0; width: 380px; background: var(--sheet); border-inline-end: 1px solid var(--line-2); overflow-y: auto; z-index: 2; }
.visit-rail .scan-note { padding: 12px 16px; background: #FFF4D6; border-bottom: 1px solid #E2C56E; font-size: 12.5px; color: #4a3800; }
.visit-rail .scan-note b { display: block; font-size: 11.5px; color: #6B4F00; margin-bottom: 2px; }
.visit-rail .status { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; }
.visit-rail .status .dot { margin-top: 7px; }
.visit-rail h3 { margin: 0; padding: 14px 16px 6px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.chapters { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.chapters::-webkit-scrollbar { display: none; }
.chapters .chip { white-space: nowrap; }
.chapter { padding: 4px 16px 18px; border-bottom: 1px solid var(--line); }
.chapter h4 { margin: 0 0 8px; font-size: 22px; font-weight: 600; }
.chapter p { margin: 0 0 8px; font-size: 14px; }
.chapter .ev { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.chapter .ev li { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 4px 0; border-top: 1px solid var(--line); }
.chapter .ev .when { font-weight: 600; color: var(--rule); }
.chapter .ev li.now .when { color: var(--watch); }
.chapter blockquote { margin: 10px 0 0; padding: 10px 12px; border-inline-start: 3px solid var(--rule); background: var(--rule-soft); font-family: var(--f-voice); font-size: 17px; line-height: 1.75; }
html[lang="en"] .chapter blockquote { font-size: 15px; line-height: 1.55; }
.chapter blockquote footer { font-family: var(--f-ui); font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.thennow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.thennow figure { margin: 0; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.thennow img { width: 100%; height: 130px; object-fit: cover; display: block; }
.thennow .now { height: 130px; display: grid; place-items: center; text-align: center; padding: 10px; color: var(--ink-2); font-size: 12px; background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(107,63,143,.06) 8px 16px); }
.thennow .now svg { width: 28px; height: 28px; fill: var(--rule); }
.thennow figcaption { font-size: 11.5px; color: var(--ink-3); padding: 6px 8px; border-top: 1px solid var(--line); }
.visit-rail .other { padding: 12px 16px 24px; }
.visit-rail .other .chips { margin-top: 6px; }
.visit-rail .nav-note { padding: 0 16px 14px; font-size: 11.5px; color: var(--ink-3); }
.rail-handle { display: none; }
.rotate-hint { display: none; }

@media (max-width: 760px) {
  .map-3d-btn { top: 78px; inset-inline-start: 12px; }
  body[data-sheet="full"] .map-3d-btn { display: none; }
  .entrance { inset-inline-start: 12px; inset-inline-end: 12px; width: auto; max-width: none; top: auto; bottom: 12px; animation-delay: 1.2s; }
  .entrance .poster { aspect-ratio: 16 / 7; }
  .entrance h2 { font-size: 22px; }
  .visit-top { height: 50px; grid-template-columns: auto 1fr auto; gap: 8px; padding: 0 10px; }
  .visit-top .title .name { font-size: 16px; }
  .visit-top .title .stat { display: none; }
  .visit-top .exit span { display: none; }
  .visit-stage { top: 50px; inset-inline: 0; bottom: 0; }
  .visit-stage iframe { height: 100%; }
  .visit-rail { top: auto; bottom: 0; inset-inline: 0; width: auto; height: 62vh; max-height: 62vh; border: 1px solid var(--line-2); border-bottom: 0; border-radius: 14px 14px 0 0; transform: translateY(calc(100% - 158px)); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -4px 18px rgba(0,0,0,.3); }
  .visit-rail.open { transform: translateY(0); }
  .rail-handle { display: grid; place-items: center; height: 22px; cursor: pointer; }
  .rail-handle i { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); }
  .visit-rail .scan-note { padding: 8px 14px; font-size: 11.5px; }
  .visit-rail .scan-note b { display: inline; margin-inline-end: 6px; }
  .visit-rail .status { font-size: 12.5px; padding: 8px 14px; }
  .visit-rail h3 { padding: 8px 14px 4px; }
  .chapters { padding: 0 14px 8px; }
  .chapter { padding: 4px 14px 14px; }
  .chapter h4 { font-size: 19px; }
  .thennow img, .thennow .now { height: 100px; }
  .rotate-hint { display: block; position: absolute; top: 58px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 3; background: rgba(255,255,255,.92); color: var(--ink); font-size: 11.5px; padding: 4px 10px; border-radius: 12px; }
  html[dir="rtl"] .rotate-hint { transform: translateX(50%); }
}
@media (max-width: 900px) and (orientation: landscape) {
  .visit-rail { transform: translateY(calc(100% - 44px)); height: 70vh; max-height: 70vh; }
  .visit-rail .rail-peek, .visit-rail .strip.in-rail { display: none; }
  .rotate-hint { display: none; }
  .visit-top { height: 44px; }
  .visit-stage { top: 44px; }
}


/* ── Round 3: threshold · see/not-see cards · media strip · simpler cards ── */
#visit.on.thr { position: fixed; inset: var(--banner-h) 0 0 0; z-index: 80; pointer-events: auto; background: rgba(237,234,226,.66); backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); overflow-y: auto; animation: thr-in .55s ease both; animation-delay: 1.5s; }
@keyframes thr-in { from { opacity: 0; } to { opacity: 1; } }
.thr-wrap { min-height: 100%; display: grid; grid-template-columns: minmax(380px, 640px) minmax(320px, 430px); gap: 48px; align-items: center; justify-content: center; padding: 40px; }
.door { position: relative; margin: 0; border: 6px solid var(--sheet); border-radius: 50% 50% 6px 6px / 30% 30% 6px 6px; overflow: hidden; box-shadow: 0 24px 60px rgba(20,16,36,.28); background: #0F0D16; aspect-ratio: 4 / 3; cursor: pointer; }
.door img { width: 100%; height: 100%; object-fit: cover; display: block; }
.door .cap { position: absolute; bottom: 0; inset-inline: 0; margin: 0; padding: 22px 14px 9px; font-size: 11.5px; color: #fff; background: linear-gradient(0deg, rgba(0,0,0,.6), transparent); }
.thr-text .eyebrow { font-size: 12.5px; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; }
.thr-text .eyebrow svg { width: 14px; height: 14px; fill: var(--rule); }
.thr-text h1 { margin: 6px 0 2px; font-size: 46px; line-height: 1.1; font-weight: 600; }
.thr-text .scope { font-size: 15px; color: var(--ink-2); margin-bottom: 16px; }
.thr-status { border-inline-start: 4px solid var(--watch); background: var(--watch-soft); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 10px; }
.thr-status b { color: var(--watch); display: block; font-size: 15px; }
.thr-status span { font-size: 13px; color: var(--ink-2); }
.thr-date { border: 1px dashed var(--ink-3); padding: 9px 12px; font-size: 13px; color: var(--ink-2); border-radius: var(--radius); margin-bottom: 14px; }
.thr-scope { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 7px; font-size: 14px; }
.thr-scope li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; align-items: baseline; }
.thr-scope i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; background: var(--rule); position: relative; top: 1px; }
.thr-scope li.out i { background: transparent; border: 1.5px dashed var(--ink-3); }
.thr-scope small { color: var(--ink-2); }
.thr-cta { display: block; }
.thr-enter { display: inline-flex; align-items: center; gap: 12px; padding: 13px 28px; background: var(--rule); color: #fff; border-radius: var(--radius); font-weight: 700; font-size: 20px; box-shadow: 0 6px 18px rgba(107,63,143,.3); }
.thr-enter svg { width: 20px; height: 20px; fill: currentColor; }
.thr-enter:hover { background: var(--ink); }
.thr-notes { list-style: none; margin: 12px 0 0; padding: 0; font-size: 12.5px; color: var(--ink-2); display: grid; gap: 4px; }
.thr-links { margin-top: 14px; font-size: 13.5px; display: flex; gap: 16px; }
.thr-links a { border-bottom: 1px solid var(--line-2); }
.thr-foot { margin-top: 14px; font-size: 11.5px; color: var(--ink-3); }

.visit-top .title .chips2 { display: inline-flex; gap: 8px; align-items: center; min-width: 0; overflow: hidden; }
.vchip { font-size: 12px; padding: 4px 10px; border-radius: 2px; white-space: nowrap; }
.vchip.watch { background: rgba(214,69,43,.2); color: #FFB7A6; border: 1px solid rgba(214,69,43,.65); font-weight: 600; }
.vchip.date { border: 1px dashed rgba(255,255,255,.45); color: rgba(255,255,255,.82); }
.rail-peek { display: none; }

.see-h { font-family: var(--f-name); font-weight: 600; font-size: 22px; padding: 14px 16px 2px; }
.see-g { padding: 10px 16px 0; font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.see-g i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); display: inline-block; }
.see-g.out i { background: transparent; border: 1.5px dashed var(--ink-3); }
.spots { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 16px 2px; }
.spot { padding: 8px 12px; border: 1.5px solid var(--ink); border-radius: var(--radius); font-weight: 600; font-size: 14px; background: var(--sheet); }
.spot.out { border-style: dashed; border-color: var(--ink-2); font-weight: 500; }
.spot.on { background: var(--ink); color: #fff; border-color: var(--ink); border-style: solid; }
.scard { margin: 12px 16px; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 16px 14px; background: var(--sheet); }
.scard .h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.scard .h h4 { margin: 0; font-size: 24px; font-weight: 600; }
.it { padding: 10px 0; border-top: 1px dotted var(--line-2); }
.it:first-of-type { border-top: 0; }
.it .when { font-weight: 700; font-size: 13px; color: var(--rule); font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.it.now .when { color: var(--watch); }
.it p { margin: 0; font-size: 14.5px; line-height: 1.7; }
.it p.q { font-family: var(--f-voice); font-size: 16.5px; line-height: 1.75; }
html[lang="en"] .it p.q { font-size: 15px; line-height: 1.55; }
.it .by { font-size: 13px; margin-top: 4px; }
.it .by .name { font-size: 14px; }
.src1 { font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }
.scard .anchor { margin-top: 10px; font-size: 11.5px; color: var(--ink-3); display: flex; gap: 8px; align-items: baseline; border-top: 1px dotted var(--line-2); padding-top: 8px; }
.scard .anchor .tag.illus { font-size: 10px; flex: none; }
.see-date { padding: 8px 16px 18px; font-size: 12.5px; color: var(--ink-2); }

.strip { position: absolute; bottom: 0; inset-inline: 0; height: 88px; background: rgba(15,13,22,.94); border-top: 1px solid rgba(255,255,255,.12); display: flex; gap: 8px; padding: 8px 12px; overflow-x: auto; z-index: 3; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip button { flex: none; width: 96px; display: grid; grid-template-rows: 46px auto; gap: 4px; color: rgba(255,255,255,.85); font-size: 11px; text-align: center; border: 1px solid transparent; border-radius: 3px; padding: 3px; }
.strip button .th { height: 46px; border-radius: 2px; background: rgba(255,255,255,.08); display: grid; place-items: center; overflow: hidden; }
.strip button .th img { width: 100%; height: 100%; object-fit: cover; }
.strip button .th svg { width: 18px; height: 18px; fill: rgba(255,255,255,.8); }
.strip button.on { border-color: #fff; background: rgba(255,255,255,.1); }
.strip button span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 20px; line-height: 20px; }
.strip.in-rail { display: none; }
.stage-swap { position: absolute; top: 0; inset-inline: 0; bottom: 88px; background: var(--paper); z-index: 2; display: grid; grid-template-rows: auto 1fr; }
.stage-swap[hidden] { display: none; }
.stage-swap .bar { display: flex; padding: 12px 16px 0; }
.stage-swap .body { display: grid; place-items: center; padding: 10px 24px 24px; overflow: auto; }
.stage-swap figure { margin: 0; max-width: 860px; text-align: center; }
.stage-swap figure img { max-height: 56vh; width: auto; max-width: 100%; box-shadow: 0 2px 12px rgba(0,0,0,.18); margin: 0 auto; }
.stage-swap figcaption { margin-top: 10px; font-size: 14px; }
.stage-swap figcaption small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.stage-swap .vq { max-width: 680px; background: var(--sheet); border: 1px solid var(--line-2); border-inline-start: 4px solid var(--rule); padding: 22px 26px; }
.stage-swap .vq blockquote { margin: 0; font-family: var(--f-voice); font-size: 24px; line-height: 1.8; }
html[lang="en"] .stage-swap .vq blockquote { font-size: 20px; line-height: 1.55; }
.stage-swap .vq .by { margin-top: 12px; font-size: 14px; }
.stage-swap .insc { font-family: var(--f-voice); font-size: 28px; line-height: 2; text-align: center; }

/* simpler cards */
.card.voice .who2 { margin-top: 8px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.card.voice .who2 .name { font-size: 15px; }
.events li { grid-template-columns: 104px 1fr; }
.events .src1 { display: block; margin-top: 2px; }
.card.builder .acct .src1 { margin-top: 8px; }
.card .it:first-child { padding-top: 0; }
.card .it:last-child { padding-bottom: 0; }
.stop-card .more { font-size: 13px; color: var(--rule); border-bottom: 1px solid var(--rule-2); }
.stop-card .src1 { margin-bottom: 4px; }

@media (max-width: 760px) {
  #visit.on.thr { animation-delay: .9s; background: var(--paper); }
  .thr-wrap { grid-template-columns: 1fr; gap: 16px; padding: 14px 16px 24px; align-items: start; }
  .door { border-width: 4px; }
  .thr-text h1 { font-size: 34px; }
  .thr-cta { position: sticky; bottom: 10px; z-index: 2; }
  .thr-enter { width: 100%; justify-content: center; font-size: 19px; padding: 14px; }
  .visit-top .title .chips2 { display: none; }
  .visit-top .tools a { display: none; }
  .rail-peek { display: block; padding: 0 14px 6px; font-size: 12.5px; color: var(--watch); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-peek small { color: var(--ink-2); font-weight: 400; }
  .strip.in-stage { display: none; }
  .strip.in-rail { display: flex; position: static; height: auto; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .strip.in-rail button { color: var(--ink-2); width: 84px; }
  .strip.in-rail button .th { background: var(--paper-2); }
  .strip.in-rail button .th svg { fill: var(--ink-2); }
  .strip.in-rail button.on { border-color: var(--ink); background: var(--sheet); color: var(--ink); }
  .stage-swap { bottom: 0; }
  .stage-swap .body { padding: 6px 12px 170px; align-items: start; }
  .stage-swap figure img { max-height: 44vh; }
  .stage-swap .vq { padding: 16px; }
  .stage-swap .vq blockquote { font-size: 19px; }
  .see-h { font-size: 20px; padding: 10px 14px 0; }
  .spots { padding: 6px 14px 2px; }
  .scard { margin: 10px 14px; padding: 10px 14px 12px; }
  .scard .h h4 { font-size: 21px; }
  .visit-stage iframe { height: 100%; }
}

/* overrides that must come last */
.visit-stage iframe { height: calc(100% - 88px); }
body.swapped .rotate-hint { display: none; }
.thr-text { background: rgba(237,234,226,.55); padding: 18px 20px; border-radius: 4px; }
@media (max-width: 760px) { .visit-stage iframe { height: 100%; } .thr-text { background: none; padding: 0; } }

/* MVP: plain "coming" line replaces the audio placeholder */
.coming { margin-top: 10px; padding: 7px 10px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-3); font-size: 12.5px; }
.stop-card .coming { margin-top: 12px; }
@media (max-width: 760px) { .demo-banner { font-size: 11.5px; } }
