/* Halfmetre. Display: Red Hat Display. UI: Outfit. Measurements: Teko. Logo and wall drawing: Karla. One accent: coral. */
:root {
  --paper: #ffffff;
  --plaster: #efe9e2;
  --plaster-2: #e4dcd2;
  --line: #e3dcd3;
  --line-2: #cfc6bb;
  --ink: #231e1a;
  --muted: #6d645c;
  --accent: #e5573c;
  --accent-text: #b23f22;
  --accent-soft: #fbe2da;
  --display: 'Red Hat Display', system-ui, sans-serif;
  --ui: 'Outfit', system-ui, sans-serif;
  --num: 'Teko', 'Outfit', sans-serif;
  --logo: 'Karla', system-ui, sans-serif;
  --head: 56px;
  --gut: clamp(16px, 3.6vw, 52px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head) + 8px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.5 var(--ui); overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
body.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
h1, h2, h3 { margin: 0; font-weight: 800; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  border: 0; border-radius: 0; cursor: pointer; text-decoration: none;
  font: 500 17px/1 var(--ui); letter-spacing: 0; padding: 0 22px; height: 54px;
  transition: background-color .15s, color .15s;
}
.btn svg { width: 20px; height: 20px; transition: transform .2s cubic-bezier(.2,.7,.2,1); }
.btn:hover svg { transform: translateX(3px); }
/* coral carries ink text: white on coral would fail contrast */
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--ink); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--accent); color: var(--ink); }
.btn:disabled { background: var(--plaster-2); color: var(--muted); cursor: default; }
.btn:disabled svg { transform: none; }
.tool {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; height: 38px;
  border: 1px solid var(--line-2); background: var(--paper); padding: 0 12px;
  font: 500 15px/1 var(--ui); border-radius: 0;
}
.tool:hover:not(:disabled) { border-color: var(--ink); }
.tool:disabled { color: #b0a79d; border-color: var(--line); cursor: default; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 30; height: var(--head);
  display: flex; align-items: center; gap: 32px; padding: 0 var(--gut);
  background: rgba(255,255,255,.95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
/* the name sits on a ruler: a long tick at its midpoint, the first half in the accent */
.logo { display: inline-flex; flex-direction: column; gap: 3px; text-decoration: none; font: 700 19px/1 var(--logo); letter-spacing: -.01em; }
/* inset by the H's side bearing so the rule starts and ends with the letters */
.logo-rule { display: block; width: 0; min-width: calc(100% - .05em); margin-left: .05em; height: 6px; }
.logo-half { fill: var(--accent); }
.site-nav { display: flex; gap: 30px; margin-left: auto; }
.site-nav a { text-decoration: none; font-weight: 500; font-size: 17px; color: var(--muted); }
.site-nav a:hover { color: var(--ink); }
.cart-btn {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer; height: 38px;
  border: 1.5px solid var(--ink); background: var(--paper); padding: 0 8px 0 16px; font-weight: 600; font-size: 17px;
}
.cart-btn:hover { background: var(--ink); color: #fff; }
.cart-count {
  min-width: 26px; height: 26px; padding: 3px 6px 0; display: inline-grid; place-items: center;
  background: var(--accent); color: var(--ink); font: 700 15px/1 var(--ui); padding: 0 6px;
}
.cart-count.is-bump { animation: bump .45s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(24px, 4vw, 64px);
  /* the hero is the whole first screen; the room takes all the height it can, so nothing else shows until you scroll */
  --hero-top: clamp(20px, 4vh, 48px);
  align-items: center; padding: var(--hero-top) var(--gut);
  min-height: calc(100vh - var(--head));
}
.hero h1 { font: 900 clamp(52px, 5.5vw, 96px)/.92 var(--display); letter-spacing: -.045em; }
.hero h1 .tick { color: var(--accent); }
.hero-body { margin-top: 30px; max-width: 30em; font-size: 21px; line-height: 1.4; color: var(--muted); }
.hero .btn { margin-top: 38px; }
/* the room sits a little left, toward the headline, and takes the full screen height; no caption under it (v24) */
.hero-stage { margin: 0; position: relative; translate: calc(-1 * clamp(0px, 3.5vw, 64px)) 0; }
.stage3d { position: relative; background: var(--plaster); overflow: hidden; }
.stage3d canvas { display: block; width: 100% !important; height: 100% !important; }
/* the hero room stands straight on the white page */
#hero3d { aspect-ratio: 4 / 3.1; max-height: calc(100vh - var(--head) - 2 * var(--hero-top)); background: transparent; }
.no3d { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); font-size: 15px; }

/* the owned device: a half-metre ruler between sections */
.ruler {
  height: 16px; margin: 0 calc(var(--gut) * -1) 0;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 80px) 0 0 / 100% 16px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 40px) 0 0 / 100% 8px no-repeat;
  border-top: 1.5px solid var(--ink);
}

/* ---------- planner ---------- */
.planner { background: var(--plaster); padding: 0 var(--gut) clamp(40px, 6vw, 80px); }
.planner-head { padding: clamp(36px, 5vw, 64px) 0 28px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px 56px; align-items: end; }
.planner-head h2, .module h2 { font: 800 clamp(38px, 4.4vw, 66px)/.98 var(--display); letter-spacing: -.035em; }
.planner-head p, .module-copy p { font-size: 19px; color: var(--muted); max-width: 30em; }

/* one tool window: bar on top, rail, canvas and room panel below */
.app { background: var(--paper); border: 1.5px solid var(--ink); box-shadow: 0 30px 60px -40px rgba(35,30,26,.45); }
.app-bar {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px;
  padding: 0 14px 0 0; border-bottom: 1.5px solid var(--ink); min-height: 68px;
}
.steps { display: flex; align-self: stretch; }
.step {
  display: inline-flex; align-items: center; padding: 0 24px; border: 0; background: transparent; cursor: pointer;
  font: 700 18px/1 var(--display); letter-spacing: -.01em; color: var(--muted); border-right: 1px solid var(--line);
  position: relative;
}
/* whatever is chosen is simply filled coral: steps, starting rooms, tools and furniture groups */
.step:hover { color: var(--ink); background: var(--plaster); }
.step.is-on { color: var(--ink); background: var(--accent); }

