/* ==========================================================================
   Mount Vernon Guide — companion edition
   Colours follow the Phase 1 Figma file (source of truth), then the brand
   guide: slate #2A404B, navy #00212C, gold #EBAD3E / #F3C25E, crimson
   #BF2B45, buff #A48E5C, white paper. Type: Abhaya Libre and Piazzolla (as in
   Figma), Mulish for Figma's Avenir, Libre Caslon for Figma's Mercury. Token
   names are unchanged so the carried-over Ask styles (ask.css) still resolve.
   Mobile first. Desktop (>= 1024px) moves the tabs into a left rail.
   ========================================================================== */
:root {
  --page: #FFFFFF; --card: #FFFFFF; --well: #F2F2F0; --field: #E6E6E3; --rule: #D9D9D9; --track: #D9D9D9;
  --ink: #1A1919; --body: #232323; --muted: #4C4F50;
  --accent: #EBAD3E; --on-accent: #00212C; --accent-soft: #FBEFD6;
  --accent-ink: #BF2B45; --on-accent-ink: #FFFFFF; --crimson-soft: #F8E4E7;
  --header: #2A404B; --good: #374F29; --good-soft: #E6EEDC; --info: #366A8D;
  /* Phase 1 extras */
  --navy: #00212C; --gold-lt: #F3C25E; --buff: #A48E5C; --teal: #147A7A;
  /* Light blue: a pill background, always with navy text (on-sky). */
  --sky: #D6E8F7; --on-sky: #00212C;
  --nav-bg: #00212C; --nav-ink: white; --nav-on: #F3C25E;
  --serif: Piazzolla, Georgia, "Times New Roman", serif;
  --display: "Abhaya Libre", Georgia, serif;
  --sans: Mulish, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --caslon: "Libre Caslon Text", "Adobe Caslon Pro", Georgia, serif;
  --r-sm: 10px; --r: 13px; --r-lg: 17px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 12px rgba(0, 0, 0, .10);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .20);
  --shadow-btn: 0 4px 3px rgba(0, 0, 0, .22);
  --av-mini: 40px; --msg-gutter: calc(var(--av-mini) + 8px);
  --nav-h: 68px; --mini-h: 60px;
  --nav-space: calc(var(--nav-h) + env(safe-area-inset-bottom));
  --side-w: 232px; --pad: 18px; --maxw: 760px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #16212A; --card: #00212C; --well: #1B2932; --field: #22323D; --rule: #2A3D48; --track: #26363F;
    --ink: #E9EEF2; --body: #B7C6CF; --muted: #8FA3B0;
    --accent: #F3C25E; --on-accent: #00212C; --accent-soft: #3A3524;
    --accent-ink: #F28A9B; --on-accent-ink: #16212A; --crimson-soft: #3B2A33;
    --header: #0F1922; --good: #9BC27A; --good-soft: #243220; --info: #96AEC4;
    --nav-bg: #00212C; --nav-ink: #C9D4DB; --nav-on: #F3C25E;
    --sky: #A9CBE8; --on-sky: #00212C;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25); --shadow-lg: 0 12px 34px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --page: #16212A; --card: #00212C; --well: #1B2932; --field: #22323D; --rule: #2A3D48; --track: #26363F;
  --ink: #E9EEF2; --body: #B7C6CF; --muted: #8FA3B0;
  --accent: #F3C25E; --on-accent: #00212C; --accent-soft: #3A3524;
  --accent-ink: #F28A9B; --on-accent-ink: #00212C; --crimson-soft: #3B2A33;
  --header: #0F1922; --good: #9BC27A; --good-soft: #243220; --info: #96AEC4;
  --nav-bg: #00212C; --nav-ink: #C9D4DB; --nav-on: #F3C25E;
  --sky: #A9CBE8; --on-sky: #00212C;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25); --shadow-lg: 0 12px 34px rgba(0, 0, 0, .5);
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
a, button { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
/* No double-tap zoom: a quick second tap on a button is just a tap. Pinch-zoom
   still works (people with low vision need it), and the map keeps its own
   double-tap zoom. :where() has no specificity, so every other touch-action
   rule (the map, the sheet grips) still wins. */
:where(*) { touch-action: manipulation; }
body { margin: 0; background: var(--page); color: var(--body); font: 500 16px/1.55 var(--sans); }
h1, h2, h3 { color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font: 700 30px/1.12 var(--serif); letter-spacing: -.01em; }
h2 { font: 700 21px/1.2 var(--serif); }
h3 { font: 700 17px/1.3 var(--serif); }
p { margin: 0 0 .8em; }
a { color: var(--accent-ink); }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--accent-ink); color: var(--on-accent-ink); padding: 10px 14px; border-radius: 10px; font-weight: 800; }
.skip-link:focus { top: 8px; }
.ic { width: 20px; height: 20px; flex: none; }
.is-hidden { display: none !important; }
[hidden] { display: none !important; }
.eyebrow { font: 800 11px/1.3 var(--sans); letter-spacing: .11em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 6px; }
.kicker { display: flex; align-items: center; gap: 8px; font: 800 12px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.kicker .ic { width: 17px; height: 17px; color: var(--accent-ink); }
.kicker .count { margin-left: auto; font-weight: 800; color: var(--muted); background: var(--well); border-radius: 20px; padding: 2px 9px; letter-spacing: 0; }
.hint { color: var(--muted); font-size: 14px; }
.lead { font: 500 18px/1.6 var(--serif); color: var(--ink); }
.lead-sm { font-size: 16px; color: var(--body); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 6px; }
.linkish .ic { width: 17px; height: 17px; }
/* "See it on the map" (Tour): a small gold button, navy text. */
.map-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 14px; border-radius: 999px; flex: none;
  background: var(--accent); color: var(--on-accent); font: 800 13.5px/1 var(--sans); text-decoration: none; box-shadow: var(--shadow-btn); }
