/* ═══════════════════════════════════════════════════════════════════
   COLORNITIDO TOOLS — CONVERTIR IMAGEN A PDF
   Estilos 100% Autónomos, Modo Oscuro Neón & Diseño Ergonómico
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --cnt-emerald: #0284c7;
    --cnt-emerald-bright: #00c2ff;
    --cnt-emerald-glow: rgba(0, 194, 255, 0.35);
    --cnt-emerald-dark: #6366f1;
    --cnt-cyan-bright: #38bdf8;
    --cnt-bg-surface: rgba(15, 23, 42, 0.90);
    --cnt-bg-card: rgba(20, 28, 48, 0.75);
    --cnt-border-subtle: rgba(255, 255, 255, 0.08);
    --cnt-text-primary: #f8fafc;
    --cnt-text-secondary: #94a3b8;
    --cnt-text-muted: #64748b;
    --cnt-danger: #ef4444;
}

/* ─── Contenedor Principal (Regla 13: 100% Viewport Width) ─── */
.cnt-imgpdf-wrap {
    position: relative;
    width: 100%;
    max-width: none !important;
    min-height: 100vh;
    color: var(--cnt-text-primary);
    box-sizing: border-box;
    background:
        radial-gradient(1100px 500px at 15% -10%, rgba(0, 194, 255, 0.12), transparent 70%),
        radial-gradient(900px 500px at 85% -10%, rgba(124, 58, 237, 0.12), transparent 70%),
        radial-gradient(800px 400px at 50% 30%, rgba(236, 72, 153, 0.05), transparent 70%),
        #07090e;
}

.cnt-tool-page .cnt-imgpdf-wrap,
#cnt-imagen-a-pdf {
    padding-top: clamp(8.5rem, 13vw, 11rem) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 3rem;
}

/* ─── Resplandor ambiental de fondo ─── */
.cnt-imgpdf-wrap .cnt-bg-glow-emerald {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 650px;
    height: 450px;
    background: radial-gradient(circle, rgba(0, 194, 255, 0.16) 0%, rgba(99, 102, 241, 0.06) 50%, transparent 75%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

/* ─── Encabezado (Alineado con Blocksy Container) ─── */
.cnt-imgpdf-wrap .cnt-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
    width: var(--theme-container-width, min(100%, 90vw));
    max-width: var(--theme-normal-container-max-width, 1290px);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.cnt-imgpdf-wrap .cnt-header-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cnt-imgpdf-wrap .cnt-tool-icon-emerald {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(0, 194, 255, 0.25), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(0, 194, 255, 0.4);
    color: var(--cnt-emerald-bright);
    box-shadow: 0 0 25px rgba(0, 194, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.2rem;
}

.cnt-imgpdf-wrap .cnt-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.85rem;
    background: rgba(0, 194, 255, 0.12);
    border: 1px solid rgba(0, 194, 255, 0.3);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cnt-emerald-bright);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
}

.cnt-imgpdf-wrap .cnt-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cnt-emerald-bright);
    box-shadow: 0 0 8px var(--cnt-emerald-bright);
}

.cnt-imgpdf-wrap .cnt-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 0.55rem;
    padding: 0.05em 0 0.22em;
    color: #ffffff;
    letter-spacing: -0.02em;
    overflow: visible;
}

.cnt-imgpdf-wrap .cnt-subtitle {
    font-size: 1rem;
    color: var(--cnt-text-secondary);
    max-width: 650px;
    margin: 0;
    line-height: 1.6;
}

/* ─── Layout de Dos Columnas (Regla 8 y 13) ─── */
.cnt-imgpdf-layout {
    display: grid;
    grid-template-columns: 390px 1fr;
    gap: 1.5rem;
    width: var(--theme-container-width, min(100%, 90vw));
    max-width: var(--theme-normal-container-max-width, 1290px);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    align-items: start;
}

/* ═══════════════════════════════════════════════════════════════════
   PANEL IZQUIERDO: CONTROLES & SCROLLBAR (Regla 8)
   ═══════════════════════════════════════════════════════════════════ */
