/* ═══════════════════════════════════════════════════════════════════
   COLORNITIDO TOOLS — MARCOS PARA FOTOS Y DISEÑOS CON FONDO TRANSPARENTE
   Estilos Encapsulados, Modo Oscuro Neón & Identidad Visual de la Suite
   ═══════════════════════════════════════════════════════════════════ */

: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-amber: #f59e0b;
    --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 y Reserva de Header de Blocksy ─── */
.cnt-tool-page .cnt-wrap#cnt-marcos-para-fotos,
.cnt-marcos-wrap#cnt-marcos-para-fotos,
#cnt-marcos-para-fotos {
    position: relative;
    width: 100%;
    max-width: none !important;
    color: var(--cnt-text-primary);
    box-sizing: border-box;
    padding-top: clamp(8.5rem, 13vw, 11rem) !important;
    padding-bottom: 5rem;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#cnt-marcos-para-fotos * {
    box-sizing: border-box;
}

/* ─── Resplandor ambiental de fondo ─── */
.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 Centrado de la Suite ─── */
.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-header-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cnt-tool-icon-emerald {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(0, 194, 255, 0.25), rgba(2, 132, 199, 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-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-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cnt-emerald-bright);
    box-shadow: 0 0 8px var(--cnt-emerald-bright);
}

.cnt-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1.25;
    margin: 0 0 0.55rem;
    padding: 0.05em 0 0.22em;
    letter-spacing: -.03em;
    background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    overflow: visible;
}

.cnt-subtitle {
    font-size: 1rem;
    color: #71717a;
    margin: 0 auto;
    max-width: 640px;
    line-height: 1.7;
    text-align: center;
}

/* ─── Layout Principal (2 Columnas Idéntico a la Suite) ─── */
.cnt-marcos-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: var(--theme-container-width, min(100%, 90vw));
    max-width: var(--theme-normal-container-max-width, 1290px);
    margin: 2rem auto 0;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    min-width: 0;
}

@media (min-width: 1024px) {
    .cnt-marcos-layout {
        grid-template-columns: 380px minmax(0, 1fr);
        align-items: start;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   COLUMNA IZQUIERDA: CONTROLES CON SCROLL INTERNO Y BOTÓN FIJO (Regla #6)
   ═══════════════════════════════════════════════════════════════════ */

.cnt-sidebar-controls {
    display: flex;
    flex-direction: column;
    background: var(--cnt-bg-surface);
    border: 1px solid var(--cnt-border-subtle);
    border-radius: 1.5rem;
    padding: 1.25rem 1.15rem 1.15rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .cnt-sidebar-controls {
        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;
    }
    .cnt-main-workspace {
        height: calc(100vh - clamp(7.5rem, 11vw, 9.5rem));
        max-height: calc(100vh - clamp(7.5rem, 11vw, 9.5rem));
        min-height: 580px;
    }
    .cnt-canvas-viewport {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        max-height: none;
    }
}

@media (max-width: 1023px) {
    .cnt-sidebar-controls {
        position: relative;
        top: 0;
        height: 580px;
        max-height: 580px;
    }
    .cnt-main-workspace {
        height: 580px;
        max-height: 580px;
        min-height: 500px;
    }
}

/* Contenedor con Scroll Interno */
.cnt-sidebar-scroll-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    padding-right: 0.45rem;
    margin-right: -0.2rem;
    min-height: 0;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 194, 255, 0.35) rgba(0, 0, 0, 0.25);
}

/* Scrollbar estilizada */
.cnt-sidebar-scroll-body::-webkit-scrollbar {
    width: 6px;
}
.cnt-sidebar-scroll-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 999px;
}
.cnt-sidebar-scroll-body::-webkit-scrollbar-thumb {
    background: rgba(0, 194, 255, 0.35);
    border-radius: 999px;
    transition: background 0.2s;
}
.cnt-sidebar-scroll-body::-webkit-scrollbar-thumb:hover {
    background: var(--cnt-emerald-bright);
}

/* Tarjetas de Control Estándar */
.cnt-control-card {
    background: var(--cnt-bg-card);
    border: 1px solid var(--cnt-border-subtle);
    border-radius: 1rem;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.2s;
}

.cnt-control-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.cnt-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.65rem;
}

.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-card-step i {
    font-size: 0.7rem;
}

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

