        /* 1. RESET Y VARIABLES GLOBALES */
        :root {
    --nu-primary: #7C3AED; 
    /* Morado elegante (acento) */

    --nu-primary-hover: #6D28D9;

    --nu-background: #F9FAFB; 
    /* Gris neutro limpio */

    --nu-surface: #FFFFFF;

    --nu-surface-dark: #F3F4F6; 
    /* Gris suave real, no violeta */

    --nu-border: #E5E7EB;

    --nu-text-primary: #111827; 
    /* Gris oscuro elegante */

    --nu-text-secondary: #6B7280;

    --nu-text-on-primary: #FFFFFF;

    --nu-white: #FFFFFF;
    --nu-black: #000000;

    --nu-success: #16A34A;
    --nu-warning: #F59E0B;
    --nu-danger: #DC2626;

    --font-family-sans: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --sidebar-width-expanded: 240px;
    --sidebar-width-collapsed: 68px;
    --right-sidebar-width: 60px;
    --mobile-nav-height: 60px;
}
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            font-size: 16px;
        }

        body {
            font-family: var(--font-family-sans);
            background-color: var(--nu-background);
            color: var(--nu-text-primary);
            display: flex;
            height: 100vh;
            overflow: hidden;
            line-height: 1.5;
        }

        button {
            font-family: var(--font-family-sans);
            cursor: pointer;
        }

        /* 2. LAYOUT PRINCIPAL (Sidebar Izquierdo, Contenido, Sidebar Derecho) */

        /* 2.1. Sidebar Izquierdo (Escritorio) */
        .nu-sidebar {
            width: var(--sidebar-width-expanded);
            height: 100vh;
            background-color: var(--nu-background);
            border-right: 1px solid var(--nu-border);
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            transition: width 0.3s ease;
            padding: 1.5rem 1rem;
            position: relative;
        }

        .nu-sidebar[data-collapsed="true"] {
            width: var(--sidebar-width-collapsed);
            min-width: var(--sidebar-width-collapsed);
            padding: 1.5rem 0.5rem;
            align-items: center;
            overflow: hidden;
        }
        .nu-sidebar:not([data-collapsed="true"]) {
            min-width: var(--sidebar-width-expanded);
        }

        .nu-sidebar-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            margin-bottom: 2rem;
        }

        .nu-sidebar-logo {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--nu-primary);
            white-space: nowrap;
        }

        .nu-sidebar[data-collapsed="true"] .nu-sidebar-logo {
            display: none;
        }

        .nu-sidebar-logo-collapsed {
            display: none;
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--nu-primary);
            letter-spacing: -0.05em;
        }

        .nu-sidebar[data-collapsed="true"] .nu-sidebar-logo-collapsed {
            display: none;
        }

        .nu-sidebar-toggle {
            background: none;
            border: 1px solid var(--nu-border);
            border-radius: 6px;
            color: var(--nu-text-secondary);
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.2s ease;
        }

        .nu-sidebar-toggle:hover {
            background-color: var(--nu-surface);
        }

        .nu-sidebar[data-collapsed="true"] .nu-sidebar-toggle {
            position: absolute;
            top: 1.5rem;
            left: 50%;
            transform: translateX(-50%);
            margin-bottom: 2rem;
        }

        .nu-sidebar[data-collapsed="true"] .nu-sidebar-nav {
            margin-top: 3rem;
        }

        .nu-sidebar-nav {
            flex-grow: 1;
            width: 100%;
        }

        .nu-nav-list {
            list-style: none;
            width: 100%;
        }

        .nu-nav-item {
            width: 100%;
        }

        .nu-nav-link {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
            border-radius: 8px;
            text-decoration: none;
            color: var(--nu-text-secondary);
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        .nu-sidebar[data-collapsed="true"] .nu-nav-link {
            justify-content: center;
            padding: 0.75rem;
        }

        .nu-nav-link:hover {
            background-color: var(--nu-surface);
            color: var(--nu-text-primary);
        }

        .nu-nav-link.active {
            background-color: var(--nu-primary);
            color: var(--nu-text-on-primary);
        }

        .nu-nav-icon {
            font-size: 1.1rem;
            width: 20px;
            text-align: center;
            flex-shrink: 0;
        }

        .nu-sidebar[data-collapsed="true"] .nu-nav-text {
            display: none;
        }

        .nu-sidebar-footer {
            width: 100%;
        }

        /* 2.2. Contenido Principal */
        .nu-main-content {
            flex-grow: 1;
            height: 100vh;
            overflow: hidden;
            position: relative;
            background-color: var(--nu-surface);
        }

        .nu-view {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            display: none;
            /* Oculto por defecto */
            flex-direction: column;
            overflow: hidden;
            /* El scroll va solo en #creation-view */
            min-height: 0;
        }

        .nu-view.active {
            display: flex;
            /* Visible */
        }

        /* 2.3. Sidebar Derecho (Resultados) */
        .nu-right-sidebar {
            width: var(--right-sidebar-width);
            height: 100vh;
            background-color: var(--nu-background);
            border-left: 1px solid var(--nu-border);
            flex-shrink: 0;
            padding: 1rem 0;
            display: none;
            /* Oculto por defecto */
            flex-direction: column;
            align-items: center;
            gap: 1rem;
        }

        .nu-right-sidebar-btn {
            background: none;
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 8px;
            color: var(--nu-text-secondary);
            font-size: 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.2s ease, color 0.2s ease;
            position: relative;
        }

        .nu-right-sidebar-btn:hover {
            background-color: var(--nu-surface);
            color: var(--nu-text-primary);
        }

        .nu-right-sidebar-btn[data-active="true"] {
            background-color: var(--nu-primary) !important;
            color: var(--nu-white) !important;
        }

        .nu-right-sidebar-btn[data-active="true"] i {
            color: var(--nu-white) !important;
        }

        /* Tooltip simple para la barra derecha */
        .nu-right-sidebar-btn::after {
            content: attr(data-tooltip);
            position: absolute;
            right: 110%;
            /* Lo empuja a la izquierda */
            left: auto;
            /* Anula la regla anterior */
            top: 50%;
            transform: translateY(-50%);
            background-color: var(--nu-black);
            color: var(--nu-white);
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.8rem;
            white-space: nowrap;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.2s ease;
            z-index: 10;
            pointer-events: none;
        }

        .nu-right-sidebar-btn:hover::after {
            opacity: 1;
            visibility: visible;
            transition-delay: 0.5s;
        }


        /* 2.4. Navegación Inferior (Móvil) */
        .nu-mobile-bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: var(--mobile-nav-height);
            background-color: var(--nu-background);
            border-top: 1px solid var(--nu-border);
            display: none;
            /* Oculto por defecto */
            align-items: stretch;
            justify-content: space-around;
            z-index: 100;
        }

        .nu-mobile-nav-link {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            flex-grow: 1;
            text-decoration: none;
            color: var(--nu-text-secondary);
            font-size: 0.7rem;
            gap: 0.25rem;
            transition: color 0.2s ease;
        }

        .nu-mobile-nav-link.active {
            color: var(--nu-primary);
        }

        .nu-mobile-nav-icon {
            font-size: 1.25rem;
        }


        /* 3. VISTA 1: CREACIÓN (#creation-view) */
        #creation-view {
            /*padding: 2rem; <-- Reemplaza esto */
            padding: 2rem 1rem;
            /* Ajuste para móvil */
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            /* Empuja todo hacia arriba */
            flex: 1;
            /* Ocupa el espacio disponible del .nu-view */
            min-height: 0;
            /* Necesario para que el scroll funcione en flex */
        }

        .creation-container {
            width: 100%;
            max-width: 800px;
            margin: 5vh auto 0 auto;
        }

        .creation-header {
            text-align: center;
            margin-bottom: 0.5rem;
        }

        .creation-header h1 {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
        }

        .creation-header p {
            font-size: 1rem;
            color: var(--nu-text-secondary);
        }

        #idea-prompts {
            text-align: center;
            color: var(--nu-text-secondary);
            margin-bottom: 0.5rem;
            height: 1.5em;
            /* Pre-asigna espacio */
            font-style: italic;
        }

        /* CTA WhatsApp: visible solo en móvil (se muestra en @media 768px) */
        .prompt-whatsapp-cta {
            display: none;
        }

        .prompt-wrapper {
            position: relative;
            max-width: 800px;
            margin-left: auto;
            margin-right: auto;
        }

        /* Project Type Cards */
.project-type-cards-outer { width: 100%; max-width: 960px; margin: 0 auto; overflow: hidden; }
.project-type-cards-container { width: 100%; margin-top: 0.5rem; }

.project-type-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
    max-width: 920px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .project-type-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .project-type-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }
}

.project-ecommerce-cta-row {
    width: 100%;
    max-width: 920px;
    margin: 0.75rem auto 0;
    display: none; /* desktop: e-commerce is in sidebar */
    justify-content: center;
    align-items: center;
}
@media (max-width: 768px) {
    .project-ecommerce-cta-row { display: flex; } /* show on mobile */
    .project-type-card[data-project-type="game"] { display: none !important; } /* hide Juego on mobile */
}

.btn-ecommerce-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 12px;
    border: 1.5px solid var(--nu-primary);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%);
    color: var(--nu-text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-ecommerce-cta:hover {
    border-color: var(--nu-primary-hover, #818cf8);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
    color: var(--nu-text-primary);
}

.btn-ecommerce-cta i {
    color: var(--nu-primary);
}

/* Card base */
.project-type-card {
    padding: 0.9rem 0.95rem 0.85rem;
    border: 1.5px solid var(--nu-border);
    background: var(--nu-surface);
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.18s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.project-type-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    opacity: 0;
    background: linear-gradient(135deg, rgba(139,92,246,0.06) 0%, rgba(99,102,241,0.04) 100%);
    transition: opacity 0.2s;
    pointer-events: none;
}

.project-type-card:hover {
    border-color: var(--nu-primary);
    background: var(--nu-surface-dark);
    box-shadow: 0 6px 22px rgba(139, 92, 246, 0.14);
    transform: translateY(-2px);
}

.project-type-card:hover::after { opacity: 1; }

.project-type-card[data-selected="true"] {
    border-color: var(--nu-primary);
    background: rgba(139,92,246,0.04);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.22), 0 6px 22px rgba(139, 92, 246, 0.12);
}

.project-type-card[data-selected="true"]::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--nu-primary), #818cf8);
    border-radius: 14px 14px 0 0;
}

/* Title row: text left, icon right */
.project-type-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.project-type-card h4 {
    margin: 0;
    font-size: 0.87rem;
    font-weight: 700;
    color: var(--nu-text-primary);
    line-height: 1.2;
    flex: 1;
    letter-spacing: -0.01em;
}

.project-type-card[data-selected="true"] h4 {
    color: var(--nu-primary);
}

.project-type-card-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(139, 92, 246, 0.09);
    border: 1px solid rgba(139, 92, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}

.project-type-card:hover .project-type-card-icon,
.project-type-card[data-selected="true"] .project-type-card-icon {
    background: rgba(139, 92, 246, 0.16);
    border-color: rgba(139, 92, 246, 0.3);
}

.project-type-card-icon svg {
    width: 14px;
    height: 14px;
    color: var(--nu-primary);
    stroke: var(--nu-primary);
}

