@font-face {
    font-family: "Win95";
    src:
        url("/assets/fonts/w-95-sans-serif.woff2") format("woff2"),
        url("/assets/fonts/w-95-sans-serif.woff") format("woff");
    font-style: normal;
    font-weight: 400;
}

:root {
    --wallpaper-a: #011901;
    --wallpaper-b: #032703;
    --wallpaper-c: #001100;
    --ui-bg: #c0c0c0;
    --ui-face: #d4d0c8;
    --ui-hi: #ffffff;
    --ui-lo: #808080;
    --ui-deep: #0a0a0a;
    --title-a: #00337f;
    --title-b: #1188ff;
    --text-main: #101010;
    --text-dark: #000000;
    --neon: #56ff56;
    --taskbar-h: 28px;
    --desktop-brightness: 1;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    padding: 0;
}

body {
    font-family: "Win95", "MS Sans Serif", "Tahoma", "Geneva", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 18% 20%, rgba(88, 255, 88, 0.22), rgba(0, 0, 0, 0) 34%),
        radial-gradient(circle at 82% 82%, rgba(90, 230, 90, 0.18), rgba(0, 0, 0, 0) 35%),
        linear-gradient(160deg, var(--wallpaper-a), var(--wallpaper-b) 55%, var(--wallpaper-c));
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

body.theme-hacker-green {
    --wallpaper-a: #011901;
    --wallpaper-b: #032703;
    --wallpaper-c: #001100;
    --title-a: #00337f;
    --title-b: #1188ff;
}

body.theme-win95-classic {
    --wallpaper-a: #0b6f6a;
    --wallpaper-b: #08726d;
    --wallpaper-c: #045b56;
    --title-a: #0a246a;
    --title-b: #3a6ea5;
}

body.theme-amber-terminal {
    --wallpaper-a: #221103;
    --wallpaper-b: #3d2208;
    --wallpaper-c: #140900;
    --title-a: #5f3208;
    --title-b: #9f6115;
}

body.theme-night-ops {
    --wallpaper-a: #060b16;
    --wallpaper-b: #0f1730;
    --wallpaper-c: #070c1d;
    --title-a: #16214f;
    --title-b: #2559a8;
}

.desktop-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 80% 18%, rgba(100, 255, 100, 0.16), rgba(0, 0, 0, 0) 38%),
        linear-gradient(90deg, rgba(25, 65, 25, 0.08), rgba(0, 0, 0, 0) 20%, rgba(25, 65, 25, 0.08) 45%, rgba(0, 0, 0, 0) 70%, rgba(25, 65, 25, 0.08));
    z-index: 0;
}

body.show-scanlines::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(0, 255, 0, 0.08) 0,
        rgba(0, 255, 0, 0.08) 1px,
        transparent 1px,
        transparent 3px
    );
    z-index: 30;
}

body.show-glow::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 110px rgba(0, 255, 0, 0.2);
    z-index: 30;
}

a {
    color: #0046ce;
}

a:hover,
a:focus-visible {
    color: #001b4f;
}

.desktop-shell {
    position: relative;
    height: calc(100vh - var(--taskbar-h));
    padding: 12px 12px 12px;
    overflow: hidden;
    filter: brightness(var(--desktop-brightness));
}

.desktop-icons {
    width: 94px;
    position: relative;
    z-index: 1;
    height: 100%;
}

.desktop-icon {
    border: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 2px;
    text-decoration: none;
    color: #d8ffd8;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    position: absolute;
    width: 72px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.desktop-icon:focus-visible {
    outline: 1px dotted #d8ffd8;
    outline-offset: 2px;
}

body.dense-icons .desktop-icons {
    gap: 4px;
}

body.dense-icons .desktop-icon {
    font-size: 10px;
    width: 64px;
}

.icon-art {
    width: 32px;
    height: 32px;
    border: none;
    background-color: transparent;
    background-size: 32px 32px;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    image-rendering: pixelated;
}

.icon-product { background-image: url("/assets/icons/icon-folder.svg"); }
.icon-computer { background-image: url("/assets/icons/icon-computer.svg"); }
.icon-mail { background-image: url("/assets/icons/icon-mail.svg"); }
.icon-shell { background-image: url("/assets/icons/icon-shell.svg"); }
.icon-control { background-image: url("/assets/icons/icon-control.svg"); }
.icon-elks { background-image: url("/assets/icons/icon-book.svg"); }
.icon-radio { background-image: url("/assets/icons/icon-radio.svg"); }
.icon-chat { background-image: url("/assets/icons/icon-chat.svg"); }

.icon-label {
    background: transparent;
    border: 1px dotted transparent;
    line-height: 1.1;
    padding: 1px 2px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9), 0 0 4px rgba(0,0,0,0.6);
}

.desktop-icon:hover .icon-label {
    text-decoration: underline;
}

.desktop-icon:focus-visible .icon-label,
.desktop-icon.selected .icon-label {
    border: 1px dotted #fff;
    background: #000080;
    color: #ffffff;
    text-shadow: none;
}

.desktop-icon.selected .icon-art {
    filter: brightness(0.7) sepia(1) saturate(3) hue-rotate(200deg);
}

.desktop-icon.dragging {
    opacity: 0.7;
    z-index: 999;
}

.desktop-icon:focus-visible {
    outline: none;
}

.window-layer {
    position: absolute;
    inset: 8px 8px 8px 104px;
    pointer-events: none;
    z-index: 1;
}

.app-window {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: var(--ui-bg);
    border: 1px solid #000;
    box-shadow:
        inset 1px 1px 0 #dfdfdf,
        inset -1px -1px 0 #808080,
        inset 2px 2px 0 #fff,
        inset -2px -2px 0 #404040;
    padding: 3px;
    min-width: 280px;
    min-height: 180px;
    pointer-events: auto;
    animation: window-pop 180ms ease-out;
    resize: both;
    overflow: hidden;
}

.app-window.minimized,
.app-window.closed {
    display: none;
}

.app-window.maximized {
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    resize: none;
    border: none;
    box-shadow:
        inset 1px 1px 0 #dfdfdf,
        inset -1px -1px 0 #808080,
        inset 2px 2px 0 #fff,
        inset -2px -2px 0 #404040;
}

.app-window.opening {
    animation: window-pop 170ms ease-out;
}

