/* ============================================================
   LANDSCAPE LAYOUT
   ============================================================

   Two-column landscape layout: the form column on the left at
   var(--shell-width), the 3D preview filling the remaining width on the
   right. Portrait is the default and is defined entirely by the other four
   stylesheets; nothing in this file applies in portrait.

   ------------------------------------------------------------
   THE CONTRACT
   ------------------------------------------------------------
   EVERY rule in this file MUST be prefixed with `html.is-landscape`.

   That class is toggled on <html> by src/ui/orientation.js whenever
   window.innerWidth > window.innerHeight (a square viewport counts as
   PORTRAIT). It is NOT a media query - this is deliberate, and
   `@media (orientation: landscape)` must not be used here.

   The prefix is what makes portrait unable to regress: if a rule can only
   match when the class is present, it cannot affect the portrait layout.
   An unprefixed rule in this file silently breaks that guarantee.

   ------------------------------------------------------------
   LOAD ORDER MATTERS - THIS FILE MUST LOAD LAST
   ------------------------------------------------------------
   Loaded after base.css -> layout.css -> components.css -> configurator.css
   in index.html.

   Because it loads last AND every selector carries an extra class, landscape
   rules beat their portrait equivalents on both specificity and source order.
   That is why NO `!important` is needed in this file. If you find yourself
   reaching for it, the selector or the load order is wrong - fix that instead.

   (Contrast with the gap-bar zero-out blocks in configurator.css, which do
   need `!important` because they use the `*` selector.)

   CARVE-OUT - step-scoped `:has()` rules are NOT beaten by an extra class.
   The "landscape always wins" claim above holds against base.css, layout.css
   and components.css. It does NOT hold against the per-step rules in
   configurator.css, because `:has()` takes the specificity of its most
   specific argument, so `.step[data-step="1"].active` contributes three
   class/attribute units:

       .form-content:has(.step[data-step="1"].active)          = (0,4,0)
       .container:has(.step[data-step="4"].active) .form-content = (0,5,0)
       html.is-landscape .form-content                          = (0,2,1)  LOSES

   A landscape rule that loses on specificity never gets to use source order.
   The fix is to MATCH the `:has()` in the landscape selector, e.g.
   `html.is-landscape .form-content:has(.step[data-step="1"].active)` - never
   `!important`. See plan Step 7 ("Specificity trap") for the worked example.


   ------------------------------------------------------------
   WHAT THIS FILE MUST NOT TOUCH
   ------------------------------------------------------------
   - Any portrait declaration in the other stylesheets. The two portrait
     values landscape needs to differ on (.container's `width` and
     `min-height`) are OVERRIDDEN here, never edited at source.
   - The Steps 4/5/6 preview-equalization tokens
     (--preview-square-size*, --preview-min-height*,
     --step-content-box-height-456) - these keep governing portrait.
   - The Step 4 fixing-tile sizing system.

   Note: flex-grow / flex-shrink / flex-basis are ignored on grid items, so
   the entire Steps 2-6 vertical flex negotiation self-neutralises once
   .container becomes a grid. min-height / max-height are NOT ignored by the
   spec - BUT measurement (plan Steps 3 + 4) showed the values actually present
   never bind in landscape: max-height already computes to `none` on every
   step, and min-height is only a <=140px FLOOR against a row hundreds of px
   tall. So no per-step neutralising rule is needed. Do not delete those
   min-heights from configurator.css either - they govern portrait.

   ------------------------------------------------------------
   REFERENCE
   ------------------------------------------------------------
   docs/LANDSCAPE_LAYOUT.md - implementation plan, hazards, decisions
   docs/LANDSCAPE_LAYOUT.md - permanent reference (added in plan Step 11)
   docs/STYLING.md       - gap bars; s2-06 is neutralised in landscape

   ============================================================ */


/* ============================================================
   1. THE TWO-COLUMN GRID                        (plan Step 3)
   ============================================================

   .container switches from a vertical flex column to a 2-column grid:

     +----------------------+---------------------------+
     | row 1  step-indicator|                           |
     +----------------------+      preview-section      |
     | row 2  step-header   |     (spans all 3 rows)    |
     +----------------------+                           |
     | row 3  form-section  |                           |
     +----------------------+---------------------------+
        var(--shell-width)              1fr
           (500px here)           (all remaining width)

   In landscape 100vw is always > --app-max-width, so --shell-width's clamp()
   pins the form column to exactly 500px. The form column is therefore the
   SAME width it is in portrait - the form is never resized or redesigned.
   ============================================================ */

/* body centres .container in portrait. In landscape the shell is full-width,
   so centring is meaningless - but flex-start also guarantees the form column
   is pinned LEFT if .container ever fails to fill the width (decision D1). */
html.is-landscape body {
    justify-content: flex-start;
}

html.is-landscape .container {
    /* The SHELL widens to the viewport; the FORM COLUMN keeps --shell-width
       via grid-template-columns below. Overridden here, never edited at
       source in layout.css. */
    width: 100vw;

    /* HAZARD H1 (plan Step 8). layout.css sets min-height: 480px as a
       desktop-resize guard. In landscape phone (428px tall) that demands more
       height than the viewport has, and <body> is overflow:hidden, so the
       bottom 52px - the whole breakdown-link row plus part of the nav row -
       is SILENTLY CLIPPED. Measured: container bottom 480 vs innerHeight 428.
       Landscape doesn't need the guard because .form-content can scroll
       instead. Portrait keeps its 480px floor untouched. */
    min-height: 0;

    display: grid;
    grid-template-columns: var(--shell-width) 1fr;

    /* minmax(0, 1fr), NOT a bare 1fr: a bare 1fr carries an implicit `auto`
       minimum, so tall form content would push the row past the viewport
       instead of letting .form-content scroll inside it. Same class of trap
       as the min-content note in docs/STYLING.md - avoided by never
       depending on intrinsic sizing in the scrolling axis. */
    grid-template-rows: auto auto minmax(0, 1fr);
}

/* Explicit placement for all FIVE direct children of .container.
   Every child MUST be placed - an unplaced child would be auto-placed into a
   new implicit row and break the layout. */
html.is-landscape .step-indicator            { grid-area: 1 / 1; }
html.is-landscape .step-header-above-preview { grid-area: 2 / 1; }

html.is-landscape .form-section {
    grid-area: 3 / 1;
    min-height: 0;   /* already 0 in layout.css; restated because grid items
                        do NOT inherit the flex-item context it was set for */
}

html.is-landscape .preview-section {
    grid-area: 1 / 2 / -1 / 3;   /* column 2, spanning every row */
    min-height: 0;
    min-width: 0;                /* stops a wide <canvas> forcing the grid
                                    wider than the viewport */
}

