/**
 * MENÚ RADIAL SET 10 — APP SKELETON OS
 *
 * Cuadrante ergonómico de 90° para aplicaciones standalone y móviles.
 * 19 aplicaciones en 5 órbitas concéntricas (Penta-Órbita).
 * FAB Central con Deadzone Guard como botón de retorno inteligente.
 * 6 Presets visuales hero configurables por el usuario.
 */

:root {
    --radial-primary: var(--color-primary);
    --radial-primary-rgb: var(--color-primary-rgb, 139, 92, 246);
    --radial-surface: var(--color-surface);
    --radial-border: var(--color-border);
    --radial-glow: rgba(var(--color-primary-rgb, 139, 92, 246), 0.35);
    --radial-icon-color: var(--color-text);
    --radial-icon-active: var(--color-sheen);
    --radial-on-accent: var(--color-sheen);
}

/* =========================================================
   FAB BOTÓN TRIGGER CENTRAL (data-flotante="5")
   ========================================================= */
.fab-btn {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 70%, var(--color-text)));
    border: 2px solid color-mix(in srgb, var(--color-sheen) 35%, transparent);
    color: var(--color-sheen);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px var(--radial-glow), 0 4px 12px rgba(var(--color-scrim-rgb), 0.4);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
    position: relative;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    z-index: calc(var(--z-overlay, 900) + 10);
}

.fab-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 10px 28px var(--radial-glow), 0 6px 16px rgba(var(--color-scrim-rgb), 0.5);
}

.fab-btn.pressed {
    transform: scale(0.94);
}

.fab-avatar-text {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.5px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.fab-btn img.fab-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    pointer-events: none;
}

/* FAB Central Back Button Modes (Set 10) */
.fab-btn.is-back-mode {
    background: color-mix(in srgb, var(--color-primary) 85%, var(--color-surface)) !important;
    border-color: var(--color-primary) !important;
    color: var(--color-sheen) !important;
    transition: all 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.fab-btn.is-back-mode .fab-avatar-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: var(--color-sheen) !important;
}

.fab-btn .fab-back-arrow {
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    color: var(--color-sheen) !important;
    text-shadow: 0 1px 3px rgba(var(--color-scrim-rgb), 0.6);
    transition: transform 0.2s ease;
}

.fab-btn .fab-back-txt {
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--color-sheen) !important;
    text-shadow: 0 1px 3px rgba(var(--color-scrim-rgb), 0.6);
    margin-top: 2px;
}

/* Deadzone Guard: Estado bloqueado inicial al abrir submenú */
.fab-btn.is-back-locked {
    opacity: 0.55 !important;
    transform: scale(0.92) !important;
    box-shadow: 0 2px 8px rgba(var(--color-scrim-rgb), 0.4) !important;
    border: 2px dashed color-mix(in srgb, var(--color-sheen) 40%, transparent) !important;
    filter: grayscale(0.5);
    cursor: not-allowed !important;
}

.fab-btn.is-back-locked::after {
    content: '🔒';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 11px;
    background: color-mix(in srgb, var(--color-surface) 90%, black);
    border-radius: var(--radius-full);
    padding: 1px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(var(--color-scrim-rgb), 0.5);
}

/* Armed State: una vez que el pulgar se aleja >= 70px */
.fab-btn.is-back-armed {
    opacity: 1 !important;
    transform: scale(1.14) !important;
    box-shadow: 0 0 32px var(--color-primary), 0 0 12px var(--color-primary), 0 8px 24px rgba(var(--color-scrim-rgb), 0.7) !important;
    border: 2px solid var(--color-primary) !important;
    animation: fabBackArmedPulse 0.9s infinite ease-in-out !important;
    cursor: pointer !important;
}

.fab-btn.is-back-armed .fab-back-arrow {
    animation: bounceInward 0.9s infinite ease-in-out;
}

@keyframes fabBackArmedPulse {
    0%, 100% {
        transform: scale(1.12);
        box-shadow: 0 0 22px var(--color-primary);
    }
    50% {
        transform: scale(1.22);
        box-shadow: 0 0 38px var(--color-primary), 0 0 14px var(--color-primary);
    }
}