.cnt-badge-mini {
    font-size: 10px;
    font-weight: 700;
    background: rgba(0, 194, 255, 0.15);
    border: 1px solid rgba(0, 194, 255, 0.3);
    color: var(--cnt-emerald-bright);
    padding: 2px 7px;
    border-radius: 6px;
}

.cnt-btn-text-reset {
    background: none;
    border: none;
    color: var(--cnt-text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
    transition: color 0.15s;
}

.cnt-btn-text-reset:hover {
    color: var(--cnt-emerald-bright);
}

/* ─── 1. Dropzone Estándar de la Suite ─── */
.cnt-dropzone {
    border: 2px dashed rgba(0, 194, 255, 0.35);
    border-radius: 0.9rem;
    background: rgba(14, 20, 32, 0.6);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.cnt-dropzone:hover,
.cnt-dropzone.dragover {
    border-color: var(--cnt-emerald-bright);
    background: rgba(0, 194, 255, 0.06);
    transform: translateY(-1px);
}

.cnt-file-input {
    display: none;
}

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

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

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

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

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

/* Spinner en Dropzone */
.cnt-dropzone-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
    user-select: none;
}

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

.cnt-dropzone-loading-sub {
    font-size: 0.74rem;
    color: var(--cnt-text-secondary);
}
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

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

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

/* Tarjeta de Archivo Cargado */
.cnt-file-info-card {
    background: rgba(14, 20, 32, 0.85);
    border: 1px solid var(--cnt-border-subtle);
    border-radius: 0.85rem;
    padding: 0.75rem;
}

.cnt-file-info-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cnt-file-thumb {
    width: 46px;
    height: 46px;
    border-radius: 0.55rem;
    background: #000;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cnt-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cnt-file-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cnt-file-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cnt-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cnt-item-tags-row {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.cnt-pill-tag {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.06);
    color: var(--cnt-text-secondary);
}

.cnt-pill-dpi-ok {
    background: rgba(0, 194, 255, 0.15);
    color: var(--cnt-emerald-bright);
}

.cnt-file-actions-btn-group {
    display: flex;
    gap: 0.3rem;
}

.cnt-btn-icon-action {
    width: 30px;
    height: 30px;
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--cnt-border-subtle);
    color: var(--cnt-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.cnt-btn-icon-action:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

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

/* ─── 2. Galería de Marcos Grunge / Manchas ─── */
.cnt-marcos-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: rgba(0, 0, 0, 0.35);
    padding: 4px;
    border-radius: 0.6rem;
    border: 1px solid var(--cnt-border-subtle);
}

.cnt-tab-btn {
    flex: 1 1 calc(50% - 4px);
    background: none;
    border: none;
    color: var(--cnt-text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 6px;
    border-radius: 0.45rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.cnt-tab-btn[data-frame-cat="all"] {
    flex: 1 1 100%;
}

.cnt-tab-btn.active {
    background: var(--cnt-emerald);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--cnt-emerald-glow);
}

/* Contenedor del Carrusel / Scroll Lateral de Marcos */
.cnt-marcos-carousel-container {
    position: relative;
    width: 100%;
    margin: 0.6rem 0 0.4rem;
}

.cnt-marcos-presets-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 20px 8px 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 194, 255, 0.45) rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

.cnt-marcos-presets-grid::-webkit-scrollbar {
    height: 5px;
}

.cnt-marcos-presets-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 999px;
}

.cnt-marcos-presets-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 194, 255, 0.4);
    border-radius: 999px;
}

.cnt-marcos-presets-grid::-webkit-scrollbar-thumb:hover {
    background: var(--cnt-emerald-bright);
    box-shadow: 0 0 10px rgba(0, 194, 255, 0.6);
}

.cnt-preset-item {
    flex: 0 0 88px;
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    background: rgba(14, 20, 32, 0.9);
    border: 1.5px solid var(--cnt-border-subtle);
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
    scroll-snap-align: start;
    user-select: none;
    box-sizing: border-box;
}

.cnt-preset-item:hover {
    border-color: rgba(0, 194, 255, 0.6);
    background: rgba(0, 194, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 194, 255, 0.2);
}

.cnt-preset-item.active {
    border-color: var(--cnt-emerald-bright);
    background: rgba(0, 194, 255, 0.16);
    box-shadow: 0 0 14px var(--cnt-emerald-glow);
    transform: translateY(-2px);
}

