/* A working studio: white tool surfaces, a generous painted elevation, green wayfinding. */
:root {
  --bg:#f7f8f7; --surface:#fff; --surface-2:#f6f7f6; --surface-3:#edf0ed;
  --ink:#243a33; --ink-soft:#40544c; --muted:#6d7972; --faint:#77847c;
  --hair:#e9ece8; --line:#dce2dc; --accent:#32664c; --accent-dk:#244d38; --accent-soft:#eaf2ec;
  --r:12px; --r-sm:7px; --shadow:none; --shadow-sm:none;
  --font:'DM Sans',system-ui,sans-serif; --mono:'DM Sans',system-ui,sans-serif;
  color-scheme:light;
}
[hidden] { display:none !important; }
body { font-weight:450; }
button,input,select { font-weight:500; }
header { position:relative; background:var(--surface); backdrop-filter:none; }
.bar { max-width:1600px; height:76px; padding-block:0; gap:24px; }
.gutter { padding-left:32px; padding-right:32px; }
.brand { gap:10px; }
.brand b { font-size:23px; font-weight:700; letter-spacing:-1px; }
.brand .brand-light { display:inline; font:inherit; font-weight:400; letter-spacing:inherit; text-transform:none; color:var(--ink); }
.brand .mark { width:34px; height:36px; border-radius:7px; background:var(--accent); margin:0; }
.brand .mark svg { width:25px; height:25px; }
.save-state { color:var(--muted); font-size:12px; }
.save-state::before,.live-dot { content:''; display:inline-block; width:6px; height:6px; background:#779c7d; border-radius:50%; margin-right:7px; vertical-align:middle; }
.tools { gap:10px; }
.icon-btn { height:36px; width:auto; padding:0 12px; display:flex; gap:8px; background:var(--surface); font-size:12px; border-color:var(--line); border-radius:6px; }
#printBtn { background:var(--accent); color:white; border-color:var(--accent); }
#themeBtn { width:36px; padding:8px; }
.workspace-intro { max-width:1600px; margin:0 auto; padding-top:31px; padding-bottom:25px; display:flex; align-items:center; justify-content:space-between; gap:24px; }
h1 { font-size:28px; font-weight:550; letter-spacing:-1px; }
.workspace-intro p { margin:6px 0 0; color:var(--muted); font-size:13px; }
.workspace-nav { display:flex; background:var(--surface-3); padding:4px; border-radius:8px; flex:none; }
.workspace-nav button { padding:10px 18px; border:0; background:transparent; color:var(--muted); border-radius:5px; font-size:12px; }
.workspace-nav button[aria-pressed=true] { background:var(--surface); color:var(--ink); box-shadow:0 1px 4px #203a3310; }
.tabs { max-width:1536px; margin:0 32px; background:transparent; }
.tabs-in { padding:0; gap:20px; overflow:auto; }
.wtab { border:0; border-bottom:2px solid transparent; background:none; border-radius:0; padding:12px 2px; font-weight:500; font-size:13px; }
.wtab[aria-selected=true] { border-color:var(--accent); background:none; color:var(--accent); }
.wtab::before { content:'▤'; font-size:17px; }
.add-wall { border:0; padding:10px 0; font-size:12px; font-weight:450; }
main { grid-template-columns:300px minmax(0,1fr); gap:24px; padding-top:24px; padding-bottom:28px; }
.rail { position:sticky; top:18px; padding:0; gap:0; background:var(--surface); border:1px solid var(--line); border-radius:10px; max-height:calc(100vh - 36px); scrollbar-width:thin; }
.rail-heading { padding:20px 20px 0; }
.rail-heading h2 { font-size:16px; font-weight:600; letter-spacing:-.3px; }
.rail-heading p { margin:5px 0 16px; font-size:11px; color:var(--muted); }
.rail > .card { border:0; border-radius:0; background:none; }
.control-nav { display:flex; padding:0 12px; border-bottom:1px solid var(--hair); }
.control-nav button { flex:1; white-space:nowrap; background:none; border:0; border-bottom:2px solid transparent; padding:12px 3px; color:var(--muted); font-size:11px; }
.control-nav button[aria-pressed=true] { color:var(--accent); border-color:var(--accent); font-weight:650; }
.group { padding:20px; }
.group h2 { font-size:13px; font-weight:650; text-transform:none; letter-spacing:0; color:var(--ink); margin-bottom:16px; }
.group-description { font-size:12px; color:var(--muted); margin:-6px 0 18px; line-height:1.6; }
#unitSeg { margin-bottom:18px; display:flex; }
#unitSeg button { flex:1; padding:8px; font-size:11px; }
.field > label { font-size:12px; font-weight:500; }
input[type=number],input[type=text],select { font-size:13px; padding:10px 11px; font-weight:450; background:var(--surface); }
.in-wrap input { padding-right:34px; }
.in-wrap .unit { font-size:11px; }
.stepper { background:var(--surface); }
.stepper button { width:34px; height:35px; color:var(--muted); }
.stepper input { padding:8px 0; }
.styles { grid-template-columns:1fr 1fr; gap:10px; }
.styles button { background:var(--surface); padding:14px 9px 10px; gap:10px; font-size:11px; font-weight:500; }
.styles .mini { height:43px; }
.styles .mini rect,.styles .mini line,.styles .mini path { stroke-width:1.2; }
.styles button[aria-pressed=true] { box-shadow:0 0 0 1px var(--accent); }
#paintName { color:var(--muted); font-weight:450; font-size:11px; }
.paints { gap:12px; padding:4px; }
.paints button { width:30px; height:30px; }
.check { font-size:12px; font-weight:450; }
.mini-btn { font-weight:500; font-size:11px; background:var(--surface); }
.results { gap:0; }
.stage-card { border:1px solid var(--line); border-radius:10px 10px 0 0; }
.stage-head { background:var(--surface); padding:12px 16px; gap:12px; }
.view-seg { border:0; background:var(--surface-2); border-radius:6px; }
.view-seg button { font-size:12px; font-weight:500; padding:8px 12px; }
.view-seg button[aria-pressed=true] { color:var(--accent); background:var(--accent-soft); }
.stage-head .sub { margin-left:auto; font-size:11px; }
.dimensions-check { font-size:11px; gap:4px; color:var(--muted); }
.dimensions-check input { width:14px; height:14px; }
.drag-hint { display:none; }
.stage { height:clamp(340px,47vh,620px); padding:28px 36px; }
.canvas-caption { padding:12px 18px; display:flex; justify-content:space-between; background:var(--surface); font-size:10px; color:var(--muted); }
.tiles { gap:0; border:1px solid var(--line); border-top:0; border-radius:0 0 10px 10px; background:var(--surface); padding:19px 0; }
.tile { padding:0 20px; border:0; border-right:1px solid var(--hair); border-radius:0; background:transparent; }
.tile:last-child { border:0; }
.tile .k { font-size:11px; text-transform:none; letter-spacing:0; font-weight:450; color:var(--muted); }
.tile .v { font-size:21px; font-weight:550; letter-spacing:-.6px; margin-top:7px; white-space:nowrap; }
.tile .v small { font-size:11px; font-weight:450; }
.tile.accent { background:none; }
.tile.accent .k { color:var(--muted); }
.tile.accent .v { color:var(--accent); }
.studio-note { display:flex; gap:12px; align-items:center; padding:22px 4px; }
.note-icon { font-size:24px; color:var(--accent); width:32px; text-align:center; flex:none; }
.studio-note b { font-size:12px; font-weight:550; }
.studio-note p { font-size:11px; color:var(--muted); margin:4px 0 0; max-width:450px; line-height:1.6; }
.studio-note button { margin-left:auto; flex:none; background:none; color:var(--accent); border:0; font-size:12px; text-decoration:underline; text-underline-offset:4px; }
.material-block { display:none; margin-bottom:18px; }
.materials-mode .material-block { display:block; }
.materials-mode .stage-card,.materials-mode .studio-note { display:none; }
.materials-mode .tiles { border-top:1px solid var(--line); border-radius:10px; margin-bottom:20px; }
.block-head h2 { font-size:16px; font-weight:550; }
th { text-transform:none; letter-spacing:0; font-size:12px; font-weight:500; }
.foot { max-width:1600px; margin:auto; padding-bottom:22px; }
.foot p { max-width:920px; margin:auto; color:var(--muted); font-size:11px; text-align:center; line-height:1.8; }
@media (min-width:1600px) { .tabs { margin-inline:auto; } }
@media (max-width:1100px) { .gutter { padding-inline:22px; } .tabs { margin-inline:22px; } main { grid-template-columns:280px minmax(0,1fr); gap:18px; } .stage-head .sub { display:none; } .tile { padding-inline:12px; } .tile .v { font-size:17px; } h1 { font-size:24px; } .workspace-nav button { padding-inline:12px; } }
@media (max-width:800px) {
  .bar { height:64px; gap:12px; } .save-state { display:none; } .brand b { font-size:21px; } .tools { gap:6px; } .icon-btn span { display:none; }
  .workspace-intro { padding-top:22px; padding-bottom:18px; align-items:flex-start; flex-direction:column; gap:18px; }
  .workspace-nav { width:100%; } .workspace-nav button { flex:1; }
  main { display:flex; flex-direction:column; gap:20px; padding-top:18px; } .results { width:100%; order:0; } .rail { order:1; width:100%; position:static; max-height:none; }
  .stage { height:320px; padding:18px; } .stage-head { padding:10px; gap:6px; justify-content:space-between; } .view-seg button { padding:8px; font-size:11px; }
  .tiles { grid-template-columns:repeat(2,1fr); row-gap:18px; } .tile:nth-child(2) { border:0; } .tile { padding-left:18px; } .tile .v { font-size:20px; }
  .studio-note { padding:16px 0 0; } .studio-note p { display:none; } .studio-note b { font-size:11px; } .studio-note button { font-size:11px; }
  .styles { grid-template-columns:repeat(3,1fr); } .group { padding:20px; } .foot { margin-top:4px; } .foot p { text-align:left; }
}
@media (max-width:420px) { .gutter { padding-inline:14px; } .tabs { margin-inline:14px; } h1 { font-size:23px; } .workspace-intro p { font-size:12px; } .dimensions-check { font-size:10px; } .stage { height:260px; } .brand .mark { width:29px; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none !important; scroll-behavior:auto !important; } }
@media print { .workspace-intro,.studio-note { display:none !important; } }
:root { --canvas:#eeefeb; }
:root[data-theme=dark] { --canvas:#28332e; }
@media (prefers-color-scheme:dark) { :root:not([data-theme=light]) { --canvas:#28332e; } }
.two,.inline-two { align-items:start; }
.handle .grip-pill { fill:var(--accent); }
/* Canvas-first planning workspace. */
.workspace-intro { display:none; }
.tabs { display:flex; align-items:center; gap:16px; }
.tabs-in { flex:1; }
.tabs .workspace-nav { background:transparent; padding:0; }
.tabs .workspace-nav button { padding:8px 12px; }
.tabs .workspace-nav button[aria-pressed=true] { background:var(--accent-soft); box-shadow:none; color:var(--accent); }
main { grid-template-columns:minmax(0,1fr) 310px; gap:20px; padding-top:18px; }
.results { grid-column:1; grid-row:1; }
.rail { grid-column:2; grid-row:1; max-height:calc(100dvh - 160px); top:18px; }
.stage { height:calc(100dvh - 320px); min-height:460px; padding:12px 24px 26px; overflow:hidden; background:#e8e3da !important; }
.stage svg { transform-origin:center; }
.stage-card { overflow:hidden; }
.stage-head { padding:9px 12px; }
.stage-head .sub { display:none; }
.canvas-toolbar { display:flex; align-items:center; gap:6px; padding:10px 12px; border-bottom:1px solid var(--hair); flex-wrap:wrap; background:var(--surface); }
.canvas-toolbar .btn { font-size:11px; padding:7px 10px; background:var(--surface); font-weight:500; }
.toolbar-spacer { flex:1; }
button:disabled { opacity:.35; cursor:not-allowed; }
.canvas-toolbar button[aria-pressed=true] { background:var(--accent-soft); border-color:var(--accent); }
.view-seg button { padding:7px 11px; }
.view-seg { margin-right:auto; }
.tiles { padding:12px 0; }
.tile .v { font-size:18px; margin-top:3px; }
.studio-note,.foot { display:none; }
.canvas-caption { padding:8px 12px; }
.zoom-controls { position:absolute; bottom:10px; right:14px; display:flex; gap:3px; align-items:center; padding:3px; background:#fffef9; color:#625b50; border:1px solid #d5cfc4; border-radius:6px; font-size:11px; box-shadow:0 2px 8px #00000008; }
.zoom-controls button { border:0; background:transparent; padding:5px 9px; font-size:12px; color:inherit; }
.camera-controls { display:flex; gap:18px; padding:10px 16px; background:var(--surface); }
.camera-controls label { font-size:11px; display:flex; align-items:center; gap:8px; }
.camera-controls input { width:120px; accent-color:var(--accent); }
.advanced-section { margin-top:18px; padding-top:15px; border-top:1px solid var(--hair); }
.advanced-section h3 { font-size:12px; margin-bottom:10px; font-weight:600; }
.advanced-section .hint { font-weight:400; line-height:1.5; margin:8px 0 12px; font-size:11px; }
.advanced-section summary,.row-config summary,.obstacle-config summary { font-size:12px; padding:10px 0; cursor:pointer; }
.row-config summary span,.obstacle-config summary span { color:var(--muted); margin-left:7px; font-size:10px; }
.row-config,.obstacle-config { border-bottom:1px solid var(--hair); padding-bottom:5px; }
.row-config .two { gap:8px; }
.row-config input,.obstacle-config input { padding:7px; }
#addRowBtn { margin-top:12px; width:100%; }
#dadoOptions { margin-top:12px; }
.obstacle-buttons { display:grid; grid-template-columns:repeat(2,1fr); gap:7px; }
.obstacle { cursor:move; }
.handle .grip-pill { fill:#fffdf7; stroke:#b4ab98; stroke-width:.7; vector-effect:non-scaling-stroke; cursor:col-resize; transition:fill .12s; }
.handle.row .grip-pill { cursor:row-resize; }
.handle .grip-dot { fill:#9d9484; pointer-events:none; }
.handle:hover .grip-pill { fill:#fff; stroke:#d5a76a; }
.handle:hover .grip-dot { fill:#c2873b; }
#templateDialog { width:min(960px,94vw); max-height:90dvh; padding:24px; border:1px solid var(--line); border-radius:14px; background:var(--surface); color:var(--ink); box-shadow:0 20px 100px #0003; }
#templateDialog::backdrop { background:#171c1870; backdrop-filter:blur(3px); }
.dialog-head { display:flex; justify-content:space-between; gap:20px; align-items:start; }
.dialog-head h2 { font-size:24px; font-weight:550; letter-spacing:-.6px; }
.dialog-head p { font-size:13px; color:var(--muted); margin:6px 0 20px; }
.template-categories { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:20px; }
.template-categories button { font-size:12px; font-weight:500; }
.template-categories button[aria-pressed=true] { background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }
#templateGrid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.template-option { border:1px solid var(--line); padding:10px; border-radius:8px; background:var(--surface); color:var(--ink); text-align:left; }
.template-option:hover { border-color:var(--accent); background:var(--accent-soft); }
.template-option svg { width:100%; height:130px; background:#e8e3da; border-radius:4px; }
.template-option b { display:block; font-size:12px; font-weight:500; margin-top:9px; }
@media(max-width:1000px) { main { grid-template-columns:minmax(0,1fr) 280px; gap:14px; } .canvas-toolbar .btn { padding:7px; } .stage-head { flex-wrap:wrap; } .view-seg button { padding-inline:7px; } }
@media(max-width:800px) { main { display:flex; } .results { order:0; } .rail { order:1; max-height:none; } .stage { height:440px; min-height:0; padding:8px 10px 30px; } .tabs { flex-wrap:wrap; gap:3px; } .tabs .workspace-nav { width:auto; margin-left:auto; } .tabs-in { min-width:120px; } .canvas-toolbar { padding:8px; gap:4px; } .canvas-toolbar .btn { font-size:10px; } .toolbar-spacer { display:none; } .view-seg button { font-size:11px; } #templateGrid { grid-template-columns:repeat(2,1fr); } .tiles { grid-template-columns:repeat(4,1fr); row-gap:0; } .tile { padding-inline:9px; } .tile .k { font-size:9px; } .tile .v { font-size:15px; } .tile .v small { font-size:9px; } .tile:nth-child(2) { border-right:1px solid var(--hair); } .camera-controls { flex-wrap:wrap; } }
@media(max-width:420px) { .stage { height:370px; } .view-seg button { padding-inline:6px; } .view-seg button svg { display:none; } .dimensions-check { font-size:10px; } .tile .v { font-size:12px; } }
@media print { .canvas-toolbar,.camera-controls,.zoom-controls,dialog { display:none !important; } }
.photo-alignment { display:flex; flex-wrap:wrap; gap:8px; padding:12px; background:var(--surface); align-items:center; }
.photo-alignment span { font-size:11px; color:var(--muted); }
#photoCorners { position:absolute; inset:0; pointer-events:none; }
.photo-corner { position:absolute; pointer-events:auto; transform:translate(-50%,-50%); width:28px; height:28px; border-radius:50%; background:#fff; color:#32664c; border:2px solid #32664c; box-shadow:0 2px 6px #0004; cursor:move; font-size:12px; touch-action:none; }
.photo { touch-action:none; }
.bar { height:58px; }
.stage { height:calc(100dvh - 266px); min-height:380px; }
.canvas-toolbar { padding-block:8px; }
.rail { max-height:calc(100dvh - 125px); }
@media(max-width:800px) { .rail { max-height:none; } .stage { height:440px; min-height:0; } }
@media(max-width:420px) { .stage { height:370px; } }
.gap-dialog { border:1px solid var(--line); border-radius:12px; padding:24px; color:var(--ink); background:var(--surface); }
.gap-dialog h2 { font-size:20px; }
.gap-dialog p { font-size:12px; color:var(--muted); }
.gap-dialog::backdrop { background:#0005; }
/* Architectural drawing desk. Quiet chrome, painted plaster, charcoal inspector. */
:root { --bg:#e7e0d5; --surface:#fcfaf6; --surface-2:#f1ece4; --surface-3:#e7dfd3; --ink:#373a32; --muted:#79796d; --line:#d9d1c5; --hair:#e5ded4; --accent:#617353; --accent-soft:#e3e9dc; }
header { background:#f7f3ed; border-bottom:1px solid #d8d0c4; }
.bar { height:48px; max-width:none; padding-inline:20px; }
.brand b { font-size:20px; }
.brand .mark { height:28px; width:28px; }
.tabs { max-width:none; margin:0; padding:0 20px; min-height:48px; border-bottom:0; }
.tabs-in { gap:14px; margin:0; }
.wtab { padding:7px 12px; border:0; border-radius:7px; color:#7a746a; }
.wtab::before { display:none; }
.wtab[aria-selected=true] { background:#fffaf1; color:#393c33; box-shadow:0 1px 3px #493e3822; }
main.gutter { max-width:none; padding:0 0 0 14px; grid-template-columns:minmax(0,1fr) 340px; gap:14px; }
.stage-card { border:0; border-radius:0; background:transparent; box-shadow:none; }
.canvas-toolbar { padding:0 4px 10px; background:transparent; border:0; }
.canvas-toolbar .btn { background:#faf6ee; border-color:#d7cec0; border-radius:6px; font-size:12px; box-shadow:0 1px 2px #40372b0b; }
.canvas-toolbar .btn#exportBtn { background:#617353; color:white; border-color:#617353; }
.stage-head { background:transparent; border:0; padding:0 4px 9px; }
.stage { height:calc(100dvh - 230px); min-height:400px; background:#e7e0d5 !important; padding:4px 22px 14px; }
.stage svg { overflow:visible; }
.canvas-caption { border:0; color:#80796d; font-size:11px; padding:4px 24px; }
.view-seg { background:#f8f4ec; box-shadow:0 1px 3px #4d402719; }
.tiles { padding:12px 0; margin-top:0; border-top:1px solid #d6cec0; }
.tile .k { color:#817b70; }
.tile .v { color:#3c4136; }
.rail { --surface:#242620; --surface-2:#2c2e27; --surface-3:#35382f; --ink:#f1eee5; --ink-soft:#dad8ce; --muted:#b0b0a0; --faint:#a19e90; --line:#494b40; --hair:#3b3e34; --accent:#b9c8a2; --accent-soft:#394332; background:var(--surface); border:0; border-radius:0; top:0; max-height:calc(100dvh - 96px); padding-bottom:24px; color:var(--ink); scrollbar-color:#595d4e transparent; color-scheme:dark; }
.rail-heading { padding:22px 22px 18px; }
.studio-brand { display:flex; align-items:center; gap:10px; font-size:24px; color:#bbcca5; }
.studio-brand span { font-size:20px; color:#f1eee5; font-weight:600; letter-spacing:-.5px; }
.rail-heading p { font-size:11px; color:#a4a795; margin-top:7px; }
.rail .card { background:transparent; border:0; }
.rail .group { padding:18px 22px; }
.rail .control-nav { background:#242620; border-color:#3b3e34; }
.rail .control-nav button { color:#b5b5a7; font-size:11px; }
.rail .control-nav button[aria-pressed=true] { color:#e4edda; border-color:#aabb94; }
.rail input,.rail select,.rail .stepper { background:#2d3028; color:#f2eee5; border-color:#484b3e; border-radius:6px; }
.rail input:focus,.rail select:focus { border-color:#b9c8a2; box-shadow:0 0 0 2px #b9c8a222; }
.rail h2 { font-size:12px; font-weight:600; color:#cbcebf; }
.rail .hint,.rail label { color:#b6b8a8; }
.row-config { margin:6px 0; padding:2px 10px; background:#2c2e27; border:1px solid #42463a; border-radius:7px; }
.row-config[open] { border-color:#899a71; }
.row-config summary { font-weight:550; }
.full-rails { margin-top:18px; }
.panel-hit { cursor:pointer; stroke:transparent; stroke-width:2; vector-effect:non-scaling-stroke; outline:none; }
.panel-hit:hover { fill:#ffffff0c; stroke:#faf4dc88; }
.panel-hit.selected,.panel-hit:focus-visible { stroke:#b8d093; fill:#ffffff09; }
#panelInspector { position:absolute; z-index:9; width:264px; padding:15px; border-radius:10px; color:#f1eee5; background:#262921; border:1px solid #515746; box-shadow:0 12px 35px #1a1e2038; }
.panel-inspector-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.panel-inspector-head strong { font-size:12px; font-weight:550; }
.panel-inspector-head button { border:0; padding:0 3px; font-size:21px; color:#cccdbd; background:transparent; }
#panelInspector p { margin:5px 0 12px; font-size:10px; color:#a7ad9a; line-height:1.5; }
#panelInspector .two { gap:8px; }
#panelInspector label { font-size:11px; color:#b8bea9; }
#panelInspector input[type=number] { display:block; margin-top:5px; width:100%; background:#33382b; color:#f9f6eb; font-size:17px; border:1px solid #525a43; border-radius:6px; padding:8px; }
#panelInspector input:focus { border-color:#c7dbab; outline:2px solid #c7dbab33; }
.panel-unit { float:right; color:#8e987f; }
.panel-lock { display:flex; gap:7px; align-items:center; margin:12px 0; }
.panel-lock input { accent-color:#a2b985; }
.panel-actions { display:flex; justify-content:space-between; gap:8px; border-top:1px solid #464c3b; padding-top:10px; }
.panel-actions button { background:transparent; border:0; padding:3px 0; color:#c0ceab; font-size:11px; }
.panel-actions #panelRemove { color:#f1a89b; }
#panelFeedback:empty { display:none; }
#panelFeedback { color:#f3c29c !important; }
@media(max-width:1000px) and (min-width:801px) { main.gutter { grid-template-columns:minmax(0,1fr) 300px; } .rail .group { padding-inline:16px; } .stage { padding-inline:8px; } }
@media(max-width:800px) { main.gutter { padding:0 12px 20px; } .bar { padding-inline:12px; } .tabs { padding-inline:12px; } .rail { max-height:none; border-radius:12px; padding-bottom:12px; } .stage { height:460px; min-height:0; padding:8px 0 24px; } .canvas-toolbar { flex-wrap:wrap; } .canvas-caption { padding:8px 0; font-size:9px; } .tiles { margin-bottom:12px; } #panelInspector { position:fixed; top:auto !important; bottom:16px; left:16px !important; width:calc(100vw - 32px); max-width:380px; } }
@media(max-width:420px) { .stage { height:390px; } .canvas-toolbar .btn { font-size:10px; } .bar .save-state { display:none; } }
@media print { #panelInspector { display:none !important; } }
.stage { grid-template-rows:minmax(0,1fr); grid-template-columns:minmax(0,1fr); }
.stage > svg { min-height:0; min-width:0; height:100%; width:100%; }
header { display:none; }
.stage { height:calc(100dvh - 160px); min-height:400px; }
.rail { max-height:calc(100dvh - 48px); }
body:not(.materials-mode) .tiles { display:none; }
.canvas-toolbar .icon-btn { height:31px; font-size:11px; }
.canvas-caption { background:transparent; }
@media(max-width:800px) { .stage { height:460px; min-height:0; } .rail { max-height:none; } .canvas-toolbar .icon-btn { padding-inline:8px; } }
@media(max-width:420px) { .stage { height:390px; } }
.wall-dimension { cursor:pointer; outline:none; }
.wall-dimension:hover,.wall-dimension:focus-visible { fill:#315230; text-decoration:underline; }
.rail .styles button[aria-pressed=true] { color:#eff5e5; background:#394332; }
.gap-hit { cursor:col-resize; outline:none; }
.gap-hit:hover,.gap-hit:focus-visible { fill:#fcf5df24; stroke:#e8e8c866; stroke-dasharray:8 8; stroke-width:1; vector-effect:non-scaling-stroke; }
.row-config > summary { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.row-config .row-count { display:flex; align-items:center; gap:12px; margin:0; color:#eceee2; background:#23271e; border-radius:5px; }
.row-count b { font-size:12px; font-weight:500; }
.row-count button { background:transparent; border:0; color:#bac4ab; padding:5px 8px; font-size:15px; }
body[data-layout-kind=cells] #layoutGroup > .inline-two { display:none; }
#layoutGroup > .advanced-section:first-child { border:0; padding-top:0; margin-top:0; margin-bottom:20px; }
.rail .field:has(> #wname) { display:none; }
.rail-heading { padding-block:16px; }
/* Precision controls extend the existing plaster / sage / charcoal palette. */
.canvas-toolbar .btn[aria-pressed=true] { background:var(--accent); color:white; border-color:var(--accent); }
.snap-options { position:relative; align-self:center; font-size:12px; z-index:12; }
.snap-options summary { padding:8px; cursor:pointer; }
.snap-options[open] { background:var(--surface); padding:8px; border:1px solid var(--line); border-radius:8px; }
.snap-options label { display:block; max-width:155px; margin:6px 0; }
.snap-options input { width:100%; margin-top:4px; }
.resize-feedback { position:absolute; left:50%; bottom:52px; transform:translateX(-50%); max-width:90%; padding:10px 16px; border-radius:8px; background:#30382e; color:#fff; font:12px var(--font); box-shadow:0 3px 14px #0002; pointer-events:none; z-index:15; }
.active-snap-guide { stroke:#4175d0; stroke-width:1.5; stroke-dasharray:5 4; vector-effect:non-scaling-stroke; pointer-events:none; }
.handle.active .grip-pill,.handle:focus-visible .grip-pill { fill:#617353; stroke:#fff; stroke-width:2; vector-effect:non-scaling-stroke; }
.handle.active .grip-dot,.handle:focus-visible .grip-dot { fill:#fff; }
.handle:focus-visible { outline:none; }
.stage > svg { touch-action:none; user-select:none; }
.stage > svg.pan-mode,.stage > svg.pan-mode * { cursor:grab !important; }
.selected-dimensions text { fill:#fff; paint-order:stroke; stroke:#30382e; stroke-width:4px; stroke-linejoin:round; cursor:text; font-family:var(--font); }
#panelFeedback:not(:empty) { color:#f4c68a; }
@media(max-width:1100px) { .canvas-toolbar { flex-wrap:wrap; } }

/* Workflow refinement: more elevation, less chrome. */
.bar {height:64px;gap:16px}
#projectName {max-width:220px;min-width:80px;border:1px solid transparent;background:transparent;color:var(--ink);font:600 14px var(--font);padding:8px;border-radius:6px}
#projectName:hover,#projectName:focus {border-color:var(--line)}
.workspace-intro {padding-top:16px;padding-bottom:16px}
.workspace-intro h1 {font-size:21px;letter-spacing:-.4px}
.wall-actions {display:flex;gap:6px;flex-wrap:wrap;margin-block:10px}
.quick-start {padding:14px 18px;background:var(--surface);border:1px solid var(--line);border-radius:8px;font-size:13px}
.quick-start p {line-height:1.8;color:var(--muted)}
#templatePreview svg {width:100%;height:200px}
.template-option small {display:block;font-size:11px;font-weight:400;line-height:1.5;color:var(--muted);margin-top:5px}
.template-footer {position:sticky;bottom:0;background:var(--surface);padding:14px 0;display:flex;gap:16px;align-items:center;border-top:1px solid var(--line)}
#templateMessage {flex:1;font-size:12px}
#templateSearch {width:100%;margin:8px 0 16px}
.planning-block {display:none}
.materials-mode .planning-block {display:block}
.planning-body {padding:20px}
.profile-rate {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 0;border-bottom:1px solid var(--line);font-size:13px}
.profile-rate input {width:100px}
.estimate-totals {display:grid;grid-template-columns:1fr auto;gap:12px;font-size:14px;border-top:1px solid var(--line);padding-top:18px}
.estimate-totals dd {margin:0;text-align:right;font-variant-numeric:tabular-nums}
#planningError {color:var(--warn)}
#cutPlan h3 {margin-top:20px;font-size:13px}
#mobileSettings {display:none}
#settingsSheet {padding:0;border:1px solid var(--line);background:var(--surface);color:var(--ink)}
.sheet-heading {display:flex;justify-content:space-between;padding:12px 18px;position:sticky;top:0;background:var(--surface);z-index:2}
:focus-visible {outline:3px solid var(--accent);outline-offset:3px}
@media(min-width:1500px){.stage:has(#panelInspector:not([hidden])){padding-right:284px}#panelInspector{left:auto!important;right:12px!important;top:12px!important;max-height:calc(100% - 64px);overflow:auto}}
@media(max-width:760px){
 .bar {height:auto;min-height:60px;flex-wrap:wrap;padding-block:10px;gap:8px}
 #projectName {max-width:160px;flex:1}.bar .save-state {order:4;width:100%;font-size:11px}
 .workspace-intro {display:none}main>.rail {display:none}main {display:block!important;padding:12px!important}
 #mobileSettings {display:inline-flex}#settingsSheet {position:fixed;inset:auto 0 0;width:100%;max-width:none;max-height:85dvh;margin:0;border-radius:16px 16px 0 0}
 #settingsSheet .rail {display:block;position:static;max-height:none;border:0;width:100%;overflow:visible}#settingsSheet::backdrop{background:#152b3766}
 #settingsSheet input,#settingsSheet select,#settingsSheet button {min-height:44px}
 .canvas-toolbar {flex-wrap:wrap}.canvas-toolbar .btn {min-height:44px}
 .tabs {margin:0 12px}.tabs-in {gap:14px}.stage {min-height:340px}
 #templateDialog {max-height:90dvh}.template-footer {align-items:stretch;flex-direction:column}
 .planning-body {padding:12px}.profile-rate {align-items:flex-start;font-size:12px}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
@media screen {header {display:block}.bar .save-state{display:block}.stage{height:calc(100dvh - 224px)}}
@media(max-width:760px){.stage{height:390px}.brand{display:none}.bar .tools{margin-left:auto}.bar{min-height:54px}.bar .save-state{order:0;width:auto;max-width:140px}}
.rail .field:has(> #wname) {display:block}
@media(min-width:801px){main.gutter{grid-template-columns:300px minmax(0,1fr);padding:0 14px;gap:18px}.rail{grid-column:1}.results{grid-column:2}}

/* Pro upgrade modal */
#upgradeDialog{border:0;border-radius:16px;padding:0;max-width:420px;width:calc(100% - 32px);box-shadow:0 24px 60px rgba(20,40,32,.28);color:var(--ink,#243a33)}
#upgradeDialog::backdrop{background:rgba(20,36,28,.45)}
#upgradeDialog .upgrade{padding:22px 22px 20px}
#upgradeDialog .upgrade-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
#upgradeDialog .upgrade-head strong{font-size:18px}
#upgradeDialog .icon-x{border:0;background:none;font-size:24px;line-height:1;cursor:pointer;color:var(--muted,#6b7d72);padding:0 4px}
#upgradeDialog .upgrade-reason{color:var(--muted,#6b7d72);font-size:13px;margin:0 0 12px}
#upgradeDialog .upgrade-reason:empty{display:none}
#upgradeDialog .upgrade-list{list-style:none;padding:0;margin:0 0 16px;display:grid;gap:8px}
#upgradeDialog .upgrade-list li{position:relative;padding-left:26px;font-size:14px}
#upgradeDialog .upgrade-list li::before{content:"✓";position:absolute;left:0;top:0;color:var(--accent);font-weight:700}
#upgradeDialog .upgrade-buy{width:100%;justify-content:center;background:var(--accent);color:#fff;border-color:var(--accent);font-weight:650;padding:11px;font-size:15px}
#upgradeDialog .upgrade-code{margin-top:14px;font-size:13px}
#upgradeDialog .upgrade-code summary{cursor:pointer;color:var(--accent);text-underline-offset:3px;text-decoration:underline}
#upgradeDialog .upgrade-code-row{display:flex;gap:8px;margin-top:10px}
#upgradeDialog .upgrade-code-row input{flex:1;min-width:0;padding:8px 10px;border:1px solid var(--line,#dce2dc);border-radius:8px;font:inherit}
#upgradeDialog .upgrade-status{font-size:12px;color:var(--muted,#6b7d72);margin:8px 0 0;min-height:14px}
#upgradeDialog .upgrade-fineprint{font-size:11px;color:var(--muted,#6b7d72);text-align:center;margin:10px 0 0}

/* SEO / about content */
.seo-content{max-width:760px;margin:8px auto 48px;color:var(--ink-soft,#3b4551);line-height:1.6;font-size:15px}
.seo-content h2{font-size:22px;color:var(--ink,#1e2630);margin:28px 0 10px}
.seo-content h3{font-size:16px;color:var(--ink,#1e2630);margin:22px 0 8px}
.seo-content p{margin:0 0 12px}
.seo-content ul,.seo-content ol{margin:0 0 12px;padding-left:22px}
.seo-content li{margin:0 0 6px}
.seo-content .faq{margin:0}
.seo-content .faq dt{font-weight:600;color:var(--ink,#1e2630);margin:16px 0 4px}
.seo-content .faq dd{margin:0 0 8px}

/* ---- Single intended theme ----------------------------------------------
   This app has one deliberate look: the warm two-tone studio above (cream
   chrome, charcoal control rail, painted canvas). It has no dedicated dark
   theme — the inherited dark-mode variables only left light text on the
   hardcoded cream chrome. So we render the studio palette in every theme
   state (OS dark preference or a stored toggle) and hide the dead toggle.
   The control rail keeps its own dark palette (defined on .rail). */
:root[data-theme=dark],
:root[data-theme=light] {
  --bg:#e7e0d5; --surface:#fcfaf6; --surface-2:#f1ece4; --surface-3:#e7dfd3;
  --ink:#373a32; --ink-soft:#3b4551; --muted:#79796d; --faint:#98a1ab;
  --hair:#e5ded4; --line:#d9d1c5; --accent:#617353; --accent-dk:#255650; --accent-soft:#e3e9dc;
  --stage-1:#f0f1f2; --stage-2:#e2e5e8; --good:#2f8f5b; --warn:#bd4a24;
  --shadow-sm:0 1px 2px rgba(20,30,45,.05);
  --shadow:0 1px 2px rgba(20,30,45,.04), 0 8px 22px rgba(20,30,45,.07);
  --shadow-lg:0 24px 60px rgba(20,30,45,.16);
  color-scheme:light;
}
@media (prefers-color-scheme:dark) {
  :root:not([data-theme=light]) {
    --bg:#e7e0d5; --surface:#fcfaf6; --surface-2:#f1ece4; --surface-3:#e7dfd3;
    --ink:#373a32; --ink-soft:#3b4551; --muted:#79796d; --faint:#98a1ab;
    --hair:#e5ded4; --line:#d9d1c5; --accent:#617353; --accent-dk:#255650; --accent-soft:#e3e9dc;
    --stage-1:#f0f1f2; --stage-2:#e2e5e8; --good:#2f8f5b; --warn:#bd4a24;
    --shadow-sm:0 1px 2px rgba(20,30,45,.05);
    --shadow:0 1px 2px rgba(20,30,45,.04), 0 8px 22px rgba(20,30,45,.07);
    --shadow-lg:0 24px 60px rgba(20,30,45,.16);
    color-scheme:light;
  }
}
#themeBtn { display:none; }
