/* (FINAL-FIX2 perf) 2 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. */
/* R13 home.css (1 November 2026, builder D; R5 + R6): the Home unit page in the "Quiet Instrument" system.
   Scope: html.r13 body #lv-home. Box, colour, material and layout only: type roles are css/r13/type.css's (no font-* / line-height / letter-spacing here).
   Owner: builder D. Rolls back with ?r13=0 (the old css/ux/motion-home.css rules then apply unchanged).
   What it does
   1. Two paper cards on the tokens: --surface-card fill, --el-1 elevation, --r-card radius. The plan card sits on the left rail (--edge-2), the info card on a wider column
      (about 40vw, 400..520px x --ui-scale) so the room rows stop being cramped and the plan card is no wider than its drawing needs.
   2. Both cards end above the orb's reserved square (--gutter + --orb-zone), and start on --title-top (the old 7.6rem / 5.2rem bands are gone).
   3. The info card is ONE scroll surface (it was a fixed head over a 305px inner scroller: the room list was cut after 3 rows). The tab bar sticks, a hairline marks a
      scrolled head, a soft foot shows while there is more below. js/ux/tower-home.js markPanes() toggles .more-b / .scrolled on the card.
   4. The mode bar .pm-seg holds five segments (Plan, Sunlight, Rooms, Renders, Walkthrough) as 44px targets; the zoom buttons sit under it; the Renders gallery
      (js/ux/renders.js, mounted by js/plus/home.js into .rn-host) fills the rest of the plan card; the plan's own layers hide while it shows. */

/* ---------- 0 · shared: the two cards ---------- */
html.r13 body #lv-home .u-plan,
html.r13 body #lv-home .u-spec.hm2 { background: var(--surface-card); box-shadow: var(--el-1); border-radius: var(--r-card); }
html.r13 body #lv-home .u-plan { overflow: hidden; }

/* ---------- 1 · landscape grid and margins ---------- */
@media (orientation: landscape) {
  html.r13 body #lv-home .unit-v { grid-template-columns: minmax(0, 1fr) clamp(calc(400px * var(--ui-scale)), 40vw, calc(520px * var(--ui-scale))); }
  html.r13 body #lv-home .u-plan { margin: var(--title-top) 0 calc(var(--gutter) + var(--orb-zone) + var(--safe-b)) var(--edge-2); }
  html.r13 body #lv-home .u-spec.hm2 { margin: var(--title-top) calc(var(--gutter) + var(--safe-r)) calc(var(--gutter) + var(--orb-zone) + var(--safe-b)) var(--s4); }
}

/* ---------- 2 · the info card: one scroll surface, a sticky tab bar ---------- */
html.r13 body #lv-home .u-spec.hm2 {
  display: flex; flex-direction: column; gap: var(--s2); min-height: 0; padding: 0 var(--q-card-pad);
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: none; mask-image: none;
}
html.r13 body #lv-home .u-spec.hm2::-webkit-scrollbar { display: none; }
html.r13 body #lv-home .u-spec.hm2 > * { flex: none; }
html.r13 body #lv-home .u-spec.hm2 > .hm-head { padding-top: var(--q-card-pad); }
html.r13 body #lv-home .u-spec.hm2 .hm-tabs { position: sticky; top: var(--s2); z-index: 4; margin: 0; }
html.r13 body #lv-home .u-spec.hm2 .hm-tabs::before { content: ""; position: absolute; z-index: -1; inset: calc(-1 * var(--s2)) calc(-1 * var(--q-card-pad)); background: var(--surface-card); pointer-events: none; transition: box-shadow var(--d-fade) var(--e-x); }
html.r13 body #lv-home .u-spec.hm2.scrolled .hm-tabs::before { box-shadow: 0 1px 0 var(--hairline); }
/* the panes stop being their own scroller (motion-home.css made them one): their content just flows, the card scrolls */
html.r13 body #lv-home .hm-panes,
html.r13 body #lv-home .hm-panes.more-b { flex: none; min-height: auto; overflow: visible; margin: 0; padding: var(--s3) 0 var(--s6); -webkit-mask-image: none; mask-image: none; }
/* the foot: a soft fade and a small chevron pinned to the bottom of the scrollport, shown only while there is more below (and not at the very end, so the last row is never covered).
   (FINAL-FIX3 F6) js/plus/home.js keeps whole items above the fold, so the fade sits over the blank foot band (28px, x1.4 on the TV), not over an item */
