        * {
            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 ── */
        .dsk-modebar {
            display: flex;
            gap: .5rem;
            justify-content: center;
            flex-wrap: wrap;
            margin: 0 0 1.5rem;
        }

        .dsk-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;
        }

        .dsk-mode-btn.active {
            background: linear-gradient(135deg, #6366f1, #7c3aed);
            border-color: transparent;
            color: #fff;
            box-shadow: 0 4px 14px rgba(99, 102, 241, .3);
        }

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

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

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

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

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

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

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

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

        .dsk-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;
        }

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

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

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

        .dsk-page-num {
            font-weight: 700;
            color: #0f172a;
        }

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

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

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

        .dsk-angle-slider {
            width: 100%;
            accent-color: #6366f1;
            margin: .375rem 0 .25rem;
        }

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

        .dsk-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;
        }

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

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

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

        .dsk-compare canvas {
            display: block;
            width: 100%;
            height: auto;
        }

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

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

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

        .dsk-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;
        }

        .dsk-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;
        }

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

        .dsk-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;
        }

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

        .dsk-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;
        }

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

        .dsk-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;
        }

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

        .dsk-progress-fill {
            background: linear-gradient(90deg, #3b82f6, #8b5cf6);
            height: 100%;
            width: 0%;
            transition: width .2s;
            border-radius: 9999px;
        }

        .dsk-ocr-bars {
            display: flex;
            align-items: flex-end;
            gap: 1.5rem;
            justify-content: center;
            margin-top: .5rem;
        }

        .dsk-ocr-bar-col {
            text-align: center;
        }

        .dsk-ocr-bar-track {
            width: 2.75rem;
            height: 6rem;
            background: #f1f5f9;
            border-radius: .5rem;
            display: flex;
            align-items: flex-end;
            overflow: hidden;
        }

        .dsk-ocr-bar-fill {
            width: 100%;
            border-radius: .5rem .5rem 0 0;
        }