.cnt-preset-thumb-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #000000;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: 
        linear-gradient(45deg, #111827 25%, transparent 25%), 
        linear-gradient(-45deg, #111827 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #111827 75%), 
        linear-gradient(-45deg, transparent 75%, #111827 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cnt-preset-thumb-wrap img {
    width: 88%;
    height: 88%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.cnt-preset-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--cnt-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.2;
}

.cnt-preset-item.active .cnt-preset-label {
    color: var(--cnt-emerald-bright);
    font-weight: 700;
}

/* Botones de navegación del scroll lateral */
.cnt-marcos-carousel-btn {
    position: absolute;
    top: calc(50% - 6px);
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(0, 194, 255, 0.4);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    opacity: 0.85;
}

.cnt-marcos-carousel-btn:hover {
    background: var(--cnt-emerald-bright);
    color: #07090e;
    opacity: 1;
    transform: translateY(-50%) scale(1.12);
    box-shadow: 0 0 14px rgba(0, 194, 255, 0.7);
}

.cnt-marcos-prev {
    left: 0;
}

.cnt-marcos-next {
    right: 0;
}

.cnt-btn-outline-dashed {
    width: 100%;
    padding: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: none;
    color: var(--cnt-text-secondary);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cnt-btn-outline-dashed:hover {
    border-color: var(--cnt-emerald-bright);
    color: #fff;
    background: rgba(0, 194, 255, 0.08);
}

/* ─── Sliders y Controles de Ajuste ─── */
.cnt-slider-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cnt-slider-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--cnt-text-secondary);
}

.cnt-slider-val {
    color: var(--cnt-emerald-bright);
    font-weight: 700;
}

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

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

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

.cnt-slider-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Checkbox Personalizado */
.cnt-checkbox-control {
    display: flex;
    align-items: center;
}

.cnt-custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--cnt-text-secondary);
    cursor: pointer;
    user-select: none;
}

.cnt-custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.cnt-checkmark {
    width: 16px;
    height: 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--cnt-border-subtle);
    border-radius: 4px;
    display: inline-block;
    position: relative;
    transition: all 0.15s;
}

.cnt-custom-checkbox input:checked ~ .cnt-checkmark {
    background: var(--cnt-emerald-bright);
    border-color: var(--cnt-emerald-bright);
}

.cnt-custom-checkbox input:checked ~ .cnt-checkmark::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ─── 3. Ajuste y Encuadre ─── */
.cnt-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cnt-field-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--cnt-text-secondary);
}

.cnt-fit-modes-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.cnt-fit-btn {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--cnt-border-subtle);
    color: var(--cnt-text-secondary);
    padding: 7px 4px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

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

.cnt-fit-btn.active {
    background: rgba(0, 194, 255, 0.15);
    border-color: var(--cnt-emerald-bright);
    color: var(--cnt-emerald-bright);
}

.cnt-transform-actions-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.cnt-btn-subtool {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--cnt-border-subtle);
    color: var(--cnt-text-secondary);
    padding: 6px 2px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.cnt-btn-subtool:hover {
    border-color: rgba(0, 194, 255, 0.4);
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

/* ─── 4. Retoque Fotográfico ─── */
.cnt-quick-filters-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.cnt-quick-filter-btn {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--cnt-border-subtle);
    color: var(--cnt-text-secondary);
    padding: 5px 2px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

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

.cnt-quick-filter-btn.active {
    background: rgba(0, 194, 255, 0.15);
    border-color: var(--cnt-emerald-bright);
    color: var(--cnt-emerald-bright);
}

/* ─── Pie Fijo Inferior con Botón Principal (Regla #6) ─── */
.cnt-sidebar-footer {
    flex-shrink: 0;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    bottom: 0;
    background: var(--cnt-bg-surface);
    z-index: 20;
}

/* Contenedor Unificado Split Button */
.cnt-download-split-btn {
    display: flex;
    align-items: stretch;
    width: 100%;
    position: relative;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #00b4d8 0%, #0284c7 45%, #6366f1 100%);
    box-shadow: 0 4px 18px -2px rgba(2, 132, 199, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.22);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), background 0.28s ease;
    box-sizing: border-box;
    overflow: visible;
}

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

.cnt-download-split-btn:has(button:disabled) {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none !important;
    transform: none !important;
}

.cnt-download-split-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3);
}

