/* ============================================================
   VIXcode Pro 7.0.0 Ultimate Edition - Sistema de Diseño
   Versión: 7.0.0 | Arquitectura modular enterprise
   Autor: VIX Hosting
   ============================================================ */

/* ========== RESET Y BASE ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ========== VARIABLES DE DISEÑO ========== */
:root {
    /* Colores primarios (escala 50-950) */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;
    --primary-950: #1e1b4b;

    /* Colores de estado */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Tema claro */
    --bg: #fafbfc;
    --surface: #ffffff;
    --surface2: #f0f2f5;
    --surface3: #e5e7eb;
    --text: #1a1a2e;
    --text2: #5a5a7a;
    --text3: #9ca3af;
    --accent: var(--primary-500);
    --accent-hover: var(--primary-600);
    --accent2: #3b82f6;
    --accent3: #10b981;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --hover: #f3f4f6;
    --hover-strong: #e5e7eb;
    --tab-active: var(--primary-50);
    --gold: #f59e0b;
    --gold-light: #fef3c7;

    /* Espaciado (base 4px) */
    --spacing-0: 0;
    --spacing-1: 4px;
    --spacing-2: 8px;
    --spacing-3: 12px;
    --spacing-4: 16px;
    --spacing-5: 20px;
    --spacing-6: 24px;
    --spacing-8: 32px;
    --spacing-10: 40px;
    --spacing-12: 48px;
    --spacing-16: 64px;
    --spacing-20: 80px;

    /* Alias de espaciado */
    --spacing-xs: var(--spacing-1);
    --spacing-sm: var(--spacing-2);
    --spacing-md: var(--spacing-4);
    --spacing-lg: var(--spacing-6);
    --spacing-xl: var(--spacing-8);

    /* Bordes */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    /* Sombras (sistema de elevación) */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* Transiciones */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Tipografía */
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

    /* Z-index (sistema de capas) */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-popover: 500;
    --z-tooltip: 600;
    --z-toast: 700;
    --z-max: 9999;

    /* Layout */
    --header-height: 56px;
    --footer-height: 40px;
}

/* ========== TEMA OSCURO ========== */
.dark-theme {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface2: #252836;
    --surface3: #2a2d3a;
    --text: #e2e4e9;
    --text2: #8b8fa3;
    --text3: #6b7280;
    --accent: var(--primary-400);
    --accent-hover: var(--primary-500);
    --accent2: #60a5fa;
    --accent3: #34d399;
    --border: #2a2d3a;
    --border-strong: #374151;
    --hover: #22252f;
    --hover-strong: #2d3142;
    --tab-active: #1e2235;
    --gold: #fbbf24;
    --gold-light: #78350f;
    --danger: #f87171;
    --danger-light: #7f1d1d;
    --success-light: #064e3b;
    --warning-light: #78350f;
    --info-light: #1e3a8a;

    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

/* ========== CUERPO PRINCIPAL ========== */
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background var(--transition), color var(--transition);
    letter-spacing: -0.01em;
    line-height: 1.5;
}

/* ========== HEADER ========== */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-shrink: 0;
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-sm);
    transition: background var(--transition), border var(--transition);
    height: var(--header-height);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--accent);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logo-text {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.badge {
    background: var(--gold);
    color: #fff;
    font-size: 0.68em;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-pro {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 2px 16px rgba(245, 158, 11, 0.5); }
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent3);
    animation: glow 2s infinite;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}

@keyframes glow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ========== AUTENTICACIÓN Y USUARIO ========== */
.auth-buttons {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border);
    padding: 4px 12px 4px 4px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85em;
    font-weight: 500;
}

.user-menu-btn:hover {
    background: var(--hover);
    border-color: var(--accent);
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.user-avatar-large {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700)) !important;
}

.user-dropdown {
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 220px;
}

/* ========== BOTONES ========== */
.btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    letter-spacing: 0.01em;
    font-family: var(--font);
    text-decoration: none;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
}

.btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.btn:hover {
    background: var(--hover);
    border-color: var(--accent2);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-green {
    background: var(--accent3);
    border-color: var(--accent3);
    color: #fff;
    font-weight: 600;
}

.btn-green:hover {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-red {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
    font-weight: 600;
}

.btn-red:hover {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75em;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 0.9em;
}

.btn-ai {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    color: white;
    font-weight: 600;
}

.btn-ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
}

.btn-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #d97706;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.btn-gold:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    border-color: #b45309;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.btn-admin {
    background: #1e293b;
    border-color: #1e293b;
    color: white;
    font-weight: 600;
}