@keyframes bounceInward {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(2px); }
}

/* Pull Target State para entrar a submenús */
.fab-btn.is-pull-target {
    background: color-mix(in srgb, var(--color-primary) 85%, var(--color-surface)) !important;
    box-shadow: 0 0 32px var(--color-primary), 0 0 10px var(--color-primary), 0 8px 24px rgba(var(--color-scrim-rgb), 0.7) !important;
    border-color: var(--color-primary) !important;
    animation: fabPullPulse 0.85s infinite ease-in-out !important;
    transform: scale(1.18) !important;
}

.fab-btn .fab-pull-arrow {
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    color: var(--color-sheen) !important;
    animation: bounceInward 0.85s infinite ease-in-out;
}

.fab-btn .fab-pull-txt {
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--color-sheen) !important;
    margin-top: 1px;
}

@keyframes fabPullPulse {
    0%, 100% {
        transform: scale(1.15);
        box-shadow: 0 0 20px var(--color-primary);
    }
    50% {
        transform: scale(1.24);
        box-shadow: 0 0 38px var(--color-primary), 0 0 14px var(--color-primary);
    }
}

/* =========================================================
   OVERLAY BACKDROP (DESENFOQUE DE PANTALLA COMPLETA)
   ========================================================= */
.radial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: color-mix(in srgb, var(--color-bg) 75%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: calc(var(--z-overlay, 900) + 1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    touch-action: none;
}

.radial-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Sincronización con .app-torre: elevar el FAB por encima del overlay cuando esté abierto */
body.radial-menu-open .app-torre {
    z-index: calc(var(--z-overlay, 900) + 15) !important;
}

body.radial-menu-open .app-torre > *:not(#radial-fab) {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.92);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* =========================================================
   STAGE DE 90° (320x320 ANCLADO AL CENTRO DEL FAB)
   ========================================================= */
.corner-arc-stage {
    position: fixed;
    width: 320px;
    height: 320px;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.45, 0.64, 1), opacity 0.2s ease;
    z-index: calc(var(--z-overlay, 900) + 4);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.corner-arc-stage.open {
    opacity: 1;
    pointer-events: auto;
}

.corner-arc-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

/* Rieles de radar concéntricos SVG */
.radar-rail-orbit0,
.radar-rail-inner,
.radar-rail-outer,
.radar-rail-orbit1,
.radar-rail-orbit2,
.radar-rail-orbit3,
.radar-rail-orbit4,
.radar-rail-orbit5 {
    fill: none;
    stroke-width: 1px;
    stroke-dasharray: 2 4;
    transition: all 0.3s ease;
}

.radar-rail-orbit0 {
    stroke: color-mix(in srgb, var(--color-primary) 24%, transparent);
    stroke-dasharray: 2 5;
}
.corner-arc-stage.is-pulling-settings .radar-rail-orbit0 {
    stroke: var(--color-primary);
    stroke-dasharray: none;
    filter: drop-shadow(0 0 4px var(--color-primary));
}

.radar-rail-inner { stroke: color-mix(in srgb, var(--color-primary) 32%, transparent); }
.radar-rail-outer { stroke: color-mix(in srgb, var(--color-primary) 36%, transparent); }
.radar-rail-orbit1 { stroke: color-mix(in srgb, var(--color-primary) 34%, transparent); }
.radar-rail-orbit2 { stroke: color-mix(in srgb, var(--color-primary) 28%, transparent); }
.radar-rail-orbit3 { stroke: color-mix(in srgb, var(--color-primary) 26%, transparent); }
.radar-rail-orbit4 { stroke: color-mix(in srgb, var(--color-primary) 30%, transparent); }
.radar-rail-orbit5 { stroke: color-mix(in srgb, var(--color-primary) 38%, transparent); stroke-dasharray: 3 3; }

/* =========================================================
   NODOS DEL ARCO RADIAL (CASCADA & LOUPE ZOOM)
   ========================================================= */
.corner-item-node {
    position: absolute;
    --stagger-idx: 0;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: var(--z-raised);
    transition: transform 0.35s cubic-bezier(0.34, 1.5, 0.64, 1), opacity 0.25s ease;
    user-select: none;
    -webkit-user-select: none;
}

.corner-arc-stage.open .corner-item-node {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    transition-delay: calc(var(--stagger-idx, 0) * 0.032s);
}

.corner-arc-stage.animation-settled .corner-item-node {
    transition-delay: 0s !important;
}

/* Botón translúcido esmerilado sin bordes toscos */
.corner-item-shape {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--color-surface) 60%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: none;
    color: var(--color-text);
    box-shadow: 0 4px 16px rgba(var(--color-scrim-rgb), 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.22s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.corner-item-shape svg {
    width: 17px;
    height: 17px;
    color: currentColor;
    stroke: currentColor;
    filter: drop-shadow(0 1px 2px rgba(var(--color-scrim-rgb), 0.5));
    pointer-events: none;
    transition: transform 0.2s ease;
}

/* LOUPE ZOOM DRAMÁTICO */
.corner-item-node.loupe-active {
    z-index: var(--z-sticky) !important;
}

.corner-item-node.loupe-active .corner-item-shape {
    transform: scale(1.78) !important;
    background: color-mix(in srgb, var(--color-primary) 38%, var(--color-surface)) !important;
    box-shadow: 0 0 28px var(--color-primary), 0 14px 34px rgba(var(--color-scrim-rgb), 0.7) !important;
    border: none !important;
}

.corner-item-node.loupe-active .corner-item-shape svg,
.corner-item-node:hover .corner-item-shape svg {
    transform: scale(1.15);
    color: var(--color-sheen) !important;
    stroke: var(--color-sheen) !important;
}

.corner-item-node.loupe-active.is-danger .corner-item-shape {
    background: color-mix(in srgb, var(--color-error) 38%, var(--color-surface)) !important;
    box-shadow: 0 0 28px var(--color-error), 0 14px 34px rgba(var(--color-scrim-rgb), 0.7) !important;
}

/* =========================================================
   PENTA-ÓRBITA (19 APPS EN 5 ANILLOS)
   ========================================================= */
.corner-arc-stage.is-penta-orbit .corner-item-node[data-ring="orbit1"] .corner-item-shape {
    width: 28px;
    height: 28px;
}
.corner-arc-stage.is-penta-orbit .corner-item-node[data-ring="orbit2"] .corner-item-shape {
    width: 28px;
    height: 28px;
}
.corner-arc-stage.is-penta-orbit .corner-item-node[data-ring="orbit3"] .corner-item-shape {
    width: 28px;
    height: 28px;
}
.corner-arc-stage.is-penta-orbit .corner-item-node[data-ring="orbit4"] .corner-item-shape {
    width: 30px;
    height: 30px;
}
.corner-arc-stage.is-penta-orbit .corner-item-node[data-ring="orbit5"] .corner-item-shape {
    width: 30px;
    height: 30px;
}

.corner-arc-stage.is-penta-orbit .corner-item-node svg {
    width: 14px;
    height: 14px;
}

.corner-arc-stage.is-penta-orbit .corner-item-node.loupe-active .corner-item-shape {
    transform: scale(1.6) !important;
}

/* Indicadores especiales */
.corner-item-node.is-pull-target {
    z-index: var(--z-modal) !important;
}

.corner-item-node.is-pull-target .corner-item-shape {
    background: color-mix(in srgb, var(--color-primary) 70%, var(--color-surface)) !important;
    box-shadow: 0 0 28px var(--color-primary), 0 6px 18px rgba(var(--color-scrim-rgb), 0.6) !important;
    border: 2px solid var(--color-primary) !important;
    transform: scale(1.38) !important;
    animation: rowTargetPulse 0.85s infinite ease-in-out !important;
}

@keyframes rowTargetPulse {
    0%, 100% {
        transform: scale(1.35);
        box-shadow: 0 0 18px var(--color-primary);
    }
    50% {
        transform: scale(1.45);
        box-shadow: 0 0 34px var(--color-primary);
    }
}

.corner-item-sub-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--color-error);
    color: var(--color-sheen);
    font-size: 9px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    padding: 0 var(--space-xs);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(var(--color-scrim-rgb), 0.6);
    pointer-events: none;
    z-index: 10;
}

/* =========================================================
   ESTILO DE SUBMENÚS: ICONO CON RELLENO VS ICONO VACÍO
   ========================================================= */

/* 1. Opciones normales sin submenú: Icono vacío / contorno translúcido */
.corner-item-node:not(.has-submenu) .corner-item-shape {
    background: color-mix(in srgb, var(--color-surface) 40%, transparent);
    border: 1.5px solid color-mix(in srgb, var(--color-text) 24%, transparent);
    color: var(--color-text);
    box-shadow: 0 2px 10px rgba(var(--color-scrim-rgb), 0.25);
}

.corner-item-node:not(.has-submenu) .corner-item-shape svg {
    stroke: currentColor;
}

.corner-item-node:not(.has-submenu) .corner-item-shape svg[fill="none"] {
    fill: none;
}

.corner-item-node:not(.has-submenu).loupe-active .corner-item-shape,
.corner-item-node:not(.has-submenu):hover .corner-item-shape {
    background: color-mix(in srgb, var(--color-primary) 40%, var(--color-surface)) !important;
    border-color: var(--color-primary) !important;
    color: var(--color-sheen) !important;
    box-shadow: 0 0 28px var(--color-primary), 0 10px 24px rgba(var(--color-scrim-rgb), 0.6) !important;
}

.corner-item-node:not(.has-submenu).loupe-active .corner-item-shape svg,
.corner-item-node:not(.has-submenu):hover .corner-item-shape svg {
    color: var(--color-sheen) !important;
    stroke: var(--color-sheen) !important;
}

/* 2. Opciones con submenú: Icono con relleno / botón sólido lleno */
.corner-item-node.has-submenu .corner-item-shape {
    background: var(--color-primary);
    border: 1.5px solid color-mix(in srgb, var(--color-sheen) 30%, var(--color-primary));
    color: var(--color-sheen);
    box-shadow: 0 0 16px var(--radial-glow), 0 4px 14px rgba(var(--color-scrim-rgb), 0.35);
}

.corner-item-node.has-submenu .corner-item-shape svg {
    fill: currentColor;
    stroke: currentColor;
    color: var(--color-sheen);
}

.corner-item-node.has-submenu.loupe-active .corner-item-shape,
.corner-item-node.has-submenu:hover .corner-item-shape {
    background: color-mix(in srgb, var(--color-primary) 92%, var(--color-sheen)) !important;
    border-color: var(--color-sheen) !important;
    color: var(--color-sheen) !important;
    box-shadow: 0 0 28px var(--color-primary), 0 12px 30px rgba(var(--color-scrim-rgb), 0.6) !important;
}

.corner-item-node.has-submenu.loupe-active .corner-item-shape svg,
.corner-item-node.has-submenu:hover .corner-item-shape svg {
    color: var(--color-sheen) !important;
    fill: var(--color-sheen) !important;
    stroke: var(--color-sheen) !important;
}

/* 3. Opciones con Acción Dual (Submenú + Acción Directa al pulsar): Estilo muy discreto */
.corner-item-node.has-dual-action .corner-item-shape {
    outline: 1.5px dashed color-mix(in srgb, currentColor 45%, transparent);
    outline-offset: 2.5px;
    position: relative;
}

.corner-item-node.has-dual-action .corner-item-shape::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 5px;
    height: 5px;
    border-radius: var(--radius-full);
    background-color: currentColor;
    opacity: 0.85;
    pointer-events: none;
}

