/* ==========================================================================
   WINDOWS 98 DESKTOP THEME - DESIGN SYSTEM
   ========================================================================== */

:root {
    /* Classic Win98 Colors */
    --win-teal: #008080;            /* Desktop background */
    --win-gray: #d4d0c8;            /* Window face / bevels */
    --win-gray-light: #f6f6f6;      /* High contrast light gray */
    --win-gray-shadow: #808080;     /* Border dark shadow */
    --win-gray-dark: #404040;       /* Border deep dark shadow */
    --win-white: #ffffff;           /* Border highlights / workspace back */
    
    --win-blue-dark: #000080;       /* Active titlebar left */
    --win-blue-light: #1084d0;      /* Active titlebar right */
    
    --win-blue-inactive: #808080;   /* Inactive titlebar left */
    --win-blue-inactive-light: #b5b2ad; /* Inactive titlebar right */
    
    --text-dark: #000000;
    --text-white: #ffffff;
    --text-grayed: #808080;
    
    /* Neon accents for 3D model details */
    --accent-cyan: #008080;
    --accent-gold: #800000;
    --accent-green: #008000;
    
    /* Fonts */
    --font-system: "Tahoma", "Arial", sans-serif;
    --font-pixel: "Press Start 2P", monospace;
    --font-mono: "Share Tech Mono", "Courier New", monospace;
}

/* Reset & Global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--win-teal);
    color: var(--text-dark);
    font-family: var(--font-system);
    font-size: 12px;
    height: 100vh;
    overflow: hidden;
    position: relative;
    user-select: none;
}

/* ==========================================================================
   CRT SCREEN EFFECTS
   ========================================================================== */

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%),
        radial-gradient(circle, rgba(0,0,0,0) 75%, rgba(0,0,0,0.4) 100%);
    background-size: 100% 3px, 100% 100%;
    z-index: 99999;
    pointer-events: none;
}

.screen-flicker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 16, 16, 0.01);
    opacity: 0;
    z-index: 99998;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.08; }
    50% { opacity: 0.12; }
    100% { opacity: 0.08; }
}

/* ==========================================================================
   BOOT UP SCREEN — noctverus Dark Cinematic Theme
   ========================================================================== */

.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    z-index: 100000;
    overflow: hidden;
    transition: opacity 0.8s ease-in-out;
}

/* Animated perspective grid background */
.boot-grid-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        linear-gradient(rgba(0, 180, 180, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 180, 180, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridDrift 20s linear infinite;
    pointer-events: none;
}

@keyframes gridDrift {
    from { background-position: 0 0; }
    to   { background-position: 0 80px; }
}

/* Scanline sweep animation */
.boot-scanline-sweep {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 200, 200, 0.04) 50%,
        transparent 100%
    );
    animation: scanSweep 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes scanSweep {
    0%   { top: -100%; }
    100% { top: 200%;  }
}

/* Center column */
.boot-center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    gap: 28px;
    z-index: 2;
    padding: 40px 20px;
}

/* Avatar glow ring */
.boot-avatar-ring {
    position: relative;
    width: 130px;
    height: 130px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.boot-avatar-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(180, 0, 0, 0.5) 0%, transparent 70%);
    animation: eyeGlow 2.5s ease-in-out infinite alternate;
}

@keyframes eyeGlow {
    from { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9); }
    to   { opacity: 1.0; transform: translate(-50%, -50%) scale(1.1); }
}

.boot-avatar {
    position: relative;
    width: 110px;
    height: 110px;
    object-fit: cover;
    border: 2px solid rgba(180, 0, 0, 0.6);
    box-shadow:
        0 0 15px rgba(180, 0, 0, 0.5),
        0 0 40px rgba(180, 0, 0, 0.2),
        inset 0 0 10px rgba(0,0,0,0.8);
    background-color: #000;
    z-index: 2;
}

/* Brand text block */
.boot-brand-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.boot-brand-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(0, 200, 200, 0.7);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.boot-win-title {
    font-family: var(--font-system);
    font-weight: 300;
    font-size: 2.8rem;
    font-style: italic;
    color: #e0e0e0;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.boot-win-version {
    font-family: var(--font-system);
    font-weight: 900;
    font-size: 4.2rem;
    color: #c0c0c0;
    margin: -12px 0 0 0;
    letter-spacing: -2px;
    line-height: 1;
    text-shadow: 0 0 30px rgba(0, 200, 200, 0.3);
}

.boot-win-version span {
    color: #008080;
    font-style: italic;
}

.boot-brand-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(180, 180, 180, 0.5);
    letter-spacing: 2px;
    margin-top: 8px;
}

/* Boot loading section */
.boot-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Dramatic START SYSTEM button */
.boot-start-btn {
    position: relative;
    background: transparent;
    border: 1px solid rgba(0, 180, 180, 0.6);
    color: #00cccc;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 3px;
    padding: 12px 40px;
    cursor: pointer;
    outline: none;
    text-transform: uppercase;
    transition: all 0.2s ease;
    box-shadow:
        0 0 10px rgba(0, 180, 180, 0.2),
        inset 0 0 10px rgba(0, 180, 180, 0.05);
}

.boot-start-btn::before,
.boot-start-btn::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: #00cccc;
    border-style: solid;
}

.boot-start-btn::before {
    top: -1px; left: -1px;
    border-width: 1px 0 0 1px;
}

.boot-start-btn::after {
    bottom: -1px; right: -1px;
    border-width: 0 1px 1px 0;
}

.boot-start-btn:hover {
    background: rgba(0, 180, 180, 0.12);
    color: #00ffff;
    box-shadow:
        0 0 20px rgba(0, 200, 200, 0.4),
        inset 0 0 15px rgba(0, 180, 180, 0.1);
    letter-spacing: 4px;
}

