/* ============================================================================
DECLARACIÓN DE PROPIEDAD INTELECTUAL Y DERECHOS DE AUTOR REGISTRADOS
============================================================================

PROPIETARIO ÚNICO, DESARROLLADOR, DISEÑADOR Y PROGRAMADOR EXCLUSIVO:
----------------------------------------------------------------------------
Ing. Roel Arturo Copetillo Portela
COPR810501rm1

HISTORIAL DE REGISTRO DE DESARROLLO (FECHA DE INICIO):
----------------------------------------------------------------------------
- Inicio oficial de diseño y desarrollo: 14 de Mayo de 2026

DECLARACIÓN DE DERECHOS LEGALES:
----------------------------------------------------------------------------
Tanto esta versión de prueba (trial/beta) como cualquier versión posterior,
estable, modificada, compilada, autoejecutable o derivada del código de esta 
aplicación, pertenecen al 100% en exclusiva y de manera vitalicia a su único
dueño y desarrollador Roel Arturo Copetillo Portela. Queda prohibida la copia, 
distribución, alteración o venta no autorizada sin el consentimiento expreso
por escrito del autor.

Todos los Derechos Reservados © 2026.
============================================================================ */

/* ── css/app.css — Estilos generales futuristas HUD ── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
input, select, textarea, button { font-family: 'Outfit', sans-serif !important; }

/* Marca registrada Xerberoz® — símbolo en superíndice */
sup.brand-r {
    font-size: 0.55em;
    line-height: 0;
    vertical-align: super;
    font-weight: inherit;
}

:root {
    --bg:        #030114;
    --bg2:       #0c0628;
    --surface:   rgba(12, 6, 32, 0.85);
    --surface2:  rgba(28, 12, 64, 0.75);
    --border:    rgba(153, 0, 255, 0.25);
    --border-hi: rgba(255, 0, 119, 0.6);
    --cyan:      #00f0ff;
    --cyan-dim:  rgba(0, 240, 255, 0.7);
    --blue:      #8644ff;
    --green:     #00ff66;
    --yellow:    #ff9900;
    --red:       #ff0055;
    --text:      #e6e1fc;
    --muted:     #847b9c;
    --font-mono: 'Outfit', sans-serif;
    --font-main: 'Outfit', sans-serif;
    
    --accent-purple: #8644ff;
    --accent-pink:   #ff0077;
    --accent-orange: #ff9900;
}

/* ══════════════════════════════════════════════════
   ESTILOS DE SCROLLBAR GLOBAL
   ══════════════════════════════════════════════════ */
/* Para Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(10, 15, 30, 0.4);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(0, 240, 255, 0.1);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.6);
}

/* Para Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 240, 255, 0.4) rgba(10, 15, 30, 0.4);
}

html {
    overflow-x: hidden;
}

/* ── Canvas de fondo ── */
#hud-bg {
    position: fixed; inset: 0;
    z-index: 0; pointer-events: none;
    display: block;
    opacity: 0.75;
}

/* ═══════════════════════════════
   GLOBAL SCI-FI FRAME
   ═══════════════════════════════ */
.global-hud-frame {
    position: fixed;
    inset: 12px;
    z-index: 99998;
    pointer-events: none;
    border: 1px solid rgba(134, 68, 255, 0.18);
    box-shadow: 0 0 10px rgba(134, 68, 255, 0.04), inset 0 0 10px rgba(134, 68, 255, 0.04);
    border-radius: 8px;
    animation: framePulse 8s infinite alternate ease-in-out;
}

@keyframes framePulse {
    0% { 
        border-color: rgba(134, 68, 255, 0.18); 
        box-shadow: 0 0 10px rgba(134, 68, 255, 0.04), inset 0 0 10px rgba(134, 68, 255, 0.04); 
    }
    50% { 
        border-color: rgba(0, 240, 255, 0.22); 
        box-shadow: 0 0 15px rgba(0, 240, 255, 0.06), inset 0 0 15px rgba(0, 240, 255, 0.06); 
    }
    100% { 
        border-color: rgba(255, 0, 119, 0.18); 
        box-shadow: 0 0 10px rgba(255, 0, 119, 0.04), inset 0 0 10px rgba(255, 0, 119, 0.04); 
    }
}

body {
    background: #000000;
    color: var(--text);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}


@keyframes floatLights {
    0% { transform: scale(1.0); }
    100% { transform: scale(1.12) translate(1.5%, 1.5%); }
}

/* ═══════════════════════════════
   HEADER
   ═══════════════════════════════ */
.sticky-top-container {
    position: sticky; top: 0; z-index: 100;
    width: 100%;
    background: transparent;
    padding-top: 29px;
    padding-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.header-visual-box {
    max-width: 96%; margin: 0 auto;
    background: #08080c;
    border: 1px solid rgba(134, 68, 255, 0.25);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.95), 0 0 15px rgba(134, 68, 255, 0.04);
    overflow: hidden; /* Ensures contents don't bleed out of rounded corners */
}

.app-header {
    padding-top: 4px;
    width: 100%;
}
.header-inner {
    width: 100%;
    padding: 6px 28px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 80px;
}

/* Logo — columna central del grid */
.logo {
    grid-column: 2;
    display: flex; align-items: center; gap: 14px;
    justify-content: center;
    transition: transform 0.3s ease;
}
.logo:hover {
    transform: scale(1.02);
}
.logo-icon-svg {
    height: 68px;
    filter: drop-shadow(0 2px 8px rgba(0, 240, 255, 0.22));
    flex-shrink: 0;
    overflow: visible;
}
.logo-text-wrap { display: flex; flex-direction: column; gap: 3px; align-items: center; text-align: center; }
.logo-title {
    font-size: 1.7rem; font-weight: 800; letter-spacing: .06em;
    color: #ffffff; text-transform: uppercase;
    background: linear-gradient(90deg, #00f0ff, #ff0077, #ff9900, #00f0ff);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shineGradient 5s linear infinite;
    line-height: 1;
}
@keyframes shineGradient {
    to { background-position: 300% center; }
}
.logo-sub {
    font-size: .78rem; color: var(--muted);
    letter-spacing: .18em; text-transform: uppercase;
    font-family: var(--font-mono);
}

/* Stats — columna derecha del grid */
.header-stats {
    grid-column: 3;
    display: flex; gap: 28px; justify-content: flex-end;
}
.hstat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.hstat span {
    font-size: 1.15rem; font-weight: 700;
    font-family: var(--font-mono); color: var(--cyan);
}
.hstat small { font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ═══════════════════════════════
   TABS (Outfit style + High Fidelity Neon)
   ═══════════════════════════════ */
.tabs-bar {
    display: flex; gap: var(--xrz-tabs-gap, 8px);
    padding: 16px 28px 16px 28px;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    overflow: hidden; /* evita que CERRAR se salga del borde neón */
    
    /* Siempre visibles de forma fija */
    transform: none !important;
    opacity: 1 !important;
}


.tab {
    display: flex; align-items: center; gap: 8px;
    padding: var(--xrz-tab-pad-y, 10px) var(--xrz-tab-pad-x, 18px);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--muted); cursor: pointer;
    font-family: var(--font-main);
    font-size: var(--xrz-tab-font, .84rem);
    flex-shrink: 0;
    box-sizing: border-box;
    --accent-orange: #ff9900;
}

/* ══════════════════════════════════════════════════
   ESTILOS DE SCROLLBAR GLOBAL
   ══════════════════════════════════════════════════ */
/* Para Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(10, 15, 30, 0.4);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(0, 240, 255, 0.1);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.6);
}

/* Para Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 240, 255, 0.4) rgba(10, 15, 30, 0.4);
}

html {
    overflow-x: hidden;
}

/* ── Canvas de fondo ── */
#hud-bg {
    position: fixed; inset: 0;
    z-index: 0; pointer-events: none;
    display: block;
    opacity: 0.75;
}

/* ═══════════════════════════════
   GLOBAL SCI-FI FRAME
   ═══════════════════════════════ */
.global-hud-frame {
    position: fixed;
    inset: 12px;
    z-index: 99998;
    pointer-events: none;
    border: 1px solid rgba(134, 68, 255, 0.18);
    box-shadow: 0 0 10px rgba(134, 68, 255, 0.04), inset 0 0 10px rgba(134, 68, 255, 0.04);
    border-radius: 8px;
    animation: framePulse 8s infinite alternate ease-in-out;
}

@keyframes framePulse {
    0% { 
        border-color: rgba(134, 68, 255, 0.18); 
        box-shadow: 0 0 10px rgba(134, 68, 255, 0.04), inset 0 0 10px rgba(134, 68, 255, 0.04); 
    }
    50% { 
        border-color: rgba(0, 240, 255, 0.22); 
        box-shadow: 0 0 15px rgba(0, 240, 255, 0.06), inset 0 0 15px rgba(0, 240, 255, 0.06); 
    }
    100% { 
        border-color: rgba(255, 0, 119, 0.18); 
        box-shadow: 0 0 10px rgba(255, 0, 119, 0.04), inset 0 0 10px rgba(255, 0, 119, 0.04); 
    }
}

body {
    background: #000000;
    color: var(--text);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}


@keyframes floatLights {
    0% { transform: scale(1.0); }
    100% { transform: scale(1.12) translate(1.5%, 1.5%); }
}

/* ═══════════════════════════════
   HEADER
   ═══════════════════════════════ */
.sticky-top-container {
    position: sticky; top: 0; z-index: 100;
    width: 100%;
    background: transparent;
    padding-top: 29px;
    padding-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.header-visual-box {
    max-width: 96%; margin: 0 auto;
    background: #08080c;
    border: 1px solid rgba(134, 68, 255, 0.25);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.95), 0 0 15px rgba(134, 68, 255, 0.04);
    overflow: hidden; /* Ensures contents don't bleed out of rounded corners */
}

.app-header {
    padding-top: 4px;
    width: 100%;
}
.header-inner {
    width: 100%;
    padding: 6px 28px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 80px;
}

/* Logo — columna central del grid */
.logo {
    grid-column: 2;
    display: flex; align-items: center; gap: 14px;
    justify-content: center;
    transition: transform 0.3s ease;
}
.logo:hover {
    transform: scale(1.02);
}
.logo-icon-svg {
    height: 68px;
    filter: drop-shadow(0 2px 8px rgba(0, 240, 255, 0.22));
    flex-shrink: 0;
    overflow: visible;
}
.logo-text-wrap { display: flex; flex-direction: column; gap: 3px; align-items: center; text-align: center; }
.logo-title {
    font-size: 1.7rem; font-weight: 800; letter-spacing: .06em;
    color: #ffffff; text-transform: uppercase;
    background: linear-gradient(90deg, #00f0ff, #ff0077, #ff9900, #00f0ff);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shineGradient 5s linear infinite;
    line-height: 1;
}
@keyframes shineGradient {
    to { background-position: 300% center; }
}
.logo-sub {
    font-size: .78rem; color: var(--muted);
    letter-spacing: .18em; text-transform: uppercase;
    font-family: var(--font-mono);
}

/* Stats — columna derecha del grid */
.header-stats {
    grid-column: 3;
    display: flex; gap: 28px; justify-content: flex-end;
}
.hstat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.hstat span {
    font-size: 1.15rem; font-weight: 700;
    font-family: var(--font-mono); color: var(--cyan);
}
.hstat small { font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ═══════════════════════════════
   TABS (Outfit style + High Fidelity Neon)
   ═══════════════════════════════ */
.tabs-bar {
    display: flex; gap: var(--xrz-tabs-gap, 8px);
    padding: 16px 28px 16px 28px;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    overflow: hidden;
    
    /* Siempre visibles de forma fija */
    transform: none !important;
    opacity: 1 !important;
}


.tab {
    display: flex; align-items: center; gap: 8px;
    padding: var(--xrz-tab-pad-y, 10px) var(--xrz-tab-pad-x, 18px);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: var(--muted); cursor: pointer;
    font-family: var(--font-main);
    font-size: var(--xrz-tab-font, .84rem);
    font-weight: 600;
    flex-shrink: 0;
    letter-spacing: .02em;
    text-transform: capitalize;
    transition: all .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
    position: relative; white-space: nowrap;
    overflow: hidden;
    /* Horizontal solo vía gap del .tabs-bar (mismo path user/admin) */
    margin: 4px 0;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.03);
}
/* Durante el fit: sin transition (evita leer anchos a medias) */
.tabs-bar.xrz-tabs-fitting .tab,
.tabs-bar.xrz-tabs-fitting .tab .tab-icon,
.tabs-bar.xrz-tabs-fitting .xerberoz-logo-center {
    transition: none !important;
}

/* Brillo de reflexión (sweep) */
.tab::after {
    content: '';
    position: absolute;
    top: 0; left: -80%;
    width: 60%; height: 100%;
    background: linear-gradient(
        110deg,
        transparent 20%,
        rgba(255, 255, 255, 0.05) 40%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0.05) 60%,
        transparent 80%
    );
    transform: skewX(-15deg);
    transition: none;
    pointer-events: none;
    opacity: 0;
}