.corner-item-node.has-dual-action.loupe-active .corner-item-shape,
.corner-item-node.has-dual-action:hover .corner-item-shape {
    outline-color: currentColor;
}

/* Indicador direccional de arrastre (↙) al enfocar opción con submenú */
.corner-item-node.has-submenu.loupe-active::after {
    content: '↙';
    position: absolute;
    bottom: -16px;
    left: -16px;
    font-size: 13px;
    font-weight: 900;
    color: var(--color-primary);
    filter: drop-shadow(0 0 6px var(--radial-glow));
    animation: bounceInward 0.85s infinite ease-in-out;
    pointer-events: none;
    z-index: var(--z-raised);
}

@keyframes bounceInward {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.7;
    }
    50% {
        transform: translate(-3px, 3px);
        opacity: 1;
    }
}

/* =========================================================
   INDICADORES VISUALES DE ÁREA DE ARRASTRE (RIELES OBJETIVO)
   ========================================================= */
.corner-arc-stage.is-pull-target-orbit1 .radar-rail-orbit1,
.corner-arc-stage.is-pull-target-orbit2 .radar-rail-orbit2,
.corner-arc-stage.is-pull-target-orbit3 .radar-rail-orbit3,
.corner-arc-stage.is-pull-target-orbit4 .radar-rail-orbit4,
.corner-arc-stage.is-pull-target-orbit0 .radar-rail-orbit0 {
    stroke: var(--color-primary) !important;
    stroke-width: 2.5px !important;
    stroke-dasharray: 6 4 !important;
    animation: railTargetPulse 0.9s infinite linear !important;
    filter: drop-shadow(0 0 10px var(--color-primary)) !important;
}

