
:root{
  --blue:#0b4ea2; --blue2:#123b6f; --ink:#17212b; --muted:#697586; --line:#dfe4ea;
  --panel:#fff; --bg:#eef2f6; --danger:#b42318;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink);overflow:hidden}
button,select,input{font:inherit}
button{cursor:pointer}
.topbar{height:72px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:10px 16px;box-shadow:0 2px 8px rgba(16,24,40,.04);z-index:4;position:relative}
.brand{display:flex;align-items:center;gap:10px}.brand-mark{width:38px;height:38px;border-radius:10px;background:linear-gradient(145deg,var(--blue),var(--blue2));color:#fff;display:grid;place-items:center;font-weight:900;letter-spacing:-1px}
.brand-kicker{font-size:9px;letter-spacing:.18em;color:var(--blue);font-weight:900}.brand-title{font-size:20px;font-weight:850}.brand-title span{font-size:11px;background:#eaf2ff;color:var(--blue);padding:3px 5px;border-radius:5px;vertical-align:middle}
.top-actions{display:flex;gap:8px}.btn,.stage-toolbar button,.stage-footer button{border:1px solid #ced5de;background:#fff;border-radius:9px;padding:9px 11px;font-weight:700;color:#344054}.btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}.btn.secondary:hover,.stage-toolbar button:hover,.stage-footer button:hover{background:#f7f9fc}
.workspace{height:calc(100vh - 72px);display:grid;grid-template-columns:300px 1fr}
.left-panel{background:#fff;border-right:1px solid var(--line);overflow:auto;-webkit-overflow-scrolling:touch}
.panel-tabs{position:sticky;top:0;background:#fff;display:grid;grid-template-columns:1fr 1fr 1fr;border-bottom:1px solid var(--line);z-index:2}
.tab{border:0;background:#fff;padding:13px 4px;font-size:12px;font-weight:800;color:#667085;border-bottom:3px solid transparent}.tab.active{color:var(--blue);border-bottom-color:var(--blue)}
.tab-page{display:none;padding:14px}.tab-page.active{display:block}
.section-title{text-transform:uppercase;letter-spacing:.08em;font-weight:900;font-size:10px;color:#667085;margin:15px 0 8px}.section-title:first-child{margin-top:0}
.upload-card{border:1.5px dashed #90add1;background:#f7faff;border-radius:12px;padding:14px;display:flex;gap:10px;align-items:center;color:var(--blue)}.upload-card input{display:none}.upload-icon{font-size:28px}.upload-card strong{display:block;font-size:13px}.upload-card span{display:block;font-size:10px;color:#77869a;margin-top:2px}
.product-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.product-card{height:90px;border:1px solid #d6dce4;border-radius:10px;background:#fbfcfd;display:flex;flex-direction:column;gap:7px;align-items:center;justify-content:center}.product-card:hover{border-color:#88aee0;background:#f5f9ff}.product-card b{font-size:11px}
.mini-window,.mini-door{display:block;width:49px;height:40px;border:4px solid #d9dde1;background:#a9c4cf;position:relative}.mini-window.casement:after,.mini-window.flush:after,.mini-window.slider:after,.mini-door.french:after{content:"";position:absolute;top:0;bottom:0;left:50%;border-left:3px solid #d9dde1}.mini-window.sash:after{content:"";position:absolute;left:0;right:0;top:50%;border-top:3px solid #d9dde1}.mini-door{height:53px;width:35px;background:#315243}.mini-door.french{width:50px;background:#aec9d3}
.control-row,.toggle-row{display:flex;align-items:center;justify-content:space-between;margin:8px 0;font-size:12px}.stepper{display:flex;align-items:center;border:1px solid #d0d5dd;border-radius:8px;overflow:hidden}.stepper button{border:0;background:#f7f8fa;width:30px;height:30px}.stepper span{width:30px;text-align:center;font-weight:800}
.choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.choice{border:1px solid #d0d5dd;background:#fff;border-radius:8px;padding:9px 6px;font-size:11px}.choice.active{border-color:var(--blue);background:#edf5ff;color:var(--blue)}
select{width:100%;border:1px solid #d0d5dd;background:#fff;border-radius:8px;padding:9px;color:#344054}
.swatches{display:flex;gap:9px;flex-wrap:wrap}.swatch,.door-swatch{width:34px;height:34px;border-radius:50%;background:var(--c);border:3px solid #fff;box-shadow:0 0 0 1px #c6ccd4}.swatch.active,.door-swatch.active{box-shadow:0 0 0 3px var(--blue)}
.stage-column{min-width:0;display:flex;flex-direction:column;padding:12px 14px 14px}
.stage-toolbar,.stage-footer{min-height:46px;display:flex;align-items:center;gap:8px}.tool-group{display:flex;gap:7px}.stage-toolbar button{font-size:11px;padding:8px 9px}.stage-toolbar .danger{color:var(--danger)}#status{margin-left:auto;font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:42%}
.stage{position:relative;flex:1;min-height:300px;background:#cfd6dd;border-radius:14px;overflow:hidden;box-shadow:0 10px 32px rgba(16,24,40,.13);display:grid;place-items:center}
canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none}
.empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;color:#5f6978;max-width:430px;padding:25px;pointer-events:none}.empty-house{font-size:64px;color:#8d98a6}.empty-state strong{font-size:16px}.empty-state span{font-size:12px;line-height:1.45}
.customer-badge{display:none;position:absolute;right:15px;top:15px;padding:7px 9px;border-radius:8px;background:rgba(9,28,51,.78);color:#fff;font-size:9px;font-weight:900;letter-spacing:.15em;pointer-events:none}
.stage-footer{justify-content:space-between}.hint{font-size:10px;color:#6d7887}.footer-actions{display:flex;gap:7px}.stage-footer button{font-size:11px;padding:8px 10px}.ai-btn{background:#fff8e8!important;border-color:#ecc56f!important;color:#74520d!important}
.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,15px);background:#101828;color:#fff;padding:10px 14px;border-radius:10px;opacity:0;transition:.18s;z-index:20;font-size:12px;pointer-events:none}.toast.show{opacity:1;transform:translate(-50%,0)}
body.customer-mode .left-panel,body.customer-mode .stage-toolbar,body.customer-mode .stage-footer{display:none}
body.customer-mode .workspace{grid-template-columns:1fr;height:calc(100vh - 72px)}
body.customer-mode .stage-column{padding:0}.customer-mode .stage{border-radius:0;box-shadow:none}.customer-mode .customer-badge{display:block}
@media(max-width:900px){
  .workspace{grid-template-columns:270px 1fr}.left-panel{font-size:12px}.product-card{height:78px}
  .hint{display:none}
}
@media(max-width:720px){
  html,body{overflow:auto}.topbar{height:64px;padding:8px 10px}.brand-title{font-size:16px}.brand-kicker{display:none}.brand-mark{width:34px;height:34px}.top-actions .secondary{display:none}
  .workspace{height:auto;display:block}.left-panel{height:285px;border-right:0;border-bottom:1px solid var(--line)}.panel-tabs{top:0}.tab-page{padding:10px}.product-grid{grid-template-columns:repeat(4,1fr)}.product-card{height:72px}.product-card b{font-size:9px}.mini-window,.mini-door{transform:scale(.78)}
  .stage-column{height:calc(100vh - 349px);min-height:470px;padding:8px}.stage-toolbar{overflow-x:auto}.stage-toolbar #status{display:none}.stage-footer{overflow-x:auto}
}