.btn-admin:hover {
    background: #0f172a;
    border-color: #0f172a;
    box-shadow: 0 4px 14px rgba(30, 41, 59, 0.3);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--hover);
    border-color: var(--accent);
    color: var(--accent);
}

.separator {
    width: 1px;
    height: 24px;
    background: var(--border-strong);
    margin: 0 4px;
    flex-shrink: 0;
}

/* ========== LAYOUT PRINCIPAL ========== */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 250px;
    max-width: 80%;
    border-right: 1px solid var(--border);
    background: var(--surface);
    transition: background var(--transition), border var(--transition);
    min-height: 0;
}

.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 250px;
    background: #ffffff;
    position: relative;
    transition: background var(--transition);
    min-height: 0;
}

.dark-theme .preview-panel {
    background: #1e1e2e;
}

/* ========== RESIZER (BARRA DIVISORIA ARRASTRABLE) ========== */
.resizer {
    width: 16px;
    cursor: col-resize;
    background: transparent;
    flex-shrink: 0;
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resizer::after {
    content: '';
    width: 2px;
    height: 40px;
    background: var(--border-strong);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.resizer::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--border-strong);
    border-radius: 50%;
    box-shadow: 
        0 -8px 0 var(--border-strong),
        0 8px 0 var(--border-strong);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.resizer:hover::after {
    background: var(--accent);
    height: 50px;
    width: 2px;
}

.resizer:hover::before {
    opacity: 0.6;
}

.resizer.active::after {
    background: var(--accent);
    height: 60px;
    width: 3px;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.resizer.active::before {
    opacity: 1;
    background: var(--accent);
    box-shadow: 
        0 -8px 0 var(--accent),
        0 8px 0 var(--accent);
}

.resizer:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========== PESTAÑAS ========== */
.tabs-bar {
    display: flex;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    gap: 0;
    overflow-x: auto;
    flex-shrink: 0;
    padding: 0 var(--spacing-xs);
    transition: background var(--transition), border var(--transition);
}

.tabs-bar::-webkit-scrollbar {
    height: 0;
}

.tab {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.82em;
    letter-spacing: 0.01em;
    color: var(--text2);
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font);
}

.tab-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tab-dot.html { background: #f97316; }
.tab-dot.css { background: #3b82f6; }
.tab-dot.js { background: #eab308; }

.tab:hover {
    color: var(--text);
    background: var(--hover);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--tab-active);
    font-weight: 600;
}

.tab-count {
    font-size: 0.68em;
    color: var(--text2);
    background: var(--surface2);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    margin-left: 2px;
    transition: background var(--transition);
    font-weight: 500;
}

/* ========== ÁREA DEL EDITOR (MONACO) ========== */
.editor-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--surface);
    min-height: 0;
}

.editor-wrapper > div {
    width: 100% !important;
    height: 100% !important;
}

.dark-theme .editor-wrapper {
    background: #1e1e2e;
}

.light-theme .editor-wrapper {
    background: #ffffff;
}

#editorFallback {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
    color: var(--text);
    background: var(--surface);
    gap: 1rem;
}

#editorFallback svg {
    color: var(--danger);
    width: 48px;
    height: 48px;
}

#editorFallback h3 {
    color: var(--text);
    margin: 0;
    font-size: 1.1rem;
}

#editorFallback p {
    color: var(--text2);
    max-width: 400px;
    margin: 0;
    font-size: 0.9rem;
}

#editorFallback button {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: all var(--transition);
    font-size: 0.9rem;
}

#editorFallback button:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

.monaco-editor .minimap {
    display: none !important;
}

/* ========== VISTA PREVIA ========== */
.preview-header {
    background: var(--surface);
    padding: var(--spacing-xs) var(--spacing-md);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    flex-shrink: 0;
    font-size: 0.8em;
    color: var(--text2);
    transition: background var(--transition), border var(--transition);
    min-height: 44px;
}

.preview-tools {
    display: flex;
    gap: var(--spacing-sm);
    margin-left: auto;
    margin-right: var(--spacing-md);
}

.preview-tool-btn {
    background: transparent;
    border: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text2);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.75rem;
    transition: all var(--transition);
    font-family: var(--font);
    font-weight: 500;
}

.preview-tool-btn:hover {
    background: var(--hover);
    color: var(--accent);
}

.preview-tool-btn.active {
    background: var(--accent);
    color: white;
}