.map-btn .ic { width: 16px; height: 16px; }
.map-btn:hover { filter: brightness(1.04); }
/* "Read more" (Mansion rooms): a light blue pill. */
.read-more { display: inline-block; border: 0; padding: 2px 10px; border-radius: 999px; background: var(--sky); color: var(--on-sky);
  font: 800 13.5px/1.5 var(--sans); cursor: pointer; vertical-align: baseline; }
.read-more:hover { filter: brightness(.97); }
.ph { background: linear-gradient(135deg, var(--well), var(--field)); }

/* --------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 18px; border-radius: var(--r); border: 1px solid transparent;
  font: 800 15px/1.2 var(--sans); text-decoration: none; transition: transform .15s var(--ease), background .15s, box-shadow .15s; }
.btn:active { transform: scale(.98); }
.btn .ic { width: 19px; height: 19px; }
/* Figma's "botton mona": gold, navy label (white on gold fails contrast), a short drop shadow. */
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-btn); }
.btn-crimson { background: var(--accent-ink); color: var(--on-accent-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent-ink) 26%, transparent); }
.btn-soft { background: var(--well); color: var(--ink); border-color: var(--rule); }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 1px solid var(--rule); color: var(--ink); text-decoration: none; flex: none; }
.icon-btn .ic { width: 20px; height: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--rule); background: var(--card);
  font: 800 14px/1.2 var(--sans); color: var(--ink); text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.chip small { font-weight: 700; color: var(--muted); }
.chip.is-on { background: var(--header); border-color: var(--header); color: #fff; }
.chip.is-on small { color: #d7dee3; }
:root[data-theme="dark"] .chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); } }
.chip.is-past { opacity: .55; }
/* Builder screen: "recommended" is a light blue pill, readable on a plain chip and on a selected (dark or gold) one. */
.pick-view .chip small, .pick-view .chip.is-on small { padding: 3px 8px; border-radius: 999px; background: var(--sky); color: var(--on-sky);
  font: 800 11px/1 var(--sans); letter-spacing: .04em; }
.pick-view .chip.is-on small { box-shadow: 0 0 0 1px rgba(255, 255, 255, .55); }
.chips { display: flex; gap: 8px; }
.chips.wrap { flex-wrap: wrap; }
.chips.scroller { overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: none; }
.chips.scroller::-webkit-scrollbar { display: none; }
.chips.scroller .chip { scroll-snap-align: start; }
.tag { display: inline-block; font: 800 11px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; background: var(--well); color: var(--muted); }

/* ------------------------------------------------------------------ shell */
.app { min-height: 100dvh; }
.main { outline: none; padding-bottom: calc(var(--nav-space) + 24px); }
body.has-mini .main { padding-bottom: calc(var(--nav-space) + var(--mini-h) + 28px); }
body.no-nav .nav { display: none; }
body.no-nav .main { padding-bottom: 24px; }
/* Intro and Language are exactly one screen tall: no padding under them to scroll to. */
body[data-view="intro"] .main, body[data-view="language"] .main { padding-bottom: 0; }
.page { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

.nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: var(--nav-space); padding: 6px 10px calc(6px + env(safe-area-inset-bottom));   /* icons and labels clear of the edges */
  display: flex; background: var(--nav-bg); box-shadow: 0 -2px 10px rgba(0, 0, 0, .12); }
.nav .brand { display: none; }
/* Figma nav: outlined icons in circles on the gold bar; the current tab's circle fills. */
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--nav-ink); text-decoration: none; font: 800 11.5px/1 var(--sans); letter-spacing: .02em; position: relative; }
.tab .ic { width: 22px; height: 22px; box-sizing: content-box; padding: 5px; border: 1.6px solid currentColor; border-radius: 50%; }
.tab.is-on { color: var(--nav-on); }
.tab.is-on .ic { background: var(--nav-on); color: var(--nav-bg); border-color: var(--nav-on); }

/* mini-player: one shape on every screen, above the tabs (spec 4.5) */
.mini { position: fixed; z-index: 39; right: 10px; width: calc(100% - 20px); bottom: calc(var(--nav-space) + 8px); height: var(--mini-h); display: flex; align-items: center; gap: 4px;
  background: var(--header); color: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; padding-right: 6px; animation: rise .3s var(--ease);
  /* expanding: a slight spring; the contents fade back in once there is room */
  transition: width .5s cubic-bezier(.34, 1.25, .5, 1), height .5s cubic-bezier(.34, 1.25, .5, 1), border-radius .45s var(--ease), bottom .45s var(--ease), padding .45s var(--ease), background-color .3s ease; }
.mini-main, .mini-bar { transition: opacity .25s ease .12s, transform .35s var(--ease) .1s; }
/* Shrunk (app.js paintMini): one small gold play/pause button at the bottom right. */
.mini.is-collapsed { width: 48px; height: 48px; bottom: calc(var(--nav-space) + 12px); padding: 0; border-radius: 50%; justify-content: center; background: var(--accent);
  transition: width .42s cubic-bezier(.5, 0, .2, 1), height .42s cubic-bezier(.5, 0, .2, 1), border-radius .42s ease, bottom .42s ease, padding .3s ease, background-color .3s ease .15s; }
