:root{font-family:ui-sans-serif,system-ui,sans-serif;color:#24332d;background:#efebe2;--green:#255849;--line:#e3dcd0;--muted:#625f55}*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button{cursor:pointer}button:focus-visible,canvas:focus-visible,input:focus-visible{outline:2px solid #bd5b29;outline-offset:2px}.shell{max-width:1700px;margin:auto;padding:22px 25px 24px}.mast{display:flex;align-items:center;gap:14px;margin:0 0 20px}.mark{height:52px;width:52px;display:grid;place-items:center;border-radius:14px;background:#244d41;color:#ffe1a5;font-size:40px;font-weight:700;line-height:1;box-shadow:0 3px 0 #18372e}.mast h1{font-size:clamp(23px,3vw,34px);line-height:1.04;margin:0;letter-spacing:-.055em}.mast p,.inventory-head p{margin:5px 0 0;color:var(--muted);font-size:13px}.mast p span,.key span{margin:0 4px}.undo{margin-left:auto;background:#fcfaf4;border:1px solid #d8d0c1;border-radius:10px;padding:9px 13px;color:#34453c;font-weight:650;white-space:nowrap}.undo:disabled{opacity:.48;cursor:default}main{display:grid;grid-template-columns:minmax(0,1fr) 322px;gap:16px}.scene,.panel{min-width:0;border-radius:18px;overflow:hidden}.scene{position:relative;display:flex;flex-direction:column;background:#172923;color:#f1ead8;min-height:550px;height:calc(100dvh - 116px);max-height:1000px;border:1px solid #283e34;box-shadow:0 9px 24px #24332d21}.toolbar{z-index:1;display:flex;position:absolute;top:16px;left:16px;right:16px;gap:8px;pointer-events:none}.switch{display:flex;padding:3px;gap:2px;background:#20372ef5;border:1px solid #4b6557;border-radius:10px;pointer-events:auto}.switch button{border:0;border-radius:6px;background:transparent;color:#f4ead3;font-size:13px;font-weight:700;min-height:33px;min-width:33px;padding:0 8px}.switch button:hover,.switch [aria-pressed=true]{background:#eee1bf;color:#253c32}.zoom{margin-left:auto}#viewport{flex:1;min-height:0;position:relative}canvas{display:block;width:100%;height:100%;touch-action:none;cursor:grab}canvas:active{cursor:grabbing}.stage-foot{min-height:44px;padding:9px 15px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #42554a;background:#1a2d25;font-size:12px;color:#ebe3cd}.key{white-space:nowrap;color:#d5c6a5}.key i{display:inline-block;width:6px;height:6px;background:#e5b96e;border-radius:50%;margin-right:5px;vertical-align:1px}#tooltip{position:absolute;pointer-events:none;z-index:2;background:#f9edcf;color:#20382e;border:1px solid #a08552;border-radius:7px;padding:5px 8px;font-size:12px;white-space:nowrap}.panel{background:#faf7ef;border:1px solid #ded5c6;display:flex;flex-direction:column;max-height:1000px;height:calc(100dvh - 116px);min-height:550px}.inventory-head{display:flex;align-items:flex-start;justify-content:space-between;padding:17px 15px 11px}.inventory-head h2{margin:0;font-size:20px;letter-spacing:-.035em}.inventory-head span{font-size:11px;color:#4b5c50;background:#eaeadd;border-radius:20px;padding:4px 8px;white-space:nowrap}.filters{display:flex;gap:4px;padding:0 12px 9px;overflow-x:auto}.filters button{white-space:nowrap;padding:6px 7px;border-radius:7px;background:transparent;color:#536258;border:1px solid transparent;font-size:11px;font-weight:750}.filters button[aria-pressed=true]{background:#dfe9dc;border-color:#d0dece;color:#234c3b}.inventory{overflow:auto;flex:1;min-height:100px;padding:0 12px 5px;overscroll-behavior:contain}.item{display:grid;grid-template-columns:37px 1fr auto;align-items:center;text-align:left;gap:9px;width:100%;padding:5px 7px 5px 5px;min-height:51px;border:1px solid transparent;border-bottom-color:#ebe4d8;background:transparent;border-radius:7px;color:#263931;touch-action:pan-y}.item:hover,.item.selected{border-color:#b7cabe;background:#e8efe4}.item .thumb{display:grid;place-items:center;height:35px;border-radius:6px;background:#ece5d6}.thumb canvas{width:35px;height:34px;cursor:inherit;touch-action:inherit}.item strong,.item small{display:block}.item strong{font-size:12px;line-height:1.15}.item small{font-size:10px;color:#6b6557;margin-top:4px}.action{font-size:12px;color:#2f674e;font-weight:750}.reset{align-self:center;border:0;background:none;color:#6c6659;padding:10px;font-size:11px;text-decoration:underline;text-underline-offset:3px}.inspector-body{padding:13px 14px 12px;border-bottom:1px solid #cdd8cc;background:#edf0e4}.inspector-top{display:flex;align-items:flex-start;justify-content:space-between;gap:6px}.inspector-top h2{font-size:15px;letter-spacing:-.02em;margin:0}.inspector-top small{display:block;color:#675635;font-size:11px;line-height:1.3;margin-top:5px}.plain{border:0;background:transparent;color:#354b3e;font-size:18px;line-height:1}.fields{margin-top:10px;display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.fields label{min-width:0;font-size:10px;color:#536255;font-weight:650}.fields input{margin-top:3px;width:100%;border:1px solid #bccbbd;border-radius:6px;background:#fbfaf4;color:#243b31;padding:4px;font-size:13px}.inspector-actions{display:flex;gap:7px;margin-top:9px}.inspector-actions button{border:1px solid #a8bdb0;background:#fbfaf4;border-radius:7px;color:#24513f;padding:5px 7px;font-weight:650;font-size:11px}.inspector-actions button:disabled{opacity:.45;cursor:default}.coordinates{font-size:10px;color:#596458;margin:7px 0 0}.estimate{color:#86521c;font-weight:800}@media(max-width:850px){.shell{padding:16px}main{grid-template-columns:minmax(0,1fr) 270px;gap:10px}.scene,.panel{height:calc(100dvh - 98px)}}@media(max-width:680px){.shell{padding:12px}.mast{margin-bottom:13px}.mark{width:43px;height:43px;font-size:32px}.undo{padding:7px 9px}main{display:flex;flex-direction:column}.scene{height:58dvh;min-height:345px}.panel{height:auto;min-height:0}.inventory{max-height:290px}.toolbar{top:8px;left:8px;right:8px;gap:4px}.switch button{min-width:27px;padding:0 5px}.stage-foot{padding:7px 9px;font-size:11px}}

.filters{flex-wrap:wrap;overflow:visible}.filters button{padding-inline:6px}.mast{min-height:52px}.shell{padding-bottom:16px}@media(max-width:680px){.mast{min-height:43px}}

.sidebar{min-width:0;display:flex;flex-direction:column;gap:12px}
.sidebar .panel{height:auto;min-height:0;max-height:none}
.inventory-panel{display:block}
.inventory-head{cursor:pointer;align-items:center;gap:7px;list-style:none;padding-bottom:15px}
.inventory-head::-webkit-details-marker{display:none}
.inventory-head>div{flex:1}
.disclosure{height:8px;width:8px;border-right:2px solid #4b6557;border-bottom:2px solid #4b6557;transform:rotate(45deg);margin:0 4px 4px}
.inventory-panel[open] .disclosure{transform:rotate(225deg);margin-bottom:0}
.inventory-content .inventory{height:clamp(135px,calc(100dvh - 520px),450px);max-height:none}
.sidebar #inspector:empty{display:none}
.sidebar #inspector{border:1px solid #ccd8cb;border-radius:14px;overflow:hidden;order:-1}
.sidebar .inspector-body{border-bottom:0}
.preset-panel{display:block;padding:15px;background:#fffdf9}
.preset-panel h2,#layout-confirm h2{font-size:17px;line-height:1.25;letter-spacing:-.025em;margin:0 0 10px}
.preset-panel select{width:100%;border:1px solid #ced5ca;border-radius:8px;background:#f4f6ed;color:#254337;padding:8px;font:inherit;font-size:13px;font-weight:650}
.preset-panel p,#layout-confirm p{font-size:13px;line-height:1.45;color:#585c50;margin:8px 0 12px}
.preset-actions,.confirm-actions{display:flex;gap:10px;align-items:center}
#load-preset,.confirm-actions button[value=ok]{background:#255849;border:1px solid #255849;border-radius:8px;color:#fffaf1;font-size:13px;font-weight:700;padding:8px 11px}
#load-preset:hover,.confirm-actions button[value=ok]:hover{background:#193f34}
.preset-actions .reset{padding:6px 2px}
#layout-confirm{border:1px solid #cad0c2;border-radius:16px;padding:20px;max-width:min(390px,calc(100% - 30px));color:#24332d;background:#fffdf9;box-shadow:0 12px 42px #17292355}
#layout-confirm::backdrop{background:#172923a0}
.confirm-actions{justify-content:flex-end}
.confirm-actions button[value=cancel]{background:#faf7ef;border:1px solid #d5d2c5;border-radius:8px;color:#34453c;padding:8px 11px;font-size:13px}
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
#status[data-blocked=true]{color:#ffd3a8}
@media(max-width:680px){.sidebar{gap:8px}.inventory-content .inventory{height:225px}}

.options{position:relative;margin-left:auto;z-index:5}
.options summary{cursor:pointer;list-style:none;border:1px solid #d8d0c1;border-radius:10px;background:#fcfaf4;color:#34453c;padding:9px 11px;font-size:13px;font-weight:700}
.options summary::-webkit-details-marker{display:none}
.options-menu{position:absolute;right:0;top:calc(100% + 6px);padding:11px 12px;background:#fffdf9;border:1px solid #d8d0c1;border-radius:10px;box-shadow:0 6px 18px #24332d25;white-space:nowrap;color:#34453c;font-size:13px}
.options-menu label{display:flex;gap:6px;align-items:center;cursor:pointer}
.options-menu input{accent-color:#255849}
.mast .undo{margin-left:0}
@media(max-width:460px){.mast{gap:8px}.mast h1{font-size:21px}.mast .undo span{display:none}.options summary{padding:8px}}

.mast-actions{margin-left:auto;display:flex;align-items:center;gap:7px}
.mast-actions .undo{font-size:13px;min-height:37px}
@media(max-width:520px){.mast{flex-wrap:wrap}.mast-actions{width:100%;justify-content:flex-end}.options{margin-left:0}.mast .undo span{display:inline}}

#wall-labels{position:absolute;inset:0;pointer-events:none}
.wall-control{position:absolute;display:flex;gap:1px;transform:translate(-50%,-50%);background:#263f35;border:1px solid #647c6b;border-radius:6px;overflow:hidden;pointer-events:auto}
.wall-control button{border:0;background:transparent;color:#f5e3b9;padding:3px 5px;min-width:18px;font-size:11px;font-weight:750;white-space:nowrap}
.wall-control button:hover,.wall-control .wall-current[aria-pressed=true]{background:#ead4a1;color:#253b30}
.sidebar .room-panel{order:-2;padding:14px 15px;background:#fffdf9;display:grid;gap:6px}
.sidebar .room-panel[hidden],#opening-form[hidden],#wall-labels[hidden]{display:none}
.room-panel h2{font-size:17px;margin:0 0 3px;letter-spacing:-.025em}
.room-panel label{font-size:11px;font-weight:700;color:#465c50}
.room-panel form{display:grid;gap:4px}
.room-panel input,.room-panel select{width:100%;min-width:0;border:1px solid #cad5c9;border-radius:6px;padding:5px 6px;background:#f9faf4;color:#253b30;font-size:12px}
.room-row{display:flex;gap:6px;align-items:center}
.room-row button{flex-shrink:0;background:#edf2e9;border:1px solid #c6d2c4;border-radius:6px;padding:5px 8px;color:#27493b;font-size:11px;font-weight:700}
.room-row button:hover{background:#dceade}
.room-row label{flex:1;min-width:0}
.room-row label input{display:block;margin-top:2px}
#room-feedback{font-size:11px;line-height:1.35;margin:1px 0 0;color:#655335}
#room-feedback:empty{display:none}

.inspector-tools{display:flex;align-items:center;gap:6px}
.remove-piece{border:0;border-radius:50%;height:23px;width:23px;padding:0;background:#a13f36;color:white;font-weight:800;font-size:17px;line-height:1}
.remove-piece:hover{background:#7d2e28}

.plan-tip{margin:0 0 2px;color:#5a6456;font-size:11px;line-height:1.35}

#tell-joke{display:block;margin:9px 0 0;padding:5px 8px;border:1px solid #ced5ca;border-radius:6px;background:#f4f6ed;color:#254337;font:inherit;font-weight:650}
#tell-joke:hover{background:#e4ebdf}

.inventory-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px;border-bottom:1px solid #ebe4d8}
.inventory-row .item{grid-template-columns:37px minmax(0,1fr);border-bottom-color:transparent}
.quantity{display:flex;align-items:center;gap:3px;padding-right:3px;color:#2d4b3e;font-size:12px;font-variant-numeric:tabular-nums;font-weight:750}
.quantity span{min-width:16px;text-align:center}
.quantity button{display:grid;place-items:center;width:26px;height:29px;padding:0;border:1px solid #ced8cb;border-radius:6px;background:#f2f5ec;color:#244c3d;font-size:16px;font-weight:750;line-height:1}
.quantity button:hover:not(:disabled){background:#dce8d9}
.quantity button:disabled{opacity:.42;cursor:default}

.workshop-brand{display:flex;align-items:center;gap:13px;min-width:0}
.workshop-brand .mark{display:block;flex-shrink:0}
.workshop-brand h1{white-space:nowrap}
.workshop-credit{display:flex;align-items:center;gap:7px;border-left:1px solid #d7cfbf;padding-left:12px;color:#5c6154;font-size:10px;line-height:1.42;white-space:nowrap}
.workshop-credit img{flex-shrink:0;border-radius:50%;border:1px solid #a3b2a2;object-fit:cover}
.workshop-credit a{color:#245343;font-weight:700;text-underline-offset:2px}
.workshop-credit a:hover{color:#795123}
@media(max-width:760px){.workshop-brand{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:10px;row-gap:6px}.workshop-credit{grid-column:2;border:0;padding:0}.workshop-credit img{width:27px;height:27px}}
@media(max-width:360px){.workshop-brand h1{font-size:19px}}
