
/* ═══════════════════════════════════════════════════════
   SAB DESIGN SYSTEM
   Type: var(--f-head) · var(--f-ui) · var(--f-mono), var(--f-display) for the wordmark — set in :root below
   Fonts: Josefin Slab (display) · Poppins (UI)
   ═══════════════════════════════════════════════════════ */

:root {
  /* Hewn Light — warm near-black ink (text + the few dark accent surfaces) */
  --ink:       #14110B;
  --ink-2:     #1E180F;
  --ink-3:     #2A2114;
  --ink-4:     #3A2E1E;
  --ink-5:     #4A3C28;

  /* Gold accent — used ONLY as a hairline / single punctuation, never a field */
  --gold:      #B08D3C;
  --gold-2:    #C9A14A;
  --gold-3:    #D9B968;
  --gold-pale: rgba(176,141,60,0.14);
  --gold-dim:  rgba(176,141,60,0.08);
  --gold-line: rgba(176,141,60,0.30);
  --gold-text: #96762A;  /* gold for LARGE text on cream/paper — ≥3:1 (AA large); hairlines stay --gold */

  /* Light ground — paper is the primary app field, creams for nested panels */
  --paper:     #FCFBF8;
  --cream:     #F4EFE6;
  --cream-2:   #ECE5D8;
  --cream-3:   #E2DAD0;
  --cream-4:   #D8CFBF;

  /* Text — on the dark ink surfaces that remain */
  --t-inv:     rgba(252,251,248,0.92);
  --t-inv-2:   rgba(252,251,248,0.56);
  --t-inv-3:   rgba(252,251,248,0.52);  /* AA ≥4.5:1 blended over the hero ink — was 0.30 (2.6:1) */
  --t-inv-4:   rgba(252,251,248,0.14);

  /* Text — on light (ink / umber / sub, per the specimen sheet) */
  --t-dark:    #14110B;
  --t-mid:     #4A3C28;
  --t-sub:     #746753;  /* AA ≥4.5:1 on paper AND cream (#F4EFE6) — was #8A7C64 (3.9:1) */
  --t-faint:   #B3A790;

  /* Borders — hairline; gold-tinted on emphasis, neutral lines otherwise */
  --b-dark:    rgba(176,141,60,0.28);
  --b-light:   #D8CFBF;
  --b-faint:   #E7E0D2;

  /* States */
  --success:   #2A6044;
  --warning:   #884800;
  --error:     #7A1E1E;

  /* Type — every font-family in the app routes through these tokens (UX rebuild
     Phase 3, 20 Sep 2026; Phase 16 Commit T, 28 Sep 2026 — Steve's type
     option C): head for every heading, display for the wordmark alone, ui
     for everything structural, mono for every figure (dimensions, prices,
     counts) so a value does not jitter as it changes. Swap the faces here. */
  --f-head:    'Newsreader', Georgia, serif;          /* headings: h1–h3, page/hero titles, the options panel's section titles */
  --f-display: 'Marcellus', Georgia, serif;          /* the wordmark ONLY (.logo-name) — one weight, no italic */
  --f-ui:      'Inter', system-ui, sans-serif;      /* every structural weight lives here */
  --f-mono:    'Chivo Mono', ui-monospace, monospace; /* plain zero; every figure */
  --f-sheet:   Arial, Helvetica, sans-serif;          /* the drawing sheet: a document that leaves the app (printed, emailed to the installer), so it carries no webfont; matches its SVG */

  /* Radius (squared — no pills). No interface shadows: a floating element is
     held by a hairline (--b-faint / --b-light) and spacing, never a card. The
     only box-shadows left are the selection rings (inset 0 0 0 1px / 0 0 0 2px). */
  --r:         2px;
  --r2:        2px;
  --r3:        3px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--f-ui);
  background: var(--paper);
  color: var(--t-dark);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;   /* only the weights and styles actually loaded render — no faux bold/oblique anywhere (Marcellus has one weight; Newsreader is loaded at 400/500 + italic 400) */
}

/* Every figure is set in the mono — a proportional figure jitters as its value changes. */
input[type=number] { font-family: var(--f-mono); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cream-4); border-radius: var(--r3); }

/* ─────────────────────────────────────────────────────
   TYPOGRAPHY
   ───────────────────────────────────────────────────── */

.serif { font-family: var(--f-head); }
.sans  { font-family: var(--f-ui); }

h1, h2, h3 { font-family: var(--f-head); font-weight: 400; }

.eyebrow {
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--t-sub);
}


/* ─────────────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────────────── */

.header {
  background: var(--ink);
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 200;
  border-bottom: 1px solid var(--b-dark);
}

.logo {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; text-decoration: none;
}

/* The mark in the chrome: monogram by height (1.24:1, never a square box). */
.logo-mono { height: 34px; width: auto; display: block; flex-shrink: 0; }

.logo-text {
  display: flex; flex-direction: column; gap: 3px;
}

/* The wordmark, final (20 Sep 2026): STEVEN ANDREWS in the display face at
   14px / 0.30em, CABINETMAKERS beneath at 8.5px / 0.36em in the UI face. Text,
   never an image. */
.logo-name {
  font-family: var(--f-display);
  font-size: 14px; font-weight: 400;
  color: var(--t-dark);
  letter-spacing: 0.30em;
  text-transform: uppercase;
  line-height: 1; white-space: nowrap;
}

.logo-tag {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 400;
  color: var(--t-sub);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  line-height: 1;
}

.header-right {
  display: flex; align-items: center; gap: 24px;
}

.hdr-nav {
  color: var(--t-inv-2);
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: color 0.2s;
  text-decoration: none;
  min-height: 44px;   /* a 44 px target with a mouse too (§70.3 items 3 and 6: "How it works" is on the plan now) */
}

.hdr-nav:hover { color: var(--t-dark); }
.hdr-nav:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.hdr-nav svg { width: 12px; height: 12px; }

.basket-btn {
  display: flex; align-items: center; gap: 8px;
  background: transparent;
  border: 1px solid var(--b-dark);
  padding: 6px 14px;
  cursor: pointer;
  color: var(--t-inv-2);
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.2s;
  position: relative;
}

.basket-btn:hover { border-color: var(--gold-line); color: var(--gold-2); }

.basket-count {
  position: absolute; top: -8px; right: -8px;
  background: var(--ink); color: var(--paper);
  font-family: var(--f-mono);
  font-size: 12px; font-weight: 500;
  min-width: 20px; height: 20px;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ─────────────────────────────────────────────────────
   VIEWER TOOLBAR BUTTONS  (de-inlined from index.html)
   ───────────────────────────────────────────────────── */
.vtbtn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 1px solid var(--b-dark); border-radius: var(--r);
  padding: 5px 8px; cursor: pointer;
  font-family: var(--f-ui); font-size: 12px; font-weight: 600;
  line-height: 14px; white-space: nowrap;   /* the line it had at 10 px (× 1.4): the 3D's bar keeps its height */
  letter-spacing: 0.04em; color: var(--t-dark);
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.vtbtn:hover { border-color: var(--gold-line); color: var(--gold-2); }
.vtbtn.secondary { color: var(--t-sub); font-weight: 500; }
.vtbtn.accent { border-color: var(--gold); color: var(--ink); background: var(--gold-pale); }
.vtbtn.accent:hover { color: var(--t-dark); border-color: var(--gold); }
.vtbtn[disabled], .vtbtn.is-disabled { opacity: 0.5; cursor: not-allowed; }

/* ─────────────────────────────────────────────────────
   SCREENS
   ───────────────────────────────────────────────────── */

.screen { display: none; min-height: calc(100vh - 64px); }
.screen.active { display: block; }

/* ─────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 12px 28px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-gold {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }

.btn-outline-gold {
  background: transparent;
  color: var(--t-dark);
  border-color: var(--gold-line);
}
.btn-outline-gold:hover { background: var(--gold-pale); border-color: var(--gold-2); }

.btn-ink {
  background: var(--ink-3);
  color: var(--t-inv);
  border-color: var(--ink-3);
}
.btn-ink:hover { background: var(--ink-4); }

.btn-outline-ink {
  background: transparent;
  color: var(--t-dark);
  border-color: var(--cream-4);
}
.btn-outline-ink:hover { border-color: var(--t-mid); }

.btn-outline-cream {
  background: transparent;
  color: var(--t-inv-2);
  border-color: var(--b-dark);
}
.btn-outline-cream:hover { border-color: var(--gold-line); color: var(--gold-2); }

.btn-ghost {
  background: transparent;
  color: var(--t-sub);
  border-color: var(--b-faint);
}
.btn-ghost:hover { border-color: var(--b-light); color: var(--t-mid); }

.btn-warn {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}
.btn-warn:hover { background: #9A5200; }

.btn-sm  { padding: 7px 18px; font-size: 12px; letter-spacing: 0.06em; }
.btn-lg  { padding: 15px 36px; font-size: 12px; }
.btn-xl  { padding: 17px 44px; font-size: 13px; letter-spacing: 0.18em; }
.btn-full { width: 100%; }

/* ─────────────────────────────────────────────────────
   FORM ELEMENTS
   ───────────────────────────────────────────────────── */

.field-group { margin-bottom: 16px; }

.field-label {
  display: block;
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--t-sub);
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--b-light);
  background: white;
  font-family: var(--f-ui);
  font-size: 14px; font-weight: 300;
  color: var(--t-dark);
  transition: border-color 0.2s;
  outline: none;
}

.field-input:focus { border-color: var(--gold); }

textarea.field-input { min-height: 110px; resize: vertical; }

select.field-input { cursor: pointer; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ─────────────────────────────────────────────────────
   SLIDERS
   ───────────────────────────────────────────────────── */

.slider-wrap { margin-bottom: 18px; }

.slider-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}


.slider-lbl-dark {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--t-sub);
}
.niche-count-btn {
  flex: 1;
  padding: 6px 8px;
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: transparent;
  color: var(--t-sub);
  border: 1px solid var(--b-dark);
  cursor: pointer;
  transition: all 0.15s;
}
.niche-count-btn:hover { color: var(--t-dark); border-color: var(--gold); }
.niche-count-btn.active { background: var(--gold); color: white; border-color: var(--gold); }

.slider-value {
  font-family: var(--f-mono);
  font-size: 20px; font-weight: 400;
  color: var(--t-dark);
  line-height: 1;
}

.slider-value-dark {
  font-family: var(--f-mono);
  font-size: 20px; font-weight: 400;
  color: var(--ink-3);
  line-height: 1;
}


input[type=range] {
  width: 100%; height: 2px;
  -webkit-appearance: none; appearance: none;
  background: var(--b-dark);
  outline: none; border: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: var(--ink);
  border: 2px solid var(--paper);
  border-radius: 50%;
  cursor: pointer;
}

input[type=range]:focus::-webkit-slider-thumb { background: var(--ink-4); }


/* ─────────────────────────────────────────────────────
   BADGES
   ───────────────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  line-height: 12.39px;   /* the line it had at 8 px (× 1.55 lays out as 12.39): the price row keeps its height to the hundredth, and the 3D its frame */
  text-transform: uppercase;
  border-radius: var(--r);
}

.badge-std     { background: rgba(42,96,68,0.12); color: #2A6044; border: 1px solid rgba(42,96,68,0.22); }
.badge-spec    { background: rgba(136,72,0,0.10); color: #884800; border: 1px solid rgba(136,72,0,0.22); }
.badge-bespoke { background: rgba(80,42,120,0.10); color: #502A78; border: 1px solid rgba(80,42,120,0.22); }

/* ─────────────────────────────────────────────────────
   TOGGLES & QTY
   ───────────────────────────────────────────────────── */

.toggle {
  width: 40px; height: 22px;
  background: var(--cream-4);
  border-radius: var(--r);   /* squared, per Hewn Light — no pills */
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle.on { background: var(--gold); }
/* Phase 18 Stop 2: the cabinet dialog's switches are <button role="switch"> —
   the browser's button chrome comes off, the look above stays. */
button.toggle { border: 0; padding: 0; font: inherit; }

.toggle::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: left 0.2s;
}

.toggle.on::after { left: 21px; }
/* Phase 11: a panel the RULE fitted (exposed in-frame end) — on, and locked. */
.toggle.derived { cursor: not-allowed; box-shadow: inset 0 0 0 2px var(--gold-dim); }
.toggle.derived::after { background: var(--cream); }

.qty-ctrl {
  display: flex; align-items: center; gap: 6px;
}

.qty-btn {
  width: 26px; height: 26px;
  border: 1px solid var(--b-light);
  background: white;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--t-mid);
  transition: all 0.15s;
  font-family: var(--f-ui);
}
.qty-btn:hover { border-color: var(--gold); color: var(--gold); }

.qty-val {
  min-width: 28px; text-align: center;
  font-family: var(--f-mono);
  font-size: 18px; color: var(--t-dark);
}

/* ─────────────────────────────────────────────────────
   CARD
   ───────────────────────────────────────────────────── */

.card {
  background: white;
  border: 1px solid var(--b-faint);
  padding: 22px;
}

.card-cream {
  background: var(--cream);
  border: 1px solid var(--b-faint);
  padding: 22px;
}

/* Gold divider */
.gold-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line) 30%, var(--gold-line) 70%, transparent);
  margin: 20px 0;
}

.divider {
  height: 1px;
  background: var(--b-faint);
  margin: 14px 0;
}

/* Section heading */
.sec-hd {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--t-sub);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--b-faint);
  margin-bottom: 14px;
}

/* ── Accordion sections (Feature #3 — one open at a time) ─────────────────── */
/* Options panel section titles (Phase 16 Commit T, §44.4 R5): Newsreader 500
   in sentence case — a heading for a group of options, not a field label. The
   canvas set them 18px against a 14px body; the panel's body runs 11–12px, so
   12 × 18/14 ≈ 15px keeps the ratio at the panel's own scale. */
.opts-panel .sec-hd, .opts-panel .spec-hd {
  font-family: var(--f-head);
  font-size: 15px; font-weight: 500;
  letter-spacing: 0; text-transform: none;
  line-height: 1.25;
}
.sec-acc .sec-hd {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none; margin-bottom: 0;
  transition: color 0.15s;
}
.sec-acc .sec-hd:hover { color: var(--t-mid); }
.sec-acc.sec-open .sec-hd { color: var(--t-dark); border-bottom-color: var(--gold-line); }
.sec-acc .sec-hd:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.sec-chv {
  flex-shrink: 0; width: 10px; height: 6px; color: var(--t-faint);
  transition: transform 0.2s ease; margin-left: 10px;
}
.sec-acc.sec-open .sec-chv { transform: rotate(180deg); color: var(--t-sub); }
.sec-body {
  max-height: 0; overflow: hidden; opacity: 0; padding-top: 0;
  transition: max-height 0.22s ease, opacity 0.15s ease, padding-top 0.22s ease;
}
.sec-acc.sec-open .sec-body { max-height: 2600px; opacity: 1; padding-top: 14px; }
@media (prefers-reduced-motion: reduce) { .sec-body, .sec-chv { transition: none; } }

.sec-hd-inv {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--t-inv-3);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--b-dark);
  margin-bottom: 14px;
}

/* ═══════════════════════════════════════════════════════
   SCREEN 1: THE OPENING SCREEN — css/opening.css (Stop 47: the materials;
   the dark hero over the project photograph went with it)
   ═══════════════════════════════════════════════════════ */

/* (A link-styled span: the basket's "Or start straight into a kitchen".) */
.hero-enquiry-link {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 300;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--t-inv-3);
  cursor: pointer;
  transition: color 0.2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.hero-enquiry-link:hover { color: var(--t-inv); }
/* The ask before a new design clears a saved one (§70.3 item 4). */
dialog.sab-ask { margin: auto; width: min(440px, calc(100vw - 32px)); max-width: none; padding: 28px 28px 24px;   /* margin: auto centres it (the page's reset zeroes a dialog's own) */ box-sizing: border-box; background: var(--paper); color: var(--t-dark);
  border: 1px solid var(--b-light); border-top: 2px solid var(--gold); border-radius: var(--r3); font-family: var(--f-ui); }
dialog.sab-ask::backdrop { background: rgba(20,17,11,0.45); }
.sab-ask-title { font-family: var(--f-head); font-weight: 400; font-size: 26px; line-height: 1.2; margin: 0 0 10px; color: var(--t-dark); }
.sab-ask-body { font-size: 14px; line-height: 1.55; color: var(--t-mid); margin: 0 0 22px; }
.sab-ask-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.sab-ask-btns .btn { min-height: 44px; padding: 0 18px; }   /* the two answers side by side in its 440 px */
.sab-ask-btns .btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Stop 42 (§128.1): the welcome on Build your room — the ask's dialog, 760 wide, the demo's
   card across its top (ink, the poster sketch, the gold play), the words under it (help.js). */
dialog.sab-ask.sab-welcome { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 0; }
.sab-demo { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 19 / 10; max-height: 400px; background: var(--ink-3); overflow: hidden; }
.sab-demo-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }   /* (the film's poster on ink, dimmed as the mockup's: the play button and the caption read over it) */
.sab-demo-play { position: absolute; width: 88px; height: 88px; border-radius: 50%; border: 0; background: var(--gold); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sab-demo-play[aria-disabled="true"], .sab-ask-btns .btn[data-demo-play][aria-disabled="true"] { opacity: 0.55; cursor: default; }
.sab-demo-play:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.sab-demo-cap { position: absolute; left: 16px; bottom: 14px; font-family: var(--f-mono); font-size: 12px; color: var(--paper); }
.sab-demo.is-playing > :not(video) { display: none; }
.sab-demo-video { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--ink); }
.sab-welcome-in { padding: 22px 26px 24px; }
.sab-welcome .sab-ask-title { font-size: 28px; }
@media (max-width: 480px) {
  .sab-demo-play { width: 64px; height: 64px; }
  .sab-welcome-in { padding: 18px 16px 16px; }
  .sab-welcome .sab-ask-btns .btn { flex: 1 1 100%; }
}
/* ═══════════════════════════════════════════════════════
   SCREEN 2: ROOM PLANNER
   ═══════════════════════════════════════════════════════ */

#s-room { display: none; }
#s-room.active { display: grid; grid-template-columns: 280px 1fr; height: calc(100vh - 64px); }

.room-sidebar {
  background: var(--cream);
  border-right: 1px solid var(--b-faint);
  padding: 20px;
  display: flex; flex-direction: column; gap: 20px;
  overflow-y: auto;
  /* Lighten the whole planner panel (Steve): redefine the inverted (light-on-dark)
     tokens to dark-on-light WITHIN this scope, so every child — including the inline
     styles using the --t-inv family, --b-dark and --ink-3 — reads on the cream
     background. (Never write a star-slash inside this comment: "--t-inv*" followed
     by "/" once closed it early and swallowed the --t-inv line below, so the
     planner's --t-inv stayed white until §66.2 item 1.) */
  --t-inv:   var(--t-dark);
  --t-inv-2: var(--t-mid);
  --t-inv-3: var(--t-sub);
  --b-dark:  var(--b-light);
  --ink-2:   var(--cream-2);
  --ink-3:   #ffffff;
}
.room-sidebar .pal-item { background: var(--paper); border-color: var(--b-light); }

/* Phase 16 Part B (§44.7 item 8) — the panels around the plan take Commit T's
   type. Scoped to the planner screen (#s-room) so they outrank the base
   rules above them, as the ?plan=v2 flag class did at Stop 1. Newsreader
   for titles (the first heading of each panel section; the in-panel group
   labels stay Inter), Inter for controls, Chivo Mono for every figure;
   hairlines, no interface shadows, radii ≤ 4px, gold only on the selected
   unit and the primary action. Type and colour only — the layout is 17–18's. */