/* Efectos al posicionar el puntero (Hover general) */
.tab:hover {
    color: #ffffff;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

.tab:hover::after {
    opacity: 1;
    animation: tabLightningSweep 0.6s ease-out forwards;
}

@keyframes tabLightningSweep {
    0%   { left: -80%; opacity: 1; }
    100% { left: 130%; opacity: 0.2; }
}

/* Iconos de las pestañas - Estilo Startup (Glow y Colores en reposo) */
.tab-icon {
    width: var(--xrz-tab-icon, 18px); height: var(--xrz-tab-icon, 18px);
    stroke: currentColor; flex-shrink: 0;
    transition: all .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reposo de iconos (Efecto sin puntero) */
.tab[data-tab="upload"]      .tab-icon { color: #00e5ff; filter: drop-shadow(0 0 3px rgba(0, 229, 255, 0.4)); }
.tab[data-tab="analyze"]     .tab-icon { color: #00f0ff; filter: drop-shadow(0 0 3px rgba(0, 240, 255, 0.4)); }
.tab[data-tab="adjust"]      .tab-icon { color: #ff9900; filter: drop-shadow(0 0 3px rgba(255, 153, 0, 0.4)); }
.tab[data-tab="results"]     .tab-icon { color: #00ff66; filter: drop-shadow(0 0 3px rgba(0, 255, 102, 0.4)); }
.tab[data-tab="ergonomics"]  .tab-icon { color: #a855f7; filter: drop-shadow(0 0 3px rgba(168, 85, 247, 0.5)); }
.tab-help  .tab-icon { color: #bfff40; filter: drop-shadow(0 0 3px rgba(191, 255, 64, 0.4)); }
.tab-clear .tab-icon { color: #ff5500; filter: drop-shadow(0 0 3px rgba(255, 85, 0, 0.4)); }
.tab-home  .tab-icon { color: #00e5ff; filter: drop-shadow(0 0 3px rgba(0, 229, 255, 0.5)); }
.tab-close .tab-icon { color: #ff3333; filter: drop-shadow(0 0 3px rgba(255, 51, 51, 0.4)); }
.tab-save .tab-icon { color: #00ff88; filter: drop-shadow(0 0 3px rgba(0, 255, 136, 0.4)); }
.tab-open .tab-icon { color: #ffcc00; filter: drop-shadow(0 0 3px rgba(255, 204, 0, 0.4)); }
.tab-close .tab-icon { color: #ff3333; filter: drop-shadow(0 0 3px rgba(255, 51, 51, 0.4)); }
.tab-save .tab-icon { color: #00ff88; filter: drop-shadow(0 0 3px rgba(0, 255, 136, 0.4)); }
.tab-open .tab-icon { color: #ffcc00; filter: drop-shadow(0 0 3px rgba(255, 204, 0, 0.4)); }
.tab[data-tab="nom036"] .tab-icon { color: #ff6b35; filter: drop-shadow(0 0 3px rgba(255, 107, 53, 0.4)); }
.tab-admin .tab-icon { color: #ff0077; filter: drop-shadow(0 0 3px rgba(255, 0, 119, 0.5)); }

/* PANEL ADMIN: estilos en CSS (sin border/background inline que anulen el hover) */
.tab-admin {
    color: #ff0077;
    border: 1px solid rgba(255, 0, 119, 0.55);
    background: rgba(255, 0, 119, 0.1);
    font-weight: 700;
}

/* Escalamiento de icono en hover */
.tab:hover .tab-icon {
    transform: scale(1.18) rotate(4deg);
}

/* Efectos de Hover específicos por pestaña */
.tab[data-tab="upload"]:hover {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.2) 0%, rgba(0, 229, 255, 0.02) 100%);
    border-color: rgba(0, 229, 255, 0.5);
    box-shadow: 0 8px 24px rgba(0, 229, 255, 0.25);
}
.tab[data-tab="analyze"]:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2) 0%, rgba(0, 240, 255, 0.02) 100%);
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 8px 24px rgba(0, 240, 255, 0.25);
}
.tab[data-tab="adjust"]:hover {
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.2) 0%, rgba(255, 153, 0, 0.02) 100%);
    border-color: rgba(255, 153, 0, 0.5);
    box-shadow: 0 8px 24px rgba(255, 153, 0, 0.25);
}
.tab[data-tab="results"]:hover {
    background: linear-gradient(135deg, rgba(0, 255, 102, 0.2) 0%, rgba(0, 255, 102, 0.02) 100%);
    border-color: rgba(0, 255, 102, 0.5);
    box-shadow: 0 8px 24px rgba(0, 255, 102, 0.25);
}
.tab[data-tab="nom036"]:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2) 0%, rgba(255, 107, 53, 0.02) 100%);
    border-color: rgba(255, 107, 53, 0.5);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.25);
}
.tab-help:hover {
    background: linear-gradient(135deg, rgba(191, 255, 64, 0.2) 0%, rgba(191, 255, 64, 0.02) 100%);
    border-color: rgba(191, 255, 64, 0.5);
    box-shadow: 0 8px 24px rgba(191, 255, 64, 0.25);
}
.tab-clear:hover {
    background: linear-gradient(135deg, rgba(255, 85, 0, 0.2) 0%, rgba(255, 85, 0, 0.02) 100%);
    border-color: rgba(255, 85, 0, 0.5);
    box-shadow: 0 8px 24px rgba(255, 85, 0, 0.25);
}
.tab-save:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 255, 136, 0.02) 100%);
    border-color: rgba(0, 255, 136, 0.5);
    box-shadow: 0 8px 24px rgba(0, 255, 136, 0.25);
}
.tab-open:hover {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.2) 0%, rgba(255, 204, 0, 0.02) 100%);
    border-color: rgba(255, 204, 0, 0.5);
    box-shadow: 0 8px 24px rgba(255, 204, 0, 0.25);
}
.tab-import .tab-icon { color: #a855f7; filter: drop-shadow(0 0 3px rgba(168, 85, 247, 0.5)); }
.tab-import:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(168, 85, 247, 0.02) 100%);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.25);
}
.tab-home:hover {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.2) 0%, rgba(0, 229, 255, 0.02) 100%);
    border-color: rgba(0, 229, 255, 0.5);
    box-shadow: 0 8px 24px rgba(0, 229, 255, 0.25);
}
.tab-admin:hover {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(255, 0, 119, 0.28) 0%, rgba(255, 0, 119, 0.04) 100%);
    border-color: #ff0077;
    box-shadow: 0 8px 24px rgba(255, 0, 119, 0.45), 0 0 18px rgba(255, 0, 119, 0.35);
}
.tab-admin:hover .tab-icon {
    color: #ff0077;
    filter: drop-shadow(0 0 8px rgba(255, 0, 119, 0.9));
}

/* Admin usa las MISMAS vars de fit que usuario (--xrz-tabs-gap / pad / font).
   Solo un pelín menos padding de barra para el botón PANEL ADMIN extra. */
body.role-admin .tabs-bar {
    gap: var(--xrz-tabs-gap, 8px);
    padding-left: 16px;
    padding-right: 16px;
    align-items: center;
}
body.role-admin .tabs-bar > .tab {
    margin-left: 0;
    margin-right: 0;
    padding: var(--xrz-tab-pad-y, 10px) var(--xrz-tab-pad-x, 18px);
}
/* Slot del logo: min-width + márgenes laterales (aire para hover scale) */
.tabs-bar-logo-slot {
    min-width: var(--xrz-logo-slot-min, 176px) !important;
    margin-left: var(--xrz-logo-side-gap, 20px) !important;
    margin-right: var(--xrz-logo-side-gap, 20px) !important;
    padding: 6px 10px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    z-index: 2;
    position: relative;
}
.tabs-bar .xerberoz-logo-center {
    max-height: var(--xrz-logo-max-h, 40px) !important;
    transform-origin: center center !important;
    will-change: transform;
}
/* Hover del logo: crece dentro del aire del slot (sin empujar vecinos) */
.tabs-bar .xerberoz-logo-center:hover {
    transform: scale(1.12) !important;
}
.tab-close:hover {
    background: linear-gradient(135deg, rgba(255, 51, 51, 0.2) 0%, rgba(255, 51, 51, 0.02) 100%);
    border-color: rgba(255, 51, 51, 0.5);
    box-shadow: 0 8px 24px rgba(255, 51, 51, 0.25);
}
/* ═══════════════════════════════
   MAIN & PANELS
   ═══════════════════════════════ */
.main-content {
    position: relative; z-index: 1;
    width: 100% !important; 
    max-width: 96% !important; 
    margin: 0 auto !important;
    box-sizing: border-box !important;
    padding: 4px 0 20px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tab-panel { display: none; opacity: 1; filter: none; }
.tab-panel.active { 
    display: flex !important; 
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden; /* Evitar scroll horizontal global */
}
/* Crossfade tabs (XrzScreenTransition 0.15s): entrante en flujo, saliente absoluto — sin brinco al terminar */
.main-content.xrz-st-stacking {
    position: relative;
}
.tab-panel.xrz-st-entering {
    display: flex !important;
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: none !important;
}
.tab-panel.xrz-st-leaving {
    display: flex !important;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    flex-direction: column;
    overflow: hidden;
    pointer-events: none !important;
    box-sizing: border-box;
}
html.xrz-st-busy {
    cursor: wait;
}

/* F0 i18n — banderas: mismo sweep/resplandor ghost; activo = contorno+glow blanco */
.xrz-lang-btn {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.xrz-lang-btn img {
    position: relative;
    z-index: 1;
    display: block;
    pointer-events: none;
}
.xrz-lang-btn::after {
    z-index: 2;
}
.xrz-lang-btn:hover::after {
    animation: btnGhostSweep 0.33s ease-out forwards;
    opacity: 1;
}
.xrz-lang-btn.xrz-lang-active {
    border-color: rgba(255, 255, 255, 0.95) !important;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.10) !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.65),
        0 0 14px rgba(255, 255, 255, 0.50),
        0 0 28px rgba(255, 255, 255, 0.28),
        0 4px 16px rgba(0, 0, 0, 0.55),
        inset 0 1px 1px rgba(255, 255, 255, 0.35) !important;
}
.xrz-lang-btn.xrz-lang-active:hover {
    border-color: #ffffff !important;
    transform: translateY(-2px) scale(1.04);
    box-shadow:
        0 0 0 1px #ffffff,
        0 0 18px rgba(255, 255, 255, 0.60),
        0 0 34px rgba(255, 255, 255, 0.32),
        0 6px 20px rgba(0, 0, 0, 0.6),
        inset 0 1px 1px rgba(255, 255, 255, 0.45) !important;
}
.xrz-lang-btn.xrz-lang-active:hover::after {
    animation: btnGhostSweep 0.33s ease-out forwards;
    opacity: 1;
}
html.xrz-st-busy .tabs-bar .tab[data-tab] {
    pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
    .tab-panel.xrz-st-leaving,
    .tab-panel.xrz-st-entering {
        transition: none !important;
    }
}

/* ── Layout Utilities ── */
.flex-col-container {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.flex-card {
    display: flex;
    flex-direction: column;
    height: auto; /* Dejar que se ajuste al contenido */
    min-height: 0;
    flex-shrink: 0;
}
.scrollable-body {
    height: auto;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden; /* Evitar scroll horizontal interno */
    padding-right: 8px;
}
.scrollable-body::-webkit-scrollbar { width: 6px; }
.scrollable-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 4px; }
.scrollable-body::-webkit-scrollbar-thumb { background: rgba(134, 68, 255, 0.4); border-radius: 4px; }
.scrollable-body::-webkit-scrollbar-thumb:hover { background: rgba(134, 68, 255, 0.7); }

/* ── Card (panel HUD) ── */
.card {
    position: relative;
    padding: 22px 28px;
    margin-bottom: 22px;
    backdrop-filter: blur(25px);
    border-radius: 8px;
    border: none !important;
    background: linear-gradient(135deg, rgba(27, 14, 54, 0.72) 0%, rgba(15, 7, 32, 0.72) 100%);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45), 
                inset 0 1px 1px rgba(255, 255, 255, 0.08), 
                0 0 20px rgba(134, 68, 255, 0.04);
    overflow: hidden;
    height: auto; /* Cambiado de flex total a auto para no forzar altura vacía gigante */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s, background 0.4s;
}
/* Efecto hover eliminado de .card general */



.card > h2::after, .card > h3::after {
    content: '';
    display: block; width: 100%; height: 2px; margin-top: 12px; margin-bottom: 20px;
    background: linear-gradient(90deg, #ff0077 0%, #8644ff 60%, transparent 100%);
    transition: background 0.4s;
}
.card:hover > h2::after, .card:hover > h3::after {
    background: linear-gradient(90deg, #00f0ff 0%, #ff9900 60%, transparent 100%);
}
.card h2 {
    font-size: 1rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: #00f0ff;
    margin-bottom: 2px;
}
.card h3 {
    font-size: .88rem; font-weight: 600; letter-spacing: .1em;
    text-transform: uppercase; color: rgba(0, 240, 255, 0.7);
    margin-bottom: 2px;
}
.text-muted { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }

/* ═══════════════════════════════
/* ═══════════════════════════════
   TWO COLUMN
   ═══════════════════════════════ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; flex: 1; min-height: 0; }
.two-col > .card { min-height: 0; height: 100%; }
.two-col-right-wrapper { position: relative; width: 100%; height: 100%; min-height: 0; }
@media(min-width:961px) {
    .two-col-right-wrapper > .card {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
    }
}
@media(max-width:960px) {
    .two-col { grid-template-columns: 1fr; }
    .two-col > .card { height: auto; }
    .two-col-right-wrapper { height: auto; }
    .two-col-right-wrapper > .card { height: 500px; }
}

/* ═══════════════════════════════
   CANVAS WRAP
   ═══════════════════════════════ */
.canvas-wrap {
    position: relative; background: #000;
    border: 1px solid rgba(0,245,255,.15);
    border-radius: 4px; overflow: hidden; min-height: 180px;
    box-shadow: inset 0 0 20px rgba(0,0,0,.6),
                0 0 12px rgba(0,245,255,.06);
}
.canvas-wrap canvas { display: block; width: 100%; }

/* ═══════════════════════════════
   ANALYSIS OVERLAY
   ═══════════════════════════════ */
.analysis-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(2, 8, 18, 0.75);
    backdrop-filter: blur(4px); z-index: 2;
}
.analysis-overlay.analysis-overlay--select {
    pointer-events: none;
    background: rgba(2, 8, 18, 0.45);
    backdrop-filter: blur(1px);
}
.analysis-target-hint {
    margin: 0 0 10px 0;
    padding: 10px 14px;
    border: 1px solid #ff0000;
    border-radius: 8px;
    color: #ffffff;
    background: #ff0000;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.45;
}
.analysis-target-lost-hint {
    margin: 0 0 10px 0;
    padding: 8px 12px;
    border: 1px solid rgba(245, 158, 11, 0.55);
    border-radius: 8px;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.12);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}
