/* ==========================================================================
   Zelanda Hub — Motion & Finish Layer
   Microinteracciones, transiciones y estética de alto nivel.
   Se carga despues de zelanda.css y zelanda-api.css.
   Todo el motion respeta prefers-reduced-motion y html.a11y-reduce-motion.
   ========================================================================== */

:root {
    --mo-enter: 560ms cubic-bezier(0.16, 1, 0.3, 1);
    --mo-pop: 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
    --mo-fast: 160ms cubic-bezier(0.2, 0, 0, 1);
    --mo-glow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* ---------- Seleccion y scrollbar pulidos ---------- */
::selection { background: rgba(37, 99, 235, 0.22); }
html.dark ::selection { background: rgba(96, 165, 250, 0.32); }

.stage { scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, 0.4) transparent; }
.stage::-webkit-scrollbar { width: 10px; height: 10px; }
.stage::-webkit-scrollbar-track { background: transparent; }
.stage::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.stage::-webkit-scrollbar-thumb:hover { background-color: rgba(100, 116, 139, 0.55); }
html.dark .stage::-webkit-scrollbar-thumb { background-color: rgba(148, 163, 184, 0.3); }

/* ---------- Transicion suave de tema claro/oscuro ---------- */
body, .card, .app-tile-xl, .fav-app, .login-banner, .subscribe-banner,
.search-xl input, .topbar, .dock, .bell-dropdown, .section-title,
.api-main, .api-footer {
    transition:
        background-color 350ms ease,
        border-color 350ms ease,
        color 350ms ease,
        box-shadow 280ms cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Entrada escalonada (JS asigna --zi e .is-in) ---------- */
@media (prefers-reduced-motion: no-preference) {
    .zel-enter { opacity: 0; }
    .zel-enter.is-in {
        animation: zelRise var(--mo-enter) both;
        animation-delay: calc(min(var(--zi, 0), 16) * 45ms);
    }
}
@keyframes zelRise {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Re-entrada de elementos al filtrar */
.app-item.zel-pop-in {
    animation: zelPopIn 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(min(var(--zi, 0), 12) * 28ms);
}
@keyframes zelPopIn {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- Launcher: titular con gradiente de marca ---------- */
.launcher-header h1 {
    background: linear-gradient(135deg, var(--zel-deep) 10%, var(--zel-primary) 55%, var(--zel-teal) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
}
html.dark .launcher-header h1 {
    background: linear-gradient(135deg, #f1f5f9 10%, #60a5fa 55%, #5eead4 100%);
    -webkit-background-clip: text;
    background-clip: text;
}
.section-title { letter-spacing: 0.02em; }
.section-title i { color: var(--zel-primary); }

/* ---------- Tiles: tilt 3D, spotlight, sheen, icono con resorte ---------- */
.app-tile-xl { overflow: hidden; transform-style: preserve-3d; }

.app-tile-xl.tilting, .app-tile-xl.tilting:hover,
.fav-app.tilting, .fav-app.tilting:hover {
    transform: perspective(720px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)) translateY(-4px) scale(1.02);
    transition: transform 70ms linear;
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, 0.45);
    z-index: 2;
}

/* Spotlight que sigue al cursor (JS pinta --mx/--my) */
.app-tile-xl::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 40%),
                rgba(37, 99, 235, 0.10), transparent 65%);
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: none;
}
.app-tile-xl:hover::before { opacity: 1; }
html.dark .app-tile-xl::before {
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 40%),
                rgba(96, 165, 250, 0.14), transparent 65%);
}

/* Sheen sweep sobre el icono */
.app-icon-xl { position: relative; overflow: hidden; transition: transform var(--mo-pop), box-shadow 300ms ease; }
.app-icon-xl::after {
    content: '';
    position: absolute;
    top: 0; left: -80%;
    width: 50%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0s;
}
.app-tile-xl:hover .app-icon-xl,
.fav-app:hover .fav-icon {
    transform: scale(1.08) rotate(-4deg);
    box-shadow: 0 14px 28px -8px rgba(37, 99, 235, 0.4);
}
.app-tile-xl:hover .app-icon-xl::after { left: 130%; transition: left 600ms ease; }

.fav-icon { transition: transform var(--mo-pop), box-shadow 300ms ease; }
.fav-app { will-change: transform; }