.app-window.inactive .window-titlebar {
    background: linear-gradient(90deg, #808080, #b0b0b0);
}

.app-window.inactive .window-title {
    color: #d4d0c8;
}

.window-titlebar {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 18px;
    padding: 1px 2px 1px 2px;
    color: #ffffff;
    background: linear-gradient(90deg, #000080, #1084d0);
    user-select: none;
    cursor: move;
}

.window-titlebar-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
}

.window-title {
    flex: 1;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}

.window-controls {
    display: flex;
    gap: 0px;
    flex-shrink: 0;
}

.wc-btn,
.w95-btn,
.drive-tile,
.mail-folder {
    font: inherit;
    color: var(--text-dark);
    background: var(--ui-face);
    border-top: 2px solid var(--ui-hi);
    border-left: 2px solid var(--ui-hi);
    border-right: 2px solid var(--ui-deep);
    border-bottom: 2px solid var(--ui-deep);
}

.wc-btn {
    width: 16px;
    height: 14px;
    padding: 0;
    font-size: 7px;
    font-weight: 700;
    line-height: 1;
    cursor: default;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ui-bg);
    border-top: 1px solid #fff;
    border-left: 1px solid #fff;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf;
    image-rendering: pixelated;
}

.wc-btn:active {
    border-top: 1px solid #000;
    border-left: 1px solid #000;
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
    box-shadow: inset 1px 1px 0 #808080;
    padding: 1px 0 0 1px;
}

.w95-btn,
.start-item,
.drive-tile,
.mail-folder {
    padding: 4px 8px;
    font-size: 12px;
}

.w95-btn:active,
.drive-tile:active,
.mail-folder:active,
.wc-btn:active {
    border-top-color: var(--ui-lo);
    border-left-color: var(--ui-lo);
    border-right-color: var(--ui-hi);
    border-bottom-color: var(--ui-hi);
}

.window-content {
    padding: 8px;
    overflow: auto;
    flex: 1;
    min-height: 0;
    background: var(--ui-bg);
    font-size: 12px;
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
}

.window-menubar {
    height: 20px;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 0;
    font-size: 11px;
    background: var(--ui-bg);
    border-bottom: 1px solid #808080;
    color: #000;
    flex-shrink: 0;
}

.menu-btn {
    font: inherit;
    font-size: 11px;
    padding: 2px 6px;
    background: transparent;
    border: none;
    color: #000;
    cursor: default;
    height: 100%;
    display: inline-flex;
    align-items: center;
}

.menu-btn:hover,
.menu-btn:focus-visible {
    background: #000080;
    color: #fff;
}

.menu-btn.active {
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-bottom: 1px solid #fff;
    border-right: 1px solid #fff;
    background: var(--ui-bg);
    color: #000;
    padding: 3px 5px 1px 7px;
}

.window-menu-popup {
    position: fixed;
    min-width: 170px;
    padding: 2px;
    display: flex;
    flex-direction: column;
    border: 1px solid #000;
    box-shadow:
        inset 1px 1px 0 #fff,
        inset -1px -1px 0 #808080,
        2px 2px 3px rgba(0,0,0,0.25);
    background: var(--ui-bg);
    z-index: 280;
}

.window-menu-popup[hidden] {
    display: none;
}

.window-menu-item {
    font: inherit;
    font-size: 11px;
    text-align: left;
    width: 100%;
    padding: 3px 22px 3px 24px;
    color: #000;
    background: transparent;
    border: none;
    cursor: default;
    white-space: nowrap;
    position: relative;
}

.window-menu-item:hover,
.window-menu-item:focus-visible {
    background: #000080;
    color: #fff;
    outline: none;
}

.window-menu-sep {
    height: 0;
    border: none;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #fff;
    margin: 2px 2px;
}

.window-menu-item.disabled {
    color: #808080;
    text-shadow: 1px 1px 0 #fff;
}

.window-menu-item.disabled:hover {
    background: transparent;
    color: #808080;
}

.window-menu-item .menu-accel {
    float: right;
    margin-left: 24px;
    color: inherit;
}

.window-menu-item .menu-underline {
    text-decoration: underline;
}

/* Desktop context menu */
.context-menu {
    position: fixed;
    min-width: 170px;
    padding: 2px;
    display: flex;
    flex-direction: column;
    border: 1px solid #000;
    box-shadow:
        inset 1px 1px 0 #fff,
        inset -1px -1px 0 #808080,
        2px 2px 3px rgba(0,0,0,0.25);
    background: var(--ui-bg);
    z-index: 300;
    font-size: 11px;
}

.context-menu[hidden] {
    display: none;
}

.context-menu-item {
    font: inherit;
    font-size: 11px;
    text-align: left;
    width: 100%;
    padding: 3px 22px 3px 24px;
    color: #000;
    background: transparent;
    border: none;
    cursor: default;
    white-space: nowrap;
    position: relative;
}

.context-menu-item:hover,
.context-menu-item:focus-visible {
    background: #000080;
    color: #fff;
    outline: none;
}

.context-menu-item.disabled {
    color: #808080;
    text-shadow: 1px 1px 0 #fff;
}

.context-menu-item.disabled:hover {
    background: transparent;
    color: #808080;
}

.context-menu-item .menu-check {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
}

.context-menu-sep {
    height: 0;
    border: none;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #fff;
    margin: 2px 2px;
}

/* Win95 resize gripper (bottom-right corner of windows) */
.window-gripper {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 12px;
    height: 12px;
    cursor: nwse-resize;
    z-index: 2;
    background-image:
        linear-gradient(135deg,
            transparent 0%, transparent 30%,
            #808080 30%, #808080 35%,
            #fff 35%, #fff 40%,
            transparent 40%, transparent 50%,
            #808080 50%, #808080 55%,
            #fff 55%, #fff 60%,
            transparent 60%, transparent 70%,
            #808080 70%, #808080 75%,
            #fff 75%, #fff 80%,
            transparent 80%);
}

.app-window.maximized .window-gripper {
    display: none;
}

/* Win95 window status bar */
.window-statusbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 1px 2px;
    font-size: 11px;
    flex-shrink: 0;
    background: var(--ui-bg);
}

.statusbar-section {
    padding: 1px 4px;
    flex: 1;
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 14px;
}

.statusbar-section.fixed {
    flex: 0 0 auto;
    min-width: 60px;
    text-align: center;
}

/* Win95 Shut Down dialog */
.shutdown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.15);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shutdown-dialog {
    width: 340px;
    background: var(--ui-bg);
    border: 1px solid #000;
    box-shadow:
        inset 1px 1px 0 #dfdfdf,
        inset -1px -1px 0 #808080,
        inset 2px 2px 0 #fff,
        inset -2px -2px 0 #404040;
    padding: 3px;
}