.video-trim-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: 4px;
}
.video-trim-actions .btn-trim-action {
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    flex: 0 1 auto;
    min-width: 0;
}
.overlay-icon { font-size: 2.5rem; margin-bottom: 10px; opacity: .7; }
.analysis-overlay p { color: var(--muted); text-align: center; font-size: .85rem; line-height: 1.6; }

/* ═══════════════════════════════
   BUTTONS
   ═══════════════════════════════ */
.analyze-controls {
    display: flex;
    justify-content: space-between; /* Empuja Iniciar a la izq y Detener a la der */
    margin-top: 16px;
    gap: 16px;
}
.analyze-controls .btn-danger {
    justify-content: center;
    text-align: center;
}
.btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, #00f0ff 0%, #8644ff 100%);
    border: none;
    color: #ffffff;
    border-radius: 24px; padding: 11px 26px;
    font-family: var(--font-mono); font-size: .82rem;
    font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    cursor: pointer; transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
/* Rayo de reflexión cyberpunk */
.btn-primary::after {
    content: ''; position: absolute;
    top: 0; left: -80%;
    width: 55%; height: 100%;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 0, 119, 0.3) 40%, rgba(255, 255, 255, 0.75) 50%, rgba(0, 240, 255, 0.3) 60%, transparent 80%);
    transform: skewX(-15deg); pointer-events: none; opacity: 0;
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}
.btn-primary:hover:not(:disabled)::after {
    animation: btnCyanSweep 0.55s ease-out forwards;
    opacity: 1;
}
@keyframes btnCyanSweep {
    0%   { left: -80%; opacity: 1; }
    100% { left: 130%; opacity: 0.3; }
}
.btn-primary:disabled { opacity: .25; cursor: not-allowed; box-shadow: none; }

/* Botón Ghost Verde (OK / ACEPTAR — mismo estándar píldora que btn-ghost-red) */
.btn-ghost-green {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.4);
    color: #69f0ae;
    border-radius: 24px; padding: 10px 24px;
    font-family: var(--font-mono); font-size: .82rem;
    font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    cursor: pointer; transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
.btn-ghost-green::after {
    content: ''; position: absolute;
    top: 0; left: -80%;
    width: 55%; height: 100%;
    background: linear-gradient(110deg, transparent 20%, rgba(0, 255, 136, 0.3) 40%, rgba(255, 255, 255, 0.8) 50%, rgba(0, 255, 136, 0.3) 60%, transparent 80%);
    transform: skewX(-15deg); pointer-events: none; opacity: 0;
}
.btn-ghost-green:hover {
    transform: translateY(-3px) scale(1.03);
    border-color: #00ff88;
    color: #ffffff;
    background: rgba(0, 255, 136, 0.18);
    box-shadow: 0 8px 24px rgba(0, 255, 136, 0.3), 0 0 15px rgba(0, 255, 136, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.btn-ghost-green:hover::after {
    animation: btnGhostSweep 0.33s ease-out forwards;
    opacity: 1;
}
.btn-ghost-green:active,
.btn-ghost-green.is-selected {
    transform: translateY(-3px) scale(1.03);
    border-color: #00ff88;
    color: #ffffff;
    background: rgba(0, 255, 136, 0.18);
    box-shadow: 0 8px 24px rgba(0, 255, 136, 0.3), 0 0 15px rgba(0, 255, 136, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.btn-ghost-green.is-selected::after {
    animation: btnGhostSweep 0.33s ease-out forwards;
    opacity: 1;
}

/* ══════════════════════════════════════════════════
   ESTÁNDAR DE BOTONES DE LA APLICACIÓN
   · btn-advance  → Verde  → Avanzar / Continuar
   · btn-select   → Ámbar  → Seleccionar / Opciones
   · btn-danger   → Rojo   → Cancelar / Eliminar
   ══════════════════════════════════════════════════ */



.btn-danger {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(135deg, #ff0055 0%, #ff9900 100%);
    border: none;
    color: #ffffff; border-radius: 24px; padding: 11px 26px;
    font-family: var(--font-mono); font-size: .82rem;
    font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    cursor: pointer; transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
/* Rayo rojo */
.btn-danger::after {
    content: ''; position: absolute;
    top: 0; left: -80%;
    width: 55%; height: 100%;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 0, 85, 0.3) 40%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 153, 0, 0.3) 60%, transparent 80%);
    transform: skewX(-15deg); pointer-events: none; opacity: 0;
}
.btn-danger:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}
.btn-danger:hover:not(:disabled)::after {
    animation: btnRedSweep 0.55s ease-out forwards;
    opacity: 1;
}
@keyframes btnRedSweep {
    0%   { left: -80%; opacity: 1; }
    100% { left: 130%; opacity: 0.3; }
}
.btn-danger:disabled { opacity: .25; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(134, 68, 255, 0.4);
    color: #e6e1fc; border-radius: 24px; padding: 10px 24px;
    font-family: var(--font-mono); font-size: .82rem;
    font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    cursor: pointer; transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
/* Rayo gris/cyan tenue */
.btn-ghost::after {
    content: ''; position: absolute;
    top: 0; left: -80%;
    width: 55%; height: 100%;
    background: linear-gradient(110deg, transparent 20%, rgba(134, 68, 255, 0.2) 40%, rgba(255, 255, 255, 0.5) 50%, rgba(0, 240, 255, 0.2) 60%, transparent 80%);
    transform: skewX(-15deg); pointer-events: none; opacity: 0;
}
.btn-ghost:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: #00f0ff; color: #00f0ff;
    box-shadow: 0 8px 24px rgba(0, 240, 255, 0.25), 0 0 15px rgba(134, 68, 255, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.btn-ghost:hover::after {
    animation: btnGhostSweep 0.33s ease-out forwards;
    opacity: 1;
}
@keyframes btnGhostSweep {
    0%   { left: -80%; opacity: 1; }
    100% { left: 130%; opacity: 0.2; }
}

/* Botón Ghost Rojo (NOK / CANCELAR — estándar píldora) */
.btn-ghost-red {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(255, 0, 85, 0.05);
    border: 1px solid rgba(255, 0, 85, 0.4);
    color: #ff8a8a;
    border-radius: 24px; padding: 10px 24px;
    font-family: var(--font-mono); font-size: .82rem;
    font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    cursor: pointer; transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    min-width: 170px; /* Tamaño igualado */
}
.btn-ghost-red::after {
    content: ''; position: absolute;
    top: 0; left: -80%;
    width: 55%; height: 100%;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 0, 85, 0.3) 40%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 153, 0, 0.3) 60%, transparent 80%);
    transform: skewX(-15deg); pointer-events: none; opacity: 0;
}
.btn-ghost-red:hover {
    transform: translateY(-3px) scale(1.03);
    border-color: #ff0055;
    color: #ffffff;
    background: rgba(255, 0, 85, 0.18);
    box-shadow: 0 8px 24px rgba(255, 0, 85, 0.3), 0 0 15px rgba(255, 0, 85, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.btn-ghost-red:hover::after {
    animation: btnGhostSweep 0.33s ease-out forwards;
    opacity: 1;
}

/* Botón Ghost Aqua (Inicio) */
.btn-ghost-aqua {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.4);
    color: #ffffff; /* Texto blanco */
    border-radius: 24px; padding: 10px 24px;
    font-family: var(--font-mono); font-size: .82rem;
    font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    cursor: pointer; transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    min-width: 170px; /* Tamaño igualado */
}
.btn-ghost-aqua::after {
    content: ''; position: absolute;
    top: 0; left: -80%;
    width: 55%; height: 100%;
    background: linear-gradient(110deg, transparent 20%, rgba(0, 240, 255, 0.3) 40%, rgba(255, 255, 255, 0.8) 50%, rgba(0, 240, 255, 0.3) 60%, transparent 80%);
    transform: skewX(-15deg); pointer-events: none; opacity: 0;
}
.btn-ghost-aqua:hover {
    transform: translateY(-3px) scale(1.03);
    border-color: #00f0ff;
    box-shadow: 0 8px 24px rgba(0, 240, 255, 0.3), 0 0 15px rgba(0, 240, 255, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.btn-ghost-aqua:hover::after {
    animation: btnGhostSweep 0.33s ease-out forwards;
    opacity: 1;
}

/* Botón Ghost Amber (JSON) */
.btn-ghost-amber {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(255, 170, 0, 0.05);
    border: 1px solid rgba(255, 170, 0, 0.4);
    color: #ffe082; /* Amarillo claro — estándar como verde claro del btn-ghost-green */
    border-radius: 24px; padding: 10px 24px;
    font-family: var(--font-mono); font-size: .82rem;
    font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    cursor: pointer; transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    min-width: 170px; /* Tamaño igualado */
}
.btn-ghost-amber::after {
    content: ''; position: absolute;
    top: 0; left: -80%;
    width: 55%; height: 100%;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 170, 0, 0.3) 40%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 170, 0, 0.3) 60%, transparent 80%);
    transform: skewX(-15deg); pointer-events: none; opacity: 0;
}
.btn-ghost-amber:hover,
.btn-ghost-amber:active,
.btn-ghost-amber.is-selected {
    transform: translateY(-3px) scale(1.03);
    border-color: #ffaa00;
    color: #ffffff;
    background: rgba(255, 170, 0, 0.18);
    box-shadow: 0 8px 24px rgba(255, 170, 0, 0.3), 0 0 15px rgba(255, 170, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.btn-ghost-amber:hover::after,
.btn-ghost-amber.is-selected::after {
    animation: btnGhostSweep 0.33s ease-out forwards;
    opacity: 1;
}

.btn-lg { padding: 11px 24px; font-size: .82rem; }

/* Icono dentro de botón */
.btn-icon {
    width: 14px; height: 14px;
    stroke: currentColor; flex-shrink: 0;
}

/* ═══════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════ */
.progress-bar-track {
    height: 8px; background: rgba(0,245,255,.08);
    border-radius: 999px; overflow: hidden; margin-top: 14px;
}
.progress-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    transition: width .15s;
    box-shadow: 0 0 10px var(--cyan);
    border-radius: 999px;
}
.progress-label {
    font-size: .72rem; color: var(--muted); margin-top: 5px;
    font-family: var(--font-mono); letter-spacing: .04em;
}

/* ═══════════════════════════════
   LIVE LOG
   ═══════════════════════════════ */
.live-log {
    background: rgba(0,0,0,.6); border: 1px solid var(--border);
    border-radius: 3px; padding: 12px 14px;
    flex: 1; min-height: 0; overflow-y: auto;
    font-family: var(--font-mono); font-size: .82rem;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.live-log::-webkit-scrollbar { width: 4px; }
.live-log::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.log-empty { color: var(--muted); text-align: center; padding: 40px 0; font-size: .82rem; }
.log-line {
    padding: 5px 0; border-bottom: 1px solid rgba(0,245,255,.04);
    animation: logIn .25s ease; line-height: 1.6;
}
@keyframes logIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; } }
.log-time { color: var(--muted); }
.log-code {
    font-weight: 700; padding: 1px 7px; border-radius: 2px; margin: 0 5px;
    font-size: .7rem; letter-spacing: .05em;
}
.code-m { background: rgba(0,102,255,.2); color: #4da6ff; border: 1px solid rgba(0,102,255,.3); }
.code-g { background: rgba(0,255,136,.15); color: var(--green); border: 1px solid rgba(0,255,136,.25); }
.code-p { background: rgba(255,229,102,.12); color: var(--yellow); border: 1px solid rgba(255,229,102,.2); }

/* ── Live Metrics ── */
.live-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 14px; }
.lm-item {
    background: rgba(28, 12, 64, 0.4); 
    border: 1px solid rgba(134, 68, 255, 0.3);
    border-radius: 8px; padding: 12px 8px; text-align: center;
    transition: all .25s ease;
}
.lm-item:hover {
    background: rgba(28, 12, 64, 0.7); 
    border-color: #00f0ff;
}
.lm-item span {
    display: block; font-size: 1.3rem; font-weight: 700;
    color: var(--cyan); font-family: var(--font-mono);
}
.lm-item small { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ═══════════════════════════════
   KPI CARDS
   ═══════════════════════════════ */
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
@media(max-width:700px) { .kpi-grid { grid-template-columns: repeat(2,1fr); } }

.kpi-card {
    position: relative;
    border-radius: 12px; padding: 26px 20px; text-align: center;
    overflow: hidden;
    border: 1.5px solid transparent;
    background: linear-gradient(rgba(12, 6, 32, 0.8), rgba(12, 6, 32, 0.8)) padding-box, 
                linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(153, 0, 255, 0.2), rgba(255, 0, 119, 0.2)) border-box;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
    transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.kpi-card:hover {
    transform: translateY(-4px) scale(1.02);
    background: linear-gradient(rgba(16, 9, 44, 0.85), rgba(16, 9, 44, 0.85)) padding-box, 
                linear-gradient(135deg, #00f0ff, #8644ff, #ff0077) border-box;
    box-shadow: 0 12px 32px rgba(0,0,0,.6);
}
.kpi-card::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 100%; height: 1.5px;
    background: linear-gradient(90deg, transparent 0%, #00f0ff 50%, transparent 100%);
    opacity: .6;
}
.kpi-card span {
    display: block; font-size: 2.4rem; font-weight: 800;
    color: var(--green); font-family: var(--font-mono);
}
.kpi-card small {
    font-size: .75rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: .08em;
}

/* ═══════════════════════════════
   EMPTY STATE
   ═══════════════════════════════ */
.empty-state {
    text-align: center; padding: 80px 20px; color: var(--muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .4; }

/* ═══════════════════════════════
   TABLES
   ═══════════════════════════════ */
.table-scroll-wrapper {
    overflow-y: auto;
    overflow-x: auto;
    max-height: 55vh; /* Ajuste para evitar que desborde el body */
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.table-scroll-wrapper::-webkit-scrollbar { width: 6px; height: 6px; }
.table-scroll-wrapper::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 4px; }
.table-scroll-wrapper::-webkit-scrollbar-thumb { background: rgba(134, 68, 255, 0.4); border-radius: 4px; }
.table-scroll-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(134, 68, 255, 0.7); }

.ref-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ref-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    /* Fondo oscuro sólido debajo del gradiente para ocultar filas al hacer scroll */
    background: linear-gradient(90deg, rgba(134, 68, 255, 0.25) 0%, rgba(255, 0, 119, 0.18) 100%), #120921 !important;
    color: #00f0ff; font-weight: 700;
    padding: 12px 16px; text-align: left;
    border-bottom: 2px solid rgba(134, 68, 255, 0.4);
    text-transform: uppercase; letter-spacing: .08em; font-size: .8rem;
    font-family: var(--font-mono);
    /* Sombra pequeña para dar efecto de relieve cuando se scrollea */
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
}
.ref-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(134, 68, 255, 0.1);
    color: var(--text);
}
.ref-table tr:hover td { background: rgba(134, 68, 255, 0.08); color: #ffffff; }

/* ── Tags ── */
.tag {
    display: inline-block; border-radius: 2px;
    padding: 2px 9px; font-size: .7rem;
    font-weight: 700; font-family: var(--font-mono);
    letter-spacing: .06em;
}
.tag-m { background: rgba(0,102,255,.15); color: #4da6ff; border: 1px solid rgba(0,102,255,.3); }
.tag-g { background: rgba(0,255,136,.12); color: var(--green); border: 1px solid rgba(0,255,136,.25); }
.tag-p { background: rgba(255,229,102,.1);  color: var(--yellow); border: 1px solid rgba(255,229,102,.2); }

/* ═══════════════════════════════
   FORMULA BOX
   ═══════════════════════════════ */
.formula-box {
    background: rgba(0,245,255,.03);
    border: 1px solid var(--border); border-radius: 3px;
    padding: 12px 16px;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    position: relative; overflow: hidden;
}
.formula-box::before {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,245,255,.3), transparent);
}
.formula-label { font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.formula {
    font-family: var(--font-mono); font-size: .92rem;
    color: var(--cyan); font-weight: 600;
}



/* ═══════════════════════════════
   PANTALLA DE BIENVENIDA (SPLASH)
   ═══════════════════════════════ */
.splash-overlay {
    position: fixed; inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: auto;
    background: transparent;
    z-index: 100000;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px;
    /* backdrop-filter: blur(12px); */
    transition: opacity 0.25s ease-out, visibility 0.25s;
}
.splash-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.splash-card {
    position: relative;
    width: 90%; max-width: 1020px;
    background: linear-gradient(rgba(18, 22, 28, 0.95), rgba(18, 22, 28, 0.95)) padding-box, 
                linear-gradient(135deg, rgba(255, 0, 119, 0.4), rgba(134, 68, 255, 0.4), rgba(0, 240, 255, 0.4), rgba(255, 153, 0, 0.4)) border-box;
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 25px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(134, 68, 255, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.2);
    display: flex; flex-direction: column; gap: 20px;
}

/* Efecto de luz viajando por el borde interno */
.splash-card-glow {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    padding: 2.5px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    border-radius: 20px;
}
.splash-card-glow::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0%, 
        #00f0ff 10%, 
        transparent 10.1%, 
        
        transparent 30%, 
        #ff0077 50%, 
        #8644ff 55%, 
        transparent 55.1%,

        transparent 75%,
        #ff9900 85%,
        transparent 85.1%,
        transparent 100%
    );
    animation: snakeLight 5s linear infinite;
}

