/* (FINAL-FIX2 perf) 1 selector list 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. */
/* R13 chrome.css (1 November 2026, WP1): the chrome as one system. Direction A "Quiet Instrument".
   Capsule skin for the top row (Back, autoplay rail, stories picker, tally, guest), the moment bar and the sample flag; one-line guest chip; primary CTA; orb zone and orb material;
   side-bar halo -> one text shadow + a soft edge gradient on the photo levels.
   Scoped under `html.r13 body` (plus `#ui >` where the old rule has it, see probes/collide-out.md). No font, letter-spacing, line-height or text-transform here (WP6 owns them).
   Every px is multiplied by --ui-scale (1 on the tablets, 1.7 on the TV). Calm motion only: opacity, 200 to 600ms, no overshoot. Owner: WP1. ?r13=0 removes the lot. */

/* ---------- 0 · local roles: what a capsule is made of, per ground (scene dark, Day map light, paper white) ---------- */
/* PERF (1 November): these four roles are declared on #ui, not on body. A custom property declared on <body> that changes with body.glass-day / [data-level] made every body style recalc a
   whole-document restyle (9 full recalcs against 3 in one dial sweep at Area). Only #ui's capsules read them. */
html.r13 body #ui {
  --q-cap-bg: var(--surface);                                         /* graphite 86% over a scene, #fff on paper (tokens.css re-points --surface) */
  --q-cap-bg-solid: var(--surface-card);                              /* graphite 96%: over photographs, no translucency */
  --q-cap-sh: inset 0 0 0 1px var(--hairline), var(--el-2);           /* hairline ring + level-2 shadow (scene) */
  --q-edge-scrim: none;
}
/* paper: --el-2 already carries the 1px ring, so the inset ring would double it */
html.r13 body:is([data-level=home], [data-level=walk], [data-level=choose], [data-level=price], [data-level=summary]) #ui { --q-cap-sh: var(--el-2); }
/* the Day map (glass-day, 4 map levels) keeps its light glass: the old --lg-tint is white 86%; only the ring and shadow are the system's */
html.r13 body.glass-day:is([data-level=century], [data-level=city], [data-level=market], [data-level=area]) #ui {
  --q-cap-bg: var(--lg-tint); --q-cap-bg-solid: var(--lg-tint); --q-cap-sh: var(--el-2-paper);
}
@media (prefers-contrast: more) {
  html.r13 body #ui, html.r13 body.glass-day:is([data-level=century], [data-level=city], [data-level=market], [data-level=area]) #ui,
  html.r13 body:is([data-level=home], [data-level=walk], [data-level=choose], [data-level=price], [data-level=summary]) #ui { --q-cap-sh: inset 0 0 0 1.5px var(--lg-line), var(--lg-shadow-s); }
}
/* one control height for the whole row: 44 at 1x, 74.8 on the TV (the old --ch-h was max(44px, 2.8rem); rem grows differently on the TV, so it is pinned to the role) */
html.r13 body { --ch-h: var(--q-ctl); }

/* ---------- 1 · the capsule skin (one surface, one ring, one shadow) ---------- */
html.r13 body #ui > #back,
html.r13 body #ui > #guest,
html.r13 body #ui > #tally,
html.r13 body #ui > #chap .rail-pill,
html.r13 body #ui > #sdock .sd-bar,
html.r13 body #ui > #mbar {
  background-image: none;
  border-radius: var(--r-capsule);
}
/* STAB (Apple tone): on the map and photo levels the capsules keep the base's Apple-minimal skin (css/tokens.css --lg-tint rgba(18,18,22,.6) / white .86 by Day, css/ux/mf-chrome.css shadows):
   R13 only sets the fill and the ring on the paper levels, where the system's white capsule is its own design */
