*{box-sizing:border-box;min-width:0}
html,body{margin:0;height:100%;background:#ecebe8;color:#1c1c1c;font-family:'Prompt',system-ui,sans-serif;overflow:hidden}
button{font-family:inherit;cursor:pointer}
input{font-family:inherit}
[hidden]{display:none!important}
.sr{position:absolute;left:-9999px}
svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

#app{height:100vh;display:grid;grid-template-columns:320px 1fr}
#side{background:#1f1f1f;color:#f4f2ee;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.brand{padding:22px 22px 14px;display:flex;flex-direction:column;gap:2px}
.eyebrow{font-size:12px;letter-spacing:.16em;color:#b9b5ad}
.brand .title{font-size:20px;font-weight:500}
.pad{padding:0 22px 14px}
#q{width:100%;height:42px;border-radius:10px;border:1px solid #3a3a3a;background:#2a2a2a;color:#f4f2ee;padding:0 14px;font-size:14px}
#q:focus{outline:2px solid #f4f2ee;outline-offset:1px}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chips button{height:32px;padding:0 13px;border-radius:999px;border:1px solid #444;background:transparent;color:#dcd8d0;font-size:13px}
.chips button[aria-pressed=true]{background:#f4f2ee;color:#1c1c1c;border-color:#f4f2ee;font-weight:500}
.listhead{padding:4px 22px 8px;display:flex;justify-content:space-between;align-items:baseline;gap:8px}
#catInfo{font-size:13px;color:#b9b5ad}
.hint{font-size:12px;color:#9a968e}
#grid{flex:1;min-height:0;overflow:auto;padding:4px 22px 22px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:max-content;gap:12px;align-content:start}
.card{background:#2a2a2a;border-radius:12px;overflow:hidden;cursor:grab;user-select:none;display:flex;flex-direction:column;transition:transform .15s,box-shadow .15s}
.card:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.35)}
.card.on{outline:2px solid #f4f2ee;outline-offset:-2px}
.card .ph{position:relative;height:0;padding-top:100%;background:#fff;flex:none}
.card .ph.loading{background:linear-gradient(100deg,#f1efeb 30%,#fbfaf8 50%,#f1efeb 70%) 0 0/300% 100%;animation:shim 1.2s linear infinite}
@keyframes shim{to{background-position:-150% 0}}
@media (prefers-reduced-motion:reduce){.card .ph.loading{animation:none}.card:hover{transform:none}}
.card img{position:absolute;inset:8px;width:calc(100% - 16px);height:calc(100% - 16px);object-fit:contain;-webkit-user-drag:none;pointer-events:none}
.card .nt{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#9a968e;font-size:12px}
.card .tag{position:absolute;left:8px;top:8px;background:#1f1f1f;color:#f4f2ee;font-size:11px;padding:3px 8px;border-radius:999px;z-index:1}
.card .ft{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:8px 8px 8px 12px;min-height:44px}
.card .ft span{font-size:13px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card .ft small{color:#9a968e}
.card .ft button{flex:none;width:32px;height:32px;border-radius:8px;border:0;background:#f4f2ee;color:#1c1c1c;font-size:18px;line-height:1}
.card .ft button:hover{background:#fff}
.empty{grid-column:1/-1;color:#9a968e;font-size:13px;padding:20px 0}

#main{display:flex;flex-direction:column;min-height:0}
#top{min-height:72px;flex:none;display:flex;align-items:center;gap:12px;padding:10px 24px;background:#fff;border-bottom:1px solid #e2dfd9;flex-wrap:wrap}
.roomname{display:flex;flex-direction:column}
.roomname .lbl{font-size:12px;color:#6b675f}.roomname .nm{font-size:17px;font-weight:500}
.dims{display:flex;align-items:center;gap:6px;margin-left:8px;font-size:13px;color:#4a4741}
.dims label{display:flex;align-items:center;gap:4px;height:36px;padding:0 10px;border:1px solid #dcd8d0;border-radius:8px}
.dims input{width:36px;border:0;font-size:13px;text-align:right;background:transparent}
.seg{display:flex;background:#f1efeb;border-radius:10px;padding:3px}
#top .seg{margin-left:auto}
.seg button{height:34px;padding:0 16px;border:0;border-radius:8px;background:transparent;font-size:13px;color:#4a4741}
.seg button[aria-pressed=true]{background:#fff;font-weight:500;color:#1c1c1c;box-shadow:0 1px 2px rgba(0,0,0,.12)}
.ghost{height:40px;padding:0 16px;border:1px solid #dcd8d0;border-radius:10px;background:#fff;font-size:13px}
.dark{height:40px;padding:0 18px;border:0;border-radius:10px;background:#1c1c1c;color:#fff;font-size:13px;letter-spacing:.02em}
.light{height:40px;padding:0 18px;border:0;border-radius:10px;background:#f4f2ee;color:#1c1c1c;font-size:13px;font-weight:500}

#stage{flex:1;min-height:0;position:relative;overflow:hidden;background:#fafaf8}
#c{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none}
#pill{position:absolute;left:50%;top:16px;transform:translateX(-50%);background:rgba(28,28,28,.86);color:#f4f2ee;font-size:12px;padding:8px 14px;border-radius:999px;white-space:nowrap;pointer-events:none}
@keyframes pulse{50%{opacity:.35}}

#pop{position:absolute;background:#fff;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.14);padding:10px;display:flex;flex-direction:column;gap:8px;width:230px;z-index:3}
#pop .row{display:flex;justify-content:space-between;align-items:center;gap:10px}
#pop .sku{font-size:14px;font-weight:500}
#pop a{font-size:12px;color:#1c1c1c}
#pop .small{font-size:12px;color:#6b675f}
#pop .btns{display:flex;gap:6px}
#pop .btns button{flex:1;height:36px;border:1px solid #dcd8d0;border-radius:8px;background:#fff;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px}
#pop .btns button:hover{background:#f6f4f0}
#pop .danger{color:#a33a2a}

#mini{position:absolute;left:20px;bottom:20px;background:#fff;border-radius:12px;box-shadow:0 6px 18px rgba(0,0,0,.10);padding:8px;display:flex;flex-direction:column;gap:6px}
#miniLbl{font-size:12px;color:#4a4741;padding:0 4px}
#mc{display:block;width:220px;height:163px;border-radius:8px;background:#f6f4f0}

#br{position:absolute;right:20px;bottom:20px;display:flex;gap:10px;align-items:flex-end}
#inroom{background:#fff;border-radius:12px;box-shadow:0 6px 18px rgba(0,0,0,.10);padding:12px 14px;display:flex;flex-direction:column;gap:4px;font-size:13px;min-width:210px;max-height:260px;overflow:auto}
#inroom .h{font-weight:500;margin-bottom:2px}
#inList button{display:block;width:100%;text-align:left;border:0;background:transparent;padding:3px 0;font-size:13px;color:#4a4741}
#inList button.sel{color:#1c1c1c;font-weight:500}
#inList button .ld{color:#9a968e;font-size:11px}
.zoom{display:flex;flex-direction:column;gap:6px}
.zoom button{width:44px;height:44px;border-radius:10px;border:0;background:#fff;box-shadow:0 4px 12px rgba(0,0,0,.10);font-size:20px}

#realbar{position:absolute;left:20px;top:16px;display:flex;gap:10px;align-items:center}
#realBack{width:40px;height:40px;border-radius:10px;border:0;background:rgba(28,28,28,.86);color:#f4f2ee;display:flex;align-items:center;justify-content:center}
#realBack svg{width:18px;height:18px}
.seg.dark{background:rgba(28,28,28,.86)}
.seg.dark button{color:#d6d2ca}
.seg.dark button[aria-pressed=true]{background:#f4f2ee;color:#1c1c1c}
body.real #side,body.real #top,body.real #mini,body.real #br,body.real #pill,body.real #pop{display:none!important}
body.real #app{grid-template-columns:1fr}
body.real #stage{background:#141414}

#drop{position:absolute;inset:12px;border:2px dashed #1c1c1c;border-radius:16px;display:flex;align-items:center;justify-content:center;font-size:15px;background:rgba(255,255,255,.35);pointer-events:none}
#toast{position:absolute;left:50%;bottom:24px;transform:translateX(-50%);background:#1c1c1c;color:#fff;font-size:13px;padding:10px 16px;border-radius:10px;z-index:5}

@media (max-width:900px){
  #app{grid-template-columns:1fr;grid-template-rows:auto 1fr}
  #side{max-height:38vh}
  .dims{margin-left:0}
  #mini{display:none}
}

/* photo mode */
#photo{position:absolute;display:block;object-fit:fill;user-select:none;-webkit-user-drag:none;pointer-events:none}
body.photo #mini{display:none}
body.photo .dims{opacity:.4;pointer-events:none}
body.photo #stage{background:#e6e3de}
#photoEmpty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:24px;z-index:4;background:#f2f0ec}
.pe-card{max-width:440px;background:#fff;border:2px dashed #cfcac1;border-radius:16px;padding:32px;display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center}
.pe-title{font-size:20px;font-weight:500}
.pe-card p{margin:0;color:#4a4741;font-size:14px;line-height:1.6}
.pe-btn{display:inline-flex;align-items:center;cursor:pointer;margin-top:6px}
.pe-or{font-size:12px;color:#6b675f}
#photoEmpty.over .pe-card{border-color:#1c1c1c}
#photoPanel{position:absolute;left:20px;bottom:20px;width:280px;background:#fff;border-radius:12px;box-shadow:0 6px 18px rgba(0,0,0,.12);padding:12px 14px;z-index:3;font-size:13px}
.pp-head{display:flex;justify-content:space-between;align-items:center;font-weight:500}
.pp-head button{border:0;background:transparent;font-size:12px;color:#4a4741;text-decoration:underline;min-height:32px}
#ppBody{display:flex;flex-direction:column;gap:10px;margin-top:6px}
#ppBody.closed{display:none}
.pp-hint{margin:0;font-size:12px;color:#6b675f;line-height:1.5}
#ppBody label{display:grid;grid-template-columns:1fr auto;gap:2px 8px;color:#4a4741}
#ppBody label input[type=range]{grid-column:1/-1;width:100%;accent-color:#1c1c1c}
#ppBody output{color:#1c1c1c;font-variant-numeric:tabular-nums}
#ppBody .chk{display:flex;align-items:center;gap:8px}
.pp-change{display:flex;align-items:center;justify-content:center;cursor:pointer}
body.real #photoPanel{display:none!important}

/* render control */
#renderCtl{position:absolute;right:20px;top:16px;z-index:3}
.rbtn{display:flex;align-items:center;gap:8px;height:44px;padding:0 18px;box-shadow:0 6px 18px rgba(0,0,0,.18)}
.rbtn svg{width:16px;height:16px}
#rBox{width:240px;background:#fff;border-radius:12px;box-shadow:0 6px 18px rgba(0,0,0,.14);padding:12px 14px;display:flex;flex-direction:column;gap:8px;font-size:13px}
.rrow{display:flex;justify-content:space-between;gap:8px}
#rPct{font-variant-numeric:tabular-nums;color:#4a4741}
.rbar{height:6px;border-radius:3px;background:#ece9e4;overflow:hidden}
.rbar i{display:block;height:100%;width:0;background:#1c1c1c;transition:width .3s}
.rrow2{display:flex;gap:6px}
.rrow2 button{flex:1;height:36px;border-radius:8px;border:1px solid #dcd8d0;background:#fff;font-size:12px}
#rSave{background:#1c1c1c;color:#fff;border-color:#1c1c1c}
body.real #renderCtl{right:20px}
body.real #pill{display:none}

/* product options in the card */
#pop{width:272px}
#popOpts{display:flex;flex-direction:column;gap:10px}
#popOpts:empty{display:none}
.og{display:flex;flex-direction:column;align-items:center;gap:6px;border-top:1px solid #efece7;padding-top:10px}
.og .oh{font-size:11px;color:#6b675f;letter-spacing:.04em}
.og .on{font-size:13px;font-weight:500;text-align:center;min-height:18px}
.sw-wrap{display:flex;align-items:center;gap:4px;max-width:100%}
.sw-row{display:flex;gap:8px;overflow-x:auto;scroll-behavior:smooth;scrollbar-width:none;padding:3px;max-width:174px}
.sw-row::-webkit-scrollbar{display:none}
.sw{flex:none;width:28px;height:28px;border-radius:50%;border:1px solid rgba(0,0,0,.18);padding:0;position:relative}
.sw[aria-pressed=true]{box-shadow:0 0 0 2px #fff,0 0 0 4px #1c1c1c}
.sw-arrow{flex:none;width:24px;height:28px;border:0;background:transparent;color:#4a4741;display:flex;align-items:center;justify-content:center;padding:0}
.sw-arrow[hidden]{display:none}
.sz-row{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
.sz{height:32px;padding:0 12px;border-radius:999px;border:1px solid #dcd8d0;background:#fff;font-size:12px}
.sz[aria-pressed=true]{background:#1c1c1c;color:#fff;border-color:#1c1c1c}
.oload{font-size:12px;color:#6b675f;text-align:center;border-top:1px solid #efece7;padding-top:10px}
.og.busy{opacity:.55;pointer-events:none}

/* walk-through */
#walkPad{position:absolute;left:50%;bottom:20px;transform:translateX(-50%);display:flex;align-items:flex-end;gap:12px;z-index:3}
.wp-grid{display:grid;grid-template-columns:repeat(3,48px);grid-template-rows:repeat(2,48px);gap:6px}
.wp-grid button,.wp-eye button{border:0;background:rgba(255,255,255,.94);box-shadow:0 4px 12px rgba(0,0,0,.14);border-radius:12px;display:flex;align-items:center;justify-content:center;touch-action:none}
.wp-grid button:active,.wp-grid button.on{background:#1c1c1c;color:#fff}
.wp-grid svg{width:20px;height:20px}
.wp-f{grid-column:2;grid-row:1}.wp-l{grid-column:1;grid-row:2}.wp-b{grid-column:2;grid-row:2}.wp-r{grid-column:3;grid-row:2}
.wp-eye{display:flex;flex-direction:column;gap:6px}
.wp-eye button{height:48px;padding:0 14px;font-size:13px}
.wp-eye button[aria-pressed=true]{background:#1c1c1c;color:#fff}
body.walk #canvasHint{display:none}
body.walk #c{cursor:grab}
body.walk #c:active{cursor:grabbing}
@media (max-width:900px){#walkPad{left:auto;right:12px;transform:none}}

/* header: keep everything on one row at laptop widths */
#top{gap:10px;padding:10px 16px}
#top .ghost{padding:0 12px}
#top .dark{padding:0 14px}
.dims{gap:4px;margin-left:4px}
.dims label{padding:0 8px}
.dims input{width:32px}
.seg button{padding:0 12px}
@media (max-width:1560px){.roomname{display:none}.dims>span{display:none}}
@media (max-width:1280px){#bShare,#bShot{display:none}}

/* floor picker */
.floorpick{position:relative}
#bFloor{display:flex;align-items:center;gap:6px}
#bFloor .fl{color:#6b675f}
#bFloor svg{width:14px;height:14px}
#floorMenu{position:absolute;top:46px;left:0;z-index:20;background:#fff;border-radius:12px;box-shadow:0 10px 28px rgba(0,0,0,.16);padding:8px;display:grid;gap:4px;min-width:220px}
#floorMenu button{display:flex;align-items:center;gap:10px;height:48px;padding:0 10px;border:0;border-radius:8px;background:#fff;font-size:13px;text-align:left}
#floorMenu button:hover{background:#f4f2ee}
#floorMenu button[aria-pressed=true]{background:#1c1c1c;color:#fff}
#floorMenu .fs{flex:none;width:34px;height:34px;border-radius:6px;background-size:cover;background-position:center;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}

/* category picker: grouped by room, equal-size buttons in a tidy 3-column grid */
.brand{padding:22px 22px 16px}
.brand .eyebrow{font-size:13px;letter-spacing:.2em;color:#f4f2ee;font-weight:500}
#cats{display:flex;flex-direction:column;gap:10px;padding-bottom:16px;border-bottom:1px solid #2e2e2e;margin-bottom:10px}
.cg{display:flex;flex-direction:column;gap:6px}
.cg-h{font-size:11px;letter-spacing:.06em;color:#8f8b83}
.cg-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.cg-row button{height:32px;padding:0 4px;border-radius:8px;border:1px solid #3a3a3a;background:#262626;color:#dcd8d0;font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cg-row button:hover{border-color:#5a5a5a;color:#fff}
.cg-row button[aria-pressed=true]{background:#f4f2ee;color:#1c1c1c;border-color:#f4f2ee;font-weight:500}

/* room first, then categories */
#cats{gap:8px}
.rooms{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:6px}
.rooms button{height:36px;padding:0 4px;border-radius:10px;border:1px solid #3a3a3a;background:transparent;color:#dcd8d0;font-size:13px;white-space:nowrap}
.rooms button:hover{border-color:#5a5a5a;color:#fff}
.rooms button[aria-pressed=true]{background:#f4f2ee;color:#1c1c1c;border-color:#f4f2ee;font-weight:500}
.cg-row button[aria-pressed=true]{background:#3a3833;color:#fff;border-color:#f4f2ee}

.card .thumbc{position:absolute;inset:8px;width:calc(100% - 16px);height:calc(100% - 16px);object-fit:contain;pointer-events:none}
.card .ph{background:#fff}

/* compact bar on the selected piece; the full card opens from the "i" button */
#quick{position:absolute;left:0;top:0;z-index:3;display:flex;align-items:center;gap:4px;padding:4px 4px 4px 12px;background:#fff;border-radius:999px;box-shadow:0 6px 18px rgba(0,0,0,.16);font-size:12px;white-space:nowrap}
#qName{font-weight:500;margin-right:4px;max-width:140px;overflow:hidden;text-overflow:ellipsis}
#quick button{width:32px;height:32px;border-radius:50%;border:0;background:#f1efeb;display:flex;align-items:center;justify-content:center;color:#1c1c1c}
#quick button:hover{background:#e6e2dc}
#quick .qi{background:#1c1c1c;color:#fff;font:600 14px Georgia,serif}
#quick .qi:hover{background:#000}
#pop .pr{display:flex;align-items:center;gap:8px}
#popClose{width:28px;height:28px;border:0;border-radius:8px;background:#f1efeb;font-size:16px;line-height:1}
body.real #quick{display:none!important}

/* rotate handle in the style of a round black icon button; drag it around the piece */
#rotBtn{position:absolute;left:0;top:0;z-index:3;width:44px;height:44px;margin:-22px 0 0 -22px;border-radius:50%;border:0;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 14px rgba(0,0,0,.25);cursor:grab;touch-action:none}
#rotBtn:hover,#rotBtn.on{background:#333}
#rotBtn.on{cursor:grabbing}
#rotBtn svg{width:24px;height:24px;stroke:#fff;stroke-width:2;fill:none}
#rotBtn::after{content:attr(data-tip);position:absolute;right:54px;top:50%;transform:translateY(-50%);background:#111;color:#fff;font-size:13px;padding:7px 12px;border-radius:6px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .12s}
#rotBtn:hover::after,#rotBtn.on::after{opacity:1}
body.real #rotBtn{display:none!important}

#quick .qi svg{width:18px;height:18px;fill:#fff;stroke:none}

/* collapsible in-room list */
#inToggle{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;border:0;background:transparent;padding:0;font:inherit;font-weight:500;cursor:pointer;min-height:28px;text-align:left}
#inToggle svg{width:16px;height:16px;flex:none;transition:transform .15s}
#inroom.closed #inList{display:none}
#inroom.closed #inToggle svg{transform:rotate(180deg)}
#inroom.closed{min-width:0;padding:8px 14px}
#pill{display:none!important}
#rotBtn{width:34px;height:34px;margin:-17px 0 0 -17px}
#rotBtn svg{width:19px;height:19px}
#rotBtn::after{right:44px;font-size:12px;padding:5px 10px}

/* room style picker (same look as the floor picker) */
#bStyle{display:flex;align-items:center;gap:6px}
#bStyle .fl{color:#6b675f}
#bStyle svg{width:14px;height:14px}
#styleMenu{position:absolute;top:46px;left:0;z-index:20;background:#fff;border-radius:12px;box-shadow:0 10px 28px rgba(0,0,0,.16);padding:8px;display:grid;gap:4px;min-width:250px}
#styleMenu button{display:flex;align-items:center;gap:10px;height:48px;padding:0 10px;border:0;border-radius:8px;background:#fff;font-size:13px;text-align:left}
#styleMenu button:hover{background:#f4f2ee}
#styleMenu button[aria-pressed=true]{background:#1c1c1c;color:#fff}
#styleMenu .si{flex:none;width:40px;height:32px;border-radius:4px;overflow:hidden;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}
#styleMenu .si svg{width:40px;height:32px;display:block}
@media (max-width:1480px){#bStyle .fl,#bFloor .fl{display:none}}

/* header fits on one row: secondary buttons become icon buttons on laptop widths */
.ib{display:flex;align-items:center;gap:6px}
.ib svg{width:16px;height:16px}
@media (max-width:1700px){.ib span{display:none}.ib{padding:0 11px!important}}
@media (max-width:1700px){#bShare,#bShot{display:flex!important}}
@media (max-width:1380px){#styleName,#floorName{max-width:72px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
@media (max-width:1380px){#top input{width:34px}#top .dims label{padding:0 6px}#bRender span,#bReal span{font-size:12px}}
@media (max-width:1320px){#top{gap:6px}#top .seg button{padding:0 9px}}
@media (max-width:1380px){#top{padding:10px 12px}#top .dims>span:first-child{display:none}#styleName,#floorName{max-width:64px}}
@media (max-width:1380px){#top{gap:6px}#top .roomname{display:none}#bStyle,#bFloor{padding:0 8px!important}#top .seg button{padding:0 8px}#top .dims{gap:4px}}

/* realistic render runs automatically: no button, only a quiet progress chip */
#bRender{display:none!important}
#rStop{display:none!important}

/* foldable room plan */
#miniToggle{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;border:0;background:transparent;padding:2px 4px;font:inherit;cursor:pointer;min-height:24px;text-align:left}
#miniToggle svg{width:16px;height:16px;flex:none;fill:none;stroke:#1c1c1c;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s}
#mini.closed #mc{display:none}
#mini.closed #miniToggle svg{transform:rotate(180deg)}
#mini.closed{padding:8px 12px}

#styleName,#floorName{display:inline-block;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}
@media (max-width:1260px){#top .ib{padding:0 9px!important}#top .seg button{padding:0 6px}#styleName,#floorName{max-width:60px}#top .dark{padding:0 10px}}
@media (max-width:1260px){#top{gap:4px}#top input{width:28px}}
/* product list scrollbar: dark to match the sidebar */
#grid{scrollbar-color:#4a4741 #1f1f1f}
#grid::-webkit-scrollbar{width:10px}
#grid::-webkit-scrollbar-track{background:#1f1f1f}
#grid::-webkit-scrollbar-thumb{background:#4a4741;border-radius:6px;border:2px solid #1f1f1f}
#grid::-webkit-scrollbar-thumb:hover{background:#6b675f}

/* realistic render runs quietly: no progress chip */
body:not(.real) #rBox{display:none!important}

/* foldable room / category picker */
#catsToggle{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;border:0;background:transparent;color:#f4f2ee;padding:2px 0;font:inherit;cursor:pointer;text-align:left}
#catsToggle .ct-sum{font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#catsToggle .ct-r{display:flex;align-items:center;gap:4px;font-size:11.5px;color:#8f8b83;flex:none}
#catsToggle svg{width:16px;height:16px;fill:none;stroke:#dcd8d0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s}
#catsToggle:hover .ct-r{color:#dcd8d0}
#cats .cats-body{display:flex;flex-direction:column;gap:8px}
#cats.closed .cats-body{display:none}
#cats.closed #catsToggle svg{transform:rotate(180deg)}
#cats.closed{padding-bottom:12px}

/* photo mode: no zoom buttons (lens is set to match the photo) */
body.photo #zin,body.photo #zout{display:none}

/* photo mode: per-item enlarge / shrink to match the photo */
#quick .qs{display:none}
body.photo #quick .qs{display:flex}
#quick .qs svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}

.pp-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.pp-del{color:#b3261e}
.pp-del.arm{background:#b3261e;color:#fff;border-color:#b3261e}

/* camera view presets (bottom right, above zoom) */
#br .zoom{position:relative}
.viewpick{position:relative;align-self:flex-end}
#bView{width:44px;height:44px;border-radius:10px;border:0;background:#fff;box-shadow:0 4px 12px rgba(0,0,0,.10);display:flex;align-items:center;justify-content:center;cursor:pointer}
#bView svg{width:20px;height:20px;fill:none;stroke:#1c1c1c;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#bView[aria-expanded=true]{background:#1c1c1c}#bView[aria-expanded=true] svg{stroke:#fff}
#viewMenu{position:absolute;right:0;bottom:52px;background:#fff;border-radius:12px;box-shadow:0 10px 28px rgba(0,0,0,.16);padding:6px;display:grid;gap:2px;min-width:170px;z-index:5}
#viewMenu button{display:flex;align-items:center;gap:10px;height:38px;padding:0 10px;border:0;border-radius:8px;background:#fff;font-size:13px;text-align:left;cursor:pointer;white-space:nowrap}
#viewMenu button:hover{background:#f4f2ee}
#viewMenu svg{width:22px;height:22px;flex:none;fill:none;stroke:#6b675f;stroke-width:1.5;stroke-linejoin:round}
body.photo .viewpick,body.walk .viewpick{display:none}

#sampleChip{position:absolute;top:16px;left:50%;transform:translateX(-50%);z-index:4;display:flex;align-items:center;gap:10px;padding:5px 5px 5px 14px;background:rgba(255,255,255,.94);border-radius:999px;box-shadow:0 6px 18px rgba(0,0,0,.14);font-size:12.5px}
#sampleChip span{color:#6b675f}
#sampleChip label{background:#1c1c1c;color:#fff;border-radius:999px;padding:7px 14px;cursor:pointer;font-weight:500}

.pp-row:has(#photoDel[hidden]){grid-template-columns:1fr}

/* view presets not used (removed at the customer's request) */
.viewpick{display:none!important}
/* smaller sample-room chip */
#sampleChip{top:12px;gap:6px;padding:3px 3px 3px 10px;font-size:11px;box-shadow:0 3px 10px rgba(0,0,0,.12)}
#sampleChip label{padding:4px 10px;font-size:11px}

/* photo mode: undo + reset (top left) */
#photoTools{display:none;position:absolute;top:12px;left:16px;z-index:4;gap:6px}
body.photo #photoTools{display:flex}
#photoTools button{display:flex;align-items:center;gap:6px;height:32px;padding:0 12px 0 10px;border:0;border-radius:999px;background:rgba(255,255,255,.94);box-shadow:0 3px 10px rgba(0,0,0,.12);font-size:12px;color:#1c1c1c;cursor:pointer}
#photoTools button:hover:not(:disabled){background:#fff}
#photoTools button:disabled{opacity:.45;cursor:default}
#photoTools svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* realistic page has its own top bar: hide photo-mode tools there */
body.real #photoTools,body.real #sampleChip{display:none!important}

/* 360° room photo */
#sampleChip button{border:0;background:#efece7;color:#1c1c1c;border-radius:999px;padding:4px 10px;font-size:11px;cursor:pointer}
#sampleChip button:hover{background:#e4e0d9}
body.pano #zin,body.pano #zout{display:flex!important;align-items:center;justify-content:center}
body.pano #photoPanel label:has(#pcT),body.pano #photoPanel label:has(#pcF){display:none}
body.pano canvas{cursor:grab}

#sampleChip{padding:3px}
#sampleChip button[aria-pressed=true]{background:#1c1c1c;color:#fff}
#sampleChip label{background:transparent;color:#1c1c1c;text-decoration:underline;padding:4px 10px}

/* chip: only the sample room + upload */
#chipPano,#chipOwn{display:none!important}
#sampleChip label{text-decoration:none!important}

/* ================= phone layout ================= */
@media (max-width:900px){
  html,body{height:100%;overflow:hidden}
  #app{height:100dvh;grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto}
  #main{grid-row:1;min-height:0}
  #side{grid-row:2;max-height:44dvh;border-top:1px solid #2c2c2c}
  /* one tidy toolbar row that scrolls sideways */
  #top{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;gap:6px!important;padding:8px 10px!important;min-height:0;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  #top::-webkit-scrollbar{display:none}
  #top>*{flex:none}
  #top .dims{display:none}
  #top button,#top .seg button,#bStyle,#bFloor{height:36px;font-size:12.5px}
  #top .seg button{padding:0 9px!important}
  #styleMenu,#floorMenu{position:fixed;top:54px;left:10px;right:10px;min-width:0;max-height:60dvh;overflow:auto}
  /* product panel at the bottom: brand row hidden, compact search */
  #side .brand,#side h1{display:none}
  #side{padding-top:6px}
  #q{height:38px;font-size:14px}
  #grid{grid-template-columns:repeat(3,1fr)!important;gap:8px!important}
  /* stage overlays */
  #br{right:10px;bottom:10px;gap:6px}
  #inroom{min-width:0;padding:8px 10px;font-size:12px;max-height:150px}
  .zoom button{width:38px;height:38px}
  #quick{transform-origin:0 0}
  /* photo mode: tools top-left, room chip top-right, angle panel just under them */
  #photoTools{top:8px;left:8px}
  #photoTools button{height:30px;padding:0 9px;font-size:11.5px}
  #photoTools button span{display:none}
  #sampleChip{top:8px;left:auto;right:8px;transform:none}
  #photoPanel{top:46px;bottom:auto;left:8px;width:auto;max-width:calc(100% - 16px);padding:8px 12px}
  body.photo #br{bottom:10px}
}
@media (max-width:900px){
  body.walk #br{display:none}
  #walkPad{bottom:12px!important}
  #realbar{left:8px!important;right:8px!important;top:8px!important;gap:6px!important;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  #realbar::-webkit-scrollbar{display:none}
  #realbar *{white-space:nowrap}
  #realbar button{font-size:12px;padding:0 10px;height:34px;flex:none}
}

/* ================= phone layout v2 (IKEA-style) ================= */
.m-only{display:none!important}
@media (max-width:900px){
  .m-only{display:revert!important}
  #mToolsMenu[hidden],#mScrim:not(.on){display:none!important}
  #app{height:100dvh;grid-template-columns:1fr!important;grid-template-rows:minmax(0,1fr) auto!important}
  #main{grid-row:1!important}
  #stage{background:#e6e3de}
  /* toolbar becomes a slide-in menu */
  #top{position:fixed!important;z-index:40;top:0;bottom:0;left:0;width:min(86vw,340px);flex-direction:column;align-items:stretch!important;flex-wrap:nowrap;overflow-y:auto!important;overflow-x:hidden!important;gap:10px!important;padding:18px 16px!important;border:0;box-shadow:8px 0 30px rgba(0,0,0,.18);transform:translateX(-105%);transition:transform .22s ease}
  body.mmenu #top{transform:none}
  #top .dims{display:flex!important;flex-wrap:wrap;gap:6px}
  #top .dims>span{display:block!important;width:100%;font-size:12px;color:#8f8b83}
  #top .dims label{flex:1}
  #top input{width:40px!important}
  #top .floorpick,#top .seg{width:100%}
  #bStyle,#bFloor{width:100%;justify-content:space-between;height:44px!important}
  #bStyle .fl,#bFloor .fl{display:inline!important}
  #styleName,#floorName{max-width:none!important}
  #top .seg{display:grid;grid-template-columns:repeat(4,1fr)}
  #top .seg button{height:40px!important}
  #top .ib{height:44px!important;justify-content:flex-start;padding:0 14px!important}
  #top .ib span{display:inline!important}
  #bReal{height:46px!important}
  #styleMenu,#floorMenu{position:static!important;margin-top:6px;box-shadow:none;border:1px solid #e6e2da}
  #mScrim.on{display:block!important;position:fixed;inset:0;z-index:35;background:rgba(0,0,0,.28)}
  /* product sheet */
  #side{position:fixed!important;z-index:38;left:0;right:0;bottom:0;max-height:none!important;height:72dvh;border-radius:16px 16px 0 0;transform:translateY(105%);transition:transform .25s ease;box-shadow:0 -10px 30px rgba(0,0,0,.25)}
  body.msheet #side{transform:none}
  #mSheetHead{display:flex!important;align-items:center;justify-content:space-between;padding:12px 16px 4px}
  #mSheetTitle{font-size:15px;font-weight:500}
  #mSheetClose{width:36px;height:36px;border:0;border-radius:50%;background:#2c2c2c;color:#fff;display:flex;align-items:center;justify-content:center}
  #mSheetClose svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
  #catsToggle{display:none!important}
  #cats{display:none}
  body.msheet-rooms #cats{display:block}
  body.msheet-rooms #cats .cats-body{display:flex!important}
  body.msheet-rooms .listhead,body.msheet-rooms #grid{display:none!important}
  /* bottom category bar */
  #mBar{display:flex!important;grid-row:2;gap:4px;overflow-x:auto;background:#fff;border-top:1px solid #e2dfd9;padding:8px 8px calc(8px + env(safe-area-inset-bottom));scrollbar-width:none}
  #mBar::-webkit-scrollbar{display:none}
  #mBar button{flex:none;width:78px;border:0;background:transparent;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:11.5px;color:#1c1c1c;padding:4px 2px;border-radius:10px}
  #mBar button[aria-pressed=true]{background:#f1eee9}
  #mBar button span{max-width:74px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #mBar svg{width:26px;height:26px;fill:none;stroke:#1c1c1c;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
  #mBar .mb-room{border-right:1px solid #e2dfd9;border-radius:0;margin-right:4px}
  /* stage controls */
  .m-round{position:absolute;top:12px;left:12px;z-index:6;width:48px;height:48px;border:0;border-radius:50%;background:#fff;box-shadow:0 4px 14px rgba(0,0,0,.12);display:flex!important;align-items:center;justify-content:center}
  .m-round svg,#mTopR svg,#mBottom svg{width:22px;height:22px;fill:none;stroke:#1c1c1c;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
  #mTopR{position:absolute;top:12px;right:12px;z-index:6;display:flex!important;align-items:center;gap:0;background:#fff;border-radius:999px;box-shadow:0 4px 14px rgba(0,0,0,.12);padding:4px}
  #mList{display:flex;align-items:center;gap:6px;border:0;background:transparent;padding:0 12px 0 10px;height:40px;font-size:13px}
  #mList b{font-size:20px;font-weight:600}
  #mReal{width:40px;height:40px;border:0;border-radius:50%;background:#1c1c1c;display:flex;align-items:center;justify-content:center;margin-left:4px}
  #mReal svg{stroke:#fff}
  #mBottom{position:absolute;left:12px;bottom:12px;z-index:6;display:flex!important;gap:8px;align-items:center}
  #mBottom .m-ur{display:flex;background:#fff;border-radius:999px;box-shadow:0 4px 14px rgba(0,0,0,.12);overflow:hidden}
  #mBottom .m-ur button{width:48px;height:46px;border:0;background:transparent;display:flex;align-items:center;justify-content:center}
  #mBottom .m-ur button+button{border-left:1px solid #ece9e3}
  #mBottom .m-ur button:disabled svg{stroke:#c9c5be}
  #mTools{display:flex;align-items:center;gap:8px;height:46px;padding:0 18px 0 14px;border:0;border-radius:999px;background:#fff;box-shadow:0 4px 14px rgba(0,0,0,.12);font-size:13.5px;font-weight:600}
  #mTools[aria-expanded=true] svg{transform:rotate(180deg)}
  #mToolsMenu{position:absolute;left:12px;bottom:66px;z-index:7;display:grid!important;grid-template-columns:repeat(4,auto);gap:4px;background:#fff;border-radius:14px;box-shadow:0 8px 24px rgba(0,0,0,.16);padding:6px}
  #mToolsMenu button{height:40px;padding:0 14px;border:0;border-radius:10px;background:transparent;font-size:13px}
  #mToolsMenu button[aria-pressed=true]{background:#1c1c1c;color:#fff}
  /* desktop overlays that move into the phone controls */
  #br{display:none!important}
  body.mlist #br{display:flex!important;position:absolute;top:70px;right:12px;bottom:auto}
  body.mlist #br .zoom,body.mlist #br .viewpick{display:none}
  #photoTools{display:none!important}
  #sampleChip{top:70px!important;left:50%!important;right:auto!important;transform:translateX(-50%)!important}
  #photoPanel{top:auto!important;bottom:70px!important;left:12px!important;right:12px;max-width:none!important}
  body.walk #mBottom{display:none!important}
  #walkPad{bottom:16px!important}
  body.real .m-only{display:none!important}
}

/* plan view: big "3D" switch bottom-left, like a floor-planner */
#planTo3d{display:none;position:absolute;left:24px;bottom:24px;z-index:5;border:0;background:transparent;flex-direction:column;align-items:center;gap:2px;cursor:pointer;color:#4f5661}
#planTo3d b{font-size:38px;font-weight:700;line-height:1}
#planTo3d span{font-size:12px;font-weight:500}
body.plan #planTo3d{display:flex}
body.plan #mini{display:none}
@media (max-width:900px){body.plan #planTo3d{display:none}}
