.app-boot {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(165deg, #f8fafc 0%, #eef0ff 42%, #edf0fe 100%);
  color: #1f2937;
  font-size: 14px;
  transition: opacity .28s ease, visibility .28s ease;
}
@media (display-mode: standalone), (display-mode: fullscreen) {
  .app-boot {
    min-height: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    max-height: none;
    background: #edf0fe;
  }
}
.app-boot.hidden { display: none; }
.app-boot.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Flowee branded splash — Icon System purple */
.flowee-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: flowee-splash-in .55s ease both;
}
.flowee-splash-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 12px 36px rgba(91, 92, 235, 0.28);
  object-fit: cover;
  background: #fff;
}
.flowee-splash-brand {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #8b7dff, #5b5ceb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@keyframes flowee-splash-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Legacy spinner (errors / fallback only) */
.app-boot-spinner {
  width: 20px; height: 20px; border: 2px solid #e5e7eb;
  border-top-color: #64748b; border-radius: 50%;
  animation: app-spin .7s linear infinite;
}
@keyframes app-spin { to { transform: rotate(360deg); } }

.app-root { min-height: 100vh; }
.app-root.hidden { display: none; }
/* Keep root under splash so restore can mount silently */
.app-root.under-splash {
  visibility: hidden;
  pointer-events: none;
}
.app-page { display: none; min-height: 100vh; }
.app-page.active { display: block; }
.app-error {
  max-width: 400px; margin: 40px auto; padding: 20px;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px;
  color: #b91c1c; font-size: 14px; text-align: center;
}

@media (prefers-color-scheme: dark) {
  .app-boot {
    background: linear-gradient(165deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
    color: #f8fafc;
  }
  .flowee-splash-brand {
    background: linear-gradient(135deg, #c4b5fd, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