html.r13 body:is([data-level=home], [data-level=walk], [data-level=choose], [data-level=price], [data-level=summary]) #ui > #back,
html.r13 body:is([data-level=home], [data-level=walk], [data-level=choose], [data-level=price], [data-level=summary]) #ui > #guest,
html.r13 body:is([data-level=home], [data-level=walk], [data-level=choose], [data-level=price], [data-level=summary]) #ui > #tally,
html.r13 body:is([data-level=home], [data-level=walk], [data-level=choose], [data-level=price], [data-level=summary]) #ui > #chap .rail-pill,
html.r13 body:is([data-level=home], [data-level=walk], [data-level=choose], [data-level=price], [data-level=summary]) #ui > #sdock .sd-bar,
html.r13 body:is([data-level=home], [data-level=walk], [data-level=choose], [data-level=price], [data-level=summary]) #ui > #mbar {
  background-color: var(--q-cap-bg); box-shadow: var(--q-cap-sh);
}
/* the old 1px gradient ring (glass.css:37) is the hairline already (both ends 10%); the box-shadow ring replaces it, so it is not drawn twice */
html.r13 body #ui > #back::before, html.r13 body #ui > #guest::before, html.r13 body #ui > #chap .rail-pill::before, html.r13 body #ui > #mbar::before { display: none; }   /* one rule per id: an :is() subject is not bucketed, so every element would be tested for ::before */

/* ---------- 2 · the top row: two groups, 8 inside a group, 16 between groups, everything on the gutter and y = 32 ---------- */
html.r13 body #ui > #back  { left: calc(var(--edge-1) + var(--safe-l)); top: calc(var(--top-row) + var(--safe-t)); height: var(--q-ctl); gap: calc(var(--s1) * var(--ui-scale)); padding: 0 calc(var(--s5) * var(--ui-scale)) 0 calc(var(--s3) * var(--ui-scale)); }
html.r13 body #ui > #guest { right: calc(var(--edge-1) + var(--safe-r)); top: calc(var(--top-row) + var(--safe-t)); height: var(--q-ctl); }
html.r13 body #ui > #tally { top: calc(var(--top-row) + var(--safe-t)); right: calc(var(--edge-1) + var(--safe-r) + var(--guest-w, 9.5rem) + var(--s2) * var(--ui-scale)); }
/* the rail sits 12px right of Back (js/app.js placeChaptersNow, fixed number): pull it to 8 (the group gap). While Back is hidden the script puts it at Back's own left, so no pull then */
html.r13 body #ui > #chap { margin-left: calc(var(--s2) * var(--ui-scale) - 12px); }
html.r13 body #ui.back-off:not(#zz-) > #chap { margin-left: 0; }
/* (23 November, audit F6) too narrow for the capsule and the Stories pill side by side (js/app.js placeChaptersNow): Play shows its icon only */
html.r13 body #ui > #chap.ch-tight .chap-play > span { display: none; }
/* still too narrow: the guest chip shows its avatar only, as on a phone (its aria-label stays) */
html.r13 body #ui.top-tight > #guest { padding: 0 calc(var(--s1) * var(--ui-scale)); }
html.r13 body #ui.top-tight > #guest .g-txt { display: none; }
/* the stories picker is placed 12px left of the tally (dockRead, fixed number): push it to 16 (the gap between groups). It is a capsule of the same 44 as its neighbours, not a 32 bar */
html.r13 body #ui > #sdock:not(.sd-low) { margin-right: calc(var(--s4) * var(--ui-scale) - 12px); }
html.r13 body #ui > #sdock .sd-bar { height: var(--q-ctl); }
html.r13 body #ui > #sdock .sd-cur { height: var(--q-ctl); background: none; }
/* Around Mirai: the picker sits bottom left (system.css:137), on the gutter */
html.r13 body[data-level=area] #ui > #sdock.sd-low { left: calc(var(--edge-1) + var(--safe-l)); }

/* ---------- 3 · the guest chip (P1-5 reverted by the orchestrator: two lines, as 8791) ---------- */
html.r13 body #ui > #guest { gap: calc(10px * var(--ui-scale)); padding: 0 calc(var(--s4) * var(--ui-scale)) 0 calc(var(--s1) * var(--ui-scale)); }
html.r13 body #ui > #guest .g-av { width: calc(var(--q-ctl) - var(--s2) * var(--ui-scale)); height: calc(var(--q-ctl) - var(--s2) * var(--ui-scale)); box-shadow: none; }
/* the second line stays drawn: the user wants Apple-minimal's readable light-grey subtitles (31 Oct) */

