/* Table Mountain — viewer chrome.
   ONE-TIME COPY of babylonstoren/css/app.css (tourism-3d's own rule: borrow
   proven code by copy, never by sync) for the boot veil, brand and palette.
   Sitting 3 (2026-09-08) built the explorer panel (desktop) / bottom sheet
   (phone). Sitting 4 (2026-09-08) replaces THAT with a pop-up toolbox: a
   64px rail of coloured discs that each pop one card open beside the rail,
   closed by default so the mountain owns the screen -- see README § "Sitting
   4 -- the toolbox rail" for the measured gate results. */

:root {
  --ink: #1c2226;
  --paper: #f4f6f5;
  --muted: rgba(28, 34, 38, 0.55);
  --line: rgba(28, 34, 38, 0.14);
  --leaf: #2f5730;
  --glass: rgba(244, 246, 245, 0.94);
  /* DARK, not light: the card's type is white (see .tb-card). 26% of a deep
     blue-grey still shows the mountain through it -- a light tint at any
     opacity milks the view toward white, which is what it did before. */
  --card-glass: rgba(14, 21, 30, 0.26);
  --pad: 20px;               /* the one outer margin every fixed element owns */

  /* Sitting 4 -- the toolbox rail's five-hue family, equal chroma. Colour
     lives ONLY on a disc, a card's 4px top bar, its 15% header wash, a
     selected difficulty chip and a checked switch -- nowhere else. */
  --places: #c9953a; --places-wash: #c9953a26;
  --trails: #5fa86a; --trails-wash: #5fa86a26;
  --views:  #5b9bd8; --views-wash:  #5b9bd826;
  --layers: #a98bd3; --layers-wash: #a98bd326;
  --guide:  #e0836b; --guide-wash:  #e0836b26;
  --eat:    #c0513a; --eat-wash:    #c0513a26;
  /* HOMES-BRIEF.md (2026-09-17) -- Atlantic slate blue, distinct from both
     --views and --gps (darker, greyer) at a glance; only rendered at all
     when the layer exists (main.js's own HOMES_ON gate). */
  --homes:  #2f6f8f; --homes-wash:  #2f6f8f26;
  /* STAY-BRIEF.md (2026-09-17) -- warm terracotta, distinct from --homes
     (slate blue) and --eat (rust red) at a glance; from the site's existing
     accent family rather than a new off-palette hue. */
  --stay:   #c17a4a; --stay-wash:   #c17a4a26;
  --gps:    #2f7fd6;
  /* Emergency. Outside the five-hue family ON PURPOSE -- this one must
     never read as just another tool. */
  --sos:    #d7443c; --sos-wash: #d7443c26;
  /* "More" (2026-09-18) is the ONE neutral disc, on purpose: every coloured
     disc is a place or a thing to do, and this one is the way to the rest of
     the interface. Graphite rather than a seventh hue keeps that distinction
     legible instead of adding another competing colour to the rail. */
  --menu:   #5d6672; --menu-wash:   #5d667226;

  --rail-w: 64px;
  --card-w: 344px;
  --card-top: 72px;
  /* The phone sheet's fixed `bottom` offset -- clear of #phone-bar (66px tall,
     18px inset) with a 12px gap, so the sheet's OWN box never geometrically
     overlaps the bar's, in ANY snap state (see the .tb-card phone rules: the
     sheet's height changes per snap, its `bottom` never does). */
  --bar-h: 66px;   /* #phone-bar's height -- taller when the bar is labelled */
  --bar-clear: calc(max(18px, env(safe-area-inset-bottom)) + var(--bar-h) + 12px);
  /* Clears the phone masthead (#brand) and its top-right #compass/#hint
     neighbours, whose bottom edges land around 56-58px down in the worst
     (no-notch) case -- 'full' height is measured against this, not the bare
     viewport, or a tall sheet paints straight over the masthead.
     🚨 Sitting G2 (i18n): #brand grew a real third line (the language
     picker, permanent, every visitor, every language) -- measured live,
     its bottom edge now lands at 72.25px, not 56-58px. 70px left a real,
     measured 226x2px overlap at 430px width (mobile_qa.py caught it after
     the fact, not predicted in advance). 86px restores the same ~14px
     safety cushion the original 70px value was built with over its own
     56-58px baseline. */
  --top-clear: 86px;
  --peek-h: 128px;
  --half-h: 55vh;
  /* 90vh, not the ~92vh a bare reading of "full" suggests -- at the smallest
     phone height (360x780) 92vh left the compass only ~2px of clearance
     above the sheet's top edge, which measurement rounding could turn into
     an overlap (Sitting 3's own finding; still true of these same sheets). */
  --sheet-h: 90vh;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  /* Layered fallback, not a replacement: on a browser that understands
     `dvh` this wins over the `100%` line above, tracking the ACTUAL visible
     area as a phone's address bar shows/hides. Without it `100%` resolves
     against the LARGEST viewport on iOS Safari, so hiding the bar leaves a
     real gap of flat body colour (#a7bcc5) below the canvas -- a bar the
     visitor sees and this codebase had no way to catch on a desktop probe. */
  height: 100dvh;
  overflow: hidden;
  background: #a7bcc5;
  color: var(--ink);
  font: 400 15px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app { position: fixed; inset: 0; }
/* 🚨 touch-action: none — THE RIG OWNS ALL GESTURES.
   Without it the browser claims the two-finger pinch as PAGE zoom before
   camera-rig.js ever sees it. The page scales, #app's position:fixed framing
   tears off the viewport, and there is no way back out on a phone — reported
   as "pinch breaks the frame and then it's stuck". The rig already implements
   pinch, twist and drag; it simply never received the gesture.
   Copied from the golf sites, which have carried this line since day one. */
#app, #app canvas { touch-action: none; }
#app canvas { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------ boot veil */
/* The loading plate is a render of THIS model (data/boot.jpg -- the front
   face from over the city, tablecloth on), so the first thing a visitor sees
   while the mountain builds is the mountain itself rather than a blank card.
   ⚠️ The background COLOUR under it is dark on purpose: the type over it is
   white, and if the image is slow or 404s, white-on-paper would be invisible.
   Colour first, image over it -- the fallback is legible on its own. */
#boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background-color: #1b2430;
  background-image:
    linear-gradient(to bottom,
      rgba(12, 18, 26, 0.30) 0%,
      rgba(12, 18, 26, 0.42) 45%,
      rgba(12, 18, 26, 0.78) 100%),
    url('../data/boot.jpg');
  background-size: cover, cover;
  background-position: center, center;
  z-index: 40;
  transition: opacity 0.7s ease, visibility 0.7s;
}
body.ready #boot { opacity: 0; visibility: hidden; }

.boot-inner {
  text-align: center;
  max-width: 22rem;
  padding: 0 1.5rem;
  color: #fff;
  /* the plate has bright cloud in it -- a soft shadow keeps the type off it */
  text-shadow: 0 1px 14px rgba(8, 12, 18, 0.55);
}

.boot-title {
  font-size: clamp(1.05rem, 3.4vw, 1.5rem);
  letter-spacing: 0.42em;
  text-indent: 0.42em;      /* tracking adds a phantom space on the right */
  font-weight: 400;
  color: #fff;
}
.boot-sub {
  margin-top: 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: rgba(255, 255, 255, 0.76);
  text-transform: uppercase;
}
.boot-bar {
  margin: 2rem auto 0.9rem;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}
