:root {
    --ink: #f8fafc;
    --muted: rgba(226, 232, 240, .68);
    --faint: rgba(226, 232, 240, .38);
    --glass: rgba(17, 24, 39, .46);
    --glass-strong: rgba(15, 23, 42, .72);
    --stroke: rgba(255, 255, 255, .14);
    --stroke-strong: rgba(255, 255, 255, .22);
    --accent: #7dd3fc;
    --accent-2: #a7f3d0;
    --danger: #ff5f57;
    --warning: #ffbd2e;
    --success: #28c840;
    --shadow-soft: 0 20px 70px rgba(0, 0, 0, .30);
    --shadow-deep: 0 34px 120px rgba(0, 0, 0, .46);
    --menubar-height: 34px;
    --dock-height: 82px;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    color: var(--ink);
    font-family: "Manrope", system-ui, sans-serif;
    background: #05070d;
    -webkit-text-size-adjust: 100%;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

.boot-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    background: radial-gradient(circle at 50% 42%, rgba(125, 211, 252, .24), transparent 25%), #05070d;
    transition: opacity .55s ease, transform .55s ease;
}

.boot-screen.hide {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none;
}

.boot-orb {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(125, 211, 252, .9), rgba(167, 243, 208, .75));
    box-shadow: 0 0 70px rgba(125, 211, 252, .52);
    animation: bootPulse 1.4s ease-in-out infinite alternate;
}

.boot-logo {
    font-size: 48px;
    font-weight: 800;
}

.boot-loading {
    color: var(--muted);
    font-size: 14px;
}

.desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    user-select: none;
}

.wallpaper,
.wallpaper-vignette {
    position: absolute;
    inset: 0;
}

.wallpaper {
    background:
        linear-gradient(130deg, rgba(8, 12, 22, .15), rgba(3, 7, 18, .22)),
        url("../wallpaper/bg.jpg"),
        radial-gradient(circle at 20% 25%, #18324a, transparent 34%),
        radial-gradient(circle at 82% 20%, #334155, transparent 29%),
        linear-gradient(145deg, #08111f, #101827 46%, #0b1220);
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
}

.wallpaper-vignette {
    background:
        radial-gradient(circle at 50% 45%, transparent 0 40%, rgba(0, 0, 0, .32) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, .16), rgba(0, 0, 0, .46));
    pointer-events: none;
}

.license-watermark {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 4200;
    max-width: min(360px, calc(100vw - 36px));
    padding: 7px 10px;
    border-radius: 8px;
    pointer-events: none;
    user-select: none;
    color: rgba(255, 255, 255, .36);
    background: rgba(5, 7, 13, .14);
    border: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(5px);
    font-size: clamp(11px, 1.1vw, 13px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .01em;
    text-align: right;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
    mix-blend-mode: screen;
}

.menubar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--menubar-height);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: rgba(7, 10, 18, .42);
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    backdrop-filter: blur(22px) saturate(150%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
}

.menubar-left,
.menubar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
}

.menu-mark,
.menu-item,
.menu-status,
.menu-clock {
    height: 26px;
    border: 0;
    border-radius: 7px;
    padding: 0 9px;
    background: transparent;
    color: rgba(255, 255, 255, .88);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.menu-mark {
    display: grid;
    place-items: center;
    width: 28px;
    padding: 0;
    background: rgba(255, 255, 255, .10);
}

.menu-item.active,
.menu-item:hover,
.menu-clock:hover,
.menu-status:hover {
    background: rgba(255, 255, 255, .10);
}

.menubar-dropdown {
    position: fixed;
    z-index: 8000;
    min-width: 200px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(10, 16, 28, .94);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
    display: grid;
    gap: 4px;
}

.menubar-dropdown button {
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;
    background: transparent;
    color: inherit;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.menubar-dropdown button:hover {
    background: rgba(255, 255, 255, .1);
}

.desktop-icons {
    position: absolute;
    top: 68px;
    left: 24px;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 94px));
    grid-auto-flow: row;
    gap: 14px 16px;
    max-width: min(560px, calc(100vw - 360px));
    max-height: calc(100dvh - var(--menubar-height) - var(--dock-height) - 56px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
    padding-bottom: 8px;
}

.desktop-icon {
    width: 94px;
    min-height: 94px;
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 10px 8px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    color: inherit;
    cursor: default;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.desktop-icon:hover,
.desktop-icon.selected {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .18);
    backdrop-filter: blur(14px);
}

.desktop-icon:active {
    transform: scale(.96);
}

.desktop-icon img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .34));
    pointer-events: none;
}