.cnt-btn-download-primary:disabled,
.cnt-btn-download-dropdown-toggle:disabled {
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Botón Principal (Acción Primaria) */
.cnt-btn-download-primary {
    flex: 1 1 auto;
    background: transparent !important;
    color: #ffffff !important;
    border: none !important;
    outline: none !important;
    padding: 0.85rem 1.1rem;
    font-size: 0.86rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: -0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: 0.65rem 0 0 0.65rem !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    transition: background 0.2s ease;
    box-sizing: border-box;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    margin: 0;
    line-height: 1.25;
}

.cnt-btn-download-primary:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    transform: none !important;
    box-shadow: none !important;
}

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

/* Botón Toggle Dropdown (Derecha) */
.cnt-btn-download-dropdown-toggle {
    flex: 0 0 auto;
    width: 44px;
    min-width: 44px;
    background: rgba(0, 0, 0, 0.1) !important;
    color: #ffffff !important;
    border: none !important;
    outline: none !important;
    border-left: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15) !important;
    border-radius: 0 0.65rem 0.65rem 0 !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
    margin: 0;
}

.cnt-btn-download-dropdown-toggle:hover {
    background: rgba(0, 0, 0, 0.25) !important;
    color: #ffffff !important;
}

.cnt-btn-download-dropdown-toggle.active {
    background: rgba(0, 0, 0, 0.35) !important;
}

.cnt-btn-download-dropdown-toggle i {
    display: inline-block;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cnt-btn-download-dropdown-toggle.active i {
    transform: rotate(180deg);
}

/* Menú Dropdown de Descarga con Estética Glassmorphism */
.cnt-download-menu {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    left: auto;
    width: 290px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.85rem;
    padding: 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(0, 194, 255, 0.25);
    z-index: 999;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: cntMenuSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cnt-menu-item:hover {
    background: rgba(0, 194, 255, 0.12);
    transform: translateX(2px);
}

@keyframes cntMenuSlideUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cnt-menu-item {
    background: transparent;
    border: none;
    border-radius: 0.55rem;
    padding: 0.65rem 0.8rem;
    color: var(--cnt-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    transition: background 0.15s, transform 0.15s;
}

.cnt-menu-item i {
    font-size: 1.05rem;
    flex-shrink: 0;
}

.cnt-menu-item div {
    display: flex;
    flex-direction: column;
}

.cnt-menu-item strong {
    font-size: 0.8rem;
    color: #ffffff;
    font-weight: 700;
}

.cnt-menu-item span {
    font-size: 0.68rem;
    color: var(--cnt-text-secondary);
    margin-top: 1px;
}

/* ═══════════════════════════════════════════════════════════════════
   COLUMNA DERECHA: LIENZO INTERACTIVO Y VISOR
   ═══════════════════════════════════════════════════════════════════ */

.cnt-main-workspace {
    display: flex;
    flex-direction: column;
    background: var(--cnt-bg-surface);
    border: 1px solid var(--cnt-border-subtle);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    min-height: 560px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

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

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

.cnt-pill-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    background: rgba(0, 194, 255, 0.12);
    border: 1px solid rgba(0, 194, 255, 0.3);
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--cnt-emerald-bright);
    white-space: nowrap;
}

.cnt-dot-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cnt-emerald-bright);
    box-shadow: 0 0 6px var(--cnt-emerald-bright);
}

.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);
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.cnt-toggle-btn:hover,
.cnt-toggle-btn.active {
    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);
}

/* Controles de Zoom */
.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 {
    background: transparent;
    border: none;
    color: var(--cnt-text-secondary);
    width: 30px;
    height: 28px;
    border-radius: 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.15s;
}

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

.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;
}

/* ─── Viewport del Lienzo con Ajedrezado de Transparencia ─── */
/* Viewport (Reglas 8 y 9 GEMINI.md) */
.cnt-canvas-viewport {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    position: relative;
    background: #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;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    min-width: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Estado Inicial Vacío Estandarizado */
.cnt-viewport-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 2rem;
    text-align: center;
}

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

.cnt-placeholder-icon-emerald {
    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: var(--cnt-text-primary);
    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;
    background: rgba(0, 194, 255, 0.15);
    color: var(--cnt-emerald-bright) !important;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 194, 255, 0.4);
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 0.5rem;
}

.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);
}

.cnt-placeholder-samples {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.8rem;
    width: 100%;
}

.cnt-samples-prompt {
    font-size: 0.72rem;
    color: var(--cnt-text-muted);
}