.mini.is-collapsed .mini-main, .mini.is-collapsed .mini-bar { position: absolute; opacity: 0; transform: translateX(-16px); pointer-events: none; transition: opacity .15s ease, transform .2s ease; }
.mini.is-collapsed .mini-btn { width: 48px; height: 48px; background: transparent; color: var(--navy); animation: miniPop .5s cubic-bezier(.34, 1.56, .64, 1) .3s both; }
@keyframes miniPop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mini, .mini-main, .mini-bar { transition: none; } .mini.is-collapsed .mini-btn { animation: none; } }
.mini-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px; color: inherit; text-decoration: none; }
.mini-img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.mini-txt { min-width: 0; display: flex; flex-direction: column; }
.mini-txt b { font: 800 14.5px/1.25 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-txt small { font-size: 12px; color: #c9d4db; }
.mini-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .12); border: 0; color: #fff; flex: none; }
.mini-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--nav-space) + 84px); transform: translate(-50%, 12px); opacity: 0; pointer-events: none; max-width: calc(100% - 32px);
  background: var(--ink); color: var(--page); padding: 11px 16px; border-radius: 12px; font: 700 14px/1.35 var(--sans); box-shadow: var(--shadow-lg); transition: opacity .2s, transform .25s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { display: flex; align-items: center; gap: 12px; padding: 40px 0; color: var(--muted); font-weight: 700; }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--rule); border-top-color: var(--accent-ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 60px 10px; }
.empty h1 { margin-bottom: 10px; }

/* ---------------------------------------------------------------- sheets */
.sheet-root { position: fixed; inset: 0; z-index: 80; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(20, 30, 36, .38); opacity: 0; transition: opacity .25s; }
.sheet-root.is-clear .sheet-scrim { background: transparent; }
.sheet-root.is-open .sheet-scrim { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86dvh; overflow: auto; background: var(--card); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(20, 30, 36, .2);
  padding: 8px var(--pad) calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .3s var(--ease); outline: none; }
.sheet-root.is-open .sheet { transform: none; }
.sheet-tall { min-height: 60dvh; }
.sheet-grip { display: flex; justify-content: center; padding: 4px 0 10px; cursor: grab; touch-action: none; }
.sheet-grip span { width: 42px; height: 5px; border-radius: 5px; background: var(--rule); }
.sheet-x { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--well); display: grid; place-items: center; color: var(--ink); }
.sheet-title { margin: 2px 50px 14px 0; }
.sheet-from { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* --------------------------------------------------------------- welcome */
.welcome { padding: 0; max-width: 640px; }
.w-hero { position: relative; min-height: 290px; display: flex; align-items: flex-end; color: #fff; overflow: hidden; }
.w-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.w-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22, 33, 42, .05) 20%, rgba(22, 33, 42, .88)); }
.w-hero .ph { position: absolute; inset: 0; background: var(--header); }
.w-brand { position: relative; z-index: 1; padding: 24px var(--pad) 22px; }
.w-logo { height: 34px; width: auto; margin-bottom: 14px; filter: brightness(0) invert(1); }
.w-brand h1 { color: #fff; font: 800 38px/1.02 var(--display); letter-spacing: -.01em; margin-bottom: 8px; }
.w-brand p { color: #e3e9ed; margin: 0; max-width: 34ch; }
.w-form { padding: 8px var(--pad) 0; }
.w-q { border: 0; margin: 0; padding: 20px 0 18px; border-bottom: 1px solid var(--rule); min-width: 0; }
.w-q legend { display: flex; align-items: center; gap: 10px; font: 700 19px/1.25 var(--serif); color: var(--ink); padding: 0; margin-bottom: 6px; }
.w-q .n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 900 13px/1 var(--sans); flex: none; }
.w-q .opt { font: 700 12px/1 var(--sans); color: var(--muted); letter-spacing: .04em; }
.w-q .hint { margin: 0 0 12px; }
.w-alt { margin-top: 6px; }
.w-alt .chip { min-height: 38px; font-size: 13.5px; }
.w-foot { position: sticky; bottom: 0; padding: 22px var(--pad) calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--page) 26%); text-align: center; }
.w-form { padding-bottom: 8px; }
.w-preview { font: 700 14px/1.4 var(--sans); color: var(--muted); margin: 6px 0 10px; min-height: 1.4em; }
.w-foot .linkish { margin-top: 12px; }

/* ------------------------------------------------------------------ tour */
.t-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: calc(18px + env(safe-area-inset-top)) 0 12px; }
.t-head h1 { font: 800 32px/1.05 var(--display); }
.banner { background: var(--accent-soft); border-radius: var(--r); padding: 14px 16px; margin: 4px 0 14px; color: var(--ink); }
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.t-summary { margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); }
.stat { padding: 12px 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.stat + .stat { border-left: 1px solid var(--rule); }
.stat b { font: 800 19px/1.15 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat b small { font-size: 12px; margin-left: 2px; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 700; }
.lens-line { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.lens-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--ink); border-radius: 999px; padding: 7px 12px; font: 800 13px/1.2 var(--sans); }
.lens-chip .ic { width: 15px; height: 15px; color: #B7811E; }

.slot { display: flex; gap: 14px; margin: 16px 0 0; padding: 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--rule); box-shadow: var(--shadow); }
.slot-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--well); color: var(--header); display: grid; place-items: center; flex: none; }
.slot h2 { font: 800 26px/1.1 var(--display); margin-bottom: 4px; }
.slot p:not(.eyebrow) { margin-bottom: 10px; font-size: 15px; }
.slot.is-soon { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 60%, var(--rule)); }
.slot.is-soon .slot-ic { background: var(--accent); color: var(--on-accent); }
.slot.is-late { background: var(--crimson-soft); border-color: color-mix(in srgb, var(--accent-ink) 40%, var(--rule)); }