@keyframes railTargetPulse {
    0% {
        stroke-dashoffset: 0;
        opacity: 0.6;
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 16px var(--color-primary));
    }
    100% {
        stroke-dashoffset: 20;
        opacity: 0.6;
    }
}

/* Feedback al arrastrar hacia adentro en Ajustes para entrar a Módulos */
.corner-arc-stage.is-pulling-modules .radar-rail-orbit2,
.corner-arc-stage.is-pulling-modules .radar-rail-orbit3 {
    stroke: var(--color-primary) !important;
    stroke-width: 3px !important;
    stroke-dasharray: none !important;
    filter: drop-shadow(0 0 12px var(--color-primary));
}

.hud-hero-dual-desc {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11.5px;
    line-height: 1.35;
}

.hud-hero-dual-desc strong {
    color: var(--color-primary);
}

/* Ficha de instrucciones de ayuda en el HUD Hero */
.hud-hero-help-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
    font-size: 11.5px;
    line-height: 1.35;
}

.hud-hero-help-content strong {
    color: var(--color-primary);
    font-weight: 700;
}



/* =========================================================
   ESCENARIO HERO HUD (INFORMACIÓN TELEMÉTRICA)
   ========================================================= */
.hud-hero-stage {
    position: fixed;
    top: var(--space-6);
    left: var(--space-4);
    right: var(--space-4);
    max-width: 480px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
    transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
    z-index: calc(var(--z-overlay, 900) + 6);
}

