/* Clear foreground hierarchy; background windows keep readable content. */
.windows .app-window{
 border-color:var(--shell-line);
 box-shadow:2px 2px var(--shell-shadow),inset 1px 1px var(--shell-line);
}
.windows .app-window.is-active{
 border-color:var(--shell-accent);
 box-shadow:4px 4px var(--shell-shadow),inset 1px 1px var(--shell-shine);
}
.windows .app-window>header{
 display:flex;align-items:center;gap:8px;padding:0 5px 0 8px;
 opacity:1;background:var(--shell-panel);color:var(--shell-muted);
 border-bottom:1px solid var(--shell-line);box-shadow:inset 0 1px var(--shell-line);
 cursor:grab;
}
.windows .app-window.is-active>header{
 background:var(--shell-title);color:var(--shell-text);
 box-shadow:inset 0 1px var(--shell-shine),inset 0 -1px var(--shell-line);
}
.windows .app-window:not(.is-active)>header{background:var(--shell-panel);color:var(--shell-muted)}
.window-title{display:flex;align-items:center;gap:8px;flex:1;min-width:0;padding-right:4px;overflow:hidden}
.window-app-icon{width:24px;height:24px;flex:none;image-rendering:pixelated;object-fit:contain;pointer-events:none}
.window-title-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
.windows .window-controls{display:flex;align-items:center;gap:4px;flex:none}
.windows .app-window>header button{
 width:28px;height:26px;padding:0;flex:none;cursor:pointer;
 color:var(--shell-muted);background:var(--shell-bg);
 border:1px solid var(--shell-line);box-shadow:none;
}
.windows .app-window.is-active>header button{
 color:var(--shell-text);background:var(--shell-panel);
 border-top-color:var(--shell-shine);border-left-color:var(--shell-shine);
 box-shadow:1px 1px var(--shell-shadow);
}
.windows .app-window>header button:hover{
 color:var(--shell-text);background:var(--shell-title);border-color:var(--shell-accent);
}
.windows .app-window>header button[data-control=close]:hover{
 color:#fff1df;background:#8e4b64;border-color:#e6a6b3;
}
.windows .app-window>header button:active{translate:1px 1px;box-shadow:none}
.windows .app-window>header button:focus-visible{outline:2px dashed var(--shell-accent);outline-offset:1px}
.windows .app-window.is-moving>header{cursor:grabbing}
.windows .app-window:is(.is-moving,.is-resizing){box-shadow:6px 6px var(--shell-shadow),inset 1px 1px var(--shell-shine)}
.app-window[data-mode=normal] .resize-se:after{
 right:6px;bottom:6px;width:2px;height:2px;border:0;background:var(--shell-line);
 box-shadow:-4px 0 var(--shell-line),0 -4px var(--shell-line),-8px 0 var(--shell-line),-4px -4px var(--shell-line),0 -8px var(--shell-line);
}
.app-window.is-active[data-mode=normal] .resize-se:after{
 background:var(--shell-accent);box-shadow:-4px 0 var(--shell-accent),0 -4px var(--shell-accent),-8px 0 var(--shell-accent),-4px -4px var(--shell-accent),0 -8px var(--shell-accent);
}
@media(max-width:600px),(pointer:coarse){
 .windows .app-window>header{height:40px;flex-basis:40px;gap:6px}
 .windows .app-window>header button{width:32px;height:30px}
 .windows .window-controls{gap:3px}
 .window-title{gap:6px;padding-right:0}
}