:is(#s-room, #jr-panel) .room-sidebar .sec-hd-inv:first-child,
#s-room .rp-cab-popover .sec-hd-inv:first-child {
  font-family: var(--f-head); font-size: 15px; font-weight: 500;
  letter-spacing: 0; text-transform: none; line-height: 1.25; color: var(--t-dark);
}
:is(#s-room, #jr-panel) .room-sidebar .sec-hd-inv:not(:first-child) { letter-spacing: 0.12em; }
:is(#s-room, #jr-panel) .room-sidebar button,
#s-room .rp-cab-popover button,
:is(#s-room, #jr-panel) .room-sidebar select,
:is(#s-room, #jr-panel) .room-sidebar input { border-radius: var(--r) !important; font-family: var(--f-ui); }
:is(#s-room, #jr-panel) .room-sidebar input[type=number] { font-family: var(--f-mono); }
:is(#s-room, #jr-panel) .pal-item { border: 1px solid var(--b-faint); background: var(--paper); }
:is(#s-room, #jr-panel) .pal-item:hover { border-color: var(--b-light); background: var(--cream-2); }
#s-room .room-sel-bar { background: var(--paper); border: 0; border-bottom: 1px solid var(--b-faint); }
#s-room .room-sel-bar .sel-lbl { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--t-mid); }
#s-room .room-rot-btn { background: transparent; border-color: var(--b-light); color: var(--t-mid); }
#s-room .room-del-btn { background: transparent; }
#s-room .room-del-btn:hover { background: rgba(122,30,30,.22); }   /* the base hover, which the #s-room scope would otherwise outrank */
#s-room .rp-cab-popover { border-color: var(--b-light); border-radius: var(--r); }

/* Phase 19 Stop 3b (§66.2 item 1) — the selected fixture's controls (door,
   window, column, beam, wall step), on the desktop panel and in the 900 px
   sheet alike. They were built for the old dark panel and came out white on
   cream; now: ink on cream, an unselected choice a --b-light hairline with
   --t-mid text on paper, the selected one gold with ink text (aria-pressed),
   every value in Chivo Mono, 44 px targets, no text under 12 px, and Remove
   in the error red. */
:is(#s-room, #jr-panel) .rp-fx { color: var(--t-dark); }
:is(#s-room, #jr-panel) .rp-fx-row { margin-bottom: 12px; }
:is(#s-room, #jr-panel) .rp-fx-lbl {
  display: block; font-family: var(--f-ui); font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--t-dark);
}
:is(#s-room, #jr-panel) .rp-fx-row > .rp-fx-lbl { margin-bottom: 6px; }
:is(#s-room, #jr-panel) .rp-fx-segs { display: flex; flex-wrap: wrap; gap: 6px; }
:is(#s-room, #jr-panel) [data-door-row="panels"] .rp-fx-segs { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); }   /* the counts in even columns, never one stretched alone */
:is(#s-room, #jr-panel) .rp-fx-seg, :is(#s-room, #jr-panel) .rp-fx-btn {
  flex: 1 1 auto; min-width: 44px; min-height: 44px; box-sizing: border-box; padding: 6px 10px;
  border: 1px solid var(--b-light); background: var(--paper); color: var(--t-mid);
  font-family: var(--f-ui); font-size: 12px; font-weight: 600; line-height: 1.2; cursor: pointer;
}
:is(#s-room, #jr-panel) .rp-fx-btn { display: block; width: 100%; margin-bottom: 8px; }
:is(#s-room, #jr-panel) .rp-fx-seg:hover, :is(#s-room, #jr-panel) .rp-fx-btn:hover { border-color: var(--gold); color: var(--t-dark); }
:is(#s-room, #jr-panel) .rp-fx-seg[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
:is(#s-room, #jr-panel) .rp-fx-remove {
  display: block; width: 100%; min-height: 44px; box-sizing: border-box; padding: 6px 10px;
  border: 1px solid var(--error); background: transparent; color: var(--error);
  font-family: var(--f-ui); font-size: 12px; font-weight: 600; cursor: pointer;
}
:is(#s-room, #jr-panel) .rp-fx-remove:hover { background: rgba(122,30,30,0.08); }
:is(#s-room, #jr-panel) .rp-fx-msg { font-family: var(--f-ui); font-size: 12px; line-height: 1.4; color: var(--error); margin: 0 0 8px; }
:is(#s-room, #jr-panel) .rp-fx-msg:empty { margin: 0; }
/* Stop 55 L11: what an External / Internal wall does with its openings, under the choice. */
:is(#s-room, #jr-panel) .rp-fx-note { font-family: var(--f-ui); font-size: 12px; line-height: 1.4; color: var(--t-sub); margin: -6px 0 10px; }
/* §97.3 item 3: every figure a number box, two to a row (a window has four);
   each box at the foot of its column, whatever its label's lines. */
:is(#s-room, #jr-panel) .rp-fx-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
:is(#s-room, #jr-panel) .rp-fx-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
:is(#s-room, #jr-panel) .rp-fx-field .rp-fx-numwrap { margin-top: auto; }
:is(#s-room, #jr-panel) .rp-fx-numwrap { position: relative; display: flex; align-items: center; }
:is(#s-room, #jr-panel) .rp-fx-num {
  width: 100%; min-height: 44px; box-sizing: border-box; padding: 8px 26px 8px 8px;
  border: 1px solid var(--b-light); background: var(--paper); color: var(--t-dark);
  font-family: var(--f-mono); font-size: 13px; -moz-appearance: textfield; appearance: textfield;
}
/* Three fields share the 240 px panel: the spin arrows (too small to tap)
   would take the room a four-figure value needs. The arrow keys still step. */
:is(#s-room, #jr-panel) .rp-fx-num::-webkit-inner-spin-button, :is(#s-room, #jr-panel) .rp-fx-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
:is(#s-room, #jr-panel) .rp-fx-unit { position: absolute; right: 8px; font-family: var(--f-mono); font-size: 12px; color: var(--t-mid); pointer-events: none; }
:is(#s-room, #jr-panel) .rp-fx-seg:focus-visible, :is(#s-room, #jr-panel) .rp-fx-btn:focus-visible, :is(#s-room, #jr-panel) .rp-fx-remove:focus-visible,
:is(#s-room, #jr-panel) .rp-fx-num:focus-visible, :is(#s-room, #jr-panel) .rp-fx input[type=range]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* A cabinet's width, depth and height typed in its edit box (Stop 52 item 7), beside the slider: 36 px with a mouse,
   44 px to a finger (phones: 16 px text, the rule under Stop 51 item 1). */
.rp-size-num { width: 76px; min-height: 36px; box-sizing: border-box; padding: 4px 8px; border: 1px solid var(--b-dark, #2A2620); border-radius: 6px;
  background: transparent; color: inherit; font-family: var(--f-mono); font-size: 14px; font-weight: 600; text-align: right; -moz-appearance: textfield; appearance: textfield; }
.rp-size-num::-webkit-inner-spin-button, .rp-size-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rp-size-num:focus-visible { outline: 2px solid var(--gold, #B08D3C); outline-offset: 1px; }
@media (pointer: coarse) { .rp-size-num { min-height: 44px; } }


/* ─────────────────────────────────────────────────────
   ROOM PLANNER v2 — drag-and-drop
   ───────────────────────────────────────────────────── */

.cabinet-palette {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 5px; margin-bottom: 10px;
}
.pal-item {
  background: rgba(247,243,236,0.05);
  border: 1px dashed rgba(196,154,42,0.28);
  border-radius: var(--r); padding: 6px 5px;
  cursor: pointer; text-align: center;
  transition: all 0.15s;
}
.pal-item:hover { background: rgba(196,154,42,.12); border-style: solid; }
/* (The tiles' pictures and labels are set at the end of the file — Phase 20
   Stop 5: .cab-tile, .fix-tile. The old .pal-item-lbl capitals went there.) */

.room-sel-bar {
  background: rgba(196,154,42,.08);
  border: 1px solid var(--b-dark);
  padding: 7px 10px;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; min-height: 36px;
}
.room-sel-bar .sel-lbl {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 700; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--t-sub); flex: 1;
}
.room-del-btn {
  background: rgba(122,30,30,.12); border: 1px solid rgba(122,30,30,.3);
  color: #C44; padding: 2px 10px;
  border-radius: var(--r); cursor: pointer;
  font-family: var(--f-ui); font-size: 12px; font-weight: 700;
}
.room-del-btn:hover { background: rgba(122,30,30,.22); }
.room-rot-btn {
  background: rgba(196,154,42,.12); border: 1px solid var(--b-dark);
  color: var(--t-mid); font-size: 12px; padding: 2px 8px;
  border-radius: var(--r); cursor: pointer;
  font-family: var(--f-ui); font-weight: 700;
}
#rp-undo-btn:disabled { opacity: 0.45; cursor: default; }
/* A selected wall's splits (§69.3 item 2): each with its Merge. */
.rp-split-btn { margin-top: 6px; }
.rp-splits { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.rp-split-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--t-dark); }
:is(#s-room, #jr-panel) .rp-split-row .rp-fx-btn { width: auto; flex: 0 0 auto; margin: 0; }
.room-canvas-wrap {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; background: var(--cream-2);
  position: relative;   /* anchor for the floating cabinet edit popover */
}

/* Floating contextual cabinet editor — anchored over the selected cabinet (R4-4) */
.rp-cab-popover {
  position: absolute;
  z-index: 30;
  width: 184px;
  background: rgba(252,251,248,0.80);     /* more translucent so the drawing reads through */
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  border: 1px solid var(--gold-line, var(--b-light));
  border-radius: var(--r3);
  padding: 9px 10px;
  font-size: 12px;
  /* JS (rpPositionCabPopover) sets left/top directly — it sits at 45° off a cabinet
     corner toward the quadrant with the most free canvas, so no transform/arrow. */
  transform: none;
  --t-inv:   var(--t-dark);
  --t-inv-2: var(--t-mid);
  --t-inv-3: var(--t-sub);
  --b-dark:  var(--b-light);
  --ink-2:   var(--cream-2);
  --ink-3:   #ffffff;
}
.rp-cab-popover .sec-hd-inv { color: var(--t-mid); margin-bottom: 2px; }
/* Stop 41 (§127.3): the appliance pop-up — type, size and hinge side asked before the
   cabinet is placed (appliance-ask.js). A centred modal, ink on paper, 44 px targets
   for a finger. And the install note (§128.3): a pill at the top, dismissed with OK.
   Its classes are its own (sab-appask-*): the landing's "Start a new design?" dialog is
   the sab-ask above, 440 wide, and must not take this one's 360. */
dialog.sab-appask { position: fixed; inset: 0; margin: auto; width: 360px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow: auto; padding: 0; border: 1px solid var(--gold-line); border-radius: var(--r3); background: var(--paper); color: var(--t-dark); font-family: var(--f-ui); box-shadow: 0 12px 40px rgba(20,17,11,0.25); }
dialog.sab-appask::backdrop { background: rgba(20, 17, 11, 0.3); }
.sab-appask-form { display: flex; flex-direction: column; gap: 12px; padding: 20px 20px 16px; }
.sab-appask-title { margin: 0; font-family: var(--f-head); font-size: 20px; font-weight: 500; }
.sab-appask-sub-title { margin: -6px 0 0; font-size: 12px; line-height: 1.45; color: var(--t-sub); }
.sab-appask-row { display: flex; flex-direction: column; gap: 6px; }
.sab-appask-lbl { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--t-dark); }
.sab-appask-note { font-size: 12px; line-height: 1.4; color: var(--t-sub); }
.sab-appask-segs { display: flex; flex-wrap: wrap; gap: 6px; }
.sab-appask-seg { flex: 1 1 auto; min-width: 44px; min-height: 44px; box-sizing: border-box; padding: 6px 10px; border: 1px solid var(--b-light); background: var(--paper); color: var(--t-mid); font-family: var(--f-ui); font-size: 12px; font-weight: 600; line-height: 1.2; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.sab-appask-seg .sab-appask-sub { font-weight: 400; font-size: 12px; }   /* (12 px: the type pass's floor) */
.sab-appask-seg:hover { border-color: var(--gold); color: var(--t-dark); }
.sab-appask-seg[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.sab-appask-numwrap { position: relative; display: flex; align-items: center; }
.sab-appask-num { width: 100%; min-height: 44px; box-sizing: border-box; padding: 8px 36px 8px 10px; border: 1px solid var(--b-light); background: var(--paper); color: var(--t-dark); font-family: var(--f-mono); font-size: 14px; }
.sab-appask-unit { position: absolute; right: 10px; font-family: var(--f-mono); font-size: 12px; color: var(--t-mid); pointer-events: none; }
.sab-appask-select { width: 100%; min-height: 44px; padding: 7px 9px; border-radius: var(--r); border: 1px solid var(--b-light); background: #fff; color: var(--t-dark); font-size: 13px; font-family: inherit; }
.sab-appask-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.sab-appask-btns .btn { min-height: 44px; }
.sab-appask-seg:focus-visible, .sab-appask-num:focus-visible, .sab-appask-select:focus-visible, .sab-appask-btns .btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sab-install-note { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1250; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font: 500 13px/1.35 var(--f-ui); box-shadow: 0 6px 20px rgba(0,0,0,0.25); max-width: min(640px, calc(100vw - 32px)); }
.sab-install-note[hidden] { display: none; }
.sab-install-note-text { margin: 0; }
.sab-install-note-x { flex: none; min-width: 44px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.4); background: transparent; color: #fff; font: 600 12px var(--f-ui); cursor: pointer; }
.sab-install-note-x:hover { background: rgba(255,255,255,0.14); }
.sab-install-note-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* §69.3 item 0b: the island rear-void question, asked in the controls (it was a
   browser confirm()). Ink on paper, a gold hairline, 44 px answers. */
.rp-rear-ask, .rp-tall-ask { margin: 6px 0 8px; padding: 8px; border: 1px solid var(--gold); border-radius: var(--r);
  background: var(--paper); color: var(--t-dark); font-size: 12px; line-height: 1.45; }
.rp-rear-ask-btns { display: flex; gap: 6px; margin-top: 6px; }
.rp-tall-ask:focus { outline: none; }
.rp-tall-ask:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }   /* the talls' answer takes focus (Stop 44): a ring for a keyboard */
.rp-rear-ask-btns .rp-fx-seg { flex: 1; min-height: 44px; }
#room-canvas {
  flex: 1; width: 100%; min-height: 0;
  cursor: default; display: block;
}

.room-canvas-area {
  background: var(--cream);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative;
  padding: 24px;
}

/* The edge is an inset outline, not a border (§70.3 item 0a): a border took
   2 px from the box the plan is drawn into, so the drawing never met its box. */
#room-canvas {
  outline: 1px solid var(--b-light); outline-offset: -1px;
  background: white;
}


.room-action-bar {
  position: absolute; bottom: 24px; right: 24px;
  display: flex; gap: 10px;
}

/* ═══════════════════════════════════════════════════════
   SCREEN 3: CONFIGURATOR — 3-COLUMN LAYOUT
   ═══════════════════════════════════════════════════════ */

#s-config { display: none; }
#s-config.active {
  display: grid;
  grid-template-columns: 220px 1fr 300px;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* ── Left: Cabinet Type Panel ──────────────────────────── */

.type-panel {
  background: var(--ink-2);
  border-right: 1px solid var(--b-dark);
  overflow-y: auto;
  padding: 16px 14px;
  display: flex; flex-direction: column;
}

/* 12 px, the brand minimum, in sentence case (§76.3 item 0.6; they were 8 px capitals). */
.type-cat-title {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0; text-transform: none;
  color: var(--t-inv-3);
  margin: 14px 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--b-dark);
}

.type-cat-title:first-child { margin-top: 4px; }

.type-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s;
  margin-bottom: 2px;
  color: var(--t-inv-2);
}

.type-btn:hover {
  background: var(--ink-4);
  border-color: var(--b-dark);
  color: var(--t-inv);
}

.type-btn.active {
  background: var(--gold-pale);
  border-color: var(--gold-line);
  color: var(--gold-2);
}

.type-btn.active svg { color: var(--gold); }

/* ─────────────────────────────────────────────────────
   WS-B: FULL-LIGHT CHROME (agreed Hewn Light target, black-on-white)
   Header + left rail move to paper/cream with ink text. Concentrated here so
   it's trivially reviewable/revertible. (The landing was the one dark screen
   until Stop 47; the opening screen is paper too — css/opening.css.)
   ───────────────────────────────────────────────────── */
.header { background: var(--paper); border-bottom: 1px solid var(--b-faint); }
.hdr-nav   { color: var(--t-mid); }
.hdr-nav:hover { color: var(--t-dark); }
.basket-btn { color: var(--t-mid); border-color: var(--b-light); }
.basket-btn:hover { color: var(--gold); border-color: var(--gold-line); }
.type-panel {
  background: var(--cream); border-right: 1px solid var(--b-faint);
  /* Same inverse-token remap as .room-sidebar: children styled with the
     light-on-dark tokens (.sec-hd-inv etc.) must read dark-on-cream here. */
  --t-inv:   var(--t-dark);
  --t-inv-2: var(--t-mid);
  --t-inv-3: var(--t-sub);
  --b-dark:  var(--b-light);
}
.type-cat-title { color: var(--t-sub); }
.type-btn { color: var(--t-mid); }
.type-btn:hover { background: var(--cream-2); border-color: var(--b-light); color: var(--t-dark); }
.type-btn.active { background: var(--gold-pale); border-color: var(--gold-line); color: var(--t-dark); }

.type-btn-lbl {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 400;
  line-height: 1.3;
}

/* ── The drawn thumbnails in the type panel (cab-thumbs.js, §74.3) ── */
.type-btn .cab-thumb {
  width: 52px; height: auto; flex-shrink: 0; display: block;
  margin: -6px 0;   /* the 40 px drawing sits in the row without growing it */
  pointer-events: none;
}
.type-panel .type-btn[draggable="true"] { cursor: grab; }
/* Drag-to-add (#8b): gold dashed affordance while a type is dragged over the viewer */
#three-container.sab-drop-active { outline: 2px dashed var(--gold); outline-offset: -6px; }

/* ── Centre: Viewer ─────────────────────────────────────── */

.viewer {
  display: flex; flex-direction: column;
  background: var(--cream-2);
  overflow: hidden;
}

.viewer-tabs {
  display: flex;
  background: var(--cream);
  border-bottom: 1px solid var(--b-light);
  padding: 0 16px;
  flex-shrink: 0;
}


.viewer-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.vpane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.vpane.active { display: flex; }

#three-container {
  flex: 1;
  width: 100%;
  min-height: 220px;
  cursor: grab;
  position: relative;
  background: #F8F5F0;
}
#three-container:active { cursor: grabbing; }
/* The browser took the 3D away (a phone short of memory — Stop 77a): one button over the pane brings it back. */
.three-paused { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 24px; border: 0;
  background: rgba(244, 239, 230, 0.94); color: var(--ink); font-family: var(--f-ui); font-size: 16px; font-weight: 600; line-height: 1.4; text-align: center; cursor: pointer; }
.three-paused:focus-visible { outline: 2px solid var(--ink); outline-offset: -6px; }

.viewer-hint {
  background: var(--cream);
  border-top: 1px solid var(--b-faint);
  padding: 7px 16px;
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 400;
  line-height: 17.05px;   /* the line it had at 11 px (× 1.55): the hints keep their height */
  color: var(--t-sub);
  text-align: center;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}

.viewer-hint span { display: flex; align-items: center; gap: 4px; }

/* 2D Drawing pane */
.drawing-pane {
  flex: 1;
  min-height: 0;            /* allow the flex item to shrink below its content so
                              overflow:auto actually scrolls instead of the tall
                              drawing overflowing the overflow:hidden viewer-body
                              and being clipped with no way to reach it (round-7) */
  display: flex; flex-direction: column;
  padding: 12px 14px;
  gap: 10px;
  overflow: auto;
  background: var(--cream);
}

.drawing-notice {
  background: rgba(136,72,0,0.06);
  border: 1px solid rgba(136,72,0,0.18);
  padding: 7px 12px;
  font-size: 12px; font-weight: 400;
  line-height: 17.05px;   /* the line it had at 11 px (× 1.55): the sheet under it stands where it stood */
  color: var(--warning);
  font-family: var(--f-ui);
  flex-shrink: 0;
}

.drawing-views {
  /* round-4: one full-width run sheet (elevation above plan) instead of the old
     two-up grid — the sheet spans the whole pane so it scales to fit, not cropped. */
  display: flex; flex-direction: column;
  gap: 8px;
  flex: 1;
}

.drawing-view {
  display: flex; flex-direction: column;
  gap: 3px;
  font-family: var(--f-sheet);   /* the sheet root: its chrome inherits this, its SVG is explicit Arial — one type system on the sheet */
  background: white;
  border: 1px solid var(--b-light);
  padding: 8px;
}

.drawing-view svg { width:100%; height:auto; display:block; }


/* ── CTA Bar (bottom of viewer) ─────────────────────────── */

.cta-bar {
  background: var(--cream);
  border-top: 1px solid var(--b-light);
  padding: 14px 20px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 14px;
  flex-shrink: 0;
}

.cta-left { display: flex; flex-direction: column; gap: 4px; }

.cta-route {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--t-sub);
  display: flex; align-items: center; gap: 8px;
}

.cta-price-row { display: flex; align-items: baseline; gap: 8px; }

.cta-price {
  font-family: var(--f-mono);
  font-size: 32px; font-weight: 500;
  color: var(--gold-text);
  line-height: 1;
}

.cta-price-note {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 400;
  line-height: 17.05px;   /* as it was at 11 px: the price row keeps its height */
  color: var(--t-sub);
}
/* The Trade badge beside a trade member's name in the header (trade-ready item 2; member.js). */
.hdr-badge { display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 6px; border: 1px solid var(--gold); border-radius: 2px; font-family: var(--f-ui); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-mid); line-height: 1.4; }
.hdr-badge[hidden] { display: none; }
/* What the price includes (trade-ready item 4): one line under the price, opened from "What's included". */
.cta-incl { font-family: var(--f-ui); font-size: 12px; line-height: 1.45; color: var(--t-sub); padding: 0 24px 8px; margin-top: -4px; background: var(--paper); }
.cta-incl[hidden] { display: none; }
.cta-incl summary { cursor: pointer; display: inline-block; min-height: 24px; text-decoration: underline; text-underline-offset: 2px; color: var(--t-mid); }
.cta-incl[open] summary { margin-bottom: 2px; }
@media (max-width: 900px) { .cta-incl { padding: 0 12px 8px; } }
.basket-incl { font-family: var(--f-ui); font-size: 12px; font-weight: 300; line-height: 1.5; color: var(--t-sub); margin: 10px 0 0; }

.cta-btns { display: flex; gap: 10px; align-items: center; }

/* ── Right: Options Panel ───────────────────────────────── */

.opts-panel {
  background: white;
  border-left: 1px solid var(--b-light);
  overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 20px;
}

/* Material swatches — PREMIUM */
.mat-route-hdr {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--t-faint);
  margin: 8px 0 4px;
}

.mat-card {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 3px;
  background: transparent;
}

.mat-card:hover {
  background: var(--cream);
  border-color: var(--b-faint);
}

.mat-card.active {
  background: rgba(196,154,42,0.06);
  border-color: var(--gold-line);
}

.mat-swatch {
  width: 52px; height: 52px;
  flex-shrink: 0;
  border: 1px solid var(--b-light);   /* square sample, hairline frame */
  position: relative;
  overflow: hidden;
}
.mat-card.active .mat-swatch { border-color: var(--gold); }   /* gold hairline = selected */

.mat-info { flex: 1; min-width: 0; }

.mat-name {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 500;
  color: var(--t-dark);
  line-height: 1.3;
  margin-bottom: 2px;
}

.mat-spec {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 400;
  color: var(--t-sub);
  line-height: 1.4;
}

.mat-check {
  width: 14px; height: 14px;
  border: 1px solid var(--b-light);
  border-radius: 0;                 /* squared marker, per Hewn Light */
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  font-size: 12px;
  transition: all 0.15s;
}

.mat-card.active .mat-check {
  background: transparent;          /* gold hairline + gold tick, never a fill */
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Finish + Decor pickers (Shinnoki range / veneer finish) ─────────────── */

.finish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.finish-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--b-faint);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.finish-btn:hover { border-color: var(--gold-line); background: var(--gold-dim); }
.finish-btn.active { border-color: var(--gold); background: var(--gold-pale); }
.finish-btn-name {
  font-family: var(--f-ui); font-size: 12px; font-weight: 500;
  color: var(--t-dark);
}
.finish-btn-sub {
  font-family: var(--f-ui); font-size: 12px; font-weight: 400;
  color: var(--t-sub); line-height: 1.3;
}
.finish-note {
  font-family: var(--f-ui); font-size: 12px; font-weight: 400;
  color: var(--t-sub); margin-top: 5px; line-height: 1.4;
}

.decor-selected-name {
  font-family: var(--f-ui); font-size: 12px; font-weight: 400;
  letter-spacing: 0; text-transform: none; color: var(--t-mid); margin-left: 4px;
}
.decor-collection-hdr {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--t-faint); margin: 8px 0 4px;
}
.decor-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px;
}
.decor-chip {
  position: relative; aspect-ratio: 1 / 1;
  border: 1px solid var(--b-light);
  border-radius: 0; cursor: pointer; overflow: hidden;   /* squared specimen */
  transition: transform 0.12s;
}
.decor-chip:hover { transform: scale(1.06); z-index: 2; }
.decor-chip.active { outline: none; border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }   /* gold hairline = selected */
.decor-chip.active::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* ── Checkout / enquiry feedback banners ─────────────────────────────────── */
.co-error {
  font-family: var(--f-ui); font-size: 12px; font-weight: 300;
  color: #8A2B2B; background: rgba(180,60,60,0.08);
  border: 1px solid rgba(180,60,60,0.28);
  padding: 10px 12px; margin-bottom: 12px; line-height: 1.5;
}
.minorder-note {
  font-family: var(--f-ui); font-size: 12px; font-weight: 300;
  color: #884800; background: rgba(136,72,0,0.08);
  border: 1px solid rgba(136,72,0,0.22);
  padding: 10px 12px; margin-bottom: 10px; line-height: 1.5;
}
.deposit-note {
  font-family: var(--f-ui); font-size: 12px; font-weight: 300;
  color: var(--t-mid); background: var(--cream);
  border: 1px solid var(--b-faint); border-left: 2px solid var(--gold);
  padding: 10px 12px; margin-bottom: 10px; line-height: 1.5;
}
.deposit-note strong { font-weight: 600; color: var(--t-dark); }
/* The appliance check before checkout (§128.4, Stop 45): the list, then one tick box the order waits on. */
.appl-check {
  margin: 16px 0; padding: 12px 14px; background: var(--cream);
  border: 1px solid var(--b-faint); border-left: 2px solid var(--gold);
  font-family: var(--f-ui); font-size: 13px; line-height: 1.5; color: var(--t-dark);
}
.appl-check[hidden] { display: none; }
.appl-check-hd { font-weight: 600; margin: 0 0 4px; }
.appl-check-list { margin: 0 0 10px; padding-left: 18px; font-weight: 300; }
.appl-check-row { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 500; }
/* The box: a 44 px target (Stop 48 — the phone pass's floor) that shows the 20 px box it always did, drawn, and
   takes no more room than that (the margins give the rest back). */
.appl-check-row input { -webkit-appearance: none; appearance: none; width: 44px; height: 44px; margin: -10px -12px -12px -12px; flex-shrink: 0; cursor: pointer;
  border: 0; border-radius: 0; background: center / 20px 20px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='.75' y='.75' width='18.5' height='18.5' rx='2' fill='%23FFFFFF' stroke='%2314110B' stroke-width='1.5'/%3E%3C/svg%3E"); }
.appl-check-row input:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='.75' y='.75' width='18.5' height='18.5' rx='2' fill='%2314110B' stroke='%2314110B' stroke-width='1.5'/%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.appl-check-row input:focus-visible { outline: 2px solid var(--ink); outline-offset: -10px; }
.appl-check-need { margin: 6px 0 0; font-size: 12px; font-weight: 300; color: #884800; }
.appl-check-need[hidden] { display: none; }
#basket-actions [data-order-btn]:disabled { opacity: .5; cursor: not-allowed; }   /* (waiting on the tick: as the basket's other off button reads) */
/* The technical drawing from the basket and the checkout (Stop 48 item 3); the tick is an .appl-check. */
.drw-open { margin: 16px 0 4px; }
.drw-open[hidden] { display: none; }
.drw-open-note { margin: 6px 0 0; font-family: var(--f-ui); font-size: 12px; font-weight: 300; line-height: 1.5; color: var(--t-sub); }
.drw-check { margin-top: 12px; }
#co-place-btn:disabled { cursor: not-allowed; }
.drawing-return { margin: 0 0 8px; }
.drawing-return[hidden] { display: none; }
/* The title block's fields (trade-ready item 3; title-block.js): a closed line over the sheets, its five boxes when open. */
.stb-form { font-family: var(--f-ui); font-size: 12px; color: var(--t-mid); flex: none; }
.stb-form summary { cursor: pointer; display: inline-block; min-height: 28px; line-height: 28px; font-weight: 600; color: var(--ink); }
.stb-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 12px; padding: 6px 0 2px; }
.stb-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stb-field span { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--t-sub); }
.stb-field input { font: inherit; font-size: 13px; min-height: 36px; padding: 6px 9px; border: 1px solid var(--b-light); border-radius: 3px; background: var(--paper); color: var(--ink); }
.stb-field input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.stb-form-note { margin: 6px 0 0; font-size: 11px; color: var(--t-sub); }
@media print { .stb-form { display: none; } }
/* The privacy notice (Stop 48 item 6): a line under each form that takes details, and the site's footer. */
.form-privacy { margin: 16px 0 0; text-align: center; font-family: var(--f-ui); font-size: 12px; font-weight: 300; line-height: 1.5; color: var(--t-sub); }
.form-privacy a { color: var(--t-dark); text-underline-offset: 2px; }
/* Each a 44 px target on its line (the phone pass's floor: an 18 px line + 13 + 13), the words where they were: the
   padding is given back by the margins; the line stands 16 px under the button above, so the target clears it. */
.form-privacy a, .site-foot a { display: inline-block; white-space: nowrap; padding: 13px 6px; margin: -13px -6px; }
.site-foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 24px; padding: 14px 16px 18px;
  background: var(--paper); border-top: 1px solid var(--b-faint); font-family: var(--f-ui); font-size: 12px; line-height: 1.5; color: var(--t-sub); text-align: center; }   /* (light, on Stop 47's light opening screen) */
.site-foot a { color: var(--t-dark); text-underline-offset: 2px; }
.site-foot a:focus-visible, .form-privacy a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.bespoke-config-line {
  font-family: var(--f-ui); font-size: 12px; font-weight: 300;
  color: var(--t-dark); line-height: 1.7;
}
.bespoke-config-line .bcl-k { color: var(--t-faint); display: inline-block; min-width: 92px; }
.bespoke-why {
  font-family: var(--f-ui); font-size: 12px; font-weight: 400;
  color: #884800; background: rgba(136,72,0,0.07);
  border-left: 2px solid var(--gold); padding: 8px 12px; margin-top: 10px; line-height: 1.5;
}

/* Door styles — LARGER */
.door-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }

.door-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px;
  border: 1px solid var(--b-faint);
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
}

.door-card:hover { border-color: var(--b-light); background: var(--cream); }
.door-card.active { border-color: var(--gold); background: rgba(196,154,42,0.05); }

.door-preview { width: 44px; height: 54px; display: flex; align-items: center; justify-content: center; }

.door-label {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--t-mid); text-align: center;
}

.door-card.active .door-label { color: var(--gold); }

/* Internal options rows */
.opt-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--b-faint);
  gap: 10px;
}

.opt-row:last-child { border-bottom: none; }

.opt-row-body { flex: 1; }

.opt-row-lbl {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 400;
  color: var(--t-dark);
}


/* ═══════════════════════════════════════════════════════
   SCREEN 4: BASKET
   ═══════════════════════════════════════════════════════ */

#s-basket { display: none; }
#s-basket.active { display: block; background: var(--cream); min-height: calc(100vh - 64px); }

.page-wrap { max-width: 920px; margin: 0 auto; padding: 40px 28px; }

.page-hd {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--b-light);
}

.page-title {
  font-family: var(--f-head);
  font-size: 36px; font-weight: 400;
  color: var(--t-dark);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.page-sub {
  font-family: var(--f-ui);
  font-size: 13px; font-weight: 300;
  color: var(--t-sub);
}

.basket-items { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }

.basket-item {
  background: white;
  border: 1px solid var(--b-faint);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
}

.bitem-thumb {
  width: 80px; height: 64px;
  background: var(--cream);
  border: 1px solid var(--b-faint);
  display: flex; align-items: center; justify-content: center;
  color: var(--t-faint);
}
.bitem-thumb .cab-thumb { display: block; width: 100%; height: 100%; }   /* the type's own drawing (§102.3 item 6) */

.bitem-name {
  font-family: var(--f-ui);
  font-size: 16px; font-weight: 500;
  color: var(--t-dark);
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 10px;
}

.bitem-spec {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 300;
  color: var(--t-sub);
  line-height: 1.5;
}

/* A design's line (Stop 51 item 12): its name and one Remove, over its cabinets. */
.basket-design { display: flex; flex-direction: column; gap: 8px; }
.bdesign-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px; }
.bdesign-name { font-family: var(--f-ui); font-size: 16px; font-weight: 500; color: var(--t-dark); letter-spacing: 0.03em; }
.bdesign-n { font-weight: 300; color: var(--t-sub); }
.bdesign-remove { margin-top: 0; }

/* A real button (Phase 20 Stop 7, §77.3 item 0.1): the keyboard reaches it. */
.bitem-remove:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.bitem-remove {
  appearance: none; background: none; border: 0; padding: 0;
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #8A2020;
  cursor: pointer;
  margin-top: 6px;
  display: inline-block;
}

.bitem-price-main {
  font-family: var(--f-mono);
  font-size: 22px; font-weight: 500;
  color: var(--t-dark);
  text-align: right;
  line-height: 1;
}

.bitem-price-note {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 300;
  color: var(--t-sub);
  text-align: right;
  margin-top: 3px;
}

.basket-summary {
  background: white;
  border: 1px solid var(--b-faint);
  padding: 22px 24px;
}

.sum-row {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  font-family: var(--f-ui);
  font-size: 13px; font-weight: 300;
  color: var(--t-mid);
  border-bottom: 1px solid var(--b-faint);
}
/* (Weight 400: the row's own 300 is not a weight Chivo Mono is loaded in — fonts.css
   holds 400 and 500 — so the figure asks for the one it has always been drawn in.
   Phase 20 Stop 9, §81.4 item 3.) */
.sum-row > span:last-child { font-family: var(--f-mono); font-weight: 400; }

.sum-total {
  display: flex; justify-content: space-between;
  padding: 16px 0 6px;
  font-family: var(--f-mono);
  font-size: 24px; font-weight: 400;
  color: var(--t-dark);
  letter-spacing: 0.02em;
}

.basket-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }

.mixed-warning {
  background: rgba(136,72,0,0.06);
  border: 1px solid rgba(136,72,0,0.18);
  padding: 12px 16px;
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 300;
  color: var(--warning);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════
   SCREEN 5: CHECKOUT
   ═══════════════════════════════════════════════════════ */

#s-checkout { display: none; }
#s-checkout.active { display: block; background: var(--cream); }

.checkout-wrap {
  max-width: 1000px; margin: 0 auto;
  padding: 40px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;   /* (minmax: the form never pushes the summary off the screen) */
  gap: 32px;
}
/* At 900 px and below the summary goes under the form, as on a phone (§132 ruling 6a): at 820 the two columns
   needed 948 px and the order form scrolled sideways. */
@media (max-width: 900px) {
  .checkout-wrap { grid-template-columns: minmax(0, 1fr); }
  .order-aside { position: static; }
}

.co-section { margin-bottom: 28px; }

.co-sec-title {
  font-family: var(--f-ui);
  font-size: 18px; font-weight: 500;
  color: var(--t-dark);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
}

.step-n {
  width: 26px; height: 26px;
  border: 1px solid var(--b-dark);
  color: var(--t-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

.payment-mock {
  border: 1px solid var(--b-light);
  padding: 20px;
  background: white;
}

.card-chip {
  width: 32px; height: 24px;
  background: var(--cream-3); border: 1px solid var(--b-light);
  border-radius: var(--r3);
  margin-bottom: 14px;
}

.card-num {
  font-family: var(--f-mono);
  font-size: 17px; letter-spacing: 0.18em;
  color: var(--t-mid); margin-bottom: 10px;
}

.card-row { display: flex; gap: 14px; margin-top: 10px; }
.card-field { flex: 1; }
.card-field-lbl {
  font-size: 9px; color: var(--t-sub);
  font-family: var(--f-ui);
  font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase;
}
.card-field-val {
  font-family: var(--f-mono);
  font-size: 13px; color: var(--t-dark);
  letter-spacing: 0.10em;
  margin-top: 2px;
}

.stripe-note {
  font-family: var(--f-ui);
  font-size: 11px; font-weight: 300;
  color: var(--t-sub);
  display: flex; align-items: center; gap: 5px;
  margin-top: 10px;
}

/* Order aside */
.order-aside { position: sticky; top: 88px; }

.aside-paint { font-family: var(--f-ui); font-size: 12px; font-weight: 300; color: var(--t-sub); padding: 0 0 7px; border-bottom: 1px solid var(--b-faint); }   /* the finish line under an order line (Stop 14) */
.confirm-paint-note { font-family: var(--f-ui); font-size: 12px; color: var(--t-sub); line-height: 1.5; margin: 10px 0 0; }
.aside-item {
  display: flex; justify-content: space-between;
  font-family: var(--f-ui);
  font-size: 13px; font-weight: 300;
  color: var(--t-mid);
  padding: 7px 0;
  border-bottom: 1px solid var(--b-faint);
}

.vat-note {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 300;
  color: var(--t-faint);
  text-align: center;
  margin-top: 10px;
}

/* ═══════════════════════════════════════════════════════
   SCREEN 6: PRICED ENQUIRY
   ═══════════════════════════════════════════════════════ */

#s-enquiry { display: none; }
#s-enquiry.active { display: block; background: var(--cream); }

.enquiry-wrap { max-width: 700px; margin: 0 auto; padding: 40px 28px; }

.enquiry-alert {
  display: flex; gap: 14px;
  padding: 16px 20px;
  margin-bottom: 28px;
}

.alert-spec { background: rgba(136,72,0,0.06); border: 1px solid rgba(136,72,0,0.18); }
.alert-bespoke { background: rgba(80,42,120,0.06); border: 1px solid rgba(80,42,120,0.18); }

.alert-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }

.alert-title {
  font-family: var(--f-ui);
  font-size: 16px; font-weight: 500;
  color: var(--t-dark);
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}

.alert-body {
  font-family: var(--f-ui);
  font-size: 13px; font-weight: 300;
  color: var(--t-sub);
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════
   SCREEN 7: BESPOKE ENQUIRY
   ═══════════════════════════════════════════════════════ */

#s-bespoke { display: none; }
#s-bespoke.active { display: block; }

.bespoke-hero-band {
  background: var(--ink);
  padding: 60px 40px;
  text-align: center;
  position: relative; overflow: hidden;
}

.bespoke-hero-band .gold-rule { width: 80px; margin: 16px auto; }

.bespoke-h2 {
  font-family: var(--f-head);
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 400;
  color: var(--t-inv);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  position: relative; z-index: 1;
}

.bespoke-sub {
  font-family: var(--f-ui);
  font-size: 16px; font-weight: 300;
  color: var(--t-inv-2);
  max-width: 500px; margin: 0 auto;
  line-height: 1.65;
  letter-spacing: 0.04em;
  position: relative; z-index: 1;
}

.bespoke-form { max-width: 700px; margin: 0 auto; padding: 40px 28px; background: var(--cream); }

/* ═══════════════════════════════════════════════════════
   SCREEN 8: CONFIRMATION
   ═══════════════════════════════════════════════════════ */

#s-confirm { display: none; }
#s-confirm.active { display: block; background: var(--cream); }

.confirm-wrap {
  max-width: 580px; margin: 0 auto;
  padding: 70px 28px; text-align: center;
}

.confirm-mark {
  width: 72px; height: 72px;
  margin: 0 auto 24px;
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--success);
}

.confirm-title {
  font-family: var(--f-head);
  font-size: 38px; font-weight: 400;
  color: var(--t-dark);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.confirm-sub {
  font-family: var(--f-ui);
  font-size: 14px; font-weight: 300;
  color: var(--t-sub);
  margin-bottom: 18px;
  line-height: 1.6;
}

.confirm-ref {
  font-family: var(--f-ui);
  font-size: 16px; font-weight: 300;
  letter-spacing: 0.18em;
  background: white;
  border: 1px solid var(--b-light);
  padding: 12px 28px;
  display: inline-block;
  margin-bottom: 36px;
  color: var(--t-dark);
}

.confirm-steps {
  background: white;
  border: 1px solid var(--b-faint);
  padding: 22px;
  text-align: left;
  margin-bottom: 30px;
}

.cs {
  display: flex; gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--b-faint);
}
.cs:last-child { border-bottom: none; }

.cs-n {
  width: 22px; height: 22px;
  border: 1px solid var(--b-dark);
  color: var(--t-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 700;
  flex-shrink: 0; margin-top: 1px;
}

.cs-t {
  font-family: var(--f-ui);
  font-size: 13px; font-weight: 300;
  color: var(--t-dark);
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════ */

.flex    { display: flex; }
.items-c { align-items: center; }
.jc-b    { justify-content: space-between; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.mt-4    { margin-top: 4px; }
.mt-8    { margin-top: 8px; }
.mt-12   { margin-top: 12px; }
.mt-20   { margin-top: 20px; }
.mb-8    { margin-bottom: 8px; }
.mb-16   { margin-bottom: 16px; }
.t-sub   { color: var(--t-sub); }
.t-faint { color: var(--t-faint); }
.t-inv   { color: var(--t-inv); }
.f300    { font-weight: 300; }
.f-sm    { font-size: 12px; }
.ta-c    { text-align: center; }

/* Print styles */
/* (Old print rules removed — printing now renders the dedicated #sab-print-sheet
   only; see the @media print block further down. The old block showed #s-config +
   .vpane, which leaked the live on-screen drawing into the PDF.) */


/* ═══════════════════ RUN BUILDER ═══════════════════ */
#s-run { display:none; flex-direction:column; height:100vh; overflow:hidden; padding:0; }
#s-run.active { display:flex; }
.run-header { padding:18px 28px 14px; border-bottom:1px solid var(--b-dark); flex-shrink:0; display:flex; align-items:flex-end; justify-content:space-between; gap:16px; }
.run-body { flex:1; display:grid; grid-template-columns:264px 1fr; overflow:hidden; min-height:0; }
.run-list-col { background:var(--bg-dark); border-right:1px solid var(--b-dark); display:flex; flex-direction:column; overflow:hidden; }
.run-list-scroll { flex:1; overflow-y:auto; padding:14px 14px 0; }
.run-list-foot { padding:12px 14px; border-top:1px solid var(--b-dark); display:flex; flex-direction:column; gap:7px; }
.run-viewer-col { display:flex; flex-direction:column; overflow:hidden; background:var(--bg-base); }
.run-view-tabs { display:flex; gap:0; border-bottom:1px solid var(--b-dark); flex-shrink:0; }
.run-pane { flex:1; display:none; overflow:auto; }
.run-pane.active { display:flex; align-items:stretch; justify-content:stretch; }
#run-pane-3d { background:var(--bg-base); }
#run-three-container { width:100%; height:100%; min-height:300px; }
.run-drawing-wrap { width:100%; padding:24px 32px; box-sizing:border-box; }
.run-drawing-wrap svg { display:block; width:100%; height:auto; max-height:70vh; }
.run-footer { padding:12px 22px; border-top:1px solid var(--b-dark); display:flex; align-items:center; justify-content:space-between; background:var(--bg-dark); flex-shrink:0; gap:12px; }
.run-footer-btns { display:flex; gap:8px; }
/* Cabinet list items */
.run-cab-item { display:flex; align-items:center; gap:7px; padding:7px 9px; background:var(--bg-base); margin-bottom:5px; border:1px solid var(--b-dark); cursor:pointer; transition:border-color .18s; }
.run-cab-item:hover  { border-color:var(--gold); }
.run-cab-item.active { border-color:var(--gold); background:rgba(196,154,42,.06); }
.run-cab-swatch { width:12px; height:12px; flex-shrink:0; border-radius:var(--r); border:1px solid rgba(255,255,255,.1); }
.run-cab-info { flex:1; min-width:0; }
.run-cab-btns { display:flex; gap:3px; flex-shrink:0; }
/* Quick-add panel */
.run-quickadd { background:var(--bg-mid); border:1px solid var(--b-dark); padding:14px; margin-top:6px; display:none; }
.run-quickadd.open { display:block; }
.run-qa-row { display:flex; gap:6px; margin-bottom:7px; align-items:center; }
/* Exploded view button */
.explode-btn { position:absolute; bottom:44px; right:16px; z-index:10; font-family:var(--f-ui); font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; padding:6px 14px; border:1px solid rgba(196,154,42,.45); background:rgba(0,0,0,.55); color:var(--t-inv); cursor:pointer; transition:all .2s; backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px); }
.explode-btn:hover { background:rgba(196,154,42,.18); border-color:var(--gold); }
.explode-btn[hidden] { display: none; }   /* off the customer's screen (trade-ready P2 item 12) */
.explode-btn.playing { color:#fff; border-color:rgba(255,255,255,.5); }

/* ═══════════════════════════════════════════════════════
   UX POLISH — ANIMATIONS, TRANSITIONS, ACCESSIBILITY
   ═══════════════════════════════════════════════════════ */

/* ── Screen fade transitions ──────────────────────────── */
.screen { animation: none; }
.screen.active { animation: screenFadeIn 0.28s ease; }
@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Viewer tab transition ─────────────────────────────── */
.vpane.active { animation: screenFadeIn 0.18s ease; }
#vpane-3d { position: relative; overflow: hidden; }

/* ── CTA price counter animation ───────────────────────── */
.cta-price { transition: opacity 0.15s ease; }
.cta-price.updating { opacity: 0.3; }
/* Words in the price's place (Stop 18, §101.3 A): "Calculating…" while the
   server is asked, "Price on request" when it has no figure — quiet, smaller. */
.cta-price.quiet { position: relative; }
.cta-price.quiet::before { content: attr(data-ghost); visibility: hidden; }   /* the last figure's room, unseen */
.cta-price .cta-price-words { position: absolute; left: 0; top: 50%; transform: translateY(-50%); white-space: nowrap; font-family: var(--f-ui); font-size: 16px; font-weight: 400; color: var(--t-sub); }
.bitem-calc { font-family: var(--f-ui); font-size: 13px; color: var(--t-sub); }

/* ── Basket button pulse on add ───────────────────────── */
@keyframes basketPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.basket-btn.added { animation: basketPulse 0.4s ease; border-color: var(--gold); color: var(--gold); }

/* ── Slider track fill (gold progress) ─────────────────── */
input[type=range].filled {
  background: linear-gradient(
    to right,
    var(--gold) 0%,
    var(--gold) var(--fill, 50%),
    var(--b-dark) var(--fill, 50%),
    var(--b-dark) 100%
  );
}


/* ── Tooltip system ────────────────────────────────────── */
.tt-wrap { position: relative; display: inline-flex; align-items: center; gap: 4px; }


/* ── Focus rings for keyboard nav ──────────────────────── */
.btn:focus-visible,
.type-btn:focus-visible,
.mat-card:focus-visible,
.door-card:focus-visible,
.door-finish-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
input[type=range]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── WS-F: broadened keyboard focus + touch affordances ──────────────────── */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
[role="radio"]:focus-visible,
[role="option"]:focus-visible,
.vtbtn:focus-visible,
.decor-chip:focus-visible,
.finish-btn:focus-visible,
.door-finish-btn:focus-visible,
.pal-item:focus-visible,
.setup-room-card:focus-visible,
.qty-btn:focus-visible,
.toggle:focus-visible,
#three-container:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.decor-chip:focus-visible { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
/* Tactile feedback on touch (no :hover on touch devices) */
.mat-card:active, .door-card:active, .decor-chip:active, .finish-btn:active, .vtbtn:active { filter: brightness(0.97); }

/* Touch devices (iPad/phone): enlarge tap targets to >=44px, no hover reliance */
@media (hover: none) and (pointer: coarse) {
  .qty-btn { width: 44px; height: 44px; }
  .mat-swatch { width: 60px; height: 60px; }
  .vtbtn { padding: 9px 13px; }
  .decor-chip { min-width: 44px; min-height: 44px; }
  .door-card { min-height: 56px; }
  .hdr-nav { padding-top: 8px; padding-bottom: 8px; }
}

/* ── Type panel active section indicator ──────────────── */
.type-cat-title.has-active {
  color: var(--t-dark);
  border-bottom-color: var(--gold-line);
}

/* ── Mobile / tablet responsive (768px) ──────────────────  */
/* ── Tablet / iPad Pro portrait (769–1120px): the 220/1fr/300 grid squeezes the
   centre column below what the toolbar + CTA bar need. Narrow the side panels
   and let both bars wrap instead of clipping under the options panel. ── */
@media (max-width: 1120px) and (min-width: 769px) {
  #s-config.active { grid-template-columns: 190px 1fr 280px; }
  .type-panel { padding: 12px 10px; }
  .viewer-tabs { flex-wrap: wrap; row-gap: 2px; padding: 0 10px; }
  .vtbtn { padding: 8px 9px; }
  .cta-bar { flex-wrap: wrap; padding: 12px 16px; row-gap: 10px; }
  .cta-left { flex: 1 1 220px; min-width: 200px; }
  .cta-price-note { white-space: nowrap; }
  .cta-btns { flex: 1 1 100%; justify-content: flex-end; }
}

@media (max-width: 768px) {
  .header { padding: 0 16px; height: 56px; }
  :root { --hdr-h: 56px; }   /* the portrait block's rows and drawer measure from it */
  .logo-tag { display: none; }

  /* Config: the ≤768 stack that stood here (rail as a wrapping row, viewer at
     50vh, options at 45vh) is superseded by the 900 px portrait layout at the
     end of this file (Phase 18 Stop 3) — removed so nothing fights it. */

  /* Room: the ≤768 stack that stood here (sidebar at 40vh over the plan) is
     superseded by the 900 px plan layout at the end of this file (Phase 18
     Stop 4) — removed so nothing fights it. */

  /* Run: stack */
  .run-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .run-list-col { max-height: 35vh; }

  /* Basket / checkout */
  .checkout-wrap { grid-template-columns: 1fr; }
  .order-aside { position: static; }
  .basket-item { grid-template-columns: 60px 1fr; }
  .bitem-price-main { display: none; }
}

/* ── Config type panel: active category highlight ───── */
.type-btn.active + .type-cat-title,
.type-cat-title.prev-active-sibling { border-bottom-color: var(--gold-line); }


/* ── The technical-drawing sheet (Phase 16 Part C, §44.8 / §45.3) ────────────
   sheet-v2.js draws it into #drawing-views (the Technical Drawing tab) and,
   for the PDF, into #sab-print-sheet before window.print(). Architectural
   linework: each view is a sheet with its schedule bottom left and its title
   block bottom right. On screen the print host is hidden; when printing we
   hide the whole app and show only it — one view per A3 landscape page (the
   @page rule below). The sheet face stays Arial (--f-sheet). */
#sab-print-sheet { display: none; font-family: var(--f-sheet); }
.sv2-view { font-family: var(--f-sheet); background: #fff; border: 1px solid #14110B; padding: 10px; grid-column: 1 / -1; }
.sv2-draw { border-bottom: 1px solid #14110B; padding-bottom: 8px; }
.sv2-foot { display: flex; gap: 10px; align-items: stretch; padding-top: 8px; }
.sv2-sched { flex: 1; min-width: 0; overflow-x: auto; }
/* A sheet per run face (Stop 71): its drawings side by side (an island's elevations and its plan), wrapping; the key
   plan in the top right corner, the drawings beside it or — when they need the width — under it; the first sheet's
   short schedule in columns, and its sheet list between the schedule and the title block. */
.sv2-draw { display: flow-root; }
.sv2-parts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4mm; }
.sv2-parts > svg { flex: 0 0 auto; }
.sv2-parts.sv2-under { clear: both; }   /* drawings that need the sheet's whole width stand under the key plan (sheet-v2.js, Stop 74) */
.sv2-key { float: right; width: 58mm; margin: 0 0 2mm 3mm; }
#drawing-views .sv2-key { width: 170px; }
.sv2-cols { display: flex; gap: 14px; align-items: flex-start; }
.sv2-cols .ssc { min-width: 0; flex: 1 1 0; }
.sv2-list { flex: 0 0 auto; max-width: 42%; }
.sv2-list .ssc { min-width: 0; }
/* On screen the first sheet's schedule takes the sheet's width, the sheet list and the title block the row under it. */
#drawing-views .sv2-view[data-kind="ov"] .sv2-foot { flex-wrap: wrap; }
#drawing-views .sv2-view[data-kind="ov"] .sv2-sched { flex: 1 1 100%; }
#drawing-views .sv2-list { flex: 1 1 0; max-width: none; min-width: 0; overflow-x: auto; }
.ssc td.ssc-long { white-space: normal; min-width: 130mm; }   /* a paragraph of a fitting note wraps; every other line stays on one (Stop 53 A10) */
/* One type scale for the sheet's words (Stop 51 item 15): 12 px for the names (the design, the sheet), 10 for what is
   read (the schedule, the block's values and notes), 8 for the capital labels (the schedule's heads, the block's keys,
   "Cabinetmakers"). The schedule's figures take only the width they need, so the words get the rest. */
/* Each row on one line (Stop 53 A10: the carcass text wrapped): the columns take the width their words need, the
   table at least the schedule's width; on screen a schedule wider than its room scrolls, and the PDF's is brought
   down in type size just enough to fit its A3 page (sheet-v2.js fitSchedules). */
.ssc { border-collapse: collapse; width: auto; min-width: 100%; font-size: 10px; color: #14110B; font-variant-numeric: tabular-nums; }
.ssc th { font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: left; padding: 2px 8px 3px 0; border-bottom: 1px solid #14110B; white-space: nowrap; }
.ssc td { padding: 3px 8px 3px 0; border-bottom: 0.5px solid #B9B3A8; vertical-align: top; white-space: nowrap; }
.ssc .ssc-f { text-align: right; white-space: nowrap; width: 1%; }
.ssc .ssc-n { font-weight: 700; width: 26px; }
.ssc tr.ssc-part td { padding-top: 1px; padding-bottom: 1px; color: #5A5446; }   /* a cabinet's panels and fillers, under it (Stop 74 item 4) */
#sab-print-sheet .ssc-short td { padding-top: 2px; padding-bottom: 2px; }   /* …the first sheet's rows a little closer, so its longer schedule leaves the plan its scale */
.stb { width: 300px; flex: 0 0 300px; border: 1px solid #14110B; padding: 8px 10px; font-size: 10px; color: #14110B; display: flex; flex-direction: column; gap: 3px; }   /* (within the 62 mm the A3 page keeps for its foot — sheet-v2.js drawAreaMm) */
.stb-brand { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 0.5px solid #14110B; }
.stb-brand svg { width: 34px !important; height: 28px !important; flex: 0 0 34px; }
.stb-word { font-family: var(--f-display); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; line-height: 1.1; }
.stb-sub { font-size: 8px; letter-spacing: .32em; text-transform: uppercase; margin-top: 2px; }
.stb-design { font-size: 12px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; margin-top: 2px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }   /* (two lines at most: the block's 62 mm) */
.stb-nw { white-space: nowrap; }
.stb-title { font-size: 12px; line-height: 1.3; }
.stb-rows { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.stb-k { padding: 1px 10px 1px 0; color: #5A5446; text-transform: uppercase; font-size: 8px; letter-spacing: .08em; vertical-align: baseline; white-space: nowrap; }
.stb-v { padding: 1px 10px 1px 0; vertical-align: baseline; }
.stb-note { font-size: 10px; }
.stb-foot { color: #5A5446; line-height: 1.35; }
#drawing-views .sv2-view + .sv2-view { margin-top: 14px; }
/* On screen the schedule and the title block are words to read, at 12 px (brief
   §77.3 item 4); the drawing above them scales with the sheet. The PDF's sheet
   (#sab-print-sheet) keeps the sizes above: it is printed at A3. */
#drawing-views .ssc, #drawing-views .ssc th, #drawing-views .stb, #drawing-views .stb-k, #drawing-views .stb-note { font-size: 12px; }
#drawing-views .stb-sub { font-size: 12px; letter-spacing: .2em; }
/* …and the block keeps its narrower width there, its facts one to a row (a key column, then the value): the
   schedule beside it holds its rows on one line where it did before Stop 51 item 15 (the PDF's block is wider, its
   short facts two to a row, to keep within its 62 mm). */
@media (min-width: 481px) { #drawing-views .stb { width: 250px; flex-basis: 250px; } }   /* (a phone's block is the sheet's width, under the schedule) */
#drawing-views .stb-rows tr { display: grid; grid-template-columns: 92px 1fr; }

@media print {
  @page { size: A3 landscape; margin: 12mm; }   /* the sheet's scale is chosen for this area (sheet-v2.js PAPER) */
  .sv2-view { break-after: page; page-break-after: always; break-inside: avoid; page-break-inside: avoid; border: 0; padding: 0; }
  /* The schedule and title block stand on the page's foot, and the drawings have all the room above them (Stop 74
     item 1; sheet-v2.js PAGE_H_MM picks each sheet's scale for it). */
  .sv2-view { display: flex; flex-direction: column; min-height: 271mm; box-sizing: border-box; }
  .sv2-draw { flex: 1 0 auto; }
  .sv2-foot { flex: 0 0 auto; }
  .sv2-view:last-child { break-after: auto; page-break-after: auto; }
  html, body { background: #fff !important; }
  body > *:not(#sab-print-sheet) { display: none !important; }
  #sab-print-sheet { display: block !important; }
}

/* ── Handle picker (public/js/hardware.picker.js) ──────────────────────────────
   Appended at the end and scoped under .hw-picker so later generic button rules
   in this file cannot flatten the swatches (they did when this block sat
   higher up). Chips reuse .niche-count-btn so the picker inherits the design
   system rather than inventing a second visual language. */
.hw-picker .hw-swatch {
  display: inline-block;
  width: 26px; height: 26px;
  min-width: 26px; min-height: 26px;
  padding: 0; margin: 0;
  border-radius: 50%;
  border: 1px solid var(--b-dark);
  background-color: transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.hw-picker .hw-swatch:hover { border-color: var(--gold); transform: scale(1.08); }
.hw-picker .hw-swatch.active { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.hw-picker .niche-count-btn { flex: 0 1 auto; }

/* ── Fit checks (public/js/fit.panel.js) ──────────────────────────────────── */
#sab-fit-warnings { margin: 14px 0 4px; }
.fit-list { list-style: none; margin: 6px 0 0; padding: 0; }
.fit-item {
  position: relative;
  padding: 6px 8px 6px 20px;
  margin-bottom: 4px;
  font-size: 12px; line-height: 1.45;
  color: var(--t-dark);
  background: rgba(0, 0, 0, 0.025);
  border-left: 2px solid var(--b-dark);
}
.fit-item .fit-dot {
  position: absolute; left: 8px; top: 11px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--b-dark);
}
.fit-error   { border-left-color: #B3402F; }
.fit-error .fit-dot   { background: #B3402F; }
.fit-warning { border-left-color: #C08A2E; }
.fit-warning .fit-dot { background: #C08A2E; }
.fit-info    { border-left-color: #6F7F6A; }
.fit-info .fit-dot    { background: #6F7F6A; }
.fit-note { margin-top: 6px; font-size: 12px; color: var(--t-inv-3); }

/* ── Specification panel (UX rebuild Phase 2, 20 Sep 2026) ─────────────────
   Door style tiles + the three material rows sit at the top of .opts-panel,
   outside the accordion. Tokens are still the current set; Phase 3 retokens.
   No gradients, no interface shadows, radii 0–4px. */
.spec-block { display: flex; flex-direction: column; gap: 8px; }
.spec-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.door-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.text-link { color: var(--t-dark); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.text-link:hover { color: var(--gold-text); }
.door-tile {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 4px 7px;
  border: 1px solid var(--b-faint);
  background: transparent; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font: inherit; color: inherit;
}
.door-tile:hover { border-color: var(--b-light); background: var(--cream); }
.door-tile.active { border-color: var(--gold); background: var(--gold-dim); }
.door-tile.unavailable { opacity: 0.45; cursor: not-allowed; }
.door-tile:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.door-tile-note { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-faint); text-align: center; }
/* Construction toggle under the door tiles — overlay | in-frame (Phase 8). */
.front-toggle { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 6px; }
.front-toggle:empty { display: none; }
.front-toggle-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--b-faint);
  background: transparent; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font: inherit; color: inherit;
}
.front-toggle-btn:hover { border-color: var(--b-light); background: var(--cream); }
.front-toggle-btn.active { border-color: var(--gold); background: var(--gold-dim); }
.front-toggle-btn.unavailable { opacity: 0.45; cursor: not-allowed; }
.front-toggle-btn:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.front-toggle-art { width: 22px; height: 29px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.front-toggle-art svg { width: 22px; height: 29px; display: block; }
.front-toggle-label { font-size: 12px; letter-spacing: 0.04em; }
.swatch-row-wrap { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.swatch-row-wrap + .swatch-row-wrap { border-top: 1px solid var(--b-faint); padding-top: 10px; }
.swatch-row-lbl {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--t-sub);
}
.swatch-sub-lbl {
  font-family: var(--f-ui);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--t-faint); margin-bottom: 4px;
}
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  width: 78px; padding: 2px;
  background: none; border: none; cursor: pointer;
  font: inherit; color: var(--t-mid);
}
.swatch-chip-sample {
  display: block; width: 46px; height: 46px;
  border: 1px solid var(--b-light);
  box-sizing: border-box;
}
.swatch-chip.active .swatch-chip-sample { border: 2px solid var(--gold); }
.swatch-chip:hover .swatch-chip-sample { border-color: var(--gold-line); }
.swatch-chip:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.swatch-chip-lbl { font-size: 12px; line-height: 1.2; text-align: left; }
.swatch-chip-con { font-size: 12px; line-height: 1.25; text-align: left; color: var(--t-sub); }
.swatch-chip.active .swatch-chip-lbl { color: var(--t-dark); font-weight: 600; }
.swatch-chip-sub { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--t-faint); text-align: left; }
.dw-note { font-size: 12px; line-height: 1.4; color: var(--t-sub); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ═══════════════════════════════════════════════════════
   PHASE 17 — "Your design" tile panel + side sheets (brief §52.4)
   Layout B: a 2 × 2 grid of picture tiles (Door style, Material, Finish,
   Handles) with Global settings full width. Previews on cream, labels in
   Newsreader 17, values in Inter 12.5 umber. Gold only for the selected
   state and the primary action, always with ink text. 44 px targets.
   ═══════════════════════════════════════════════════════ */
.yd-head { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.yd-title { margin: 0; font-family: var(--f-head); font-size: 26px; font-weight: 400; line-height: 1.15; color: var(--t-dark); }
.yd-sub { font-family: var(--f-ui); font-size: 13px; color: var(--t-sub); }
.yd-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.yd-tile {
  display: flex; flex-direction: column; gap: 10px; min-height: 44px;
  padding: 8px; background: var(--paper); border: 1px solid var(--b-light); border-radius: var(--r);
  text-align: left; font-family: var(--f-ui); color: var(--t-dark); cursor: pointer;
}
.yd-tile:hover { border-color: var(--t-sub); }
.yd-tile { position: relative; }
/* "N differs" sits on the tile's preview, top right (§52.4, mock-up AltB). */
.yd-badge {
  position: absolute; top: 14px; right: 14px; padding: 2px 6px;
  background: var(--paper); border: 1px solid var(--b-light); border-radius: 2px;
  font-size: 12px; font-weight: 500; line-height: 1.4; color: var(--t-mid);
}
.yd-badge[hidden] { display: none; }
.yd-tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.yd-prev {
  position: relative; height: 112px; display: flex; align-items: center; justify-content: center;
  background: var(--cream); overflow: hidden;
}
.yd-prev svg { max-width: 100%; }
.yd-pair { display: flex; gap: 2px; }
.yd-pair svg { width: 40px; height: auto; }
.yd-boards { display: flex; flex-direction: column; gap: 8px; width: 78%; }
.yd-board { display: block; height: 20px; border: 1px solid var(--ink-5); background-size: cover; background-position: center; }
.yd-surface { display: block; width: 78%; height: 78px; border: 1px solid var(--ink-5); background-size: cover; background-position: center; }
.yd-txt { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 4px; }
.yd-lbl { font-family: var(--f-head); font-size: 17px; font-weight: 500; }
.yd-val { font-size: 12.5px; line-height: 1.4; color: var(--t-mid); }
.yd-tile-wide { grid-column: span 2; padding: 14px 16px; gap: 10px; }
.yd-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.yd-fig { display: flex; flex-direction: column; gap: 2px; }
.yd-fig-l { font-size: 12px; color: var(--t-sub); }
.yd-fig-v { font-size: 15px; }
.yd-fig-v.mono { font-family: var(--f-mono); }
.yd-hint { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--t-sub); }
.yd-hint svg { flex-shrink: 0; margin-top: 1px; }
/* ── The cabinet dialog (Phase 18 Stop 2, brief §56.4) ─────────
   Modeless, 380 px, fixed beside the selected cabinet inside the 3D view
   (cab-editor-modal.js places and drags it). Held by a hairline and the one
   floating shadow the mock-up draws; no backdrop. Rows are 52 px with 44 px
   controls; text is 13 px or more, figures in mono. */
.cab-dlg {
  position: fixed; z-index: 900; width: 380px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--t-dark); font-family: var(--f-ui);
  border: 1px solid var(--cream-4); border-radius: var(--r);
  box-shadow: 0 16px 40px rgba(20, 17, 11, 0.22);
}
.cab-dlg[hidden] { display: none; }
.cab-dlg-hd { height: 64px; flex-shrink: 0; display: flex; align-items: stretch; background: var(--cream); border-bottom: 1px solid var(--cream-4); }
.cab-dlg-grip { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 12px; cursor: grab; touch-action: none; user-select: none; }
.cab-dlg-grip.dragging { cursor: grabbing; }
.cab-dlg-hd-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cab-dlg-title { font-family: var(--f-head); font-size: 20px; font-weight: 500; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab-dlg-title:focus { outline: none; }
.cab-dlg-title:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cab-dlg-dims { font-family: var(--f-mono); font-size: 12px; color: var(--t-sub); }
.cab-dlg-x { width: 52px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; color: var(--ink); cursor: pointer; }
.cab-dlg-x:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
.cab-dlg-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 20px 20px; }
.cab-dlg-sections { display: flex; flex-direction: column; gap: 16px; }
.cab-sec { display: flex; flex-direction: column; gap: 10px; }
.cab-sec-hd { display: flex; flex-direction: column; gap: 2px; }
.cab-h3 { margin: 0; font-family: var(--f-head); font-size: 16px; font-weight: 500; }
.cab-h4 { margin: 2px 0 -4px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--t-mid); }   /* a sub-head in a section: the fridge's size and gaps (Stop 51 item 16) */
#fridge-gaps[hidden], #fridge-presets[hidden], #fridge-integrated-row[hidden] { display: none; }
.cab-note { font-size: 12px; line-height: 1.5; color: var(--t-sub); }
.cab-note .mono { font-family: var(--f-mono); color: var(--t-dark); }
.cab-note[hidden] { display: none; }
/* Size: three fields, then the read-out and the apply-to-all links */
.cab-size { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cab-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cab-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cab-field label { font-size: 12px; color: var(--t-mid); }
.cab-input { display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 10px; background: var(--paper); border: 1px solid var(--cream-4); border-radius: var(--r); }
.cab-input:focus-within { border-color: var(--ink); }
.cab-input input { width: 100%; min-width: 0; border: 0; padding: 0; background: transparent; font-family: var(--f-mono); font-size: 15px; color: var(--t-dark); -moz-appearance: textfield; }
.cab-input input[type="text"] { font-family: var(--f-ui); font-size: 14px; }
.cab-input input::-webkit-outer-spin-button, .cab-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cab-input input:focus { outline: none; }
.cab-unit { font-family: var(--f-mono); font-size: 12px; color: var(--t-sub); flex-shrink: 0; }
.cab-input-sm { width: 108px; padding: 0 8px; }
.cab-link {
  align-self: flex-start; height: 32px; padding: 0; background: transparent; border: 0; cursor: pointer;
  font-family: var(--f-ui); font-size: 13px; font-weight: 500; color: var(--t-mid);
  text-decoration: underline; text-underline-offset: 3px;
}
.cab-link:hover { color: var(--ink); }
.cab-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cab-link[hidden] { display: none; }
/* Rows: label left, control right, hairlines between */
.cab-rows { display: flex; flex-direction: column; border-top: 1px solid var(--b-faint); }
.cab-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--b-faint); }
.cab-row-flat { border-top: 1px solid var(--b-faint); }
.cab-row-wrap { flex-wrap: wrap; }
.cab-row-lbl { font-size: 13px; color: var(--t-mid); }
.cab-row-sub { flex-basis: 100%; padding-bottom: 8px; font-size: 12px; line-height: 1.4; color: var(--t-sub); }
.cab-row-sub[hidden] { display: none; }
/* Segmented control (Hinged on, blind corner, oven niches, fridge type):
   reuses .niche-count-btn's active state, sized to the mock-up */
.cab-seg { display: flex; gap: 3px; padding: 2px; background: var(--cream); border: 1px solid var(--cream-4); border-radius: var(--r3); }
.cab-dlg .cab-seg-btn.niche-count-btn {
  flex: 1 1 auto; min-width: 64px; height: 40px; margin: 0; padding: 0 12px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--r);
  font-family: var(--f-ui); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--t-dark); cursor: pointer;
}
.cab-dlg .cab-seg-btn.niche-count-btn:hover { border-color: var(--cream-4); }
.cab-dlg .cab-seg-btn.niche-count-btn.active { background: var(--paper); border-color: var(--gold); font-weight: 600; color: var(--t-dark); }
.cab-dlg .cab-seg-btn.niche-count-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.cab-seg-sub { display: block; font-size: 12px; font-weight: 400; color: var(--t-sub); }
/* Chips the sink / tap / hob picker builds (style.picker.js): the dialog's
   chip look — ink on cream with a gold ring when chosen, never white on gold */
.cab-dlg #fittings-picker .niche-count-btn { min-height: 40px; padding: 0 12px; background: var(--paper); border: 1px solid var(--cream-4); border-radius: var(--r); font-family: var(--f-ui); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--t-dark); }
.cab-dlg #fittings-picker .niche-count-btn.active { background: var(--cream); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); color: var(--t-dark); }
/* Stepper (Shelves) */
.cab-stepper { display: flex; align-items: center; gap: 4px; }
.cab-dlg .cab-step.qty-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--paper); border: 1px solid var(--cream-4); border-radius: var(--r); color: var(--ink); font-size: 0; }
.cab-dlg .cab-step.qty-btn:hover { border-color: var(--ink); color: var(--ink); }
.cab-step-val { width: 32px; text-align: center; font-family: var(--f-mono); font-size: 15px; }
/* The inside's drawing (Stop 68 item 2; dimensions.js sabDrawInterior): the boards, the drilled rows, each shelf and drawer join to drag */
.cab-interior { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--b-faint); }
.cab-interior[hidden], #interior-sel-row[hidden], #interior-fix-row[hidden] { display: none; }
#interior-svg text { fill: var(--t-mid); font-family: var(--f-mono); pointer-events: none; }
#interior-svg rect, #interior-svg circle { vector-effect: non-scaling-stroke; stroke-width: 1; }
#interior-svg .int-board { fill: var(--cream-4); }
#interior-svg .int-hole { fill: var(--t-sub); }
#interior-svg .int-aperture { fill: none; stroke: var(--t-sub); stroke-dasharray: 4 3; }
#interior-svg .int-front { fill: var(--cream); stroke: var(--t-sub); }
#interior-svg .int-hit { fill: transparent; }
#interior-svg .int-shelf, #interior-svg .int-handle { cursor: ns-resize; outline: none; }
#interior-svg .int-shelf-board, #interior-svg .int-handle-bar { fill: var(--gold); }
#interior-svg .is-sel .int-shelf-board, #interior-svg .int-shelf:focus-visible .int-shelf-board,
#interior-svg .is-sel .int-handle-bar, #interior-svg .int-handle:focus-visible .int-handle-bar { fill: var(--ink); }
/* The door designer's drawing (Stop 83 item 10; dimensions.js sabDrawDoorDesign): the leaf, its frame, each mid rail to drag */
#doordesign-panel[hidden] { display: none; }
#doordesign-panel { display: flex; flex-direction: column; gap: 6px; padding: 6px 0 10px; }
#doordesign-svg text { fill: var(--t-mid); font-family: var(--f-mono); pointer-events: none; }
#doordesign-svg rect, #doordesign-svg line { vector-effect: non-scaling-stroke; stroke-width: 1; }
#doordesign-svg .dd-frame { fill: var(--cream-4); stroke: var(--t-sub); }
#doordesign-svg .dd-panel { fill: var(--cream); stroke: var(--t-sub); }
#doordesign-svg .dd-relief { stroke: var(--t-sub); }
#doordesign-svg .dd-bead { stroke: var(--t-sub); vector-effect: non-scaling-stroke; }
#doordesign-svg .dd-hit { fill: transparent; stroke: none; }
#doordesign-svg .dd-rail { cursor: ns-resize; outline: none; }
#doordesign-svg .dd-rail-board { fill: var(--gold); stroke: none; }
#doordesign-svg .dd-rail:focus-visible .dd-rail-board, #doordesign-svg .dd-rail.is-drag .dd-rail-board { fill: var(--ink); }
#interior-svg .int-divider { cursor: ew-resize; outline: none; }   /* (Stop 69 item 8: dividers drag sideways) */
#interior-svg .int-divider-board { fill: var(--gold); }
#interior-svg .is-sel .int-divider-board, #interior-svg .int-divider:focus-visible .int-divider-board { fill: var(--ink); }
/* Chips (End panels): a pressed chip is cream with a gold ring; a derived one
   (the in-frame rule fitted it) is locked and says so beneath */
.cab-chips { display: flex; gap: 6px; }
.cab-dlg .cab-chip.toggle {
  width: auto; height: 44px; padding: 0 14px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--cream-4); box-shadow: none; position: static;
  font-family: var(--f-ui); font-size: 13px; font-weight: 500; color: var(--t-dark); cursor: pointer;
}
.cab-dlg .cab-chip.toggle::after { display: none; }
/* Stop 73 item 9 (Steve): an on chip is GOLD with ink on it, as the switches and the plan's own End panel buttons are —
   cream with a hairline gold ring did not read as chosen. One the rule fitted keeps the quiet locked look. */
.cab-dlg .cab-chip.toggle.on { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.cab-dlg .cab-chip.toggle.derived { cursor: not-allowed; color: var(--t-mid); }
.cab-dlg .cab-chip.toggle.on.derived { background: var(--cream); box-shadow: inset 0 0 0 1px var(--gold); color: var(--t-mid); font-weight: 500; }
.cab-dlg .cab-chip.toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Switches (.toggle, styled elsewhere) sit at the row's right */
.cab-dlg .cab-row > .toggle { flex-shrink: 0; }
.cab-fillers { display: flex; gap: 6px; }
/* Ranges (blind corner, oven, fridge split) — the sheet's range look */
.cab-range { display: flex; flex-direction: column; gap: 6px; }
.cab-range-hd { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--t-mid); }
.cab-range-val { font-family: var(--f-mono); font-size: 13px; color: var(--t-dark); }
.cab-range-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--t-sub); }
.cab-range-hd label .cab-unit { margin-left: 6px; }
.cab-range-link { margin-left: 6px; font-size: 12px; color: var(--t-mid); text-decoration: underline; text-underline-offset: 3px; }
.cab-figs { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; color: var(--t-sub); }
.cab-figs .mono { font-family: var(--f-mono); color: var(--t-dark); }
.cab-figs-total { padding: 8px 10px; background: var(--gold-dim); border: 1px solid var(--b-dark); color: var(--t-mid); }
.cab-callout { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; background: var(--cream); border: 1px solid var(--b-light); border-radius: var(--r); font-size: 12px; line-height: 1.5; color: var(--t-mid); }
.cab-callout svg { flex-shrink: 0; margin-top: 2px; }
.cab-select { height: 44px; padding: 0 8px; border: 1px solid var(--cream-4); border-radius: var(--r); background: var(--paper); font-family: var(--f-ui); font-size: 13px; color: var(--t-dark); }
.cab-select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
/* This cabinet only: label · the choice · Match design */
.cab-only .cab-rows { border-top: 1px solid var(--b-faint); }
.cab-only-row { min-height: 44px; justify-content: flex-start; }
.cab-only-lbl { width: 82px; flex-shrink: 0; font-size: 13px; color: var(--t-mid); }
.cab-only-sel {
  flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 4px; border: 1px solid transparent; border-radius: var(--r);
  background: transparent; font-family: var(--f-ui); font-size: 13px; color: var(--t-dark); cursor: pointer;
}
.cab-only-sel:hover { border-color: var(--cream-4); }
.cab-only-sel:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.cab-only-row .cab-link { height: 44px; flex-shrink: 0; color: var(--ink); }
/* The sink / tap / hob picker and the fit warnings keep their own styles;
   inside the dialog their headings read as the dialog's */
.cab-dlg .sec-hd, .cab-dlg .slider-lbl-dark { font-family: var(--f-head); font-size: 16px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--t-dark); border: 0; padding: 0; margin: 0 0 8px; }

/* ── Header: Save this design (ink outline) ─────────────── */
.hdr-save {
  height: 40px; margin-left: 8px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--ink); border-radius: var(--r);
  font-family: var(--f-ui); font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer;
}
.hdr-save:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.hdr-save[hidden] { display: none; }
/* ── Header: Design help (Stop 42, §128.1) — gold edge on cream, its "?" beside the words ── */
.hdr-help {
  height: 44px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px;
  background: var(--cream); border: 1px solid var(--gold); border-radius: var(--r);
  font-family: var(--f-ui); font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; white-space: nowrap;
}
.hdr-help:hover { background: var(--cream-2); }
.hdr-help:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.hdr-help[hidden] { display: none; }
.hdr-help-ico { width: 18px; height: 18px; flex: none; }
/* ── Design help's sheet (Stop 42): 400 wide beside the design; the demo again (gold edge), the notes, the ask ── */
@media (min-width: 901px) { dialog.sab-sheet.sheet-help { width: 400px; } }
.sheet-body.help-body { gap: 10px; }
.help-demo { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 14px; background: var(--cream); border: 1px solid var(--gold); border-radius: var(--r); text-align: left; cursor: pointer; font-family: var(--f-ui); color: var(--ink); }
.help-demo svg { flex: none; }
/* The film's poster, small, its play mark over it (Stop 43). */
.help-demo-thumb { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 96px; height: 60px; background: var(--ink-3); overflow: hidden; }
.help-demo-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.help-demo-thumb svg { position: relative; }
.help-demo-txt { display: flex; flex-direction: column; gap: 2px; }
.help-demo-t { font-size: 14px; font-weight: 600; }
.help-demo-s { font-size: 12px; color: var(--t-sub); }
.help-note { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--b-faint); border-radius: var(--r); }
.help-note-t { margin: 0; font-family: var(--f-ui); font-size: 14px; font-weight: 600; color: var(--ink); }
.help-note-p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--t-mid); }
.help-ask { display: flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 4px; border: 1px solid var(--ink); border-radius: var(--r); font-family: var(--f-ui); font-size: 14px; color: var(--ink); text-decoration: none; }
.help-ask:hover { background: var(--cream); }
.help-demo:focus-visible, .help-ask:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* The last note follows the layout: the steps are at the top left from 901 px up; below, "Your design" holds the choices. */
.help-narrow { display: none; }
@media (max-width: 900px) { .help-wide { display: none; } .help-narrow { display: inline; } }

/* ── The side sheet: native <dialog>, from the right ────── */
/* Its content rules are scoped :is(dialog.sab-sheet, .jr-step) (Stop 36): from
   901 px up the same controls live in the step panel's panes (journey.js moves
   them), and read there as they do in a sheet. :is() keeps each rule's
   specificity what it was (the dialog's). */
html.sab-sheet-open { overflow: hidden; }
dialog.sab-sheet {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: 560px; max-width: 100vw; height: 100%; max-height: none;
  padding: 0; border: 0; border-left: 1px solid var(--b-light);
  background: var(--paper); color: var(--t-dark); font-family: var(--f-ui);
}
dialog.sab-sheet[open] { display: flex; flex-direction: column; animation: sab-sheet-in 180ms ease-out; }
dialog.sab-sheet::backdrop { background: rgba(20, 17, 11, 0.2); }
@keyframes sab-sheet-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.sab-sheet[open] { animation: none; } }
/* At 900 px and below the sheet rises from the bottom (Phase 18 Stop 3, the
   block at the end of this file) and the design is framed in the strip above
   it, so the footer note's promise holds there too — the §53.3 item 2 hiding
   rule that stood here is gone. */
.sheet-hd {
  padding: 28px 32px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  border-bottom: 1px solid var(--b-faint); flex-shrink: 0;
}
.sheet-hd-txt { display: flex; flex-direction: column; gap: 6px; }
.sheet-title { margin: 0; font-family: var(--f-head); font-size: 30px; font-weight: 400; line-height: 1.1; }
.sheet-title:focus { outline: none; }
.sheet-title:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sheet-sub { margin: 0; font-size: 14px; line-height: 1.5; color: var(--t-mid); }
.sheet-x {
  width: 44px; height: 44px; flex-shrink: 0; margin: -8px -8px 0 0; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: var(--ink); cursor: pointer; border-radius: var(--r);
}
.sheet-x:focus-visible, .sheet-done:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 24px 32px; display: flex; flex-direction: column; gap: 28px; }
.sheet-sec { display: flex; flex-direction: column; gap: 12px; }
.sheet-h3 { margin: 0; font-family: var(--f-head); font-size: 18px; font-weight: 500; }
.sheet-note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--t-sub); }
/* The floor's choices under Wood / Tile (Stop 20): a label over each group of radios. */
.floor-group { display: flex; flex-direction: column; gap: 6px; }
.floor-group[hidden] { display: none; }
.floor-lbl { margin: 4px 0 0; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--t-mid); }
.sheet-callout {
  padding: 12px 16px; background: var(--cream); border: 1px solid var(--b-light); border-radius: var(--r);
  font-size: 13px; line-height: 1.5; color: var(--t-mid);
}
.sheet-ft {
  flex-shrink: 0; padding: 20px 32px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--b-faint);
}
.sheet-ft-note { font-size: 13px; color: var(--t-sub); }
.sheet-done {
  height: 44px; padding: 0 32px; display: inline-flex; align-items: center;
  background: var(--gold); border: 0; border-radius: var(--r);
  font-family: var(--f-ui); font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer;
}

/* Door style sheet: style tiles as a radiogroup, drawn in the chosen material. */
:is(dialog.sab-sheet, .jr-step) .door-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
:is(dialog.sab-sheet, .jr-step) .door-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-height: 44px;
  padding: 12px; background: var(--paper); border: 1px solid var(--b-light); border-radius: var(--r);
  box-shadow: none; text-align: left; color: var(--t-dark); font-family: var(--f-ui); cursor: pointer;
}
:is(dialog.sab-sheet, .jr-step) .door-tile.active { background: var(--cream); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
:is(dialog.sab-sheet, .jr-step) .door-tile.unavailable { opacity: 0.55; cursor: not-allowed; }
:is(dialog.sab-sheet, .jr-step) .door-tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.door-tile-art { display: flex; gap: 2px; height: 88px; align-items: center; }
.door-tile-art svg { height: 88px; width: auto; }
.door-tile-txt { display: flex; flex-direction: column; gap: 2px; }
:is(dialog.sab-sheet, .jr-step) .door-label { margin: 0; padding: 0; text-align: left; font-family: var(--f-head); font-size: 18px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--t-dark); }
.door-tile-sub { font-size: 12px; color: var(--t-sub); }
:is(dialog.sab-sheet, .jr-step) .door-tile-note { font-size: 12px; color: var(--t-sub); }
/* Construction: a two-way segmented control. */
:is(dialog.sab-sheet, .jr-step) .front-toggle {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 3px; margin: 0;
  background: var(--cream); border: 1px solid var(--b-light); border-radius: var(--r3);
}
:is(dialog.sab-sheet, .jr-step) .front-toggle-btn {
  height: 44px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--r); box-shadow: none;
  font-family: var(--f-ui); font-size: 14px; font-weight: 500; color: var(--t-mid); text-transform: none; letter-spacing: 0; cursor: pointer;
}
:is(dialog.sab-sheet, .jr-step) .front-toggle-btn.active { background: var(--paper); border-color: var(--gold); font-weight: 600; color: var(--t-dark); }
:is(dialog.sab-sheet, .jr-step) .front-toggle-btn.unavailable { opacity: 0.5; cursor: not-allowed; }
:is(dialog.sab-sheet, .jr-step) .front-toggle-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sheet-range-hd { display: flex; align-items: baseline; justify-content: space-between; }
.sheet-range-hd label { font-family: var(--f-head); font-size: 18px; font-weight: 500; }
.sheet-range-val { font-family: var(--f-mono); font-size: 15px; }
/* A 44 px touch target drawn as the app's own 2 px track (the global range style). */
/* The track in --t-sub (#746753): 5.3:1 against the sheet's paper, over the
   3:1 a control's boundary needs (§53.3 item 4; it was --b-dark, a 28 % gold
   wash at 1.3:1). */
:is(dialog.sab-sheet, .jr-step) input[type="range"] {
  width: 100%; height: 44px; margin: 0;
  background: linear-gradient(var(--t-sub), var(--t-sub)) center / 100% 2px no-repeat;
}
:is(dialog.sab-sheet, .jr-step) input[type="range"]::-webkit-slider-thumb { width: 22px; height: 22px; }
:is(dialog.sab-sheet, .jr-step) input[type="range"]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
:is(dialog.sab-sheet, .jr-step) .front-toggle-label { font-size: 14px; letter-spacing: 0; text-transform: none; }

/* Material and Finish sheets: the swatch rows, the finish buttons and the
   decor grid keep their panel styling; inside a sheet they read as plain
   radiogroups with the sheet's focus ring. */
.sheet-differs { margin: 0; font-size: 13px; font-weight: 500; color: var(--t-mid); }
.sheet-differs[hidden] { display: none; }
.sheet-fixed { margin: 0; font-size: 14px; color: var(--t-dark); }
.sheet-fixed[hidden] { display: none; }
:is(dialog.sab-sheet, .jr-step) .swatch-chip:focus-visible,
:is(dialog.sab-sheet, .jr-step) .finish-btn:focus-visible,
:is(dialog.sab-sheet, .jr-step) .decor-chip:focus-visible,
:is(dialog.sab-sheet, .jr-step) .worktop-finish-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
:is(dialog.sab-sheet, .jr-step) .finish-btn { text-transform: none; }
button.decor-chip { display: block; width: 100%; padding: 0; background-color: transparent; font: inherit; }

/* Handles sheet: the picker's chips read as options, not shouting labels —
   no uppercase (it printed "12MM" / "96MM"), 44 px targets. */
:is(dialog.sab-sheet, .jr-step) .hw-picker .niche-count-btn {
  min-height: 44px; padding: 0 14px; text-transform: none; letter-spacing: 0;
  font-family: var(--f-ui); font-size: 14px;
}
:is(dialog.sab-sheet, .jr-step) .hw-picker .slider-lbl-dark { font-family: var(--f-head); font-size: 18px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--t-dark); }
:is(dialog.sab-sheet, .jr-step) .hw-picker .hw-swatch { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
:is(dialog.sab-sheet, .jr-step) .hw-picker .niche-count-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Global settings: each range's ends, under the track. */
.sheet-range-ends { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 12px; color: var(--t-sub); }

/* ── Stop 2b (§54.1): the sheets at a size you can judge ──────────────────
   In a sheet no text is under 12 px, and gold is never under anything but
   ink. The boards are samples, three to a row across the sheet: the sample,
   its name at 14 px, the construction at 12 px, "Slab only" at 12 px in
   sentence case. The worktops and the Shinnoki decors take the same grid. */
:is(dialog.sab-sheet, .jr-step) .swatch-row,
:is(dialog.sab-sheet, .jr-step) .wt-grid,
:is(dialog.sab-sheet, .jr-step) .decor-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
:is(dialog.sab-sheet, .jr-step) .wt-group { grid-column: 1 / -1; margin-top: 4px; font-size: 13px; font-weight: 500; color: var(--t-mid); }
/* The boards' three groups (Stop 49 item 6): Classic, Decor, Premium veneer — a heading across the grid, as the worktops'. */
.swatch-group-hd { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--t-mid); }
:is(dialog.sab-sheet, .jr-step) .swatch-group-hd { grid-column: 1 / -1; }
.swatch-group-hd:first-child { margin-top: 0; }
.swatch-group-note { font-weight: 400; color: var(--t-mid); }
:is(dialog.sab-sheet, .jr-step) .swatch-chip,
:is(dialog.sab-sheet, .jr-step) .worktop-finish-chip,
:is(dialog.sab-sheet, .jr-step) button.decor-chip {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: auto; min-height: 44px;
  padding: 6px 6px 10px; background: var(--paper); border: 1px solid var(--b-light); border-radius: var(--r);
  text-align: left; font-family: var(--f-ui); color: var(--t-dark); cursor: pointer;
  aspect-ratio: auto; overflow: visible; transform: none;
}
:is(dialog.sab-sheet, .jr-step) .swatch-chip.active,
:is(dialog.sab-sheet, .jr-step) .worktop-finish-chip.active,
:is(dialog.sab-sheet, .jr-step) button.decor-chip.active { background: var(--cream); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
:is(dialog.sab-sheet, .jr-step) button.decor-chip:hover { transform: none; }

/* The paint colours (Stop 14, §91.1 item 2): a denser grid than the boards,
   a flat sample the published colour, name and number under it. */
:is(dialog.sab-sheet, .jr-step) .paint-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 4px; }
:is(dialog.sab-sheet, .jr-step) .paint-chip .swatch-chip-sample { width: auto; height: 40px; }
:is(dialog.sab-sheet, .jr-step) .paint-brand { margin-top: 10px; }
:is(dialog.sab-sheet, .jr-step) .paint-own { border: 1px solid var(--b-light); border-radius: var(--r); padding: 8px 12px; }
:is(dialog.sab-sheet, .jr-step) .paint-own-toggle { display: block; width: 100%; min-height: 44px; padding: 0; background: none; border: 0; text-align: left; cursor: pointer; font: inherit; font-size: 14px; color: var(--t-dark); }
:is(dialog.sab-sheet, .jr-step) .paint-own-toggle::before { content: '▸ '; color: var(--t-faint); }
:is(dialog.sab-sheet, .jr-step) .paint-own-toggle[aria-expanded="true"]::before { content: '▾ '; }
:is(dialog.sab-sheet, .jr-step) .paint-own-form[hidden] { display: none; }
:is(dialog.sab-sheet, .jr-step) .paint-own-form { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
:is(dialog.sab-sheet, .jr-step) .paint-own-form .field-label { margin-top: 4px; }
:is(dialog.sab-sheet, .jr-step) .paint-own-form .field-input { min-height: 44px; }   /* the touch size (§57.3; portrait-touch's 44 px audit) */
:is(dialog.sab-sheet, .jr-step) .paint-own-form .field-input[aria-invalid="true"] { border-color: var(--warning); }
/* The own colour's shade (Stop 74 item 14): an HSL wheel — the hue round it, grey at its middle — at the slider's
   lightness (--l, paint.js wireShade), its marker, and beside it the shade, the lightness slider and the hex. */
.paint-shade { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.paint-wheel { --l: 50%; position: relative; flex: 0 0 176px; width: 176px; height: 176px; border-radius: 50%; border: 1px solid var(--b-light); cursor: crosshair; touch-action: none;
  background: radial-gradient(closest-side, hsl(0 0% var(--l)), hsl(0 0% var(--l) / 0)),
              conic-gradient(hsl(0 100% var(--l)), hsl(60 100% var(--l)), hsl(120 100% var(--l)), hsl(180 100% var(--l)), hsl(240 100% var(--l)), hsl(300 100% var(--l)), hsl(360 100% var(--l))); }
.paint-wheel-dot { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #14110B; pointer-events: none; }
.paint-shade-side { flex: 1 1 140px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.paint-shade-swatch { display: block; height: 44px; border-radius: var(--r); border: 1px solid var(--b-light); }
.paint-light { width: 100%; min-height: 44px; margin: 0; }
:is(dialog.sab-sheet, .jr-step) button.decor-chip.active::after { content: none; }
:is(dialog.sab-sheet, .jr-step) .swatch-chip-sample,
:is(dialog.sab-sheet, .jr-step) .wt-sample,
:is(dialog.sab-sheet, .jr-step) .decor-chip-sample {
  display: block; width: 100%; height: 80px; border: 1px solid var(--b-light); box-sizing: border-box;
  background-size: cover; background-position: center; border-radius: 0;
}
:is(dialog.sab-sheet, .jr-step) .swatch-chip.active .swatch-chip-sample { border: 1px solid var(--b-light); }
:is(dialog.sab-sheet, .jr-step) .swatch-chip-lbl,
:is(dialog.sab-sheet, .jr-step) .wt-name,
:is(dialog.sab-sheet, .jr-step) .decor-chip-name { padding: 0 2px; font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--t-dark); }
:is(dialog.sab-sheet, .jr-step) .swatch-chip.active .swatch-chip-lbl { font-weight: 600; }
:is(dialog.sab-sheet, .jr-step) .swatch-chip-con { padding: 0 2px; font-size: 12px; line-height: 1.35; color: var(--t-sub); }
:is(dialog.sab-sheet, .jr-step) .swatch-chip-sub { padding: 0 2px; font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--t-mid); }
/* The Shinnoki decors, as a collection: each collection named, then its grid. */
:is(dialog.sab-sheet, .jr-step) .decor-collection-hdr {
  margin: 12px 0 8px; font-family: var(--f-head); font-size: 16px; font-weight: 500;
  letter-spacing: 0; text-transform: none; color: var(--t-dark);
}
:is(dialog.sab-sheet, .jr-step) .swatch-sub-lbl { margin: 0 0 8px; font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--t-dark); }
:is(dialog.sab-sheet, .jr-step) .decor-selected-name { font-size: 14px; color: var(--t-mid); }
/* Finish: the option buttons and notes at sheet scale. */
:is(dialog.sab-sheet, .jr-step) .finish-grid { gap: 10px; }
:is(dialog.sab-sheet, .jr-step) .finish-btn { min-height: 44px; padding: 10px 12px; gap: 4px; border-color: var(--b-light); border-radius: var(--r); }
:is(dialog.sab-sheet, .jr-step) .finish-btn.active { background: var(--cream); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
:is(dialog.sab-sheet, .jr-step) .finish-btn-name { font-size: 14px; }
:is(dialog.sab-sheet, .jr-step) .finish-btn-sub,
:is(dialog.sab-sheet, .jr-step) .finish-note { font-size: 12px; line-height: 1.45; }
/* Notes. */
:is(dialog.sab-sheet, .jr-step) .dw-note { font-size: 12px; line-height: 1.5; }
/* Handles: each style is its drawing over its name; selected = cream fill,
   gold ring, ink text (never white on gold). Each finish sphere is named. */
:is(dialog.sab-sheet, .jr-step) .hw-picker .niche-count-btn.active,
:is(dialog.sab-sheet, .jr-step) .hw-picker .niche-count-btn[aria-checked="true"] {
  background: var(--cream); color: var(--ink); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold);
}
:is(dialog.sab-sheet, .jr-step) .hw-picker .hw-styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
:is(dialog.sab-sheet, .jr-step) .hw-picker .niche-count-btn.hw-style {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; height: auto; padding: 8px 8px 10px;
  background: var(--paper); border: 1px solid var(--b-light); border-radius: var(--r); text-align: left;
}
:is(dialog.sab-sheet, .jr-step) .hw-picker .niche-count-btn.hw-style.active { background: var(--cream); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.hw-style-art { display: flex; align-items: center; justify-content: center; height: 64px; background: var(--cream); }
.niche-count-btn.hw-style.active .hw-style-art { background: var(--paper); }
.hw-style-name { font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--t-dark); }
/* A handle's picture (Stop 38): its own model rendered at one scale, 120 × 64 at 2×, never scaled — a narrower box
   crops it about its centre, a pull longer than the box runs off its sides — its length in the corner. */
.hw-thumb { position: relative; display: block; width: 100%; max-width: 120px; height: 64px; }
.hw-thumb .hw-pic { display: flex; justify-content: center; width: 100%; height: 100%; overflow: hidden; }
.hw-thumb img { display: block; flex: none; width: 120px; height: 64px; }
/* the length sits over the picture, outside its crop: in a narrow tile (a phone's three columns) it wraps, never cut */
.hw-thumb .hw-len { position: absolute; left: 4px; right: 4px; bottom: 3px; font-size: 12px; line-height: 1.15; color: var(--t-sub); font-family: var(--f-ui); }
/* A size no door or drawer of the design can take (Stop 38): greyed, the reason said under the sizes. */
.hw-picker .niche-count-btn.is-unfit { opacity: 0.45; border-style: dashed; cursor: not-allowed; }
:is(dialog.sab-sheet, .jr-step) .hw-picker .hw-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; }
.hw-picker .hw-fin {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 44px; padding: 4px 2px;
  background: transparent; border: 0; cursor: pointer; font-family: var(--f-ui);
}
.hw-picker .hw-fin .hw-swatch { cursor: inherit; }
.hw-fin-name { font-size: 12px; line-height: 1.3; text-align: center; color: var(--t-mid); }
.hw-fin.active .hw-fin-name { color: var(--t-dark); font-weight: 600; }
.hw-picker .hw-fin:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* A list of saved designs (My designs, Stop 42) */
.save-list { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
.save-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--b-light); border-radius: var(--r); }
.save-item-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.save-item-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-item-meta { font-size: 12px; color: var(--t-sub); }
.btn-outline {
  height: 44px; padding: 0 16px; background: transparent; border: 1px solid var(--ink); border-radius: var(--r);
  font-family: var(--f-ui); font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer;
}
.btn-outline:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* A quiet text action (Delete, Undo): ink, underlined, a 44 px target. */
.btn-text {
  height: 44px; padding: 0 6px; background: transparent; border: 0; cursor: pointer;
  font-family: var(--f-ui); font-size: 13px; font-weight: 500; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px;
}
.btn-text:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Panel width (layout B): 400 px at desktop, never under 300. Appended after
   the 3-column rules above, so these win; the tablet band keeps its narrower
   rail and the phone stack (≤768) is untouched. */
#s-config.active { grid-template-columns: 220px 1fr clamp(300px, 28vw, 400px); }
@media (max-width: 1120px) and (min-width: 769px) {
  #s-config.active { grid-template-columns: 190px 1fr 300px; }
}
/* With the wider panel, the price bar wraps up to 1399 px as the tablet band
   does (iPad landscape, 1180 px, clipped "Add to Basket" under the panel).
   The band ended at 1280 px until Phase 20 Stop 7 (§77.3 item 4): from 1281 to
   1379 px the one-row bar left the note 44–87 px, in three to six lines, and
   at 12 px "Add to Basket" ran 4 px out of the bar at 1281. From 1400 px the
   row holds the price, a two-line note, the toggle and both buttons. */
@media (max-width: 1399px) and (min-width: 1121px) {
  .cta-bar { flex-wrap: wrap; padding: 12px 16px; row-gap: 10px; }
  .cta-left { flex: 1 1 220px; min-width: 200px; }
  .cta-price-note { white-space: nowrap; }
  .cta-btns { flex: 1 1 100%; justify-content: flex-end; }
}
/* The price row from 901 to 1280 px (§72.3 item 2). The bands above hold the
   note to one line; at 901 px the bar is 411 px wide and the price, the note
   and the ex VAT toggle need 425, so the toggle ran out past the bar and
   "EX VAT" was cut. The note wraps beside the price where it must (as it does
   above 1399 px); the price and the toggle never shrink. (To 1399 px with the
   band above, Stop 7.) */
@media (max-width: 1399px) and (min-width: 901px) {
  .cta-price-note { white-space: normal; min-width: 0; }
  .cta-price { flex: none; }
}

/* ═══ Phase 18 Stop 3 — iPad portrait, 900 px and below (brief §57.2 items 1–3;
   tested at 820×1180 and 768×1024; phones are Phase 20). Appended last, so
   these win over the 3-column, tablet-band and ≤768 rules above.
   1. The cabinet-type rail folds into a DRAWER behind "Add a cabinet"; the 3D
      view takes the full width at the top; the "Your design" tiles sit below
      and scroll; the price bar stays pinned at the bottom. The .viewer wrapper
      becomes display:contents so its tab bar, body and price bar are grid
      rows of their own, with the tiles between the body and the bar.
   2. Sheets rise from the bottom (70 % of the height); the design is framed
      in the part still showing (design-panel.js frames into the top strip).
   3. The cabinet dialog is a bottom sheet with a half-height and a
      full-height stop, dragged by its handle (cab-editor-modal.js). ═══ */
/* Above 900 px the drawer chrome does not exist (set before the block, so the
   block's display rules win at the same specificity). */
.rail-close, .rail-add-btn, .rail-scrim { display: none; }
@media (max-width: 900px) {
  #s-config.active {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 46vh) minmax(0, 1fr) auto;
    height: calc(100vh - var(--hdr-h, 64px));
    overflow: hidden;
  }
  .viewer { display: contents; }
  .viewer-tabs { grid-row: 1; flex-wrap: nowrap; overflow-x: auto; padding: 0 10px; }
  .viewer-body { grid-row: 2; min-height: 0; background: var(--cream-2); }
  .opts-panel { grid-row: 3; min-height: 0; overflow-y: auto; border-left: 0; border-top: 1px solid var(--b-light); padding: 16px; }
  .cta-bar { grid-row: 4; flex-wrap: nowrap; padding: 12px 16px; }
  .cta-left { flex: 1 1 auto; min-width: 0; }
  .cta-btns { flex: 0 0 auto; }
  .yd-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .yd-tile-wide { grid-column: span 4; }

  /* The rail as a drawer: off-canvas to the left, over the view, under the header. */
  .type-panel {
    position: fixed; top: var(--hdr-h, 64px); bottom: 0; left: 0; z-index: 950;
    width: 300px; max-width: 86vw;
    flex-direction: column; flex-wrap: nowrap; gap: 0;
    padding: 12px 14px 16px; max-height: none;
    border-right: 1px solid var(--b-dark); border-bottom: 0;
    transform: translateX(-100%); visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }
  #s-config.rail-open .type-panel { transform: none; visibility: visible; transition-delay: 0s; box-shadow: 8px 0 32px rgba(20, 17, 11, 0.28); }
  .type-cat-title { width: auto; }
  .type-btn { width: 100%; flex: 0 0 auto; }
  .type-btn-lbl { display: inline; }
  .rail-scrim { position: fixed; inset: var(--hdr-h, 64px) 0 0 0; z-index: 940; background: rgba(20, 17, 11, 0.2); }
  #s-config.rail-open .rail-scrim { display: block; }
  .rail-hd { display: flex; align-items: center; justify-content: space-between; }
  .rail-close { display: flex; }
  .rail-add-btn { display: inline-flex; }
  /* The hint names the gesture (a tap, not a click) — see .yd-hint-touch below. */

  /* Sheets rise from the bottom: 70 % of the height, full width. */
  dialog.sab-sheet {
    inset: auto 0 0 0; width: 100vw; height: 70vh; max-height: 70vh;
    border-left: 0; border-top: 1px solid var(--b-light); border-radius: var(--r) var(--r) 0 0;
  }
  dialog.sab-sheet[open] { animation: sab-sheet-up 200ms ease-out; }
  .sheet-hd { padding: 20px 24px 16px; }
  .sheet-body { padding: 20px 24px; }
  .sheet-ft { padding: 16px 24px 24px; }

  /* The cabinet dialog as a bottom sheet (cab-editor-modal.js adds .cab-dlg-sheet
     at these widths and keeps left/top/max-height off it). Two stops: half and
     full. The handle is a pill on the title bar; the six-dot grip goes. */
  .cab-dlg.cab-dlg-sheet {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none;
    height: 50vh; max-height: none;
    border-radius: var(--r) var(--r) 0 0; border-bottom: 0;
    box-shadow: 0 -12px 40px rgba(20, 17, 11, 0.22);
    transition: height 0.2s ease;
  }
  .cab-dlg.cab-dlg-sheet.cab-dlg-full { height: calc(100vh - var(--hdr-h, 64px)); }
  .cab-dlg.cab-dlg-sheet.cab-dlg-dragging { transition: none; }
  .cab-dlg.cab-dlg-sheet .cab-dlg-hd { position: relative; height: 72px; }
  .cab-dlg.cab-dlg-sheet .cab-dlg-hd::before {
    content: ''; position: absolute; top: 8px; left: 50%; width: 44px; height: 5px; margin-left: -22px;
    border-radius: 3px; background: var(--cream-4);
  }
  .cab-dlg.cab-dlg-sheet .cab-dlg-grip { cursor: ns-resize; padding-top: 10px; }
  .cab-dlg.cab-dlg-sheet .cab-dlg-grip > svg { display: none; }
}
@keyframes sab-sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
/* The cabinet dialog docked over the rail from 901 px up (Stop 27, §111.2 item 1;
   cab-editor-modal.js adds .cab-dlg-dock and sets its box to the rail's — at
   least the dialog's own width). It slides out from the rail's edge; the view
   stays clear of it. The rail behind it is inert. */
@keyframes cab-dlg-dock-in { from { transform: translateX(-100%); } to { transform: none; } }
.cab-dlg.cab-dlg-dock {
  max-width: none; border-radius: 0; border-top: 0; border-bottom: 0; border-left: 0;
  box-shadow: 8px 0 32px rgba(20, 17, 11, 0.22);
  animation: cab-dlg-dock-in 0.2s ease;
}
.cab-dlg.cab-dlg-dock .cab-dlg-grip { cursor: default; }
.cab-dlg.cab-dlg-dock .cab-dlg-grip > svg { display: none; }
/* The rail behind the docked dialog is inert: what shows of it (its foot beside the price bar) reads as behind. */
#s-config.cab-dock-open .type-panel { opacity: 0.45; transition: opacity 0.2s ease; }
@media (prefers-reduced-motion: reduce) {
  .type-panel { transition: none; }
  .cab-dlg.cab-dlg-sheet { transition: none; }
  .cab-dlg.cab-dlg-dock { animation: none; }
}
/* The drawer's own chrome: its close sits on the rail's ink. */
.rail-hd { align-items: center; }
.rail-close {
  width: 44px; height: 44px; margin: 0 -8px 0 0; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: var(--r); color: var(--t-inv-2); cursor: pointer;
}
.rail-close:hover, .rail-close:focus-visible { color: var(--t-inv); outline: 2px solid var(--gold); outline-offset: -4px; }
/* The hints name the pointer's gestures (§57.2 item 4): the wheel with a
   mouse and a click; a pinch and a tap on a touch device. */
.viewer-hint .hint-touch, .yd-hint .hint-touch { display: none; }
@media (pointer: coarse) {
  .viewer-hint .hint-mouse, .yd-hint .hint-mouse { display: none; }
  .viewer-hint .hint-touch { display: inline-flex; }
  .yd-hint .hint-touch { display: inline; }
}

/* The tablet band's centre column is tight (1024 × 768: 534 px). The dialog
   narrows to 340 px there so that, docked at the view's edge, the strip beside
   it can still frame the selected cabinet (§57.3). */
@media (max-width: 1120px) and (min-width: 901px) {
  .cab-dlg:not(.cab-dlg-sheet) { width: 340px; }
}
/* ═══ Phase 18 Stop 3 — touch, on ANY width (brief §57.2 item 4, §57.3):
   keyed on the pointer, not the width. Every target is at least 44 px;
   nothing depends on hover; the gestures are the pointer's. ═══ */
/* "Edit in 3D" on the plan: the touch equivalent of the double-click. Hidden
   until a cabinet is selected (layout.js), and shown only to a coarse pointer
   or once a touch has selected on this plan. */
.room-edit-3d {
  display: none; margin-left: 6px; padding: 0 12px; min-height: 44px; align-items: center;
  background: var(--gold); border: 0; border-radius: var(--r);
  font-family: var(--f-ui); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink); cursor: pointer;
}
.room-edit-3d:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.room-sel-bar.touched .room-edit-3d:not([hidden]) { display: inline-flex; }
@media (pointer: coarse) {
  .room-edit-3d:not([hidden]) { display: inline-flex; }

  /* 44 px targets. Heights only where the look allows; the switch keeps its
     40 × 22 track inside a 44 px box (background-clip + padding), the range
     inputs keep their 4 px track inside a 44 px box. */
  .hdr-nav { min-height: 44px; padding: 0 8px; }
  .hdr-save { height: 44px; }
  .basket-btn { min-height: 44px; }
  .vtbtn { min-height: 44px; padding: 8px 12px; }
  .btn-sm { min-height: 44px; padding-top: 12px; padding-bottom: 12px; }
  .explode-btn { min-height: 44px; padding: 10px 14px; }
  .type-btn { min-height: 44px; }
  .yd-tile { min-height: 44px; }
  .cab-link { min-height: 44px; display: inline-flex; align-items: center; }
  .cab-seg-btn { min-height: 44px; }
  .cab-chip { min-height: 44px; }
  .cab-only-sel { min-height: 44px; }
  .cab-input input { height: 44px; margin: -1px 0; }   /* the field is the whole 44 px box, not the line inside it */
  .logo { min-height: 44px; }
  .text-link { padding: 15px 6px; margin: 0 -6px; }   /* an inline link: the padding grows the target; the margin keeps the line as set */
  /* The 3D view's add-beside and rotate buttons are sized inline (interaction.js):
     a 22/24 px gold disc on a mouse. On touch (§58.3 item 2) the BUTTON is the
     44 px tap area — transparent, centred on its anchor (the margin is half its
     size, as the inline one is) — and the disc it shows is a 32 px ::before
     inside it, so a tap lands easily and the picture keeps a small button. */
  .sab-add-btn {
    width: 44px !important; height: 44px !important; margin: -22px 0 0 -22px !important;
    line-height: 44px !important; font-size: 16px !important;
    background: transparent !important; border: 0 !important; box-shadow: none !important;
    isolation: isolate;   /* the disc's z-index: -1 stays inside the button */
  }
  .sab-add-btn::before {
    content: ''; position: absolute; inset: 6px; z-index: -1; border-radius: 50%;
    background: #C49A2A; border: 1px solid rgba(0, 0, 0, 0.25); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);   /* interaction.js's GOLD, as on a mouse */
  }
  /* Every range: a 44 px box with the 2 px track drawn centred in it (the
     base rule paints the whole box as the track; the sheet's rule already
     draws it this way). A filled range keeps its gold fill, sized the same. */
  input[type=range] { height: 44px; background: linear-gradient(var(--b-dark), var(--b-dark)) center / 100% 2px no-repeat; }
  input[type=range].filled { background-size: 100% 2px; background-position: center; background-repeat: no-repeat; }
  .rp-cab-popover button, .rp-cab-popover select { min-height: 44px; }
  .room-rot-btn, .room-del-btn { min-height: 44px; padding: 0 12px; }
  .pal-item { min-height: 44px; }
  .room-sidebar input[type="number"], .room-sidebar select { min-height: 44px; }
  .sheet-x { width: 44px; height: 44px; }
  .btn-text, .btn-outline, .sheet-done { min-height: 44px; }
  .swatch-chip, .decor-chip, .door-tile, .front-toggle-btn, .finish-chip, .handle-chip, .hw-swatch { min-height: 44px; }
  button.toggle {
    box-sizing: content-box; width: 40px; height: 22px; padding: 11px 2px;
    background-clip: content-box;
  }
  button.toggle::after { top: 14px; left: 5px; }
  button.toggle.on::after { left: 23px; }
}

/* ═══ Phase 18 Stop 4 — the room plan at 900 px and below (brief §58.3 item 1;
   tested at 820×1180 and 768×1024). Appended last, so these win.
   - The room is drawn full width. Nothing sits on top of it: the selected
     unit's controls and the Back / Clear Room bar, which float over the
     canvas on the desktop, are rows UNDER the plan here, and the plan re-fits
     to the room it has left (layout.js rpInit measures the canvas's own share
     of the column).
   - Room size, "Doors, windows, columns & beams", "Add cabinets" and "Your
     design" (Phase 20 Stop 2 — it took the schedule's place; the schedule
     left the plan) are SHEETS, one open at a time, opened from the bar above
     the plan (#rp-bar, in the selection bar): a sidebar section is a sheet
     that rises as the grid's second row (the sidebar is display: contents, so
     its sections are the grid's own items); #s-room carries rp-open-<name>.
   - The selected unit's sheet (#rp-cab-popover) shows while a unit is
     selected and no other sheet is open: its rows in two columns, a close,
     and "Edit in 3D" (#rp-unit-edit-3d) — the bar's Rotate / Remove / Edit
     in 3D are hidden, those live in the sheet.
   Above 900 px none of this applies: the bar, the closes and the sheet
   button do not exist, and the desktop plan is untouched. ═══ */
.rp-bar, .rp-sheet-x, .rp-unit-edit, .rp-hint-touch { display: none; }
.rp-sec { position: relative; }
#room-canvas { touch-action: none; }   /* the plan's own gestures: one finger drags, two pinch and pan */
#three-container canvas { touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }   /* Stop 31 §114.4 item 4: no browser double-tap zoom — a double-tap frames the cabinet (interaction.js); the viewer's own touch handlers orbit, pinch and pan. Stop 51 item 8: a press-and-hold selects a cabinet, so iOS shows no callout or text selection under it. Stop 51 (after the screenshots): none, not manipulation — manipulation let the browser pinch-zoom the whole page as well whenever its touchmove came too late to be cancelled (2 pinches in 6 at 428); the viewer owns every one- and two-finger move here, and the page outside the 3D keeps html's manipulation, so it can still be pinch-zoomed */
@media (pointer: coarse) {
  .rp-hint-mouse { display: none; }
  .rp-hint-touch { display: inline; }
}
@media (max-width: 900px) {
  /* §59.2: every row is the grid's own — the sidebar AND the canvas wrap are
     display: contents — so the order can put the bar first, the plan second
     (the flexible row), a sheet after it and the action row LAST, at the very
     bottom whatever is open. The plan's row keeps 200 px (30 % of a short
     screen): an open sheet scrolls in what is left rather than covering the
     plan's lower edge (§102.3 item 1 — it hid the front wall and its figures). */
  #s-room.active {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(min(200px, 30vh), 1fr);
    grid-auto-rows: auto;
    height: calc(100vh - var(--hdr-h, 64px));
    overflow: hidden; position: relative;
  }
  /* The plan's message as a strip (layout.js rpPlaceStatus, §70.3 item 0c): a
     row between the bar and the plan, so the plan keeps the flexible row. */
  #s-room.rp-strip-on.active { grid-template-rows: auto auto minmax(min(200px, 30vh), 1fr); }
  .room-sidebar { display: contents; }
  .rp-side-only { display: none; }
  .rp-sec { display: none; order: 3; min-height: 0; max-height: 55vh; overflow-y: auto; box-sizing: border-box;
    background: var(--cream); border-top: 1px solid var(--b-light); border-radius: var(--r) var(--r) 0 0;
    padding: 16px 20px 24px; animation: sab-sheet-up 200ms ease-out; }
  #s-room.rp-open-size #rp-sec-size, #s-room.rp-open-fix #rp-sec-fix, #s-room.rp-open-add #rp-sec-add, #s-room.rp-open-design #rp-sec-design { display: block; }
  .rp-sec .sec-hd-inv:first-child { padding-right: 48px; }
  .rp-sheet-x {
    display: flex; position: absolute; top: 8px; right: 8px; width: 44px; height: 44px;
    align-items: center; justify-content: center; background: transparent; border: 0; border-radius: var(--r);
    color: var(--t-mid); font-size: 24px; line-height: 1; cursor: pointer;
  }
  .rp-sheet-x:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
  .rp-sec .cabinet-palette { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rp-sec #fixture-palette { grid-template-columns: repeat(5, minmax(0, 1fr)); }

  /* The column: the bar, the plan, then the unit sheet / schedule / action row. */
  .room-canvas-wrap { display: contents; }
  #room-canvas { order: 1; min-height: 0; }
  .room-sel-bar { order: 0; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 6px 12px; min-height: 56px; }
  .room-sel-bar .sel-lbl, #rp-rotate-btn, #rp-remove-btn, #rp-edit-3d { display: none !important; }
  .rp-bar { display: flex; gap: 8px; flex: 1 1 auto; min-width: 0; }
  .rp-bar-btn {
    flex: 0 0 auto; min-height: 44px; padding: 0 12px; border: 1px solid var(--b-light); border-radius: var(--r);
    background: var(--paper); color: var(--t-mid); font-family: var(--f-ui); font-size: 12px; font-weight: 600;
    letter-spacing: 0.04em; cursor: pointer; white-space: nowrap;
  }
  .rp-bar-btn[aria-expanded="true"] { background: var(--gold-pale); border-color: var(--gold); color: var(--ink); }
  .rp-bar-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  #rp-fit-btn, #rp-undo-btn { flex: 0 0 auto; min-height: 44px; }
  .room-action-bar { position: static; order: 9; flex: 0 0 auto; justify-content: flex-end; padding: 10px 12px; gap: 8px; border-top: 1px solid var(--b-faint); background: var(--paper); flex-wrap: wrap; }

  /* The selected unit's sheet. */
  #s-room .rp-cab-popover {
    position: relative; top: auto; left: auto; order: 2; flex: 0 0 auto; width: auto; max-height: 50vh; overflow-y: auto; box-sizing: border-box;
    background: var(--cream); -webkit-backdrop-filter: none; backdrop-filter: none;
    border: 0; border-top: 1px solid var(--b-light); border-radius: var(--r) var(--r) 0 0;
    padding: 12px 20px 20px; animation: sab-sheet-up 200ms ease-out;
    grid-template-columns: 1fr 1fr; column-gap: 20px; align-items: start;   /* display: grid is set inline by layout.js in sheet mode */
  }
  .rp-cab-popover > .sec-hd-inv:first-child { grid-column: 1 / -1; padding-right: 220px; min-height: 44px; display: flex; align-items: center; }
  .rp-cab-popover .rp-unit-edit { position: absolute; top: 8px; right: 56px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
    background: var(--gold); border: 0; border-radius: var(--r); font-family: var(--f-ui); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); cursor: pointer; }
  .rp-cab-popover .rp-unit-edit:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  .rp-cab-popover > .rp-prop { min-width: 0; }
  .rp-cab-popover > .rp-prop-wide, .rp-cab-popover > .rp-prop-remove { grid-column: 1 / -1; }
  .rp-cab-popover button, .rp-cab-popover select { min-height: 44px; }
  #s-room[class*="rp-open-"] .rp-cab-popover { display: none !important; }   /* one sheet at a time: a section sheet takes the row */
}
@media (prefers-reduced-motion: reduce) { .rp-sec, .rp-cab-popover { animation: none; } }

/* ═══ Phase 20 Stop 9 (§81.4 item 2) — from 901 px up the cabinet edit box
   DOCKS over the left column, instead of floating over the plan: the plan
   stays fully visible (the box used to cover the room's label and the
   selected cabinet's lock and handles). layout.js gives it the column's own
   box (rpPositionCabPopover: left, top, width, height) and makes the column
   behind it inert. The column's cream, its padding and its hairline; a 44 px
   close at the top right; Esc closes it; focus moves into it and back to the
   plan (rpDockSync, rpCloseCabBox). Below 901 px the sheet above is as it was. ═══ */
@media (min-width: 901px) {
  #s-room .rp-cab-popover {
    box-sizing: border-box; overflow-y: auto; z-index: 30;
    background: var(--cream); -webkit-backdrop-filter: none; backdrop-filter: none;
    border: 0; border-right: 1px solid var(--b-faint); border-radius: 0;
    padding: 20px;
  }
  #s-room .rp-cab-popover > .sec-hd-inv:first-child { display: flex; align-items: center; min-height: 44px; padding-right: 52px; margin-bottom: 8px; }
  #s-room .rp-cab-popover .rp-sheet-x {
    display: flex; position: absolute; top: 20px; right: 12px; width: 44px; height: 44px;
    align-items: center; justify-content: center; background: transparent; border: 0; border-radius: var(--r);
    color: var(--t-mid); font-size: 24px; line-height: 1; cursor: pointer;
  }
  #s-room .rp-cab-popover .rp-sheet-x:hover { background: var(--cream-2); color: var(--ink); }
  #s-room .rp-cab-popover .rp-sheet-x:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
  /* Focus is moved onto the box itself when it opens (for the keyboard and a
     screen reader, which reads its name): the box shows a ring only when the
     keyboard brought it there. */
  #s-room .rp-cab-popover:focus { outline: none; }
  #s-room .rp-cab-popover:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
}
/* The plan takes the focus back when the box closes: a ring only for the keyboard. */
#room-canvas:focus { outline: none; }
#room-canvas:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

/* ═══ Phase 20 Stop 2 — the plan becomes the first design screen (brief §68.4).
   Appended last, so these win over the blocks above. ═══ */

/* 1. The view switcher: Plan | 3D | Technical drawing, in the header of every
   design screen (app.js sabSyncViewSwitch shows it and sets body.sab-design).
   Above 1140 px it sits in the masthead, centred between the name and the
   header's own buttons; from 1140 px down it is the header's second row; at
   900 px and below it fills the width. The current view is gold with ink text
   (6.0:1), the others umber on paper; every target is 44 px. The header keeps
   its 64 px above 1140 px, so the 3D's frame does not move there. */
.view-switch { display: flex; align-items: stretch; border: 1px solid var(--b-light); border-radius: var(--r); background: var(--paper); }
.view-switch[hidden] { display: none; }
.vs-btn {
  min-height: 44px; min-width: 44px; padding: 0 18px;   /* "3D" in the tightened 1180 band is narrower than 44 without the min */ border: 0; border-left: 1px solid var(--b-light); background: transparent;
  font-family: var(--f-ui); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--t-mid);
  white-space: nowrap; cursor: pointer;
}
.vs-btn:first-child { border-left: 0; }
.vs-btn:hover:not([aria-current]) { background: var(--cream); color: var(--t-dark); }
.vs-btn[aria-current="page"] { background: var(--gold); color: var(--ink); }
.vs-btn[aria-current="page"] + .vs-btn { border-left-color: var(--gold); }
.vs-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; position: relative; z-index: 1; }
/* §119.1 item 6: the technical drawing, greyed for a customer (a click says when it opens). */
.vs-btn.vs-locked, .vs-btn.vs-locked:hover { background: transparent; color: var(--t-faint); cursor: default; }
.btn.vs-locked, .btn.vs-locked:hover { background: transparent; color: var(--t-faint); border-color: var(--b-light); cursor: default; }
#vs-note { position: fixed; z-index: 1250; padding: 8px 12px; background: var(--ink); color: #fff; font: 500 13px/1.3 var(--f-ui); border-radius: var(--r); box-shadow: 0 6px 18px rgba(20,17,11,0.22); white-space: nowrap; pointer-events: none; }
#vs-note[hidden] { display: none; }
body.sab-design .header { display: grid; grid-template-columns: 1fr auto 1fr; column-gap: 24px; }
body.sab-design .header .logo { justify-self: start; }
body.sab-design .header .header-right { justify-self: end; white-space: nowrap; }   /* its buttons keep their one line: the grid then gives them their full width and the switcher moves over */
/* iPad landscape (1180) keeps one row: the switcher and the gaps close up so
   the header's own buttons (515 px on touch) still fit beside it. */