.radial-overlay.active ~ .hud-hero-stage,
.radial-overlay.active .hud-hero-stage,
body.radial-menu-open .hud-hero-stage {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.hud-hero-card {
    background: color-mix(in srgb, var(--color-surface) 65%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
    border-radius: var(--radius-xl);
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    box-shadow: 0 20px 40px rgba(var(--color-scrim-rgb), 0.5), 0 0 30px var(--radial-glow);
    transition: all 0.25s ease;
}

.hud-hero-card.is-danger {
    border-color: color-mix(in srgb, var(--color-error) 40%, transparent);
    box-shadow: 0 20px 40px rgba(var(--color-scrim-rgb), 0.5), 0 0 30px var(--color-error);
}

.hud-hero-icon-box {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--color-primary) 22%, var(--color-surface));
    border: 1px solid color-mix(in srgb, var(--color-primary) 40%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(var(--color-scrim-rgb), 0.4), 0 0 18px var(--radial-glow);
    transition: all 0.2s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.hud-hero-card.is-danger .hud-hero-icon-box {
    background: color-mix(in srgb, var(--color-error) 22%, var(--color-surface));
    border-color: color-mix(in srgb, var(--color-error) 40%, transparent);
    box-shadow: 0 8px 20px rgba(var(--color-scrim-rgb), 0.4), 0 0 18px var(--color-error);
}

.hud-hero-icon-box svg {
    width: 28px;
    height: 28px;
    color: currentColor;
    stroke: currentColor;
    filter: drop-shadow(0 1px 3px rgba(var(--color-scrim-rgb), 0.5));
}

.hud-hero-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.hud-hero-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.hud-hero-badge {
    background: var(--color-primary);
    color: var(--color-sheen);
    font-size: 9px;
    font-weight: 800;
    padding: 2px var(--space-2);
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hud-hero-card.is-danger .hud-hero-badge {
    background: var(--color-error);
}

.hud-hero-route {
    font-size: 11px;
    font-family: monospace;
    color: var(--color-text-secondary);
}

.hud-hero-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--color-text);
    line-height: 1.2;
    margin-top: 1px;
}

.hud-hero-desc {
    font-size: 12px;
    line-height: 1.4;
    color: var(--color-text-secondary);
    margin-top: 2px;
}

.hud-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-2);
    background: color-mix(in srgb, var(--color-primary) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-primary) 32%, transparent);
    border-radius: var(--radius-full);
    padding: 2px var(--space-2);
    font-size: 11px;
    font-weight: 700;
    color: var(--color-primary);
    width: fit-content;
}

