/* Genesis 3D builder. Site tokens + K6 Chehalis look-A accent and type stacks. P1 shell rules first (test.html), the P8 flow + P8-6 controls under body.gb-ui.
   FINAL P7P8 F10: ONE accent (--gold, #7fc29a per K6: the builder panels are always dark) for every control. */
:root {
  --bg: #0a0a0a; --panel: #161616; --line: rgba(255,255,255,.10);
  --ink: #f4f2ee; --ink-dim: #a8a49c; --ink-faint: #8a867d; --gold: #7fc29a; --gold-d: #6aae86; --gold-ring: rgba(127,194,154,.32); --accent-ink: #0e1a13; --track: #1a1a1a;
  --ease: cubic-bezier(.16,.84,.44,1); --bar: 64px; --strip: 36px;
  --font-display: Georgia, "Times New Roman", serif; --font-body: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --gb-top: 0px; /* HEADER NOTE: the host sets 64px under the Chehalis header; the builder never assumes 100dvh is all its own */
}
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden;
  font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
/* K6 LOOK: Chehalis look-A accent, the DARK pair everywhere (--gold #7fc29a, --accent-ink #0e1a13): the builder panels are always dark, so no light/dark media query; #1f5a3a is for light surfaces only and the builder has none. Display stack for prices and card/intro headlines */
.gb-price, .gb-from, .gb-cname, .gb-intro-h, .gb-intro-from { font-family: var(--font-display); }
#gb-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; outline: none; }
.gb-views { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 6px; z-index: 2; }
.gb-views button { height: 32px; padding: 0 14px; border-radius: 16px; border: 1px solid var(--line);
  background: rgba(22,22,22,.82); color: var(--ink); font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1; letter-spacing: .02em;
  cursor: pointer; transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.gb-views button.on { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.gb-views button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#gb-debug { position: fixed; top: 8px; left: 8px; z-index: 3; padding: 4px 8px; border-radius: 2px;
  background: rgba(22,22,22,.85); color: var(--ink); font: 11px/1.4 ui-monospace, Menlo, Consolas, monospace; }
#gb-debug[hidden] { display: none; }
#gb-error { position: fixed; left: 16px; right: 16px; bottom: 64px; z-index: 3; color: var(--gold); font-size: 14px; }

/* ---------- P8-1 one frame for the whole flow (390 first) ---------- */
html:has(body.gb-ui) { height: auto; overflow: visible; --sh: min(50dvh, 422px); scroll-padding-top: calc(var(--sh) + var(--strip) + 16px); }
html:has(body.gb-ui[data-step="3"]) { --sh: 36dvh; }
html:has(body.gb-ui[data-step="4"]) { --sh: 30dvh; }
html:has(body.gb-ui.gb-kb) { --sh: 0px; }
body.gb-ui { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; font-size: 16px; }
.gb-ui *, .gb-ui *::before, .gb-ui *::after { box-sizing: border-box; }
.gb-ui .gb-app { min-height: calc(100dvh - var(--gb-top)); }
.gb-ui .gb-stage { position: sticky; top: 0; height: var(--sh); z-index: 3; background: #dfe3e6; overflow: hidden; transition: height .2s var(--ease); }
.gb-ui .gb-stage #gb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* P8-3 INTRO: only the exterior and the card; strip, panel and bar hidden until Start */
html:has(.gb-intro:not([hidden]):not(.out)) .gb-stage { height: calc(100dvh - var(--gb-top)); }
html:has(.gb-intro:not([hidden]):not(.out)) .gb-panel { display: none; }

/* camera pills: 44 px, on a track, on the stage's bottom edge (P8-3, P8-4) */
.gb-pills { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; gap: 0; padding: 3px; z-index: 2;
  background: var(--track); border-radius: 24px; }
.gb-pills button { height: 44px; min-width: 44px; padding: 0 14px; border-radius: 22px; border: 0; background: transparent; color: var(--gold);
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); white-space: nowrap; }
.gb-pills button.on { background: var(--gold); color: var(--accent-ink); }
.gb-ui button:focus-visible, .gb-ui input:focus-visible, .gb-ui textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gb-intro { position: absolute; inset: 0; z-index: 4; display: grid; place-items: end center; background: linear-gradient(transparent 40%, rgba(10,10,10,.55)); transition: opacity .4s var(--ease); }
.gb-intro[hidden] { display: none; }
.gb-intro.out { opacity: 0; pointer-events: none; }
.gb-intro-card { margin: 16px 16px 40px; padding: 24px 22px 20px; max-width: 340px; width: calc(100% - 32px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.gb-intro-card p { margin: 0 0 6px; font-size: 18px; line-height: 1.35; }
.gb-intro-card .gb-dim { font-size: 16px; }
.gb-intro-from { min-height: 30px; font-size: 22px !important; font-weight: 600; font-variant-numeric: tabular-nums; } /* K5: reserved before the JSON fills it, no shift */
.gb-intro-card .gb-btn { margin-top: 14px; width: 100%; }
.gb-toast { position: absolute; left: 50%; top: 12px; transform: translate(-50%, -8px); z-index: 5; max-width: calc(100% - 32px);
  padding: 9px 14px; border-radius: 4px; background: rgba(22,22,22,.92); color: var(--ink); font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease); overflow-wrap: anywhere; }
.gb-toast.on { opacity: 1; transform: translate(-50%, 0); }
.gb-ui #gb-debug { position: absolute; }
.gb-ui #gb-error { position: absolute; bottom: 64px; }

.gb-panel { position: relative; background: var(--bg); padding-bottom: calc(var(--bar) + 32px + env(safe-area-inset-bottom)); }
/* P8-1 progress strip: sticky directly under the stage, 36 px; F12 labels 11 px 600, current 700 */
.gb-steps { position: sticky; top: var(--sh); z-index: 3; height: var(--strip); margin: 0; padding: 0 16px; list-style: none; display: flex; justify-content: space-between;
  background: var(--bg); border-bottom: 1px solid var(--line); transition: top .2s var(--ease); }
.gb-rail { position: absolute; left: 44px; right: 44px; top: 13px; height: 2px; background: #2a2a2a; }
.gb-fill { position: absolute; left: 0; top: 0; height: 2px; background: var(--gold); transition: width .2s var(--ease); }
.gb-steps li { position: relative; width: 64px; }
.gb-steps button { width: 100%; height: var(--strip); padding: 5px 0 0; display: flex; flex-direction: column; align-items: center; background: none; border: 0;
  color: var(--ink-faint); font-family: inherit; cursor: pointer; }
.gb-steps button:disabled { cursor: default; }
.gb-steps i { width: 16px; height: 16px; border-radius: 50%; background: #2a2a2a; color: var(--ink-faint); font-size: 10px; font-weight: 600; line-height: 16px; font-style: normal; text-align: center; }
.gb-steps button.done i, .gb-steps button.cur i { background: var(--gold); color: var(--accent-ink); }
.gb-steps span { margin-top: 1px; font-size: 14px; line-height: 14px; font-weight: 600; letter-spacing: 0; color: var(--ink-faint); white-space: nowrap; }
.gb-steps button.done span { color: var(--ink-dim); }
.gb-steps button.cur span { color: var(--ink); font-weight: 700; }

.gb-body { padding: 16px 16px 24px; }
.gb-slide { animation: gbslide .2s var(--ease); }
@keyframes gbslide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.gb-body h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: .01em; }
.gb-lead { margin: 0 0 14px; color: var(--ink-dim); font-size: 16px; }
.gb-dim { color: var(--ink-dim); }
.gb-note { margin: 12px 2px 0; color: var(--ink-dim); font-size: 16px; }

/* P8-6 buttons: primary gold, secondary ghost; 48 px, radius 12 */
.gb-btn { height: 48px; padding: 0 18px; border: 1px solid var(--gold); border-radius: 12px; background: var(--gold); color: var(--accent-ink); font-family: inherit;
  font-size: 16px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; transition: background .12s ease; }
.gb-btn:active { background: var(--gold-d); }
.gb-btn.gb-s { background: transparent; color: var(--gold); }
.gb-btn.gb-wide { display: block; width: 100%; margin-top: 12px; }

/* 1 PLAN */
.gb-card { display: grid; gap: 4px; width: 100%; margin: 0 0 10px; padding: 14px; text-align: left; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; font-family: inherit; font-size: 16px; cursor: pointer; transition: border-color .2s var(--ease); }
.gb-card.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.gb-cname { font-size: 18px; font-weight: 600; }
.gb-meta { color: var(--ink-dim); }
.gb-estd { color: var(--ink-dim); font-size: 14px; font-style: italic; }
.gb-from { margin-top: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gb-plans { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gb-plans .gb-cname { font-size: 16px; }
.gb-plans .gb-card { margin: 0; }
.gb-thumb { display: block; width: 100%; margin-bottom: 8px; }
.gb-thumb .gb-plan2 { display: block; width: 100%; height: auto; border-radius: 6px; }
.gb-tsize { display: block; margin-top: 4px; font-size: 14px; color: var(--ink-dim); text-align: center; font-variant-numeric: tabular-nums; }
/* L9: one plan renderer (cards + Plan view): ink walls on cream, fixtures in a second cream tone */
.gb-plan2 { background: #f4f1ea; }
.gb-plan2 .pf { fill: #efe9dd; }
.gb-plan2 .pr { fill: #f7f3ea; stroke: none; }
.gb-plan2 .pg { fill: rgba(42,42,42,.06); stroke: #2a2a2a; stroke-width: .08; stroke-dasharray: .4 .3; }
.gb-plan2 .pl { fill: #f7f3ea; }
.gb-plan2 .ple { fill: none; stroke: #2a2a2a; stroke-width: .3; }
.gb-plan2 .wl { stroke: #2a2a2a; fill: none; stroke-linecap: square; }
.gb-plan2 .fx { fill: #e4dac8; stroke: #2a2a2a; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.gb-plan2 .fx2 { fill: #f4efe5; stroke: #2a2a2a; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.gb-plan2 .fl { fill: none; stroke: #2a2a2a; stroke-width: 1px; vector-effect: non-scaling-stroke; opacity: .55; }
.gb-plan2 .win { fill: none; stroke: #2a2a2a; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.gb-plan2 .dr { fill: none; stroke: #2a2a2a; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.gb-plan2 .lb { fill: #3a3a3a; font-family: inherit; font-weight: 600; letter-spacing: .04em; text-anchor: middle; }
.gb-plan2d { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; padding: 12px 12px 64px; background: #e9e5dc; }
.gb-plan2d[hidden] { display: none; }
.gb-plan2d .gb-plan2 { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 6px; }
.gb-level { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: flex; padding: 3px; z-index: 2; background: var(--track); border-radius: 24px; }
.gb-level[hidden] { display: none; }
.gb-level button { height: 44px; min-width: 64px; padding: 0 14px; border-radius: 22px; border: 0; background: transparent; color: var(--gold); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.gb-level button.on { background: var(--gold); color: var(--accent-ink); }
/* L10: the custom paint chip: neutral diagonal hatch, never a colour that could read as a real paint */
.gb-sw.gb-swc { background: repeating-linear-gradient(45deg, #d8d4cc 0 3px, #f2efe9 3px 7px); }
.gb-cpaint { display: block; width: 100%; max-width: 360px; height: 44px; margin: 4px 0 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; font-size: 16px; }
/* M-F2: 2-up at 390; a plan longer than 36 ft (.gb-long, the 14x52 pair) takes the full row so its drawing reads */
/* M-F1: 2-up in the 1440 panel; 3-up only where the grid itself gets >= 900 CSS px (container query on the panel body) */

/* 2 OUTSIDE: one horizontal row of 44 px swatches per group, 8 px gaps, scroll-snap, name under the row */
.gb-swrow { margin: 0 0 10px; }
.gb-swatches { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 3px 3px 2px; scrollbar-width: none; }
.gb-swatches::-webkit-scrollbar { display: none; }
.gb-sw { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: var(--c); scroll-snap-align: start; position: relative; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); transition: box-shadow .2s var(--ease); }
.gb-sw.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); }
.gb-sw.on::after { content: ""; position: absolute; left: 16px; top: 10px; width: 10px; height: 18px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); filter: drop-shadow(0 0 1px #000); }
.gb-sw.on.lt::after { border-color: #111; filter: none; }
.gb-swname { margin-top: 5px; height: 22px; font-size: 16px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-gl { margin-right: 8px; font-size: 14px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-dim); }

/* 3 INSIDE + 4 OPTIONS: grouped accordions; one row = name + adder on one line, blurb under it, 56 px, the whole row taps */
.gb-grp { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gb-gh { width: 100%; min-height: 56px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; background: var(--panel); color: var(--ink); border: 0;
  font-family: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.gb-gt { flex: 1; font-weight: 600; }
.gb-gt small { display: block; margin-top: 2px; font-weight: 400; font-size: 14px; color: var(--ink-dim); }
.gb-sum { color: var(--gold); font-weight: 600; font-size: 15px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gb-chev { flex: none; width: 14px; height: 14px; position: relative; }
.gb-chev::before { content: ""; position: absolute; left: 3px; top: 2px; width: 7px; height: 7px; border: solid var(--ink-dim); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s var(--ease); }
[aria-expanded="true"] > .gb-chev::before { transform: translateY(4px) rotate(-135deg); }
.gb-opt { width: 100%; min-height: 56px; padding: 10px 14px; display: flex; gap: 12px; align-items: flex-start; background: var(--bg); color: var(--ink);
  border: 0; border-top: 1px solid var(--line); font-family: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.gb-tk { flex: 0 0 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 2px solid #555; }
.gb-tk.sq { border-radius: 5px; }
.gb-opt.on .gb-tk { border-color: var(--gold); background: radial-gradient(var(--gold) 45%, transparent 50%); }
.gb-opt.on .gb-tk.sq { background: var(--gold); box-shadow: inset 0 0 0 3px var(--bg); }
.gb-nm { flex: 1; min-width: 0; }
.gb-nm b { font-weight: 600; }
.gb-nm small { display: block; margin-top: 3px; color: var(--ink-dim); font-size: 14px; line-height: 1.35; }
.gb-ad { flex: none; font-weight: 600; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.gb-ad.on { color: var(--gold); }
.gb-rate { display: block; margin-top: 2px; font-size: 14px; font-weight: 400; color: var(--ink-faint); }
.gb-inc { padding: 4px 14px 12px; border-top: 1px solid var(--line); background: #111; }
.gb-ih { width: 100%; min-height: 44px; padding: 0; display: flex; align-items: center; justify-content: space-between; background: none; border: 0; color: var(--gold);
  font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.gb-inc ul { margin: 0; padding-left: 18px; color: var(--ink-dim); font-size: 16px; line-height: 1.5; }
.gb-ref { margin: 8px 0 0; color: var(--ink-faint); font-size: 14px; }
.gb-quoted { margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; }

/* 5 QUOTE */
.gb-sumcard { padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-size: 16px; }
.gb-erow { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-variant-numeric: tabular-nums; }
.gb-erow span:last-child { white-space: nowrap; }
.gb-erow small { display: block; font-size: 14px; font-weight: 400; }
.gb-ui small[hidden] { display: none; }
.gb-del { color: var(--ink-dim); }
.gb-erow.gb-del span:last-child { white-space: normal; } /* I6: the out-of-range delivery line wraps inside the card */
.gb-total { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 600; }
.gb-pk { margin: 4px 0; }
.gb-pk summary { min-height: 44px; display: flex; align-items: center; color: var(--gold); font-weight: 600; cursor: pointer; list-style: none; }
.gb-pk summary::-webkit-details-marker { display: none; }
.gb-pk ul { margin: 0 0 8px; padding: 0 0 0 18px; color: var(--ink-dim); font-size: 16px; line-height: 1.5; }
.gb-foot { margin: 6px 0 0; color: var(--ink-faint); font-size: 14px; }
.gb-link { height: 44px; padding: 0; background: none; border: 0; color: var(--gold); font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.gb-form { padding-top: 4px; }
.gb-field { display: block; margin-top: 14px; color: var(--ink); }
.gb-field > span { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.gb-field em { font-style: normal; font-weight: 400; color: var(--ink-dim); }
.gb-field input, .gb-field textarea { width: 100%; min-height: 48px; padding: 0 14px; background: #111; color: var(--ink); border: 1px solid #3a3a3a; border-radius: 12px;
  font-family: inherit; font-size: 16px; }
.gb-field textarea { height: 88px; padding-top: 12px; resize: vertical; }
.gb-field input:focus, .gb-field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-ring); }
.gb-help { display: block; margin-top: 5px; color: var(--ink-dim); font-size: 14px; }
.gb-taprow { display: flex; flex-wrap: wrap; gap: 8px; padding: 3px; background: var(--track); border-radius: 26px; width: fit-content; max-width: 100%; }
.gb-tap { height: 44px; padding: 0 16px; border-radius: 22px; border: 0; background: transparent; color: var(--gold); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.gb-tap.on { background: var(--gold); color: var(--accent-ink); }
.gb-spots { flex-wrap: nowrap; overflow-x: auto; width: auto; margin: 0 0 12px; scrollbar-width: none; } /* P7-4 jump points: one scrolling row */
.gb-spots::-webkit-scrollbar { display: none; }
.gb-spots .gb-tap { flex: 0 0 auto; }
.gb-status { min-height: 1.4em; margin: 10px 0 0; color: var(--gold); font-size: 14px; }
.gb-status a { color: var(--gold); }
#gb-send-inline { display: none; }
.gb-kb #gb-send-inline { display: block; }
.gb-done .gb-lead { font-size: 17px; line-height: 1.45; color: var(--ink); }
.gb-saveline { margin: 0; }
.gb-donerow { display: flex; gap: 10px; margin-top: 16px; }
.gb-donerow .gb-btn { flex: 1; }
.gb-copied { margin: 8px 0 0; min-height: 1.3em; font-size: 14px; }

/* P8-1 bar: [Back] [Est. $X] [Next], 64 px, sticky; F11 Est. never wraps (15 px floor, min width for the price) */
.gb-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; height: var(--bar); padding: 8px 16px env(safe-area-inset-bottom); display: flex; align-items: center; gap: 8px;
  background: rgba(10,10,10,.96); border-top: 1px solid var(--line); }
.gb-bar .gb-btn { padding: 0 14px; }
.gb-back[hidden] { display: none; }
.gb-price { flex: 1 1 auto; min-width: 104px; text-align: center; font-size: 16px; font-weight: 600; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gb-price span { white-space: nowrap; }
.gb-price small { display: block; font-size: 14px; font-weight: 400; color: var(--ink-dim); }
.gb-price small[hidden] { display: none; }
body[data-step="4"] .gb-price { font-size: 15px; }
.gb-next { flex: none; }
/* G11: disabled Next / Send = gold outline, label at 70 % ink (>= 3:1 on the bar), never brown on brown */
.gb-next.dim, .gb-next.dim:active { opacity: 1; background: transparent; color: rgba(244,242,238,.7); box-shadow: inset 0 0 0 2px var(--gold); }
.gb-next[hidden] { display: none; }
.gb-kb .gb-bar, .gb-isdone .gb-bar { display: none; }

@media (min-width: 900px) {
  html:has(body.gb-ui), body.gb-ui { overflow: hidden; height: 100%; }
  html:has(body.gb-ui), html:has(body.gb-ui[data-step]) { --sh: 0px; }
  .gb-ui .gb-app { display: grid; grid-template-columns: 60vw 40vw; height: calc(100vh - var(--gb-top)); height: calc(100dvh - var(--gb-top)); min-height: 0; }
  .gb-ui .gb-stage, html:has(.gb-intro:not([hidden]):not(.out)) .gb-stage { position: relative; height: 100%; }
  /* K5 ADDENDUM: while the intro shows, the stage fills the full width behind the card (no black panel region) */
  html:has(.gb-intro:not([hidden]):not(.out)) .gb-panel { display: none; }
  html:has(.gb-intro:not([hidden]):not(.out)) .gb-app { grid-template-columns: 100%; }
  .gb-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; padding-bottom: 0; border-left: 1px solid var(--line); }
  .gb-steps { position: relative; top: 0; flex: none; padding: 0 24px; }
  .gb-rail { left: 52px; right: 52px; }
  .gb-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 24px 32px 32px; }
  /* F13: the bar is pinned to the bottom of the panel at 1440 */
  .gb-bar { position: sticky; bottom: 0; flex: none; height: 76px; padding: 0 32px; }
  .gb-price { font-size: 20px; }
  body[data-step="4"] .gb-price { font-size: 20px; }
}

/* FINAL P2 + P3: first-paint plan placeholder */
.gb-ph { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: #dfe3e6; }
.gb-ph[hidden] { display: none; }
/* FINAL P3-2: while the intro is up, the plan sits in the top of the canvas and the card below it, so the card never hides the plan */
.gb-stage:has(.gb-intro:not([hidden]):not(.out)) .gb-ph { place-items: start center; padding-top: 28px; }
/* FINAL P4-2: the view pills stay hidden until Start is tapped (visibility keeps their layout box for the safe-area fit) */
.gb-stage:has(.gb-intro:not([hidden]):not(.out)) .gb-pills { visibility: hidden; }
.gb-ph-plan { width: 84%; max-height: 80%; display: grid; place-items: center; }
.gb-ph-plan svg { width: 100%; height: auto; max-height: 100%; }
.gb-ph-plan .o { fill: #f4f2ee; stroke: #2a2a2a; stroke-width: .35; }
.gb-ph-plan polygon { fill: none; stroke: #6a6a6a; stroke-width: .18; }
.gb-load { position: absolute; left: 0; right: 0; top: 0; height: 2px; overflow: hidden; }
.gb-load::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; background: var(--gold); animation: gbload 1.2s var(--ease) infinite; }
@keyframes gbload { from { left: -30%; } to { left: 100%; } }

/* ---------- K11 basics ---------- */
.gb-recenter { position: absolute; right: 10px; top: 10px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: rgba(22,22,22,.78); color: var(--ink); cursor: pointer; }
.gb-stage:has(.gb-intro:not([hidden]):not(.out)) .gb-recenter { visibility: hidden; }
.gb-spin { position: absolute; left: 50%; top: 50%; z-index: 3; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 3px solid rgba(22,22,22,.25); border-top-color: var(--gold); animation: gbspin .9s linear infinite; pointer-events: none; }
.gb-spin[hidden], .gb-hint[hidden] { display: none; }
@keyframes gbspin { to { transform: rotate(360deg); } }
.gb-hint { position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 22px;
  background: rgba(22,22,22,.88); color: var(--ink); font-size: 15px; text-align: center; pointer-events: none; }
.gb-maker { margin: 12px 0 0; font-size: 14px; color: var(--ink-dim); }
.gb-intro-card .gb-maker { margin: 12px 0 0; font-size: 14px; }
.gb-text { color: var(--gold); font-weight: 600; text-decoration: none; display: inline-block; min-height: 24px; }
.gb-qhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gb-qhead .gb-text { min-height: 44px; line-height: 44px; }
.gb-share { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--gold); cursor: pointer; }
.gb-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.gb-privacy { margin: 8px 0 0; font-size: 14px; }
.gb-confirm p { margin: 16px 0 0; font-size: 17px; }
/* K11-13: the step dot stays 16 px, its tap zone is 44 px tall */
.gb-steps button { position: relative; }
.gb-steps button::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
/* K11-9: landscape phone = the side-panel layout (canvas left 55 percent, panel right) */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 899px) {
  html:has(body.gb-ui), body.gb-ui { overflow: hidden; height: 100%; }
  html:has(body.gb-ui), html:has(body.gb-ui[data-step]) { --sh: 0px; }
  .gb-ui .gb-app { display: grid; grid-template-columns: 55vw 45vw; height: calc(100vh - var(--gb-top)); height: calc(100dvh - var(--gb-top)); min-height: 0; }
  html:has(.gb-intro:not([hidden]):not(.out)) .gb-app { grid-template-columns: 100%; }
  .gb-ui .gb-stage, html:has(.gb-intro:not([hidden]):not(.out)) .gb-stage { position: relative; height: 100%; }
  .gb-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; padding-bottom: 0; border-left: 1px solid var(--line); }
  .gb-steps { position: relative; top: 0; flex: none; }
  .gb-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .gb-bar { position: sticky; bottom: 0; flex: none; }
}
/* K11-10: prefers-reduced-motion = no animated transitions */
@media (prefers-reduced-motion: reduce) {
  .gb-ui *, .gb-ui *::before, .gb-ui *::after { transition: none !important; animation: none !important; }
  .gb-spin { border-top-color: var(--gold); }
}
/* L2: Plan view tap tooltip (fixture name) */
.gb-tip { position: absolute; z-index: 4; transform: translate(-50%, calc(-100% - 10px)); padding: 6px 10px; border-radius: 8px; background: #0e1a13; color: #f2efe9; font-size: 14px; line-height: 1.2; pointer-events: none; white-space: nowrap; }
.gb-tip[hidden] { display: none; }

/* ---------- FLOW v2 (M1: FLOW-V2-SPEC sections 1-8, FINAL M M-F1..M-F7) ---------- */
.gb-doors { display: grid; grid-auto-rows: 1fr; gap: 10px; margin-top: 14px; } /* section 1: the two doors are the same size */
.gb-door { display: grid; gap: 4px; min-height: 84px; padding: 14px 16px; text-align: left; border: 1px solid var(--gold); border-radius: 12px; background: var(--gold); color: var(--accent-ink); font: inherit; cursor: pointer; }
.gb-door b { font-size: 18px; font-weight: 700; }
.gb-door span { font-size: 14px; line-height: 1.3; }
.gb-door[hidden] { display: none; }
@media (min-width: 900px) { .gb-intro-card:has(.gb-doors) { max-width: 640px; } .gb-doors { grid-template-columns: 1fr 1fr; } }
/* M-F6: at 390 the intro plan takes the safe width and the card sits right under it (no empty band); --gb-php = the drawn plan height (ui.js) */
@media (max-width: 899px) {
  .gb-stage:has(.gb-intro:not([hidden]):not(.out)) .gb-ph-plan { width: calc(100% - 32px); }
  .gb-intro { place-items: start center; padding-top: calc(28px + var(--gb-php, calc((100vw - 32px) * .29)) + 4px); }
  .gb-intro-card { margin-top: 0; }
}
.gb-body { container-type: inline-size; }
.gb-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 900px) { .gb-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gb-plans .gb-card.gb-long { grid-column: 1 / -1; }
.gb-lcard { padding: 10px; gap: 3px; align-content: start; }
.gb-lcard .gb-thumb { margin-bottom: 6px; }
.gb-lcard > span { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.gb-csize { font-size: 16px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.gb-ctype { display: flex; gap: 6px; font-size: 14px; line-height: 1.3; }
.gb-plans .gb-cname, .gb-lcard .gb-cname { font-size: 14px; line-height: 1.3; font-weight: 600; }
.gb-cdesc, .gb-cbest { font-size: 14px; line-height: 1.3; color: var(--ink-dim); }
.gb-lcard .gb-from { margin-top: 2px; font-size: 14px; color: var(--gold); }
.gb-cline { font-size: 14px; color: var(--ink); }
.gb-sil { width: 22px; height: 16px; flex: none; margin-top: 2px; }
.gb-sil56 { width: 56px; height: 40px; }
.gb-sil56 path, .gb-sil path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; }
.gb-row { margin: 14px 0 0; }
.gb-rh, .gb-group { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.gb-group { margin-top: 18px; }
.gb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gb-chip { min-height: 44px; min-width: 64px; padding: 0 14px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.gb-chip.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); color: var(--gold); }
.gb-types .gb-chip { padding: 8px 10px 6px; min-width: 76px; }
.gb-result { margin-top: 18px; }
.gb-under { margin: 10px 0; padding: 4px 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.gb-dnote { margin: 6px 0 0; font-size: 14px; color: var(--ink-dim); }
.gb-dtag { margin: -6px 0 6px; min-height: 14px; line-height: 14px; font-size: 11px; color: var(--ink-dim); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gb-linkbtn { padding: 0; min-height: 32px; border: 0; background: none; color: var(--gold); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; }
.gb-showall { margin-top: 12px; }
@media (min-width: 900px) { .gb-body .gb-chips { flex-wrap: wrap; } }
.gb-chip small { font-size: 14px; font-weight: 400; color: var(--ink-dim); }
body:not([data-step="0"]) .gb-dtag { margin: -10px 0 2px; }
/* M-L1 loading animation: while the intro is up the plan under it draws itself, walls then openings then fixtures (stroke-dash, 1.2 s loop);
   SVG/CSS only; the stroke reads the host accent token (--gold-d) so the Chehalis host draws it in its colours */
.gb-stage:has(.gb-intro:not([hidden]):not(.out)) .gb-ph-plan svg :is(rect, polygon, path, line, ellipse, polyline) {
  stroke: var(--gold-d, #6aae86); stroke-width: .12; stroke-dasharray: 140; stroke-dashoffset: 140; animation: gb-draw 1.2s var(--ease, ease) infinite; }
.gb-stage:has(.gb-intro:not([hidden]):not(.out)) .gb-ph-plan svg :is(path, line, polyline) { animation-name: gb-draw2; }
.gb-stage:has(.gb-intro:not([hidden]):not(.out)) .gb-ph-plan svg :is(.fx, .fx2, ellipse, .lb) { animation-name: gb-draw3; }
@keyframes gb-draw { 0% { stroke-dashoffset: 140; fill-opacity: 0; } 40% { stroke-dashoffset: 0; fill-opacity: 0; } 60%, 100% { stroke-dashoffset: 0; fill-opacity: 1; } }
@keyframes gb-draw2 { 0%, 25% { stroke-dashoffset: 140; fill-opacity: 0; } 60% { stroke-dashoffset: 0; fill-opacity: 0; } 75%, 100% { stroke-dashoffset: 0; fill-opacity: 1; } }
@keyframes gb-draw3 { 0%, 50% { stroke-dashoffset: 140; fill-opacity: 0; } 85%, 100% { stroke-dashoffset: 0; fill-opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .gb-stage .gb-ph-plan svg * { animation: none !important; stroke-dashoffset: 0 !important; } }
#gb-canvas.gb-in { animation: gb-in .3s var(--ease, ease); } /* M-L1: the 3D fades in over 300 ms as the placeholder goes */
@keyframes gb-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #gb-canvas.gb-in { animation: none; } }
