/* PDF araçları (metin / birleştir / sayfa seç) — site token’ları ile uyumlu */
.pdfed-page {
    padding: 2rem max(1rem, env(safe-area-inset-left, 0px)) 2rem max(1rem, env(safe-area-inset-right, 0px));
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.pdfed-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pdfed-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
}

.pdfed-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.pdfed-dropzone {
    max-width: 42rem;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-ui, 16px);
    background: var(--card-bg);
    box-shadow: var(--shadow-card);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.pdfed-dropzone:hover,
.pdfed-dropzone:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--body-bg);
}

.pdfed-dropzone.pdfed-dragover {
    border-color: var(--accent-color);
    background: rgba(var(--accent-rgb), 0.04);
}

.pdfed-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.pdfed-dropzone-icon {
    display: inline-flex;
    padding: 1rem;
    border-radius: 9999px;
    background: var(--body-bg);
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.pdfed-dropzone-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.pdfed-dropzone-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0;
}

.pdfed-work-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pdfed-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .pdfed-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.pdfed-toolbar-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.pdfed-page-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0 0.25rem;
}

.pdfed-btn {
    min-height: 44px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
    border: none;
}

.pdfed-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pdfed-btn-primary {
    background: var(--accent-color);
    color: #fff;
}

.pdfed-btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.pdfed-btn-outline {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.pdfed-btn-outline:hover:not(:disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* ——— Araç çubuğu (toolstrip) ——— */
.pdfed-toolstrip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem;
    border-radius: 14px;
    background: var(--body-bg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
}

.pdfed-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    line-height: 1;
}

.pdfed-tool-btn svg {
    flex-shrink: 0;
}

.pdfed-tool-btn:hover {
    color: var(--text-primary);
    background: rgba(var(--accent-rgb), 0.06);
}

.pdfed-tool-btn--active,
.pdfed-tool-btn[aria-pressed="true"] {
    color: var(--accent-color);
    background: var(--card-bg);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
}

.pdfed-tool-btn--danger {
    color: var(--text-muted);
}

.pdfed-tool-btn--danger:hover:not(:disabled) {
    color: #b91c1c;
    background: rgba(185, 28, 28, 0.06);
}

.pdfed-tool-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pdfed-toolstrip-sep {
    width: 1px;
    align-self: stretch;
    margin: 0.25rem 0.15rem;
    background: var(--border-color);
    border-radius: 1px;
}

@media (max-width: 420px) {
    .pdfed-tool-btn span {
        display: none;
    }
    .pdfed-tool-btn {
        padding: 0.4rem 0.55rem;
    }
}

/* ——— TextLayer (mevcut metin düzenleme) ——— */
.pdfed-text-layer {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.pdfed-text-layer > span {
    position: absolute;
    color: transparent;
    white-space: pre;
    cursor: default;
    transform-origin: left top;
    border-radius: 2px;
    box-sizing: border-box;
    padding: 0 1px;
    transition: background 0.12s, box-shadow 0.12s;
}

.pdfed-stage--edit-mode .pdfed-text-layer {
    pointer-events: auto;
}

.pdfed-stage--edit-mode .pdfed-text-layer > span {
    cursor: pointer;
}

.pdfed-stage--edit-mode .pdfed-text-layer > span:hover {
    background: rgba(59, 130, 246, 0.10);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22);
}

.pdfed-text-layer > span.pdfed-text-edited {
    color: #000;
    background: #fff;
    box-shadow: none;
    padding: 0 2px;
}

.pdfed-text-layer > span.pdfed-text-deleted {
    color: transparent;
    background: #fff;
    box-shadow: none;
    padding: 0 2px;
}

.pdfed-text-layer > span.pdfed-text-active-edit {
    color: var(--text-primary, #1e293b);
    background: #fff;
    box-shadow: 0 0 0 2.5px var(--accent-color, #3b82f6);
    outline: none;
    z-index: 20;
    min-width: 24px;
    border-radius: 3px;
}

/* ——— Shape overlay layer ——— */
.pdfed-shape-layer {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 1;
}

.pdfed-shape-layer .pdfed-shape {
    position: absolute;
    box-sizing: border-box;
}

.pdfed-shape--whiteout {
    background: #fff;
    border: 1px dashed rgba(180, 180, 180, 0.5);
}

.pdfed-shape--rect {
    background: transparent;
    border: 2px solid #dc2626;
    border-radius: 2px;
}

/* ——— Drag preview (sürükleme sırasındaki geçici kutu) ——— */
.pdfed-drag-preview {
    position: absolute;
    z-index: 8;
    pointer-events: none;
    box-sizing: border-box;
}

.pdfed-drag-preview--whiteout {
    background: rgba(255, 255, 255, 0.75);
    border: 2px dashed #94a3b8;
}

.pdfed-drag-preview--rect {
    background: rgba(220, 38, 38, 0.06);
    border: 2px solid #dc2626;
    border-radius: 2px;
}

.pdfed-canvas-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pdfed-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border-radius: var(--radius-ui, 16px);
    border: 1px solid var(--border-subtle);
    background: var(--card-bg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

#pdfed-canvas {
    display: block;
    vertical-align: top;
    /* max-width kaldırıldı — tıklama koordinatları ile piksel uyumu için */
}

.pdfed-annotation-layer {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 3;
}

.pdfed-annotation-layer .pdfed-ann-text {
    position: absolute;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdfed-hit-overlay {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 4;
    cursor: crosshair;
    background: transparent;
}

.pdfed-draft-input {
    position: absolute;
    z-index: 10;
    min-width: 140px;
    max-width: min(280px, 85vw);
    min-height: 44px;
    padding: 0.35rem 0.5rem;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow-card-hover);
}

.pdfed-draft-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.pdfed-hint {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 22rem;
    padding: 0 0.5rem;
}

.pdfed-actions-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}

@media (min-width: 480px) {
    .pdfed-actions-bottom {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ——— Sekmeler (premium) ——— */
.pdfed-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0.35rem;
    border-radius: 9999px;
    background: var(--body-bg);
    border: 1px solid var(--border-subtle);
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

.pdfed-tab {
    flex: 1 1 auto;
    min-height: 44px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.pdfed-tab:hover {
    color: var(--text-primary);
    background: rgba(var(--accent-rgb), 0.06);
}

.pdfed-tab--active,
.pdfed-tab[aria-selected="true"] {
    color: var(--text-primary);
    background: var(--card-bg);
    box-shadow: var(--shadow-card);
}

.pdfed-tab:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.pdfed-tab-panel {
    min-width: 0;
}

/* Araç panelleri: kırık beyaz / kart hissi (Tailwind gray-50 benzeri) */
.pdfed-tool-surface {
    padding: 1.5rem;
    border-radius: var(--radius-ui, 16px);
    background: var(--body-bg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    position: relative;
}

@media (min-width: 640px) {
    .pdfed-tool-surface {
        padding: 2rem;
    }
}

.pdfed-tool-heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.pdfed-tool-lead {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    line-height: 1.55;
    max-width: 40rem;
}

.pdfed-dropzone--multi {
    max-width: none;
}

/* ——— Birleştirme kartları ——— */
.pdfm-empty-hint {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

.pdfm-empty-hint[hidden] {
    display: none !important;
}

.pdfm-card-scroll-wrap {
    margin-bottom: 1.25rem;
    min-height: 0;
}

.pdfm-card-list {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.25rem 0.125rem 0.75rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.pdfm-card {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: min(200px, 72vw);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.pdfm-card-moves {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
}

.pdfm-card-move {
    min-width: 40px;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--body-bg);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.pdfm-card-move:hover:not(:disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.pdfm-card-move:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pdfm-card-body {
    text-align: center;
    min-height: 3.25rem;
}

.pdfm-card-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.pdfm-card-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pdfm-card-remove {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 8px;
}

.pdfm-card-remove:hover {
    color: #b91c1c;
    background: rgba(185, 28, 28, 0.08);
}

.pdfm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

/* ——— Split grid ——— */
.pdfs-work {
    margin-top: 1.25rem;
}

.pdfs-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.pdfs-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
}

@media (max-width: 520px) {
    .pdfs-meta {
        width: 100%;
        margin-left: 0;
    }
}

.pdfs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pdfs-thumb {
    position: relative;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

.pdfs-thumb:hover {
    border-color: var(--accent-color);
}

.pdfs-thumb:focus-within {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}

/* Seçili = indirilecek (ring-blue / premium vurgu) */
.pdfs-thumb--selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color), var(--shadow-card-hover);
}

.pdfs-thumb-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.pdfs-thumb-canvas-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #525252;
    min-height: 120px;
    padding: 0.35rem;
}

.pdfs-thumb-canvas-wrap canvas {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.pdfs-thumb-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--card-bg);
}

.pdfs-thumb-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pdfs-thumb-check {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--accent-color);
    cursor: pointer;
    flex-shrink: 0;
}

.pdfs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

/* ——— Image overlay layer ——— */
.pdfed-image-layer {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

.pdfed-img-overlay {
    position: absolute;
    pointer-events: auto;
    cursor: move;
    box-sizing: border-box;
    border: 2px solid transparent;
    border-radius: 2px;
    transition: border-color 0.12s;
    user-select: none;
    -webkit-user-select: none;
}

.pdfed-img-overlay:hover {
    border-color: rgba(59, 130, 246, 0.35);
}

.pdfed-img-overlay--selected {
    border-color: var(--accent-color, #3b82f6);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.pdfed-img-overlay img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    border-radius: 1px;
}

.pdfed-img-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid var(--accent-color, #3b82f6);
    border-radius: 2px;
    z-index: 2;
    pointer-events: auto;
}

.pdfed-img-handle--nw { top: -5px; left: -5px; cursor: nwse-resize; }
.pdfed-img-handle--ne { top: -5px; right: -5px; cursor: nesw-resize; }
.pdfed-img-handle--sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.pdfed-img-handle--se { bottom: -5px; right: -5px; cursor: nwse-resize; }

/* ——— Tespit edilen görsel overlay katmanı ——— */
.pdfed-detected-image-layer {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 3;
    overflow: visible;
}

.pdfed-detected-img {
    position: absolute;
    pointer-events: none;
    visibility: hidden;
    cursor: pointer;
    box-sizing: border-box;
    border: 2px dashed rgba(var(--accent-rgb), 0.45);
    border-radius: 3px;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.pdfed-detected-image-layer--active .pdfed-detected-img {
    pointer-events: auto;
    visibility: visible;
}

.pdfed-detected-image-layer--active .pdfed-detected-img:hover {
    border-color: var(--accent-color);
    background: rgba(var(--accent-rgb), 0.10);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18);
}

.pdfed-detected-img--removed {
    border-color: rgba(185, 28, 28, 0.4) !important;
    background: rgba(185, 28, 28, 0.08) !important;
    cursor: default;
}

.pdfed-detected-image-layer--active .pdfed-detected-img--removed {
    visibility: visible;
    pointer-events: auto;
}

.pdfed-detected-img--removed::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        rgba(185, 28, 28, 0.18) 4px,
        rgba(185, 28, 28, 0.18) 6px
    );
    border-radius: 2px;
    pointer-events: none;
}

/* ——— Görsel aksiyon modalı ——— */
.pdfed-imgaction-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.pdfed-imgaction-modal[hidden] {
    display: none !important;
}

.pdfed-imgaction-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.pdfed-imgaction-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1.75rem 2rem;
    border-radius: 20px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    max-width: min(480px, 94vw);
    width: 100%;
}

.pdfed-imgaction-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0;
    letter-spacing: -0.02em;
}

.pdfed-imgaction-lead {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    margin: -0.35rem 0 0;
    line-height: 1.5;
}

.pdfed-imgaction-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.pdfed-imgaction-toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.pdfed-imgaction-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.pdfed-imgaction-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.pdfed-imgaction-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border-color, #cbd5e1);
    border-radius: 12px;
    transition: background 0.2s;
}

.pdfed-imgaction-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.pdfed-imgaction-switch input:checked + .pdfed-imgaction-slider {
    background: var(--accent-color);
}

.pdfed-imgaction-switch input:checked + .pdfed-imgaction-slider::before {
    transform: translateX(20px);
}

.pdfed-imgaction-switch input:focus-visible + .pdfed-imgaction-slider {
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}

.pdfed-imgaction-upload {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    background: var(--body-bg);
}

.pdfed-imgaction-upload[hidden] {
    display: none !important;
}

.pdfed-imgaction-upload input[type="file"] {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pdfed-imgaction-preview-img {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.pdfed-imgaction-preview-img[hidden] {
    display: none !important;
}

.pdfed-imgaction-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
}

.pdfed-imgaction-status[hidden] {
    display: none !important;
}

.pdfed-imgaction-status--deleted {
    background: rgba(185, 28, 28, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(185, 28, 28, 0.18);
}

[data-bs-theme="dark"] .pdfed-imgaction-status--deleted {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.22);
}

.pdfed-imgaction-status--replaced {
    background: rgba(22, 163, 74, 0.08);
    color: #15803d;
    border: 1px solid rgba(22, 163, 74, 0.18);
}

[data-bs-theme="dark"] .pdfed-imgaction-status--replaced {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.22);
}

.pdfed-imgaction-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}

.pdfed-btn--danger-outline {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.35);
}

