[hidden] { display: none !important; }   /* a display rule must never un-hide a hidden element */
:root {
  --ink: #1f2124; --ink2: #55585d; --paper: #f5f2ec; --card: #ffffff; --line: #e2ddd3;
  --accent: #9a5b2e; --accent-ink: #fff; --ok: #2f6b3a; --err: #a12d22;
  --r: 12px; --gut: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--paper);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); }
button, input, select, textarea { font: inherit; color: inherit; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 10px var(--gut); padding-top: max(10px, env(safe-area-inset-top)); background: var(--ink); color: #fff; }
.brand { display: flex; gap: 10px; align-items: center; }
.brand .logo { background: #fff; border-radius: 8px; padding: 2px; object-fit: contain; }
.brand b { display: block; letter-spacing: .14em; font-size: 14px; }
.brand span { display: block; font-size: 12px; opacity: .7; letter-spacing: .04em; }
.ghost { background: transparent; border: 1px solid #ffffff55; color: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; }

/* ---- layout: preview on top (phone), side by side (desktop) ---- */
.layout { display: grid; grid-template-columns: 1fr; }
.preview { position: sticky; top: 52px; z-index: 10; background: #dde6ee; height: 46vh; min-height: 280px; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr) 420px; height: calc(100vh - 52px); }
  .preview { top: 0; height: 100%; border-bottom: 0; border-right: 1px solid var(--line); }
  .form { overflow-y: auto; height: 100%; }
}
/* App shell (index.html + custom.html, body.shell): the page itself never scrolls. Header and the 3D / plan
   preview stay put; only the options column scrolls - so editing never pushes the model off screen. */
html:has(body.shell), body.shell { height: 100%; overflow: hidden; overflow: clip; overscroll-behavior: none; }   /* clip: not even focus / scrollIntoView can scroll the page */
body.shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
body.shell .top { position: relative; flex: none; }
body.shell .layout { flex: 1 1 auto; min-height: 0; height: auto; grid-template-rows: auto minmax(0, 1fr); }
body.shell .preview { position: relative; top: auto; height: 46vh; height: 46dvh; }
body.shell .form { position: relative; overflow-y: auto; min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* the hidden radio / checkbox inputs behind pills, switches and segmented buttons are position:absolute - keep them
   inside their own control, or focusing one (any tap on an option) scrolls the page to wherever it floats */
.seg, .switch, .pill, .scale label, .mnn label, .buyopt { position: relative; }
@media (max-width: 899px) { body.shell.custom .preview { height: 36vh; height: 36dvh; min-height: 230px; } }
@media (min-width: 900px) {
  body.shell .layout { grid-template-rows: minmax(0, 1fr); }
  body.shell .preview { height: auto; }
  body.shell .form { height: auto; }
}
.tabs { display: flex; gap: 4px; padding: 6px 8px 0; background: #eef1f4; }
.tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px 8px 0 0; cursor: pointer; color: var(--ink2); font-weight: 600; font-size: 14px; }
.tabs button[aria-selected=true] { background: #dde6ee; color: var(--ink); }
.stage { position: relative; flex: 1; min-height: 0; }
.pane { position: absolute; inset: 0; }
.pane[hidden] { display: none; }
#view3d canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.scroll { overflow-y: auto; background: var(--card); padding: 14px var(--gut); }
.chips { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 0; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; background: #ffffffcc; backdrop-filter: blur(6px); cursor: pointer; }
.chips button.on { background: var(--ink); color: #fff; }
.badge { position: absolute; left: 10px; bottom: 10px; z-index: 2; background: #1f2124d9; color: #fff; padding: 6px 12px; border-radius: 8px; font-size: 13px; }
.badge em { font-style: normal; color: #f3c99e; }
.hint { position: absolute; right: 10px; bottom: 12px; font-size: 11px; color: #33363bb0; pointer-events: none; }
@media (max-width: 600px) { .hint { display: none; } }
.loading[hidden] { display: none; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; background: #dde6eecc; font-weight: 600; z-index: 5; }
#viewPlan { background: #fff; }
#planHost { position: absolute; inset: 44px 8px 8px; touch-action: none; overflow: hidden; }
.zoomctl { position: absolute; right: 8px; top: 52px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.zoomctl button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fffffff0; font-size: 20px; line-height: 1; color: var(--ink); cursor: pointer; box-shadow: 0 1px 3px #0002; }
.zoomctl button:disabled { opacity: .35; cursor: default; }
.plan-svg { width: 100%; height: 100%; }
.plan-svg .room { fill: #f7f4ee; stroke: none; }
.plan-svg .room.gar { fill: #ecebe8; }
.plan-svg .lbl { font-size: 1px; text-anchor: middle; font-weight: 600; fill: #2b2b2b; letter-spacing: .02em; }
.plan-svg .lbl.out { font-size: .8px; fill: #7d7566; font-weight: 500; }
.plan-svg .dim { font-size: .7px; text-anchor: middle; fill: #6b6b6b; }
.plan-svg .dim.big { font-size: 1.1px; fill: #333; }
.plan-svg .dimline line { stroke: #777; stroke-width: .07; }

/* ---- form ---- */
.form { padding: 12px var(--gut) 0; }
.card { border: 1px solid var(--line); background: var(--card); border-radius: var(--r); margin: 0 0 12px; padding: 12px 14px 14px; min-width: 0; }
legend { font-weight: 700; font-size: 16px; padding: 0 6px; display: flex; align-items: center; gap: 8px; }
legend i { font-style: normal; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.row.col { flex-direction: column; align-items: stretch; }
.row.col output { float: right; font-weight: 500; color: var(--accent); }
.row input:not([type=range]):not([type=radio]), .row select, .row textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; font-weight: 400; font-size: 16px; }
.row > select { width: auto; flex: 0 1 auto; font-size: 15px; }
.row.col > select { width: 100%; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; flex-wrap: wrap; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 7px 12px; font-weight: 500; cursor: pointer; border-left: 1px solid var(--line); font-size: 14px; min-width: 38px; text-align: center; }
.seg label:first-of-type { border-left: 0; }
.seg input:checked + label { background: var(--ink); color: #fff; }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: -2px; }
.sub { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink2); margin: 14px 0 6px; font-weight: 700; }
.matches { display: grid; gap: 8px; }
.match { text-align: left; border: 1.5px solid var(--line); background: #fbfaf7; border-radius: 10px; padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; }
.match b { font-size: 15px; letter-spacing: .03em; }
.match span { font-size: 13px; color: var(--ink2); }
.match.on { border-color: var(--accent); background: #fbf3ec; box-shadow: 0 0 0 1px var(--accent) inset; }
.note { font-size: 13px; color: var(--ink2); margin: 8px 0 0; }
.note a { color: var(--accent); }
.switch { display: flex; align-items: center; gap: 12px; margin: 12px 0; font-weight: 600; font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 44px; height: 26px; border-radius: 13px; background: #cfcac0; position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px #0003; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 12px 0 4px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.sw { border: 0; background: none; padding: 0; cursor: pointer; display: grid; gap: 4px; justify-items: center; font-size: 11px; color: var(--ink2); }
.sw i { width: 100%; height: 34px; border-radius: 8px; border: 1px solid #0002; display: block; }
.sw.on i { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.sw.on span { color: var(--ink); font-weight: 700; }
.err { color: var(--err); font-weight: 600; font-size: 14px; min-height: 1em; margin: 6px 0 0; }
.release { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 22%); padding: 18px 0 max(14px, env(safe-area-inset-bottom)); display: grid; gap: 6px; }
.releaseInfo { font-size: 14px; color: var(--ink); text-align: center; }
.releaseInfo b { color: var(--accent); font-size: 16px; }
.releaseInfo span { font-size: 12px; color: var(--ink2); }
#viewSummary tr.price td { color: var(--ink); }
#viewSummary tr.price b { color: var(--accent); font-size: 16px; }
.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 14px 18px; font-weight: 700; font-size: 16px; cursor: pointer; letter-spacing: .02em; }
.primary:disabled { opacity: .6; }
#viewSummary h3 { margin: 4px 0 10px; }
#viewSummary h4 { margin: 16px 0 6px; font-size: 14px; }
#viewSummary table { border-collapse: collapse; width: 100%; font-size: 14px; }
#viewSummary th { text-align: left; color: var(--ink2); font-weight: 600; padding: 6px 10px 6px 0; vertical-align: top; width: 84px; }
#viewSummary td { padding: 6px 0; border-bottom: 1px solid var(--line); }
#viewSummary ul { margin: 0; padding-left: 18px; font-size: 14px; }
/* ---- mode switch ---- */
.modes { display: flex; gap: 4px; background: #ffffff14; border-radius: 999px; padding: 3px; }
.modes a { color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; opacity: .75; white-space: nowrap; }
.modes a[aria-current=page] { background: #fff; color: var(--ink); opacity: 1; }
@media (max-width: 420px) { .brand span { display: none; } .modes a { padding: 6px 9px; font-size: 12px; } }

/* ---- custom design stepper ---- */
.stepper { position: sticky; top: 0; z-index: 3; background: var(--paper); padding: 8px 0 8px; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .25s; }
.stepnav { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 13px; color: var(--ink2); gap: 8px; }
.stepnav select { border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; max-width: 62%; font-size: 13px; }
/* Custom design: 5 named phases over the 17 form sections (custom.js PHASES) */
.phases { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-bottom: 8px; }
.phases .ph { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; padding: 2px 0; cursor: pointer; color: var(--ink2); font: inherit; }
.phases .ph i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 13px; border: 1.5px solid var(--line); background: #fff; }
.phases .ph span { font-size: 11px; line-height: 1.15; text-align: center; }
.phases .ph.on { color: var(--ink); font-weight: 700; }
.phases .ph.on i { background: var(--accent); border-color: var(--accent); color: #fff; }
.phases .ph.done i { background: #fbf3ec; border-color: var(--accent); color: var(--accent); }
.phasehead { margin: 10px 0 2px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.phasehead b { font-size: 18px; }
.phasehead span { font-size: 12px; color: var(--accent); font-weight: 600; }
.phasehead small { flex-basis: 100%; font-size: 13px; color: var(--ink2); }
.custom .stepnav #stepLabel { display: none; }
.custom .stepnav { justify-content: flex-end; }
.custom .stepnav select { max-width: 100%; color: var(--ink2); }
.custom #back { border-color: transparent; background: none; color: var(--ink2); }
/* Custom design round 2: fields that need fixing, the "what happens next" box, two short fields per row on wide screens */
.custom .q.bad input, .custom .q.bad select, .custom .q.bad textarea { border-color: #b3261e; box-shadow: 0 0 0 3px rgba(179, 38, 30, .15); }
.custom .q.bad .ql, .custom .q.bad legend, .custom .check.bad { color: #b3261e; }
.custom .check.bad { outline: 2px solid #b3261e; outline-offset: 4px; border-radius: 6px; }
.custom .err:not(:empty) { background: #fdecea; color: #8c1d18; border-radius: 8px; padding: 8px 10px; font-weight: 600; }
.whatnext { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 12px 14px 4px; margin: 10px 0 4px; }
.whatnext h3 { margin: 0 0 6px; font-size: 16px; }
.whatnext ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.45; }
.whatnext li { margin: 0 0 8px; }
@media (min-width: 1100px) {
  .custom .card.step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; align-items: end; }
  .custom .card.step > * { grid-column: 1 / -1; }
  .custom .card.step > .q.short { grid-column: auto; }
}
/* room wish list: a room's Notes box shows once it's marked Must or Nice (or already has text) - 28 rooms stay short on a phone */
.custom .rrow:not(:has(input[value$='_Must']:checked, input[value$='_Nice']:checked)) > input[name$='_notes']:placeholder-shown { display: none; }
.custom .q textarea { min-height: 2.6em; resize: vertical; field-sizing: content; max-height: 12em; }   /* grows as they type */
@media (max-width: 760px) {                 /* Custom design on phones: every tap target at least 44px */
  .custom .q input:not([type=radio]):not([type=checkbox]), .custom .q select, .custom input.other, .custom .q textarea { min-height: 44px; }
  .custom .pill span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; }
  .custom .scale label b, .custom .mnn label b { min-width: 44px; height: 44px; }
  .custom .check { min-height: 44px; display: flex; align-items: center; gap: 10px; }
  .custom .check input { width: 22px; height: 22px; flex: none; }
  .custom .navbtns button { min-height: 48px; }
  .custom .phases .ph { min-height: 44px; }
}@media (max-width: 760px) {                 /* phone: give the questions the room - header scrolls away, no jump list */
  .custom .stepper { position: static; padding-top: 4px; }
  .custom .stepnav { display: none; }
  .phases .ph i { width: 22px; height: 22px; font-size: 12px; }
  .phases .ph span { font-size: 10px; }
  .phasehead b { font-size: 17px; }
  .custom .release { padding-top: 10px; }
}
.q { display: block; border: 0; padding: 0; margin: 12px 0; min-width: 0; }
.q > legend, .ql { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.q input:not([type=radio]):not([type=checkbox]), .q select, .q textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; font-size: 16px; }
.cb { font-style: normal; font-size: 10px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: 2px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill input { position: absolute; opacity: 0; }
.pill span { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 14px; background: #fff; cursor: pointer; }
.pill input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.other { margin-top: 6px; }
.scale { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink2); flex-wrap: wrap; }
.scale label input, .mnn label input { position: absolute; opacity: 0; }
.scale label b, .mnn label b { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 13px; color: var(--ink); }
.scale label input:checked + b, .mnn label input:checked + b { background: var(--ink); color: #fff; border-color: var(--ink); }
.scale label input:focus-visible + b, .mnn label input:focus-visible + b { outline: 2px solid var(--accent); }
.hh { display: grid; grid-template-columns: 1.4fr .5fr 1fr; gap: 6px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.hh input, .hh select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 15px; background: #fff; min-width: 0; }
.hh input:nth-child(4), .hh input:nth-child(5) { grid-column: 1 / -1; }
.rtable { display: grid; gap: 2px; }
.rrow { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rrow > input { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 14px; }
.rrow.rate small { display: block; color: var(--ink2); font-size: 12px; }
.mnn { display: flex; gap: 4px; }
.ranks { display: grid; gap: 6px; }
.ranks label { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.ranks input { width: 64px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 16px; text-align: center; }
.ack { font-size: 13px; color: var(--ink2); padding-left: 18px; }
.ack li { margin-bottom: 6px; }
.navbtns { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.ghost2 { background: #fff; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 15px; cursor: pointer; }
.ghost2:disabled { opacity: .4; }
#viewSummary .rl { columns: 2; font-size: 13px; }
#viewSummary .rl small { color: var(--ink2); }
body.custom .step legend { font-size: 17px; }
@media (max-width: 899px) { body.custom .preview { height: 36vh; min-height: 230px; } }

/* ---- checkout after release ---- */
.buy h3 { margin: 4px 0 8px; }
/* package picker at Release (pkgpick.js) */
.pkgPick { margin: 6px 0 4px; }
.pkgs { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.pkgs legend { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.pkgs .req { font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-left: 6px; }
.pkgs.missing legend { color: #b3261e; }
.pkgs.missing .pkg { border-color: #e2a39d; }
.pkg { position: relative; display: grid; gap: 4px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 42px; cursor: pointer; background: #fff; }
.pkg.on, .pkg:has(input:checked) { border-color: var(--accent); background: #fbf3ec; }
.pkg input { position: absolute; left: 14px; top: 15px; width: 18px; height: 18px; accent-color: var(--accent); }
.pkghead { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.pkghead b { font-size: 15px; }
.pkghead em { font-style: normal; font-weight: 700; font-size: 17px; color: var(--accent); white-space: nowrap; }
.pkgrate { font-size: 12px; color: var(--ink2); }
.pkg ul { margin: 2px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink); }
.pkg li { margin: 2px 0; }
.pkgnote { color: var(--ink2); font-size: 12px; font-style: italic; }
.buyopts { display: grid; gap: 8px; margin-bottom: 12px; }
.buyopt { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.buyopt:has(input:checked) { border-color: var(--accent); background: #fbf3ec; }
.buyopt input { margin-top: 3px; accent-color: var(--accent); }
.buyopt b { font-size: 15px; }
.buyopt em { font-style: normal; font-weight: 700; color: var(--accent); margin-left: 6px; }
.buyopt small { display: block; color: var(--ink2); font-size: 12px; margin-top: 2px; }
#payBtns { margin: 6px 0; min-height: 10px; }
.primary.dl { display: inline-block; text-decoration: none; margin: 8px 0 4px; }
.ghost2.wide { width: 100%; padding: 12px; margin-top: 8px; }

dialog { border: 0; border-radius: 14px; max-width: min(520px, calc(100vw - 32px)); padding: 20px; }
dialog::backdrop { background: #0008; }
dialog h2 { margin: 0 0 8px; }
dialog img { width: 100%; border-radius: 8px; margin: 10px 0 14px; }
dialog .primary { width: 100%; }

/* ---- layout editor (Our plans: "Change the layout" card + Floor plan edit mode) ---- */
.edbtn { position: absolute; top: 8px; right: 8px; z-index: 3; border: 0; border-radius: 999px; padding: 8px 14px; min-height: 36px; font-size: 13px; font-weight: 700; background: var(--accent); color: #fff; cursor: pointer; box-shadow: 0 1px 3px #0003; }
.edbtn.on { background: var(--ink); }
.planhint { position: absolute; left: 8px; right: 8px; bottom: 6px; margin: 0; z-index: 2; text-align: center; font-size: 12px; color: var(--ink2); pointer-events: none; }
.toast { position: absolute; left: 50%; top: 48px; transform: translateX(-50%); z-index: 4; max-width: calc(100% - 24px); background: #1f2124e6; color: #fff; font-size: 13px; padding: 8px 12px; border-radius: 8px; text-align: center; pointer-events: none; }
.toast[hidden], .planhint[hidden] { display: none; }
#viewPlan.editing #planHost { touch-action: none; bottom: 26px; }
.plan-svg .room.new { fill: #fbf1e6; }
.plan-svg .room.sel { fill: #f3d9bf; }
.editing .plan-svg * { pointer-events: none; }   /* labels, door swings etc. must not catch the finger */
.editing .plan-svg .room, .editing .plan-svg .ew, .editing .plan-svg .eb, .editing .plan-svg .hd, .editing .plan-svg .eo { pointer-events: auto; }
.plan-svg .eo { stroke: #9a5b2e; stroke-opacity: .55; stroke-width: 13; stroke-linecap: round; vector-effect: non-scaling-stroke; cursor: grab; }
.plan-svg .eo.eoh { stroke-opacity: 0; stroke-width: 22; }
.plan-svg .eo.win { stroke: #3f6d97; }
.plan-svg .eo.sel, .plan-svg .eo.drag { stroke-opacity: .95; stroke-width: 16; }
.plan-svg .eo.eoh.drag { stroke-opacity: 0; }
.oppanel { position: absolute; left: 8px; right: 8px; bottom: 28px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; box-shadow: 0 2px 10px #0002; font-size: 13px; }
.oppanel[hidden] { display: none; }
.oppanel b { font-size: 14px; }
.oppanel .grow { flex: 1 1 auto; min-width: 120px; }
.oppanel span { display: inline-flex; align-items: center; gap: 4px; color: var(--ink2); }
.oppanel em { font-style: normal; font-weight: 600; color: var(--ink); min-width: 40px; text-align: center; }
.oppanel button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 17px; cursor: pointer; }
.oppanel .x { background: #efebe4; border: 0; }
.editing .plan-svg .room { cursor: grab; }
.plan-svg .ewv { stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-dasharray: 5 4; opacity: .85; pointer-events: none; }
.plan-svg .ew { stroke: transparent; stroke-width: 16; vector-effect: non-scaling-stroke; cursor: grab; }
.plan-svg .ewg.drag .ewv, .plan-svg .ewg:hover .ewv { stroke-width: 4; opacity: 1; stroke-dasharray: none; }
.plan-svg .eb { fill: #9a5b2e22; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 6 4; cursor: grab; }
.plan-svg .eg.drag .eb { fill: #9a5b2e44; stroke-dasharray: none; }
.plan-svg .eg.drag .hd { display: none; }
/* tap-to-place (rooms, windows, doors) */
button.pill { border: 0; background: none; padding: 0; font: inherit; }
button.pill.on span { background: var(--ink); color: #fff; border-color: var(--ink); }
#edOps { margin-bottom: 4px; }
#edAdd.on { background: var(--ink); color: #fff; }
.edauto { flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--ink2); }
.edauto .seg label { padding: 6px 9px; }
.plan-svg .eg.sel .eb { fill: #3f6d9733; stroke: #3f6d97; stroke-dasharray: none; }
.oppanel .tip { display: block; color: var(--ink2); font-size: 12px; }
.oppanel .otypes button { width: auto; padding: 0 10px; font-size: 13px; }
.oppanel .otypes button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.oppanel button.del { width: auto; padding: 0 12px; font-size: 13px; color: #a12a1f; border-color: #e0b4ae; }
@media (max-width: 600px) {
  .oppanel { bottom: 6px; left: 6px; right: 6px; padding: 6px 8px; gap: 4px 8px; }
  .oppanel .tip { display: none; }
  .oppanel button { width: 34px; height: 34px; font-size: 15px; }
  .oppanel .grow { flex-basis: 100%; }
}
.plan-svg .hd { stroke: var(--accent); stroke-width: 24; stroke-linecap: round; vector-effect: non-scaling-stroke; cursor: grab; }
.plan-svg .hd:hover { stroke: var(--ink); }
@media (max-width: 600px) { .plan-svg .hd { stroke-width: 18; } }
.edsize { justify-content: flex-start; gap: 14px; }
.edsize .step { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }   /* room-size steppers only - .step is also the Custom design question card */
.edsize .step small { font-size: 12px; color: var(--ink2); margin-right: 2px; }
.edsize .step b, .ectl b { min-width: 34px; text-align: center; font-weight: 600; font-size: 14px; }
.edsize .step button, .ectl button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 18px; cursor: pointer; }
#edAdd { margin-top: 4px; }
.swaprow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; }
.swaprow select { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 6px; background: #fff; font-size: 15px; }
.swaprow button { grid-column: 1 / -1; padding: 10px; }
/* roofs: pick one, change type / pitch, move / stretch */
.roofsel { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: #fff; font: inherit; font-size: 14px; }
.roofpanel { display: grid; gap: 8px; margin-top: 8px; font-size: 14px; }
.roofpanel:empty { display: none; }
.roofpanel .rtypes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.roofpanel button { min-height: 36px; min-width: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf7; cursor: pointer; font: inherit; font-size: 14px; padding: 4px 8px; }
.roofpanel button.on { background: var(--ink, #1f1f1f); color: #fff; border-color: transparent; }
.roofpanel button:disabled { opacity: .4; cursor: default; }
.roofpanel .rrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.roofpanel .rrow > span { flex: 1 1 120px; color: var(--ink2); }
.roofpanel .rrow em { font-style: normal; font-weight: 600; min-width: 42px; text-align: center; }
.roofpanel .rgrow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.roofpanel .rgrow span { display: flex; align-items: center; gap: 4px; justify-content: space-between; color: var(--ink2); }
.edlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.edlist li { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fbfaf7; }
.edlist li.none { border-style: dashed; color: var(--ink2); background: none; }
.edlist li.bad { border-color: var(--err); }
.edlist li.bad em { color: var(--err); font-style: normal; }
.edlist .eh { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.edlist .x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 8px; background: #efebe4; cursor: pointer; font-size: 14px; }
.ectl { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; color: var(--ink2); }
.ectl span { display: inline-flex; align-items: center; gap: 4px; }
.ectl b { color: var(--ink); }
.edbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.edbtns button { padding: 10px; }
