/* CSS Variables for Theme */
:root {
    /* Colors */
    --color-primary: #007bff;
    --color-success: #5AB577;        /* brand + status green (client-supplied).
       NOTE: intentionally DISTINCT from --color-panel-fixed #5AB778, which is
       panel colour-coding matched to the 3D material. The two are visually
       identical but mean different things — do NOT merge them. */


    --color-success-dark: #0b5a2e;   /* dark success text (COL-5 legacy-green sweep + COL-8 ready-badge headroom) */
    --color-danger: #d32f2f;
    --color-background: #f5f5f5;
    --color-surface: #ffffff;
    --color-text: #231F20;
    --color-text-secondary: #333;
    --color-border: #e7e2df;
    --color-success-light-bg: #D8EADA;   /* light green tint (selected cards, ready badge) */
    --color-card-border: #d5d1ce;        /* standard card border */
    

    /* Page-level horizontal padding (left/right) — single source of truth
       for all major layout containers. */
    --padding-page-horizontal: 24px;

    /* ── App shell width ──
       --shell-width is the actual rendered width of the UI: it tracks the
       viewport between the floor and the cap, and is the single source of
       truth for .container, .bottom-sheet and --content-width.
         • ≥ --app-max-width  → shell is capped and centred in the window
         • between the two     → shell tracks the viewport exactly
         • < --app-min-width   → shell holds its size and clips evenly on
                                 BOTH edges (body is overflow: hidden, so
                                 no scrollbar). This mirrors the vertical
                                 behaviour of .container's min-height.
       --content-width is the usable width inside the shell's side padding —
       it doubles as the square target for the 3D preview. */
    --app-min-width: 320px;
    --app-max-width: 500px;
    --shell-width: clamp(var(--app-min-width), 100vw, var(--app-max-width));
    --content-width: calc(var(--shell-width) - 2 * var(--padding-page-horizontal));


    /* Flex priority pair — which sibling absorbs/releases space first.
       Used by the Step 2/3 preview vs. header growth phases. */
    --flex-priority-high: 200;
    --flex-priority-low: 1;


    /* ══════════════════════════════════════════════════════════════
       Vertical Padding Knobs (top → bottom)
       Single source of truth — tune one value and every consumer
       across ALL steps updates. See docs/Padding_QUICK_REFERENCE.md.
       ══════════════════════════════════════════════════════════════ */

    /* ── Step indicator ── */
    --padding-above-step-indicator: 10px;
    --padding-below-step-indicator: 4px;

    /* ── Step header (above 3D preview) ── */
    --step-header-above-preview-pad-top: 1px;
    --step-header-above-preview-pad-bottom: 10px;
    --step-heading-margin-bottom: 4px;

    /* ── Layout cards (Step 1) ──
       Inner vertical padding of a layout card. The gap ABOVE the first card
       and the gap BETWEEN cards are gap bars (--gap-s1-03 / --gap-s1-03a). */
    --layout-btn-vert-pad: clamp(6px, 1.5vh, 12px);

    /* ── Loading overlay ──
       NOTE: the overlay lives INSIDE .preview-section, which is hidden on
       Step 1, so it is only ever seen on Steps 2–6. */
    --loading-text-margin-top: 20px;



    /* ── Input ── */
    --input-field-gap-above: 4px;

    /* ── 3D preview sizing ──
       Consumed by the Step 2 and Step 3 preview rules.
       --preview-square-size is the preview's flex-basis: its "resting" height,
       equal to its own width, i.e. a square. Growth phases (see the Step 2
       vertical-space comment) pivot around this size. */
    --preview-square-size: var(--content-width);
    /* Steps 4/5/6 preview — a LARGER square than Steps 2/3 (which use
       --preview-square-size). Tune the 1.15 multiplier to resize the
       fixing/finishes/summary previews; Steps 2/3 are unaffected. */
    --preview-square-size-456: calc(var(--preview-square-size) * 1.2);
    /* Steps 4/5/6 preview shrink floor — SMALLER than Steps 2/3
       (--preview-min-height) so the preview gives up more space on short
       viewports before the nav row clips. Lower these values to let it
       shrink even further. */
    --preview-min-height-456: clamp(40px, 6vh, 80px);
    --preview-min-height: clamp(90px, 12vh, 140px);

    /* ── Steps 4/5/6 content box ──
       Wraps each step's form-content (fixing tiles / swatches / summary)
       in a shared fluid height so the form-section is constant across
       Steps 4/5/6 → the preview is identical. The vh term makes the box
       shrink on short viewports (before the preview's flex-shrink kicks
       in); the clamp floor is the box's minimum. Tune to taste. */
    --step-content-box-height-456: clamp(120px, 30vh, 265px);





    /* ── Best Match cards ── */
    --best-match-margin-top: clamp(7px, 1vh, 8px);
    --best-match-vert-pad: clamp(4px, 4vh, 32px);
    --best-match-gap: clamp(4px, 1vh, 4px);
    --best-match-solo-vert-pad: clamp(10px, 6vh, 44px);
    --cards-to-view-options-gap: clamp(2px, 0.5vh, 12px);
    /* Growth ceiling for the whole header block on Steps 2 & 3 — heading +
       subtitle + input (~110px) PLUS the Best Match cards. It must live on
       the flex item itself (.step-header-above-preview): a max-height on the
       card list inside would stop the cards growing but the header would keep
       claiming space, pooling it as blank space under the cards instead of
       releasing it to the preview. Raise to give the cards more room, lower to
       hand space to the preview sooner.
       NOTE: on Steps 2/3 the gap-bar zero-out rule strips --best-match-vert-pad /
       --best-match-solo-vert-pad, so card height comes from flex growth plus
       --best-match-card-min-height instead of padding. */
    --step-header-max-height: clamp(230px, 46vh, 410px);
    --best-match-card-min-height: 65px;

    /* Fixed chrome above the card list on Steps 2/3 — step-heading (26)
       + s2-02 (4) + subtitle (~18) + s2-03 (4) + input (40) + s2-04 (14).
       This was already an unnamed assumption inside the tuning note above;
       it is named here because the solo-card ceiling is derived from it.
       ⚠️ This is the ONE knob to adjust if the solo card's max height does
       not match a 2-card card exactly (e.g. if the subtitle ever wraps to
       a second line, adding ~18px). */
    --step-header-chrome-height: 106px;

    /* M-03 range warning under the Step 2/3 input — 4px padding + one caption
       line. Added to the header cap while the warning shows. */
    --range-warning-height: 18px;

    /* Phase-2 ceiling for ONE card — deliberately IDENTICAL whether one or
       two cards render. Derived from the 2-card cap above so the existing
       2-card layout is numerically unchanged: subtract the chrome and the
       inter-card gap, then halve. */
    --best-match-card-max-height: calc(
        (var(--step-header-max-height) - var(--step-header-chrome-height) - var(--gap-s2-04a)) / 2
    );

    /* Header ceiling when only ONE card renders: chrome + one card instead
       of two. The cap must live on the header (the flex item) for the
       surplus to reach the preview — see the solo-card rule further down. */
    --step-header-max-height-solo: calc(
        var(--step-header-chrome-height) + var(--best-match-card-max-height)
    );




    /* ── Nav buttons ── */
    --padding-buttons-top: 8px;
    --nav-row-gap: 18px;
    --control-padding-y: 11px;
    --control-height: 40px;
    --border-width: 2px;

    /* ── Form content (legacy fields, scroll area) ── */
    --padding-form-bottom: calc(clamp(8px, 2vh, 16px) + env(safe-area-inset-bottom));

    /* ── Bottom screen-edge clearance ── */
    --safe-area-bottom: calc(clamp(12px, 3vh, 28px) + env(safe-area-inset-bottom));

    /* ══════════════════════════════════════════════════════════════
       GAP BARS — Steps 1, 2 & 3
       Every vertical space on these steps is ONE --gap-sN-NN variable.
       The elements themselves have no vertical padding/margin (a
       zero-out rule strips it), so this list is the complete spacing
       map for each screen — nothing is hidden further down the CSS.
       Each bar is painted as a border in --gap-bar-color, so setting
       --gap-debug-opacity: 0.4 reveals every gap and 0 hides them all.
       See docs/STYLING.md.
       ══════════════════════════════════════════════════════════════ */
    /* PRODUCTION VALUE = 0 (bars invisible). Set to 0.4-0.5 to reveal every
       gap while tuning. The bars ARE the spacing (they are painted as
       borders), so changing this NEVER changes layout — only visibility. */
    --gap-debug-opacity: 0.0;

    --scroll-fade-size: 40px;
    --scroll-fade-chevron-color: rgba(0,0,0,0.2);
    --scroll-fade-chevrons: 1;   /* 0=hidden, 1=visible */
    --scroll-fade-chevron-offset: 4px;

    --gap-bar-color: rgba(255,60,60,var(--gap-debug-opacity));
    --gap-shared-bar-color: rgba(60,60,255,var(--gap-debug-opacity));

    /* ══════════════════════════════════════════════════════════════
       SHARED GAP VARIABLES (--gap-all-NN)
       These apply to corresponding positions on EVERY step. Each
       step's per-step variable references these via var().
       Shared bars render in blue (--gap-shared-bar-color); step-
       specific bars stay red (--gap-bar-color).
       ══════════════════════════════════════════════════════════════ */
    --gap-all-00: 4px;     /* top of screen → step indicator */
    --gap-all-01: 4px;     /* step indicator → step heading */
    --gap-all-02: 4px;     /* step heading → subtitle */
    --gap-all-05: 8px;     /* last element above nav → nav buttons */
    --gap-all-06: 10px;    /* nav buttons → breakdown link row */
    --gap-all-07: 12px;    /* breakdown link row → bottom edge */

    /* ── Step 1 gap bars (top → bottom) ──
       Step 1's stack differs from Steps 2/3 in two ways: it has NO 3D
       preview (formManager hides .preview-section on Step 1) and no size
       input. It has the three layout cards where Steps 2/3 have Best
       Match cards, and its breakdown-link row is present but with its
       button hidden, so the row still occupies space.

       Step 1 → Step 2 alignment:
         s1-00 ≡ s2-00   (top of screen → step-indicator)
         s1-01 ≡ s2-01   (step-indicator → step heading)
         s1-02 ≡ s2-02   (step heading → subtitle)
         s1-03 ≡ s2-04   (s2-03, subtitle → input, has no counterpart)
         s1-03a ≡ s2-04a (between cards)
         s1-04  — no counterpart: cards → inline error message
         s1-05 ≡ s2-09   (last element above the nav → nav buttons)
         s1-06 ≡ s2-10   s1-07 ≡ s2-11

       The two calc() values keep Step 1's existing fluid scaling: they
       are the sums that --padding-form-bottom + --padding-buttons-top
       and --safe-area-bottom produce today. */
    --gap-s1-00: var(--gap-all-00);   /* top of screen → step-indicator */
    --gap-s1-01: var(--gap-all-01);   /* step-indicator → step heading */
    --gap-s1-02: var(--gap-all-02);   /* step heading → subtitle */
    --gap-s1-03: 5px;    /* subtitle → first layout card (per-step) */
    --gap-s1-03a: 12px;   /* between layout cards (per-step) */
    --gap-s1-04: 0px;     /* eliminated — folded into s1-05 */
    --gap-s1-05: var(--gap-all-05);   /* last layout card → nav buttons */
    --gap-s1-06: var(--gap-all-06);   /* nav buttons → breakdown link row */
    --gap-s1-07: var(--gap-all-07);   /* breakdown link row → bottom edge */


    /* ── Step 2 gap bars (top → bottom, values in px) ── */
    --gap-s2-00: var(--gap-all-00);   /* top of screen → step-indicator */

    --gap-s2-01: var(--gap-all-01);   /* step-indicator → step heading */
    --gap-s2-02: var(--gap-all-02);   /* step heading → subtitle */
    --gap-s2-03: 4px;     /* subtitle → width input (per-step) */
    --gap-s2-04: 14px;    /* width input → best match cards (per-step) */
    --gap-s2-04a: 4px;    /* between best match cards (per-step) */
    --gap-s2-05: 4px;     /* best match cards → 3D preview (per-step) */
    --gap-s2-06: 4px;     /* 3D preview → pinned config section (per-step) */
    --gap-s2-07: 4px;     /* pinned config label → config card (per-step) */
    --gap-s2-08: 8px;     /* config card → view other options (per-step).
                             Painted as a border-TOP on .view-other-options —
                             see the s2-08 rule in css/configurator.css for why
                             it must never sit on .config-card. */
    --gap-s2-09: 16px;    /* view other options → nav buttons (was --gap-all-05, 8px —
                             too tight under the View Other Options / View
                             Diagram row on phones; landscape overrides it) */
    --gap-s2-10: var(--gap-all-06);   /* nav buttons → width breakdown link */
    --gap-s2-11: var(--gap-all-07);   /* width breakdown link → bottom edge */

    /* ── Step 3 gap bars (top → bottom, values in px) ──
       Step 3 has NO pinned-config section (no "Recommended Configurations"
       label, config card, or "View Other Options" link), so it has three
       fewer gaps than Step 2. The numbering is therefore a shorter,
       unbroken 00→08 sequence rather than a 1:1 mirror.

       Step 3 → Step 2 alignment:
         s3-00 ≡ s2-00   s3-04  ≡ s2-04
         s3-01 ≡ s2-01   s3-04a ≡ s2-04a
         s3-02 ≡ s2-02   s3-05  ≡ s2-05
         s3-03 ≡ s2-03
         s3-06 ≡ s2-06 + s2-07 + s2-08 + s2-09  (preview → nav buttons,
                         collapsed: pinned-config section is absent)
         s3-07 ≡ s2-10   s3-08  ≡ s2-11 */
    --gap-s3-00: var(--gap-all-00);   /* top of screen → step-indicator */
    --gap-s3-01: var(--gap-all-01);   /* step-indicator → step heading */
    --gap-s3-02: var(--gap-all-02);   /* step heading → subtitle */
    --gap-s3-03: 4px;     /* subtitle → depth input (per-step) */
    --gap-s3-04: 14px;    /* depth input → best match cards (per-step) */
    --gap-s3-04a: 4px;    /* between best match cards (per-step) */
    --gap-s3-05: 4px;     /* best match cards → 3D preview (per-step) */
    /* s3-06 is NOT a variable — Step 3 renders the same real pinned-config
       section as Step 2 (its content is visibility: hidden) and reuses the
       shared s2-06…s2-09 gap bars, so the form-section heights match exactly
       and the cards/preview split stays in sync between steps. */
    --gap-s3-07: var(--gap-all-06);   /* nav buttons → depth breakdown link */
    --gap-s3-08: var(--gap-all-07);   /* depth breakdown link → bottom edge */

    /* ── Step 4 gap bars (top → bottom, values in px) ──
       Step 4 has NO pinned-config section, no Best Match cards, and
       no subtitle/input — just a heading row, preview, then fixing
       buttons with image+caption per wrapper. The caption gets its
       own gap bar (s4-04) between the fixing button and its label.

       Step 4 → Step 2 alignment:
         s4-00 ≡ s2-00   s4-02 ≡ s2-02+s2-03 (heading→preview, no subtitle/input)
         s4-01 ≡ s2-01   s4-03 ≡ s2-05 (preview→form-content)
                         s4-04 has NO Step 2 counterpart (fixing btn→caption)
                         s4-05 ≡ s2-09 (last content→nav buttons)
                         s4-06 ≡ s2-10   s4-07 ≡ s2-11 */
    --gap-s4-00: var(--gap-all-00);   /* top of screen → step-indicator */
    --gap-s4-01: var(--gap-all-01);   /* step-indicator → header */
    --gap-s4-02: 14px;    /* heading → preview (per-step, merged s2-02+s2-03) */
    --gap-s4-03: 24px;    /* preview → form-content (per-step) */
    --gap-s4-04: 6px;     /* fixing button image → caption label (per-step) */
    --gap-s4-05: var(--gap-all-05);   /* last content → nav buttons */
    --gap-s4-06: var(--gap-all-06);   /* nav buttons → breakdown link row */
    --gap-s4-07: var(--gap-all-07);   /* breakdown link row → bottom edge */

    /* ── Step 5 gap bars (top → bottom, values in px) ──
       Structurally similar to Step 4 — swatches instead of fixing
       buttons. Each swatch item has a color circle + label below it;
       the circle→label gap gets its own bar (s5-03a).

       Step 5 → Step 2 alignment:
         s5-00 ≡ s2-00   s5-02 ≡ s2-02+s2-03
         s5-01 ≡ s2-01   s5-03 ≡ s2-05
                         s5-03a has NO Step 2 counterpart (swatch circle→label)
                         s5-04 ≡ s2-09
                         s5-05 ≡ s2-10   s5-06 ≡ s2-11 */
    --gap-s5-00: var(--gap-all-00);   /* top of screen → step-indicator */
    --gap-s5-01: var(--gap-all-01);   /* step-indicator → header */
    --gap-s5-02: 14px;    /* heading → preview (per-step, merged s2-02+s2-03) */
    --gap-s5-03: 24px;    /* preview → form-content (per-step) */
    --gap-s5-03a: 4px;    /* swatch color circle → label text (per-step) */
    --gap-s5-03b: var(--space-4);   /* swatch group → optional add-on box (per-step) */
    --gap-s5-04: var(--gap-all-05);   /* last content → nav buttons */
    --gap-s5-05: var(--gap-all-06);   /* nav buttons → breakdown link row */
    --gap-s5-06: var(--gap-all-07);   /* breakdown link row → bottom edge */

    /* ── Step 6 gap bars (top → bottom, values in px) ──
       Step 6 has a header-above-preview (logo + "ready" badge) and a 3D
       preview, like Steps 4/5. The form-content holds the "Your Summary"
       block (heading, table, buttons, card) — no scrollable cards, so the
       form-content is content-sized.

       The ready-badge is vertically centered between the logo and the
       summary content: s6-09a (logo → badge) equals the gap below the badge
       (s6-02 + s6-03). Portrait: 18 = 0 + 18. Landscape: 25 = 7 + 18
       (s6-09a is overridden to 25px in landscape.css).

       Step 6 → Step 2 alignment:
         s6-00 ≡ s2-00   s6-02 ≡ s2-02+s2-03 (heading→preview, no subtitle/input)
         s6-01 ≡ s2-01   s6-03 ≡ s2-05 (preview→form-content)
                         s6-04 ≡ summary heading → layout row
                         s6-05 ≡ layout row → dims block
                         s6-06 ≡ dims → nav buttons (≡ s2-09)
                         s6-07 ≡ s2-10   s6-08 ≡ s2-11 */
    --gap-s6-00: var(--gap-all-00);   /* top of screen → step-indicator */
    --gap-s6-01: var(--gap-all-01);   /* step-indicator → header */
    --gap-s6-02: 7px;     /* header → form-section (landscape only; portrait zeroes it — preview hidden) */
    --gap-s6-03: 18px;    /* preview → "Your Summary" heading (per-step) */
    --gap-s6-04: 14px;    /* "Your Summary" heading → Layout row (per-step) */
    --gap-s6-05: 16px;    /* Layout row → dims block (per-step) */
    --gap-s6-06: var(--gap-all-05);   /* dims block → nav buttons */
    --gap-s6-07: var(--gap-all-06);   /* nav buttons → breakdown link row */
    --gap-s6-08: var(--gap-all-07);   /* breakdown link row → bottom edge */
    --gap-s6-09: 12px;    /* internal gap between summary content-box children (heading/table/buttons/logo/card) */
    --gap-s6-09a: 18px;   /* logo → ready-badge AND badge → summary content (symmetric — centers the badge; landscape overrides to 25px) */

    /* ── Step 7 gap bars (top → bottom, values in px) ──
       Step 7 has NO 3D preview and NO header-above-preview — the full
       screen area from the indicator down is devoted to the shopping
       list content. The step-indicator text is hidden but its space is
       reserved (CSS visibility: hidden), so s7-00/s7-01 are still needed.

       Step 7 → Step 2 alignment:
         s7-00 ≡ s2-00   s7-01 ≡ 0 (logo aligns with Step 6's header logo)
                                    (s7-01a centers the title between the
                                     logo and the divider)
         s7-05 ≡ s2-09   s7-10 ≡ s2-11 (orange btn→bottom edge) */
    --gap-s7-00: var(--gap-all-00);   /* top of screen → step-indicator */
    --gap-s7-01: 0px;     /* step-indicator → logo (0px — logo aligns with Step 6's header logo; --gap-all-01 handles the 4px below the indicator) */
    --gap-s7-01a: 1px;   /* logo → title AND title → divider (symmetric — the .shopping-list-heading wrapper centers the title between them) */
    /* --gap-s7-02: retired — the title → divider gap is now the wrapper's
       border-bottom (s7-01a), keeping the title centered. */
    --gap-s7-03: 1px;    /* divider → first shopping list item (per-step) */
    --gap-s7-04: 0px;     /* between .shopping-list-item rows (per-step) */
    --gap-s7-05: 0px;     /* last list item → "Order these products" subheading (per-step) */
    --gap-s7-06: 8px;     /* subheading → body text paragraph (per-step) */
    --gap-s7-07: 4px;    /* body text → red "Check Out Bunnings" button (per-step) */
    --gap-s7-08: 16px;     /* red button → "Power Pass" small print (per-step) */
    --gap-s7-09: 4px;    /* small print → orange "Bunnings Trade" button (per-step) */
    --gap-s7-10: 16px;     /* last disclaimer → nav buttons (per-step) */
    --gap-s7-11: 16px;    /* orange button → first disclaimer (per-step) */
    --gap-s7-12: 12px;    /* between disclaimer paragraphs (per-step) */


    /* ── Bottom sheet (reusable overlay) ── */
    --sheet-pad-top: 20px;
    --sheet-pad-bottom-base: 24px;
    --sheet-handle-margin-bottom: 16px;
    --sheet-header-margin-bottom: 4px;
    --sheet-subtitle-margin-bottom: 16px;
    --sheet-card-gap: 12px;
    --sheet-body-margin-bottom: 20px;
    --sheet-option-vert-pad: 14px;
    --sheet-update-btn-vert-pad: 12px;
    --sheet-back-vert-pad: 12px;

    /* ── Width Breakdown sheet ── */
    --breakdown-line-vert-pad: 6px;
    --breakdown-total-margin-top: 4px;
    --breakdown-total-pad-top: 10px;





    

    /* Typography */
    --font-family: 'Stolzl', sans-serif;

    /* ── Typography Presets ──
        Every component references ONLY these tokens for font-size and
        font-weight.  Tune --font-offset to shift ALL sizes at once; edit
        the pairs below to adjust individual text levels.
        See docs/STYLING.md for the full element coverage map. */
    --font-offset: -2px;

    --font-size-caption:       calc(11px + var(--font-offset));  --weight-caption:       400;
    --font-size-label-strong:  calc(12px + var(--font-offset));  --weight-label-strong:  600;
    --font-size-body:          calc(14px + var(--font-offset));  --weight-body:          500;
    --font-size-button:        calc(14px + var(--font-offset));  --weight-button:        600;
    --font-size-subhead:       calc(16px + var(--font-offset));  --weight-subhead:       500;
    --font-size-heading:       calc(17px + var(--font-offset));  --weight-heading:       700;
    --font-size-title:         calc(21px + var(--font-offset));  --weight-title:         700;
    --font-size-sheet-title:   calc(26px + var(--font-offset));  --weight-sheet-title:   700;

    /* Shopping-list disclaimer text size multiplier (Step 7).
       Scales the caption size used by .shopping-disclaimer.
       1 = default (9px after --font-offset); e.g. 1.25 ≈ 11px. */
    --shopping-disclaimer-font-scale: 0.75;

    /* Border Radius — single source of truth for all rounded corners.
       (--border-radius-pill stays 50% for circular elements such as
       the step-number badge, checkmark badge, and loading spinner.) */
    --border-radius: 4px;
    --border-radius-pill: 50%;

    /* Checkmark badge — single source of truth for all green-tick circles */
    --checkmark-size: 22px;

    /* ===== Bottom sheet tokens ===== */
    --sheet-radius: 16px;              /* bottom-sheet top corners */
    --z-sheet-scrim: 1000;             /* dimmed backdrop behind bottom sheets */
    --z-sheet: 1001;                   /* bottom sheet above the scrim */

    /* ══════════════════════════════════════════════════════════════
       Step 1 Landscape Panel (component-scoped tokens)
       The "Your Shower, Taking Shape" panel shown on Step 1 in
       landscape only. Values are DECIDED in PLAN_STEP1_LANDSCAPE_PANEL.md
       Section 1.5 — do not re-derive. Scoped to this component (not the
       shared --color-* / --font-size-* lists) per YAGNI, until a second
       consumer exists.
       ══════════════════════════════════════════════════════════════ */
    /* Panel width minus the 24px left margin (landscape.css 8a) that aligns
       the panel's left edge with the 3D preview canvas (which .preview-section
       insets by --padding-page-horizontal). */
    --step1-panel-width: calc(100vw - var(--shell-width) - var(--padding-page-horizontal));
    /* RES-4 (ui-audit): the panel's actual rendered HEIGHT in landscape. The
       grid cell (landscape.css 8a, column 2) spans all three rows, so it is
       100dvh tall; the card then insets itself by 2 × --landscape-preview-gap
       (8a: height: calc(100% - 2 * var(--landscape-preview-gap))). The panel's
       vertical insets (8a/8c/8d) are FRACTIONS of this token, NOT raw vh — vh
       scales against the viewport, but the panel never fills the viewport (it
       is 2 × --landscape-preview-gap shorter), which mis-proportioned the photo
       on desktop-landscape sizes (1280×500, split-screen). The dvh line
       overrides the vh fallback, mirroring body's own height fallback
       (configurator.css). Update this token, not the fractions in
       landscape.css. */
    --step1-panel-height: calc(100vh - 2 * var(--landscape-preview-gap));
    --step1-panel-height: calc(100dvh - 2 * var(--landscape-preview-gap));
    --step1-panel-heading-size: clamp(20px, 4vh, 32px);
    --step1-panel-subtitle-size: calc(var(--step1-panel-heading-size) * 0.6);
    /* ~23.25% of panel width (1.5x Section 1.5's ~15.5% per user request),
       105px/240px floor/ceiling. 105px floor ensures the brand block fits within
       the 30% gutter (63% image width → gutter = 100% - 7% - 63% = 30%) at the
       914×320 worst-case landscape viewport without overlapping the image or
       overflowing the panel edge. Uses --step1-panel-width, 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%. */
    --step1-panel-logo-width: clamp(105px, calc(var(--step1-panel-width) * 0.2325), 240px);
    /* Step 7 shopping-list logo (black-on-transparent, light header). */
    --shopping-list-logo-width: clamp(120px, 36%, 180px);
    /* Step 7 shopping-list minimum height — 2 BOM rows (2 × 66px). Below this
       the list fully expands and the whole form-content scrolls instead. */
    --shopping-list-min-height: 100px;
    /* Step 6 summary logo (black-on-transparent, light background). */
    --step6-logo-width: clamp(120px, 36%, 180px);

    /* ── Landscape 3D preview vertical gap ──
       Spacing above and below the live 3D preview in landscape mode
       (app-Steps 2–7). Consumed by css/landscape.css Section 9, which
       paints it as transparent top/bottom borders on .preview-section —
       borders are the only vertical-spacing mechanism that survives the
       per-step `*` zero-outs in configurator.css (margin/padding are
       zeroed with !important). Portrait is unaffected. Tune this one
       value to change the gap. */
    --landscape-preview-gap: 21px;

    /* ══════════════════════════════════════════════════════════════
       Step 0 — Token baseline (ui-audit-report.md §2)
       Additive only — no consumers yet. Steps 1–12 wire these in.
       ══════════════════════════════════════════════════════════════ */

    /* ── 4px spacing scale (§2.1) ── */
    --space-0-5: 2px;
    --space-1:   4px;
    --space-2:   8px;
    --space-3:   12px;
    --space-4:   16px;
    --space-5:   20px;
    --space-6:   24px;
    --space-8:   32px;
    --space-10:  40px;
    --space-12:  48px;
    /* ── Card spacing alias ── */
    --card-pad: var(--space-4);   /* 16px — uniform padding for white outline cards (SPA-1) */

    /* ── New colour tokens (§2.2) ── */
    --color-border-strong: #574e4d;          /* strong border / divider */
    --color-surface-muted: #fafafa;          /* subtle surface tint */
    --color-surface-hover: #f0f0f0;          /* hover surface */
    --color-surface-pressed: #e6e6e6;        /* pressed surface */
    --color-scene: #D9D9D9;                   /* 3D scene grey */
    --color-placeholder: #757575;             /* input placeholder text (COL-3 — AA on white) */
    --color-primary-light-bg: #e7f3ff;        /* selected option background */
    --color-primary-lighter-bg: #f0f7ff;      /* hover option background */
    --color-warning: #FF9933;                 /* orange checkout (COL-1) */
    --color-warning-light: #FFB366;           /* formula header */
    --color-diff-danger: #d32f2f;             /* smaller diff badge (COL-4 alias to --color-danger) */
    --color-diff-success: #5AB577;            /* larger diff badge (COL-4 alias to --color-success) */
    --color-panel-hinge: #AE8FC3;             /* hinge panel colour (client-supplied, 3D-matched) */
    --color-panel-door: #194E9E;              /* door panel colour (client-supplied, 3D-matched) */
    --color-panel-fixed: #5AB778;             /* fixed panel colour (client-supplied, 3D-matched) */

    /* ── Selection-language tiers (CON-8) ──
       Two intentional selection states, applied consistently across the five
       selection controls:
         Primary   = black outline + green tick (layout / fixing / swatch)
         Suggested = light-green fill + green tick (Best Match / config sheet) */
    --selection-primary-border: var(--color-panel-black);
    --selection-suggested-fill: var(--color-success-light-bg);

    /* ── Z-index scale (§2.6) ──
       --z-sheet-scrim (1000) / --z-sheet (1001) already exist above;
       kept here for reference only. --z-boot (10000) stays hardcoded in
       index.html's critical-path inline <style>. */
    --z-chevron: 10;                          /* scroll-fade chevron */
    --z-nav: 100;                             /* .button-section */
    --z-preview-controls: 900;                /* .orientation-overlay (above the
                                                 canvas, below .loading-overlay) */
    --z-overlay: 1000;                        /* .loading-overlay */
    --z-fade: 1001;                           /* #previewFadeOverlay */

    /* ── Shadows (§2.5) ── */
    --shadow-focus: 0 0 0 3px rgba(0,123,255,0.35); /* focus indicator (was 0.1 alpha) */
    --shadow-card: 0 2px 4px rgba(0,0,0,0.12);     /* card/toast shadow */
    --shadow-pop: 0 4px 6px rgba(0,0,0,0.12);      /* popped element shadow */

    /* ── Motion tokens (§2.7) ── */
    --duration-fast: 0.15s;
    --duration-base: 0.2s;
    --duration-slow: 0.3s;
    --duration-enter: 0.28s;

}