.cnt-imgpdf-sidebar {
    background: var(--cnt-bg-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--cnt-border-subtle);
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

@media (min-width: 1024px) {
    .cnt-imgpdf-sidebar {
        position: sticky;
        top: clamp(6.5rem, 10vw, 8.5rem);
        height: calc(100vh - clamp(7.5rem, 11vw, 9.5rem));
        max-height: calc(100vh - clamp(7.5rem, 11vw, 9.5rem));
        min-height: 580px;
        overflow: hidden;
    }
}

.cnt-imgpdf-sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 194, 255, 0.35) rgba(0, 0, 0, 0.25);
}

.cnt-imgpdf-sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}
.cnt-imgpdf-sidebar-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 999px;
}
.cnt-imgpdf-sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 194, 255, 0.35);
    border-radius: 999px;
}
.cnt-imgpdf-sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--cnt-emerald-bright);
}

/* ─── Tarjetas de Control (Regla 9 y 12) ─── */
.cnt-imgpdf-wrap .cnt-control-card {
    background: var(--cnt-bg-card);
    border: 1px solid var(--cnt-border-subtle);
    border-radius: 1rem;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cnt-imgpdf-wrap .cnt-control-card:hover {
    border-color: rgba(0, 194, 255, 0.25);
}

.cnt-imgpdf-wrap .cnt-card-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-bottom: 1px solid var(--cnt-border-subtle);
    padding-bottom: 0.65rem;
}

.cnt-imgpdf-wrap .cnt-card-step {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 194, 255, 0.15);
    border: 1px solid rgba(0, 194, 255, 0.35);
    color: var(--cnt-emerald-bright);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cnt-imgpdf-wrap .cnt-card-header h3 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--cnt-text-primary);
    margin: 0;
    flex: 1;
}

/* ─── Dropzone (Paso 1 - Regla 5: Spinner visual obligatorio) ─── */
.cnt-imgpdf-wrap .cnt-dropzone {
    position: relative;
    background: rgba(15, 23, 42, 0.45);
    border: 2px dashed rgba(0, 194, 255, 0.35);
    border-radius: 0.85rem;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    overflow: hidden;
}

.cnt-imgpdf-wrap .cnt-dropzone:hover,
.cnt-imgpdf-wrap .cnt-dropzone.dragover,
.cnt-imgpdf-wrap .cnt-dropzone.drag-over {
    border-color: var(--cnt-emerald-bright);
    background: rgba(0, 194, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 194, 255, 0.2);
    transform: translateY(-2px);
}

.cnt-imgpdf-wrap .cnt-dropzone .cnt-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.cnt-imgpdf-wrap .cnt-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    pointer-events: none;
    user-select: none;
}

.cnt-imgpdf-wrap .cnt-dropzone-icon {
    font-size: 2rem;
    color: var(--cnt-emerald-bright);
    margin-bottom: 0.25rem;
}

.cnt-imgpdf-wrap .cnt-dropzone-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cnt-text-primary);
}

.cnt-imgpdf-wrap .cnt-dropzone-subtitle {
    font-size: 0.74rem;
    color: var(--cnt-text-secondary);
}

.cnt-imgpdf-wrap .cnt-dropzone-tags {
    font-size: 0.68rem;
    color: var(--cnt-text-muted);
    margin-top: 0.2rem;
}

/* Spinner en Dropzone (Regla #5) */
.cnt-imgpdf-wrap .cnt-dropzone-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.cnt-imgpdf-wrap .cnt-dropzone-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 194, 255, 0.2);
    border-top-color: var(--cnt-emerald-bright);
    border-radius: 50%;
    animation: cntImgPdfDropzoneSpin 0.8s linear infinite;
}

@keyframes cntImgPdfDropzoneSpin {
    to { transform: rotate(360deg); }
}

.cnt-imgpdf-wrap .cnt-dropzone-loading-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cnt-text-primary);
}

