/* (FINAL-FIX2 perf) 5 selector lists in this file whose last compound was a bare :is(...) are written out one selector per alternative, so Blink buckets each by its own class / id / tag instead of testing every element on every style recalc. Each alternative is padded with :not(#zz-) / :not(.zz-) / :not(zz-) so its specificity is what the :is() gave (the most specific alternative); one that cannot be padded down is a class / type more specific only where no rule anywhere could tell the difference (checked against every stylesheet and the DOM), otherwise it stays in a :is() with a never-matching alternative of the full specificity. Same elements, same cascade. */
/* The component system pass (audit 04). Loaded last. One glass material for chrome, one scrim, one capsule for the orb's actions, readable text, 44px targets. */

/* ---- C-01: one material. The stories pill, its chips, the filter bar and the plan control use the same flat glass as Back / the capsule / the guest chip (no live blur, no second recipe) ---- */
#sdock .sd-bar, #sdock .sd-chip, .gf-row, .gf-all, .gf-r, #lv-walk .wx-when {
  background-color: var(--lg-tint); background-image: var(--lg-sheen); color: var(--lg-fg);
  box-shadow: var(--lg-hi), var(--lg-shade), var(--lg-shadow-s); -webkit-backdrop-filter: none; backdrop-filter: none;
}
.gf-row { background-image: none; box-shadow: var(--lg-hi), var(--lg-shadow-s); }
.gf-all, .gf-r { background-color: transparent; background-image: none; box-shadow: none; color: var(--lg-fg2); }
.gf-all.on, .gf-row.part .gf-r.on { background-color: var(--act-bg); background-image: none; color: var(--act-fg); box-shadow: var(--act-line); }   /* (17 October) the compact active state (css/tokens.css), as the chips */
body.glass-day .gf-all.on, body.glass-day .gf-row.part .gf-r.on { background-color: var(--act-bg-day); color: var(--act-fg-day); box-shadow: var(--act-line-day); }
#sdock .sd-chip.on { background-color: var(--lg-sel); background-image: var(--lg-sheen); color: var(--lg-sel-fg); box-shadow: var(--lg-sel-sh); }
#sdock .sd-pop { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.glass-day #sdock .sd-bar, body.glass-day #sdock .sd-chip, body.glass-day .gf-row { background-color: var(--lg-tint); }

