/* ═══════════════════════════════════════════════════════════════════
   COLORNITIDO TOOLS — RECORTAR IMAGEN
   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-crop-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-crop-wrap,
#cnt-recortar-imagen {
    padding-top: clamp(8.5rem, 13vw, 11rem) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 3rem;
}

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

.cnt-crop-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-crop-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-crop-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-crop-wrap .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: -0.03em;
    background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    overflow: visible;
}

.cnt-crop-wrap .cnt-subtitle {
    font-size: 1rem;
    color: var(--cnt-text-secondary);
    margin: 0 auto;
    max-width: 640px;
    line-height: 1.7;
}

/* ─── Layout Principal de 2 Columnas ─── */
.cnt-crop-wrap .cnt-crop-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;
}

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

/* ─── Barra Lateral de Controles (Regla 8: Sticky + Altura Unificada) ─── */
.cnt-crop-wrap .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;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .cnt-crop-wrap .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-crop-wrap .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;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .cnt-crop-wrap .cnt-canvas-viewport {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        max-height: none;
    }
}

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

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

.cnt-crop-wrap .cnt-sidebar-scroll-body::-webkit-scrollbar {
    width: 6px;
}
.cnt-crop-wrap .cnt-sidebar-scroll-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}
.cnt-crop-wrap .cnt-sidebar-scroll-body::-webkit-scrollbar-thumb {
    background: rgba(0, 194, 255, 0.35);
    border-radius: 4px;
}
.cnt-crop-wrap .cnt-sidebar-scroll-body::-webkit-scrollbar-thumb:hover {
    background: #00c2ff;
}

/* ─── Tarjetas de Control (Regla 12: Numeración Estándar) ─── */
.cnt-crop-wrap .cnt-control-card {
    background: var(--cnt-bg-card);
    border: 1px solid var(--cnt-border-subtle);
    border-radius: 1rem;
    padding: 1rem 1.05rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

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

.cnt-crop-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-crop-wrap .cnt-card-header h3 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--cnt-text-primary);
    margin: 0;
    flex: 1;
}

/* ─── Dropzone de Subida (Regla 5: Spinner visual obligatorio) ─── */
.cnt-crop-wrap .cnt-dropzone {
    position: relative;
    border: 2px dashed rgba(0, 194, 255, 0.3);
    border-radius: 0.85rem;
    background: rgba(15, 23, 42, 0.45);
    padding: 1.25rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

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

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

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

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

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

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

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

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

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

.cnt-crop-wrap .cnt-dropzone-loading-sub {
    font-size: 0.74rem;
    color: var(--cnt-text-secondary);
}

.cnt-crop-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: cntCropSpin 0.8s linear infinite;
}

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

/* Tarjeta de Archivo Cargado */
.cnt-crop-wrap .cnt-file-info-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(0, 194, 255, 0.25);
    border-radius: 0.75rem;
    padding: 0.65rem 0.75rem;
    box-sizing: border-box;
}

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

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

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

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

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

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

.cnt-crop-wrap .cnt-pill-tag {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
    font-weight: 600;
}

.cnt-crop-wrap .cnt-pill-size {
    background: rgba(255, 255, 255, 0.08);
    color: var(--cnt-text-secondary);
}

.cnt-crop-wrap .cnt-pill-dpi-ok {
    background: rgba(0, 194, 255, 0.15);
    color: var(--cnt-emerald-bright);
    border: 1px solid rgba(0, 194, 255, 0.3);
}

.cnt-crop-wrap .cnt-file-actions-btn-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

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

.cnt-crop-wrap .cnt-btn-icon-action:hover {
    background: rgba(0, 194, 255, 0.2);
    color: var(--cnt-emerald-bright);
    border-color: rgba(0, 194, 255, 0.4);
}

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

/* ─── Grid de Proporciones de Aspecto ─── */
.cnt-crop-wrap .cnt-aspect-ratio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
}

.cnt-crop-wrap .cnt-ratio-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.65rem;
    padding: 0.45rem 0.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--cnt-text-secondary);
}

.cnt-crop-wrap .cnt-ratio-btn strong {
    font-size: 0.8rem;
    color: var(--cnt-text-primary);
}

.cnt-crop-wrap .cnt-ratio-btn span {
    font-size: 0.65rem;
    color: var(--cnt-text-muted);
}