@keyframes snakeLight {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.splash-card > *:not(.splash-card-glow):not(.splash-corner) {
    position: relative;
    z-index: 1;
}
.splash-corner {
    display: none;
    position: absolute; width: 16px; height: 16px;
    border: 2.5px solid #00f0ff;
    z-index: 2;
}
.splash-corner.tl { top: -2px; left: -2px; border-right: none; border-bottom: none; border-top-left-radius: 20px; }
.splash-corner.tr { top: -2px; right: -2px; border-left: none; border-bottom: none; border-top-right-radius: 20px; }
.splash-corner.bl { bottom: -2px; left: -2px; border-right: none; border-top: none; border-bottom-left-radius: 20px; }
.splash-corner.br { bottom: -2px; right: -2px; border-left: none; border-top: none; border-bottom-right-radius: 20px; }

.splash-logo-row {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.splash-logo-container {
    position: relative;
    width: auto;
    max-width: 95vw;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}
.splash-hand-base {
    width: 100%;
    height: auto;
    max-height: 55vh;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    opacity: 1 !important;
    animation: handPulse 4s ease-in-out infinite alternate;
}
@keyframes handPulse {
    0% { transform: scale(1.0); }
    100% { transform: scale(1.02); }
}
.splash-hand-lightning {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    filter: brightness(2.0);
    -webkit-mask-image: linear-gradient(110deg, transparent 0%, transparent 45%, rgba(255,255,255,1) 50%, transparent 55%, transparent 100%);
    -webkit-mask-size: 250% 100%;
    animation: lightningSweep 2.5s linear infinite;
}

@keyframes lightningSweep {
    0%   { -webkit-mask-position: 150% 0; }
    100% { -webkit-mask-position: -50% 0; }
}
.splash-title-wrapper {
    display: flex; align-items: baseline; gap: 16px;
}
.splash-title {
    font-size: 1.7rem; font-weight: 800; color: #ffffff;
    letter-spacing: 0.05em;
    background: linear-gradient(90deg, #00f0ff, #ff0077, #ff9900);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    white-space: nowrap;
}
.splash-version-inline {
    font-family: var(--font-mono); font-size: 1rem; color: #ff9900;
    letter-spacing: 0.1em;
}
.splash-version-subtitle {
    font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted);
    letter-spacing: 0.15em; text-transform: uppercase;
}

.splash-divider {
    height: 2px; width: 100%;
    background: linear-gradient(90deg, transparent, rgba(134, 68, 255, 0.5), transparent);
}

.splash-body {
    display: flex; flex-direction: column; gap: 16px;
}
.splash-welcome {
    font-size: 1.3rem; font-weight: 600; color: #fff;
}
.splash-desc {
    font-size: 1.05rem; line-height: 1.6; color: rgba(255,255,255,0.85);
}
.splash-desc strong { color: #00f0ff; font-weight: 700; }

.splash-actions {
    display: flex; gap: 16px; margin-top: 10px;
    justify-content: center;
}
/* Ocultar SOLO la UI de la app mientras el splash esté activo.
   El fondo dinámico (mesh-bg / hud-bg) permanece visible;
   el splash-overlay sigue con background transparent. */
body.splash-active .app-header,
body.splash-active .sticky-top-container,
body.splash-active .tabs-bar,
body.splash-active .main-content,
body.splash-active .global-hud-frame {
    display: none !important;
}

/* ═══════════════════════════════
   AJUSTES INPUT (TAB 4)
   ═══════════════════════════════ */
.adjust-input {
    background: rgba(8, 4, 24, 0.8);
    border: 2px solid rgba(134, 68, 255, 0.4);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
}
.adjust-input:focus {
    border-color: transparent;
    background: linear-gradient(rgba(12, 6, 32, 0.9), rgba(12, 6, 32, 0.9)) padding-box, 
                linear-gradient(135deg, #00f0ff, #8644ff) border-box;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
}
.adjust-input::placeholder {
    color: var(--muted);
    opacity: 0.5;
}

/* ═══════════════════════════════
   MODALS (AYUDA)
   ═══════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 5, 12, 0.85);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex; align-items: center; justify-content: center;
}
.modal-content {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 30px;
    max-width: 650px;
    width: 90%;
    position: relative;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.85);
    animation: modalIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-close {
    position: absolute; top: 15px; right: 20px;
    background: transparent; border: none;
    color: var(--muted); font-size: 2rem;
    cursor: pointer; transition: color 0.2s;
    line-height: 1;
}
.modal-close:hover { color: #ff3333; }

.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(0,245,255,0.3); border-radius: 3px; }
.modal-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }

/* Formato de listas MODAPTS (Ayuda) */
.modapts-list {
    list-style: none;
    padding-left: 10px;
    font-family: var(--font-mono);
    color: #fff;
    margin-bottom: 16px;
}
.modapts-list li {
    display: flex;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 6px;
}
.modapts-list li span {
    flex-shrink: 0;
    min-width: 32px;
    display: inline-block;
}

/* Destacado verde para números de resultados */
.result-number {
    color: var(--green) !important;
    font-weight: 700;
    font-family: var(--font-mono);
}

/* ═══════════════════════════════
   DISEÑO PREMIUM DE TABS DE AYUDA (Side-by-Side)
   ═══════════════════════════════ */
.help-container {
    display: flex;
    gap: 24px;
    flex-grow: 1;
    min-height: 0;
    margin-top: 15px;
}
.help-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding-right: 20px;
    overflow-y: auto;
}
.help-tab-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: var(--muted);
    padding: 12px 14px;
    text-align: left;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
}
.help-tab-btn:hover {
    background: rgba(255, 255, 255, 0.10) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.75) !important;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.28), 0 0 4px rgba(255, 255, 255, 0.45);
    padding-left: 18px;
    transform: translateX(2px);
}
.help-tab-btn.active {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.32), 0 0 6px rgba(255, 255, 255, 0.5);
}
.help-tab-btn.active:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.4), 0 0 8px rgba(255, 255, 255, 0.55);
}
/* Manual de Usuario — contorno amarillo + relleno tenue; se enciende al hover */
a.btn-manual-usuario,
.btn-manual-usuario {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: 10px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.04em;
    color: #ffd700 !important;
    background: rgba(255, 215, 0, 0.10) !important;
    border: 1.5px solid #ffd700 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.18);
    cursor: pointer;
    transition: background 0.22s ease, box-shadow 0.22s ease, color 0.22s ease, filter 0.22s ease, transform 0.22s ease;
    position: relative;
    z-index: 2;
    pointer-events: auto;
}
a.btn-manual-usuario:hover,
.btn-manual-usuario:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.45), 0 0 8px rgba(255, 255, 255, 0.6);
    filter: none;
    transform: translateY(-1px);
}
a.btn-manual-usuario:active,
.btn-manual-usuario:active {
    transform: translateY(0);
    filter: brightness(0.98);
}
.help-content-area {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 15px;
    position: relative;
}
.help-content-area.xrz-st-stacking {
    min-height: 280px;
}
.help-tab-pane {
    display: none;
}
.help-tab-pane.active {
    display: block;
}
.help-tab-pane.xrz-st-entering {
    display: block !important;
    position: relative;
    z-index: 1;
    pointer-events: none !important;
}
.help-tab-pane.xrz-st-leaving {
    display: block !important;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 2;
    pointer-events: none !important;
    box-sizing: border-box;
}
.help-tab-pane p, .help-tab-pane ul, .help-tab-pane ol {
    font-size: 1.12rem;
    line-height: 1.65;
    color: #e2e8f0;
}

/* Overlay navegación entre páginas (EFI / Manual) */
#xrz-nav-fade-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: #070416;
    opacity: 0;
    pointer-events: none;
    display: none;
}
#xrz-nav-fade-overlay.xrz-nav-visible {
    display: block;
    pointer-events: all;
}

/* Cubierta ANTES del primer paint al llegar desde otra página (evita corte) */
html.xrz-nav-pending {
    background: #070416 !important;
}
html.xrz-nav-pending body {
    background: #070416 !important;
}
html.xrz-nav-pending::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: #070416;
    pointer-events: all;
}

