/* Space is reserved before a lazily-loaded asset arrives, so decoding it never
   reflows what is already on screen. */

img, video, iframe {
  background-color: rgba(255, 255, 255, 0.04);
}

/* An <img> with no src yet is a placeholder box, not a broken-image glyph. */
img:not([src]), img[src=""] {
  visibility: hidden;
}

/* Chat photos arrive at unknown sizes; object-fit crops into the reserved box. */
.bubble-photo { aspect-ratio: 3 / 4; }

/* Thumbnails whose grid cell does not already fix a height. */
.pl-slot-thumb, .outfit-seed-img { aspect-ratio: 1 / 1; object-fit: cover; }

/* Avatars are always square, whatever the source image is. */
.msg-av, .rail-avatar { aspect-ratio: 1 / 1; object-fit: cover; }

/* ── Loading skeletons ───────────────────────────────────────────────────────
   A panel waiting on a fetch holds its own height, so the answer arriving
   replaces the placeholder in place instead of shoving the page around. */

.skel {
  border-radius: 10px;
  background: linear-gradient(100deg,
    rgba(255, 255, 255, 0.045) 30%,
    rgba(255, 255, 255, 0.10) 50%,
    rgba(255, 255, 255, 0.045) 70%) 0 0 / 300% 100%;
  animation: skel-sweep 1.4s ease-in-out infinite;
}

/* The sweep is a white tint, which vanishes on the light theme's pale ground. */
:root[data-theme="light"] .skel {
  background: linear-gradient(100deg,
    rgba(0, 0, 0, 0.04) 30%,
    rgba(0, 0, 0, 0.08) 50%,
    rgba(0, 0, 0, 0.04) 70%) 0 0 / 300% 100%;
}

@keyframes skel-sweep {
  from { background-position: 150% 0; }
  to   { background-position: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; }
}

.skel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.skel-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 760px) {
  .skel-days { grid-template-columns: 1fr; }
}