/* The 5th child: the Step 1 marketing panel (section 8). It occupies the SAME
   cell as .preview-section - column 2, all rows - because the two are never
   visible at the same time: Step 1 has no 3D preview in either orientation
   (previewIsHidden() returns true unconditionally for the layout step), and the
   panel only appears on Step 1. `-1` is the last row line, exactly as
   .preview-section uses, so this stays correct against
   grid-template-rows' three explicit rows.

   Placed unconditionally even though the panel is `display: none` on every
   other step. A display:none element is out of flow and takes no grid area, so
   this line is strictly optional for correctness - it is here to satisfy this
   section's own invariant ("every child MUST be placed") and to stay correct if
   the display value is ever changed. */
html.is-landscape #step1LandscapePanel {
    grid-area: 1 / 2 / -1 / 3;
    min-height: 0;
    min-width: 0;
}


/* ============================================================
   2. GAP BAR SYSTEM CORRECTION                  (plan Step 5)
   ============================================================

   The Gap Bar System (docs/STYLING.md) encodes VERTICAL gaps as borders on
   the box above the gap. In a two-column layout most of those adjacencies are
   unchanged - they're all inside the left column. Exactly ONE breaks.

   s2-06 is "3D preview -> pinned config section", painted in configurator.css
   as a margin-bottom + border-bottom on .preview-section (shared by app-Steps
   2 and 3). In portrait the pinned-config section sits directly below the
   preview, so the bar describes a real gap.

   In landscape the preview is in column 2 and the pinned-config section is in
   column 1 - they are no longer adjacent, and nothing sits below the preview
   at all. The border becomes a stray line across the bottom of the preview
   column, and it steals height from the canvas for a gap to nothing.

   Only the BORDER needs zeroing. The configurator.css rule also sets
   `margin-bottom: var(--gap-s2-06)`, but that declaration is dead in BOTH
   orientations: each step carries a `.container:has(...) * { margin-bottom: 0
   !important }` zero-out, and `*` matches .preview-section too. Measured 0px
   in portrait. A `margin-bottom: 0` here would therefore be a no-op that
   falsely implies the margin does something - so it is deliberately omitted.

   This is the ONLY gap bar that needs correcting - verified by auditing every
   rule targeting .preview-section in configurator.css. Steps 4/5/6 only zero
   its padding (no border), Step 7 sets only `display` on it (section 3 below),
   and Step 1 deliberately has no bar because the box is display:none there. */
html.is-landscape .container:has(.step[data-step="2"].active) .preview-section,
html.is-landscape .container:has(.step[data-step="3"].active) .preview-section {
    border-bottom-width: 0;
}


/* ============================================================
   3. APP-STEP 7 PREVIEW                           (plan Step 6)
   ============================================================

   App-Step 7 (the shopping list) is the one step whose preview EXISTS ONLY IN
   LANDSCAPE. In portrait the list needs the full height, so the preview stays
   hidden exactly as before. In landscape column 2 is empty and otherwise
   wasted, so we show the finished shower next to the list.

   Two separate `display: none` declarations have to be beaten, which is why
   this rule is so specific:

     .preview-section.hidden                                       (0,2,0)
       - layout.css. formManager toggles the .hidden class; previewIsHidden()
         now returns false for app-Step 7 in landscape, so the class is no
         longer added. Beaten anyway, so a stale class can't blank the column.

     .container:has(.step[data-step="7"].active) .preview-section  (0,5,0)
       - configurator.css line ~1245, the portrait step-7 rule.

   Ours is (0,6,1), so it wins on specificity alone - no !important, per the
   file contract in the header.

   `display: block` is the value .preview-section already computes to on every
   other step: layout.css declares no `display` for it, so block is its natural
   value. We are restoring the default, not inventing a new one.

   ONLY `display` is set. The plan's draft also carried `min-height: 0` and
   `max-height: none`; both were dropped after checking the cascade - layout.css
   already sets `min-height: 0` (and section 1 restates it for the grid item),
   and no rule anywhere sets a max-height on this box. Writing values the
   browser already computes is the trap that cost time on app-Step 4, where a
   restated value hid which declaration was actually load-bearing.

   Grid placement needs nothing here: section 1 places .preview-section into
   column 2 for ALL steps unconditionally, so app-Step 7 inherits it. */
html.is-landscape .container:has(.step[data-step="7"].active) .preview-section {
    display: block;
}


/* ============================================================
   4. BOTTOM SHEETS - PIN TO THE FORM COLUMN  (Step 9, HAZARD H2)
   ============================================================

   The three sheets (#configSheet, #breakdownSheet, #depthBreakdownSheet) are
   direct children of <body>, NOT of .container, so they do not take part in the
   landscape grid. Left alone they stay centred on the whole WINDOW: measured at
   1440x900 the sheet sat at 469.9 -> 969.9 while the form column ends at 500,
   so it straddled the column boundary and hung mostly over the 3D preview -
   visually detached from the button that opened it. Decision D2 resolved this
   as left-pinned: the sheet belongs to the column that opened it.

   WHY BOTH DECLARATIONS MUST CHANGE TOGETHER. layout.css folds the horizontal
   centring INTO the slide transform so the two share one transition:

       .bottom-sheet       { left: 50%; transform: translate(-50%, 100%); }
       .bottom-sheet.open  {           transform: translate(-50%,   0); }

   The -50% is the centring; the 100%/0 is the slide. Override `left` without
   both transform states and the sheet is shifted off-screen by half its width;
   override only one transform state and it either loses its animation or slides
   in from the wrong place. Hence exactly two rules, always edited as a pair.

   Width needs NO change: the sheet is already width: var(--shell-width), the
   same token the form column uses, so `left: 0` aligns the two edge-to-edge by
   construction rather than by a matching pair of magic numbers.

   Specificity: ours are (0,2,1) and (0,3,1) vs the base (0,1,0) and (0,2,0),
   so both win on specificity and on order. No !important - contract holds.

   NOT TOUCHED, deliberately:
     .sheet-scrim - position: fixed; inset: 0, so it dims the preview column
       too. Correct for a modal: the sheet is the only live surface while open,
       and dimming just the left half would imply the preview is still
       interactive. Full-window scrim is intended, not an oversight.
     max-height: 85% of the viewport + overflow-y: auto (layout.css) - already correct. At 428px tall that
       is 363.7px with internal scrolling, which is exactly the intended
       fallback. Verified in Step 9 rather than re-declared. */
html.is-landscape .bottom-sheet {
    left: 0;
    transform: translate(0, 100%);
}

html.is-landscape .bottom-sheet.open {
    transform: translate(0, 0);
}


