        /* --- Workspace --- */
        main {
            flex: 1;
            position: relative;
            display: flex;
            overflow: hidden;
        }

        #canvas-container {
            flex: 1;
            background-color: #080a0d;
            background-image:
                linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
            background-size: 50px 50px;
            cursor: crosshair;
        }

        body.no-image #canvas-container {
            cursor: default;
        }

        body.no-image .toolbar,
        body.no-image #side-stack,
        body.no-image #filter-panel,
        body.no-image #auto-panel,
        body.no-image #alignment-preview-panel,
        body.no-image #status-bar {
            opacity: 0;
            pointer-events: none;
        }

        .empty-state {
            position: absolute;
            inset: 0;
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 80;
            pointer-events: none;
        }

        body.no-image .empty-state {
            display: flex;
        }

        .empty-upload-card {
            width: min(420px, calc(100vw - 48px));
            display: grid;
            justify-items: center;
            gap: 16px;
            padding: 28px;
            border-radius: 14px;
            border: 1px solid rgba(0, 242, 255, 0.18);
            background: rgba(13, 17, 23, 0.72);
            backdrop-filter: var(--glass-blur);
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
            pointer-events: all;
        }

        .empty-upload-mark {
            width: 52px;
            height: 52px;
            display: grid;
            place-items: center;
            border-radius: 12px;
            color: var(--accent-primary);
            background: rgba(0, 242, 255, 0.08);
            border: 1px solid rgba(0, 242, 255, 0.2);
        }

        .empty-upload-title {
            font-size: 1rem;
            font-weight: 700;
            color: var(--text-main);
        }

        .empty-upload-subtitle {
            max-width: 360px;
            color: var(--text-dim);
            font-size: 0.78rem;
            text-align: center;
            line-height: 1.5;
        }

        .empty-upload-btn {
            border: 0;
            border-radius: 9px;
            background: var(--accent-primary);
            color: var(--bg-dark);
            font-weight: 800;
            padding: 11px 18px;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            box-shadow: 0 8px 24px rgba(0, 242, 255, 0.2);
        }

        .histogram-wrapper {
            margin-top: 12px;
            height: 76px;
            width: 100%;
            background: rgba(0, 0, 0, 0.2);
            border-radius: 8px;
            border: 1px solid var(--border-color);
            overflow: hidden;
        }

        .histogram-wrapper canvas {
            display: block;
            width: 100%;
            height: 100%;
        }

        .histogram-caption {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-top: 6px;
            font-size: 0.58rem;
            color: var(--text-dim);
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .histogram-health {
            border: 1px solid var(--border-color);
            border-radius: 999px;
            padding: 2px 7px;
            color: var(--text-main);
            background: rgba(255, 255, 255, 0.04);
            white-space: nowrap;
        }

        .histogram-health.good {
            color: var(--accent-success);
            border-color: rgba(0, 255, 136, 0.35);
            background: rgba(0, 255, 136, 0.08);
        }

        .histogram-health.warn {
            color: #ffaa00;
            border-color: rgba(255, 170, 0, 0.35);
            background: rgba(255, 170, 0, 0.08);
        }

        .histogram-health.bad {
            color: #ff6b6b;
            border-color: rgba(255, 107, 107, 0.35);
            background: rgba(255, 107, 107, 0.08);
        }

        .histogram-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
            margin-top: 8px;
        }

        .histogram-stat {
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 6px 7px;
            background: rgba(255, 255, 255, 0.025);
            min-width: 0;
        }

        .histogram-stat-label {
            font-size: 0.56rem;
            color: var(--text-dim);
            line-height: 1.1;
        }

        .histogram-stat-value {
            margin-top: 2px;
            font-size: 0.72rem;
            color: var(--text-main);
            font-family: 'JetBrains Mono', monospace;
            white-space: nowrap;
        }

        .histogram-note {
            margin-top: 7px;
            font-size: 0.62rem;
            color: var(--text-dim);
            line-height: 1.45;
        }

        .switch-group {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid rgba(255, 255, 255, 0.05);
        }

        .switch {
            position: relative;
            display: inline-block;
            width: 34px;
            height: 20px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(255, 255, 255, 0.1);
            transition: .4s;
            border-radius: 20px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 14px;
            width: 14px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked+.slider {
            background-color: var(--accent-primary);
        }

        input:checked+.slider:before {
            transform: translateX(14px);
        }
