/* Available with the HTML shell, before application modules initialize. */
#appStartupProgress {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 38px 26px 24px;
  overflow: auto;
  resize: none !important;
  border: 0;
  border-radius: 14px;
  outline: none;
  background: transparent;
  color: #233e53;
  box-shadow: none;
  text-align: center;
  font: 14px/1.5 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
#appStartupProgress[hidden] { display: none !important; }
#appStartupProgress::backdrop {
  background-color: #f4f8f9;
  background-image: linear-gradient(#f4f8f9f0, #f4f8f9f0), url('../assets/clademap-icon.svg');
  background-repeat: no-repeat;
  background-size: auto, clamp(320px, 55vw, 640px);
  background-position: center, calc(50% + 200px) center;
}
#appStartupProgress .startup-emblem { position: relative; width: 132px; height: 132px; margin: 0 auto 32px; isolation: isolate; }
#appStartupProgress .startup-emblem::before {
  content: '';
  position: absolute;
  inset: -60px;
  z-index: -1;
  background: radial-gradient(circle, #177d871a, transparent 70%);
}
#appStartupProgress .startup-emblem img {
  display: block;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: #f7fbfb;
  filter: drop-shadow(0 12px 22px #174c5220);
  animation: startup-logo-enter 800ms cubic-bezier(.25,.1,.25,1) both,
    startup-logo-breathe 4600ms ease-in-out 800ms infinite;
}
#appStartupProgress .startup-ring { position: absolute; inset: -20px; width: 172px; height: 172px; fill: none; animation: startup-spin 2600ms linear infinite; transform-origin: center; }
#appStartupProgress .startup-ring-track { stroke: #177d872b; stroke-width: 1; }
#appStartupProgress .startup-ring-arc { stroke: #177d87; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 130 522; }
#appStartupProgress .startup-status { min-height: 78px; }
#appStartupMessage { display: block; max-width: 32ch; min-height: 3em; margin: 8px auto 0; font-size: 14px; line-height: 1.5; color: #334b5d; overflow-wrap: anywhere; }
#appStartupPercent { display: block; font-size: 16px; font-weight: 600; line-height: 1.5; font-variant-numeric: tabular-nums; color: #176f75; }
/* Keep the native progress value and accessible startup name without a second visual bar. */
#appStartupProgress .startup-title, #appStartupBar {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
#appStartupError { margin: 16px 0; color: #a52c39; overflow-wrap: anywhere; white-space: pre-wrap; }
#appStartupProgress button { margin-top: 16px; padding: 6px 18px; border: 1px solid #b7cbdc; border-radius: 6px; background: #eef5fc; color: #204d76; font: inherit; cursor: pointer; }
#appStartupProgress [hidden] { display: none !important; }
#appStartupProgress[data-state="failed"] { background: #fff; border: 1px solid #d2dfea; box-shadow: 0 18px 65px #203e5b26; }
#appStartupProgress[data-state="failed"] .startup-title { position: static; width: auto; height: auto; margin: 0 0 12px; overflow: visible; clip-path: none; white-space: normal; font: 600 18px/1.3 'Segoe UI', system-ui, sans-serif; color: #193a50; }
#appStartupProgress[data-state="failed"] .startup-ring, #appStartupProgress[data-state="failed"] .startup-emblem img { animation: none; }
#appStartupProgress[data-state="failed"] .startup-ring-arc { stroke: #a52c39; stroke-dasharray: none; }
#appStartupProgress[data-state="failed"] #appStartupPercent { display: none; }
#appStartupProgress[data-state="revealing"] { animation: startup-dismiss 180ms ease-in both; }
#appStartupProgress[data-state="revealing"]::backdrop { animation: startup-reveal 260ms ease-out both; }
#appStartupProgress[data-state="revealing"] .startup-ring, #appStartupProgress[data-state="revealing"] .startup-emblem img { animation: none; }
@keyframes startup-dismiss { to { opacity: 0; } }
@keyframes startup-reveal { to { opacity: 0; } }
@keyframes startup-spin { to { transform: rotate(360deg); } }
@keyframes startup-logo-enter { from { opacity: .85; transform: translateY(4px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes startup-logo-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@media (prefers-reduced-motion: reduce) {
  #appStartupProgress .startup-ring, #appStartupProgress .startup-emblem img { animation: none; }
  #appStartupProgress[data-state="revealing"], #appStartupProgress[data-state="revealing"]::backdrop { animation: none; }
}