/* ---------- 4 · the primary action: one light capsule on a scene, one ink capsule on paper / the Day map (--lg-prom already flips with the ground) ---------- */
html.r13 body #ui > #cta.on {
  height: var(--q-ctl); min-height: var(--q-ctl); padding: 0 calc(var(--s5) * var(--ui-scale)) 0 calc(var(--s5) * var(--ui-scale)); gap: calc(var(--s2) * var(--ui-scale));
  border-radius: var(--r-capsule); opacity: 1;
}

/* the context strip (Century eras, City / Area lens cards) stops a gap short of the capsule's real left edge: css/ux/map.css reserved a fixed 11rem for it, and the capsule is wider since it carries 20px of padding on each
   side (156px at 1280x800, against the 143px reserved: the last card and its "+N" tab ran 14px under it). --cta-w is its measured width (js/app.js); the strip's own "+N" tab and fade take the overflow. Market and the
   timeline's raised capsule keep their own rules (js/ux/timeline.js lifts the capsule off this row). */
@media (orientation: landscape) {
  html.r13 body.has-cta:not(.tl-on):is([data-level=century], [data-level=city], [data-level=area]) #ui#ui #ctx#ctx { right: calc(var(--pad) + 12.4rem + var(--safe-r) + var(--cta-w, 11rem) + var(--s4) * var(--ui-scale)); }
}
/* TV Century: the capsule sat 83x24px over the lower right of the Mirai badge. It rides level with the orb (its centre on the orb zone's centre, the row the context strip already shares) instead of 40px above it */
html.r13.tv body[data-level=century]:not(.tl-on) #ui > #cta.on { bottom: calc(var(--gutter) + var(--safe-b) + (var(--orb-zone) - var(--q-ctl)) / 2); }

/* ---------- 5 · the orb: a fixed 96px reserved corner on the gutter, and graphite material over photographs ---------- */
html.r13 body #ui > #orb {
  right: calc(var(--edge-1) + var(--safe-r) + (var(--orb-zone) - 5.6rem) / 2);
  bottom: calc(var(--gutter) + var(--safe-b) + (var(--orb-zone) - 5.6rem) / 2);
}
html.r13 body #ui > #orb .core { background-image: none; }
html.r13 body #ui > #orb .core::before { display: none; }
html.r13 body #ui > #orb .sun { background-image: none; }
html.r13 body:is([data-level=home], [data-level=walk], [data-level=choose], [data-level=price], [data-level=summary]) #ui > #orb .core, html.r13 body:is([data-level=home], [data-level=walk], [data-level=choose], [data-level=price], [data-level=summary]) #ui > #orb .sun { background-color: var(--q-cap-bg); box-shadow: var(--q-cap-sh); }
/* STAB: over Site and Tower the orb keeps 8791's rgba(18,18,22,.6) (--lg-tint), as the pairs in qa/a11-fix1/tone; the solid-graphite variant is gone */

/* ---------- 6 · the sample flag: quiet (a disclosure, not a badge) ---------- */
html.r13 body #sampleflag { left: var(--edge-1); translate: none; background-image: none; }   /* opacity stays the old rules' (.on / body.clean / drawer) */
html.r13 body #sampleflag::before { display: none; }
html.r13 body:is([data-level=home], [data-level=walk], [data-level=choose], [data-level=price], [data-level=summary]) #sampleflag { background-color: rgba(29, 29, 31, .06); }

/* ---------- 7 · the side bar over photographs (P2-2): the six-layer text halo becomes one shadow; legibility on bright sky comes from a soft gradient at the very screen edge
   (no box, no panel: it fades out over 200px, full height, and never reaches the labels' own edge as a line) ---------- */