.desktop-icon span {
    max-width: 92px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.22;
    text-align: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(2, 8, 20, .58);
    backdrop-filter: blur(6px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, .85), 0 0 12px rgba(0, 0, 0, .45);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.widget-rail {
    position: absolute;
    top: 64px;
    right: 24px;
    z-index: 40;
    width: 286px;
    display: grid;
    gap: 14px;
}

.desktop-widget {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 22px;
    background: rgba(11, 18, 32, .34);
    backdrop-filter: blur(26px) saturate(150%);
    box-shadow: var(--shadow-soft);
}

.desktop-widget.compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.widget-kicker {
    margin-bottom: 4px;
    color: var(--faint);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.widget-title {
    font-size: 18px;
    font-weight: 800;
}

.widget-meter {
    height: 8px;
    margin: 18px 0 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .11);
}

.widget-meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .35s ease;
}

.widget-foot {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.live-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 18px var(--success);
}

.window-area {
    position: absolute;
    inset: var(--menubar-height) 0 var(--dock-height);
    z-index: 300;
    pointer-events: none;
}

.os-window {
    position: absolute;
    top: 72px;
    left: 220px;
    width: min(920px, calc(100vw - 80px));
    height: min(620px, calc(100vh - 150px));
    min-width: 360px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--stroke);
    border-radius: 20px;
    background: rgba(15, 23, 42, .62);
    backdrop-filter: blur(34px) saturate(145%);
    box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255, 255, 255, .10);
    pointer-events: auto;
    transform-origin: 50% 88%;
    transition: box-shadow .2s ease, opacity .2s ease, transform .22s cubic-bezier(.2, .8, .2, 1), filter .2s ease;
}

.os-window.opening {
    animation: windowOpen .24s cubic-bezier(.2, .8, .2, 1);
}

.os-window.inactive {
    filter: saturate(.78) brightness(.86);
    box-shadow: 0 18px 64px rgba(0, 0, 0, .36);
}

.os-window.minimizing {
    opacity: 0;
    transform: translateY(120px) scale(.72);
}

.os-window.maximized,
.os-window.snap-left,
.os-window.snap-right {
    transition: inset .2s ease, width .2s ease, height .2s ease, transform .2s ease;
}

.window-titlebar {
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    grid-template-columns: 82px 1fr 82px;
    align-items: center;
    padding: 0 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .025));
    cursor: grab;
}

.window-titlebar:active {
    cursor: grabbing;
}

.window-titlebar-minimize {
    display: none;
}

.traffic-lights {
    display: flex;
    align-items: center;
    gap: 8px;
}

.traffic-light {
    width: 13px;
    height: 13px;
    min-width: 32px;
    min-height: 32px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    margin: -9px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
    cursor: pointer;
    flex-shrink: 0;
}

.traffic-light::before {
    content: "";
    display: block;
    width: 13px;
    height: 13px;
    margin: 9px;
    border-radius: 50%;
    box-shadow: inherit;
}

.traffic-light.close::before { background: var(--danger); }
.traffic-light.minimize::before { background: var(--warning); }
.traffic-light.maximize::before { background: var(--success); }

.traffic-light.close,
.traffic-light.minimize,
.traffic-light.maximize {
    background: transparent;
    box-shadow: none;
}

.os-window.maximized .traffic-light.maximize::before {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), inset 0 0 0 4px rgba(0, 0, 0, .22);
}

.window-title {
    justify-self: center;
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
    font-weight: 800;
}

.window-content {
    flex: 1;
    overflow: auto;
    user-select: text;
}

.window-statusbar {
    height: 28px;
    flex: 0 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .54);
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, .025);
}