.cnt-imgpdf-wrap .cnt-dropzone-loading-sub {
    font-size: 0.72rem;
    color: var(--cnt-text-muted);
}

/* ─── Galería / Lista de Imágenes Subidas ─── */
.cnt-imgpdf-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cnt-imgpdf-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cnt-imgpdf-items-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--cnt-emerald-bright);
}

.cnt-imgpdf-items-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cnt-btn-mini-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: rgba(0, 194, 255, 0.12);
    border: 1px solid rgba(0, 194, 255, 0.3);
    border-radius: 0.5rem;
    color: var(--cnt-emerald-bright);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cnt-btn-mini-action:hover {
    background: rgba(0, 194, 255, 0.25);
    color: #ffffff;
}

.cnt-btn-mini-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.cnt-btn-mini-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
}

.cnt-imgpdf-items-container {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: 230px;
    overflow-y: auto;
    padding-right: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 194, 255, 0.25) transparent;
}

.cnt-imgpdf-item-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.65rem;
    padding: 0.45rem 0.6rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.cnt-imgpdf-item-card:hover,
.cnt-imgpdf-item-card.is-active {
    border-color: var(--cnt-emerald-bright);
    background: rgba(0, 194, 255, 0.08);
}

.cnt-imgpdf-item-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--cnt-emerald-bright);
    background: rgba(0, 194, 255, 0.15);
    border-radius: 9999px;
    padding: 0.15rem 0.45rem;
    min-width: 18px;
    text-align: center;
}

.cnt-imgpdf-item-thumb {
    width: 38px;
    height: 38px;
    border-radius: 0.4rem;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cnt-imgpdf-item-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cnt-imgpdf-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cnt-imgpdf-item-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cnt-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cnt-imgpdf-item-meta {
    font-size: 0.68rem;
    color: var(--cnt-text-muted);
}

.cnt-imgpdf-item-btns {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cnt-btn-icon-item {
    width: 26px;
    height: 26px;
    border-radius: 0.35rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--cnt-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cnt-btn-icon-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.cnt-btn-icon-item.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ─── Grid de Tamaños de Hoja (Paso 2) ─── */
.cnt-imgpdf-pagesize-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.cnt-pagesize-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.65rem 0.75rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.65rem;
    color: var(--cnt-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.cnt-pagesize-btn:hover {
    border-color: rgba(0, 194, 255, 0.4);
    color: #ffffff;
}

.cnt-pagesize-btn.active {
    background: rgba(0, 194, 255, 0.12);
    border-color: var(--cnt-emerald-bright);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(0, 194, 255, 0.2);
}

.cnt-pagesize-btn strong {
    font-size: 0.78rem;
    color: #ffffff;
}

.cnt-pagesize-btn span {
    font-size: 0.68rem;
    color: var(--cnt-text-muted);
    margin-top: 0.15rem;
}

.cnt-pagesize-btn.active span {
    color: var(--cnt-cyan-bright);
}

/* ─── Inputs de Medidas en 2 Columnas ─── */
.cnt-inputs-2col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.cnt-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cnt-input-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--cnt-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cnt-number-input,
.cnt-text-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.65rem;
    color: #ffffff;
    font-size: 0.82rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.cnt-number-input:focus,
.cnt-text-input:focus {
    border-color: var(--cnt-emerald-bright);
    box-shadow: 0 0 10px rgba(0, 194, 255, 0.25);
}

.cnt-input-with-suffix {
    display: flex;
    align-items: center;
    position: relative;
}

.cnt-input-with-suffix input {
    padding-right: 3rem;
}

.cnt-input-suffix {
    position: absolute;
    right: 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--cnt-emerald-bright);
    pointer-events: none;
}

/* ─── Grid de Orientación & Márgenes (Paso 3) ─── */
.cnt-imgpdf-orient-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.cnt-orient-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.65rem 0.5rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.65rem;
    color: var(--cnt-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cnt-orient-btn i {
    font-size: 1rem;
}

.cnt-orient-btn strong {
    font-size: 0.74rem;
}

.cnt-orient-btn:hover {
    border-color: rgba(0, 194, 255, 0.4);
    color: #ffffff;
}

.cnt-orient-btn.active {
    background: rgba(0, 194, 255, 0.12);
    border-color: var(--cnt-emerald-bright);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(0, 194, 255, 0.2);
}

.cnt-imgpdf-margin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.cnt-margin-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.3rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.65rem;
    color: var(--cnt-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.cnt-margin-btn strong {
    font-size: 0.78rem;
    color: #ffffff;
}

.cnt-margin-btn span {
    font-size: 0.64rem;
    color: var(--cnt-text-muted);
}

.cnt-margin-btn:hover {
    border-color: rgba(0, 194, 255, 0.4);
    color: #ffffff;
}

.cnt-margin-btn.active {
    background: rgba(0, 194, 255, 0.12);
    border-color: var(--cnt-emerald-bright);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(0, 194, 255, 0.2);
}

.cnt-margin-btn.active span {
    color: var(--cnt-cyan-bright);
}

/* ─── Sliders y Labels ─── */
.cnt-slider-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--cnt-text-secondary);
    margin-bottom: 0.35rem;
}

.cnt-slider-val-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--cnt-emerald-bright);
    background: rgba(0, 194, 255, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
}

.cnt-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
}

.cnt-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--cnt-emerald-bright);
    box-shadow: 0 0 10px var(--cnt-emerald-bright);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.cnt-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* ─── Modo de Ajuste & Fondo (Paso 4) ─── */
