/* Use the bundled Windows controls; keep the system chrome in the light theme. */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    min-height: 36px;
    padding: 4px max(8px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: silver;
    box-shadow: inset 0 1px #dfdfdf, inset 0 2px #fff;
    color: #222;
    color-scheme: light;
    font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
    font-size: 11px;
    letter-spacing: .3px;
    user-select: none;
}
#taskbar button { appearance: none; -webkit-appearance: none; color: inherit; }
#taskbar[hidden] { display: none; }
#desktop[hidden] { display: none; }
#desktop-context-menu {
    position: fixed;
    z-index: 1000;
    min-width: 190px;
    box-sizing: border-box;
    padding: 3px;
    color: #222;
    color-scheme: light;
    background: silver;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #dfdfdf, inset -2px -2px grey, inset 2px 2px #fff;
    font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
    font-size: 11px;
    letter-spacing: .3px;
}
#desktop-context-menu[hidden] { display: none; }
#desktop-context-menu [role="menuitem"] {
    display: block;
    width: 100%;
    padding: 7px 18px;
    border: 0;
    box-shadow: none;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
}
#desktop-context-menu [role="menuitem"]:focus {
    outline: none;
    color: #fff;
    background: navy;
}
.desktop-menu-separator { margin: 3px 2px; border-top: 1px solid grey; border-bottom: 1px solid white; }
#start-button, #taskbar .task-button {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 3px 7px;
    text-align: left;
}
#start-button { min-width: 66px; flex-shrink: 0; }
#taskbar img { width: 16px; height: 16px; image-rendering: pixelated; flex-shrink: 0; pointer-events: none; }
#start-button img { width: 20px; height: 20px; }
#start-button[aria-expanded="true"], #taskbar .task-button[aria-pressed="true"] {
    box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px grey;
    background-color: #dfdfdf;
    font-weight: bold;
}
.taskbar-divider { height: 26px; width: 2px; flex-shrink: 0; box-shadow: inset 1px 0 grey, inset -1px 0 white; }
#task-buttons { display: flex; flex: 1; min-width: 0; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
#taskbar .task-button { flex: 0 1 160px; min-width: 54px; }
.task-button span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#taskbar-clock {
    flex-shrink: 0;
    padding: 7px 10px;
    min-width: 58px;
    text-align: center;
    white-space: nowrap;
    box-shadow: inset 1px 1px grey, inset -1px -1px #fff;
}
#start-menu {
    position: absolute;
    bottom: 100%;
    left: max(8px, env(safe-area-inset-left));
    display: flex;
    padding: 3px;
    width: 238px;
    background: silver;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #dfdfdf, inset -2px -2px grey, inset 2px 2px #fff;
}
#start-menu[hidden], .window-container[hidden] { display: none; }
.start-brand {
    background: linear-gradient(0deg, navy, #1084d0);
    color: white;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    padding: 9px 5px;
    font: bold 20px Arial, sans-serif;
}
.start-brand span { font-weight: normal; }
#start-menu [role="menu"] { flex: 1; padding: 2px; }
#start-menu [role="menuitem"] {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    box-shadow: none;
    border: 0;
    text-align: left;
}
#start-menu [role="menuitem"] img { width: 24px; height: 24px; }
#start-menu [role="menuitem"]:focus {
    background: navy;
    color: white;
    outline: none;
}
.start-separator { margin: 3px 2px; border-top: 1px solid grey; border-bottom: 1px solid white; }
.window-container:focus { outline: none; }
.title-bar.inactive { background: linear-gradient(90deg, grey, #b5b5b5); }
[data-window-type="about"] .retro-window { box-sizing: border-box; }
[data-window-type="about"] .title-bar { flex-shrink: 0; }
.retro-window.show-content .about-content { flex: 1; min-height: 0; height: auto; overflow: auto; }
.about-content { padding: 12px; box-sizing: border-box; color: #222; color-scheme: light; }
[data-window-type="about"] .retro-window.measure-about { display: block; visibility: hidden; width: 100%; height: auto; }
.retro-window.measure-about .about-content { display: block; height: auto; }
.about-intro { display: flex; gap: 16px; }
.about-intro > img { width: 40px; height: 40px; flex-shrink: 0; image-rendering: pixelated; }
.about-content h1 { font: bold 20px Arial, sans-serif; margin: 0 0 12px; }
.about-content p { margin-bottom: 12px; line-height: 1.5; }
.about-details { border-top: 1px solid grey; box-shadow: inset 0 1px white; padding-top: 12px; margin-top: 2px; }
.about-details p { margin-bottom: 4px; }
.about-closing { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.about-closing p { margin: 0; }
.about-closing button { flex-shrink: 0; appearance: none; -webkit-appearance: none; color: inherit; }
.about-remember { display: flex; align-items: center; margin-top: 12px; font-size: 11px; }
.about-remember label { cursor: pointer; }
.title-bar-controls button { -webkit-appearance: none; appearance: none; color: #222; }
#shutdown-screen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 24px;
    box-sizing: border-box;
    border: 0;
    background: #000;
    color: #dc8b25;
    outline: none;
    cursor: wait;
    user-select: none;
    text-align: center;
    font: bold clamp(20px, 3vw, 30px)/1.4 Arial, sans-serif;
}
#shutdown-screen[open] { display: grid; place-items: center; }
#shutdown-screen::backdrop { background: #000; }
#shutdown-screen.shutdown-complete { cursor: default; }
@media (max-width: 600px) {
    #taskbar { gap: 4px; }
    #start-button, #taskbar .task-button { height: 36px; }
    #start-button { min-width: 60px; gap: 4px; }
    #taskbar .task-button { min-width: 36px; padding: 4px 6px; }
    #taskbar-clock { min-width: 0; padding: 11px 7px; }
    .title-bar-controls button[aria-label="Minimize"] { background-position: center 18px; }
}