.preview-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: #fff;
    transition: width 0.1s ease-out, max-width 0.1s ease-out, background var(--transition);
    margin: 0 auto;
    min-height: 0;
}

.dark-theme .preview-frame {
    background: #1e1e2e;
}

.device-btns {
    display: flex;
    gap: 3px;
    background: var(--surface2);
    border-radius: var(--radius-full);
    padding: 2px;
    transition: background var(--transition);
}

.device-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: none;
    background: transparent;
    color: var(--text2);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.72em;
    transition: all var(--transition);
    font-family: var(--font);
    font-weight: 500;
}

.device-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.device-btn:hover:not(.active) {
    color: var(--text);
    background: var(--hover);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75em;
    font-weight: 500;
}

.status-ok {
    color: var(--accent3);
    font-weight: 600;
}

.status-warn {
    color: var(--warning);
    font-weight: 600;
}

.status-error {
    color: var(--danger);
    font-weight: 600;
}

/* ========== LOADER ========== */
.preview-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: var(--z-overlay);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    pointer-events: none;
    white-space: nowrap;
    transition: background var(--transition), border var(--transition), box-shadow var(--transition);
}

.preview-loader.hidden {
    display: none;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== EDITOR WYSIWYG ========== */
.wysiwyg-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px 6px;
    cursor: pointer;
    color: var(--text2);
    margin-left: 6px;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
}

.wysiwyg-toggle:hover {
    background: var(--hover);
    color: var(--accent);
    border-color: var(--accent);
}

.wysiwyg-toggle.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.wysiwyg-toolbar {
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-xs) var(--spacing-sm);
    gap: var(--spacing-xs);
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
    animation: slideDown 0.2s ease;
    transition: background var(--transition), border var(--transition);
}

.wysiwyg-toolbar.active {
    display: flex;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wysiwyg-toolbar button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    cursor: pointer;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85em;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}

.wysiwyg-toolbar button:hover {
    background: var(--hover);
    border-color: var(--border);
    color: var(--accent);
}

.wysiwyg-toolbar button strong { font-weight: 800; }
.wysiwyg-toolbar button em { font-style: italic; font-family: Georgia, serif; }
.wysiwyg-toolbar button u { text-decoration: underline; }
.wysiwyg-toolbar button s { text-decoration: line-through; }

.wysiwyg-toolbar select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8em;
    color: var(--text);
    cursor: pointer;
    font-family: var(--font);
    height: 28px;
    transition: all var(--transition);
    appearance: auto;
}

.wysiwyg-toolbar select:hover,
.wysiwyg-toolbar select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.wysiwyg-toolbar input[type="color"] {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
    background: var(--surface);
    transition: all var(--transition);
}

.wysiwyg-toolbar input[type="color"]:hover {
    border-color: var(--accent);
}

.toolbar-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 2px;
    flex-shrink: 0;
}

.sync-btn {
    margin-left: auto !important;
    background: var(--accent3) !important;
    color: white !important;
    border-color: var(--accent3) !important;
    padding: 5px 10px !important;
    gap: 4px;
    font-weight: 600;
}

.sync-btn:hover {
    background: #059669 !important;
    border-color: #059669 !important;
    color: white !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* ========== WYSIWYG EDICIÓN DIRECTA (FLOATING TOOLBAR) ========== */
.vixcode-floating-toolbar {
    position: fixed;
    z-index: var(--z-max);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: flex;
    gap: 4px;
    align-items: center;
    transition: opacity 0.2s, transform 0.2s;
    backdrop-filter: blur(8px);
}

.vixcode-floating-toolbar.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.vixcode-floating-toolbar button {
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text);
    font-size: 0.85rem;
    font-family: var(--font);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

.vixcode-floating-toolbar button:hover {
    background: var(--hover);
    color: var(--accent);
}

.vixcode-floating-toolbar button strong { font-weight: 800; }
.vixcode-floating-toolbar button em { font-style: italic; font-family: Georgia, serif; }
.vixcode-floating-toolbar button u { text-decoration: underline; }

.vixcode-floating-toolbar .sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

.vixcode-wysiwyg-selected {
    outline: 2px solid var(--accent) !important;
    outline-offset: 2px !important;
    cursor: text !important;
    position: relative;
    z-index: 10;
}

.vixcode-wysiwyg-selected::after {
    content: 'Editando';
    position: absolute;
    top: -22px;
    left: 0;
    background: var(--accent);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font);
    pointer-events: none;
    white-space: nowrap;
}

[contenteditable="true"] {
    cursor: text;
}

