/* Shared document + React loading visuals. No asset requests outside installed startup. */
.cuib-dots { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 28px; }
.cuib-dots > span { width: 12px; height: 12px; border-radius: 50%; background: #F2D3B1; animation: cuib-dot 1.4s ease-in-out infinite; }
.cuib-dots > span:nth-child(2) { background: #E9B987; animation-delay: .14s; }
.cuib-dots > span:nth-child(3) { background: #F5AA32; animation-delay: .28s; }
.cuib-dots > span:nth-child(4) { background: #D77E57; animation-delay: .42s; }
.cuib-dots > span:nth-child(5) { background: #A55D36; animation-delay: .56s; }
@keyframes cuib-dot { 0%, 65%, 100% { opacity: .62; transform: scale(.9); } 28% { opacity: 1; transform: scale(1.12); } }
#cuib-boot-recovery[hidden], #cuib-boot-recovery [hidden] { display: none; }
#cuib-boot-recovery { position: fixed; inset: 0; z-index: 9999; box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: 24px; padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); background-color: #F8F3EA; color: #3F342E; font: 16px/1.5 Arial, sans-serif; opacity: 1; transition: opacity 250ms ease-out; }
#cuib-boot-recovery.cuib-boot-leaving { opacity: 0; pointer-events: none; }
.cuib-boot-content { width: 100%; max-width: 420px; text-align: center; }
.cuib-boot-logo { display: none; width: min(55vw, 340px, 56vh); min-width: min(180px, 100%); max-width: 100%; aspect-ratio: 3 / 1; height: auto; margin: 0 auto clamp(12px, 4vh, 36px); }
#cuib-boot-retry { padding: 12px 20px; border: 0; border-radius: 12px; background: #8A6045; color: #FFFDF8; font: inherit; cursor: pointer; }
#cuib-boot-update { display: block; margin-top: 16px; color: #8A6045; }
/* Select by window geometry, including unfolded and rotated devices.
   Anchor at the house so cover crops only peripheral decoration. */
@media (display-mode: standalone) {
  #cuib-boot-recovery { background-color: #FCF4E7; background-image: var(--cuib-boot-art, url('/loading-background.webp')); background-size: cover; background-position: right bottom; background-repeat: no-repeat; }
  .cuib-boot-logo { display: block; }
}
.cuib-ios-standalone #cuib-boot-recovery { background-color: #FCF4E7; background-image: var(--cuib-boot-art, url('/loading-background.webp')); background-size: cover; background-position: right bottom; background-repeat: no-repeat; }
.cuib-ios-standalone .cuib-boot-logo { display: block; }
@media (prefers-reduced-motion: reduce) { .cuib-dots > span { animation: none; opacity: 1; transform: none; } #cuib-boot-recovery { transition: none; } }

@media (min-aspect-ratio: 4/5) {
  #cuib-boot-recovery { --cuib-boot-art: url('/loading-background-landscape.webp'); }
}

@media (min-width: 600px) {
  .cuib-boot-content { max-width: 480px; }
  .cuib-boot-logo { width: min(62vw, 400px, 62vh); }
  #cuib-boot-recovery .cuib-dots > span { width: 14px; height: 14px; }
}

/* Logo composition follows available space independently of the artwork. */
@media (max-width: 599px) and (max-aspect-ratio: 1/1) {
  .cuib-boot-logo { width: min(41.85vw, 162px, 28.35vh); min-width: 0; aspect-ratio: 1122 / 1402; }
}