@media (max-width: 1279px) and (min-width: 1140px) {
  body.sab-design .header { column-gap: 16px; }
  body.sab-design .vs-btn { padding: 0 12px; }
}
@media (max-width: 1139px) {
  body.sab-design { --hdr-h: 120px; }
  body.sab-design .header { grid-template-columns: 1fr auto; grid-template-rows: 63px 56px; height: 120px; column-gap: 0; }   /* no gap: the masthead row is exactly as wide as it was (820 px fits the name and the four buttons with nothing to spare) */
  body.sab-design .view-switch { grid-column: 1 / -1; grid-row: 2; justify-self: center; align-self: center; }
}
@media (max-width: 900px) {
  body.sab-design .view-switch { justify-self: stretch; }
  body.sab-design .vs-btn { flex: 1 1 0; padding: 0 8px; }
}
@media (max-width: 768px) {
  body.sab-design { --hdr-h: 112px; }
  body.sab-design .header { grid-template-rows: 55px 56px; height: 112px; }
}
/* §70.3 item 6: every header target is 44 px, with a mouse too. */
.hdr-save { height: 44px; }
.basket-btn { min-height: 44px; }
/* From 901 to 1139 px (§70.3 item 6) the header's buttons condense so the
   switcher fits on one row with them, and the header keeps its 64 px: the
   gaps close up, Back shows its arrow alone, "Save this design" reads "Save",
   the switcher's buttons tighten. Save and Basket keep their words. The row
   then needs 881 px (the name 230, the switcher 243, the buttons 336, the
   gaps and padding), so it holds across the band; at 900 px and below the
   switcher keeps its own full-width row. */
