/* fix73 — photos in chats: the picture itself, like Instagram / WhatsApp.
   No coloured frame around it, a soft placeholder while it loads, "Save" as a small round button on the photo. */

/* a photo with nothing else in the bubble: no bubble at all */
.bubble.has-photo.bare { padding: 0; background: transparent !important; border-radius: 18px; box-shadow: none; }
.bubble-row.mine .bubble.has-photo.bare { background: transparent !important; }
/* a photo WITH a caption keeps the bubble, with a thin edge */
.bubble.has-photo:not(.bare) { padding: 3px; }

.bubble.has-photo { width: min(72vw, 270px); max-width: none; box-sizing: border-box; }
.dm-media-box { position: relative; display: block; }
.dm-photo {
  width: 100%; min-height: 200px; border-radius: 18px; background-color: rgba(255, 255, 255, .06);
}
.dm-photo img {
  width: 100%; max-width: none; min-width: 0; height: auto; min-height: 0; max-height: 360px;
  object-fit: cover; border-radius: 18px; opacity: 0; transition: opacity .2s ease;
}
.dm-photo.is-loaded { min-height: 0; background-image: none; }
.dm-photo.is-loaded img { opacity: 1; }
.dm-photo:not(.is-loaded) {
  background-image: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .09) 50%, transparent 80%);
  background-size: 220% 100%; animation: dmShimmer 1.2s linear infinite;
}
@keyframes dmShimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .dm-photo:not(.is-loaded) { animation: none; } }

/* videos in chat: same width, same corners */
.dm-media-box .dm-video-thumb { width: 100%; border-radius: 18px; overflow: hidden; display: block; position: relative; }

.dm-save-chip {
  position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: rgba(0, 0, 0, .46); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.dm-save-chip svg { width: 16px; height: 16px; }
.dm-save-chip.on { background: rgba(37, 120, 255, .85); }
.dm-save-chip:active { transform: scale(.92); }
html[data-mode="light"] .dm-photo { background-color: rgba(15, 23, 42, .06); }