.resize-handle {
    position: absolute;
    z-index: 6;
}

.resize-handle.n { top: -4px; left: 12px; right: 12px; height: 8px; cursor: ns-resize; }
.resize-handle.s { bottom: -4px; left: 12px; right: 12px; height: 8px; cursor: ns-resize; }
.resize-handle.e { top: 12px; right: -4px; bottom: 12px; width: 8px; cursor: ew-resize; }
.resize-handle.w { top: 12px; left: -4px; bottom: 12px; width: 8px; cursor: ew-resize; }
.resize-handle.ne { top: -4px; right: -4px; width: 16px; height: 16px; cursor: nesw-resize; }
.resize-handle.nw { top: -4px; left: -4px; width: 16px; height: 16px; cursor: nwse-resize; }
.resize-handle.se { right: -4px; bottom: -4px; width: 16px; height: 16px; cursor: nwse-resize; }
.resize-handle.sw { left: -4px; bottom: -4px; width: 16px; height: 16px; cursor: nesw-resize; }

.dock {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 8000;
    min-height: 68px;
    max-width: min(96vw, 720px);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    align-content: flex-end;
    gap: 7px;
    row-gap: 6px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 24px;
    background: rgba(8, 13, 24, .45);
    backdrop-filter: blur(30px) saturate(170%);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .12);
    transform: translateX(-50%);
}

.dock-item {
    position: relative;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 15px;
    background: rgba(255, 255, 255, .08);
    transform-origin: 50% 100%;
    transition: width .14s ease, height .14s ease, transform .14s ease, background .16s ease;
}

.dock-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    pointer-events: none;
}

.dock-item:hover,
.dock-item.near {
    background: rgba(255, 255, 255, .14);
}

.dock-item.running::after {
    content: "";
    position: absolute;
    bottom: -7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .86);
}

.dock-item.running.minimized::after {
    background: var(--warning);
    width: 6px;
    height: 6px;
}

.dock-item.running.minimized {
    opacity: 0.72;
    transform: translateY(2px) scale(0.94);
}

.dock-item.bounce {
    animation: dockBounce .58s cubic-bezier(.22, 1.35, .36, 1);
}

.dock-separator {
    width: 1px;
    height: 42px;
    margin: 0 4px;
    background: rgba(255, 255, 255, .22);
}

.notification-panel,
.context-menu {
    position: absolute;
    z-index: 7000;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 18px;
    background: rgba(10, 16, 28, .68);
    backdrop-filter: blur(28px) saturate(150%);
    box-shadow: var(--shadow-deep);
}

.notification-panel {
    right: 16px;
    top: 44px;
    width: 320px;
    max-height: 430px;
    display: none;
    padding: 16px;
}

.notification-panel.open {
    display: block;
    animation: menuIn .18s ease;
}

.panel-title {
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 800;
}

.notification-list {
    display: grid;
    gap: 10px;
}

.notification-item,
.toast {
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 14px;
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .86);
    font-size: 13px;
    line-height: 1.45;
}

.context-menu {
    min-width: 190px;
    display: none;
    padding: 7px;
}

.context-menu.open {
    display: block;
    animation: menuIn .12s ease;
}

.context-menu button {
    width: 100%;
    height: 34px;
    border: 0;
    border-radius: 10px;
    padding: 0 10px;
    background: transparent;
    color: rgba(255, 255, 255, .86);
    text-align: left;
    font-size: 13px;
    font-weight: 700;
}

.context-menu button:hover {
    background: rgba(255, 255, 255, .11);
}

.toast-layer {
    position: fixed;
    right: 18px;
    bottom: calc(var(--dock-height) + 20px);
    z-index: 9000;
    display: grid;
    gap: 10px;
    max-width: min(360px, calc(100vw - 24px));
    pointer-events: none;
}

.toast {
    min-width: 250px;
    background: rgba(9, 15, 27, .78);
    backdrop-filter: blur(24px);
    animation: toastIn .24s ease;
}

.app-shell {
    min-height: 100%;
    padding: 22px;
    color: rgba(255, 255, 255, .90);
}