.hud-hero-card.is-danger .hud-hero-cta {
    background: color-mix(in srgb, var(--color-error) 16%, transparent);
    border-color: color-mix(in srgb, var(--color-error) 32%, transparent);
    color: var(--color-error);
}

.hud-hero-cta-bullet {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    box-shadow: 0 0 6px var(--color-primary);
}

.hud-hero-card.is-danger .hud-hero-cta-bullet {
    background: var(--color-error);
    box-shadow: 0 0 6px var(--color-error);
}

/* =========================================================
   LOS 6 PRESETS HERO DEL SET 10
   ========================================================= */

/* 01. Swiss Titular Colosal (52px) */
.hud-hero-stage.hud-v6-colosal {
    top: 24% !important;
    left: var(--space-6) !important;
    right: auto !important;
    max-width: 520px !important;
}
.hud-hero-stage.hud-v6-colosal .hud-hero-icon-box {
    display: none !important;
}
.hud-hero-stage.hud-v6-colosal .hud-hero-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
}
.hud-hero-stage.hud-v6-colosal .hud-hero-meta {
    font-family: monospace !important;
    font-size: 11px !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
}
.hud-hero-stage.hud-v6-colosal .hud-hero-title {
    font-size: 52px !important;
    font-weight: 900 !important;
    letter-spacing: -2px !important;
    line-height: 0.95 !important;
    text-shadow: 0 4px 24px rgba(var(--color-scrim-rgb), 0.95) !important;
}
.hud-hero-stage.hud-v6-colosal .hud-hero-desc {
    font-size: 14px !important;
    opacity: 0.85 !important;
    max-width: 320px !important;
}

/* 02. Swiss Eje Guía Vertical */
.hud-hero-stage.hud-v6-rail {
    top: 18% !important;
    left: var(--space-6) !important;
    right: auto !important;
    max-width: 400px !important;
}
.hud-hero-stage.hud-v6-rail .hud-hero-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    border-left: 2px solid var(--color-primary) !important;
    padding: 0 0 0 var(--space-4) !important;
}
.hud-hero-stage.hud-v6-rail .hud-hero-icon-box {
    display: none !important;
}
.hud-hero-stage.hud-v6-rail .hud-hero-title {
    font-size: 32px !important;
    font-weight: 800 !important;
    letter-spacing: -0.8px !important;
}

/* 03. Swiss Pureza Radical Anti-Cámara */
.hud-hero-stage.hud-v7-pure {
    top: 76px !important;
    left: var(--space-6) !important;
    right: auto !important;
    max-width: 480px !important;
}
.hud-hero-stage.hud-v7-pure .hud-hero-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
}
.hud-hero-stage.hud-v7-pure .hud-hero-icon-box,
.hud-hero-stage.hud-v7-pure .hud-hero-desc {
    display: none !important;
}
.hud-hero-stage.hud-v7-pure .hud-hero-title {
    font-size: 46px !important;
    font-weight: 900 !important;
    letter-spacing: -1.6px !important;
    text-shadow: 0 4px 24px rgba(var(--color-scrim-rgb), 0.95) !important;
}