.cnt-placeholder-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.cnt-sample-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--cnt-border-subtle);
    color: var(--cnt-text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.cnt-sample-chip:hover {
    border-color: var(--cnt-emerald-bright);
    background: rgba(0, 194, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}

/* Stage del Canvas */
.cnt-marcos-canvas-stage {
    position: relative;
    transform-origin: center center;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8);
    cursor: grab;
}

.cnt-marcos-canvas-stage:active {
    cursor: grabbing;
}

.cnt-marcos-canvas {
    display: block;
    max-width: none;
}

/* Guías de Centrado */
.cnt-marcos-guides-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cnt-guide-v {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: rgba(0, 194, 255, 0.6);
    box-shadow: 0 0 4px var(--cnt-emerald-bright);
}

.cnt-guide-h {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(0, 194, 255, 0.6);
    box-shadow: 0 0 4px var(--cnt-emerald-bright);
}

/* Hint flotante */
.cnt-marcos-drag-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(14, 20, 32, 0.85);
    border: 1px solid var(--cnt-border-subtle);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: var(--cnt-text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(8px);
}

/* Spinner sobre viewport */
.cnt-marcos-viewport-spinner {
    position: absolute;
    inset: 0;
    background: rgba(6, 9, 14, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 50;
    color: var(--cnt-emerald-bright);
    font-size: 12px;
    font-weight: 700;
}

/* ─── Barra Inferior de Métricas & Descarga (Reglas 6, 9 y 10 GEMINI.md) ─── */
.cnt-marcos-wrap .cnt-bottom-bar,
.cnt-marcos-statusbar {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0.75rem 1.15rem 0.85rem;
    gap: 0.65rem;
    background: rgba(10, 15, 28, 0.92);
    border-top: 1px solid var(--cnt-border-subtle);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10;
    flex-shrink: 0;
    box-sizing: border-box;
}

.cnt-marcos-wrap .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-marcos-wrap .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-marcos-wrap .cnt-info-pill i {
    color: var(--cnt-emerald-bright, #00c2ff);
    font-size: 0.75rem;
}

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

.cnt-marcos-wrap .cnt-info-pill strong {
    color: #f8fafc;
    font-weight: 700;
}

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

.cnt-marcos-wrap .cnt-info-pill-accent strong,
.cnt-marcos-wrap .cnt-info-pill-accent span,
.cnt-marcos-wrap .cnt-info-pill-accent i {
    color: #00c2ff;
}

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

.cnt-marcos-wrap .cnt-download-split-btn {
    width: auto;
    min-width: 280px;
    max-width: 360px;
}

.cnt-marcos-wrap .cnt-bottom-bar button:disabled,
.cnt-marcos-wrap .cnt-btn-download-primary:disabled,
.cnt-marcos-wrap .cnt-btn-download-dropdown-toggle:disabled {
    opacity: 0.42 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

@media (max-width: 1023px) {
    .cnt-marcos-wrap .cnt-studio-layout {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
    }
    .cnt-marcos-wrap .cnt-sidebar-controls,
    .cnt-marcos-wrap .cnt-main-workspace {
        min-width: 0;
        max-width: 100%;
    }
}

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

@media (max-width: 640px) {
    .cnt-marcos-wrap .cnt-bottom-bar {
        padding: 0.75rem 0.85rem;
    }
    .cnt-marcos-wrap .cnt-bottom-actions {
        flex-direction: column;
        width: 100%;
    }
    .cnt-marcos-wrap .cnt-download-split-btn {
        width: 100%;
        min-width: 0;
        max-width: none;
    }
    .cnt-marcos-wrap .cnt-btn-download-primary {
        width: 100%;
        justify-content: center;
        white-space: normal;
        text-align: center;
    }
    .cnt-marcos-wrap .cnt-download-menu {
        max-width: calc(100vw - 2.5rem);
        right: 0;
        left: auto;
        box-sizing: border-box;
    }
    .cnt-marcos-wrap .cnt-info-pill {
        flex: 1 1 100%;
        justify-content: center;
        white-space: normal;
        text-align: center;
    }
    .cnt-marcos-drag-hint {
        max-width: calc(100% - 24px);
        white-space: normal;
        text-align: center;
    }
}

/* Utilidades de texto y colores */
.text-green { color: var(--cnt-emerald-bright); }
.text-amber { color: var(--cnt-amber); }
.text-cyan { color: var(--cnt-cyan-bright); }
.text-purple { color: #a855f7; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
