/* Estilos base del visor (antes en línea en viewer.html). Se cargan antes de trillas-ui-v1.css. */
:root{color-scheme:dark;--bg:#07090b;--panel:#0d1115;--panel2:#11171c;--line:#273039;--text:#e7edf1;--muted:#7e8b94;--accent:#59c9ff;--good:#67d4a2;--warn:#d6aa61;--shadow:rgba(0,0,0,.35)}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}button,input{font:inherit}button{color:var(--text);background:#11171c;border:1px solid #2d3942;border-radius:7px;height:32px;padding:0 10px;cursor:pointer}button:hover,button.on{border-color:#557b91;background:#17232b}#collisionBtn.on{border-color:#6b8c78;background:#142019;color:#d7f1df}.app{position:fixed;inset:0;display:grid;grid-template-rows:46px minmax(0,1fr) 26px;background:#07090b}.topbar{display:flex;align-items:center;gap:8px;padding:0 9px;border-bottom:1px solid var(--line);background:#0b0f12;z-index:20}.brand{display:flex;align-items:center;gap:9px;min-width:205px}.mark{width:29px;height:29px;border:1px solid #41505a;border-radius:7px;display:grid;place-items:center;font-weight:800;font-size:13px}.brand div{display:flex;flex-direction:column;line-height:1}.brand strong{font-size:12px;letter-spacing:.18em}.brand small{font-size:7px;color:var(--muted);margin-top:4px;letter-spacing:.08em}.project{font-size:10px;color:#aeb9c0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.grow{flex:1}.toolbar{display:flex;align-items:center;gap:5px}.toolbar button{font-size:9px;height:29px;padding:0 9px}.stage{position:relative;min-height:0;overflow:clip;background:linear-gradient(#0a1620,#15191a 58%,#0b0d0e)}#view{display:block;width:100%;height:100%;touch-action:none;outline:none;cursor:grab}#view.dragging{cursor:grabbing}.panel{position:absolute;top:10px;bottom:10px;background:rgba(13,17,21,.94);border:1px solid #29343c;border-radius:10px;box-shadow:0 12px 40px var(--shadow);backdrop-filter:blur(10px);z-index:10;overflow:hidden;transition:transform .18s ease,opacity .18s ease}.left{left:10px;width:230px}.right{right:10px;width:250px}.left.closed{transform:translateX(calc(-100% - 14px));opacity:.2}.right.closed{transform:translateX(calc(100% + 14px));opacity:.2}.phead{height:42px;display:flex;align-items:center;justify-content:space-between;padding:0 10px;border-bottom:1px solid var(--line)}.phead b{font-size:9px;letter-spacing:.12em}.phead button{width:28px;height:28px;padding:0}.search{margin:8px;width:calc(100% - 16px);height:30px;border:1px solid #2c363e;border-radius:7px;background:#080c0f;color:#d9e3e8;padding:0 9px;outline:none;font-size:10px}.tabs{display:flex;gap:5px;padding:0 8px 8px}.tabs button{height:27px;font-size:8px;padding:0 7px}.layerlist{position:absolute;left:0;right:0;top:113px;bottom:0;overflow:auto;border-top:1px solid #202930}.layerrow{display:grid;grid-template-columns:18px 9px minmax(0,1fr);gap:7px;align-items:center;padding:7px 9px;border-bottom:1px solid #1d252b;font-size:8px}.layerrow input{accent-color:var(--accent)}.swatch{width:8px;height:8px;border-radius:2px}.layerrow b{font-size:8px;font-weight:650;word-break:break-word}.layerrow small{display:block;color:#6f7d86;margin-top:2px}.empty{padding:56px 20px;text-align:center;color:var(--muted);font-size:9px}.empty .big{font-size:30px;color:#43515a}.info{padding:11px}.tag{display:inline-block;font-size:7px;letter-spacing:.1em;color:#9ddfff;border:1px solid #365366;padding:3px 5px;border-radius:4px}.info h3{font-size:12px;margin:9px 0 12px;word-break:break-word}.gridinfo{display:grid;grid-template-columns:1fr 1fr;font-size:8px;border-top:1px solid #263039}.gridinfo span{padding:6px 0;border-bottom:1px solid #202930}.gridinfo span:nth-child(odd){color:#6f7e87}.gridinfo span:nth-child(even){text-align:right;color:#c5d0d6}.note{margin-top:10px;border-left:2px solid #7c6848;background:#15120e;padding:8px;font-size:8px;color:#a99c87;line-height:1.45}.facts{margin-top:12px;border-top:1px solid #263039;padding-top:8px}.facts b{font-size:9px}.facts p{display:flex;justify-content:space-between;gap:8px;margin:0;padding:5px 0;font-size:8px;color:#77858e}.facts strong{color:#c0cbd2}.hud{position:absolute;left:50%;transform:translateX(-50%);top:10px;z-index:6;background:rgba(7,12,15,.78);border:1px solid #2a3740;border-radius:8px;padding:5px 8px;font-size:8px;color:#82919b;pointer-events:none}.hud strong{color:#d7e1e7}.hint{position:absolute;left:50%;transform:translateX(-50%);bottom:10px;z-index:6;background:rgba(7,12,15,.74);border:1px solid #25313a;border-radius:7px;padding:5px 8px;font-size:8px;color:#77858e;pointer-events:none}.floating{position:absolute;z-index:12;top:12px}.fl{left:12px}.fr{right:12px}.floating button{width:34px;height:34px;padding:0;font-size:15px;background:rgba(12,17,21,.88)}.labels{position:absolute;inset:0;pointer-events:none;z-index:5}.label{position:absolute;transform:translate(-50%,-50%);background:rgba(8,14,18,.88);border:1px solid #314754;color:#d8edf7;border-radius:5px;padding:3px 5px;font-size:8px;white-space:nowrap}.label.number{font-size:18px;font-weight:750;color:#e7e7e4;border-color:#5a5650;background:rgba(12,12,12,.86)}.status{display:flex;align-items:center;gap:18px;padding:0 9px;border-top:1px solid var(--line);background:#0b0f12;color:#71808a;font-size:8px;min-width:0}.status .sel{color:#c2ccd2}.status .rightstat{margin-left:auto}.toast{position:absolute;left:50%;top:54px;transform:translateX(-50%);z-index:30;padding:7px 10px;border-radius:7px;background:#162028;border:1px solid #355366;color:#dff3ff;font-size:9px;opacity:0;transition:opacity .2s;pointer-events:none}.toast.show{opacity:1}.legend{position:absolute;right:12px;bottom:12px;z-index:6;background:rgba(8,13,16,.75);border:1px solid #26343c;border-radius:7px;padding:6px 8px;font-size:7px;color:#7f8c95;pointer-events:none}.legend i{display:inline-block;width:7px;height:7px;border-radius:2px;margin:0 4px 0 8px}.legend i:first-child{margin-left:0}
@media(max-width:900px){.left{width:210px}.brand{min-width:155px}.brand small{display:none}.project{display:none}}@media(max-width:620px){.left{width:205px;top:8px;bottom:8px}.toolbar button:nth-child(n+5){display:none}.hint,.legend{display:none}.brand{min-width:115px}.brand strong{font-size:10px}.mark{width:27px;height:27px}.status span:nth-child(n+3){display:none}}

/* Compact controls; the architectural canvas remains the main surface. */
/* Editing extends the ORIGINAL viewport instead of launching another app. */
.navigation .editor-tool{border:1px solid #37637d;color:#c9e8f7;background:#0c2535}
.navigation .editor-tool.on{background:#18506c;border-color:#65c8f8;color:white}
.navigation .tool-divider{width:1px;align-self:stretch;background:#33434c;margin:3px}
#view.editor-move{cursor:move!important}#view.editor-wall{cursor:crosshair!important}
.editor-tip{padding:8px 10px;border-left:2px solid #59c9ff;background:#10242e;color:#bad6e7;font-size:11px;line-height:1.5;margin:8px 0}
.editor-actions{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.editor-actions button{flex:1;min-width:65px}
[hidden]{display:none!important}.panel.closed{visibility:hidden;pointer-events:none}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button:disabled{opacity:.45;cursor:default}
.topbar .toolbar{overflow-x:auto;flex-shrink:1}.toolbar button{flex-shrink:0;font-size:10px}.brand{min-width:170px}.floating.fr{display:flex;gap:6px}.floating.fr #toggleStudio{width:auto;padding:0 12px;font-size:12px}.panel{top:56px;bottom:72px}.right{width:288px;overflow:auto}.phead b{font-size:11px}.info,.studio-content{padding:16px}.info h3{font-size:14px}.gridinfo,.note,.empty{font-size:11px}.intro{color:#acbac3;font-size:12px;line-height:1.5;margin:0 0 16px}.control{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:9px;font-size:12px;margin:14px 0;color:#bac7ce}select{width:100%;background:#111a20;color:var(--text);border:1px solid #34424d;border-radius:8px;padding:9px;font:inherit}.presets{display:grid;grid-template-columns:1fr 1fr;gap:8px}.preset{height:auto;min-height:66px;padding:9px;text-align:left;font-size:11px;display:flex;flex-direction:column;gap:8px}.preset i{display:block;width:100%;height:23px;border-radius:4px}.preset.on{border-color:var(--accent)}input[type=color]{width:46px;height:30px;padding:2px;background:#111a20;border:1px solid #34424d;border-radius:6px}input[type=range]{width:100%;accent-color:var(--accent)}.wide{width:100%;font-size:11px}.save-note{font-size:10px;line-height:1.6;color:#91a1ab}.check{display:flex;gap:9px;align-items:center;font-size:12px;margin:12px 0}.check input{accent-color:var(--accent)}details{border-top:1px solid var(--line);padding:14px 0 0;margin-top:14px}summary{font-size:12px;cursor:pointer;color:#dce5e9}.navigation{position:absolute;bottom:34px;left:50%;transform:translateX(-50%);display:flex;gap:4px;padding:6px;border:1px solid #34424d;border-radius:12px;background:rgba(13,20,25,.94);z-index:8;box-shadow:0 8px 28px #0005}.navigation button{font-size:12px;border-color:transparent;height:35px}.navigation button.on{background:#213947;color:#d2f0ff;border-color:#416a80}.navigation span{width:1px;background:var(--line);margin:5px}.hint{font-size:10px;white-space:nowrap;bottom:9px;border:0;background:transparent}.legend{display:none}.hud{font-size:10px}.left .phead{gap:6px}.layerrow b{font-size:10px}.layerrow small{font-size:9px}.layerrow{padding:10px 9px}.status .rightstat{font-size:8px}.toast{font-size:12px}
@media(max-width:900px){.right{display:block}.project{display:none}.hud{left:64px;transform:none;top:16px}.hud #fps{display:none}.hint{font-size:8px}.brand{min-width:140px}}
@media(max-width:620px){.app{grid-template-rows:52px minmax(0,1fr) 26px}.brand{min-width:104px}.toolbar button:nth-child(n+5){display:block}.toolbar{max-width:calc(100vw - 128px)}.panel{top:58px;bottom:83px;max-width:calc(100% - 20px)}.navigation{bottom:15px;white-space:nowrap}.navigation button{min-width:36px;padding:0 8px}.hud{font-size:8px;max-width:calc(100% - 190px);overflow:hidden;white-space:nowrap}.hud #lockText{display:none}.floating.fr #toggleStudio{padding:0 8px}.floating button{height:38px}.hint{display:none}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
.text-field{width:100%;background:#111a20;color:var(--text);border:1px solid #34424d;border-radius:8px;padding:9px;font:inherit;min-width:0}.button-row{display:flex;gap:6px;margin:10px 0}.button-row button{flex:1;font-size:10px;height:auto;min-height:34px}.saved-views{display:grid;gap:6px;margin:12px 0}.saved-view{display:flex;gap:4px}.saved-view button:first-child{flex:1;text-align:left;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.saved-view button:last-child{padding:0 9px}.compare-overlay{position:absolute;inset:0;pointer-events:none;z-index:4}.compare-overlay span{position:absolute;top:58px;background:#101b25de;color:#dcecf5;border:1px solid #486174;border-radius:6px;padding:6px 10px;font-size:11px;max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.compare-overlay span:first-child{left:12px}.compare-overlay span:nth-child(2){right:12px}.compare-overlay i{position:absolute;top:0;bottom:0;left:50%;width:2px;background:#a5d6ed88}.compare-overlay i:after{content:'A ↔ B';position:absolute;top:48%;left:50%;transform:translateX(-50%);background:#152c39;border:1px solid #80a8bd;border-radius:8px;padding:7px;font:10px system-ui;white-space:nowrap}

#gpuView{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}#view{position:relative;z-index:1}.library{margin-bottom:18px}.library .preset{min-height:54px;justify-content:center}.section-caption{font-size:11px;color:#a4b4bf;margin:18px 0 10px}.dimensions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.dimensions label{font-size:11px;color:#afbec8}.dimensions input{margin-top:6px}.reference-photo{width:100%;border-radius:7px;margin-top:12px}.label.number{background:transparent;border:0;color:#24272a;text-shadow:0 1px 1px #fff8;font-size:22px;font-weight:700}.engine-status{font-size:10px;color:#8aa3b3}.studio .phead{position:sticky;top:0;background:#0d1115;z-index:1}
@media(max-width:620px){.navigation{max-width:calc(100vw - 16px);overflow:auto;left:8px;right:8px;transform:none;justify-content:flex-start}.navigation button{flex-shrink:0}.navigation .editor-tool{font-size:10px}}

/* Estudio: controles ordenados sin reducir el área útil del visor. */
#studioPanel.studio{top:46px;bottom:26px;right:0;width:min(380px,28vw);border:0;border-left:1px solid #1e3542;border-radius:0;background:#0a151d;box-shadow:-18px 0 38px rgba(0,0,0,.32);backdrop-filter:blur(14px);display:flex;flex-direction:column}
#studioPanel .phead{height:58px;min-height:58px;padding:0 17px;border-bottom:1px solid #1d3643;background:#0b1821;position:static}
#studioPanel .studio-heading{display:flex;min-width:0;flex-direction:column;gap:4px}
#studioPanel .studio-heading b{font-size:12px;letter-spacing:.14em;color:#e3f0f6}
#studioPanel .studio-heading small{font-size:9px;letter-spacing:.06em;color:#7e9aa9;white-space:nowrap}
#studioPanel .phead button{border-color:#294653;background:#10232d;color:#b9d8e6}
#studioPanel .studio-content{padding:12px;overflow-y:auto;display:block;flex:1;min-height:0;scrollbar-color:#35505e #0a151d;scrollbar-width:thin}
#studioPanel .studio-content::-webkit-scrollbar{width:8px}
#studioPanel .studio-content::-webkit-scrollbar-thumb{background:#35505e;border:2px solid #0a151d;border-radius:10px}
#studioPanel .studio-content>*{min-width:0}
#studioPanel .studio-quick-tools{padding:12px;border:1px solid #1e3947;border-radius:9px;background:linear-gradient(145deg,#0f222c,#0c1921)}
#studioPanel .intro{margin:0;color:#b8cbd4;font-size:11px;line-height:1.45}
#studioPanel .engine-status{display:inline-flex;width:max-content;max-width:100%;margin:9px 0 10px;padding:4px 7px;border:1px solid #2b5060;border-radius:999px;background:#0d202a;color:#9bcadd;font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#studioPanel .studio-section-title{margin:0 0 8px;color:#7c9cac;font-size:9px;font-weight:700;letter-spacing:.12em}
#studioPanel .library{margin:0}
#studioPanel .presets{gap:7px}
#studioPanel .preset{min-height:42px;padding:8px;border-color:#263f4d;border-radius:7px;background:#11232d;color:#d7e6ed;font-size:10px;line-height:1.15;justify-content:center;gap:4px}
#studioPanel .library .preset{min-height:42px}
#studioPanel .preset:hover,#studioPanel .preset.on{border-color:#5aaed1;background:#173443}
#studioPanel>.studio-content>details{margin:10px 0;padding:0;border:1px solid #1e3947;border-radius:9px;background:#0d1b24;overflow:hidden}
#studioPanel>.studio-content>details>summary{display:flex;align-items:center;min-height:43px;padding:0 12px;color:#d8e8ef;font-size:11px;font-weight:650;letter-spacing:.02em;list-style-position:inside}
#studioPanel>.studio-content>details>summary:hover{background:#102630}
#studioPanel>.studio-content>details[open]>summary{border-bottom:1px solid #1d3946;background:#102630;color:#e4f5fc}
#studioPanel>.studio-content>details>*:not(summary){margin-left:12px;margin-right:12px}
#studioPanel>.studio-content>details>.save-note:last-child{margin-bottom:12px}
#studioPanel #architectureEditor>details{margin:10px 0 0;padding:0;border:1px solid #23404e;border-radius:7px;background:#0b1820;overflow:hidden}
#studioPanel #architectureEditor>details>summary{min-height:38px;padding:0 9px;font-size:10px;font-weight:650;display:flex;align-items:center}
#studioPanel #architectureEditor>details[open]>summary{border-bottom:1px solid #1d3946;background:#102630}
#studioPanel #architectureEditor>details>*:not(summary){margin-left:9px;margin-right:9px}
#studioPanel .section-caption{margin:2px 0 0;color:#83a6b6;font-size:9px;font-weight:700;letter-spacing:.12em}
#studioPanel .control{margin:8px 0;gap:6px;color:#b8cad3;font-size:11px}
#studioPanel .check{margin:9px 0;font-size:11px;color:#b8cad3}
#studioPanel .text-field,#studioPanel select{min-height:34px;padding:7px 8px;border-color:#294653;border-radius:6px;background:#10212a;color:#e2edf2;font-size:11px}
#studioPanel .dimensions{gap:7px}
#studioPanel .dimensions label{font-size:10px;color:#9db5c1}
#studioPanel .dimensions input{margin-top:4px}
#studioPanel .button-row{gap:7px;margin:8px 0}
#studioPanel .button-row button,#studioPanel .editor-actions button{min-height:34px;border-color:#294653;background:#112630;font-size:10px}
#studioPanel .wide{min-height:34px;border-color:#31596a;background:#112a35;font-size:10px}
#studioPanel .wide:hover,#studioPanel .button-row button:hover,#studioPanel .editor-actions button:hover{border-color:#5aaed1;background:#183846}
#studioPanel .editor-tip{margin:8px 0;padding:7px 8px;border-left-color:#55bce7;background:#102631;color:#b8d5e2;font-size:10px}
#studioPanel .save-note{font-size:9px;line-height:1.45;color:#8fa7b4}
#studioPanel .color-control{align-items:center}
#studioPanel input[type=color]{background:#10212a;border-color:#294653}
#studioPanel .reference-photo{margin:0 0 12px;border:1px solid #294653;border-radius:7px}
@media(max-width:900px){#studioPanel.studio{top:46px;bottom:26px;width:min(360px,48vw)}}
@media(max-width:620px){#studioPanel.studio{top:52px;bottom:26px;right:0;width:min(360px,100vw);max-width:100%;border-left:1px solid #1e3542}.studio .phead{position:static}}