/* 04. Sidebar Táctico Izquierdo */
.hud-hero-stage.hud-preset-sidebar {
    top: 22% !important;
    left: var(--space-4) !important;
    right: auto !important;
    max-width: 250px !important;
}
.hud-hero-stage.hud-preset-sidebar .hud-hero-card {
    flex-direction: column !important;
    gap: var(--space-2) !important;
}

/* 05. Sci-Fi Telemetría Cyber */
.hud-hero-stage.hud-preset-cyber .hud-hero-card {
    border-radius: var(--radius-sm) !important;
    border-left: 3px solid var(--color-primary) !important;
    background: color-mix(in srgb, var(--color-bg) 85%, transparent) !important;
}
.hud-hero-stage.hud-preset-cyber .hud-hero-title {
    font-family: monospace !important;
    letter-spacing: 0.5px !important;
    color: var(--color-primary) !important;
}

/* 06. Spotlight Centrado */
.hud-hero-stage.hud-preset-spotlight {
    top: 14% !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) translateY(-12px) !important;
    width: 90% !important;
    max-width: 380px !important;
    text-align: center !important;
}
body.radial-menu-open .hud-hero-stage.hud-preset-spotlight {
    transform: translateX(-50%) translateY(0) !important;
}
.hud-hero-stage.hud-preset-spotlight .hud-hero-card {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: var(--space-4) !important;
}
.hud-hero-stage.hud-preset-spotlight .hud-hero-icon-box {
    width: 64px !important;
    height: 64px !important;
    border-radius: var(--radius-full) !important;
}
.hud-hero-stage.hud-preset-spotlight .hud-hero-meta {
    justify-content: center !important;
}
.hud-hero-stage.hud-preset-spotlight .hud-hero-cta {
    margin: var(--space-2) auto 0 !important;
}

/* =========================================================
   VISIBILIDAD: MÓVIL EN TODAS LAS PANTALLAS vs ESCRITORIO
   ========================================================= */

/* Por defecto en pantallas con cabecera (escritorio), el FAB radial no se muestra */
body:not(.no-header) #radial-fab {
    display: none;
}

@media (max-width: 640px) {
    /* En móvil, el FAB radial aparece en todas las pantallas (en .app-torre, abajo del todo) */
    body:not(.no-header) #radial-fab {
        display: flex !important;
    }

    /* En móvil el Menú Radial sustituye a la hamburguesa SOLO si el radial está presente (usuario autenticado) */
    body:has(#radial-fab) .header-hamburger,
    body.has-radial-menu .header-hamburger {
        display: none !important;
    }

    /* Ocultar la barra lateral móvil clásica si el radial está presente */
    body:has(#radial-fab) .sidebar,
    body:has(#radial-fab) .sidebar-overlay,
    body.has-radial-menu .sidebar,
    body.has-radial-menu .sidebar-overlay {
        display: none !important;
    }
}

/* =========================================================
   ADAPTACIÓN PARA PC / ESCRITORIO (MAYOR TAMAÑO DE ICONOS)
   ========================================================= */
@media (min-width: 641px) {
    /* Tamaño aumentado en modo raíz (2 órbitas) */
    .corner-item-shape {
        width: 42px;
        height: 42px;
    }
    .corner-item-shape svg {
        width: 21px;
        height: 21px;
    }
    .corner-item-node.loupe-active .corner-item-shape,
    .corner-item-node:hover .corner-item-shape {
        transform: scale(1.6) !important;
    }

    /* Tamaño aumentado en penta-órbita (19 apps) */
    .corner-arc-stage.is-penta-orbit .corner-item-node[data-ring="orbit1"] .corner-item-shape,
    .corner-arc-stage.is-penta-orbit .corner-item-node[data-ring="orbit2"] .corner-item-shape,
    .corner-arc-stage.is-penta-orbit .corner-item-node[data-ring="orbit3"] .corner-item-shape {
        width: 32px;
        height: 32px;
    }
    .corner-arc-stage.is-penta-orbit .corner-item-node[data-ring="orbit4"] .corner-item-shape,
    .corner-arc-stage.is-penta-orbit .corner-item-node[data-ring="orbit5"] .corner-item-shape {
        width: 36px;
        height: 36px;
    }
    .corner-arc-stage.is-penta-orbit .corner-item-node svg {
        width: 17px;
        height: 17px;
    }
    .corner-arc-stage.is-penta-orbit .corner-item-node.loupe-active .corner-item-shape,
    .corner-arc-stage.is-penta-orbit .corner-item-node:hover .corner-item-shape {
        transform: scale(1.65) !important;
    }

    /* FAB central en PC */
    .fab-btn {
        width: 60px;
        height: 60px;
    }
    .fab-avatar-text {
        font-size: 16px;
    }
}

/* =========================================================
   TELEMETRÍA: MODO DEBUG UNIVERSAL
   ========================================================= */
.debug-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: var(--z-toast, 1000);
}

.debug-overlay.active {
    display: block !important;
}

.debug-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--color-success, #22c55e);
}