.pdfed-btn--danger-outline:hover:not(:disabled) {
    color: #991b1b;
    border-color: #b91c1c;
    background: rgba(185, 28, 28, 0.06);
}

[data-bs-theme="dark"] .pdfed-btn--danger-outline {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.35);
}

[data-bs-theme="dark"] .pdfed-btn--danger-outline:hover:not(:disabled) {
    color: #fecaca;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ——— Signature modal ——— */
.pdfed-sig-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.pdfed-sig-modal[hidden] {
    display: none !important;
}

.pdfed-sig-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.pdfed-sig-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1.75rem 2rem;
    border-radius: 20px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    max-width: min(560px, 94vw);
    width: 100%;
}

.pdfed-sig-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0;
    letter-spacing: -0.02em;
}

.pdfed-sig-lead {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    margin: -0.35rem 0 0;
}

.pdfed-sig-pad-wrap {
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    touch-action: none;
}

.pdfed-sig-pad-wrap canvas {
    display: block;
    width: 100%;
    height: 200px;
    cursor: crosshair;
}

.pdfed-sig-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}

/* ——— Loading overlay ——— */
.pdfed-loading {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
}

.pdfed-loading:not([hidden]) {
    pointer-events: auto;
}

.pdfed-loading-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
}

.pdfed-loading-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 2.5rem;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card-hover);
    max-width: 90vw;
}

.pdfed-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: pdfed-spin 0.75s linear infinite;
}

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

.pdfed-loading-text {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}
