/* =========================================================
   P5-P1 — Responsive Contract Global / Desktop Window Shell
   Baseline: U123

   Scope:
   - Normal windows opened from desktop icons (.os-window)
   - Compact laptops and short desktop viewports
   - Tablet-large bridge (721–980px)

   Protected:
   - Mobile window contract <=720px
   - Maximized window behavior
   - Catalog card/layout rules
   - Studio, dashboard, and public preview
   ========================================================= */

.os-window {
    box-sizing: border-box;
}

.window-body {
    min-height: 0;
}

/* Desktop and laptop: a normal window must remain visibly windowed.
   Maximize is still controlled only by the Maximize button. */
@media (min-width: 981px) {
    .os-window:not(.maximized) {
        width: min(860px, calc(100vw - 96px)) !important;
        height: min(650px, calc(100dvh - var(--taskbar-h) - 120px)) !important;
        max-height: calc(100dvh - var(--taskbar-h) - 120px) !important;
        min-height: min(280px, calc(100dvh - var(--taskbar-h) - 40px)) !important;
    }
}

/* 11-inch / short-laptop contract.
   Keep real desktop margins above and below the normal window. */
@media (min-width: 981px) and (max-height: 780px) {
    .os-window:not(.maximized) {
        height: min(600px, calc(100dvh - var(--taskbar-h) - 120px)) !important;
        max-height: calc(100dvh - var(--taskbar-h) - 120px) !important;
    }

    .window-titlebar {
        min-height: 44px;
        height: 44px;
        flex: 0 0 44px;
    }

    .window-body {
        padding: 16px;
    }
}

/* Tablet besar / laptop sangat kecil is no longer treated exactly like mobile.
   It may approach fullscreen, but keeps a visible desktop frame. */
@media (min-width: 721px) and (max-width: 980px) {
    .os-window:not(.maximized) {
        left: 24px !important;
        top: 20px !important;
        width: calc(100vw - 48px) !important;
        height: calc(100dvh - var(--taskbar-h) - 40px) !important;
        max-height: calc(100dvh - var(--taskbar-h) - 40px) !important;
        min-height: 0 !important;
    }
}
