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

.pdf-zoom-select {
    height: 28px;
    min-width: 92px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font-size: 12px;
    padding: 0 8px;
}

.pdf-zoom-select:focus {
    outline: none;
    border-color: var(--brand, var(--acc, #2563eb));
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.pdf-zoom-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.pdf-zoom-btn:hover {
    background: #f8fafc;
}

.pdf-zoom-btn:focus {
    outline: none;
    border-color: var(--brand, var(--acc, #2563eb));
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.pdfviewer {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.pdfviewer-inner {
    width: 100%;
    min-height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

.pdfstatus {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line, #dbe2ef);
    color: var(--muted, var(--mut, #52627a));
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    z-index: 3;
}

.pdfstatus.hidden {
    display: none;
}

.pdfcanvas {
    display: block;
    max-width: none;
}

.pdf-blue-texts-panel {
    margin: 12px 0 0;
    padding: 12px;
    border-top: 1px solid var(--line, #dbe2ef);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.98));
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pdf-blue-texts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pdf-blue-texts-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text, #0f172a);
    letter-spacing: 0.02em;
}

.pdf-blue-texts-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pdf-blue-texts-btn {
    height: 28px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.pdf-blue-texts-btn:hover {
    background: #f8fafc;
}

.pdf-blue-texts-btn:focus {
    outline: none;
    border-color: var(--brand, var(--acc, #2563eb));
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.pdf-blue-texts-area {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.45;
}

.pdf-blue-texts-area:focus {
    outline: none;
    border-color: var(--brand, var(--acc, #2563eb));
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.pdf-selection-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.pdf-selection-layer.is-active {
    display: block;
}

.pdf-selection-highlight {
    position: absolute;
    border: 2px solid transparent;
    border-radius: 2px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.88);
    pointer-events: none;
}

.pdf-selection-highlight.active-pdf-row-overlay {
    position: absolute;
    border: 2px dashed rgba(239, 68, 68, 0.95);
    background: rgba(239, 68, 68, 0.12);
    border-radius: 4px;
    pointer-events: none;
    z-index: 20;
    box-sizing: border-box;
    box-shadow: none;
}

.pdf-selection-highlight.pdf-column-debug-region {
    border: 1px dashed rgba(37, 99, 235, 0.45);
    background: rgba(59, 130, 246, 0.06);
    box-shadow: none;
    pointer-events: none;
    z-index: 2;
}

.pdf-selection-highlight.pdf-column-debug-label {
    border: 0;
    background: rgba(15, 23, 42, 0.72);
    color: #f8fafc;
    font-size: 10px;
    line-height: 1.2;
    padding: 1px 4px;
    border-radius: 4px;
    box-shadow: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 4;
}

.pdf-selection-highlight.pdf-column-debug-token {
    border-color: rgba(14, 116, 144, 0.88);
    background: rgba(34, 211, 238, 0.12);
    box-shadow: none;
    pointer-events: none;
    z-index: 3;
}

.pdf-selection-highlight.pdf-header-orange-token {
    border: 2px solid rgba(234, 88, 12, 0.92);
    background: rgba(251, 146, 60, 0.18);
    box-shadow: 0 0 0 1px rgba(234, 88, 12, 0.35);
    pointer-events: none;
    z-index: 5;
}

/* ── Per-header-key colored highlights ── */
.pdf-selection-highlight.pdf-header-pos {
    border: 2px solid rgba(37, 99, 235, 0.92);
    background: rgba(96, 165, 250, 0.20);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.30);
    pointer-events: none;
    z-index: 5;
}

.pdf-selection-highlight.pdf-header-part-no {
    border: 2px solid rgba(22, 163, 74, 0.92);
    background: rgba(74, 222, 128, 0.18);
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.30);
    pointer-events: none;
    z-index: 5;
}

.pdf-selection-highlight.pdf-header-model-type {
    border: 2px solid rgba(14, 116, 144, 0.92);
    background: rgba(103, 232, 249, 0.18);
    box-shadow: 0 0 0 1px rgba(14, 116, 144, 0.30);
    pointer-events: none;
    z-index: 5;
}

.pdf-selection-highlight.pdf-header-qty {
    border: 2px solid rgba(124, 58, 237, 0.92);
    background: rgba(196, 181, 253, 0.22);
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.30);
    pointer-events: none;
    z-index: 5;
}

.pdf-selection-highlight.pdf-header-designation {
    border: 2px solid rgba(234, 88, 12, 0.92);
    background: rgba(251, 146, 60, 0.18);
    box-shadow: 0 0 0 1px rgba(234, 88, 12, 0.30);
    pointer-events: none;
    z-index: 5;
}

.pdf-selection-highlight.pdf-header-units {
    border: 2px solid rgba(202, 138, 4, 0.92);
    background: rgba(253, 224, 71, 0.22);
    box-shadow: 0 0 0 1px rgba(202, 138, 4, 0.30);
    pointer-events: none;
    z-index: 5;
}

.pdf-selection-highlight.pdf-header-weight {
    border: 2px solid rgba(220, 38, 38, 0.92);
    background: rgba(252, 165, 165, 0.22);
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.30);
    pointer-events: none;
    z-index: 5;
}

.pdf-selection-highlight.pdf-header-fn {
    border: 2px solid rgba(168, 85, 247, 0.92);
    background: rgba(221, 214, 254, 0.22);
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.30);
    pointer-events: none;
    z-index: 5;
}

.pdf-selection-highlight.pdf-header-measurement {
    border: 2px solid rgba(8, 145, 178, 0.92);
    background: rgba(103, 232, 249, 0.20);
    box-shadow: 0 0 0 1px rgba(8, 145, 178, 0.30);
    pointer-events: none;
    z-index: 5;
}

.pdf-selection-highlight.pdf-header-standard {
    border: 2px solid rgba(15, 118, 110, 0.92);
    background: rgba(94, 234, 212, 0.18);
    box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.30);
    pointer-events: none;
    z-index: 5;
}

.pdf-selection-highlight.pdf-table-debug-area {
    border: 1px solid rgba(14, 165, 233, 0.6);
    background: rgba(56, 189, 248, 0.06);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-table-debug-top-line {
    border: 0;
    background: rgba(14, 165, 233, 0.95);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-table-debug-col {
    border: 1px dashed color-mix(in srgb, var(--td-col-color, #22c55e) 70%, transparent);
    background: color-mix(in srgb, var(--td-col-color, #22c55e) 12%, transparent);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-table-debug-col-label,
.pdf-selection-highlight.pdf-table-debug-header-label,
.pdf-selection-highlight.pdf-table-debug-boundary-adjustment {
    border: 0;
    background: rgba(15, 23, 42, 0.78);
    color: #f8fafc;
    box-shadow: none;
    padding: 1px 4px;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-selection-highlight.pdf-table-debug-header-row {
    border: 1px dashed rgba(245, 158, 11, 0.95);
    background: rgba(251, 191, 36, 0.12);
    box-shadow: none;
    color: #92400e;
    font-size: 10px;
    line-height: 1.2;
    padding: 1px 4px;
}

.pdf-selection-highlight.pdf-table-debug-header {
    border: 1px dashed rgba(245, 158, 11, 0.7);
    background: rgba(251, 191, 36, 0.08);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-table-debug-row {
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.03);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-table-debug-separator {
    border: 0;
    background: rgba(244, 63, 94, 0.75);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-table-debug-natural-gap {
    border: 0;
    background: rgba(234, 179, 8, 0.9);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-table-debug-boundary-before {
    border: 0;
    background: rgba(59, 130, 246, 0.45);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-table-debug-boundary-after {
    border: 0;
    background: rgba(16, 185, 129, 0.9);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-table-debug-ignored-header {
    border: 1px solid rgba(239, 68, 68, 0.8);
    background: rgba(248, 113, 113, 0.1);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-table-debug-text-assigned {
    border: 1px solid rgba(15, 23, 42, 0.22);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-table-debug-text-unassigned {
    border: 1px solid rgba(220, 38, 38, 0.95);
    background: rgba(252, 165, 165, 0.35);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-table-debug-overlap {
    border: 1px solid rgba(220, 38, 38, 0.92);
    background: rgba(248, 113, 113, 0.22);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-table-debug-warning {
    border: 0;
    background: rgba(127, 29, 29, 0.82);
    color: #fee2e2;
    box-shadow: none;
    padding: 1px 4px;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-selection-highlight.pdf-table-debug-stats {
    border: 1px solid rgba(15, 23, 42, 0.25);
    background: rgba(15, 23, 42, 0.78);
    color: #e2e8f0;
    box-shadow: none;
    padding: 4px 6px;
    font-size: 10px;
    line-height: 1.3;
}

/* 🔬 EXPERIMENTAL: Header Left Lines Mode */

.pdf-selection-highlight.pdf-header-left-line-initial {
    border: 0;
    background: rgba(153, 153, 153, 0.35);
    box-shadow: none;
    border-right: 1px dashed rgba(153, 153, 153, 0.55);
}

.pdf-selection-highlight.pdf-header-left-line-adjusted {
    border: 0;
    background: color-mix(in srgb, var(--hll-color, #22c55e) 65%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--hll-color, #22c55e) 95%, transparent);
    border-right: 2px solid color-mix(in srgb, var(--hll-color, #22c55e) 85%, transparent);
}

.pdf-selection-highlight.pdf-header-left-line-label {
    border: 0;
    background: rgba(15, 23, 42, 0.82);
    color: #f8fafc;
    box-shadow: none;
    padding: 2px 4px;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 3px;
    font-weight: 600;
}

.pdf-column-mode-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 8px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.pdf-column-mode-select {
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.pdf-column-mode-select:hover {
    border-color: #999;
}

.pdf-column-mode-select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 3px rgba(33, 150, 243, 0.3);
}

/* 🎯 HEADER DEBUG MODE: Headers-Only Visualization */

.pdf-selection-highlight.pdf-header-debug-row-bg {
    border: 0;
    background: rgba(59, 130, 246, 0.08);
    box-shadow: none;
}

.pdf-selection-highlight.pdf-header-debug-rect {
    border: 2px solid #3b82f6;
    background: rgba(59, 130, 246, 0.12);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.pdf-selection-highlight.pdf-header-debug-label {
    border: 0;
    background: #3b82f6;
    color: #ffffff;
    box-shadow: none;
    padding: 2px 4px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 2px;
    letter-spacing: 0.5px;
}

.pdf-selection-highlight.pdf-header-debug-vline {
    border: 0;
    background: rgba(59, 130, 246, 0.35);
    box-shadow: none;
    border-left: 1px dotted rgba(59, 130, 246, 0.55);
}

.pdf-selection-highlight.pdf-header-debug-stats {
    border: 1px solid rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.92);
    color: #ffffff;
    box-shadow: none;
    padding: 4px 6px;
    font-size: 10px;
    line-height: 1.3;
    font-weight: 600;
}

/* ─── Ocultar botones legacy del panel PDF ────────────────────────────────── */

/* Marcar línea PN en PDF - Legacy experimental tool */
#markPnRowBtn {
    display: none !important;
}

/* Debug Tabla - Herramienta antigua de debug */
#pdfTableDebugToggleBtn {
    display: none !important;
}

/* Recalcular Tabla - Herramienta de debug antigua */
#pdfTableRecalcBtn {
    display: none !important;
}

/* Selector de modo de columnas - Legacy column detection */
.pdf-column-mode-label {
    display: none !important;
}

/* Panel de Textos azules del PDF - Herramienta legacy completa */
.pdf-blue-texts-panel {
    display: none !important;
}