.shutdown-titlebar {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 18px;
    padding: 1px 2px;
    color: #ffffff;
    background: linear-gradient(90deg, #000080, #1084d0);
    user-select: none;
    cursor: default;
}

.shutdown-titlebar .window-title {
    flex: 1;
    font-size: 11px;
    font-weight: 700;
}

.shutdown-body {
    padding: 14px 16px 10px;
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    align-items: start;
}

.shutdown-icon {
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
    /* Win95 question mark icon via inline SVG */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='14' fill='%23000080'/%3E%3Ctext x='16' y='22' text-anchor='middle' font-family='sans-serif' font-size='20' font-weight='bold' fill='%23fff'%3E%3F%3C/text%3E%3C/svg%3E");
}

.shutdown-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shutdown-options p {
    margin: 0 0 4px;
    font-size: 12px;
}

.shutdown-radio-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0 0 6px;
}

.shutdown-radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    cursor: default;
}

.shutdown-radio-group input[type="radio"] {
    margin: 0;
    accent-color: #000080;
}

.shutdown-buttons {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    padding: 0 16px 12px;
}

.shutdown-buttons .w95-btn {
    min-width: 72px;
    text-align: center;
    padding: 4px 8px;
}

.shutdown-buttons .w95-btn.default-btn {
    border: 1px dotted #000;
    outline: 1px solid #000;
    outline-offset: -4px;
}

/* Safe-to-turn-off screen */
.shutdown-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #000;
    color: #ff8c00;
    font-family: sans-serif;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
}

.lead {
    margin: 0 0 8px;
    line-height: 1.35;
}

.bullet-log {
    margin: 0;
    padding-left: 18px;
}

.bullet-log li {
    margin-bottom: 4px;
}

.button-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.drive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.explorer-shell {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 4px;
    min-height: 100%;
}

.explorer-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 2px;
    border-bottom: 1px solid #808080;
    background: var(--ui-bg);
}

.explorer-address {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 4px;
    border-bottom: 1px solid #808080;
    background: var(--ui-bg);
}

.explorer-address input {
    font: inherit;
    background: #fff;
    padding: 2px 5px;
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff,
        inset 2px 2px 0 #000;
}

.explorer-main {
    min-height: 0;
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 5px;
}

.explorer-sidebar {
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff;
    background: #fff;
    padding: 6px;
    overflow: auto;
}

.explorer-sidebar h3 {
    margin: 0 0 4px;
    font-size: 11px;
    color: #003f8a;
}

.explorer-sidebar ul {
    margin: 0 0 8px;
    padding-left: 16px;
    font-size: 11px;
}

.explorer-sidebar li {
    margin-bottom: 2px;
}

.drive-grid-explorer {
    align-content: start;
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff;
    background: #fff;
    padding: 6px;
    overflow: auto;
}

.drive-tile {
    text-decoration: none;
    display: grid;
    gap: 2px;
    background: #efefef;
    position: relative;
    align-content: center;
    min-height: 52px;
    text-align: left;
    padding-left: 40px;
}

.drive-tile::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    background: url("/assets/icons/icon-hdd.svg") center / contain no-repeat;
}

.drive-tile[data-drive-kind="folder"]::before {
    background-image: url("/assets/icons/icon-folder.svg");
}

.drive-tile[data-drive-kind="floppy"]::before {
    background-image: url("/assets/icons/icon-floppy.svg");
}

.drive-tile[data-drive-kind="book"]::before {
    background-image: url("/assets/icons/icon-book.svg");
}

.drive-tile[data-drive-kind="mail"]::before {
    background-image: url("/assets/icons/icon-mail.svg");
}

.drive-tile[data-drive-kind="audio"]::before {
    background-image: url("/assets/icons/icon-radio.svg");
}

.drive-tile[data-drive-kind="net"]::before {
    background-image: url("/assets/icons/icon-chat.svg");
}

.drive-tile[data-drive-kind="control"]::before {
    background-image: url("/assets/icons/icon-control.svg");
}

.drive-icon {
    display: inline-block;
    font-weight: 700;
    color: #004ea8;
}

.drive-label {
    color: #111;
}

.explorer-statusbar {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 4px;
    font-size: 11px;
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff;
    background: var(--ui-bg);
}

.fine-note {
    margin: 8px 0 0;
    font-size: 11px;
    color: #333;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    gap: 8px;
}

.photo-card {
    display: grid;
    gap: 5px;
    text-decoration: none;
    color: #111;
    background: #efefef;
    padding: 4px;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #202020;
    border-bottom: 2px solid #202020;
}

.photo-card img {
    width: 100%;
    height: 104px;
    object-fit: cover;
    border: 1px solid #666;
    background: #000;
}

.photo-card span {
    font-size: 12px;
    font-weight: 700;
}

.photo-card-btn {
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.product-app-window .window-content {
    overflow: auto;
}

.mail-window {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 6px;
}

.mail-toolbar {
    display: flex;
    gap: 6px;
}

.mail-layout {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 7px;
    min-height: 0;
}

.mail-folders {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff;
    padding: 4px;
    background: var(--ui-bg);
}

.mail-folder {
    text-align: left;
}

.mail-folder.active {
    background: #dfe6ff;
}

.mail-main {
    display: grid;
    grid-template-rows: 40% 1fr;
    gap: 7px;
    min-height: 0;
}

.mail-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff;
    background: #fff;
    overflow: auto;
}

.mail-list-item {
    padding: 4px 6px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    font-size: 12px;
}

.mail-list-item:hover {
    background: #d9e8ff;
}

.mail-list-item.selected {
    background: #000080;
    color: #fff;
}

.mail-list-item strong {
    display: block;
}

.mail-preview,
.mail-compose {
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff;
    background: #fff;
    padding: 6px;
    overflow: auto;
}

.mail-preview h3 {
    margin: 0 0 6px;
    font-size: 14px;
}

.mail-preview p {
    margin: 0 0 6px;
    white-space: pre-wrap;
}

.mail-compose {
    display: grid;
    gap: 6px;
}

.mail-compose label {
    display: grid;
    gap: 3px;
    font-size: 12px;
}

.mail-compose input,
.mail-compose textarea,
.shell-input input,
.toggle-line select,
.toggle-line input[type="range"] {
    font: inherit;
    background: #fff;
    padding: 3px 4px;
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff,
        inset 2px 2px 0 #000,
        inset -2px -2px 0 #dfdfdf;
}