/* STAB: R13's one-layer --alt-ts is gone: the side bar keeps A11 A4's deeper halo (css/ux/mf-chrome.css:526-528; contrast 2.75-6.45 measured on Site / Tower / Day map) - the user's no-panel rule needs it over bright sky. Documented exception to the one-shadow-layer rule. */
/* Edge scrim kept off: the user does not want anything that reads as a panel behind the side bar. */
html.r13 body #ui::after {
  content: ""; position: fixed; left: 0; top: 0; bottom: 0; width: calc(220px * var(--ui-scale)); pointer-events: none; z-index: 0; opacity: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .30) 0%, rgba(0, 0, 0, .22) 18%, rgba(0, 0, 0, .12) 45%, rgba(0, 0, 0, .04) 75%, rgba(0, 0, 0, 0) 100%);
  transition: opacity var(--d-level) var(--e-calm);
}
html.r13 body.scrim-off #ui::after { opacity: 0; }
@media (prefers-reduced-motion: reduce) { html.r13 body #ui::after { transition: none; } }

/* ---------- WP6 (type) minimal width fixes: the picker's label is Callout 15 now (it was 12.5), so its two old caps no longer fit and the name ellipsised ("Stori...", "Metro & infrast...") ---------- */
html.r13 body #sdock.sd-low .sd-bar { max-width: none; }
html.r13 body #sdock .sd-cur > span { max-width: 18rem; }

/* ---------- STAB: portrait sheet lift of the side bar, capped at 12px ----------
   css/ux/chrome.css:81 lifts the bar by min(0, 50dvh - sheet - ...) while a portrait bottom sheet is open. The R13 card is ~100px taller than the old one, so the lift grew from 6 to 102px;
   js/app.js altTarget maps a tap to a row from offsetTop (it cannot see a CSS translate), so at 102px a tap landed two rows off (800x1280 touch replay: 9 of 73 cases differ from 8795). Capped at 12px (a quarter row) taps map as before. */
@media (orientation: portrait) {
  html.r13.ux-sheet body #alt { translate: 0 max(-12px, min(0px, calc(50dvh - var(--ux-sheet, 0px) - 7rem - var(--alt-p) * 2.5))); }
}

/* ---------- STAB: system-check edges / radii ---------- */
/* the side bar's box starts on the gutter (it was 36 at 1366, 31 at 1180, 50 on the TV against edge-1 32 / 24 / 54) */
html.r13 body #alt { left: calc(var(--edge-1) + var(--safe-l)); }
/* the logo disc: a px radius, not 50% (the check reads any radius >= half the short side as a capsule) */
html.r13 body #ui > #orb .core { border-radius: var(--r-capsule); }

/* ---------- FINAL-FIX1 F3: residuals of the system-check ---------- */
/* P2-2: the Site / Tower title block (#place and its kicker) was two shadow layers (audit-readability.css, qa-a.css); one tight layer with a short blur keeps the title legible on the lit facade and sky.
   The side-bar halo stays the documented exception (section 7). The children (title, facts, .pw) inherit #place's. */
html.r13 body:is([data-level=site], [data-level=tower]) #place { text-shadow: 0 1px 5px rgba(0, 0, 0, .75); }
html.r13 body:is([data-level=site], [data-level=tower]) #place .pl-k { text-shadow: 0 1px 5px rgba(0, 0, 0, .75); }
/* paper levels: the side bar's names are ink on cream; the white halo (8px + 2px, two layers) is one soft layer (the dark photo-level halo above stays the documented exception) */
html.r13 body:is([data-level=home], [data-level=choose], [data-level=walk], [data-level=price], [data-level=summary]) #alt { --alt-ts: 0 0 6px rgba(255, 255, 255, .9); }
/* the attract clock and the Site tags' muted figures: one layer each (they were 2) */
html.r13 body #attract .at-clock { text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
html.r13 body #lv-site .tchip.muted b { text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
/* the Area hero marker (Century / Mirai medallion) is a 10.5px (.8rem) tile: the inner radius of the system */
html.r13 body #lv-map .hero.hg > .hg-med { border-radius: var(--r-inner); }
/* P1-3 exemptions (the two-edge grid is {edge-1, edge-2} for the left edge, edge-1 for the right edge; these four are NOT blocks that can sit on it):
   #tally   : its right edge is 8 left of the guest chip, whose width is its content (guest name), so its left edge is wherever the content ends;
   #cta     : the primary action is anchored left of the orb (and of the timeline, js/ux/timeline.js, when that is open), its right edge is the orb zone's left, not edge-1;
   #ctx     : a full-width flex strip that CENTRES its chips between the side bar / rail and the orb: the box edge is not drawn, the chips are;
   #chap, #sdock : members of the left / right top-row groups (8 right of Back, 16 left of the tally), never block edges;
   #orb     : the 5.6rem core is centred in the 96px reserved square (the dial's box fills the square on scene levels, the paper levels have no dial) so the core never jumps between levels.
   system-check.mjs lists them as `exempt` with these reasons instead of failing on them. */

/* ---------- side bar shade on the photo levels (3 November) ---------- */
/* Site and Tower: the level names sat straight on foliage and sky. One very soft, feathered dark wash behind the bar (a radial fade, no edge and no fixed shape: it is darkest at the screen edge
   behind the names and gone before the rest of the picture), under the names and the lens plate, never over them. A paint-only layer: nothing animates, nothing receives taps. */
html.r13 body:is([data-level=site], [data-level=tower]) #alt::before {
  content: ""; position: absolute; z-index: -3; pointer-events: none;
  left: calc(var(--edge-1) * -1 - var(--safe-l)); top: -2.5rem; bottom: -2.5rem; width: calc(var(--alt-plate-w) + 7rem);
  background: radial-gradient(ellipse 100% 50% at 0% 50%, rgba(8, 10, 12, .34) 0%, rgba(8, 10, 12, .2) 38%, rgba(8, 10, 12, .08) 66%, rgba(8, 10, 12, 0) 100%);
}

