.pro-space-modal{width:min(1120px,96vw);max-width:none;max-height:92dvh}
.pro-space-modal .modal-body{max-height:calc(92dvh - 145px);overflow:auto;padding:18px 22px}
.space-editor-intro{display:flex;justify-content:space-between;gap:16px;align-items:start;margin-bottom:14px}
.space-editor-intro p{font-size:12px;line-height:1.6}.space-editor-intro small{font-size:10px;color:var(--muted);max-width:260px;line-height:1.6}
.space-editor-layout{display:grid;grid-template-columns:210px minmax(0,1fr) 250px;gap:14px;align-items:start}
.space-editor-main{min-width:0}
.space-editor-palette-slot{min-width:0}
.space-editor-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}.space-editor-tools strong{font-size:12px;margin-right:auto}.space-editor-tools .text-btn{font-size:11px}
.space-editor-palette{padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff;margin-bottom:12px}.space-palette-tabs{display:flex;gap:5px;overflow-x:auto;scrollbar-width:none}.space-palette-tabs::-webkit-scrollbar{display:none}.space-palette-tab{border:0;background:transparent;color:var(--muted);font-size:11px;font-weight:700;padding:8px 10px;white-space:nowrap;border-bottom:2px solid transparent;cursor:pointer}.space-palette-tab.active{color:var(--primary);border-bottom-color:var(--primary)}.space-palette-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:9px}.space-palette-item{display:flex;align-items:center;gap:7px;min-height:48px;padding:7px 8px;border:1px solid #ffffffa8;border-radius:8px;background:var(--space-kind-color,#edf2e8);color:#23382e;text-align:left;font-size:11px;font-weight:700;cursor:grab;touch-action:none}.space-palette-item:hover,.space-palette-item:focus-visible,.space-palette-item.active{outline:2px solid var(--primary);outline-offset:1px;box-shadow:inset 0 0 0 1px #ffffffb8}.space-palette-hint{margin-top:8px;color:var(--muted);font-size:10px;line-height:1.5}
#space-layout-canvas{display:block;width:100%;max-height:520px;aspect-ratio:340/260;border:1px solid var(--line);border-radius:8px;touch-action:none;background:#fbfcf8}
.space-block{cursor:grab}.space-block:active{cursor:grabbing}.space-block-shape{stroke:#738772;stroke-width:2}.space-block.selected .space-block-shape{stroke:var(--primary);stroke-width:3;filter:drop-shadow(0 2px 4px #254b7433)}.space-block text{font-size:11px;fill:#324e3c;pointer-events:none;user-select:none}.space-block .space-room-name{pointer-events:all;cursor:pointer}.space-room-name tspan{font-size:9px;fill:#496e59}.space-block[data-kind="study"] .space-room-name,.space-block[data-kind="closet"] .space-room-name,.space-block[data-kind="doubleStairs"] .space-room-name{fill:#fff}.space-block[data-kind="study"] .space-room-name tspan,.space-block[data-kind="closet"] .space-room-name tspan,.space-block[data-kind="doubleStairs"] .space-room-name tspan{fill:#fff}.space-edge-handle{fill:var(--primary);stroke:#fff;stroke-width:1.5;cursor:ew-resize}.space-edge-handle[data-edge="top"],.space-edge-handle[data-edge="bottom"]{cursor:ns-resize}
.space-placement-preview{pointer-events:none}.space-placement-preview rect{fill-opacity:.68;stroke:#315e46;stroke-width:2.5;stroke-dasharray:7 4}.space-placement-preview text{font-size:11px;font-weight:700;fill:#23422e;paint-order:stroke;stroke:#ffffffb8;stroke-width:2px}
.space-editor-side{border:1px solid var(--line);border-radius:10px;background:var(--surface-soft);padding:15px;min-width:0}.space-editor-fields>strong{font-size:13px;display:block;margin-bottom:12px}.space-editor-fields .field{margin-bottom:10px}.space-editor-fields label{font-size:10px}.space-editor-fields input,.space-editor-fields select{font-size:12px}.space-editor-fields .form-grid{gap:8px}.space-editor-fields .note{font-size:10px;line-height:1.6;margin:10px 0 14px}.space-editor-empty{font-size:12px;color:var(--muted);line-height:1.7}.space-details-toggle,.space-details-close{display:none}
.space-model-panel{padding:18px 20px;margin-top:18px}.space-model-panel h3{font-size:15px}.space-model-panel .note{font-size:11px;margin-top:5px;line-height:1.7}.space-model-panel svg{display:block;width:100%;height:auto;max-height:420px;margin:12px auto;border:1px solid var(--line);border-radius:9px}.space-model-levels{display:flex;gap:6px}.space-model-levels .pill-button{font-size:10px;min-height:30px;padding:5px 10px}
.space-style-note{position:absolute;left:14px;top:14px;background:#fffffff2;border:1px solid #fff;border-radius:6px;color:#435447;padding:6px 9px;font-size:10px;box-shadow:0 2px 10px #00000013}
@media(max-width:950px){.space-editor-layout{grid-template-columns:180px minmax(0,1fr)}.space-editor-side{grid-column:1/-1}.space-palette-items{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:751px){.space-palette-tabs{flex-wrap:wrap;overflow:visible}.space-palette-tab{padding:6px 7px}}
@media(max-width:750px){.pro-space-modal{width:100vw;max-height:100dvh;border-radius:0}.pro-space-modal .modal-body{max-height:calc(100dvh - 135px);padding:14px}.space-editor-intro{display:block}.space-editor-intro small{display:block;margin-top:5px;max-width:none}.space-editor-layout{grid-template-columns:1fr}.space-editor-side{padding:13px;grid-column:auto}#space-layout-canvas{max-height:55dvh}.space-palette-tab{padding:8px 9px}.space-palette-items{grid-template-columns:repeat(4,minmax(0,1fr))}.space-palette-item{display:grid;justify-items:center;text-align:center;gap:3px;padding:6px 3px;min-height:58px;font-size:10px}}
@media(max-width:380px){.space-palette-items{grid-template-columns:repeat(3,minmax(0,1fr))}}
.space-editor-palette{max-height:min(520px,calc(92dvh - 230px));overflow-y:auto;scrollbar-width:thin}
.space-palette-group+.space-palette-group{border-top:1px solid var(--line);margin-top:12px;padding-top:11px}
.space-palette-group h4{font-size:11px;color:#33483c;margin:0 0 8px;font-weight:750}
.space-palette-icon{display:block;width:27px;height:27px;flex:none;object-fit:contain;padding:4px;border-radius:7px;background:transparent}.space-palette-item[data-kind="study"],.space-palette-item[data-kind="closet"],.space-palette-item[data-kind="doubleStairs"],.space-room-kind-group button[data-kind="study"],.space-room-kind-group button[data-kind="closet"],.space-room-kind-group button[data-kind="doubleStairs"]{color:#fff}.space-palette-item[data-kind="study"] img,.space-palette-item[data-kind="closet"] img,.space-palette-item[data-kind="doubleStairs"] img,.space-room-kind-group button[data-kind="study"] img,.space-room-kind-group button[data-kind="closet"] img,.space-room-kind-group button[data-kind="doubleStairs"] img{filter:brightness(0) invert(1)}
@media(max-width:750px){.space-editor-palette{max-height:27dvh}.space-palette-group+.space-palette-group{margin-top:9px;padding-top:9px}.space-palette-icon{width:27px;height:27px}}
.space-canvas-hint{font-size:10px;color:var(--muted);line-height:1.5;margin:0 0 8px}.space-editor-canvas-wrap{position:relative;min-width:0}.space-room-menu{position:absolute;z-index:5;display:grid;min-width:110px;padding:4px;border:1px solid var(--line);border-radius:8px;background:#fff;box-shadow:0 8px 24px #172c1c2b}.space-room-menu[hidden]{display:none}.space-room-menu button{border:0;background:transparent;border-radius:5px;padding:8px 10px;color:#304638;text-align:left;font-size:11px;cursor:pointer}.space-room-menu button:hover,.space-room-menu button:focus-visible{background:#eef3ee}.space-room-menu button:last-child{color:#a34d4d}
.space-room-dimensions{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:3}.space-room-dimension{position:absolute;transform:translateX(-50%);padding:1px 4px;border-radius:3px;background:#ffffffd9;color:#294435;font-size:11px;font-weight:700;line-height:1.25;white-space:nowrap;font-variant-numeric:tabular-nums;box-shadow:0 1px 3px #00000016}
.space-room-kind-menu{position:absolute;z-index:6;width:178px;max-height:min(260px,60dvh);overflow-y:auto;padding:8px;border:1px solid var(--line);border-radius:9px;background:#fff;box-shadow:0 8px 24px #172c1c2b;scrollbar-width:thin}.space-room-kind-menu[hidden]{display:none}.space-room-kind-menu>strong{display:block;font-size:11px;color:#263e30;margin:1px 3px 6px}.space-room-kind-group{border-top:1px solid #edf1ec;padding-top:6px;margin-top:6px}.space-room-kind-group>span{display:block;font-size:9px;color:var(--muted);margin:0 3px 4px}.space-room-kind-group>div{display:grid;grid-template-columns:1fr 1fr;gap:3px}.space-room-kind-group button{display:flex;align-items:center;gap:4px;min-height:28px;padding:3px 5px;border:1px solid #ffffffa8;border-radius:5px;background:var(--space-kind-color,#edf2e8);color:#23382e;text-align:left;font-size:10px;cursor:pointer}.space-room-kind-group button:hover,.space-room-kind-group button:focus-visible,.space-room-kind-group button.active{outline:2px solid var(--primary);outline-offset:1px}.space-room-kind-group button img{width:16px;height:16px;object-fit:contain}
@media(max-width:950px){.space-editor-side{display:none;position:fixed;left:12px;right:12px;bottom:78px;z-index:120;max-width:420px;max-height:65dvh;margin:auto;overflow:auto;box-shadow:0 14px 45px #1d2e2540}.space-editor-side.open{display:block}.space-details-toggle{display:inline-flex;align-items:center;justify-content:center;position:absolute;right:10px;top:10px;z-index:4;min-height:32px;padding:5px 10px;border:1px solid var(--line);border-radius:7px;background:#fffffff0;color:var(--primary);font-size:11px;font-weight:700;cursor:pointer}.space-details-toggle[hidden]{display:none}.space-details-close{display:block;float:right;border:0;background:transparent;color:var(--muted);font-size:22px;line-height:1;cursor:pointer}}
@media(max-width:750px){.space-room-dimension{font-size:10px;padding:1px 2px}}
.modal-backdrop:has(.pro-space-modal){padding:0}
.pro-space-modal{display:flex;flex-direction:column;width:100vw;max-width:none;height:100dvh;max-height:none;border-radius:0;overflow:hidden}
.pro-space-modal .modal-head,.pro-space-modal .modal-foot{flex:none}
.pro-space-modal .modal-body{display:flex;flex-direction:column;flex:1;min-height:0;max-height:none;overflow:hidden;padding:12px 18px}
.space-editor-intro{flex:none;margin-bottom:8px}
.space-editor-layout{flex:1;min-height:0;align-items:stretch;grid-template-columns:220px minmax(0,1fr) 250px;gap:12px}
.space-editor-palette-slot,.space-editor-main{min-height:0}
.space-editor-palette{height:100%;max-height:none;margin:0;box-sizing:border-box;overflow-y:auto}
.space-palette-item{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:4px;height:46px;min-height:46px;padding:4px 6px;box-sizing:border-box;text-align:left;line-height:1.15}
.space-palette-item .space-palette-icon{width:20px;height:20px;padding:1px;box-sizing:border-box}
.space-palette-item span{display:block;width:3em;flex:none;white-space:normal;word-break:break-all;font-size:10px}
.space-history-btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;flex:none;padding:5px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--primary);cursor:pointer}
.space-history-btn svg{width:18px;height:18px}
.space-history-btn:hover:not(:disabled),.space-history-btn:focus-visible{background:var(--surface-soft);border-color:var(--primary)}
.space-history-btn:disabled{opacity:.38;cursor:not-allowed}
.space-block .space-room-name{font-weight:600;transition:fill .15s ease,filter .15s ease}
.space-room-name-bg{fill:#ffffffcc;stroke:#3c8d70;stroke-width:1;opacity:0;pointer-events:none;transition:opacity .15s ease}
.space-room-label:hover .space-room-name-bg,.space-room-label:focus-within .space-room-name-bg{opacity:1}
.space-block .space-room-name tspan{opacity:.65;transition:opacity .15s ease,fill .15s ease}
.space-block .space-room-name:hover,.space-block .space-room-name:focus-visible{fill:#0c7353;font-weight:800;filter:drop-shadow(0 0 3px #ffffff)}
.space-block .space-room-name:hover tspan,.space-block .space-room-name:focus-visible tspan{fill:#0c7353;opacity:1}
.space-block[data-kind="study"] .space-room-name:hover,.space-block[data-kind="closet"] .space-room-name:hover,.space-block[data-kind="doubleStairs"] .space-room-name:hover,.space-block[data-kind="study"] .space-room-name:focus-visible,.space-block[data-kind="closet"] .space-room-name:focus-visible,.space-block[data-kind="doubleStairs"] .space-room-name:focus-visible{fill:#0c7353;filter:drop-shadow(0 0 3px #ffffff)}
.space-block[data-kind="study"] .space-room-name:hover tspan,.space-block[data-kind="closet"] .space-room-name:hover tspan,.space-block[data-kind="doubleStairs"] .space-room-name:hover tspan,.space-block[data-kind="study"] .space-room-name:focus-visible tspan,.space-block[data-kind="closet"] .space-room-name:focus-visible tspan,.space-block[data-kind="doubleStairs"] .space-room-name:focus-visible tspan{fill:#0c7353}
.space-editor-main{display:flex;flex-direction:column}
.space-canvas-hint{flex:none}
.space-editor-canvas-wrap{flex:1;min-height:0}
#space-layout-canvas{height:100%;max-height:none;aspect-ratio:auto}
@media(max-width:950px){.space-editor-layout{grid-template-columns:180px minmax(0,1fr)}}
@media(max-width:750px){.pro-space-modal .modal-body{padding:10px 12px}.space-editor-layout{display:flex;flex-direction:column;gap:8px}.space-editor-palette-slot{height:min(26dvh,220px);flex:none}.space-editor-main{flex:1}.space-editor-intro{display:none}.space-palette-item{display:flex;height:46px;min-height:46px;padding:3px 4px}}
