:root {
    --desk:              #008080;
    --win-grey:          #c0c0c0;
    --win-body:          #c0c0c0;
    --win-inset-bg:      #ffffff;
    --win-dark:          #808080;
    --win-darker:        #404040;
    --win-titlebar:      #000080;
    --win-titlebar-inactive: #808080;
    --win-text:          #000000;
    --win-title-text:    #ffffff;
    --accent:            #000080;
    --accent-light:      #0000cc;
    --red:               #cc0000;
    --green-ok:          #008000;

    /* bevel helpers */
    --bevel-out:         #ffffff #808080 #808080 #ffffff;
    --bevel-in:          #808080 #ffffff #ffffff #808080;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background: var(--desk);
    font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
    font-size: 11px;
    color: var(--win-text);
    user-select: none;
}

/* ── Desktop ── */
#desktop { position: fixed; inset: 0; bottom: 28px; overflow: hidden; }
#bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.18; }

/* ══════════════════════════════════════
   TASKBAR
══════════════════════════════════════ */
#taskbar {
    position: fixed; bottom: 0; left: 0; right: 0; height: 28px;
    background: var(--win-grey);
    border-top: 2px solid #ffffff;
    box-shadow: inset 0 1px 0 #dfdfdf;
    display: flex; align-items: center; gap: 2px; padding: 2px 4px; z-index: 5000;
}

#start-btn {
    background: var(--win-grey);
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    color: var(--win-text);
    font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    cursor: pointer;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: flex; align-items: center; gap: 4px;
    height: 22px;
}
#start-btn:active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}

#start-btn .start-logo {
    width: 16px; height: 16px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
}
#start-btn .start-logo span { display: block; }
#start-btn .start-logo span:nth-child(1) { background: #ff0000; }
#start-btn .start-logo span:nth-child(2) { background: #00cc00; }
#start-btn .start-logo span:nth-child(3) { background: #0000ff; }
#start-btn .start-logo span:nth-child(4) { background: #ffcc00; }

.taskbar-divider { width: 2px; height: 20px; border-left: 1px solid #808080; border-right: 1px solid #ffffff; margin: 0 2px; }

.taskbar-btn {
    background: var(--win-grey);
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    color: var(--win-text);
    font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
    font-size: 11px;
    padding: 1px 6px;
    cursor: pointer;
    max-width: 140px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    height: 20px;
    display: flex; align-items: center;
}
.taskbar-btn:hover { background: #d4d4d4; }
.taskbar-btn.active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    background: #b8b8b8;
}

#taskbar-clock {
    margin-left: auto;
    background: var(--win-grey);
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
    color: var(--win-text);
    font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
    font-size: 11px;
    padding: 2px 8px;
    letter-spacing: 0.5px;
    height: 20px;
    display: flex; align-items: center;
}

/* ══════════════════════════════════════
   START MENU
══════════════════════════════════════ */
#start-menu {
    display: none; position: fixed; bottom: 28px; left: 4px; width: 180px;
    background: var(--win-grey);
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    z-index: 6000;
    box-shadow: 2px 2px 0 #000;
}
#start-menu.open { display: block; }