@media (max-width: 1139px) and (min-width: 901px) {
  body.sab-design { --hdr-h: 64px; }
  body.sab-design .header { padding: 0 20px; grid-template-columns: auto auto auto; grid-template-rows: none; height: 64px; column-gap: 16px; justify-content: space-between; }
  body.sab-design .view-switch { grid-column: auto; grid-row: auto; justify-self: center; }
  body.sab-design .header-right { gap: 6px; }
  body.sab-design #hdr-back { min-width: 44px; justify-content: center; padding: 0; }
  body.sab-design #hdr-back .hdr-lbl, body.sab-design .hdr-save .hdr-more { display: none; }
  body.sab-design .hdr-save { margin-left: 0; padding: 0 12px; }
  body.sab-design .basket-btn { padding: 0 12px; }
  body.sab-design .vs-btn { padding: 0 12px; }
}
/* Design help (Stop 42) is wider than "How it works" was: from 820 to 1139 px, where the masthead's row has no
   room to spare, it drops its "?" and closes up — its words stay. */
@media (max-width: 1139px) and (min-width: 820px) {
  body.sab-design #hdr-help-btn { padding: 0 10px; font-size: 13px; }
  body.sab-design #hdr-help-btn .hdr-help-ico { display: none; }
}
/* Below 820 px (§72.3 item 1). On the design screens the masthead's row (the
   name, then Back, How it works, Save this design and Basket with their words)
   needs 768 px, so below 820 px the buttons ran into the name and off the
   screen, and pushed the page sideways. There the four become 44 px icons,
   each keeping its name for a screen reader (Back and Save by aria-label, How
   it works and Basket by their words, hidden as .sr-only hides them), set in
   two rows of one grid: the name, Back and Basket; the switcher, How it works
   ("?") and Save. Off the design screens (the name, Back and Basket) the words
   go below 480 px, where the row would be wider than the screen; and below
   480 px the header's side padding is 12 px, so at 360 px the name keeps 6 px
   clear of Back. The header keeps its heights, so nothing under it moves. */