.starters-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.starters-label { font-size: 15px; color: var(--muted); white-space: nowrap; }
.briefs { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.briefs::-webkit-scrollbar { display: none; }
.brief-tab {
  flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center; min-height: 40px;
  text-align: left; cursor: pointer; padding: 6px 14px; background: var(--paper); border: 1px solid var(--line-2);
}
.brief-tab:hover { border-color: var(--ink); }
.brief-tab.is-on { background: var(--accent); border-color: var(--accent); }
.bt-name { font-weight: 600; font-size: 15px; line-height: 1.15; white-space: nowrap; }
.bt-meta { font-size: 13px; color: var(--muted); line-height: 1.2; white-space: nowrap; }
.brief-tab.is-on .bt-meta { color: var(--ink); }
.tool-group { display: flex; gap: 6px; flex: none; }

.app-body { display: grid; grid-template-columns: 96px minmax(0, 1fr) 344px; min-height: 640px; }
@media (min-width: 1100px) {
  /* the section is one screen: ruler, the heading (same size as the module's), then the tool window
     takes whatever height is left, so the heading and the whole builder show together */
  #planner { scroll-margin-top: -8px; } /* cancels the page's 8px scroll gap so the section lands right under the header */
  .planner { display: flex; flex-direction: column; height: calc(100svh - var(--head)); min-height: 600px; padding-bottom: 20px; }
  .planner-head { padding: 22px 0 18px; gap: 12px 40px; }
  .planner-head p { font-size: 16.5px; line-height: 1.4; max-width: 32em; }
  .app { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; }
  /* the heading costs height, so the tool's chrome gives some back to the 3D preview */
  .app-bar { min-height: 60px; }
  .app-body { grid-template-columns: 96px minmax(0, 1fr) clamp(344px, 27vw, 420px); }
  .type-pick span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .budget-spent { font-size: 34px; }
  .room-sum { padding-top: 10px !important; padding-bottom: 10px !important; }
  .room-sum .btn { height: 48px; }
  .app-body { flex: 1; min-height: 0; }
  .board { min-height: 0; }
  .board-stage { display: block; min-height: 0; overflow: hidden; }
  /* pinned to the stage: before v22 the base .plan rule (later in the file) won here, so a tall plan spilled under the bar below */
  .board-stage > .plan, .app:not(.is-drawing) .plan { position: absolute; left: 16px; top: 4px; width: calc(100% - 32px); height: calc(100% - 16px); max-height: none; aspect-ratio: auto; }
}
@media (min-width: 1100px) and (max-height: 820px) {
  /* short laptop screens: tighter so the whole room panel still shows without scrolling */
  .planner { padding-bottom: 12px; }
  .planner-head { padding: 16px 0 14px; }
  .app-bar { min-height: 56px; }
  .board-tools { min-height: 44px; padding-top: 6px; }
  .inspector > * { padding: 9px 18px; }
  .budget-spent { font-size: 32px; }
  .goal { padding: 2px 0; font-size: 14px; }
  .room-sum .btn { height: 46px; }
}
@media (min-width: 1100px) and (max-height: 700px) {
  .inspector > * { padding: 7px 18px; }
  .goal { padding: 1px 0; line-height: 1.15; }
  .budget-bar { margin-top: 6px; }
  .room-sum .btn { height: 42px; }
}
@media (min-width: 1100px) and (max-height: 680px) {
  .app-bar { min-height: 50px; }
  .budget-spent { font-size: 28px; }
  .needs-head { margin-bottom: 0; }
  .goal { font-size: 13.5px; line-height: 1.1; }
  .inspector > * { padding: 6px 18px; }
  .room-sum .btn { height: 38px; }
  #planner.planner { padding-bottom: 3px; }
}

.rail { border-right: 1px solid var(--line); background: #faf7f4; padding: 10px 8px; }
.draw-tools, .tray-cats { display: flex; flex-direction: column; gap: 4px; }
.draw-tool, .cat {
  display: block; padding: 13px 4px; border: 0; background: transparent;
  font: 500 15px/1.1 var(--ui); color: var(--muted); cursor: pointer; text-align: center;
}
.draw-tool:hover, .cat:hover { color: var(--ink); background: var(--plaster); }
.draw-tool.is-on, .cat.is-on { background: var(--accent); color: var(--ink); }

.board { display: flex; flex-direction: column; min-width: 0; }
.board-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px 0; min-height: 50px; }
.board-dims { font: 500 24px/1 var(--num); letter-spacing: .01em; padding-top: 4px; }
.seg { display: inline-flex; border: 1px solid var(--ink); }
.seg-btn { border: 0; background: transparent; padding: 0 16px; height: 34px; font-weight: 600; font-size: 15px; cursor: pointer; }
.seg-btn.is-on { background: var(--ink); color: #fff; }
.board-stage { position: relative; padding: 4px 16px 12px; display: grid; place-items: center; min-height: 340px; flex: 1; }
.plan {
  display: block; width: 100%; height: auto; max-height: max(400px, calc(100vh - var(--head) - 290px)); aspect-ratio: var(--ratio, 1);
  touch-action: none; user-select: none; -webkit-user-select: none; overflow: visible;
}
.app:not(.is-drawing) .plan { max-height: max(360px, calc(100vh - var(--head) - 330px)); } /* leaves room for the catalogue */
.plan-hint {
  position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); pointer-events: none;
  max-width: 15em; text-align: center; color: var(--ink); font-size: 17px; background: var(--paper); padding: 10px 14px; border: 1px solid var(--line-2);
}
.plan3d { position: absolute; inset: 4px 16px 8px; }

/* plan drawing */
.plan .void { fill: #f5f4f1; }
.plan .floor { fill: #fff; }
.plan.is-drawing { cursor: crosshair; }
.plan.is-drawing .grid line { stroke: #e2dfd9; }
.plan.is-drawing .grid line.m { stroke: #cfcac2; }
.plan.is-drawing .piece { opacity: .45; pointer-events: none; }
.plan .wall-out { stroke: var(--ink); stroke-width: 12; stroke-linecap: butt; }
.plan .wall-post { fill: var(--ink); }
.plan .wall-in { stroke: var(--ink); stroke-width: 8; stroke-linecap: square; }
.plan .win-base { stroke: #fff; stroke-width: 12; }
.plan .draft-add { fill: rgba(229,87,60,.14); stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.plan .draft-cut { fill: url(#hatch); opacity: .7; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.plan .draft-size { font: 500 22px var(--num); fill: var(--accent-text); text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.plan .draft-wall { stroke: var(--accent); stroke-width: 8; stroke-linecap: square; }
.plan .draft-wall-cut { stroke: var(--accent); stroke-width: 8; stroke-dasharray: 6 6; }
.plan .draft-wall-no { stroke: #b9b4ab; stroke-width: 4; stroke-dasharray: 4 6; }
.plan .draft-win { stroke: var(--accent); stroke-width: 6; }
.plan .grid line { stroke: #ebe8e3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.plan .grid line.m { stroke: #dcd8d1; }
.plan .glass { stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plan .door-arc { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.plan .door-leaf { stroke: var(--ink); stroke-width: 3; }
.plan .door-label { font: 500 15px var(--num); fill: #a39e96; text-anchor: middle; letter-spacing: .04em; }
.plan-ruler line { stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plan-ruler text { font: 500 17px var(--num); fill: var(--ink); text-anchor: middle; }
.plan .unreached { fill: url(#swing); }
.piece { cursor: grab; outline: none; }
.piece .hit { fill: transparent; }
.piece .outline { fill: none; stroke: transparent; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.piece:hover .outline { stroke: rgba(35,30,26,.35); }
.piece.is-sel .outline, .piece:focus-visible .outline { stroke: var(--accent); }
.piece.is-blocked .outline { stroke: var(--accent); stroke-dasharray: 5 4; }
.piece.is-dragging { cursor: grabbing; opacity: .9; }
.piece.is-bad > g { opacity: .45; }
.piece.is-bad .outline { stroke: var(--accent); stroke-dasharray: 2 3; }
.preview .pv-piece { opacity: .55; }
.preview .pv-box { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.preview .is-bad .pv-box { stroke: var(--accent); }

.toast {
  position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 10px 16px; font-size: 16px; font-weight: 500; white-space: nowrap;
  transition: opacity .18s, transform .18s; z-index: 2;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.selbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--accent-soft); }
.sel-info { min-width: 0; flex: 1; }
.sel-name { font-weight: 600; font-size: 17px; }
.sel-meta { font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-actions { display: flex; gap: 8px; }

.drawbar { display: flex; align-items: center; gap: 20px; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); }
.draw-hint { font-size: 16px; color: var(--muted); max-width: 42em; }
.drawbar .btn { flex: none; }

.tray { border-top: 1px solid var(--line); background: #faf7f4; padding: 12px 16px 14px; }
.tray-items { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tray-card {
  flex: 0 0 auto; width: 168px; display: flex; flex-direction: column; gap: 4px; text-align: left;
  border: 1px solid var(--line); background: var(--paper); padding: 8px 8px 10px; cursor: grab; touch-action: pan-x;
  user-select: none; -webkit-user-select: none; transition: border-color .15s, transform .15s;
}
.tray-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.tc-icon { height: 72px; display: grid; place-items: center; background: var(--plaster); margin-bottom: 4px; }
.tc-icon svg { width: calc(var(--w) * 14px + 6px); height: calc(var(--d) * 14px + 6px); max-height: 62px; max-width: 136px; }
.tc-name { font-weight: 600; font-size: 16px; line-height: 1.15; }
.tc-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; color: var(--muted); }
.tc-price { color: var(--ink); font: 500 20px/1 var(--num); }

/* the room panel */
.inspector { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.inspector > * { padding: 12px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.inspector > .side3d { padding: 0; aspect-ratio: 16 / 11; }
.type-pick { display: grid; gap: 2px; }
.type-pick span { font-size: 14px; color: var(--muted); }
.type-pick select {
  font: 800 23px/1.15 var(--display); letter-spacing: -.02em; color: var(--ink); background: transparent; border: 0;
  padding: 0 28px 2px 0; border-radius: 0; appearance: none; -webkit-appearance: none; cursor: pointer; width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23231e1a' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center; background-size: 13px 9px;
}
.type-pick select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brief-dims { margin-top: 2px; font-size: 14px; color: var(--muted); }

.budget-row { display: flex; align-items: baseline; gap: 10px; }
.budget-spent { font: 500 38px/.8 var(--num); padding-top: 6px; }
.budget-of { color: var(--muted); font: 400 22px/1 var(--num); }
.budget-of input {
  font: inherit; color: inherit; width: 4.2ch; border: 0; border-bottom: 1.5px dashed var(--line-2); background: transparent; padding: 0; margin-left: 1px;
  -moz-appearance: textfield; appearance: textfield;
}
.budget-of input::-webkit-outer-spin-button, .budget-of input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.budget-of input:focus { outline: none; border-bottom: 1.5px solid var(--accent); color: var(--ink); }
/* the budget bar is a ruler: tick every tenth */
.budget-bar {
  position: relative; height: 8px; margin-top: 10px; background: var(--plaster);
}
.budget-bar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--paper) calc(10% - 1px) 10%);
}
.budget-fill { height: 100%; width: 0; background: var(--ink); transition: width .4s cubic-bezier(.2,.7,.2,1), background-color .2s; }
.budget-left { margin-top: 6px; font-size: 14px; color: var(--muted); }
.budget.is-over .budget-fill { background: var(--accent); }
.budget.is-over .budget-spent, .budget.is-over .budget-left { color: var(--accent-text); }
.budget.is-over .budget-left { font-weight: 600; }

.needs-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.goals-title { font: 700 15px/1.2 var(--display); letter-spacing: -.01em; }
.goal-count { font: 500 18px/1 var(--num); color: var(--muted); white-space: nowrap; }
.goal-count.is-done { color: var(--accent-text); }
.goals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.goal {
  display: grid; grid-template-columns: 16px 1fr auto; gap: 2px 10px; align-items: start;
  padding: 3px 0; font-size: 14.5px; line-height: 1.2;
}
.goal + .goal { border-top: 1px dashed var(--line); }
.mk { display: inline-grid; place-items: center; width: 16px; height: 16px; border: 1.5px solid var(--line-2); flex: none; margin-top: .05em; }
.mk.is-on { background: var(--accent); border-color: var(--accent); }
.mk.is-on::after { content: ""; width: 7px; height: 4px; border: solid var(--ink); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.g-text { color: var(--ink); }
.goal:not(.is-met) .g-text { color: var(--muted); }
.g-detail { font-size: 14px; color: var(--muted); text-align: right; white-space: nowrap; }
.goal.is-warn .g-detail { color: var(--accent-text); font-weight: 600; }
.goal.is-long { grid-template-columns: 16px 1fr; }
.goal.is-long .g-detail { grid-column: 2; text-align: left; white-space: normal; }

.result { background: var(--ink); color: #fff; }
.result-title { font: 800 22px/1.1 var(--display); letter-spacing: -.02em; }
.result-line { margin-top: 6px; font-size: 15px; color: #d8d0c7; }

.room-sum { display: flex; flex-direction: column; gap: 10px; margin-top: auto; border-bottom: 0 !important; }
@media (min-width: 1100px) {
  /* the room panel takes the canvas's height and scrolls on its own; the cart button stays at its foot */
  .inspector { height: 0; min-height: 100%; overflow-y: auto; scrollbar-width: thin; }
  /* the 3D preview takes whatever height the room facts leave, so the needs list never scrolls */
  .inspector > .side3d { flex: 1 1 0; min-height: 0; max-height: 300px; aspect-ratio: auto; }
  .app.is-3d .side3d { display: none; } /* the canvas already shows the room in 3D */
  /* room facts kept tight to leave the preview its height: the size is already above the plan,
     money left sits on the budget line, the total is in the budget */
  .brief-dims, .room-sum-line { display: none; }
  .budget { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; column-gap: 10px; }
  .budget-row { display: contents; }
  .budget-spent { grid-column: 1; grid-row: 1; }
  .budget-of { grid-column: 2; grid-row: 1; }
  .budget-left { grid-column: 3; grid-row: 1; margin-top: 0; text-align: right; }
  .budget-bar { grid-column: 1 / -1; grid-row: 2; margin-top: 8px; }
  .room-sum { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); z-index: 1; }
}
.room-sum-line { font-weight: 600; font-size: 17px; }
@media (min-width: 1100px) and (max-height: 919px) {
  /* on laptop screens the 3D preview sits beside the room type and budget, so it costs no extra height
     and the needs list still fits under the section heading */
  .inspector { display: grid; grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); grid-template-rows: auto auto auto 1fr auto; }
  .inspector > * { grid-column: 1 / -1; }
  .inspector > .side3d { grid-column: 1; grid-row: 1 / 3; max-height: none; height: auto; border-right: 1px solid var(--line); }
  .inspector > .brief-text { grid-column: 2; grid-row: 1; padding: 10px 14px 6px; border-bottom: 0; }
  .inspector > .budget { grid-column: 2; grid-row: 2; padding: 0 14px 10px; display: block; }
  .inspector > .result { grid-row: 3; }
  .inspector > .needs { grid-row: 4; }
  .inspector > .room-sum { grid-row: 5; }
  .type-pick select { font-size: 19px; padding-right: 22px; background-position: right 2px center; }
  .budget-row { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
  .budget-spent { font-size: 28px; }
  .budget-of { font-size: 17px; }
  .budget-bar { margin-top: 8px; }
  .budget-left { margin-top: 5px; font-size: 13px; text-align: left; }
}
@media (min-width: 1100px) and (max-height: 760px) {
  /* 1366 × 768 laptops: the bar already shows what is left, and the ruler gives its height to the needs list */
  .inspector > .budget .budget-left { display: none; }
  .planner > .ruler { display: none; }
  .planner { padding-bottom: 6px; }
  .planner-head { padding: 10px 0 8px; }
}

.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; opacity: 0;
  width: calc(var(--w, 2) * 22px); height: calc(var(--d, 2) * 22px);
}
.drag-ghost svg { width: 100%; height: 100%; transform: translate(-50%, -50%); filter: drop-shadow(0 6px 10px rgba(0,0,0,.18)); }
.drag-ghost.is-on { opacity: 1; }
.drag-ghost.is-over { opacity: 0; }

/* ---------- module ---------- */
.module { padding: 0 var(--gut) clamp(48px, 7vw, 96px); }
.module-copy { padding: clamp(36px, 5vw, 64px) 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 56px; align-items: end; }
.wall-figure { margin: clamp(28px, 4vw, 56px) auto 0; max-width: 980px; }
.wall-figure svg { width: 100%; height: auto; display: block; }
/* the wall drawing keeps its own lettering (Karla) */
.wall-figure .dim line { stroke: var(--ink); stroke-width: 1.2; }
.wall-figure .dim text, .wall-figure .ruler-n { font: 700 15px var(--logo); fill: var(--ink); text-anchor: middle; }
.wall-figure .wall-name { font: 500 15px var(--logo); fill: var(--muted); text-anchor: middle; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 28px var(--gut) 40px; display: flex; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; font-size: 15px; color: var(--muted); }

/* ---------- cart drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(28,27,25,.38); z-index: 40; opacity: 0; transition: opacity .25s; }
.drawer-scrim.is-open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(420px, 100%);
  background: var(--paper); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .26s cubic-bezier(.2,.7,.2,1);
}
.drawer.is-open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font: 800 30px/1 var(--display); letter-spacing: -.03em; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 22px; }
.cart-empty { padding: 24px 0; color: var(--muted); }
.cart-row { display: grid; grid-template-columns: 56px 1fr auto; grid-template-rows: auto auto; gap: 4px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cr-icon { grid-row: 1 / span 2; height: 56px; display: grid; place-items: center; background: var(--plaster); }
.cr-icon svg { width: calc(var(--w) * 10px + 4px); height: calc(var(--d) * 10px + 4px); max-width: 48px; max-height: 48px; }
.cr-name { font-weight: 700; font-size: 15px; }
.cr-name small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.cr-price { font: 500 22px/1 var(--num); font-variant-numeric: tabular-nums; grid-column: 3; grid-row: 1; text-align: right; }
.qty { grid-column: 2 / span 2; grid-row: 2; display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); justify-self: start; }
.qty button { width: 32px; height: 30px; border: 0; background: transparent; cursor: pointer; font-size: 17px; }
.qty button:hover { background: var(--plaster); }
.qty span { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; }
.drawer-foot { padding: 18px 22px 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.drawer-foot:empty { display: none; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 19px; font-variant-numeric: tabular-nums; }
.cart-note { font-size: 14px; color: var(--muted); }
.checkout-msg { font-size: 14px; background: var(--plaster); padding: 10px 12px; }

/* ---------- narrower desktops ---------- */
@media (max-width: 1500px) {
  .bt-meta { display: none; }
}
@media (max-width: 1280px) {
  .app-body { grid-template-columns: 88px minmax(0, 1fr) 300px; }
  .bt-meta { display: none; }
  .starters-label { display: none; }
}

/* ---------- tablet and phone: one column ---------- */
@media (max-width: 1099px) {
  .app-bar { grid-template-columns: minmax(0, 1fr) auto; gap: 0; padding: 0; }
  .steps { grid-column: 1; }
  .tool-group { grid-column: 2; padding: 0 10px; }
  .starters-row { grid-column: 1 / -1; grid-row: 2; border-top: 1px solid var(--line); padding: 8px 10px; }
  .bt-meta { display: block; }
  .app-body { display: flex; flex-direction: column; min-height: 0; }
  .inspector { display: contents; }
  .inspector > * { border-left: 0; }
  .side3d { display: none; }
  .budget { order: 1; position: sticky; top: var(--head); z-index: 5; background: var(--paper);
    display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; column-gap: 10px; padding: 10px 14px; }
  .budget-row { display: contents; }
  .budget-spent { font-size: 36px; grid-column: 1; grid-row: 1; }
  .budget-of { grid-column: 2; grid-row: 1; }
  .budget-left { grid-column: 3; grid-row: 1; margin-top: 0; }
  .budget-bar { grid-column: 1 / -1; grid-row: 2; margin-top: 8px; }
  .rail { order: 2; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; }
  .draw-tools, .tray-cats { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .draw-tools::-webkit-scrollbar, .tray-cats::-webkit-scrollbar { display: none; }
  .draw-tool, .cat { flex: 1 0 auto; min-width: 64px; padding: 11px 8px; font-size: 14px; }
  .board { order: 3; }
  .tray { position: sticky; bottom: 0; z-index: 4; box-shadow: 0 -10px 18px -14px rgba(0,0,0,.3); }
  .brief-text { order: 4; }
  .result { order: 5; }
  .needs { order: 6; }
  .room-sum { order: 7; }
}
@media (max-width: 860px) {
  .site-nav { display: none; }
  .cart-btn { margin-left: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 28px; padding-top: 28px; padding-bottom: clamp(40px, 7vh, 88px); }
  .hero h1 { font-size: clamp(48px, 14vw, 80px); }
  .hero-body { font-size: 18px; margin-top: 18px; }
  .hero .btn { margin-top: 26px; }
  #hero3d { aspect-ratio: 4 / 3.3; max-height: none; }
  .hero-stage { translate: none; }
  .planner-head, .module-copy { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-bottom: 20px; }
  .app { margin: 0 calc(var(--gut) * -1); border-left: 0; border-right: 0; }
  .wall-figure { margin-top: 20px; }
}
@media (max-width: 560px) {
  :root { --head: 52px; }
  .step { padding: 0 16px; font-size: 16px; }
  .app-bar { min-height: 56px; }
  .tool { height: 36px; padding: 0 9px; }
  .board-tools { padding: 8px 10px 0; min-height: 44px; }
  .board-dims { font-size: 21px; }
  .board-stage { padding: 4px 4px 4px; min-height: 0; }
  .plan3d { inset: 4px; min-height: 320px; position: absolute; }
  .board-stage.is-3d { min-height: 340px; }
  .plan { max-height: none; }
  .drawbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px; }
  .draw-hint { font-size: 15px; }
  .tray { padding: 8px 10px 10px; }
  .tray-card { width: 146px; padding: 6px 6px 8px; }
  .tray-card { gap: 2px; }
  .tc-icon { height: 44px; margin-bottom: 2px; }
  .tc-price { font-size: 18px; }
  .tc-meta { font-size: 13px; }
  .tc-icon svg { width: calc(var(--w) * 10px + 6px); height: calc(var(--d) * 10px + 6px); max-height: 44px; }
  .tc-name { font-size: 15px; }
  .selbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px; }
  .sel-actions { margin-left: auto; }
  .plan-hint { font-size: 15px; }
  .toast { white-space: normal; width: max-content; max-width: calc(100% - 24px); text-align: center; }
  .inspector > * { padding: 14px; }
  .site-foot { flex-direction: column; }
}
.drawer[hidden], .drawer-scrim[hidden] { display: none; }

/* ===== v25 editor redesign ===== */
/* EDITOR REDESIGN (drawing first). Loaded after styles.css; every rule is scoped to #workspace so it wins
   over the base rules without relying on source order. */

#workspace {
  --L: 224px;               /* left column: tools + starting rooms (Draw), groups + catalogue (Furnish) */
  --P: 288px;               /* room panel */
  --drawing: #8a8178;       /* plan: dimension lines, door arcs, room areas */
  --grid-1: #f1ece6;        /* plan: 50 cm lines on the floor */
  --grid-2: #e4ddd3;        /* plan: 1 m lines on the floor */
}

/* ---------- plan drawing (all sizes) ---------- */
#workspace .plan { overflow: hidden; }
#workspace .plan .dots { fill: var(--line-2); }
#workspace .plan .floor { fill: #fff; }
#workspace .plan .fgrid line { stroke: var(--grid-1); stroke-width: 1; vector-effect: non-scaling-stroke; shape-rendering: crispEdges; }
#workspace .plan .fgrid line.m { stroke: var(--grid-2); }
#workspace .plan .wedge { fill: rgba(35, 30, 26, .04); }
#workspace .plan .walls { fill: var(--ink); }
#workspace .plan .win { fill: #fff; stroke: var(--ink); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
#workspace .plan .glass { stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
#workspace .plan .arc { fill: none; stroke: var(--drawing); stroke-width: 1; vector-effect: non-scaling-stroke; }
#workspace .plan .leaf { fill: #fff; stroke: var(--ink); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
#workspace .plan .dim line { stroke: var(--drawing); stroke-width: 1; vector-effect: non-scaling-stroke; }
#workspace .plan .dim line.tick { stroke: var(--drawing); }
#workspace .plan .dim line.end { stroke: var(--ink); stroke-width: 1.5; }
#workspace .plan .dim text, #workspace .plan .area, #workspace .plan .entrance, #workspace .plan .draft-size {
  font-family: var(--ui); font-weight: 500; text-anchor: middle; dominant-baseline: central;
  paint-order: stroke; stroke: #fff; stroke-linejoin: round; letter-spacing: 0;
}
#workspace .plan .dim text { fill: var(--ink); }
#workspace .plan .area { fill: var(--drawing); stroke: none; }
#workspace .plan .entrance { fill: var(--muted); stroke: none; }
#workspace .plan .draft-size { fill: var(--ink); font-weight: 600; }
#workspace .plan .draft-size.at-start { text-anchor: start; }
#workspace .plan .unreached { fill: url(#hatch); opacity: .28; }
#workspace .plan .unreached-edge { fill: none; stroke: var(--accent); stroke-width: 1; vector-effect: non-scaling-stroke; }
#workspace .plan .keep-clear { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
#workspace .plan .sel-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
#workspace .piece.is-sel .outline { stroke: transparent; }      /* the selection layer above the walls draws it */
#workspace .plan .draft-add { fill: rgba(229, 87, 60, .10); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; }
#workspace .plan .draft-wall { stroke: var(--accent); stroke-width: 8; stroke-linecap: butt; }
#workspace .plan .draft-win { stroke: var(--accent); stroke-width: 12; }

/* the 3D canvases stand on the white board and panel, like the hero */
#workspace .side3d, #workspace .plan3d { background: var(--paper); }
#workspace .stage3d canvas { cursor: grab; }
#workspace .stage3d canvas:active { cursor: grabbing; }
#workspace .no3d { font-size: 14px; padding: 16px; }

/* toast: plain fade at the top of the stage */
#workspace .toast { top: 8px; bottom: auto; transform: translateX(-50%); transition: opacity .18s; font-size: 15px; padding: 8px 14px; }
#workspace .toast.is-on { transform: translateX(-50%); }

/* catalogue card hover: border only */
#workspace .tray-card { transition: border-color .15s; }
#workspace .tray-card:hover { transform: none; border-color: var(--ink); }
#workspace .tc-price { font: 600 15px/1 var(--ui); font-variant-numeric: tabular-nums; }

/* Plan or 3D: the chosen view is filled coral like every other chosen control */
#workspace .seg-btn.is-on { background: var(--accent); color: var(--ink); }

/* type: no Teko in the editor */
#workspace .board-dims { font: 400 15px/1.2 var(--ui); letter-spacing: 0; padding: 0; display: flex; gap: 8px; align-items: baseline; white-space: nowrap; }
#workspace .board-dims b { font-weight: 600; color: var(--ink); }
#workspace .board-dims span { color: var(--muted); }
#workspace .budget-spent { font: 600 22px/1 var(--ui); font-variant-numeric: tabular-nums; padding: 0; letter-spacing: -.01em; }
#workspace .budget-of { font: 400 14px/1 var(--ui); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
#workspace .budget-field { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 7px; border: 1px solid var(--line-2); background: var(--paper); color: var(--muted); }
#workspace .budget-field:hover { border-color: var(--ink); }
#workspace .budget-field:focus-within { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
#workspace .budget-of input { font: 500 14px/1 var(--ui); font-variant-numeric: tabular-nums; color: var(--ink); width: 5.6ch; border: 0; padding: 0; margin: 0; background: transparent; }
#workspace .budget-of input:focus { outline: none; border: 0; }
#workspace .budget-left { font-size: 13px; font-variant-numeric: tabular-nums; }
#workspace .budget-bar { height: 6px; }
#workspace .goal-count { font: 600 14px/1 var(--ui); font-variant-numeric: tabular-nums; }
#workspace .goals-title { font: 700 15px/1.2 var(--display); }

/* needs: what is still open reads strongest; a detail stays on the same line when it fits */
#workspace .goal { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 0 10px; padding: 3px 0; font-size: 14px; line-height: 1.3; align-items: start; }
#workspace .goal + .goal { border-top: 0; }
#workspace .goal .mk { margin-top: 1px; }
#workspace .g-body { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 10px; min-width: 0; }
#workspace .g-text { color: var(--ink); }
#workspace .goal.is-met .g-text { color: var(--muted); }
#workspace .g-detail { font-size: 13px; color: var(--muted); text-align: right; margin-left: auto; white-space: nowrap; }
#workspace .goal.is-warn .g-detail { color: var(--accent-text); font-weight: 500; }

/* ---------- desktop: 1100 px and wider ---------- */
@media (min-width: 1100px) {
  #workspace { display: flex; flex-direction: column; }
  #workspace .app-body { grid-template-columns: var(--L) minmax(0, 1fr) var(--P); flex: 1 1 0; min-height: 0; overflow: hidden; }

  /* top bar, 48 px: steps over the left column, then Undo, Clear and the next step on the right */
  #workspace .app-bar { grid-template-columns: var(--L) minmax(0, 1fr) auto; min-height: 0; height: 48px; gap: 0; padding: 0 8px 0 0; }
  #workspace .steps { width: var(--L); border-right: 1px solid var(--line); }
  #workspace .step { flex: 1 1 0; justify-content: center; padding: 0 8px; font-size: 17px; border-right: 0; }
  #workspace .step + .step { border-left: 1px solid var(--line); }
  #workspace .tool-group { grid-column: 3; gap: 6px; align-items: center; }
  #workspace .app-bar .tool { height: 34px; padding: 0 14px; }
  #workspace .app-bar .tool:disabled { color: #a39a90; }
  #workspace .app-bar .btn { height: 34px; padding: 0 16px; font: 600 15px/1 var(--ui); margin-left: 6px; }
  #workspace.is-drawing #addRoom, #workspace:not(.is-drawing) #toFurnish { display: none; }

  /* left column */
  #workspace .rail { display: flex; flex-direction: column; gap: 0; padding: 12px; min-height: 0; overflow: hidden; background: #faf7f4; }
  #workspace .draw-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  #workspace .draw-tool { padding: 0; height: 38px; font-size: 15px; }
  #workspace .rail .drawbar { display: block; padding: 10px 2px 0; border: 0; }
  #workspace .rail .draw-hint { font-size: 14px; line-height: 1.4; color: var(--muted); }
  #workspace .rail .starters-row { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
  #workspace:not(.is-drawing) .rail .starters-row { display: none; }
  #workspace .rail .starters-label { display: block; font: 600 13px/1 var(--ui); color: var(--muted); padding-left: 2px; }
  #workspace .rail .briefs { flex-direction: column; gap: 4px; overflow: visible; padding: 0; }
  #workspace .rail .brief-tab { flex-direction: row; justify-content: space-between; align-items: center; gap: 8px; min-height: 0; height: 36px; padding: 0 10px; }
  #workspace .rail .bt-name { font-weight: 500; font-size: 14px; }
  #workspace .rail .bt-meta { display: none; font-size: 13px; }
  #workspace .tray-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  #workspace .cat { padding: 0; height: 34px; font-size: 14px; }
  #workspace .rail .tray { border: 0; background: transparent; padding: 0; margin-top: 12px; flex: 1 1 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
  #workspace .rail .tray-items { flex-direction: column; overflow: visible; gap: 6px; padding: 0; }
  #workspace .rail .tray-card { width: auto; height: 64px; display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; row-gap: 4px; padding: 6px 8px 6px 6px; align-content: center; touch-action: pan-y; }
  #workspace .rail .tc-icon { grid-row: 1 / 3; height: 52px; margin: 0; }
  #workspace .rail .tc-icon svg { width: calc(var(--w) * 9px + 4px); height: calc(var(--d) * 9px + 4px); max-width: 50px; max-height: 44px; }
  #workspace .rail .tc-name { font-size: 14px; line-height: 1.15; align-self: end; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #workspace .rail .tc-meta { font-size: 13px; line-height: 1; align-self: start; white-space: nowrap; }
  #workspace .rail .tc-price { font-size: 14px; }

  /* board: one 44 px row (room size, or the selected piece), then the plan takes the rest */
  #workspace .board { min-height: 0; overflow: hidden; }
  #workspace .board-tools { height: 44px; min-height: 0; padding: 0 12px 0 16px; gap: 12px; }
  #workspace .board-tools .selbar { flex: 0 1 auto; min-width: 0; height: 38px; border: 0; padding: 0 3px 0 12px; gap: 16px; margin-right: auto; }
  #workspace .board-tools .sel-info { flex: 0 1 auto; min-width: 0; }
  #workspace .board-tools:has(.selbar:not([hidden])) .board-dims { display: none; }
  #workspace .sel-name { font-size: 15px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #workspace .sel-meta { font-size: 13px; line-height: 1.25; }
  #workspace .sel-actions { gap: 4px; }
  #workspace .board-tools .tool { height: 32px; padding: 0 12px; }
  #workspace .seg-btn { height: 32px; font-size: 15px; font-weight: 500; padding: 0 14px; }
  #workspace .board-stage { display: block; position: relative; flex: 1 1 0; min-height: 0; padding: 0; overflow: hidden; }
  #workspace .board-stage > .plan { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; }
  #workspace .plan3d { inset: 0; }

  /* room type: a setting of the whole room, in the top bar after the steps */
  #workspace .app-bar > .brief-text { grid-column: 2; padding: 0 16px; border: 0; min-width: 0; }
  #workspace .type-pick { display: flex; align-items: center; gap: 10px; }
  #workspace .type-pick span { position: static; width: auto; height: auto; clip-path: none; overflow: visible; font-size: 14px; color: var(--muted); flex: none; }
  #workspace .type-pick select {
    width: auto; min-width: 0; height: 34px; font: 600 15px/1 var(--ui); letter-spacing: 0; padding: 0 32px 0 10px;
    border: 1px solid var(--line-2); background-color: var(--paper); background-position: right 11px center; background-size: 12px 8px;
  }
  #workspace .type-pick select:hover { border-color: var(--ink); }
  #workspace .brief-dims { display: none; }

  /* room panel: the 3D preview full width on top, then the budget and what the room needs; one 16 px inset */
  #workspace .inspector { display: flex; flex-direction: column; overflow-y: auto; }
  #workspace .inspector > * { padding: 12px 16px; }
  #workspace .inspector > .result, #workspace .room-sum { display: none; }
  #workspace .inspector > .side3d { flex: 1 1 0; min-height: 120px; max-height: var(--P); height: auto; aspect-ratio: auto; padding: 0; }
  #workspace .inspector > .budget { display: grid; grid-template-columns: auto auto 1fr; align-items: center; column-gap: 8px; padding: 14px 16px; }
  #workspace .budget-row { display: contents; }
  #workspace .budget-spent { grid-column: 1; grid-row: 1; }
  #workspace .budget-of { grid-column: 2; grid-row: 1; }
  #workspace .budget-left { display: block; grid-column: 3; grid-row: 1; justify-self: end; margin: 0; text-align: right; line-height: 1.2; }
  #workspace .budget-bar { grid-column: 1 / -1; grid-row: 2; margin-top: 10px; }
  #workspace .inspector > .needs { flex: 0 0 auto; padding: 14px 16px 16px; }
  #workspace .needs-head { margin-bottom: 8px; }
}

/* column widths: set once, by screen width */
@media (min-width: 1280px) { #workspace { --L: 240px; --P: 320px; } #workspace .rail .bt-meta { display: block; } }
@media (min-width: 1536px) { #workspace { --L: 256px; --P: 360px; } }
@media (min-width: 1800px) { #workspace { --L: 272px; --P: 400px; } }

/* short screens: rows a little tighter */
@media (min-width: 1100px) and (max-height: 759px) {
  #workspace .goal { padding: 2px 0; line-height: 1.25; }
  #workspace .inspector > .side3d { min-height: 72px; }
  #workspace .inspector > .budget { padding: 12px 16px; }
  #workspace .inspector > .needs { padding: 12px 16px; }
}
@media (min-width: 1100px) and (min-height: 900px) {
  #workspace .goal { padding: 4px 0; }
}

/* ---------- phone and tablet ---------- */
@media (max-width: 1099px) {
  #workspace:not(.is-drawing) .starters-row { display: none; }
  #workspace .board-stage { display: block; padding: 0; min-height: 0; }
  #workspace .board-stage > .plan { width: 100%; max-height: none; aspect-ratio: auto; }
}

/* ===== v26 (zan, 2026-10-16) ===== */
/* desktop: the next step (Furnish this room / Add room to cart) is a coral button closing the room panel;
   Undo and Clear sit alone at the right end of the top bar */
@media (min-width: 1100px) {
  #workspace .inspector > .room-sum { display: block; margin-top: auto; padding: 12px 16px 16px; border-top: 0; }
  #workspace .room-sum-line { display: none; }
  #workspace .room-sum .btn { width: 100%; height: 48px; justify-content: center; font: 600 16px/1 var(--ui); margin: 0; }
  #workspace .app-bar { padding-right: 12px; }
  #workspace .app-bar .tool { height: 36px; padding: 0 16px; font-size: 15px; }
  /* scaled tool window: rows as at 1440 × 800 */
  #workspace.is-zoomed .goal { padding: 3px 0; }
}
@media (min-width: 1100px) and (max-height: 759px) {
  #workspace .inspector > .room-sum { padding: 8px 16px 12px; }
  #workspace .room-sum .btn { height: 42px; }
}

/* hero and section text grow with wide screens instead of stopping at 1745 px */
.hero h1 { font-size: clamp(52px, 5.5vw, 168px); }
.hero-body { font-size: max(21px, 1.12vw); }
.hero .btn { font-size: max(17px, .9vw); height: max(54px, 2.8vw); padding: 0 max(22px, 1.15vw); }
.planner-head h2, .module h2 { font-size: clamp(38px, 4.4vw, max(66px, 3.5vw)); }
.planner-head p, .module-copy p { font-size: max(16.5px, .88vw); }

/* the 50 cm module: one screen, the copy on the left and the wall drawing as large as the height allows */
@media (min-width: 1100px) {
  .module {
    display: grid; grid-template-columns: minmax(300px, .72fr) minmax(0, 1.6fr); column-gap: clamp(32px, 4vw, 96px);
    align-items: center; min-height: calc(100svh - var(--head)); padding-bottom: clamp(32px, 4vh, 64px);
  }
  .module > .ruler { grid-column: 1 / -1; align-self: start; }
  .module-copy { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 0; align-self: center; }
  .module-copy h2 { font-size: clamp(48px, 4.6vw, 112px); }
  .wall-figure { margin: clamp(24px, 4vh, 48px) 0; max-width: none; justify-self: center;
    width: min(100%, calc((100svh - var(--head) - 120px) * 1.4576)); }
}