.boot-start-btn:active {
    background: rgba(0, 180, 180, 0.25);
    transform: scale(0.98);
}

.boot-start-btn.disabled-btn {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Progress bar (new style) */
.boot-progress-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 280px;
}

.boot-progress-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(0, 200, 200, 0.7);
    letter-spacing: 2px;
    animation: blink 1s infinite steps(2);
}

.boot-progress-track {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(0, 180, 180, 0.3);
    position: relative;
    overflow: hidden;
}

.boot-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #008080, #00cccc);
    box-shadow: 0 0 8px rgba(0, 200, 200, 0.8);
    transition: width 0.05s linear;
    animation: progressSweep 1.8s linear forwards;
}

@keyframes progressSweep {
    0%   { width: 0%; }
    60%  { width: 75%; }
    85%  { width: 90%; }
    100% { width: 100%; }
}

/* Footer */
.boot-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    z-index: 2;
}

.boot-footer-left,
.boot-footer-right {
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(180, 180, 180, 0.35);
    letter-spacing: 1px;
}



/* ==========================================================================
   DESKTOP ENVIRONMENT
   ========================================================================== */

.desktop {
    width: 100vw;
    height: 100vh;
    background-color: var(--win-teal);
    position: relative;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

/* Desktop Icons */
.desktop-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 75px;
    text-align: center;
    cursor: pointer;
}

.icon-img {
    width: 32px;
    height: 32px;
    margin-bottom: 6px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.avatar-icon {
    border: 2px solid var(--win-white);
    background-color: #000;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    border-radius: 4px;
}

.icon-label {
    color: var(--win-white);
    font-size: 11px;
    text-shadow: 1px 1px 1px #000;
    padding: 2px 4px;
    word-wrap: break-word;
    max-width: 100%;
}

.desktop-icon:hover .icon-label {
    background-color: var(--win-blue-dark);
    text-shadow: none;
}

/* Vector SVG placeholders for win98 icons */
.my-computer-icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect x='4' y='6' width='24' height='16' fill='%23d4d0c8' stroke='%23000' stroke-width='2'/><rect x='6' y='8' width='20' height='12' fill='%2300ffff'/><rect x='12' y='22' width='8' height='4' fill='%23d4d0c8' stroke='%23000' stroke-width='2'/><line x1='10' y1='26' x2='22' y2='26' stroke='%23000' stroke-width='2'/></svg>");
}

.recycle-bin-icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path d='M8 8 L24 8 L22 28 L10 28 Z' fill='%23d4d0c8' stroke='%23000' stroke-width='2'/><line x1='6' y1='8' x2='26' y2='8' stroke='%23000' stroke-width='2'/><rect x='12' y='4' width='8' height='4' fill='%23d4d0c8' stroke='%23000' stroke-width='2'/><line x1='12' y1='14' x2='12' y2='24' stroke='%23808080' stroke-width='2'/><line x1='16' y1='14' x2='16' y2='24' stroke='%23808080' stroke-width='2'/><line x1='20' y1='14' x2='20' y2='24' stroke='%23808080' stroke-width='2'/></svg>");
}

/* ==========================================================================
   WINDOWS 98 BEVELS & WINDOWS
   ========================================================================== */

/* Outer Bevel Box (Outward) */
.win98-window, .win98-btn, .win98-card, .win98-tab-sheet {
    background-color: var(--win-gray);
}

.win98-window {
    border: 2px solid;
    border-color: var(--win-white) var(--win-gray-shadow) var(--win-gray-shadow) var(--win-white);
    box-shadow: inset 1px 1px 0px var(--win-gray-light), inset -1px -1px 0px var(--win-gray-dark);
    display: flex;
    flex-direction: column;
}

/* Titlebar */
.window-titlebar {
    background: linear-gradient(90deg, var(--win-blue-dark), var(--win-blue-light));
    color: var(--win-white);
    padding: 3px 5px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
    font-size: 11px;
}

.titlebar-left {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ie-title-icon {
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='7' fill='none' stroke='%2300ffff' stroke-width='2'/><ellipse cx='8' cy='8' rx='7' ry='2' fill='none' stroke='%23ffcc00' stroke-width='2'/></svg>");
    background-size: contain;
}

.titlebar-controls {
    display: flex;
    gap: 2px;
}

.win98-title-btn {
    width: 16px;
    height: 14px;
    background-color: var(--win-gray);
    border: 1px solid;
    border-color: var(--win-white) var(--win-gray-shadow) var(--win-gray-shadow) var(--win-white);
    box-shadow: inset 0.5px 0.5px 0px var(--win-gray-light);
    cursor: pointer;
    position: relative;
}

.win98-title-btn:active {
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    box-shadow: none;
}

.btn-min::before {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 4px;
    width: 6px;
    height: 2px;
    background: #000;
}

.btn-max::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 4px;
    width: 7px;
    height: 6px;
    border: 1px solid #000;
    border-top-width: 2px;
}

.btn-close::before {
    content: "✕";
    position: absolute;
    top: -1px;
    left: 3px;
    font-size: 10px;
    color: #000;
    font-weight: bold;
}

/* Menu Bar */
.window-menubar {
    background-color: var(--win-gray);
    border-bottom: 1px solid var(--win-gray-shadow);
    display: flex;
    padding: 2px 6px;
    gap: 12px;
}

.menu-item {
    font-size: 11px;
    padding: 2px 4px;
    cursor: pointer;
}

.menu-item:hover {
    background-color: var(--win-blue-dark);
    color: var(--win-white);
}

.underline {
    text-decoration: underline;
}