/* ============================================================
   5. APP-STEP 7 - SHOPPING LIST OVERFLOW           (plan Step 7)
   ============================================================

   THE BUG (926x428, a 7-item list). The list's items painted straight through
   the content below them - subheading, body text, both checkout buttons - and
   .form-content was left with 239px of scroll:

       .shopping-list        box  67.5px   content 463px  -> 396px painting out
       .form-content         scrollable overflow          -> 239px

   Two rules, and the A/B below is why BOTH are kept. Columns are the list's
   visible height / .form-content's scrollable overflow:

       neither (before)   67.5px / 239px      <- items overlap the text below
       5a only            67.5px /  23px      <- overlap gone
       5b only            133px  / 170px      <- still overlapping
       both               133px /  20px       <- shipped

   CAUSE 1 (rule 5a) is the load-bearing fix: 239px -> 23px. components.css
   gives .shopping-list only `display: flex; flex-direction: column` and
   configurator.css makes it `flex: 1 1 auto`, so flexbox shrinks its BOX to
   whatever is left (67.5px) while the items keep their intrinsic ~66px each.
   With `overflow: visible` (the initial value) they simply paint outside the
   box - shrinking a box does NOT clip its contents - and they also keep
   inflating the step's scroll height. Making it a scroll container fixes both.

   CAUSE 2 (rule 5b) is a QUALITY fix, not the overlap fix: it roughly doubles
   the list's visible height (67.5 -> 133px) and trims the residual scroll
   170 -> 20px. The breakdown-link row reserves 69.4px for a control that is
   `visibility: hidden` on Step 7 (40px control + the all-06/all-07 gap bars).
   Portrait wants that reservation - it keeps the nav row at the same height on
   every step. Landscape cannot afford it.

   WHAT IS LEFT. Nothing paints over the nav row in ANY of the four states
   above: .form-content is itself a scroll container whose bottom edge lands
   exactly on the nav row's top (measured 372.4 = 372.4), so it clips there.
   What remains after both rules is a 20px scroll of .form-content at 926x428
   (21px at 844x390), i.e. the last ~20px of the orange button sits below the
   fold until you scroll. That is the designed fallback, not an overlap, and it
   is 0px at 1440x900.

   MEASURING TRAP - do not trust rect comparisons here. Once 5a is applied,
   `lastItem.getBoundingClientRect().bottom - list.getBoundingClientRect()
   .bottom` still reports ~330px, because a scrolled-out child keeps its
   layout position; it is CLIPPED, not moved. Two false "still broken"
   readings came from exactly this. Use scrollHeight - clientHeight, or a
   screenshot.

   WHY LANDSCAPE-ONLY (and what that leaves behind). Both causes are really
   "content taller than the viewport" - height-driven, not orientation-driven.
   At 390x844 PORTRAIT the same 7 items still overflow .form-content by 1px.
   Left unfixed by explicit decision: portrait has been held byte-identical
   all session, and 5b would pull Step 7's nav row out of line with Steps 1-6
   in portrait. If a portrait overlap is ever reported, promote rule 5a (NOT
   5b) into configurator.css. See docs/LANDSCAPE_LAYOUT.md.

   SPECIFICITY. Both portrait rules are step-scoped `:has()` selectors at
   (0,5,0), so `html.is-landscape .shopping-list` at (0,2,1) would LOSE - this
   is exactly the carve-out described at the top of this file. Matching the
   `:has()` puts ours at (0,6,1) and (0,6,1). No !important needed. */

/* 5a - SUPERSEDED. This rule used to make the list its own scroll region:

       .shopping-list { overflow-y: auto; overscroll-behavior: contain; }

   It became actively harmful once rule 5d (below) gave the list
   `flex: 0 0 auto`. At natural height the list's own content ALWAYS fits
   (measured 914x320: clientH 397 == scrollH 397), so it is a scroll
   container with NOTHING TO SCROLL - permanently sitting at both its top
   and bottom scroll boundary. `overscroll-behavior: contain` then means
   "at my boundary, do NOT chain to my parent", so every wheel/touch over
   the list was captured and thrown away instead of reaching .form-content,
   which holds the real 383px of overflow.

   The user-visible signature was exact: scrolling worked in the 24px
   gutters either side of the list (x 0-24 and 476-500, bare .form-content)
   but was dead everywhere over the list itself (x 24-476). See the
   replacement rule below rule 5d.

   NO min-height FLOOR (kept from the original note). One was tried -
   a viewport-relative clamp floor (64px/132px bounds) - and measured INERT at both landscape phone
   sizes, so it was removed rather than kept as a knob that does nothing. */


/* 5b - reserve the ~69px held by the hidden breakdown link.

   `visibility: hidden` (not `display: none`) keeps the row's space reserved
   so the nav row stays vertically aligned with Steps 1/4/5/6, which also
   reserve this row's space (their button is `visibility: hidden`). */
html.is-landscape .container:has(.step[data-step="7"].active) .breakdown-link-row {
    visibility: hidden;
}


/* 5c - Step 7 nav-row gap band: override the portrait --gap-s7-10 (16px) with the
   shared "content -> nav" gap --gap-all-05 (8px) so the landscape nav-row band
   matches Steps 4/5/6 (48px) instead of the one-off 56px. Portrait keeps 16px -
   this rule is html.is-landscape-scoped. Specificity (0,6,1) beats the portrait
   Step 7 rule (0,5,0), so no !important. */
html.is-landscape .container:has(.step[data-step="7"].active) .button-section {
    border-top-width: var(--gap-all-05);
}


/* 5d / 5d(ii) / 5e - RETIRED (2026-08-20). These three rules made Step 7
   landscape a SINGLE scroll region: .form-content scrolled the whole step
   (logo, list, order section, checkout buttons, disclaimers) while the list
   was `flex: none; overflow: visible`. That made landscape behave differently
   from portrait, where .shopping-list is the sole scroller.

   The requirement is orientation parity — the scroll area must work the same
   in portrait and landscape. The shared behaviour now lives entirely in
   css/configurator.css (Step 7 flex layout + .shopping-list overflow-y: auto):

     - TALL  (list has room):       .shopping-list scrolls internally;
                                    .form-content fits (no scroll).
     - SHORT (list collapses to 0): .form-content scrolls everything EXCEPT
                                    the nav (.button-section +
                                    .breakdown-link-row stay pinned below).

   Landscape therefore needs NO override here. The portrait Step 7 rules
   already apply in landscape: `.form-content:has(.step[data-step="7"].active)`
   (0,4,0) beats the generic `html.is-landscape .form-content { flex: 1 0 auto }`
   (0,2,1) below, and `.container:has(.step[data-step="7"].active)
   .shopping-list` (0,5,0) has no landscape counterpart.

   WHY THE SINGLE-SCROLL-REGION APPROACH WAS REMOVED (do NOT re-add): it
   stopped the list from ever scrolling on its own in landscape, so at tall
   landscape heights the whole content scrolled instead of just the list —
   the user-visible defect this section was originally written to fix.

   RELATED: portrait .form-content was `overflow: hidden` from commit
   b09c64ac until this change; that created a dead zone at short portrait
   heights (clipped disclaimers + a scroll-fade indicator on a container that
   could not scroll). Reverting it to `overflow: auto` in configurator.css is
   what restores the shared graceful-degradation behaviour. */