/* Media apps: fill window, less padding */
.window-content:has(.music-app),
.window-content:has(.cinema-app) {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-shell.music-app,
.app-shell.cinema-app {
    flex: 1;
    min-height: 0;
}

.app-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.app-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
}

.app-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.app-button,
.app-input {
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 11px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.app-button {
    padding: 0 13px;
    font-weight: 800;
    cursor: pointer;
}

.app-button.primary {
    border-color: rgba(125, 211, 252, .35);
    background: rgba(125, 211, 252, .22);
}

.app-input {
    min-width: 220px;
    padding: 0 12px;
    outline: none;
}

.surface {
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 16px;
    background: rgba(255, 255, 255, .045);
}

/*
========================================
DVOS OPERATING SYSTEM POLISH
========================================
*/

body {
    letter-spacing: 0;
}

.desktop::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(circle at 18% 18%, rgba(125, 211, 252, .20), transparent 23%),
        radial-gradient(circle at 82% 18%, rgba(167, 243, 208, .12), transparent 25%),
        linear-gradient(115deg, rgba(255, 255, 255, .06), transparent 32% 68%, rgba(255, 255, 255, .035));
    pointer-events: none;
    mix-blend-mode: screen;
}

.desktop::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 180px;
    z-index: 3;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .34));
    pointer-events: none;
}

.wallpaper {
    filter: saturate(1.05) contrast(1.02);
}

.wallpaper-vignette {
    background:
        radial-gradient(circle at 50% 42%, transparent 0 36%, rgba(0, 0, 0, .28) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, .50));
}

.menubar {
    height: 34px;
    padding: 0 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(8, 13, 24, .34));
    border-bottom-color: rgba(255, 255, 255, .16);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .10) inset, 0 10px 34px rgba(0, 0, 0, .18);
}

.menu-mark {
    width: 30px;
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .08)),
        rgba(255, 255, 255, .09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .20);
}

.menu-item,
.menu-status,
.menu-clock {
    border-radius: 8px;
    color: rgba(255, 255, 255, .86);
    font-size: 12px;
    font-weight: 700;
}

.menu-item.active {
    background: rgba(255, 255, 255, .14);
}

.desktop-icons {
    top: 62px;
    left: 22px;
    gap: 12px;
}

.desktop-icon {
    min-height: 90px;
    border-radius: 14px;
}

.desktop-icon:hover,
.desktop-icon.selected {
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 16px 34px rgba(0, 0, 0, .20);
}

.desktop-icon img {
    width: 58px;
    height: 58px;
    filter: drop-shadow(0 16px 16px rgba(0, 0, 0, .34));
}

.desktop-icon span {
    padding: 2px 7px;
    border-radius: 7px;
    background: rgba(0, 0, 0, .18);
    backdrop-filter: blur(10px);
}

.widget-rail {
    top: 58px;
    right: 18px;
}

.desktop-widget {
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .13), rgba(12, 18, 32, .32));
    box-shadow: 0 24px 70px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .14);
}

.os-window {
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .025)),
        rgba(11, 18, 32, .66);
    border-color: rgba(255, 255, 255, .18);
    box-shadow:
        0 42px 130px rgba(0, 0, 0, .52),
        0 0 0 1px rgba(255, 255, 255, .05) inset,
        0 1px 0 rgba(255, 255, 255, .18) inset;
}

.os-window:not(.inactive) {
    box-shadow:
        0 44px 136px rgba(0, 0, 0, .55),
        0 0 0 1px rgba(125, 211, 252, .16),
        0 0 42px rgba(125, 211, 252, .10),
        0 1px 0 rgba(255, 255, 255, .22) inset;
}

.os-window.inactive {
    opacity: .88;
    transform: scale(.995);
}

.window-titlebar {
    height: 46px;
    flex-basis: 46px;
    grid-template-columns: 76px 1fr 76px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .035)),
        rgba(255, 255, 255, .03);
}

.traffic-light {
    width: 12px;
    height: 12px;
}

.traffic-light:hover {
    filter: brightness(1.12);
    transform: scale(1.08);
}