.now { margin: 8px 0 0; border-radius: var(--r-lg); overflow: hidden; background: var(--card); border: 1px solid var(--rule); box-shadow: var(--shadow-lg); }
.now-img { display: block; aspect-ratio: 2.2 / 1; background: var(--well); }
.now-img img, .now-img .ph { width: 100%; height: 100%; object-fit: cover; }
.now-body { padding: 16px 18px 18px; }
.now-body h2 { font: 800 30px/1.05 var(--display); margin-bottom: 6px; }
.now-body .meta { color: var(--muted); font-weight: 700; font-size: 14px; }
.now .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.now .actions .btn-primary { flex: 1 1 60%; }
.now-done { text-align: left; background: linear-gradient(160deg, var(--good-soft), var(--card)); }
.official { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; margin: 6px 0 0; }
.official a { color: var(--muted); }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 28px 0 12px; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.tl { display: grid; grid-template-columns: 54px 34px 1fr; align-items: center; column-gap: 8px; position: relative; }
.tl::before { content: ""; position: absolute; left: calc(54px + 8px + 16px); top: 0; bottom: 0; width: 2px; background: var(--rule); }
.tl:first-of-type::before { top: 50%; }
.tl:last-child::before { bottom: 50%; }
.tl-time { text-align: right; font: 800 13.5px/1.1 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-time small { font-size: 10px; margin-left: 1px; }
.tl-dot { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2px solid var(--rule); font: 900 13px/1 var(--sans); color: var(--ink); }
.tl-dot .ic { width: 16px; height: 16px; }
.tl-body { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; margin: 5px 0; border-radius: var(--r); background: var(--card); border: 1px solid var(--rule); color: inherit; text-decoration: none; min-width: 0; transition: transform .15s var(--ease), box-shadow .15s; }
.tl-body:active { transform: scale(.99); }
.tl-img { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; flex: none; }
.tl-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.tl-txt b { font: 800 16px/1.25 var(--sans); color: var(--ink); }
.tl-txt small { font-size: 13px; color: var(--muted); font-weight: 600; }
.tl-ticket { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font: 800 12px/1 var(--sans); color: var(--accent-ink); }
.tl-ticket .ic { width: 14px; height: 14px; }
.tl-chev { color: var(--muted); width: 18px; height: 18px; }
.tl.is-now .tl-dot { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent-ink); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-ink) 18%, transparent); }
/* Free order: the places by part of the estate, ticked off as visited. */
.t-free-hint { margin: -4px 0 6px; }
.fl-head { margin: 18px 0 8px; font: 800 12px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fl { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fl-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: var(--r); background: var(--card); border: 1px solid var(--rule); color: inherit; text-decoration: none; }
.fl-item.is-near { border-color: color-mix(in srgb, var(--navy) 55%, var(--rule)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--navy) 18%, transparent), var(--shadow); }
.fl-item.is-near small { color: var(--navy); font-weight: 800; }
:root[data-theme="dark"] .fl-item.is-near small { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fl-item.is-near small { color: var(--accent); } }
.fl-item.is-done { opacity: .72; }
.fl-row { display: flex; align-items: center; gap: 8px; }
.fl-row .fl-item { flex: 1; min-width: 0; }
.fl-tick { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--rule); background: var(--card); color: var(--muted); cursor: pointer; }
.fl-tick .ic { width: 20px; height: 20px; }
.fl-tick.is-on { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent-ink); }
/* "I've been here" / "Visited · Undo" (stop pages, the map's place sheet) */
.btn-visit .ic { width: 16px; height: 16px; }
.ask-mansion { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.ask-mansion .btn { flex: 1 1 160px; }
.ask-mansion .ic { width: 16px; height: 16px; }
.btn-visit.is-on { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.s-head .btn-visit { margin-top: 10px; }

.tl.is-now .tl-body { border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--rule)); box-shadow: var(--shadow); }
.tl.is-done .tl-dot { background: var(--good); border-color: var(--good); color: #fff; }
.tl.is-done .tl-body { opacity: .62; }
.tl.is-done .tl-txt b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.tl.is-seq .tl-body { background: linear-gradient(135deg, var(--card), var(--well)); }
.tl.is-seq .tl-dot { border-color: var(--header); }
.tl-leg { display: grid; grid-template-columns: 54px 34px 1fr; column-gap: 8px; position: relative; font: 700 12.5px/1.2 var(--sans); color: var(--muted); }
.tl-leg::before { content: ""; position: absolute; left: calc(54px + 8px + 16px); top: 0; bottom: 0; width: 2px; background: repeating-linear-gradient(var(--rule) 0 4px, transparent 4px 8px); }
.tl-leg span { grid-column: 3; display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; }
.tl-leg .ic { width: 15px; height: 15px; }
.tl-leg.is-wait span { color: #9A6B12; }
.tl-head { list-style: none; margin: 20px 0 6px calc(54px + 8px + 34px + 8px); font: 800 12px/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--accent-ink); }
.nearby .hint { margin-top: -6px; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mini-list li { display: flex; align-items: center; gap: 10px; }
.mini-list li > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r); background: var(--card); border: 1px solid var(--rule); color: inherit; text-decoration: none; }
.mini-list .in { width: 44px; height: 44px; display: grid; place-items: center; color: var(--good); }
.ml-img { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; flex: none; }
.mini-list b { display: block; font: 800 15px/1.25 var(--sans); color: var(--ink); }
.mini-list small { color: var(--muted); font-size: 13px; }
/* Where are you now? · Browse all places · Change my tour, above "Your walk". */
.t-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 -10px; }
.t-link { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--rule);
  background: var(--card); color: var(--ink); font: 700 14px/1.2 var(--sans); text-decoration: none; cursor: pointer; }
.t-link .ic { width: 17px; height: 17px; color: var(--muted); }
.t-link:hover { border-color: var(--accent); }