.hdr-ico { display: none; }
@media (max-width: 819px) {
  body.sab-design .header { grid-template-columns: minmax(0, 1fr) 44px 44px; column-gap: 6px; }
  body.sab-design .header-right { display: contents; }
  body.sab-design .header .logo { grid-column: 1; grid-row: 1; }
  body.sab-design #hdr-back { grid-column: 2; grid-row: 1; }
  body.sab-design .header .basket-btn { grid-column: 3; grid-row: 1; }
  body.sab-design .view-switch { grid-column: 1; grid-row: 2; justify-self: stretch; min-width: 0; }
  body.sab-design .vs-btn { flex: 1 1 auto; }   /* each as wide as its words, the spare shared: three equal thirds would cut "Technical drawing" */
  body.sab-design #hdr-help-btn { grid-column: 2; grid-row: 2; }
  body.sab-design .hdr-save { grid-column: 3; grid-row: 2; }
  body.sab-design #hdr-back, body.sab-design #hdr-help-btn, body.sab-design .hdr-save, body.sab-design .header .basket-btn {
    width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0; justify-content: center; align-self: center; box-sizing: border-box;
  }
  body.sab-design #hdr-back .hdr-lbl, body.sab-design #hdr-help-btn .hdr-lbl, body.sab-design .header .basket-btn .hdr-lbl {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
  }
  body.sab-design .hdr-save > span { display: none; }
  body.sab-design #hdr-help-btn .hdr-help-ico { display: block; }
  body.sab-design #hdr-back svg { width: 14px; height: 14px; }
  body.sab-design .basket-count { top: -4px; right: -4px; }   /* inside the header's top edge */
}
@media (max-width: 479px) {
  .header { padding: 0 12px; }
  .header-right { gap: 6px; }
  #hdr-back, .header .basket-btn { width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; box-sizing: border-box; }
  #hdr-back .hdr-lbl, .header .basket-btn .hdr-lbl {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
  }
  #hdr-back svg { width: 14px; height: 14px; }
}
/* Below 360 px (§74.1 item 3). The name beside its monogram is 230 px wide,
   and with Back and Basket it needs 342 px, so at 320 px the header ran 22 px
   past the screen. There the lockup is set a step smaller, in proportion: the
   monogram 30 px high, the name at 12 px (its 0.30em spacing kept), 8 px
   between them and at the header's sides. It is then 196 px wide, and stands
   clear of Back on every screen at 320 px. The switcher has 204 px there and
   its three buttons need 211, so "Technical drawing" may take two lines
   inside its 44 px rather than be cut. */