/* Toolbar */
.window-toolbar {
    background-color: var(--win-gray);
    border-bottom: 1px solid var(--win-gray-shadow);
    padding: 3px 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-btn {
    background: transparent;
    border: 1px solid transparent;
    font-family: var(--font-system);
    font-size: 11px;
    padding: 3px 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #000;
}

.toolbar-btn span {
    width: 18px;
    height: 18px;
    margin-bottom: 2px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.toolbar-btn:hover {
    border-color: var(--win-white) var(--win-gray-shadow) var(--win-gray-shadow) var(--win-white);
    background-color: rgba(255,255,255,0.1);
}

.toolbar-btn:active {
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
}

.toolbar-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn-back span { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M10 3 L4 8 L10 13 Z' fill='%23000'/></svg>"); }
.btn-forward span { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M6 3 L12 8 L6 13 Z' fill='%23000'/></svg>"); }
.btn-stop span { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect x='4' y='4' width='8' height='8' fill='%23ff0000'/></svg>"); }
.btn-refresh span { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 3 A5 5 0 1 1 3 8 L5 8 A3 3 0 1 0 8 5 Z' fill='%23008000'/></svg>"); }
.btn-home span { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 2 L2 8 L4 8 L4 14 L12 14 L12 8 L14 8 Z' fill='%23800000'/></svg>"); }
.btn-search span { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='6' cy='6' r='4' fill='none' stroke='%23000' stroke-width='2'/><line x1='9' y1='9' x2='14' y2='14' stroke='%23000' stroke-width='2'/></svg>"); }
.btn-favs span { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><polygon points='8,1 10,6 15,6 11,9 13,14 8,11 3,14 5,9 1,6 6,6' fill='%23ffcc00' stroke='%23000'/></svg>"); }
.btn-history span { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='6' fill='none' stroke='%23000' stroke-width='2'/><path d='M8 3 L8 8 L11 8' fill='none' stroke='%23000' stroke-width='2'/></svg>"); }

.toolbar-separator {
    width: 2px;
    height: 25px;
    background-color: var(--win-gray-shadow);
    border-right: 1px solid var(--win-white);
    margin: 0 4px;
}

/* Address Bar */
.window-addressbar {
    background-color: var(--win-gray);
    border-bottom: 2px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    padding: 4px 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.address-label {
    font-size: 11px;
    color: var(--win-gray-shadow);
}

.address-input-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 2px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    padding: 2px 4px;
}

.address-ie-icon {
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='7' fill='none' stroke='%230000ff' stroke-width='1.5'/><ellipse cx='8' cy='8' rx='7' ry='2' fill='none' stroke='%23ffaa00' stroke-width='1.5'/></svg>");
    background-size: contain;
    margin-right: 4px;
}

.address-input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-family: var(--font-system);
    font-size: 11px;
    color: #000;
}

/* Window Content Frame */
.window-content {
    flex-grow: 1;
    background-color: #555555; /* Neutral grey inside browser container */
    padding: 10px;
    display: flex;
    overflow: hidden;
}

/* Window Status Bar */
.window-statusbar {
    background-color: var(--win-gray);
    height: 20px;
    border-top: 1px solid var(--win-gray-shadow);
    display: flex;
    padding: 2px;
    gap: 4px;
}

.statusbar-pane {
    border: 1px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    padding: 1px 6px;
    font-size: 10px;
    display: flex;
    align-items: center;
}

.pane-text {
    flex-grow: 1;
}

.pane-zone {
    width: 110px;
    text-align: right;
    justify-content: flex-end;
}

/* ==========================================================================
   APP WORKSPACE LAYOUT
   ========================================================================== */

#app-window {
    position: absolute;
    top: 30px;
    left: 5%;
    width: 90%;
    height: 80vh;
    z-index: 100;
    transition: none; /* Instant resizing like real Win98 */
}

#app-window.maximized {
    width: 100vw !important;
    height: calc(100vh - 28px) !important;
    top: 0 !important;
    left: 0 !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 100;
}

.app-body {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 10px;
    height: 100%;
}

/* ==========================================================================
   3D VIEWPORT DESIGN (Win98 Card)
   ========================================================================== */

.win98-card {
    border: 2px solid;
    border-color: var(--win-white) var(--win-gray-shadow) var(--win-gray-shadow) var(--win-white);
    box-shadow: inset 1px 1px var(--win-gray-light);
    display: flex;
    flex-direction: column;
    padding: 8px;
    background-color: var(--win-gray);
}

.card-header-bar {
    background-color: var(--win-blue-dark);
    color: var(--win-white);
    font-weight: bold;
    font-size: 11px;
    padding: 3px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.viewer-container {
    flex-grow: 1;
    background-color: #000;
    position: relative;
    border: 2px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
}

.viewer-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.viewer-instructions {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background-color: rgba(212, 208, 200, 0.9);
    border: 1px solid #000;
    box-shadow: 1px 1px 0px #fff;
    padding: 6px;
    font-size: 10px;
    color: #000;
    pointer-events: none;
    line-height: 1.4;
    z-index: 10;
    font-family: var(--font-system);
}

.viewer-details-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(212, 208, 200, 0.95);
    border: 1.5px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    color: #000;
    pointer-events: none;
    z-index: 10;
}

.card-footer-controls {
    margin-top: 6px;
    display: flex;
    gap: 6px;
}

/* ==========================================================================
   WIN98 PROPERTY SHEET TABS & SIDEBAR
   ========================================================================== */

.sidebar-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.win98-tab-headers {
    display: flex;
    gap: 2px;
    padding-left: 5px;
    z-index: 2;
}

.tab-header {
    background-color: var(--win-gray);
    border: 2px solid;
    border-color: var(--win-white) var(--win-gray-shadow) transparent var(--win-white);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-family: var(--font-system);
    cursor: pointer;
    position: relative;
    top: 2px;
    outline: none;
}

.tab-header.active {
    background-color: var(--win-gray);
    border-color: var(--win-white) var(--win-gray-shadow) transparent var(--win-white);
    padding-top: 6px;
    top: 0px;
    font-weight: bold;
    z-index: 5;
}

.win98-tab-sheet {
    flex-grow: 1;
    border: 2px solid;
    border-color: var(--win-white) var(--win-gray-shadow) var(--win-gray-shadow) var(--win-white);
    box-shadow: inset 1px 1px var(--win-gray-light);
    padding: 12px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1;
}

.tab-page {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.section-title {
    font-size: 11px;
    font-weight: bold;
    color: #404040;
    margin: 8px 0 6px 0;
    text-transform: uppercase;
}

.section-title:first-child {
    margin-top: 0;
}

.section-divider {
    border: none;
    border-top: 1.5px solid var(--win-gray-shadow);
    border-bottom: 1.5px solid var(--win-white);
    margin: 12px 0;
}

/* List/Grid of models */
.model-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Win98 File Listing Row */
.model-slot {
    height: 28px;
    border: 1px solid transparent;
    background-color: transparent;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0 6px;
    cursor: pointer;
}

.model-slot:hover {
    background-color: rgba(0, 0, 128, 0.05);
    border-color: rgba(0, 0, 128, 0.15);
}

.model-slot.active {
    background-color: var(--win-blue-dark) !important;
    border-color: var(--win-blue-dark);
}

.model-slot.active .model-slot-title {
    color: var(--win-white) !important;
}

.model-slot.active .model-slot-icon {
    filter: invert(1) brightness(2);
}

.model-slot.active::after {
    content: "✓";
    color: var(--win-white);
    font-weight: bold;
    margin-left: auto;
    font-size: 11px;
}

.model-slot-icon {
    font-size: 1.1rem;
    margin-right: 8px;
}

.model-slot-title {
    font-size: 11px;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-slot.locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.model-slot.locked:hover {
    background-color: transparent;
    border-color: transparent;
}

/* File Properties Panel */
.info-panel {
    background-color: #fff;
    border: 2px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    padding: 2px 0;
}

.info-label {
    color: var(--win-gray-shadow);
}

.info-val {
    color: #000;
    font-weight: bold;
}

.info-val.cyan { color: #000080; }
.info-val.yellow { color: #800000; }
.info-val.text-red { color: #ff0000; }

/* Tab 2: Copyright Warning */
.copyright-warning-badge {
    background-color: #800000;
    color: #fff;
    padding: 6px;
    border: 2px solid;
    border-color: var(--win-white) #000 #000 var(--win-white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: bold;
    font-size: 11px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.license-brief-desc {
    font-size: 11px;
    line-height: 1.4;
    color: #000;
    margin-bottom: 12px;
}

.license-property-box {
    background-color: var(--win-gray-light);
    border: 2px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    padding: 8px;
    margin-bottom: 12px;
}

.license-actions-layout {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ==========================================================================
   WIN98 STANDARD BUTTONS
   ========================================================================== */

.win98-btn {
    font-family: var(--font-system);
    font-size: 11px;
    background-color: var(--win-gray);
    border: 2px solid;
    border-color: var(--win-white) var(--win-gray-shadow) var(--win-gray-shadow) var(--win-white);
    box-shadow: inset 1px 1px 0px var(--win-gray-light);
    color: #000;
    padding: 4px 10px;
    cursor: pointer;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.win98-btn:hover {
    background-color: #dfdfdf;
}

.win98-btn:active, .win98-btn.active {
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    box-shadow: none;
}

.win98-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.download-btn {
    font-weight: bold;
    border-color: var(--win-white) var(--win-gray-shadow) var(--win-gray-shadow) var(--win-white);
}

/* ==========================================================================
   WIN98 DIALOG BOXES (About & Modal Dialogs)
   ========================================================================== */

.about-dialog-box {
    position: absolute;
    top: 25%;
    left: 35%;
    width: 320px;
    z-index: 1000;
    box-shadow: 4px 4px 15px rgba(0,0,0,0.5);
}

.dialog-body {
    padding: 15px;
    display: flex;
    gap: 15px;
    background-color: var(--win-gray);
}

.dialog-avatar-container {
    width: 68px;
    height: 68px;
    background-color: #000;
    border: 2px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.dialog-avatar {
    width: 60px;
    height: 60px;
    object-fit: cover;
}

.dialog-info-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
}

.dialog-text {
    line-height: 1.4;
    color: #000;
}

.social-link {
    color: #000080;
    text-decoration: underline;
    overflow-wrap: anywhere;
}

.social-link:hover,
.social-link:focus-visible {
    color: #800000;
}

.dialog-footer {
    padding: 10px 15px;
    display: flex;
    justify-content: flex-end;
    background-color: var(--win-gray);
    border-top: 1px solid var(--win-gray-shadow);
}

.dialog-ok-btn {
    width: 75px;
    font-weight: bold;
}

/* Notepad License Viewer Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    width: 550px;
    max-height: 80vh;
    box-shadow: 5px 5px 20px rgba(0,0,0,0.6);
}

.notepad-body {
    background-color: #ffffff;
    border: 2px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    padding: 10px;
    overflow-y: auto;
    max-height: 50vh;
}

.license-language-bar {
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    background: var(--win-gray);
    border-bottom: 1px solid var(--win-gray-shadow);
}

.license-language-btn {
    min-width: 72px;
    font-size: 11px;
}

.license-language-btn.active {
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    background: #d9d9d9;
    font-weight: bold;
}

#license-text-container {
    font-family: "Courier New", monospace;
    font-size: 12px;
    color: #000;
    white-space: pre-wrap;
    user-select: text;
}

/* ==========================================================================
   WIN98 TASKBAR & SYSTEM TRAY
   ========================================================================== */

.win98-taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 28px;
    background-color: var(--win-gray);
    border-top: 2px solid var(--win-white);
    display: flex;
    align-items: center;
    padding: 2px 4px;
    z-index: 10000;
    box-shadow: inset 0 1px 0 var(--win-gray-light);
}

.taskbar-divider {
    width: 2px;
    height: 20px;
    background-color: var(--win-gray-shadow);
    border-right: 1px solid var(--win-white);
    margin: 0 6px;
}

/* Start Button */
.taskbar-start-btn {
    font-weight: bold;
    font-size: 12px;
    padding: 2px 6px;
    height: 22px;
    gap: 4px;
}

.start-win-logo {
    width: 16px;
    height: 14px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M2,2 L7,3 L7,8 L2,8 Z' fill='%23ff0000'/><path d='M8,3 L14,2 L14,8 L8,8 Z' fill='%230000ff'/><path d='M2,9 L7,9 L7,14 L2,13 Z' fill='%23008000'/><path d='M8,9 L14,9 L14,13 L8,14 Z' fill='%23ffcc00'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Quick Launch */
.taskbar-quick-launch {
    display: flex;
    gap: 4px;
}

.quick-launch-icon {
    width: 18px;
    height: 18px;
    cursor: pointer;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.ie-quick {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='6' fill='none' stroke='%230000ff' stroke-width='1.5'/><ellipse cx='8' cy='8' rx='6' ry='1.5' fill='none' stroke='%23ffcc00' stroke-width='1.5'/></svg>");
}

.show-desktop-quick {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect x='2' y='2' width='12' height='10' fill='%23d4d0c8' stroke='%23000' stroke-width='1'/><rect x='4' y='4' width='8' height='6' fill='%230000ff'/><line x1='1' y1='14' x2='15' y2='14' stroke='%23000'/></svg>");
}

/* Active Window tasks list */
.taskbar-tasks {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
}

.task-btn {
    height: 22px;
    max-width: 150px;
    justify-content: flex-start;
    gap: 4px;
    padding: 2px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-btn.active {
    background-color: var(--win-gray-light);
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    box-shadow: none;
}

.ie-task-icon {
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='6' fill='none' stroke='%230000ff' stroke-width='1.5'/><ellipse cx='8' cy='8' rx='6' ry='1.5' fill='none' stroke='%23ffcc00' stroke-width='1.5'/></svg>");
    background-size: contain;
    flex-shrink: 0;
}

/* Tray Clock & Icons */
.taskbar-tray {
    border: 2px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    display: flex;
    align-items: center;
    padding: 2px 6px;
    height: 22px;
    gap: 8px;
    background-color: var(--win-gray);
}

.tray-icon {
    width: 14px;
    height: 14px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
}

.tray-sound {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3,5 L6,5 L9,2 L9,14 L6,11 L3,11 Z' fill='%23000'/><path d='M11,5 A4,4 0 0 1 11,11 M13,3 A7,7 0 0 1 13,13' fill='none' stroke='%23000' stroke-width='1.5'/></svg>");
}

.tray-sound.muted {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3,5 L6,5 L9,2 L9,14 L6,11 L3,11 Z' fill='%23808080'/><line x1='11' y1='5' x2='15' y2='11' stroke='%23ff0000' stroke-width='2'/><line x1='15' y1='5' x2='11' y2='11' stroke='%23ff0000' stroke-width='2'/></svg>");
}

.tray-fps {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: bold;
    color: #404040;
}

.tray-time {
    font-size: 11px;
    color: #000;
}

/* ==========================================================================
   HELPERS & SCROLLBARS
   ========================================================================== */

.hidden {
    display: none !important;
}

.font-mono {
    font-family: var(--font-mono);
}

.font-pixel {
    font-family: var(--font-pixel);
}

.win-bold {
    font-weight: bold;
}

.blink {
    animation: blink 1.2s infinite steps(2);
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
}

/* Classic Windows 98 Gray Scrollbar */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFElEQVQImWNkYGBgYGBkYGBgYDAAAA4AA8v4+fQAAAAASUVORK5CYII=") repeat; /* Light grey checkerboard background */
    background-color: #dfdfdf;
}

::-webkit-scrollbar-thumb {
    background-color: var(--win-gray);
    border: 1px solid;
    border-color: var(--win-white) var(--win-gray-shadow) var(--win-gray-shadow) var(--win-white);
    box-shadow: inset 1px 1px 0px var(--win-white);
}

::-webkit-scrollbar-thumb:hover {
    background-color: #dfdfdf;
}

::-webkit-scrollbar-button {
    display: block;
    background-color: var(--win-gray);
    border: 1.5px solid;
    border-color: var(--win-white) var(--win-gray-shadow) var(--win-gray-shadow) var(--win-white);
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   RESPONSIVENESS (Windows resizing details)
   ========================================================================== */

@media (max-width: 950px) {
    #app-window {
        width: 94%;
        left: 3%;
        top: 2%;
        height: 85vh;
    }
    #app-window.maximized {
        width: 100vw !important;
        height: calc(100vh - 28px) !important;
        top: 0 !important;
        left: 0 !important;
    }
    .app-body {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
    .viewer-section {
        height: 380px;
    }
    .sidebar-section {
        height: auto;
        margin-top: 10px;
    }
    .about-dialog-box {
        left: 10%;
        top: 15%;
    }
}

/* Tablet and phone layout: keep the Win98 look while making every control reachable. */
@media (max-width: 950px) {
    .desktop {
        padding: 12px;
        padding-bottom: 42px;
        min-height: 100dvh;
        height: 100dvh;
        overflow: hidden;
    }

    .app-window {
        width: calc(100vw - 24px) !important;
        max-width: none !important;
        left: 12px !important;
        right: 12px;
        min-width: 0;
    }

    .viewer-layout {
        grid-template-columns: minmax(0, 1fr) 180px;
    }

    .viewer-instructions {
        font-size: 9px;
    }
}

@media (max-width: 700px) {
    html, body {
        width: 100%;
        min-height: 100%;
        overflow: hidden;
    }

    .desktop-shortcuts {
        flex-direction: row;
        gap: 10px;
        top: 10px;
        left: 10px;
    }

    .desktop-icon {
        width: 62px;
    }

    .icon-label {
        font-size: 10px;
    }

    .app-window,
    .app-window.maximized {
        position: fixed;
        inset: 0 0 32px 0 !important;
        width: auto !important;
        height: auto !important;
        min-height: 0;
        border-width: 2px;
    }

    .window-titlebar[data-drag-target] {
        cursor: default;
    }

    .window-menubar {
        gap: 4px;
        padding: 2px 3px;
    }

    .menu-item {
        padding: 3px 5px;
        font-size: 12px;
    }

    .window-toolbar {
        padding: 3px;
        flex-wrap: wrap;
    }

    .toolbar-left-btns {
        gap: 3px;
        flex-wrap: wrap;
    }

    .toolbar-brand-box {
        display: none;
    }

    .explorer-toolbar {
        padding: 3px;
    }

    .explorer-path-bar {
        width: 100%;
    }

    .path-label {
        display: none;
    }

    .explorer-body {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .explorer-tree {
        display: none;
    }

    .explorer-files {
        grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
        gap: 8px 4px;
        padding: 8px 4px;
    }

    .viewer-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(230px, 1fr) auto;
        overflow-y: auto;
        min-height: 0;
    }

    .viewer-canvas-wrap {
        min-height: 230px;
    }

    .viewer-info-panel {
        max-height: none;
        overflow: visible;
    }

    .viewer-instructions {
        display: none;
    }

    .window-statusbar {
        min-height: 22px;
    }

    .win98-taskbar {
        height: 32px;
        padding: 3px 4px;
    }

    .taskbar-divider,
    .taskbar-quick-launch,
    .tray-fps,
    #tray-fps-indicator {
        display: none;
    }

    .task-btn {
        max-width: 110px;
    }

    .tray-time {
        font-size: 10px;
    }

    #win-about .dialog-body {
        padding: 18px;
    }

    .dialog-info-container {
        font-size: 12px;
    }

    .notepad-body {
        margin: 4px;
        font-size: 10px;
    }

    #license-text-container {
        font-size: 10px;
    }
}

/* ==========================================================================
   noctverus OS CUSTOM COMPONENT ADDITIONS
   ========================================================================== */

.title-avatar-icon {
    width: 16px;
    height: 16px;
    object-fit: cover;
    margin-right: 4px;
    border: 1px solid var(--win-white);
    border-radius: 2px;
}

.address-icon {
    width: 14px;
    height: 14px;
    object-fit: cover;
    margin-right: 4px;
    border: 1px solid var(--win-gray-shadow);
}

.window-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.toolbar-left-btns {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-brand-box {
    width: 28px;
    height: 28px;
    margin-left: auto;
    border: 2px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1px;
}

.toolbar-brand-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.toolbar-brand-box.loading img {
    animation: brandPulse 0.5s infinite alternate steps(4);
}

@keyframes brandPulse {
    from { filter: drop-shadow(0 0 1px #ff0000) brightness(1.0); }
    to { filter: drop-shadow(0 0 6px #ff0000) brightness(1.5); }
}

/* Start Menu Popup */
.start-menu-popup {
    position: absolute;
    left: 2px;
    bottom: 28px;
    width: 190px;
    z-index: 200000;
    display: flex;
    flex-direction: row;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    border: 2px solid;
    border-color: var(--win-white) var(--win-gray-shadow) var(--win-gray-shadow) var(--win-white);
}

.start-menu-sidebar {
    width: 24px;
    background: linear-gradient(180deg, var(--win-blue-light), var(--win-blue-dark));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
}

.sidebar-text-vertical {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    color: var(--win-white);
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 1px;
    font-family: var(--font-system);
}

.start-menu-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--win-gray);
}

.start-menu-user-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background-color: var(--win-gray-light);
    border-bottom: 1.5px solid var(--win-gray-shadow);
}

.user-banner-img {
    width: 24px;
    height: 24px;
    border: 1.5px solid var(--win-white);
    object-fit: cover;
}

.user-banner-name {
    font-weight: bold;
    font-size: 11px;
    color: #000;
}

.start-menu-divider {
    height: 1px;
    background-color: var(--win-gray-shadow);
    border-bottom: 1px solid var(--win-white);
    margin: 4px 1px;
}

.start-menu-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    gap: 10px;
    cursor: pointer;
    font-size: 11px;
    color: #000;
}

.start-menu-item:hover {
    background-color: var(--win-blue-dark);
    color: var(--win-white);
}

.start-menu-item:hover .start-menu-item-icon {
    filter: invert(1) brightness(2);
}

.start-menu-item-icon {
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.about-icon { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='7' fill='%230000ff'/><text x='6' y='12' fill='%23fff' font-family='sans-serif' font-size='10' font-weight='bold'>i</text></svg>"); }
.notepad-icon { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect x='3' y='2' width='10' height='12' fill='%23fff' stroke='%23000'/><line x1='5' y1='5' x2='11' y2='5' stroke='%23000'/><line x1='5' y1='8' x2='11' y2='8' stroke='%23000'/></svg>"); }
.shutdown-icon { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='6' fill='none' stroke='%23ff0000' stroke-width='2'/><line x1='8' y1='2' x2='8' y2='8' stroke='%23ff0000' stroke-width='2'/></svg>"); }
.sm-folder-icon { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M1 4 L6 4 L7 2 L15 2 L15 14 L1 14 Z' fill='%23ffcc00' stroke='%23806000' stroke-width='1'/></svg>"); }

/* ==========================================================================
   WINDOW LAYER — Draggable Windows
   ========================================================================== */

#window-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.app-window {
    position: absolute;
    pointer-events: all;
    display: flex;
    flex-direction: column;
    min-width: 200px;
    min-height: 120px;
}

.app-window.maximized {
    width: 100vw !important;
    height: calc(100vh - 28px) !important;
    top: 0 !important;
    left: 0 !important;
}

/* Active window z-index boost */
.app-window.focused {
    z-index: 500;
}

/* ==========================================================================
   FOLDER / FILE ICONS — Desktop
   ========================================================================== */

.folder-icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path d='M2 8 L12 8 L14 5 L30 5 L30 27 L2 27 Z' fill='%23ffcc00' stroke='%23806000' stroke-width='1.5'/><path d='M2 10 L30 10 L30 27 L2 27 Z' fill='%23ffdd44' stroke='%23806000' stroke-width='1.5'/></svg>");
    width: 32px;
    height: 32px;
}

.folder-icon-wrap .icon-img {
    width: 32px;
    height: 32px;
    background-size: contain;
}

.title-folder-icon {
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M1 4 L6 4 L7 2 L15 2 L15 14 L1 14 Z' fill='%23ffcc00' stroke='%23806000' stroke-width='1'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 5px;
    flex-shrink: 0;
}

.folder-quick {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M1 4 L6 4 L7 2 L15 2 L15 14 L1 14 Z' fill='%23ffcc00' stroke='%23806000' stroke-width='1'/></svg>");
}

/* ==========================================================================
   EXPLORER WINDOW LAYOUT
   ========================================================================== */

.explorer-toolbar {
    background-color: var(--win-gray);
    border-bottom: 1px solid var(--win-gray-shadow);
    padding: 3px 6px;
}

.explorer-path-bar {
    display: flex;
    align-items: center;
    gap: 6px;
}

.path-label {
    font-size: 11px;
    color: var(--win-gray-shadow);
    white-space: nowrap;
}

.path-input-wrap {
    flex-grow: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    padding: 2px 4px;
    gap: 4px;
}

.path-folder-icon-sm {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M1 4 L6 4 L7 2 L15 2 L15 14 L1 14 Z' fill='%23ffcc00' stroke='%23806000' stroke-width='1'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
}

.path-text {
    font-size: 11px;
    font-family: var(--font-system);
    color: #000;
}

.explorer-body {
    flex-grow: 1;
    display: flex;
    overflow: hidden;
    background: #fff;
    border: 2px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    margin: 4px 6px;
}

/* Left tree panel */
.explorer-tree {
    width: 130px;
    flex-shrink: 0;
    border-right: 1px solid var(--win-gray-shadow);
    background: #fff;
    padding: 4px;
    overflow-y: auto;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
}

.tree-item.active {
    background: var(--win-blue-dark);
    color: var(--win-white);
}

.tree-item.indent {
    padding-left: 20px;
}

.tree-folder-icon-sm {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M1 4 L6 4 L7 2 L15 2 L15 14 L1 14 Z' fill='%23ffcc00' stroke='%23806000' stroke-width='1'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
}

.tree-item.active .tree-folder-icon-sm {
    filter: invert(1) brightness(2);
}

/* Right file grid */
.explorer-files {
    flex-grow: 1;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
    overflow-y: auto;
    background: #fff;
}

/* Individual file icon in explorer */
.explorer-file-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 72px;
    padding: 6px 4px;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
}

.explorer-file-icon:hover {
    background: rgba(0,0,128,0.06);
    border-color: rgba(0,0,128,0.15);
}

.explorer-file-icon.selected {
    background: var(--win-blue-dark);
    border-color: var(--win-blue-dark);
}

.explorer-file-icon.selected .file-icon-label {
    color: #fff;
}

.file-icon-3d {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect x='2' y='6' width='28' height='22' rx='2' fill='%23d4d0c8' stroke='%23808080' stroke-width='1.5'/><polygon points='16,9 26,14 26,23 16,28 6,23 6,14' fill='none' stroke='%23000080' stroke-width='1.5'/><line x1='16' y1='9' x2='16' y2='28' stroke='%23000080' stroke-width='1'/><line x1='6' y1='14' x2='26' y2='14' stroke='%23000080' stroke-width='1'/><rect x='1' y='2' width='12' height='6' fill='%23ffcc00' stroke='%23806000' stroke-width='1'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.file-icon-label {
    font-size: 10px;
    font-family: var(--font-system);
    color: #000;
    word-break: break-all;
    line-height: 1.2;
    max-width: 68px;
}

.file-icon-size {
    font-size: 9px;
    color: var(--win-gray-shadow);
    margin-top: 2px;
}

/* ==========================================================================
   3D VIEWER WINDOW LAYOUT
   ========================================================================== */

.viewer-layout {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr 200px;
    overflow: hidden;
    background: var(--win-gray);
    padding: 6px;
    gap: 6px;
}

.viewer-canvas-wrap {
    position: relative;
    background: #000;
    border: 2px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    overflow: hidden;
}

.viewer-canvas-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.viewer-instructions {
    position: absolute;
    bottom: 8px; left: 8px;
    background: rgba(212,208,200,0.9);
    border: 1px solid #000;
    padding: 5px;
    font-size: 10px;
    pointer-events: none;
    line-height: 1.5;
    z-index: 10;
}

.viewer-details-badge {
    position: absolute;
    top: 6px; right: 6px;
    background: rgba(212,208,200,0.95);
    border: 1.5px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    pointer-events: none;
    z-index: 10;
}

.viewer-status-badge {
    position: absolute;
    top: 6px; left: 6px;
    background: var(--win-blue-dark);
    color: #fff;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    pointer-events: none;
    z-index: 10;
    font-family: var(--font-mono);
}

/* Viewer right info panel */
.viewer-info-panel {
    background: var(--win-gray);
    border: 2px solid;
    border-color: var(--win-white) var(--win-gray-shadow) var(--win-gray-shadow) var(--win-white);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    font-size: 11px;
}

.info-panel-title {
    background: var(--win-blue-dark);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 6px;
    letter-spacing: 0.5px;
}

.info-panel-body {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-panel-divider {
    border: none;
    border-top: 1px solid var(--win-gray-shadow);
    border-bottom: 1px solid var(--win-white);
    margin: 2px 0;
}

.copyright-body {
    gap: 4px;
}

.copyright-badge-sm {
    background: #800000;
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    padding: 3px 5px;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

.copyright-text-sm {
    font-size: 9.5px;
    line-height: 1.4;
    color: #333;
}

/* Toolbar toggle buttons (smaller) */
.toolbar-toggle-btn {
    font-size: 10px !important;
    padding: 2px 6px !important;
    height: 20px;
}

/* Notepad body */
.notepad-body {
    flex-grow: 1;
    background: #fff;
    border: 2px solid;
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
    margin: 4px 6px;
    padding: 8px;
    overflow-y: auto;
}

#license-text-container {
    font-family: "Courier New", monospace;
    font-size: 11px;
    white-space: pre-wrap;
    color: #000;
    user-select: text;
}

/* Must remain last: these overrides take precedence over desktop window rules. */
@media (max-width: 700px) {
    .app-window,
    .app-window.maximized {
        position: fixed;
        inset: 0 0 32px 0 !important;
        width: auto !important;
        height: auto !important;
        min-height: 0;
    }

    .viewer-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(230px, 1fr) auto;
        overflow-y: auto;
        min-height: 0;
    }

    .viewer-canvas-wrap {
        min-height: 230px;
    }

    .viewer-info-panel {
        max-height: none;
        overflow: visible;
    }
}

/* ==========================================================================
   BROWSER
   ========================================================================== */

.soundplayer-playlist-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    background: var(--win-gray);
    border-bottom: 1px solid var(--win-gray-shadow);
    font-size: 11px;
}

.soundplayer-playlist-bar .playlist-label {
    font-weight: normal;
    color: #000;
    white-space: nowrap;
}

.soundplayer-playlist-bar .browser-playlist-select {
    background: #fff;
    border: 2px inset var(--win-gray);
    color: #000;
    font-family: 'MS Sans Serif', 'Microsoft Sans Serif', Tahoma, sans-serif;
    font-size: 11px;
    padding: 1px 2px;
}

.soundplayer-playlist-bar .browser-playlist-select option {
    background: #fff;
    color: #000;
}

.playlist-now {
    color: #000;
    font-weight: normal;
    margin-left: auto;
    font-size: 11px;
}

.playlist-divider {
    width: 1px;
    height: 16px;
    background: var(--win-gray-shadow);
    margin: 0 4px;
}

.metal-select {
    background: #fff;
    color: #000;
}

.metal-select option {
    background: #fff;
    color: #000;
}

#win-browser .statusbar-pane {
    color: #000;
    background: var(--win-gray);
    border-color: var(--win-gray-shadow) var(--win-white) var(--win-white) var(--win-gray-shadow);
}

.browser-body {
    flex: 1;
    overflow: hidden;
    background: var(--win-gray);
    position: relative;
}

.browser-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.browser-icon-img {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #8b0000, #dc143c);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.browser-icon-img::after {
    content: '🎵';
    font-size: 22px;
}

/* ==========================================================================
   GALLERY ICON
   ========================================================================== */

.gallery-icon-img {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4a6741, #2d5a27);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.gallery-icon-img::after {
    content: '🖼️';
    font-size: 22px;
}

/* ==========================================================================
   GALLERY GRID
   ========================================================================== */

.gallery-grid {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    overflow-y: auto;
    background: #fff;
    align-content: flex-start;
}

.gallery-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
    padding: 6px 4px;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
}

.gallery-thumb:hover {
    background: rgba(0,0,128,0.06);
    border-color: rgba(0,0,128,0.15);
}

.gallery-thumb.selected {
    background: var(--win-blue-dark);
    border-color: var(--win-blue-dark);
}

.gallery-thumb.selected .gallery-thumb-label {
    color: #fff;
}

.gallery-thumb-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border: 1px solid var(--win-gray-shadow);
    margin-bottom: 4px;
    background: var(--win-gray);
}

.gallery-thumb-label {
    font-size: 10px;
    font-family: var(--font-system);
    color: #000;
    word-break: break-all;
    line-height: 1.2;
    max-width: 92px;
}

/* ==========================================================================
   PHOTO VIEWER
   ========================================================================== */

.photo-viewer-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background: #000;
    padding: 8px;
}

.photo-viewer-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: default;
}