.boot-bar i {
  display: block;
  height: 100%;
  width: 34%;
  background: #fff;
  animation: sweep 1.5s ease-in-out infinite;
}
@keyframes sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(394%); }
}
.boot-msg {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: rgba(255, 255, 255, 0.72);
  min-height: 1em;
}

/* ---------------------------------------------------------------- scrim */
/* Removed 2026-09-09 -- Luke: "there's a whole banner there... I want that
   gone, I want full screen." The top/bottom legibility scrims (translucent
   full-width gradient bars, pinned via `position: fixed`) read as pale bands
   across the whole viewport rather than a subtle readability aid. #brand
   already carries its own glass-chip background (see the note above its own
   rule, a few lines down) so nothing lost the scrim was actually protecting.
   If a future sitting needs masthead legibility back over a busy photo area,
   scope it to #brand/#brand-pill's own backdrop rather than a full-bleed bar. */

/* --------------------------------------------------------------- brand */
/* The phone masthead. On desktop (>=900px) this is retired -- #brand-pill
   (built by src/ui.js, below) carries the same mark/sub text instead; ui.js
   reads THIS node's textContent/markup once at construction and never
   duplicates it by hand, so the mountain-and-cloth mark drawn into
   `.brand-mark` here (index.html) is the one place its path data lives. */
/* left ONLY, deliberately no `right` -- a fixed-position element with both
   left AND right set spans the FULL viewport width regardless of its (much
   narrower) flex content, and getBoundingClientRect() measures that full
   box, not the visible content. The first cut set both, and mobile_qa.py's
   overlap audit correctly caught #brand's invisible right-hand two-thirds
   "overlapping" #hint and #compass despite nothing being painted there.
   ⚠️ This comment USED TO say legibility came from ".brand-mark's own
   glass chip plus the existing body::before top scrim" -- that scrim was
   REMOVED 2026-09-09 (see the "scrim" section header above), and citing it
   here regardless was stale and wrong at least as far back as this
   comment's own last edit. Corrected 2026-09-16 after it fooled a later
   sitting into skipping a backdrop for two new masthead lines, which then
   read as illegible noise over photo texture at phone width -- see #brand's
   own rule for the real fix (its own scoped backdrop, not a scrim). */
#brand {
  position: fixed;
  left: 16px;
  top: max(16px, env(safe-area-inset-top));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.9s ease 0.3s;
  pointer-events: none;
  /* Conductor fix, 2026-09-16: this comment block itself (a few lines up)
     cited "the existing body::before top scrim" as this element's real
     source of legibility over a busy photo -- but that scrim was REMOVED
     on 2026-09-09 (see the "scrim" section header right above, in this
     same file), and the reasoning for removing it without replacing it was
     explicitly scoped to a two-line mark+sub masthead protected by
     `.brand-mark`'s own small glass chip. Confirmed live at 390px with
     embed mode's "Explore in 3D" line and the language picker both added
     (Sitting G, 2026-09-15) -- the stack is now FOUR lines, the icon chip
     covers roughly one of them, and the bottom two read as illegible noise
     against real rock/cloud photo texture (not a DOM overlap -- the four
     lines' own getBoundingClientRect()s are cleanly non-overlapping,
     confirmed -- a pure legibility failure). The 2026-09-09 sitting's own
     closing note already said exactly what to do about this: "if a future
     sitting needs masthead legibility back over a busy photo area, scope
     it to #brand/#brand-pill's own backdrop rather than a full-bleed bar."
     This is that future sitting. Unconditional (not just in embed mode) --
     the original two-line case was already a thin margin resting on one
     small icon, this is the more robust version of the same thing, not a
     new visual weight Luke would notice as "a banner."
     Declutter pass, 2026-09-18: the language picker moved out of this stack
     into the More card, so the four lines that forced this backdrop are two
     again -- and the whole block is deliberately smaller (Luke: "just put
     Table Mountain in there, Elysium Labs Africa, but smaller"). The
     backdrop itself stays: two lines over moving cloud/rock photo still
     need it, cheaper to keep than to re-litigate the 2026-09-16 fix. */
  padding: 5px 10px 5px 6px;
  border-radius: 12px;
  background: rgba(12, 19, 28, 0.34);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
body.ready #brand { opacity: 1; }

.brand-mark {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(28, 34, 38, 0.10);
}
.brand-mark svg { width: 20px; height: 20px; display: block; }

.brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
#brand .mark {
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5), 0 0 18px rgba(255, 255, 255, 0.7);
}
#brand .sub {
  margin-top: 0;
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5), 0 0 18px rgba(255, 255, 255, 0.7);
}

/* Wave 5 (2026-09-16): #brand is deliberately left-only sized (see its own
   rule's comment above) so its measured box is real content, not a phantom
   full-width one -- and at 360px specifically (not 390/430, both already
   clear with room to spare) that real content is wide enough to reach 12px
   into #hint's box: measured live, brand 245.6px wide ending at x=261.6,
   hint starting at x=250. Not something this sitting's own changes touched
   (no CSS/markup here changed) -- mobile_qa.py simply hadn't caught it at
   this exact width before. Same fix as every other "detail doesn't fit"
   case in this file: clip gracefully rather than force the box wider. Only
   #brand's SUB line is constrained -- "CAPE TOWN, SOUTH AFRICA" is the
   widest of the three stacked lines in every shipped language; the mark
   and the language picker already fit under the same cap without help. */
@media (max-width: 379px) {
  #brand .sub {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (min-width: 900px) {
  #brand { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-bar i { animation: none; width: 100%; }
  #boot, #brand { transition: none; }
  #toolbox-rail, #toolbox-rail *, #phone-bar, #phone-bar *,
  #hint, #compass, #compass *, .tb-card { transition: none !important; }
}

/* =====================================================================
   Brand pill -- desktop only. Same mark/sub text as #brand (read by
   ui.js), just repositioned next to the rail instead of pinned top-left.
   ===================================================================== */
#brand-pill { display: none; }
@media (min-width: 900px) {
  #brand-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    left: calc(var(--pad) + var(--rail-w) + 16px);
    top: 22px;
    z-index: 25;
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px 8px 10px;
    box-shadow: 0 3px 10px rgba(28, 34, 38, 0.10);
    opacity: 0;
    transition: opacity 0.9s ease 0.3s;
    pointer-events: none;
  }
  body.ready #brand-pill { opacity: 1; }
  .brand-pill-mark { display: flex; color: var(--ink); }
  .brand-pill-mark svg { width: 22px; height: 22px; display: block; }
  .brand-pill-text {
    font-size: 12.5px; letter-spacing: 0.32em; text-indent: 0.32em; color: var(--ink);
    white-space: nowrap;
  }
  .brand-pill-div { width: 1px; height: 12px; background: var(--line); }
  .brand-pill-sub {
    font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
    white-space: nowrap;
  }
}

/* =====================================================================
   The toolbox rail -- desktop (>=900px) only. #phone-bar (near the bottom
   of this file) replaces it on phone.
   ===================================================================== */
#toolbox-rail { display: none; }
@media (min-width: 900px) {
  #toolbox-rail {
    position: fixed;
    left: var(--pad);
    top: var(--pad);
    bottom: var(--pad);
    width: var(--rail-w);
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0 10px;
    gap: 14px;
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(28, 34, 38, 0.14);
    opacity: 0;
    transition: opacity 0.7s ease 0.4s;
  }
  body.ready #toolbox-rail { opacity: 1; }
}