/* ------------------------------------------------------------------ stop */
.stop, .seq { padding: 0; }
.s-hero { position: relative; aspect-ratio: 4 / 3; max-height: 46dvh; background: var(--well); overflow: hidden; }
.s-img, .s-hero .ph { width: 100%; height: 100%; object-fit: cover; }
.s-back { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; width: 44px; height: 44px; border-radius: 50%; background: rgba(22, 33, 42, .55); backdrop-filter: blur(6px); color: #fff; display: grid; place-items: center; }
.s-head { padding: 18px var(--pad) 4px; }
.s-head h1 { font: 800 34px/1.04 var(--display); }
.s-core, .for-you, .lookfor, .more, .stories, .seq-core, .seq-rooms, .beyond { padding: 0 var(--pad); margin-top: 20px; }
.transport { margin: 14px var(--pad) 0; padding: 10px 14px 10px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.scrub { width: 100%; accent-color: var(--accent-ink); height: 20px; margin: 0; display: block; }
.times { display: flex; justify-content: space-between; font: 700 11px/1 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.tbtns { display: flex; justify-content: center; align-items: center; gap: 12px; }
.tb { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule); background: var(--well); display: grid; place-items: center; color: var(--ink); }
.tb .ic { width: 20px; height: 20px; }
.tb-main { width: 52px; height: 52px; background: var(--accent); color: var(--on-accent); border: 0; box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 34%, transparent); }   /* gold, like the app's main buttons */
.tb-sm { width: 34px; height: 34px; }
.tb-sm .ic { width: 17px; height: 17px; }
.tb-rate { font: 800 12px/1 var(--sans); color: var(--ink); }
.tb-main .ic { width: 24px; height: 24px; }
/* Narration read by an AI voice is always labelled as such (audio_instructions/old_approach/AUDIO.md). */
.tag-ai { margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: var(--well); color: var(--muted); font: 800 10px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px; }
.tx-note { margin: 4px 0 10px; font: 600 12.5px/1.4 var(--sans); color: var(--muted); }
.script { margin-top: 18px; background: var(--well); border-radius: var(--r-lg); padding: 16px 16px 6px; }
.script.is-collapsed .tx-body { max-height: 190px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.script .linkish { margin: 6px 0 12px; }
.tx { font: 500 16.5px/1.62 var(--serif); color: var(--ink); margin: 0 0 12px; }
.spk { display: block; font: 800 11px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.tx-own { padding-left: 14px; border-left: 3px solid var(--accent); font-style: italic; }
.lens-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.lens-card h3 { font-size: 20px; margin-bottom: 10px; }
.lens-card p { font: 500 16px/1.6 var(--serif); color: var(--body); }
.lens-card .sub { font: 700 13px/1.3 var(--sans); color: var(--muted); margin-top: -6px; }
.lens-card .for { display: inline-flex; align-items: center; gap: 6px; font: 800 12px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: #9A6B12; background: var(--accent-soft); padding: 6px 10px; border-radius: 999px; margin-bottom: 10px; }
.lens-card .for .ic { width: 14px; height: 14px; }
.lens-card figure { margin: 0 0 12px; }
.card-img { border-radius: 12px; width: 100%; height: auto; margin: 0 0 12px; background: var(--well); }
.for-you .lens-card { border-left: 4px solid var(--accent); }
.lf-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 72%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: none; }
.lf-row::-webkit-scrollbar { display: none; }
.lf { scroll-snap-align: start; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s, box-shadow .2s; }
.lf-open { border: 0; padding: 0; background: var(--well); aspect-ratio: 4 / 3; display: block; }
.lf-img, .lf-open .ph { width: 100%; height: 100%; object-fit: cover; }
.lf-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lf-body h3 { font-size: 16px; }
.lf-found { margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border-radius: 10px; border: 1.5px dashed var(--rule); background: transparent; font: 800 13.5px/1 var(--sans); color: var(--ink); }
.lf-found .ic { width: 17px; height: 17px; }
.lf.is-found { border-color: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 18%, transparent); }
.lf.is-found .lf-found { background: var(--good); border: 1.5px solid var(--good); color: #fff; animation: pop .35s var(--ease); }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.acc { border-top: 1px solid var(--rule); }
.acc:last-child { border-bottom: 1px solid var(--rule); }
.acc summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 2px; cursor: pointer; font: 700 16.5px/1.3 var(--serif); color: var(--ink); min-height: 52px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .ic { color: var(--muted); transition: transform .2s; }
.acc[open] summary .ic { transform: rotate(180deg); }
.acc-body { padding: 0 2px 14px; }
.acc-body p { font: 500 16px/1.62 var(--serif); }
.acc-body .lens-card { box-shadow: none; }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background: var(--accent-soft); } 100% { background: transparent; } }

.nextbar, .seq-bar { position: sticky; bottom: calc(var(--nav-space) + 10px); z-index: 30; margin: 28px var(--pad) 0; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px;
  background: color-mix(in srgb, var(--card) 96%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--shadow-lg); }
.nb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nb-txt small { font: 800 11.5px/1.3 var(--sans); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.nb-txt b { font: 800 16px/1.25 var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nextbar .btn { flex: none; }

/* topic cards: base overview first, then cards ranked for the visitor */
.base-kicker { margin: 20px var(--pad) 0; }
.tr-now { display: flex; flex-direction: column; gap: 0; margin: 0 0 4px; font: 800 14px/1.3 var(--sans); color: var(--ink); }
.tr-now small { font: 700 12px/1.3 var(--sans); color: var(--muted); }
.tr-now small:empty { display: none; }   /* no "Then:" line when nothing follows */
/* The small red ↺ after a place's description: its own audio from the start. */
.replay-base { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 4px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--accent-ink); vertical-align: -4px; cursor: pointer; }
.replay-base .ic { width: 18px; height: 18px; }
.replay-base:hover { background: var(--crimson-soft); }
.tb:disabled { opacity: .3; cursor: default; }
.tr-now .tr-sub { min-height: 0; color: var(--accent-ink); font-weight: 800; }   /* where the audio comes from, under its title */
.cards { padding: 0 var(--pad); margin-top: 24px; }
.cards-why { margin: -6px 0 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tc-list { display: flex; flex-direction: column; gap: 10px; }
.tc { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.cards-rec .tc { border-left: 3px solid var(--accent); }
.tc-head { display: flex; align-items: center; gap: 4px; padding-right: 8px; }
.tc-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; background: none; text-align: left; color: inherit; min-height: 72px; }
.tc-img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: var(--well); }
.tc-ic { display: grid; place-items: center; color: var(--accent-ink); }
.tc-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tc-txt b { font: 800 15.5px/1.25 var(--sans); color: var(--ink); }
.tc-txt small { font: 700 12.5px/1.3 var(--sans); color: var(--muted); }
.tc-why { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-ink) !important; text-transform: uppercase; letter-spacing: .06em; font-size: 11px !important; }
.tc-why .ic { width: 13px; height: 13px; }
.tc-chev { color: var(--muted); display: grid; transition: transform .2s; }
.tc.is-open .tc-chev { transform: rotate(180deg); }
.tc-play { width: 46px; height: 46px; border-radius: 50%; border: 0; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.tc-play .ic { width: 20px; height: 20px; }
.tc.is-playing { border-color: color-mix(in srgb, var(--accent) 70%, var(--rule)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.tc-body { padding: 4px 14px 14px; border-top: 1px solid var(--rule); }
.tc-body > figure { margin: 10px 0 0; }
.tc-body p { font: 500 16px/1.62 var(--serif); color: var(--body); margin: 10px 0 0; }
.tc-body .tx { color: var(--ink); }
.tc-body .lf-found { margin-top: 12px; width: 100%; }
.tc.is-found { border-color: var(--good); }
.tc.is-found .lf-found { background: var(--good); border: 1.5px solid var(--good); color: #fff; }

/* --------------------------------------------------------------- mansion */
.seq-top { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) var(--pad) 10px; }
.seq-title { min-width: 0; }
.seq-title h1 { font: 800 30px/1.05 var(--display); }
/* The rooms bar: the whole bar is a button that opens "Rooms in the Mansion". */
.seq-dots-btn { display: flex; align-items: center; gap: 10px; width: calc(100% - 2 * var(--pad)); margin: 0 var(--pad) 14px; padding: 8px 0; border: 0; background: none; cursor: pointer; color: var(--muted); }
.seq-dots { list-style: none; display: flex; gap: 5px; flex: 1; padding: 0; margin: 0; }
.seq-dots li { flex: 1; }
.seq-dots span { display: block; height: 6px; border-radius: 6px; background: var(--track); }
.seq-dots .is-done span { background: var(--good); }
.seq-dots .is-now span { background: var(--accent-ink); }
.seq-rooms-lbl { flex: none; display: inline-flex; align-items: center; gap: 3px; font: 800 12.5px/1 var(--sans); color: var(--ink); white-space: nowrap; }
.seq-rooms-lbl .ic { width: 14px; height: 14px; }
.room-pick { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.room-pick a { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border: 1px solid var(--rule); border-radius: var(--r); color: inherit; text-decoration: none; background: var(--card); }
.room-pick a.is-here { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.rp-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--well); font: 800 13px/1 var(--sans); color: var(--ink); }
.rp-n .ic { width: 15px; height: 15px; color: var(--good); }
.rp-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rp-t b { font: 700 15px/1.3 var(--serif); color: var(--ink); }
.rp-t small { font: 800 11.5px/1.2 var(--sans); color: var(--accent-ink); text-transform: uppercase; letter-spacing: .06em; }
.seq-hero { margin: 0 var(--pad); border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 10; background: var(--well); }
.seq-img, .seq-hero .ph { width: 100%; height: 100%; object-fit: cover; }
.seq-bar { padding: 8px; gap: 8px; }
.seq-prev { width: 54px; padding: 0; flex: none; }
.seq-next { flex: 1; justify-content: space-between; text-align: left; min-height: 58px; }
.seq-next span { display: flex; flex-direction: column; min-width: 0; }
.seq-next small { font: 800 11px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.seq-next span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.room-list a { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; text-decoration: none; color: inherit; height: 100%; }
.rl-img, .room-list .ph { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.room-list span { padding: 8px 10px 10px; display: flex; flex-direction: column; }
.room-list small { font: 800 11px/1.2 var(--sans); color: var(--accent-ink); letter-spacing: .06em; text-transform: uppercase; }
.room-list b { font: 800 14.5px/1.25 var(--sans); color: var(--ink); }
.room-list .is-done a { opacity: .6; }
.transport-note { display: flex; gap: 8px; align-items: center; margin: 14px var(--pad) 0; font-weight: 700; color: var(--muted); }

/* ------------------------------------------------------------ map screen */
body.is-full .main { padding: 0; }
.mapview { position: fixed; inset: 0 0 var(--nav-space) 0; }
.map-host, .atlas { position: absolute; inset: 0; }
.map-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); font-weight: 800; background: #e0e5cc; }
.map-loading .ic { width: 40px; height: 40px; }
.map-top { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 76px; z-index: 500; pointer-events: none; }
.map-card { display: inline-block; pointer-events: auto; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--rule); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); }
.map-card .eyebrow { margin: 0 0 2px; }
.map-card h1 { font: 800 20px/1.15 var(--sans); }
.map-ctl { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.ctl { width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--rule); background: color-mix(in srgb, var(--card) 96%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--ink); }
.ctl[aria-pressed="false"] { color: var(--muted); }
.map-status { position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 500; background: var(--header); color: #fff; border-radius: 12px; padding: 10px 14px; font: 700 14px/1.35 var(--sans); box-shadow: var(--shadow-lg); }
body.has-mini .map-status, body.has-mini .near { bottom: calc(var(--mini-h) + 22px); }
.map-status.is-err { background: #8a2e3c; }
.near { position: absolute; left: 12px; right: 12px; bottom: 70px; z-index: 500; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 10px 10px 10px 14px; box-shadow: var(--shadow-lg); font-size: 14px; color: var(--ink); }
.near span { display: inline-flex; align-items: center; gap: 6px; }
.pin-sheet { display: flex; gap: 14px; align-items: flex-start; }
.ps-img { width: 92px; height: 92px; border-radius: 14px; object-fit: cover; flex: none; }
.ps-body { min-width: 0; }
.ps-body h2 { font: 800 25px/1.05 var(--display); margin-bottom: 4px; }
.ps-body .meta { font-size: 14px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.ps-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ps-actions .btn-primary { flex: 1 1 50%; }
.sheet-pin { max-width: 560px; margin: 0 auto; }
/* The map's place sheet (sheet.js detents): peek, half and nearly full, like a
   phone's maps app. The map behind stays usable. */
.sheet-root.is-clear { pointer-events: none; }
.sheet-root.is-clear .sheet { pointer-events: auto; }
.sheet.is-detent { height: 90dvh; max-height: none; overflow: hidden; display: flex; flex-direction: column; touch-action: none;
  transition: transform .34s cubic-bezier(.2, .8, .2, 1); }
.sheet.is-detent .sheet-body { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.sheet.is-detent.is-full .sheet-body { overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }
.sheet.is-detent [data-peek], .sheet.is-detent .sheet-grip { touch-action: none; }
.ps-more-hint { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 12px; padding: 8px; border: 0; background: none;
  color: var(--muted); font: 700 13px/1 var(--sans); cursor: pointer; }
.ps-more-hint .ic { width: 16px; height: 16px; }
.sheet[data-detent="full"] .ps-more-hint, .sheet[data-detent="half"] .ps-more-hint { display: none; }
.ps-more { padding-top: 6px; }
.ps-hero { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; margin: 4px 0 14px; }
.ps-more .lead { margin-top: 0; }
.ps-sub { margin: 18px 0 8px; font: 800 12px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ps-rooms { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ps-rooms a { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border: 1px solid var(--rule); border-radius: var(--r); color: inherit; text-decoration: none; background: var(--card); }
.ps-rooms span { flex: 1; min-width: 0; }
.ps-rooms small { display: block; font: 800 11px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ps-rooms b { display: block; font: 700 15px/1.3 var(--serif); color: var(--ink); }

/* ----------------------------------------------------- change and browse */
.presets { display: grid; gap: 8px; }
.preset { text-align: left; padding: 12px 14px; border-radius: var(--r); border: 1.5px solid var(--rule); background: var(--card); display: flex; flex-direction: column; }
.preset b { font: 800 15px/1.3 var(--sans); color: var(--ink); }
.preset small { color: var(--muted); font-size: 13px; }
.preset.is-on { border-color: var(--accent-ink); background: var(--crimson-soft); }
.search { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--rule); border-radius: 14px; padding: 0 14px; background: var(--well); margin-bottom: 14px; }
.search input { flex: 1; border: 0; background: transparent; min-height: 48px; font: 700 16px/1 var(--sans); color: var(--ink); outline: none; }
.br-hits small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.br-zone h3 { font: 800 12px/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--accent-ink); margin: 16px 0 8px; }

/* ----------------------------------------------------------------- visit */
.v-head { display: flex; align-items: center; gap: 12px; padding: calc(16px + env(safe-area-inset-top)) 0 14px; }
.v-head h1 { font: 800 30px/1.05 var(--display); }
.v-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
/* One rhythm inside every card: 14px between items, a clear 26px above each
   small heading, and the heading kept 10px from its own options. */
.v-card > * { margin: 0; }
.v-card > * + * { margin-top: 14px; }
.v-card > h2 { display: flex; align-items: center; gap: 8px; font-size: 19px; }
.v-card > .v-sub { margin-top: 26px; }
.v-card > h2 + .v-sub { margin-top: 16px; }
.v-card > .v-sub + * { margin-top: 10px; }
.v-sub { font: 800 12px/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.v-card > .switch { margin-top: 26px; }
.v-card > .hint { line-height: 1.5; }
.v-prog { display: flex; align-items: center; gap: 16px; }
.v-prog h2 { font-size: 20px; }
.v-prog p { margin: 4px 0 0; color: var(--muted); }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; flex: none; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--card) 76%, transparent 78% 100%), conic-gradient(var(--good) calc(var(--p) * 1%), var(--track) 0); }
.ring b { font: 900 24px/1 var(--sans); color: var(--ink); }
.ring small { font-size: 11px; color: var(--muted); font-weight: 700; }
/* Tour: "Your visit so far" (tour.js soFar), at the foot of the page. */
.so-far { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--rule); scroll-margin-top: 16px; }
.so-far > * { margin: 0; }
.so-far > * + * { margin-top: 12px; }
.so-far > .v-sub { display: flex; align-items: center; gap: 6px; margin-top: 22px; }
.so-far > .v-sub .ic { width: 16px; height: 16px; }
.v-seen { list-style: none; padding: 0; }
.v-seen .chip { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.album { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.al { border: 0; padding: 0; background: none; text-align: left; display: flex; flex-direction: column; gap: 4px; font: 700 12px/1.25 var(--sans); color: var(--ink); }
.al-img, .al .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.switch { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.switch input { width: 22px; height: 22px; accent-color: var(--accent-ink); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.credits { font-size: 12px; line-height: 1.5; color: var(--muted); padding: 6px 4px 20px; }

/* ------------------------------------------------------------------- ask */
/* The page is exactly one screen tall and only the conversation scrolls, so the
   composer and the newest message are never behind the nav or off the bottom. */
.ask-page { display: flex; flex-direction: column; height: calc(100dvh - var(--nav-space)); }
.ask-page .stack { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 12px; }
.ask-page .stack > * { flex-shrink: 0; }
.ask-composer { flex: 0 0 auto; margin-bottom: 10px; }
body[data-view="ask"] .mini { display: none; }
body[data-view="ask"] .main, body[data-view="ask"].has-mini .main { padding-bottom: var(--nav-space); }

/* --------------------------------------------------------------- desktop */
@media (min-width: 1024px) {
  :root { --nav-space: 0px; --pad: 28px; }
  .nav { top: 0; bottom: 0; right: auto; width: var(--side-w); height: auto; flex-direction: column; gap: 4px; padding: 22px 14px; box-shadow: 1px 0 0 rgba(0, 0, 0, .08); }
  .nav .brand { display: block; padding: 4px 10px 22px; }
  .nav .brand img { width: 170px;  } 
  :root[data-theme="dark"] .nav .brand img { filter: brightness(0) invert(1); }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav .brand img { filter: brightness(0) invert(1); } }
  .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 15px; }
  .tab.is-on { background: rgba(255, 255, 255, .45); }
  .main { margin-left: var(--side-w); padding-bottom: 60px; }
  body.has-mini .main { padding-bottom: 110px; }
  body.no-nav .main { margin-left: 0; }
  .mini { left: auto; right: 24px; bottom: 24px; width: 380px; }
  .mini.is-collapsed { width: 48px; bottom: 24px; }
  .mapview { inset: 0 0 0 var(--side-w); }
  .now-img { max-height: 280px; aspect-ratio: auto; height: 280px; }
  .s-hero { aspect-ratio: 16 / 7; border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .stop, .seq { max-width: 860px; }
  .nextbar, .seq-bar { bottom: 20px; }
  .lf-row { grid-auto-columns: minmax(220px, 32%); }
  .room-list { grid-template-columns: repeat(3, 1fr); }
  .sheet { left: 50%; right: auto; width: min(620px, 92vw); transform: translate(-50%, 100%); }
  .sheet.is-detent { left: 0; right: 0; margin: 0 auto; transform: translateY(100%); }   /* centred without transform: the sheet moves by translateY */
  .sheet-root.is-open .sheet { transform: translate(-50%, 0); }
  .welcome { margin-top: 24px; border-radius: var(--r-lg); overflow: hidden; background: var(--card); box-shadow: var(--shadow-lg); }
  .toast { bottom: 40px; }
}

/* ------------------------------------------------- moving between screens
   app.js runs each change of screen as a view transition: the old screen fades
   out quickly while the new one fades in, sliding a little when going deeper
   (fwd) or back. The nav bar and the mini-player are named, so they stay put
   instead of fading with the page. Browsers without view transitions get a
   fade-in only. */
#nav { view-transition-name: nav; }
#mini { view-transition-name: mini; }
::view-transition-old(root) { animation: vt-out .15s ease-in both; }
::view-transition-new(root) { animation: vt-in .26s cubic-bezier(.2, .8, .2, 1) both; }
html[data-nav="fwd"]::view-transition-old(root) { animation-name: vt-out-fwd; }
html[data-nav="fwd"]::view-transition-new(root) { animation-name: vt-in-fwd; }
html[data-nav="back"]::view-transition-old(root) { animation-name: vt-out-back; }
html[data-nav="back"]::view-transition-new(root) { animation-name: vt-in-back; }
::view-transition-group(nav), ::view-transition-group(mini) { animation-duration: .26s; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
@keyframes vt-in-fwd { from { opacity: 0; transform: translateX(28px); } }
@keyframes vt-out-fwd { to { opacity: 0; transform: translateX(-12px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-28px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(12px); } }
/* Fallback and the first screen: opacity only (a transform here would move the
   page's fixed bars with it for a moment). */
.view.enter-fwd, .view.enter-back, .view.enter-fade, .view.enter-first { animation: vt-in .26s ease-out both; }
/* Until the first screen is drawn, a first visit (or a cleared one) shows the
   intro's navy, not a flash of the light page. */
html.boot-onb, html.boot-onb body { background: #0D1E30; }

/* --------------------------------------------- Clear my visit (visit.js) */
.resetting { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 20px; padding: 24px; color: #fff; text-align: center;
  background: radial-gradient(120% 60% at 0 0, rgba(164, 142, 92, .55), transparent 55%), linear-gradient(165deg, #0A2A4A 0%, #00212C 45%, #1F4852 100%);
  opacity: 0; transition: opacity .35s ease; }
.resetting.is-on { opacity: 1; }
.rs-mark svg { width: 72px; height: 72px; display: block; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rs-ring { stroke: #EBAD3E; stroke-width: 3; stroke-dasharray: 176; stroke-dashoffset: 176; transform: rotate(-90deg); transform-origin: 50% 50%; }
.resetting.is-on .rs-ring { animation: rsRing .85s .2s cubic-bezier(.6, 0, .3, 1) forwards; }
.rs-tick { stroke: #fff; stroke-width: 4; stroke-dasharray: 40; stroke-dashoffset: 40; transition: stroke-dashoffset .35s cubic-bezier(.3, .7, .3, 1); }
.resetting.is-done .rs-tick { stroke-dashoffset: 0; }
.rs-txt { display: grid; margin: 0; font: 400 20px/1.3 var(--caslon, var(--serif)); }
.rs-txt span { grid-area: 1 / 1; transition: opacity .3s ease, translate .3s ease; }
.rs-b { opacity: 0; translate: 0 8px; }
.resetting.is-done .rs-a { opacity: 0; translate: 0 -8px; }
.resetting.is-done .rs-b { opacity: 1; translate: 0 0; }
@keyframes rsRing { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
