@keyframes sk-spin {
  to { transform: rotate(360deg); }
}

#app-loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #64748b;
  background: #f8fafc;
}

#app-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: sk-spin 0.8s linear infinite;
}

#app-loading-timeout {
  max-width: 320px;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
}

#app-loading-timeout[hidden] { display: none; }

#app-loading-reload {
  display: block;
  margin: 12px auto 0;
  min-height: 44px;
  padding: 8px 20px;
  color: #fff;
  background: #2563eb;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

html.dark #app-loading { color: #94a3b8; background: #0A0A0F; }
html.dark #app-loading-spinner { border-color: #1e293b; border-top-color: #3b82f6; }
html.dark #app-loading-timeout { color: #cbd5e1; }
html.dark #app-loading-reload { background: #3b82f6; }

html.theme-transition body,
html.theme-transition #root,
html.theme-transition .office-root,
html.theme-transition .office-root * {
  transition-property: color, background-color, border-color, fill, stroke, box-shadow, opacity, transform;
  transition-duration: 220ms;
  transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  html.theme-transition body,
  html.theme-transition #root,
  html.theme-transition .office-root,
  html.theme-transition .office-root * { transition-duration: 0ms; }
}

#ym-noscript img { position: absolute; left: -9999px; }