/* ============================================================
   6. PHASE 2 - CARD GROWTH, PINNED-CONFIG, SHORT-VIEWPORT CLIPPING
   ============================================================

   Three coupled fixes (Issues 2/3/4 from PLAN.md) all stem from the
   same root: .container becoming a CSS grid makes flex-grow /
   flex-shrink on its direct children stop working (see header note).
   They MUST ship together - fixing one alone risks trading a clip for
   a gap (PLAN.md Escalation check). All scoped to html.is-landscape so
   portrait is protected by construction.

   ------------------------------------------------------------ */

/* Issue 2 - Best Match cards never grow in landscape.

   The Step 2/3 header flex-grow is ignored (it is a grid item), so the
   header is auto-sized and cards stay at --best-match-card-min-height
   (65px) even with hundreds of px of slack. Override the grid rows for
   Steps 2 & 3 so the header (row 2) and form-section (row 3) SHARE the
   leftover height via minmax(0, 1fr) each - the grid-native equivalent
   of the ignored flex-grow. Split (not take-all) keeps form-section
   tall enough for the nav + breakdown row (Issue 4). Scoped to Steps 2
   & 3 only - Steps 1/4/5/6/7 keep the base auto auto minmax(0,1fr). */
html.is-landscape .container:has(.step[data-step="2"].active),
html.is-landscape .container:has(.step[data-step="3"].active) {
    grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
}

/* Step 2 - the even split clipped the ALTERNATE card on mid-height desktop
   windows (~1000x540 iframe: list 127px vs 134px of cards, bottom border
   cut). Guarantee the header row the height it needs for two 65px cards
   (~280px incl. heading + input), capped at ~half the column so the nav
   still gets the other half on short windows. Above ~540px tall the 1fr
   share already exceeds 270px, so tall layouts are unchanged; the
   breakdown link scrolls inside form-section (Issue 4a) when short. */
html.is-landscape .container:has(.step[data-step="2"].active) {
    grid-template-rows: auto minmax(min(280px, 52%), 1fr) minmax(0, 1fr);
}

/* Issue 3 - REMOVED (Session 30). Previously set flex-grow: 0 to keep

   form-content has base flex:1 (layout.css) and grows to fill the tall
   landscape form-section, shoving the pinned-config (a later sibling
   inside form-section) to the bottom with the nav (451px gap at
   1440x900). Set flex-grow:0 so form-content stops absorbing the slack
   and the pinned-config rises to the top of form-section (under the
   header/cards). DOM unchanged - pinned-config stays in form-section. */


/* Issue 4 - breakdown-link-row hard-clipped on short landscape.

   .form-section is overflow:hidden (layout.css base), so on short
   landscape (<=428px) the breakdown-link-row is hard-clipped (~10-18px
   unrecoverable - the F1 bug). Let form-section scroll as a fallback
   (PLAN.md option A; option B gap-bar shaves rejected). A scrollbar on
   the left column at short heights is acceptable UX. On tall landscape
   nothing overflows so no scrollbar appears. overflow-y longhand
   overrides the base overflow:hidden shorthand y-axis; x stays clipped. */
html.is-landscape .form-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Issue 4a (re-scoped, plan Step 3) - the Issue 4 fallback above was
   removed from the generic rule in session 31 (it caused the Step 1 nav
   to scroll away). Re-introduce it scoped to Steps 2/3 only, so the
   .breakdown-link-row is reachable at short landscape heights without
   touching Steps 1/4/5/6/7. */
html.is-landscape .container:has(.step[data-step="2"].active) .form-section,
html.is-landscape .container:has(.step[data-step="3"].active) .form-section {
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Make form-content grow in landscape to fill available height in form-section.
   This pushes the nav buttons (button-section) to the bottom of the viewport
   instead of clustering at the top, eliminating spare white space. */
html.is-landscape .form-content {
    flex: 1 0 auto;
}

/* Step 3 - collapse the invisible pinned-config placeholder (landscape only).

   MEASURED at 914x320: #recommendedConfigGroup is a direct child of
   .form-section, 85.8px tall, with visibility:hidden on every one of its
   children. Session 19 renders it on Step 3 purely so the PORTRAIT
   form-section height matches Step 2 (portrait stacks preview above form, so
   equal form heights => equal preview heights).

   In landscape the preview is in grid column 2 and is sized by the column,
   NOT by form-section's height - so the reservation buys nothing and costs
   85.8px. That reserved-but-invisible box IS the white gap between the depth
   cards and the nav buttons, and it also pushed .breakdown-link-row's bottom
   to 357.5px, past the 320px viewport (hard-clipped).

   display:none (not visibility:hidden) so the box contributes zero height and
   its gap-bar borders (s2-06..s2-09) go with it. Step 3 only - Step 2's
   pinned-config is real, visible and clickable. */
html.is-landscape .container:has(.step[data-step="3"].active) #recommendedConfigGroup {
    display: none;
}

/* Step 3 - give the freed height to the depth cards, not to empty space.

   With the placeholder collapsed, row 3 (form-section) still had
   minmax(0, 1fr) from the Issue-2 rule above, so it kept an equal share of
   the slack (149.6px) even though its real content is only nav 40 + breakdown
   61.2 = 101.2px. The surplus landed in Step 3's EMPTY .form-content (the
   depth UI lives in the header, row 2), reappearing as a 51.6px gap above the
   nav.

   Sizing row 3 `auto` makes it exactly its content height, so all remaining
   slack goes to row 2 (the header) and the depth best-match list grows into
   it. Measured at 914x320: list clientH 43 -> 91 (scrollH 134, still scrolls),
   gap above nav 51.6 -> 3.3px, breakdown bottom 320.1 <= 320 viewport.

   Step 3 only - Step 2 keeps minmax(0, 1fr) because its pinned-config is real
   content that must keep its share of row 3. */
html.is-landscape .container:has(.step[data-step="3"].active) {
    grid-template-rows: auto minmax(0, 1fr) auto;
}

