html.dwarg-is-loading,
body.dwarg-loading {
  overflow: hidden !important;
}

/* Global loader — above sidebar, modals, PWA chrome */
#dwarg-loader.dwarg-loader,
.dwarg-loader {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 2147483646 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.dwarg-loader.is-active {
  pointer-events: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.dwarg-loader__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dwarg-loader__panel {
  position: relative;
  z-index: 1;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.25rem;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 48px rgba(100, 141, 203, 0.22), 0 2px 12px rgba(0, 0, 0, 0.06);
  max-width: calc(100vw - 2rem);
}

.dwarg-loader__orbit {
  position: absolute;
  top: 1.35rem;
  left: 50%;
  width: 108px;
  height: 108px;
  margin-left: -54px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #648dcb;
  border-right-color: #7b5cff;
  animation: dwarg-orbit 1s linear infinite;
}

.dwarg-loader__logo-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dwarg-loader__logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  animation: dwarg-logo-pulse 1.4s ease-in-out infinite;
}

.dwarg-loader__label {
  margin: 1rem 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #648dcb;
  letter-spacing: 0.02em;
}

.dwarg-loader__sublabel {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: 0.01em;
}

.dwarg-loader__dots {
  display: flex;
  gap: 0.35rem;
}

.dwarg-loader__dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #648dcb, #7b5cff);
  animation: dwarg-dot-bounce 1.2s ease-in-out infinite;
}

.dwarg-loader__dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.dwarg-loader__dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dwarg-orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes dwarg-logo-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.92;
  }
}

@keyframes dwarg-dot-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dwarg-loader__orbit,
  .dwarg-loader__logo,
  .dwarg-loader__dots span {
    animation: none;
  }
}
