/* PDF Link Editor */
.pdf-link-editor {
    display: grid;
    gap: 1.1rem;
}

.ple-modes {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 0.28rem;
    border-radius: 999px;
    border: 1px solid var(--border, rgba(148, 163, 184, 0.22));
    background: rgba(15, 23, 42, 0.35);
    gap: 0.25rem;
}

.ple-mode-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-dim, #94a3b8);
    font: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.55rem 1.05rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.ple-mode-btn:hover {
    color: #e2e8f0;
}

.ple-mode-btn.is-active {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.ple-panel[hidden] {
    display: none !important;
}

.ple-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 1rem;
}

.ple-form-card,
.ple-preview-card,
.ple-queue-card {
    border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
    border-radius: 16px;
    background:
        radial-gradient(520px 180px at 0% 0%, rgba(14, 165, 233, 0.12), transparent 55%),
        rgba(15, 23, 42, 0.42);
    padding: 1rem 1.05rem 1.1rem;
}

.ple-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

.ple-card-sub {
    margin: 0.35rem 0 0.9rem;
    color: var(--text-dim, #94a3b8);
    font-size: 0.84rem;
    line-height: 1.45;
}

.ple-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0.35rem 0 0.85rem;
    color: #cbd5e1;
    font-size: 0.86rem;
    line-height: 1.4;
    cursor: pointer;
}

.ple-check input {
    margin-top: 0.2rem;
}

.ple-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.ple-preview-head,
.ple-queue-head,
.ple-check-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.ple-preview-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 700;
}

.ple-canvas-wrap {
    position: relative;
    margin-top: 0.65rem;
    min-height: 320px;
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    background:
        linear-gradient(180deg, #f8fafc, #eef2ff);
    overflow: auto;
    cursor: crosshair;
}

.ple-canvas-wrap.is-ready {
    border-style: solid;
    border-color: #cbd5e1;
}

.ple-canvas-wrap canvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.ple-hotspots {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ple-hotspot {
    position: absolute;
    border: 2px solid #2563eb;
    background: rgba(37, 99, 235, 0.16);
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.ple-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
    pointer-events: none;
}

.ple-canvas-wrap.is-ready .ple-empty {
    display: none;
}

.ple-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.2);
    color: #7dd3fc;
    font-size: 0.75rem;
}

.ple-table-wrap {
    overflow: auto;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.28);
}

.ple-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    font-size: 0.84rem;
}

.ple-table th,
.ple-table td {
    padding: 0.7rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    vertical-align: top;
}

.ple-table th {
    color: #94a3b8;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(15, 23, 42, 0.55);
}

.ple-table td {
    color: #e2e8f0;
}

.ple-table a {
    color: #7dd3fc;
    word-break: break-all;
}

.ple-empty-row td {
    text-align: center;
    color: #94a3b8;
    padding: 1.4rem 1rem;
}

.ple-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ple-status.is-ok {
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
}

.ple-status.is-warn {
    background: rgba(245, 158, 11, 0.16);
    color: #fcd34d;
}

.ple-status.is-bad {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

.ple-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0.85rem 0 1rem;
}

.ple-stat {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
    background: rgba(15, 23, 42, 0.4);
    text-align: center;
}

.ple-stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: #e2e8f0;
    line-height: 1.1;
}

.ple-stat-label {
    display: block;
    margin-top: 0.25rem;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ple-stat.is-ok .ple-stat-value { color: #6ee7b7; }
.ple-stat.is-warn .ple-stat-value { color: #fcd34d; }
.ple-stat.is-bad .ple-stat-value { color: #fca5a5; }

.ple-remove-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: #fca5a5;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.ple-summary {
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.45);
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.55;
}

.ple-summary strong {
    color: #f8fafc;
}

.ple-report-sections {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ple-report-section {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    padding: 0.9rem 1rem 1rem;
    background: rgba(15, 23, 42, 0.35);
}

.ple-report-section.is-ok {
    border-color: rgba(16, 185, 129, 0.28);
    background:
        radial-gradient(420px 120px at 0% 0%, rgba(16, 185, 129, 0.12), transparent 60%),
        rgba(15, 23, 42, 0.35);
}

.ple-report-section.is-bad {
    border-color: rgba(239, 68, 68, 0.28);
    background:
        radial-gradient(420px 120px at 0% 0%, rgba(239, 68, 68, 0.12), transparent 60%),
        rgba(15, 23, 42, 0.35);
}

.ple-report-section.is-warn {
    border-color: rgba(245, 158, 11, 0.28);
    background:
        radial-gradient(420px 120px at 0% 0%, rgba(245, 158, 11, 0.12), transparent 60%),
        rgba(15, 23, 42, 0.35);
}

.ple-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ple-section-head h4 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: #f8fafc;
}

.ple-section-count {
    display: inline-flex;
    min-width: 1.75rem;
    justify-content: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 800;
}

.ple-report-section.is-ok .ple-section-count {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
}

.ple-report-section.is-bad .ple-section-count {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

.ple-report-section.is-warn .ple-section-count {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
}

.ple-section-note {
    margin: 0.35rem 0 0.75rem;
    color: #94a3b8;
    font-size: 0.82rem;
    line-height: 1.45;
}

.ple-report-section.is-empty {
    opacity: 0.72;
}

#pleAllTableWrap {
    margin-top: 0.25rem;
}

#pleAllTableWrap::before {
    content: 'Complete link inventory';
    display: block;
    margin: 0 0 0.55rem;
    color: #cbd5e1;
    font-size: 0.86rem;
    font-weight: 800;
}

@media (max-width: 980px) {
    .ple-grid {
        grid-template-columns: 1fr;
    }

    .ple-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .ple-modes {
        width: 100%;
    }

    .ple-mode-btn {
        flex: 1;
        text-align: center;
    }

    .ple-actions .btn {
        width: 100%;
    }
}