@media (max-width: 359px) {
  .header { padding: 0 8px; }
  body.sab-design .vs-btn { white-space: normal; line-height: 1.15; padding: 0 6px; }
}
/* Stop 51 item 18: with the account in the row too (my-designs.css), that smaller lockup is set below 420 px, and the
   header's sides close to 8 px below 380 px (its buttons' gaps to 5 px: my-designs.css), so a 360 px phone holds the
   name and three icons, 4 px clear. */
@media (max-width: 419px) {
  .logo { gap: 8px; }
  .logo-mono { height: 30px; }
  .logo-name { font-size: 12px; }
}
@media (max-width: 379px) {
  .header { padding: 0 8px; }
}
/* In the 56 px header (768 px and below) the basket's count, 7 px above its
   button, began a pixel above the screen: it sits 4 px above it there. */
@media (max-width: 768px) { .basket-count { top: -4px; right: -4px; } }

/* Both design screens measure their height from the header's (above 900 px the
   rules up the file still said 64 px), and drop the screens' own min-height
   (.screen: 100vh − 64 px), which would hold them open past the screen under
   the taller two-row header. */
#s-room.active, #s-config.active { height: calc(100vh - var(--hdr-h, 64px)); min-height: 0; }
/* The 3D's tab bar lost its tabs to the switcher; it keeps its 36 px, because
   its height sets the 3D canvas's (the golden frames are 920 × 685). */
.viewer-tabs { min-height: 36px; }

/* 2. "Your design" on the plan: the 3D's panel (#yd-panel), moved into the
   plan's right-hand column above 900 px — the same width rule as the 3D's
   options column — and into a sheet under the plan at 900 px and below. */
.yd-panel { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 901px) {
  /* One row the screen's height (§70.3 item 0a): an auto row grew to whatever
     the plan's canvas asked for — its inline height, or with none its pixel
     size — so the canvas could not be measured from its box. */
  #s-room.active { grid-template-columns: 280px minmax(0, 1fr) clamp(300px, 28vw, 400px); grid-template-rows: minmax(0, 1fr); }
  .rp-design { background: white; border-left: 1px solid var(--b-light); overflow-y: auto; padding: 16px; min-height: 0; }
}
@media (max-width: 1120px) and (min-width: 901px) {
  #s-room.active { grid-template-columns: 240px minmax(0, 1fr) 280px; }
}
@media (max-width: 900px) {
  .rp-design .yd-head { padding-right: 48px; }
}