.mail-compose input:focus,
.mail-compose textarea:focus,
.shell-input input:focus {
    outline: 1px dotted #000;
    outline-offset: -3px;
}

.mail-compose textarea {
    min-height: 86px;
    resize: vertical;
}

.toggle-line select {
    width: 100%;
    font: inherit;
    font-size: 12px;
    padding: 2px 20px 2px 4px;
    background: #fff;
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff,
        inset 2px 2px 0 #000,
        inset -2px -2px 0 #dfdfdf;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17'%3E%3Crect width='16' height='17' fill='%23c0c0c0'/%3E%3Crect x='0' y='0' width='16' height='1' fill='%23fff'/%3E%3Crect x='0' y='0' width='1' height='17' fill='%23fff'/%3E%3Crect x='15' y='0' width='1' height='17' fill='%23000'/%3E%3Crect x='0' y='16' width='16' height='1' fill='%23000'/%3E%3Crect x='14' y='1' width='1' height='15' fill='%23808080'/%3E%3Crect x='1' y='15' width='14' height='1' fill='%23808080'/%3E%3Cpolygon points='4,6 12,6 8,11' fill='%23000'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 16px 17px;
    cursor: default;
}

.shell-screen {
    height: calc(100% - 34px);
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff,
        inset 2px 2px 0 #000,
        inset -2px -2px 0 #dfdfdf;
    background: #000;
    color: #c0c0c0;
    padding: 4px 6px;
    overflow: auto;
    font-family: "Fixedsys", "Lucida Console", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.25;
}

.shell-input {
    margin-top: 6px;
    font-family: "Lucida Console", "Courier New", monospace;
    font-size: 12px;
}

.shell-line {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px;
}

.shell-line label {
    color: #000;
    font-weight: 700;
}

.shell-line input {
    width: 100%;
}

.shell-cursor {
    color: #0a7a0a;
    font-weight: 700;
    animation: cursor-blink 1s step-end infinite;
    user-select: none;
}

.encyclopedia-window {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 7px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.ency-topbar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ency-topbar input[type="search"] {
    flex: 1;
    min-width: 160px;
    background: #fff;
    padding: 4px 6px;
    font: inherit;
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff,
        inset 2px 2px 0 #000;
}

.ency-layout {
    min-height: 0;
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 8px;
}

.ency-sidebar {
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff;
    background: var(--ui-bg);
    padding: 4px;
}

.ency-sidebar .w95-btn {
    text-align: left;
}

.ency-sidebar .w95-btn.active {
    background: #d9e8ff;
}

.ency-article {
    min-height: 0;
    overflow: auto;
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff;
    background: #fff;
    padding: 8px;
}

.ency-article h2 {
    margin: 0 0 8px;
    font-size: 16px;
}

.ency-article h3 {
    margin: 8px 0 6px;
    font-size: 13px;
}

.ency-article h4 {
    margin: 8px 0 4px;
    font-size: 12px;
    font-weight: 700;
}

.ency-article p {
    margin: 0 0 8px;
    line-height: 1.45;
}

.ency-article ul,
.ency-article ol {
    margin: 0 0 8px;
    padding-left: 18px;
}

.ency-article li {
    margin-bottom: 3px;
    line-height: 1.35;
}

.ency-article a {
    color: #0046ce;
    text-decoration: underline;
}

.ency-article a:hover {
    color: #001b4f;
}

/* Markdown images rendered from GitHub */
.ency-article img {
    max-width: 100%;
    height: auto;
    border: 2px inset #9a9a9a;
    display: block;
    margin: 6px 0;
    background: #f0f0f0;
}

/* Hide badge images inline */
.ency-article img[src*="badge"],
.ency-article img[src*="workflow"] {
    display: inline;
    border: none;
    height: 18px;
    width: auto;
    margin: 0 2px;
    vertical-align: middle;
}

/* Code blocks */
.ency-article pre {
    margin: 6px 0 10px;
    padding: 6px 8px;
    background: #000;
    color: #c0c0c0;
    font-family: "Lucida Console", "Courier New", monospace;
    font-size: 11px;
    line-height: 1.4;
    overflow-x: auto;
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff,
        inset 2px 2px 0 #000;
    white-space: pre-wrap;
    word-break: break-word;
}

.ency-article code {
    font-family: "Lucida Console", "Courier New", monospace;
    font-size: 11px;
    background: #e8e8e8;
    padding: 1px 3px;
    border: 1px solid #b0b0b0;
}

.ency-article pre code {
    background: transparent;
    border: none;
    padding: 0;
}

/* Blockquotes */
.ency-article blockquote {
    margin: 6px 0 10px;
    padding: 4px 8px 4px 12px;
    border-left: 3px solid #000080;
    background: #f0f0ff;
    color: #333;
    font-style: italic;
}

.ency-article blockquote p {
    margin: 0 0 4px;
}

/* Horizontal rule */
.ency-article hr {
    border: none;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #fff;
    margin: 8px 0;
}

/* Tables (for README tables) */
.ency-article table {
    border-collapse: collapse;
    margin: 6px 0 10px;
    font-size: 11px;
    width: 100%;
}

.ency-article th,
.ency-article td {
    padding: 3px 6px;
    text-align: left;
    border: 1px solid #808080;
}

.ency-article th {
    background: var(--ui-bg);
    font-weight: 700;
}

.ency-article td {
    background: #fff;
}

/* Loading / status indicators */
.ency-loading {
    text-align: center;
    padding: 24px 8px;
    color: #555;
    font-size: 12px;
}

.ency-loading p {
    margin: 0;
}

.ency-error {
    color: #990000;
    background: #fff0f0;
    padding: 8px;
    border: 1px solid #cc0000;
    margin: 8px 0;
    font-size: 12px;
}

/* GitHub metadata cards */
.ency-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
    margin: 8px 0 12px;
}

.ency-meta-card {
    padding: 6px 8px;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    background: var(--ui-bg);
    text-align: center;
}

.ency-meta-card .meta-value {
    font-size: 18px;
    font-weight: 700;
    color: #000080;
    display: block;
}

.ency-meta-card .meta-label {
    font-size: 10px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Topic tags */
.ency-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 6px 0 10px;
}

.ency-tag {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    background: #e0e8f0;
    border: 1px solid #8098b0;
    color: #003366;
}

/* Commit / release lists */
.ency-commit-list,
.ency-release-list {
    list-style: none;
    margin: 6px 0;
    padding: 0;
}

.ency-commit-item,
.ency-release-item {
    padding: 6px 8px;
    border-bottom: 1px solid #d0d0d0;
    font-size: 12px;
}

