#threeDialog{position:fixed;inset:12px;margin:auto;width:calc(100vw - 24px);height:calc(100dvh - 24px);max-width:1800px;max-height:none;padding:0;border:1px solid #6597bb;border-radius:18px;background:#164a7c;color:#f2f7fc;overflow:hidden;box-shadow:0 24px 90px #001b3db3}
#threeDialog[open]{display:flex;flex-direction:column}#threeDialog::backdrop{background:#001726bb}#threeDialog *{box-sizing:border-box}#threeDialog button,#threeDialog select,#threeDialog .three-appearance-menu>summary{font-family:var(--draft-font,'Architects Daughter'),sans-serif;font-size:15px;color:#fff;border:1px solid #76a3c2;border-radius:10px;background:#245d92;padding:8px 12px;min-height:44px;cursor:pointer}#threeDialog button:focus-visible,#threeDialog select:focus-visible,#threeDialog .three-appearance-menu>summary:focus-visible{outline:3px solid #65e5ff;outline-offset:2px}#threeDialog button[aria-pressed=true]{background:#0085b8;border-color:#7de5ff}#threeDialog button:disabled{opacity:.5}#threeDialog h2{margin:0;font:26px var(--draft-font,'Architects Daughter'),sans-serif}#threeSummary{font-size:13px;color:#c6dcea}.three-header{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:12px 18px;border-bottom:1px solid #447ba7;flex:none}.three-tools{display:flex;flex-wrap:wrap;gap:8px 16px;padding:10px 18px;align-items:center;flex:none}.three-tools label{display:flex;align-items:center;gap:8px;font-family:var(--draft-font);font-size:15px}.three-tools select{max-width:200px}#threeCanvas{position:relative;flex:1;min-height:80px;background:#245f9f;touch-action:none;overflow:hidden}#threeCanvas canvas,#threeCanvas>svg{display:block;width:100%;height:100%;touch-action:none}.three-footer{padding:10px 18px;display:flex;gap:12px;justify-content:space-between;align-items:center;flex:none}.three-footer p{margin:0;font-size:13px;line-height:1.6;color:#d8e8f4}.three-footer small{color:#b5cddd}.three-camera{display:flex;gap:5px;flex-wrap:wrap}.three-camera button{min-width:44px;font-size:20px!important;padding:5px!important}#threeError:not([hidden]){position:absolute;inset:140px 20px 100px;display:flex;flex-direction:column;justify-content:center;align-items:center;background:#164a7c;padding:24px;text-align:center;border-radius:12px}#threeError p{max-width:500px;line-height:1.6}#open3DView{width:100%;min-height:48px;text-align:left;margin:6px 0 14px;background:#087fae;color:#fff;border:1px solid #67d9fa;border-radius:10px;padding:12px;font-family:var(--draft-font);font-size:18px}
@media(max-width:700px){#threeDialog{inset:0;width:100vw;height:100dvh;border-radius:0}.three-header{padding:8px 10px}.three-header h2{font-size:22px}.three-header button{font-size:12px!important;max-width:145px}.three-tools{padding:8px 10px;gap:6px}.three-tools label{font-size:12px}.three-tools select{max-width:125px}.three-tools button,#threeDialog select,#threeDialog .three-appearance-menu>summary{font-size:12px;min-height:40px;padding:6px 8px}.three-footer{padding:8px 10px;flex-direction:column;gap:6px}.three-footer p{font-size:11px;text-align:center}.three-camera{justify-content:center}.three-camera button{min-width:38px;min-height:42px!important}.three-header{padding-top:max(8px,env(safe-area-inset-top))}.three-footer{padding-bottom:max(8px,env(safe-area-inset-bottom))}}
@media(max-height:500px){.three-header{padding:5px 10px}.three-header h2{font-size:20px}.three-tools{padding:5px 10px}.three-footer p{display:none}.three-footer{padding:5px 10px}.three-camera{margin:auto}}

#threeCanvas{background:#245f9f linear-gradient(#092c6080,#092c6080);background-image:linear-gradient(#092c6080,#092c6080),url("assets/workspace-blueprint.jpg");background-size:cover;background-position:center}
#threeCanvas>svg{background:transparent!important}

.three-contents{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;gap:5px;padding:4px 6px;border:1px solid #7ac9e7;border-radius:10px;background:#123c61;color:#fff}
.three-contents>span{grid-column:1/-1;padding:0 2px;font-size:13px;color:#eefaff}
#threeDialog .three-contents button{min-height:36px;min-width:0;padding:4px 3px;font-size:13px;white-space:nowrap;background:#225a88;color:#fff;border:1px solid #77b4d3;border-radius:7px;font-weight:600}
#threeDialog .three-contents button[aria-pressed=true]{background:#e5f8ff;color:#083149;border-color:#fff}
#threeDialog .three-contents button:focus-visible{outline:3px solid #fff;outline-offset:2px}
@media(max-width:600px){.three-contents>span,#threeDialog .three-contents button{font-size:12px}}

.three-appearance-menu{position:relative;z-index:5}
.three-appearance-menu>summary{list-style:none;display:flex;align-items:center}
.three-appearance-menu>summary::-webkit-details-marker{display:none}
.three-appearance-menu .three-appearance-controls{position:absolute;top:calc(100% + 6px);right:0;width:min(360px,calc(100vw - 40px));padding:14px;background:var(--surface,#164a7c);border:1px solid #77b4d3;border-radius:14px;box-shadow:0 8px 30px #001b3d88;display:grid;grid-template-columns:1fr;gap:12px}
#threeAppearanceClose{justify-self:end}
.three-appearance-controls label{justify-content:space-between}
.three-appearance-controls select{max-width:190px}
#threeFloor{max-width:160px}

.three-appearance-menu .three-appearance-controls{left:0;right:auto;overflow-y:auto}#threeAppearanceClose{position:sticky;top:0;z-index:1}

#threeAppearanceStatus:empty{display:none}
.workflow-studio #threeAppearanceMenu>summary{font-family:var(--draft-font)!important;font-weight:700!important}
.three-tools,.three-camera{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
.three-tools>*{flex:0 0 auto;white-space:nowrap}
.three-appearance-menu .three-appearance-controls{position:fixed;top:0;left:0;z-index:8}
.three-camera{max-width:100%;justify-content:flex-start}

#threeCanvas{background:#343d46 radial-gradient(ellipse at 42% 36%,#566471,#28313b 82%)}
/* The camera controls float over the scene so the model uses the full viewport. */
html.workflow-studio #threeDialog{inset:0;width:100%;height:100dvh;max-width:none;border:0;border-radius:0;background:#102538}
#threeDialog .three-header{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);padding:10px clamp(8px,2vw,28px);gap:8px;background:#102538}
#threeDialog .three-brand,#threeDialog .three-tools{display:flex;align-items:center;gap:8px;padding:0;overflow:visible}
#threeDialog .three-brand img{width:32px;height:32px;object-fit:contain}
#threeDialog .three-heading{text-align:center;min-width:0}
#threeDialog .three-tools{justify-content:flex-end;background:none}
#threeDialog .three-header :is(button,select,summary),#threeDialog .three-camera button{background:linear-gradient(#294860,#122a40);border-color:#526d82;box-shadow:inset 0 1px #ffffff20,0 2px 5px #0005}
#threeDialog select {
 color-scheme:dark;
 color:#f5fbff;
}
#threeDialog select :is(option,optgroup) {
 background-color:#172b40;
 color:#f5fbff;
}
#threeDialog #threeFloor{width:66px}
#threeDialog .three-scene-tools{position:absolute;z-index:2;top:80px;right:clamp(8px,2vw,28px);display:flex;align-items:center;gap:10px}
#threeDialog :is(.three-projection,.three-camera){display:flex;gap:2px;padding:3px;border:1px solid #627b90;border-radius:14px;background:#172e43;box-shadow:0 4px 12px #07172860}
#threeDialog .three-projection button{background:transparent;border-color:transparent;min-height:36px}
#threeDialog .three-projection button[aria-pressed=true],#threeDialog #threePan[aria-pressed=true]{background:#1c556c;border-color:#2ad9fa}
#threeDialog .three-height-controls{display:flex;gap:5px;align-items:center}
#threeDialog #threeHeightLines{background:none;border:0;padding:3px}
#threeDialog #threeHeightToggle{position:relative;min-height:24px;width:43px;padding:0;border-radius:100px;background:#263a4d;border-color:#648092}
#threeHeightToggle::before{content:"";position:absolute;inset:3px auto 3px 3px;aspect-ratio:1;border-radius:50%;background:#eaf5ff}
#threeDialog #threeHeightToggle[aria-checked=true]{background:#10799c}
#threeHeightToggle[aria-checked=true]::before{left:auto;right:3px}
html.workflow-studio #threeDialog .three-footer{position:absolute;bottom:0;left:0;right:0;z-index:2;flex-direction:row;padding:10px clamp(8px,2vw,28px);background:transparent;pointer-events:none}
#threeDialog .three-camera{margin-left:auto;pointer-events:auto;border-color:transparent;box-shadow:none}
#threeDialog .three-camera button{min-height:38px;border-radius:10px}
#threeDialog #threeCanvas{background:radial-gradient(ellipse at 48% 38%,#566576,#293543 85%)}
@media(max-width:540px){
 #threeDialog .three-brand img,#threeDialog #threeClose span{display:none}
 #threeDialog .three-header{grid-template-columns:minmax(0,1fr) minmax(0,40%) minmax(0,1fr)}
 #threeDialog .three-header :is(button,select,summary){padding-inline:6px;min-height:36px}
 #threeDialog #threeFloor{width:45px}
 #threeDialog h2{font-size:19px}
 #threeDialog #threeSummary{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
 #threeDialog .three-footer p{display:none}
 #threeDialog .three-scene-tools{top:66px}
}
#threeDialog .three-header svg,#threeDialog .three-camera svg{width:20px;height:20px;display:block;flex:none;color:#fff}
#threeDialog :is(#threeClose,.three-camera button,#threeAppearanceMenu>summary){display:flex;align-items:center;justify-content:center;gap:7px}
#threeDialog .three-floor-picker{position:relative;display:flex;align-items:center;justify-content:center;gap:6px;min-width:60px;min-height:44px;padding:4px 8px;border:1px solid #526d82;border-radius:10px;background:linear-gradient(#294860,#122a40);box-shadow:inset 0 1px #ffffff20,0 2px 5px #0005;color:white}
#threeDialog .three-floor-picker:focus-within{outline:2px solid #65e5ff;outline-offset:2px}
#threeDialog .three-floor-picker #threeFloor{position:absolute;inset:0;width:100%;height:100%;opacity:0}
#threeDialog .three-floor-picker svg{width:16px;height:16px}
#threeDialog .three-camera button{padding:5px!important}
@media(max-width:540px){
 #threeDialog .three-brand img{display:block;width:24px;height:24px}
 #threeDialog .three-floor-picker{min-width:44px;min-height:36px;gap:3px;padding-inline:5px}
 #threeDialog #threeAppearanceMenu>summary{gap:4px}
 #threeDialog .three-header svg{width:16px;height:16px}
}
#threeDialog .three-scene-tools{position:relative;top:auto;right:auto;height:0;flex:none;justify-content:flex-end;align-items:flex-start;margin-inline:clamp(8px,2vw,28px);transform:translateY(8px);pointer-events:none}
#threeDialog .three-scene-tools>*{pointer-events:auto}
@media(max-width:480px){
 #threeDialog #threeAppearanceMenu>summary span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 #threeDialog #threeAppearanceMenu>summary{min-width:36px}
}

/* Keep view controls in the top toolbar, above the model. */
#threeDialog .three-scene-tools {
 height:auto;
 min-width:0;
 margin:0;
 padding:4px clamp(8px,2vw,28px) 8px;
 transform:none;
 align-items:center;
 pointer-events:auto;
 background:#172b40;
}
#threeDialog .three-scene-tools :is(.three-projection,.three-height-controls) {
 flex:none;
 white-space:nowrap;
}
@media(max-width:540px) {
 #threeDialog .three-scene-tools {gap:6px}
 #threeDialog .three-scene-tools button {font-size:12px}
}
#threeDialog .three-header .three-scene-tools { padding:0; background:none; }
@media(min-width:1050px) {
 #threeDialog .three-header { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto; }
 #threeDialog .three-heading { position:absolute; inset-inline:36%; pointer-events:none; }
 #threeDialog .three-tools { grid-column:3; }
}
@media(max-width:1049px) {
 #threeDialog .three-header .three-scene-tools { grid-column:1 / -1; justify-content:center; flex-wrap:wrap; }
}
#threeDialog .three-floor-picker {
 box-sizing:border-box;
 min-width:44px;
 min-height:44px;
 width:44px;
 padding:0;
 border-radius:50%;
 border:2px solid #5cf4ff;
 background:radial-gradient(circle,#09283d 48%,#074969 65%,#10bed7 85%,#061724);
 box-shadow:inset 0 0 4px #65f6ff,0 0 7px #24dfff8c;
}
#threeDialog .three-floor-picker svg { display:none; }
html[data-theme=light] #threeDialog .three-floor-picker {
 border-color:#155db7;
 background:radial-gradient(circle,#edf5ff 44%,#c5dffd 76%,#84b4ef);
 color:#172b40;
 box-shadow:0 0 5px #155db777;
}

@media(min-width:1200px) {
 #threeDialog .three-header {gap:16px}
 #threeDialog .three-header .three-tools {gap:14px}
 #threeDialog .three-header .three-scene-tools {gap:16px}
 #threeDialog .three-header .three-projection {gap:6px}
}
#threeDialog .three-camera {gap:8px}