.rail-logo {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.rail-logo svg { width: 36px; height: 36px; display: block; }
.rail-hr { flex: 0 0 auto; width: 32px; height: 1px; background: var(--line); }
.rail-discs { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* ------------------------------------------------------------- discs */
.disc {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 3px 8px rgba(28, 34, 38, 0.18);
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  cursor: pointer;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.disc-ico { display: flex; width: 22px; height: 22px; }
.disc-ico svg { width: 100%; height: 100%; display: block; }

@media (hover: hover) {
  .disc:hover { transform: translateY(-1px); }
}
.disc:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* One colour token per key, shared by the disc AND its matching card (the
   card reads the same custom property for its bar/wash/switch accents --
   see .tb-card below). GPS has no card; it gets --accent only, for its own
   outline/tracking states. */
[data-disc="places"], #card-places { --accent: var(--places); --accent-wash: var(--places-wash); }
[data-disc="trails"], #card-trails { --accent: var(--trails); --accent-wash: var(--trails-wash); }
[data-disc="views"],  #card-views  { --accent: var(--views);  --accent-wash: var(--views-wash); }
[data-disc="layers"], #card-layers { --accent: var(--layers); --accent-wash: var(--layers-wash); }
[data-disc="guide"],  #card-guide  { --accent: var(--guide);  --accent-wash: var(--guide-wash); }
[data-disc="eat"],    #card-eat    { --accent: var(--eat);    --accent-wash: var(--eat-wash); }
[data-disc="homes"],  #card-homes  { --accent: var(--homes);  --accent-wash: var(--homes-wash); }
[data-disc="stay"],   #card-stay   { --accent: var(--stay);   --accent-wash: var(--stay-wash); }
[data-disc="sos"], #card-sos { --accent: var(--sos); --accent-wash: var(--sos-wash); }
[data-disc="menu"], #card-menu { --accent: var(--menu); --accent-wash: var(--menu-wash); }

.disc[data-disc] { background: var(--accent); }

/* Open state: a paper ring + the disc's own colour, and a 6% scale lift --
   never a coloured BORDER at rest (that lives only on the ring). */
.disc[data-disc][aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--accent);
  transform: scale(1.06);
}
@media (hover: hover) {
  .disc[data-disc][aria-pressed="true"]:hover { transform: scale(1.06) translateY(-1px); }
}

/* GPS -- outline = utility, per the brief: transparent fill, coloured ring
   and icon at rest; filled + white icon once actually tracking (mirrors the
   old #locate[data-on="1"] treatment). */
.disc-outline {
  width: 44px; height: 44px;
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

/* Layer on/off toggles (the DA link's Trails + Wards, 2026-09-23). Same
   vocabulary as GPS just above: OFF = outline on paper, ON = the filled
   disc with the open-state ring, so on and off read apart at a glance --
   a ring alone was too subtle. Each toggle sets its own --accent. */
.trails-toggle { --accent: var(--trails); }
.layer-toggle {
  background: var(--paper);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  box-shadow: none;
}
.layer-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--accent);
  transform: scale(1.06);
}
@media (hover: hover) {
  .layer-toggle[aria-pressed="true"]:hover { transform: scale(1.06) translateY(-1px); }
}
/* Words under the bar buttons (the DA link, 2026-09-23 -- ui.js `barLabels`).
   Luke: "People don't know what those things at the bottom are... I need to
   actually say the words." The word is a child of its button, so tapping the
   word taps the button; the disc itself stays the 46/48px touch target. The
   phone bar grows to hold it, and --bar-clear (redeclared here, because a
   custom property resolves where it is declared) moves every sheet up too. */
.disc-label { display: none; }
body.bar-labelled {
  --bar-h: 84px;
  --bar-clear: calc(max(18px, env(safe-area-inset-bottom)) + var(--bar-h) + 12px);
}
body.bar-labelled .rail-discs { gap: 36px; }
body.bar-labelled .rail-discs > .disc,
body.bar-labelled #phone-bar > .disc { position: relative; }
body.bar-labelled .disc-label {
  display: block;
  position: absolute;
  top: calc(100% + 9px);   /* clears the 5px "on" ring + its 6% scale */
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
}
@media (max-width: 899px) {
  body.bar-labelled #phone-bar { align-items: flex-start; padding-top: 8px; }
}
/* --------------------------------------------------------------- #hint */
/* The one stable anchor credits.js mounts its "i" into (unedited -- see
   src/credits.js). Positioned by CSS alone: unlike Sitting 3's collapsible
   panel, nothing in THIS design ever hides or moves the rail/masthead, so
   there is no need to reparent this node at runtime the way Sitting 3 did --
   it stays exactly where index.html put it and just gets a fixed position
   here (foot of the rail on desktop, beside the compass on phone). */
#hint {
  position: fixed;
  z-index: 27;
  margin: 0; padding: 0;
  font-size: 0; line-height: 0;   /* the injected button is the only content */
  pointer-events: none;           /* the injected button re-enables itself */
}
#hint .hint-text { display: none; }   /* the toast reads from the canvas, not here */
/* 2026-09-18 declutter pass: #hint/#creditsbtn is the one piece of corner
   chrome deliberately LEFT here, not folded into the More card -- see
   ui.js's _buildMenuBody for why (a real mobile_qa.py gate failure caught
   the first attempt to move it: attribution must be tappable in EVERY
   state, not just while one particular card happens to be open). */

@media (min-width: 900px) {
  #hint {
    left: var(--pad);
    width: var(--rail-w);
    bottom: 30px;
    display: flex;
    justify-content: center;
  }
}
@media (max-width: 899px) {
  #hint {
    right: calc(14px + 44px + 8px);
    top: max(14px, env(safe-area-inset-top));
    width: 44px; height: 44px;
  }
}

/* ------------------------------------------------------------- compass */
#compass {
  position: fixed;
  z-index: 22;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(28, 34, 38, 0.10);
  opacity: 0;
  transition: opacity 0.9s ease 0.6s;
}
body.ready #compass { opacity: 1; }
/* The needle rotates, not the button -- see ui.js's compassNeedle comment.
   Rotating the OUTER button measured bigger than its true box in Sitting 3's
   overlap audit: getBoundingClientRect() returns a rotated element's
   axis-aligned box, larger than the unrotated one even though a rotated
   CIRCLE reads identically on screen. */
