/* Phone page-transition skeleton.
   On phones, the page-loading overlay (#page-load-overlay, base.html) shows an
   outline of the page being opened instead of the spinner; built by
   static/js/skeleton-mobile.js. Loaded with media="(max-width: 980px)", so the
   desktop keeps the spinner. Colours come from the theme tokens (light and
   dark palettes). Class names carry "loader" so unslop-mobile.css's motion
   rule leaves the pulse running. */

#page-load-overlay.is-skeleton {
  /* start under the phone top bar, which stays visible; the bottom bar
     (z-index above the overlay) stays on top as well */
  top: calc(62px + env(safe-area-inset-top));
  justify-content: flex-start; align-items: stretch; gap: 0;
  background: var(--bg-page);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  overflow: hidden;
}
#page-load-overlay.is-skeleton #page-load-boxes,
#page-load-overlay.is-skeleton #page-load-text { display: none; }
#page-load-overlay.is-skeleton #page-load-actions {
  position: absolute; inset-inline: 0; bottom: calc(64px + 48px + env(safe-area-inset-bottom));
  justify-content: center;
}

.skm-loader {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px 10px calc(96px + env(safe-area-inset-bottom));
}
.skm-loader-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.skm-loader-row { display: flex; align-items: center; gap: 10px; }
.skm-loader-col { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.skm-loader-grid { display: grid; gap: 10px; }
.skm-loader-grid.is-2 { grid-template-columns: 1fr 1fr; }
.skm-loader-grid.is-3 { grid-template-columns: 1fr 1fr 1fr; }
.skm-loader-grid.is-7 { grid-template-columns: repeat(7, 1fr); gap: 6px; }

/* the grey bones */
.skm-loader-bone {
  display: block;
  height: 12px; border-radius: 6px;
  background: color-mix(in oklab, var(--text) 12%, var(--bg-card));
  animation: skmLoaderPulse 1.2s ease-in-out infinite;
}
.skm-loader-card > .skm-loader-bone,
.skm-loader-col > .skm-loader-bone { max-width: 100%; }
.skm-loader-bone.is-title { height: 20px; width: 46%; border-radius: 8px; }
.skm-loader-bone.is-line  { width: 82%; }
.skm-loader-bone.is-short { width: 48%; }
.skm-loader-bone.is-tiny  { width: 28%; height: 10px; }
.skm-loader-bone.is-big   { height: 30px; width: 54%; border-radius: 8px; }
.skm-loader-bone.is-input { height: 44px; width: 100%; border-radius: 12px; }
.skm-loader-bone.is-btn   { height: 40px; flex: 1; border-radius: 12px; }
.skm-loader-bone.is-pill  { height: 30px; width: 84px; border-radius: 999px; flex: 0 0 auto; }
.skm-loader-bone.is-icon  { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto; }
.skm-loader-bone.is-dot   { width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto; }
.skm-loader-bone.is-cell  { height: 46px; border-radius: 10px; }
.skm-loader-bone.is-panel { height: 150px; width: 100%; border-radius: 12px; }
.skm-loader-gap { flex: 1; }

/* a soft wave down the page: each card starts its pulse a little later */
.skm-loader > :nth-child(2) .skm-loader-bone { animation-delay: .08s; }
.skm-loader > :nth-child(3) .skm-loader-bone { animation-delay: .16s; }
.skm-loader > :nth-child(4) .skm-loader-bone { animation-delay: .24s; }
.skm-loader > :nth-child(n+5) .skm-loader-bone { animation-delay: .32s; }

@keyframes skmLoaderPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .5; }
}
@media (prefers-reduced-motion: reduce) {
  .skm-loader-bone { animation: none; }
}