/* ========== FOOTER ========== */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: var(--spacing-xs) var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7em;
    color: var(--text2);
    flex-shrink: 0;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    transition: background var(--transition), border var(--transition);
    height: var(--footer-height);
}

.footer kbd {
    background: var(--surface2);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-size: 0.9em;
    border: 1px solid var(--border);
    font-family: var(--mono);
    transition: background var(--transition), border var(--transition);
    font-weight: 500;
}

.footer strong {
    color: var(--accent);
    font-weight: 600;
}

a.vix-credits {
    opacity: 0.55;
    font-size: 0.9em;
    color: var(--text2);
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

a.vix-credits:hover {
    opacity: 1;
    color: var(--accent);
    background: var(--hover);
}

a.vix-credits:hover svg {
    transform: translate(1px, -1px);
}

a.vix-credits svg {
    transition: transform 0.2s;
}

a.vix-credits strong {
    color: var(--accent);
    font-weight: 600;
}

/* ========== DROPDOWNS ========== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    min-width: 220px;
    overflow: hidden;
    animation: slideDown 0.18s ease;
    transition: background var(--transition), border var(--transition), box-shadow var(--transition);
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    font-size: 0.82em;
    transition: all var(--transition);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text);
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    font-family: var(--font);
    width: 100%;
    text-align: left;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--hover);
    color: var(--accent);
}

.dropdown-item svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: var(--spacing-xs) 0;
    border: none;
}

/* ========== BOTÓN ZEN Y AYUDA (PREMIUM) ========== */
.zen-exit-btn {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: var(--z-max);
}

.zen-exit-btn button {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: all var(--transition);
    font-family: var(--font);
    font-size: 0.85rem;
}

.zen-exit-btn button:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.zen-exit-btn button svg {
    stroke-width: 2.5;
}

.help-btn {
    position: fixed;
    bottom: var(--spacing-lg);
    left: var(--spacing-lg);
    background: var(--accent);
    color: white;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    z-index: var(--z-overlay);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
}

.help-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    background: var(--accent-hover);
}

.help-panel {
    position: fixed;
    bottom: calc(var(--spacing-lg) + 60px);
    left: var(--spacing-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    width: 340px;
    max-width: calc(100vw - 40px);
    z-index: var(--z-overlay);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
}

.help-panel.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

.help-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    background: var(--surface);
    font-size: 0.95rem;
}

.help-header button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text2);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.help-header button:hover {
    background: var(--hover);
    color: var(--text);
}

.help-content {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-height: 420px;
    overflow-y: auto;
}

.help-section h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text2);
    margin: 0 0 var(--spacing-sm) 0;
    font-weight: 700;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.75rem;
    color: var(--text);
    background: var(--surface2);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.shortcut-item kbd {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: var(--mono);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text);
    box-shadow: 0 1px 0 var(--border-strong);
}

.help-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
    font-family: var(--font);
}

.help-action-btn:last-child {
    margin-bottom: 0;
}

.help-action-btn:hover {
    background: var(--hover);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateX(4px);
}

.help-action-btn svg {
    flex-shrink: 0;
}

/* ========== MODALES ========== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
    padding: var(--spacing-md);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-overlay.active .modal {
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    transition: background var(--transition), border var(--transition), box-shadow var(--transition);
    overflow: hidden;
}

.modal-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    transition: border var(--transition);
    flex-shrink: 0;
    font-size: 1rem;
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-body pre {
    background: var(--surface2);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.82em;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    transition: background var(--transition);
    border: 1px solid var(--border);
}

.modal-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border);
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    transition: border var(--transition);
    flex-shrink: 0;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text2);
    padding: 4px;
    border-radius: 50%;
    transition: all var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--hover);
    color: var(--text);
}

.modal-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: all var(--transition);
    line-height: 1.5;
}

.modal-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.modal-input::placeholder {
    color: var(--text3);
    opacity: 1;
}

.modal-input:invalid:not(:placeholder-shown) {
    border-color: var(--danger);
}

/* ========== CURRENCY TOGGLE ========== */
.currency-toggle {
    display: inline-flex;
    background: var(--surface2);
    border-radius: var(--radius-full);
    padding: 4px;
    gap: 4px;
}

.currency-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: var(--text2);
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
    font-size: 0.9rem;
}

.currency-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.currency-btn:hover:not(.active) {
    color: var(--text);
    background: var(--hover);
}

/* ========== PAYMENT METHOD BUTTONS ========== */
.payment-method-btn {
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font);
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.payment-method-btn:hover {
    border-color: var(--accent);
    background: var(--hover);
    transform: translateY(-2px);
}

