/* Shared loading indicator; real sprite alpha works on either surface. */
#nexoLoading {
  --loader-surface:#fff; --loader-text:#163b50; --loader-muted:#5c7486;
  --loader-border:#d7e4eb; --loader-accent:#058aa2;
  position:fixed; inset:0; box-sizing:border-box; margin:auto;
  width:min(360px, calc(100vw - 32px)); max-width:none;
  max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px); padding:22px 24px 24px;
  border:1px solid var(--loader-border); border-radius:18px;
  color:var(--loader-text); background:var(--loader-surface);
  box-shadow:0 18px 70px #061b3433; text-align:center;
  font-family:inherit; overflow:auto;
}
#nexoLoading:not([open]) { display:none !important; }
#nexoLoading[open] { display:block; }
#nexoLoading:focus { outline:none; }
#nexoLoading::backdrop { background:rgb(8 24 36 / 42%); backdrop-filter:blur(2px); }
body.nexo-dark #nexoLoading {
  --loader-surface:#142632; --loader-text:#e7f2f6; --loader-muted:#aec8d6;
  --loader-border:#315061; --loader-accent:#63d7e8;
}
/* Navigation uses an opaque, stable surface: no half-rendered tray underneath. */
#nexoLoading.nexo-loading-transition { font-family:system-ui,-apple-system,"Segoe UI",sans-serif; }
#nexoLoading.nexo-loading-transition::backdrop { background:#f4f7f8; backdrop-filter:none; }
#nexoLoading.nexo-loading-transition[data-theme="light"] {
  --loader-surface:#fff; --loader-text:#163b50; --loader-muted:#5c7486;
  --loader-border:#d7e4eb; --loader-accent:#058aa2;
}
#nexoLoading.nexo-loading-transition[data-theme="dark"] {
  --loader-surface:#142632; --loader-text:#e7f2f6; --loader-muted:#aec8d6;
  --loader-border:#315061; --loader-accent:#63d7e8;
}
#nexoLoading.nexo-loading-transition[data-theme="dark"]::backdrop { background:#0c1922; }
#nexoLoading .nexo-loading-robot {
  width:184px; height:184px; margin:0 auto 12px;
  background:url('icons/nexo-robot-desk.png?v=1') 0 0 / 200% 200% no-repeat;
  animation:nexo-robot-work 2.4s steps(1,end) infinite;
  animation-delay:var(--robot-phase,0ms);
}
#nexoLoading h2 { margin:0 0 8px; padding:0; font-family:inherit; font-size:18px; font-weight:800; line-height:1.3; color:var(--loader-text); }
#nexoLoading p { margin:0; padding:0; font-size:13px; line-height:1.55; color:var(--loader-muted); }
#nexoLoading .nexo-loading-dots { display:flex; justify-content:center; gap:7px; margin-top:18px; }
#nexoLoading .nexo-loading-dots i { width:6px; height:6px; border-radius:50%; background:var(--loader-accent); animation:nexo-loading-pulse 1.5s ease-in-out infinite; }
#nexoLoading .nexo-loading-dots i { animation-delay:var(--dots-phase,0ms); }
#nexoLoading .nexo-loading-dots i:nth-child(2) { animation-delay:calc(var(--dots-phase,0ms) + .2s); }
#nexoLoading .nexo-loading-dots i:nth-child(3) { animation-delay:calc(var(--dots-phase,0ms) + .4s); }
#nexoLoading .nexo-loading-slow { margin-top:12px; font-size:12px; }
@keyframes nexo-robot-work { 0%,100%{background-position:0 0} 25%{background-position:100% 0} 50%{background-position:0 100%} 75%{background-position:100% 100%} }
@keyframes nexo-loading-pulse { 0%,80%,100%{opacity:.3;transform:translateY(0)} 40%{opacity:1;transform:translateY(-3px)} }
@media(max-width:480px) { #nexoLoading { padding:18px 20px 20px; width:min(320px,calc(100vw - 32px)); } #nexoLoading .nexo-loading-robot { width:156px;height:156px; } #nexoLoading h2 { font-size:17px; } }
@media(prefers-reduced-motion:reduce) { #nexoLoading .nexo-loading-robot, #nexoLoading .nexo-loading-dots i { animation:none; } }