.cnt-crop-wrap .cnt-ratio-btn:hover {
    border-color: rgba(0, 194, 255, 0.35);
    background: rgba(0, 194, 255, 0.08);
    color: var(--cnt-emerald-bright);
}

.cnt-crop-wrap .cnt-ratio-btn.active {
    background: linear-gradient(135deg, rgba(0, 194, 255, 0.18), rgba(99, 102, 241, 0.18));
    border-color: var(--cnt-emerald-bright);
    box-shadow: 0 0 12px rgba(0, 194, 255, 0.25);
    color: #fff;
}

.cnt-crop-wrap .cnt-ratio-btn.active strong {
    color: var(--cnt-emerald-bright);
}

/* ─── Switch / Toggles ─── */
.cnt-crop-wrap .cnt-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.2rem;
}

.cnt-crop-wrap .cnt-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.cnt-crop-wrap .cnt-toggle-text strong {
    font-size: 0.8rem;
    color: var(--cnt-text-primary);
}

.cnt-crop-wrap .cnt-toggle-text span {
    font-size: 0.68rem;
    color: var(--cnt-text-muted);
}

.cnt-crop-wrap .cnt-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
}

.cnt-crop-wrap .cnt-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cnt-crop-wrap .cnt-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cnt-crop-wrap .cnt-switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.cnt-crop-wrap .cnt-switch input:checked + .cnt-switch-slider {
    background-color: #0284c7;
    border-color: var(--cnt-emerald-bright);
    box-shadow: 0 0 10px rgba(0, 194, 255, 0.5);
}

.cnt-crop-wrap .cnt-switch input:checked + .cnt-switch-slider:before {
    transform: translateX(16px);
    background-color: #ffffff;
}

/* ─── Inputs de Coordenadas Numéricas (px) ─── */
.cnt-crop-wrap .cnt-inputs-2col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.cnt-crop-wrap .cnt-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.cnt-crop-wrap .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-crop-wrap .cnt-input-group label i {
    color: var(--cnt-emerald-bright);
    font-size: 0.68rem;
}

.cnt-crop-wrap .cnt-number-input {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.65rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    outline: none;
    box-sizing: border-box;
    width: 100%;
    transition: all 0.2s ease;
}

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

.cnt-crop-wrap .cnt-quick-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.cnt-crop-wrap .cnt-btn-subaction {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.65rem;
    padding: 0.45rem 0.5rem;
    color: var(--cnt-text-secondary);
    font-size: 0.74rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cnt-crop-wrap .cnt-btn-subaction:hover {
    background: rgba(0, 194, 255, 0.12);
    border-color: rgba(0, 194, 255, 0.3);
    color: var(--cnt-emerald-bright);
}

/* ─── Selector de Formato & Calidad ─── */
.cnt-crop-wrap .cnt-format-selector-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
}

.cnt-crop-wrap .cnt-selector-pill {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.65rem;
    padding: 0.5rem 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cnt-crop-wrap .cnt-selector-pill strong {
    font-size: 0.84rem;
    color: var(--cnt-text-primary);
}

.cnt-crop-wrap .cnt-selector-pill span {
    font-size: 0.65rem;
    color: var(--cnt-text-muted);
}

.cnt-crop-wrap .cnt-selector-pill:hover {
    border-color: rgba(0, 194, 255, 0.35);
    background: rgba(0, 194, 255, 0.08);
}

.cnt-crop-wrap .cnt-selector-pill.active {
    background: linear-gradient(135deg, rgba(0, 194, 255, 0.18), rgba(99, 102, 241, 0.18));
    border-color: var(--cnt-emerald-bright);
    box-shadow: 0 0 12px rgba(0, 194, 255, 0.25);
}

.cnt-crop-wrap .cnt-selector-pill.active strong {
    color: var(--cnt-emerald-bright);
}

/* Sliders */
.cnt-crop-wrap .cnt-slider-control {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cnt-crop-wrap .cnt-slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    color: var(--cnt-text-secondary);
}

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

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

.cnt-crop-wrap .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 rgba(0, 194, 255, 0.7);
    cursor: pointer;
    border: 2px solid #ffffff;
}

.cnt-crop-wrap .cnt-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--cnt-emerald-bright);
    box-shadow: 0 0 10px rgba(0, 194, 255, 0.7);
    cursor: pointer;
    border: 2px solid #ffffff;
}

.cnt-crop-wrap .cnt-color-chips-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

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