.payment-method-btn.active {
    border-color: var(--accent);
    background: var(--primary-50);
    color: var(--accent);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.dark-theme .payment-method-btn.active {
    background: rgba(99, 102, 241, 0.1);
}

/* ========== PLAN CARDS ========== */
.plan-card {
    transition: all 0.3s ease;
    position: relative;
    background: var(--surface);
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.plan-card ul {
    flex: 1;
}

.plan-popular {
    border-color: var(--accent) !important;
    transform: scale(1.02);
}

.plan-popular:hover {
    transform: scale(1.02) translateY(-5px);
}

/* ========== STAT CARDS ========== */
.stat-card {
    transition: all 0.3s ease;
    background: var(--surface2);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========== ESTILOS IA ========== */
.ai-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ai-action-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
}

.ai-action-btn:hover {
    background: var(--surface2);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

/* ========== METADATA ========== */
.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.metadata-item {
    background: var(--surface2);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.metadata-label {
    display: block;
    font-size: 0.72em;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.metadata-value {
    display: block;
    font-size: 0.92em;
    color: var(--text);
    line-height: 1.5;
    word-break: break-word;
}

.badge-status {
    display: inline-block;
    background: var(--gold);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* ========== TOAST ========== */
#toastContainer {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: calc(100vw - 40px);
}

.toast {
    background: var(--surface);
    color: var(--text);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    font-size: 0.85em;
    animation: toastIn 0.3s ease;
    pointer-events: auto;
    cursor: pointer;
    transition: background var(--transition), border var(--transition), box-shadow var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    max-width: 400px;
}

.toast:hover {
    background: var(--hover);
    border-color: var(--accent);
}

.toast-removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

/* ========== MODO ZEN ========== */
body.zen-mode .header,
body.zen-mode .footer,
body.zen-mode .tabs-bar,
body.zen-mode .preview-header,
body.zen-mode .wysiwyg-toolbar,
body.zen-mode .help-btn,
body.zen-mode .help-panel {
    display: none !important;
}

body.zen-mode .main-container {
    flex-direction: row;
}

body.zen-mode .editor-panel,
body.zen-mode .preview-panel {
    height: 100vh;
}

body.zen-mode .resizer {
    height: 100%;
}

/* ========== CONSOLA E INSPECTOR ========== */
.console-panel,
.inspector-panel {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 400px;
    max-width: 90%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-overlay);
    display: flex;
    flex-direction: column;
    font-size: 0.78rem;
    font-family: var(--mono);
    transition: all var(--transition);
    max-height: 50vh;
}

.console-panel.hidden,
.inspector-panel.hidden {
    display: none;
}

.console-header,
.inspector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-family: var(--font);
    font-size: 0.85rem;
}

.console-logs {
    max-height: 250px;
    overflow-y: auto;
    padding: var(--spacing-sm);
    background: var(--surface);
}

.console-entry {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.4;
}

.console-entry:last-child {
    border-bottom: none;
}

.console-error { color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.console-warn { color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.console-log { color: var(--text); }
.console-info { color: var(--accent2); background: rgba(59, 130, 246, 0.08); }
.console-time { color: var(--text2); margin-right: var(--spacing-sm); font-size: 0.7rem; }
.console-type { font-weight: bold; margin-right: var(--spacing-sm); }

.console-clear,
.console-close,
.inspector-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text2);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-family: var(--font);
    font-weight: 500;
}

.console-clear:hover,
.console-close:hover,
.inspector-close:hover {
    background: var(--hover);
    color: var(--text);
}

.inspector-content {
    padding: var(--spacing-md);
    max-height: 300px;
    overflow-y: auto;
    background: var(--surface);
}

.inspector-element {
    margin-bottom: var(--spacing-md);
}

.inspector-actions button {
    margin-right: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all var(--transition);
    font-family: var(--font);
}

.inspector-actions button:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.inspector-styles ul {
    list-style: none;
    margin-top: var(--spacing-sm);
}

.inspector-styles li {
    font-size: 0.75rem;
    padding: 2px 0;
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
}

.css-prop { color: var(--accent); font-weight: 500; }
.css-value { color: var(--accent3); }

.inspector-hint {
    color: var(--text2);
    font-style: italic;
}

/* ========== ELEMENTOR WIDGET ========== */
.vixcode-widget {
    all: revert;
    display: block;
}

/* ========== SCROLLBARS ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent2);
    background-clip: padding-box;
    border: 2px solid transparent;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .header {
        padding: var(--spacing-xs) var(--spacing-sm);
        gap: var(--spacing-sm);
    }

    .header-actions {
        gap: 4px;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 0.7em;
    }

    .btn-sm span:not(svg) {
        display: none;
    }

    .separator {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .resizer {
        width: 100%;
        height: 16px;
        cursor: row-resize;
    }
    
    .resizer::after {
        width: 40px;
        height: 2px;
    }
    
    .resizer::before {
        width: 4px;
        height: 4px;
        box-shadow: 
            -8px 0 0 var(--border-strong),
            8px 0 0 var(--border-strong);
    }
    
    .resizer:hover::after,
    .resizer.active::after {
        width: 60px;
        height: 3px;
    }

    .editor-panel,
    .preview-panel {
        min-width: 100%;
        min-height: 250px;
        flex: none;
        height: 50%;
        max-width: 100%;
    }

    .header {
        padding: var(--spacing-xs) var(--spacing-sm);
        gap: var(--spacing-sm);
        flex-wrap: wrap;
        height: auto;
        min-height: var(--header-height);
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--spacing-xs);
    }

    .header-actions::-webkit-scrollbar {
        height: 0;
    }

    .btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.7em;
    }

    .tab {
        padding: var(--spacing-sm) var(--spacing-sm);
        font-size: 0.73em;
    }

    .metadata-grid {
        grid-template-columns: 1fr;
    }

    .wysiwyg-toolbar {
        padding: var(--spacing-xs);
        gap: 2px;
    }

    .wysiwyg-toolbar button {
        min-width: 26px;
        height: 26px;
        padding: var(--spacing-xs);
    }

    .wysiwyg-toolbar select,
    .wysiwyg-toolbar input[type="color"] {
        height: 26px;
    }

    .sync-btn span {
        display: none;
    }

    .preview-loader {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }

    .help-panel {
        width: 280px;
        left: var(--spacing-sm);
        bottom: 70px;
    }

    .help-btn {
        width: 44px;
        height: 44px;
        left: var(--spacing-sm);
        bottom: var(--spacing-sm);
    }

    .footer {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.65em;
        height: auto;
        min-height: var(--footer-height);
    }

    .footer kbd {
        padding: 1px 4px;
        font-size: 0.85em;
    }

    .console-panel,
    .inspector-panel {
        width: 100%;
        max-width: 100%;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .modal {
        max-width: 95%;
        max-height: 95vh;
    }

    .modal-body {
        padding: var(--spacing-md);
    }

    .modal-header {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.95rem;
    }

    .modal-footer {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    #toastContainer {
        bottom: var(--spacing-sm);
        right: var(--spacing-sm);
        left: var(--spacing-sm);
        max-width: 100%;
    }

    .toast {
        font-size: 0.78rem;
        padding: var(--spacing-sm) var(--spacing-md);
        min-height: 38px;
        max-width: 100%;
    }

    .zen-exit-btn {
        bottom: var(--spacing-sm);
        right: var(--spacing-sm);
    }

    .zen-exit-btn button {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.75rem;
    }

    .plans-grid {
        grid-template-columns: 1fr !important;
    }

    .plan-popular {
        transform: none;
    }

    .plan-popular:hover {
        transform: translateY(-5px);
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1em;
    }

    .badge {
        font-size: 0.6em;
        padding: 2px 6px;
    }

    .device-btns {
        display: none;
    }

    .preview-tools {
        display: none;
    }
}

/* ========== MODO ZEN MOBILE ========== */
@media (max-width: 768px) {
    body.zen-mode .main-container {
        flex-direction: column;
    }

    body.zen-mode .resizer {
        width: 100%;
        height: 16px;
    }
}

/* ========== ACCESIBILIDAD ========== */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus-visible,
.tab:focus-visible,
.device-btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Reducir movimiento */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    :root {
        --border: #000000;
        --text: #000000;
        --bg: #ffffff;
    }

    .dark-theme {
        --border: #ffffff;
        --text: #ffffff;
        --bg: #000000;
    }
}

/* ========== UTILIDADES ========== */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* ========== ANIMACIONES ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========== IMPRESIÓN ========== */
@media print {
    .header,
    .footer,
    .preview-panel,
    .resizer,
    .zen-exit-btn,
    .help-btn,
    .help-panel,
    .console-panel,
    .inspector-panel,
    .modal-overlay,
    #toastContainer,
    .vixcode-floating-toolbar {
        display: none !important;
    }

    .editor-panel {
        width: 100% !important;
        height: 100vh !important;
        border: none !important;
    }

    body {
        overflow: visible !important;
        height: auto !important;
    }
}
/* ===== VIXcode UI refinement 7.1 ===== */
.logo-icon { width: 36px; height: 36px; filter: drop-shadow(0 6px 14px rgba(76,82,255,.22)); }
.logo-icon svg { width: 34px; height: 34px; stroke: none; overflow: visible; }
.logo-text { display:inline-flex; align-items:baseline; font-size:1.22rem; font-weight:500; letter-spacing:-.045em; }
.logo-text strong { font-weight:800; }
.logo-text span { color:var(--accent); font-weight:720; }

#toastContainer { bottom:24px; right:24px; gap:12px; width:min(390px,calc(100vw - 32px)); }
.toast { position:relative; width:100%; min-height:64px; padding:12px 44px 12px 12px; gap:12px; border-radius:16px; border:1px solid color-mix(in srgb,var(--toast-color,var(--accent)) 25%,var(--border)); background:color-mix(in srgb,var(--surface) 94%,var(--toast-color,var(--accent)) 6%); box-shadow:0 18px 48px rgba(15,23,42,.18),0 2px 8px rgba(15,23,42,.08); cursor:default; overflow:hidden; align-items:flex-start; }
.toast::before { content:""; position:absolute; inset:0 auto 0 0; width:4px; background:var(--toast-color,var(--accent)); }
.toast::after { content:""; position:absolute; left:0; bottom:0; height:2px; width:100%; background:var(--toast-color,var(--accent)); transform-origin:left; animation:toastProgress var(--toast-duration,3000ms) linear forwards; opacity:.65; }
.toast-success { --toast-color:#16a34a; }
.toast-error { --toast-color:#dc2626; }
.toast-warning { --toast-color:#d97706; }
.toast-info { --toast-color:#2563eb; }
.toast-icon { flex:0 0 34px; width:34px; height:34px; display:grid; place-items:center; border-radius:10px; color:var(--toast-color); background:color-mix(in srgb,var(--toast-color) 12%,transparent); }
.toast-icon svg { width:18px; height:18px; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.toast-content { min-width:0; padding-top:1px; }
.toast-title { display:block; margin-bottom:2px; color:var(--text); font-size:.86rem; font-weight:750; }
.toast-message { display:block; color:var(--text2); font-size:.82rem; font-weight:480; line-height:1.45; overflow-wrap:anywhere; }
.toast-close { position:absolute; top:10px; right:10px; width:28px; height:28px; display:grid; place-items:center; border:0; border-radius:8px; background:transparent; color:var(--text2); cursor:pointer; }
.toast-close:hover { background:var(--hover); color:var(--text); }
.toast:hover { background:color-mix(in srgb,var(--surface) 90%,var(--toast-color) 10%); border-color:color-mix(in srgb,var(--toast-color) 42%,var(--border)); transform:translateY(-1px); }
@keyframes toastProgress { to { transform:scaleX(0); } }
@media (prefers-reduced-motion:reduce) { .toast,.toast-removing,.toast::after { animation:none!important; } }
.elementor-export-modal{max-width:900px;width:min(900px,calc(100vw - 32px));}
.modal-title-with-icon{display:inline-flex;align-items:center;gap:9px;font-weight:750;}
.elementor-help{display:flex;gap:12px;align-items:flex-start;padding:14px 16px;margin-bottom:14px;border:1px solid color-mix(in srgb,var(--accent) 22%,var(--border));border-radius:14px;background:color-mix(in srgb,var(--accent) 7%,var(--surface));color:var(--accent);}
.elementor-help div{display:grid;gap:3px}.elementor-help strong{color:var(--text);font-size:.9rem}.elementor-help span{color:var(--text2);font-size:.8rem;line-height:1.45}
.elementor-code-preview{min-height:360px;max-height:56vh;overflow:auto;margin:0;padding:18px;border:1px solid var(--border);border-radius:14px;background:#0b1020;color:#dbeafe;font:12.5px/1.65 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;tab-size:2;box-shadow:inset 0 1px 0 rgba(255,255,255,.04)}
.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}.modal-actions .btn{display:inline-flex;align-items:center;gap:7px}
/* Iconografía coherente y minimalista */
.btn svg,.dropdown-item svg,.modal-header svg,.wysiwyg-toolbar svg{flex:0 0 auto;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;shape-rendering:geometricPrecision}
.btn svg{stroke-width:1.8}.dropdown-item svg{stroke-width:1.8}
.dropdown-item{min-height:38px}.dropdown-item svg{width:16px;height:16px}

/* ===== VIXcode 7.1: alertas aurora, consola e inspector refinados ===== */
#toastContainer{position:fixed;right:22px;bottom:22px;width:min(390px,calc(100vw - 28px));display:grid;gap:12px;z-index:99999;pointer-events:none;perspective:900px}
.toast{--toast-rgb:59,130,246;pointer-events:auto;isolation:isolate;position:relative;display:grid;grid-template-columns:42px minmax(0,1fr) 30px;align-items:center;min-height:78px;padding:12px 12px 12px 14px;border:1px solid rgba(var(--toast-rgb),.28);border-radius:22px;background:linear-gradient(135deg,color-mix(in srgb,var(--surface) 88%,transparent),color-mix(in srgb,var(--surface2) 82%,transparent));box-shadow:0 24px 70px rgba(2,6,23,.28),inset 0 1px 0 rgba(255,255,255,.12);backdrop-filter:blur(22px) saturate(150%);overflow:hidden;animation:vixToastIn .44s cubic-bezier(.2,.8,.2,1) both}
.toast::before{content:"";position:absolute;z-index:-1;width:140px;height:140px;left:-55px;top:-75px;border-radius:50%;background:radial-gradient(circle,rgba(var(--toast-rgb),.34),transparent 68%);filter:blur(4px)}
.toast::after{content:"";position:absolute;left:14px;right:14px;bottom:7px;height:3px;border-radius:99px;background:linear-gradient(90deg,rgba(var(--toast-rgb),1),rgba(var(--toast-rgb),.2));transform-origin:left;animation:toastProgress var(--toast-duration,3000ms) linear forwards}
.toast-success{--toast-rgb:16,185,129}.toast-error{--toast-rgb:244,63,94}.toast-warning{--toast-rgb:245,158,11}.toast-info{--toast-rgb:59,130,246}
.toast-icon{width:42px;height:42px;border-radius:15px;display:grid;place-items:center;color:rgb(var(--toast-rgb));background:linear-gradient(145deg,rgba(var(--toast-rgb),.2),rgba(var(--toast-rgb),.06));border:1px solid rgba(var(--toast-rgb),.25);box-shadow:inset 0 1px 0 rgba(255,255,255,.15)}
.toast-icon svg{width:21px;height:21px;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.toast-content{padding:0 10px;min-width:0}.toast-title{display:block;font-size:.82rem;letter-spacing:.02em;font-weight:800;color:var(--text)}.toast-message{display:block;margin-top:3px;font-size:.8rem;line-height:1.4;color:var(--text2)}
.toast-close{width:30px;height:30px;border:0;border-radius:11px;display:grid;place-items:center;background:rgba(148,163,184,.08);color:var(--text2);cursor:pointer;transition:.2s ease}.toast-close:hover{background:rgba(var(--toast-rgb),.16);color:rgb(var(--toast-rgb));transform:rotate(4deg)}.toast-removing{animation:vixToastOut .26s ease forwards}
@keyframes vixToastIn{from{opacity:0;transform:translate3d(28px,12px,-40px) rotateY(-8deg) scale(.94)}to{opacity:1;transform:none}}@keyframes vixToastOut{to{opacity:0;transform:translateX(28px) scale(.95)}}
.console-panel,.inspector-panel{width:min(520px,calc(100% - 24px));right:12px;bottom:12px;border-radius:18px;border:1px solid color-mix(in srgb,var(--accent) 18%,var(--border));box-shadow:0 24px 70px rgba(2,6,23,.3);overflow:hidden;backdrop-filter:blur(18px)}
.console-header,.inspector-header{min-height:48px;padding:8px 12px;background:linear-gradient(135deg,var(--surface2),color-mix(in srgb,var(--surface2) 88%,var(--accent) 12%))}.console-logs{max-height:330px;min-height:130px}.console-entry{display:grid;grid-template-columns:70px 64px minmax(0,1fr);gap:4px;padding:9px 11px;word-break:break-word}.inspector-content{padding:14px;max-height:380px;overflow:auto}.inspector-empty{min-height:140px;display:grid;place-content:center;text-align:center;gap:6px;color:var(--text2)}.inspector-empty strong{color:var(--text)}
.preview-tool-btn.active{background:color-mix(in srgb,var(--accent) 15%,var(--surface));border-color:color-mix(in srgb,var(--accent) 45%,var(--border));color:var(--accent)}