.app-name-xl { transition: color var(--mo-fast); }
.app-tile-xl:hover .app-name-xl { color: var(--zel-primary); }
.app-tile-xl:hover:active { transform: translateY(-1px) scale(0.985); }

/* ---------- Botones: press + sheen ---------- */
.btn, .subscribe-btn { position: relative; overflow: hidden; }
.btn:active, .subscribe-btn:active { transform: scale(0.96); }
.btn::after, .subscribe-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -90%;
    width: 45%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
}
.btn:hover::after, .subscribe-btn:hover::after { left: 140%; transition: left 550ms ease; }
.subscribe-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ---------- Ripple (JS crea .zel-ripple) ---------- */
.zel-ripple {
    position: absolute;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.16;
    transform: scale(0);
    animation: zelRipple 620ms ease-out forwards;
    pointer-events: none;
}
@keyframes zelRipple {
    to { transform: scale(2.8); opacity: 0; }
}

/* ---------- Estrella de favorito: pop + chispas ---------- */
.favorite-toggle { transition: transform var(--mo-pop), color var(--mo-fast); }
.favorite-toggle:active { transform: scale(0.8); }
.favorite-toggle.zel-pop { animation: zelStarPop 460ms cubic-bezier(0.34, 1.8, 0.64, 1); }
@keyframes zelStarPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.55) rotate(-10deg); }
    70%  { transform: scale(0.92) rotate(4deg); }
    100% { transform: scale(1) rotate(0); }
}
.zel-spark {
    position: fixed;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--c, #E5A52D);
    pointer-events: none;
    z-index: 9999;
    animation: zelSpark 680ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes zelSpark {
    to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

/* ---------- Buscador grande: foco premium ---------- */
.search-xl input { transition: var(--ease-overshoot); }
.search-xl input:focus {
    border-color: var(--zel-primary);
    box-shadow: var(--mo-glow), var(--shadow-md);
    transform: translateY(-1px);
}
.search-xl i { transition: color var(--mo-fast), transform var(--mo-pop); }
.search-xl:focus-within i { color: var(--zel-primary); transform: translateY(-50%) scale(1.15); }

/* Buscador global del topbar */
.global-search i, .global-search .kbd { transition: color var(--mo-fast), transform var(--mo-pop), opacity var(--mo-fast); }
.global-search:focus-within i { color: var(--zel-primary); transform: translateY(-50%) scale(1.12); }
.global-search:focus-within .kbd { opacity: 0; transform: translateY(-50%) scale(0.8); }
.global-search input:focus { box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22); }

/* ---------- Topbar ---------- */
.topbar .brand img { transition: transform var(--mo-pop); }
.topbar .brand:hover img { transform: rotate(-8deg) scale(1.08); }
.icon-btn { transition: var(--ease-spring); }
.icon-btn:active { transform: scale(0.88); }
.icon-btn i { transition: transform var(--mo-pop); }
#hubThemeToggle.zel-swap i { animation: zelIconSwap 420ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes zelIconSwap {
    0%   { transform: rotate(0) scale(1); opacity: 1; }
    45%  { transform: rotate(-120deg) scale(0.4); opacity: 0; }
    100% { transform: rotate(0) scale(1); opacity: 1; }
}