.ency-commit-item:last-child,
.ency-release-item:last-child {
    border-bottom: none;
}

.ency-commit-msg {
    font-weight: 700;
    color: #000;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ency-commit-meta {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
}

.ency-release-tag {
    font-weight: 700;
    font-size: 13px;
    color: #000080;
}

.ency-release-date {
    font-size: 10px;
    color: #666;
    margin-left: 6px;
}

.ency-release-body {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
}

/* Search highlight */
.ency-highlight {
    background: #ffff00;
    color: #000;
    padding: 0 1px;
}

.radio-window {
    display: grid;
    gap: 6px;
    align-content: start;
}

.winamp-shell {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 0;
    background: #232323;
    padding: 0;
    border: 2px solid #3a3a3a;
    border-radius: 2px;
    overflow: hidden;
}

.winamp-main {
    display: grid;
    gap: 0;
    position: relative;
    background: linear-gradient(180deg, #3d3d3d 0%, #282828 6%, #1e1e1e 100%);
    padding: 4px 6px 6px;
}

.winamp-main::before {
    content: "WINAMP";
    position: absolute;
    right: 8px;
    top: 4px;
    width: auto;
    height: auto;
    background: none;
    opacity: 0.5;
    font-size: 8px;
    letter-spacing: 2px;
    color: #9a9a9a;
    font-family: "Lucida Console", "Courier New", monospace;
}

.winamp-caption {
    margin: 0 0 2px;
    color: #7e7e7e;
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.winamp-display {
    border: 2px inset #111;
    background: linear-gradient(180deg, #000000, #0a1a0a);
    color: #00e100;
    min-height: 54px;
    padding: 6px 8px;
    font-family: "Lucida Console", "Courier New", monospace;
    text-shadow: 0 0 6px rgba(0, 225, 0, 0.5);
    position: relative;
}

.winamp-display::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(0, 0, 0, 0.15) 1px,
            rgba(0, 0, 0, 0.15) 2px
        );
    pointer-events: none;
}

.winamp-track {
    margin: 0 0 6px;
    font-size: 11px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    animation: winamp-scroll 12s linear infinite;
}

@keyframes winamp-scroll {
    0%, 20% { transform: translateX(0); }
    80%, 100% { transform: translateX(-30%); }
}

.winamp-status {
    margin: 0;
    font-size: 10px;
    color: #00c800;
}

.winamp-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px 0;
}