.start-menu-header {
    background: var(--win-titlebar);
    padding: 8px 8px;
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 1px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.start-menu-items-wrap {
    margin-left: 22px;
    padding: 4px 0;
}

.start-menu-item {
    display: flex; align-items: center; gap: 8px; padding: 5px 12px;
    font-size: 11px; cursor: pointer;
    transition: none;
}
.start-menu-item:hover { background: var(--win-titlebar); color: #ffffff; }

/* ══════════════════════════════════════
   WINDOWS
══════════════════════════════════════ */
.win {
    position: absolute; min-width: 200px; min-height: 120px;
    background: var(--win-body);
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: 2px 2px 0 #000000;
    z-index: 100; display: flex; flex-direction: column;
}
.win.active { z-index: 200; }
.win.minimized { display: none; }

.win-titlebar {
    background: var(--win-titlebar-inactive);
    padding: 3px 4px;
    display: flex; align-items: center; gap: 4px;
    cursor: move; flex-shrink: 0;
    height: 22px;
}
.win.active .win-titlebar { background: var(--win-titlebar); }

.win-title {
    flex: 1;
    font-size: 11px;
    font-weight: bold;
    color: var(--win-title-text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    letter-spacing: 0.3px;
}

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

.win-btn {
    width: 16px; height: 14px;
    font-size: 9px;
    background: var(--win-grey);
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #404040;
    border-bottom: 1px solid #404040;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    color: var(--win-text);
    line-height: 1;
    font-weight: bold;
}
.win-btn:active {
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
}
.win-btn-close:hover { background: #e0e0e0; }

.win-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

.win-resize {
    position: absolute; bottom: 0; right: 0; width: 12px; height: 12px;
    cursor: se-resize;
    background:
        linear-gradient(135deg, transparent 30%, #808080 30%, #808080 45%, transparent 45%),
        linear-gradient(135deg, transparent 55%, #808080 55%, #808080 70%, transparent 70%),
        linear-gradient(135deg, transparent 75%, #808080 75%);
}

/* ══════════════════════════════════════
   SHARED BUTTON STYLE
══════════════════════════════════════ */
.win95-btn {
    background: var(--win-grey);
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    color: var(--win-text);
    font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
    font-size: 11px;
    padding: 3px 8px;
    cursor: pointer;
    letter-spacing: 0.3px;
}
.win95-btn:active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    padding: 4px 7px 2px 9px;
}
.win95-btn:hover { background: #d4d4d4; }

/* ══════════════════════════════════════
   FILE MANAGER
══════════════════════════════════════ */
.file-drop-zone {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 10px; margin: 8px;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    background: var(--win-inset-bg);
    cursor: pointer;
    min-height: 100px;
}
.file-drop-zone.drag-over {
    background: #e8e8ff;
    border-color: var(--accent);
}
.file-drop-icon {
    font-size: 32px;
    line-height: 1;
    opacity: 0.4;
}
.file-drop-text {
    font-size: 11px;
    color: #000;
    text-align: center;
    line-height: 1.8;
}
.file-drop-text span { color: var(--accent); cursor: pointer; text-decoration: underline; }
.file-drop-text span:hover { color: var(--accent-light); }
#file-input { display: none; }

.file-preview { display: none; flex-direction: column; flex: 1; }
.file-preview.has-image { display: flex; }
.preview-img-wrap {
    flex: 1; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: #000;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    margin: 6px 6px 0;
}
.preview-img-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-info {
    padding: 3px 8px;
    font-size: 10px;
    color: #444;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #b0b0b0;
    margin-top: 4px;
}
.file-info span { color: var(--win-text); }

.change-file-btn {
    background: transparent; border: none; border-top: 1px solid #b0b0b0;
    color: var(--accent); font-family: 'MS Sans Serif', Arial, sans-serif; font-size: 10px;
    padding: 3px 8px; cursor: pointer; text-align: left;
    text-decoration: underline;
}
.change-file-btn:hover { color: var(--accent-light); }

/* ══════════════════════════════════════
   EFFECTS LAB — PICKER
══════════════════════════════════════ */
.fx-picker-header {
    padding: 4px 8px;
    font-size: 10px;
    font-weight: bold;
    color: var(--win-text);
    background: var(--win-grey);
    border-bottom: 1px solid #b0b0b0;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.fx-picker {
    display: flex; flex-wrap: wrap; gap: 3px; padding: 6px 6px;
    background: var(--win-grey); border-bottom: 2px solid #b0b0b0; flex-shrink: 0;
}

.fx-chip {
    background: var(--win-grey);
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    color: var(--win-text);
    font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
    font-size: 10px;
    padding: 2px 7px;
    cursor: pointer;
    letter-spacing: 0.3px;
}
.fx-chip:hover { background: #d4d4d4; }
.fx-chip:active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    padding: 3px 6px 1px 8px;
}

/* ══════════════════════════════════════
   EFFECTS LAB — LAYER STACK
══════════════════════════════════════ */
.fx-stack-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: bold;
    color: var(--win-text);
    background: var(--win-grey);
    border-bottom: 1px solid #b0b0b0;
    flex-shrink: 0;
}

.fx-clear-all {
    background: var(--win-grey);
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #404040;
    border-bottom: 1px solid #404040;
    color: var(--win-text);
    font-family: 'MS Sans Serif', Arial, sans-serif;
    font-size: 10px;
    padding: 1px 6px;
    cursor: pointer;
}
.fx-clear-all:hover { background: #d4d4d4; }
.fx-clear-all:active {
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
}

.fx-stack {
    flex: 1; overflow-y: auto;
    display: flex; flex-direction: column; gap: 0;
    background: var(--win-inset-bg);
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    margin: 4px 6px 6px;
}
.fx-stack::-webkit-scrollbar { width: 16px; }
.fx-stack::-webkit-scrollbar-track { background: #c0c0c0; }
.fx-stack::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #404040;
    border-bottom: 1px solid #404040;
}

.fx-stack-empty {
    padding: 16px 12px;
    font-size: 11px;
    color: #808080;
    text-align: center;
    line-height: 1.8;
}

/* ── Layer card ── */
.layer-card {
    display: flex; align-items: center; gap: 0;
    height: 22px; padding: 0 4px;
    border-bottom: 1px solid #e0e0e0;
    background: transparent;
    cursor: pointer;
}
.layer-card:hover { background: #ddeeff; }
.layer-card.selected { background: var(--win-titlebar); color: #ffffff; }
.layer-card.selected .layer-name { color: #ffffff; }
.layer-card.selected .layer-drag { color: #aaaacc; }
.layer-card.dragging { opacity: 0.5; }
.layer-card.muted { opacity: 0.5; }

.layer-drag {
    color: #b0b0b0; font-size: 11px; cursor: grab; flex-shrink: 0;
    padding: 0 4px 0 2px; letter-spacing: -1px; line-height: 1;
    font-family: monospace;
}
.layer-drag:hover { color: #606060; }
.layer-drag:active { cursor: grabbing; }

.layer-name {
    flex: 1; font-size: 11px; color: var(--win-text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.layer-eye {
    background: transparent; border: none; cursor: pointer; flex-shrink: 0;
    padding: 3px 3px; color: #808080;
    display: flex; align-items: center; font-size: 12px;
}
.layer-eye.on { color: var(--win-text); }
.layer-eye:hover { color: var(--accent); }

.layer-del {
    background: transparent; border: none; cursor: pointer; flex-shrink: 0;
    padding: 3px 3px; color: #c0c0c0;
    display: flex; align-items: center; font-size: 10px;
}
.layer-del:hover { color: var(--red); }

/* ── Sliders ── */
.fx-slider {
    -webkit-appearance: none; width: 100%; height: 16px;
    background: transparent;
    outline: none; cursor: pointer;
}
.fx-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: var(--win-inset-bg);
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
}
.fx-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 11px; height: 20px;
    margin-top: -9px;
    background: var(--win-grey);
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    cursor: pointer;
}

/* ══════════════════════════════════════
   CONTROLS PANEL
══════════════════════════════════════ */
.ctrl-empty {
    padding: 16px 12px;
    font-size: 11px;
    color: #808080;
    line-height: 2;
    text-align: center;
}

.ctrl-panel {
    display: none; flex-direction: column; gap: 0;
    overflow-y: auto; flex: 1;
}
.ctrl-panel.visible { display: flex; }

.ctrl-row {
    display: flex; flex-direction: column; gap: 4px;
    padding: 6px 8px;
    border-bottom: 1px solid #b0b0b0;
}
.ctrl-row-inline {
    flex-direction: row; align-items: center; gap: 8px;
}

.ctrl-label-row {
    display: flex; justify-content: space-between; align-items: center;
}
.ctrl-label {
    font-size: 11px; color: var(--win-text); letter-spacing: 0.2px;
}
.ctrl-val {
    font-size: 10px;
    color: var(--win-text);
    font-family: 'Courier New', monospace;
    background: var(--win-inset-bg);
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
    padding: 0 4px;
    min-width: 36px;
    text-align: right;
}

.ctrl-color {
    width: 32px; height: 20px;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    background: #ffffff;
    cursor: pointer;
    padding: 1px;
    flex-shrink: 0;
}

.ctrl-select {
    flex: 1;
    background: var(--win-inset-bg);
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    color: var(--win-text);
    font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
    font-size: 11px;
    padding: 2px 4px;
    cursor: pointer;
    outline: none;
}

/* ══════════════════════════════════════
   PREVIEW CANVAS
══════════════════════════════════════ */
.canvas-wrap {
    flex: 1; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: #000000;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    margin: 6px 6px 0;
    position: relative;
}
#output-canvas {
    max-width: 100%; max-height: 100%;
    object-fit: contain; display: block;
}
.canvas-placeholder {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    opacity: 0.5; pointer-events: none;
    color: #808080;
}
.canvas-placeholder .ph-icon { font-size: 32px; }
.canvas-placeholder .ph-text { font-size: 11px; letter-spacing: 1px; }

.canvas-toolbar {
    display: flex; gap: 3px; padding: 4px 6px;
    background: var(--win-grey);
    border-top: 1px solid #b0b0b0;
    flex-shrink: 0; align-items: center;
}
.canvas-tool-btn {
    background: var(--win-grey);
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    color: var(--win-text);
    font-size: 12px;
    width: 22px; height: 20px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.canvas-tool-btn:hover { background: #d4d4d4; }
.canvas-tool-btn:active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}
.canvas-zoom-label {
    font-size: 10px;
    color: #444;
    margin-left: 4px;
    font-family: 'Courier New', monospace;
}

/* ══════════════════════════════════════
   EXPORT
══════════════════════════════════════ */
.export-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.export-row { display: flex; flex-direction: column; gap: 4px; }
.export-label { font-size: 11px; color: var(--win-text); }

.export-select {
    background: var(--win-inset-bg);
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    color: var(--win-text);
    font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
    font-size: 11px;
    padding: 2px 4px;
    cursor: pointer;
    outline: none;
    width: 100%;
}
.export-select option { background: #ffffff; }

.fx-slider-label {
    display: flex; justify-content: space-between; align-items: center;
}
.val-readout {
    font-size: 10px;
    color: var(--win-text);
    font-family: 'Courier New', monospace;
    background: var(--win-inset-bg);
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
    padding: 0 4px;
    min-width: 28px;
    text-align: right;
}

.export-download-btn {
    background: var(--win-grey);
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    color: var(--win-text);
    font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    padding: 5px 0;
    cursor: pointer;
    letter-spacing: 0.5px;
    width: 100%;
}
.export-download-btn:hover { background: #d4d4d4; }
.export-download-btn:active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    padding: 6px 0 4px;
}

.export-status { font-size: 10px; color: #444; text-align: center; }
.export-status.ok  { color: var(--green-ok); font-weight: bold; }
.export-status.err { color: var(--red); font-weight: bold; }

/* ══════════════════════════════════════
   HELP
══════════════════════════════════════ */
.info-body {
    padding: 10px; font-size: 11px; line-height: 1.8;
    color: var(--win-text); overflow-y: auto;
}
.info-body h3 {
    color: var(--win-text); font-size: 11px; font-weight: bold;
    margin-bottom: 4px; margin-top: 8px;
    border-bottom: 1px solid #b0b0b0;
    padding-bottom: 2px;
}
.info-body h3:first-child { margin-top: 0; }
.info-body kbd {
    background: var(--win-grey);
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #404040;
    border-bottom: 1px solid #404040;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    padding: 1px 4px;
    color: var(--win-text);
}

/* ══════════════════════════════════════
   PROCESSING OVERLAY
══════════════════════════════════════ */
#processing-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9000;
    align-items: center; justify-content: center;
}
#processing-overlay.visible { display: flex; }

.processing-box {
    background: var(--win-grey);
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: 2px 2px 0 #000;
    padding: 16px 24px;
    display: flex; flex-direction: column; gap: 12px; align-items: center;
    min-width: 260px;
}

.processing-box::before {
    content: 'Photo Lab';
    display: block;
    width: calc(100% + 48px);
    margin: -16px -24px 0;
    background: var(--win-titlebar);
    color: #ffffff;
    font-weight: bold;
    font-size: 11px;
    padding: 3px 8px;
    margin-bottom: 12px;
}

.processing-title {
    font-size: 11px;
    color: var(--win-text);
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.processing-bar-wrap {
    width: 200px; height: 18px;
    background: var(--win-inset-bg);
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    overflow: hidden;
    padding: 1px;
}
.processing-bar {
    height: 100%;
    width: 100%;
    background: repeating-linear-gradient(
        90deg,
        var(--win-titlebar) 0px,
        var(--win-titlebar) 16px,
        var(--win-grey) 16px,
        var(--win-grey) 20px
    );
    background-size: 300% 100%;
    animation: win95progress 1s steps(8) infinite;
}
@keyframes win95progress {
    0%   { background-position: 0% 0; }
    100% { background-position: -100% 0; }
}

/* ══════════════════════════════════════
   NAVBAR OVERRIDES
══════════════════════════════════════ */
.navbar { border-right-color: var(--win-titlebar) !important; }
.hamburger {
    border-color: var(--win-grey) !important;
    background: var(--win-grey) !important;
    border-radius: 0 !important;
    border-top: 2px solid #ffffff !important;
    border-left: 2px solid #ffffff !important;
    border-right: 2px solid #404040 !important;
    border-bottom: 2px solid #404040 !important;
}
.hamburger span { background: var(--win-text) !important; }
.hamburger:hover { background: #d4d4d4 !important; }
.nav-menu {
    background: var(--win-grey) !important;
    border-top: 2px solid #ffffff !important;
    border-left: 2px solid #ffffff !important;
    border-right: 2px solid #404040 !important;
    border-bottom: 2px solid #404040 !important;
    box-shadow: 2px 2px 0 #000 !important;
    border-radius: 0 !important;
}
.nav-menu a { color: var(--win-text) !important; font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif !important; font-size: 11px !important; }
.nav-menu a:hover { color: #ffffff !important; background: var(--win-titlebar) !important; }
.nav-menu a.active { color: #ffffff !important; background: var(--win-titlebar) !important; }
.back-home {
    color: var(--win-text) !important;
    border-bottom-color: #b0b0b0 !important;
    font-weight: bold !important;
}

/* ══════════════════════════════════════
   SCROLLBARS (Win95 style)
══════════════════════════════════════ */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: var(--win-grey); }
::-webkit-scrollbar-thumb {
    background: var(--win-grey);
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    min-height: 20px;
}
::-webkit-scrollbar-button {
    background: var(--win-grey);
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    display: block;
    height: 16px;
}

/* ══════════════════════════════════════
   MOBILE TAB BAR (hidden on desktop)
══════════════════════════════════════ */
#mobile-tabbar { display: none; }

/* ══════════════════════════════════════
   MOBILE LAYOUT
══════════════════════════════════════ */
@media (max-width: 700px) {

    /* Hide desktop chrome */
    #taskbar, #start-menu { display: none !important; }
    #desktop { bottom: 0; overflow: visible; }
    #bg-canvas { display: none; }

    /* Canvas preview strip — always visible at top */
    #win-canvas {
        position: fixed !important;
        left: 0 !important; top: 40px !important;
        width: 100% !important; height: 280px !important;
        z-index: 50 !important;
        border-left: none !important; border-right: none !important;
        border-top: none !important;
        display: flex !important;
    }
    #win-canvas .win-titlebar { display: none; }
    #win-canvas .win-body { padding: 0; }
    #win-canvas .canvas-wrap { margin: 0; border: none; }
    #win-canvas .canvas-toolbar { padding: 3px 6px; }
    #win-canvas .win-resize { display: none; }

    /* All panel windows: stack below the canvas strip */
    .win {
        position: fixed !important;
        left: 0 !important;
        top: 320px !important; /* navbar(40) + canvas(280) */
        width: 100% !important;
        height: calc(100% - 320px - 48px) !important; /* minus tabbar */
        border-left: none !important; border-right: none !important;
        border-bottom: none !important;
        box-shadow: none !important;
        display: none !important;
        z-index: 100 !important;
    }
    .win.win-resize { display: none; }
    .win .win-resize { display: none; }
    .win .win-controls { display: none; }
    .win-titlebar { cursor: default; }

    /* Active tab panel is shown */
    .win.mob-active { display: flex !important; }

    /* Canvas is always shown regardless */
    #win-canvas { display: flex !important; }

    /* Hide windows not part of tab system */
    #win-help { display: none !important; }

    /* Tab bar */
    #mobile-tabbar {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 48px;
        background: var(--win-grey);
        border-top: 2px solid #ffffff;
        box-shadow: 0 -1px 0 #808080;
        z-index: 5000;
    }

    .mob-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: var(--win-grey);
        border: none;
        border-right: 1px solid #b0b0b0;
        font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
        font-size: 9px;
        color: var(--win-text);
        cursor: pointer;
        padding: 4px 0;
        line-height: 1;
    }
    .mob-tab:last-child { border-right: none; }
    .mob-tab span { font-size: 9px; letter-spacing: 0.3px; }
    .mob-tab.active {
        background: var(--win-titlebar);
        color: #ffffff;
        border-top: 2px solid #ffffff;
    }
    .mob-tab:not(.active):active { background: #b0b0b0; }

    /* Panel title bars stay visible as section headers */
    .win.mob-active .win-titlebar {
        background: var(--win-titlebar);
        cursor: default;
    }

    /* Effects lab: make chips wrap nicely */
    .fx-picker { gap: 4px; padding: 8px; }
    .fx-chip { padding: 4px 10px; font-size: 11px; }

    /* Controls: give sliders more room */
    .ctrl-row { padding: 8px 10px; }
    .fx-slider { height: 22px; }
    .fx-slider::-webkit-slider-thumb { width: 18px; height: 26px; }

    /* Export: stack comfortably */
    .export-body { padding: 12px; gap: 12px; }
    .export-download-btn { padding: 10px 0; font-size: 13px; }

    /* File drop zone: bigger tap target */
    .file-drop-zone { min-height: 140px; gap: 14px; }
    .file-drop-icon { font-size: 40px; }
    .file-drop-text { font-size: 13px; }
    .change-file-btn { padding: 8px; font-size: 12px; }
}
