/*
Ezorxpdf - Shared Tool Page Styles
=============================================
Used by: pdf-merge, pdf-compress, pdf-split, pdf-to-text, pdf-to-image,
         pdf-protect, pdf-unlock, pdf-watermark, pdf-ocr, image-to-text,
         pdf-summarizer, research-paper-summarizer
Version: 1.0.0
*/

/* ============================================
   PDF MERGE TOOL - v2 (Reference Match)
   ============================================ */

/* ---- State Visibility ---- */
#st-upload.hidden, #st-files.hidden, #st-settings.hidden, #st-processing.hidden, #st-result.hidden, #st-error.hidden, #st-editor.hidden, #st-workspace.hidden { display: none !important; }

/* ---- Upload State ---- */
.mp-upload-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1rem;
}
.mp-upload-title {
    text-align: center;
    margin-bottom: 2.5rem;
}
.mp-upload-title h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 0.5rem;
}
.mp-upload-title p {
    font-size: 1.0625rem;
    color: #6b7280;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.mp-dropzone {
    border: 2px dashed #c7d2fe;
    border-radius: 1rem;
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbff;
}
.mp-dropzone:hover,
.mp-dropzone.dragover {
    border-color: #6366f1;
    background: #f0f0ff;
}
.mp-dropzone-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.mp-dropzone-icon svg { width: 32px; height: 32px; color: #6366f1; }
.mp-dropzone-icon img { width: 100%; height: auto; max-width: 122px; }
.mp-dropzone-icon::after {
    content: '✦';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    color: #a78bfa;
    animation: sparkle 2s ease-in-out infinite;
}
@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}
.mp-dropzone h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}
.mp-dropzone-or {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 320px;
    margin: 0 auto 0.75rem;
    color: #9ca3af;
    font-size: 0.875rem;
}
.mp-dropzone-or::before,
.mp-dropzone-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.mp-choose-btn {
    display: inline-flex;
    align-items: stretch;
    border-radius: 0.625rem;
    overflow: hidden;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.35);
    transition: box-shadow 0.2s, transform 0.2s;
}
.mp-choose-btn:hover {
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}
.mp-choose-main {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.mp-choose-main:hover { background: linear-gradient(135deg, #4f46e5, #4338ca); }
.mp-choose-drop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    color: white;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.2);
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s;
}
.mp-choose-drop:hover { background: linear-gradient(135deg, #4338ca, #3730a3); }
.mp-dropzone-hint {
    font-size: 0.8125rem;
    color: #9ca3af;
    margin-top: 0.75rem;
}

/* Trust Badges */
.mp-trust-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
}
.mp-trust-item {
    text-align: center;
}
.mp-trust-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mp-trust-icon svg { width: 28px; height: 28px; }
.mp-trust-item h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}
.mp-trust-item p {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Mini Trust Row */
.mp-subtitle-mobile { display: none; }
.mp-mini-trust {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.mp-mini-trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}
.mp-mini-trust-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Explore Other Tools */
.mp-explore-section {
    margin-top: 6rem;
    margin-bottom: 1.5rem;
    padding-top: 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.mp-explore-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 2rem;
    text-align: center;
}
.mp-explore-content {
    display: grid;
    grid-template-columns: repeat(6, auto);
    column-gap: 3.5rem;
    row-gap: 0;
    justify-content: center;
}
.mp-explore-ai-row {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.mp-explore-cat-title {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.mp-explore-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.625rem;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.15s;
    border: 1.5px solid transparent;
    margin-bottom: 0.125rem;
    white-space: nowrap;
}
.mp-explore-item:hover {
    background: #f3f4f6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.mp-explore-item:active {
    transform: translateY(0);
}
.mp-explore-item.active {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4f46e5;
}
.mp-explore-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mp-explore-item-icon svg {
    width: 16px;
    height: 16px;
}
#tools-mega-panel .tools-category-section {
    margin-top: 0;
    margin-bottom: 0;
}
.tools-category-section {
    margin-top: 6rem;
    margin-bottom: 1.5rem;
    padding-top: 0;
    padding-bottom: 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.tools-category-grid {
    display: grid;
    grid-template-columns: repeat(6, auto);
    column-gap: 3.5rem;
    row-gap: 0;
    justify-content: center;
}
.tools-category-ai {
    grid-column: 1;
    grid-row: 2;
    margin-top: -12rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.tools-category-ocr {
    grid-column: 2;
    grid-row: 2;
    margin-top: -8.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.tools-category-name {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.tools-category-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border-radius: 12px;
    text-decoration: none;
    color: #374151;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1.5px solid transparent;
    margin-bottom: 0.125rem;
    white-space: nowrap;
}
.tools-category-item:hover {
    background: #f3f4f6;
    color: #4f46e5;
    transform: translateY(-1px);
}
.tools-category-icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tools-category-icon svg {
    width: 16px;
    height: 16px;
    stroke: #ffffff;
}
@media (max-width: 1024px) {
    .mp-explore-row, .mp-explore-ai-row { grid-template-columns: repeat(3, 1fr); }
    .mp-explore-ai-row > div { grid-column: auto; }
    .tools-category-grid { grid-template-columns: repeat(3, auto); column-gap: 2.5rem; }
}
@media (max-width: 768px) {
    .mp-explore-row, .mp-explore-ai-row { grid-template-columns: repeat(2, 1fr); gap: 1.25rem 1rem; }
    .tools-category-grid { grid-template-columns: repeat(2, auto); column-gap: 1.5rem; }
    .tools-category-ai { margin-top: 0; grid-column: auto; grid-row: auto; }
    .tools-category-ocr { margin-top: 0; grid-column: auto; grid-row: auto; }
}
@media (max-width: 480px) {
    .mp-explore-row, .mp-explore-ai-row { grid-template-columns: 1fr; }
    .tools-category-grid { grid-template-columns: 1fr; }
    .tools-category-ai { margin-top: 0; grid-column: auto; grid-row: auto; }
    .tools-category-ocr { margin-top: 0; grid-column: auto; grid-row: auto; }
    .mp-subtitle-desktop { display: none; }
    .mp-subtitle-mobile { display: block; }
    .mp-mini-trust { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 0.25rem 1rem; }
    .mp-mini-trust-item { font-size: 0.75rem; white-space: nowrap; }
    .mp-mini-trust-item svg { width: 14px; height: 14px; }
    .mp-mini-trust-item:last-child { grid-column: 1 / -1; justify-self: center; margin-top: 0.125rem; }
}

/* ---- Files State ---- */
.mp-files-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}
.mp-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    background: white;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}
.mp-back-btn:hover { background: #f9fafb; border-color: #d1d5db; }
.mp-files-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.mp-files-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}
.mp-files-count {
    margin-left: auto;
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 500;
}
.mp-finish-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 1rem;
}
.mp-finish-btn:hover { background: linear-gradient(135deg, #16a34a, #15803d); box-shadow: 0 2px 8px rgba(34,197,94,0.3); }

/* Toolbar */
.mp-toolbar {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
/* Watermark / Editor Toolbar (sticky bar above viewer) */
.wm-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-sizing: border-box;
    flex-wrap: wrap;
}
.wm-toolbar-divider {
    width: 1px;
    height: 22px;
    background: #e5e7eb;
    flex-shrink: 0;
}
.mp-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}
.mp-tool-btn:hover { background: #f9fafb; border-color: #d1d5db; }
.mp-tool-btn.active { background: #6366f1; border-color: #6366f1; color: white; }
.mp-tool-btn.active svg { color: white; }
.mp-tool-btn svg { width: 14px; height: 14px; color: #6b7280; }
.mp-select-all {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #6b7280;
    cursor: pointer;
    font-weight: 500;
}
.mp-toolbar-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
}
.mp-view-toggle {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.mp-view-btn {
    padding: 0.4rem 0.5rem;
    background: white;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.15s ease;
}
.mp-view-btn.active { background: #f3f4f6; color: #374151; }
.mp-view-btn svg { width: 14px; height: 14px; }

/* Files Layout */
.mp-files-body {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.mp-files-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.875rem;
}
.mp-files-grid.list-view {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.mp-files-grid.list-view .mp-pdf-card {
    max-width: 350px;
}
.mp-files-grid.list-view .mp-card-preview {
    aspect-ratio: 3/4;
    max-height: 200px;
}

/* List view file row */
.mp-file-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: move;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.mp-file-row:hover {
    border-color: #c7d2fe;
    box-shadow: 0 1px 4px rgba(99,102,241,0.06);
}
.mp-file-row:active { cursor: grabbing; }
.mp-file-row.dragging { opacity: 0.4; border-style: dashed; cursor: grabbing; }
.mp-file-row.drag-over { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.3); }
.mp-file-row-icon {
    width: 40px;
    height: 40px;
    background: #eef2ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mp-file-row-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.mp-file-row-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mp-file-row-size {
    font-size: 11px;
    color: #9ca3af;
}
.mp-file-row-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.mp-file-row-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* PDF Thumbnail Card */
.mp-pdf-card {
    position: relative;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    cursor: move;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.mp-pdf-card:hover { border-color: #c7d2fe; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.mp-pdf-card:active { cursor: grabbing; }
.mp-pdf-card.dragging { opacity: 0.4; border-style: dashed; cursor: grabbing; }
.mp-pdf-card.drag-over { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.3); }
.mp-pdf-card.selected { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.2); }
.mp-pdf-card-top {
    position: absolute;
    top: 0.375rem;
    left: 0.375rem;
    right: 0.375rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}
.mp-drag-dots {
    display: grid;
    grid-template-columns: repeat(2, 3px);
    gap: 2px;
    padding: 4px;
    cursor: move;
}
.mp-drag-dots span {
    width: 3px;
    height: 3px;
    background: #9ca3af;
    border-radius: 50%;
}
.mp-card-close {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.15s ease;
}
.mp-card-close:hover { background: rgba(0,0,0,0.08); }
.mp-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.mp-card-rotate {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.15s ease;
}
.mp-card-rotate:hover { background: rgba(99,102,241,0.12); color: #6366f1; }
.mp-file-row-rotate {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.mp-file-row-rotate:hover { background: #eef2ff; color: #6366f1; }
.mp-card-preview img { transition: transform 0.2s ease; }
.mp-card-preview {
    width: 100%;
    aspect-ratio: 3/4;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.mp-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mp-card-preview .pdf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
    font-size: 0.75rem;
}
.mp-card-preview .pdf-placeholder svg { width: 32px; height: 32px; color: #d1d5db; pointer-events: none; }
.mp-thumb-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.375rem;
    pointer-events: none;
}
.mp-card-num {
    text-align: center;
    padding: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
}
.mp-card-num .rot-deg {
    color: #6366f1;
    margin-left: 2px;
}
.mp-file-row-size .rot-deg {
    color: #6366f1;
    font-weight: 600;
}
.mp-add-card {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 240px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    background: transparent;
}
.mp-add-card:hover { border-color: #6366f1; color: #6366f1; background: #fafaff; }
.mp-add-card svg { width: 28px; height: 28px; }
.mp-add-card span { font-size: 0.75rem; font-weight: 500; }

/* Sidebar */
.mp-sidebar {
    width: 350px;
    min-height: 400px;
    max-height: 80vh;
    flex-shrink: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.25rem;
    overflow-y: auto;
}
.mp-sidebar-title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.5rem;
}
.mp-sidebar-title svg { width: 16px; height: 16px; color: #6366f1; }
.mp-sidebar-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.mp-sidebar-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.8125rem;
    color: #374151;
    background: white;
    cursor: pointer;
    margin-bottom: 0.5rem;
}
.mp-tip-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}
.mp-tip-box h5 {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.25rem;
}
.mp-tip-box p {
    font-size: 0.75rem;
    color: #a16207;
    line-height: 1.5;
}
.mp-stats {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-top: 1px solid #f3f4f6;
    font-size: 0.8125rem;
}
.mp-stats span:first-child { color: #6b7280; }
.mp-stats span:last-child { font-weight: 600; color: #111827; }

.mp-ad-slot {
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    padding: 0;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}
.mp-ad-slot:empty {
    display: none;
}

.mp-ad-placeholder {
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}
.mp-ad-placeholder span {
    font-size: 0.6875rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Settings full height - only for st-settings */
.mp-settings-full {
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}
.mp-settings-full .mp-files-body {
    flex: 1;
    min-height: 0;
    align-items: stretch;
}
.mp-settings-full .mp-sidebar {
    width: 350px;
    flex-shrink: 0;
    justify-content: flex-start;
    gap: 0.5rem;
    max-height: 90%;
    border-radius: 12px;
    padding-bottom: 1.5rem;
}
.mp-settings-full .mp-sidebar-label {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #111827;
    text-align: center;
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 0.75rem;
}

.mp-ad-container {
    margin: -2rem auto 2.5rem;
    padding: 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 728px;
    max-width: 100%;
    min-height: 90px;
}
.mp-ad-container:empty {
    display: none;
}
.mp-ad-container .adsbygoogle {
    display: inline-block;
}

.mp-top-ad {
    margin: -2rem auto 2.5rem;
    padding: 0;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    width: 728px;
    max-width: 100%;
    height: 90px;
    overflow: hidden;
}
.mp-top-ad span {
    font-size: 0.6875rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- Result State (Premium 3-Column Layout) ---- */
.mp-result-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.mp-result-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.mp-result-top .mp-back-btn { }
.mp-result-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}
.mp-result-body {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

/* PDF Viewer (Center - Main Focus) */
.mp-viewer {
    flex: 1;
    min-width: 0;
    height: 92vh;
    background: #e8ecf1;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}
.mp-viewer-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: white;
    border-bottom: 1px solid #dde3ea;
    font-size: 0.8125rem;
    color: #6b7280;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
}
.mp-viewer-toolbar .page-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.mp-viewer-toolbar .page-nav input {
    width: 40px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.25rem 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    background: #f9fafb;
}
.mp-viewer-toolbar .page-nav input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
}
.mp-viewer-toolbar .page-nav span {
    color: #9ca3af;
    font-size: 0.8125rem;
}
.mp-viewer-toolbar .zoom {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0 auto;
}
.mp-viewer-toolbar .zoom button {
    width: 30px;
    height: 30px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.15s ease;
}
.mp-viewer-toolbar .zoom button:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}
.mp-viewer-toolbar .zoom span {
    font-weight: 600;
    color: #374151;
    min-width: 40px;
    text-align: center;
    font-size: 0.8125rem;
}
.mp-viewer-toolbar .dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}
.mp-viewer-toolbar .dl-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}
.mp-viewer-body {
    display: flex;
    flex: 1;
    height: 0;
    overflow: hidden;
    min-height: 0;
    border-top: 1px solid #dde3ea;
}
/* Watermark result viewer body - column direction for scroll */
.wm-result-viewer-body {
    background: transparent;
    border-top: none;
    padding: 1rem 1.5rem;
    flex-direction: column;
    align-items: center;
}
/* Watermark result all-pages container */
.wm-result-all-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    overflow-y: auto;
    padding: 0.75rem 0;
    width: 100%;
    flex: 1;
    min-height: 0;
}


/* Thumbnail Sidebar (Left) */
.mp-thumb-sidebar {
    width: 150px;
    background: #f8f9fb;
    border-right: 1px solid #dde3ea;
    padding: 0.75rem 0.625rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    flex-shrink: 0;
}
.mp-thumb-sidebar::-webkit-scrollbar {
    width: 4px;
}
.mp-thumb-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.mp-thumb-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}
.mp-thumb {
    border: none;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: transparent;
    box-shadow: none;
    flex-shrink: 0;
}
.mp-thumb:hover {
    opacity: 0.85;
}
.mp-thumb.active {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}
.mp-thumb canvas {
    width: 100%;
    height: auto;
    display: block;
    background: white;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.mp-thumb span {
    font-size: 0.6875rem;
    color: #9ca3af;
    display: block;
    padding: 0.25rem 0 0.125rem;
    font-weight: 600;
}
.mp-thumb.active span {
    color: #16a34a;
}

/* Two-layer canvas stack: base PDF render + fast watermark overlay.
   Keeping these separate lets watermark settings (font/size/color/opacity/
   position/rotation) redraw instantly without re-rasterizing the PDF page,
   which is what was causing every thumbnail to visibly "refresh". */
.mp-canvas-stack {
    position: relative;
    line-height: 0;
}
.mp-canvas-stack canvas.mp-overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: none;
}

/* Main PDF Preview (Center - Hero) */
.mp-main-preview {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8ecf1;
    padding: 1.25rem;
    overflow: hidden;
    min-width: 0;
    position: relative;
}
.mp-main-preview canvas {
    max-width: 100%;
    max-height: 100%;
    background: white;
}
.mp-main-preview.zoomed {
    overflow: auto;
}
.mp-main-preview.zoomed canvas {
    max-width: none;
    max-height: none;
}

/* Result Panel (Right - Compact) */
.mp-result-panel {
    width: 350px;
    height: 92vh;
    flex-shrink: 0;
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    position: relative;
    overflow-y: auto;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}
.mp-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.875rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
}
.mp-success-icon::before,
.mp-success-icon::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: confetti 1.5s ease-out forwards;
}
.mp-success-icon::before {
    top: -8px;
    left: 10px;
    background: #fbbf24;
    animation-delay: 0.2s;
}
.mp-success-icon::after {
    top: -6px;
    right: 10px;
    background: #a78bfa;
    animation-delay: 0.4s;
}
@keyframes confetti {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-20px) scale(0); opacity: 0; }
}
.mp-success-icon svg { width: 32px; height: 32px; color: #059669; }
.mp-result-panel h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.125rem;
}
.mp-result-panel .subtitle {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 1.25rem;
}
.mp-result-file {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem;
    background: #f9fafb;
    border: 1px solid #eef0f4;
    border-radius: 10px;
    text-align: left;
    margin-bottom: 0.875rem;
}
.mp-result-file-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #fef2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mp-result-file-icon svg { width: 18px; height: 18px; color: #ef4444; }
.mp-result-file-info { flex: 1; min-width: 0; }
.mp-result-file-info .name { font-size: 0.8125rem; font-weight: 600; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-result-file-info .meta { font-size: 0.6875rem; color: #9ca3af; }
/* Click-to-rename file name */
.mp-result-file-info .name.mp-renamable { cursor: text; border-radius: 4px; transition: background 0.15s; }
.mp-result-file-info .name.mp-renamable:hover { background: #eef2ff; }
.mp-result-file-info .name.is-editing { overflow: visible; background: transparent; }
.mp-rename-wrap { display: flex; align-items: center; gap: 2px; }
.mp-rename-input { box-sizing: border-box; flex: 1; min-width: 0; width: 100%; font: inherit; font-weight: 600; color: #111827; background: #fff; border: 1px solid #d1d5db; border-radius: 6px; padding: 2px 6px; outline: none; box-shadow: none; }
.mp-rename-input:focus, .mp-rename-input:focus-visible { outline: none !important; outline-offset: 0 !important; box-shadow: none !important; border-color: #6366f1; }
.mp-rename-ext { color: #6b7280; font-weight: 600; flex-shrink: 0; }
.mp-result-file-edit {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.mp-result-file-edit:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* Download Button Group */
.mp-dl-group {
    display: flex;
    margin-bottom: 0.875rem;
}
.mp-dl-main {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    border-radius: 10px 0 0 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mp-dl-main:hover { background: linear-gradient(135deg, #16a34a, #15803d); }
.mp-dl-drop {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.25);
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mp-dl-drop:hover { background: linear-gradient(135deg, #16a34a, #15803d); }

/* Action Buttons Row */
.mp-action-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.375rem;
    margin-bottom: 0.875rem;
}
.mp-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.25rem;
    background: white;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.625rem;
    font-weight: 500;
    color: #6b7280;
}
.mp-action-btn:hover { background: #f9fafb; border-color: #e5e7eb; }
.mp-action-btn svg { width: 16px; height: 16px; }
.mp-action-btn.delete:hover { background: #fef2f2; color: #ef4444; border-color: #fecaca; }

/* Compress Tip */
.mp-compress-tip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 0.6875rem;
    color: #166534;
    margin-bottom: 1rem;
}
.mp-compress-tip svg { width: 14px; height: 14px; color: #22c55e; flex-shrink: 0; }
.mp-compress-tip a { font-weight: 600; color: #15803d; }

/* Continue With */
.mp-continue { text-align: left; margin-bottom: 1rem; }
.mp-continue h5 {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.mp-continue-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.375rem;
}
.mp-continue-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}
.mp-continue-item:hover { border-color: #6366f1; background: #fafaff; }
.mp-continue-item .icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mp-continue-item .icon svg { width: 14px; height: 14px; }
.mp-continue-item span { font-size: 0.6875rem; font-weight: 500; color: #374151; line-height: 1.2; }

/* Security Note */
.mp-security {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding-top: 0.875rem;
    border-top: 1px solid #f3f4f6;
    text-align: left;
}
.mp-security svg { width: 14px; height: 14px; color: #22c55e; flex-shrink: 0; margin-top: 2px; }
.mp-security .title { font-size: 0.6875rem; font-weight: 600; color: #374151; }
.mp-security .desc { font-size: 0.625rem; color: #9ca3af; line-height: 1.4; }

/* ---- Processing State ---- */
.mp-processing-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 3rem 1rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}
.mp-processing-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 3rem 2.5rem 2.5rem;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
}

/* Orb animation */
.mp-processing-orb {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.75rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mp-orb-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #22c55e;
    animation: orbSpin 1.4s linear infinite;
}
.mp-orb-ring-2 {
    inset: 8px;
    border-top-color: #86efac;
    animation-duration: 2s;
    animation-direction: reverse;
}
.mp-orb-core {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(34,197,94,0.35);
    animation: orbPulse 2s ease-in-out infinite;
}
@keyframes orbSpin {
    to { transform: rotate(360deg); }
}
@keyframes orbPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(34,197,94,0.35); }
    50% { transform: scale(1.06); box-shadow: 0 6px 28px rgba(34,197,94,0.5); }
}

.mp-processing-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.375rem;
}
.mp-processing-sub {
    font-size: 0.8125rem;
    color: #9ca3af;
    margin-bottom: 1.75rem;
}
.mp-processing-dots::after {
    content: '';
    animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

.mp-progress-track {
    width: 100%;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.mp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a, #22c55e);
    background-size: 200% 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 0.4s ease;
    animation: progressShimmer 1.5s ease-in-out infinite;
}
@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.mp-progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #22c55e;
    margin-bottom: 1.5rem;
}

/* ---- File Loading State ---- */
/* ============ FILE LOADING - NEW DESIGN ============ */
.mp-file-loading-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    position: relative;
    overflow: hidden;
}

/* Floating Particles */
.fl-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.fl-particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    animation: fl-float 6s ease-in-out infinite;
}

.fl-p1 { width: 8px; height: 8px; background: #6366f1; top: 15%; left: 10%; animation-delay: 0s; }
.fl-p2 { width: 6px; height: 6px; background: #8b5cf6; top: 25%; right: 15%; animation-delay: 1s; }
.fl-p3 { width: 10px; height: 10px; background: #a78bfa; bottom: 30%; left: 8%; animation-delay: 2s; }
.fl-p4 { width: 5px; height: 5px; background: #6366f1; top: 60%; right: 10%; animation-delay: 0.5s; }
.fl-p5 { width: 7px; height: 7px; background: #c4b5fd; bottom: 20%; right: 20%; animation-delay: 1.5s; }
.fl-p6 { width: 4px; height: 4px; background: #818cf8; top: 40%; left: 20%; animation-delay: 3s; }

@keyframes fl-float {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
    50% { transform: translateY(-20px) scale(1.2); opacity: 0.7; }
}

/* Main Illustration Container */
.fl-illustration {
    position: relative;
    width: 200px;
    height: 240px;
    margin: 0 auto 1rem;
    z-index: 1;
}

/* Glow Ring */
.fl-glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #6366f1;
    border-right-color: #8b5cf6;
    animation: fl-spin 2s linear infinite;
    opacity: 0.6;
}

.fl-glow-ring::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-bottom-color: #a78bfa;
    border-left-color: #c4b5fd;
    animation: fl-spin 3s linear infinite reverse;
    opacity: 0.4;
}

@keyframes fl-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* PDF Document Card */
.fl-doc {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 160px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 10px 25px -5px rgba(99, 102, 241, 0.2),
        0 0 40px rgba(99, 102, 241, 0.1);
    overflow: hidden;
    z-index: 2;
    animation: fl-doc-float 3s ease-in-out infinite;
}

@keyframes fl-doc-float {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50% { transform: translate(-50%, -50%) translateY(-8px); }
}

/* Document Header Bar */
.fl-doc-header {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.fl-doc-dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

/* Document Body Lines */
.fl-doc-body {
    padding: 12px 12px 10px;
}

.fl-doc-line {
    height: 6px;
    border-radius: 3px;
    margin-bottom: 6px;
    animation: fl-shimmer 1.5s ease-in-out infinite;
}

.fl-line-1 { width: 80%; background: linear-gradient(90deg, #e0e7ff 0%, #c7d2fe 50%, #e0e7ff 100%); background-size: 200% 100%; animation-delay: 0s; }
.fl-line-2 { width: 60%; background: linear-gradient(90deg, #ede9fe 0%, #ddd6fe 50%, #ede9fe 100%); background-size: 200% 100%; animation-delay: 0.1s; }
.fl-line-3 { width: 75%; background: linear-gradient(90deg, #e0e7ff 0%, #c7d2fe 50%, #e0e7ff 100%); background-size: 200% 100%; animation-delay: 0.2s; }
.fl-line-4 { width: 45%; background: linear-gradient(90deg, #ede9fe 0%, #ddd6fe 50%, #ede9fe 100%); background-size: 200% 100%; animation-delay: 0.3s; }

.fl-doc-img {
    width: 50px;
    height: 40px;
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
    border-radius: 6px;
    margin-top: 4px;
    animation: fl-shimmer 1.5s ease-in-out infinite;
    animation-delay: 0.4s;
}

@keyframes fl-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Scanning Beam */
.fl-scan-beam {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.6), 0 0 30px rgba(139, 92, 246, 0.3);
    animation: fl-scan 2s ease-in-out infinite;
    z-index: 3;
}

@keyframes fl-scan {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Orbiting Dots */
.fl-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
    animation: fl-spin 4s linear infinite;
    z-index: 1;
}

.fl-orbit-dot {
    position: absolute;
    border-radius: 50%;
    animation: fl-pulse 1.5s ease-in-out infinite;
}

.fl-od1 {
    width: 10px;
    height: 10px;
    background: #6366f1;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.fl-od2 {
    width: 8px;
    height: 8px;
    background: #8b5cf6;
    bottom: 10px;
    right: -4px;
    animation-delay: 0.5s;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.fl-od3 {
    width: 6px;
    height: 6px;
    background: #a78bfa;
    bottom: 10px;
    left: -3px;
    animation-delay: 1s;
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

@keyframes fl-pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.4); opacity: 1; }
}

/* PDF Badge New */
.fl-pdf-badge-new {
    display: inline-block;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 20px;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    animation: fl-badge-pulse 2s ease-in-out infinite;
}

@keyframes fl-badge-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 2px 16px rgba(239, 68, 68, 0.5); }
}

/* File Info */
.fl-file-info {
    text-align: center;
    margin-bottom: 0.75rem;
    z-index: 1;
}

.fl-file-name {
    font-size: 0.8125rem;
    color: #6b7280;
    max-width: 320px;
    word-break: break-word;
    line-height: 1.5;
    margin: 0;
}

.fl-file-name span {
    color: #9ca3af;
}

/* Progress Bar */
.fl-progress-wrap {
    width: 240px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
    z-index: 1;
}

.fl-progress-bar {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
    border-radius: 2px;
    animation: fl-progress 1.5s ease-in-out infinite;
}

@keyframes fl-progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* Status Text */
.fl-status-text {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
    z-index: 1;
}

.fl-uploading-dots {
    display: inline-block;
    width: 1.5em;
    text-align: left;
}

/* ---- SEO Content ---- */
.mp-seo {
    max-width: 720px;
    margin: 2.5rem auto 0;
    padding: 0 1rem;
}
.mp-seo h2 { font-size: 1.125rem; font-weight: 700; color: #111827; margin-bottom: 0.75rem; }
.mp-seo h3 { font-size: 1rem; font-weight: 600; color: #374151; margin: 1.25rem 0 0.625rem; }
.mp-seo p { font-size: 0.875rem; color: #4b5563; line-height: 1.7; margin-bottom: 0.625rem; }
.mp-seo ul { list-style: none; padding: 0; margin-bottom: 0.875rem; }
.mp-seo ul li { position: relative; padding-left: 1.125rem; font-size: 0.875rem; color: #4b5563; line-height: 1.7; margin-bottom: 0.25rem; }
.mp-seo ul li::before { content: ''; position: absolute; left: 0; top: 0.5rem; width: 5px; height: 5px; background: #22c55e; border-radius: 50%; }

/* ---- Features Grid (6 Icons) ---- */
.mp-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem 2.5rem;
    margin-top: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.mp-feature-item {
    text-align: center;
}
.mp-feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mp-feature-icon svg {
    width: 36px;
    height: 36px;
    stroke-width: 1.25;
}
.mp-feature-item h4 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}
.mp-feature-item p {
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.6;
}

/* ---- How It Works ---- */
.mp-how-section {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin-top: 5.5rem;
    padding: 0 1rem;
    margin-left: auto;
    margin-right: auto;
}
.mp-how-section > h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #111827;
    text-align: center;
    margin-top: 6rem;
    margin-bottom: 1.5rem;
}
.mp-how-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}
.mp-how-illustration {
    flex: 0 0 42%;
    max-width: 460px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: visible;
    margin-left: -60px;
}
.mp-how-illustration img {
    width: 100%;
    max-width: 460px;
    height: auto;
}
.mp-how-illustration .doc-stack {
    position: relative;
    width: 150px;
    height: 170px;
}
.mp-how-illustration .doc-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    height: 155px;
    background: white;
    border: 3.5px solid #000000;
    border-radius: 8px;
    padding: 2.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
}
.mp-how-illustration .doc-line {
    height: 4px;
    background: #1f2937;
    border-radius: 2px;
}
.mp-how-illustration .dl-1 { width: 58%; }
.mp-how-illustration .dl-2 { width: 78%; }
.mp-how-illustration .dl-3 { width: 42%; }
.mp-how-illustration .doc-badge {
    position: absolute;
    bottom: -4px;
    right: -2px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: white;
    border: 1.5px solid #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    font-size: 0.75rem;
    font-weight: 800;
    z-index: 2;
}
.mp-how-steps {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-left: 0;
}
.mp-how-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.mp-how-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #111827;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}
.mp-how-step-text {
    font-size: 1.0625rem;
    color: #374151;
    line-height: 1.6;
}
.mp-how-step-text strong {
    font-weight: 700;
    color: #111827;
}

/* ---- FAQ Section ---- */
.mp-faq-section {
    max-width: 700px;
    margin: 5rem auto 0;
    padding: 0 1rem;
}
.mp-faq-section > h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #111827;
    text-align: center;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
}
.mp-faq-item {
    border-bottom: 1px solid #e5e7eb;
}
.mp-faq-item:first-of-type {
    border-top: 1px solid #e5e7eb;
}
.mp-faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 0;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #111827;
    text-align: left;
    transition: color 0.15s ease;
}
.mp-faq-q:hover {
    color: #4b5563;
}
.mp-faq-q svg {
    width: 18px;
    height: 18px;
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}
.mp-faq-item.open .mp-faq-q svg {
    transform: rotate(180deg);
}
.mp-faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.mp-faq-item.open .mp-faq-a {
    max-height: 300px;
}
.mp-faq-a-inner {
    padding: 0 0 1.125rem;
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.7;
}

/* ---- Responsive (Features / How / FAQ) ---- */
@media (max-width: 1024px) {
    .mp-explore-content { grid-template-columns: repeat(3, auto); column-gap: 2.5rem; }
    .mp-settings-full .mp-sidebar { width: 100%; max-height: none; }
    .mp-settings-full .mp-files-body { flex-direction: column; }
}
@media (max-width: 768px) {
    .mp-features-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .mp-how-section > h2 { padding-left: 1rem; }
    .mp-how-content { flex-direction: column; gap: 2rem; padding-left: 0; }
    .mp-how-illustration { flex: 0 0 auto !important; width: 100% !important; }
    .mp-how-illustration img { width: 100% !important; max-width: 320px !important; transform: none !important; }
    .mp-how-illustration .doc-stack { transform: scale(0.75); transform-origin: center; }
    .mp-explore-content { grid-template-columns: repeat(2, auto); column-gap: 1.5rem; }
}
@media (max-width: 480px) {
    .mp-features-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .mp-explore-content { grid-template-columns: 1fr; }
    .mp-how-illustration img { max-width: 260px !important; }
    .mp-how-illustration .doc-stack { transform: scale(0.6); }
}

/* ---- Error State ---- */
.mp-error-wrap {
    max-width: 400px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}
.mp-error-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fef2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.875rem;
}
.mp-error-icon svg { width: 28px; height: 28px; color: #ef4444; }

/* ---- Processing File Status ---- */
.mp-file-status-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    width: 100%;
    text-align: left;
}
.mp-file-status-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    background: #f9fafb;
    border-radius: 10px;
    font-size: 0.8125rem;
    color: #374151;
    border: 1px solid #f3f4f6;
}
.mp-file-status-item .check { color: #22c55e; }
@keyframes spinRotate { to { transform: rotate(360deg); } }
.mp-file-status-item .waiting {
    color: #22c55e;
    animation: spinRotate 1s linear infinite;
    display: inline-flex;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .mp-result-wrap { max-width: 100%; padding: 0 1rem; }
    .mp-thumb-sidebar { width: 120px; }
    .mp-result-panel { width: 280px; padding: 1rem; }
    .mp-settings-full { overflow-y: auto; }
    .mp-settings-full .mp-sidebar { width: 100%; max-height: none; }
    .mp-settings-full .mp-files-body { flex-direction: column; }
    .wm-toolbar { gap: 0.25rem !important; padding: 0.5rem 0.75rem !important; }
    .wm-toolbar input[type="text"] { width: 80px !important; }
    .wm-toolbar select { max-width: 110px; }
    .wm-toolbar input[type="range"] { width: 48px !important; }
}
@media (max-width: 768px) {
    .mp-trust-row { grid-template-columns: 1fr; gap: 1rem; }
    .mp-files-body { flex-direction: column; }
    .mp-files-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .mp-sidebar { width: 100%; }
    .mp-settings-full { height: auto; min-height: calc(100vh - 70px); overflow-y: auto; }
    .mp-settings-full .mp-files-body { flex-direction: column; }
    .mp-settings-full .mp-sidebar { width: 100%; max-height: none; position: relative; top: auto; }
    .mp-result-body { flex-direction: column; }
    .mp-result-panel { width: 100%; height: auto; }
    .mp-thumb-sidebar { display: none; }
    .mp-viewer { height: 50vh !important; min-height: 300px; }
    .mp-main-preview { padding: 0.75rem; }
    .mp-action-row { grid-template-columns: repeat(2, 1fr); }
    .mp-continue-grid { grid-template-columns: repeat(2, 1fr); }
    .mp-files-header { flex-wrap: wrap; }
    .mp-files-count { margin-left: 0; }
    .mp-finish-btn { margin-left: 0; }
    .mp-viewer-toolbar { flex-wrap: wrap; gap: 0.5rem; }
    .mp-result-body { display: flex !important; flex-direction: column !important; gap: 1.25rem !important; }
    .mp-viewer { width: 100% !important; grid-column: 1 !important; flex: none !important; }
    .mp-how-steps { margin-left: 0 !important; }
    .mp-toolbar { flex-wrap: wrap !important; }
    .mp-toolbar input[type="text"] { width: 80px !important; }
    .inv-grid-3 { grid-template-columns: 1fr !important; }
    .inv-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
    .inv-grid-2 { grid-template-columns: 1fr !important; }
    .wm-viewer { height: 50vh !important; min-height: 300px; }
    .wm-sidebar { height: auto !important; max-height: none !important; overflow-y: auto !important; }
    .mp-toolbar { flex-wrap: wrap !important; gap: 0.375rem !important; padding: 0.5rem 0.75rem !important; }
    .mp-toolbar > div { flex-shrink: 1; min-width: 0; }
    .mp-toolbar input[type="text"] { width: 80px !important; }
    .mp-toolbar select { max-width: 120px; }
    .mp-toolbar input[type="range"] { width: 40px !important; }
    .wm-toolbar { gap: 0.375rem !important; padding: 0.5rem 0.75rem !important; }
    .wm-toolbar > div { flex-shrink: 1; min-width: 0; }
    .wm-toolbar input[type="text"] { width: 70px !important; }
    .wm-toolbar select { max-width: 100px; }
    .wm-toolbar input[type="range"] { width: 40px !important; }
    .wm-toolbar .wm-font-size-input { width: 36px !important; }
    .wm-result-viewer-body { padding: 0.75rem 1rem; }
    .mp-result-wrap .mp-viewer { height: 40vh !important; min-height: 160px; }
    .mp-result-body[style*="grid-template-columns:1fr auto 350px"] { grid-template-columns: 1fr !important; }
    .mp-result-body[style*="grid-template-columns:1fr auto 350px"] .mp-viewer { grid-column: 1 !important; width: 100% !important; }
}
@media (max-width: 480px) {
    .mp-files-grid { grid-template-columns: repeat(2, 1fr); }
    .mp-continue-grid { grid-template-columns: repeat(2, 1fr); }
    .mp-upload-title h1 { font-size: 1.75rem; }
    .mp-upload-title p { font-size: 0.9375rem; }
    .mp-dropzone { padding: 2.5rem 1rem 2rem; }
    .mp-result-wrap { padding: 0 0.75rem; }
    .mp-main-preview { padding: 0.5rem; }
    .mp-viewer-toolbar { padding: 0.5rem 0.75rem; }
    .mp-action-row { grid-template-columns: 1fr; }
    .mp-continue-grid { grid-template-columns: repeat(2, 1fr); }
    .mp-toolbar { gap: 0.25rem !important; padding: 0.375rem 0.5rem !important; }
    .mp-toolbar > div[style*="height:22px"] { display: none; }
    .mp-toolbar input[type="text"] { width: 60px !important; }
    .mp-toolbar select { max-width: 90px; font-size: 0.6875rem !important; }
    .wm-viewer { height: 45vh !important; min-height: 250px; }
    .wm-toolbar { gap: 0.25rem !important; padding: 0.375rem 0.5rem !important; }
    .wm-toolbar-divider { display: none; }
    .wm-toolbar input[type="text"] { width: 56px !important; }
    .wm-toolbar select { max-width: 80px; font-size: 0.6875rem !important; }
    .wm-toolbar input[type="range"] { width: 36px !important; }
    .wm-toolbar .wm-font-size-input { width: 30px !important; }
    .wm-result-viewer-body { padding: 0.5rem 0.75rem; }
    .mp-result-wrap .mp-viewer { height: 35vh !important; min-height: 150px; }
}

/* ---- Sticky Mobile CTA ---- */
@media (max-width: 768px) {
    .mp-finish-btn {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        margin: 0;
        padding: 1rem;
        border-radius: 0;
        font-size: 1rem;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    .mp-finish-btn + * {
        margin-bottom: 60px;
    }
}

/* ---- Explore Grid Tablet ---- */
@media (max-width: 1024px) and (min-width: 769px) {
    .mp-explore-content { grid-template-columns: repeat(3, auto); column-gap: 2rem; }
}

/* ---- FAQ Improvements ---- */
@media (max-width: 768px) {
    .mp-faq-item.open .mp-faq-a { max-height: 500px; }
    .mp-faq-a-inner { padding: 0 0.5rem 1.125rem; }
}

/* ---- How It Works Responsive ---- */
@media (max-width: 768px) {
    .mp-how-content { gap: 1.5rem; }
    .mp-how-illustration { max-width: 280px; }
    .mp-how-steps { gap: 0.75rem; }
    .mp-how-step-text { font-size: 0.875rem; }
}

/* ---- Features Grid Tablet ---- */
@media (max-width: 1024px) and (min-width: 769px) {
    .mp-features-grid { gap: 1.5rem; }
    .mp-feature-item p { font-size: 0.875rem; }
}

/* ---- Mobile Touch Targets (44px minimum) ---- */
@media (max-width: 768px) {
    .mp-tool-btn,
    .mp-view-btn,
    .mp-action-btn,
    .mp-continue-item {
        min-height: 44px;
        min-width: 44px;
    }
    .mp-card-close,
    .mp-card-rotate,
    .mp-file-row-close,
    .mp-file-row-rotate,
    .mp-result-file-edit {
        min-width: 44px;
        min-height: 44px;
    }
    .mp-drag-dots {
        padding: 8px;
    }
    .mp-drag-dots span {
        width: 4px;
        height: 4px;
    }

    /* 92vh viewer/sidebar override for mobile */
    .mp-viewer.wm-viewer,
    .mp-viewer[style*="height:92vh"] {
        height: 50vh !important;
        max-height: 50vh !important;
    }
    .mp-sidebar.wm-sidebar,
    .mp-sidebar[style*="height:92vh"] {
        height: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
    }

    /* Editor/Watermark toolbar mobile */
    .wm-toolbar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    .wm-toolbar > div {
        flex-shrink: 0;
    }
    .wm-toolbar .ed-tool-btn,
    .wm-toolbar button[style*="width:28px"],
    .wm-toolbar button[style*="width:34px"],
    .wm-toolbar label[style*="width:34px"] {
        min-width: 44px !important;
        min-height: 44px !important;
        width: auto !important;
        height: auto !important;
    }
    .wm-toolbar input[type="range"] {
        min-width: 80px;
    }
    .wm-toolbar select {
        min-height: 44px;
        font-size: 0.8125rem;
    }
    .wm-toolbar input[type="text"],
    .wm-toolbar input[type="number"] {
        min-height: 36px;
    }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