.wa-btn {
    min-width: 34px;
    height: 22px;
    font: inherit;
    font-size: 11px;
    font-weight: bold;
    color: #e0e0e0;
    background: linear-gradient(180deg, #4a4a4a, #2a2a2a);
    border-top: 1px solid #666;
    border-left: 1px solid #666;
    border-right: 1px solid #111;
    border-bottom: 1px solid #111;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.wa-btn:hover {
    background: linear-gradient(180deg, #5a5a5a, #3a3a3a);
    color: #fff;
}

.wa-btn:active {
    border-top-color: #111;
    border-left-color: #111;
    border-right-color: #666;
    border-bottom-color: #666;
    background: linear-gradient(180deg, #222, #333);
}

.wa-btn[data-radio-action="play"] {
    color: #00e100;
}

.wa-btn[data-radio-action="stop"] {
    color: #ff6060;
}

.winamp-volume {
    display: grid;
    gap: 2px;
    color: #aaa;
    font-size: 10px;
    padding: 2px 0;
}

.winamp-volume input[type="range"] {
    width: 100%;
    accent-color: #00e100;
}

.winamp-playlist {
    background: linear-gradient(180deg, #0a0a14, #000008);
    color: #00e100;
    padding: 4px 6px;
    min-height: 150px;
    border-left: 1px solid #333;
    font-family: "Lucida Console", "Courier New", monospace;
}

.app-window[data-window-id="radio-player"].winamp-live .winamp-display {
    box-shadow: inset 0 0 20px rgba(0, 225, 0, 0.15);
}

.app-window[data-window-id="radio-player"].winamp-live .winamp-track {
    color: #00ff00;
}

.winamp-playlist ol {
    margin: 4px 0 0;
    padding-left: 16px;
    font-size: 10px;
}

.winamp-playlist li {
    margin-bottom: 3px;
}

.winamp-playlist li::marker {
    color: #00e100;
}

.winamp-playlist .winamp-caption {
    color: #00c800;
    border-bottom: 1px solid #1a1a2a;
    padding-bottom: 2px;
}

.radio-window .fine-note {
    margin-top: 0;
    font-size: 10px;
    color: #666;
}

/* Winamp-style window overrides */
.app-window[data-window-id="radio-player"] .window-content {
    background: #1a1a1a;
    padding: 4px;
}

.app-window[data-window-id="radio-player"] .window-titlebar {
    background: linear-gradient(90deg, #0000a0, #0060d0, #0000a0);
}

.app-window[data-window-id="radio-player"] .window-menubar {
    background: #2a2a2a;
    border-bottom: 1px solid #444;
}

.app-window[data-window-id="radio-player"] .window-menubar .menu-btn {
    color: #ccc;
}

.app-window[data-window-id="radio-player"] .window-menubar .menu-btn:hover {
    color: #fff;
    background: #444;
}

.app-window[data-window-id="radio-player"] .window-statusbar {
    background: #232323;
    color: #888;
    border-top: 1px solid #444;
}

.hexchat-window {
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 7px;
    min-height: 0;
    height: 100%;
}

.hexchat-frame {
    width: 100%;
    height: 100%;
    min-height: 330px;
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff,
        inset 2px 2px 0 #000;
    background: #000;
}

.control-grid {
    display: grid;
    gap: 7px;
    align-content: start;
}

.toggle-line {
    display: grid;
    gap: 3px;
    font-size: 12px;
}

.start-menu {
    position: fixed;
    left: 2px;
    bottom: calc(var(--taskbar-h) + 2px);
    width: 260px;
    overflow: visible;
    display: grid;
    grid-template-columns: 24px 1fr;
    border-top: 2px solid #dfdfdf;
    border-left: 2px solid #dfdfdf;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #000, 2px 2px 3px rgba(0,0,0,0.25);
    background: var(--ui-bg);
    z-index: 200;
}

.start-menu[hidden] {
    display: none;
}

.start-banner {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    background: linear-gradient(0deg, #000080 0%, #0b5ea2 50%, #1084d0 100%);
    color: #d0d0d0;
    font-size: 15px;
    font-weight: 700;
    padding: 8px 3px;
    letter-spacing: 0.08em;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    user-select: none;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}

.start-banner b {
    color: #fff;
}

.start-menu-items {
    display: flex;
    flex-direction: column;
    padding: 2px;
    background: var(--ui-bg);
    overflow: visible;
    position: relative;
}

.start-item {
    text-decoration: none;
    text-align: left;
    margin: 0;
    position: relative;
    padding: 4px 18px 4px 36px;
    display: flex;
    align-items: center;
    width: 100%;
    font-size: 12px;
    border: none;
    background: transparent;
    color: var(--text-dark);
    cursor: default;
    line-height: 1.3;
    min-height: 24px;
}

.start-item:hover,
.start-item:focus-visible {
    background: #000080;
    color: #fff;
    outline: none;
}

.start-item:hover::before,
.start-item:focus-visible::before {
    filter: brightness(10);
}

.start-item:hover::after,
.start-item:focus-visible::after {
    color: #fff;
}

.start-item::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.start-item.has-submenu::after {
    content: "\25B6";
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 8px;
    color: inherit;
}

.start-item.has-submenu {
    position: relative;
    overflow: visible;
}

.start-item[data-start-icon="computer"]::before { background-image: url("/assets/icons/icon-computer.svg"); }
.start-item[data-start-icon="folder"]::before { background-image: url("/assets/icons/icon-folder.svg"); }
.start-item[data-start-icon="mail"]::before { background-image: url("/assets/icons/icon-mail.svg"); }
.start-item[data-start-icon="shell"]::before { background-image: url("/assets/icons/icon-shell.svg"); }
.start-item[data-start-icon="control"]::before { background-image: url("/assets/icons/icon-control.svg"); }
.start-item[data-start-icon="book"]::before { background-image: url("/assets/icons/icon-book.svg"); }
.start-item[data-start-icon="radio"]::before { background-image: url("/assets/icons/icon-radio.svg"); }
.start-item[data-start-icon="chat"]::before { background-image: url("/assets/icons/icon-chat.svg"); }
.start-item[data-start-icon="product"]::before { background-image: url("/assets/icons/icon-folder.svg"); }

/* Win95-style start menu special icons via SVG data URIs */
.start-item[data-start-icon="find"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.5' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3Cline x1='10.5' y1='10.5' x2='14' y2='14' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.start-item[data-start-icon="help"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='2' y='1' width='12' height='14' rx='1' fill='%23ffe066' stroke='%23808000' stroke-width='0.5'/%3E%3Ctext x='8' y='12' text-anchor='middle' font-family='sans-serif' font-size='10' font-weight='bold' fill='%23800080'%3E%3F%3C/text%3E%3C/svg%3E");
}
.start-item[data-start-icon="run"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='1' y='3' width='14' height='10' rx='1' fill='%23c0c0c0' stroke='%23808080' stroke-width='0.5'/%3E%3Crect x='3' y='5' width='10' height='6' fill='%23000'/%3E%3Crect x='4' y='7' width='4' height='1' fill='%23c0c0c0'/%3E%3C/svg%3E");
}
.start-item[data-start-icon="shutdown"]::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='3' y='2' width='10' height='12' rx='1' fill='%23c0c0c0' stroke='%23808080' stroke-width='0.5'/%3E%3Ccircle cx='8' cy='8' r='3' fill='none' stroke='%23800000' stroke-width='1.5'/%3E%3Cline x1='8' y1='4' x2='8' y2='8' stroke='%23800000' stroke-width='1.5'/%3E%3C/svg%3E");
}

.start-sep {
    border: none;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #fff;
    margin: 2px 2px;
    height: 0;
    padding: 0;
}

.start-submenu {
    position: absolute;
    left: calc(100% - 2px);
    top: -4px;
    width: 210px;
    display: none;
    flex-direction: column;
    padding: 2px;
    border-top: 2px solid #dfdfdf;
    border-left: 2px solid #dfdfdf;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #000, 2px 2px 3px rgba(0,0,0,0.25);
    background: var(--ui-bg);
    z-index: 210;
}

.start-item.has-submenu:hover > .start-submenu,
.start-item.has-submenu.submenu-open > .start-submenu {
    display: flex;
}

.start-submenu .start-item {
    padding-left: 30px;
}

.start-submenu .start-item::before {
    left: 6px;
    width: 14px;
    height: 14px;
}

.start-heading {
    font-size: 11px;
    font-weight: 700;
    color: #808080;
    padding: 2px 6px 1px 36px;
    cursor: default;
    user-select: none;
}

.taskbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--taskbar-h);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 3px;
    border-top: 1px solid #fff;
    box-shadow: inset 0 1px 0 #dfdfdf;
    background: var(--ui-bg);
    z-index: 120;
    flex-wrap: nowrap;
}

.start-button {
    min-width: 54px;
    height: 22px;
    font-size: 11px;
    font-weight: 700;
    background: var(--ui-bg);
    position: relative;
    padding: 0 6px 0 24px;
    flex-shrink: 0;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 #808080;
    cursor: default;
    white-space: nowrap;
}

.start-button::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 14px;
    image-rendering: pixelated;
    /* Authentic Win95 waving flag using 4-quadrant colors with slight wave distortion */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' viewBox='0 0 16 14'%3E%3Crect x='1' y='0' width='6' height='5' fill='%23FF0000' rx='0.5'/%3E%3Crect x='8' y='0' width='6' height='5' fill='%2300AA00' rx='0.5'/%3E%3Crect x='1' y='6' width='6' height='5' fill='%230000FF' rx='0.5'/%3E%3Crect x='8' y='6' width='6' height='5' fill='%23FFD800' rx='0.5'/%3E%3Crect x='0' y='0' width='1' height='14' fill='%23000'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.start-button:active,
.start-button.pressed {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #dfdfdf;
    padding: 1px 5px 0 25px;
}

.taskbar-divider {
    width: 2px;
    align-self: stretch;
    margin: 2px 1px;
    border-left: 1px solid #808080;
    border-right: 1px solid #fff;
    flex-shrink: 0;
}

.task-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    flex: 1 1 0%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px;
    height: 100%;
}

.task-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    cursor: default;
    min-width: 80px;
    max-width: 180px;
    flex-shrink: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-size: 11px;
    font-weight: 400;
    padding: 2px 6px;
    height: 22px;
    color: #000;
    background: var(--ui-bg);
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 #808080;
}

.task-btn.active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #dfdfdf;
    font-weight: 700;
    background-image: url("data:image/svg+xml,%3Csvg width='2' height='2' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='0' width='1' height='1' fill='%23fff'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23fff'/%3E%3C/svg%3E");
    background-size: 2px 2px;
    background-repeat: repeat;
    padding: 3px 5px 1px 7px;
}