.window-title {
    color: rgba(255, 255, 255, .82);
    font-size: 12px;
    letter-spacing: 0;
}

.window-content {
    background:
        radial-gradient(circle at 50% 0, rgba(255, 255, 255, .05), transparent 28%),
        rgba(3, 7, 18, .10);
}

.window-statusbar {
    height: 26px;
    flex-basis: 26px;
}

.dock {
    bottom: 13px;
    min-height: 76px;
    padding: 11px 13px 12px;
    gap: 8px;
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .06)),
        rgba(10, 16, 28, .48);
    border-color: rgba(255, 255, 255, .24);
    box-shadow:
        0 26px 80px rgba(0, 0, 0, .42),
        0 1px 0 rgba(255, 255, 255, .24) inset,
        0 -1px 0 rgba(255, 255, 255, .06) inset;
}

.dock::before {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    top: 7px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
}

.dock-item {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .06)),
        rgba(255, 255, 255, .07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 12px 24px rgba(0, 0, 0, .18);
}

.dock-item img {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .25));
}

.dock-item.running::after {
    bottom: -8px;
    width: 5px;
    height: 5px;
    box-shadow: 0 0 10px rgba(255, 255, 255, .55);
}

.dock-separator {
    height: 44px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .30), transparent);
}

.notification-panel,
.context-menu {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05)),
        rgba(8, 13, 24, .68);
    border-color: rgba(255, 255, 255, .18);
}

.toast {
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .055)),
        rgba(8, 13, 24, .78);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .14);
}

.app-shell {
    padding: 20px;
}

.app-title {
    font-size: 22px;
}

.app-button,
.app-input {
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .045)),
        rgba(255, 255, 255, .055);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}

.app-button:hover {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .07)),
        rgba(255, 255, 255, .08);
}

.app-button.primary {
    color: #e0f7ff;
    background:
        linear-gradient(180deg, rgba(125, 211, 252, .28), rgba(125, 211, 252, .14)),
        rgba(125, 211, 252, .10);
}

.surface {
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .025)),
        rgba(255, 255, 255, .035);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.desktop-icon img,
.dock-item img {
    display: none;
}

.desktop-icon::before,
.dock-item::before {
    content: "DV";
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .94);
    font-weight: 900;
    letter-spacing: 0;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .05)),
        linear-gradient(145deg, #0ea5e9, #134e4a);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .24),
        inset 0 -10px 22px rgba(0, 0, 0, .18),
        0 14px 24px rgba(0, 0, 0, .26);
}

.desktop-icon::before {
    width: 58px;
    height: 58px;
    border-radius: 15px;
    font-size: 18px;
}

.dock-item::before {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 12px;
}

.desktop-icon[data-app="files"]::before,
.dock-item[data-app="files"]::before {
    content: "FI";
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .06)),
        linear-gradient(145deg, #38bdf8, #1d4ed8);
}

.desktop-icon[data-app="movies"]::before,
.dock-item[data-app="movies"]::before {
    content: "MV";
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .05)),
        linear-gradient(145deg, #fb7185, #7c3aed);
}

.desktop-icon[data-app="monitor"]::before,
.dock-item[data-app="monitor"]::before {
    content: "MN";
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .06)),
        linear-gradient(145deg, #34d399, #0f766e);
}

.desktop-icon[data-app="docker"]::before,
.dock-item[data-app="docker"]::before {
    content: "DK";
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, .06)),
        linear-gradient(145deg, #60a5fa, #1e40af);
}

.desktop-icon[data-app="settings"]::before,
.dock-item[data-app="settings"]::before {
    content: "ST";
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .07)),
        linear-gradient(145deg, #94a3b8, #334155);
}

.desktop-icon[data-app="ai"]::before,
.dock-item[data-app="ai"]::before {
    content: "AI";
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, .06)),
        linear-gradient(145deg, #a78bfa, #0891b2);
}

.desktop-icon[data-app="music"]::before,
.dock-item[data-app="music"]::before {
    content: "MU";
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, .06)),
        linear-gradient(145deg, #f472b6, #7c3aed);
}