.debug-corner--tl {
    top: 5px;
    left: 5px;
    border-right: none;
    border-bottom: none;
}

.debug-corner--tr {
    top: 5px;
    right: 5px;
    border-left: none;
    border-bottom: none;
}

.debug-corner--bl {
    bottom: 5px;
    left: 5px;
    border-right: none;
    border-top: none;
}

.debug-corner--br {
    bottom: 5px;
    right: 5px;
    border-left: none;
    border-top: none;
}

.debug-viewport-size {
    position: absolute;
    bottom: 10px;
    right: 45px;
    background: var(--color-success, #22c55e);
    color: var(--color-sheen);
    font-family: monospace;
    font-size: 12px;
    font-weight: bold;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm, 4px);
    pointer-events: none;
}

/* =========================================================
   ORGANIZACIÓN ACTIVA: INDICADOR VISUAL EN SUBMENÚ
   ========================================================= */
.corner-item-node.is-active-org .corner-item-shape {
    border-color: var(--color-success) !important;
    box-shadow: 0 0 16px color-mix(in srgb, var(--color-success) 45%, transparent) !important;
}

.corner-item-node.is-active-org::after {
    content: '✓';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    background: var(--color-success);
    color: var(--color-sheen);
    font-size: 10px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(var(--color-scrim-rgb), 0.5);
    z-index: var(--z-raised);
    pointer-events: none;
}

/* =========================================================
   MODO PREVISUALIZACIÓN Y LANZAMIENTO DESDE AJUSTES
   ========================================================= */
.fab-btn.is-preview-active {
    display: flex !important;
    position: fixed !important;
    bottom: var(--space-4) !important;
    right: var(--space-4) !important;
    z-index: calc(var(--z-overlay, 900) + 10) !important;
}

.radial-hero-preview-box {
    margin: var(--space-4) 0;
    padding: var(--space-4);
    background: color-mix(in srgb, var(--color-surface) 80%, transparent);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    box-shadow: 0 4px 16px rgba(var(--color-scrim-rgb), 0.2);
}

.radial-preview-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
}

.radial-preview-headline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.radial-preview-beacon {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary);
    flex-shrink: 0;
}

.radial-preview-canvas {
    background: color-mix(in srgb, var(--color-bg) 60%, transparent);
    border: 1px dashed color-mix(in srgb, var(--color-border) 80%, transparent);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    position: relative;
}

.radial-preview-canvas .hud-hero-stage.is-inline-preview {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    max-width: 100% !important;
    width: 100% !important;
    z-index: 1 !important;
}

.radial-preview-canvas .hud-hero-stage.is-inline-preview.hud-preset-spotlight {
    transform: none !important;
    margin: 0 auto !important;
}