/* Tablas técnicas de ayuda */
.help-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0 24px 0;
    font-size: 1.08rem;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.help-table th, .help-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.help-table th {
    background: rgba(0, 245, 255, 0.08);
    color: var(--cyan);
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.03em;
}
.help-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}
.help-table code {
    font-family: var(--font-mono);
    color: #a3ff00;
    font-weight: 700;
    font-size: 1.12rem;
    background: rgba(163, 255, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
}
.help-alert-box {
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.08) 0%, rgba(255, 120, 0, 0.03) 100%);
    border-left: 4px solid #ffaa00;
    border-radius: 6px;
    padding: 14px 18px;
    margin: 18px 0;
    color: #ffd080;
    font-size: 1.08rem;
    line-height: 1.55;
}
.help-section-title {
    color: var(--cyan) !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin: 24px 0 12px 0 !important;
    border-bottom: 1px solid rgba(0, 245, 255, 0.15) !important;
    padding-bottom: 6px !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
}
.header-visual-box {
    border-radius: 8px !important;
    background: #0A0A0A !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: none !important;
    animation: none !important;
    width: 100% !important;
    max-width: 96% !important; 
    margin: 0 auto !important;
    box-sizing: border-box !important;
}
.help-list-premium {
    list-style: none;
    padding-left: 0;
    margin-bottom: 18px;
}
.help-list-premium li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    font-size: 1.12rem;
    line-height: 1.65;
    color: #e0e8f0;
}
.help-list-premium li::before {
    content: "•";
    color: #a3ff00;
    font-weight: bold;
    font-size: 1.45rem;
    position: absolute;
    left: 6px;
    top: -2px;
}

/* Selector de Modos de Operación y Estilos de Documento */
.mode-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 105px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mode-card:hover {
    transform: translateY(-5px);
    animation: none !important;
}

#mode-video-btn:hover {
    box-shadow: 0 0 35px rgba(14, 165, 233, 0.9), 0 8px 24px rgba(0, 0, 0, 0.6) !important;
    border-color: #0ea5e9 !important;
}

#mode-doc-btn:hover {
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.9), 0 8px 24px rgba(0, 0, 0, 0.6) !important;
    border-color: #a855f7 !important;
}

#mode-interactive-btn:hover {
    box-shadow: 0 0 35px rgba(236, 72, 153, 0.9), 0 8px 24px rgba(0, 0, 0, 0.6) !important;
    border-color: #ec4899 !important;
}

/* ── Active state por cada tarjeta de modo ── */
#mode-video-btn.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(30, 27, 75, 0.45)) !important;
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.5), 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}
#mode-doc-btn.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(30, 27, 75, 0.45)) !important;
    border-color: #a855f7 !important;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.5), 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}
#mode-interactive-btn.active {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.18), rgba(30, 27, 75, 0.45)) !important;
    border-color: #ec4899 !important;
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.5), 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}
#mode-ergonomics-btn.active {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(10, 50, 30, 0.45)) !important;
    border-color: #00ff88 !important;
    box-shadow: 0 0 28px rgba(0, 255, 136, 0.55), 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}
#mode-nom036-btn.active {
    background: linear-gradient(135deg, rgba(57, 255, 20, 0.15), rgba(10, 50, 30, 0.45)) !important;
    border-color: #39ff14 !important;
    box-shadow: 0 0 28px rgba(57, 255, 20, 0.55), 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}
#mode-efi-btn.active, #mode-efi-estacion-btn.active {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(30, 27, 75, 0.45)) !important;
    border-color: #ff6b35 !important;
    box-shadow: 0 0 28px rgba(255, 107, 53, 0.55), 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}
#mode-efi-linea-btn.active {
    background: linear-gradient(135deg, rgba(255, 133, 51, 0.15), rgba(30, 27, 75, 0.45)) !important;
    border-color: #ff8533 !important;
    box-shadow: 0 0 28px rgba(255, 133, 51, 0.55), 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

/* ── Hover states ── */
#mode-ergonomics-btn:hover {
    box-shadow: 0 0 35px rgba(0, 255, 136, 0.7), 0 8px 24px rgba(0, 0, 0, 0.6) !important;
    border-color: #00ff88 !important;
}

#mode-nom036-btn:hover {
    box-shadow: 0 0 35px rgba(57, 255, 20, 0.7), 0 8px 24px rgba(0, 0, 0, 0.6) !important;
    border-color: #39ff14 !important;
}
#mode-efi-btn:hover, #mode-efi-estacion-btn:hover {
    box-shadow: 0 0 35px rgba(255, 107, 53, 0.7), 0 8px 24px rgba(0, 0, 0, 0.6) !important;
    border-color: #ff6b35 !important;
}
#mode-efi-linea-btn:hover {
    box-shadow: 0 0 35px rgba(255, 133, 51, 0.7), 0 8px 24px rgba(0, 0, 0, 0.6) !important;
    border-color: #ff8533 !important;
}

.row-manually-adjusted {
    background: rgba(0, 255, 204, 0.04) !important;
    border-left: 3px solid #00ffcc !important;
}
.row-manually-adjusted td {
    color: #00ffcc !important;
}

/* ==========================================================================
   MODAL INTERACTIVO
   ========================================================================== */
.i-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: transparent; /* Fondo 100% transparente para ver la malla pura */
    backdrop-filter: none; /* Sin difuminado para no manchar el fondo */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}
.i-modal-content {
    width: 95vw; height: 95vh;
    background: transparent; /* Contenedor transparente */
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Separación física entre header y main */
    box-shadow: none;
}

/* Header */
.i-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: #0A0B10; /* Color de panel flotante */
    border: 1px solid var(--border);
    border-radius: 16px; /* Bordes redondeados independientes */
    box-shadow: var(--inset-hi), 0 4px 16px rgba(0,0,0,0.8);
}
.i-header-left {
    display: flex;
    align-items: center;
}
.i-header-right {
    display: flex;
    align-items: center;
}

/* Main Layout */
.i-main {
    display: flex;
    flex: 1;
    gap: 20px; /* Separación física entre paneles izquierdo y derecho */
    overflow: hidden;
}
.i-left-panel {
    flex: 0 0 400px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 16px;
    overflow: hidden;
}
.i-right-panel {
    flex: 1;
    background: transparent; /* Contenedor de diseño transparente */
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    padding: 0; /* Removido para que los hijos dicten el espacio */
    overflow: hidden;
    gap: 20px; /* Separación física real entre acciones y tabla */
}