.desktop-icon[data-app="codex"]::before,
.dock-item[data-app="codex"]::before {
    content: "CX";
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, .06)),
        linear-gradient(145deg, #22d3ee, #2563eb);
}

@keyframes bootPulse {
    to { transform: scale(1.08); filter: brightness(1.16); }
}

@keyframes windowOpen {
    from { opacity: 0; transform: translateY(24px) scale(.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dockBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    42% { transform: translateY(-18px) scale(1.08); }
    72% { transform: translateY(-7px) scale(1.02); }
}

@keyframes menuIn {
    from { opacity: 0; transform: translateY(-8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    :root {
        --dock-height: 72px;
    }

    .dock {
        position: fixed;
        left: 50%;
        bottom: max(10px, env(safe-area-inset-bottom));
        z-index: 6000;
        max-width: calc(100vw - 16px);
        transform: translateX(-50%);
    }

    .menu-item:nth-of-type(n+3),
    .menu-status:nth-of-type(n+3),
    .widget-rail {
        display: none;
    }

    .desktop-icons {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        max-width: none;
        left: 12px;
        right: 12px;
        top: 54px;
        max-height: calc(100dvh - var(--menubar-height) - var(--dock-height) - 80px);
    }

    .desktop-icon {
        width: auto;
    }

    .os-window:not(.maximized) {
        min-width: 0;
        border-radius: 16px;
    }

    .os-window.maximized {
        left: 6px !important;
        top: 6px !important;
        width: calc(100% - 12px) !important;
        height: calc(100% - 12px) !important;
        border-radius: 14px;
    }

    .resize-handle {
        display: none;
    }

    .window-titlebar {
        cursor: default;
    }

    .dock {
        width: calc(100% - 32px);
        max-width: 90%;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .menubar {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
}

/* ============================================================
   MOBILE / TABLET — ≤ 768px
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --mobile-window-margin: 16px;
    }

    .desktop-icons {
        z-index: 10;
        left: var(--mobile-window-margin);
        right: var(--mobile-window-margin);
        width: auto;
        max-width: none;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
        top: calc(var(--menubar-height) + 12px);
        bottom: calc(var(--dock-height) + 20px + env(safe-area-inset-bottom));
        max-height: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        align-content: start;
        pointer-events: auto;
        transition: opacity .2s ease, visibility .2s ease;
    }

    /* Hide launcher while an app window is open (dock stays visible) */
    .desktop.apps-active .desktop-icons {
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
    }

    .window-area {
        z-index: 400;
    }

    .dock {
        z-index: 8000;
        width: calc(100% - 32px);
        max-width: 90%;
        margin: 0 auto;
        left: 50%;
        right: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        transform: translateX(-50%);
    }

    .dock-item {
        width: 40px;
        height: 40px;
        flex: 0 0 auto;
    }

    .dock-item::before {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .dock-separator {
        height: 34px;
        flex-shrink: 0;
    }

    /* App windows: inset from screen edges */
    .os-window {
        left: var(--mobile-window-margin) !important;
        right: var(--mobile-window-margin);
        top: calc(var(--menubar-height) + 8px) !important;
        width: calc(100% - var(--mobile-window-margin) * 2) !important;
        max-width: calc(100vw - var(--mobile-window-margin) * 2);
        margin: 0 auto;
        height: calc(100dvh - var(--menubar-height) - var(--dock-height) - 24px) !important;
        min-width: 0 !important;
        min-height: 0 !important;
        border-radius: 16px !important;
        box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
    }

    .os-window.maximized {
        left: var(--mobile-window-margin) !important;
        top: calc(var(--menubar-height) + 8px) !important;
        width: calc(100% - var(--mobile-window-margin) * 2) !important;
        height: calc(100dvh - var(--menubar-height) - var(--dock-height) - 24px) !important;
        border-radius: 16px !important;
    }
}

/* Phones ≤ 540px — 2-column launcher */
@media (max-width: 540px) {
    :root {
        --menubar-height: 38px;
        --dock-height: 64px;
        --mobile-window-margin: 16px;
    }

    .desktop-icons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    /* Hide resize handles & snap on phones */
    .resize-handle,
    .snap-indicator { display: none !important; }

    /* Titlebar: compact + touch-friendly controls */
    .window-titlebar {
        height: 44px;
        flex-basis: 44px;
        grid-template-columns: 100px 1fr 48px;
        cursor: default;
        touch-action: pan-y;
    }

    .traffic-lights {
        gap: 4px;
    }

    .traffic-light {
        width: 14px;
        height: 14px;
        min-width: 36px;
        min-height: 36px;
        margin: -11px;
    }

    .traffic-light::before {
        width: 14px;
        height: 14px;
        margin: 11px;
    }

    .window-titlebar-minimize {
        display: grid;
        place-items: center;
        width: 40px;
        height: 36px;
        margin-left: auto;
        border: 1px solid rgba(255, 255, 255, .16);
        border-radius: 10px;
        background: rgba(255, 255, 255, .08);
        color: rgba(255, 255, 255, .9);
        font-size: 18px;
        font-weight: 800;
        line-height: 1;
        cursor: pointer;
        touch-action: manipulation;
    }

    .window-statusbar {
        display: none;
    }

    .window-title {
        font-size: 13px;
    }

    /* Window content: touch-scroll */
    .window-content {
        -webkit-overflow-scrolling: touch;
        overflow: auto;
        overscroll-behavior: contain;
        touch-action: pan-y;
        min-height: 0;
    }

    .os-window.minimized-away {
        display: none !important;
    }

    /* === Dock: smaller icons, horizontal scroll === */
    html,
    body,
    .desktop {
        height: 100dvh;
        min-height: 100dvh;
    }

    /* Dock: fixed, single row, horizontal scroll */
    .dock {
        position: fixed;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: calc(100% - 32px);
        max-width: 90%;
        min-height: 52px;
        max-height: 56px;
        gap: 6px;
        padding: 6px 10px;
        padding-bottom: max(6px, env(safe-area-inset-bottom));
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .dock-item {
        width: 38px;
        height: 38px;
        touch-action: manipulation;
    }

    .dock-item img {
        width: 28px;
        height: 28px;
    }

    /* === Menubar: hide extras === */
    .menu-item,
    .menu-status { display: none !important; }

    .menu-logo { display: flex; }

    /* Clock stays visible */
    .menu-clock { display: inline-flex !important; }

    /* === App toolbar: compact === */
    .app-toolbar {
        gap: 8px;
        margin-bottom: 10px;
        flex-wrap: wrap;
    }

    .app-title { font-size: 18px; }

    /* === Buttons & inputs: bigger touch targets === */
    .app-button,
    .app-input {
        height: 42px;
        border-radius: 10px;
        font-size: 16px; /* prevent iOS zoom */
    }

    .app-button { padding: 0 14px; }

    .window-content:has(.music-app),
    .window-content:has(.cinema-app) {
        padding: 0;
        overflow-y: auto !important;
        overflow-x: hidden;
        display: block;
    }

    .app-shell.music-app,
    .app-shell.cinema-app {
        padding: 0 !important;
        height: auto;
        min-height: 100%;
        overflow: visible;
    }

    .icon-button {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .desktop-icon {
        width: auto;
        min-height: 72px;
        padding: 8px 6px;
        touch-action: manipulation;
    }

    .desktop-icon span {
        font-size: 11px;
        max-width: 100%;
    }

    .toast-layer {
        left: 10px;
        right: 10px;
        bottom: calc(var(--dock-height) + 14px + env(safe-area-inset-bottom));
        max-width: none;
    }

    .toast {
        font-size: 12px;
        max-height: 4.5em;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .license-watermark {
        right: max(10px, env(safe-area-inset-right));
        bottom: calc(64px + env(safe-area-inset-bottom));
        max-width: min(250px, calc(100vw - 20px));
        padding: 5px 8px;
        font-size: 10.5px;
        opacity: .88;
    }

}

/* Small tablets 541–768px: keep 3-column grid (defined above) */
@media (max-width: 768px) and (min-width: 541px) {
    .app-button,
    .app-input {
        font-size: 16px;
        height: 40px;
    }
}