html.r13 body #lv-home .u-spec.hm2 .hm-panes::after { content: ""; position: sticky; bottom: 0; display: block; height: 28px; margin-top: -28px; opacity: 0; visibility: hidden; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M2 2.5l6 5.5 6-5.5' fill='none' stroke='%238e8e96' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center bottom 5px / 16px 10px no-repeat, linear-gradient(transparent, var(--surface-card));
  transition: opacity var(--d-fade) var(--e-x), visibility 0s linear var(--d-fade); }
html.r13 body #lv-home .u-spec.hm2.more-b .hm-panes::after { opacity: 1; visibility: visible; transition: opacity var(--d-fade) var(--e-x), visibility 0s; }
html.r13.tv body #lv-home .u-spec.hm2 .hm-panes::after { height: 39px; margin-top: -39px; background-size: 22px 14px, 100% 100%; background-position: center bottom 7px, 0 0; }

/* a short screen: tighten, never hide (nothing is removed) */
@media (max-height: 640px) {
  html.r13 body #lv-home .u-spec.hm2 { gap: var(--s1); }
  html.r13 body #lv-home .u-spec.hm2 > .hm-head { padding-top: var(--s3); }
  html.r13 body #lv-home .u-spec.hm2 .hm-act { gap: var(--s1); row-gap: var(--s1); }
}

/* ---------- 3 · the plan card: mode bar, zoom buttons, drawing ---------- */
html.r13 body #lv-home .pm-seg { left: var(--s4); top: var(--s4); padding: 2px; max-width: calc(100% - 2 * var(--s4)); overflow: hidden; background: rgba(0, 0, 0, .05); box-shadow: none; }
html.r13 body #lv-home .pm-seg button { min-height: var(--q-ctl); padding: 0 var(--s3); }
html.r13 body #lv-home .pm-seg button svg { display: none; }       /* the glyphs were drawn at opacity 0 and only left a gap before the label */
html.r13 body #lv-home .u-plan { --q-hm-bar: calc(var(--s4) + var(--q-ctl) + 4px); }     /* where the mode bar ends */
html.r13 body #lv-home .u-plan .zbtns { top: calc(var(--q-hm-bar) + var(--s2)); right: var(--s4); }   /* under the mode bar: five segments are wider than the old three */
html.r13 body #lv-home .u-plan .u-z img { top: calc(var(--q-hm-bar) + var(--s2)); left: var(--s4); width: calc(100% - 2 * var(--s4)); height: calc(100% - var(--q-hm-bar) - var(--s2) - var(--s4)); }
html.r13 body #lv-home .u-plan[data-pm="sun"] .u-z img { height: calc(100% - 10.4rem); }   /* the sun bar keeps the room it had (css/qa-a.css) */

/* ---------- 4 · Renders (R6): the gallery fills the plan card under the mode bar ---------- */
html.r13 body #lv-home .u-plan .rn-host { position: absolute; z-index: 2; left: var(--s4); right: var(--s4); bottom: var(--s4); top: calc(var(--q-hm-bar) + var(--s2)); --rn-pad: 0; --rn-r: var(--r-inner); }
html.r13 body #lv-home .u-plan[data-pm="renders"] .u-z, html.r13 body #lv-home .u-plan[data-pm="renders"] .zbtns, html.r13 body #lv-home .u-plan[data-pm="renders"] .sun-ov, html.r13 body #lv-home .u-plan[data-pm="renders"] .sun-bar, html.r13 body #lv-home .u-plan[data-pm="renders"] .hm-view { visibility: hidden; pointer-events: none; }
html.r13 body #lv-home .u-plan[data-pm="walk"] .sun-ov, html.r13 body #lv-home .u-plan[data-pm="walk"] .sun-bar { display: none; }

/* ---------- 5 · the Overview "Renders" tile: a slim full-width strip under the view and walkthrough tiles ---------- */
html.r13 body #lv-home .hm-tiles .hm-tile-renders { grid-column: 1 / -1; aspect-ratio: auto; height: calc(var(--q-row) * 2); min-height: calc(var(--q-row) * 1.5); }
html.r13 body #lv-home .hm-tiles .hm-tile-renders > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }
html.r13 body #lv-home .hm-tiles .hm-tile-renders::after { background: linear-gradient(180deg, rgba(10, 8, 14, .3) 0%, rgba(10, 8, 14, .64) 34%, rgba(10, 8, 14, .76)); }

