/* A native, resizable Atlas window with restrained workspace lighting. */
body{background:radial-gradient(ellipse at 12% 0%,color-mix(in srgb,var(--primary) 10%,transparent),transparent 52%),#040811}
body::after{content:"";position:fixed;inset:0;border:1px solid color-mix(in srgb,var(--accent) 27%,#152231);border-radius:12px;pointer-events:none;z-index:20}
body.window-maximized::after{border-radius:0;border-color:transparent}
.brain-titlebar{height:78px;margin:10px 12px 0;padding:13px 15px 13px 20px;gap:18px;border:1px solid color-mix(in srgb,var(--accent) 25%,#142332);border-radius:16px;background:linear-gradient(115deg,color-mix(in srgb,var(--primary) 10%,#07111d),#050c16 65%);box-shadow:0 8px 28px -20px color-mix(in srgb,var(--primary) 50%,transparent),inset 0 1px 0 #ffffff06;-webkit-app-region:drag;user-select:none}
.brain-titlebar .identity{min-width:0;flex:1;gap:15px}
.brain-titlebar .identity>div{min-width:0}
.brain-titlebar h1{font-size:16px;letter-spacing:.24em;white-space:nowrap;margin-bottom:4px}
.brain-titlebar h1 small{display:block;font-size:7px;letter-spacing:.18em;margin:2px 0 0;color:var(--muted)}
.brain-mark{width:44px;height:40px;flex:none;overflow:visible;filter:drop-shadow(0 0 7px color-mix(in srgb,var(--primary) 28%,transparent))}
.brain-mark .mark-top{stop-color:var(--accent)}.brain-mark .mark-base{stop-color:var(--primary)}
.brain-mark ellipse{stroke:var(--accent)}
#workspaceName{max-width:420px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;letter-spacing:.05em}
.brain-titlebar .header-actions{flex:none;-webkit-app-region:no-drag}
.brain-titlebar button{-webkit-app-region:no-drag}
.brain-window-controls{display:flex;gap:4px;flex:none;padding-left:13px;border-left:1px solid color-mix(in srgb,var(--accent) 16%,#142332);-webkit-app-region:no-drag}
.brain-window-controls button{width:34px;height:34px;display:grid;place-items:center;padding:0;border:1px solid transparent;border-radius:9px;background:transparent;color:#a7bdcf;transition:background .16s,color .16s,border-color .16s}
.brain-window-controls button:hover{color:var(--accent);background:color-mix(in srgb,var(--primary) 15%,#091421);border-color:color-mix(in srgb,var(--accent) 35%,#142332)}
.brain-window-controls button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.brain-window-controls #brainClose:hover{color:#fff;background:#a63145;border-color:#d1586e}
.brain-window-controls svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.3;pointer-events:none}
.restore-shape{display:none}.window-maximized .maximize-shape{display:none}.window-maximized .restore-shape{display:block}
.window-inactive .brain-titlebar{box-shadow:none}
.universe,main>aside{border-color:color-mix(in srgb,var(--accent) 18%,#142332);box-shadow:0 12px 30px -25px color-mix(in srgb,var(--primary) 38%,transparent)}
.subhead{padding-top:12px;padding-bottom:12px}
main>aside{background:linear-gradient(155deg,color-mix(in srgb,var(--primary) 5%,#09111d),#070e18 58%)}
#search{border-color:color-mix(in srgb,var(--accent) 20%,#1d3043);background:#050d17}
@media(max-width:1080px){.brain-titlebar{gap:12px;padding-left:16px}.brain-titlebar .identity{gap:10px}.brain-mark{width:35px}.brain-titlebar h1{font-size:14px}#workspaceName{max-width:240px}.brain-titlebar .header-actions{gap:6px}.brain-titlebar .header-actions button{padding:8px 10px}.brain-window-controls{padding-left:9px;gap:2px}}
@media(max-height:700px){.brain-titlebar{height:68px;margin-top:8px;padding-top:9px;padding-bottom:9px}.subhead{padding-top:8px;padding-bottom:8px}}
@media(prefers-reduced-motion:reduce){.brain-window-controls button{transition:none}}

/* Fit Windows Snap zones at scaled display sizes without forcing neighbouring windows aside. */
main,.universe,main>aside,.preview-layout,.preview-column,#metadataForm{min-width:0}
.brain-view-switch{display:none;-webkit-app-region:no-drag}
#filters{flex-shrink:0}.graph-footer{flex-shrink:0}
@media(max-width:1000px){main{grid-template-columns:minmax(0,1fr) 280px;gap:12px;margin-left:12px;margin-right:12px}.subhead>span:last-child{display:none}}
@media(max-width:800px){
 #previewDialog{padding:15px;overflow-y:auto;display:block}
 #previewDialog:not([open]){display:none}
 #previewDialog[open]{display:block}
 .preview-layout{display:flex;flex-direction:column;gap:16px}
 .preview-column{flex:none;min-height:220px}
 #previewContent{flex:none;height:clamp(160px,35vh,320px);min-height:150px}
 #metadataForm{overflow:visible;flex:none}
 .preview-header{position:sticky;top:-15px;z-index:2;background:#0b1626;padding:8px 0 5px;border-bottom:1px solid var(--line)}
 .preview-header h2{font-size:18px;max-height:none;margin-bottom:10px}
}
@media(max-width:720px){
 .brain-titlebar{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:40px 30px;height:auto;gap:8px 10px;margin:8px 8px 0;padding:9px 11px}
 .brain-titlebar .identity{grid-column:1;grid-row:1;gap:9px}
 .brain-titlebar .brain-mark{width:30px;height:34px}
 .brain-titlebar h1{font-size:12px;letter-spacing:.18em;margin-bottom:2px}
 .brain-titlebar h1 small{display:none}#workspaceName{font-size:10px;max-width:100%}
 .brain-window-controls{grid-column:2;grid-row:1;padding-left:5px;gap:1px}
 .brain-window-controls button{width:29px;height:31px}
 .brain-view-switch{grid-column:1;grid-row:2;display:flex;gap:3px;align-items:center;justify-self:start}
 .brain-view-switch button{font-size:11px;padding:5px 9px;border-color:transparent;background:transparent}
 .brain-view-switch button[aria-pressed=true]{border-color:color-mix(in srgb,var(--accent) 45%,#243446);color:var(--accent);background:color-mix(in srgb,var(--primary) 15%,#07101b)}
 .brain-titlebar .header-actions{grid-column:1/-1;grid-row:2;justify-self:end;gap:5px}
 .brain-titlebar .header-actions button{font-size:11px;padding:5px 8px}
 .subhead{padding:7px 14px;font-size:10px}
 main{grid-template-columns:minmax(0,1fr);margin:0 8px 6px;gap:0}
 body:not([data-brain-view=library]) #brainLibraryPane{display:none}
 body[data-brain-view=library] #brainMapPane{display:none}
 #filters{padding:9px 10px 6px;gap:5px}
 #filters button{font-size:10px;padding:5px 8px}
 #graphStage{min-height:80px}
 .graph-footer{padding:8px 9px;gap:7px}
 .graph-footer>div{max-width:100%;flex-wrap:wrap;justify-content:center}
 #graphHint{font-size:8px;white-space:normal}
 #empty b{font-size:16px}#empty span{font-size:11px}
 #status{padding:0 13px 7px;min-height:23px;font-size:10px;flex-shrink:0}
 dialog{padding:18px;max-width:calc(100vw - 24px)}
 .dialog-actions{flex-wrap:wrap;margin-top:16px}
 #details{max-height:35vh}
}
@media(max-width:720px) and (max-height:560px){
 .brain-titlebar{margin-top:5px;padding-top:6px;padding-bottom:6px;row-gap:4px}
 .subhead{padding-top:5px;padding-bottom:5px}
 #filters{flex-wrap:nowrap;overflow-x:auto;padding:6px 8px;scrollbar-width:thin}
 #filters button{white-space:nowrap;flex-shrink:0}
 #graphHint{display:none}.graph-footer{padding:5px 8px;gap:4px}
 #brainLibraryPane{display:block;overflow-y:auto}
 body:not([data-brain-view=library]) #brainLibraryPane{display:none}
 #brainLibraryPane .library-head{padding:9px 12px}
 #brainLibraryPane .library-head h2,#brainLibraryPane .library-head .eyebrow{display:none}
 #brainLibraryPane #library{min-height:90px;max-height:180px}
 #brainLibraryPane #details{max-height:180px;margin-top:8px}
 #brainLibraryPane .sidebar-foot{padding:7px 12px}
}
@media(max-height:480px) and (min-width:721px){
 .brain-titlebar{height:58px;padding-top:6px;padding-bottom:6px}
 .brain-titlebar h1 small{display:none}.subhead{padding-top:5px;padding-bottom:5px}
 #filters{flex-wrap:nowrap;overflow-x:auto;padding-top:6px;scrollbar-width:thin}
 #filters button{flex-shrink:0;white-space:nowrap}#graphStage{min-height:80px}
 .graph-footer{padding:6px;gap:4px}#graphHint{display:none}
 #brainLibraryPane{display:block;overflow-y:auto}
 #brainLibraryPane .library-head h2,#brainLibraryPane .library-head .eyebrow{display:none}
 #brainLibraryPane #library{max-height:160px;min-height:90px}
}