.cnt-crop-wrap .cnt-chip-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cnt-crop-wrap .cnt-color-chip.active {
    border-color: var(--cnt-emerald-bright);
    background: rgba(0, 194, 255, 0.12);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════
   ÁREA PRINCIPAL / WORKSPACE / VISOR
   ═══════════════════════════════════════════════════════════════════ */

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

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

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

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

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

.cnt-crop-wrap .cnt-btn-tool:hover {
    color: var(--cnt-text-primary);
}

.cnt-crop-wrap .cnt-btn-tool.active {
    background: linear-gradient(135deg, rgba(0, 194, 255, 0.25) 0%, rgba(2, 132, 199, 0.45) 100%);
    color: #ffffff;
    border-color: rgba(0, 194, 255, 0.5);
    box-shadow: 0 2px 10px rgba(0, 194, 255, 0.2);
}

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

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

.cnt-crop-wrap .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-crop-wrap .cnt-zoom-divider {
    width: 1px;
    height: 16px;
    background: var(--cnt-border-subtle);
    margin: 0 0.15rem;
}

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

/* ─── Lienzo / Viewport Interactivo (Ajedrezado Oficial) ─── */
.cnt-crop-wrap .cnt-canvas-viewport {
    position: relative;
    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;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

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

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

.cnt-crop-wrap .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-crop-wrap .cnt-placeholder-content h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--cnt-text-primary);
    margin: 0;
}

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

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

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

/* Overlay de Procesamiento (Regla 5) */
.cnt-crop-wrap .cnt-processing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 9, 14, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.cnt-crop-wrap .cnt-processing-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(0, 194, 255, 0.35);
    border-radius: 1.25rem;
    padding: 2rem 2.5rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 194, 255, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.cnt-crop-wrap .cnt-processing-spinner {
    width: 44px;
    height: 44px;
    border: 3.5px solid rgba(0, 194, 255, 0.2);
    border-top-color: var(--cnt-emerald-bright);
    border-radius: 50%;
    animation: cnt-crop-spin 0.8s linear infinite;
}

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

.cnt-crop-wrap .cnt-processing-card h4 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

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

/* ─── Escenario de Recorte (Stage) ─── */
.cnt-crop-wrap .cnt-crop-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
}

.cnt-crop-wrap .cnt-crop-stage.is-panning {
    cursor: grabbing;
}

.cnt-crop-wrap .cnt-crop-zoom-container {
    position: relative;
    transform-origin: center center;
    transition: transform 0.05s ease-out;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    display: block;
}

.cnt-crop-wrap #cnt-crop-base-canvas {
    display: block;
    max-width: none;
    max-height: none;
    pointer-events: none;
}

/* Capa de Recorte Interactivo */
.cnt-crop-wrap .cnt-crop-overlay-layer {
    position: absolute;
    inset: 0;
    pointer-events: auto;
}

/* Máscaras Oscurecidas Exteriores */
.cnt-crop-wrap .cnt-crop-mask {
    position: absolute;
    background: rgba(0, 0, 0, 0.65);
    pointer-events: none;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

/* Recuadro de Recorte (Crop Box) */
.cnt-crop-wrap .cnt-crop-box {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid var(--cnt-emerald-bright);
    box-shadow: 0 0 12px rgba(0, 194, 255, 0.45), inset 0 0 10px rgba(0, 194, 255, 0.15);
    cursor: move;
    touch-action: none;
}

/* Badge Flotante de Medidas */
.cnt-crop-wrap .cnt-crop-box-badge {
    position: absolute;
    top: -28px;
    left: 0;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(0, 194, 255, 0.4);
    color: var(--cnt-emerald-bright);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 0.45rem;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.03em;
}

/* Rejilla de Regla de Tercios */
.cnt-crop-wrap .cnt-crop-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cnt-crop-wrap .cnt-crop-grid-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
}

.cnt-crop-wrap .cnt-grid-h1 {
    top: 33.333%;
    left: 0;
    right: 0;
    height: 1px;
}

.cnt-crop-wrap .cnt-grid-h2 {
    top: 66.666%;
    left: 0;
    right: 0;
    height: 1px;
}

.cnt-crop-wrap .cnt-grid-v1 {
    left: 33.333%;
    top: 0;
    bottom: 0;
    width: 1px;
}

.cnt-crop-wrap .cnt-grid-v2 {
    left: 66.666%;
    top: 0;
    bottom: 0;
    width: 1px;
}