.cnt-imgpdf-fit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
}

.cnt-fit-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.4rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.65rem;
    color: var(--cnt-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    gap: 0.25rem;
}

.cnt-fit-btn i {
    font-size: 0.95rem;
}

.cnt-fit-btn strong {
    font-size: 0.72rem;
    color: #ffffff;
}

.cnt-fit-btn span {
    font-size: 0.62rem;
    color: var(--cnt-text-muted);
}

.cnt-fit-btn:hover {
    border-color: rgba(0, 194, 255, 0.4);
    color: #ffffff;
}

.cnt-fit-btn.active {
    background: rgba(0, 194, 255, 0.12);
    border-color: var(--cnt-emerald-bright);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(0, 194, 255, 0.2);
}

.cnt-color-chips-row {
    display: flex;
    gap: 0.5rem;
}

.cnt-color-chip {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.5rem 0.65rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.65rem;
    color: var(--cnt-text-secondary);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cnt-color-chip:hover {
    border-color: rgba(0, 194, 255, 0.4);
    color: #ffffff;
}

.cnt-color-chip.active {
    border-color: var(--cnt-emerald-bright);
    background: rgba(0, 194, 255, 0.12);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 194, 255, 0.2);
}

.cnt-chip-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cnt-chip-swatch-checkered {
    background: linear-gradient(45deg, #334155 25%, transparent 25%),
                linear-gradient(-45deg, #334155 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #334155 75%),
                linear-gradient(-45deg, transparent 75%, #334155 75%);
    background-size: 6px 6px;
    background-color: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ─── Calidad y Exportación (Paso 5) ─── */
.cnt-imgpdf-quality-grid {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.cnt-quality-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.65rem;
    color: var(--cnt-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cnt-quality-btn strong {
    font-size: 0.78rem;
    color: #ffffff;
}

.cnt-quality-btn span {
    font-size: 0.68rem;
    color: var(--cnt-text-muted);
}

.cnt-quality-btn:hover {
    border-color: rgba(0, 194, 255, 0.4);
    color: #ffffff;
}

.cnt-quality-btn.active {
    background: rgba(0, 194, 255, 0.12);
    border-color: var(--cnt-emerald-bright);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(0, 194, 255, 0.2);
}

.cnt-quality-btn.active span {
    color: var(--cnt-cyan-bright);
}

/* ═══════════════════════════════════════════════════════════════════
   PANEL DERECHO: WORKSPACE Y VISOR (Regla 8)
   ═══════════════════════════════════════════════════════════════════ */
.cnt-imgpdf-workspace {
    background: var(--cnt-bg-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--cnt-border-subtle);
    border-radius: 1.5rem;
    box-sizing: border-box;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .cnt-imgpdf-workspace {
        height: calc(100vh - clamp(7.5rem, 11vw, 9.5rem));
        max-height: calc(100vh - clamp(7.5rem, 11vw, 9.5rem));
        min-height: 580px;
    }
}

/* ─── Toolbar Superior (1 Sola Línea Estandarizada) ─── */
.cnt-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.15rem;
    min-height: 48px;
    border-bottom: 1px solid var(--cnt-border-subtle);
    background: rgba(10, 16, 28, 0.95);
    flex-shrink: 0;
    gap: 0.5rem;
    flex-wrap: nowrap;
    box-sizing: border-box;
}

.cnt-toolbar-left,
.cnt-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.cnt-toolbar-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(5, 8, 15, 0.75);
    border: 1px solid var(--cnt-border-subtle);
    border-radius: 0.65rem;
    padding: 0.2rem 0.4rem;
}

.cnt-btn-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--cnt-border-subtle);
    border-radius: 0.5rem;
    color: var(--cnt-text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cnt-btn-tool:hover:not(:disabled) {
    background: rgba(0, 194, 255, 0.15);
    border-color: rgba(0, 194, 255, 0.45);
    color: var(--cnt-emerald-bright);
}

.cnt-btn-tool:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.cnt-toolbar-page-indicator {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cnt-emerald-bright);
    padding: 0 0.4rem;
    white-space: nowrap;
}

/* ─── Zoom Controls ─── */
.cnt-zoom-controls {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--cnt-border-subtle);
    border-radius: 0.6rem;
    padding: 0.2rem;
    gap: 0.2rem;
}

.cnt-zoom-btn {
    width: 30px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--cnt-text-secondary);
    border-radius: 0.45rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    transition: all 0.15s ease;
}

.cnt-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.cnt-zoom-btn-text {
    width: auto !important;
    padding: 0 0.65rem;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.cnt-zoom-divider {
    width: 1px;
    height: 16px;
    background: var(--cnt-border-subtle);
    margin: 0 0.15rem;
}

.cnt-zoom-level {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--cnt-text-primary);
    min-width: 48px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.cnt-toggle-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--cnt-border-subtle);
    color: var(--cnt-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cnt-toggle-btn:hover {
    background: rgba(0, 194, 255, 0.15);
    border-color: rgba(0, 194, 255, 0.45);
    color: var(--cnt-emerald-bright);
    box-shadow: 0 0 10px rgba(0, 194, 255, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════
   VIEWPORT / LIENZO INTERACTIVO (Regla 8 y 9)
   ═══════════════════════════════════════════════════════════════════ */
.cnt-imgpdf-viewport {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Ajedrezado de transparencia unificado Colornitido (Regla 9) */
    background-color: #060907;
    background-image:
        linear-gradient(45deg, #0f1511 25%, transparent 25%),
        linear-gradient(-45deg, #0f1511 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #0f1511 75%),
        linear-gradient(-45deg, transparent 75%, #0f1511 75%);
    background-size: 20px 20px;
    user-select: none;
}

/* ─── Placeholder Vacío Estandarizado ─── */
.cnt-viewport-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 2rem;
    box-sizing: border-box;
}

.cnt-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 420px;
    gap: 0.75rem;
}

.cnt-placeholder-icon {
    width: 76px;
    height: 76px;
    border-radius: 1.35rem;
    background: rgba(0, 194, 255, 0.08);
    border: 1px solid rgba(0, 194, 255, 0.25);
    color: var(--cnt-emerald-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 0 30px rgba(0, 194, 255, 0.15);
    margin-bottom: 0.25rem;
}

.cnt-placeholder-content h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

.cnt-placeholder-content p {
    font-size: 0.85rem;
    color: var(--cnt-text-secondary);
    line-height: 1.5;
    margin: 0;
}

.cnt-btn-placeholder-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    margin-top: 0.5rem;
    background: rgba(0, 194, 255, 0.15);
    border: 1px solid rgba(0, 194, 255, 0.4);
    border-radius: 0.75rem;
    color: var(--cnt-emerald-bright) !important;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.cnt-btn-placeholder-upload:hover {
    background: var(--cnt-emerald-bright);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 194, 255, 0.4);
    border-color: var(--cnt-emerald-bright);
}

/* ─── Cargador Visual Obligatorio (Regla 5) ─── */
.cnt-processing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 9, 14, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.cnt-processing-card {
    background: var(--cnt-bg-card);
    border: 1px solid rgba(0, 194, 255, 0.35);
    border-radius: 1.25rem;
    padding: 2rem 2.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 194, 255, 0.2);
}

.cnt-processing-spinner {
    width: 48px;
    height: 48px;
    border: 3.5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--cnt-emerald-bright);
    border-radius: 50%;
    animation: cntImgPdfSpin 0.8s linear infinite;
}

@keyframes cntImgPdfSpin {
    to { transform: rotate(360deg); }
}

.cnt-processing-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.cnt-processing-card p {
    font-size: 0.82rem;
    color: var(--cnt-text-secondary);
    margin: 0;
}

/* ─── Escenario de Hoja PDF (Stage) ─── */
.cnt-imgpdf-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}

.cnt-imgpdf-stage:active {
    cursor: grabbing;
}

.cnt-imgpdf-zoom-container {
    transform-origin: center center;
    transition: transform 0.12s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ─── Hoja de Papel Simulada (Sheet) ─── */
.cnt-imgpdf-paper-sheet {
    position: relative;
    background: #ffffff;
    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.75),
        0 2px 10px rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.25s ease, height 0.25s ease, background-color 0.25s ease;
}

/* Recuadro de Margen Imprimible */
.cnt-imgpdf-margin-box {
    position: absolute;
    inset: 0;
    border: 1px dashed rgba(0, 194, 255, 0.45);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: inset 0.2s ease;
}

.cnt-imgpdf-margin-box canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    pointer-events: auto;
}

/* Badge flotante de especificación de hoja */
.cnt-imgpdf-sheet-badge {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(0, 194, 255, 0.35);
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--cnt-emerald-bright);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* ─── Tira de Miniaturas Inferior (Thumbnails Strip) ─── */
.cnt-imgpdf-thumbnails-strip {
    background: rgba(10, 15, 29, 0.95);
    border-top: 1px solid var(--cnt-border-subtle);
    padding: 0.55rem 1rem;
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 194, 255, 0.35) transparent;
}