/* Description — máx 2 líneas con ellipsis */
.project-type-card .project-type-desc {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--nu-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Credits badge */
.project-type-card-credits {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: auto;
    font-size: 0.67rem;
    font-weight: 700;
    color: var(--nu-primary);
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 20px;
    padding: 3px 9px 3px 7px;
    width: fit-content;
    transition: background 0.2s;
}

.project-type-card:hover .project-type-card-credits,
.project-type-card[data-selected="true"] .project-type-card-credits {
    background: rgba(139, 92, 246, 0.14);
}

.project-type-card-credits svg {
    width: 10px;
    height: 10px;
    stroke: var(--nu-primary);
    flex-shrink: 0;
}

/* Ocultar Múltiple en mobile */
@media (max-width: 768px) {
    .project-type-card[data-project-type="multiple"] {
        display: none;
    }
    .project-type-card { padding: 0.75rem 0.8rem; }
    .project-type-card h4 { font-size: 0.82rem; }
    .project-type-card .project-type-desc { font-size: 0.7rem; }
}

        /* 3.1. Zona de Arrastrar y Soltar (Drag & Drop) */
        #file-drop-zone {
            width: 100%;
            background-color: var(--nu-background);
            border-radius: 12px;
            padding: 1.5rem;
            transition: border-color 0.2s ease, background-color 0.2s ease;
        }

        #file-drop-zone.drag-over {
            border-color: var(--nu-primary);
            background-color: #F4F4FF;
        }

        #file-drop-zone.has-files {
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
            border-bottom-style: solid;
        }

        /* 3.2. Preview de Imágenes */
        #image-preview-container {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            display: none;
            /* Oculto hasta que haya archivos */
        }

        #image-preview-container.has-files {
            display: flex;
        }

        .file-preview-item {
            position: relative;
            width: 80px;
            height: 80px;
        }

        .file-preview-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 6px;
            border: 1px solid var(--nu-border);
        }

        .file-preview-remove-btn {
            position: absolute;
            top: -5px;
            right: -5px;
            width: 20px;
            height: 20px;
            background-color: var(--nu-danger);
            color: var(--nu-white);
            border: none;
            border-radius: 50%;
            font-size: 0.7rem;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }


        .prompt-input-area {
            position: relative;
            width: 100%;
            display: flex;
            align-items: flex-end;
            gap: 0.5rem;
            padding: 0.5rem;
        }

        /* 2. Definición de Variables de Dark Mode */
        body[data-theme="dark"] {

--nu-primary: #8B5CF6; 
/* Solo acento */

--nu-primary-hover: #A78BFA;

--nu-background: #0F1115; 
/* Similar a ChatGPT */

--nu-surface: #171923; 
/* Tarjetas */

--nu-surface-dark: #1F2430; 
/* Hover / elevated */

--nu-border: #2A2F3A;

--nu-text-primary: #E5E7EB; 
/* Gris claro suave */

--nu-text-secondary: #9CA3AF;

--nu-text-on-primary: #FFFFFF;

--nu-white: #FFFFFF;
--nu-black: #000000;
}
        /* 3. Estilos del Toggle en Dark Mode */
        body[data-theme="dark"] .theme-toggle-btn .theme-icon-dark {
            display: none;
        }

        body[data-theme="dark"] .theme-toggle-btn .theme-icon-light {
            display: block;
            margin-left: auto;
            /* Mueve el sol a la derecha */
        }

        body[data-theme="dark"] .nu-sidebar-logo {
            color: var(--nu-primary);
        }


        #prompt-textarea {
            width: 100%;
            min-height: 60px;
            max-height: 300px;
            border: none;
            outline: none;
            resize: none;
            font-family: var(--font-family-sans);
            font-size: 1rem;
            background-color: transparent;
            overflow-y: auto;
            color: var(--nu-text-primary);
            flex-grow: 1;
        }

        .prompt-actions {
            display: flex;
            gap: 0.5rem;
            flex-shrink: 0;
        }

        .prompt-btn {
            background: none;
            border: 1px solid var(--nu-border);
            color: var(--nu-text-secondary);
            width: 36px;
            height: 36px;
            border-radius: 8px;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        .prompt-btn:hover {
            background-color: var(--nu-surface-dark);
            color: var(--nu-text-primary);
        }

        .prompt-btn.primary {
            background-color: var(--nu-primary);
            color: var(--nu-text-on-primary);
            border-color: var(--nu-primary);
        }

        .prompt-btn.primary:hover {
            background-color: var(--nu-primary-hover);
        }

        .prompt-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .prompt-tags {
            display: flex;
            gap: 0.5rem;
            margin-top: 1rem;
            justify-content: center;
        }

        .prompt-tag {
            background-color: var(--nu-surface-dark);
            color: var(--nu-text-secondary);
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 500;
        }


        /* 4. VISTA 2: CARGA (#loading-view) */
        #loading-view {
            flex-direction: row;
        }
        /* Mantener iframe y terminal en fila (terminal visible con logs) */
        body.creation-loading-active #loading-view {
            flex-direction: row;
        }
        /* Sidebar: mantener estado normal (expandido/colapsado) para que el usuario pueda redimensionar; ocultar top-nav y nav móvil */
        body.creation-loading-active .nu-sidebar {
            /* No forzar colapso: respetar data-collapsed para que el toggle funcione */
        }
        body.creation-loading-active .top-navbar-wrapper,
        body.creation-loading-active .nu-mobile-bottom-nav {
            display: none !important;
        }
        /* Preview e iframe comparten espacio con la terminal (sin fullscreen) */
        body.creation-loading-active #loading-preview-pane {
            flex: 1;
            position: relative;
            width: auto;
            height: 100%;
            z-index: 1;
        }
        /* Terminal visible al lado del iframe con las impresiones del proceso */
        body.creation-loading-active #loading-terminal-pane {
            display: flex !important;
            flex-basis: 40%;
            max-width: 500px;
        }

        #loading-preview-pane {
            flex: 1;
            height: 100%;
            background-color: var(--nu-black);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #loading-iframe {
            width: 100%;
            height: 100%;
            border: none;
        }

        #loading-terminal-pane {
            flex-basis: 40%;
            max-width: 500px;
            height: 100%;
            background-color: var(--nu-background);
            border-left: 1px solid var(--nu-border);
            display: flex;
            flex-direction: column;
        }

        .terminal-header {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--nu-border);
            font-weight: 600;
        }

        #terminal-log {
            flex-grow: 1;
            overflow-y: auto;
            padding: 1.5rem;
            list-style: none;
            font-size: 0.9rem;
            -webkit-overflow-scrolling: touch;
        }

        .log-entry {
            margin-bottom: 1.25rem;
        }

        .log-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.25rem;
        }

        .log-icon {
            font-size: 1rem;
        }

        .log-entry.success .log-icon {
            color: var(--nu-success);
        }

        .log-entry.warning .log-icon {
            color: var(--nu-warning);
        }

        .log-entry.error .log-icon {
            color: var(--nu-danger);
        }

        .log-entry.pending .log-icon {
            color: var(--nu-primary);
        }

        .log-title {
            font-weight: 600;
        }

        .log-duration {
            font-size: 0.8rem;
            color: var(--nu-text-secondary);
            margin-left: auto;
        }

        .log-details {
            font-size: 0.85rem;
            color: var(--nu-text-secondary);
            padding-left: 1.75rem;
            /* Alineado con el título */
            border-left: 2px solid var(--nu-surface-dark);
            margin-left: 7px;
            /* Alineado con el icono */
            padding-top: 0.25rem;
            margin-top: 0.25rem;
        }

        .log-details pre {
            background-color: var(--nu-surface);
            padding: 0.5rem;
            border-radius: 4px;
            white-space: pre-wrap;
            word-break: break-all;
        }

        /* 5. VISTA 3: RESULTADOS (#result-view) */
        #result-view {
            flex-direction: row;
        }

        .result-panes-container {
            flex-grow: 1;
            height: 100%;
            position: relative;
            overflow: hidden;
        }

        #result-preview-pane {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            display: flex;
        }

        #result-iframe {
            width: 100%;
            height: 100%;
            border: none;
            background-color: var(--nu-white);
        }

        #result-code-editor-pane {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            display: none;
            /* Oculto por defecto */
            flex-direction: column;
        }

        .editor-header {
            padding: 0.5rem 1rem;
            background-color: #1E1E1E;
            /* Coincide con VS-Dark */
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .editor-header-title {
            color: #CCC;
            font-size: 0.9rem;
        }

        #save-code-btn {
            background-color: var(--nu-primary);
            color: var(--nu-white);
            border: none;
            padding: 0.4rem 0.8rem;
            border-radius: 6px;
            font-size: 0.85rem;
            font-weight: 500;
        }

        #save-code-btn:disabled {
            background-color: var(--nu-text-secondary);
        }

        #monaco-editor-container {
            width: 100%;
            flex-grow: 1;
        }

        /* Fullscreen Preview */
        .fullscreen-preview {
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            width: 100vw !important;
            height: 100vh !important;
            z-index: 200 !important;
        }


        /* 6. MODALES */
        .nu-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            display: none;
            /* Oculto por defecto */
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }

        .nu-modal-overlay.active {
            display: flex;
        }

        .nu-modal {
            background-color: var(--nu-background);
            border-radius: 12px;
            padding: 1.5rem;
            width: 90%;
            max-width: 500px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }

        .nu-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .nu-modal-header h2 {
            font-size: 1.25rem;
            color: var(--nu-text-primary);
            font-weight: 600;
        }

        .nu-modal-close-btn {
            background: none;
            border: none;
            font-size: 1.25rem;
            color: var(--nu-text-secondary);
            cursor: pointer;
        }

        .nu-modal-content {
            font-size: 0.95rem;
        }

        /* Connectors Modal */
        .connectors-modal-header {
            flex-wrap: wrap;
            gap: 12px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--nu-border);
            position: relative;
        }
        .connectors-modal-header .connectors-close-left {
            order: -1;
            position: absolute;
            left: 0;
            top: 0;
            z-index: 2;
        }
        .connectors-modal-header h2 { margin-right: 36px; }
        .connectors-modal-tabs {
            display: flex;
            gap: 4px;
            width: 100%;
        }
        .connectors-tab {
            padding: 8px 14px;
            background: none;
            border: none;
            color: var(--nu-text-secondary);
            font-size: 0.9rem;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            font-family: inherit;
        }
        .connectors-tab:hover { color: var(--nu-text-primary); }
        .connectors-tab.active {
            color: var(--nu-primary);
            border-bottom-color: var(--nu-primary);
            font-weight: 600;
        }
        .connectors-search-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: var(--nu-surface);
            border: 1px solid var(--nu-border);
            border-radius: 8px;
            flex: 1;
            min-width: 140px;
        }
        .connectors-search-wrap i { color: var(--nu-text-secondary); font-size: 0.85rem; }
        .connectors-search {
            border: none;
            background: none;
            outline: none;
            color: var(--nu-text-primary);
            font-size: 0.9rem;
            width: 100%;
        }
        .connectors-modal-content { padding: 16px 0 32px 0; }
        #connectors-modal .nu-modal.connectors-modal { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
        #connectors-modal .connectors-modal-content { overflow-y: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; }
        .connectors-intro {
            color: var(--nu-text-secondary);
            font-size: 0.9rem;
            margin-bottom: 16px;
            line-height: 1.5;
        }
        .connectors-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
        .connectors-grid[data-active-tab="apps"] {
            grid-template-columns: 1fr;
        }
        @media (max-width: 768px) {
            .connectors-grid { grid-template-columns: 1fr !important; }
        }
        .connector-card {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 14px;
            background: var(--nu-surface);
            border: 1px solid var(--nu-border);
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.2s, border-color 0.2s;
        }
        .connector-card:hover {
            background: var(--nu-surface-dark);
            border-color: var(--nu-primary);
        }
        .connector-card img {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            object-fit: cover;
            flex-shrink: 0;
        }
        .connector-card-body h4 { margin: 0 0 4px 0; font-size: 0.95rem; color: var(--nu-text-primary); }
        .connector-card-body p { margin: 0; font-size: 0.8rem; color: var(--nu-text-secondary); line-height: 1.4; }
        .connector-card.connected { border-color: var(--nu-primary); background: rgba(139, 92, 246, 0.08); }
        .connector-card { position: relative; }
        .connector-card .connector-disconnect {
            position: absolute;
            top: 8px;
            right: 8px;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: var(--nu-surface-dark);
            border: 1px solid var(--nu-border);
            color: var(--nu-text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            opacity: 0;
            transition: opacity 0.2s;
        }
        .connector-card.connected:hover .connector-disconnect,
        .connector-card .connector-disconnect:hover { opacity: 1; }
        .connector-card .connector-disconnect:hover { color: #ef4444; background: rgba(239,68,68,0.15); }
        /* Connectors modal: centrado en desktop, scroll en contenido */
        .connectors-modal-overlay { padding: 24px !important; align-items: center !important; justify-content: center !important; }
        @media (max-width: 768px) {
            .connectors-modal-overlay { padding-top: 40px !important; padding-bottom: 24px !important; align-items: flex-start !important; justify-content: flex-start !important; }
        }
        #connectors-modal .nu-modal-close-btn,
        .connectors-close-left { display: flex !important; align-items: center; justify-content: center; }

        /* Connect tools bar - iconos conectados con X para desconectar */
        .connect-tools-icon-wrap {
            position: relative;
            display: inline-flex;
        }
        .connect-tools-icon-wrap .connector-disconnect-bar {
            position: absolute;
            top: -4px;
            right: -4px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: var(--nu-surface-dark);
            border: 1px solid var(--nu-border);
            color: var(--nu-text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.55rem;
            z-index: 1;
        }
        .connect-tools-icon-wrap .connector-disconnect-bar:hover { color: #ef4444; }

        /* Connect Service Modal */
        .connect-service-header { display: flex; align-items: center; gap: 12px; }
        .connect-service-icon-img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
        .connect-service-desc {
            color: var(--nu-text-secondary);
            font-size: 0.9rem;
            margin-bottom: 16px;
            line-height: 1.5;
        }
        .connect-service-desc a { color: var(--nu-primary); text-decoration: underline; }
        .connect-service-api-wrap {
            margin-bottom: 16px;
        }
        .connect-service-api-wrap label {
            display: block;
            font-weight: 500;
            margin-bottom: 6px;
            font-size: 0.9rem;
            color: var(--nu-text-primary);
        }
        .connect-service-api-input {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid var(--nu-border);
            border-radius: 8px;
            background: var(--nu-surface);
            color: var(--nu-text-primary);
            font-size: 0.95rem;
        }
        .connect-service-voice-wrap {
            margin-bottom: 16px;
        }
        .connect-service-voice-wrap label {
            display: block;
            font-weight: 500;
            margin-bottom: 6px;
            font-size: 0.9rem;
            color: var(--nu-text-primary);
        }
        .connect-service-voice-wrap small {
            display: block;
            margin-top: 6px;
            font-size: 0.8rem;
            color: var(--nu-text-secondary);
        }
        .connect-service-voice-wrap small a { color: var(--nu-primary); }
        .connect-service-info {
            display: flex;
            gap: 12px;
            padding: 14px;
            background: var(--nu-surface);
            border: 1px solid var(--nu-border);
            border-radius: 8px;
            margin-bottom: 20px;
        }
        .connect-service-info i { color: var(--nu-text-secondary); margin-top: 2px; }
        .connect-service-info strong { display: block; margin-bottom: 4px; color: var(--nu-text-primary); }
        .connect-service-info p { margin: 0; font-size: 0.85rem; color: var(--nu-text-secondary); line-height: 1.4; }
        .connect-service-btn {
            width: 100%;
            padding: 12px 20px;
            background: var(--nu-primary);
            color: var(--nu-text-on-primary);
            border: none;
            border-radius: 10px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
        }
        .connect-service-btn:hover { background: var(--nu-primary-hover); }

        .form-group {
            margin-bottom: 1rem;
        }

        .form-group label {
            display: block;
            font-weight: 500;
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
        }

        .form-group input[type="text"] {
            width: 100%;
            padding: 0.75rem;
            border: 1px solid var(--nu-border);
            border-radius: 8px;
            font-size: 0.95rem;
        }

        .form-switch {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.75rem;
            background-color: var(--nu-surface);
            border-radius: 8px;
        }

        /* Toggle Switch */
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 24px;
        }

        .toggle-switch input {
            display: none;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: var(--nu-surface-dark);
            transition: .4s;
            border-radius: 24px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked+.slider {
            background-color: var(--nu-primary);
        }

        input:checked+.slider:before {
            transform: translateX(20px);
        }

        .form-tabs {
            display: flex;
            background-color: var(--nu-surface);
            border-radius: 8px;
            padding: 0.25rem;
            margin-bottom: 1rem;
        }

        .form-tab {
            flex: 1;
            text-align: center;
            padding: 0.5rem;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            font-size: 0.9rem;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        .form-tab.active {
            background-color: var(--nu-white);
            color: var(--nu-primary);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        }

        .form-tab-content {
            display: none;
        }

        .form-tab-content.active {
            display: block;
        }

        #custom-code-textarea {
            width: 100%;
            min-height: 150px;
            border: 1px solid var(--nu-border);
            border-radius: 8px;
            padding: 0.75rem;
            font-family: monospace;
            font-size: 0.9rem;
        }

        .nu-modal-footer {
            margin-top: 1.5rem;
            text-align: right;
        }

        .nu-btn {
            padding: 0.6rem 1.25rem;
            border: none;
            border-radius: 8px;
            font-weight: 500;
            font-size: 0.95rem;
        }

        .nu-btn.primary {
            background-color: var(--nu-primary);
            color: var(--nu-text-on-primary);
        }

        .nu-btn.primary:hover {
            background-color: var(--nu-primary-hover);
        }
        .nu-btn.danger {
            background-color: var(--nu-danger);
            color: white;
        }
        .nu-btn.danger:hover {
            background-color: #b91c1c;
        }

        /* Share Modal Específico */
        #share-url-input {
            width: 100%;
            padding: 0.75rem;
            border: 1px solid var(--nu-border);
            background-color: var(--nu-surface);
            border-radius: 8px;
            margin-bottom: 1rem;
        }

        .share-buttons {
            display: flex;
            justify-content: center;
            gap: 1rem;
        }

        .share-btn {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            text-decoration: none;
            color: var(--nu-white);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
        }

        #share-whatsapp {
            background-color: #25D366;
        }

        @media (max-width: 768px) {
            #share-whatsapp { display: none !important; }
        }

        #share-facebook {
            background-color: #1877F2;
        }

        #share-twitter {
            background-color: #1DA1F2;
        }

        #share-open-link {
            background-color: var(--nu-text-secondary);
        }

        /* 7. RESPONSIVE (Móvil) */
        @media (max-width: 768px) {
            body {
                flex-direction: column;
            }

            /* Ocultar sidebar de escritorio, mostrar nav inferior */
            .nu-sidebar {
                display: none;
            }

            .nu-mobile-bottom-nav {
                display: flex;
            }

            .nu-main-content {
                height: calc(100vh - var(--mobile-nav-height));
                padding-bottom: 0;
                /* El nav ya ocupa espacio */
            }

            /* Ocultar sidebar derecho en móvil (acciones estarán en otro lugar, p.ej. modal) */
            .nu-right-sidebar {
                display: none;
            }

            /* Ajustar vistas para móvil */
            #creation-view {
                padding: 1rem;
            }

            .creation-header h1 {
                font-size: 1.5rem;
            }

            #file-drop-zone {
                padding: 1rem;
            }

            .prompt-input-area {
                padding: 0.25rem;
            }

            #prompt-textarea {
                padding-right: 50px;
                /* Menos espacio para botones */
            }

            .prompt-actions {
                bottom: 0.5rem;
                right: 0.5rem;
            }

            /* CTA WhatsApp debajo del textarea - OCULTO a pedido del usuario (no eliminado). */
            .prompt-whatsapp-cta {
                display: none !important;
                align-items: center;
                justify-content: center;
                gap: 10px;
                width: 100%;
                margin-top: 12px;
                padding: 14px 20px;
                background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
                color: #fff;
                font-weight: 700;
                font-size: 1rem;
                border-radius: 12px;
                text-decoration: none;
                box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
                transition: transform 0.2s, box-shadow 0.2s;
                border: none;
                cursor: pointer;
            }

            .prompt-whatsapp-cta:hover,
            .prompt-whatsapp-cta:active {
                color: #fff;
                transform: translateY(-2px);
                box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
            }

            .prompt-whatsapp-cta i {
                font-size: 1.35rem;
            }

            /* Vistas de Carga y Resultados en Stack */
            #loading-view,
            #result-view {
                flex-direction: column;
            }

            #loading-preview-pane {
                flex-basis: 40%;
                min-height: 200px;
            }

            #loading-terminal-pane {
                flex-basis: 60%;
                flex-grow: 1;
                max-width: 100%;
                border-left: none;
                border-top: 1px solid var(--nu-border);
            }

            .result-panes-container {
                height: 100%;
                padding-bottom: 50px;
                /* Espacio para botones de acción flotantes */
            }

            #result-view {
                position: relative;
            }



            .mobile-result-btn {
                background: none;
                border: none;
                color: var(--nu-white);
                font-size: 1.1rem;
            }

            /* Ocultar botones de barra derecha en móvil */
            .nu-right-sidebar {
                display: none;
            }
        }

        /* --- PEGA ESTO AL FINAL DE TU <style> --- */

        /* 1. Estilos para Lista de Proyectos en Creación */
        .projects-list-section {
            width: 100%;
            max-width: 800px;
            margin: 1rem auto 1.5rem;
            padding: 0 1.5rem;
        }

        .projects-list-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.75rem;
        }
        @media (min-width: 769px) {
            .projects-list-header { display: none; }
        }

        .projects-list-header h3 {
            font-size: 1.1rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: var(--nu-text-primary);
        }

        .projects-list-header h3::before {
            content: '';
            width: 4px;
            height: 1.1em;
            background: var(--nu-primary);
            border-radius: 2px;
            display: inline-block;
        }

        .view-all-link {
            font-size: 0.9rem;
            color: var(--nu-primary);
            text-decoration: none;
            font-weight: 500;
        }

        .project-card {
            background: var(--nu-background);
            border: 1px solid var(--nu-border);
            border-radius: 16px;
            overflow: hidden;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
        }

        .project-card:hover {
            transform: translateY(-6px);
            box-shadow: 0 12px 32px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
            border-color: rgba(99, 102, 241, 0.3);
        }

        .project-card::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--nu-primary), #8b5cf6, #ec4899);
            opacity: 0;
            transition: opacity 0.25s;
        }

        .project-card:hover::after {
            opacity: 1;
        }

        .project-card-preview {
            width: 100%;
            background: linear-gradient(135deg, var(--nu-surface-dark) 0%, var(--nu-surface) 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--nu-text-secondary);
            padding-top: 60%;
            position: relative;
            overflow: hidden;
        }

        .project-card-preview-img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .project-card-preview-content {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 1.5rem 1rem 1rem;
            padding-top: 2rem;
            text-align: center;
        }

        .project-card-preview-content i {
            font-size: 2.5rem;
            color: var(--nu-primary);
            margin-bottom: 0.5rem;
            opacity: 0.8;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
        }

        .project-card-preview-content h3 {
            margin: 0;
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--nu-text-primary);
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .project-card-info {
            padding: 0.85rem 1rem;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.5rem 0.65rem;
        }

        .project-card-info .project-card-date {
            display: inline-flex;
            align-items: center;
            font-size: 0.7rem;
            color: var(--nu-text-secondary);
            flex-shrink: 0;
        }

        .project-card-info h4 {
            font-size: 0.9rem;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 0;
            flex: 1 1 0%;
            min-width: 0; /* CLAVE: sin esto el ellipsis no funciona dentro de flex (el item no encoge) */
            color: var(--nu-text-primary);
        }

        .project-card-info p {
            font-size: 0.72rem;
            color: var(--nu-text-secondary);
            white-space: nowrap;
            flex-shrink: 0;
        }

        .project-card-info .project-card-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 8px;
            border-radius: 6px;
            font-size: 0.65rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            flex-shrink: 0;
        }

        .project-card-badge.badge-landing {
            background: rgba(59, 130, 246, 0.1);
            color: #3b82f6;
        }

        .project-card-badge.badge-catalog {
            background: rgba(16, 185, 129, 0.1);
            color: #10b981;
        }

        .project-card-badge.badge-game {
            background: rgba(245, 158, 11, 0.1);
            color: #f59e0b;
        }

        .project-card-badge.badge-multiple {
            background: rgba(139, 92, 246, 0.1);
            color: #8b5cf6;
        }

        .project-card-badge.badge-system {
            background: rgba(6, 182, 212, 0.1);
            color: #06b6d4;
        }

        .project-card-badge.badge-other {
            background: rgba(107, 114, 128, 0.1);
            color: #6b7280;
        }

        /* 2. Estilos para Vista de Resultados (Split) */
        #result-view {
            flex-direction: row;
            background-color: var(--nu-surface);
        }

        .result-preview-container {
            flex: 1;
            /* Ocupa el espacio disponible */
            height: 100%;
            min-width: 300px;
            display: flex;
            background-color: var(--nu-background);
        }

        .result-data-container {
            flex-basis: 500px;
            /* Ancho fijo para el chat */
            width: 500px;
            /* Ancho fijo cuando está abierto */
            max-width: 500px;
            /* Ancho máximo */
            min-width: 500px;
            /* Ancho mínimo para el chat */
            height: 100%;
            background-color: var(--nu-background);
            border-left: 1px solid var(--nu-border);
            position: relative;
            display: none;
            flex-direction: column;
        }

        .data-pane {
            display: none;
            /* Ocultos por defecto */
            flex-direction: column;
            width: 100%;
            height: 100%;
        }

        .data-pane.active {
            display: flex;
            /* Se muestra el panel activo */
        }

        .data-pane-content {
            flex-grow: 1;
            overflow-y: auto;
            padding: 1.5rem;
            background-color: var(--nu-background);
        }

        /* Estilo para el log de creación (ya lo tenías) */
        #log-content-container {
            list-style: none;
            font-size: 0.9rem;
            padding: 1.5rem;
        }

        /* Estilo para el resumen (markdown) */
        #learn-content-container {
            line-height: 1.6;
        }

        #learn-content-container h3 {
            font-size: 1.1rem;
            margin-top: 1.5rem;
            margin-bottom: 0.5rem;
        }

        #learn-content-container ul {
            padding-left: 1.5rem;
        }

        /* 3. Estilos para el "Spinner Lindo" */
        .data-pane-loader {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: var(--nu-background);
            display: none;
            /* Oculto por defecto */
            align-items: center;
            justify-content: center;
            z-index: 10;
        }

        .data-pane-loader.active {
            display: flex;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 4px solid var(--nu-surface-dark);
            border-top-color: var(--nu-primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

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

        /* 4. Responsive para Split View */
        @media (max-width: 768px) {
            #result-view {
                flex-direction: column;
            }

            .result-preview-container {
                flex: 1;
                min-height: 250px;
            }

            .result-data-container {
                flex: 1;
                max-width: 100%;
                min-width: 100%;
                border-left: none;
                border-top: 1px solid var(--nu-border);
            }
        }

        @media (min-width: 769px) {
            #result-view .mobile-result-actions {
                display: none !important;
            }
        }

        .prompt-btn#mic-btn.active {
            background-color: var(--nu-danger);
            color: var(--nu-white);
            border-color: var(--nu-danger);
        }

        /* --- PEGA ESTO AL FINAL DE TU <style> --- */

        /* 1. Estilos para el Botón de Dark Mode */
        .theme-toggle-container {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.75rem 1rem;
            margin-bottom: 0.5rem;
        }

        .nu-sidebar[data-collapsed="true"] .theme-toggle-container {
            justify-content: center;
        }

        .nu-sidebar[data-collapsed="true"] .nu-nav-text {
            display: none;
        }

        .theme-toggle-btn {
            background-color: var(--nu-surface);
            border: 1px solid var(--nu-border);
            border-radius: 20px;
            cursor: pointer;
            width: 50px;
            height: 26px;
            position: relative;
            display: flex;
            align-items: center;
            padding: 0 4px;
        }

        .theme-toggle-btn .theme-icon-dark {
            color: #4B5563;
            /* Un gris oscuro */
        }

        .theme-toggle-btn .theme-icon-light {
            color: #F59E0B;
            /* Un ámbar */
            display: none;
            /* Oculto por defecto */
        }


        .nu-mobile-result-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: var(--mobile-nav-height);
            background-color: var(--nu-background);
            border-top: 1px solid var(--nu-border);
            display: flex;
            /* Se mostrará con JS */
            align-items: stretch;
            justify-content: space-around;
            z-index: 100;
            display: none;
            /* OCULTA POR DEFECTO */
        }

        @media (max-width: 768px) {
            body.mobile-pane-active .result-preview-container {
                display: none;
                /* Oculta el preview del sitio (iframe) */
            }

            body.mobile-pane-active .result-data-container {
                height: 100%;
                /* El panel de datos ocupa toda la altura */
                flex-basis: 100%;
                min-height: 0;
            }
        }

        /* === v5: Chat IA en móvil como bottom sheet con FAB === */
        @media (max-width: 768px) {
            /* FAB del chat IA: visible cuando hay proyecto abierto en móvil */
            .nu-chat-fab {
                position: fixed;
                bottom: 88px;
                /* arriba del bottom-nav móvil */
                right: 16px;
                width: 56px;
                height: 56px;
                border-radius: 50%;
                background: linear-gradient(135deg, #5b21b6, #7c3aed);
                color: #fff;
                border: none;
                cursor: pointer;
                box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5);
                z-index: 9990;
                display: none;
                /* JS lo muestra */
                align-items: center;
                justify-content: center;
                font-size: 1.2rem;
                transition: transform .2s, box-shadow .2s;
            }

            .nu-chat-fab:active {
                transform: scale(0.92);
            }

            .nu-chat-fab[data-show="true"] {
                display: flex;
            }

            .nu-chat-fab .fab-badge {
                position: absolute;
                top: -2px;
                right: -2px;
                width: 16px;
                height: 16px;
                background: #ef4444;
                border-radius: 50%;
                border: 2px solid #fff;
                display: none;
            }

            /* Chat panel como bottom sheet cuando está activo en móvil */
            body.mobile-chat-fullscreen .result-data-container {
                position: fixed !important;
                inset: 0 !important;
                width: 100% !important;
                height: 100% !important;
                max-width: 100% !important;
                min-width: 0 !important;
                z-index: 9995 !important;
                border-radius: 0 !important;
                border-left: none !important;
                animation: slideUpChat 0.25s ease-out;
                display: flex !important;
            }

            @keyframes slideUpChat {
                from {
                    transform: translateY(100%);
                    opacity: 0.3;
                }

                to {
                    transform: translateY(0);
                    opacity: 1;
                }
            }

            /* Botón cerrar bottom sheet (visible solo en móvil) */
            .nu-chat-mobile-close {
                display: none !important;
            }

            body.mobile-chat-fullscreen .nu-chat-mobile-close {
                display: flex !important;
                position: fixed;
                top: 12px;
                right: 12px;
                width: 36px;
                height: 36px;
                border-radius: 50%;
                background: rgba(0, 0, 0, 0.5);
                color: #fff;
                border: none;
                z-index: 9996;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                font-size: 1rem;
            }

            /* En móvil, esconder el FAB cuando el chat está abierto */
            body.mobile-chat-fullscreen .nu-chat-fab {
                display: none !important;
            }
        }

        @media (min-width: 769px) {

            .nu-chat-fab,
            .nu-chat-mobile-close {
                display: none !important;
            }
        }

        /* Loader específico para el Iframe de Preview */
        #preview-loader {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: var(--nu-background);
            /* Fondo del tema */
            display: none;
            /* Oculto por defecto */
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 20;
            /* Encima del iframe */
            color: var(--nu-primary);
        }

        #preview-loader.active {
            display: flex;
        }

        #preview-loader p {
            margin-top: 1rem;
            font-size: 0.9rem;
            color: var(--nu-text-secondary);
            font-weight: 500;
        }

        /* Título de la sección en el panel derecho */
        .right-panel-title {
            font-size: 1.1rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--nu-border);
            color: var(--nu-text-primary);
        }

        /* Inputs dentro del panel derecho */
        .right-panel-input {
            width: 100%;
            padding: 10px;
            border: 1px solid var(--nu-border);
            background-color: var(--nu-surface);
            /* O blanco según tu tema */
            color: var(--nu-text-primary);
            border-radius: 6px;
            margin-bottom: 1rem;
        }

        /* Botones dentro del panel */
        .right-panel-btn {
            width: 100%;
            padding: 10px;
            background-color: var(--nu-primary);
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
        }

        .right-panel-btn:hover {
            background-color: var(--nu-primary-hover);
        }

        .right-panel-btn.danger {
            background-color: var(--nu-danger);
        }

        /* Estilo para items de plugins */
        .plugin-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0;
            border-bottom: 1px solid var(--nu-border);
        }

        /* Asegura que el contenedor de datos pueda ocupar todo el ancho en modo código */
        #result-data-container {
            transition: all 0.3s ease;
        }

        /* Asegura que el editor de código tenga altura */
        #data-pane-code {
            height: 100%;
            width: 100%;
            flex-direction: column;
        }

        #monaco-editor-container {
            flex-grow: 1;
            width: 100%;
            height: calc(100vh - 50px);
            /* Resta el header del editor */
        }

        /* 1. Panel de Datos (El cuadro blanco) - Ajuste Escritorio */
        .result-data-container {
            flex-basis: 300px;
            /* Más delgado por defecto */
            max-width: 350px;
            /* Máximo más estrecho */
            min-width: 280px;
            height: 100%;
            background-color: var(--nu-background);
            border-left: 1px solid var(--nu-border);
            display: none;
            flex-direction: column;
            z-index: 50;
            /* Por encima del iframe si es necesario */
        }

        /* 2. Botón Flotante Móvil (Oculto en PC) */
        .mobile-toggle-handle {
            display: none;
        }

        /* 3. RESPONSIVE (Móvil) - AQUÍ ESTÁ EL ARREGLO CRÍTICO */
        @media (max-width: 768px) {

            /* El Sidebar derecho (Barra de iconos) se vuelve flotante o lateral */
            .nu-right-sidebar {
                display: flex !important;
                position: fixed;
                right: 0;
                top: 0;
                /* Restamos la altura del nav inferior para que no se monten */
                height: calc(100vh - var(--mobile-nav-height));
                width: 60px;
                /* Un poco más ancho para tactil */
                z-index: 90;
                /* Menor que el nav bottom (z-index 100) */
                background: var(--nu-background);
                border-left: 1px solid var(--nu-border);
                transform: translateX(100%);
                transition: transform 0.3s ease;
            }

            .nu-right-sidebar.active {
                transform: translateX(0);
                /* Visible */
            }

            /* La "Orejita" para sacar el menú */
            .mobile-toggle-handle {
                display: flex;
                position: fixed;
                right: 0;
                top: 50%;
                transform: translateY(-50%);
                width: 30px;
                height: 50px;
                background: var(--nu-primary);
                color: white;
                border-radius: 10px 0 0 10px;
                align-items: center;
                justify-content: center;
                z-index: 201;
                cursor: pointer;
                box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
            }

            /* Panel de Datos (Blanco) - FULL SCREEN */
            .result-data-container {
                position: fixed !important;
                top: 0;
                left: 0;
                width: 100vw !important;
                height: 100vh !important;
                max-width: none !important;
                z-index: 150;
                /* Tapa todo */
            }

            /* Ajuste para que el iframe ocupe todo */
            .result-preview-container {
                width: 100vw;
                height: 100vh;
            }
        }

        /* La flecha flotante móvil oculta por defecto */
        #mobile-toggle-handle {
            display: none;
        }

        /* Solo se mostrará si le ponemos la clase .visible vía JS */
        #mobile-toggle-handle.visible {
            display: flex;
        }

        /* --- CORRECCIÓN 1: OCULTAR FLECHA MÓVIL EN PC --- */
        @media (min-width: 769px) {
            #mobile-toggle-handle {
                display: none !important;
                /* Fuerza el ocultado en escritorio */
            }

            /* Ajuste para que el panel de datos no se vea blanco/vacío por defecto */
            .result-data-container {
                display: none;
            }
        }

        /* --- CORRECCIÓN 2: ASEGURAR QUE EL LOADER TAPE TODO PERO SE QUITE --- */
        .data-pane-loader {
            z-index: 50;
            background: var(--nu-background);
        }

        /* --- FIX VISIBILIDAD IFRAME --- */
        #result-iframe {
            background-color: #fff;
            /* Fondo blanco para evitar transparencias raras */
            display: block;
            /* Por defecto visible */
        }

        /* Asegurar que el contenedor del preview siempre ocupe espacio si está activo */
        .result-preview-container {
            position: relative;
            z-index: 1;
            flex: 1;
        }

        /* El contenedor de datos (panel derecho) no debe aplastar al iframe en escritorio */
        .result-data-container {
            z-index: 10;
        }

        /* Asegura que el contenedor tenga espacio */
        #result-preview-container {
            display: flex;
            flex: 1;
            position: relative;
            width: 100%;
            height: 100%;
            background-color: var(--nu-background);
            /* Fondo blanco por si el iframe tarda */
            overflow: hidden;
        }

        /* Estilos para el iframe generado dinámicamente */
        #result-iframe {
            width: 100%;
            height: 100%;
            border: none;
            display: block;
            opacity: 0;
            /* Empieza invisible hasta que carga */
            transition: opacity 0.3s ease;
        }

        /* El loader debe estar encima de todo */
        #preview-loader {
            z-index: 20;
        }

        /* El contenedor padre debe usar posición relativa */
        .result-preview-container {
            position: relative;
            /* Clave para que los hijos se posicionen bien */
            width: 100%;
            height: 100%;
            flex: 1;
            display: flex;
            overflow: hidden;
            background-color: #fff;
        }

        /* El Loader debe flotar ENCIMA del iframe */
        #preview-loader {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: var(--nu-background, #fff);
            /* Usa tu variable de fondo */
            z-index: 20;
            /* Encima del iframe */
            display: none;
            /* Oculto por defecto */
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        #preview-loader.active {
            display: flex;
            /* Se muestra cuando JS le pone la clase active */
        }

        /* El Iframe debe ocupar todo el espacio detrás */
        #result-iframe {
            width: 100%;
            height: 100%;
            border: none;
            display: block;
            z-index: 1;
        }

        /* Contenedor principal */
        .preview-container {
            display: flex;
            justify-content: center;
            /* Centra horizontalmente */
            align-items: flex-start;
            /* Alinea arriba */
            width: 100%;
            height: 100%;
            overflow-y: auto;
            padding: 20px 0;
            /* Padding arriba y abajo */
            box-sizing: border-box;
            /* Fondo técnico */
            background-color: #f8f9fa;
            background-image:
                linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
            background-size: 20px 20px;
        }

        /* Estilos de los dispositivos */
        .device-frame {
            transition: all 0.3s ease;
            background: white;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
            display: block;
            /* CLAVE PARA EL CENTRADO: */
            margin-left: auto !important;
            margin-right: auto !important;
            position: relative;
        }

        .device-mobile {
            width: 375px !important;

        }

        .device-tablet {
            width: 768px !important;


        }

        /* El PADRE (el área gris de fondo) */
        .preview-area {
            display: flex;
            justify-content: center;
            /* ESTO CENTRA HORIZONTALMENTE */
            align-items: flex-start;
            /* Alinea arriba */
            width: 100%;
            height: 100%;
            /* O calc(100vh - altura_header) */
            overflow: hidden;
            /* Evita scroll doble */
            background-color: #1e1e1e;
            /* Color de fondo para que resalte el canvas */
        }

        /* EL HIJO (El contenedor de tu sitio web) */
        #result-data-container {
            /* La altura SIEMPRE será el 100% del padre, sin importar el ancho */
            height: 100% !important;

            /* Transición suave al cambiar de ancho */
            transition: width 0.3s ease;

            /* Sombra para diferenciarlo del fondo cuando no es full-width */
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
            background-color: white;
        }

        /* CLASES MODIFICADORAS PARA EL ANCHO (Javascript las activa) */

        /* Vista Desktop (Por defecto) */
        #result-data-container.w-desktop {
            width: 100%;
            /* Al ser 100%, el centrado no se nota, pero llena todo */
        }

        /* Vista Tablet */
        #result-data-container.w-tablet {
            width: 768px;
            /* El flex del padre lo mantendrá centrado */
        }

        /* Vista Móvil (Simulador) */
        #result-data-container.w-mobile {
            width: 375px;
            /* El flex del padre lo mantendrá centrado */
        }

        .device-desktop {
            width: 100% !important;
            height: 100% !important;
            border: none !important;
            max-width: 100% !important;
        }

        /* Botón flotante de WhatsApp (mismo estilo que el resto, sin verde) */
        .float-wa-btn {
            position: fixed;
            bottom: 80px;
            right: 20px;
            width: 60px;
            height: 60px;
            background-color: var(--nu-primary);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 30px;
            box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
            z-index: 1000;
            text-decoration: none;
            transition: transform 0.3s;
        }

        .float-wa-btn:hover {
            transform: scale(1.1);
            background-color: var(--nu-primary-hover, #4f46e5);
        }

        /* --- Ocultar selectores de vista en pantallas móviles reales --- */
        @media (max-width: 768px) {

            /* Asegúrate de que esta clase apunte al contenedor de esos 3 botones específicos */
            .view-mode-buttons,
            .device-toggles {
                display: none !important;
            }

            /* Si no tienen una clase agrupada, usa los IDs de los botones si los tienen, por ejemplo: */
            #btn-view-desktop,
            #btn-view-tablet,
            #btn-view-mobile {
                display: none !important;
            }
        }

        /* Estilos para el Toast (Notificación Flotante) */
        #toast-container {
            visibility: hidden;
            min-width: 250px;
            background-color: var(--nu-background);
            color: var(--nu-text-primary);
            text-align: center;
            border-radius: 8px;
            padding: 16px;
            position: fixed;
            z-index: 2147483647;
            left: 50%;
            bottom: 30px;
            transform: translateX(-50%);
            font-size: 17px;
            opacity: 0;
            transition: opacity 0.5s, bottom 0.5s;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        #toast-container.show {
            visibility: visible;
            opacity: 1;
            bottom: 50px;
        }

        #toast-container.success {
            border-left: 5px solid var(--nu-success);
        }

        #toast-container.error {
            border-left: 5px solid var(--nu-danger);
        }

        /* Centrar el preview */
        .result-preview-container {
            display: flex;
            justify-content: center;
            /* Centrado horizontal */
            align-items: flex-start;
            /* Alineado arriba */
            background-color: #e9ecef;
            /* Fondo gris para diferenciar el canvas */
            width: 100%;
            overflow-x: auto;
            /* Permitir scroll horizontal si es necesario */
            height: 100%;
            overflow: hidden;
            /* Evita scrolls dobles */
            padding-top: 0px;
        }

        /* El iframe en sí */
        #result-iframe {
            transition: width 0.3s ease;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            /* Sombra bonita */
            background: white;
        }

        /* Clases para los tamaños (JS las aplicará) */
        iframe.device-desktop {
            width: 100%;
            height: 100%;
            border: none;
        }

        iframe.device-tablet {
            width: 768px;
            margin: 0 auto;
            /* Centrar horizontalmente */
            display: block;
        }

        iframe.device-mobile {
            width: 375px;
            margin: 0 auto;
            /* Centrar horizontalmente */
            display: block;
        }

        /* MODIFICACIÓN MÓVIL: Barra Superior */
        @media (max-width: 768px) {

            /* Ocultar botones de cambio de vista en móvil real */
            #view-desktop-btn,
            #view-tablet-btn,
            #view-mobile-btn {
                display: none !important;
            }

            /* Transformar Sidebar Derecho en Barra Superior Horizontal */
            .nu-right-sidebar {
                display: flex !important;
                position: fixed;
                top: 0;
                left: 40px;
                /* Espacio para flecha izquierda */
                width: calc(100% - 80px);
                /* Resta espacio de ambas flechas */
                height: 60px;
                /* Altura fija */
                flex-direction: row;
                /* Horizontal */
                overflow-x: auto;
                /* Scroll horizontal */
                overflow-y: hidden;
                -webkit-overflow-scrolling: touch;
                scroll-behavior: smooth;
                background: var(--nu-background);
                border-bottom: 1px solid var(--nu-border);
                border-left: none;
                z-index: 150;
                padding: 0 10px;
                align-items: center;
                transform: none !important;
                /* Quitar animaciones laterales */
            }

            /* Botones de flecha de scroll horizontal */
            .nu-scroll-arrow {
                position: fixed;
                top: 0;
                height: 60px;
                width: 40px;
                z-index: 151;
                background: var(--nu-background);
                border: none;
                border-bottom: 1px solid var(--nu-border);
                border-right: 1px solid var(--nu-border);
                color: var(--nu-primary);
                font-size: 1.2rem;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                opacity: 0;
                transition: opacity 0.3s, background-color 0.2s;
                pointer-events: none;
            }

            .nu-scroll-arrow:hover {
                background-color: var(--nu-surface);
            }

            .nu-scroll-arrow-left {
                left: 0;
                border-right: 1px solid var(--nu-border);
            }

            .nu-scroll-arrow-right {
                right: 0;
                border-left: 1px solid var(--nu-border);
                border-right: none;
            }

            .nu-scroll-arrow.visible {
                opacity: 1;
                pointer-events: auto;
            }

            /* Ajustar botones dentro de la barra superior */
            .nu-right-sidebar-btn {
                min-width: 40px;
                /* Espacio para el dedo */
                margin: 0 5px;
            }

            /* Ocultar HRs en móvil */
            .nu-right-sidebar hr {
                display: none;
            }

            /* Ajustar el contenido principal para que no quede tapado por la barra superior */
            #result-view {
                padding-top: 60px;
                /* Espacio para la barra */
            }

            /* Quitar la "orejita" flotante vieja */
            .mobile-toggle-handle {
                display: none !important;
            }

            .nu-right-sidebar {
                /* POR DEFECTO OCULTO EN MÓVIL */
                display: none !important;

                position: fixed;
                top: 0;
                left: 0;
                width: 100%;
                height: 60px;
                flex-direction: row;
                overflow-x: auto;
                background: var(--nu-background);
                border-bottom: 1px solid var(--nu-border);
                border-left: none;
                z-index: 150;
                padding: 0 10px;
                align-items: center;
                transform: none !important;
            }

            /* SOLO MOSTRAR SI ESTAMOS VIENDO UN PROYECTO */
            body.in-result-view .nu-right-sidebar {
                display: flex !important;
            }

            /* Ajustar el padding del contenido cuando la barra está visible */
            body.in-result-view #result-view {
                padding-top: 60px;
            }

            /* Si no estamos en proyecto, el padding debe ser normal */
            #result-view {
                padding-top: 0;
            }
        }

        /* Contenedor del resumen */
        #learn-content-container {
            padding: 20px;
            overflow-y: auto;
            /* Scroll vertical */
            overflow-x: hidden;
            /* No scroll horizontal */
            word-wrap: break-word;
            /* Romper palabras largas */
            white-space: normal;
            /* Texto normal, no en una línea */
            line-height: 1.6;
        }

        #learn-content-container h3 {
            margin-top: 1.5rem;
            color: var(--nu-primary);
        }

        #learn-content-container ul {
            padding-left: 20px;
            margin-bottom: 1rem;
        }

        #learn-content-container li {
            margin-bottom: 5px;
        }

        /* 1. Bloquear scroll general de la página para evitar el "doble scroll" */
        html,
        body {
            height: 100%;
            width: 100%;
            overflow: hidden;
            /* IMPORTANTE: Quita el scroll del navegador */
            margin: 0;
            padding: 0;
            position: fixed;
            /* Asegura que no se mueva en iOS */
        }

        /* 2. Asegurar que el contenedor principal ocupe todo pero permita scroll en móvil durante creación */
        .nu-main-content {
            height: 100vh;
            width: 100%;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        /* Permitir scroll en móvil durante creación */
        @media (max-width: 768px) {
            #loading-view {
                overflow-y: auto !important;
                -webkit-overflow-scrolling: touch;
                height: 100vh;
                position: relative;
            }

            #loading-view .loading-content {
                min-height: 100vh;
                padding-bottom: 2rem;
            }

            #loading-view .creation-log-container {
                max-height: none !important;
                overflow-y: visible !important;
            }

            /* Permitir scroll en el contenedor de logs */
            #loading-view .log-content {
                overflow-y: auto !important;
                -webkit-overflow-scrolling: touch;
                max-height: 70vh;
            }
        }

        /* 3. El contenedor del Iframe debe ocupar el espacio restante */
        .result-preview-container {
            flex: 1;
            /* Ocupa todo el espacio disponible */
            height: 100%;
            width: 100%;
            overflow: hidden;
            /* El contenedor NO hace scroll */
            position: relative;
            -webkit-overflow-scrolling: touch;
            /* Suavidad en iOS */
        }

        /* 4. El Iframe es el único que debe permitir scroll interno */
        #result-iframe {
            width: 100%;
            height: 100%;
            border: none;
            display: block;
            overflow-y: auto;
            /* El iframe sí permite scroll */
        }

        /* 5. Asegurar que los paneles laterales también tengan su propio scroll */
        .nu-sidebar,
        .nu-right-sidebar,
        #creation-view,
        .data-pane-content {
            overflow-y: auto;
            overscroll-behavior: contain;
            /* Evita que el scroll afecte al padre */
        }

        /* --- ESTILOS ESPECÍFICOS PARA LOS POPUPS DE PERFIL Y SUSCRIPCIÓN --- */

        /* 1. Estilos de Perfil (Adaptados para Modal) */
        .profile-header-modal {
            height: 180px;
            background-size: cover;
            background-position: center;
            border-radius: 12px;
            position: relative;
            margin-bottom: 60px;
            background-color: var(--nu-input-bg);
        }

        .profile-main-info-modal {
            position: absolute;
            bottom: -50px;
            left: 20px;
            display: flex;
            align-items: flex-end;
            gap: 15px;
        }

        .profile-photo-modal {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            object-fit: cover;
            border: 4px solid var(--nu-secondary-bg);
            /* Borde del color del modal */
        }

        .stats-row-modal {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
            padding: 0 10px;
        }

        .stat-box {
            text-align: center;
        }

        .stat-num {
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--nu-text-primary);
        }

        .stat-label {
            font-size: 0.8rem;
            color: var(--nu-text-secondary);
        }

        /* 2. Estilos de Suscripción (Planes) */
        .plan-toggle-container {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 15px;
            margin-bottom: 25px;
        }

        .plans-grid-modal {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }

        .plan-card-modal {
            background: var(--nu-input-bg);
            border: 1px solid var(--nu-border);
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            transition: transform 0.2s, border-color 0.2s;
            display: flex;
            flex-direction: column;
        }

        .plan-card-modal.active-plan {
            border: 2px solid var(--nu-primary);
            box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
        }

        .plan-price {
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--nu-primary);
            margin: 10px 0;
        }

        .plan-features-list {
            list-style: none;
            padding: 0;
            text-align: left;
            font-size: 0.85rem;
            color: var(--nu-text-secondary);
            margin-bottom: 15px;
            flex-grow: 1;
        }

        .plan-features-list li {
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .plan-features-list i {
            color: var(--nu-success);
        }

        /* Barras de progreso */
        .usage-bar-container {
            background: var(--nu-input-bg);
            height: 10px;
            border-radius: 5px;
            margin-top: 5px;
            overflow: hidden;
        }

        .usage-bar-fill {
            height: 100%;
            background: var(--nu-primary);
            width: 0%;
            transition: width 0.5s ease;
        }

        /* --- FIX NUCLEAR DE SCROLL --- */
        html,
        body {
            position: fixed;
            /* Evita rebote elástico en iOS completo */
            width: 100%;
            height: 100%;
            overflow: hidden;
            /* Bloquea scroll en body */
        }

        .nu-main-content,
        #creation-view,
        .nu-modal-content,
        .data-pane-content {
            /* Habilitar scroll suave solo aquí */
            overflow-y: auto !important;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
        }

        /* --- FIX GRID MÓVIL (2 POR FILA) --- */
        @media (max-width: 768px) {
            .project-grid-container {
                display: grid;
                /* Forzar 2 columnas exactas */
                grid-template-columns: 1fr 1fr !important;
                gap: 10px !important;
                padding-bottom: 80px;
                /* Espacio para que el scroll llegue al final */
            }

            .project-card-preview-content i {
                font-size: 2rem;
            }

            .project-card-preview-content h3 {
                font-size: 0.95rem;
            }

            .project-card-info h4 {
                font-size: 0.8rem;
                /* Texto más pequeño */
            }
        }

        /* --- FIX MODALES TIPO APP (Sin X, respetan barra abajo) --- */
        @media (max-width: 768px) {
            .nu-modal-overlay {
                background-color: var(--nu-background);
                align-items: flex-start;
                z-index: 90;
                padding-top: 0;
                padding-bottom: var(--mobile-nav-height);
            }

            .nu-modal-overlay.active {
                padding-top: 0;
            }

            .nu-modal {
                width: 100% !important;
                max-width: 100% !important;
                height: auto !important;
                max-height: calc(100vh - var(--mobile-nav-height)) !important;
                border-radius: 0 !important;
                box-shadow: none !important;
                display: flex;
                flex-direction: column;
                margin: 0 !important;
            }

            #projects-modal .nu-modal {
                margin-top: 0 !important;
            }
            #projects-modal .nu-modal-header {
                padding-top: 76px !important;
            }

            .nu-modal-header .nu-modal-close-btn {
                display: none;
                /* Ocultar la X en móvil */
            }
            #connectors-modal .nu-modal-close-btn,
            #connect-service-modal .nu-modal-close-btn {
                display: flex !important;
                align-items: center;
                justify-content: center;
            }
            #connectors-modal .connectors-modal,
            #connect-service-modal .nu-modal {
                margin: 0 16px 24px 16px;
                max-height: calc(100vh - 100px);
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }
            .connectors-modal .connectors-modal-content {
                -webkit-overflow-scrolling: touch;
            }
            .connectors-modal-overlay { padding-top: 40px !important; padding-bottom: 24px !important; }
        }

        /* Color activo para botones del Nav Móvil */
        .nu-mobile-nav-link.active {
            color: var(--nu-primary) !important;
            font-weight: 700;
        }

        .nu-mobile-nav-link.active i {
            transform: scale(1.1);
            /* Pequeña animación */
        }

        /* --- ESTILOS DE LA BARRA DE BÚSQUEDA --- */
        .projects-filter-bar {
            display: flex;
            margin-top: 0.25rem;
            gap: 10px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }

        .search-input {
            flex-grow: 1;
            min-width: 120px;
            padding: 10px 15px;
            border-radius: 8px;
            border: 1px solid var(--nu-border);
            background: var(--nu-surface);
            color: var(--nu-text-primary);
        }

        .btn-papelera {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            border-radius: 8px;
            border: 1px solid var(--nu-border);
            background: var(--nu-surface);
            color: var(--nu-text-secondary);
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .btn-papelera:hover {
            background: var(--nu-surface-dark);
            color: var(--nu-text-primary);
            border-color: var(--nu-text-secondary);
        }

        .btn-papelera.active {
            background: rgba(220, 53, 69, 0.1);
            color: var(--nu-danger);
            border-color: var(--nu-danger);
        }

        .filter-select {
            padding: 10px;
            border-radius: 8px;
            border: 1px solid var(--nu-border);
            background: var(--nu-surface);
            color: var(--nu-text-primary);
        }

        /* --- NUEVAS TARJETAS (SIN IFRAME) --- */
        .project-card {
            background-color: var(--nu-background);
            border: 1px solid var(--nu-border);
            border-radius: 12px;
            overflow: hidden;
            cursor: pointer;
            transition: transform 0.2s ease, border-color 0.2s;
            display: flex;
            flex-direction: column;
            height: 100%;
            /* Para que todas midan lo mismo */
        }

        .project-card:hover {
            transform: translateY(-3px);
            border-color: var(--nu-primary);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }

        /* Encabezado visual de la tarjeta (Icono en vez de Iframe) */
        .project-card-header {
            height: 80px;
            background: linear-gradient(135deg, var(--nu-surface-dark) 0%, var(--nu-surface) 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            color: var(--nu-primary);
            position: relative;
        }

        /* Badges de estado/categoría */
        .card-badges {
            position: absolute;
            top: 8px;
            right: 8px;
            display: flex;
            gap: 5px;
        }

        .card-badge {
            font-size: 0.65rem;
            padding: 2px 6px;
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.9);
            color: var(--nu-text-secondary);
            font-weight: 600;
            text-transform: uppercase;
        }

        .card-badge.status-active {
            color: var(--nu-success);
        }

        .card-badge.status-suspended {
            color: var(--nu-danger);
        }

        .project-card-info {
            padding: 12px;
            display: flex;
            flex-direction: column;
            gap: 5px;
            flex-grow: 1;
        }

        .project-card-info h4 {
            font-size: 0.95rem;
            font-weight: 700;
            margin: 0;
            line-height: 1.2;
            /* Limitar a 2 líneas */
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .project-meta {
            font-size: 0.75rem;
            color: var(--nu-text-secondary);
            display: flex;
            justify-content: space-between;
            margin-top: auto;
            /* Empuja esto al fondo */
            padding-top: 8px;
            border-top: 1px solid var(--nu-surface-dark);
        }

        /* --- GRID RESPONSIVE (max 3 columnas desktop) --- */
        .project-grid-container {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
            padding-bottom: 50px;
        }
        @media (max-width: 1200px) {
            .project-grid-container { grid-template-columns: repeat(3, 1fr); }
        }
        @media (max-width: 900px) {
            .project-grid-container { grid-template-columns: repeat(2, 1fr); }
        }
        @media (max-width: 768px) {
            .project-grid-container {
                grid-template-columns: 1fr 1fr !important;
                gap: 10px !important;
            }

            .project-card-header {
                height: 60px;
                /* Más bajito en móvil */
                font-size: 1.5rem;
            }
        }

        /* Quick actions overlay on project cards - always visible */
        .project-card-quick-actions {
            position: absolute;
            top: 10px;
            right: 10px;
            display: flex;
            gap: 5px;
            opacity: 1;
            transform: translateY(0);
            transition: all 0.2s ease;
            z-index: 5;
            pointer-events: auto;
        }

        .quick-action-btn {
            width: 30px;
            height: 30px;
            border-radius: 8px;
            border: none;
            background: var(--nu-background);
            color: var(--nu-text-secondary);
            font-size: 0.72rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .quick-action-btn:hover {
            background: var(--nu-primary);
            color: white;
            transform: scale(1.1);
        }

        .quick-action-btn.btn-danger:hover {
            background: var(--nu-danger);
            color: white;
        }

        /* Ajustes para ocultar */
        .hidden {
            display: none !important;
        }

        /* --- ESTILOS DEL MODAL DE AUTENTICACIÓN (Guest Mode) --- */

        /* Ajuste específico para el contenido centrado */
        #auth-modal .nu-modal-content {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            padding: 10px;
        }

        /* Títulos y Subtítulos del Modal */
        #auth-modal h2 {
            font-size: 1.8rem;
            margin-bottom: 0.5rem;
            font-weight: 700;
        }

        #auth-modal p {
            color: var(--nu-text-secondary);
            font-size: 0.95rem;
            margin-bottom: 1.5rem;
        }

        /* Botón de Google */
        #btn-google-auth {
            background-color: #ffffff !important;
            color: #333333 !important;
            border: 1px solid #e0e0e0;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            font-weight: 600;
            padding: 12px;
            margin-bottom: 1rem;
            transition: background-color 0.2s;
        }

        #btn-google-auth:hover {
            background-color: #f1f1f1 !important;
        }

        /* Separador "O" */
        .auth-separator {
            display: flex;
            align-items: center;
            color: var(--nu-text-secondary);
            margin: 1.5rem 0;
            font-size: 0.85rem;
        }

        .auth-separator hr {
            flex-grow: 1;
            border: 0;
            border-top: 1px solid var(--nu-border);
        }

        .auth-separator span {
            padding: 0 10px;
            font-weight: 500;
        }

        /* Formularios internos */
        #form-login-modal,
        #form-register-modal {
            text-align: left;
            /* Alinear inputs a la izquierda */
            width: 100%;
        }

        /* Reutilizando tu clase .right-panel-input para que se vea igual al resto */
        #auth-modal .right-panel-input {
            background-color: var(--nu-surface);
            border: 1px solid var(--nu-border);
            color: var(--nu-text-primary);
            width: 100%;
            margin-bottom: 0;
            /* El margen lo da el form-group */
        }

        #auth-modal .right-panel-input:focus {
            border-color: var(--nu-primary);
            outline: none;
        }

        /* Logo del modal = misma marca N* de la barra lateral (no la N azul). */
        #auth-modal .n3-auth-logo {
            width: 44px;
            height: 44px;
            margin: 0 auto 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--nu-text-primary, #111);
        }
        #auth-modal .n3-auth-logo .n3-mark-svg {
            width: 36px;
            height: 36px;
            display: block;
        }
        body[data-theme="dark"] #auth-modal .n3-auth-logo {
            color: #fff;
        }

        /* Combobox «¿A qué te dedicas?» — mismo fondo que los inputs, no select nativo. */
        #auth-modal .n3-auth-combo {
            position: relative;
            width: 100%;
        }
        #auth-modal .n3-auth-combo-btn {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            width: 100%;
            text-align: left;
            cursor: pointer;
            border-radius: 12px;
            padding: 12px 14px;
            font: inherit;
            background-color: var(--nu-surface) !important;
            border: 1px solid var(--nu-border);
            color: var(--nu-text-primary);
        }
        #auth-modal .n3-auth-combo-btn:focus {
            border-color: var(--nu-primary);
            outline: none;
        }
        #auth-modal .n3-auth-combo-btn.is-placeholder .n3-auth-combo-label {
            color: var(--nu-text-secondary, #9ca3af);
            opacity: 0.85;
        }
        #auth-modal .n3-auth-combo-chev {
            width: 16px;
            height: 16px;
            flex: 0 0 auto;
            opacity: 0.7;
        }
        #auth-modal .n3-auth-combo-list {
            position: absolute;
            left: 0;
            right: 0;
            top: calc(100% + 6px);
            z-index: 20;
            margin: 0;
            padding: 6px;
            list-style: none;
            max-height: 220px;
            overflow: auto;
            border-radius: 12px;
            border: 1px solid var(--nu-border);
            background: var(--nu-surface);
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
            text-align: left;
        }
        #auth-modal .n3-auth-combo-list[hidden] {
            display: none !important;
        }
        #auth-modal .n3-auth-combo-list li {
            padding: 10px 12px;
            border-radius: 8px;
            cursor: pointer;
            color: var(--nu-text-primary);
            font-size: 0.92rem;
        }
        #auth-modal .n3-auth-combo-list li:hover,
        #auth-modal .n3-auth-combo-list li[aria-selected="true"] {
            background: rgba(29, 78, 216, 0.12);
            color: var(--nu-primary, #1D4ED8);
        }

        /* Enlace de "Olvidaste contraseña" y cambios de vista */
        #auth-modal a {
            color: var(--nu-primary);
            text-decoration: none;
            font-weight: 600;
            transition: color 0.2s;
        }

        #auth-modal a:hover {
            color: var(--nu-primary-hover);
            text-decoration: underline;
        }

        /* Clase utilitaria para ocultar vistas (Login vs Registro) */
        .hidden {
            display: none !important;
        }

        /* Ajuste responsive para el modal en móviles */
        @media (max-width: 768px) {
            #auth-modal .nu-modal {
                /* En móvil queremos que se vea abajo o centrado, pero con margen */
                width: 90% !important;
                max-height: 90vh;
                border-radius: 16px !important;
                /* Recuperar bordes redondeados si se perdieron */
            }
        }

        #creation-view {
            padding: 2rem 1rem;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            display: flex;
            flex-direction: column;
            align-items: center;
            /* POR DEFECTO: Centrado verticalmente */
            justify-content: center;
            height: 100%;
            flex: 1;
            min-height: 0;
            /* Necesario para scroll en contenedor flex */
            transition: justify-content 0.3s ease;
        }

        /* Cuando hay proyectos, empujamos todo arriba; el scroll sigue en #creation-view */
        #creation-view.has-projects {
            justify-content: flex-start;
        }

        /* --- ESTILOS INPUT TIPO GEMINI --- */

        /* 1. La Caja Principal (Input Box) */
        .creation-input-box {
            background-color: var(--nu-surface);
            /* Fondo gris claro/oscuro */
            border-radius: 16px;
            /* Bordes muy redondeados */
            padding: 16px;
            display: flex;
            border: 1px solid var(--nu-border);
            flex-direction: column;
            gap: 10px;
            transition: border-color 0.2s, box-shadow 0.2s;
            position: relative;
            /* Para Drag & Drop */
            transition: background-color 0.2s;
        }

        /* Efecto al hacer clic o arrastrar archivos */
        .creation-input-box:focus-within,
        .creation-input-box.drag-over {
            border-color: var(--nu-primary);
            box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
            /* Resplandor suave */
        }

        .creation-input-box.drag-over {
            background-color: var(--nu-surface-dark);
        }

        /* 2. Área de Previsualización de Imágenes (Arriba) */

        .image-preview-container.hidden {
            display: none;
        }

        /* Miniaturas */
        .image-thumbnail-wrapper {
            position: relative;
            width: 60px;
            height: 60px;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid var(--nu-border);
        }

        .image-thumbnail-wrapper img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        /* Botón X para borrar imagen */
        .delete-image-btn {
            position: absolute;
            top: 2px;
            right: 2px;
            background: rgba(0, 0, 0, 0.6);
            color: white;
            border: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            font-size: 10px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .delete-image-btn:hover {
            background: var(--nu-danger);
        }

        /* 3. Textarea (Invisible visualmente, parece parte de la caja) */
        .prompt-textarea {
            width: 100%;
            background: transparent;
            border: none;
            color: var(--nu-text-primary);
            font-family: inherit;
            font-size: 1rem;
            line-height: 1.5;
            resize: none;
            /* Sin resize manual */
            outline: none;
            min-height: 24px;
            max-height: 200px;
            /* Scroll si es muy largo */
            overflow-y: hidden;
            /* Se ajustará con JS */
        }

        .prompt-textarea::placeholder {
            color: var(--nu-text-secondary);
        }

        /* 4. Barra de Acciones Inferior */
        .creation-actions-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-top: 5px;
        }

        /* Connect your tools bar - pegada al textarea */
        /* Conectores: oculto temporalmente */
        #connect-tools-bar,
        #connect-tools-reopen {
            display: none !important;
        }

        .connect-tools-bar {
            display: flex;
            align-items: center;
            width: 100%;
            margin-top: 8px;
            padding: 10px 14px;
            background: var(--nu-surface);
            border: 1px solid var(--nu-border);
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.2s, border-color 0.2s;
        }
        .connect-tools-bar:hover {
            background: var(--nu-surface-dark);
            border-color: var(--nu-primary);
        }
        .connect-tools-inner {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
        }
        .connect-tools-icon {
            color: var(--nu-text-secondary);
            font-size: 1rem;
        }
        .connect-tools-text {
            color: var(--nu-text-primary);
            font-size: 0.9rem;
            font-weight: 500;
        }
        .connect-tools-icons {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-left: auto;
        }
        .connect-tools-icons img {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            object-fit: cover;
        }
        .connect-tools-close {
            background: none;
            border: none;
            color: var(--nu-text-secondary);
            cursor: pointer;
            padding: 4px;
            border-radius: 50%;
            font-size: 0.85rem;
        }
        .connect-tools-close:hover {
            color: var(--nu-text-primary);
            background: var(--nu-surface-dark);
        }
        @media (max-width: 768px) {
            .connect-tools-bar.connect-tools-has-icons .connect-tools-text { display: none; }
            .connect-tools-bar.connect-tools-has-icons .connect-tools-icon { margin-right: 0; }
        }

        .actions-left,
        .actions-right {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        /* --- AI Model Picker (Custom Combobox) --- */
        .ai-model-picker {
            position: relative;
        }

        .ai-model-picker-trigger {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 5px 10px;
            border: 1px solid var(--nu-border);
            background: var(--nu-surface);
            color: var(--nu-text-primary);
            border-radius: 20px;
            font-size: 0.78rem;
            cursor: pointer;
            transition: all 0.2s ease;
            white-space: nowrap;
            font-weight: 500;
            font-family: inherit;
        }

        .ai-model-picker-trigger:hover {
            border-color: var(--nu-primary);
            background: var(--nu-surface-dark);
        }

        .ai-model-icon {
            width: 16px;
            height: 16px;
            object-fit: contain;
            flex-shrink: 0;
        }

        .ai-model-chevron {
            font-size: 0.55rem;
            color: var(--nu-text-secondary);
            transition: transform 0.2s;
        }

        .ai-model-picker.open .ai-model-chevron {
            transform: rotate(180deg);
        }

        .ai-model-dropdown {
            position: absolute;
            bottom: calc(100% + 8px);
            left: 0;
            background: var(--nu-background);
            border: 1px solid var(--nu-border);
            border-radius: 12px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
            min-width: 240px;
            max-height: 60vh;            /* LAB: nunca más alto que la pantalla */
            overflow-y: auto;            /* LAB: scroll si hay muchos modelos → no se corta */
            -webkit-overflow-scrolling: touch;
            padding: 6px;
            z-index: 10000;              /* LAB: por encima de todo */
            opacity: 0;
            visibility: hidden;
            transform: translateY(8px);
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        /* LAB: en pantallas bajas, abrir hacia ABAJO para que se vea completo */
        @media (max-height: 760px) {
            .ai-model-dropdown { bottom: auto; top: calc(100% + 8px); max-height: 55vh; }
        }

        .ai-model-picker.open .ai-model-dropdown {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .ai-model-option {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.15s;
        }

        .ai-model-option:hover {
            background: var(--nu-surface);
        }

        .ai-model-option.active {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.04));
        }

        .ai-model-opt-icon {
            width: 22px;
            height: 22px;
            object-fit: contain;
            flex-shrink: 0;
            border-radius: 4px;
        }

        .ai-model-opt-info {
            display: flex;
            flex-direction: column;
            flex: 1;
        }

        .ai-model-opt-name {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--nu-text-primary);
        }

        .ai-model-opt-desc {
            font-size: 0.7rem;
            color: var(--nu-text-secondary);
            margin-top: 1px;
        }

        .ai-model-check {
            color: var(--nu-primary);
            font-size: 0.75rem;
            opacity: 0;
            transition: opacity 0.15s;
        }

        .ai-model-option.active .ai-model-check {
            opacity: 1;
        }

        /* Botones de Icono (Redondos y limpios) */
        .action-icon-btn {
            background: transparent;
            border: none;
            color: var(--nu-text-secondary);
            width: 36px;
            height: 36px;
            border-radius: 50%;
            font-size: 1.1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
        }

        .action-icon-btn:hover {
            background-color: var(--nu-surface-dark);
            color: var(--nu-text-primary);
        }

        .action-icon-btn.active {
            color: var(--nu-danger);
            /* Para el microfono activo */
            background-color: rgba(220, 53, 69, 0.1);
        }

        /* Botón Enviar (Destacado) */
        .action-icon-btn.send-btn {
            background-color: var(--nu-primary);
            color: white;
        }

        .action-icon-btn.send-btn:hover:not(:disabled) {
            background-color: var(--nu-primary-hover);
            transform: scale(1.05);
        }

        .action-icon-btn.send-btn:disabled {
            background-color: var(--nu-surface-dark);
            color: var(--nu-text-secondary);
            cursor: not-allowed;
            opacity: 0.7;
        }

        /* Ajustes Móvil */
        @media (max-width: 768px) {
            .creation-input-box {
                padding: 12px;
            }

            .action-icon-btn {
                width: 34px;
                height: 34px;
                font-size: 1rem;
            }
        }

        /* FORZAR VISIBILIDAD DE PREVIEWS */
        #image-preview-container {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            width: 100%;
            margin-bottom: 10px;
            min-height: 0;
            /* Evita colapsos raros */
        }

        #image-preview-container.hidden {
            display: none !important;
        }

        .image-thumbnail-wrapper {
            width: 60px;
            height: 60px;
            border-radius: 8px;
            overflow: hidden;
            position: relative;
            border: 1px solid var(--nu-border);
            background-color: #000;
            /* Fondo negro para ver si carga */
            flex-shrink: 0;
        }

        .image-thumbnail-wrapper img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            /* Elimina espacios fantasma */
        }

        /* --- GESTIÓN DE VISTAS (SPA) --- */
        .nu-view {
            display: none !important;
            /* Oculto por defecto */
            width: 100%;
            height: 100%;
            overflow: hidden;
            /* Evita scrolls fantasma */
        }

        .nu-view.active {
            display: flex !important;
            /* Solo la activa se ve */
            flex-direction: column;
        }

        /* Excepción: La vista de creación necesita scroll interno */
        #creation-view.active {
            overflow-y: auto;
        }

        /* --- NUEVOS ESTILOS DE MODALES PRO (REEMPLAZO) --- */

        /* 1. Estandarización del Modal Grande */
        .nu-modal-pro {
            width: 95%;
            max-width: 1100px;
            /* Mucho más ancho, como Lovable */
            height: 85vh;
            /* Altura consistente */
            max-height: 800px;
            background-color: var(--nu-background);
            border-radius: 16px;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            /* Importante para el layout interno */
            border: 1px solid var(--nu-border);
        }

        /* 2. Layout interno del Perfil (Sidebar Izq + Contenido Der) */
        .profile-layout-container {
            display: flex;
            height: 100%;
            overflow: hidden;
        }

        /* Sidebar del modal (Izquierda) */
        .profile-sidebar-panel {
            width: 280px;
            background-color: var(--nu-surface);
            border-right: 1px solid var(--nu-border);
            padding: 30px 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            flex-shrink: 0;
        }

        /* Contenido del modal (Derecha - Scrollable) */
        .profile-content-panel {
            flex-grow: 1;
            padding: 40px;
            overflow-y: auto;
            background-color: var(--nu-background);
        }

        /* Elementos del Sidebar de Perfil */
        .pro-avatar-container {
            position: relative;
            width: 120px;
            height: 120px;
            margin-bottom: 15px;
        }

        .pro-avatar {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
            border: 4px solid var(--nu-primary);
        }

        .pro-user-name {
            font-size: 1.2rem;
            font-weight: 700;
            text-align: center;
            margin-bottom: 5px;
            color: var(--nu-text-primary);
        }

        .pro-user-role {
            font-size: 0.85rem;
            color: var(--nu-text-secondary);
            background: var(--nu-surface-dark);
            padding: 4px 12px;
            border-radius: 20px;
        }

        /* Grid del Formulario (Inputs bonitos) */
        .settings-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 30px;
        }

        .full-width {
            grid-column: 1 / -1;
        }

        .input-label {
            display: block;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--nu-text-secondary);
            margin-bottom: 8px;
        }

        .pro-input {
            width: 100%;
            padding: 12px;
            border-radius: 8px;
            border: 1px solid var(--nu-border);
            background-color: var(--nu-surface);
            color: var(--nu-text-primary);
            font-size: 0.95rem;
            transition: border-color 0.2s;
        }

        .pro-input:focus {
            border-color: var(--nu-primary);
            outline: none;
        }

        /* Tu Consumo - Estilos profesionales */
        .tu-consumo-section {
            background: var(--nu-surface);
            border: 1px solid var(--nu-border);
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 32px;
        }
        .tu-consumo-title {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--nu-text-primary);
            margin-bottom: 6px;
        }
        .tu-consumo-desc {
            font-size: 0.9rem;
            color: var(--nu-text-secondary);
            margin-bottom: 20px;
        }
        .credits-summary-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
            gap: 12px;
            margin-bottom: 20px;
        }
        .credits-summary-card {
            padding: 14px;
            border-radius: 12px;
            background: var(--nu-background);
            border: 1px solid var(--nu-border);
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .credits-summary-card:hover {
            border-color: var(--nu-primary);
            box-shadow: 0 2px 8px rgba(124, 58, 237, 0.12);
        }
        .credits-summary-label {
            font-size: 0.75rem;
            color: var(--nu-text-secondary);
            margin-bottom: 4px;
        }
        .credits-summary-value {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--nu-text-primary);
        }
        .tu-consumo-total-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 0;
            border-top: 1px solid var(--nu-border);
            margin-bottom: 16px;
        }
        .tu-consumo-total-label {
            font-size: 1rem;
            font-weight: 600;
            color: var(--nu-text-primary);
        }
        .tu-consumo-total-value {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--nu-primary);
        }
        .tu-consumo-btn {
            width: 100%;
            padding: 12px 20px;
            background: var(--nu-surface);
            border: 1px solid var(--nu-border);
            border-radius: 10px;
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--nu-text-primary);
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .tu-consumo-btn:hover {
            background: var(--nu-primary);
            border-color: var(--nu-primary);
            color: white;
        }
        .profile-info-section {
            margin-top: 32px;
        }
        .profile-section-title {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--nu-text-primary);
            margin-bottom: 20px;
        }

        /* Barras de Progreso Estilizadas */
        .usage-stats-container {
            background-color: var(--nu-surface);
            border: 1px solid var(--nu-border);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 30px;
        }

        .progress-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
            font-size: 0.9rem;
            font-weight: 500;
        }

        .pro-progress-track {
            height: 8px;
            background-color: var(--nu-surface-dark);
            border-radius: 4px;
            overflow: hidden;
            margin-bottom: 20px;
        }

        .pro-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--nu-primary), #a855f7);
            border-radius: 4px;
            width: 0%;
            transition: width 1s ease;
        }

        /* Ajuste Móvil */
        @media (max-width: 768px) {
            .profile-layout-container {
                flex-direction: column;
                overflow-y: auto;
            }

            .profile-sidebar-panel {
                width: 100%;
                border-right: none;
                border-bottom: 1px solid var(--nu-border);
                flex-direction: row;
                padding: 15px;
                justify-content: flex-start;
                gap: 15px;
            }

            .pro-avatar-container {
                width: 60px;
                height: 60px;
                margin: 0;
            }

            .settings-grid {
                grid-template-columns: 1fr;
            }

            .nu-modal-pro {
                height: 100%;
                max-height: none;
                border-radius: 0;
                width: 100%;
            }
        }

       
        /* --- NUEVOS ESTILOS SUSCRIPCIÓN (MODERNO) --- */
        .plans-container-modern {
            display: flex;
            gap: 20px;
            justify-content: center;
            padding: 20px 0;
            flex-wrap: wrap;
        }

        .plan-card-modern {
            background: #fff;
            border: 1px solid var(--nu-border);
            border-radius: 16px;
            padding: 30px;
            width: 300px;
            display: flex;
            flex-direction: column;
            transition: transform 0.2s, box-shadow 0.2s;
            position: relative;
            text-align: left;
        }

        .plan-card-modern:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
            border-color: var(--nu-primary);
        }


        .plan-desc {
            font-size: 0.9rem;
            color: var(--nu-text-secondary);
            min-height: 40px;
            margin-bottom: 20px;
        }

        .plan-price-box {
            margin-bottom: 25px;
        }



        .plan-period {
            color: var(--nu-text-secondary);
            font-size: 1rem;
        }

        .plan-btn {
            width: 100%;
            padding: 12px;
            border-radius: 8px;
            border: none;
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.2s;
            margin-bottom: 25px;
        }

        .plan-btn.primary {
            background-color: var(--nu-primary);
            /* Morado */
            color: white;
        }

        .plan-btn.primary:hover {
            background-color: var(--nu-primary-hover);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }

        .plan-btn.outline {
            background-color: transparent;
            border: 1px solid var(--nu-text-primary);
            color: var(--nu-text-primary);
        }

        .plan-features {
            list-style: none;
            padding: 0;
            margin: 0;
            font-size: 0.9rem;
            color: var(--nu-text-secondary);
        }

        .plan-features li {
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .plan-features li i {
            color: var(--nu-text-primary);
            /* Checkmark negro/gris */
            font-size: 0.8rem;
        }

        /* Modo oscuro ajustes */
        body[data-theme="dark"] .plan-card-modern {
            background: var(--nu-surface);
            border-color: var(--nu-border);
        }

        /* Asegurar que el popup genérico esté siempre encima (incl. modal imagen z-index:10002) */
        #generic-popup {
            z-index: 10005 !important;
        }

        #generic-popup .nu-modal {
            border: 2px solid var(--nu-primary);
            /* Borde elegante */
            box-shadow: 0 0 50px rgba(99, 102, 241, 0.3);
            /* Resplandor */
        }

        /* Busca esto en tu <style>: */
        .plan-card-modern {
            background: #fff;
            border: 1px solid var(--nu-border);
            border-radius: 16px;
            padding: 30px;
            width: 300px;
            /* <--- ESTO ES EL PROBLEMA */
            display: flex;
            flex-direction: column;
            transition: transform 0.2s, box-shadow 0.2s;
            position: relative;
            text-align: left;
        }

        /* REEMPLÁZALO POR ESTO: */
        .plan-card-modern {
            background: #fff;
            border: 1px solid var(--nu-border);
            border-radius: 16px;
            padding: 30px;

            /* --- CAMBIOS CLAVE AQUÍ --- */
            flex: 1;
            /* Crece para ocupar espacio */
            min-width: 280px;
            /* No se hace más pequeño que esto */
            max-width: 350px;
            /* No se hace gigante en pantallas enormes */
            width: auto;
            /* Quitamos el ancho fijo */
            /* -------------------------- */

            display: flex;
            flex-direction: column;
            transition: transform 0.2s, box-shadow 0.2s;
            position: relative;
            text-align: left;
        }

        .plans-container-modern {
            display: flex;
            gap: 20px;
            justify-content: center;
            padding: 20px 0;
            flex-wrap: wrap;
            /* Esto permite que en móviles sí se bajen uno debajo de otro */
        }

        /* Estilos para botones en popup móvil */
        @media (max-width: 768px) {
            .nu-modal-footer {
                flex-direction: column-reverse;
                /* El botón principal (oferta) arriba */
                gap: 10px;
                align-items: stretch;
                /* Ocupar todo el ancho */
            }

            .nu-btn.btn-full-mobile {
                width: 100% !important;
                margin: 0 !important;
                padding: 14px !important;
                font-size: 1rem !important;
                justify-content: center;
            }

            /* Estilo "Fantasma" para el botón secundario */
            .nu-btn.secondary-ghost {
                background: transparent;
                border: 1px solid var(--nu-border);
                color: var(--nu-text-secondary);
            }
        }

        /* --- ESTILOS MODAL SUSCRIPCIÓN ESTILO LOVABLE --- */
        .nu-modal.nu-modal-pro {
            max-width: 1100px !important;
            /* Un poco más estrecho para que no se desparrame */
            width: 100% !important;
            background-color: var(--nu-background);
            padding: 0px;
            /* Fondo blanco limpio */
            border-radius: 12px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
            border: none;
        }

        .nu-modal-header {
            padding: 20px 30px 10px 30px !important;
        }

        .nu-modal-content {
            padding: 10px 30px 40px 30px !important;
        }

        #modal-suscripcion-custom .nu-modal-content {
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            max-height: 75vh;
        }

        /* Títulos más sutiles */
        .modal-title-main {
            font-size: 1.25rem;
            /* 20px */
            font-weight: 600;
            color: var(--nu-text-on-primary);
        }

        .modal-subtitle {
            font-size: 0.9rem;
            color: #6b7280;
            margin-top: 4px;
        }

        /* Grid de Planes */
        .plans-container-modern {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        /* Tarjeta Estilo Lovable */
        .plan-card-modern {
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            padding: 24px;
            display: flex;
            flex-direction: column;
            transition: all 0.2s ease;
            position: relative;
            /* Quitar sombras pesadas por defecto para que se vea plano y limpio */
            box-shadow: none;
        }

        .plan-card-modern:hover {
            border-color: #d1d5db;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
            transform: translateY(-2px);
        }

        /* Header de la tarjeta */
        .plan-name {
            font-size: 1rem;
            font-weight: 600;
            color: var(--nu-text-primary);
            margin-bottom: 8px;
        }

        .plan-desc {
            font-size: 0.85rem;
            color: var(--nu-text-primary);
            min-height: 40px;
            /* Alineación */
            line-height: 1.4;
            margin-bottom: 15px;
        }

        /* Precio Grande */
        .plan-price-box {
            margin-bottom: 5px;
            display: flex;
            align-items: baseline;
            gap: 4px;
        }

        .plan-price-number {
            font-size: 2.2rem;
            /* 36px aprox */
            font-weight: 700;
            color: var(--nu-text-primary);
            letter-spacing: -1px;
        }

        .plan-period {
            font-size: 0.9rem;
            color: var(--nu-text-primary);
            font-weight: 400;
        }

        /* El Toggle dentro de la tarjeta */
        .card-toggle-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 20px;
            height: 24px;
            /* Altura fija para evitar saltos */
        }

        .save-badge {
            background-color: #d1fae5;
            color: #065f46;
            font-size: 0.75rem;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 12px;
            display: none;
            /* Se muestra con JS */
        }

        /* Botón Upgrade Estilo Stripe/Lovable */
        .plan-btn {
            width: 100%;
            padding: 10px;
            border-radius: 6px;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
            margin-bottom: 20px;
            border: 1px solid transparent;
        }

        .plan-btn.primary {
            background-color: var(--nu-primary);
            /* Tu morado */
            color: white;
        }

        .plan-btn.primary:hover {
            background-color: var(--nu-primary-hover);
            box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
        }

        .plan-btn.outline {
            background-color: white;
            border: 1px solid #e5e7eb;
            color: #374151;
        }

        .plan-btn.outline:hover {
            border-color: #d1d5db;
            background-color: #f9fafb;
        }

        /* Lista de Features */
        .plan-features {
            list-style: none;
            padding: 0;
            margin: 0;
            border-top: 1px solid #f3f4f6;
            padding-top: 15px;
        }

        .plan-features li {
            font-size: 0.85rem;
            color: var(--nu-text-primary);
            margin-bottom: 10px;
            display: flex;
            align-items: flex-start;
            gap: 8px;
        }

        .plan-features li i {
            color: #10b981;
            /* Verde check */
            margin-top: 2px;
        }

        /* Estilos para tarjetas de tokens */
        .token-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
            border-color: var(--nu-primary);
        }

        .token-buy-btn:hover {
            background: var(--nu-primary-dark, #4f46e5) !important;
        }

        body[data-theme="dark"] .token-card {
            background: var(--nu-surface);
            border-color: var(--nu-border);
        }

        /* Planes modal - ajustes mobile */
        @media (max-width: 768px) {
            .plans-container-modern {
                grid-template-columns: 1fr;
                margin-top: 8px;
                padding: 0 4px;
            }
            #modal-suscripcion-custom .nu-modal-header {
                padding-top: 76px;
                padding-bottom: 12px;
                margin-bottom: 0;
            }
            #modal-suscripcion-custom .nu-modal-content {
                padding: 0 0 24px;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }
            #modal-suscripcion-custom .plan-card-modern {
                max-width: 100%;
                margin: 0 auto 16px;
            }
            #modal-suscripcion-custom .plans-container-modern {
                width: 100%;
                max-width: 100%;
            }

            .plan-card-modern{
                min-width: 100%;
            }
        }

        /* --- NUEVOS ESTILOS PARA PREVIEW DE IMÁGENES --- */

        #image-preview-container {
            display: flex;
            flex-wrap: nowrap;
            /* IMPORTANTE: No bajar a la siguiente línea */
            overflow-x: auto;
            /* Scroll horizontal si hay muchas */
            gap: 10px;
            width: 100%;
            margin-bottom: 5px;
            padding-bottom: 5px;
            /* Espacio para scroll */
            min-height: 0;

            /* Ocultar barra de scroll visualmente pero mantener funcionalidad */
            scrollbar-width: none;
            /* Firefox */
            -ms-overflow-style: none;
            /* IE/Edge */
        }

        /* Ocultar scrollbar en Chrome/Safari */
        #image-preview-container::-webkit-scrollbar {
            display: none;
        }

        #image-preview-container.hidden {
            display: none !important;
        }

        .image-thumbnail-wrapper {
            width: 70px;
            height: 70px;
            border-radius: 12px;
            /* Bordes más redondeados */
            overflow: hidden;
            position: relative;
            border: none;
            /* SIN BORDE */
            background-color: transparent;
            flex-shrink: 0;
            /* IMPORTANTE: Evita que se aplasten */
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            /* Sombra suave en vez de borde */
            transition: transform 0.2s;
        }

        .image-thumbnail-wrapper:hover {
            transform: scale(1.05);
        }

        .image-thumbnail-wrapper img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        /* Botón de borrar más estilizado */
        .delete-image-btn {
            position: absolute;
            top: 4px;
            right: 4px;
            background: rgba(0, 0, 0, 0.6);
            color: white;
            border: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            font-size: 10px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(2px);
            transition: background 0.2s;
        }

        .delete-image-btn:hover {
            background: var(--nu-danger);
        }

        /* Modal Imágenes: fullscreen sin tapar sidebar */
        .nu-modal-images-overlay {
            left: var(--sidebar-width-expanded);
            width: calc(100% - var(--sidebar-width-expanded));
            background: var(--nu-background);
            align-items: stretch;
            justify-content: stretch;
        }
        body.sidebar-collapsed .nu-modal-images-overlay {
            left: var(--sidebar-width-collapsed);
            width: calc(100% - var(--sidebar-width-collapsed));
        }
        .nu-modal-images-panel {
            display: flex;
            flex-direction: column;
            width: 100%;
            height: 100%;
            background: var(--nu-background);
            border-radius: 0;
            box-shadow: none;
        }
        .nu-modal-images-content {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
        }
        .images-gallery-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 20px;
        }
        @keyframes skeleton-shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }
        .image-card {
            background: var(--nu-surface);
            border: 1px solid var(--nu-border);
            border-radius: 12px;
            overflow: hidden;
            transition: box-shadow 0.2s, transform 0.2s;
        }
        .image-card:hover {
            box-shadow: 0 4px 16px rgba(0,0,0,0.08);
        }
        .image-card-create {
            min-height: 180px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            border: 2px dashed var(--nu-border);
            background: var(--nu-surface-dark);
        }
        .image-card-create:hover {
            border-color: var(--nu-primary);
            background: rgba(124, 58, 237, 0.06);
        }
        .image-card-create-inner {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            color: var(--nu-text-secondary);
        }
        .image-card-create-icon {
            font-size: 2.5rem;
            color: var(--nu-primary);
        }
        .image-card-create-text {
            font-weight: 600;
            font-size: 1rem;
        }
        .image-card-generated {
            cursor: pointer;
        }
        .image-card-generated .image-card-img-wrap {
            aspect-ratio: 16/9;
            overflow: hidden;
            background: var(--nu-surface-dark);
        }
        .image-card-generated .image-card-img-wrap img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .image-card-generated .image-card-body {
            padding: 12px;
        }
        .image-card-generated .image-card-prompt {
            font-size: 0.85rem;
            color: var(--nu-text-primary);
            margin-bottom: 8px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .image-card-generated .image-card-refs {
            display: flex;
            gap: 6px;
            margin-bottom: 8px;
            flex-wrap: wrap;
        }
        .image-card-generated .image-card-refs img {
            width: 36px;
            height: 36px;
            object-fit: cover;
            border-radius: 6px;
            border: 1px solid var(--nu-border);
        }
        .image-card-generated .image-card-meta {
            font-size: 0.75rem;
            color: var(--nu-text-secondary);
        }
        .orientation-toggle-group {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            background: var(--nu-surface-dark);
            padding: 6px;
            border-radius: 12px;
            border: 1px solid var(--nu-border);
        }
        .orientation-toggle-btn {
            flex: 1;
            min-width: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 10px 14px;
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--nu-text-secondary);
            background: transparent;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .orientation-toggle-btn:hover {
            color: var(--nu-text-primary);
            background: rgba(124, 58, 237, 0.08);
        }
        .orientation-toggle-btn.active {
            color: white;
            background: var(--nu-primary);
            box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
        }
        .create-image-ref-preview {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 10px;
        }
        .create-image-ref-preview .ref-thumb {
            position: relative;
            width: 64px;
            height: 64px;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid var(--nu-border);
        }
        .create-image-ref-preview .ref-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .create-image-ref-zone {
            min-height: 80px;
            padding: 12px;
            border-radius: 8px;
            transition: border-color 0.2s, background 0.2s;
        }
        .create-image-ref-zone-dragover {
            border: 2px dashed var(--nu-primary) !important;
            background: rgba(124, 58, 237, 0.08) !important;
        }
        .create-image-ref-preview .ref-thumb .ref-remove {
            position: absolute;
            top: 2px;
            right: 2px;
            width: 20px;
            height: 20px;
            background: rgba(0,0,0,0.6);
            color: white;
            border: none;
            border-radius: 50%;
            font-size: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        @media (max-width: 768px) {
            .nu-modal-images-overlay {
                left: 0;
                width: 100%;
            }
            .nu-modal-images-content {
                padding-bottom: calc(var(--mobile-nav-height, 60px) + 24px);
            }
            body.modal-images-open .nu-mobile-bottom-nav {
                z-index: 10001;
            }
            .images-gallery-grid {
                grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
                gap: 12px;
            }
        }

        /* Modal detalle imagen: sutil, centrado, compacto */
        .nu-modal-image-detail-overlay {
            display: flex !important;
            align-items: center;
            justify-content: center;
            background: rgba(0,0,0,0.5);
            padding: 20px;
        }
        .nu-modal-image-detail-overlay .nu-modal {
            margin: auto;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        }
        .nu-modal-back-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border: none;
            background: var(--nu-surface-dark);
            color: var(--nu-text-primary);
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
        }
        .nu-modal-back-btn:hover {
            background: var(--nu-border);
        }
        .image-detail-action-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            background: rgba(0,0,0,0.6);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9rem;
            text-decoration: none;
            transition: background 0.2s;
        }
        .image-detail-action-btn:hover {
            background: rgba(0,0,0,0.8);
        }
        .image-detail-action-btn-sm {
            width: 28px;
            height: 28px;
            font-size: 0.75rem;
        }
        .image-detail-action-btn-delete {
            background: rgba(220, 38, 38, 0.85);
        }
        .image-detail-action-btn-delete:hover {
            background: rgba(185, 28, 28, 1);
        }

        /* --- AGREGA ESTO AL FINAL DE TU CSS --- */

        /* 1. Preparamos la barra para animarse */
        .nu-mobile-bottom-nav {
            transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
            /* Animación suave */
            transform: translateY(0);
            /* Posición normal */
            will-change: transform;
            /* Optimización para móviles */
        }

        /* 2. Clase que la esconde hacia abajo */
        .nu-mobile-bottom-nav.nav-hidden {
            transform: translateY(100%);
            /* Se baja el 100% de su altura */
        }

        /* Credits + Language - Top Right Row (desktop) */
        .credits-and-lang-row {
            position: fixed;
            top: 1rem;
            right: 2rem;
            z-index: 10000;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .credits-display-pill {
            display: flex;
            align-items: center;
            padding: 8px 14px;
            background: var(--nu-background);
            border: 1px solid var(--nu-border);
            border-radius: 24px;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--nu-text-primary);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .credits-display-pill:hover {
            border-color: var(--nu-primary);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
        }
        .credits-display-pill.credits-low { border-color: var(--nu-warning); }
        .credits-display-pill.credits-negative { border-color: var(--nu-danger); color: var(--nu-danger); }
        .credits-display-pill .credits-label { margin-left: 6px; }

        /* Project type pill above prompt */
        .project-type-pill-wrap { margin-bottom: 8px; }
        .project-type-pill {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
            background: rgba(124, 58, 237, 0.15);
            color: var(--nu-primary);
            border: 1px solid rgba(124, 58, 237, 0.3);
        }

        /* Theme Toggle - posición manejada por top-navbar-wrapper */
        .theme-toggle-top-row {
            transition: margin-left 0.3s ease;
        }

        /* Top Navbar Wrapper - Desktop: theme 10px del sidebar, credits derecha */
        .top-navbar-wrapper {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 2rem 1rem 0;
            gap: 12px;
            background: transparent;
            pointer-events: none;
        }
        .top-navbar-wrapper > * {
            pointer-events: auto;
        }
        .top-navbar-wrapper .theme-toggle-top-row {
            margin-left: calc(var(--sidebar-width-expanded) + 10px);
            transition: margin-left 0.3s ease;
        }
        body.sidebar-collapsed .top-navbar-wrapper .theme-toggle-top-row {
            margin-left: calc(var(--sidebar-width-collapsed) + 10px);
        }
        .top-navbar-wrapper .theme-toggle-top-row {
            position: static !important;
            left: auto !important;
        }
        .top-navbar-wrapper .credits-and-lang-row {
            position: static !important;
            right: auto !important;
            margin-left: auto;
        }
        @media (max-width: 768px) {
            .top-navbar-wrapper {
                background: #1a1a2e;
                padding: 10px 16px;
                justify-content: flex-start;
                align-items: center;
                min-height: 48px;
                pointer-events: auto;
                box-shadow: 0 2px 12px rgba(0,0,0,0.15);
            }
            .top-navbar-wrapper .theme-toggle-top-row,
            .top-navbar-wrapper .credits-and-lang-row {
                display: flex !important;
                align-items: center !important;
            }
            .top-navbar-wrapper .theme-toggle-btn {
                flex-shrink: 0;
            }
            .top-navbar-wrapper .theme-toggle-top-row {
                margin-left: 0 !important;
            }
            .top-navbar-wrapper .credits-and-lang-row {
                margin-left: auto;
            }
            .top-navbar-wrapper .credits-display-pill,
            .top-navbar-wrapper .language-selector-trigger {
                background: rgba(255,255,255,0.1) !important;
                border-color: rgba(255,255,255,0.2) !important;
                color: #fff !important;
                height: 40px !important;
                min-height: 40px !important;
                padding: 0 14px !important;
        
                align-items: center !important;
            }
            .top-navbar-wrapper .credits-display-pill:hover,
            .top-navbar-wrapper .language-selector-trigger:hover {
                background: rgba(255,255,255,0.15) !important;
            }
            .top-navbar-wrapper .credits-display-pill .credits-label,
            .top-navbar-wrapper .credits-display-pill span,
            .top-navbar-wrapper .credits-display-pill i,
            .top-navbar-wrapper .language-selector-trigger span {
                color: #fff !important;
            }
            .top-navbar-wrapper .language-selector-trigger i {
                color: rgba(255,255,255,0.7) !important;
            }
            body:not(.in-result-view) #creation-view {
                padding-top: 68px;
            }
        }
        .theme-toggle-top-row .theme-toggle-btn {
            position: relative;
            width: 52px;
            height: 28px;
            border-radius: 100px;
            border: 1.5px solid var(--nu-border);
            background: var(--nu-surface-dark);
            cursor: pointer;
            padding: 0;
            transition: all 0.3s ease;
            outline: none;
        }
        .theme-toggle-top-row .theme-toggle-btn:hover {
            border-color: var(--nu-primary);
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
        }
        .theme-toggle-top-row .theme-toggle-thumb {
            position: absolute;
            top: 3px;
            left: 3px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: var(--nu-surface);
            border: 1.5px solid var(--nu-border);
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, border-color 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 1px 4px rgba(0,0,0,0.18);
        }
        .theme-toggle-top-row .theme-toggle-thumb svg {
            width: 11px;
            height: 11px;
            transition: opacity 0.2s ease, transform 0.3s ease;
            position: absolute;
        }
        .theme-toggle-top-row .theme-toggle-thumb .icon-sun {
            color: #F59E0B;
            stroke: #F59E0B;
            opacity: 1;
            transform: rotate(0deg) scale(1);
        }
        .theme-toggle-top-row .theme-toggle-thumb .icon-moon {
            color: var(--nu-primary);
            stroke: var(--nu-primary);
            opacity: 0;
            transform: rotate(-45deg) scale(0.7);
        }
        body[data-theme="dark"] .theme-toggle-top-row .theme-toggle-btn {
            background: rgba(139, 92, 246, 0.12);
            border-color: rgba(139, 92, 246, 0.3);
        }
        body[data-theme="dark"] .theme-toggle-top-row .theme-toggle-thumb {
            transform: translateX(24px);
            background: var(--nu-surface-dark);
            border-color: rgba(139, 92, 246, 0.3);
        }
        body[data-theme="dark"] .theme-toggle-top-row .theme-toggle-thumb .icon-sun {
            opacity: 0;
            transform: rotate(45deg) scale(0.7);
        }
        body[data-theme="dark"] .theme-toggle-top-row .theme-toggle-thumb .icon-moon {
            opacity: 1;
            transform: rotate(0deg) scale(1);
        }

        /* Language Selector - Modern Pill Style */
        .language-selector-custom {
            position: relative;
            top: auto;
            right: auto;
            z-index: 10000;
        }

        .language-selector-trigger {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 14px;
            background: var(--nu-background);
            border: 1px solid var(--nu-border);
            border-radius: 24px;
            cursor: pointer;
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--nu-text-primary);
            transition: all 0.25s ease;
            backdrop-filter: blur(12px);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }

        .language-selector-trigger:hover {
            border-color: var(--nu-primary);
            box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
            transform: translateY(-1px);
        }

        .language-selector-trigger i {
            font-size: 0.6rem;
            color: var(--nu-text-secondary);
            transition: transform 0.25s ease;
            margin-left: 2px;
        }

        .language-selector-custom.open .language-selector-trigger i {
            transform: rotate(180deg);
        }

        .language-selector-trigger .flag-icon {
            width: 20px;
            height: 15px;
            border-radius: 3px;
            object-fit: cover;
            border: 1px solid rgba(0, 0, 0, 0.08);
            flex-shrink: 0;
        }

        .language-selector-dropdown-menu {
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            background: var(--nu-background);
            border: 1px solid var(--nu-border);
            border-radius: 14px;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
            min-width: 200px;
            max-height: 0;
            overflow: hidden;
            opacity: 0;
            transform: translateY(-8px) scale(0.97);
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 10001;
        }

        .language-selector-custom.open .language-selector-dropdown-menu {
            max-height: 320px;
            opacity: 1;
            transform: translateY(0) scale(1);
            padding: 6px;
        }

        .language-selector-option {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            cursor: pointer;
            border-radius: 10px;
            transition: all 0.15s ease;
            color: var(--nu-text-primary);
            position: relative;
        }

        .language-selector-option:hover {
            background: var(--nu-surface);
        }

        .language-selector-option.active {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.06));
        }

        .language-selector-option.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 3px;
            height: 60%;
            background: var(--nu-primary);
            border-radius: 0 3px 3px 0;
        }

        .language-selector-option .flag-icon {
            width: 26px;
            height: 19px;
            border-radius: 4px;
            object-fit: cover;
            border: 1px solid rgba(0, 0, 0, 0.06);
            flex-shrink: 0;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        }

        .language-selector-option.active .flag-icon {
            border-color: var(--nu-primary);
        }

        .language-selector-option span {
            flex: 1;
            font-weight: 500;
            font-size: 0.85rem;
        }

        .language-selector-option.active span {
            color: var(--nu-primary);
            font-weight: 600;
        }

        /* Category Filter - Custom Combobox */
        .category-filter-custom {
            position: relative;
            display: inline-block;
        }

        .category-filter-trigger {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
            padding: 0.625rem 1rem;
            background: var(--nu-surface);
            border: 1px solid var(--nu-border);
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--nu-text-primary);
            min-width: 180px;
            transition: all 0.2s ease;
        }

        .category-filter-trigger:hover {
            background: var(--nu-surface-dark);
            border-color: var(--nu-primary);
        }

        .category-filter-trigger i {
            font-size: 0.8rem;
            color: var(--nu-text-secondary);
            transition: transform 0.2s ease;
        }

        .category-filter-custom.open .category-filter-trigger i {
            transform: rotate(180deg);
        }

        .category-filter-dropdown-menu {
            position: absolute;
            top: calc(100% + 0.5rem);
            left: 0;
            background: var(--nu-background);
            border: 1px solid var(--nu-border);
            border-radius: 8px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
            min-width: 100%;
            max-height: 0;
            overflow: hidden;
            opacity: 0;
            transform: translateY(-10px);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 10001;
        }

        .category-filter-custom.open .category-filter-dropdown-menu {
            max-height: 300px;
            opacity: 1;
            transform: translateY(0);
            padding: 0.5rem;
        }

        .category-filter-option {
            display: flex;
            align-items: center;
            padding: 0.75rem 1rem;
            cursor: pointer;
            border-radius: 6px;
            transition: all 0.2s ease;
            color: var(--nu-text-primary);
            font-size: 0.9rem;
        }

        .category-filter-option:hover {
            background: var(--nu-surface);
            color: var(--nu-primary);
        }

        .category-filter-option.active {
            background: var(--nu-primary);
            color: white;
            font-weight: 600;
        }

        /* WhatsApp Popup */
        .whatsapp-popup {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            z-index: 9999;
            background: linear-gradient(135deg, var(--nu-primary) 0%, var(--nu-primary-hover) 100%);
            border-radius: 16px;
            padding: 1rem 1.5rem;
            box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            gap: 1rem;
            color: white;
            font-weight: 600;
            max-width: 320px;
            animation: slideInUp 0.5s ease-out;
        }

        .whatsapp-popup:hover {
            transform: translateY(-4px);
            box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
        }

        .whatsapp-popup-close {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.875rem;
            transition: all 0.2s;
            z-index: 10;
        }

        .whatsapp-popup-close:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
        }

        .whatsapp-popup i {
            font-size: 1.5rem;
        }

        .whatsapp-popup-content {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            flex: 1;
        }

        .whatsapp-popup-title {
            font-size: 0.95rem;
            font-weight: 700;
            line-height: 1.3;
        }

        .whatsapp-popup-subtitle {
            font-size: 0.8rem;
            opacity: 0.9;
            font-weight: 400;
        }

        @keyframes slideInUp {
            from {
                transform: translateY(100px);
                opacity: 0;
            }

            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        /* WhatsApp Register Modal - obligatorio si no tiene número */
        .whatsapp-register-modal .country-selector-custom {
            position: relative;
            display: block;
            width: 100%;
        }
        .whatsapp-register-modal .country-selector-trigger {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 14px;
            background: var(--nu-surface);
            border: 1px solid var(--nu-border);
            border-radius: 10px;
            cursor: pointer;
            font-size: 0.95rem;
            color: var(--nu-text-primary);
            width: 100%;
        }
        .whatsapp-register-modal .country-selector-dropdown {
            position: absolute;
            top: calc(100% + 4px);
            left: 0;
            right: 0;
            background: var(--nu-background);
            border: 1px solid var(--nu-border);
            border-radius: 10px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            max-height: 220px;
            overflow-y: auto;
            z-index: 10002;
        }
        .whatsapp-register-modal .country-option {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            cursor: pointer;
            transition: background 0.15s;
        }
        .whatsapp-register-modal .country-option:hover {
            background: var(--nu-surface);
        }

        @keyframes slideOutDown {
            from {
                transform: translateY(0);
                opacity: 1;
            }

            to {
                transform: translateY(100px);
                opacity: 0;
            }
        }

        /* Prompt Pills */
        .prompt-pills-container {
            display: none !important;
            flex-wrap: nowrap;
            gap: 0.75rem;
            margin: 1.5rem 0;
            justify-content: center;
            overflow-x: auto;
            padding: 0.5rem;
            scrollbar-width: thin;
            scrollbar-color: var(--nu-primary) transparent;
        }

        .prompt-pills-container::-webkit-scrollbar {
            height: 6px;
        }

        .prompt-pills-container::-webkit-scrollbar-track {
            background: transparent;
        }

        .prompt-pills-container::-webkit-scrollbar-thumb {
            background: var(--nu-primary);
            border-radius: 3px;
        }

        .prompt-pills-container.expanded {
            justify-content: flex-start;
        }

        .prompt-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.625rem 1.25rem;
            background: var(--nu-surface);
            border: 1px solid var(--nu-border);
            border-radius: 24px;
            cursor: pointer;
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--nu-text-primary);
            transition: all 0.2s ease;
            white-space: nowrap;
        }

        .prompt-pill:hover {
            background: var(--nu-primary);
            color: white;
            border-color: var(--nu-primary);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }

        .prompt-pill.selected {
            background: var(--nu-primary);
            color: white;
            border-color: var(--nu-primary);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }

        .prompt-pill i {
            font-size: 0.75rem;
        }

        .prompt-pill.selected {
            background: var(--nu-primary);
            color: white;
            border-color: var(--nu-primary);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }

        .prompt-pill-more {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.625rem 1.25rem;
            background: var(--nu-surface);
            border: 1px solid var(--nu-border);
            border-radius: 24px;
            cursor: pointer;
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--nu-text-primary);
            transition: all 0.2s ease;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .prompt-pill-more:hover {
            background: var(--nu-primary);
            color: white;
            border-color: var(--nu-primary);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }

        @media (max-width: 768px) {
            .language-selector-custom {
                top: 0.0rem;
                right: 0.5rem;
            }

            .language-selector-trigger {
                font-size: 0.78rem;
                padding: 6px 10px;
            }

            /* WhatsApp popup visible en móvil también */
            /* .whatsapp-popup {
        display: none !important;
    } */

            .prompt-pills-container {
                gap: 0.5rem;
                margin: 1rem 0;
            }

            .prompt-pill {
                padding: 0.5rem 1rem;
                font-size: 0.8rem;
            }
        }

         /* --- FIX FINAL RESPONSIVE PARA MÓVIL --- */
        /* --- FIX FINAL DEFINITIVO: SCROLL FLUIDO MOBILE --- */
        @media (max-width: 768px) {

/* 1. Modal ocupa el 100% real de la pantalla */
.nu-modal-pro {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    overflow: hidden !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background-color: var(--nu-background);
}
.nu-modal-overlay .nu-modal:not(.nu-modal-pro) {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* 2. El Header se queda quieto arriba - espacio para navbar */
.nu-modal-header {
    flex-shrink: 0;
    z-index: 10;
    background-color: var(--nu-background);
    border-bottom: 1px solid var(--nu-border);
    padding-top: 76px !important;
}

/* 3. CONTENEDOR DE SCROLL ÚNICO Y FLUIDO */
.profile-layout-container {
    display: flex !important;
    flex-direction: column !important;

    /* TRUCO FLEXBOX PARA SCROLL PERFECTO: */
    flex-grow: 1 !important;
    height: 0 !important;
    /* Fuerza a calcular altura restante */
    min-height: 0 !important;

    overflow-y: auto !important;
    /* Scroll aquí */
    -webkit-overflow-scrolling: touch !important;
    /* Suavidad en iOS */
    padding-bottom: 80px !important;
    /* Espacio extra para que no choque abajo */
}

/* 4. Panel de la Foto (Parte de la lista) */
.profile-sidebar-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--nu-border);
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 20px;
    gap: 10px;
    background-color: var(--nu-surface);
    flex-shrink: 0;
    /* No se deforma al scrollear */
}

