@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;650;700;800&display=swap');
:root{--ink:#111d2c;--muted:#5d6a76;--paper:#f8fafb;--line:#d7dfe5;--orange:#b74920;--accent:#ef7642;--panel:#fff;--soft:#eef2f5;font-family:Manrope,system-ui,-apple-system,sans-serif;color:var(--ink);font-synthesis:none}
*{box-sizing:border-box}body{margin:0;background:var(--paper)}button,input{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible{outline:3px solid var(--accent);outline-offset:3px}button{touch-action:manipulation}svg{display:block}.app{min-height:100svh;display:flex;flex-direction:column}.header{height:88px;padding:0 40px;display:flex;justify-content:space-between;align-items:center;background:var(--ink);color:#fff}.identity{display:flex;gap:15px;align-items:center}.identity>svg{color:var(--accent)}.identity b{font-size:24px;font-weight:800;letter-spacing:.05em}.brand-point{color:var(--accent)}.subbrand{display:block;font-size:11px;letter-spacing:.15em;font-weight:500;color:#bcc8d5;margin-top:3px}.demo-badge{font-size:12px;letter-spacing:.09em;color:#d9e0e9;padding:9px 13px;border:1px solid #536073;border-radius:3px}.app main{display:grid;grid-template-columns:minmax(0,1fr) 348px;flex:1;min-height:700px}.stage{position:relative;overflow:hidden;background:#e9eef1;min-height:700px;isolation:isolate}#viewer{position:absolute;inset:0;outline:none}#viewer canvas{display:block;width:100%;height:100%;touch-action:none}.stage-title{position:absolute;left:38px;top:31px;pointer-events:none}.eyebrow{font-size:11px;letter-spacing:.15em;font-weight:700;color:var(--muted)}.stage-title h1{font-size:clamp(24px,2.6vw,40px);font-weight:500;letter-spacing:-.05em;line-height:1.13;margin:12px 0 8px}.stage-title p{font-size:14px;margin:0;color:var(--muted)}.model-tag{position:absolute;left:38px;bottom:90px;display:flex;gap:10px;align-items:center;font-size:12px;color:#3d4e5d;pointer-events:none}.model-tag-line{height:1px;width:25px;background:var(--orange)}.view-tools{position:absolute;right:24px;top:30px;display:flex;gap:5px;flex-direction:column}.icon-button{height:38px;width:38px;border:1px solid #c7d2db;border-radius:50%;background:#ffffffdc;color:var(--ink);display:grid;place-items:center;box-shadow:0 2px 8px #17304508}.icon-button svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.icon-button:hover{background:#fff;border-color:#879bab}.stage-bottom{position:absolute;left:38px;right:25px;bottom:26px;display:flex;align-items:center;justify-content:space-between;gap:15px}.gesture-hint{font-size:12px;color:#455668;max-width:290px}.dimension-button{font-size:13px;min-height:40px;padding:9px 15px;background:#ffffffdc;border:1px solid #c3d0d9;color:var(--ink);border-radius:4px}.dimension-button[aria-pressed=true]{color:#fff;background:var(--ink);border-color:var(--ink)}.control-panel{padding:30px 28px 23px;background:var(--panel);border-left:1px solid var(--line);display:flex;flex-direction:column;gap:21px}.panel-heading{display:flex;justify-content:space-between;align-items:center}.technical-label{font-size:13px;font-weight:600;color:#8a969f}.mode-tabs{display:grid;grid-template-columns:repeat(3,1fr);padding:4px;background:var(--soft);border-radius:6px;gap:2px}.mode-tabs button{border:0;padding:11px 6px;border-radius:4px;background:transparent;font-size:14px;font-weight:600;color:#566877}.mode-tabs button[aria-pressed=true]{background:var(--ink);color:#fff}.panel-intro h2{font-size:25px;font-weight:500;line-height:1.25;letter-spacing:-.04em;margin:0 0 9px}.panel-intro p{font-size:14px;line-height:1.65;margin:0;color:var(--muted)}.slider-heading{display:flex;justify-content:space-between;align-items:center;font-size:14px;margin-bottom:11px}.slider-heading output{font-size:13px;color:var(--orange);font-variant-numeric:tabular-nums;font-weight:700}input[type=range]{accent-color:var(--orange);width:100%;height:25px;margin:0 0 12px;cursor:pointer}.layer-list{display:flex;flex-direction:column;gap:0;border-top:1px solid var(--line)}.layer-row{display:flex;align-items:center;min-height:45px;border-bottom:1px solid #e5eaee;gap:8px}.layer-select{display:flex;align-items:center;gap:11px;flex:1;padding:10px 0;min-width:0;text-align:left;background:transparent;border:0;color:var(--ink);font-size:14px}.layer-index{color:#7a8791;font-size:11px;min-width:16px}.swatch{width:10px;height:20px;border-radius:2px;flex:none}.layer-title{flex:1}.layer-select[aria-pressed=true] .layer-title{font-weight:700;color:var(--orange)}.visibility{height:35px;min-width:35px;background:transparent;border:0;display:grid;place-items:center;color:#718392}.visibility svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5}.visibility[aria-pressed=false]{color:#a6afb7}.visibility[aria-pressed=false] svg{opacity:.4}.layer-row.is-hidden .layer-select{opacity:.45}.selected-layer{border-left:2px solid var(--accent);padding:3px 0 3px 15px}.selected-layer h3{margin:7px 0 6px;font-size:16px;font-weight:600}.selected-layer p{font-size:13px;line-height:1.65;color:var(--muted);margin:0}.panel-bottom{margin-top:auto;display:flex;gap:10px;padding-top:15px;border-top:1px solid var(--line)}.panel-bottom p{font-size:12px;line-height:1.6;color:#626f7a;margin:0}.demo-square{height:8px;width:8px;background:var(--accent);flex:none;margin-top:5px}.app footer{height:42px;display:flex;align-items:center;justify-content:space-between;padding:0 40px;border-top:1px solid var(--line);font-size:10px;letter-spacing:.1em;color:#62717e;background:var(--paper)}.loading{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:14px;display:flex;align-items:center;gap:12px;background:#ffffffed;padding:16px 20px;border-radius:6px;white-space:nowrap}.loading-mark{display:block;width:18px;height:18px;border:2px solid #dae1e6;border-top-color:var(--orange);border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}[hidden]{display:none!important}.fallback{position:absolute;inset:200px 10% auto;background:#fff;border:1px solid var(--line);padding:25px;border-radius:6px}.fallback h2{font-size:20px}.fallback p{font-size:16px;line-height:1.6}.dimension-label{color:#253c50;font:600 12px Manrope,system-ui;background:#ffffffed;border:1px solid #cad4dc;padding:4px 8px;border-radius:3px;white-space:nowrap;pointer-events:none}.layer-pin{color:var(--ink);font:600 12px Manrope,system-ui;background:#ffffffef;border:1px solid #cbd7df;padding:5px 9px;border-radius:3px;white-space:nowrap;pointer-events:none}
@media(min-width:1600px){.app main{grid-template-columns:minmax(0,1fr) 390px}.control-panel{padding:35px}}
@media(max-width:1000px) and (min-width:701px){.app main{grid-template-columns:minmax(0,1fr) 305px}.control-panel{padding:25px 22px;gap:18px}.stage-title{left:25px}.stage-title h1{font-size:28px}.stage-bottom{left:25px}.gesture-hint{max-width:190px}}
@media(max-width:700px){.header{height:69px;padding:0 20px;flex:none}.identity{gap:10px}.identity b{font-size:21px}.identity>svg{width:25px;height:29px}.subbrand{font-size:9px;letter-spacing:.12em}.demo-badge{font-size:9px;padding:7px 8px;letter-spacing:.04em}.app main{display:flex;flex-direction:column;min-height:0}.stage{min-height:430px;height:54svh;max-height:580px;flex:none}.stage-title{left:21px;top:21px}.stage-title h1{font-size:28px;margin:8px 0 6px}.stage-title p{font-size:13px;max-width:235px}.stage-title .eyebrow{font-size:10px}.view-tools{top:20px;right:15px;gap:6px}.icon-button{width:35px;height:35px}.model-tag{left:21px;bottom:68px;font-size:11px}.stage-bottom{left:21px;right:17px;bottom:17px;gap:10px}.gesture-hint{max-width:210px;font-size:11px;line-height:1.6}.dimension-button{font-size:12px;padding:8px 10px;min-height:37px}.control-panel{border-left:0;border-top:1px solid var(--line);padding:19px 21px 22px;gap:18px}.panel-heading{display:none}.mode-tabs{order:-1}.mode-tabs button{min-height:42px;padding:10px;font-size:14px}.panel-intro h2{font-size:21px;margin:0 0 7px}.panel-intro h2 br{display:none}.panel-intro p{font-size:14px;line-height:1.55}.layer-workspace{display:block}.app[data-mode=building] .layer-workspace{display:none}.layer-list{display:grid;grid-template-columns:1fr 1fr;column-gap:18px}.layer-row{min-height:47px}.layer-select{gap:7px;font-size:13px}.layer-index{display:none}.visibility{min-width:28px;padding:0}.swatch{width:8px;height:17px}.selected-layer p{font-size:14px}.panel-bottom{padding-top:13px}.panel-bottom p{font-size:12px}.app footer{height:auto;min-height:41px;padding:13px 21px;font-size:9px}.app footer span:last-child{display:none}.fallback{inset:145px 20px auto}.layer-pin{font-size:11px;padding:4px 7px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

.stage{background:#e8e5df}.facade-views{display:flex;gap:8px}.facade-views button{flex:1;min-height:38px;border:1px solid var(--line);background:#fff;border-radius:4px;font-size:12px;color:var(--ink)}.facade-views button:hover{border-color:var(--orange)}.source-link{font-size:12px;color:#795138;text-underline-offset:3px}.app main{min-height:780px}.control-panel{gap:17px}.layer-row{min-height:39px}.layer-select{font-size:13px;padding:8px 0}.stage-title{z-index:2}.layer-pin{font-size:10px;padding:3px 6px}@media(max-width:700px){.app main{min-height:0}.stage{height:57svh;min-height:445px}.facade-views{margin-top:-6px}.stage-title h1{font-size:26px}.demo-badge{font-size:10px}.layer-list{grid-template-columns:1fr}.layer-index{display:block}.layer-row{min-height:44px}.layer-select{font-size:14px}.visibility{min-width:38px}}

.control-panel .selected-layer{min-height:85px}.panel-intro h2{font-size:23px}.app[data-mode=building] .panel-intro h2{font-size:22px}
.engineering{padding:48px 40px;background:#f3f5f3;border-top:1px solid var(--line)}.engineering-head{max-width:790px;margin-bottom:30px}.engineering h2{font-size:32px;font-weight:500;letter-spacing:-.04em;margin:12px 0}.engineering h3{font-size:21px;font-weight:600;letter-spacing:-.025em;margin:0 0 14px}.engineering p{font-size:14px;line-height:1.7;color:#52616c}.engineering-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(260px,.7fr);gap:30px}.planner-controls{display:flex;gap:12px;align-items:end;flex-wrap:wrap}.planner-controls label,.sheet-label{display:flex;flex-direction:column;gap:7px;font-size:12px;color:#3e5460;flex:1;min-width:95px}.planner-controls input,.planner-controls select,.sheet-label select{width:100%;padding:10px;border:1px solid #b6c5c9;border-radius:4px;background:white;color:#253843;font:inherit;min-height:43px}.planner-controls button,.export-controls button{padding:11px 14px;background:white;border:1px solid #9badb7;border-radius:4px;font-size:13px;color:#203b4b;min-height:43px}.planner-controls button:hover,.export-controls button:hover{border-color:var(--orange)}.layout-drawing{background:#fff;border:1px solid var(--line);padding:18px;overflow:auto}.layout-drawing svg{display:block;width:100%;min-width:780px}.layout-drawing text{font-family:system-ui}.layout-drawing [data-part]{cursor:pointer}.layout-drawing [data-part]:hover rect,.layout-drawing [data-part]:focus rect{fill:#efb565;stroke:#714f28;stroke-width:22px;outline:none}.layout-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;padding:20px 0}.layout-metrics b{display:block;font-size:26px;letter-spacing:-.04em;font-weight:600}.layout-metrics span{display:block;font-size:12px;color:#5a6c75}.part-info{background:#fff;border-left:3px solid var(--accent);padding:15px;font-size:14px;line-height:1.7;min-height:60px}.part-info p{margin:5px 0}.engineering p.scope{font-size:12px;line-height:1.7;color:#596e77}.engineering-warning{padding:13px 16px;background:#f7e9df;border:1px solid #e5c2a9;color:#68472e!important}.export-controls{display:flex;gap:8px;flex-wrap:wrap}.cut-column{background:#fff;padding:25px;border:1px solid var(--line)}.sheet-drawing{margin:20px auto;max-width:235px}.sheet-drawing svg{width:100%;max-height:600px}.secondary{margin-top:38px;padding-top:35px;border-top:1px solid #c8d4d7;grid-template-columns:1fr 1fr}.sequence{font-size:14px;line-height:1.8;padding-left:20px;color:#3e5765}.sequence li{margin-bottom:9px}.quantities{margin-top:28px;border:1px solid #cbd6d9;background:white;padding:18px 22px}.quantities summary{cursor:pointer;font-size:16px;font-weight:600}.quantities table{width:100%;border-collapse:collapse;font-size:13px}.quantities th,.quantities td{padding:12px;text-align:left;border-bottom:1px solid #e1e7e7}.quantities th{color:#4d6772;font-size:12px}.quantities td:nth-child(2){white-space:nowrap}.quantities td:last-child{color:#597583;font-size:12px}#engineering-status{font-size:12px;color:#617a86;margin-top:20px}
@media(max-width:950px){.engineering{padding:32px 22px}.engineering-grid{grid-template-columns:1fr}.cut-column{display:grid;grid-template-columns:1fr 220px;gap:15px}.cut-column .sheet-drawing{grid-column:2;grid-row:1/6;margin:0}.secondary{gap:26px}.layout-drawing svg{min-width:1000px}.layout-metrics{grid-template-columns:1fr 1fr}.engineering h2{font-size:27px}.quantities{overflow:auto;padding:15px}.planner-controls{gap:9px}}
@media(max-width:550px){.cut-column{display:block;padding:20px}.sheet-drawing{max-width:200px}.planner-controls label{min-width:90px}.layout-metrics b{font-size:24px}.quantities th,.quantities td{padding:10px 6px}.quantities td:first-child{min-width:170px}.engineering-grid{gap:24px}}
.mode-tabs{grid-template-columns:repeat(5,1fr)}.mode-tabs button{font-size:12px;padding:10px 3px}.app[data-mode=roof] .layer-workspace,.app[data-mode=plinth] .layer-workspace{display:block}@media(max-width:700px){.mode-tabs button{font-size:13px;padding:9px 4px}}
/* Grid children must shrink independently from the scrollable drawing canvas. */
.engineering,.engineering-grid>*,.cut-column{min-width:0;max-width:100%}
.interface-section img{display:block}
.export-controls a{padding:11px 14px;border:1px solid #9badb7;border-radius:4px;color:#203b4b;text-decoration:none;font-size:13px}
.app[data-mode=plinth] .stage-title,.app[data-mode=detail] .stage-title{background:#f8fafbea;padding:12px 16px;border-left:2px solid var(--accent);max-width:calc(100% - 100px)}
@media(max-width:950px){.engineering-grid{grid-template-columns:minmax(0,1fr)}.cut-column{grid-template-columns:minmax(0,1fr) 220px}}
@media(max-width:550px){.cut-column{display:block}}
.operation-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));gap:12px;margin:16px 0}.operation-card{margin:0;min-width:0}.operation-card label{display:flex;align-items:center;gap:9px;flex-wrap:wrap;font-size:14px}.operation-card input[type=number]{max-width:100%;width:130px;min-height:42px;border:1px solid #b8c7c9;border-radius:6px;padding:8px;background:white}.operation-card input[type=checkbox]{width:20px;height:20px;flex-shrink:0}.operation-card p{font-size:13px}.quantities table{overflow-wrap:anywhere}

/* Visual workspace: building first; calculations are an explicit secondary drawer. */
.app main{flex:none;min-height:0;height:calc(100svh - 124px);grid-template-columns:minmax(0,1fr) 310px}.stage{min-height:560px}.control-panel{padding:24px 22px;overflow:auto;gap:14px}.header{height:72px;padding:0 26px}.header-actions{display:flex;align-items:center;gap:16px}.header-actions button{background:transparent;color:#e6edf2;border:1px solid #72818b;border-radius:5px;padding:10px 14px;font-size:12px}.panel-heading,.panel-intro h2,.panel-bottom,.source-link{display:none}.panel-intro p{margin:0;font-size:12px}.facade-views{display:grid;grid-template-columns:1fr 1fr;gap:6px}.facade-views button{min-height:42px}.app[data-mode=building] .layer-workspace{display:none}.selected-layer{margin-top:0;border-left:2px solid var(--accent);padding:12px}.stage-title{top:22px;left:26px}.stage-title h1{font-size:26px}.stage-title p{font-size:12px}.stage-bottom{left:26px}.model-tag{left:26px}.stage{background:#e4e9ec}.app footer{display:none}#engineering-drawer{background:white;border-top:1px solid var(--line)}#engineering-drawer>summary{padding:18px 26px;cursor:pointer;display:flex;justify-content:space-between;font-size:13px;font-weight:600;list-style:none}#engineering-drawer>summary span{font-weight:400;color:var(--muted)}#engineering-drawer[open]>summary{position:sticky;top:0;z-index:4;background:#fff}.engineering{padding:30px 26px}.mode-tabs button{min-height:42px}
@media(max-width:700px){.header{height:60px;padding:0 16px}.subbrand,.demo-badge{display:none}.identity b{font-size:19px}.header-actions button{padding:8px;font-size:11px}.app main{height:auto;display:flex}.stage{height:66svh;min-height:430px;max-height:none}.control-panel{padding:14px 16px;gap:10px;overflow:visible}.mode-tabs{width:100%;order:-1}.facade-views{grid-template-columns:repeat(4,1fr)}.facade-views button{font-size:10px;padding:6px 2px}.panel-intro{display:none}.selected-layer{min-height:0!important;padding:8px 12px}.selected-layer h3{margin:5px 0;font-size:14px}.selected-layer p{font-size:12px;line-height:1.5}.stage-title{left:16px;top:16px}.stage-title h1{font-size:23px}.stage-title p{max-width:210px;font-size:11px}.stage-title .eyebrow{font-size:9px}.view-tools{right:12px;top:18px}.stage-bottom{left:16px;right:12px}.model-tag{left:16px;font-size:10px}.layer-list{grid-template-columns:1fr 1fr;column-gap:16px}.layer-select{font-size:12px}.layer-index{display:none}.layer-row{min-height:40px}.visibility{min-width:28px}#engineering-drawer>summary{padding:18px 16px;font-size:12px}}

#focus-component{padding:10px 12px;min-height:42px;border:1px solid #be6d47;background:#fff4ec;color:#724321;border-radius:5px;font-size:12px}

/* A model is the reading surface: small persistent labels never cover a junction. */
.stage-title{max-width:calc(100% - 94px)}
.app[data-mode="detail"] .stage-title,.app[data-mode="roof"] .stage-title,.app[data-mode="plinth"] .stage-title{background:#ffffffed;border-left:2px solid var(--accent);padding:9px 13px;max-width:260px}
.app[data-mode="detail"] .stage-title h1,.app[data-mode="roof"] .stage-title h1,.app[data-mode="plinth"] .stage-title h1{font-size:20px;margin:0;letter-spacing:-.03em}
.app[data-mode="detail"] .stage-title p,.app[data-mode="roof"] .stage-title p,.app[data-mode="plinth"] .stage-title p,.app[data-mode="detail"] .stage-title .eyebrow,.app[data-mode="roof"] .stage-title .eyebrow,.app[data-mode="plinth"] .stage-title .eyebrow{display:none}
@media(max-width:700px){
 .stage-title{background:#ffffffeb!important;padding:7px 10px!important;border:0!important;max-width:calc(100% - 85px)!important;border-radius:4px}
 .stage-title h1{font-size:18px!important;margin:0!important;letter-spacing:-.02em!important}
 .stage-title p,.stage-title .eyebrow,.gesture-hint,.model-tag{display:none!important}
 .stage-bottom{left:auto;bottom:12px;right:12px}
}
.reveal-controls[hidden]{display:none}.reveal-controls>div{display:flex;gap:6px}.reveal-controls button{flex:1;padding:10px 8px;border:1px solid var(--line);border-radius:4px;background:var(--paper);font-size:13px;color:var(--ink)}.reveal-controls button[aria-pressed=true]{background:var(--ink);color:#fff}.reveal-controls>a{display:inline-block;margin-top:8px;font-size:12px;color:var(--orange)}

#glazing-inspection{display:block;width:100%;margin-top:8px}

/* A small readable title also survives manual zoom against dark geometry. */
.stage-title{background:#fffffff2;border:1px solid #d4dde2;border-radius:5px;padding:8px 12px;max-width:calc(100% - 110px);box-shadow:0 2px 8px #17304512}
.stage-title h1{font-size:18px;line-height:1.3;margin:0;letter-spacing:-.025em;color:var(--ink)}
.stage-title :is(.eyebrow,p),.gesture-hint{display:none}
.model-tag{background:#fffffff2;border:1px solid #d4dde2;border-radius:5px;padding:8px 12px;color:var(--ink)}
.app[data-view="component"] .model-tag{display:none}

.presentation-frames{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.presentation-frames a{display:block;color:var(--ink);text-decoration:none;border:1px solid var(--line);border-radius:5px;overflow:hidden}
.presentation-frames figure{margin:0}.presentation-frames img{display:block;width:100%;height:auto}.presentation-frames figcaption{padding:12px 14px;font-size:13px}
@media(max-width:700px){.presentation-frames{grid-template-columns:1fr;gap:12px}}

.material-samples{display:flex;flex-wrap:wrap;gap:24px}.material-samples figure{margin:0 0 20px}.material-samples img,.rr23-sample{width:140px;height:105px;display:block;object-fit:cover;border:1px solid #aab6bc}.rr23-sample{background:#434a50}.material-samples figcaption{margin-top:8px;font-size:13px}.quantities td small{display:block;color:#60717c;margin-top:6px}

.layer-pin{max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:5px;pointer-events:none}

/* Shared architectural palette. Model, dimensions and presentation use these tokens. */
:root {
 --ink:#edf2f4; --muted:#b5c2cb; --paper:#111b24; --panel:#1b2a35;
 --soft:#273d49; --line:#4a606f; --orange:#e7ad7d; --accent:#8ac7b7;
 --radius:12px; --overlay:#1b2c38f2; --overlay-line:#536b7b;
 --shadow:0 5px 20px #07111b55;
}
body { background:var(--paper); -webkit-font-smoothing:antialiased; }
button,input,select,a { -webkit-tap-highlight-color:transparent; }
button { transition:background-color .15s,color .15s,border-color .15s; }
button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible,summary:focus-visible {
 outline:3px solid var(--accent); outline-offset:3px;
}
.header { height:76px; padding:0 28px; background:var(--panel); color:var(--ink); border-bottom:1px solid var(--line); gap:16px; }
.identity { gap:11px; flex-shrink:0; }
.identity b { font-size:22px; font-weight:800; letter-spacing:.025em; }
.identity>svg { width:26px; height:30px; color:var(--orange); }
.brand-point { color:var(--orange); }
.subbrand { color:var(--muted); font-size:9px; letter-spacing:.14em; margin-top:3px; }
.header-actions { gap:16px; min-width:0; }
.header-actions button { min-height:44px; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); color:var(--ink); padding:10px 16px; font-weight:650; font-size:13px; }
.header-actions button:hover { background:var(--soft); border-color:var(--accent); }
.header-actions button[aria-pressed=true] { background:var(--ink); border-color:var(--ink); color:var(--panel); }
.demo-badge { padding:0; border:0; color:var(--muted); font-size:11px; letter-spacing:.1em; }
.app main { height:calc(100svh - 76px); min-height:540px; padding:16px; gap:16px; grid-template-columns:minmax(0,1fr) 340px; }
.stage { min-height:0; border:1px solid var(--line); border-radius:18px; background:#243845; }
.control-panel { min-width:0; padding:20px; gap:20px; background:var(--panel); border:1px solid var(--line); border-radius:18px; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#b7c4b3 transparent; }
.panel-heading { display:flex; align-items:center; justify-content:space-between; }
.eyebrow { font-size:10px; font-weight:750; letter-spacing:.1em; color:var(--muted); }
.technical-label { color:var(--accent); font-size:11px; font-weight:700; padding:4px 7px; border:1px solid var(--line); border-radius:6px; }
.stage-title { left:20px; top:20px; max-width:calc(100% - 98px); padding:11px 14px; border:1px solid var(--overlay-line); border-radius:var(--radius); background:var(--overlay); box-shadow:var(--shadow); }
.stage-title .eyebrow,.stage-title p { display:none; }
.stage-title h1 { margin:0; font-size:16px; font-weight:700; line-height:1.35; letter-spacing:-.02em; color:var(--ink); }
.model-tag { left:20px; bottom:84px; max-width:calc(100% - 98px); padding:8px 11px; border:1px solid var(--overlay-line); border-radius:9px; background:var(--overlay); color:var(--muted); font-size:11px; line-height:1.5; }
.model-tag:has(span:empty) { display:none; }
.model-tag-line { width:18px; background:var(--orange); }
.view-tools { right:16px; top:20px; gap:3px; padding:5px; border:1px solid var(--overlay-line); border-radius:16px; background:var(--overlay); box-shadow:var(--shadow); }
.icon-button { width:44px; height:44px; border:0; border-radius:10px; box-shadow:none; background:transparent; color:var(--ink); }
.icon-button svg { width:20px; height:20px; stroke-width:1.7; }
.icon-button:hover { background:var(--soft); }
#zoom-in { border-top:1px solid var(--line); border-radius:0 0 10px 10px; }
#home-view { border-top:1px solid var(--line); border-radius:0 0 10px 10px; }
.stage-bottom { left:20px; right:20px; bottom:20px; gap:8px; justify-content:flex-start; flex-wrap:wrap; }
.dimension-button { min-height:46px; padding:11px 16px; border:1px solid var(--overlay-line); border-radius:var(--radius); background:var(--overlay); color:var(--ink); font-size:13px; font-weight:650; box-shadow:var(--shadow); }
.dimension-button:hover { background:var(--panel); border-color:var(--accent); }
.dimension-button[aria-pressed=true] { color:var(--panel); background:var(--accent); border-color:var(--accent); }
.gesture-hint { display:none; }
.mode-tabs { flex:none; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:4px; gap:3px; border:1px solid var(--line); border-radius:14px; background:var(--soft); }
.mode-tabs button { min-height:44px; padding:10px 3px; border:0; border-radius:10px; color:var(--muted); background:transparent; font-size:13px; font-weight:650; line-height:1.2; }
.mode-tabs button:hover { background:var(--soft); color:var(--ink); }
.mode-tabs button[aria-pressed=true] { background:var(--accent); color:var(--panel); box-shadow:0 2px 4px #253b3312; }
.panel-intro { display:block; }
.panel-intro p { margin:0; font-size:13px; line-height:1.65; color:var(--muted); }
.selected-layer { padding:16px!important; min-height:0!important; border:1px solid var(--line); border-radius:var(--radius); background:var(--paper); }
.selected-layer .eyebrow { font-size:10px; line-height:1.6; letter-spacing:.06em; color:var(--orange); overflow-wrap:anywhere; }
.selected-layer h3 { margin:7px 0 8px; font-size:17px; font-weight:700; line-height:1.4; letter-spacing:-.025em; }
.selected-layer p { margin:0; font-size:13px; line-height:1.65; color:var(--muted); overflow-wrap:anywhere; }
.selection-actions { display:flex; flex-wrap:wrap; gap:8px; }
.selection-actions:empty,.selection-actions:not(:has(button:not([hidden]))) { display:none; }
.selection-actions button,#selected-svg-export,#selected-drawing-return { min-height:44px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--ink); font-size:13px; font-weight:650; text-align:left; }
.selection-actions button:hover,#selected-svg-export:hover,#selected-drawing-return:hover { background:var(--soft); }
#focus-component { background:var(--accent); border-color:var(--accent); color:var(--panel); }
#focus-component:hover { background:var(--ink); border-color:var(--ink); }
.slider-heading { font-size:14px; font-weight:650; line-height:1.4; margin-bottom:4px; gap:12px; }
.slider-heading output { min-width:3ch; font-size:13px; color:var(--accent); }
#explode { width:100%; height:44px; min-height:44px; margin:0 0 10px; accent-color:var(--accent); }
.layer-list { border:0; gap:5px; }
.layer-row { min-height:48px; gap:6px; padding:0 7px; border:1px solid transparent; border-radius:10px; }
.layer-row:hover { background:var(--paper); }
.layer-row:has(.layer-select[aria-pressed=true]) { border-color:var(--accent); background:var(--soft); }
.layer-select { min-height:44px; padding:8px 0; gap:9px; font-size:13px; line-height:1.45; }
.layer-select[aria-pressed=true] .layer-title { color:var(--ink); }
.layer-title { overflow-wrap:anywhere; }
.layer-index { min-width:14px; font-size:10px; color:var(--muted); }
.swatch { height:20px; width:7px; border-radius:3px; }
.visibility { height:44px; min-width:44px; border-radius:8px; color:var(--muted); }
.visibility:hover { background:var(--soft); }
.visibility svg { width:19px; height:19px; }
.layer-pin,.dimension-label { border-color:var(--overlay-line); border-radius:8px; background:var(--overlay); color:var(--ink); box-shadow:var(--shadow); }
.layer-pin { font-size:12px; padding:6px 9px; }
.loading,.fallback { color:var(--ink); background:var(--panel); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow); }
.loading-mark { border-color:var(--line); border-top-color:var(--accent); }
.reveal-controls { padding:0; }
.reveal-controls>div { gap:6px; }
.reveal-controls button { min-height:44px; padding:10px 8px; border-radius:10px; font-size:13px; font-weight:650; background:var(--paper); }
.reveal-controls button[aria-pressed=true] { background:var(--accent); }
#glazing-inspection { width:100%; margin-top:6px; }
.reveal-controls>a { color:var(--muted); font-size:12px; text-underline-offset:3px; }
.navigation-guide { margin-top:auto; padding-top:18px; border-top:1px solid var(--line); color:var(--muted); }
.navigation-guide p { font-size:12px; line-height:1.65; margin:8px 0 12px; }
.desktop-keys { display:flex; flex-wrap:wrap; gap:10px 16px; font-size:11px; }
.desktop-keys>span { display:flex; align-items:center; gap:4px; }
kbd { display:inline-grid; place-items:center; min-width:21px; height:24px; padding:0 4px; border:1px solid #b8c5b4; border-bottom-width:2px; border-radius:5px; background:var(--paper); color:var(--ink); font:600 10px Manrope,system-ui,sans-serif; }
.mobile-guide { display:none; }
#engineering-drawer{background:var(--paper);border-top:1px solid var(--line)}#engineering-drawer:not([open]){border:0}.engineering{background:var(--paper);padding:36px 28px}.engineering-head{max-width:750px;margin-bottom:24px}.engineering h2{font-size:28px;font-weight:600;line-height:1.25;letter-spacing:-.03em}.engineering h3{font-size:19px}.engineering p{font-size:13px;color:var(--muted)}.engineering .eyebrow{letter-spacing:.09em;color:var(--orange)}.engineering-grid{gap:24px}.cut-column,.part-info,.layout-drawing,.quantities,.house-facade{border-radius:var(--radius);border-color:var(--line);background:var(--panel)}.part-info{border:1px solid var(--line);padding:16px}.planner-controls input,.planner-controls select,.sheet-label select,.planner-controls button,.export-controls button,.house-controls button,.house-controls input,.house-controls select{min-height:44px;border-color:var(--line);border-radius:9px;background:var(--panel);color:var(--ink);font-size:12px}.layout-metrics b{font-size:24px;color:var(--ink)}.layout-metrics span{color:var(--muted)}.engineering-warning{border:1px solid #dbbaa1;border-radius:10px;background:#f4e8dc;color:#68482e!important;font-size:12px!important}.quantities{padding:16px;margin:20px 0}.quantities summary{min-height:32px;line-height:1.5;font-size:13px}.engineering table{font-size:12px}.engineering a{color:var(--orange);text-underline-offset:3px}.engineering .scope{font-size:12px}.selected-drawing{border-top:0}.selected-drawing-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(260px,.7fr);gap:24px;align-items:start}.selected-part-svg{padding:20px;border:1px solid var(--line);border-radius:16px;background:var(--panel);max-height:650px;display:flex;justify-content:center}.selected-part-svg svg{width:100%;height:auto;max-height:600px}.selected-drawing-info dl{margin:0 0 16px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:4px 16px}.selected-drawing-info dl>div{display:flex;align-items:baseline;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--line)}.selected-drawing-info dl>div:last-child{border:0}.selected-drawing-info dt{font-size:12px;color:var(--muted)}.selected-drawing-info dd{margin:0;font-size:13px;font-weight:650;text-align:right}.selected-drawing-info button{margin:0 6px 8px 0}

@media(min-width:1600px) { .app main { grid-template-columns:minmax(0,1fr) 364px; } .control-panel { padding:24px; } }
@media(max-width:1000px) and (min-width:701px) { .app main { padding:12px; gap:12px; grid-template-columns:minmax(0,1fr) 300px; } .control-panel { padding:16px; gap:16px; } .header { padding:0 20px; } .demo-badge { display:none; } }
@media(max-width:700px) {
 .header { height:64px; padding:0 16px; gap:10px; }
 .identity { gap:8px; } .identity b { font-size:18px; } .identity>svg { display:block; width:22px; height:26px; }
 .subbrand,.demo-badge { display:none; } .header-actions { gap:0!important; }
 .header-actions button { min-height:44px!important; padding:9px 12px; font-size:11px; line-height:1.3; }
 .app main { display:flex; flex-direction:column; height:auto; min-height:0; padding:10px; gap:10px; }
 .stage { height:62svh; min-height:360px; max-height:680px; border-radius:16px; }
 .control-panel { padding:14px; gap:16px; border:1px solid var(--line); border-radius:16px; overflow:visible; }
 .panel-heading,.panel-intro { display:none; }
 .mode-tabs { order:-1; width:100%; } .mode-tabs button { font-size:13px; min-height:44px; padding:10px 3px; }
 .stage-title { top:12px; left:12px; padding:9px 12px!important; border:1px solid var(--overlay-line)!important; border-radius:10px; background:var(--overlay)!important; max-width:calc(100% - 88px)!important; }
 .stage-title h1 { font-size:15px!important; }
 .view-tools { right:10px; top:12px; padding:4px; gap:2px; border-radius:14px; }
 .icon-button { width:44px; height:44px; }
 .stage-bottom { left:12px; right:12px; bottom:12px; gap:8px; }
 .dimension-button { min-height:44px; padding:10px 13px; font-size:12px; border-radius:10px; }
 .model-tag { left:12px; bottom:70px; font-size:11px; padding:7px 9px; }
 .layer-list { display:grid; grid-template-columns:1fr; gap:5px; }
 .layer-row { padding:0 9px; } .layer-select { font-size:14px; } .layer-index { display:block; }
 .visibility { min-width:44px; }
 .selected-layer { padding:14px!important; } .selected-layer h3 { font-size:16px; } .selected-layer p { font-size:13px; }
 .selection-actions button { flex:1; font-size:12px; }
 .navigation-guide { padding-top:14px; } .navigation-guide p { margin-bottom:6px; }
 .desktop-keys { display:none; } .mobile-guide { display:block; }
 .engineering { padding:24px 16px; } .engineering h2 { font-size:24px; }
 .engineering-grid,.selected-drawing-grid { grid-template-columns:1fr; gap:16px; }
 .layout-drawing,.selected-part-svg { padding:12px; }
 .selected-part-svg { max-height:520px; } .selected-part-svg svg { max-height:480px; }
 .selected-drawing-info dl>div { padding:10px 0; }
 .layout-metrics { grid-template-columns:repeat(2,1fr); gap:16px; }
}
@media(max-width:360px) { .header { padding:0 12px; } .identity b { font-size:16px; } .header-actions button { padding:9px 10px; } .control-panel { padding:10px; } .mode-tabs button { font-size:12px; } }
.selected-drawing .engineering-head>#selected-drawing-return { display:block; margin-bottom:16px; }

/* Dimensions remain a readable source list when the camera or screen cannot
   accommodate every label. Controls stay within the stage in fullscreen. */
/* Dimension controls are docked beside/below the canvas, never over it. */
.dimension-review{position:static;width:100%;padding:12px;background:var(--panel);border:1px solid var(--line);border-radius:12px;color:var(--ink);font-size:13px}
.dimension-head{display:flex;gap:8px}.dimension-face-label{flex:1;min-width:0}.dimension-face-label select{width:100%;min-height:44px;border:1px solid var(--line);border-radius:8px;padding:8px;background:var(--paper);color:var(--ink);font:inherit}
#dimension-close{width:44px;min-height:44px;padding:0;font-size:24px;line-height:1;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink)}
.dimension-scopes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin-top:8px}.dimension-scopes button{min-height:44px;border:0;border-radius:8px;background:var(--soft);color:var(--ink);font-size:12px}.dimension-scopes button[aria-pressed=true]{background:var(--accent);color:var(--panel)}.dimension-scopes button:disabled{opacity:.45;cursor:default}
#dimension-context{font-size:12px;line-height:1.4;margin:10px 0;overflow-wrap:anywhere}#dimension-visible-count{display:none}#dimension-list{margin-top:4px}#dimension-list summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:650;list-style:none}#dimension-list summary::before{content:'+';font-size:18px;margin-right:8px}#dimension-list[open] summary::before{content:'−'}#dimension-values{max-height:min(300px,35svh);overflow-y:auto;overscroll-behavior:contain;border-top:1px solid var(--line)}.dimension-value{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;padding:12px 0;border-bottom:1px solid var(--line)}.dimension-value strong{font-variant-numeric:tabular-nums;white-space:nowrap}.dimension-value small{grid-column:1/-1;color:var(--muted);font-size:11px;overflow-wrap:anywhere}.dimension-source-note{font-size:11px;line-height:1.5;margin:8px 0 0;color:var(--muted)}.dimension-label{font-size:13px;font-weight:650;padding:5px 9px;font-variant-numeric:tabular-nums}.app[data-dimensions=true] .model-tag{display:none}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:700px){.dimension-review{padding:10px;font-size:13px}.app[data-dimensions=true] .view-tools{top:10px;left:10px;right:10px;flex-direction:row;justify-content:space-between}.app[data-dimensions=true] .stage-title{display:none}.dimension-label{font-size:12px;padding:4px 7px}}

/* Lost or failed graphics never leave a black canvas behind the recovery card. */
.app:is([data-context-state="lost"],[data-context-state="restoring"],[data-context-state="render-error"],[data-context-state="failed"]) #viewer canvas{visibility:hidden}
.app:is([data-context-state="lost"],[data-context-state="restoring"],[data-context-state="render-error"],[data-context-state="failed"]) .fallback{z-index:10}
/* Compact, stable toolbar shared by phone and desktop. */
.stage-title{display:none!important}.view-tools{position:absolute;top:12px!important;left:12px!important;right:12px!important;flex-direction:row!important;justify-content:space-between;gap:0!important;padding:4px!important;border-radius:14px!important;max-width:420px;margin-left:auto}
.view-tools .icon-button{width:44px!important;height:44px!important;min-width:44px;min-height:44px;padding:11px!important}.view-tools .icon-button[aria-pressed=true]{color:var(--panel);background:var(--ink)}
#gesture-mode .pan-symbol,#gesture-mode[data-gesture=pan] .rotate-symbol{display:none}#gesture-mode[data-gesture=pan] .pan-symbol{display:block}
.app[data-mode=building]:not([data-component]) #selected-layer,.app[data-mode=building][data-component=""] #selected-layer,.navigation-guide,.panel-intro{display:none!important}
@media(max-width:700px){.control-panel{padding:10px;gap:10px}.mode-tabs{padding:3px;border-radius:12px}.mode-tabs button{min-height:44px;padding:8px 6px;font-size:13px}.layer-row{min-height:44px}.selected-layer p{font-size:12px;line-height:1.5}.view-tools{max-width:none}}

/* Current native model appears before its lossless 3D payload is ready. */
.model-poster{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;background:#253740}
.app[data-ready=true] .model-poster{visibility:hidden}
.app:not([data-ready=true]) #viewer canvas{visibility:hidden}
.app:not([data-ready=true]) .view-tools{display:none!important}
.loading{bottom:22px;top:auto;left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px 16px;font-size:13px;white-space:nowrap}
.loading[hidden],.fallback[hidden]{display:none}
#loading-progress{display:block;width:100%;height:3px;accent-color:var(--accent)}
.fallback{top:auto;bottom:22px;left:22px;transform:none;width:min(420px,calc(100% - 44px));padding:18px;font-size:13px;z-index:10}
.fallback h2{font-size:16px;margin:0 0 8px}.fallback p{line-height:1.5;margin:0 0 12px}
.mode-tabs[inert]{opacity:.6}
/* An unselected whole-building overview has no empty desktop sidebar. */
@media(min-width:701px){
 body:not(.presentation) .app[data-mode=building] main{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto}
 body:not(.presentation) .app[data-mode=building] .control-panel{padding:6px 0;background:transparent;border:0;border-radius:0;gap:8px;overflow:visible;max-height:260px}
 body:not(.presentation) .app[data-mode=building] .panel-heading{display:none}
 body:not(.presentation) .app[data-mode=building] .mode-tabs{width:min(620px,100%);margin:auto}
 body:not(.presentation) .app[data-mode=building] #dimension-review{width:min(620px,100%);margin:auto;overflow:auto;max-height:220px}
 body:not(.presentation) .app[data-mode=building] #selected-layer:not([hidden]){width:min(620px,100%);margin:auto;max-height:170px;overflow:auto}
}
@media(max-width:700px){.loading{bottom:16px;font-size:12px}.fallback{left:12px;bottom:12px;width:calc(100% - 24px);padding:14px}.model-poster{object-fit:contain}}
/* Language belongs to the header; the viewer and current camera stay alive. */
.language-switch{display:flex;align-items:center;gap:2px;padding:3px;border:1px solid var(--line);border-radius:12px;background:var(--soft)}
.header-actions .language-switch button{min-width:38px;min-height:38px;padding:6px 8px;border:0;border-radius:8px;font-size:12px}
.header-actions .language-switch button[aria-pressed=true]{background:var(--accent);color:#fff}
@media(max-width:700px){.header-actions{gap:8px!important}.header-actions .language-switch button{min-width:34px;min-height:36px!important;padding:5px 7px}.language-switch{border-radius:10px;padding:2px}.identity b{font-size:17px}.header-actions #presentation-toggle{max-width:94px}}

/* A small plinth section needs a compact phone stage and a readable side view. */
@media(max-width:600px){body:not(.presentation) .app[data-mode="plinth"] .stage{height:360px;min-height:360px;max-height:none}}

/* Touch chrome must not start a selection or the iOS copy callout. */
.header,.stage,.mode-tabs,button{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.header-actions .language-switch button{display:grid;place-items:center;min-width:42px}
.language-flag{width:24px;height:16px;border-radius:2px;box-shadow:0 0 0 1px #ffffff35;pointer-events:none}