.cnt-imgpdf-thumbnails-track {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.cnt-imgpdf-thumb-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 0.55rem;
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cnt-imgpdf-thumb-card:hover {
    border-color: rgba(0, 194, 255, 0.4);
    background: rgba(0, 194, 255, 0.05);
}

.cnt-imgpdf-thumb-card.active {
    border-color: var(--cnt-emerald-bright);
    background: rgba(0, 194, 255, 0.12);
    box-shadow: 0 0 12px rgba(0, 194, 255, 0.25);
}

.cnt-imgpdf-thumb-frame {
    width: 48px;
    height: 48px;
    border-radius: 0.35rem;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cnt-imgpdf-thumb-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cnt-imgpdf-thumb-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--cnt-text-secondary);
}

.cnt-imgpdf-thumb-card.active .cnt-imgpdf-thumb-label {
    color: var(--cnt-emerald-bright);
}

/* ═══════════════════════════════════════════════════════════════════
   BARRA INFERIOR DE ACCIONES (Reglas 6, 9 y 10)
   ═══════════════════════════════════════════════════════════════════ */
.cnt-imgpdf-bottom-bar {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0.75rem 1.15rem 0.85rem;
    background: rgba(10, 15, 28, 0.92);
    border-top: 1px solid var(--cnt-border-subtle);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-shrink: 0;
    gap: 0.65rem;
    box-sizing: border-box;
    z-index: 10;
}