/* ---------- 6 · the "usable" ring: room for the figure and the word inside the stroke (final fix 1) ---------- */
html.r13:not(.tv) body #lv-home .vz-area .vz-ring { width: 88px; height: 88px; }
html.r13:not(.tv) body #lv-home .vz-area .vz-ring b { margin-top: -16px; }
html.r13:not(.tv) body #lv-home .vz-area .vz-ring small { bottom: 25px; }
html.r13.tv body #lv-home .vz-area .vz-ring { width: 144px; height: 144px; }
html.r13.tv body #lv-home .vz-area .vz-ring b { margin-top: -28px; }
html.r13.tv body #lv-home .vz-area .vz-ring small { bottom: 46px; }

/* ---------- 7 · the card at rest (FINAL-FIX3 F6): whole items above the fold ---------- */
/* TV: the card keeps its own, smaller scale (as the map card does: 1.4, not 1.7) so the head, the tabs and the tiles fit above the orb; the tokens that carry the scale are re-declared for it */
html.r13.tv body #lv-home .u-spec.hm2 {
  --ui-scale: 1.4;
  --ty-display: 300 calc(56px * var(--ui-scale))/1.07 var(--sans); --ty-large: 400 calc(34px * var(--ui-scale))/1.18 var(--sans); --ty-title: 400 calc(24px * var(--ui-scale))/1.25 var(--sans);
  --ty-head: 600 calc(17px * var(--ui-scale))/1.3 var(--sans); --ty-body: 400 calc(15px * var(--ui-scale))/1.47 var(--sans); --ty-callout: 500 calc(15px * var(--ui-scale))/1.33 var(--sans);
  --ty-foot: 400 calc(13px * var(--ui-scale))/1.38 var(--sans); --ty-cap: 500 calc(12px * var(--ui-scale))/1.33 var(--sans); --ty-fig: 300 calc(40px * var(--ui-scale))/1.1 var(--num); --ty-fig-row: 400 calc(17px * var(--ui-scale))/1.3 var(--num);
  --q-ctl: calc(44px * var(--ui-scale)); --q-chip: calc(32px * var(--ui-scale)); --q-seg: calc(36px * var(--ui-scale)); --q-row: calc(44px * var(--ui-scale)); --q-row-sub: calc(56px * var(--ui-scale)); --q-icon: calc(20px * var(--ui-scale));
}
/* the Overview is a two-column grid: the intro, the view and walkthrough tiles, then the figures (area ring, room counts), then the Renders strip. The DOM order (and so the text order) is unchanged:
   .hm-tiles and .vz-ov dissolve into the grid and CSS order puts the strip after the figures. js/plus/home.js adds .hm-ov to the Overview pane */
html.r13 body #lv-home .hm-pane.hm-ov:not([hidden]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); align-content: start; }
html.r13 body #lv-home .hm-ov > .hm-intro { grid-column: 1 / -1; margin: 0 0 var(--s1); }
html.r13 body #lv-home .hm-ov > .hm-tiles,
html.r13 body #lv-home .hm-ov > .vz-ov { display: contents; }
html.r13 body #lv-home .hm-ov .vz-area { grid-column: 1 / -1; order: 2; margin-top: var(--s1); }
html.r13 body #lv-home .hm-ov .vz-sts { grid-column: 1 / -1; order: 3; }
html.r13 body #lv-home .hm-ov .hm-tile-renders { order: 4; }
/* the steps the fit may take (js/plus/home.js keeps the one that shows the most whole items): 1 = shorter tiles; 2 = + a tighter head and figures; 3 = + the shortest tiles */
html.r13 body #lv-home .u-spec.hm2.fit-1 .hm-ov .hm-tile-view, html.r13 body #lv-home .u-spec.hm2.fit-1 .hm-ov .hm-tile-walk { aspect-ratio: 2 / 1; }
html.r13 body #lv-home .u-spec.hm2.fit-1 .hm-ov .hm-tile-renders { height: calc(var(--q-row) * 1.5); }
html.r13 body #lv-home .u-spec.hm2.fit-2 .hm-ov .hm-tile-view, html.r13 body #lv-home .u-spec.hm2.fit-2 .hm-ov .hm-tile-walk { aspect-ratio: 2 / 1; }
html.r13 body #lv-home .u-spec.hm2.fit-2 .hm-ov .hm-tile-renders { height: calc(var(--q-row) * 1.5); }
html.r13 body #lv-home .u-spec.hm2.fit-3 .hm-ov .hm-tile-view, html.r13 body #lv-home .u-spec.hm2.fit-3 .hm-ov .hm-tile-walk { aspect-ratio: 2.4 / 1; }
html.r13 body #lv-home .u-spec.hm2.fit-3 .hm-ov .hm-tile-renders { height: calc(var(--q-row) * 1.25); min-height: 0; }
html.r13 body #lv-home .u-spec.hm2.fit-2, html.r13 body #lv-home .u-spec.hm2.fit-3 { gap: var(--s1); }
html.r13 body #lv-home .u-spec.hm2.fit-2 > .hm-head, html.r13 body #lv-home .u-spec.hm2.fit-3 > .hm-head { padding-top: var(--s3); }
/* (FINAL-FIX4 F7, QA-C D12) the tab row's sticky backing reaches --s2 (8px) above the row: the gap under the actions row (the Price / Sold / On hold capsule) never goes below that, at every fit step (4px gap + 4px here), so the backing never paints over the capsule */
html.r13 body #lv-home .u-spec.hm2.fit-2 .hm-act, html.r13 body #lv-home .u-spec.hm2.fit-3 .hm-act { row-gap: var(--s1); margin-bottom: var(--s1); }
html.r13 body #lv-home .u-spec.hm2.fit-2 .hm-panes, html.r13 body #lv-home .u-spec.hm2.fit-3 .hm-panes { padding-top: var(--s2); }
html.r13 body #lv-home .u-spec.hm2.fit-2 .hm-ov .vz-area, html.r13 body #lv-home .u-spec.hm2.fit-3 .hm-ov .vz-area { padding-block: var(--s1); margin-top: 0; }
html.r13 body #lv-home .u-spec.hm2.fit-2 .hm-ov .vz-st, html.r13 body #lv-home .u-spec.hm2.fit-3 .hm-ov .vz-st { padding-block: var(--s2) var(--s1); }