/* Issue 4b (Step 7) - DELIBERATELY NO RULE HERE. Do not re-add
   `overflow: hidden` on Step 7's form-content.

   WHAT WAS TRIED. Phase 2 shipped:

       html.is-landscape .container:has(.step[data-step="7"].active)
       .form-content { overflow: hidden; }

   The goal was cosmetic: rules 5a/5b already make the shopping-list its
   own scroll region and reclaim the breakdown row, but form-content
   itself still scrolls ~17px (the last ~20px of the orange checkout
   button sits below the fold). Clipping it was meant to leave the
   shopping-list as the SINGLE scroll region.

   WHY IT FAILED (Check F, measured at 926x428 on Step 7). It turned a
   17px SCROLLABLE deficit into an 18px CLIPPED one, and the clipped
   content was the orange checkout button - 0 of 40px visible, and
   unreachable by any gesture:

       form-content   336 client / 354 scroll, overflow: hidden
       form-content   visible bottom 356.53
       .btn-checkout-orange  top 357.48 -> entirely below the clip line
       form-section   407 / 407  -> CANNOT scroll: form-content hid the
                                    overflow, so the ancestor never sees it

   ROOT CAUSE. Step 7's form-content is a flex column whose only
   flex:1 1 auto item is .shopping-list; everything below it
   (subheading, body text, red button, small print, orange button) is
   fixed-height / flex:none. The list is the sole shock absorber and is
   already fully shrunk before this rule applies. Changing `overflow`
   does not change flex layout, so the list cannot absorb the 18px -
   `hidden` just deletes it. And because form-content hides its own
   overflow, the Issue 4a form-section scroll fallback is neutralised
   too, leaving no scroll region that can reach the button.

   WHY NOT `overflow: visible` INSTEAD. Same reason: the box does not
   grow, so form-section's scrollHeight does not grow either - the tail
   would simply PAINT outside the box, over .button-section (the nav
   band sits at ~366.7-407, the orange button at ~357-397). That trades
   a clip for an overlap.

   THE DECISION. Step 7 keeps the pre-Phase-2 behaviour: form-content
   stays `overflow: auto` (css/configurator.css line ~1269), i.e. it is
   its own scroll region and the button is reachable by scrolling it.
   That RELAXES the "shopping-list is the only scroll region on Step 7"
   preference - in landscape there are two, nested (outer form-content,
   inner shopping-list). Reachability of the checkout button is a
   requirement; a single scroll region was only a preference.

   IF YOU WANT ONE SCROLL REGION AGAIN, it is a LAYOUT change, not an
   overflow change: the fixed-height tail has to fit. Shaving gap bars
   is out (magic-number fight), and flooring .shopping-list only pushes
   the deficit further down the column. Measure first. */



/* ============================================================
   7. SESSION 29 - LANDSCAPE UX POLISH (STEPS 1-3)
   ============================================================

   Three independent UX-polish fixes from the session-28 landscape
   assessment (LANDSCAPE_UX_FIXES.md), implemented in session 29. All are
   CSS-only, html.is-landscape-scoped, and independent of each other and of
   the rules above - portrait is protected by construction (the class is
   absent in portrait, so none of these selectors match).

   ------------------------------------------------------------ */

/* 7a - Step 1 layout buttons too short in landscape.

   At 914x320 the three .layout-btn cards render at only ~26px tall (their
   min-height is 0 and flex shrinks them), so the title + subtitle text
   ("Corner / To suit corner space") is cramped and hard to read - a poor
   first impression. The form-section has ~299px of height for three
   buttons, so there is ample room. A 50px min-height makes the text
   readable while still fitting all three buttons plus the nav row with
   room to spare. Scoped to Step 1 only. */
html.is-landscape .container:has(.step[data-step="1"].active) .layout-btn {
    min-height: 50px;
}

/* NEW: Step 1 form-content scroll override for landscape.

   At 914x320, the Step 1 form-content has `overflow: hidden` (portrait rule,
   configurator.css line 237). The three 50px buttons + heading + subtitle exceed
   the available form-section height (~299px) when the nav row is subtracted
   (~47px), leaving only ~252px for content. With 150px of headers and 50x3=150px
   buttons, the total is 300px - overflow. The portrait rule clips the bottom
   layout card and nav buttons entirely, making Step 1 unusable in mobile
   landscape.

   Fix: Override with overflow-y: auto (specificity 0,5,1 beats portrait 0,4,0)
   so form-content becomes its own scroll container at 914x320. At tall
   landscapes (1440x900) this remains inert (content fits). Portrait is
   unaffected (class absent). */
html.is-landscape .form-content:has(.step[data-step="1"].active) {
    flex: 1 1 0;
    overflow: hidden;
    min-height: 0;
}

/* 7a-step1 - Step 1: only buttons scroll, heading/subtitle fixed at top.
   
   The form-content is already display:flex + flex-direction:column (from
   base layout.css), so we can use flex properties on the children to control
   scrolling. The heading, subtitle, and error-message stay fixed at the top
   with flex:0 0 auto (fixed height). Only the layout-buttons scroll with
   flex:1 1 auto + overflow-y:auto. This keeps the heading/subtitle visible
   while the user scrolls through the 3 buttons. */
html.is-landscape .form-content:has(.step[data-step="1"].active) .step-heading,
html.is-landscape .form-content:has(.step[data-step="1"].active) .step-subtitle,
html.is-landscape .form-content:has(.step[data-step="1"].active) .error-message {
    flex: 0 0 auto;
}