.compass-needle {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  transition: transform 0.2s linear;
}
.compass-needle svg { width: 20px; height: 20px; }
#compass:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (min-width: 900px) { #compass { right: var(--pad); top: var(--pad); } }
@media (max-width: 899px) { #compass { right: 14px; top: max(14px, env(safe-area-inset-top)); } }

/* ----------------------------------------------------------- saver toggle */
/* 2026-09-19: same box/glass/shadow recipe as #compass just above (deliberate
   copy, not a shared class -- #compass's own rule has compass-specific
   children/rotation logic this button doesn't need). One slot below the
   compass, same right edge -- #gps-note (next block) moves down accordingly
   so the two can never collide even when both are visible at once. */
#saver-toggle {
  position: fixed;
  z-index: 23;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(28, 34, 38, 0.10);
  opacity: 0;
  transition: opacity 0.9s ease 0.6s, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
body.ready #saver-toggle { opacity: 1; }
#saver-toggle svg { width: 20px; height: 20px; display: block; }
#saver-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* On: the same green already used for a positive/eco reading elsewhere
   (.detail-dist's "2.3 km away" text) -- not one of the per-card --accent
   tokens, since this button lives outside every card's own [data-disc]
   scope and has no natural one of its own. */
#saver-toggle.is-on {
  background: #2f573026;
  border-color: var(--leaf);
  color: var(--leaf);
}

@media (min-width: 900px) { #saver-toggle { right: var(--pad); top: 74px; } }
@media (max-width: 899px) { #saver-toggle { right: 14px; top: 66px; } }

/* ---------------------------------------------------------------- toast */
.toast-hint {
  position: fixed;
  z-index: 6;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.9s ease 0.6s;
  pointer-events: none;
  white-space: nowrap;
}
body.ready .toast-hint { opacity: 1; }
/* 🚨 REAL BUG, fixed 2026-09-18: this used to read `.toast-hint.faded`, which
   loses to `body.ready .toast-hint` above on specificity -- (0,2,1) beats
   (0,2,0) -- so the hint NEVER faded, on any device, however long a visitor
   stayed. Measured live: still opacity 1 ten minutes after load, with
   `.faded` correctly applied by ui.js's 6s timer the whole time; the timer
   was never the bug. Must stay at or above `body.ready`'s specificity if
   this rule is ever touched again. */
body.ready .toast-hint.faded { opacity: 0; transition: opacity 0.6s ease; }
/* Hidden whenever a card/sheet is open -- pointless under an open card, and
   on phone the sheet would otherwise sit on top of it anyway (the exact
   overlap Sitting 3's own gate 3 caught once, on the old always-open sheet). */
html[data-open] .toast-hint { display: none; }
/* Conductor fix, 2026-09-15: confirmed live at 390px width with all ten
   trailhead tags on -- the declutter sweep (ui.js _declutterTags) only
   resolves tag-vs-tag overlap, and at narrow widths a tag pushed down to
   clear its neighbours lands squarely on top of this toast's own fixed
   bottom position, both rendering as overlapping unreadable text
   (Platteklip Gorge's pill over "DRAG TO LOOK AROUND"). Same fix hikeit.js
   already applies for the exact same reason during an active flight --
   ported here rather than teaching the declutter sweep a THIRD kind of
   obstacle (it has already been rewritten twice for tag-vs-tag alone, see
   that method's own comment; pushing this in as one more collision class
   risks the same oscillation bugs, not a quick win). The toast is
   non-interactive wayfinding chrome, not attribution -- #creditsbtn (the
   licence/credits button) is a separate element, untouched by this rule. */
body.trails-on .toast-hint { display: none; }

@media (min-width: 900px) {
  .toast-hint { bottom: 22px; }
  /* Centring on the WHOLE viewport collides with #guide-teaser at the first
     paint (both visible together only in the rail-rest, pre-interaction
     state -- the teaser survives until Guide is opened once, the toast
     until the first drag/wheel or 6s): teaser's rightmost extent is
     left(94px) + its own max-width(280px) = 374px, so recentre the toast on
     the free canvas to the right of that instead of the raw viewport --
     half of 374, rounded up. Same fix Sitting 3 used for its old panel vs
     this same toast, generalised: shift right by half of whatever occupies
     the left edge. */
  .toast-hint { left: calc(50% + 190px); }
}
@media (max-width: 899px) { .toast-hint { bottom: 154px; } }

/* ----------------------------------------------------------- guide teaser */
#guide-teaser {
  position: fixed;
  z-index: 21;
  display: flex; align-items: center; gap: 10px;
  max-width: 280px;
  padding: 10px 14px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 8px 20px rgba(28, 34, 38, 0.14);
  opacity: 0;
  transition: opacity 0.9s ease 0.8s;
  pointer-events: none;   /* decorative -- reached via its disc, not the bubble */
}
body.ready #guide-teaser { opacity: 1; }
#guide-teaser[hidden] { display: none; }
html[data-open] #guide-teaser { display: none; }
.teaser-ico {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--guide);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.teaser-ico svg { width: 14px; height: 14px; }

@media (min-width: 900px) {
  #guide-teaser { left: calc(var(--pad) + var(--rail-w) + 10px); bottom: 26px; }
}
@media (max-width: 899px) {
  #guide-teaser { right: 14px; bottom: 98px; border-radius: 14px 14px 4px 14px; }
  .teaser-ico { width: 24px; height: 24px; }
  .teaser-ico svg { width: 13px; height: 13px; }
}

/* -------------------------------------------------------------- gps note */
/* Status feedback for the GPS disc/fab (locating/away/error/tracking) --
   anchored on the opposite (right) side from the rail/cards on desktop and
   clear of the bar/teaser on phone, so it can never collide with an open
   card or the teaser regardless of viewport width. Pushed down one more
   slot (2026-09-19) when #saver-toggle took this corner's second spot --
   this note is `[hidden]` most of the time, but a visitor can have GPS
   running and see it at the same time the saver button is on screen (it
   always is), so the two must never share a slot even though only one of
   them is usually visible. */
#gps-note {
  position: fixed;
  z-index: 24;
  max-width: 220px;
  margin: 0;
  padding: 8px 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 6px 16px rgba(28, 34, 38, 0.14);
  pointer-events: none;
}
#gps-note[hidden] { display: none; }

@media (min-width: 900px) { #gps-note { right: var(--pad); top: 128px; } }
@media (max-width: 899px) { #gps-note { right: 14px; top: 118px; } }

/* =====================================================================
   The cards -- one per disc (Places/Trails/Views/Layers/Guide). Same
   markup and class names at both widths; only position/size/orientation
   change (desktop: a side card beside the rail; phone: a bottom sheet) --
   the same "one chrome, two layouts" rule Sitting 3 set for its old
   #explorer. Closed by default (`hidden`); ui.js's open/close choreography
   clears `hidden`, flushes layout, then toggles `.is-open` so the CSS
   transition below actually has two distinct frames to animate between.
   ===================================================================== */
.tb-card {
  position: fixed;
  z-index: 25;
  display: flex;
  flex-direction: column;
  /* Luke, 2026-09-08: "completely white... I want to see through them so I
     can see what I'm still looking at" -- a near-opaque fill (--glass is
     94%) reads as solid over the mountain. --card-glass drops that to ~8%
     and leans on a light blur to keep the list text readable, rather than
     var(--glass) itself, since the rail/brand pills that also use --glass
     were not part of the complaint and stay as they were. */
  /* 🚨 THE CARD RUNS ITS OWN PALETTE, and it is the INVERSE of the page's.
     Luke, 2026-09-09: "that writing should be in white most of the time
     because the mountains are dark... a little bit more see-through, and then
     just make the lettering white."
     A light fill is what forced dark type, and a light fill over a dark
     mountain is exactly what he was seeing wash out. So the three tokens the
     whole card interior is built on (--ink / --muted / --line) are redefined
     HERE, on the card itself, and every child rule that already reads them
     flips for free rather than being chased down one by one. --paper flips
     with them so `.row[aria-pressed]`, which paints ink-on-paper, comes out
     as a white chip with dark type -- still the strongest thing in the list. */
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.68);
  --line: rgba(255, 255, 255, 0.20);
  --paper: #16202b;
  background: var(--card-glass);
  /* Less blur than before (10px) as part of "more see-through" -- blur is
     what was eating the view behind, more than the fill was. */
  backdrop-filter: blur(7px) saturate(125%);
  -webkit-backdrop-filter: blur(7px) saturate(125%);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  color: var(--ink);
  /* the drape behind runs from bright cloud to near-black gorge -- a soft
     shadow is what keeps white type readable across both */
  text-shadow: 0 1px 10px rgba(6, 10, 16, 0.55);
  /* Motion is transform + opacity ONLY -- never width/height/padding/margin.
     This page runs two concurrent raymarched cloud volumes against a frame
     budget the quality ladder exists to protect; a layout-thrashing popup
     transition is a genuine stutter risk here, not a lint nitpick (the exact
     mistake Sitting 3 made and had to strip out of the old #explorer's own
     collapse transition -- see the file header). */
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), opacity 180ms ease;
}
.tb-card[hidden] { display: none; }

.card-notch {
  position: absolute;
  left: -7px; top: 50%;
  width: 12px; height: 12px;
  /* Matches .tb-card's fill -- a solid --paper notch on a see-through card
     would read as a floating white diamond. */
  background: var(--card-glass);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}
.card-bar { height: 4px; flex: 0 0 auto; background: var(--accent); }
.card-handle {
  display: none;
  flex: 0 0 auto;
  width: 100%;
  min-height: 22px;
  align-items: center; justify-content: center;
  border: 0; background: none; padding: 6px 0 0;
  cursor: grab;
  touch-action: none;
}
.card-handle .grip { display: block; width: 34px; height: 4px; border-radius: 999px; background: var(--line); }

.card-head {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 12px 12px 16px;
  background: var(--accent-wash);
  border-bottom: 1px solid var(--line);
}
.card-head-ico {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.card-head-ico svg { width: 16px; height: 16px; display: block; }
.card-title {
  flex: 1 1 auto;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: var(--ink);
}
.card-close {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border: 0; background: none; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  cursor: pointer;
}
.card-close svg { width: 16px; height: 16px; }
.card-close:hover { color: var(--ink); }

.card-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.4rem 0 0.6rem;
  display: flex;
  flex-direction: column;
}

.tb-card button:focus-visible, .tb-card input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

@media (min-width: 900px) {
  .tb-card {
    left: calc(var(--pad) + var(--rail-w) + 16px);
    top: var(--card-top);
    width: var(--card-w);
    max-height: calc(100vh - var(--card-top) - var(--pad));
    box-shadow: 0 14px 36px rgba(28, 34, 38, 0.18);
    opacity: 0;
    transform: translateX(-8px);
  }
  .tb-card.is-open { opacity: 1; transform: translateX(0); }
  .card-notch { display: block; }
  #card-guide { height: 470px; }
}

@media (max-width: 899px) {
  .tb-card {
    left: 0; right: 0;
    /* Fixed, and the actual fix (see the long comment below) -- never 0.
       Only #phone-bar's own 66px + 18px inset + a 12px gap need clearing
       here (the sole floating button left, #sos-fab, is hidden outright
       whenever a card is open, same as before). */
    bottom: var(--bar-clear);
    height: var(--peek-h);      /* fallback; a snap rule below wins once open */
    border-radius: 20px 20px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    box-shadow: 0 -10px 30px rgba(28, 34, 38, 0.16);
    opacity: 0;
    /* Only the OPEN/CLOSE motion is transform+opacity (a small vertical
       nudge) -- the snap-to-height below is deliberately NOT in this list. */
    transform: translateY(16px);
    touch-action: pan-y;
  }
  .tb-card.is-open { opacity: 1; transform: translateY(0); }

  /* Peek/half/full change HEIGHT, with `bottom` held fixed at --bar-clear in
     every one of them -- NOT a width/height transition (the file header's
     rule against those is about never putting them in a smooth
     `transition:`; these are discrete, untransitioned values, same
     category as any other static CSS length). This replaces a first cut
     that reused Sitting 3's old #explorer mechanics verbatim -- bottom:0,
     height:90vh, translateY(sheetHeight - snapHeight) -- which worked
     there because NOTHING else lived at the very bottom of the screen. Here
     #phone-bar does, permanently, and translateY moves the sheet's WHOLE
     box (both edges) uniformly: at 'peek' the box's bottom edge still sat
     at the viewport's bottom edge, so its rect geometrically overlapped
     #phone-bar's rect (and covered #card-close under it, making it
     untappable) in every snap state, not just full. Anchoring `bottom` at
     --bar-clear and letting height vary keeps the sheet's bottom edge
     permanently above the bar instead. ui.js's drag handler sets `height`
     directly during a drag (1:1 finger tracking, transition:none while
     dragging, exactly as this repo's other drag handles already do) and
     snaps to one of these three rules on release. */
  html[data-sheet="peek"] .tb-card.is-open { height: var(--peek-h); }
  html[data-sheet="half"] .tb-card.is-open { height: var(--half-h); }
  html[data-sheet="full"]  .tb-card.is-open { height: calc(100vh - var(--bar-clear) - var(--top-clear)); }

  .card-notch { display: none; }
  .card-handle { display: flex; }
  .card-body { touch-action: pan-y; padding-bottom: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tb-card { transition: none !important; }
}

/* ------------------------------------------------------------- search */
.search-wrap {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  margin: 12px 12px 4px;
  padding: 0 12px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.10);
}
.search-ico { flex: 0 0 auto; width: 16px; height: 16px; color: var(--muted); display: flex; }
.search-ico svg { width: 100%; height: 100%; }
#explorer-search {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: 0; background: none; padding: 0;
  font: inherit; font-size: 13.5px; color: var(--ink);
}
#explorer-search::placeholder { color: var(--muted); }
#explorer-search::-webkit-search-cancel-button { cursor: pointer; }

