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

        body {
            font-family: 'Inter', sans-serif;
            background: #ffffff;
            color: #0f172a;
            min-height: 100vh;
            -webkit-font-smoothing: antialiased;
        }

        .container {
            max-width: 72rem;
            margin: 0 auto;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        @keyframes pulse {

            0%,
            100% {
                opacity: 1;
            }

            50% {
                opacity: .5;
            }
        }


        /* ── Tool-specific UI ── */
        .enh-modebar {
            display: flex;
            gap: .5rem;
            justify-content: center;
            flex-wrap: wrap;
            margin: 0 0 1.5rem;
        }

        .enh-mode-btn {
            background: #fff;
            border: 1.5px solid #e2e8f0;
            color: #475569;
            font-size: .8125rem;
            font-weight: 700;
            padding: .5rem 1.125rem;
            border-radius: 9999px;
            cursor: pointer;
            transition: all .2s;
        }

        .enh-mode-btn.active {
            background: linear-gradient(135deg, #06b6d4, #6366f1);
            border-color: transparent;
            color: #fff;
            box-shadow: 0 4px 14px rgba(6, 182, 212, .3);
        }

        .enh-stats {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: .75rem;
            margin-bottom: 1.75rem;
        }

        .enh-stat {
            background: #fff;
            border: 1px solid #e8ecf0;
            border-radius: .875rem;
            padding: .875rem .5rem;
            text-align: center;
        }

        .enh-stat-val {
            font-size: 1.15rem;
            font-weight: 800;
            color: #0f172a;
        }

        .enh-stat-lbl {
            font-size: .625rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: .04em;
            color: #94a3b8;
            margin-top: .2rem;
        }

        @media(max-width:820px) {
            .enh-stats {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        .enh-quality-meter {
            display: flex;
            gap: .375rem;
            justify-content: center;
            margin: .5rem 0 1.5rem;
        }

        .enh-quality-pill {
            font-size: .6875rem;
            font-weight: 700;
            padding: .3rem .85rem;
            border-radius: 9999px;
            background: #f1f5f9;
            color: #94a3b8;
        }

        .enh-quality-pill.active-poor {
            background: #fef2f2;
            color: #dc2626;
        }

        .enh-quality-pill.active-fair {
            background: #fff7ed;
            color: #c2410c;
        }

        .enh-quality-pill.active-good {
            background: #eff6ff;
            color: #2563eb;
        }

        .enh-quality-pill.active-excellent {
            background: #ecfdf5;
            color: #059669;
        }

        .enh-viewer {
            background: #fff;
            border: 1.5px solid #e8ecf0;
            border-radius: 1.25rem;
            padding: 1.5rem;
            margin-bottom: 1.75rem;
        }

        .enh-compare {
            position: relative;
            margin: 0 auto;
            max-width: 32rem;
            max-height: 32rem;
            overflow: auto;
            border-radius: .75rem;
            background: #f1f5f9;
            box-shadow: 0 4px 20px rgba(15, 23, 42, .1);
            user-select: none;
        }

        .enh-compare-inner {
            position: relative;
            display: inline-block;
        }

        .enh-compare-inner canvas {
            display: block;
            max-width: 100%;
            height: auto;
        }

        .enh-compare-after {
            position: absolute;
            top: 0;
            left: 0;
            width: 50%;
            height: 100%;
            overflow: hidden;
        }

        .enh-compare-after canvas {
            width: var(--enh-cw);
            max-width: none;
        }

        .enh-compare-handle {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 50%;
            width: 3px;
            background: #6366f1;
            cursor: ew-resize;
            transform: translateX(-50%);
        }

        .enh-compare-handle::after {
            content: '↔';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 2.25rem;
            height: 2.25rem;
            background: #fff;
            border-radius: 50%;
            box-shadow: 0 2px 10px rgba(15, 23, 42, .25);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: .875rem;
            color: #6366f1;
            font-weight: 700;
        }

        .enh-compare-label {
            position: absolute;
            bottom: .5rem;
            font-size: .625rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: .05em;
            background: rgba(15, 23, 42, .65);
            color: #fff;
            padding: .2rem .55rem;
            border-radius: 9999px;
            z-index: 2;
        }

        .enh-viewer-nav {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: .75rem;
            margin-top: 1rem;
            flex-wrap: wrap;
        }

        .enh-nav-btn {
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            width: 2.25rem;
            height: 2.25rem;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #475569;
        }

        .enh-zoom-btn {
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            padding: .4rem .75rem;
            border-radius: .5rem;
            cursor: pointer;
            color: #475569;
            font-size: .75rem;
            font-weight: 700;
        }

        .enh-zoom-btn.active {
            background: #6366f1;
            color: #fff;
            border-color: transparent;
        }

        .enh-sliders {
            background: #fff;
            border: 1.5px solid #e8ecf0;
            border-radius: 1.25rem;
            padding: 1.125rem 1.375rem;
            margin-bottom: 1.75rem;
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: .25rem 2rem;
        }

        .enh-slider-row {
            margin-bottom: .55rem;
        }

        .enh-sliders > label {
            grid-column: 1 / -1;
            margin-top: .4rem;
        }

        .enh-slider-label {
            display: flex;
            justify-content: space-between;
            font-size: .75rem;
            font-weight: 700;
            color: #334155;
            margin-bottom: .15rem;
        }

        .enh-slider-label span:last-child {
            color: #6366f1;
            font-weight: 700;
        }

        .enh-slider-row input[type=range] {
            height: 1rem;
        }

        @media(max-width:640px) {
            .enh-sliders {
                grid-template-columns: 1fr;
            }
        }

        .enh-slider-row input[type=range] {
            width: 100%;
            accent-color: #6366f1;
        }

        .enh-recommend {
            background: #eff6ff;
            border: 1.5px solid #bfdbfe;
            border-radius: 1rem;
            padding: 1rem 1.25rem;
            margin-bottom: 1.5rem;
        }

        .enh-recommend-item {
            display: flex;
            align-items: flex-start;
            gap: .5rem;
            font-size: .8125rem;
            color: #1e40af;
            font-weight: 600;
            margin-bottom: .5rem;
        }

        .enh-recommend-item:last-child {
            margin-bottom: 0;
        }

        .enh-page-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
            gap: 1rem;
            margin-bottom: 1.75rem;
        }

        .enh-page-card {
            background: #fff;
            border: 1.5px solid #e8ecf0;
            border-radius: 1rem;
            overflow: hidden;
            transition: border-color .2s, box-shadow .2s;
        }

        .enh-page-card.selected {
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
        }

        .enh-page-thumb-wrap {
            background: #f8fafc;
            padding: .75rem;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            border-bottom: 1px solid #eef2f7;
            min-height: 8.5rem;
        }

        .enh-page-thumb-wrap img {
            max-width: 100%;
            max-height: 7.5rem;
            box-shadow: 0 2px 10px rgba(15, 23, 42, .12);
        }

        .enh-page-body {
            padding: .75rem .875rem .875rem;
        }

        .enh-page-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: .75rem;
            margin-bottom: .375rem;
        }

        .enh-badge {
            font-size: .625rem;
            font-weight: 700;
            padding: .15rem .5rem;
            border-radius: 9999px;
        }

        .enh-badge-ok {
            background: #ecfdf5;
            color: #059669;
        }

        .enh-badge-warn {
            background: #fff7ed;
            color: #c2410c;
        }

        .enh-page-actions {
            display: flex;
            gap: .375rem;
            margin-top: .5rem;
        }

        .enh-mini-btn {
            flex: 1;
            font-size: .6875rem;
            font-weight: 700;
            padding: .35rem .25rem;
            border-radius: .5rem;
            border: 1px solid #e2e8f0;
            background: #f8fafc;
            color: #475569;
            cursor: pointer;
        }

        .enh-mini-btn.off {
            opacity: .45;
        }

        .enh-actions {
            display: flex;
            gap: .75rem;
            justify-content: center;
            flex-wrap: wrap;
        }

        .enh-btn-primary {
            display: inline-flex;
            align-items: center;
            gap: .5rem;
            background: linear-gradient(135deg, #6366f1, #7c3aed);
            color: #fff;
            font-weight: 700;
            padding: .875rem 2.25rem;
            border-radius: 9999px;
            font-size: .9375rem;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
            border: none;
            transition: all .25s;
        }

        .enh-btn-primary:disabled {
            opacity: .45;
            cursor: not-allowed;
        }

        .enh-btn-secondary {
            background: #f1f5f9;
            color: #475569;
            font-weight: 600;
            padding: .875rem 1.75rem;
            border-radius: 9999px;
            font-size: .875rem;
            cursor: pointer;
            border: 1px solid #e2e8f0;
        }

        .enh-progress-track {
            background: #f1f5f9;
            border-radius: 9999px;
            height: .5rem;
            overflow: hidden;
            margin: 1rem 0 .5rem;
        }

        .enh-progress-fill {
            background: linear-gradient(90deg, #06b6d4, #6366f1);
            height: 100%;
            width: 0%;
            transition: width .2s;
            border-radius: 9999px;
        }
