/* ================= WINDOWS (everything open is a window on the desk; taskbar tabs = windows) ================= */
.xp-win { --titlebar:var(--accent); position:absolute; display:flex; flex-direction:column; background:var(--card);
  left:calc(150px + var(--n,0) * 22px); top:calc(14px + var(--n,0) * 22px); right:22px; bottom:14px;
  --frame:var(--titlebar); padding:0 4px 4px; background:var(--frame); border:0; border-radius:9px 9px 4px 4px; overflow:clip;
  box-shadow:0 0 0 1px rgba(0,0,0,.6), 0 4px 10px rgba(0,0,0,.28); }
.xp-win.focus { box-shadow:0 0 0 1px rgba(0,0,0,.7), 0 10px 26px rgba(0,0,0,.42); }
.xp-win:not(.focus) { --frame:#a8a290; --on-accent:#f1eee4; }
.xp-win .xp-title { margin:0 -4px; border-bottom:0; border-radius:0;
  background:linear-gradient(180deg,rgba(255,255,255,.34) 0,rgba(255,255,255,.08) 38%,rgba(0,0,0,0) 55%,rgba(0,0,0,.16) 100%), var(--frame); }
.xp-win .xp-body { background:var(--card); box-shadow:0 0 0 1px rgba(0,0,0,.45); }
.xp-win[data-key=cmd] .xp-body { box-shadow:0 0 0 1px rgba(255,255,255,.28); }
.xp-win.min { display:none; }
.xp-win.max { inset:0 !important; width:auto !important; height:auto !important; border-radius:0; padding:0; }
.xp-win.max .xp-title { margin:0; }
.xp-win .xp-title { cursor:grab; user-select:none; flex:none; }
.xp-win .xp-bar, .xp-win .xp-addr, .xp-win .xp-status { flex:none; }
.xp-win .xp-bar { border-bottom:1px solid #b5ae9a; } .xp-win .xp-addr { border-bottom:1px solid #8a8473; } .xp-win .xp-status { border-top:1px solid #8a8473; }
.xp-body { flex:1; min-height:0; overflow:auto; position:relative; scrollbar-color:var(--ink) var(--beige); scrollbar-width:thin; }
.xp-body > #quarto-content { max-width:none; width:auto; margin:0; padding:0 .4rem 1.2rem; }
.xp-win.loading .st::after { content:" \2026 loading"; }
/* the two home windows */
.xp-win[data-key=cmd]    { --accent:var(--orange); --titlebar:var(--ink); --on-accent:var(--paper); right:auto; bottom:auto; left:150px; top:4%;
  width:min(660px, calc(100% - 190px)); height:min(52%, 380px); min-height:240px; }
.xp-win[data-key=cmd] .xp-body { background:#000; overflow:hidden; }
.xp-win[data-key=cmd] .term { height:100%; max-height:none; min-height:0; }
.xp-win[data-key=recent] { --accent:var(--teal); --accent-ink:#13705f; --titlebar:var(--teal); left:auto; bottom:auto; right:4%; top:30%;
  width:min(660px, 55%); height:min(50%, 330px); min-height:210px; }
.xp-win[data-key=recent] .xp-body { padding:.7rem; }

/* shorter screens: smaller desktop icons so all five stay in one column */
@media (max-height:780px) { .icon { gap:.3rem; width:76px; } .icon b { width:52px; height:52px; border-radius:13px; } .icon svg { width:30px; height:30px; } .desktop { gap:.55rem 1rem; top:14px; } }

/* phones / short windows: every window is maximised; the taskbar tabs switch between them */
@media (max-width:760px), (max-height:520px) {
  .xp-win, .xp-win[data-key=cmd], .xp-win[data-key=recent] { inset:0 !important; width:auto !important; height:auto !important; border-radius:0; border-width:0; min-height:0; }
  .xp-win:not(.focus) { display:none; }
  .xp-win, .xp-win[data-key=cmd], .xp-win[data-key=recent] { padding:0; }
  .xp-win .xp-title { margin:0; }
  .xp-bar { display:none; }
}