.status-tray {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 4px;
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
    background: var(--ui-bg);
    flex-shrink: 0;
    white-space: nowrap;
}

.tray-volume {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.tray-icon {
    position: relative;
    min-width: 16px;
    height: 16px;
    width: 16px;
    font-size: 0;
    line-height: 0;
    background: transparent;
    border: none;
    cursor: default;
    padding: 0;
}

.tray-icon::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    background: url("/assets/icons/icon-volume.svg") center / contain no-repeat;
}

.tray-icon.muted {
    opacity: 0.5;
}

.tray-icon.muted::after {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 16px;
    border-top: 2px solid #b00000;
    transform: rotate(-24deg);
}

.volume-popup {
    position: absolute;
    right: 0;
    bottom: 26px;
    width: 170px;
    padding: 6px;
    border: 1px solid #000;
    box-shadow:
        inset 1px 1px 0 #fff,
        inset -1px -1px 0 #808080,
        2px 2px 3px rgba(0,0,0,0.25);
    background: var(--ui-bg);
    display: grid;
    gap: 6px;
    z-index: 250;
}

.volume-popup[hidden] {
    display: none;
}

.volume-popup label {
    display: grid;
    gap: 4px;
    font-size: 12px;
}

.volume-popup input[type="range"] {
    width: 100%;
}

.counter-chip,
.clock-chip {
    font-family: "Win95", "Tahoma", sans-serif;
    font-size: 11px;
    color: #000;
    white-space: nowrap;
}

.status-error {
    color: #990000;
}