/* Tiradores (Handles) */
.cnt-crop-wrap .cnt-crop-handle {
    position: absolute;
    box-sizing: border-box;
    touch-action: none;
    z-index: 10;
}

/* Esquinas */
.cnt-crop-wrap .cnt-crop-handle.handle-nw,
.cnt-crop-wrap .cnt-crop-handle.handle-ne,
.cnt-crop-wrap .cnt-crop-handle.handle-se,
.cnt-crop-wrap .cnt-crop-handle.handle-sw {
    width: 14px;
    height: 14px;
    background: #0f172a;
    border: 2.5px solid var(--cnt-emerald-bright);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 194, 255, 0.8);
    transition: transform 0.15s ease, background 0.15s ease;
}

.cnt-crop-wrap .cnt-crop-handle.handle-nw:hover,
.cnt-crop-wrap .cnt-crop-handle.handle-ne:hover,
.cnt-crop-wrap .cnt-crop-handle.handle-se:hover,
.cnt-crop-wrap .cnt-crop-handle.handle-sw:hover {
    transform: scale(1.3);
    background: var(--cnt-emerald-bright);
}

.cnt-crop-wrap .cnt-crop-handle.handle-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.cnt-crop-wrap .cnt-crop-handle.handle-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.cnt-crop-wrap .cnt-crop-handle.handle-se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.cnt-crop-wrap .cnt-crop-handle.handle-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }

/* Bordes */
.cnt-crop-wrap .cnt-crop-handle.handle-n,
.cnt-crop-wrap .cnt-crop-handle.handle-s {
    height: 6px;
    width: 26px;
    background: var(--cnt-emerald-bright);
    border-radius: 999px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 6px rgba(0, 194, 255, 0.7);
    cursor: ns-resize;
}

.cnt-crop-wrap .cnt-crop-handle.handle-n { top: -3px; }
.cnt-crop-wrap .cnt-crop-handle.handle-s { bottom: -3px; }

.cnt-crop-wrap .cnt-crop-handle.handle-e,
.cnt-crop-wrap .cnt-crop-handle.handle-w {
    width: 6px;
    height: 26px;
    background: var(--cnt-emerald-bright);
    border-radius: 999px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 6px rgba(0, 194, 255, 0.7);
    cursor: ew-resize;
}

.cnt-crop-wrap .cnt-crop-handle.handle-w { left: -3px; }
.cnt-crop-wrap .cnt-crop-handle.handle-e { right: -3px; }

/* ═══════════════════════════════════════════════════════════════════
   BARRA INFERIOR DE ACCIONES Y DESCARGA (Reglas 6, 9 y 10)
   ═══════════════════════════════════════════════════════════════════ */

.cnt-crop-wrap .cnt-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);
    z-index: 20;
    gap: 0.65rem;
    flex-shrink: 0;
    box-sizing: border-box;
}

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

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

.cnt-crop-wrap .cnt-info-pill strong {
    color: var(--cnt-text-primary);
    font-weight: 700;
}

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

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

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

/* Botón Principal de Descarga Oficial */
.cnt-crop-wrap .cnt-btn-download-primary {
    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;
    padding: 0.7rem 1.6rem;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    box-shadow: 0 4px 18px -2px rgba(2, 132, 199, 0.45);
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

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

/* Regla 10: Estados Desactivados Obligatorios (:disabled) */
.cnt-crop-wrap .cnt-btn-download-primary:disabled,
.cnt-crop-wrap button:disabled {
    opacity: 0.42 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ─── Responsivo Móvil / Tablet ─── */
@media (max-width: 1023px) {
    .cnt-crop-wrap .cnt-studio-layout {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
    }
    .cnt-crop-wrap .cnt-sidebar-controls,
    .cnt-crop-wrap .cnt-main-workspace {
        min-width: 0;
        max-width: 100%;
    }
}

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

@media (max-width: 767px) {
    .cnt-crop-wrap .cnt-aspect-ratio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .cnt-crop-wrap .cnt-bottom-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem 0.85rem;
    }
    .cnt-crop-wrap .cnt-bottom-info .cnt-info-pill {
        flex: 1 1 100%;
        white-space: normal;
        text-align: center;
        justify-content: center;
    }
    .cnt-crop-wrap .cnt-bottom-actions {
        width: 100%;
        flex-direction: column;
    }
    .cnt-crop-wrap .cnt-btn-download-primary {
        width: 100%;
        justify-content: center;
    }
}