/* 5. Panel del Formulario (Parte de la lista) */
.profile-content-panel {
    padding: 20px !important;
    padding-bottom: 150px !important;
    /* Mucho espacio final para ver el último botón */
    overflow: visible !important;
    /* Quita scroll interno, usa el del padre */
    height: auto !important;
    background-color: var(--nu-background);
    flex-shrink: 0;
}

/* 6. Ajustes Visuales */
.pro-avatar-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px auto;
}

.settings-grid {
    grid-template-columns: 1fr !important;
    gap: 15px;
}

/* 7. Ajuste para que los Popups no se corten por el teclado */
.nu-modal-overlay {
    align-items: flex-start !important;
    /* Alineado arriba */
}
}

    /* Movements filter chips — outside media query so desktop gets the styles too */
    .mov-chip {
        display: inline-flex; align-items: center; gap: 5px;
        padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
        border: 1px solid var(--nu-border); background: var(--nu-surface-dark);
        color: var(--nu-text-secondary); cursor: pointer; transition: all 0.15s;
        font-family: inherit; line-height: 1.4; outline: none; appearance: none; -webkit-appearance: none;
    }
    .mov-chip:hover { border-color: var(--nu-primary); color: var(--nu-primary); background: rgba(139,92,246,0.07); }
    .mov-chip.active { background: var(--nu-primary); color: #fff; border-color: var(--nu-primary); }
    .mov-chip i { font-size: 0.7rem; }

/* --- CREDITS POPUP MOBILE: toggle al tocar de nuevo + espacio para nav inferior --- */
@media (max-width: 768px) {
    #modal-credits-movements.nu-modal-overlay {
        padding-bottom: var(--mobile-nav-height, 60px);
    }
    #modal-credits-movements .nu-modal {
        max-height: calc(100vh - var(--mobile-nav-height, 60px) - 20px) !important;
    }
    /* Botón X más grande y fácil de tocar en móvil para salir del panel de créditos */
    #modal-credits-movements .nu-modal-close-btn {
        width: 42px !important;
        height: 42px !important;
        font-size: 1.15rem !important;
        flex-shrink: 0;
    }
    /* Modal Crear imagen: espacio para nav inferior en móvil */
    #modal-create-image.nu-modal-overlay {
        padding-bottom: calc(var(--mobile-nav-height, 60px) + 20px);
        align-items: flex-start;
        overflow-y: auto;
    }
    #modal-create-image .nu-modal {
        max-height: calc(100vh - var(--mobile-nav-height, 60px) - 40px) !important;
        margin-bottom: calc(var(--mobile-nav-height, 60px) + 10px);
    }
}