.cnt-imgpdf-bottom-bar .cnt-bottom-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
    overflow: visible;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.55rem;
}

.cnt-imgpdf-bottom-bar .cnt-info-pill {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--cnt-border-subtle);
    border-radius: 9999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.74rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    flex: 1 1 auto;
    justify-content: center;
    box-sizing: border-box;
    transition: all 0.2s ease;
    color: #cbd5e1;
}

.cnt-imgpdf-bottom-bar .cnt-info-pill i {
    color: var(--cnt-emerald-bright, #00c2ff);
    font-size: 0.75rem;
}

.cnt-imgpdf-bottom-bar .cnt-info-label {
    font-size: 0.72rem;
    color: var(--cnt-text-muted);
    font-weight: 600;
}

.cnt-imgpdf-bottom-bar .cnt-info-pill strong {
    font-weight: 700;
    color: #ffffff;
}

.cnt-imgpdf-bottom-bar .cnt-info-pill-accent {
    border-color: rgba(0, 194, 255, 0.45);
    background: rgba(0, 194, 255, 0.08);
}

.cnt-imgpdf-bottom-bar .cnt-info-pill-accent strong,
.cnt-imgpdf-bottom-bar .cnt-info-pill-accent span,
.cnt-imgpdf-bottom-bar .cnt-info-pill-accent i {
    color: #00c2ff;
}

.cnt-imgpdf-bottom-bar .cnt-bottom-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
    width: 100%;
    flex-wrap: nowrap;
    box-sizing: border-box;
}