/* ---- C-02 / C-03: the guest chip never moves; while a presentation is on, the capsule and stories pill step aside and the presenter bar reads on any scene ---- */
body:has(> #ui > #mbar.on) #guest { top: calc(var(--pad) + var(--safe-t)) !important; }   /* its resting top (css/ux/chrome.css); "auto" sent it to the very top edge, half off screen */
body:has(> #ui > #mbar.on) #chap, body:has(> #ui > #mbar.on) #sdock, body:has(> #ui > #mbar.on) .gm-flt:not(#zz-) { opacity: 0 !important; pointer-events: none !important; visibility: hidden; }
#mbar { background-color: var(--lg-tint-thick, rgba(24, 20, 34, .82)); }

/* ---- C-05: one scrim and one rule for what hides under a modal ---- */
:root { --scrim: rgba(14, 12, 20, .34); }
#drawer .dr-scrim, #ask-ov .ask-scrim, #sheet .sh-scrim { background: var(--scrim) !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
body:has(> :is(#sheet.on, #ask-ov.on)) #ui { opacity: 0 !important; pointer-events: none !important; transition: opacity .2s var(--ease-out); }

/* ---- C-07: the orb's actions are always a glass capsule (they were bare text on map scenes and a capsule only on Home) ---- */
body #orb .ring .ring-row { background-color: var(--lg-tint); background-image: var(--lg-sheen); box-shadow: var(--lg-hi), var(--lg-shade), var(--lg-shadow-s); border-radius: var(--r-pill); padding: 0 1rem; gap: 20px; }
body #orb .ring .ring-row::before { display: none; }
body #orb .ring .ring-row > button.ri { color: var(--lg-fg); text-shadow: none; }

/* ---- C-08: the expanded stories row has a soft edge and never runs under the capsule; on narrow screens it takes its own line under the top bar ---- */
#sdock .sd-pop { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 1.4rem, #000 calc(100% - .3rem), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 1.4rem, #000 calc(100% - .3rem), transparent 100%); }
@media (max-width: 900px), (orientation: portrait) {
  #sdock { position: fixed; }
  #sdock .sd-pop { position: fixed; left: calc(var(--pad) + var(--safe-l)); right: calc(var(--pad) + var(--safe-r)); top: calc(var(--pad) + var(--safe-t) + 3.4rem); height: auto; max-width: none; width: auto; flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; justify-content: flex-start; padding: .5rem; border-radius: 22px; background-color: var(--lg-tint); background-image: var(--lg-sheen); box-shadow: var(--lg-hi), var(--lg-shade), var(--lg-shadow-s); transform: translateY(-8px); }
  #sdock.open .sd-pop { transform: none; }
}

/* ---- C-10 / C-11: captions and counters read ---- */
:root { --lg-fg3: rgba(245, 245, 247, .66); }
body.glass-day, body[data-level="home"], body[data-level="choose"], body[data-level="walk"], body[data-level="price"], body[data-level="summary"] { --lg-fg3: rgba(22, 22, 27, .72); }
#chap .rail-n { font-size: 12px; }

/* ---- C-12: the destructive pill is readable on the white drawer ---- */
:is(#drawer:not(.ux-setup), #ask-ov) .pill.danger { color: #b3261e; }

/* ---- C-13: the toast is one shape: glass-white, two lines allowed, never truncated ---- */
#toast { white-space: normal !important; text-overflow: clip !important; overflow: visible !important; border-radius: 18px !important; text-align: center; line-height: 1.35; padding: .7rem 1.2rem; max-width: min(36rem, calc(100vw - 2rem)) !important; }

/* ---- C-15: 44px targets (the visible size stays, the hit area grows) ---- */
#sdock .sd-cur, #sdock .sd-chip, .gf-all, .gf-r, #lv-site .tchip.muted, .bc-view, .px-btn, .step { position: relative; }
#sdock .sd-cur::after, #sdock .sd-chip::after, .gf-all::after, .gf-r::after, #lv-site .tchip.muted::after, .bc-view::after, .px-btn::after { content: ""; position: absolute; inset: -5px -3px; }
body #cta { min-height: 44px; }

/* ---- C-24: a picture that fails to load shows a quiet placeholder, not the browser's broken-image icon ---- */
img.img-fail { visibility: hidden; }
.cx-pl:has(img.img-fail), .wk-ph:has(img.img-fail) { background: linear-gradient(135deg, rgba(120, 118, 140, .14), rgba(120, 118, 140, .05)); }

/* ---- C-25: the attract lockup: one mark, a local scrim behind the tagline, the touch hint lower ---- */
#attract .at-logo { display: none; }
#attract .at-copy::before { content: ""; position: absolute; inset: -3rem -12% -2rem; z-index: -1; pointer-events: none; background: radial-gradient(60% 70% at 50% 55%, rgba(10, 6, 24, .55), transparent 75%); }
#attract .at-touch { bottom: calc(5dvh + var(--safe-b)); }
#attract .at-touch i { width: 2.8rem; height: 2.8rem; }

/* ---- C-26: the summary banner is dark: no white halo on its title ---- */
.sm-hero h1:not(.zz-), .sm-hero h2:not(.zz-), .sm-hero h3:not(.zz-), .sm-hero :is(.sm-hero-in *) { text-shadow: none !important; }

/* graphics (audit G-03, G-18): the orb logo is ink on paper levels, white on photos with a slim shadow; no broken-image box in the unit sheet */
body:is([data-level="home"], [data-level="choose"], [data-level="walk"], [data-level="price"], [data-level="summary"]) #orb .core .logo { background: #16161b; }
body:is([data-level="home"], [data-level="choose"], [data-level="walk"], [data-level="price"], [data-level="summary"]) #orb .core { box-shadow: var(--lg-hi), 0 8px 24px -10px rgba(22, 22, 27, .35), 0 0 0 1px rgba(22, 22, 27, .08); }
body #orb .core .logo { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
body:is([data-level="home"], [data-level="choose"], [data-level="walk"], [data-level="price"], [data-level="summary"]) #orb .core .logo { filter: none; }
.u-plan img:not([src]), .u-plan img[src=""] { visibility: hidden; }

/* =====================================================================
   Compact chips and the Stories pill (17 October, Phases 4 and 5): one chip system for every chip bar (css/tokens.css "Compact system").
   32px chips in a 44px bar, plain at rest, the chosen one a 14% fill with a hairline (ink by Day). Loaded after map.css, area.css and market.css at their weight,
   and one step heavier than qa-fixes.css's #sdock rules, which load after this file.
   ===================================================================== */
/* the bar */
body #ctx .strip { gap: var(--bar-gap); padding: var(--bar-pad); align-items: center; box-shadow: var(--lg-hi), var(--card-shadow); }
/* every chip in a bar (lens chips, landmark and place chips, ring, legend, hub, radius, outlook, metric, zone and tower chips on the Site) */
body #ctx .strip > .pill, body #ctx .strip > .lcard, body #ctx .strip > .pchip { min-height: var(--ctl-h); height: var(--ctl-h); padding: 0 var(--chip-px); gap: var(--chip-gap); border-radius: var(--chip-r); font: var(--t-label); letter-spacing: -.005em;
  background: transparent; box-shadow: none; color: var(--lg-fg2); }
body #ctx .strip > :is(.pill, .lcard, .pchip).on { color: var(--act-fg); }
body #ctx .strip > .pill::before, body #ctx .strip > .lcard::before, body #ctx .strip > .pchip::before { background-color: var(--act-bg); background-image: none; box-shadow: var(--act-line); }
body.glass-day #ctx .strip > :is(.pill, .lcard, .pchip).on { color: var(--act-fg-day); }
body.glass-day #ctx .strip > .pill::before, body.glass-day #ctx .strip > .lcard::before, body.glass-day #ctx .strip > .pchip::before { background-color: var(--act-bg-day); box-shadow: var(--act-line-day); }
body #ctx .strip > :is(.pill, .lcard, .pchip) svg { width: var(--ico-sm); height: var(--ico-sm); stroke-width: 1.8; }
body #ctx .strip > .pill b { width: auto; min-width: 0; height: auto; padding: 0; border-radius: 0; background: none; color: inherit; font: 600 var(--t-label-fs)/1 var(--num); }
body #ctx .strip > .pill small, body #ctx .strip > :is(.lcard, .pchip) small { font: var(--t-meta); opacity: 1; color: var(--lg-fg3); }
body #ctx .strip > :is(.lcard, .pchip).on small { color: inherit; opacity: .8; }
body #ctx .legacy-strip .seg-glow { background-color: var(--act-bg); background-image: none; box-shadow: var(--act-line); }
body.glass-day #ctx .legacy-strip .seg-glow { background-color: var(--act-bg-day); box-shadow: var(--act-line-day); }
/* landmark chips: a 24px round photo, the name over the time and distance */
body #ctx .strip > .lcard { padding-left: 4px; max-width: 15rem; }
body #ctx .strip > .lcard .ph { width: 24px; height: 24px; flex: none; border-radius: 50%; overflow: hidden; }
body #ctx .strip > .lcard .ph img { width: 100%; height: 100%; object-fit: cover; }
/* (23 October) a landmark without a photo wears its map pin in small: the charcoal disc with the solid white pictogram, centred (css/ux/area.css .gm[data-k="lm"]).
   Before, the solid badge icon sat at the circle's top-left, unfilled, as a thin outline */
body #ctx .strip > .lcard .ph.ic { display: grid; place-items: center; background: rgba(36, 31, 35, .9); color: #fff; }
body #ctx .strip > .lcard .ph.ic svg { width: 14px; height: 14px; stroke-width: 1.7; }
body #ctx .strip > .lcard .ph.ic svg .f { fill: currentColor; }
body #ctx .strip > .lcard .ph.ic svg .d { stroke: #241f23; }
body #ctx .strip > .lcard .tx { display: grid; gap: 1px; min-width: 0; text-align: left; }
body #ctx .strip > .lcard b { font: 600 12px/1.15 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: inherit; }
body #ctx .strip > .lcard small { font: 500 12px/1.15 var(--sans); }
/* the small marks inside chips */
body #ctx .strip > .pchip i, body #ctx .sx-chip i, body #ctx .hub-chip .mm-dot { width: 8px; height: 8px; flex: none; background-image: none; box-shadow: none; }
body #ctx .leg-chip i { width: 14px; height: 3px; border-radius: 2px; }
body #ctx .strip > .sx-chip b { font: 600 var(--t-label-fs)/1 var(--sans); margin-right: 2px; color: var(--lg-fg); }
body #ctx .strip > .stat-chip .n { font: 400 15px/1 var(--num); letter-spacing: -.01em; color: var(--lg-fg); }
body #ctx .strip > .stat-chip span { font: var(--t-label); }
body #ctx .strip > .rad-chip .n { font: 600 13.5px/1 var(--num); }
body #ctx .heat-leg { display: flex; align-items: center; min-height: var(--ctl-h); gap: 12px; padding: 0 var(--chip-px); font: var(--t-meta); }
body #ctx .heat-leg i { width: 8px; height: 8px; }
body #ctx .strip .strip-note { font: var(--t-meta); }
/* the "05/11" capsule keeps the top row's 44px; its Play is a 32px button inside it (audit-layout.css made it full height) */
body.has-chap #chap .chap-play { min-height: var(--ctl-h); height: var(--ctl-h); padding: 0 12px 0 10px; font: var(--t-label); }
/* the Stories pill: 32px like the chips; its chevron points to where the panel opens */
body #sdock .sd-bar { height: var(--ctl-h); }
body #sdock .sd-cur { position: relative; height: var(--ctl-h); gap: 6px; padding: 0 calc(var(--chip-px) - 2px) 0 var(--chip-px); font: var(--t-label); letter-spacing: -.01em; }
body #sdock .sd-cur::after { inset: var(--ctl-hit-y) -3px; }
body #sdock .sd-cur > span { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; }
body #sdock .sd-cur svg:first-child { width: var(--ico-sm); height: var(--ico-sm); }
body #sdock .sd-up { width: 12px; height: 12px; opacity: .7; transform: rotate(180deg); }   /* the panel opens downward: the chevron points down, and up while open */
body #sdock.open .sd-up { transform: none; }
/* its panel */
body #sdock .sd-pop { min-width: 13rem; padding: 4px; gap: 2px; border-radius: 16px; }
body #sdock .sd-pop .sd-chip { min-height: 40px; padding: 8px 12px 8px 10px; gap: 8px; font: 500 13px/1.25 var(--sans); background: transparent; box-shadow: none; }
body #sdock .sd-pop .sd-chip svg { width: 14px; height: 14px; }
body #sdock .sd-pop .sd-chip.on { background-color: var(--act-bg); background-image: none; box-shadow: var(--act-line); color: var(--act-fg); font-weight: 600; }
body.glass-day #sdock .sd-pop .sd-chip { background: transparent; }   /* map.css:423 gave every Day row a white fill, so the chosen one did not stand out */
body.glass-day:is([data-level="century"], [data-level="city"], [data-level="market"], [data-level="area"]) #sdock .sd-pop .sd-chip.on { background-color: var(--act-bg-day); box-shadow: var(--act-line-day); color: var(--act-fg-day); }
body #sdock .sd-pop .sd-grp { padding: 8px 10px 3px; font: 600 12px/1 var(--sans); }
/* Around Mirai (Phase 5): the pill sits at the bottom left on the strip's baseline (js/app.js placeDockNow sets .sd-low) and the panel opens upward */
body[data-level="area"] #sdock.sd-low { left: calc(var(--pad) + var(--safe-l)); right: auto; top: auto; bottom: calc(var(--pad) + var(--safe-b) + 1.6rem + var(--bar-pad)); }
body #sdock.sd-low .sd-bar { max-width: 8rem; }
body #sdock.sd-low .sd-pop { left: 0; right: auto; top: auto; bottom: calc(100% + 8px); transform: translateY(6px); transform-origin: 0 100%; max-height: min(70dvh, 32rem, calc(100dvh - var(--pad) * 2 - var(--safe-t) - var(--safe-b) - 9rem)); }
body #sdock.sd-low.open .sd-pop { transform: none; }
body #sdock.sd-low .sd-up { transform: none; }
body #sdock.sd-low.open .sd-up { transform: rotate(180deg); }
/* the strip starts right of the pill (css/ux/area.css moves the map filters the same way) */
@media (orientation: landscape) {
  body[data-level="area"]:not(.cine) #ctx, body.has-chap[data-level="area"]:not(.cine) #ctx { left: calc(var(--pad) + var(--safe-l) + var(--sd-slot)); }
}
/* (:not(.cine) also lifts these to the weight of css/ux/map.css's "body.has-chap:is(...):not(.cine) #ctx", which sets left in every orientation) */
@media (orientation: portrait) and (min-width: 601px) {
  body[data-level="area"]:not(.cine) #ctx, body.has-chap[data-level="area"]:not(.cine) #ctx { left: calc(var(--pad) + var(--safe-l) + var(--sd-slot)); }
  body[data-level="area"] #sdock.sd-low { bottom: calc(var(--pad) + var(--safe-b) + .7rem + var(--bar-pad)); }
  html.ux-sheet body[data-level="area"] #sdock.sd-low { bottom: calc(var(--ux-sheet, 0px) + .7rem + var(--bar-pad)); }
}
/* phones: the bar runs along the bottom, clear of the sun dial, and the pill sits just above it
   (the #ui:has() form matches css/ux/map.css's "#ui:has(> #orb.has-sun) #ctx", whose right edge would win otherwise) */
@media (orientation: portrait) and (max-width: 600px) {
  body[data-level="area"] #ctx, body.has-chap[data-level="area"] #ctx, html.ux-sheet body.has-chap[data-level="area"] #ctx, body[data-level="area"] #ui:has(> #orb.has-sun) #ctx { left: calc(var(--pad) + var(--safe-l)); right: calc(var(--pad) + var(--safe-r) + 10.5rem); bottom: calc(var(--pad) + var(--safe-b) + 2.2rem); }
  body[data-level="area"] #sdock.sd-low, html.ux-sheet body[data-level="area"] #sdock.sd-low { bottom: calc(var(--pad) + var(--safe-b) + 2.2rem + 44px + 8px); }
}