/* 4. The room size boxes — width, depth, ceiling — in a row of three (mockup 4, Stop 44). */
:is(#s-room, #jr-panel) .rp-size-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
:is(#s-room, #jr-panel) .rp-size-fields + .rp-hint { margin-top: 8px; }
/* Stop 72 item 4: a name for each room, under the sizes — a field a row, words (the UI face, not the figures' mono). */
:is(#s-room, #jr-panel) .rp-room-names { display: grid; gap: 8px; margin-top: 14px; }
:is(#s-room, #jr-panel) .rp-room-names .rp-names-hd { margin-bottom: 2px; }
:is(#s-room, #jr-panel) .rp-room-names .rp-fx-field .rp-fx-lbl { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--t-mid); }
:is(#s-room, #jr-panel) .rp-name-input { font-family: var(--f-ui); font-size: 14px; padding-right: 8px; }
:is(#s-room, #jr-panel) .rp-room-names .rp-hint { margin: 0; }
@media (max-width: 900px) { :is(#s-room, #jr-panel) .rp-name-input { font-size: 16px; } }
/* Fit to ceiling (Stop 49 item 5): under the cabinet tiles, a hairline above it; the gap box and the button side by side. */
.rp-ceil { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--b-faint); }
.rp-ceil-hd { font-size: 12px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase; color: var(--t-sub); margin: 0 0 6px; }
:is(#s-room, #jr-panel) .rp-ceil-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-top: 8px; }
.rp-ceil-btn { min-height: 44px; padding: 0 14px; white-space: nowrap; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 600; cursor: pointer; }   /* (Room built's look: the panel's --t-inv is dark) */
.rp-ceil-btn:hover { background: var(--ink-4); border-color: var(--ink-4); }
.rp-ceil-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* …on (Stop 51 item 19): the line saying so, and the way off — a quiet text button, 44 px tall. */
.rp-ceil-state { margin-top: 8px; }
.rp-ceil-off { min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rp-ceil-off:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.rp-ceil-state[hidden], .rp-ceil-off[hidden] { display: none; }

/* 5. A typed wall length: the field opened in place over the figure (layout.js
   rpEditDim). A paper card held by a gold hairline while it is live (no
   interface shadow); the figure in Chivo Mono, a 44 px box, the unit inside. */
.rp-dim-edit {
  position: absolute; z-index: 40; display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px; background: var(--paper); border: 1px solid var(--gold); border-radius: var(--r);
}
.rp-dim-edit[hidden] { display: none; }
.rp-dim-lbl { font-family: var(--f-ui); font-size: 12px; font-weight: 600; color: var(--t-dark); white-space: nowrap; }
/* The wrap hugs its box (§69.1): stretched to the card's width it put the unit,
   pinned to its right edge, over the box's border. */
.rp-dim-wrap { position: relative; display: flex; align-items: center; align-self: flex-start; }
.rp-dim-input {
  width: 128px; min-height: 44px; box-sizing: border-box; padding: 8px 36px 8px 10px;
  border: 1px solid var(--b-light); border-radius: var(--r); background: white;
  font-family: var(--f-mono); font-size: 15px; color: var(--t-dark); -moz-appearance: textfield; appearance: textfield;
}
.rp-dim-input::-webkit-inner-spin-button, .rp-dim-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rp-dim-input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.rp-dim-unit { position: absolute; right: 10px; font-family: var(--f-mono); font-size: 13px; color: var(--t-mid); pointer-events: none; }
.rp-dim-hint { font-family: var(--f-ui); font-size: 12px; color: var(--t-sub); white-space: nowrap; }

/* What the plan has to say (layout.js rpSay): quiet paper with a gold edge;
   it fades. layout.js rpPlaceStatus puts it where it covers none of the plan's
   walls or figures (§70.3 item 0c) — or, where nothing is clear, makes it a
   strip of its own above the plan (.strip: a row of the layout, the plan
   fitted below it). The canvas is ordered after it for that. */
.rp-status {
  position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 35;
  width: max-content; max-width: min(560px, calc(100% - 32px)); box-sizing: border-box; padding: 10px 14px;
  background: var(--paper); border: 1px solid var(--b-light); border-left: 3px solid var(--gold); border-radius: var(--r);
  font-family: var(--f-ui); font-size: 13px; line-height: 1.45; color: var(--t-dark);
  opacity: 0; pointer-events: none; transition: opacity 0.4s;
}
.rp-status.on { opacity: 1; transition-duration: 0.18s; }
.rp-status.strip { position: static; order: 0; transform: none; width: auto; max-width: none; flex: 0 0 auto; border-radius: 0; border-width: 0 0 1px 3px; transition: none; }
#room-canvas { order: 1; }
@media (max-width: 900px) { .rp-status { top: 64px; bottom: auto; } }
@media (prefers-reduced-motion: reduce) { .rp-status { transition: none; } }

/* ═══ Phase 20 Stop 5 — Add cabinets: category tabs, drawn thumbnails, the
   room-feature icons (brief §74). Appended last, so these win. ═══ */

/* The hint above a palette's tiles. */
.rp-hint { margin: 0 0 10px; font-family: var(--f-ui); font-size: 12px; line-height: 1.5; color: var(--t-sub); }

/* 1. The category tabs (§74.2; §83.2 ruling 8, Phase 20 Stop 11): seven real
   buttons as CHIPS sized to their words, wrapping naturally — a grid of three
   per row made rows of three, three and one, and "Counter-height" wrapped at
   1024 px. Each at least 44 px tall, 12 px text, no word ever broken; the
   chosen one (aria-pressed) gold with ink text at weight 600, the others paper
   with a --b-light border. The order stays Base, Wall, Counter-height, Tall,
   Appliances, Wardrobes (Drawers inside Base since Stop 40; the Design step's
   own tabs are an equal-width grid, #rp-cat-tabs below). */
.rp-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; }
.rp-tab {
  flex: 0 0 auto; min-height: 44px; min-width: 44px; box-sizing: border-box; padding: 0 10px; white-space: nowrap;   /* a short word (Tall) still a 44 px target */
  background: var(--paper); border: 1px solid var(--b-light); border-radius: var(--r);
  font-family: var(--f-ui); font-size: 12px; font-weight: 500; line-height: 1.2; color: var(--ink);
  cursor: pointer;
}
.rp-tab:hover { border-color: var(--gold); }
.rp-tab[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); font-weight: 600; }
.rp-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; position: relative; z-index: 1; }
/* From 901 to 1120 px the sidebar is 240 px wide, and a classic scrollbar,
   17 px on Windows, takes its width from that (§76.3 item 0.8): the sides are
   8 px there. (The chips wrap to the width they have, so the tabs no longer
   close up or tighten their letters.) */
@media (max-width: 1120px) and (min-width: 901px) {
  :is(#s-room, #jr-panel) .room-sidebar { padding-left: 8px; padding-right: 8px; }
}

/* 2. The cabinet tiles (§74.3): the drawn thumbnail at the tile's width, the
   name at 12 px / 600 in a two-line slot (so rows line up), the default width
   in Chivo Mono. Paper with a --b-faint border, two columns in the side panel;
   on the Add cabinets sheet (900 px and below, §74.5) as many columns as fit
   at 104 px or wider. */
#cab-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cab-tile, :is(#s-room, #jr-panel) .cab-tile {
  box-sizing: border-box; display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  min-width: 0; min-height: 44px; padding: 6px 6px 8px;
  background: var(--paper); border: 1px solid var(--b-faint); border-radius: var(--r);
  font-family: var(--f-ui); text-align: left; color: var(--ink); cursor: grab;
}
.cab-tile .cab-thumb { display: block; width: 100%; height: auto; margin: 0; pointer-events: none; }
.cab-tile-name { min-height: 32px; font-size: 12px; font-weight: 600; line-height: 16px; overflow-wrap: anywhere; }
.cab-tile-mm { font-family: var(--f-mono); font-size: 12px; line-height: 16px; color: var(--t-sub); }
@media (max-width: 900px) {
  .rp-sec #cab-palette { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}
/* The add-cabinet picker (the 3D) shows the same tabs and tiles on paper
   (§76.3 item 0.5; its card is styled in index.html). A tile there is picked,
   never dragged. */
.sab-pick.cab-tile { cursor: pointer; }
.sab-pick.cab-tile:hover { border-color: var(--b-light); background: var(--cream-2); }
/* "Another <name>, <width> mm" (Phase 20 Stop 9, §81.4 item 1): the first tile
   once a cabinet has been added — a copy of the last one. A row of its own
   across the top of the tiles (the plan's panel and sheet, and the 3D's
   picker), so the tiles under it keep their columns when it appears: the same
   drawn thumbnail on the left, the name and the width beside it. Clicked,
   never dragged. */
.cab-tile.cab-tile-again, :is(#s-room, #jr-panel) .cab-tile.cab-tile-again {
  grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 10px; cursor: pointer;
}
.cab-tile-again .cab-thumb { flex: 0 0 72px; width: 72px; }
.cab-tile-again .cab-tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cab-tile-again .cab-tile-name { min-height: 0; }

/* 3. The room-feature tiles (§74.4): door, window, column, beam, recess /
   breast, each its plan symbol (64 × 48) over a 12 px sentence-case label, in
   three columns in the side panel. On their sheet (900 px and below) as many
   columns as fit at 88 px or wider, so five never squeeze into a phone's row. */
#fixture-palette { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
:is(#s-room, #jr-panel) .fix-tile {
  box-sizing: border-box; display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  min-width: 0; min-height: 44px; padding: 6px 6px 8px;
  background: var(--paper); border: 1px solid var(--b-faint); border-radius: var(--r);
  font-family: var(--f-ui); text-align: left; color: var(--ink); cursor: grab;
}
.fix-tile .fix-ico { display: block; width: 100%; height: auto; pointer-events: none; }
.fix-tile-name { min-height: 32px; font-size: 12px; font-weight: 600; line-height: 16px; }
@media (max-width: 900px) {
  .rp-sec #fixture-palette { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
}

/* ═══ Phase 20 Stop 6 — the phone pass (brief §76.3 item 1). At 320 to 430 px
   in portrait the design path has no overlap, no clipped text, no sideways
   scroll, no text under 12 px and no target under 44 px
   (tests/render/phone-pass.e2e.mjs). The 900 px layouts above were made for a
   tablet held upright; this block is the phone's. Appended last, so it wins. ═══ */

/* The plan's bar (900 px and below) never overlaps itself: its four sheet
   buttons keep their own width, and the bar — they, Undo and Fit — scrolls
   inside its own box when the screen is narrower than it. */
@media (max-width: 900px) {
  .rp-bar { flex: 0 0 auto; }
}
/* The cabinet size editor's labels and figures (layout.js rpUpdateCabinetProps;
   they were inline styles — the same values). */
.rp-prop-lbl { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--t-inv-3, #B7AE9F); }
.rp-prop-val { font-size: 12px; color: var(--t-inv, #F4EFE6); }
/* A derived figure's note under its row (a counter-height cabinet's height, §82.5 item 5). */
.rp-prop-note { font-size: 12px; line-height: 1.3; color: var(--t-inv-3, #B7AE9F); }

@media (max-width: 480px) {
  /* ── Type and targets, everywhere on the path ── */
  .btn, .btn-sm, .btn-lg, .btn-xl { font-size: 12px; letter-spacing: 0.08em; white-space: normal; min-height: 44px; }
  .btn-sm { padding: 10px 14px; }
  .btn-lg { padding: 12px 16px; }
  .btn-xl { padding: 14px 16px; }
  .basket-count { font-size: 12px; min-width: 20px; height: 20px; }
  .badge { font-size: 12px; letter-spacing: 0.04em; }
  .field-label, .sec-hd, .swatch-row-lbl { font-size: 12px; letter-spacing: 0.06em; }
  .field-input { min-height: 44px; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .vat-note, .step-n, .dw-note, .finish-btn-name, .finish-btn-sub { font-size: 12px; }

  /* ── The plan ── */
  .room-rot-btn { font-size: 12px; }
  /* The cabinet size editor: one column; its title clear of the close, "Edit
     in 3D" a row of its own (beside the title it left the title 60 px). */
  #s-room .rp-cab-popover { grid-template-columns: minmax(0, 1fr); }
  .rp-cab-popover > .sec-hd-inv:first-child { padding-right: 52px; }
  .rp-cab-popover .rp-unit-edit { position: static; justify-content: center; margin: 0 0 10px; font-size: 12px; letter-spacing: 0.06em; }
  .rp-prop-lbl, .rp-prop-val { font-size: 12px; }
  /* "Your design": two columns of tiles (four left each 60 px wide). */
  .yd-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yd-tile-wide { grid-column: span 2; }

  /* ── The 3D ── */
  /* The view takes a little less of the height, so the tiles keep a row under it. */
  #s-config.active { grid-template-rows: auto minmax(0, 38vh) minmax(0, 1fr) auto; }
  .vtbtn, .reset-lbl { font-size: 12px; }
  .rail-hd .sec-hd-inv { font-size: 12px; letter-spacing: 0.08em; }
  /* The hints wrap, and "Updates live…" gives its line to the two gestures. */
  .viewer-hint { font-size: 12px; flex-wrap: wrap; gap: 2px 12px; padding: 6px 12px; }
  .viewer-hint span:last-child { display: none; }
  /* Exploded view stands at the top of the view: at the bottom it sat on the hints once they wrapped. */
  .explode-btn { top: 8px; right: 8px; bottom: auto; font-size: 12px; letter-spacing: 0.06em; }
  /* The price row: the price and its ex / inc VAT switch; the route and the
     note under them; then the two buttons, side by side. Nothing overlaps. */
  .cta-bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 12px 10px; }
  .cta-left { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-width: 0; }
  .cta-price-row { display: contents; }
  .cta-price { order: 1; flex: 1 1 auto; font-size: 24px; }
  .cta-left::after { content: ''; order: 3; flex: 0 0 100%; height: 0; }   /* the line ends after the price */
  .cta-route { order: 4; flex: none; font-size: 12px; }
  .cta-price-note { order: 5; flex: 1 1 150px; min-width: 0; font-size: 12px; white-space: normal; }
  .cta-btns { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
  .cta-btns .btn { padding: 8px; }

  /* ── The technical drawing ── */
  .drawing-notice { font-size: 12px; }
  /* The sheet's schedule and title block, one under the other, at 12 px (the drawing above them scales with the sheet). */
  .sv2-foot { flex-direction: column; }
  .stb { width: auto; flex: 0 0 auto; font-size: 12px; }
  .ssc, .ssc th, .stb-k, .stb-note { font-size: 12px; }
  .stb-sub { font-size: 12px; letter-spacing: .2em; }

  /* ── The basket and the forms ── */
  .page-wrap, .enquiry-wrap { padding: 24px 16px; }
  .checkout-wrap { grid-template-columns: minmax(0, 1fr); padding: 24px 16px; gap: 20px; }
  /* Place order: its words and its figure wrap as one sentence (as a row of three they broke apart). */
  #co-place-btn { display: block; text-align: center; line-height: 1.5; }
  .basket-item { grid-template-columns: 60px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .bitem-thumb { width: 60px; height: 52px; }
  .bitem-name { flex-wrap: wrap; gap: 4px 10px; }
  .bitem-remove { display: inline-flex; align-items: center; min-height: 44px; margin-top: 0; font-size: 12px; letter-spacing: 0.08em; }
  /* A line's price is a row of its own under it — the price, then its note. (At 768 px and
     below the price was hidden and its note left alone in the 60 px column under the picture.) */
  .basket-item > :nth-child(3) { grid-column: 1 / -1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
  .bitem-price-main { display: block; font-size: 18px; text-align: left; }
  .bitem-price-note { font-size: 12px; text-align: left; margin-top: 0; }
  .basket-summary { padding: 16px; }
  .sum-total { font-size: 18px; flex-wrap: wrap; gap: 2px 12px; }
}
/* Below 360 px the 3D's two gesture hints share one line without their icons
   (with them they need 309 px and wrapped; the second line fell under the tiles). */
@media (max-width: 359px) {
  .viewer-hint svg { display: none; }
}

/* ═══ Phase 20 Stop 7 — the type pass at wider screens (brief §77.3 item 4): no
   word under 12 px at 768, 1024, 1280 and 1440 px either. The sizes themselves
   are raised where each rule stands, above; this is what the larger type moved.
   ═══ */
/* 481–900 px: the price row's two buttons give up some side padding, so the
   note beside the price (12 px now) keeps to two lines at 768 px as it did at
   11 px, and the price row is no taller. */
@media (max-width: 900px) and (min-width: 481px) {
  .cta-btns .btn { padding-left: 12px; padding-right: 12px; }
  .cta-btns .btn-lg { padding-left: 24px; padding-right: 24px; }
}
/* 901–1279 px: the drawing's pane is 534–700 px wide, and beside the 250 px
   title block the schedule (12 px now) had 224 px for seven columns. The two
   stand one under the other there, as they do on a phone. */
@media (max-width: 1279px) and (min-width: 901px) {
  #drawing-views .sv2-foot { flex-direction: column; }
  #drawing-views .stb { width: auto; flex: 0 0 auto; }
}

/* Tap to place (Stop 26, §106.3 item 2): the banner while a cabinet is being placed. */
#rp-placing { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1200; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; border-radius: 999px; background: var(--ink, #14110b); color: #fff; font: 600 13px/1.2 var(--font-ui, Arial, sans-serif); box-shadow: 0 6px 20px rgba(0,0,0,0.25); max-width: calc(100vw - 32px); }
#rp-placing[hidden] { display: none; }
#rp-placing .rp-placing-cancel { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.4); background: transparent; color: #fff; font: inherit; cursor: pointer; }
#rp-placing .rp-placing-cancel:active { background: rgba(255,255,255,0.18); }
/* §119.1 item 5: the hint's icon and words; the tile picked up; the picture on the pointer. */
#rp-placing .rp-placing-ico { flex: none; width: 20px; height: 20px; }
#rp-placing .rp-placing-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#rp-placing .rp-placing-what { font-weight: 400; font-size: 12px; opacity: 0.8; }
:is(#s-room, #jr-panel) .pal-item.is-picked, :is(#s-room, #jr-panel) .pal-item.is-picked:hover { border-color: var(--gold); background: var(--gold-dim); box-shadow: inset 0 0 0 1px var(--gold); }
#rp-pick { position: fixed; left: 0; top: 0; z-index: 1300; pointer-events: none; padding: 4px; background: var(--paper); border: 1.5px solid var(--gold); border-radius: var(--r); box-shadow: 0 6px 18px rgba(20,17,11,0.22); }
#rp-pick[hidden] { display: none; }
#rp-pick .rp-pick-art { display: block; width: 56px; }
#rp-pick .rp-pick-art svg { display: block; width: 56px; height: auto; max-height: 56px; }
#rp-pick .rp-pick-badge { position: absolute; top: -9px; right: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: #fff; font: 700 15px/18px var(--f-ui); text-align: center; }

/* Pressed at once (Stop 26, §106.3 item 3): no tap delay on any button-like control, and the pressed look on the press itself. */
button, [role="button"], [role="tab"], [role="radio"], [role="switch"], .pal-item, .rp-tab, .rp-fx-seg, .vtbtn, .mat-card, .door-card, .decor-chip, .finish-btn, input[type="range"], label.chip { touch-action: manipulation; }
button:active, [role="button"]:active, [role="tab"]:active, [role="radio"]:active, [role="switch"]:active, .pal-item:active, .rp-tab:active, .rp-fx-seg:active, .vtbtn:active { filter: brightness(0.88); transform: scale(0.97); transition: none; }

/* ═══ Stop 36: the journey shell (lead) — steps rail | the step's panel | one canvas ═══
   index.html #s-room. The empty regions take no room until an agent fills them.
   Each agent's own rules go in its block below, never in another's. */
.jr-gimbal:empty, .jr-price:empty, .jr-panel-hd:empty, .jr-nav:empty { display: none; }
@media (min-width: 901px) {
  #s-room.active { grid-template-columns: 156px 332px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .jr-rail { min-height: 0; overflow-y: auto; background: var(--paper); border-right: 1px solid var(--b-faint); }
  /* The panel holds still — its heading at the top, Back / Next at the foot — and the step between them scrolls,
     so nothing is ever under the buttons (found at the gate: a press on a step's last box landed on Back under a
     sticky foot, and the type pass saw content under it). position: relative on both — the containing block for
     their absolutely placed parts (each chip's .sr-only name), so they clip with them instead of stretching the
     page (the page scrolled 3908 px on the Style step). */
  .jr-panel { position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--cream); border-right: 1px solid var(--b-faint); }
  .jr-panel > .jr-step:not([hidden]) { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .jr-panel > .room-sidebar { flex: none; border-right: 0; overflow: visible; }
  .jr-panel > .rp-design { flex: none; border-left: 0; overflow: visible; }
  .jr-nav { flex: none; margin-top: auto; }
  .jr-gimbal { position: absolute; top: 64px; right: 16px; z-index: 20; }
  .jr-price { flex: none; }
  /* Steps 5 and 6 hold the old sidebar's sections in a .room-sidebar (its tokens): one inset with steps 1–4, not a box in a box. */
  .jr-step > .room-sidebar { padding: 0; background: transparent; border: 0; }
}
@media (max-width: 1120px) and (min-width: 901px) {
  #s-room.active { grid-template-columns: 120px 300px minmax(0, 1fr); }
}
@media (min-width: 901px) {
  /* The 3D screen takes the same shell (app.js sabPlaceShell): its cabinet-type rail and options
     column give way to the steps rail and panel; cabinets are added from the panel's palette. */
  #s-config.active { grid-template-columns: 156px 332px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  #s-config > .type-panel, #s-config > .opts-panel { display: none; }
  #s-config .viewer { position: relative; min-width: 0; }
}
@media (max-width: 1120px) and (min-width: 901px) {
  #s-config.active { grid-template-columns: 120px 300px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .jr-panel { display: contents; }
  .jr-rail, .jr-panel-hd, .jr-step, .jr-nav { display: none; }
  /* The 3D below 900 px keeps its own rail drawer and options; the shell's panel is the plan's. */
  #s-config > .jr-panel { display: none; }
}

/* ── Stop 36 Agent A: one canvas, gimbal, trackpad ── */
/* The view gimbal (§119.2, the approved mockup): paper on a hairline, the cube
   that turns the view, then Plan · Iso · 3D — the view shown in ink with paper
   text (17.6:1), the others umber on paper; every target 44 px. Top right of the
   canvas region on both screens (the shell's rule above 900 px places it). */
.jr-gimbal { display: flex; align-items: center; gap: 6px; padding: 4px; background: var(--paper); border: 1px solid var(--b-light); border-radius: var(--r); box-shadow: 0 2px 8px rgba(20,17,11,0.08); }
.jg-orbit { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: grab; touch-action: none; }
.jg-orbit:active { cursor: grabbing; }
.jg-views { display: flex; border: 1px solid var(--b-light); }
.jg-btn { min-width: 52px; min-height: 44px; padding: 0 10px; border: 0; border-left: 1px solid var(--b-light); background: var(--paper); color: var(--t-mid);
  font-family: var(--f-ui); font-size: 13px; font-weight: 500; cursor: pointer; }
.jg-btn:first-child { border-left: 0; }
.jg-btn:hover:not([aria-pressed="true"]) { background: var(--cream); }
.jg-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 600; }
.jg-btn:focus-visible, .jg-orbit:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; position: relative; z-index: 1; }
/* Above 900 px the gimbal floats at the view's top right, over the drawing too: the drawing's notice stops short of
   it (found at the gate, type-pass: the notice ran under it). */
@media (min-width: 901px) { #vpane-2d .drawing-notice { margin-right: 260px; } }
/* 900 px and below: the gimbal sits at the end of the screen's bar (app.js sabPlaceShell) —
   the plan's bar, the 3D's tab bar — never over the room, Exploded view or the drawing's
   notice; without its cube (the 3D orbits by touch and drag), the three views at 44 px.
   The 3D pane is pinned to its grid cell (the viewer is display: contents here), or
   auto-placement would push it to a column of its own. */
@media (max-width: 900px) {
  /* The plan: at the end of the bar above it (app.js sabPlaceShell) — nothing floats over the room here —
     without the cube (Iso and 3D orbit in the 3D), the three views at 44 px. */
  #rp-sel-bar .jr-gimbal, #s-config .viewer-tabs .jr-gimbal { position: static; flex: none; margin-left: auto; padding: 2px; box-shadow: none; }
  #rp-sel-bar .jg-orbit, #s-config .viewer-tabs .jg-orbit { display: none; }
  #rp-sel-bar .jg-btn, #s-config .viewer-tabs .jg-btn { min-width: 44px; padding: 0 8px; }
  #s-config .viewer-body { grid-column: 1; }
}


/* ── Stop 36 Agent B: left panel and steps ── */
/* The mock-up Steve approved (21 Oct, §119.4): a paper rail and panel; the
   current step enlarged on cream; "STEP n OF 6" in gold mono over the step's
   serif title and its tip; Back / Next at the panel's foot. Gold text this
   small is drawn in a deeper gold (--jr-gold, 4.6:1 on paper and on cream —
   the brand gold is 2.8:1 there), as --gold-text is for large text. */
.jr-rail, .jr-panel { --jr-gold: #806426; }
@media (min-width: 901px) {
  .jr-panel { background: var(--paper); }
  /* The plan's parked sidebar belongs to steps 4 and 5 (Agent D): not shown with the design's choices. */
  #jr-panel:not([data-step="4"]):not([data-step="5"]) > .room-sidebar { display: none; }
  /* The old "Your design" tiles go (§119.2): what they opened lives in the steps, once. The element
     stays for 900 px and below and for the cabinet dialog's "This cabinet only" rows (index.html). */
  #jr-panel > #rp-sec-design { display: none; }
  /* The cabinet dialog docks over the step panel (cab-editor-modal.js): the panel's foot, beside the price, reads as behind. */
  .cab-dock-open > .jr-panel { opacity: 0.45; transition: opacity 0.2s ease; }
}
.jr-steps { list-style: none; margin: 0; padding: 16px 0; display: flex; flex-direction: column; gap: 2px; }
.jr-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 44px;
  padding: 10px 16px; background: transparent; border: 0; border-radius: 0; text-align: left; cursor: pointer;
  font-family: var(--f-ui); color: var(--ink);
}
.jr-tab:hover { background: var(--gold-dim); }
.jr-tab[aria-current="step"] { padding-top: 14px; padding-bottom: 14px; background: var(--cream); }
.jr-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.jr-num { font-family: var(--f-mono); font-size: 12px; color: var(--t-sub); }   /* 12 px: the type pass's floor (§78), not the mock-up's 11 */
.jr-tab[aria-current="step"] .jr-num { color: var(--jr-gold); }
.jr-lbl { font-size: 13px; line-height: 1.25; }
.jr-tab[aria-current="step"] .jr-lbl { font-size: 16px; font-weight: 600; }
.jr-sum { font-size: 12px; line-height: 1.3; color: var(--t-sub); }
.jr-sum[hidden] { display: none; }
.jr-panel-hd { position: sticky; top: 0; z-index: 2; padding: 20px 24px 12px; background: var(--paper); border-bottom: 1px solid var(--b-faint); }
.jr-kicker { margin: 0; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--jr-gold); }
.jr-title { margin: 4px 0 0; font-family: var(--f-head); font-size: 28px; font-weight: 400; line-height: 1.15; color: var(--ink); }
.jr-tip { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--t-mid); }
/* Laid out from 901 px up only: at 900 px and below the shell block hides the panes and the nav. */
@media (min-width: 901px) {
  .jr-step:not([hidden]) { display: flex; flex-direction: column; gap: 24px; padding: 16px 24px 24px; }
  .jr-nav { display: flex; align-items: center; gap: 8px; padding: 12px 24px; background: var(--paper); border-top: 1px solid var(--b-faint); }
}
.jr-back, .jr-next {
  height: 44px; padding: 0 16px; border-radius: var(--r); cursor: pointer;
  font-family: var(--f-ui); font-size: 14px; font-weight: 500; color: var(--ink);
}
.jr-back { background: transparent; border: 1px solid var(--b-light); }
.jr-next { margin-left: auto; padding: 0 20px; background: var(--gold); border: 0; font-weight: 600; }
.jr-back[hidden], .jr-next[hidden] { display: none; }
.jr-back:focus-visible, .jr-next:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 1120px) and (min-width: 901px) {
  .jr-tab { padding-left: 12px; padding-right: 12px; }
  .jr-panel-hd, .jr-step:not([hidden]), .jr-nav { padding-left: 16px; padding-right: 16px; }
}
/* A step's groups: a small spaced label over its choices. A choice is paper
   with a hairline; the chosen one cream with a 2 px gold rule (1 px border +
   1 px inset, so nothing shifts); every target at least 44 px. */
.jr-group { display: flex; flex-direction: column; gap: 10px; }
.jr-group[hidden], .jr-line[hidden] { display: none; }
.jr-h { margin: 0; font-family: var(--f-ui); font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t-sub); }
.jr-cards, .jr-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.jr-chips { gap: 8px; }
.jr-mats { display: flex; flex-direction: column; gap: 8px; }
.jr-card, .jr-chip, .jr-mat {
  background: var(--paper); border: 1px solid var(--b-light); border-radius: var(--r); color: var(--ink); font-family: var(--f-ui);
}
.jr-card.is-on, .jr-chip.is-on, .jr-mat.is-on { background: var(--cream); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.jr-card { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 44px; padding: 14px 8px; cursor: pointer; }
.jr-card-art { display: flex; height: 60px; align-items: center; }
.jr-card-art svg { height: 60px; width: auto; }
.jr-card-name { font-size: 14px; font-weight: 500; }
.jr-card.is-on .jr-card-name { font-weight: 600; }
/* Details (Stop 87 item 1): three to a row, each card its drawing, its name and what it does to the price. */
.jr-dt-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jr-dt-card { padding: 10px 6px; gap: 4px; text-align: center; }
.jr-card-sub { font-size: 12px; line-height: 1.3; color: var(--ink-3, #746753); }
.dd-differs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink); font-weight: 500; }
.jr-mat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 0 10px 0 12px; }
.jr-mat-pick {
  display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 56px; padding: 8px 0;
  background: none; border: 0; text-align: left; cursor: pointer; font-family: var(--f-ui); color: var(--ink);
}
.jr-mat-txt { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.jr-mat-name { font-size: 14px; font-weight: 500; }
.jr-mat.is-on .jr-mat-name { font-weight: 600; }
.jr-mat-sub { font-size: 12px; line-height: 1.35; color: var(--t-sub); }
.jr-mat-pick .bespoke-tag, .jr-chip .bespoke-tag { flex: none; margin-left: auto; }
.jr-mat-pick:disabled { cursor: not-allowed; opacity: 0.55; }
/* The "i": a 32 px round button, an italic serif i (the mock-up); its press area is 44 px. */
/* The button is the 44 px target itself (the iPad audit measures the box, portrait-touch); the mock-up's 32 px
   circle is drawn behind the letter (Stop 36 gate). */
.jr-i {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; margin: -6px; padding: 0 0 1px; border: 0;
  background: transparent; cursor: pointer; font-family: var(--f-head); font-style: italic; font-size: 17px; line-height: 1; color: var(--ink);
}
.jr-i::before { content: ''; position: absolute; inset: 6px; z-index: -1; border-radius: 50%; border: 1px solid var(--b-light); background: var(--paper); }
.jr-i[aria-expanded="true"] { color: var(--paper); }
.jr-i[aria-expanded="true"]::before { background: var(--ink); border-color: var(--ink); }
.jr-note { grid-column: 1 / -1; margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--t-mid); }
.jr-h-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }   /* a group's heading with its "i" (the carcass board's, §127.2 item 5) */
.jr-note[hidden] { display: none; }
.jr-chip { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; text-align: left; font-size: 13px; cursor: pointer; }
.jr-chip.is-on .jr-chip-name { font-weight: 600; }
.jr-sw { flex: none; width: 22px; height: 22px; border: 1px solid var(--b-light); background-size: cover; background-position: center; }
.jr-line { margin: 0; font-size: 13px; line-height: 1.5; color: var(--t-mid); }
.jr-card:focus-visible, .jr-chip:focus-visible, .jr-mat-pick:focus-visible, .jr-i:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.jr-slot:empty, .jr-slot[hidden] { display: none; }
.jr-slot { display: flex; flex-direction: column; gap: 16px; }
/* The sheets' controls in a 284 px pane: two samples to a row, shorter samples. */
#jr-panel .swatch-row, #jr-panel .wt-grid, #jr-panel .decor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#jr-panel .swatch-chip-sample, #jr-panel .wt-sample, #jr-panel .decor-chip-sample { height: 56px; }
#jr-panel .paint-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
#jr-panel .finish-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
/* The worktop section carries its own "Worktop" heading — the step's title says it. */
#jr-panel #worktop-row > .sheet-h3 { display: none; }
#jr-panel .hw-picker .hw-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); }


/* ── Stop 36 Agent C: Direct / Bespoke ── */
/* The opening page (§119.2, the approved mockup): 01 what you are designing, 02 how
   you would like to order — two large cards, Direct preselected — then the summary
   and "Start designing". Left-aligned, numbered; the six rooms in one row from
   1100 px. The card grows down the page (auto margins) and is never cut at the top
   when it is taller than the screen. (The room cards' own rules: index.html.) */
#s-setup.active { align-items: flex-start; padding: 24px 0; box-sizing: border-box; }
#s-setup .rt-card { width: min(1080px, calc(100% - 32px)); margin: auto; padding: 32px 40px; text-align: left; display: flex; flex-direction: column; gap: 32px; }
.rt-q { display: flex; flex-direction: column; gap: 16px; }
.rt-step { display: flex; align-items: baseline; gap: 16px; }
.rt-num { font-family: var(--f-mono); font-size: 13px; color: var(--gold-text); }
#s-setup .rt-title { margin: 0; font-size: clamp(26px, 3vw, 34px); }
#s-setup .rt-sub { margin: -8px 0 0; }
#s-setup .rt-choice.sel { background: var(--cream); border: 2px solid var(--gold); }
@media (min-width: 1100px) { #s-setup .rt-choices { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.mode-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.mode-choice { display: flex; flex-direction: column; gap: 14px; padding: 28px 32px; text-align: left; cursor: pointer;
  background: var(--paper); border: 1px solid var(--b-light); border-radius: var(--r3); color: var(--t-dark); font-family: var(--f-ui);
  transition: border-color .15s, background-color .15s; }
.mode-choice:hover { border-color: var(--gold); }
.mode-choice[aria-checked="true"] { background: var(--cream); border: 2px solid var(--gold); padding: 27px 31px; }
.mode-choice:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mode-hd { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mode-name { font-family: var(--f-head); font-size: 30px; line-height: 1.1; }
.mode-tag { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-mid); border: 1px solid var(--b-light); padding: 4px 10px; white-space: nowrap; }
.mode-copy { font-size: 15px; line-height: 1.55; color: var(--t-mid); }
.mode-list { display: flex; flex-direction: column; font-size: 14px; line-height: 1.7; color: var(--t-mid); }
.mode-list > span { position: relative; padding-left: 18px; }
.mode-list > span::before { content: ''; position: absolute; left: 4px; top: 0.78em; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.rt-go { display: flex; justify-content: flex-end; align-items: center; gap: 24px; flex-wrap: wrap; }
.rt-summary { font-size: 14px; color: var(--t-sub); }
.rt-start { min-height: 52px; background: var(--ink); border-color: var(--ink); color: var(--paper); font-size: 14px; letter-spacing: 0.14em; }
.rt-start:disabled { opacity: 0.5; cursor: not-allowed; }
/* A laptop's screen (1366 × 768, 1280 × 800): the same page, its spacing tightened so "Start designing" shows
   without a scroll (Stop 43 review: it sat below the fold). */
@media (min-width: 1100px) and (max-height: 860px) {
  #s-setup.active { padding: 8px 0; }
  #s-setup .rt-card { padding: 20px 40px; gap: 18px; }
  .mode-choice { padding: 20px 32px; gap: 10px; }
  .mode-choice[aria-checked="true"] { padding: 19px 31px; }
  .mode-list { line-height: 1.55; }
}
@media (max-width: 760px) {
  #s-setup .rt-card { padding: 24px 20px; gap: 24px; }
  .mode-choices { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .mode-choice { padding: 20px; }
  .mode-choice[aria-checked="true"] { padding: 19px; }
  .mode-name { font-size: 24px; }
  .rt-go { justify-content: stretch; }
  .rt-start { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .mode-choice { transition: none; } }

/* The switch, Direct order | Bespoke (§119.2), on the design screens only; the one on
   is ink. From 1380 px it is the header's, in the masthead's first cell with the logo
   (the logo at its start, the switch at its end, beside the view switcher). Below
   that the cell has no room beside the name (they meet at 1370 px since Stop 42's
   Design help and My designs; 1302 px before), and the price bar's copy takes the
   mode tag's place (the bar is the 3D's only at 900 px and below). */
.mode-switch { display: none; border: 1px solid var(--b-light); }
@media (min-width: 1380px) {
  body.sab-design .header .logo { grid-column: 1; grid-row: 1; }
  body.sab-design .header .mode-switch { display: flex; grid-column: 1; grid-row: 1; justify-self: end; }
}
@media (max-width: 1379px) {
  .jr-price .jr-bar-switch { display: flex; flex: none; }
  .jr-price #cta-route-info { display: none; }
}
.mode-switch button { min-height: 44px; padding: 0 16px; border: 0; background: var(--paper); color: var(--t-dark); font: 400 13px/1 var(--f-ui); white-space: nowrap; cursor: pointer; }
.mode-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 600; }
.mode-switch button:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }

/* The price bar (§119.2): 72 px under the one canvas, on the plan and the 3D — a
   mono tag (the order mode), the price in mono and its line, the gold button on the
   right; over it, only when a Direct design can't be ordered, the strip saying why. */
.jr-price { flex: none; display: flex; flex-direction: column; background: var(--paper); border-top: 1px solid var(--b-faint); }
.jr-price .cta-bar { min-height: 72px; box-sizing: border-box; padding: 10px 24px; background: var(--paper); border-top: 0; }
.jr-price .cta-price { flex: none; font-size: 26px; font-weight: 400; color: var(--t-dark); white-space: nowrap; }   /* ("Priced after survey" keeps its one line) */
.jr-price #cta-route-info { flex: none; }
.jr-mode-tag { white-space: nowrap; font-family: var(--f-mono); font-size: 12px; font-weight: 400; letter-spacing: 0.1em; color: var(--t-mid); background: transparent; border: 1px solid var(--b-light); border-radius: 0; padding: 3px 8px; }
@media (min-width: 901px) {
  .jr-price .cta-left { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 4px; }
}
@media (min-width: 1400px) {   /* one row, as on the mockup: the note wraps beside the price before the tag leaves it */
  .jr-price .cta-left { flex-wrap: nowrap; min-width: 0; }
  .jr-price .cta-price-note { min-width: 0; }
}
.jr-block { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 24px; background: var(--cream); border-bottom: 1px solid var(--b-faint); font-size: 13px; line-height: 1.45; color: var(--t-dark); }
.jr-block[hidden] { display: none; }
.jr-block .btn { flex: none; min-height: 44px; }
.cta-btns #cta-main-btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* Under the plan (its canvas is order 1), and the plan's Back and Clear Room keep above
   it however tall it wraps (checkout.js sets --jr-bar-h). */
#jr-canvas > .jr-price { order: 2; }
#jr-canvas > .room-action-bar { bottom: calc(var(--jr-bar-h, 72px) + 24px); }
@media (max-width: 900px) {
  #s-config .jr-price { grid-row: 4; }       /* the 3D's .viewer is display: contents there: the bar is its grid row */
  #s-room .jr-price { display: none; }       /* the plan at 900 px and below stays as it was (the phone layout is its own stop) */
}

/* Bespoke-only in Direct (shared with Agents B and D): the control greyed but still
   focusable — a press offers Bespoke (sabOfferBespoke) — and tagged BESPOKE. */
.is-bespoke-only { opacity: 0.5; }
/* 12 px, not the mock-up's 10: every label 12 px or more since the type pass (§78, Stop 7; cab-palette 4 at the Stop 36 gate). */
.bespoke-tag { display: inline-block; font-family: var(--f-mono); font-size: 12px; font-weight: 400; letter-spacing: 0.08em; line-height: 1.3; color: var(--t-mid); border: 1px solid var(--b-light); padding: 2px 6px; white-space: nowrap; }
/* The note a Bespoke-only press brings, at the top of the step panel: "Switch to Bespoke" or "Stay in Direct". */
.jr-bespoke-note { margin: 12px 24px 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--cream); border: 1px solid var(--b-light); font-size: 13px; line-height: 1.45; color: var(--t-dark); }
.jr-bespoke-note[hidden] { display: none; }
.jr-bn-text { margin: 0; }
.jr-bn-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.jr-bn-btns .btn { min-height: 44px; text-transform: none; letter-spacing: 0; font-size: 13px; }
@media (max-width: 900px) {
  .jr-bespoke-note { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1200; margin: 0; }
}


/* ── Stop 36 Agent D: build your room, design, drag and drop ── */
/* The steps 4 and 5 panes (index.html) each hold the old sidebar's sections in a
   .room-sidebar of their own — its look, its tokens, its 20 px gaps — inside the
   panel, which scrolls (the lead's block). The panel-content rules above that
   were scoped #s-room are :is(#s-room, #jr-panel) since Stop 36, so they hold
   while app.js sabPlaceShell has the panel on the 3D screen. */
.jr-step > .room-sidebar { border-right: 0; overflow: visible; }
@media (max-width: 900px) {
  /* The sheets live in these panes: they stay in the grid (the lead's block hides .jr-step here). */
  #jr-step-4, #jr-step-5 { display: contents; }
  #jr-step-4 .rp-lock-note { display: none; }   /* (.rp-side-only, which its own display: flex below would outrank) */
}

/* 1. Build your room — the lock (§119.2: "Room built" locks the room; going back unlocks it). */
.rp-lock-note {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px;
  background: var(--cream-2); border: 1px solid var(--b-light); border-radius: var(--r);
  font-family: var(--f-ui); font-size: 13px; line-height: 1.4; color: var(--t-dark);
}
.rp-lock-note[hidden] { display: none; }
.rp-lock-note svg { flex: none; }
.rp-room-built {
  min-height: 48px; padding: 0 16px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.rp-room-built:hover { background: var(--ink-4); border-color: var(--ink-4); }
.rp-room-built.is-locked { background: var(--paper); color: var(--ink); border-color: var(--b-light); }
.rp-room-built.is-locked:hover { border-color: var(--ink); }
.rp-room-built:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
#jr-panel .pal-item.is-locked, #jr-panel .pal-item.is-locked:hover { opacity: 0.45; cursor: not-allowed; border-color: var(--b-faint); background: var(--paper); }
#jr-panel .rp-fx-num:disabled { background: var(--cream-2); color: var(--t-sub); cursor: not-allowed; }

/* 2. Design your kitchen — the category tabs along the top of the pane (§119.2:
   "sub-tabs along the top … active one highlighted and enlarged"): the chosen
   one ink with paper text, 14 px at 600 against the others' 12 px. Since Stop 40
   (§127.2 item 3: Drawers inside Base) the six are equal-width in a tidy grid —
   two to a row in the 284 px pane and on a phone (three would leave
   "Counter-height" 90 px, too narrow for it unbroken), three to a row in the
   sheet from 600 px. Above 900 px the panel's header names the step, so the
   sheet's own heading stands down. */
#rp-cat-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
#rp-cat-tabs .rp-tab { min-width: 0; padding: 0 4px; }   /* (the word centred in its cell: the pressed "Counter-height" at 14 px fits a 111 px cell — 901–1120 px with a classic scrollbar) */
#rp-cat-tabs .rp-tab[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); font-size: 14px; font-weight: 600; }
@media (min-width: 600px) and (max-width: 900px) { #rp-cat-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 901px) {
  #jr-step-5 #rp-sec-add > .sec-hd-inv:first-child { display: none; }
}

/* 3. Drag and drop (§119.4: "with no text selection"): a tile moves like an
   object — its words are never selected (layout.js also stops the browser's
   own selection and drag while a tile is pressed), and a finger drags it
   sideways out of the panel while an up or down swipe still scrolls it. */
.pal-item { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#cab-palette .pal-item, #fixture-palette .pal-item { touch-action: pan-y; }


/* ── Stop 42 Window A: the guided setup (§128.1; the mock-up 3-guided-setup) ──
   Full screen under the header, over the plan (index.html #jr-guide, journey.js): the progress row of five
   steps; the question on the left (the step panes, moved in) and the live preview on cream on the right;
   Back, the hint and Next along the foot. Next is ink, the last step's "Build your room" gold; a step not
   yet answered greys Next and the hint says what is missing. 820 px keeps both columns; under 600 px one
   column with the preview held at the top. */
.jr-guide { position: fixed; top: var(--hdr-h, 64px); left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--paper); color: var(--ink); font-family: var(--f-ui); --jr-gold: #806426; }
.jr-guide[hidden] { display: none; }
/* What it covers — the rail, the step panel, the canvas — is out of Tab's reach and a screen reader's too (Stop 43
   review); laid out as ever underneath, so nothing moves when the guide goes. */
#s-room.jr-guiding > :not(#jr-guide) { visibility: hidden; }
.sg-progress { padding: 0 32px; border-bottom: 1px solid var(--b-faint); }
.sg-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sg-step { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 56px; box-sizing: border-box; border-bottom: 3px solid transparent; font-size: 14px; color: var(--t-sub); }
.sg-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--b-light); font-family: var(--f-mono); font-size: 12px; color: var(--t-sub); }
.sg-step.is-done { border-bottom-color: var(--ink); color: var(--ink); }
.sg-step[aria-current="step"] { border-bottom-color: var(--gold); color: var(--ink); font-weight: 600; }
.sg-step.is-done .sg-num, .sg-step[aria-current="step"] .sg-num { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.sg-body { display: grid; grid-template-columns: minmax(0, 720px) minmax(0, 1fr); min-height: 0; }
.sg-q { position: relative; min-height: 0; overflow-y: auto; box-sizing: border-box; padding: 32px 48px 24px; display: flex; flex-direction: column; gap: 22px; }
.sg-hd { display: flex; flex-direction: column; gap: 6px; }
.sg-kicker { margin: 0; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--jr-gold); }
.sg-title { margin: 0; font-family: var(--f-head); font-size: 40px; font-weight: 400; line-height: 1.1; color: var(--ink); }
.sg-title:focus { outline: none; }
.sg-title:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.sg-lede { margin: 0; font-size: 15px; line-height: 1.5; color: var(--t-mid); }
.sg-lede[hidden] { display: none; }
.sg-preview { min-height: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; background: var(--cream); border-left: 1px solid var(--b-faint); }
.sg-art { width: 100%; max-width: 640px; }
.sg-art svg { display: block; width: 100%; height: auto; max-height: 60vh; }
.sg-sum { margin: 0; font-family: var(--f-head); font-size: 22px; line-height: 1.25; text-align: center; color: var(--ink); }
.sg-sum2 { margin: 0; min-height: 1.45em; font-size: 13px; line-height: 1.45; text-align: center; color: var(--t-mid); }   /* (its line kept while empty: the preview does not jump) */
.sg-nav { display: flex; align-items: center; gap: 16px; min-height: 76px; box-sizing: border-box; padding: 12px 32px; background: var(--paper); border-top: 1px solid var(--b-faint); }
.sg-back, .sg-next { flex: none; min-height: 48px; padding: 0 18px; border-radius: var(--r); font-family: var(--f-ui); font-size: 14px; color: var(--ink); cursor: pointer; }
.sg-back { background: var(--paper); border: 1px solid var(--b-light); }
.sg-back[hidden] { display: block; visibility: hidden; }   /* (its room kept, so Next stays put on the first step) */
.sg-hint { flex: 1 1 auto; margin: 0; text-align: center; font-size: 13px; line-height: 1.45; color: var(--t-mid); }
.sg-next { min-height: 52px; padding: 0 26px; background: var(--ink); border: 0; color: var(--paper); font-weight: 600; }
.sg-next.is-build { background: var(--gold); color: var(--ink); letter-spacing: 0.12em; }
.sg-next:disabled, .sg-next.is-off { background: var(--b-light); color: var(--t-mid); cursor: not-allowed; }
.sg-next.is-off { cursor: pointer; }   /* (still pressed: it shows what is missing, Stop 49 item 1) */
.sg-back:focus-visible, .sg-next:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* The question Next is waiting for (Stop 49 item 1, journey.js flag): a gold outline round its choices, a short line over them. */
.jr-guide .sg-flag { outline: 2px solid var(--gold); outline-offset: 6px; border-radius: var(--r); }
.sg-flag-line { margin: 0 0 4px; padding-left: 10px; border-left: 3px solid var(--gold); font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink); }
/* The step panes in the guide: the panel's own parts at the guide's width — the cards two to a row, as the mock-up. */
.jr-guide .jr-step:not([hidden]) { display: flex; flex-direction: column; gap: 22px; padding: 0; }
.jr-guide .jr-mats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.jr-guide .jr-bespoke-note { margin: 0; }
.jr-guide #jr-wt-none { padding: 20px; background: var(--cream); border: 1px solid var(--b-faint); font-size: 15px; line-height: 1.5; color: var(--ink); }
.jr-guide #worktop-row > .sheet-h3 { display: none; }   /* (the step's title names it) */
#paint-section.sg-pending > :not(#paint-mode-lbl):not(#paint-mode) { display: none; }   /* (journey.js: no colours before primed or painted is answered) */
#fs-carcass-body.sg-pending, #front-construction-note.sg-pending, #handle-picker.sg-pending .hw-caption { display: none; }   /* (…nor a line naming a pick not made yet) */
@media (max-width: 1120px) {
  .sg-progress, .sg-nav { padding-left: 24px; padding-right: 24px; }
  .sg-q { padding: 24px 28px; }
  .sg-title { font-size: 32px; }
}
@media (max-width: 900px) {
  .sg-body { grid-template-columns: minmax(0, 1fr) minmax(0, 40%); }
  .sg-preview { justify-content: flex-start; padding: 20px 16px; gap: 12px; }
  .sg-sum { font-size: 18px; }
  .jr-guide .jr-mats { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  .sg-progress { padding: 0 8px; }
  .sg-step { justify-content: center; }
  .sg-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* (said, not shown: STEP n OF 4 names it) */
  .sg-body { display: flex; flex-direction: column; overflow-y: auto; }
  .sg-preview { order: -1; position: sticky; top: 0; z-index: 3; flex: none; overflow: visible; padding: 8px 16px; border-left: 0; border-bottom: 1px solid var(--b-faint); }
  .sg-art svg { max-height: 24vh; }
  .sg-sum, .sg-sum2 { display: none; }
  .sg-q { flex: none; overflow: visible; padding: 16px 16px 24px; }
  .sg-title { font-size: 28px; }
  .sg-nav { flex-wrap: wrap; gap: 8px; min-height: 0; padding: 10px 16px; }
  .sg-hint { order: -1; flex: 1 1 100%; }
  .sg-next { margin-left: auto; padding: 0 18px; }
}

/* ═══ Stop 51 item 1 — a phone never scrolls the page sideways ═══
   Measured on every main screen at 428 and 390 (tests/render/no-sideways.e2e.mjs): nothing stands past the screen's
   edge, so the page is never wider than the screen as laid out. What made an iPhone's page wider and pan left and
   right was Safari zooming it in, and not zooming back out:
   - a field whose text is under 16 px zooms the page in when it takes focus (the room's width, a cabinet's size, the
     save form…): on a phone every field's text is 16 px (!important: the panels' own sizes are more specific);
   - a quick double tap zooms on anything that is not a link (a tile tapped twice): a double tap never zooms the page
     here (touch-action: manipulation — a pinch still zooms it, for whoever needs it; the plan and the 3D own their
     gestures, touch-action: none);
   - turned to landscape, Safari enlarges the text (text-size-adjust). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
@media (pointer: coarse) and (max-width: 600px), (pointer: coarse) and (max-height: 500px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), select, textarea { font-size: 16px !important; }
}

/* ═══ Stop 51 item 4 — the plan's bar stays put, and its last button is never cut off ═══
   - The design screens are the height of the screen as it shows NOW (100dvh). On an iPhone 100vh is the height with
     Safari's bars hidden — taller than what shows while they are out — so the page itself scrolled, and the bar of
     Room size, Doors & windows, Add cabinets… went up with it as a list was scrolled. A desktop's dvh is its vh: no
     size moves there. A sheet's scroll ends at its own end, never handing on to the page (overscroll-behavior).
   - The bar (and the 3D's own bar) scroll sideways inside themselves where the buttons need more than the screen, with
     a fade at each edge that has more past it (app.js sabEdgeFade sets .fade-l / .fade-r): the last one is never just
     cut off at 390 or 428. */
#s-room.active, #s-config.active { height: calc(100dvh - var(--hdr-h, 64px)); }
.rp-sec, #s-room .rp-cab-popover, .opts-panel { overscroll-behavior: contain; }
[data-fade-edges] { scrollbar-width: none; }
[data-fade-edges]::-webkit-scrollbar { display: none; }
[data-fade-edges].fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
[data-fade-edges].fade-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
[data-fade-edges].fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }

/* ═══ Stop 51 item 5 — Steps, where "Your design" was (journey.js renderSteps) ═══
   The plan's sheet at 900 px and below; on a phone also the 3D's options column (the iPad upright's 3D keeps the
   Your design tiles: the sheets they open are its way in there). Each step a 56 px row: its number in gold mono,
   its name over what was chosen, and "Change". */
.sab-steps > .yd-head { margin: 0 0 16px; padding-right: 48px; }   /* (the sheet's close sits beside the title) */
.sab-steps-sum { margin: 0; }
.sab-steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sab-step { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 56px; box-sizing: border-box;
  padding: 10px 14px; background: var(--paper); border: 1px solid var(--b-light); border-radius: var(--r); text-align: left; cursor: pointer; font-family: var(--f-ui); color: var(--ink); }
.sab-step:hover { border-color: var(--gold); }
.sab-step:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sab-step[aria-current="step"] { border-color: var(--gold); }
.sab-step-num { font-family: var(--f-mono); font-size: 12px; color: #806426; }
.sab-step-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sab-step-lbl { font-size: 15px; font-weight: 600; line-height: 1.3; }
.sab-step-sum { font-size: 13px; line-height: 1.4; color: var(--t-mid); overflow-wrap: anywhere; }
.sab-step-go { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--t-mid); }
.sab-steps-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; margin: 16px 0 0; }
.sab-steps-figs:empty { display: none; }
#s-config .opts-panel > #sab-steps { display: none; }
@media (max-width: 600px) {
  #s-config .opts-panel > #sab-steps { display: block; }
  #s-config .opts-panel > #yd-panel { display: none; }
}

/* ═══ Stop 51 item 6 — a phone confirms its room too ═══
   At 900 px and below the room's lock note and its button ("Room built"; locked, "Change room size") stand under the
   Room size and Doors & windows sheets — grid rows of their own after the sheet (the panes are display: contents
   here), so the button never scrolls away with the sheet's content. */
@media (max-width: 900px) {
  #s-room.rp-open-size #rp-room-built, #s-room.rp-open-fix #rp-room-built { display: block; order: 4; width: 100%; border-radius: 0; }
  #s-room.rp-open-size #rp-lock-note:not([hidden]), #s-room.rp-open-fix #rp-lock-note:not([hidden]) { display: flex; order: 4; border-radius: 0; border-width: 1px 0 0; }
}