@keyframes window-pop {
    from {
        opacity: 0;
        transform: scale(0.92);
        filter: brightness(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes cursor-blink {
    from,
    to {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* ── Win95 Authentic Scrollbars ── */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background:
        url("data:image/svg+xml,%3Csvg width='2' height='2' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='0' width='1' height='1' fill='%23c0c0c0'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23c0c0c0'/%3E%3Crect x='1' y='0' width='1' height='1' fill='%23fff'/%3E%3Crect x='0' y='1' width='1' height='1' fill='%23fff'/%3E%3C/svg%3E");
    background-size: 2px 2px;
}

::-webkit-scrollbar-thumb {
    background: var(--ui-bg);
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf;
    min-height: 20px;
}

::-webkit-scrollbar-thumb:active {
    background: #a0a0a0;
}

::-webkit-scrollbar-button:single-button {
    background: var(--ui-bg);
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf;
    display: block;
    height: 16px;
    width: 16px;
    background-size: 8px;
    background-repeat: no-repeat;
    background-position: center;
}

::-webkit-scrollbar-button:single-button:active {
    border-top: 2px solid #000;
    border-left: 2px solid #000;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    box-shadow: inset 1px 1px 0 #808080;
}

/* Up arrow */
::-webkit-scrollbar-button:single-button:vertical:decrement {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4' viewBox='0 0 8 4'%3E%3Cpolygon points='4,0 8,4 0,4' fill='%23000'/%3E%3C/svg%3E");
}

/* Down arrow */
::-webkit-scrollbar-button:single-button:vertical:increment {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4' viewBox='0 0 8 4'%3E%3Cpolygon points='0,0 8,0 4,4' fill='%23000'/%3E%3C/svg%3E");
}

/* Left arrow */
::-webkit-scrollbar-button:single-button:horizontal:decrement {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='8' viewBox='0 0 4 8'%3E%3Cpolygon points='0,4 4,0 4,8' fill='%23000'/%3E%3C/svg%3E");
}

/* Right arrow */
::-webkit-scrollbar-button:single-button:horizontal:increment {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='8' viewBox='0 0 4 8'%3E%3Cpolygon points='0,0 4,4 0,8' fill='%23000'/%3E%3C/svg%3E");
}

::-webkit-scrollbar-corner {
    background: var(--ui-bg);
}

/* Firefox scrollbar approximation */
@supports (scrollbar-color: auto) {
    * {
        scrollbar-color: var(--ui-bg) #dfdfdf;
        scrollbar-width: auto;
    }
}

/* ── Win95 Tooltip styling ── */
.win95-tooltip {
    position: fixed;
    padding: 2px 4px;
    font-size: 11px;
    font-family: "Win95", "MS Sans Serif", sans-serif;
    color: #000;
    background: #ffffe1;
    border: 1px solid #000;
    z-index: 400;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 1px 1px 0 rgba(0,0,0,0.15);
}

/* ── Win95 Selection highlight color ── */
::selection {
    background: #000080;
    color: #fff;
}

::-moz-selection {
    background: #000080;
    color: #fff;
}

/* ── Win95 Focus rectangles ── */
.w95-btn:focus-visible,
.wa-btn:focus-visible {
    outline: 1px dotted #00e100;
    outline-offset: -3px;
}

/* ── Win95 Input caret color ── */
input, textarea {
    caret-color: #000;
}

/* ── Win95 Range Slider (Track + Thumb) ── */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    background: transparent;
    cursor: default;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: #fff;
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
    box-shadow: inset 1px 1px 0 #000;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 11px;
    height: 20px;
    margin-top: -9px;
    background: var(--ui-bg);
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf;
}

input[type="range"]::-moz-range-track {
    height: 4px;
    background: #fff;
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
}

input[type="range"]::-moz-range-thumb {
    width: 11px;
    height: 20px;
    border-radius: 0;
    background: var(--ui-bg);
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf;
}

/* ── Win95 disabled text with 3D emboss ── */
.w95-btn:disabled,
button:disabled {
    color: #808080;
    text-shadow: 1px 1px 0 #fff;
}

.product-shell {
    min-height: 100vh;
    padding: 12px 12px calc(var(--taskbar-h) + 16px);
    overflow: auto;
}

.product-window {
    width: min(980px, 100%);
    margin: 0 auto;
    background: var(--ui-face);
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    box-shadow: 2px 2px 0 #444;
}

.product-window .window-content {
    max-height: none;
    height: auto;
}

.product-head {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(260px, 360px);
    gap: 10px;
}

.product-photo img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border: 2px inset #8a8a8a;
    background: #000;
}

.spec-table {
    margin: 0;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 5px 8px;
    font-size: 12px;
}

.spec-table dt {
    font-weight: 700;
}

.spec-table dd {
    margin: 0;
}

.long-copy {
    margin-top: 10px;
    border: 2px inset #9a9a9a;
    background: #fff;
    padding: 8px;
    font-size: 12px;
    line-height: 1.45;
}

.long-copy h2,
.long-copy h3 {
    margin: 0 0 6px;
    font-size: 14px;
}

.long-copy p {
    margin: 0 0 8px;
}

.long-copy ul {
    margin: 0 0 8px;
    padding-left: 18px;
}

.product-image-strip {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-thumb {
    width: 74px;
    height: 58px;
    padding: 2px;
    background: #f0f0f0;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-right: 2px solid #4f4f4f;
    border-bottom: 2px solid #4f4f4f;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #6c6c6c;
}

.product-thumb.active {
    border-top-color: #4f4f4f;
    border-left-color: #4f4f4f;
    border-right-color: #fff;
    border-bottom-color: #fff;
}

.comment-shell {
    margin-top: 12px;
    border: 2px inset #9a9a9a;
    background: #fff;
    padding: 8px;
}

.comment-shell h2 {
    margin: 0 0 6px;
    font-size: 14px;
}

.comment-form {
    display: grid;
    gap: 7px;
}

.comment-form label {
    display: grid;
    gap: 3px;
    font-size: 12px;
}

.comment-form input,
.comment-form textarea {
    font: inherit;
    padding: 4px;
    border: none;
    box-shadow:
        inset 1px 1px 0 #808080,
        inset -1px -1px 0 #fff,
        inset 2px 2px 0 #000,
        inset -2px -2px 0 #dfdfdf;
    background: #fff;
}

.comment-form textarea {
    min-height: 90px;
    resize: vertical;
}

.comment-status {
    margin: 0;
    min-height: 1.2em;
    font-size: 12px;
    color: #555;
}

.comment-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.comment-item {
    background: #f5f5f5;
    border: 1px solid #b0b0b0;
    padding: 6px;
}

.comment-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: #555;
}

.comment-body {
    margin: 5px 0 0;
    font-size: 12px;
    white-space: pre-wrap;
}

/* ── Display Properties window ── */

.display-props-window {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 10px;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.display-tabs {
    display: flex;
    gap: 0;
    margin-bottom: -1px;
    z-index: 1;
}

.display-tab {
    padding: 4px 14px;
    font-family: "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Geneva, sans-serif;
    font-size: 11px;
    background: var(--silver);
    border: 2px solid;
    border-color: #fff #808080 transparent #fff;
    border-radius: 3px 3px 0 0;
    cursor: pointer;
    position: relative;
    top: 1px;
    margin-right: 2px;
    color: #000;
}

.display-tab:focus {
    outline: 1px dotted #000;
    outline-offset: -3px;
}

.display-tab.active {
    background: var(--silver);
    border-color: #fff #808080 var(--silver) #fff;
    top: 0;
    padding-bottom: 6px;
    z-index: 2;
    font-weight: bold;
}

.display-panel {
    flex: 1;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    background: var(--silver);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.display-panel[hidden] {
    display: none;
}

.display-preview {
    width: 180px;
    height: 130px;
    margin: 0 auto 6px;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
    background: #008080;
    position: relative;
    overflow: hidden;
}

.screensaver-preview {
    background: #000;
}

.display-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid #000;
    pointer-events: none;
}

.wallpaper-preview {
    background-size: cover;
    background-position: center;
}

.display-panel .toggle-line {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    color: #000;
}

.display-panel .toggle-line select,
.display-panel .toggle-line input[type="text"],
.display-panel .toggle-line input[type="number"] {
    padding: 3px 4px;
    font-family: inherit;
    font-size: 11px;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
    background: #fff;
    color: #000;
}

.display-panel .toggle-line input[type="range"] {
    width: 100%;
}

.display-props-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 8px;
    border-top: none;
    margin-top: auto;
}

.display-props-buttons .w95-btn {
    min-width: 72px;
}

/* ── Screensaver overlay ── */

.screensaver-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    cursor: none;
}

.screensaver-overlay canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Desktop watermark ── */

.desktop-watermark {
    position: fixed;
    right: 16px;
    bottom: calc(var(--taskbar-h) + 12px);
    font-family: "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Geneva, sans-serif;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.22);
    pointer-events: none;
    z-index: 0;
    user-select: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .window-layer {
        left: 95px;
    }
}

@media (max-width: 900px) {
    body {
        overflow: auto;
        height: auto;
        min-height: 100vh;
    }

    .desktop-shell {
        height: auto;
        min-height: calc(100vh - var(--taskbar-h));
        overflow: visible;
        padding-bottom: 12px;
    }

    .desktop-icons {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 8px;
    }

    .desktop-icon {
        position: static;
        width: 86px;
    }

    .window-layer {
        position: static;
        inset: auto;
        display: grid;
        gap: 8px;
        pointer-events: auto;
    }

    .app-window {
        position: relative;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 180px;
        resize: none;
    }

    .window-titlebar {
        cursor: default;
    }

    .mail-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .ency-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .explorer-main {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .product-head {
        grid-template-columns: 1fr;
    }

    .winamp-shell {
        grid-template-columns: 1fr;
    }

    .task-btn {
        min-width: 60px;
    }
}

@media (max-width: 660px) {
    .taskbar {
        flex-wrap: wrap;
        height: auto;
        min-height: var(--taskbar-h);
        gap: 2px;
        padding: 2px 3px;
    }

    .desktop-shell {
        height: auto;
        min-height: calc(100vh - 56px);
    }

    .start-button {
        flex: 0 0 auto;
    }

    .task-buttons {
        flex: 1 1 100%;
        order: 2;
        min-width: 0;
    }

    .taskbar-divider {
        display: none;
    }

    .status-tray {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .volume-popup {
        right: auto;
        left: 0;
    }

    .start-menu {
        width: calc(100% - 8px);
    }

    .task-btn {
        min-width: 50px;
        max-width: 120px;
        font-size: 10px;
    }

    .counter-chip {
        display: none;
    }
}

@media (max-width: 400px) {
    .start-button {
        min-width: 42px;
        padding: 0 4px 0 22px;
        font-size: 10px;
    }

    .start-menu {
        width: calc(100vw - 4px);
        left: 0;
    }

    .status-tray {
        gap: 3px;
        padding: 0 3px;
    }

    .clock-chip {
        font-size: 10px;
    }

    .start-submenu {
        left: 0;
        bottom: auto;
        top: 100%;
        width: calc(100vw - 30px);
    }
}