.places-list { flex: 1 1 auto; min-height: 0; }

.group-head {
  margin: 12px 16px 4px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.group-head:first-child { margin-top: 8px; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: calc(100% - 16px);
  margin: 0 8px;
  height: 40px;
  padding: 0 16px;
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.row:hover { background: rgba(255, 255, 255, 0.12); }
.row[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.row-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;   /* elevation/km/climb figures align */
}
.row[aria-pressed="true"] .row-meta { color: rgba(22, 32, 43, 0.66); }
.row-caption {
  display: block;
  flex-basis: 100%;
  margin-top: 0.15rem;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
  white-space: normal;
}
.view-row, .view-fly { height: auto; min-height: 40px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.view-fly { font-weight: 500; }
.view-fly .ico, .view-fly .ico svg { width: 16px; height: 16px; }

.trail-meta { display: flex; align-items: center; gap: 8px; }
.diff-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  border: 1px solid var(--muted);
}
/* Difficulty chips keep their OWN colour regardless of the row's selected
   (ink-on-paper) state -- see renderSwitch's comment in ui.js for the same
   rule applied to switches. Sitting A: these are now the EXACT three hex
   values routes.js paints the line/halo with (--diff-gentle doubles as
   --trails on purpose, see routes.js's own header) -- the chip and the line
   on the mountain can never read as two different opinions about the same
   trail. */
:root {
  --diff-gentle: var(--trails);
  --diff-moderate: #e0a63a;
  --diff-steep: #e0553a;
}
.diff-gentle   { color: var(--diff-gentle); border-color: var(--diff-gentle); }
.diff-moderate { color: var(--diff-moderate); border-color: var(--diff-moderate); }
.diff-steep    { color: var(--diff-steep); border-color: var(--diff-steep); }

/* ------------------------------------------------------ trail row + card */
.trail-row-line { display: flex; align-items: stretch; gap: 2px; margin: 0 8px; }
.trail-row-line .trail-row { width: 100%; margin: 0; }
.trail-chevron {
  flex: 0 0 auto;
  width: 36px; min-width: 36px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px;
  background: none; color: var(--muted); cursor: pointer;
}
.trail-chevron:hover { background: rgba(255, 255, 255, 0.12); color: var(--ink); }
.trail-chevron-ico { display: flex; width: 15px; height: 15px; transition: transform 0.18s ease; }
.trail-chevron[aria-expanded="true"] .trail-chevron-ico { transform: rotate(90deg); }
.trail-chevron:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.trail-stats {
  margin: 0 0 0.35rem;
  font-size: 13.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.trail-profile {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0.55rem 0 0;
  color: var(--accent);
  overflow: visible;
}
.trail-actions { display: flex; flex-direction: column; gap: 4px; margin: 0.7rem -0.9rem -0.1rem; }
.trail-action { width: calc(100% - 16px); }

.empty-note, .shortcuts-note {
  margin: 12px 16px;
  font-size: 12px;
  color: var(--muted);
}
.shortcuts-note {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  letter-spacing: 0.02em;
}

.card-divider { flex: 0 0 auto; height: 1px; background: var(--line); margin: 0 16px 6px; }
.card-foot-note {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.foot-note-bar { flex: 0 0 auto; width: 22px; height: 4px; border-radius: 2px; background: var(--accent); }

.row-wrap { display: flex; flex-direction: column; }
.detail {
  position: relative;
  margin: 0.1rem 8px 0.6rem;
  padding: 0.8rem 2.2rem 0.9rem 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.detail-close {
  position: absolute;
  top: 0.4rem; right: 0.4rem;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--muted); cursor: pointer;
}
.detail-close svg { width: 12px; height: 12px; }
.detail-kind {
  margin: 0 0 0.4rem;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-blurb { margin: 0; font-size: 13.5px; line-height: 1.6; }
.detail-dist {
  margin: 0.7rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--leaf);
}
.detail-dist[hidden] { display: none; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 44px;
  margin: 0 8px;
  padding: 0 16px;
  cursor: pointer;
  flex: 0 0 auto;
}
.switch-label { font-size: 13.5px; color: var(--ink); }
/* A one-line explanation under a switch whose consequence is not obvious
   from its own label -- used by the Homes "3D house model" toggle, where
   what you get when it is OFF (the bare aerial photograph of the real roof)
   is the whole point of the control. */
.switch-hint {
  margin: -4px 8px 10px;
  padding: 0 16px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
}

/* =====================================================================
   The "More" card -- everything that used to own a permanent corner,
   EXCEPT #creditsbtn (see css/app.css's own #hint comment for why: a
   licence-attribution gate requires it stay reachable in every state, not
   just while this card is the one open). Rows here are links to other
   cards, live switches, or #live-chip -- an element live.js owns and keeps
   updating, simply re-parented here by ui.js's _adoptMenuGuests.
   ===================================================================== */
.menu-row { justify-content: flex-start; gap: 12px; }
.menu-row-ico { flex: 0 0 auto; display: flex; width: 19px; height: 19px; color: var(--accent); }
.menu-row-ico svg { width: 100%; height: 100%; display: block; }
.menu-row .row-name { flex: 1 1 auto; text-align: left; }
.menu-row-chev { flex: 0 0 auto; display: flex; width: 14px; height: 14px; color: var(--muted); }
.menu-row-chev svg { width: 100%; height: 100%; display: block; }

/* The live-conditions chip, in its menu home. live.js positions it `fixed`
   for its own top-right corner life; inside this card it is ordinary flow
   content, full width, left-aligned like every other row. Only layout is
   overridden -- its colours, dot and cableway link stay exactly as live.js
   draws them, so that module needs to know nothing about this card. */
.menu-live { margin: 0 8px 4px; }
.menu-live:empty { display: none; }
.menu-live #live-chip {
  position: static;
  max-width: none;
  width: 100%;
  align-items: flex-start;
  box-sizing: border-box;
  opacity: 1; visibility: visible; pointer-events: auto;
  box-shadow: none;
}
.menu-live #live-chip .live-chip-text,
.menu-live #live-chip .live-chip-meta { text-align: left; }

.menu-lang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  margin: 0 8px;
  padding: 0 16px;
}
.menu-lang-row .row-name { font-size: 13.5px; color: var(--ink); }
.switch-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 38px; height: 22px;
  margin: 0;
  cursor: pointer;
}
.switch-track {
  position: relative;
  width: 38px; height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  transition: background 0.15s ease;
  flex: 0 0 auto;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
/* The on-colour is whichever card this switch lives inside (--accent) --
   see renderSwitch's own comment in ui.js. */
.switch-row input:checked + .switch-track { background: var(--accent); }
.switch-row input:checked + .switch-track::after { transform: translateX(16px); }
.switch-row input:focus-visible + .switch-track { outline: 2px solid var(--ink); outline-offset: 2px; }

/* -------------------------------------------------------------- guide */
.guide-body { padding: 0; }
.guide-messages {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px;
}
.guide-bubble {
  align-self: flex-start;
  max-width: 86%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  padding: 10px 14px;
}
.guide-bubble p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.guide-chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* Reads --accent/--accent-wash, not a hardcoded colour -- shared verbatim by
   the Guide card's suggestion chips and the Eat card's category filters, so
   each always matches the card it lives inside (same rule as .switch-track). */
.chip {
  border: 1px solid var(--accent);
  background: var(--accent-wash);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}
@media (hover: hover) {
  .chip:hover { background: var(--accent); color: #fff; }
}
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; }
.chip:disabled { opacity: 0.45; cursor: default; }

/* --------------------------------------------------------- eat & drink */
.eat-chips { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 12px 10px; }
.eat-row .row-meta { display: flex; align-items: center; }
.eat-open-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}
.eat-open-dot.eat-open { background: var(--trails); }
.eat-open-dot.eat-closed { background: var(--muted); }
.eat-line { margin: 0.35rem 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.eat-links { display: flex; flex-direction: column; gap: 4px; margin: 0.7rem -0.9rem 0; }
.eat-link { width: calc(100% - 16px); }
.eat-featured-cta {
  display: block;
  margin: 0.8rem 0 0;
  font-size: 11.5px;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 2px;
}
.eat-offer-slot { margin: 0.6rem -0.9rem 0; }
.eat-claim-btn {
  width: calc(100% - 16px);
  height: auto; min-height: 44px;
  padding: 10px 16px;
  background: var(--eat-wash);
  border: 1px solid var(--eat);
}
.eat-claim-btn .row-name { white-space: normal; font-size: 13px; }
.eat-claim-btn .row-meta { color: var(--eat); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; font-size: 10.5px; }

/* ------------------------------------------------------- homes for sale
   HOMES-BRIEF.md (2026-09-17). Reuses .eat-chips/.eat-line/.eat-links/
   .eat-featured-cta/.detail-kind/.detail-blurb verbatim (see ui.js) --
   these rules only cover what's genuinely new: the sample badge, the photo
   strip, the large price line and the primary "Stand on the balcony" CTA. */
.homes-row .row-meta { font-variant-numeric: tabular-nums; }
.home-sample-chip {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--homes-wash);
  color: var(--homes);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.homes-sample-banner {
  margin: 0 12px 10px;
  padding: 8px 10px;
  background: var(--homes-wash);
  border: 1px solid var(--homes);
  border-radius: 8px;
  color: var(--ink);
}
.home-sample-badge {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--homes-wash);
  border: 1px solid var(--homes);
  color: var(--homes);
  font-size: 10.5px;
  font-weight: 600;
}
.home-price {
  margin: 0.2rem 0 0.5rem;
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.home-photos {
  display: flex;
  gap: 6px;
  margin: 0 -0.9rem 0.6rem;
  padding: 0 0.9rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.home-photos img {
  flex: 0 0 auto;
  width: 72%;
  max-width: 240px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  scroll-snap-align: start;
}
.home-balcony-row { margin: 0.8rem -0.9rem 0; }
.home-balcony-btn {
  display: block;
  width: calc(100% - 16px);
  min-height: 44px;
  padding: 0 16px;
  background: var(--homes);
  border: 0;
  border-radius: 8px;
}
.home-balcony-btn .row-name { color: #fff; font-weight: 600; text-align: center; }
@media (hover: hover) {
  .home-balcony-btn:hover { filter: brightness(1.08); }
}

/* --------------------------------------------------------------- voucher
   A real "ticket" metaphor, deliberately NOT the dark see-through .tb-card
   look -- (1) a QR code needs true white behind it to scan reliably, a
   dark glass card would risk exactly that, and (2) a plain light card
   reads as "this is the physical thing you hand over", same instinct as a
   boarding pass or a cinema ticket being a distinct object from the app
   chrome around it. */
#voucher-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: var(--pad);
  background: rgba(10, 14, 18, 0.55);
  opacity: 0;
  transition: opacity 200ms ease;
}
#voucher-overlay[hidden] { display: none; }
#voucher-overlay.is-open { opacity: 1; }
.voucher-panel {
  position: relative;
  width: min(22rem, 100%);
  max-height: calc(100vh - 2 * var(--pad));
  overflow-y: auto;
  background: #ffffff;
  color: #16202b;
  border-radius: 18px;
  padding: 1.6rem 1.4rem 1.4rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  transform: translateY(8px) scale(0.98);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
#voucher-overlay.is-open .voucher-panel { transform: translateY(0) scale(1); }
@media (prefers-reduced-motion: reduce) {
  #voucher-overlay, .voucher-panel { transition: none; }
}
.voucher-close {
  position: absolute; top: 0.6rem; right: 0.6rem;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: rgba(22, 32, 43, 0.06); border-radius: 50%;
  color: #16202b; font-size: 14px; cursor: pointer;
}
.voucher-venue {
  margin: 0.2rem 2rem 0.1rem;
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(22, 32, 43, 0.55);
}
.voucher-offer { margin: 0 0 1rem; font-size: 16px; font-weight: 600; line-height: 1.4; }
.voucher-qr { margin: 0 auto 0.8rem; width: min(15rem, 100%); }
.voucher-qr svg { width: 100%; height: auto; display: block; }
.voucher-code {
  margin: 0 0 0.8rem;
  font-size: 20px; font-weight: 700; letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}
.voucher-date { margin: 0; font-size: 11.5px; color: rgba(22, 32, 43, 0.5); }
.voucher-used-stamp {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 18px;
}
.voucher-used-stamp span {
  font-size: 28px; font-weight: 800; letter-spacing: 0.08em;
  color: #c0513a;
  border: 4px solid #c0513a;
  border-radius: 10px;
  padding: 0.3rem 1.2rem;
  transform: rotate(-8deg);
}
.voucher-used-stamp[hidden] { display: none; }

.guide-input-row {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  margin: 12px;
  padding: 0 6px 0 14px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
}
.guide-input {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: 0; background: none; padding: 0;
  font: inherit; font-size: 13.5px; color: var(--ink);
}
.guide-input::placeholder { color: var(--muted); }
.guide-send {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--guide);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.guide-send svg { width: 16px; height: 16px; }

@media (max-width: 899px) {
  .guide-input-row { height: 48px; margin: 12px 14px 14px; }
  .guide-send { width: 36px; height: 36px; }
}

/* =====================================================================
   Phone (<900px) -- a bottom thumb bar replaces the rail; each disc opens
   the SAME .tb-card, styled as a bottom sheet above (see the .tb-card
   phone media query). #app/#app canvas keep touch-action: none untouched;
   the sheet itself keeps its own pan-y gesture (see .card-body above).
   ===================================================================== */
#phone-bar { display: none; }

@media (max-width: 899px) {
  /* Declutter pass, 2026-09-18: five fixed slots now (Places/Trails/Eat/
     Stay/More), space-evenly, no scroll -- the bar earned its width back
     once Views/Layers/Homes/Guide/GPS/SOS moved behind "More". The old
     pbar-scroll fallback (for a 7th/8th disc at 360px) is gone with them. */
  #phone-bar {
    position: fixed;
    left: 14px; right: 14px;
    bottom: max(18px, env(safe-area-inset-bottom));
    height: var(--bar-h);
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    padding: 0 8px;
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 10px 26px rgba(28, 34, 38, 0.18);
    opacity: 0;
    transition: opacity 0.7s ease 0.4s;
  }
  body.ready #phone-bar { opacity: 1; }
  #phone-bar .disc { width: 46px; height: 46px; flex: 0 0 auto; }
}

/* --------------------------------------------------------- trailhead tags */
/* One pill per featured trail's start point, positioned every frame by
   ui.js's update() (a plain camera.project() -- see its own comment on why
   this is the first such loop in the codebase, not a second copy of one).
   translate()-only positioning (never left/top) so moving 10 of these a
   frame is a compositor-only cost, matching this file's own width/height/
   padding/margin transition ban in spirit even though these aren't
   transitioned at all. */
#trail-tags {
  position: fixed;
  inset: 0;
  z-index: 16;
  pointer-events: none;
}
/* A card open (e.g. Trails itself) sits at a LOWER z-index than nothing
   here -- tags would otherwise paint their clipped left edge right against
   the card's own right border, which read as a rendering glitch, not two
   independent layers, the first time this was rendered and looked at. The
   list row already carries the same km/climb figures, so nothing is lost. */
html[data-open] #trail-tags { display: none; }
.trail-tag {
  position: absolute;
  left: 0; top: 0;
  /* No transform here on purpose -- ui.js's _declutterTags() sets a plain
     pixel `translate(Xpx, Ypx)` inline, every frame, to this element's
     already-computed TOP-LEFT corner (see its own long comment: an
     earlier version tried to fold a -50%/-100% self-anchor into that same
     transform via calc(), which is correct on paper and a measured 8x
     frame-rate cost in practice -- calc() mixing a percentage with an
     absolute length cannot resolve on the compositor thread alone). An
     inline style transform REPLACES a stylesheet one outright rather than
     composing with it, so this rule must never set `transform` at all,
     or ui.js's own positioning math silently stops matching what paints. */
  display: flex; align-items: baseline; gap: 6px;
  max-width: 220px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(14, 21, 30, 0.72);
  /* No backdrop-filter -- measured live, a 2px blur on up to ten of these
     over a LIVE WebGL canvas (recomputed every frame the canvas repaints,
     not just when the pill moves) roughly HALVED frame rate (11.5fps to
     23.2fps with it removed, same camera, same everything else). The 72%
     opacity background already does the actual legibility work -- the
     blur was decoration on top of it, not load-bearing. */
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}
.trail-tag[hidden] { display: none; }
.tag-dot {
  flex: 0 0 auto;
  width: 7px; height: 7px;
  border-radius: 50%;
  align-self: center;
}
.tag-dot.diff-dot-gentle   { background: var(--diff-gentle); }
.tag-dot.diff-dot-moderate { background: var(--diff-moderate); }
.tag-dot.diff-dot-steep    { background: var(--diff-steep); }
.tag-name { font-size: 12.5px; font-weight: 600; }
.tag-meta {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.7);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* All-ten-at-once mode (see ui.js update()'s own comment): the stats are
   still one tap away on the same trail's row, and dropping them here
   shrinks every pill by roughly a third -- real room back at a crowded
   VIEWS.trailmap. A single selected trail (the only case the full pill
   is used) has the whole screen to itself. */
.trail-tag.tag-compact .tag-meta { display: none; }
@media (max-width: 899px) {
  .trail-tag {
    max-width: 148px;
    white-space: normal;
    line-height: 1.25;
    padding: 4px 8px;
    /* Without this, `.tag-meta`'s own flex-basis:100% below has no effect
       -- flex-basis only creates a new row when its container can WRAP,
       and .trail-tag never declared that it could. First cut of this rule
       relied on flex-basis alone and the stats line never actually
       dropped to its own row; caught by height variance in the declutter
       gate (README § Sitting A) once it was actually measured live,
       not just eyeballed against a screenshot. */
    flex-wrap: wrap;
  }
  .tag-name, .tag-meta { font-size: 11px; }
  .tag-meta { display: block; flex-basis: 100%; }
  .trail-tag.tag-compact { max-width: 108px; padding: 4px 8px 4px 7px; }
  .trail-tag.tag-compact .tag-name { font-size: 11px; }
}

/* =====================================================================
   44px minimum touch targets, in PX -- deliberately last in the file.
   Root font here is 15px, so 2.75rem is 41px and quietly misses the floor
   (the trap this repo already paid for once, README § Session 2, phone).
   Placed after EVERY other rule on purpose: .view-row/.view-fly's own
   `min-height: 40px` (in the search/rows section above) has the same
   specificity as a same-breakpoint override placed earlier would, and the
   first cut of this block sat inside the .tb-card media query above that
   rule -- same specificity, earlier source order, so the 40px value silently
   won the cascade and 'Fly the mountain' measured under the floor in gate 2.
   Source order is the tiebreaker at equal specificity; last wins here.
   ===================================================================== */
@media (max-width: 899px) {
  .row, .switch-row, .card-close, .card-handle, .chip, .guide-send,
  .disc, #compass {
    min-height: 44px;
  }
  .disc, #compass, .card-close, .guide-send { min-width: 44px; }
}


/* ----------------------------------------------------------------- SOS */
/* The emergency card. Deliberately the plainest thing in the app: big tap
   targets, no motion, nothing clever between a thumb and a phone call. */
.sos-lede {
  margin: 12px 16px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.sos-call {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 16px);
  margin: 0 8px 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  text-decoration: none;
}
.sos-call:hover { background: rgba(255, 255, 255, 0.14); }
/* The one number to try first, so a person who reads nothing else still
   presses the right thing. */
.sos-call.sos-primary {
  background: var(--sos);
  border-color: var(--sos);
  color: #fff;
  text-shadow: none;
}
.sos-call.sos-primary:hover { background: #c23a33; }
.sos-call-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sos-call-name { font-size: 14px; font-weight: 500; }
.sos-call-note { font-size: 11.5px; color: var(--muted); }
.sos-call.sos-primary .sos-call-note { color: rgba(255, 255, 255, 0.85); }
.sos-call-num {
  flex: 0 0 auto;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.sos-pos { padding: 0 16px 4px; }
.sos-coords {
  margin: 2px 0 4px;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  /* a rescue operator is being read this aloud off a phone at arm's length */
  user-select: all;
}
.sos-pos-meta { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.sos-pos-off { margin: 2px 0 8px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.sos-locate { width: 100%; margin: 0; }
/* Sitting F addition (NEXT-10-BRIEF.md § F, 2026-09-15) -- "share my
   position", src/safety.js. Same full-width row shape as .sos-locate just
   above, kept as its own class rather than reused so an existing test
   script selecting `.sos-locate` can't accidentally also catch this one. */
.sos-share { width: 100%; margin: 8px 0 0; }

/* The phone FAB, and the only floating button left after the 2026-09-18
   declutter pass -- ui.js builds it ONLY while COURSE.sos.live is true (see
   _buildSosFab), so on the disarmed build shipping today this rule matches
   nothing and emergency help lives one tap into More instead. Hidden with a
   card open, like every other floating control ever was here. */
/* The emergency side button (ui.js _buildSosFab). Luke, 2026-09-29: "on the
   side… separate from the bar, its own emergency button". A red tab on the
   RIGHT edge at mid-height on every screen size: desktop cards open on the
   left beside the rail, the right edge holds only the compass / saver / GPS
   note at the top, and on phones the right edge between the top corner
   buttons and the guide teaser above the bar is clear. Hidden while a card is
   open, like every floating control here, so it never sits on a sheet. */
#sos-fab.sos-side {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 58px;
  height: 70px;
  padding: 0;
  border: 0;
  border-radius: 16px 0 0 16px;
  background: #d92d20;
  color: #fff;
  font: 700 12px/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(120, 18, 12, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  opacity: 0;
  transition: opacity 0.7s ease 0.5s, background-color 0.15s ease, transform 0.12s ease;
}
body.ready #sos-fab.sos-side { opacity: 1; }
#sos-fab.sos-side .sos-side-ico { display: block; width: 22px; height: 22px; }
#sos-fab.sos-side .sos-side-ico svg { width: 100%; height: 100%; display: block; }
@media (hover: hover) and (pointer: fine) {
  #sos-fab.sos-side:hover { background: #b42318; }
}
#sos-fab.sos-side:active { transform: translateY(-50%) scale(0.97); }
#sos-fab.sos-side:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
@media (max-width: 899px) {
  #sos-fab.sos-side { width: 52px; height: 64px; }
}
html[data-open] #sos-fab { display: none; }

/* The disarmed (testing) state of the emergency card. Loud enough that nobody
   demoing this mistakes it for a working line -- see COURSE.sos in course.js. */
.sos-testing {
  margin: 12px 8px 10px;
  padding: 10px 12px;
  border: 1px dashed var(--sos);
  border-radius: 10px;
  background: var(--sos-wash);
  font-size: 12.5px;
  line-height: 1.45;
}
.sos-testing strong { color: #ffb3ad; }
/* Inert numbers: visibly present, deliberately un-pressable. */
.sos-call.sos-inert { cursor: default; opacity: 0.72; }
.sos-call.sos-inert:hover { background: rgba(255, 255, 255, 0.08); }
.sos-call.sos-primary.sos-inert { background: rgba(215, 68, 60, 0.55); border-color: rgba(215, 68, 60, 0.6); }
.sos-call.sos-primary.sos-inert:hover { background: rgba(215, 68, 60, 0.55); }
