:root{--ink:#20211e;--muted:#6f716b;--paper:#ece9e1;--surface:#fffefa;--line:#d7d2c7;--accent:#9d4035;--sage:#66776d;--warn:#b24639;--blue:#627f82;--shadow:0 12px 34px rgba(47,42,34,.08)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--paper);color:var(--ink);font-family:Arial,"Apple SD Gothic Neo","Noto Sans KR",sans-serif}body{overflow-x:hidden}button,input,select{font:inherit}button,select,input{min-height:44px}button{border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);cursor:pointer}button:hover{border-color:#a8a296}button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #315f9b;outline-offset:2px}.skip{position:fixed;left:12px;top:-60px;z-index:100;padding:12px;background:#fff;color:#111}.skip:focus{top:12px}.topbar{height:72px;display:grid;grid-template-columns:240px 1fr auto;align-items:center;gap:16px;padding:0 22px;background:rgba(255,254,250,.96);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}.brand{display:flex;flex-direction:column}.brand span{font-size:9px;letter-spacing:.16em;color:var(--accent);font-weight:800}.brand strong{font-size:19px}.viewTabs{justify-self:center;display:flex;padding:4px;background:#e7e3da;border-radius:13px}.viewTabs button{min-width:92px;border:0;background:transparent}.viewTabs button.active{background:#fff;box-shadow:0 2px 8px rgba(0,0,0,.08);font-weight:800}.topActions{display:flex;gap:7px}.topActions button{padding:0 14px}.topActions button:first-child,.topActions button:nth-child(2){width:44px;padding:0;font-size:20px}.primary{background:var(--accent);color:white;border-color:var(--accent)}.workspace{display:grid;grid-template-columns:240px minmax(420px,1fr) 270px;gap:12px;padding:12px;height:calc(100vh - 104px);min-height:640px}.panel{min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow)}.library,.inspector{padding:18px;overflow-y:auto}.panelTitle{display:flex;align-items:center;gap:10px;margin-bottom:18px}.panelTitle>span{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#eee9df;color:var(--accent);font-size:11px;font-weight:900}.panelTitle div{display:flex;flex-direction:column}.panelTitle small{color:var(--muted);font-size:10px;margin-top:2px}.presetGrid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.presetGrid button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:72px;font-size:11px}.presetGrid b{font-size:22px;color:var(--sage)}.roomBox,.projectBox,.dataTools{margin-top:18px;padding-top:18px;border-top:1px solid var(--line)}.subhead{display:flex;align-items:center;justify-content:space-between}.subhead button{min-height:36px;padding:0 10px;font-size:10px}.roomForm{margin-top:10px;display:grid;gap:7px}.roomForm[hidden]{display:none}.roomForm label,.fieldPair label,#itemForm>label,dialog label{position:relative;display:grid;grid-template-columns:1fr 74px 24px;align-items:center;gap:5px;color:var(--muted);font-size:11px}.roomForm input,.fieldPair input,#itemForm input,#itemForm select,dialog input{width:100%;height:40px;min-height:40px;border:1px solid var(--line);border-radius:8px;background:white;padding:0 8px}.projectBox{display:grid;gap:8px}.projectBox label{display:grid;gap:6px;font-size:11px;color:var(--muted)}.projectBox select{width:100%;border:1px solid var(--line);border-radius:9px;background:white;padding:0 8px}.dangerText{color:var(--warn)}.stage{display:flex;flex-direction:column;overflow:hidden}.stageHeader{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line)}.stageHeader>div:first-child{display:flex;align-items:baseline;gap:9px}.stageHeader span{font-size:10px;color:var(--muted)}.legend{display:flex;gap:10px}.dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:4px}.dot.ok{background:var(--sage)}.dot.warn{background:var(--warn)}.planFigure{position:relative;flex:1;min-height:0;margin:0;background:#e9e4da;overflow:hidden}.planFigure figcaption{position:absolute;left:12px;bottom:10px;z-index:4;padding:7px 9px;border-radius:7px;background:rgba(255,254,250,.88);font-size:9px;color:var(--muted);pointer-events:none}.planFigure canvas{display:block;width:100%;height:100%;touch-action:none}.planFigure #threeWrap{position:absolute;inset:0;background:linear-gradient(#dfe7e5,#f0ece4)}.planFigure #threeWrap[hidden]{display:none}#three{width:100%;height:100%}.orbitHint{position:absolute;right:12px;bottom:10px;margin:0;padding:7px 9px;border-radius:7px;background:rgba(255,254,250,.9);font-size:9px;color:var(--muted)}.dimensionRail{display:flex;gap:8px;min-height:50px;padding:9px 12px;overflow-x:auto;border-top:1px solid var(--line)}.dimensionRail span{white-space:nowrap;padding:8px 10px;border-radius:8px;background:#eee9df;font-size:10px}.dimensionRail span.warn{background:#f7ded9;color:#8c2f25}.emptyState{min-height:160px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:20px;border:1px dashed var(--line);border-radius:12px}.emptyState b{font-size:13px}.emptyState span{margin-top:5px;color:var(--muted);font-size:10px;line-height:1.5}.fieldPair{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:9px}#itemForm>label{margin-bottom:9px}#itemForm .wide{grid-template-columns:1fr}#itemForm .wide input{margin-top:5px}.statusNote{padding:10px;margin:10px 0;border-radius:9px;background:#e6efe9;color:#405d4b;font-size:10px;line-height:1.45}.statusNote.warn{background:#f7ded9;color:#8c2f25}.danger{width:100%;color:white;background:var(--warn);border-color:var(--warn)}.dataTools p{font-size:10px;line-height:1.55;color:var(--muted)}.dataTools>div{display:grid;grid-template-columns:1fr 1fr;gap:7px}.dataTools button{font-size:10px}.fallback{padding:20px}dialog{width:min(420px,calc(100% - 24px));border:0;border-radius:16px;padding:0;box-shadow:0 24px 80px rgba(0,0,0,.25)}dialog::backdrop{background:rgba(25,25,23,.48)}dialog form{padding:20px}dialog header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}dialog header button{width:44px;font-size:20px}dialog label{margin-bottom:10px}dialog menu{display:flex;justify-content:flex-end;gap:8px;padding:12px 0 0;margin:0}dialog menu button{min-width:90px}#toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,20px);z-index:50;padding:11px 15px;border-radius:10px;background:#20211e;color:white;font-size:11px;opacity:0;pointer-events:none;transition:.16s ease}#toast.show{opacity:1;transform:translate(-50%,0)}footer{height:32px;display:grid;place-items:center;color:var(--muted);font-size:9px}
@media(max-width:900px){.topbar{height:auto;min-height:72px;grid-template-columns:1fr auto;padding:10px 12px}.viewTabs{grid-row:2;grid-column:1/-1;justify-self:stretch}.viewTabs button{flex:1}.topActions button:first-child,.topActions button:nth-child(2){display:none}.workspace{height:auto;min-height:0;grid-template-columns:1fr;padding:8px}.library{order:2}.stage{order:1;height:68vh;min-height:520px}.inspector{order:3}.presetGrid{grid-template-columns:repeat(3,1fr)}.roomForm{grid-template-columns:1fr 1fr}.planFigure figcaption{max-width:70%}.inspector,.library{overflow:visible}.fieldPair{grid-template-columns:1fr 1fr}}
@media(max-width:520px){.brand strong{font-size:16px}.topActions .primary{padding:0 11px}.stage{height:63vh;min-height:480px}.presetGrid{grid-template-columns:repeat(3,1fr)}.roomForm{grid-template-columns:1fr}.fieldPair{grid-template-columns:1fr}.legend span{display:none}.dimensionRail{min-height:46px}.tonePreview{grid-template-columns:repeat(2,1fr)}}
@media(prefers-reduced-motion:reduce){#toast{transition:none}}
@media print{.topbar,.library,.inspector,.dimensionRail,footer{display:none!important}.workspace{display:block;height:auto;padding:0}.stage{height:100vh;border:0;box-shadow:none}.planFigure figcaption{display:block}.planFigure{height:95vh}.viewTabs{display:none}}

/* Whole-home editing rail */
.legend button{min-height:32px;padding:0 9px;font-size:9px}
.threeTools{position:absolute;left:12px;top:12px;z-index:3;display:flex;gap:5px;padding:5px;border-radius:10px;background:rgba(255,254,250,.9)}.threeTools button{min-height:34px;padding:0 9px;font-size:9px}.threeTools button.active{background:var(--accent);border-color:var(--accent);color:#fff}
.referenceImage{display:block;width:100%;height:100%;object-fit:contain;background:#fff;padding:8px}.referenceImage[hidden]{display:none}
.dataTools>div{grid-template-columns:1fr 1fr}.dialogHelp{color:var(--muted);font-size:11px;line-height:1.5}.versionList{display:grid;gap:7px;max-height:52vh;overflow:auto}.versionRow{display:grid;grid-template-columns:1fr auto auto;gap:6px;align-items:center;padding:9px;border:1px solid var(--line);border-radius:10px}.versionRow div{display:flex;flex-direction:column;gap:3px}.versionRow small{color:var(--muted);font-size:9px}.versionRow button{min-height:36px;padding:0 9px;font-size:10px}
.viewTabs button{min-width:84px}.roomPicker{display:grid;gap:6px;margin-top:12px;color:var(--muted);font-size:11px}.roomPicker select,.roomForm select{width:100%;border:1px solid var(--line);border-radius:9px;background:#fff;padding:0 8px}.stageHeader>div:first-child{align-items:center;flex-wrap:wrap}.stageHeader em{padding:5px 7px;border-radius:999px;background:#eee9df;color:var(--accent);font-size:9px;font-style:normal;font-weight:700}.planFigure canvas[hidden]{display:none}.nudge{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin:8px 0}.nudge button{min-height:36px;padding:0 4px;font-size:9px}.itemActions{display:grid;grid-template-columns:1fr 1fr;gap:7px}.itemActions button{width:100%}.checklist{margin-top:18px;padding-top:16px;border-top:1px solid var(--line);font-size:10px}.checklist summary{cursor:pointer;font-weight:800}.checklist label{display:flex;align-items:center;gap:7px;margin-top:9px;color:var(--muted)}.checklist input{min-height:0;width:16px;height:16px}
@media(max-width:520px){.viewTabs button{min-width:0;padding:0 7px;font-size:12px}}
.layerTools{display:flex;align-items:center;gap:12px;min-height:42px;padding:6px 12px;border-top:1px solid var(--line);overflow-x:auto;background:#faf8f3;font-size:10px}.layerTools strong{color:var(--accent)}.layerTools label{display:flex;align-items:center;gap:5px;white-space:nowrap;color:var(--muted)}.layerTools input{width:16px;height:16px;min-height:0}.layerTools button{min-height:30px;padding:0 9px;white-space:nowrap;font-size:9px}.layerTools button.active{background:#315f9b;color:#fff;border-color:#315f9b}.measureMode{cursor:crosshair!important}@media(max-width:520px){.layerTools{gap:9px}.layerTools strong{display:none}}@media print{.layerTools{display:none!important}}
