/* TulBD PDF Tools Suite CSS */
.pdf-tools-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 28px;
    background: var(--tb-card, #ffffff);
    border: 1px solid var(--tb-border, rgba(0, 0, 0, 0.08));
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.pdf-tools-header {
    text-align: center;
    margin-bottom: 24px;
}

.pdf-tools-title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
}

.pdf-tools-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.pdf-tools-header h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: var(--tb-text, #1e293b);
}

.pdf-tools-lead {
    font-size: 15px;
    color: var(--tb-muted, #64748b);
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Tool Switcher Pills */
.pdf-tools-switcher {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 0 20px;
    margin-bottom: 24px;
    border-bottom: 1.5px dashed var(--tb-border, rgba(0, 0, 0, 0.12));
}

.pdf-tool-pill {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    min-width: max-content;
    padding: 7px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--tb-muted, #475569);
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.pdf-tool-pill:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.04);
}

.pdf-tool-pill.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border-color: #dc2626 !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.28);
}

/* Dropzone */
.pdf-dropzone {
    border: 2px dashed #ef4444;
    border-radius: 14px;
    padding: 44px 20px;
    text-align: center;
    background: var(--tb-bg-soft, #f8fafc);
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 24px;
}

.pdf-dropzone:hover,
.pdf-dropzone.dragover {
    border-color: #dc2626;
    background: rgba(239, 68, 68, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

.pdf-dropzone-icon {
    margin-bottom: 14px;
    color: #ef4444;
}

.pdf-dropzone-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--tb-text, #1e293b);
    margin-bottom: 6px;
}

.pdf-dropzone-sub {
    font-size: 13.5px;
    color: var(--tb-muted, #64748b);
    margin-bottom: 18px;
}

.pdf-dropzone-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border: 1px solid #dc2626 !important;
    color: #ffffff !important;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.pdf-dropzone-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.pdf-dropzone-btn:active {
    transform: translateY(0);
}

/* Meta Bar */
.pdf-doc-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px;
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 20px;
}

.pdf-doc-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pdf-meta-badge {
    display: inline-block;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tb-text, #334155);
    background: var(--tb-card, #ffffff);
    border: 1px solid var(--tb-border, #cbd5e1);
    border-radius: 6px;
}

.pdf-meta-badge.pdf-meta-name {
    font-weight: 600;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-btn-change-file {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    background: var(--tb-card, #ffffff);
    border: 1px solid var(--tb-border, #cbd5e1);
    color: var(--tb-text, #1e293b);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-btn-change-file:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Multi-file Merge Queue */
.pdf-file-list-wrap {
    margin-bottom: 24px;
}

.pdf-file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--tb-text, #1e293b);
}

.pdf-file-list-actions {
    display: flex;
    gap: 8px;
}

.pdf-btn-add-more,
.pdf-btn-clear-all {
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--tb-border, #cbd5e1);
    background: var(--tb-card, #ffffff);
    color: var(--tb-text, #334155);
    transition: all 0.2s ease;
}

.pdf-btn-add-more:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.pdf-btn-clear-all:hover {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}

.pdf-file-queue {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pdf-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.pdf-queue-item:hover {
    border-color: #ef4444;
    background: var(--tb-card, #ffffff);
}

.pdf-queue-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.pdf-queue-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #ef4444;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.pdf-queue-info {
    min-width: 0;
}

.pdf-queue-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--tb-text, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.pdf-queue-meta {
    font-size: 12px;
    color: var(--tb-muted, #64748b);
    margin-top: 2px;
}

.pdf-queue-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdf-queue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--tb-border, #cbd5e1);
    background: var(--tb-card, #ffffff);
    color: var(--tb-text, #475569);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s ease;
}

.pdf-queue-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.pdf-queue-btn.pdf-queue-del:hover {
    border-color: #dc2626;
    background: #dc2626;
    color: #ffffff;
}

/* Organizer Toolbar */
.pdf-organizer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 20px;
}

.pdf-toolbar-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.pdf-tool-btn {
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--tb-border, #cbd5e1);
    background: var(--tb-card, #ffffff);
    color: var(--tb-text, #334155);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-tool-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.pdf-toolbar-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdf-range-input {
    width: 140px;
    padding: 6px 10px;
    font-size: 12.5px;
    border: 1px solid var(--tb-border, #cbd5e1);
    border-radius: 6px;
    background: var(--tb-card, #ffffff);
    color: var(--tb-text, #1e293b);
}

.pdf-range-input:focus {
    outline: none;
    border-color: #ef4444;
}

/* Split Options */
.pdf-split-options-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 18px;
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--tb-text, #1e293b);
}

.pdf-split-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Thumbnails Grid */
.pdf-thumbnails-container {
    margin-bottom: 24px;
}

.pdf-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    max-height: 520px;
    overflow-y: auto;
    padding: 12px;
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 12px;
}

.pdf-page-card {
    position: relative;
    background: var(--tb-card, #ffffff);
    border: 2px solid var(--tb-border, #e2e8f0);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pdf-page-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pdf-page-card.selected {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.pdf-page-top-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--tb-muted, #64748b);
}

.pdf-page-check {
    accent-color: #ef4444;
}

.pdf-page-canvas-wrap {
    width: 100%;
    aspect-ratio: 1 / 1.35;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-page-canvas-wrap canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.pdf-page-card-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
    width: 100%;
}

.pdf-page-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid var(--tb-border, #cbd5e1);
    background: var(--tb-card, #ffffff);
    color: var(--tb-text, #475569);
    cursor: pointer;
    transition: all 0.15s ease;
}

.pdf-page-action-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Compression Presets Grid */
.pdf-compress-settings-wrap {
    margin-bottom: 24px;
}

.pdf-compress-settings-wrap h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--tb-text, #1e293b);
    margin: 0 0 14px;
}

.pdf-compress-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.pdf-compress-card {
    position: relative;
    display: block;
    background: var(--tb-bg-soft, #f8fafc);
    border: 2px solid var(--tb-border, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-compress-card input[type="radio"] {
    position: absolute;
    top: 16px;
    right: 16px;
    accent-color: #ef4444;
}

.pdf-compress-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.pdf-compress-card.active {
    border-color: #ef4444;
    background: var(--tb-card, #ffffff);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.12);
}

.pdf-compress-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.pdf-compress-card-head strong {
    font-size: 15px;
    color: var(--tb-text, #1e293b);
}

.pdf-badge-rec,
.pdf-badge-extreme,
.pdf-badge-low {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}

.pdf-badge-rec {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.pdf-badge-extreme {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.pdf-badge-low {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.pdf-compress-stats {
    font-size: 13px;
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 6px;
}

.pdf-compress-card p {
    font-size: 12.5px;
    color: var(--tb-muted, #64748b);
    margin: 0;
    line-height: 1.45;
}

/* Compression Results Card */
.pdf-compress-result-card {
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 12px;
    padding: 18px 24px;
    margin-bottom: 24px;
}

.pdf-result-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 16px;
}

.pdf-res-box {
    text-align: center;
}

.pdf-res-lbl {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--tb-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.pdf-res-box strong {
    font-size: 20px;
    font-weight: 700;
    color: var(--tb-text, #1e293b);
}

.pdf-res-val-saved {
    color: #059669 !important;
    background: rgba(16, 185, 129, 0.12);
    padding: 3px 10px;
    border-radius: 6px;
}

.pdf-res-arrow {
    font-size: 20px;
    color: var(--tb-muted, #94a3b8);
}

/* Progress Bar */
.pdf-progress-wrap {
    margin-bottom: 24px;
}

.pdf-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--tb-text, #334155);
    margin-bottom: 8px;
}

.pdf-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--tb-border, #e2e8f0);
    border-radius: 4px;
    overflow: hidden;
}

.pdf-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 4px;
    transition: width 0.2s ease;
}

/* Action Buttons */
.pdf-tools-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.pdf-btn-action,
.pdf-btn-download-merged,
.pdf-btn-download-organized,
.pdf-btn-download-split-zip,
.pdf-btn-download-compressed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #ffffff !important;
    border: none;
    border-radius: 10px !important;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
    transition: all 0.2s ease;
}

.pdf-btn-action:hover:not(:disabled),
.pdf-btn-download-merged:hover,
.pdf-btn-download-organized:hover,
.pdf-btn-download-split-zip:hover,
.pdf-btn-download-compressed:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.pdf-btn-action:disabled {
    background: #cbd5e1 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.pdf-btn-reset-suite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--tb-card, #ffffff);
    color: var(--tb-text, #334155);
    border: 1px solid var(--tb-border, #cbd5e1);
    border-radius: 10px;
    padding: 13px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-btn-reset-suite:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.pdf-status-msg {
    text-align: center;
    font-size: 13.5px;
    margin-top: 12px;
    color: var(--tb-muted, #64748b);
}

/* --- Advanced PDF Editor Workspace & Viewport --- */
.pdf-editor-workspace {
    margin-top: 20px;
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 14px;
    overflow: hidden;
}

.pdf-editor-toolbar {
    background: var(--tb-card, #ffffff);
    border-bottom: 1px solid var(--tb-border, #e2e8f0);
    padding: 10px 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pdf-editor-toolbar .pdf-toolbar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.pdf-tb-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tb-text, #334155);
    background: var(--tb-bg-soft, #f1f5f9);
    border: 1px solid var(--tb-border, #cbd5e1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-tb-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: #ef4444;
    color: #ef4444;
}

.pdf-tb-btn.active {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.pdf-tb-btn.highlight-pulse {
    animation: pdfPulse 2s infinite;
}

@keyframes pdfPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.pdf-toolbar-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.pdf-opt-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.pdf-editor-color-picker {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    background: transparent;
}

.pdf-editor-size-picker {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--tb-border, #cbd5e1);
    background: var(--tb-card, #ffffff);
    color: var(--tb-text, #334155);
    font-size: 12.5px;
}

.pdf-editor-viewport {
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
    max-height: 75vh;
    min-height: 480px;
    background: #475569;
}

.pdf-canvas-wrap {
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    background: #ffffff;
    user-select: none;
    line-height: 0;
}

.pdf-render-canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.pdf-interaction-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 2;
    touch-action: none;
}

.pdf-dom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.pdf-overlay-item {
    position: absolute;
    pointer-events: auto;
    border: 1.5px dashed #3b82f6;
    padding: 2px;
    background: rgba(59, 130, 246, 0.05);
    cursor: move;
    box-sizing: border-box;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.pdf-overlay-item.selected {
    border: 2px solid #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
    z-index: 10;
}

.pdf-item-del-btn {
    position: absolute;
    top: -13px;
    right: -13px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ef4444;
    color: #ffffff;
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 25;
    touch-action: manipulation;
    padding: 0;
}

.pdf-item-edit-btn {
    position: absolute;
    top: -13px;
    left: -13px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 25;
    touch-action: manipulation;
    padding: 0;
}

.pdf-item-resize-handle {
    position: absolute;
    bottom: -9px;
    right: -9px;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    background: #2563eb;
    border: 2px solid #ffffff;
    cursor: nwse-resize;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    touch-action: none;
    z-index: 25;
}

/* Touch hit expansion area for mobile fingertips */
.pdf-item-resize-handle::after {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
}

/* Whiteout Callout Banner */
.pdf-whiteout-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: 12px;
    padding: 14px 18px;
    margin: 16px 0;
    color: #713f12;
}

.pdf-whiteout-banner-icon {
    font-size: 20px;
    line-height: 1;
}

.pdf-whiteout-banner-text {
    font-size: 13.5px;
    line-height: 1.55;
}

/* Signature Pad Modal */
.pdf-sig-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pdf-sig-modal {
    background: var(--tb-card, #ffffff);
    border: 1px solid var(--tb-border, #cbd5e1);
    border-radius: 18px;
    max-width: 520px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.pdf-sig-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.pdf-sig-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.pdf-sig-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--tb-muted, #64748b);
}

.pdf-sig-modal-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--tb-border, #e2e8f0);
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.pdf-sig-tab-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--tb-bg-soft, #f8fafc);
    color: var(--tb-muted, #64748b);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.pdf-sig-tab-btn.active {
    background: rgba(239, 68, 68, 0.08);
    border-color: #ef4444;
    color: #ef4444;
}

.pdf-sig-tab-pane {
    display: none;
}

.pdf-sig-tab-pane.active {
    display: block;
}

.pdf-sig-draw-wrap {
    position: relative;
    border: 1.5px dashed var(--tb-border, #cbd5e1);
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}

.pdf-sig-pad-canvas {
    display: block;
    width: 100%;
    height: 180px;
    cursor: crosshair;
    touch-action: none;
}

.pdf-sig-line-hint {
    position: absolute;
    bottom: 24px;
    left: 20px;
    right: 20px;
    border-top: 1px dashed #cbd5e1;
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    pointer-events: none;
    padding-top: 4px;
}

.pdf-sig-draw-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.pdf-sig-btn-clear {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: 6px;
    border: 1px solid var(--tb-border, #cbd5e1);
    background: var(--tb-bg-soft, #f8fafc);
    cursor: pointer;
}

.pdf-sig-colors {
    display: flex;
    gap: 8px;
}

.pdf-sig-color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.pdf-sig-color-dot.active {
    border-color: #ef4444;
    transform: scale(1.1);
}

.pdf-sig-type-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 18px;
    border-radius: 10px;
    border: 1px solid var(--tb-border, #cbd5e1);
    background: var(--tb-bg-soft, #f8fafc);
    box-sizing: border-box;
}

.pdf-sig-font-previews {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 180px;
    overflow-y: auto;
}

.pdf-sig-font-card {
    padding: 12px 16px;
    border: 1.5px solid var(--tb-border, #e2e8f0);
    border-radius: 8px;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.2s ease;
}

.pdf-sig-font-card:hover,
.pdf-sig-font-card.active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.04);
}

.pdf-sig-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--tb-border, #e2e8f0);
}

.pdf-sig-btn-cancel {
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid var(--tb-border, #cbd5e1);
    background: transparent;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
}

.pdf-sig-btn-insert {
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    background: #ef4444;
    color: #ffffff;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
}

/* --- Text Extraction Suite --- */
.pdf-extract-stats-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    margin: 18px 0;
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 12px;
}

.pdf-stat-item {
    font-size: 14px;
    color: var(--tb-muted, #64748b);
}

.pdf-stat-item strong {
    color: #ef4444;
    font-size: 16px;
    margin-left: 4px;
}

.pdf-extract-controls-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pdf-extract-search-input {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--tb-border, #cbd5e1);
    font-size: 13.5px;
    width: 240px;
    background: var(--tb-card, #ffffff);
}

.pdf-extract-actions-right {
    display: flex;
    gap: 8px;
}

.pdf-extract-view-box {
    margin-bottom: 18px;
}

.pdf-extracted-textarea {
    width: 100%;
    min-height: 320px;
    padding: 18px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--tb-text, #1e293b);
    background: var(--tb-bg-soft, #f8fafc);
    border: 1.5px solid var(--tb-border, #cbd5e1);
    border-radius: 14px;
    box-sizing: border-box;
    resize: vertical;
}

/* --- Security & Permissions Suite --- */
.pdf-security-card {
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 14px;
    padding: 24px;
    margin: 20px 0;
}

.pdf-security-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
}

.pdf-sec-hint {
    font-size: 13.5px;
    color: var(--tb-muted, #64748b);
    margin: 0 0 16px;
    line-height: 1.5;
}

.pdf-pwd-input-group {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 440px;
}

.pdf-pwd-input-group input {
    width: 100%;
    padding: 10px 44px 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--tb-border, #cbd5e1);
    font-size: 14px;
    background: var(--tb-card, #ffffff);
    box-sizing: border-box;
}

.pdf-btn-toggle-pwd {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--tb-muted, #64748b);
}

.pdf-pwd-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.pdf-pwd-col {
    flex: 1;
    min-width: 240px;
}

.pdf-pwd-col label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.pdf-strength-meter {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
    max-width: 440px;
}

.pdf-strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
}

.pdf-permissions-box {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed var(--tb-border, #cbd5e1);
}

.pdf-permissions-box h4 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
}

.pdf-perms-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pdf-perm-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    cursor: pointer;
}

/* Signature Removal Technical Banner */
.pdf-removesig-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    color: #1e3a8a;
    font-size: 14px;
    line-height: 1.55;
}
.pdf-removesig-banner-icon {
    font-size: 22px;
    flex-shrink: 0;
}
.pdf-removesig-banner-text strong {
    color: #1d4ed8;
}

/* Metadata & Properties Stats Grid */
.pdf-meta-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.pdf-meta-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}
.pdf-meta-stat-card:hover {
    border-color: #ef4444;
    transform: translateY(-1px);
}
.pdf-meta-stat-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    flex-shrink: 0;
}
.pdf-meta-stat-info {
    display: flex;
    flex-direction: column;
}
.pdf-meta-stat-info .pdf-stat-lbl {
    font-size: 12px;
    color: var(--tb-muted, #64748b);
    font-weight: 500;
}
.pdf-meta-stat-info strong {
    font-size: 15px;
    color: var(--tb-text, #0f172a);
    font-weight: 700;
    margin-top: 2px;
}

/* Metadata Form Card */
.pdf-metadata-card {
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 24px;
}
.pdf-meta-card-head {
    margin-bottom: 18px;
    border-bottom: 1px dashed var(--tb-border, #cbd5e1);
    padding-bottom: 12px;
}
.pdf-meta-card-head h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: var(--tb-text, #0f172a);
}
.pdf-meta-card-head p {
    margin: 0;
    font-size: 13.5px;
    color: var(--tb-muted, #64748b);
}
.pdf-meta-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.pdf-meta-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pdf-meta-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tb-text, #334155);
}
.pdf-meta-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--tb-border, #cbd5e1);
    border-radius: 8px;
    font-size: 14px;
    background: var(--tb-card, #ffffff);
    color: var(--tb-text, #0f172a);
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.pdf-meta-field input:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.pdf-meta-field input[readonly] {
    background: rgba(0, 0, 0, 0.04);
    color: var(--tb-muted, #64748b);
    cursor: default;
}

/* ==========================================
   RESOURCE EXTRACTION SUITE (IMAGES, FONTS, LINKS, ETC.)
   ========================================== */
.pdf-extract-resource-section {
    margin-top: 20px;
}
.pdf-res-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 12px;
    margin-bottom: 16px;
}
.pdf-res-count-badge {
    font-size: 14px;
    color: var(--tb-text, #1e293b);
}
.pdf-res-count-badge strong {
    color: #ef4444;
    font-size: 16px;
}
.pdf-res-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.pdf-res-actions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--tb-border, #cbd5e1);
    background: #ffffff;
    color: var(--tb-text, #1e293b);
    cursor: pointer;
    transition: all 0.2s;
}
.pdf-res-actions button:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}
.pdf-res-actions .pdf-btn-res-download-all {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}
.pdf-res-actions .pdf-btn-res-download-all:hover {
    background: #dc2626;
    border-color: #dc2626;
}
.pdf-tech-notice-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
    text-align: left;
}
.pdf-tech-notice-box h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #92400e;
}
.pdf-tech-notice-box p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #78350f;
}
.pdf-res-filter-wrap {
    margin-bottom: 16px;
}
.pdf-res-search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--tb-border, #cbd5e1);
    border-radius: 10px;
    font-size: 14px;
    background: #ffffff;
    color: var(--tb-text, #1e293b);
    box-sizing: border-box;
}
.pdf-res-search-input:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.pdf-res-content-container {
    margin-bottom: 20px;
}
.pdf-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.pdf-image-item {
    background: #ffffff;
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.pdf-image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}
.pdf-image-thumb-wrap {
    height: 140px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    overflow: hidden;
}
.pdf-image-thumb-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.pdf-image-meta {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--tb-muted, #64748b);
    border-top: 1px solid var(--tb-border, #f1f5f9);
}
.pdf-image-meta strong {
    color: var(--tb-text, #1e293b);
    font-size: 13px;
}
.pdf-image-download-btn {
    margin: 8px 12px 12px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid var(--tb-border, #cbd5e1);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--tb-text, #1e293b);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.pdf-image-download-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}
.pdf-res-table-wrap {
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 12px;
    overflow-x: auto;
    background: #ffffff;
}
.pdf-res-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}
.pdf-res-table th {
    background: #f8fafc;
    padding: 12px 16px;
    font-weight: 700;
    color: var(--tb-text, #334155);
    border-bottom: 1px solid var(--tb-border, #e2e8f0);
    white-space: nowrap;
}
.pdf-res-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--tb-border, #f1f5f9);
    color: var(--tb-text, #1e293b);
    vertical-align: middle;
}
.pdf-res-table tr:last-child td {
    border-bottom: none;
}
.pdf-res-table tr:hover td {
    background: #f8fafc;
}
.pdf-res-url-cell {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
    font-size: 12px;
}
.pdf-res-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}
.pdf-tag-external { background: #eff6ff; color: #1d4ed8; }
.pdf-tag-internal { background: #f5f3ff; color: #6d28d9; }
.pdf-tag-subset { background: #fef3c7; color: #92400e; }
.pdf-tag-embedded { background: #ecfdf5; color: #047857; }
.pdf-tag-annot { background: #f1f5f9; color: #475569; }
.pdf-outline-tree {
    background: #ffffff;
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 12px;
    padding: 16px 20px;
    text-align: left;
}
.pdf-outline-node {
    margin: 6px 0;
    line-height: 1.6;
}
.pdf-outline-node a {
    color: #ef4444;
    text-decoration: none;
    font-weight: 500;
}
.pdf-outline-node a:hover {
    text-decoration: underline;
}
.pdf-outline-page-badge {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
}
.pdf-res-empty-msg {
    padding: 28px;
    text-align: center;
    background: #f8fafc;
    border: 1px dashed var(--tb-border, #cbd5e1);
    border-radius: 12px;
    color: var(--tb-muted, #64748b);
    font-size: 14px;
}

/* ==========================================
   VALIDATION SUITE
   ========================================== */
.pdf-validate-card {
    background: #ffffff;
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
    text-align: left;
}
.pdf-val-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--tb-border, #e2e8f0);
    margin-bottom: 20px;
}
.pdf-val-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 800;
}
.pdf-val-status-badge.pdf-val-pass {
    background: #dcfce7;
    color: #15803d;
}
.pdf-val-status-badge.pdf-val-warn {
    background: #fef3c7;
    color: #b45309;
}
.pdf-val-status-badge.pdf-val-fail {
    background: #fee2e2;
    color: #b91c1c;
}
.pdf-val-score-num {
    font-size: 14px;
    color: var(--tb-muted, #64748b);
}
.pdf-val-score-val {
    font-size: 18px;
    color: #15803d;
}
.pdf-val-summary-text {
    font-size: 14px;
    color: var(--tb-text, #334155);
    line-height: 1.5;
}
.pdf-val-checklist h4 {
    margin: 0 0 14px;
    font-size: 15px;
    color: var(--tb-text, #1e293b);
}
.pdf-val-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.pdf-val-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 10px;
}
.pdf-val-item-ico {
    font-size: 16px;
}
.pdf-val-item-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--tb-text, #1e293b);
}
.pdf-val-item-status {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}
.pdf-val-item-status.pass { background: #dcfce7; color: #166534; }
.pdf-val-item-status.warn { background: #fef3c7; color: #92400e; }
.pdf-val-item-status.fail { background: #fee2e2; color: #991b1b; }
.pdf-val-console-wrap {
    background: #0b1120;
    border-radius: 10px;
    overflow: hidden;
    color: #f1f5f9;
}
.pdf-val-console-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: #1e293b;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
}
.pdf-btn-copy-val-log {
    background: #334155;
    border: none;
    color: #ffffff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
}
.pdf-val-console-log {
    margin: 0;
    padding: 14px;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    color: #38bdf8;
    white-space: pre-wrap;
}

/* ==========================================
   FLATTENING SUITE
   ========================================== */
.pdf-flatten-card {
    background: #ffffff;
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}
.pdf-flat-card-head h3 {
    margin: 0 0 4px;
    font-size: 16px;
    color: var(--tb-text, #1e293b);
}
.pdf-flat-card-head p {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--tb-muted, #64748b);
}
.pdf-flat-options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pdf-flat-check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--tb-text, #1e293b);
    transition: border-color 0.2s;
}
.pdf-flat-check:hover {
    border-color: #ef4444;
}
.pdf-flat-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ef4444;
    cursor: pointer;
}

/* ==========================================================================
   Dark Mode & Night Mode Styles (TulBD [data-theme="dark"])
   ========================================================================== */
[data-theme="dark"] .pdf-tools-card,
body.dark-theme .pdf-tools-card,
.dark-theme .pdf-tools-card,
html[data-theme="dark"] .pdf-tools-card {
    background: #111a2e;
    border-color: #273549;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .pdf-tools-header h2,
body.dark-theme .pdf-tools-header h2,
.dark-theme .pdf-tools-header h2 {
    color: #f8fafc;
}

[data-theme="dark"] .pdf-tools-lead,
body.dark-theme .pdf-tools-lead,
.dark-theme .pdf-tools-lead {
    color: #94a3b8;
}

[data-theme="dark"] .pdf-tools-switcher,
body.dark-theme .pdf-tools-switcher,
.dark-theme .pdf-tools-switcher {
    border-bottom-color: #273549;
}

/* Night Mode Tool Pill Buttons (Fixes glaring white buttons in dark mode) */
[data-theme="dark"] .pdf-tool-pill,
body.dark-theme .pdf-tool-pill,
.dark-theme .pdf-tool-pill {
    background: #0f172a !important;
    border-color: #2a3a52 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .pdf-tool-pill:hover,
body.dark-theme .pdf-tool-pill:hover,
.dark-theme .pdf-tool-pill:hover {
    background: #1e293b !important;
    color: #fca5a5 !important;
    border-color: #ef4444 !important;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.25);
}

[data-theme="dark"] .pdf-tool-pill.active,
body.dark-theme .pdf-tool-pill.active,
.dark-theme .pdf-tool-pill.active {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.5) !important;
}

/* Night Mode Dropzone */
[data-theme="dark"] .pdf-dropzone,
body.dark-theme .pdf-dropzone,
.dark-theme .pdf-dropzone {
    background: rgba(15, 23, 42, 0.7) !important;
    border: 2px dashed #ef4444 !important;
}

[data-theme="dark"] .pdf-dropzone:hover,
[data-theme="dark"] .pdf-dropzone.dragover,
body.dark-theme .pdf-dropzone:hover,
body.dark-theme .pdf-dropzone.dragover,
.dark-theme .pdf-dropzone:hover,
.dark-theme .pdf-dropzone.dragover {
    border-color: #f87171 !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

[data-theme="dark"] .pdf-dropzone-title,
body.dark-theme .pdf-dropzone-title,
.dark-theme .pdf-dropzone-title {
    color: #f8fafc;
}

[data-theme="dark"] .pdf-dropzone-sub,
body.dark-theme .pdf-dropzone-sub,
.dark-theme .pdf-dropzone-sub {
    color: #94a3b8;
}

[data-theme="dark"] .pdf-dropzone-btn,
body.dark-theme .pdf-dropzone-btn,
.dark-theme .pdf-dropzone-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.45) !important;
}

[data-theme="dark"] .pdf-dropzone-btn:hover,
body.dark-theme .pdf-dropzone-btn:hover,
.dark-theme .pdf-dropzone-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    border-color: #991b1b !important;
    box-shadow: 0 6px 22px rgba(239, 68, 68, 0.6) !important;
}

[data-theme="dark"] .pdf-editor-workspace,
[data-theme="dark"] .pdf-security-card,
[data-theme="dark"] .pdf-extract-stats-bar,
[data-theme="dark"] .pdf-extracted-textarea,
[data-theme="dark"] .pdf-meta-stat-card,
[data-theme="dark"] .pdf-metadata-card,
body.dark-theme .pdf-editor-workspace,
body.dark-theme .pdf-security-card,
body.dark-theme .pdf-extract-stats-bar,
body.dark-theme .pdf-extracted-textarea,
body.dark-theme .pdf-meta-stat-card,
body.dark-theme .pdf-metadata-card {
    background: #0f172a;
    border-color: #273549;
    color: #f1f5f9;
}

[data-theme="dark"] .pdf-editor-toolbar,
body.dark-theme .pdf-editor-toolbar {
    background: #182338;
    border-color: #273549;
}

[data-theme="dark"] .pdf-tb-btn,
body.dark-theme .pdf-tb-btn {
    background: #0f172a;
    border-color: #2a3a52;
    color: #cbd5e1;
}

[data-theme="dark"] .pdf-sig-modal,
body.dark-theme .pdf-sig-modal {
    background: #182338;
    border-color: #273549;
    color: #f1f5f9;
}

[data-theme="dark"] .pdf-sig-type-input,
[data-theme="dark"] .pdf-pwd-input-group input,
[data-theme="dark"] .pdf-extract-search-input,
[data-theme="dark"] .pdf-meta-field input,
body.dark-theme .pdf-sig-type-input,
body.dark-theme .pdf-pwd-input-group input,
body.dark-theme .pdf-extract-search-input,
body.dark-theme .pdf-meta-field input {
    background: #0f172a;
    border-color: #273549;
    color: #f1f5f9;
}

[data-theme="dark"] .pdf-meta-field input[readonly],
body.dark-theme .pdf-meta-field input[readonly] {
    background: #0b1120;
    color: #94a3b8;
}

[data-theme="dark"] .pdf-meta-stat-info strong,
[data-theme="dark"] .pdf-meta-card-head h3,
[data-theme="dark"] .pdf-meta-field label,
body.dark-theme .pdf-meta-stat-info strong,
body.dark-theme .pdf-meta-card-head h3,
body.dark-theme .pdf-meta-field label {
    color: #f8fafc;
}

[data-theme="dark"] .pdf-removesig-banner,
body.dark-theme .pdf-removesig-banner {
    background: rgba(30, 58, 138, 0.25);
    border-color: #1e40af;
    color: #bfdbfe;
}

[data-theme="dark"] .pdf-doc-meta-bar,
[data-theme="dark"] .pdf-organizer-toolbar,
[data-theme="dark"] .pdf-split-options-wrap,
[data-theme="dark"] .pdf-queue-item,
[data-theme="dark"] .pdf-pages-grid,
[data-theme="dark"] .pdf-compress-card,
[data-theme="dark"] .pdf-compress-result-card,
body.dark-theme .pdf-doc-meta-bar,
body.dark-theme .pdf-organizer-toolbar,
body.dark-theme .pdf-split-options-wrap,
body.dark-theme .pdf-queue-item,
body.dark-theme .pdf-pages-grid,
body.dark-theme .pdf-compress-card,
body.dark-theme .pdf-compress-result-card {
    background: #0f172a;
    border-color: #273549;
    color: #f1f5f9;
}

[data-theme="dark"] .pdf-meta-badge,
[data-theme="dark"] .pdf-btn-change-file,
[data-theme="dark"] .pdf-btn-add-more,
[data-theme="dark"] .pdf-btn-clear-all,
[data-theme="dark"] .pdf-queue-btn,
[data-theme="dark"] .pdf-tool-btn,
[data-theme="dark"] .pdf-range-input,
[data-theme="dark"] .pdf-page-card,
[data-theme="dark"] .pdf-page-action-btn,
[data-theme="dark"] .pdf-btn-reset-suite,
body.dark-theme .pdf-meta-badge,
body.dark-theme .pdf-btn-change-file,
body.dark-theme .pdf-btn-add-more,
body.dark-theme .pdf-btn-clear-all,
body.dark-theme .pdf-queue-btn,
body.dark-theme .pdf-tool-btn,
body.dark-theme .pdf-range-input,
body.dark-theme .pdf-page-card,
body.dark-theme .pdf-page-action-btn,
body.dark-theme .pdf-btn-reset-suite {
    background: #182338;
    border-color: #273549;
    color: #f1f5f9;
}

[data-theme="dark"] .pdf-queue-name,
[data-theme="dark"] .pdf-compress-card-head strong,
[data-theme="dark"] .pdf-compress-settings-wrap h3,
[data-theme="dark"] .pdf-file-list-header,
body.dark-theme .pdf-queue-name,
body.dark-theme .pdf-compress-card-head strong,
body.dark-theme .pdf-compress-settings-wrap h3,
body.dark-theme .pdf-file-list-header {
    color: #f8fafc;
}

[data-theme="dark"] .pdf-compress-card.active,
body.dark-theme .pdf-compress-card.active {
    background: #182338;
    border-color: #ef4444;
}

[data-theme="dark"] .pdf-progress-bar,
body.dark-theme .pdf-progress-bar {
    background: #273549;
}

[data-theme="dark"] .pdf-res-box strong,
body.dark-theme .pdf-res-box strong {
    color: #f8fafc;
}

/* ==========================================================================
   3-Part Feature Comparison Table & Mobile Responsiveness
   ========================================================================== */
.pdf-seo-article .table-responsive,
.article .table-responsive {
    margin: 28px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--tb-border, #cbd5e1);
    background: #ffffff;
    width: 100%;
}

.pdf-comp-table,
.comp-table,
.table-bordered {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14.5px;
    line-height: 1.55;
}

.pdf-comp-table th,
.comp-table th,
.table-bordered th {
    background: #f1f5f9;
    color: #0f172a;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 2px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
    letter-spacing: 0.01em;
}

.pdf-comp-table th:last-child,
.comp-table th:last-child,
.table-bordered th:last-child {
    border-right: none;
}

.pdf-comp-table th:nth-child(2),
.comp-table th:nth-child(2) {
    background: #fee2e2;
    color: #dc2626;
    border-left: 1px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
}

.pdf-comp-table td,
.comp-table td,
.table-bordered td {
    padding: 13px 18px;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    vertical-align: middle;
}

.pdf-comp-table td:last-child,
.comp-table td:last-child,
.table-bordered td:last-child {
    border-right: none;
}

.pdf-comp-table tr:last-child td,
.comp-table tr:last-child td,
.table-bordered tr:last-child td {
    border-bottom: none;
}

.pdf-comp-table tr:hover td,
.comp-table tr:hover td,
.table-bordered tr:hover td {
    background: #f8fafc;
}

.pdf-comp-table td:nth-child(2),
.comp-table td:nth-child(2) {
    background: rgba(239, 68, 68, 0.04);
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
}

.pdf-comp-table tr:hover td:nth-child(2),
.comp-table tr:hover td:nth-child(2) {
    background: rgba(239, 68, 68, 0.08);
}

.table-badge-good {
    display: inline-block;
    padding: 2px 7px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12.5px;
    margin-right: 4px;
}

.table-badge-bad {
    display: inline-block;
    padding: 2px 7px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12.5px;
    margin-right: 4px;
}

/* Dark Mode Comparison Table */
[data-theme="dark"] .pdf-seo-article .table-responsive,
[data-theme="dark"] .article .table-responsive,
body.dark-theme .pdf-seo-article .table-responsive,
body.dark-theme .article .table-responsive {
    background: #0f172a;
    border-color: #273549;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .pdf-comp-table,
[data-theme="dark"] .comp-table,
[data-theme="dark"] .table-bordered,
body.dark-theme .pdf-comp-table,
body.dark-theme .comp-table,
body.dark-theme .table-bordered {
    color: #cbd5e1;
}

[data-theme="dark"] .pdf-comp-table th,
[data-theme="dark"] .comp-table th,
[data-theme="dark"] .table-bordered th,
body.dark-theme .pdf-comp-table th,
body.dark-theme .comp-table th,
body.dark-theme .table-bordered th {
    background: #182338;
    color: #f8fafc;
    border-bottom: 2px solid #273549;
    border-right: 1px solid #273549;
}

[data-theme="dark"] .pdf-comp-table th:nth-child(2),
body.dark-theme .pdf-comp-table th:nth-child(2) {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-left: 1px solid #273549;
    border-right: 1px solid #273549;
}

[data-theme="dark"] .pdf-comp-table td,
[data-theme="dark"] .comp-table td,
[data-theme="dark"] .table-bordered td,
body.dark-theme .pdf-comp-table td,
body.dark-theme .comp-table td,
body.dark-theme .table-bordered td {
    border-bottom: 1px solid #273549;
    border-right: 1px solid #273549;
    color: #cbd5e1;
}

[data-theme="dark"] .pdf-comp-table td:nth-child(2),
body.dark-theme .pdf-comp-table td:nth-child(2) {
    background: rgba(239, 68, 68, 0.08);
    border-left: 1px solid #273549;
    border-right: 1px solid #273549;
}

[data-theme="dark"] .pdf-comp-table tr:hover td,
[data-theme="dark"] .comp-table tr:hover td,
[data-theme="dark"] .table-bordered tr:hover td,
body.dark-theme .pdf-comp-table tr:hover td,
body.dark-theme .comp-table tr:hover td,
body.dark-theme .table-bordered tr:hover td {
    background: #141f33;
}

[data-theme="dark"] .table-badge-good,
body.dark-theme .table-badge-good {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

[data-theme="dark"] .table-badge-bad,
body.dark-theme .table-badge-bad {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Mobile Responsive Optimization: Fits all 3 parts fully on mobile screen */
@media (max-width: 680px) {
    .pdf-seo-article .table-responsive,
    .article .table-responsive {
        margin: 18px 0;
        border-radius: 10px;
        width: 100%;
    }
    .pdf-comp-table,
    .comp-table,
    .table-bordered {
        font-size: 11.5px;
        line-height: 1.38;
        table-layout: auto;
        width: 100%;
    }
    .pdf-comp-table th,
    .comp-table th,
    .table-bordered th {
        padding: 9px 5px !important;
        font-size: 11px !important;
        white-space: normal;
    }
    .pdf-comp-table td,
    .comp-table td,
    .table-bordered td {
        padding: 8px 5px !important;
        font-size: 11px !important;
        white-space: normal;
        word-break: break-word;
    }
    .pdf-comp-table th:first-child,
    .pdf-comp-table td:first-child,
    .comp-table th:first-child,
    .comp-table td:first-child,
    .table-bordered th:first-child,
    .table-bordered td:first-child {
        width: 28%;
        min-width: 78px;
    }
    .pdf-comp-table th:nth-child(2),
    .pdf-comp-table td:nth-child(2),
    .comp-table th:nth-child(2),
    .comp-table td:nth-child(2),
    .table-bordered th:nth-child(2),
    .table-bordered td:nth-child(2) {
        width: 36%;
        min-width: 98px;
    }
    .pdf-comp-table th:nth-child(3),
    .pdf-comp-table td:nth-child(3),
    .comp-table th:nth-child(3),
    .comp-table td:nth-child(3),
    .table-bordered th:nth-child(3),
    .table-bordered td:nth-child(3) {
        width: 36%;
        min-width: 98px;
    }
    .table-badge-good,
    .table-badge-bad {
        display: inline-block;
        padding: 1px 4px;
        font-size: 9.5px;
        border-radius: 4px;
        margin-right: 2px;
        margin-bottom: 2px;
    }
}

@media (max-width: 400px) {
    .pdf-comp-table,
    .comp-table,
    .table-bordered {
        font-size: 10.5px;
    }
    .pdf-comp-table th,
    .comp-table th,
    .table-bordered th {
        padding: 7px 4px !important;
        font-size: 10.5px !important;
    }
    .pdf-comp-table td,
    .comp-table td,
    .table-bordered td {
        padding: 6px 4px !important;
        font-size: 10.5px !important;
    }
    .pdf-comp-table th:first-child,
    .pdf-comp-table td:first-child,
    .comp-table th:first-child,
    .comp-table td:first-child,
    .table-bordered th:first-child,
    .table-bordered td:first-child {
        min-width: 70px;
    }
    .pdf-comp-table th:nth-child(2),
    .pdf-comp-table td:nth-child(2),
    .comp-table th:nth-child(2),
    .comp-table td:nth-child(2),
    .table-bordered th:nth-child(2),
    .table-bordered td:nth-child(2) {
        min-width: 88px;
    }
    .pdf-comp-table th:nth-child(3),
    .pdf-comp-table td:nth-child(3),
    .comp-table th:nth-child(3),
    .comp-table td:nth-child(3),
    .table-bordered th:nth-child(3),
    .table-bordered td:nth-child(3) {
        min-width: 88px;
    }
}

/* =========================================================
   12. PAGE NUMBERS TOOL STYLES
   ========================================================= */
.pdf-pn-config-card,
.pdf-wm-config-card {
    background: var(--tb-card, #ffffff);
    border: 1px solid var(--tb-border, rgba(0, 0, 0, 0.08));
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.pdf-pn-layout,
.pdf-wm-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
}

@media (max-width: 900px) {
    .pdf-pn-layout,
    .pdf-wm-layout {
        grid-template-columns: 1fr;
    }
}

.pdf-pn-controls,
.pdf-wm-controls {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.pdf-pn-group,
.pdf-wm-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.pdf-pn-group-label,
.pdf-wm-group-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--tb-text, #1e293b);
}

/* Position Grid (3x2) */
.pdf-pn-pos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 440px;
}

.pdf-pn-pos-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    background: var(--tb-bg-soft, #f8fafc);
    border: 1.5px solid var(--tb-border, #e2e8f0);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--tb-muted, #475569);
    font-size: 12px;
}

.pdf-pn-pos-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.04);
}

.pdf-pn-pos-btn.active {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.pdf-pn-pos-indicator {
    font-size: 16px;
    line-height: 1;
    margin-bottom: 2px;
}

.pdf-pn-pos-text {
    font-size: 11px;
}

/* Multi-column Rows */
.pdf-pn-row-2col,
.pdf-wm-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pdf-pn-row-3col,
.pdf-wm-row-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 600px) {
    .pdf-pn-row-2col,
    .pdf-wm-row-2col,
    .pdf-pn-row-3col,
    .pdf-wm-row-3col {
        grid-template-columns: 1fr;
    }
}

.pdf-pn-format-select,
.pdf-pn-range-type,
.pdf-pn-font-family,
.pdf-pn-font-size,
.pdf-pn-start-num,
.pdf-pn-custom-format,
.pdf-pn-custom-range,
.pdf-wm-text-input,
.pdf-wm-rotation,
.pdf-wm-font-size,
.pdf-wm-image-scale,
.pdf-wm-page-range-type,
.pdf-wm-custom-range {
    width: 100%;
    padding: 9px 12px;
    font-size: 13.5px;
    border: 1px solid var(--tb-border, #cbd5e1);
    border-radius: 8px;
    background: var(--tb-input-bg, #ffffff);
    color: var(--tb-text, #1e293b);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.pdf-pn-format-select:focus,
.pdf-pn-custom-format:focus,
.pdf-wm-text-input:focus {
    border-color: #ef4444;
}

.pdf-pn-color-wrap,
.pdf-wm-color-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-pn-color-picker,
.pdf-wm-color-picker {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 2px solid var(--tb-border, #cbd5e1);
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.pdf-pn-color-picker::-webkit-color-swatch-wrapper,
.pdf-wm-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.pdf-pn-color-picker::-webkit-color-swatch,
.pdf-wm-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.pdf-pn-color-code,
.pdf-wm-color-code {
    font-size: 12px;
    font-family: monospace;
    color: var(--tb-muted, #64748b);
}

.pdf-pn-margin-options {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--tb-text, #334155);
}

.pdf-pn-margin-options label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* Document Live Preview Sheet */
.pdf-pn-preview-box,
.pdf-wm-preview-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px solid var(--tb-border, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
}

.pdf-pn-preview-header,
.pdf-wm-preview-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    margin-bottom: 14px;
    color: var(--tb-muted, #64748b);
}

.pdf-pn-sheet,
.pdf-wm-sheet {
    position: relative;
    width: 190px;
    height: 260px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    padding: 18px 14px;
    overflow: hidden;
    user-select: none;
}

.pdf-pn-sheet-lines,
.pdf-wm-sheet-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pdf-pn-dummy-line,
.pdf-wm-dummy-line {
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
}

.pdf-pn-dummy-line.long,
.pdf-wm-dummy-line.long { width: 100%; }
.pdf-pn-dummy-line.medium,
.pdf-wm-dummy-line.medium { width: 75%; }
.pdf-pn-dummy-line.short,
.pdf-wm-dummy-line.short { width: 45%; }

/* Positioned stamp on sheet */
.pdf-pn-stamp-preview {
    position: absolute;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #334155;
    background: rgba(239, 68, 68, 0.12);
    border: 1px dashed #ef4444;
    padding: 2px 4px;
    border-radius: 3px;
}

.pdf-pn-stamp-preview[data-pos="top-left"] {
    top: 8px;
    left: 8px;
}
.pdf-pn-stamp-preview[data-pos="top-center"] {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}
.pdf-pn-stamp-preview[data-pos="top-right"] {
    top: 8px;
    right: 8px;
}
.pdf-pn-stamp-preview[data-pos="bottom-left"] {
    bottom: 8px;
    left: 8px;
}
.pdf-pn-stamp-preview[data-pos="bottom-center"] {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}
.pdf-pn-stamp-preview[data-pos="bottom-right"] {
    bottom: 8px;
    right: 8px;
}

/* =========================================================
   13. WATERMARK TOOL STYLES
   ========================================================= */
.pdf-wm-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--tb-border, #e2e8f0);
    padding-bottom: 8px;
    margin-bottom: 6px;
}

.pdf-wm-tab-btn {
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--tb-muted, #64748b);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-wm-tab-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.pdf-wm-tab-btn.active {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.pdf-wm-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.pdf-wm-preset-pill {
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--tb-muted, #475569);
    background: var(--tb-bg-soft, #f1f5f9);
    border: 1px solid var(--tb-border, #cbd5e1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pdf-wm-preset-pill:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.pdf-wm-upload-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--tb-bg-soft, #f8fafc);
    border: 1px dashed var(--tb-border, #cbd5e1);
    border-radius: 8px;
}

.pdf-wm-upload-hint {
    font-size: 11.5px;
    color: var(--tb-muted, #64748b);
}

.pdf-wm-opacity-slider {
    width: 100%;
    cursor: pointer;
}

.pdf-wm-overlay-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    font-weight: 800;
    font-family: system-ui, -apple-system, sans-serif;
    color: #dc2626;
    opacity: 0.25;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
    pointer-events: none;
}

.pdf-wm-img-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 140px;
    max-height: 140px;
    object-fit: contain;
    pointer-events: none;
}

/* Dark mode overrides */
[data-theme="dark"] .pdf-pn-config-card,
[data-theme="dark"] .pdf-wm-config-card,
body.dark-theme .pdf-pn-config-card,
body.dark-theme .pdf-wm-config-card {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .pdf-pn-group-label,
[data-theme="dark"] .pdf-wm-group-label,
body.dark-theme .pdf-pn-group-label,
body.dark-theme .pdf-wm-group-label {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .pdf-pn-pos-btn,
body.dark-theme .pdf-pn-pos-btn {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .pdf-pn-pos-btn.active,
body.dark-theme .pdf-pn-pos-btn.active {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .pdf-pn-format-select,
[data-theme="dark"] .pdf-pn-range-type,
[data-theme="dark"] .pdf-pn-font-family,
[data-theme="dark"] .pdf-pn-font-size,
[data-theme="dark"] .pdf-pn-start-num,
[data-theme="dark"] .pdf-pn-custom-format,
[data-theme="dark"] .pdf-pn-custom-range,
[data-theme="dark"] .pdf-wm-text-input,
[data-theme="dark"] .pdf-wm-rotation,
[data-theme="dark"] .pdf-wm-font-size,
[data-theme="dark"] .pdf-wm-image-scale,
[data-theme="dark"] .pdf-wm-page-range-type,
[data-theme="dark"] .pdf-wm-custom-range,
body.dark-theme .pdf-pn-format-select,
body.dark-theme .pdf-pn-range-type,
body.dark-theme .pdf-pn-font-family,
body.dark-theme .pdf-pn-font-size,
body.dark-theme .pdf-pn-start-num,
body.dark-theme .pdf-pn-custom-format,
body.dark-theme .pdf-pn-custom-range,
body.dark-theme .pdf-wm-text-input,
body.dark-theme .pdf-wm-rotation,
body.dark-theme .pdf-wm-font-size,
body.dark-theme .pdf-wm-image-scale,
body.dark-theme .pdf-wm-page-range-type,
body.dark-theme .pdf-wm-custom-range {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .pdf-pn-preview-box,
[data-theme="dark"] .pdf-wm-preview-box,
body.dark-theme .pdf-pn-preview-box,
body.dark-theme .pdf-wm-preview-box {
    background: #0f172a !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .pdf-pn-sheet,
[data-theme="dark"] .pdf-wm-sheet,
body.dark-theme .pdf-pn-sheet,
body.dark-theme .pdf-wm-sheet {
    background: #1e293b !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .pdf-pn-dummy-line,
[data-theme="dark"] .pdf-wm-dummy-line,
body.dark-theme .pdf-pn-dummy-line,
body.dark-theme .pdf-wm-dummy-line {
    background: #334155 !important;
}

[data-theme="dark"] .pdf-wm-preset-pill,
body.dark-theme .pdf-wm-preset-pill {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .pdf-wm-upload-box,
body.dark-theme .pdf-wm-upload-box {
    background: #0f172a !important;
    border-color: #334155 !important;
}