/* ---------- 8 · the photo tiles' words (FINAL-FIX3 F6, QA-C D9 / QA-A m3): a quiet scrim under the label and a soft halo, so the kicker and the title reach 4.5:1 over bright sky and foliage ---------- */
html.r13 body #lv-home .hm-tile::after { background: linear-gradient(180deg, rgba(10, 8, 14, 0) 14%, rgba(10, 8, 14, .6) 52%, rgba(10, 8, 14, .74)); }
html.r13 body #lv-home .hm-tile .ht-t small { color: rgba(255, 255, 255, .94); text-shadow: 0 1px 5px rgba(0, 0, 0, .5), 0 0 1px rgba(0, 0, 0, .35); }
html.r13 body #lv-home .hm-tile .ht-t b { text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }

/* ---------- 9 · the floor plate card waits for its drawing (FINAL-FIX3 F6, QA-C D4): js/plus/home.js adds .fp-wait while the plate has no drawing yet, so an empty white card never shows ---------- */
html.r13 body #lv-home .fp.fp-wait { visibility: hidden; }

/* "Release this hold?" (3 November): press-and-hold on the Hold requested banner opens this small dialog (js/ux/tower-home.js askRelease): a compact card in the middle of the screen,
   not the full-size sheet. Two real buttons side by side: Keep hold (quiet) and Release hold (ink), 48px tall, the same width. */
html.r13 body #sheet.rel .sh-panel { inset: auto; left: 50%; top: 50%; translate: -50% -50%; width: min(30rem, calc(100vw - 2rem)); height: auto; max-height: calc(100dvh - 2rem); padding: 28px 28px 24px; overflow: visible; }
html.r13 body #sheet.rel .sl-sheet { display: grid; gap: 0; max-width: none; margin: 0; }
html.r13 body #sheet.rel .sl-head { margin: 0 0 8px; padding-right: 44px; }
html.r13 body #sheet.rel .rel-sub { margin: 0 0 24px; color: rgba(22, 22, 27, .72); font: 400 max(1rem, 16px)/1.4 var(--sans); }
html.r13 body #sheet.rel .rel-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0; }
html.r13 body #sheet.rel .rel-acts .cx-btn { display: flex; align-items: center; justify-content: center; min-height: 48px; margin: 0; padding: 0 20px; border: 0; border-radius: 999px; font: 600 max(1rem, 16px)/1 var(--sans); box-shadow: none; }
html.r13 body #sheet.rel .rel-acts .cx-btn:not(.lg-prominent):not(#zz-) { background: rgba(22, 22, 27, .08); color: #16161b; }
html.r13 body #sheet.rel .rel-acts .cx-btn.lg-prominent:not(#zz-) { background: #16161b; color: #fff; }

/* the floor plan's zoom hint ("Pinch or double-tap to zoom...", 3 November): 13px down to 12px, the app's smallest text size (scaled on the TV) */
html.r13 body #lv-home .fp .zhint:not(#zz-):not(#zz-):not(#zz-) { font-size: calc(12px * var(--ui-scale, 1)); }