/* ─── Botón Principal de Descarga Oficial (Reglas 6, 9 y 10) ─── */
.cnt-imgpdf-bottom-bar .cnt-btn-download-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(135deg, #00b4d8 0%, #0284c7 45%, #6366f1 100%);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0.75rem;
    box-shadow: 0 4px 18px -2px rgba(2, 132, 199, 0.45);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    flex-shrink: 0;
}

.cnt-imgpdf-bottom-bar .cnt-btn-download-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #00c2ff 0%, #0ea5e9 45%, #7c3aed 100%);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -4px rgba(124, 58, 237, 0.55), 0 0 20px rgba(0, 194, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Estado Desactivado Obligatorio (Regla 10) */
.cnt-imgpdf-bottom-bar button:disabled,
.cnt-imgpdf-bottom-bar .cnt-btn-download-primary:disabled {
    opacity: 0.42 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN (Regla 8)
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
    .cnt-imgpdf-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
        width: 100%;
        max-width: 100%;
    }

    .cnt-imgpdf-sidebar {
        height: 580px;
        max-height: 580px;
        position: relative;
        top: 0;
        overflow: hidden;
        min-width: 0;
        max-width: 100%;
    }

    .cnt-imgpdf-workspace {
        min-height: 540px;
        height: 580px;
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .cnt-imgpdf-toolbar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.45rem;
        padding: 0.55rem 0.75rem;
        height: auto;
    }
    .cnt-imgpdf-toolbar-left,
    .cnt-imgpdf-toolbar-center,
    .cnt-imgpdf-toolbar-right {
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .cnt-imgpdf-bottom-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem 0.85rem;
    }

    .cnt-imgpdf-bottom-bar .cnt-info-pill {
        flex: 1 1 100%;
        white-space: normal;
        text-align: center;
        justify-content: center;
    }

    .cnt-imgpdf-bottom-bar .cnt-bottom-actions {
        flex-direction: column;
        width: 100%;
    }

    .cnt-imgpdf-bottom-bar .cnt-btn-download-primary {
        width: 100%;
        justify-content: center;
        white-space: normal;
        text-align: center;
    }

    .cnt-imgpdf-pagesize-grid {
        grid-template-columns: 1fr;
    }
}