/* Silueta SVG */
.i-svg-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0A0B10;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--inset-hi), 0 4px 16px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
}
.body-zone {
    fill: rgba(0, 255, 255, 0.05);
    stroke: rgba(0, 255, 255, 0.4);
    stroke-width: 1.5;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.body-zone:hover {
    fill: rgba(255,255,255,0.1);
    stroke: rgba(255,255,255,0.3);
    stroke-width: 2;
}
.body-zone.zone-selected {
    stroke-width: 3;
}

/* Colores por zona en hover y selected */
.body-zone[data-code="M1"]:hover, .body-zone[data-code="M1"].cascade-hover, .body-zone[data-code="M1"].cascade-selected { fill: rgba(255, 51, 0, 0.2); stroke: #ff3300; }
.body-zone[data-code="M1"].zone-selected { fill: rgba(255, 51, 0, 0.3); stroke: #ff3300; filter: drop-shadow(0 0 12px rgba(255,51,0,0.6)); }
.body-zone[data-code="M1"].zone-selected + .zone-label { fill: #ff3300; filter: drop-shadow(0 0 5px #ff3300); }

.body-zone[data-code="M2"]:hover, .body-zone[data-code="M2"].cascade-hover, .body-zone[data-code="M2"].cascade-selected { fill: rgba(255, 0, 255, 0.2); stroke: #ff00ff; }
.body-zone[data-code="M2"].zone-selected { fill: rgba(255, 0, 255, 0.3); stroke: #ff00ff; filter: drop-shadow(0 0 12px rgba(255,0,255,0.6)); }
.body-zone[data-code="M2"].zone-selected + .zone-label { fill: #ff00ff; filter: drop-shadow(0 0 5px #ff00ff); }

.body-zone[data-code="M3"]:hover, .body-zone[data-code="M3"].cascade-hover, .body-zone[data-code="M3"].cascade-selected { fill: rgba(170, 255, 0, 0.2); stroke: #aaff00; }
.body-zone[data-code="M3"].zone-selected { fill: rgba(170, 255, 0, 0.3); stroke: #aaff00; filter: drop-shadow(0 0 12px rgba(170,255,0,0.6)); }
.body-zone[data-code="M3"].zone-selected + .zone-label { fill: #aaff00; filter: drop-shadow(0 0 5px #aaff00); }

.body-zone[data-code="M4"]:hover, .body-zone[data-code="M4"].cascade-hover, .body-zone[data-code="M4"].cascade-selected { fill: rgba(255, 0, 0, 0.2); stroke: #ff0000; }
.body-zone[data-code="M4"].zone-selected { fill: rgba(255, 0, 0, 0.3); stroke: #ff0000; filter: drop-shadow(0 0 12px rgba(255,0,0,0.6)); }
.body-zone[data-code="M4"].zone-selected + .zone-label { fill: #ff0000; filter: drop-shadow(0 0 5px #ff0000); }

.body-zone[data-code="M5"]:hover, .body-zone[data-code="M5"].cascade-hover, .body-zone[data-code="M5"].cascade-selected { fill: rgba(255, 153, 0, 0.2); stroke: #ff9900; }
.body-zone[data-code="M5"].zone-selected { fill: rgba(255, 153, 0, 0.3); stroke: #ff9900; filter: drop-shadow(0 0 12px rgba(255,153,0,0.6)); }
.body-zone[data-code="M5"].zone-selected + .zone-label { fill: #ff9900; filter: drop-shadow(0 0 5px #ff9900); }

.body-zone[data-code="M7"]:hover, .body-zone[data-code="M7"].cascade-hover, .body-zone[data-code="M7"].cascade-selected { fill: rgba(255, 0, 255, 0.2); stroke: #ff00ff; }
.body-zone[data-code="M7"].zone-selected { fill: rgba(255, 0, 255, 0.3); stroke: #ff00ff; filter: drop-shadow(0 0 12px rgba(255,0,255,0.6)); }
.body-zone[data-code="M7"].zone-selected + .zone-label { fill: #ff00ff; filter: drop-shadow(0 0 5px #ff00ff); font-size: 16px; }

.body-zone[data-code="B17"]:hover { fill: rgba(0, 153, 255, 0.2); stroke: #0099ff; }
.body-zone[data-code="B17"].zone-selected { fill: rgba(0, 153, 255, 0.3); stroke: #0099ff; filter: drop-shadow(0 0 12px rgba(0,153,255,0.6)); }
.body-zone[data-code="B17"].zone-selected + .zone-label { fill: #0099ff; filter: drop-shadow(0 0 5px #0099ff); }

.body-zone[data-code="S30"]:hover { fill: rgba(255, 85, 0, 0.2); stroke: #ff5500; }
.body-zone[data-code="S30"].zone-selected { fill: rgba(255, 85, 0, 0.3); stroke: #ff5500; filter: drop-shadow(0 0 12px rgba(255,85,0,0.6)); }
.body-zone[data-code="S30"].zone-selected + .zone-label { fill: #ff5500; filter: drop-shadow(0 0 5px #ff5500); }

.i-aux-btn.i-aux-selected {
    background: linear-gradient(135deg, rgba(134, 68, 255, 0.25), rgba(30, 34, 53, 0.9));
    border-color: rgba(134, 68, 255, 0.8);
    box-shadow: 0 0 15px rgba(134, 68, 255, 0.4);
    transform: translateY(-2px);
}

/* ── Botones de pasos W5 ── */
.i-step-btn {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 1px solid var(--primary);
    background: rgba(0, 255, 255, 0.1);
    color: var(--primary);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}
.i-step-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
}
.i-step-btn:active {
    transform: scale(0.92);
    background: rgba(0, 255, 255, 0.3);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* ── Fix para botón 100% ancho ── */
#btnIConfirmManual:hover {
    transform: translateY(-3px) scale(1) !important;
}

.i-aux-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.body-zone[data-code="F3"]:hover { fill: rgba(0, 255, 153, 0.2); stroke: #00ff99; }
.body-zone[data-code="F3"].zone-selected { fill: rgba(0, 255, 153, 0.3); stroke: #00ff99; filter: drop-shadow(0 0 12px rgba(0,255,153,0.6)); }
.body-zone[data-code="F3"].zone-selected + .zone-label { fill: #00ff99; filter: drop-shadow(0 0 5px #00ff99); }

.body-zone[data-code="W5"]:hover { fill: rgba(200, 220, 255, 0.2); stroke: #c8dcff; }
.body-zone[data-code="W5"].zone-selected { fill: rgba(200, 220, 255, 0.3); stroke: #c8dcff; filter: drop-shadow(0 0 12px rgba(200,220,255,0.6)); }
.body-zone[data-code="W5"].zone-selected + .zone-label { fill: #c8dcff; filter: drop-shadow(0 0 5px #c8dcff); }

.zone-label {
    fill: rgba(255,255,255,0.3);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: bold;
    text-anchor: middle;
    transition: all 0.3s;
}
.body-zone.zone-selected + .zone-label {
    font-size: 16px;
}

/* Code Preview */
.i-preview-box {
    background: #0A0B10;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--inset-hi), 0 4px 16px rgba(0,0,0,0.8);
    padding: 20px;
    flex-shrink: 0;
}

/* Acciones Panel */
.i-actions-container {
    flex-shrink: 0;          /* Tamaño natural, sin scroll */
    background: #0A0B10;     /* Panel flotante */
    border: 1px solid var(--border);
    border-radius: 16px;     /* Redondeado de tarjeta */
    box-shadow: var(--inset-hi), 0 4px 16px rgba(0,0,0,0.8);
    padding: 20px;           /* Mejor espaciado interior */
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.i-term-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
}
.i-term-btn {
    background: rgba(30, 34, 53, 0.8) !important;
    border: 2px solid transparent !important;
    border-radius: 10px !important;
    padding: 10px 8px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    color: #fff !important;
    position: relative;
    overflow: hidden;
}
.i-term-btn strong {
    font-size: 1.4rem !important;
    font-family: var(--font-mono) !important;
    margin-bottom: 3px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}
.i-term-btn span {
    font-size: 0.75rem !important;
    color: rgba(255,255,255,0.65) !important;
    text-align: center !important;
    font-weight: 500 !important;
}

/* Red for G actions */
.i-term-btn[data-code^="G"] {
    border-color: rgba(255, 50, 80, 0.3) !important;
}
.i-term-btn[data-code^="G"] strong {
    color: #ff3250 !important;
}
.i-term-btn[data-code^="G"]:hover, .i-term-btn[data-code^="G"].i-term-selected {
    background: linear-gradient(135deg, rgba(255, 50, 80, 0.2), rgba(30, 34, 53, 0.9)) !important;
    border-color: #ff3250 !important;
    box-shadow: 0 0 15px rgba(255, 50, 80, 0.4) !important;
    transform: translateY(-2px);
}

/* Orange for P actions */
.i-term-btn[data-code^="P"] {
    border-color: rgba(255, 153, 0, 0.3) !important;
}
.i-term-btn[data-code^="P"] strong {
    color: #ff9900 !important;
}
.i-term-btn[data-code^="P"]:hover, .i-term-btn[data-code^="P"].i-term-selected {
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.2), rgba(30, 34, 53, 0.9)) !important;
    border-color: #ff9900 !important;
    box-shadow: 0 0 15px rgba(255, 153, 0, 0.4) !important;
    transform: translateY(-2px);
}

/* Tabla Registros */
.i-table-container {
    flex: 1;                 /* Absorbe el espacio restante */
    min-height: 0;           /* Permite que flex reduzca la altura correctamente */
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}
.i-table-scroll {
    flex: 1;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 15px;
}
.i-table-row {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
}
.i-table-row:hover {
    background: rgba(255,255,255,0.02);
}
.i-td-num { padding: 10px; color: var(--muted); font-size: 0.85rem; }
.i-td-desc { padding: 10px; color: #fff; font-size: 0.95rem; }
.i-td-code { padding: 10px; }
.i-code-badge {
    background: rgba(163, 255, 0, 0.1);
    color: #a3ff00;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 0.9rem;
}
.i-td-mods { padding: 10px; color: #fff; font-size: 0.95rem; text-align: right; }
.i-td-del { padding: 10px; text-align: center; }
.i-del-btn {
    background: transparent;
    border: none;
    color: #ff0055;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.2s;
}
.i-del-btn:hover {
    background: rgba(255,0,85,0.1);
    opacity: 1;
}

.i-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #0A0B10;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--inset-hi), 0 4px 16px rgba(0,0,0,0.8);
    flex-shrink: 0;
    margin-top: 16px;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}


/* ══════════════════════════════════════
   PREMIUM CINEMATIC MESH GRADIENT BACKGROUND
   ══════════════════════════════════════ */
.mesh-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -2;
    overflow: hidden;
    background-color: #020205; /* Fondo ultra oscuro base */
}

/* Canvas para WebGL Shader */
#glcanvas {
    width: 100vw;
    height: 100vh;
    display: block;
}

/* Capa sutil de ruido (grain) para efecto premium tipo frosted glass sobre el fluido */
.mesh-noise {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    opacity: 0.03; /* Apenas perceptible (3%) */
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

.mesh-blob {
    position: absolute;
    filter: blur(90px); /* Desenfoque altísimo para fundido perfecto */
    border-radius: 50%;
    mix-blend-mode: screen; /* Fusión aditiva: los colores suman luz al cruzarse */
    will-change: transform; /* Rendimiento ultra-suave a 60fps por GPU */
    opacity: 0.7;
}

/* AZUL VIVO: color(display-p3 0 0.5 1) o un azul eléctrico muy puro */
.blob-blue {
    width: 60vw; height: 60vw;
    background: color(display-p3 0.05 0.65 1.0); /* Fallback si no soporta P3: #0e96ff */
    top: -20%; right: -10%;
    animation: blobOrbitBlue 14s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

/* AQUA RADIANTE: color(display-p3 0 1 0.8) */
.blob-aqua {
    width: 55vw; height: 55vw;
    background: color(display-p3 0.0 1.0 0.7); /* Fallback: #00ffb3 */
    top: -10%; left: -20%;
    animation: blobOrbitAqua 16s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

/* MAGENTA/VIOLETA ELÉCTRICO: color(display-p3 0.8 0 1) */
.blob-magenta {
    width: 65vw; height: 65vw;
    background: color(display-p3 0.75 0.0 1.0); /* Fallback: #bf00ff */
    bottom: -30%; left: 10%;
    animation: blobOrbitMagenta 18s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fallbacks clásicos por si el navegador (ej. Chrome viejo) no soporta color(display-p3) */
@supports not (color: color(display-p3 1 1 1)) {
    .blob-blue { background: #0088ff; }
    .blob-aqua { background: #00f0a8; }
    .blob-magenta { background: #aa00ff; }
}

/* Movimiento Orgánico Compuesto: Traslación, Rotación y Escala */
@keyframes blobOrbitBlue {
    0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
    50%  { transform: translate(-15vw, 20vh) scale(1.15) rotate(45deg); }
    100% { transform: translate(-30vw, 5vh) scale(0.9) rotate(90deg); }
}

@keyframes blobOrbitAqua {
    0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
    50%  { transform: translate(25vw, 15vh) scale(1.2) rotate(-30deg); }
    100% { transform: translate(15vw, 35vh) scale(0.85) rotate(-60deg); }
}

@keyframes blobOrbitMagenta {
    0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
    50%  { transform: translate(20vw, -25vh) scale(0.9) rotate(25deg); }
    100% { transform: translate(5vw, -45vh) scale(1.2) rotate(50deg); }
}


.i-aux-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    padding: 6px 8px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.i-aux-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.i-aux-btn.i-aux-selected {
    background: rgba(168, 85, 247, 0.2);
    border-color: #a855f7;
    color: #fff;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}
.i-aux-btn strong { font-size: 0.9rem; color: #a855f7; font-weight: 800; }
.i-aux-btn.i-aux-selected strong { color: #fff; }
.i-aux-btn span { font-size: 0.65rem; color: var(--muted); text-align: center; line-height: 1.2; }
.i-aux-btn.i-aux-selected span { color: rgba(255,255,255,0.8); }

/* Grid de auxiliares: 8 columnas para que entren en 2 filas simétricas (16 botones) */
.i-aux-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

/* Responsive: en pantallas angostas (<1400px) reducir a 6 columnas */
@media (max-width: 1400px) {
    .i-aux-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 1100px) {
    .i-aux-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
}

/* Custom styling for Select dropdown — themed to app style */
#ergoMethodSelector {
    appearance: none;
    -webkit-appearance: none;
    background-color: #0d0820;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300ff88%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right .7em top 50%;
    background-size: .65em auto;
    padding-right: 2.5em !important;
    border: 1px solid rgba(0, 255, 136, 0.35);
    color: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#ergoMethodSelector:focus {
    outline: none;
    border-color: rgba(0, 255, 136, 0.7);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.15);
}

/* Opciones del desplegable — fondo oscuro, selección con tinte cyan */
#ergoMethodSelector option {
    background-color: #0d0820;
    color: #e2e8f0;
    padding: 10px 14px;
    font-weight: 500;
}
#ergoMethodSelector option:checked,
#ergoMethodSelector option:hover {
    background-color: #0d0820;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.25), rgba(0, 240, 255, 0.15)) #0d0820;
    color: #00ff88;
}

/* ═══════════════════════════════
   CUSTOM DROPDOWN — Ergo Method
   ═══════════════════════════════ */
.custom-dropdown {
    position: relative;
    min-width: 270px;
    user-select: none;
    z-index: 100;
}
.custom-dropdown-selected {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(0, 255, 136, 0.4);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: .9rem; font-weight: 700; letter-spacing: .04em;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.custom-dropdown-selected:hover,
.custom-dropdown.open .custom-dropdown-selected {
    border-color: rgba(0, 255, 136, 0.75);
    box-shadow: 0 0 14px rgba(0, 255, 136, 0.2);
}
.custom-dropdown-selected svg {
    transition: transform 0.25s;
    color: #00ff88;
}
.custom-dropdown.open .custom-dropdown-selected svg {
    transform: rotate(180deg);
}
.custom-dropdown-list {
    display: none;
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: rgba(10, 5, 24, 0.97);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 255, 136, 0.1);
    backdrop-filter: blur(12px);
}
.custom-dropdown.open .custom-dropdown-list {
    display: block;
    animation: dropdownIn 0.18s ease;
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.custom-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    color: #c4c4d0;
    font-family: var(--font-mono);
    font-size: .88rem; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.custom-dropdown-item span {
    color: var(--muted);
    font-size: .78rem; font-weight: 400;
}
.custom-dropdown-item:hover {
    background: rgba(0, 255, 136, 0.07);
    color: #ffffff;
    border-left-color: rgba(0, 255, 136, 0.5);
}
.custom-dropdown-item.active {
    background: rgba(0, 255, 136, 0.12);
    color: #00ff88;
    border-left-color: #00ff88;
}
.custom-dropdown-item.active span {
    color: rgba(0, 255, 136, 0.7);
}



/* ═══════════════════════════════
   NOM-036 FORM STYLES
   ═══════════════════════════════ */
.nom036-label {
    display: block;
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}
.nom036-input {
    background: rgba(8, 4, 24, 0.8);
    border: 2px solid rgba(255, 107, 53, 0.3);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}
.nom036-input:focus {
    border-color: transparent;
    background: linear-gradient(rgba(12, 6, 32, 0.95), rgba(12, 6, 32, 0.95)) padding-box, 
                linear-gradient(135deg, #ff6b35, #ff3333) border-box;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.35);
}
.nom036-input::placeholder {
    color: var(--muted);
    opacity: 0.5;
}
.nom036-btn-calc {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff3333 100%);
    border: none;
    color: #ffffff;
    border-radius: 24px; padding: 11px 26px;
    font-family: var(--font-mono); font-size: .82rem;
    font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    cursor: pointer; transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    position: relative; overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.nom036-btn-calc:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.nom036-input option {
    background-color: #0f0a26;
    color: #ffffff;
    font-family: var(--font-mono);
}


/* ── Xerberoz® Suite Modular Layout ── */
.xerberoz-suite-row {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 18px 20px;
    background: #000000;
    border: 1px solid rgba(0, 229, 255, 0.45);
    border-radius: 12px;
    margin-bottom: 24px;
}
.xerberoz-suite-row:last-child {
    margin-bottom: 0;
}
.xerberoz-logo-col {
    flex: 0 0 350px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}
.xerberoz-logo-col img {
    max-width: 100%;
    height: auto;
}
.xerberoz-cards-col {
    flex: 1;
    min-width: 0;
}
.logo-glow-mods { filter: drop-shadow(0 0 14px rgba(0, 210, 255, 0.35)); }
.logo-glow-ergo { filter: drop-shadow(0 0 14px rgba(57, 255, 20, 0.35)); }
.logo-glow-efi  { filter: drop-shadow(0 0 14px rgba(255, 107, 53, 0.35)); }
.xerberoz-suite-row.suite-mods { border-color: rgba(0, 229, 255, 0.55); }
.xerberoz-suite-row.suite-ergo { border-color: rgba(57, 255, 20, 0.55); }
.xerberoz-suite-row.suite-efi  { border-color: rgba(255, 107, 53, 0.55); }

@media (max-width: 1100px) {
    .xerberoz-suite-row {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .xerberoz-logo-col {
        flex: 0 0 auto;
        justify-content: center;
        margin-bottom: 8px;
    }
}

/* ── Dashboard Header Row ── */
.dashboard-header-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}
/* Cabecera main menu: altura mínima (solo padding; tipografía intacta) */
#title-box {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}
#title-box .dashboard-header-row {
    margin-bottom: 0;
    align-items: center;
}
@media (max-width: 768px) {
    .dashboard-header-row {
        display: flex;
        flex-direction: column;
        text-align: center;
    }
}

/* Botón Ghost Purple */
.btn-ghost-purple {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(192, 132, 252, 0.05);
    border: 1px solid rgba(192, 132, 252, 0.4);
    color: #ffffff;
    border-radius: 24px; padding: 10px 24px;
    font-family: var(--font-mono); font-size: .82rem;
    font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    cursor: pointer; transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    min-width: 170px;
}
.btn-ghost-purple::after {
    content: ''; position: absolute;
    top: 0; left: -80%;
    width: 55%; height: 100%;
    background: linear-gradient(110deg, transparent 20%, rgba(192, 132, 252, 0.3) 40%, rgba(255, 255, 255, 0.8) 50%, rgba(192, 132, 252, 0.3) 60%, transparent 80%);
    transform: skewX(-15deg); pointer-events: none; opacity: 0;
}
.btn-ghost-purple:hover {
    transform: translateY(-3px) scale(1.03);
    border-color: #c084fc;
    box-shadow: 0 8px 24px rgba(192, 132, 252, 0.3), 0 0 15px rgba(192, 132, 252, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.btn-ghost-purple:hover::after {
    animation: btnGhostSweep 0.33s ease-out forwards;
    opacity: 1;
}

/* ═══════════════════════════════
   FULL-SCREEN PROGRESS OVERLAY
   ═══════════════════════════════ */
.full-screen-progress-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(5, 5, 10, 0.7);
    backdrop-filter: blur(15px);
    z-index: 999999;
    display: none;
    align-items: center; justify-content: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
}
.full-screen-progress-card {
    background: rgba(10, 5, 24, 0.6);
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 0 15px rgba(168, 85, 247, 0.1);
    border-radius: 16px;
    padding: 40px 50px;
    width: 90%; max-width: 500px;
    text-align: center;
}
.full-screen-progress-card .progress-bar-track {
    margin-top: 30px;
    height: 10px; background: rgba(0,245,255,.08);
    border-radius: 999px; overflow: hidden;
}
.full-screen-progress-card .progress-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    transition: width .15s;
    box-shadow: 0 0 10px var(--cyan);
    border-radius: 999px;
}
.full-screen-progress-card .progress-label {
    margin-top: 15px; font-size: 1rem; font-weight: bold; color: #ffffff;
    font-family: var(--font-mono); letter-spacing: .04em;
}
/* ==========================================================================
   FASE 6: GRÁFICAS Xerberoz (MOTOR CUSTOM)
   ========================================================================== */

/* Estructuras Flexbox para Gráficas Verticales */
.chart-vertical-container {
    display: flex;
    flex-direction: row;
    height: 100%;
    width: 100%;
    position: relative;
    padding-bottom: 30px;
    padding-left: 35px;
}

.chart-y-axis {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 30px;
    width: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    padding-right: 5px;
}

.chart-y-label {
    color: #8b9bb4;
    font-size: 11px;
    font-family: var(--font-mono);
    line-height: 1;
    transform: translateY(50%);
}

.chart-y-title {
    position: absolute;
    left: -42px;
    top: 75%;
    transform: translateY(-50%) rotate(-90deg);
    color: #8b9bb4;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
}

.chart-bars-area {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    padding-left: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    flex: 1 1 0;
    margin: 0 3px;
    min-width: 0;
    max-width: 42%;
}

.chart-bar-vertical {
    width: 100%;
    border-radius: 2px 2px 0 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5px;
    box-shadow: inset -5px -5px 15px rgba(0, 0, 0, 0.4), inset 5px 5px 15px rgba(255, 255, 255, 0.1);
    transition: height 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chart-bar-value {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-mono);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.chart-x-legend {
    position: absolute;
    bottom: 0;
    left: 45px;
    right: 0;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.legend-color {
    width: 8px;
    height: 8px;
    border-radius: 1px;
}

.chart-x-labels-direct {
    position: absolute;
    bottom: 0;
    left: 45px;
    right: 0;
    height: 30px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.chart-x-legend span {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}

.chart-x-label {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Gráfica Ergonomía (Horizontal) — filas label+barra alineadas */
.chart-horizontal-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    padding-bottom: 28px;
    padding-left: 0;
    box-sizing: border-box;
    min-height: 0;
}

/* Legacy (eje + barras separados) — se mantiene por compat */
.chart-h-axis-y {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 28px;
    width: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: flex-end;
    padding-right: 10px;
    border-right: 1.5px solid #ffffff;
}

.chart-h-label {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.chart-h-legend span {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.chart-h-bars-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: flex-start;
    padding-left: 0px;
    margin-left: 85px;
}

/* Nuevo: una fila por estándar (label + track + barra) */
.chart-h-rows {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75em; /* gap ≈ alto tipografía de labels */
    min-height: 0;
    width: 100%;
}

.chart-h-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    flex: 1 1 0;
    min-height: 22px;
}

.chart-h-row .chart-h-label {
    flex: 0 0 78px;
    text-align: right;
    line-height: 1.2;
}

.chart-h-bar-track {
    flex: 1 1 auto;
    min-width: 0;
    height: 28px;
    display: flex;
    align-items: center;
    border-left: 1.5px solid #ffffff;
    padding-left: 0;
}

.chart-h-bar-track .chart-bar-horizontal {
    height: 28px;
}

.chart-bar-horizontal {
    height: 28px;
    flex: 0 0 auto;
    border-radius: 0 2px 2px 0;
    box-shadow: inset -5px -5px 15px rgba(0, 0, 0, 0.4), inset 5px 5px 15px rgba(255, 255, 255, 0.1);
    transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chart-h-legend {
    position: absolute;
    bottom: 0;
    left: 90px;
    right: 0;
    height: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.h-legend-item {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Degradados Base Xerberoz */
.bg-grad-blue { background: linear-gradient(to top, #000000, #0088ff); }
.bg-grad-purple { background: linear-gradient(to top, #000000, #8800ff); }
.bg-grad-green { background: linear-gradient(to top, #000000, #00ff00); }
.bg-grad-red { background: linear-gradient(to top, #000000, #ff0000); }
.bg-grad-yellow { background: linear-gradient(to top, #000000, #ffff00); }
.bg-grad-magenta { background: linear-gradient(to top, #000000, #990099); }
.bg-grad-darkpurple { background: linear-gradient(to top, #000000, #5500aa); }

/* =========================================================
   ESTILOS NEÓN MINIMALISTAS PARA TARJETAS DE MÓDULOS Xerberoz
   ========================================================= */
.neon-card-cyan:hover {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.35), inset 0 0 10px rgba(56, 189, 248, 0.1) !important;
    transform: translateY(-2px);
}
.bg-grad-darkblue { background: linear-gradient(to top, #000000, #0044aa); }

/* Overrides para resplandor neon y esquinas redondeadas de mode-video-btn */
#mode-video-btn {
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(15, 23, 42, 1.0) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
}
#mode-video-btn:hover {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.6), inset 0 0 10px rgba(56, 189, 248, 0.2) !important;
    transform: translateY(-3px) !important;
}
#mode-video-btn.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(30, 27, 75, 0.85)), #0f172a !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.8), inset 0 0 12px rgba(56, 189, 248, 0.3) !important;
}

/* Overrides para resplandor neon y esquinas redondeadas de mode-doc-btn (Morado) */
#mode-doc-btn {
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(15, 23, 42, 1.0) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
}
#mode-doc-btn:hover {
    border-color: #a855f7 !important;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.6), inset 0 0 10px rgba(168, 85, 247, 0.2) !important;
    transform: translateY(-3px) !important;
}
#mode-doc-btn.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(30, 27, 75, 0.85)), #0f172a !important;
    border-color: #a855f7 !important;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.8), inset 0 0 12px rgba(168, 85, 247, 0.3) !important;
}

/* Overrides para resplandor neon y esquinas redondeadas de mode-interactive-btn (Rosa) */
#mode-interactive-btn {
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(15, 23, 42, 1.0) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
}
#mode-interactive-btn:hover {
    border-color: #ec4899 !important;
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.6), inset 0 0 10px rgba(236, 72, 153, 0.2) !important;
    transform: translateY(-3px) !important;
}
#mode-interactive-btn.active {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(30, 27, 75, 0.85)), #0f172a !important;
    border-color: #ec4899 !important;
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.8), inset 0 0 12px rgba(236, 72, 153, 0.3) !important;
}

/* Overrides para resplandor neon y esquinas redondeadas de mode-ergonomics-btn (Amarillo) */
#mode-ergonomics-btn {
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(15, 23, 42, 1.0) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
}
#mode-ergonomics-btn:hover {
    border-color: #eab308 !important;
    box-shadow: 0 0 25px rgba(234, 179, 8, 0.6), inset 0 0 10px rgba(234, 179, 8, 0.2) !important;
    transform: translateY(-3px) !important;
}
#mode-ergonomics-btn.active {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(30, 27, 75, 0.85)), #0f172a !important;
    border-color: #eab308 !important;
    box-shadow: 0 0 30px rgba(234, 179, 8, 0.8), inset 0 0 12px rgba(234, 179, 8, 0.3) !important;
}

/* Overrides para resplandor neon y esquinas redondeadas de mode-nom036-btn (Verde / STPS) */
#mode-nom036-btn {
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(15, 23, 42, 1.0) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
}
#mode-nom036-btn:hover {
    border-color: #22c55e !important;
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.6), inset 0 0 10px rgba(34, 197, 94, 0.2) !important;
    transform: translateY(-3px) !important;
}
#mode-nom036-btn.active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(30, 27, 75, 0.85)), #0f172a !important;
    border-color: #22c55e !important;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.8), inset 0 0 12px rgba(34, 197, 94, 0.3) !important;
}

/* Overrides para resplandor neon y esquinas redondeadas de mode-efi-estacion-btn (Fase 6: Naranja) */
#mode-efi-estacion-btn {
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(15, 23, 42, 1.0) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
}
#mode-efi-estacion-btn:hover {
    border-color: #f97316 !important;
    box-shadow: 0 0 25px rgba(249, 115, 22, 0.6), inset 0 0 10px rgba(249, 115, 22, 0.2) !important;
    transform: translateY(-3px) !important;
}
#mode-efi-estacion-btn.active {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(30, 27, 75, 0.85)), #0f172a !important;
    border-color: #f97316 !important;
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.8), inset 0 0 12px rgba(249, 115, 22, 0.3) !important;
}

/* Overrides para resplandor neon y esquinas redondeadas de mode-efi-linea-btn (Fase 7: Rojo) */
#mode-efi-linea-btn {
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(15, 23, 42, 1.0) !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
}
#mode-efi-linea-btn:hover {
    border-color: #ff0033 !important;
    box-shadow: 0 0 25px rgba(255, 0, 51, 0.6), inset 0 0 10px rgba(255, 0, 51, 0.2) !important;
    transform: translateY(-3px) !important;
}
#mode-efi-linea-btn.active {
    background: linear-gradient(135deg, rgba(255, 0, 51, 0.25), rgba(30, 27, 75, 0.85)), #0f172a !important;
    border-color: #ff0033 !important;
    box-shadow: 0 0 30px rgba(255, 0, 51, 0.8), inset 0 0 12px rgba(255, 0, 51, 0.3) !important;
}

/* Contenedor transparente de Suites Xerberoz® (Menú Principal) */
#suitesContainer {
    background: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
    padding-top: 24px !important;
    margin-bottom: 22px !important;
}

/* Empalme perfecto del contorno SVG con el borde neón del botón */
.mode-card img {
    transform: scale(1.01) !important;
    transform-origin: center !important;
}

/*
 * Placas un poco más anchas + más gap entre botones.
 * Medidas de mode-card = originales (height 105, padding 2px 8px, flex 1 1 0).
 * No congelar ni max-width: el SVG debe llenar el botón como antes.
 */
.xerberoz-suite-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
    margin-bottom: 24px !important;
    padding: 18px 24px !important;
    background: #000000 !important;
    border: 1px solid rgba(0, 229, 255, 0.45) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    border-bottom-style: solid !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.xerberoz-suite-row:last-child {
    margin-bottom: 0 !important;
}
.xerberoz-logo-col {
    flex: 0 0 280px !important;
    max-width: 280px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.xerberoz-logo-col img {
    max-width: 100% !important;
    max-height: 95px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}
.xerberoz-cards-col {
    flex: 1 !important;
    min-width: 0 !important;
}
.xerberoz-suite-row .xerberoz-cards-col.operation-mode-selector {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 18px !important;
    padding: 0 10px !important;
}
/* Perímetro por módulo (solo border-color; no tocar logos ni cards) */
.xerberoz-suite-row.suite-mods {
    border-color: rgba(0, 229, 255, 0.55) !important; /* MODS azul */
}
.xerberoz-suite-row.suite-ergo {
    border-color: rgba(57, 255, 20, 0.55) !important; /* ERGO verde */
}
.xerberoz-suite-row.suite-efi {
    border-color: rgba(255, 107, 53, 0.55) !important; /* EFI naranja */
}
/* Restaurar medidas originales del botón (sin max-width / flex 0) */
#suitesContainer .mode-card {
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 105px !important;
    padding: 2px 8px !important;
    box-sizing: border-box !important;
}

/* ═══════════════════════════════════════════════════════════════════
   XRZ LAYOUT WORLDS
   Sync numérico con js/layout-detect.js (PC_MIN=1280 / TABLET_MIN=768).

   Mundos:
     pc                → width >= 1280px          → layout actual (sin overrides)
     tablet-landscape  → 768–1279px y landscape   → Fase 2: ajustes CSS
     portrait          → angosto o vertical       → Fase 3: aviso “gira la tablet”
   ═══════════════════════════════════════════════════════════════════ */
:root {
    --xrz-bp-pc: 1280px;
    --xrz-bp-tablet-min: 768px;
}

/* PC: intencionalmente vacío — no alterar el diseño de escritorio */
html[data-xrz-layout="pc"] {
    /* sin overrides */
}

/* ─── Fase 2: Tablet landscape ─── */
html[data-xrz-layout="tablet-landscape"] .sticky-top-container {
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
}

html[data-xrz-layout="tablet-landscape"] .header-visual-box {
    max-width: 100%;
}

html[data-xrz-layout="tablet-landscape"] .tabs-bar {
    /* Preferir una fila + scale JS; wrap solo como último recurso visual */
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: var(--xrz-tabs-gap, 6px) !important;
    padding: 10px 12px !important;
}

html[data-xrz-layout="tablet-landscape"] .tabs-bar-logo-slot {
    flex: 0 0 auto !important;
    order: 0 !important;
    min-width: var(--xrz-logo-slot-min, 132px) !important;
    margin-left: var(--xrz-logo-side-gap, 10px) !important;
    margin-right: var(--xrz-logo-side-gap, 10px) !important;
    padding: 2px 6px !important;
}

html[data-xrz-layout="tablet-landscape"] .xerberoz-logo-center {
    max-height: var(--xrz-logo-max-h, 34px) !important;
}

html[data-xrz-layout="tablet-landscape"] .tab {
    padding: var(--xrz-tab-pad-y, 8px) var(--xrz-tab-pad-x, 12px) !important;
    font-size: var(--xrz-tab-font, 0.74rem) !important;
    gap: 5px !important;
    border-radius: 10px !important;
}

html[data-xrz-layout="tablet-landscape"] .tab .tab-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

html[data-xrz-layout="tablet-landscape"] .tabs-bar-divider,
html[data-xrz-layout="tablet-landscape"] .tabs-bar > div[style*="width: 1px"] {
    display: none !important;
}

/* Menú suites: logo arriba, cards en fila usable */
html[data-xrz-layout="tablet-landscape"] #suitesContainer {
    padding-left: 12px !important;
    padding-right: 12px !important;
}

html[data-xrz-layout="tablet-landscape"] .xerberoz-suite-row {
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 14px 14px !important;
    margin-bottom: 14px !important;
}

html[data-xrz-layout="tablet-landscape"] .xerberoz-logo-col {
    flex: 0 0 auto !important;
    max-width: 100% !important;
    width: 100% !important;
    justify-content: center !important;
}

html[data-xrz-layout="tablet-landscape"] .xerberoz-logo-col img {
    max-height: 72px !important;
}

html[data-xrz-layout="tablet-landscape"] .xerberoz-suite-row .xerberoz-cards-col.operation-mode-selector {
    width: 100% !important;
    gap: 12px !important;
    padding: 0 !important;
    justify-content: stretch !important;
}

html[data-xrz-layout="tablet-landscape"] #suitesContainer .mode-card {
    flex: 1 1 0 !important;
    height: 92px !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 2px 6px !important;
}

html[data-xrz-layout="tablet-landscape"] #title-box {
    padding: 8px 18px !important;
}

html[data-xrz-layout="tablet-landscape"] .dashboard-header-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    text-align: left !important;
}

html[data-xrz-layout="tablet-landscape"] .main-content {
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box;
}

html[data-xrz-layout="tablet-landscape"] .card {
    padding-left: 16px;
    padding-right: 16px;
}

/* Splash / welcome */
html[data-xrz-layout="tablet-landscape"] .splash-card {
    width: 94% !important;
    max-width: 920px !important;
    padding: 28px 24px !important;
}

html[data-xrz-layout="tablet-landscape"] .splash-logo-container img,
html[data-xrz-layout="tablet-landscape"] .splash-hand-base {
    max-width: 100%;
}

/* Modales genéricos */
html[data-xrz-layout="tablet-landscape"] .full-screen-progress-card {
    padding: 28px 24px !important;
    max-width: 460px !important;
}

html[data-xrz-layout="tablet-landscape"] .xrz-picker-modal,
html[data-xrz-layout="tablet-landscape"] .xrz-admin-modal,
html[data-xrz-layout="tablet-landscape"] #helpModal > div,
html[data-xrz-layout="tablet-landscape"] .modal-content {
    max-width: min(960px, 96vw) !important;
}

/* Pantallas densas: apilar columnas si aún hay 2 cols por encima de 960 */
html[data-xrz-layout="tablet-landscape"] .two-col {
    grid-template-columns: 1fr !important;
}

html[data-xrz-layout="tablet-landscape"] .two-col > .card,
html[data-xrz-layout="tablet-landscape"] .two-col-right-wrapper,
html[data-xrz-layout="tablet-landscape"] .two-col-right-wrapper > .card {
    height: auto !important;
    min-height: 0 !important;
}

html[data-xrz-layout="tablet-landscape"] .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

html[data-xrz-layout="tablet-landscape"] .i-aux-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)) !important;
}

html[data-xrz-layout="tablet-landscape"] .canvas-wrap {
    max-width: 100%;
    overflow: auto;
}

/* ─── Fase 4b: escala proporcional vía meta viewport (js) ───
 * html.xrz-viewport-fit → layout CSS como PC (data-xrz-layout=pc),
 * el navegador escala todo. Sin zoom/transform (rompían login en iOS).
 */
html.xrz-viewport-fit,
html.xrz-viewport-fit body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* Bienvenida: caja ~50% del tamaño “escritorio” visual en tablet */
html.xrz-viewport-fit .splash-overlay {
    gap: 14px !important;
    padding: 12px !important;
    box-sizing: border-box;
    overflow: auto !important;
}

html.xrz-viewport-fit .splash-card {
    width: 50% !important;
    max-width: 540px !important;
    min-width: 280px !important;
    padding: 14px 18px !important;
    gap: 10px !important;
    border-radius: 14px !important;
}

html.xrz-viewport-fit .splash-card h2,
html.xrz-viewport-fit .splash-welcome {
    font-size: 1.05rem !important;
    margin: 0 0 6px !important;
}

html.xrz-viewport-fit .splash-card p,
html.xrz-viewport-fit .splash-desc,
html.xrz-viewport-fit .splash-body {
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
}

html.xrz-viewport-fit .splash-logo-container {
    margin-bottom: 8px !important;
    max-width: 70% !important;
}

html.xrz-viewport-fit .splash-actions {
    gap: 10px !important;
    margin-top: 4px !important;
}

html.xrz-viewport-fit .splash-actions .btn,
html.xrz-viewport-fit .splash-actions button {
    padding: 8px 16px !important;
    font-size: 0.78rem !important;
}

/* Login: cubrir viewport completo (evitar filtrar menú a la derecha) */
html.xrz-viewport-fit .xrz-login-overlay,
html[data-xrz-layout="tablet-landscape"] .xrz-login-overlay,
html[data-xrz-layout="portrait"] .xrz-login-overlay {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    overflow: hidden !important;
}

/* Legacy Fase 4 zoom/transform: DESACTIVADO (causaba hueco lateral en iOS) */
html.xrz-scaled {
    zoom: normal !important;
}
html.xrz-scaled body {
    transform: none !important;
    width: auto !important;
    min-height: 0 !important;
}

html.xrz-scale-off {
    --xrz-ui-scale: 1 !important;
}

/* Portrait / angosto — Fase 3: aviso de rotación */
html[data-xrz-layout="portrait"] {
    /* atributo usado por .xrz-rotate-hint */
}

.xrz-rotate-hint {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(5, 8, 16, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

html[data-xrz-layout="portrait"] .xrz-rotate-hint {
    display: flex;
}

html.xrz-rotate-dismissed .xrz-rotate-hint {
    display: none !important;
}

.xrz-rotate-hint-card {
    width: min(420px, 100%);
    padding: 28px 24px 24px;
    text-align: center;
    background: #08080c;
    border: 1px solid rgba(0, 229, 255, 0.45);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), 0 0 28px rgba(0, 229, 255, 0.12);
    color: #e2e8f0;
}

.xrz-rotate-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
    animation: xrz-rotate-wiggle 2.4s ease-in-out infinite;
}

@keyframes xrz-rotate-wiggle {
    0%, 100% { transform: rotate(0deg); }
    35% { transform: rotate(-18deg); }
    70% { transform: rotate(90deg); }
}

.xrz-rotate-hint-card h2 {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #00e5ff;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.45);
}

.xrz-rotate-hint-card p {
    margin: 0 0 20px;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #94a3b8;
}

.xrz-rotate-hint-card p strong {
    color: #e2e8f0;
    font-weight: 700;
}

.xrz-rotate-dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(57, 255, 20, 0.45);
    background: rgba(57, 255, 20, 0.08);
    color: #39ff14;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.xrz-rotate-dismiss:hover,
.xrz-rotate-dismiss:focus-visible {
    background: rgba(57, 255, 20, 0.16);
    box-shadow: 0 0 18px rgba(57, 255, 20, 0.25);
    outline: none;
}

.xrz-rotate-dismiss:active {
    transform: scale(0.98);
}

/* Fallback portrait sin JS de atributos: orientation CSS */
@media (orientation: portrait) and (max-width: 1279px) {
    /* el overlay solo aparece si existe el nodo inyectado + data-xrz-layout;
       este bloque queda como referencia de rango Fase 3 */
}

/* Fallbacks solo-CSS (sin JS): mismos ajustes tablet landscape */
/* T. Labor Cronómetro — hint AUTO (value nunca es literal "AUTO") */
.xrz-labor-hint {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #a8a29e;
    border: 1px solid rgba(168, 162, 158, 0.35);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    vertical-align: middle;
    white-space: nowrap;
}
.xrz-labor-hint[hidden] { display: none !important; }
.xrz-labor-field-auto {
    border-color: rgba(168, 162, 158, 0.4) !important;
}

@media (min-width: 768px) and (max-width: 1279px) and (orientation: landscape) {
    .sticky-top-container { padding-left: 8px; padding-right: 8px; box-sizing: border-box; }
    .tabs-bar {
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: var(--xrz-tabs-gap, 6px) !important;
        padding: 10px 12px !important;
    }
    .tabs-bar-logo-slot {
        flex: 0 0 auto !important;
        order: 0 !important;
        min-width: var(--xrz-logo-slot-min, 132px) !important;
    }
    .xerberoz-logo-center { max-height: var(--xrz-logo-max-h, 34px) !important; }
    .tab {
        padding: var(--xrz-tab-pad-y, 8px) var(--xrz-tab-pad-x, 12px) !important;
        font-size: var(--xrz-tab-font, 0.74rem) !important;
    }
    .tabs-bar-divider,
    .tabs-bar > div[style*="width: 1px"] { display: none !important; }
    .xerberoz-suite-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 14px !important;
    }
    .xerberoz-logo-col {
        flex: 0 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
        justify-content: center !important;
    }
    .xerberoz-logo-col img { max-height: 72px !important; }
    #suitesContainer .mode-card { height: 92px !important; }
    .two-col { grid-template-columns: 1fr !important; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   EFI DASHBOARD (Estación + Línea)
   Posición/tamaño: js/efi-viewport.js (fixed entre sticky y ©).
   Aquí solo la distribución interna: gráficas crecen, resto no.
   ═══════════════════════════════════════════════════════════════════ */
body > .sticky-top-container {
    flex: 0 0 auto;
    position: relative;
    z-index: 20;
}

#efiDashboard.efi-dashboard,
#efiDashboard {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

#efiDashboard .efi-dash-header,
#efiDashboard .efi-dash-kpis,
#efiDashboard .efi-dash-footer {
    flex: 0 0 auto !important;
    min-width: 0;
}

#efiDashboard .efi-dash-kpis {
    gap: 12px !important;
}

#efiDashboard .efi-dash-kpis > * {
    min-width: 0;
}

#efiDashboard .efi-dash-charts {
    flex: 1 1 0 !important;
    height: 0 !important;
    min-height: 180px !important;
    display: flex !important;
    align-items: stretch !important;
    gap: 15px !important;
    overflow: hidden !important;
}

#efiDashboard .efi-chart-panel,
#efiDashboard .efi-chart-group {
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    align-self: stretch !important;
    overflow: hidden;
}

#efiDashboard .efi-chart-group {
    display: flex !important;
    flex-direction: row !important;
}

#efiDashboard .efi-chart-panel {
    display: flex !important;
    flex-direction: column !important;
}

#efiDashboard .efi-chart-panel > h3 {
    flex: 0 0 auto;
}

#efiDashboard #graficaCargaCont,
#efiDashboard #graficaErgoCont,
#efiDashboard #graficaVaVnaVnanCont,
#efiDashboard #grafica3mCont {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 0 !important;
    overflow: hidden;
}

#efiDashboard .chart-vertical-container,
#efiDashboard .chart-horizontal-container {
    height: 100% !important;
    min-height: 0 !important;
}

#efiDashboard .chart-h-rows {
    flex: 1 1 0;
    min-height: 0;
    justify-content: center;
    gap: 0.03em; /* 1/4 de 0.12em */
}

#efiDashboard .chart-h-row {
    flex: 1 1 0;
    min-height: 22px;
    max-height: none;
}

#efiDashboard .chart-h-bar-track {
    height: 82%;
    max-height: none;
}

#efiDashboard .chart-h-bar-track .chart-bar-horizontal,
#efiDashboard .chart-bar-horizontal {
    height: 100%;
    max-height: none;
    min-height: 14px;
}

/* Barras verticales: menos hueco horizontal → barras más anchas */
#efiDashboard .chart-bars-area {
    justify-content: center !important;
    gap: 8px !important;
}

#efiDashboard .chart-bar-wrapper {
    margin: 0 3px !important;
    flex: 1 1 0 !important;
    max-width: 38% !important;
    width: auto !important;
}

#efiDashboard .efi-dash-footer {
    margin-top: 0;
}

/* © solo en pantallas previas (carga / inicio de módulo), no en gráficas */
body.efi-dashboard-active #efiPageCopyright {
    display: none !important;
}


