/* Window chrome, Windows XP "Luna" inspired */
.win {
  position: absolute; display: flex; flex-direction: column; background: var(--face);
  border: 3px solid var(--blue-dark); border-top: 0; border-radius: 8px 8px 0 0;
  box-shadow: 3px 4px 10px rgba(0,0,0,.5); min-width: 150px;
}
.titlebar {
  flex: none; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 6px; margin: 0 -3px; border-radius: 8px 8px 0 0; cursor: default; touch-action: none;
  color: #fff; font-weight: bold; font-size: 13px; text-shadow: 1px 1px 1px #0a1c6b;
  background: linear-gradient(#0997ff 0%, #0053ee 8%, #0050ee 40%, #06f 88%, #06f 93%, #005bff 95%, #003dd7 100%);
}
.win.inactive .titlebar { background: linear-gradient(#7697e7, #7a96df 8%, #7e9ee3 40%, #94afe8 88%, #8fa9e2); text-shadow: none; }
.win.inactive { border-color: #6a85d8; }
.win.dragging { opacity: .93; }
#windows.busy iframe { pointer-events: none; }
/* Resize handles: straddle the window border; corners sit above edges */
.rs { position: absolute; z-index: 2; touch-action: none; }
.rs-n, .rs-s { left: 8px; right: 8px; height: 7px; cursor: ns-resize; }
.rs-e, .rs-w { top: 8px; bottom: 8px; width: 7px; cursor: ew-resize; }
.rs-n { top: -3px; } .rs-s { bottom: -5px; } .rs-e { right: -5px; } .rs-w { left: -5px; }
.rs-ne, .rs-nw, .rs-se, .rs-sw { width: 13px; height: 13px; z-index: 3; }
.rs-ne, .rs-nw { top: -3px; height: 8px; } .rs-se, .rs-sw { bottom: -5px; }
.rs-ne, .rs-se { right: -5px; } .rs-nw, .rs-sw { left: -5px; }
.rs-nw, .rs-se { cursor: nwse-resize; } .rs-ne, .rs-sw { cursor: nesw-resize; }
.titlebar .t-icon { display: grid; place-items: center; }
.titlebar .t-icon .mini svg { width: 16px; height: 16px; }
.t-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-btn {
  width: 22px; height: 22px; padding: 0; line-height: 1; font-size: 13px; font-weight: bold; color: #fff; border: 1px solid #fff; border-radius: 3px;
  background: radial-gradient(circle at 30% 30%, #7da7f9, #2a62e0 70%);
}
.tb-btn:hover { filter: brightness(1.15); }
.tb-close { background: radial-gradient(circle at 30% 30%, #f4a58f, #d8431f 70%); margin-left: 2px; }
.tb-btn:focus-visible { outline: 2px solid #ffe36b; }
.winbody { flex: 1; min-height: 0; overflow: auto; user-select: text; }

.win.widget { border-radius: 8px 8px 0 0; }
.win.widget .winbody { overflow: hidden; }
#win-help { max-height: calc(100% - 12px); } /* sized by its text; scrolls only on short screens */

.xp-btn { padding: 4px 14px; border: 1px solid #003c74; border-radius: 3px; background: linear-gradient(#fff, #ece9d8 85%, #d6d0c0); color: #000; min-width: 90px; }
.xp-btn:hover:not(:disabled) { box-shadow: inset 0 0 0 2px #f8b636; }
.xp-btn:disabled { color: #888; border-color: #aaa; cursor: default; }
.xp-btn:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
