        *{margin:0;padding:0;box-sizing:border-box}
        body{font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;background: #ffffff;color:#0f172a;min-height:100vh;-webkit-font-smoothing:antialiased}
        .container{max-width:72rem;margin:0 auto}
        [hidden]{display:none!important}
        @keyframes spin{to{transform:rotate(360deg)}}
        @keyframes pulse{0%,100%{opacity:1}50%{opacity:.5}}
        @keyframes fadeIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
        @keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}
        .pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}

        /* ===== BUTTONS ===== */
        .btn{display:inline-flex;align-items:center;gap:.5rem;padding:.625rem 1.25rem;border-radius:.75rem;font-size:.8125rem;font-weight:700;cursor:pointer;border:none;transition:all .2s ease;text-decoration:none;white-space:nowrap}
        .btn-primary{background:linear-gradient(135deg,#6366f1,#7c3aed);color:#fff;box-shadow:0 4px 12px rgba(99,102,241,.3)}
        .btn-primary:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(99,102,241,.4)}
        .btn-danger{background:linear-gradient(135deg,#ef4444,#dc2626);color:#fff;box-shadow:0 4px 12px rgba(239,68,68,.3)}
        .btn-danger:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(239,68,68,.4)}
        .btn-success{background:linear-gradient(135deg,#10b981,#059669);color:#fff;box-shadow:0 4px 12px rgba(16,185,129,.3)}
        .btn-success:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(16,185,129,.4)}
        .btn-ghost{background:#fff;color:#475569;border:1.5px solid #e2e8f0}
        .btn-ghost:hover{border-color:#6366f1;color:#3b82f6;background:#eff6ff}
        .btn-ghost-red{background:#fff;color:#ef4444;border:1.5px solid #fecaca}
        .btn-ghost-red:hover{background:#fef2f2;border-color:#ef4444}
        .btn-sm{padding:.4rem .875rem;font-size:.75rem;border-radius:.625rem}
        .btn-lg{padding:.875rem 2rem;font-size:.9375rem;border-radius:1rem}
        .btn:disabled{opacity:.5;cursor:not-allowed;transform:none!important;pointer-events:none}

        /* ===== UPLOAD ZONE ===== */

        /* Reserve space on the tool section from the 'processing' state onward (see setState()
           in remove-duplicate-pages.js — NOT applied to the idle 'upload' state, so the page
           nearly every visitor sees has no artificial gap). Sized to the processing-state
           card's own natural height (~29rem), which also covers the results state's static
           chrome (stats grid + control panel) in the common case of a handful of duplicate
           groups. A results view with many duplicate-group cards can still grow past this and
           shift the page a little — accepted trade-off for keeping the idle-state gap at zero.
           min() keeps it from exceeding the viewport on short screens. */
        #tool-section.reserve-space{min-height:min(29rem,90vh)}

        /* ===== PROCESSING ===== */
        .spinner{width:52px;height:52px;border:4px solid #e2e8f0;border-top-color:#3b82f6;border-radius:50%;animation:spin .8s linear infinite;margin:0 auto 1.5rem}
        .progress-bar-wrap{background:#e2e8f0;border-radius:9999px;height:8px;overflow:hidden;margin:1.25rem auto;max-width:320px}
        .progress-bar-fill{height:100%;border-radius:9999px;background:linear-gradient(90deg,#3b82f6,#8b5cf6);transition:width .4s ease}
        .pstep{display:flex;align-items:center;gap:.75rem;font-size:.875rem;color:#64748b;opacity:.35;transition:all .3s}
        .pstep.active{opacity:1;color:#3b82f6;font-weight:600}
        .pstep.done{opacity:1;color:#10b981}
        .pstep-dot{width:8px;height:8px;border-radius:50%;background:currentColor;flex-shrink:0}

        /* ===== STAT CARDS ===== */
        .stats-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:.875rem;margin-bottom:1.5rem}
        .stat-card{background:#fff;border:1px solid #e2e8f0;border-radius:1rem;padding:1.125rem 1rem;text-align:center;box-shadow:0 2px 8px rgba(15,23,42,.05)}
        .stat-num{font-size:1.625rem;font-weight:800;line-height:1}
        .stat-label{font-size:.7rem;color:#64748b;font-weight:600;margin-top:.325rem;text-transform:uppercase;letter-spacing:.05em}

        /* ===== DETECTION CONTROLS ===== */
        .ctrl-panel{background:#fff;border:1px solid #e2e8f0;border-radius:1rem;padding:1.125rem 1.25rem;margin-bottom:1.5rem}
        .mode-tabs{display:flex;background:#f1f5f9;border-radius:.75rem;padding:.25rem;gap:.25rem}
        .mode-tab{flex:1;padding:.5rem .5rem;border-radius:.5rem;font-size:.75rem;font-weight:700;text-align:center;cursor:pointer;border:none;background:transparent;color:#64748b;transition:all .2s}
        .mode-tab.active{background:#fff;color:#3b82f6;box-shadow:0 2px 6px rgba(15,23,42,.08)}
        .filter-tabs{display:flex;gap:.5rem;flex-wrap:wrap}
        .filter-tab{padding:.35rem .875rem;border-radius:9999px;font-size:.75rem;font-weight:700;cursor:pointer;border:1.5px solid #e2e8f0;background:#fff;color:#64748b;transition:all .2s}
        .filter-tab.active{border-color:#6366f1;color:#3b82f6;background:#eff6ff}
        .slider{-webkit-appearance:none;appearance:none;width:100%;height:6px;border-radius:9999px;background:linear-gradient(90deg,#3b82f6,#8b5cf6);outline:none}
        .slider::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;border-radius:50%;background:#fff;border:3px solid #3b82f6;cursor:pointer;box-shadow:0 2px 8px rgba(99,102,241,.3);transition:transform .15s}
        .slider::-webkit-slider-thumb:hover{transform:scale(1.2)}

        /* ===== GROUPS ===== */
        .group-card{background:#fff;border:1.5px solid #e2e8f0;border-radius:1.25rem;overflow:hidden;margin-bottom:1rem;transition:border-color .2s,box-shadow .2s;animation:fadeIn .3s ease}
        .group-card:hover{border-color:#bfdbfe;box-shadow:0 4px 16px rgba(99,102,241,.08)}
        .group-header{display:flex;align-items:center;gap:.75rem;padding:1rem 1.25rem;cursor:pointer;user-select:none}
        .group-header:hover{background:#f8faff}
        .group-body{padding:0 1.25rem 1.25rem;border-top:1px solid #f1f5f9}
        .group-thumbs{display:flex;gap:.875rem;overflow-x:auto;padding:.875rem 0 .5rem;scrollbar-width:thin;scrollbar-color:#cbd5e1 #f1f5f9}
        .group-thumbs::-webkit-scrollbar{height:5px}
        .group-thumbs::-webkit-scrollbar-track{background:#f1f5f9;border-radius:9999px}
        .group-thumbs::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:9999px}
        .thumb-wrap{flex:0 0 auto;width:110px;cursor:pointer;transition:transform .2s}
        .thumb-wrap:hover{transform:translateY(-2px)}
        .thumb-card{border:2.5px solid #e2e8f0;border-radius:.875rem;overflow:hidden;background:#fff;box-shadow:0 2px 8px rgba(15,23,42,.06);transition:border-color .2s,box-shadow .2s;position:relative}
        .thumb-card.is-keep{border-color:#10b981;box-shadow:0 4px 12px rgba(16,185,129,.2)}
        .thumb-card.is-remove{border-color:#ef4444;background:#fef2f2}
        .thumb-card canvas{width:100%;height:auto;display:block}
        .thumb-status{position:absolute;top:.35rem;right:.35rem;width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.65rem;font-weight:800}
        .thumb-status-keep{background:#6366f1;color:#fff}
        .thumb-status-remove{background:#ef4444;color:#fff}
        .thumb-footer{padding:.4rem .5rem;background:#fff;border-top:1px solid #f1f5f9}
        .thumb-num{font-size:.68rem;font-weight:700;color:#475569}
        .thumb-compare-btn{font-size:.62rem;color:#3b82f6;cursor:pointer;font-weight:600;display:block;margin-top:.1rem;border:none;background:none;padding:0;text-align:left}
        .thumb-compare-btn:hover{text-decoration:underline}
        .group-actions{display:flex;gap:.5rem;flex-wrap:wrap;padding-top:.75rem;border-top:1px solid #f1f5f9;margin-top:.75rem}

        /* ===== BADGES ===== */
        .badge{display:inline-flex;align-items:center;gap:.25rem;padding:.2rem .6rem;border-radius:9999px;font-size:.7rem;font-weight:700;letter-spacing:.02em}
        .badge-exact{background:#fef2f2;color:#ef4444;border:1px solid #fecaca}
        .badge-text{background:#eff6ff;color:#3b82f6;border:1px solid #bfdbfe}
        .badge-visual{background:#f5f3ff;color:#7c3aed;border:1px solid #ddd6fe}
        .badge-conf-high{background:#f0fdf4;color:#16a34a;border:1px solid #bbf7d0}
        .badge-conf-med{background:#eff6ff;color:#2563eb;border:1px solid #bfdbfe}
        .badge-conf-low{background:#fff7ed;color:#c2410c;border:1px solid #fed7aa}
        .group-num-badge{width:2rem;height:2rem;border-radius:.5rem;background:linear-gradient(135deg,#6366f1,#7c3aed);color:#fff;font-size:.75rem;font-weight:800;display:flex;align-items:center;justify-content:center;flex-shrink:0}
        .expand-btn{margin-left:auto;width:28px;height:28px;border-radius:.5rem;border:1.5px solid #e2e8f0;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#94a3b8;flex-shrink:0;transition:all .2s}
        .expand-btn:hover{border-color:#6366f1;color:#3b82f6}
        .chevron{transition:transform .25s}
        .chevron.open{transform:rotate(180deg)}

        /* ===== EMPTY STATE ===== */
        .empty-state{text-align:center;padding:3.5rem 2rem;background:#f8fafc;border:1.5px dashed #e2e8f0;border-radius:1.25rem}

        /* ===== MODAL ===== */
        .modal-overlay{position:fixed;inset:0;background:rgba(15,23,42,.75);backdrop-filter:blur(6px);z-index:9000;display:flex;align-items:center;justify-content:center;padding:1.5rem;opacity:0;transition:opacity .25s}
        .modal-overlay.visible{opacity:1}
        .modal-box{background:#fff;border-radius:1.5rem;max-width:960px;width:100%;max-height:90vh;overflow-y:auto;box-shadow:0 32px 80px rgba(15,23,42,.3);transform:translateY(12px);transition:transform .25s;animation:fadeIn .25s ease forwards}
        .modal-compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:1.25rem;padding:1.25rem}
        .modal-page-wrap{border:1.5px solid #e2e8f0;border-radius:1rem;overflow:hidden;background:#f8fafc}
        .modal-page-wrap canvas{width:100%;height:auto;display:block}
        .modal-page-label{padding:.625rem .875rem;background:#fff;border-bottom:1px solid #e2e8f0;font-size:.8rem;font-weight:700;color:#475569;display:flex;align-items:center;gap:.5rem}

        /* ===== INFO PANEL ===== */
        .info-panel{background:#fff;border:1px solid #e2e8f0;border-radius:1rem;padding:1.125rem;display:flex;flex-direction:column;gap:.625rem}
        .info-row{display:flex;justify-content:space-between;align-items:center;font-size:.8125rem}
        .info-key{color:#64748b;font-weight:500}
        .info-val{font-weight:700;color:#1e293b}

        /* ===== PRIVACY / TRUST ===== */
        .privacy-banner{display:flex;align-items:center;gap:.75rem;background:rgba(16,185,129,.06);border:1px solid rgba(16,185,129,.2);border-radius:.875rem;padding:.875rem 1.25rem;font-size:.8125rem;color:#065f46;font-weight:600}

        /* ===== DOWNLOAD CARD ===== */
        .download-card{background:linear-gradient(135deg,#f0fdf4,#dcfce7);border:2px solid #bbf7d0;border-radius:1.5rem;padding:2.5rem;text-align:center}
        .success-icon{width:4.5rem;height:4.5rem;background:linear-gradient(135deg,#10b981,#059669);border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 1.25rem;box-shadow:0 8px 24px rgba(16,185,129,.35)}

        /* ===== ERROR ===== */
        .error-card{background:#fef2f2;border:1.5px solid #fecaca;border-radius:1rem;padding:2rem;text-align:center;color:#dc2626}

        /* ===== TOAST ===== */
        #toast{position:fixed;bottom:1.5rem;right:1.5rem;background:#1e293b;color:#fff;padding:.875rem 1.5rem;border-radius:.875rem;font-size:.875rem;font-weight:600;box-shadow:0 8px 24px rgba(15,23,42,.25);transform:translateY(4rem);opacity:0;transition:all .35s cubic-bezier(.34,1.56,.64,1);z-index:9999;max-width:320px;pointer-events:none}
        #toast.show{transform:translateY(0);opacity:1}

        /* ===== SECTIONS ===== */
        .section{padding:5rem 1.5rem}
        .feat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1.5rem}
        .feat-card{background:#fff;border:1px solid #e8edf5;border-radius:1.25rem;padding:1.75rem;box-shadow:0 2px 12px rgba(15,23,42,.05);transition:all .3s}
        .feat-card:hover{transform:translateY(-3px);box-shadow:0 8px 24px rgba(99,102,241,.1);border-color:#bfdbfe}
        .feat-icon{width:2.75rem;height:2.75rem;border-radius:.875rem;display:flex;align-items:center;justify-content:center;margin-bottom:1rem}
        .faq-item{background:#fff;border:1.5px solid #e8edf5;border-radius:1.125rem;margin-bottom:.75rem;overflow:hidden;transition:border-color .2s,box-shadow .2s}
        .faq-item:hover{border-color:#bfdbfe;box-shadow:0 4px 16px rgba(99,102,241,.08)}
        .faq-item.faq-open{border-color:#bfdbfe;box-shadow:0 2px 12px rgba(99,102,241,.1)}
        .faq-q{font-size:.9375rem;font-weight:700;color:#1e293b;cursor:pointer;display:flex;justify-content:space-between;align-items:start;gap:1rem;padding:1.25rem 1.5rem;width:100%;text-align:left;background:transparent;border:none;transition:background .15s}
        .faq-q:hover{background:#f8faff}
        .faq-a{font-size:.8875rem;color:#475569;line-height:1.78;display:none;padding:.125rem 1.5rem 1.25rem;border-top:1px solid #eff4ff;background:#f8faff}
        .faq-a.open{display:block}
        .faq-chevron{flex-shrink:0;transition:transform .25s;color:#94a3b8;margin-top:.1rem}
        .faq-chevron.open{transform:rotate(180deg);color:#3b82f6}
        .rts-wrap{padding:2rem 1.5rem;background:linear-gradient(135deg,#f8faff 0%,#faf5ff 100%);border-top:1px solid rgba(148,163,184,.12);border-bottom:1px solid rgba(148,163,184,.12)}
        .rts-inner{max-width:84rem;margin:0 auto}
        .rts-header{display:flex;align-items:center;gap:.75rem;margin-bottom:1.125rem}
        .rts-divider{flex:1;height:1px;background:linear-gradient(90deg,#e2e8f0,transparent)}
        .rts-label{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:#94a3b8;white-space:nowrap}
        .rts-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:.75rem}
        .rts-card{display:flex;
            min-width: 0;align-items:center;gap:.625rem;padding:.75rem .75rem;background:#fff;border:1px solid #e8edf5;border-radius:.875rem;text-decoration:none;box-shadow:0 1px 4px rgba(15,23,42,.05);transition:transform .22s cubic-bezier(.34,1.56,.64,1),box-shadow .22s ease,border-color .22s ease}
        .rts-card:hover{transform:translateY(-3px);border-color:transparent;box-shadow:0 8px 24px rgba(99,102,241,.13),0 2px 8px rgba(15,23,42,.06)}
        .rts-icon{width:2rem;height:2rem;border-radius:.625rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:transform .22s cubic-bezier(.34,1.56,.64,1)}
        .rts-card:hover .rts-icon{transform:scale(1.1)}
        .rts-text{display:flex;flex-direction:column;min-width:0}
        .rts-name{font-size:.8125rem;font-weight:700;color:#1e293b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2}
        .rts-hint{font-size:.7rem;color:#94a3b8;margin-top:.15rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
        .rts-card:hover .rts-name{color:#1e40af}

        /* ===== RESPONSIVE ===== */
        @media(max-width:1024px){.stats-grid{grid-template-columns:repeat(3,1fr)}.feat-grid{grid-template-columns:repeat(2,1fr)}.guide-grid{grid-template-columns:1fr!important}}
        @media(max-width:1100px){.rts-grid{grid-template-columns:repeat(3,1fr)}}
        @media(max-width:860px){.rts-grid{grid-template-columns:repeat(3,1fr)}.modal-compare-grid{grid-template-columns:1fr}.guide-stats{grid-template-columns:repeat(2,1fr)!important}}
        @media(max-width:640px){.stats-grid{grid-template-columns:repeat(2,1fr)}.feat-grid{grid-template-columns:1fr}.group-header{flex-wrap:wrap}}
        @media(max-width:540px){
            .rts-wrap{padding:1.125rem 1rem}
            .rts-header{margin-bottom:.75rem}
            .rts-grid{grid-template-columns:repeat(2,1fr);gap:.5rem}
            .rts-card{padding:.625rem .75rem;gap:.5rem}
            .rts-icon{width:2rem;height:2rem;border-radius:.5rem}
            .rts-name{font-size:.75rem}
            .rts-hint{font-size:.65rem}
        }
        @media(max-width:380px){
            .rts-wrap{padding:.875rem .75rem}
            .rts-grid{gap:.4rem}
            .rts-card{padding:.5rem .625rem;gap:.4rem}
            .rts-icon{width:1.75rem;height:1.75rem}
        }
        @media(max-width:480px){.stats-grid{grid-template-columns:repeat(2,1fr)}}