html.is-landscape .form-content:has(.step[data-step="1"].active) .layout-buttons {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

/* 7b - Step 2 Best Match list: contain cards + scroll indicator.

   At 914x320 the .best-match-list is flex:1 1 auto (configurator.css) and
   shrinks to ~57px while its cards (65px each) keep their intrinsic size.
   With the list's overflow:visible the cards paint straight past the
   header (row 2, bottom ~170px) into the form-section area (row 3),
   overlapping the pinned-config card below - the session-28 assessment
   flagged cards 3-4 as "hidden off-screen with no visual cue". (Best
   Match renders 1-2 cards for a given width, so at most 2 are shown, but
   the overflow-past-the-header overlap is the real defect.)

   Fix: cap the list at max-height 150px and make it a scroll container
   (overflow-y: auto) so the cards are CONTAINED inside the header instead
   of painting over the form-section. A subtle bottom fade gradient
   (white -> translucent) hints at more content below when the list does
   scroll. 150px fits ~2 cards (130px) without a scrollbar in the common
   case; a scrollbar + gradient appear only if content exceeds 150px.

   SCOPED TO STEP 2 ONLY. The master doc's selector
   (`.step-header-above-preview .best-match-list`) is not step-scoped and
   would also hit Step 3's #depthBestMatchList, conflicting with the 7c
   Step 3 fix below. The Step 2 :has() scope keeps this isolated. Portrait
   keeps flex:1 1 auto + overflow:visible (cards grow with the tall
   header). */
html.is-landscape .container:has(.step[data-step="2"].active) .best-match-list {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* 7c - Step 3 depth Best Match list: contain cards (same defect as 7b).

   Step 3 has the IDENTICAL defect to Step 2: #depthBestMatchList is
   flex:1 1 auto, shrinks to ~57px at 914x320, and with overflow:visible
   its 65px cards paint past the header (row 2, ~170px) into the
   form-section, overlapping the pinned-config card below. The session-28
   assessment (Issue 4) called this "~140px unused whitespace" and proposed
   expanding the header so all cards fit. That proposal does NOT work at the
   914x320 worst case (see DEVIATION note below), so this fix instead
   mirrors 7b: make the list a scroll container so cards are contained.

   DEVIATION FROM THE ROADMAP. The master doc proposed:
     grid-template-rows: auto minmax(0, 1fr);   (2 explicit rows)
     .step-header-above-preview { max-height: none; flex-grow: 1; }
   Measured at 914x320, the 2-row grid makes form-section an implicit-auto
   row sized to its CONTENT (~194px: pinned-config 86 + breakdown link 61 +
   nav 47), leaving the header only ~105px - SMALLER than the current
   149.6px, so the cards overflow MORE, not less. (The master doc's
   "~140px unused" assumed a near-empty form-section that does not match
   the real Step 3 layout.) `max-height: none` is unnecessary: the header's
   230px cap (configurator.css --step-header-max-height) already lets the
   1-2 depth cards (130px) + form-group (~93px) = ~223px fit at TALL
   landscapes where the grid row gives the header >= 223px; and `flex-grow:
   1` is a no-op on a grid item. So neither roadmap declaration helps.

   THIS FIX. overflow-y: auto (no max-height) contains the cards inside the
   header at short heights (no overlap, scroll to see more) AND lets the
   list grow with the header at tall heights (cards fit without scroll,
   capped only by the header's 230px ceiling). No max-height cap is set
   here - unlike 7b - so Step 3 cards can use the full header height at
   tall landscapes (a max-height would pool a blank band, the trap
   configurator.css line ~186 warns about). The gradient matches 7b.
   Scoped to Step 3 only; portrait keeps overflow:visible. */
html.is-landscape .container:has(.step[data-step="3"].active) .best-match-list {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}


/* Step 6 summary (redesign) — the new content (badge + table + buttons +
   logo + card) is taller than the form column at short landscape, so
   something has to scroll.

   RETIRED (plan Step 2) — do NOT re-add:

       html.is-landscape .container:has(.step[data-step="6"].active)
       .form-section { overflow-y: auto; min-height: 0;
                       overscroll-behavior: contain; }

   Scrolling .form-section made the WHOLE column scroll, including
   .button-section and .breakdown-link-row. Measured at 914x320 the nav
   row sat at 602.4-650.4 (392px below the fold) on 2sided and 533.6-581.6
   on 3sided/singlepanel — the Back/Next buttons were off-screen at rest
   and only reachable by scrolling. Nav must stay pinned.

   THE FIX. Move the scroll one level in: .form-content becomes the scroll
   region, so only the summary content scrolls while .button-section and
   .breakdown-link-row (later siblings inside .form-section) stay pinned
   below it. .form-section reverts to its layout.css base overflow: hidden.

   flex: 1 1 auto + min-height: 0 are BOTH required — they override the
   generic `html.is-landscape .form-content { flex: 1 0 auto }` above
   (which forbids shrinking, so the box would grow past the column and
   push the nav off-screen again rather than scrolling). Selector matches
   the `:has()` convention (see header, lines 38-52) at (0,6,1) so it
   beats the portrait Step 6 rules in configurator.css. */
html.is-landscape .container:has(.step[data-step="6"].active) .form-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Step 5 (support-tube add-on) — same scroll treatment as Step 6. The
   opted-in add-on box is taller than the fixed 456 content box, so in
   landscape .form-content becomes the scroll region (nav stays pinned). */
html.is-landscape .container:has(.step[data-step="5"].active) .form-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Step 6 badge centering (landscape) — the gap below the badge is larger in
   landscape (s6-02 7px + s6-03 18px = 25px, because the preview sits beside
   the header rather than hidden), so the symmetric logo→badge gap (s6-09a)
   is overridden from 18px to 25px to match. Custom-property override on the
   Step 6-scoped container, inherited by #header-step-6. */
html.is-landscape .container:has(.step[data-step="6"].active) {
    --gap-s6-09a: 25px;
}

/* ============================================================
   8. STEP 1 LANDSCAPE MARKETING PANEL           (plan Step B)
   ============================================================

   Step 1 has no 3D preview in either orientation, so in landscape column 2
   was simply blank. This section fills it with a static marketing panel
   (#step1LandscapePanel): heading + dynamic "{Layout} Layout Selected"
   subtitle top-left, a scene photo below them, and the STEIN logo + tagline
   right-anchored and vertically centred.

   IT IS ENTIRELY STATIC. Nothing here touches the 3D pipeline:
   .preview-section keeps its own `display: none` on Step 1 (set by
   previewIsHidden() -> .hidden), and the two boxes are fully independent even
   though they share grid cell 1 / 2 / -1 / 3 - they are never visible at the
   same time.

   The panel's hidden default lives in components.css (see the comment there),
   NOT here, so portrait never depends on this file loading.

   ------------------------------------------------------------
   HAZARD - THE STEP 1 `*` ZERO-OUT USES !important
   ------------------------------------------------------------
   configurator.css:702 is:

       .container:has(.step[data-step="1"].active) * {
           padding-top: 0 !important;  padding-bottom: 0 !important;
           margin-top: 0 !important;   margin-bottom: 0 !important;
       }

   The panel is inside .container, so `*` matches the panel AND every element
   in it. VERTICAL padding and margin therefore CANNOT be used anywhere in
   this section - they would be silently zeroed. This file forbids
   !important, and the gap-bar system's own convention (configurator.css:722,
   "Any NEW bar must also be a border") gives the correct workaround:

     - vertical panel insets  -> transparent `border-top`/`border-bottom`
       (borders are never zeroed by the rule above)
     - vertical gaps between flex children -> `row-gap` on the flex parent
       (a gap is not a margin, so it also survives), the same technique
       session 19 used for s2-04a/s3-04a
     - HORIZONTAL padding is untouched by the zero-out and is used normally

   (RES-4) Percentage vertical values from plan Section 1.5 are expressed
   against the panel's own HEIGHT via the --step1-panel-height token (base.css,
   Step-1 Landscape Panel block): a percentage padding/border resolves against
   the element's WIDTH in CSS, not its height - and the panel's cell is much
   wider than it is tall in landscape, so `%` would give a wildly wrong inset.
   --step1-panel-height is the panel's real height (the grid cell spans all
   three rows of the viewport-height shell, minus the 2 × --landscape-preview-gap
   the card insets itself by), so the inset math is exact at EVERY landscape
   height - the old raw viewport-relative insets scaled against the viewport
   and mis-proportioned the photo on
   desktop-landscape sizes (1280×500, split-screen). Update the token, not the
   fractions below.

   CROSS-REFERENCE: this constraint is now prominently documented at the top of
   each of the three `*` zero-out blocks in configurator.css (Steps 1, 2, 3) —
   look for the "⚠️ ZERO-OUT (Step N) — FRAGILE CONSTRAINT" comment blocks.
   ------------------------------------------------------------ */

/* 8a - Reveal the panel on Step 1 only.

   (0,6,1): html + .is-landscape + .container + :has(.step[data-step="1"]
   .active -> 3 units) + #id. It beats the (0,1,0) `display: none` base rule in
   components.css on specificity, so no !important is needed - exactly the
   pattern section 3 uses to un-hide .preview-section on Step 7. */
html.is-landscape .container:has(.step[data-step="1"].active) #step1LandscapePanel {
    display: flex;
    flex-direction: column;

    /* Anchor for the absolutely-positioned brand block (8d). */
    position: relative;

    /* Left inset matching the 3D preview canvas. .preview-section carries
       `padding: 0 var(--padding-page-horizontal)`, so its canvas starts 24px
       right of the form column. Without this margin the panel's black
       background runs flush to the form column (x = --shell-width), making the
       preview appear 24px larger on the left than on every other step. */
    margin-left: var(--padding-page-horizontal);

    /* The card itself is inset --landscape-preview-gap from the top and bottom
       of the viewport, matching the vertical gap the live preview gets on
       Steps 2-7 (Section 9). align-self: center + an explicit height shrink
       the grid item's border-box (and therefore its grey outline) inward;
       margins are unavailable (zeroed with !important by the Step 1 * rule)
       and the top/bottom borders below are reserved for the image insets. */
    align-self: center;
    height: calc(100% - 2 * var(--landscape-preview-gap));

    /* Section 1.5's ratios are expressed as "% of PANEL width". They cannot be
       written as plain percentages on the children: a child's `width: 54%`
       resolves against the panel's CONTENT box (panel minus the 7%+7% padding =
       86% of the panel), which measured 46.4% of the panel instead of the
       required 54%. --step1-panel-width (base.css, Step D) is the panel's exact
       width in landscape (grid column 2 = 100vw - var(--shell-width) - var(--padding-page-horizontal)), so
       children compute their ratios off it via calc(). */

    background: var(--color-surface);   /* white, matching the app's card style (was --step1-panel-bg #231F20) */

    /* White-card treatment: same outline/radius tokens as the app's other
       white cards (--color-card-border / --border-width / --border-radius).
       box-shadow (not border) because the top/bottom transparent borders
       below are the panel's vertical insets and must not be overwritten. */
    border-radius: var(--border-radius);
    box-shadow: 0 0 0 var(--border-width) var(--color-card-border);

    /* Section 1.5: ~7% of width horizontal inset, ~4.5%/~7% of height
       top/bottom. Horizontal padding is safe (the zero-out only strips
       vertical); the vertical insets MUST be transparent borders. */
    padding-left: 7%;
    padding-right: 7%;
    border-top: calc(var(--step1-panel-height) * 0.045) solid transparent;
    border-bottom: calc(var(--step1-panel-height) * 0.07) solid transparent;

    /* The panel is the sole occupant of a grid cell it must never outgrow. */
    overflow: hidden;
}

/* 8b - Text block: heading + subtitle, top-left, natural height.

   row-gap (not margin) for the ~4px heading->subtitle gap, per the hazard
   note above. Section 1.5 calls this gap "very tight, do not scale much", so
   it stays a fixed 4px rather than a viewport-relative value. */
html.is-landscape .container:has(.step[data-step="1"].active) .step1-landscape-panel__text {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    row-gap: 4px;
    text-align: left;
}

/* 8c - Scene photo.

   Section 1.5: left edge flush with the text block (so no extra inset), width
   ~63% of the panel, filling the remaining height between the text block and
   the bottom inset. `border-top` supplies the ~6.5% (of --step1-panel-height) subtitle->image gap
   (margin-top would be zeroed by the `*` rule).

   flex: 1 1 auto + min-height: 0 lets the photo absorb the leftover height
   instead of overflowing at 914x320. align-self: flex-start keeps it
   left-anchored instead of stretching across the full content width. */
html.is-landscape .container:has(.step[data-step="1"].active) .step1-landscape-panel__scene {
    flex: 1 1 auto;
    min-height: 0;
    align-self: flex-start;

    /* 63% of the PANEL, not of the content box - see --step1-panel-width in base.css.
       Measured: a plain `63%` would resolve against the content box (~86% of panel);
       this calc() resolves against --step1-panel-width (the full panel width). */
    width: calc(var(--step1-panel-width) * 0.63);

    border-top: calc(var(--step1-panel-height) * 0.065) solid transparent;
}

/* object-fit: cover on a 100%/100% box = fills edge-to-edge, no letterboxing
   and no distortion (Section 1.5 DECIDED). display: block removes the inline
   baseline gap. border-radius: var(--border-radius) rounds the image's corners
   to the app's standard radius (a FIXED 4px, non-scaling value: the image
   itself resizes via object-fit: cover, but the corner radius stays constant
   across landscape sizes, matching how --border-radius behaves elsewhere).
   The radius is applied to the <img> itself, which clips its own cover-fitted
   content, so no wrapper overflow: hidden is needed. */
html.is-landscape .container:has(.step[data-step="1"].active) .step1-landscape-panel__scene-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
}

/* 8d - Brand block (logo + tagline).

   Section 1.5 (corrected): HORIZONTALLY CENTERED in the gutter (the space
   between the scene image's right edge and the panel's right edge), NOT
   right-anchored. The original "right: ~5%" was a wrong visual estimate —
   pixel measurement of the mockup showed the logo sits centered in the gutter
   with roughly equal left/right margins (~11-12% of panel width each in the
   reference canvas).

   The gutter center is derived from the image's actual geometry, both fixed
   elsewhere in this file: image left inset = 7% (8a's padding-left) and image
   width = 63% (8c's calc(var(--step1-panel-width) * 0.63)). So:

       gutter center = 7% + 63% + (100% - 7% - 63%) / 2 = 85% of panel width

   `left: 85%` + `translateX(-50%)` centers the block on that point, so the
   left/right margins in the gutter stay equal regardless of logo/tagline
   width. Recalculate 85% only if padding-left (7%) or the scene width
   factor (0.63) changes.

   Vertical centering is UNCHANGED: `top: calc(50% + 0.0125 *
   var(--step1-panel-height))` + `translateY(-50%)` centres against the panel's
   PADDING box (inside the transparent borders). Those borders are asymmetric
   (4.5% top vs 7% bottom of --step1-panel-height), which would bias the logo
   ~1.25% of the panel height above its true midpoint, so the offset compensates
   (7% − 4.5% = 2.5%; half = 1.25%). Both halves of a transform-centring pair
   must
   always be edited together (the same trap section 4 records for the bottom
   sheets).

   The brand block now holds a single child (the combined logo+tagline SVG),
   so the old flex-column/row-gap layout is gone — no internal layout rules
   are needed.

   `width: fit-content` is required. Without it the block filled the whole
   content box and painted straight over the photo; fit-content shrinks it to
   the logo.

   The max-width is a CONTAINMENT GUARD, not a design value. The gutter is
   ~30% of the panel; a 28%-wide block centered at 85% spans 71%→99%,
   leaving ~1% margin each side and never overlapping the image (whose right
   edge sits at 70%). */
html.is-landscape .container:has(.step[data-step="1"].active) .step1-landscape-panel__brand {
    position: absolute;
    left: 85%;
    top: calc(50% + var(--step1-panel-height) * 0.0125);
    transform: translate(-50%, -50%);

    width: fit-content;
    max-width: calc(var(--step1-panel-width) * 0.28);
}

/* The source SVG is already black-on-transparent, so it needs no colour
   treatment (Section 1.5). height: auto preserves its aspect ratio (natural
   1200x361.44, ~3.32:1); the width is the --step1-panel-logo-width token (base.css, Step D)
   - a 120px floor / 240px ceiling around the ~23.25% ratio (1.5x per user request). The preferred value
   is calc(var(--step1-panel-width) * 0.2325), NOT the plan's `15vw` sketch: `vw`
   resolves against the viewport, but the panel is 100vw - var(--shell-width),
   so 15vw would read ~33% of the panel at 914x320 vs the spec's ~15%. See log.

   The width MUST be resolved from --step1-panel-width, not written as `15%`:
   the parent is now `width: fit-content`, so a percentage width on the logo
   would be CIRCULAR - the parent sizes itself from the child while the child
   sizes itself from the parent. Browsers resolve that by falling back to the
   image's natural size, which measured 49.2px (11.9% of the panel) instead of
   the required ~23.25%. Section 1.5: logo mark ~15-16% of panel width (1.5x to
   ~23.25% per user request). */
html.is-landscape .container:has(.step[data-step="1"].active) .step1-landscape-panel__logo {
    display: block;
    width: var(--step1-panel-logo-width);
    height: auto;
}

/* 8e - Typography + colours (Section 1.5 DECIDED values).

   Sizes/colours are the --step1-panel-* tokens (base.css, Step D): the heading
   is a single clamp() and the subtitle derives from it via calc() so the
   Section 1.5 ratio (0.6) stays locked automatically. The panel
   inherits --font-family from body, so font-family is not restated. */
html.is-landscape .container:has(.step[data-step="1"].active) .step1-landscape-panel__heading {
    color: #000000;
    font-size: var(--step1-panel-heading-size);
    font-weight: var(--weight-heading);
    line-height: 1.15;
}

html.is-landscape .container:has(.step[data-step="1"].active) .step1-landscape-panel__subtitle {
    color: #000000;
    font-size: var(--step1-panel-subtitle-size);   /* 0.6 x heading, per Section 1.5 */
    font-weight: 500;
    line-height: 1.2;
    /* Reserve one line's height even when the text is empty (pre-selection, where
       init() blanks the subtitle). Without this the empty <p> has height 0, so the
       __text block grows by one line-height when the subtitle first appears, and the
       scene image (flex: 1 1 auto) visibly shrinks by the same amount. 1.2em == the
       computed line-height (1.2 x font-size), and the subtitle is always a single
       line, so this is exact. */
    min-height: 1.2em;
}

/* ============================================================
   9. LANDSCAPE PREVIEW VERTICAL GAP
   ============================================================

   In landscape the live 3D preview (.preview-section) fills grid column 2
   edge-to-edge: `grid-area: 1 / 2 / -1 / 3` spans every row, so the canvas
   touches the top and bottom of the viewport. This section insets it
   vertically on every step that shows the live preview (app-Steps 2-7).

   WHY BORDERS, NOT MARGIN/PADDING. Each step carries a
   `.container:has(.step[data-step="N"].active) * { margin-*: 0 !important;
   padding-*: 0 !important }` zero-out (configurator.css), and `*` matches
   .preview-section too, so margin-top/bottom and padding-top/bottom on the
   preview are dead — `!important` beats any non-important declaration
   regardless of specificity. Borders are never zeroed, so the gap is
   painted as transparent top/bottom borders (the same technique Section 8
   uses for the Step 1 panel's vertical insets). With the global
   `box-sizing: border-box` reset, the borders are drawn INSIDE the
   preview's grid cell, so #canvasFrame (height: 100%) shrinks by exactly
   the gap and the transparent strips read as empty space.

   STEP 1 IS DELIBERATELY EXCLUDED: it shows the static marketing panel
   (#step1LandscapePanel), not the live preview, and its vertical insets
   are already handled by Section 8.

   TUNING: change --landscape-preview-gap in css/base.css.
   ============================================================ */
html.is-landscape .container:has(.step[data-step="2"].active) .preview-section,
html.is-landscape .container:has(.step[data-step="3"].active) .preview-section,
html.is-landscape .container:has(.step[data-step="4"].active) .preview-section,
html.is-landscape .container:has(.step[data-step="5"].active) .preview-section,
html.is-landscape .container:has(.step[data-step="6"].active) .preview-section,
html.is-landscape .container:has(.step[data-step="7"].active) .preview-section {
    border-top: var(--landscape-preview-gap) solid transparent;
    border-bottom: var(--landscape-preview-gap) solid transparent;
}




/* ── Step 2/3 header in landscape: respect the grid row ──
   configurator.css gives the header `min-height: min-content` so wrapped
   card text never clips on narrow PORTRAIT phones. In landscape the header
   is a grid item sized by its row; that floor overrode the row/max-height
   and the Best Match cards painted over "Recommended Configurations".
   Undo it here - the card list scrolls inside the row instead, and the
   short-window rules below make two cards fit in the common case. */
html.is-landscape .container:has(.step[data-step="2"].active) .step-header-above-preview,
html.is-landscape .container:has(.step[data-step="3"].active) .step-header-above-preview,
html.is-landscape .container:has(.step[data-step="2"].active) .step-header-above-preview .best-match-list,
html.is-landscape .container:has(.step[data-step="3"].active) .step-header-above-preview .best-match-list {
    min-height: 0;
}

/* ── Short desktop windows (≤640px tall): compact Step 2 ──
   At ~1000x455 (a laptop with the site header above the iframe) the left
   column needs ~550px but has ~400px, and the even grid split cut the
   ALTERNATE card's bottom edge. Trim the two largest vertical spends:
   card padding 16→8px (×2 cards), the input → cards gap 14→6px, and the
   48px "View Other Options → Next" gap → 16px. */
@media (max-height: 640px) {
    html.is-landscape .container:has(.step[data-step="2"].active) .best-match-card {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
    html.is-landscape .container:has(.step[data-step="2"].active) .form-section {
        --gap-s2-09: var(--space-4);
    }
    html.is-landscape .container:has(.step[data-step="2"].active) {
        --gap-s2-04: 6px;   /* width input → cards, 14→6px */
    }
}
