#window-collapse,#window-chip,#window-resize{display:none}
@media(min-width:901px){
 body{padding-top:40px}
 #shell{margin:0 auto;min-width:760px;max-width:calc(100vw - 40px);min-height:540px;grid-template-rows:150px minmax(0,1fr) 110px;transition:opacity .15s,filter .2s}
 #shell>.dashboard{height:100%;min-height:0;overflow:auto;overscroll-behavior:contain;margin:0;padding:14px 32px 22px;scrollbar-width:thin;scrollbar-color:#52727b transparent}
 #shell .dashboard-grid{flex:0 0 auto;grid-template-rows:260px 260px;min-height:0;height:auto}
 #shell .telemetry{flex-shrink:0}
 #shell .glass{min-height:0}
 #shell>footer{min-height:110px}
 #shell.window-narrow .material-control{grid-template-columns:90px 150px 40px;top:103px}
 #shell.window-narrow .material-control input{width:150px}
 #shell.window-narrow>header .identity{align-self:start;margin:0;position:absolute;top:70px;left:4%}
 #shell.window-narrow .footer-message{max-width:210px;font-size:8px;text-align:right}
 #shell.window-narrow .portfolio-legend{flex-wrap:wrap;gap:12px}
 #shell.window-small .material-control{left:52%}
 #window-collapse{display:block;position:fixed;right:24px;top:2px;z-index:1000;min-height:30px;padding:3px 12px;font:10px ui-monospace,monospace;border:0;color:#bcd8de;background:#081117e8;border-radius:0 0 8px 8px}
 #window-resize{display:block;position:absolute;right:6px;bottom:6px;z-index:20;width:36px;height:36px;min-height:36px;padding:0;font-size:24px;line-height:1;color:#c7e4e8;background:#0b202955;border:0;border-radius:0;cursor:nwse-resize;touch-action:none}
 #window-resize:focus-visible{outline:1px solid #c7f9ff;outline-offset:-4px}
 .window-resizing,.window-resizing *{cursor:nwse-resize!important;user-select:none!important}
 #window-chip{position:fixed;left:24px;bottom:24px;z-index:1001;display:block;width:150px;height:64px;font:14px ui-monospace,monospace;letter-spacing:4px;background:#08151de8;border:0;border-radius:0;filter:drop-shadow(0 8px 14px #0009);clip-path:polygon(0 22%,9% 0,28% 0,39% 17%,82% 17%,93% 35%,100% 35%,100% 80%,91% 100%,67% 100%,61% 90%,31% 90%,25% 100%,9% 100%,0 80%)}
 #window-chip:before{content:'';position:absolute;inset:0;background:linear-gradient(120deg,#d5efff,#65828a);clip-path:polygon(0 22%,9% 0,28% 0,39% 17%,82% 17%,93% 35%,100% 35%,100% 80%,91% 100%,67% 100%,61% 90%,31% 90%,25% 100%,9% 100%,0 80%,1% 79%,10% 98%,24% 98%,30% 88%,62% 88%,68% 98%,90% 98%,99% 79%,99% 37%,92% 37%,81% 19%,38% 19%,27% 2%,10% 2%,1% 23%,1% 79%,0 80%);pointer-events:none}
 #window-chip:focus-visible{background:#214550;outline:none;box-shadow:inset 0 0 18px #afffff66}
 .window-collapsed #shell,.window-collapsed #layers{visibility:hidden;pointer-events:none;opacity:0}
 .window-collapsed{overflow:hidden}
 body:not(.window-collapsed) #shell{animation:window-reveal .16s ease-out}
 #window-chip{animation:window-reveal .16s ease-out}
 @keyframes window-reveal{from{opacity:0}to{opacity:1}}
}
@media(prefers-reduced-motion:reduce){#shell,#window-chip{animation:none!important;transition:none!important}}

@media(min-width:901px){
 body{min-height:100vh;background-attachment:fixed}
 #shell>footer>span{position:absolute;top:8px;left:4%;font-size:8px}
 #shell>footer>.footer-message{left:auto;right:4%;max-width:280px;text-align:right}
 #window-chip{height:75px;clip-path:none;background:var(--chip-frame) center/100% 100% no-repeat;box-shadow:none;padding-top:18px}
 #window-chip:before{display:none}
 #window-chip:focus-visible{outline:1px solid #9ddde5;outline-offset:4px;background:var(--chip-frame) center/100% 100% no-repeat;filter:drop-shadow(0 0 4px #63cbdc88)}
}

/* Width budget: 260px smallest card × 3.05/.85 + 32px gaps +
   48px margins = 1013px; reserve 7px for rounding/scrollbars => 1020px. */
@media(min-width:901px){
 #shell>.dashboard{padding-inline:24px}
 #shell:not(.window-mobile) .hud-console{grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;padding-inline:16px}
 #shell:not(.window-mobile) .dashboard-grid{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) minmax(0,.85fr);grid-template-areas:'sites sites attention' 'work releases sources';grid-template-rows:280px 280px;gap:16px}
 #shell:not(.window-mobile) .main-card .portfolio-legend{flex-wrap:wrap;gap:10px}
}
#shell.window-mobile .hud-console{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 14px;padding-inline:0}
#shell.window-mobile .mobile-tabs{display:none}
#shell.window-mobile .dashboard-grid,#shell.window-mobile .dashboard-grid:has(.main-card.selected){display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:'sites' 'work' 'releases' 'attention' 'sources';grid-template-rows:repeat(5,360px);gap:18px;height:auto;min-height:0;flex:0 0 auto;overflow:visible}
#shell.window-mobile .dashboard-grid>.main-card{display:block!important;height:360px;min-height:360px;width:100%;position:relative}
#shell.window-mobile .main-card .portfolio-legend{flex-direction:column;align-items:flex-start;gap:12px;flex-wrap:nowrap}
@media(max-width:900px){
 #shell.window-mobile,#shell.window-mobile:has(.main-card.selected){height:auto;grid-template-rows:170px auto 128px}
 #shell.window-mobile>.dashboard,#shell.window-mobile>.dashboard:has(.main-card.selected){height:auto;min-height:0;overflow:visible;margin:0}
}
