/* Browser layout layered over the V153 visual baseline. */
html,body{margin:0;width:100%;height:100%;overflow:hidden}body{padding:0;display:block;background:#fff}
#app{width:100%;height:100dvh;border:0;border-radius:0;box-shadow:none;max-width:none}
.status,.home-indicator{display:none!important}.screen{inset:0;padding:0 20px 90px;scrollbar-width:thin}
.web-controls{height:42px;display:flex;align-items:center;justify-content:flex-end;gap:12px;border-bottom:1px solid #eee;background:white;font-size:12px}
.web-controls span{color:#777}.web-controls button{border:1px solid #ddd;border-radius:18px;padding:5px 13px;min-height:32px;font-size:12px}
.nav{height:66px;padding-bottom:env(safe-area-inset-bottom);background:#fffffff5}.nav button{font-size:12px;min-width:76px}
.topbar{height:62px}.brand{font-size:28px}.look-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:28px}
.card-media{aspect-ratio:1.4}.card-title h3{font-size:19px}.card-title p{font-size:13px}
.screen>.topbar,.screen>.web-controls{grid-column:1/-1}.scene-items{position:absolute;right:20px;top:116px;bottom:190px;width:260px;z-index:15;background:#fffffff2;border:1px solid #e5e5e5;border-radius:14px;padding:12px;overflow:auto;box-shadow:0 4px 20px #00000008}
.scene-items h2{font-size:16px;padding:4px 2px 12px}.scene-items button{display:flex;width:100%;align-items:center;gap:10px;padding:9px;text-align:left;border-radius:9px;border:1px solid transparent;margin-bottom:5px;font-size:12px}
.scene-items button[aria-pressed=true]{background:#ededed;border-color:#777}.scene-items img{width:48px;height:44px;object-fit:contain}.scene-items span{overflow-wrap:anywhere}
body[data-page=three] .web-controls{position:relative;z-index:20;margin:0 -12px;padding:0 20px}body[data-page=three] .scene-top{height:58px;max-width:calc(100% - 295px)}
body[data-page=three] .full-scene{top:42px;right:295px;bottom:175px}body[data-page=three] .selection{right:310px;bottom:185px;left:20px}
body[data-page=three] .diy-bottom{padding:8px 28px 14px;height:170px}.diy-tools{max-width:720px;margin:auto}.diy-tools button{font-size:12px;min-height:44px}
body[data-page=three] .diy-bottom>.primary{max-width:560px;margin:auto;display:block}
body[data-page=three] .scene-drawer{left:auto;right:20px;top:116px;bottom:190px;width:350px;height:auto;max-height:none;z-index:25}
.scene-drawer .model-grid{grid-template-columns:repeat(3,1fr);max-height:calc(100% - 140px)}
dialog{max-width:calc(100vw - 32px);border-radius:16px!important}dialog::backdrop{clip-path:none!important}
.image-library{width:600px}.image-library .model-grid{grid-template-columns:repeat(3,1fr)}
body[data-page=designer] .agent-composer.chat-composer{left:max(20px,calc((100% - 780px)/2));right:max(20px,calc((100% - 780px)/2));bottom:78px}
[data-act="my-furniture"],[data-act="image-to-3d"],[data-act="my-models"],[data-act="use-home"],[data-act="prepare-proposal"],[data-act="apply-proposal"]{display:none!important}
@media(min-width:900px){
 body:not([data-page=three]) .screen{padding-left:max(32px,calc((100vw - 1320px)/2));padding-right:max(32px,calc((100vw - 1320px)/2))}
 body[data-page=detail] .screen{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(320px,1fr);gap:0 28px;align-content:start}
 .detail-preview{margin-top:20px;aspect-ratio:1.4}.detail-copy{padding-top:20px}.detail-copy h2{font-size:29px}.piece img{height:70px}
 .image-edit-v114{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(320px,1fr);gap:0 24px;margin:0}
 .image-edit-v114 .light-stage{grid-column:1;grid-row:1;aspect-ratio:1.45;border-radius:12px}
 .image-edit-v114 .image-update-status{grid-column:1;grid-row:2;align-self:start;border-radius:8px}
 .image-edit-v114 .image-edit-content{grid-column:2;grid-row:1/4;padding-top:0}
 .image-edit-v114 .edit-bottom{grid-column:1;grid-row:3;align-self:start;position:static}
 .image-pieces{grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-page=profile] .screen,body[data-page=designer] .screen,body[data-page=settings-page] .screen{padding-left:max(24px,calc((100vw - 780px)/2));padding-right:max(24px,calc((100vw - 780px)/2))}
}
@media(min-width:600px) and (max-width:1000px){.look-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:599px){
 .screen{padding-left:16px;padding-right:16px}.look-list{grid-template-columns:1fr}.topbar{height:52px}.web-controls{height:38px}.web-controls span{font-size:10px}
 .scene-items{right:8px;top:96px;bottom:auto;max-height:170px;width:140px;padding:6px}.scene-items h2{font-size:12px;padding-bottom:5px}.scene-items button{padding:5px;gap:5px;font-size:10px}.scene-items img{width:30px;height:30px}
 body[data-page=three] .full-scene{right:0;top:38px;bottom:172px}body[data-page=three] .scene-top{max-width:100%;padding-right:0;height:50px}
 body[data-page=three] .selection{right:8px;left:8px;bottom:180px}.scene-stats{max-width:calc(100% - 155px)}
 body[data-page=three] .scene-drawer{left:8px;right:8px;width:auto;top:auto;bottom:174px;height:320px;max-height:55dvh}
 .image-library .model-grid{grid-template-columns:repeat(2,1fr)}
}

@media(min-width:900px){dialog{inset:50% auto auto 50%!important;transform:translate(-50%,-50%)!important;margin:0!important;max-height:85dvh!important}.selection .text-btn{font-size:12px;min-height:36px}.selection strong{font-size:14px}}

.camera-tabs .camera-chip.active{color:#fff!important}

/* Context actions stay next to the selected furniture, outside the scene toolbar. */
body[data-page=three] .selection.selection-floating{position:fixed;inset:auto;bottom:auto;right:auto;width:340px;max-width:calc(100vw - 24px);padding:12px;border:1px solid #dedfd8;border-radius:16px;background:rgba(255,255,255,.97);box-shadow:0 8px 30px #0002;z-index:35;visibility:hidden;transform:none}
body[data-page=three] .selection-floating::after{content:'';position:absolute;bottom:-7px;left:var(--pointer-x,50%);width:12px;height:12px;background:#fff;border-right:1px solid #dedfd8;border-bottom:1px solid #dedfd8;transform:translateX(-50%) rotate(45deg)}
body[data-page=three] .selection-floating>div{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;margin-top:8px}
body[data-page=three] .selection-floating .text-btn{min-height:36px;padding:6px;font-size:12px;justify-content:center;border-radius:8px}
body[data-page=three] .selection-floating .text-btn:hover{background:#f0f2ec}
@media(max-width:600px){body[data-page=three] .selection.selection-floating{width:280px;padding:10px}}

/* Landscape workspace: one compact command dock and a full-height asset rail. */
@media(min-width:700px) and (orientation:landscape){
 body[data-page=three]{--asset-rail:clamp(210px,23vw,300px);--dock-height:104px;--web-height:42px}
 body[data-page=three] .full-scene{left:0;right:var(--asset-rail);top:var(--web-height);bottom:var(--dock-height)}
 body[data-page=three] .scene-top{max-width:calc(100% - var(--asset-rail));height:52px}
 body[data-page=three] .scene-items{right:0;top:var(--web-height);bottom:var(--dock-height);width:var(--asset-rail);max-height:none;border-radius:0;border-width:0 0 0 1px;padding:16px 12px;box-shadow:none;background:#fff}
 body[data-page=three] .scene-items h2{position:sticky;top:-16px;background:#fff;z-index:1;padding:8px 2px 14px;margin:0}
 body[data-page=three] .scene-items button{min-height:62px}
 body[data-page=three] .diy-bottom{height:var(--dock-height);padding:10px 20px;display:grid;grid-template-columns:minmax(0,1fr) 230px;grid-template-rows:32px 42px;gap:6px 24px;border-radius:0;border-top:1px solid #e8e8e8;box-shadow:none}
 body[data-page=three] .diy-bottom .camera-tabs{grid-column:1;grid-row:1;justify-content:flex-start;padding:0;border:0}
 body[data-page=three] .camera-tabs>span{margin-right:10px}
 body[data-page=three] .diy-tools{grid-column:1;grid-row:2;width:100%;max-width:600px;margin:0;display:flex;justify-content:flex-start;gap:12px;padding:0}
 body[data-page=three] .diy-tools button{flex:1;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:6px 12px;border-radius:9px;background:#f7f7f5}
 body[data-page=three] .diy-tools svg{width:18px;height:18px}
 body[data-page=three] .diy-bottom>.primary{grid-column:2;grid-row:2;width:100%;min-height:40px;height:40px;margin:0;padding:8px 12px}
 body[data-page=three] .diy-bottom>small{grid-column:2;grid-row:1;align-self:center;text-align:center;margin:0;font-size:9px}
 body[data-page=three] .scene-drawer{right:0;left:auto;top:var(--web-height);bottom:var(--dock-height);width:var(--asset-rail);height:auto;max-height:none;border-radius:0;padding:12px;overflow:auto}
 body[data-page=three] .scene-drawer .model-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:none;overflow:visible}
 body[data-page=three] .scene-drawer .furniture-tabs{overflow-x:auto;flex-wrap:nowrap}
 body[data-page=three] .selection.selection-floating{max-width:calc(100vw - var(--asset-rail) - 24px)}
 .image-library{max-height:85dvh}
}
@media(min-width:700px) and (max-height:550px) and (orientation:landscape){
 body[data-page=three]{--asset-rail:200px;--dock-height:84px;--web-height:34px}
 body[data-page=three] .web-controls{height:34px}
 body[data-page=three] .web-controls span{font-size:10px}
 body[data-page=three] .scene-top{height:42px}
 body[data-page=three] .scene-items{padding:8px}.scene-items img{width:36px;height:36px}
 body[data-page=three] .scene-items button{min-height:46px;padding:5px}
 body[data-page=three] .diy-bottom{grid-template-columns:minmax(0,1fr) 170px;grid-template-rows:24px 36px;padding:6px 12px;gap:4px 12px}
 body[data-page=three] .diy-tools{gap:6px}
 body[data-page=three] .diy-tools button{font-size:11px;min-height:36px;padding:4px;gap:4px}
 body[data-page=three] .diy-bottom>.primary{height:36px;min-height:36px;font-size:12px}
 body[data-page=three] .selection.selection-floating{width:290px;padding:8px}
 body[data-page=three] .selection-floating>div{margin-top:4px;gap:2px}
 body[data-page=three] .selection-floating .text-btn{min-height:30px;padding:3px}
 .topbar{height:44px}.web-controls{height:34px}.nav{height:52px}
 dialog{max-height:88dvh!important}
}
@media(min-width:700px) and (max-width:899px) and (orientation:landscape){
 body[data-page=detail] .screen{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(280px,1fr);gap:0 18px;align-content:start;padding:0 18px 24px}
 .detail-preview{margin-top:16px;aspect-ratio:1.3}.detail-copy h2{font-size:24px}
 .image-edit-v114{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(280px,1fr);gap:0 16px;margin:0}
 .image-edit-v114 .light-stage{grid-column:1;grid-row:1;margin:0;aspect-ratio:1.3;border-radius:12px}
 .image-edit-v114 .image-update-status{grid-column:1;grid-row:2}
 .image-edit-v114 .image-edit-content{grid-column:2;grid-row:1/4;padding-top:0}
 .image-edit-v114 .edit-bottom{grid-column:1;grid-row:3;position:static}
}

body[data-page=three] .selection.selection-floating{width:220px;padding:10px 12px}
body[data-page=three] .selection-floating>div{display:flex;gap:4px;margin-top:7px}
.furniture-action{display:flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;border-radius:10px;background:transparent;color:#333;padding:10px}
.furniture-action svg{width:20px;height:20px}
.furniture-action:hover,.furniture-action:focus-visible{background:#edf0e8;outline:2px solid #8c9b7c;outline-offset:1px}
.furniture-action.danger{color:#a4433f}.furniture-action.danger:hover,.furniture-action.danger:focus-visible{background:#fff0ed;outline-color:#c66b62}

/* Template selection is the single entry step before DIY. */
body[data-page=experience] .layout-actions{margin-top:18px}
body[data-page=experience] .layout-actions .primary{min-height:44px}
@media(min-width:900px) and (orientation:landscape){
 body[data-page=experience] .screen{padding-bottom:24px}
 body[data-page=experience] .layout-experience{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(300px,1fr);grid-template-rows:minmax(0,1fr) auto;gap:0 24px;min-height:0;height:calc(100dvh - 136px);margin:0;background:transparent}
 body[data-page=experience] .experience-stage{grid-column:1;grid-row:1;min-height:0;height:100%;border-radius:14px;overflow:hidden}
 body[data-page=experience] .experience-helper{grid-column:1;grid-row:2;margin:0;padding:9px 12px;background:transparent}
 body[data-page=experience] .layout-panel{grid-column:2;grid-row:1/3;min-height:0;overflow:auto;border:1px solid #eee;border-radius:14px;padding:22px;display:flex;flex-direction:column}
 body[data-page=experience] .layout-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible;gap:10px}
 body[data-page=experience] .layout-option{width:auto;min-width:0}
 body[data-page=experience] .layout-thumb{height:90px;width:100%}
 body[data-page=experience] .layout-heading{align-items:flex-start;gap:10px}
 body[data-page=experience] .layout-heading h2{font-size:22px}
 body[data-page=experience] .layout-preview-label{display:none}
 body[data-page=experience] .layout-description{line-height:1.6;margin:16px 0}
 body[data-page=experience] .layout-actions{margin-top:auto;padding-top:16px}
}

.creation-tabs{display:flex;gap:4px;border-bottom:1px solid #ddd;margin:0 0 16px}.creation-tabs button{flex:1;padding:14px 8px;border:0;background:none;white-space:normal}.creation-tabs [aria-current=page]{border-bottom:2px solid #171717;font-weight:700}.creation-grid{display:grid;gap:12px;grid-template-columns:1fr}.creation-grid article{min-width:0;overflow-wrap:anywhere}@media(min-width:800px){.creation-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

.backpack-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px}.backpack-items button{display:grid;gap:8px;min-width:0;padding:14px;overflow-wrap:anywhere}.backpack-items small{color:#777}#backpack-filter{display:flex;flex-wrap:wrap;gap:10px}#backpack-filter label{display:grid;gap:5px;min-width:0;flex:1}#backpack-filter input,#backpack-filter select{width:100%;min-width:0}
/* Source furniture names may be longer than their previous generic labels. */
.scene-items button{min-width:0;flex-wrap:wrap}.scene-items button img{flex-shrink:0}.scene-items button>span{flex:1;min-width:0;line-height:1.5;word-break:break-word}.scene-items button>small{max-width:100%;overflow-wrap:anywhere}.selection-floating>strong{display:block;max-width:100%;overflow-wrap:anywhere}

/* Held furniture tools: compact, one row, no title or information action. */
body[data-page=three] .selection.selection-floating{width:max-content;max-width:calc(100vw - 24px);padding:6px;border-radius:14px;box-shadow:0 4px 20px #00000018}
body[data-page=three] .selection.selection-floating>div{display:flex;gap:2px;margin:0}
body[data-page=three] .furniture-action[data-transform]{touch-action:none;user-select:none;cursor:grab}
body[data-page=three] .furniture-action.is-held{background:#252c22;color:#fff;cursor:grabbing;outline:none}

.creation-grid .library-card{overflow:hidden;padding:0 0 16px;border-radius:18px;background:#fff}
.library-card>h3,.library-card>p,.library-card>button{margin-left:16px;margin-right:16px}
.library-cover{display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:cover;background:#f1f2ee;margin:0 0 14px}
.library-cover.model-cover{object-fit:contain;padding:12px;box-sizing:border-box}
.library-cover.cover-empty{display:grid;place-items:center;color:#8a8e84;font-size:13px}
.cover-picker-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-height:60vh;overflow:auto}
.cover-picker-grid button{padding:3px;border:1px solid #dedfd8;border-radius:12px;overflow:hidden;background:#f4f4f0;min-width:0}
.cover-picker-grid button[aria-pressed=true]{border:2px solid #69765b}
.cover-picker-grid img{display:block;width:100%;aspect-ratio:1;object-fit:cover;border-radius:9px}
.cover-picker-grid span{display:block;padding:8px;font-size:12px}
