/* Page-scoped IDE workbench; the app sidebar/auth controls remain shared. */
body.code-mode #app-view{height:100dvh;overflow:hidden}
body.code-mode main{height:100dvh;min-width:0;display:flex;flex-direction:column;overflow:hidden}
body.code-mode .topbar{height:44px;min-height:44px;flex:none;padding:0 140px 0 20px}
body.code-mode .workspace{max-width:none;width:100%;height:calc(100dvh - 44px);padding:0;margin:0;min-height:0;display:flex;flex-direction:column}
body.code-mode #research-view{display:flex;flex:1;min-height:0;min-width:0;padding:0;margin:0;overflow:hidden}
body.code-mode #global-error:not([hidden]){position:absolute;z-index:60;top:46px;right:18px;max-width:min(550px,80vw)}
.code-workspace{--ide-bg:#17191d;--ide-surface:#212329;--ide-side:#1e2025;--ide-border:#33363d;--ide-text:#e6e9ef;--ide-muted:#9ca2ad;--ide-accent:#59b789;--ide-blue:#8ec7f5;--ide-yellow:#e2c778;--ide-red:#f17e85;flex:1;min-width:0;min-height:0;background:var(--ide-bg);color:var(--ide-text);display:flex;flex-direction:column;font:12px/1.45 'Segoe UI',Arial,sans-serif}
.code-workspace *{box-sizing:border-box}
#code-inspector-toggle,#code-inspector-close{display:none}
.code-workspace button,.code-workspace input,.code-workspace textarea{font:inherit}
.code-workspace button{color:var(--ide-text);background:#2b2e35;border:1px solid #454951;border-radius:4px;padding:6px 11px;min-height:32px;white-space:nowrap}
.code-workspace button:hover:not(:disabled){background:#383c44}
.code-workspace button.code-primary{background:#217a52;border-color:#2c9a65;color:white;font-weight:700}
.code-workspace button.code-primary:hover:not(:disabled){background:#2c9865}
.code-workspace button:disabled{background:#252830!important;color:#858a92!important;border-color:#343841!important;opacity:1}
.code-header{height:68px;flex:none;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:8px 18px;border-bottom:1px solid var(--ide-border);background:#202228}
.code-heading{display:flex;align-items:center;gap:12px}.code-mark{display:grid;place-items:center;width:33px;height:33px;border:1px solid #397454;border-radius:7px;color:#75c699;font-size:18px}.code-heading small{font:700 9px/1 'Segoe UI',Arial,sans-serif;color:var(--ide-accent);letter-spacing:2px}.code-heading h1{color:var(--ide-text);font-size:20px;line-height:1.1;margin:4px 0 0;font-weight:620;letter-spacing:-.5px}.code-actions{display:flex;align-items:center;gap:7px}.code-actions #code-dirty{color:var(--ide-muted);margin-right:10px;white-space:nowrap}.code-columns{flex:1;min-height:0;min-width:0;display:grid;grid-template-columns:clamp(165px,16vw,240px) minmax(250px,1fr) clamp(245px,23vw,330px)}.code-columns>*{min-width:0;min-height:0}.code-files{display:flex;flex-direction:column;background:var(--ide-side);border-right:1px solid var(--ide-border)}.pane-heading{height:44px;padding:0 13px;display:flex;align-items:center;justify-content:space-between;color:#c3c9d1;letter-spacing:1.5px;font-size:10px}.pane-heading button{border:0;padding:1px 7px;min-height:25px;font-size:17px}.files-label{padding:10px 13px;color:#a7adb8;font-weight:700;letter-spacing:1px;font-size:10px;background:#25282e}.empty-list{padding:12px 14px;color:var(--ide-muted);line-height:1.4}.code-file{width:100%;text-align:left!important;border:0!important;border-radius:0!important;background:transparent!important;color:#cbd1dc!important;padding:8px 13px!important;white-space:normal!important;overflow-wrap:anywhere}.code-file:before{content:'◇';color:var(--ide-blue);margin-right:8px}.code-file:hover,.code-file.active{background:#2f3639!important}.rail-note{margin-top:auto;padding:16px 13px;border-top:1px solid var(--ide-border);color:var(--ide-muted);line-height:1.5}.status-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--ide-accent);margin-right:5px}.code-center{display:flex;flex-direction:column;min-width:0;background:var(--ide-bg)}.code-tabs{height:38px;flex:none;display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--ide-border);background:#24262c;color:var(--ide-muted);overflow:hidden}.code-tab{height:38px;padding:9px 15px;border-right:1px solid var(--ide-border);color:var(--ide-text);white-space:nowrap}.code-tab.active{border-top:2px solid var(--ide-accent);padding-top:7px;background:var(--ide-bg)}.code-path{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.code-upload-label{margin-left:auto;margin-right:14px;color:var(--ide-blue);cursor:pointer;white-space:nowrap}.code-upload-label:hover{text-decoration:underline}.code-upload-label input{position:absolute;opacity:0;width:1px;height:1px}
body.code-mode #source-upload{position:absolute!important;width:1px!important;height:1px!important;clip-path:inset(50%);overflow:hidden}.code-editor{flex:1;min-height:130px;overflow:auto;font:13px/1.6 Consolas,'Cascadia Code',monospace}.code-editor .cm-editor{height:100%;background:var(--ide-bg);color:var(--ide-text);font:13px/1.6 Consolas,'Cascadia Code',monospace}.code-editor .cm-scroller{overflow:auto;font:inherit}.code-editor .cm-gutters{background:#1c1f23;color:#727983;border-right:1px solid var(--ide-border)}.code-editor .cm-activeLine{background:#232a29}.code-editor .cm-activeLineGutter{background:#2b3230}.code-editor .cm-content{padding-top:14px}.code-editor textarea{display:block;width:100%;height:100%;min-height:240px;resize:none;background:transparent;color:var(--ide-text);border:0;outline:0;padding:16px;font:inherit}.code-problems{height:118px;flex:none;border-top:1px solid var(--ide-border);overflow:auto;background:#1d2024}.problems-header{height:32px;display:flex;justify-content:space-between;align-items:center;padding:0 14px;border-bottom:1px solid #2c3036;color:#bfc4cf;font-size:10px;font-weight:700;letter-spacing:1px}.code-problems pre{margin:0;padding:10px 14px;color:var(--ide-muted);white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.5 Consolas,monospace}.code-status{height:25px;flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 12px;background:#185b40;color:#e7fff0;font-size:10px;white-space:nowrap}.code-inspector{display:flex;flex-direction:column;border-left:1px solid var(--ide-border);background:var(--ide-surface)}.inspector-tabs{height:43px;display:flex;align-items:stretch;border-bottom:1px solid var(--ide-border)}.inspector-tabs button{flex:1;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;font-weight:700;font-size:10px;letter-spacing:1px}.inspector-tabs button.selected{border-bottom-color:var(--ide-accent);color:#8fe2ad}.inspector-panel{padding:20px 16px;min-height:0;overflow:auto}.inspector-panel h2{font-size:17px;color:var(--ide-text);margin:0 0 5px}.inspector-panel p{font-size:12px;color:var(--ide-muted);line-height:1.5;margin:0 0 15px}.inspector-panel input,.inspector-panel textarea{width:100%;border:1px solid #4a4f58;border-radius:4px;background:#181b20;color:var(--ide-text);padding:10px;outline:none}.inspector-panel input:focus,.inspector-panel textarea:focus{border-color:var(--ide-accent)}.inspector-panel label{display:block;color:#d4d9e2;font-weight:600;margin-bottom:7px}.inspector-panel textarea{resize:vertical;min-height:100px;margin-bottom:12px}.inspector-panel a{display:inline-block;color:#8ccca7;margin-top:14px;text-decoration:underline}.reference-results{max-height:calc(100dvh - 300px);overflow:auto;margin-top:12px;scrollbar-width:thin}.reference-results h3{font-size:11px;letter-spacing:1px;margin:14px 0 6px;color:#8aceaa}.reference-results pre{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;color:#c4ccd3;line-height:1.5;font:11px/1.55 Consolas,monospace}.reference-hit{padding:8px 0;border-bottom:1px solid #383b42;white-space:pre-wrap;overflow-wrap:anywhere}.inspector-panel code{color:#d5bf7d}
@media(max-width:1200px){.code-columns{grid-template-columns:165px minmax(250px,1fr) 245px}.code-path{display:none}}
@media(max-width:900px){#code-inspector-toggle,#code-inspector-close{display:inline-flex;align-items:center;justify-content:center}#code-inspector-close{margin:7px;align-self:flex-end}.code-header:after{display:none!important}body.code-mode main{height:calc(100dvh - 110px)}body.code-mode #app-view{overflow:hidden}body.code-mode .sidebar{height:110px}.code-columns{grid-template-columns:150px minmax(220px,1fr)}.code-inspector{position:absolute;z-index:45;right:0;top:calc(110px + 44px + 68px);bottom:0;width:min(350px,70vw);box-shadow:-10px 0 30px #0008}.code-inspector:not(.open){display:none}.code-header{height:68px}.code-heading small{display:none}.code-actions{overflow-x:auto}.code-header:after{content:'REF / AI';font-size:10px;color:#8ccca7;cursor:pointer}}
@media(max-width:600px){.code-actions{gap:4px!important}.code-actions #code-dirty{display:none}.code-actions button{font-size:10px;padding:6px 6px!important}.code-actions #code-save{font-size:0;min-width:51px}.code-actions #code-save:after{content:'Save';font-size:10px}.code-actions #code-inspector-toggle{font-size:0;min-width:72px}.code-actions #code-inspector-toggle:after{content:'Ref / AI';font-size:10px}body.code-mode main{height:calc(100dvh - 130px)}body.code-mode .topbar{height:36px;min-height:36px}.code-header{height:98px;align-items:flex-start;flex-direction:column;gap:4px}.code-columns{display:block;position:relative}.code-files{display:none}.code-center{height:100%}.code-inspector{top:0;width:100%;height:100%}.code-problems{height:100px}.code-status{font-size:9px}.code-actions{width:100%}.code-actions button{min-height:40px}.code-tab{min-width:130px}.code-inspector:not(.open){display:none}}

/* A focused reference lookup, in the browser top layer instead of an IDE rail. */
.code-workspace #code-inspector-toggle,.code-workspace #code-inspector-close{display:inline-flex;align-items:center;justify-content:center}
.code-columns{grid-template-columns:clamp(165px,16vw,240px) minmax(0,1fr)}
@media(max-width:1200px){.code-columns{grid-template-columns:165px minmax(0,1fr)}}
.code-workspace .code-inspector{position:fixed;inset:0;margin:auto;width:80vw;max-width:none;height:80dvh;max-height:none;padding:0;overflow:hidden;border:1px solid #4a5260;border-radius:10px;background:#191e27;color:#e8edf4;box-shadow:0 25px 90px #000b}
.code-workspace .code-inspector:not([open]){display:none!important}
.code-workspace .code-inspector[open]{display:flex;flex-direction:column}
.code-workspace .code-inspector::backdrop{background:rgba(2,6,13,.82)}
.inspector-header{display:flex;flex:none;align-items:center;justify-content:space-between;gap:12px;padding:13px 20px;background:#222a36;border-bottom:1px solid #394354}
.inspector-header small{display:block;color:#9eafc3;font-size:10px;letter-spacing:1.5px;font-weight:700}
.inspector-header h2{margin:3px 0 0;font-size:19px;color:#f0f4fa}
.code-workspace #code-inspector-close{min-height:42px;padding:7px 16px;font-size:13px;font-weight:700}
.inspector-tabs{height:44px;flex:none}.inspector-tabs button{flex:0 1 auto;padding:0 22px}
.code-workspace .inspector-panel{display:flex;flex:1;min-height:0;flex-direction:column;gap:9px;padding:15px 20px 12px;overflow:hidden}
.code-workspace .inspector-panel[hidden]{display:none!important}
.reference-search-label{font-size:12px;color:#cbd5e1;font-weight:700}
.code-workspace #reference-search{width:100%;height:43px;flex:none;margin:0;background:#101721;border:1px solid #536073;border-radius:6px;color:#f1f5f9;padding:0 13px;font-size:14px}
.reference-layout{display:grid;grid-template-columns:clamp(180px,23%,280px) minmax(0,1fr);flex:1;min-height:0;border:1px solid #3b4555;border-radius:7px;overflow:hidden}
.reference-list{overflow:auto;padding:8px;background:#171d27;border-right:1px solid #3b4555}
.code-workspace .reference-list button{display:block;width:100%;min-height:42px;text-align:left;white-space:normal;overflow-wrap:anywhere;background:transparent;border:0;border-radius:5px;color:#cbd5e1;font-size:13px;padding:9px 11px}
.code-workspace .reference-list button.active{background:#2d394a;color:#f4f8ff;font-weight:700}
.code-workspace .reference-list button:focus-visible,.code-workspace #code-inspector-close:focus-visible{outline:2px solid #93c5fd;outline-offset:1px}
.code-workspace .reference-results{overflow:auto;min-height:0;padding:20px 25px;color:#d8e0ea;font-size:14px;line-height:1.6;white-space:normal;font-family:'Segoe UI',Arial,sans-serif}
.reference-results h2{color:#f6f8fc;font-size:21px;margin:0 0 10px}
.reference-results .reference-signature{font:12px/1.5 Consolas,monospace;color:#9fb9d3;overflow-wrap:anywhere;margin:-3px 0 17px}
.reference-results p,.reference-results ul{margin:0 0 12px}.reference-results li{margin:5px 0}
.reference-results pre{padding:14px;margin:8px 0 18px;border:1px solid #3b4757;border-radius:6px;background:#101720;color:#cbe4f8;overflow:auto;font:12px/1.6 Consolas,monospace;white-space:pre}
.reference-results code:not(pre code){color:#b5ddf5;font:12px Consolas,monospace}
.reference-download{align-self:flex-start;flex:none}
.reference-list h3{margin:10px 9px 5px;font-size:10px;letter-spacing:1.1px;color:#93a6bc}
@media(max-width:900px){.code-workspace .code-inspector{inset:0;width:80vw;height:80dvh;max-height:none;box-shadow:0 25px 90px #000b}.code-columns{grid-template-columns:150px minmax(0,1fr)}.code-header:after{display:none}}
@media(max-width:600px){.code-columns{display:block}.code-workspace .code-inspector{inset:0;width:80vw;height:80dvh}.inspector-header{padding:9px 10px}.inspector-header h2{font-size:15px}.code-workspace #code-inspector-close{min-height:44px}.code-workspace .inspector-panel{padding:10px;gap:6px}.reference-layout{grid-template-columns:minmax(92px,38%) minmax(0,1fr)}.reference-list{padding:4px}.code-workspace .reference-list button{padding:7px 5px;font-size:11px;min-height:44px}.code-workspace .reference-results{padding:12px;font-size:12px}.reference-results pre{font-size:11px}.inspector-tabs button{padding:0 9px;font-size:9px}}
@media(max-width:600px){.reference-list h3{margin:7px 3px 3px;font-size:8px;letter-spacing:.4px}.reference-results h2{font-size:16px;line-height:1.3;overflow-wrap:anywhere}.code-workspace .reference-results{line-height:1.45}}
@media(max-width:360px){.code-header{height:90px}.code-problems{height:78px}.reference-results .reference-signature{font-size:10px}}