/* ---------- Campana: badge con pulso + dropdown con pop ---------- */
.bell-count { animation: zelBellPulse 2.6s ease-out infinite; }
@keyframes zelBellPulse {
    0%   { box-shadow: 0 0 0 0 rgba(198, 37, 51, 0.45); }
    70%  { box-shadow: 0 0 0 9px rgba(198, 37, 51, 0); }
    100% { box-shadow: 0 0 0 0 rgba(198, 37, 51, 0); }
}
.bell-dropdown { transform-origin: top right; }
.bell-dropdown.zel-open { animation: zelDrop 300ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes zelDrop {
    from { opacity: 0; transform: scale(0.92) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
html.dark .bell-dropdown { background: #1e293b !important; border-color: #334155 !important; color: #e2e8f0 !important; }

/* ---------- Dock: micro-resortes ---------- */
.dock-app:active { transform: translateY(0) scale(0.9); }
.dock-app.active i { animation: zelDockIn 420ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes zelDockIn {
    from { transform: translateY(7px) scale(0.65); opacity: 0.3; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
.dock-app i { transition: transform var(--mo-pop); }
.dock-app:hover i { transform: scale(1.12); }

/* ---------- Banners ---------- */
.subscribe-banner { position: relative; overflow: hidden; }
.subscribe-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(198, 37, 51, 0.06) 50%, transparent 70%);
    transform: translateX(-100%);
    pointer-events: none;
}
.subscribe-banner:hover::before { animation: zelSweep 900ms ease; }
@keyframes zelSweep { to { transform: translateX(100%); } }

/* ---------- Salud de las apps: punto vivo ---------- */
.app-health.ok i { animation: zelBeat 2.2s ease-in-out infinite; }
@keyframes zelBeat {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.65; transform: scale(0.85); }
}

/* ---------- Loader de navegacion: marca + anillo ---------- */
.api-loader {
    background: rgba(248, 250, 252, 0.72);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
html.dark .api-loader { background: rgba(11, 18, 32, 0.72); }
.loader-mark { position: relative; width: 76px; height: 76px; display: grid; place-items: center; }
.loader-mark img { width: 44px; height: 44px; animation: zelMarkPulse 1.4s ease-in-out infinite; }
.loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.35);
    animation: zelRingPing 1.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
@keyframes zelMarkPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}
@keyframes zelRingPing {
    0%   { transform: scale(0.75); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}
.api-loader p { letter-spacing: 0.04em; }

/* Handoff Hub -> producto: el logo pulsa, hace morph al icono del
   producto (color de marca) mientras el anillo sigue expandiendose.
   Usado por login_callback.html para que el salto se sienta continuo. */
.handoff-loader .lm-logo { animation: zelMarkPulse 1.4s ease-in-out infinite, zelLmOut .5s ease .35s both; }
.handoff-loader .lm-product {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 1rem;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.15rem;
    opacity: 0;
    transform: scale(0.55);
    animation: zelLmIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.75s forwards;
}
@keyframes zelLmOut { to { opacity: 0; transform: scale(0.55); } }
@keyframes zelLmIn {
    to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .handoff-loader .lm-logo { animation: none; opacity: 0; }
    .handoff-loader .lm-product { animation: none; opacity: 1; transform: none; }
}
html.a11y-reduce-motion .handoff-loader .lm-logo { animation: none; opacity: 0; }
html.a11y-reduce-motion .handoff-loader .lm-product { animation: none; opacity: 1; transform: none; }

/* ---------- Opt-in de notificaciones push ---------- */
.zl-push-card {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    /* Bajo los overlays (switcher=200, loader=9999, SweetAlert) */
    z-index: 150;
    width: min(21rem, calc(100vw - 2rem));
    background: var(--zel-card);
    border: 1px solid var(--zel-border);
    border-radius: 1.1rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
    padding: 1.05rem 1.15rem;
    color: var(--zel-text, #0f172a);
    font-family: var(--font-body, system-ui, sans-serif);
    transform-origin: bottom right;
    animation: zlPushIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    overflow: hidden;
}
html.dark .zl-push-card { background: var(--zel-card-dark); border-color: var(--zel-border-dark); color: var(--zel-text-dark, #e2e8f0); }
.zl-push-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--zel-primary), #14B8A6);
}
.zl-push-card.zl-push-out { animation: zlPushOut 0.3s cubic-bezier(0.55, 0, 1, 0.45) forwards; }
@keyframes zlPushIn {
    from { opacity: 0; transform: translateY(18px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes zlPushOut {
    to { opacity: 0; transform: translateY(12px) scale(0.96); }
}

.zl-push-head { display: flex; gap: 0.75rem; align-items: flex-start; }
.zl-push-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.8rem;
    background: linear-gradient(135deg, #14B8A6, #0EA5E9);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(20, 184, 166, 0.4);
}
.zl-push-icon i { animation: zlBellRing 5s ease-in-out 1.2s infinite; transform-origin: top center; }
@keyframes zlBellRing {
    0%, 100% { transform: rotate(0); }
    2%  { transform: rotate(-18deg); }
    5%  { transform: rotate(14deg); }
    8%  { transform: rotate(-10deg); }
    11% { transform: rotate(6deg); }
    14% { transform: rotate(0); }
}
.zl-push-title { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.15rem; }
.zl-push-text { font-size: 0.8rem; color: var(--zel-muted); line-height: 1.45; }
.zl-push-x {
    border: none;
    background: none;
    color: var(--zel-muted);
    font-size: 1.05rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.15rem;
    border-radius: 0.4rem;
    transition: var(--ease-smooth, 0.2s ease);
}
.zl-push-x:hover { color: var(--zel-text, #0f172a); background: rgba(100, 116, 139, 0.12); }
html.dark .zl-push-x:hover { color: #fff; }
.zl-push-actions { display: flex; gap: 0.5rem; margin-top: 0.8rem; justify-content: flex-end; }
.zl-push-later, .zl-push-on {
    border-radius: 0.6rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--ease-spring, 0.2s ease);
}
.zl-push-later {
    border: 1px solid var(--zel-border);
    background: transparent;
    color: var(--zel-muted);
}
.zl-push-later:hover { background: rgba(100, 116, 139, 0.1); color: var(--zel-text, #0f172a); }
html.dark .zl-push-later { border-color: var(--zel-border-dark); }
html.dark .zl-push-later:hover { color: #e2e8f0; }
.zl-push-on {
    border: none;
    background: linear-gradient(135deg, #14B8A6, #0EA5E9);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.zl-push-on:hover { filter: brightness(1.07); transform: translateY(-1px); }
.zl-push-on:active { transform: scale(0.96); }
.zl-push-on:disabled { opacity: 0.7; cursor: default; transform: none; }
/* Estado de exito: el icono se transforma en check */
.zl-push-card.zl-push-done .zl-push-icon { background: linear-gradient(135deg, #22C55E, #14B8A6); box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4); }
.zl-push-card.zl-push-done .zl-push-icon i { animation: zlDonePop 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes zlDonePop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* Barra de auto-cierre: se agota en 15s, se pausa con hover/focus */
.zl-push-timer {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, var(--zel-primary), #14B8A6);
    transform-origin: left;
    animation: zlPushTimer 15s linear forwards;
    opacity: 0.5;
}
@keyframes zlPushTimer { to { transform: scaleX(0); } }
.zl-push-card:hover .zl-push-timer,
.zl-push-card:focus-within .zl-push-timer { animation-play-state: paused; }
.zl-push-card.zl-push-done .zl-push-timer,
.zl-push-card.zl-push-out .zl-push-timer { display: none; }

@media (prefers-reduced-motion: reduce) {
    .zl-push-card { animation: none; }
    .zl-push-card.zl-push-out { animation: none; opacity: 0; }
    .zl-push-icon i { animation: none; }
    .zl-push-timer { animation: none; opacity: 0.35; }
}
html.a11y-reduce-motion .zl-push-card { animation: none; }
html.a11y-reduce-motion .zl-push-card.zl-push-out { animation: none; opacity: 0; }
html.a11y-reduce-motion .zl-push-icon i { animation: none; }
html.a11y-reduce-motion .zl-push-timer { animation: none; opacity: 0.35; }

/* ---------- Colapso suave de secciones al buscar ---------- */
.zel-collapsible {
    max-height: 600px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                visibility 0s;
}
.zel-collapsible.zel-collapsed {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                visibility 0s 0.38s;
}
@media (prefers-reduced-motion: reduce) {
    .zel-collapsible, .zel-collapsible.zel-collapsed { transition: none; }
}
html.a11y-reduce-motion .zel-collapsible,
html.a11y-reduce-motion .zel-collapsible.zel-collapsed { transition: none; }

/* ---------- Footer del shell: pill flotante ---------- */
.api-footer.zel-footer {
    margin: 0 1rem 1rem;
    border-radius: 1rem;
    padding: 0.7rem 1.25rem;
    text-align: left;
    box-shadow: 0 8px 24px rgba(13, 27, 42, 0.35);
}
/* El FAB back-to-top sube para no tapar el footer */
.back-to-top { bottom: 4.75rem; }
.zf-inner {
    display: flex;
    align-items: center;
    gap: 0.85rem 1.5rem;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}
.zf-left { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: #cbd5e1; font-size: 0.85rem; }
.zf-logo { width: 18px; height: 18px; }
.zf-dim { opacity: 0.5; font-weight: 400; font-size: 0.78rem; }
.zf-env {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.45);
    padding: 0.12rem 0.45rem;
    border-radius: 0.4rem;
}
.zf-links { display: flex; gap: 1.15rem; flex-wrap: wrap; }
.zf-links a {
    color: #9aa4b2;
    font-size: 0.78rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s ease, transform 0.2s ease;
}
.zf-links a:hover { color: #fff; transform: translateY(-1px); }
.zf-links a i { font-size: 0.7rem; opacity: 0.8; }
.zf-right { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.zf-tenant { max-width: 220px; }
.zf-tenant-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zf-tenant {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
}
.zf-tenant i { font-size: 0.65rem; color: var(--zel-teal, #14b8a6); }
@media (max-width: 700px) {
    .zf-inner { justify-content: center; text-align: center; }
    .zf-links { justify-content: center; }
}

/* Transicion de salida entre paginas del hub */
.api-main { transition: opacity 240ms ease, filter 240ms ease; }
body.zel-leaving .api-main { opacity: 0.35; filter: blur(3px); }

/* ---------- Ambiente: orbes de gradiente en el stage ---------- */
.zel-ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.zel-ambient i {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
}
.zel-ambient i:nth-child(1) {
    width: 46vmax; height: 46vmax;
    top: -20vmax; right: -14vmax;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.10), transparent 70%);
    animation: zelDrift1 26s ease-in-out infinite alternate;
}
.zel-ambient i:nth-child(2) {
    width: 38vmax; height: 38vmax;
    bottom: -18vmax; left: -10vmax;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.09), transparent 70%);
    animation: zelDrift2 32s ease-in-out infinite alternate;
}
.zel-ambient i:nth-child(3) {
    width: 26vmax; height: 26vmax;
    top: 38%; left: 44%;
    background: radial-gradient(circle, rgba(229, 165, 45, 0.07), transparent 70%);
    animation: zelDrift3 38s ease-in-out infinite alternate;
}
html.dark .zel-ambient i:nth-child(1) { background: radial-gradient(circle, rgba(37, 99, 235, 0.16), transparent 70%); }
html.dark .zel-ambient i:nth-child(2) { background: radial-gradient(circle, rgba(20, 184, 166, 0.12), transparent 70%); }
html.dark .zel-ambient i:nth-child(3) { background: radial-gradient(circle, rgba(229, 165, 45, 0.08), transparent 70%); }
@keyframes zelDrift1 {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-6vmax, 5vmax) scale(1.12); }
}
@keyframes zelDrift2 {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(7vmax, -4vmax) scale(1.08); }
}
@keyframes zelDrift3 {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-5vmax, -6vmax) scale(0.92); }
}
.api-main, .api-footer { position: relative; z-index: 1; }

/* ---------- Skip link: visible solo con foco ---------- */
.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 9999;
    padding: 0.55rem 1rem;
    border-radius: 0.6rem;
    background: var(--zel-deep);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    transform: translateY(-150%);
    transition: transform var(--mo-fast);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Focus visible consistente ---------- */
:focus-visible {
    outline: 2px solid var(--zel-primary);
    outline-offset: 2px;
    border-radius: 6px;
}
.app-tile-xl:focus-visible, .fav-app:focus-visible { border-radius: inherit; }

/* ---------- App Switcher (Ctrl+K) ---------- */
.launcher-overlay.open { animation: fadeIn 180ms ease both; }
.launcher-overlay.open .launcher { animation: scaleIn 280ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.app-tile.kb-active {
    background: rgba(37, 99, 235, 0.08);
    box-shadow: inset 0 0 0 2px var(--zel-primary);
}
html.dark .app-tile.kb-active { background: rgba(96, 165, 250, 0.12); }
.zel-switch-tile { user-select: none; }
.zel-switch-tile[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.switcher-empty {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--zel-muted);
}
.switcher-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0.25rem;
    font-size: 0.72rem;
    color: var(--zel-muted);
}
.switcher-foot .kbd {
    position: static;
    transform: none;
    display: inline-block;
}
.switcher-foot a { color: var(--zel-primary); font-weight: 600; }
.switcher-hints { display: flex; gap: 0.75rem; align-items: center; }
.switcher-hints span { display: inline-flex; align-items: center; gap: 0.3rem; }

/* ---------- Respeto total al movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
    .zel-ambient { display: none; }
    .app-tile-xl.tilting, .fav-app.tilting { transform: none; }
    .zel-enter { opacity: 1; }
}
html.a11y-reduce-motion .zel-ambient { display: none; }
html.a11y-reduce-motion .app-tile-xl.tilting { transform: none; }