/* ---------- Home action line: the chosen item's capsule (3 November) ---------- */
/* the capsule (button::before, inset 4px -10px) reached 10px into the 20px gap, so it sat 8px from its neighbour but 12px from the line's end, and the label rode 2.5px above its icon
   (the old underline's 3px + 2px of room under the word). The gap is 28px (the capsule clears its neighbours by 16px) and the word sits level with its icon. */
html.r13 body #orb .ring .ring-row { gap: 28px; }   /* every level (3 November: it was Home only; Tower's line had the same crowded capsule and the raised word) */
html.r13 body #orb .ring .ring-row > button.ri > span { padding-bottom: 0; border-bottom-width: 0; }

/* ---------- Stories list: group titles (3 November) ---------- */
/* "Your day", "Around you", "Getting around", "Everything" were solid ink at 70% (darker than the items under them at 64%) with 8px above and 3px below, so they read as a heavier row, not a title,
   and sat 1px off the icon column. They are now the quietest text in the list: 12px / 600, the theme's ink at 60% (4.9:1 on the white list, 4.9:1 on the dark one), starting exactly on the icons' left edge,
   with a hairline and 12px of air above every group after the first and 6px before its first item. Sentence case stays (the app's rule). */
html.r13 body #ui > #sdock .sd-pop .sd-grp { padding: 12px 10px 6px 9px; margin-top: 6px; border-top: 1px solid color-mix(in srgb, var(--lg-fg) 9%, transparent); font-weight: 600; letter-spacing: .01em; color: var(--lg-fg); opacity: .6; }
html.r13 body #ui > #sdock .sd-pop .sd-grp:first-child { margin-top: 0; padding-top: 6px; border-top: 0; }

/* Stories list on the photo levels (3 November): on Site and Tower the list is the dark platter (rgba(18, 18, 22, .96)) but the day theme gave its words the paper pages' ink, so the rows
   were near-black on near-black: the list looked empty (only the native tooltip showed). The words, the icons and the group titles read light there; the chosen row is full white. */
html.r13 body:is([data-level="site"], [data-level="tower"]) #ui > #sdock .sd-pop .sd-chip { color: rgba(245, 245, 247, .8); }
html.r13 body:is([data-level="site"], [data-level="tower"]) #ui > #sdock .sd-pop .sd-chip.on { color: #fff; }
html.r13 body:is([data-level="site"], [data-level="tower"]) #ui > #sdock .sd-pop .sd-grp { color: #f5f5f7; opacity: .62; border-top-color: rgba(255, 255, 255, .12); }