/* ==== bloque <style> anidado en el body de index.html (6576-6580) ==== */
      .nu-plan-method-opt.selected{border-color:#7c3aed!important;background:#f5f3ff!important;}
      #plan-method-continue:not(:disabled){opacity:1!important;}
      #plan-method-continue:not(:disabled):hover{background:#6d28d9!important;}

/* ==== bloque LAB (27057-27063) ==== */
        .ai-model-pro-badge{font-size:9px;font-weight:700;background:linear-gradient(90deg,#7c3aed,#a855f7);color:#fff;padding:1px 5px;border-radius:6px;margin-left:4px;vertical-align:middle;}
        .ai-model-option[data-locked="1"]{opacity:.55;}
        .ai-model-option[data-locked="1"]::after{content:"🔒";margin-left:auto;padding-left:6px;}
        #lab-credit-badge{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:#6d28d9;background:#f3e8ff;border:1px solid #e9d5ff;border-radius:999px;padding:3px 10px;margin-left:8px;white-space:nowrap;}
        .dark #lab-credit-badge{background:#2a1f44;border-color:#4c3a73;color:#c4b5fd;}

/* ============================================================================
   CONTRASTE WCAG AA — regla universal del dueño (30-jul-2026)
   ----------------------------------------------------------------------------
   "no pongas en ningún lugar de la página texto claro sobre fondos claros y
    viceversa: si no se puede leer, no sirve."
   Medido con la misma matemática de luminancia relativa que usa
   SlidesEngine.fixContrast() (frontend/public/slides/engine.js), a través de
   _qa_tools/auditar_contraste.py sobre la página REAL.
   Cada valor de aquí abajo lleva su razón medida; no hay ninguno "a ojo".
   ========================================================================== */

/* El acento del modo oscuro era #8B5CF6 y se usaba como TEXTO sobre los fondos
   oscuros: 4,30:1 sobre #181227 y 4,46:1 sobre #0F1115 — por debajo de 4,5:1.
   #A78BFA da 6,70:1 sobre la superficie oscura y mantiene el morado. */
body[data-theme="dark"] {
  --nu-primary: #A78BFA;
}

/* Pero un botón relleno con ese morado claro y texto blanco daría 2,9:1. Los
   botones sólidos del modo oscuro se pintan con el morado profundo, donde el
   blanco da 7,10:1. */
body[data-theme="dark"] .nu-btn.primary,
body[data-theme="dark"] button.primary {
  background: #6D28D9;
  color: #fff;
  border-color: #6D28D9;
}

/* En modo CLARO el botón sólido usaba #8B5CF6 con texto blanco: 4,23:1.
   El morado de marca #7C3AED da 5,70:1 con blanco. */
body[data-theme="light"] .nu-btn.primary,
body:not([data-theme="dark"]) .nu-btn.primary {
  background: #7C3AED;
  color: #fff;
}
