        /* Retro Color Palette & Typography */
        body {
            background-color: #008080; /* Classic Teal */
            font-family: "MS Sans Serif", "Courier New", sans-serif;
            font-size: 12px;
            color: #000000;
            margin: 0;
            padding: 10px;
            padding-bottom: 40px; 
            height: 100vh;
            box-sizing: border-box;
            overflow: hidden;
        }

        /* Desktop Shortcuts */
       .desktop-icons {
            display: flex;
            flex-direction: column;
            gap: 15px;
            position: absolute;
            top: 10px;
            left: 10px;
            z-index: 1;
            flex-wrap: wrap;
            max-height: calc(100vh - 60px);
        }

        .icon {
            width: 65px;
            text-align: center;
            cursor: pointer;
            color: #ffffff;
            text-shadow: 1px 1px #000000;
            user-select: none;
        }

        .icon img {
            width: 32px;
            height: 32px;
            display: block;
            margin: 0 auto 5px auto;
        }

        /* 3D Border Effects & Window States */
        .window {
            background-color: #c0c0c0;
            border-top: 2px solid #ffffff;
            border-left: 2px solid #ffffff;
            border-right: 2px solid #808080;
            border-bottom: 2px solid #808080;
            box-shadow: 1px 1px 0px 0px #000000;
            width: 90vw;
            max-width: 600px;
            position: absolute;
            display: flex;
            flex-direction: column;
            z-index: 10;
            box-sizing: border-box;
            overflow: hidden;
        }

        /* ADD: Window Edge Affordance Layer Controls and Box Boundary Assignments */
        .win-edge { position: absolute; z-index: 99; }
        .win-edge-n { top: -3px; left: 0; right: 0; height: 6px; cursor: n-resize; }
        .win-edge-s { bottom: -3px; left: 0; right: 0; height: 6px; cursor: s-resize; }
        .win-edge-e { top: 0; bottom: 0; right: -3px; width: 6px; cursor: e-resize; }
        .win-edge-w { top: 0; bottom: 0; left: -3px; width: 6px; cursor: w-resize; }
        .win-edge-nw { top: -3px; left: -3px; width: 8px; height: 8px; cursor: nw-resize; }
        .win-edge-ne { top: -3px; right: -3px; width: 8px; height: 8px; cursor: ne-resize; }
        .win-edge-sw { bottom: -3px; left: -3px; width: 8px; height: 8px; cursor: sw-resize; }
        .win-edge-se { bottom: -3px; right: -3px; width: 8px; height: 8px; cursor: se-resize; }

        #app-window {
            top: 40px;
            left: 90px;
        }

        #winamp-container {
            top: 80px;
            left: 140px;
            width: 275px;
            height: 348px;
            background-color: #000000;
            overflow: hidden;
        }

        /* CHANGE: Flexible Winamp Frame Dimension Scaling Rules */
        #winamp-frame {
            width: 100%;
            height: calc(100% - 18px);
            border: none;
            transform: scale(1);
            transform-origin: top left;
        }

        #paint-window {
            top: 120px;
            left: 180px;
            width: 500px;
            height: 360px;
            display: flex;
            flex-direction: column;
        }

        #about-folder, #portfolio-folder, #media-folder {
            width: 320px;
            height: 240px;
        }
        #about-folder { top: 60px; left: 110px; }
        #portfolio-folder { top: 90px; left: 140px; }
        #media-folder { top: 120px; left: 170px; }

        .folder-grid {
            display: flex;
            gap: 15px;
            padding: 5px;
            flex-wrap: wrap;
        }

        .folder-item {
            width: 60px;
            text-align: center;
            cursor: pointer;
        }

        .folder-item img {
            width: 32px;
            height: 32px;
            display: block;
            margin: 0 auto 5px auto;
        }

        /* MS Paint Tooling Layouts */
        .paint-workspace {
            display: flex;
            background-color: #c0c0c0;
            gap: 4px;
            padding: 3px;
            flex-grow: 1;
            overflow: hidden;
        }

        .paint-sidebar {
            display: grid;
            grid-template-columns: repeat(2, 24px);
            grid-auto-rows: 24px;
            gap: 2px;
            background-color: #c0c0c0;
            flex-shrink: 0;
        }

        .paint-tool-btn {
            background-color: #c0c0c0;
            border-top: 1px solid #ffffff;
            border-left: 1px solid #ffffff;
            border-right: 1px solid #808080;
            border-bottom: 1px solid #808080;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            font-size: 12px;
        }

        .paint-tool-btn.selected {
            border-top: 1px solid #808080;
            border-left: 1px solid #808080;
            border-right: 1px solid #ffffff;
            border-bottom: 1px solid #ffffff;
            background-color: #e0e0e0;
        }

        .paint-canvas-area {
            flex-grow: 1;
            background-color: #808080;
            padding: 3px;
            display: flex;
            overflow: auto;
            position: relative;
            border-top: 2px solid #555555;
            border-left: 2px solid #555555;
            border-right: 2px solid #ffffff;
            border-bottom: 2px solid #ffffff;
        }

        /* CHANGE: Fixed Canvas Container Structure with Dedicated Resize Node Markers */
        .canvas-container {
            position: relative;
            display: inline-block;
            background-color: #ffffff;
            padding: 0;
            margin: 0;
            align-self: flex-start;
        }

        #paintCanvas {
            background-color: #ffffff;
            cursor: crosshair;
            display: block;
        }

        .canvas-handle {
            position: absolute;
            width: 3px;
            height: 3px;
            background-color: #000080;
            border: 1px solid #ffffff;
            z-index: 5;
        }
        .canvas-handle-e { top: 50%; right: -5px; transform: translateY(-50%); cursor: e-resize; }
        .canvas-handle-s { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
        .canvas-handle-se { bottom: -5px; right: -5px; cursor: se-resize; }

        .paint-colors {
            background-color: #c0c0c0;
            border-top: 2px solid #808080;
            padding: 4px;
            display: flex;
            gap: 3px;
            flex-shrink: 0;
        }

        .color-swatch {
            width: 14px;
            height: 14px;
            border-top: 1px solid #808080;
            border-left: 1px solid #808080;
            border-right: 1px solid #ffffff;
            border-bottom: 1px solid #ffffff;
            cursor: pointer;
        }

        /* Responsive Window State Overrides */
        .window.minimized {
            display: none !important;
        }

        .window.maximized {
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            width: 100vw !important;
            max-width: 100% !important;
            height: calc(100vh - 28px) !important;
            transform: none !important;
            z-index: 999 !important;
        }

        /* NOTE: Restored source min-height configurations for standard layout structures */
        .window-inset {
            border-top: 2px solid #808080;
            border-left: 2px solid #808080;
            border-right: 2px solid #ffffff;
            border-bottom: 2px solid #ffffff;
            background-color: #ffffff;
            padding: 10px;
            min-height: 200px;
            flex-grow: 1;
            overflow-y: auto;
            box-sizing: border-box;
        }

        /* Title Bar */
        .title-bar {
            background: linear-gradient(90deg, #000080, #1084d0);
            color: #ffffff;
            padding: 3px 5px 3px 3px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: bold;
            user-select: none;
            cursor: move;
            flex-shrink: 0;
        }

        .title-bar.inactive {
            background: linear-gradient(90deg, #808080, #b5b5b5);
        }

        .title-bar-text {
            display: flex;
            align-items: center;
            gap: 5px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .title-bar-controls {
            display: flex;
            gap: 2px;
            flex-shrink: 0;
        }

        .title-bar-controls button {
            width: 16px;
            height: 14px;
            font-size: 9px;
            font-weight: bold;
            vertical-align: middle;
            text-align: center;
            padding: 0;
            cursor: pointer;
            background-color: #c0c0c0;
            border-top: 1px solid #ffffff;
            border-left: 1px solid #ffffff;
            border-right: 1px solid #808080;
            border-bottom: 1px solid #808080;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #000000;
        }


        /* Address bar toolbar buttons */
        .nav-btn {
            background: #c0c0c0;
            border-top: 2px solid #ffffff;
            border-left: 2px solid #ffffff;
            border-right: 2px solid #808080;
            border-bottom: 2px solid #808080;
            padding: 1px 7px;
            font-size: 12px;
            cursor: pointer;
            min-width: 26px;
            font-family: inherit;
        }
        .nav-btn:active {
            border-top: 2px solid #808080;
            border-left: 2px solid #808080;
            border-right: 2px solid #ffffff;
            border-bottom: 2px solid #ffffff;
        }

        /* Menu Bar Navigation */
        .menu-bar {
            display: flex;
            background-color: #c0c0c0;
            padding: 2px 0;
            border-bottom: 1px solid #808080;
            user-select: none;
            flex-shrink: 0;
        }

        .menu-item {
            padding: 2px 8px;
            cursor: pointer;
            position: relative;
        }

        .menu-item:hover {
            background-color: #000080;
            color: #ffffff;
        }

        /* Dropdown Menus */
        .dropdown-content {
            display: none;
            position: absolute;
            top: 18px;
            left: 0;
            background-color: #c0c0c0;
            min-width: 120px;
            border-top: 1px solid #ffffff;
            border-left: 1px solid #ffffff;
            border-right: 2px solid #000000;
            border-bottom: 2px solid #000000;
            z-index: 1002;
        }

        .dropdown-content a {
            color: #000000;
            padding: 4px 8px;
            text-decoration: none;
            display: block;
        }

        .dropdown-content a:hover {
            background-color: #000080;
            color: #ffffff;
        }

        .menu-item:hover .dropdown-content {
            display: block;
        }

        /* Status Bar */
        .status-bar {
            display: flex;
            gap: 2px;
            margin-top: 2px;
            user-select: none;
            flex-shrink: 0;
        }

        .status-field {
            background-color: #c0c0c0;
            border-top: 1px solid #808080;
            border-left: 1px solid #808080;
            border-right: 1px solid #ffffff;
            border-bottom: 1px solid #ffffff;
            padding: 2px 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .field-main { flex-grow: 1; }
        .field-side { width: 80px; text-align: center; flex-shrink: 0; }

        /* Taskbar */
        .taskbar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 28px;
            background-color: #c0c0c0;
            border-top: 2px solid #ffffff;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 2px;
            z-index: 1000;
            user-select: none;
        }

        .taskbar-left {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .start-btn {
            font-weight: bold;
            display: flex;
            align-items: center;
            gap: 4px;
            height: 22px;
            padding: 0 6px;
        }

        .start-btn img {
            width: 16px;
            height: 16px;
        }

        .task-button {
            height: 22px;
            font-size: 11px;
            width: 100px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            display: flex;
            align-items: center;
            padding: 0 4px;
            background-color: #c0c0c0;
            border-top: 1px solid #ffffff;
            border-left: 1px solid #ffffff;
            border-right: 1px solid #808080;
            border-bottom: 1px solid #808080;
        }

        .task-button.minimized-state {
            border-top: 1px solid #808080;
            border-left: 1px solid #808080;
            border-right: 1px solid #ffffff;
            border-bottom: 1px solid #ffffff;
            background-color: #e0e0e0;
        }

        .systray {
            border-top: 2px solid #808080;
            border-left: 2px solid #808080;
            border-right: 2px solid #ffffff;
            border-bottom: 2px solid #ffffff;
            padding: 2px 6px;
            font-size: 11px;
            display: flex;
            align-items: center;
            gap: 4px;
            background-color: #c0c0c0;
            flex-shrink: 0;
        }

        .content-section {
            display: none;
        }

        .content-section.active {
            display: block;
        }

        /* Mobile Adjustments */
        @media (max-width: 600px) {
            #app-window {
                top: 70px !important;
                left: 5vw !important;
                width: 90vw !important;
            }
            #winamp-container {
                top: 360px !important;
                left: 5vw !important;
                width: 275px !important;
                max-width: 90vw;
            }
            .desktop-icons {
                flex-direction: row;
            }
        }

        #bootscreen-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background-color: #000000;
            z-index: 100000;
            color: #ffffff;
            font-family: "Courier New", monospace;
            font-size: 14px;
            padding: 20px;
            box-sizing: border-box;
            overflow: hidden;
            display: block;
            user-select: none;
        }

        #win98-splash {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background-color: #ffffff;
            z-index: 100001;
            display: none;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            user-select: none;
        }

        .splash-logo {
            width: 320px;
            height: auto;
            margin-bottom: 40px;
        }

        .loader-bar-container {
            width: 280px;
            height: 12px;
            background-color: #ffffff;
            border: 2px solid #808080;
            box-shadow: 1px 1px 0px #fff;
            position: relative;
            overflow: hidden;
        }

        .loader-bar-progress {
            position: absolute;
            top: 0;
            left: -60px;
            width: 60px;
            height: 100%;
            background: linear-gradient(90deg, #1084d0, #000080, #1084d0);
            animation: win98Progress 2s linear infinite;
        }

        @keyframes win98Progress {
            0% { left: -60px; }
            100% { left: 280px; }
        }

        /* Start Menu */
        #start-menu {
            display: none;
            position: fixed;
            bottom: 28px;
            left: 2px;
            width: 200px;
            background-color: #c0c0c0;
            border-top: 2px solid #ffffff;
            border-left: 2px solid #ffffff;
            border-right: 2px solid #808080;
            border-bottom: 2px solid #808080;
            box-shadow: 2px 2px 0px #000000;
            z-index: 10001;
            flex-direction: row;
            user-select: none;
        }
        #start-menu.open { display: flex; }

        .start-menu-banner {
            width: 22px;
            background: linear-gradient(180deg, #1084d0 0%, #000080 100%);
            display: flex;
            align-items: flex-end;
            padding-bottom: 6px;
            flex-shrink: 0;
        }
        .start-menu-banner span {
            color: #ffffff;
            font-size: 11px;
            font-weight: bold;
            white-space: nowrap;
            writing-mode: vertical-rl;
            transform: rotate(180deg);
            letter-spacing: 1px;
            font-family: "MS Sans Serif", sans-serif;
        }
        .start-menu-banner span em {
            color: #c0c0c0;
            font-style: normal;
            font-weight: normal;
        }

        .start-menu-items {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            padding: 2px 0;
        }

        .start-menu-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 4px 8px 4px 6px;
            cursor: pointer;
            position: relative;
            font-size: 12px;
        }
        .start-menu-item:hover {
            background-color: #000080;
            color: #ffffff;
        }
        .start-menu-item img { width: 16px; height: 16px; flex-shrink: 0; }
        .start-menu-item .smi-label { flex-grow: 1; }
        .start-menu-item .smi-arrow { font-size: 9px; }

        .start-menu-sep {
            height: 1px;
            background-color: #808080;
            margin: 3px 4px;
            border-bottom: 1px solid #ffffff;
        }

        .start-submenu {
            display: none;
            position: absolute;
            left: 100%;
            top: 0;
            width: 160px;
            background-color: #c0c0c0;
            border-top: 2px solid #ffffff;
            border-left: 2px solid #ffffff;
            border-right: 2px solid #808080;
            border-bottom: 2px solid #808080;
            box-shadow: 2px 2px 0px #000000;
            z-index: 10002;
            flex-direction: column;
            padding: 2px 0;
        }
        .start-menu-item:hover .start-submenu { display: flex; }
        .start-submenu-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 4px 8px;
            cursor: pointer;
            font-size: 12px;
        }
        .start-submenu-item:hover {
            background-color: #000080;
            color: #ffffff;
        }
        .start-submenu-item img { width: 16px; height: 16px; flex-shrink: 0; }

        /* Right-click context menu */
        #ctx-menu {
            display: none;
            position: fixed;
            background-color: #c0c0c0;
            border-top: 2px solid #ffffff;
            border-left: 2px solid #ffffff;
            border-right: 2px solid #808080;
            border-bottom: 2px solid #808080;
            box-shadow: 2px 2px 0px #000000;
            z-index: 10003;
            padding: 2px 0;
            min-width: 160px;
            user-select: none;
        }
        #ctx-menu.open { display: block; }
        .ctx-item {
            padding: 4px 24px 4px 24px;
            font-size: 12px;
            cursor: pointer;
            white-space: nowrap;
            position: relative;
        }
        .ctx-item:hover { background-color: #000080; color: #ffffff; }
        .ctx-item.disabled { color: #808080; cursor: default; }
        .ctx-item.disabled:hover { background-color: transparent; color: #808080; }
        .ctx-sep { height: 1px; background-color: #808080; margin: 3px 4px; border-bottom: 1px solid #ffffff; }

        /* Settings / Background window */
        #settings-window {
            top: 100px;
            left: 200px;
            width: 340px;
        }
        .settings-body {
            padding: 12px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .settings-preview {
            width: 100%;
            height: 100px;
            border-top: 2px solid #808080;
            border-left: 2px solid #808080;
            border-right: 2px solid #ffffff;
            border-bottom: 2px solid #ffffff;
            background-color: #008080;
            background-size: cover;
            background-position: center;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            color: #ffffff;
            text-shadow: 1px 1px #000;
        }
        .settings-row {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
        }
        .settings-row label { flex-grow: 1; }
        .settings-file-btn {
            background-color: #c0c0c0;
            border-top: 2px solid #ffffff;
            border-left: 2px solid #ffffff;
            border-right: 2px solid #808080;
            border-bottom: 2px solid #808080;
            padding: 3px 10px;
            cursor: pointer;
            font-size: 11px;
            white-space: nowrap;
        }
        .settings-file-btn:active {
            border-top: 2px solid #808080;
            border-left: 2px solid #808080;
            border-right: 2px solid #ffffff;
            border-bottom: 2px solid #ffffff;
        }
        .settings-actions {
            display: flex;
            justify-content: flex-end;
            gap: 4px;
        }
        .settings-actions button {
            background-color: #c0c0c0;
            border-top: 2px solid #ffffff;
            border-left: 2px solid #ffffff;
            border-right: 2px solid #808080;
            border-bottom: 2px solid #808080;
            padding: 3px 14px;
            cursor: pointer;
            font-size: 11px;
            min-width: 60px;
        }
        .settings-actions button:active {
            border-top: 2px solid #808080;
            border-left: 2px solid #808080;
            border-right: 2px solid #ffffff;
            border-bottom: 2px solid #ffffff;
        }

        /* Properties window */
        #properties-window {
            top: 80px;
            left: 160px;
            width: 320px;
        }
        .props-tabs {
            display: flex;
            padding: 4px 4px 0 4px;
            gap: 2px;
            background-color: #c0c0c0;
            flex-shrink: 0;
        }
        .props-tab {
            padding: 3px 10px;
            font-size: 11px;
            cursor: pointer;
            background-color: #c0c0c0;
            border-top: 2px solid #ffffff;
            border-left: 2px solid #ffffff;
            border-right: 2px solid #808080;
            border-bottom: none;
            position: relative;
            top: 2px;
            z-index: 1;
        }
        .props-tab.active {
            background-color: #c0c0c0;
            border-bottom: 2px solid #c0c0c0;
            font-weight: bold;
            z-index: 2;
        }
        .props-panel {
            border-top: 2px solid #ffffff;
            border-left: 2px solid #ffffff;
            border-right: 2px solid #808080;
            border-bottom: 2px solid #808080;
            margin: 0 4px 4px 4px;
            background-color: #c0c0c0;
            padding: 10px;
            font-size: 11px;
            display: none;
            flex-direction: column;
            gap: 6px;
            flex-grow: 1;
        }
        .props-panel.active { display: flex; }
        .props-row {
            display: flex;
            justify-content: space-between;
            border-bottom: 1px dotted #808080;
            padding-bottom: 3px;
            gap: 8px;
        }
        .props-label { color: #444444; white-space: nowrap; }
        .props-value { font-weight: bold; text-align: right; word-break: break-all; }
        .props-section-title {
            font-weight: bold;
            color: #000080;
            font-size: 11px;
            border-bottom: 1px solid #808080;
            padding-bottom: 2px;
            margin-top: 4px;
        }
        .props-footer {
            display: flex;
            justify-content: flex-end;
            padding: 4px;
            flex-shrink: 0;
        }
        .props-footer button {
            background-color: #c0c0c0;
            border-top: 2px solid #ffffff;
            border-left: 2px solid #ffffff;
            border-right: 2px solid #808080;
            border-bottom: 2px solid #808080;
            padding: 3px 18px;
            cursor: pointer;
            font-size: 11px;
        }

        /* ── CRT / Scanline overlay ───────────────────────────────────────── */
        #crt-overlay {
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 100002;
            display: none;
        }
        #crt-overlay.active { display: block; }

        /* Phosphor green tint */
        #crt-overlay {
            background: rgba(18, 16, 16, 0);
            mix-blend-mode: normal;
        }
        #crt-overlay.active::after {
            content: '';
            position: absolute;
            inset: 0;
            background:
                /* vignette */
                radial-gradient(ellipse at center, transparent 15%, rgba(0,0,0,0.15) 50%),
                /* phosphor green tint */
                rgba(0, 10, 0, 0.08);
            pointer-events: none;
        }

        /* Scrolling scanlines via ::before */
        #crt-overlay.active::before {
            content: '';
            position: absolute;
            inset: 0;
            background: repeating-linear-gradient(
                to bottom,
                transparent        0px,
                transparent        2px,
                rgba(0, 0, 0, 0.35) 2px,
                rgba(0, 0, 0, 0.35) 3px
            );
            animation: crt-scroll 8s linear infinite;
            pointer-events: none;
        }

        @keyframes crt-scroll {
            from { background-position: 0 0; }
            to   { background-position: 0 100px; }
        }

        /* Screen flicker */
        @keyframes crt-flicker {
            0%   { opacity: 1; }
            85%  { opacity: 1; }
            87%  { opacity: 0.88; }
            88%  { opacity: 1; }
            94%  { opacity: 0.96; }
            95%  { opacity: 1; }
            100% { opacity: 1; }
        }
        #crt-overlay.active {
            animation: crt-flicker 5s infinite;
        }

        /* RGB shift on the scanline overlay */
        @keyframes rgb-shift {
            0%   { text-shadow: none; filter: none; }
            50%  { filter: hue-rotate(0.5deg) saturate(1.1); }
            100% { filter: none; }
        }