/* Content images keep their watermark when saved; preview stays inside the page. */
img[data-protected-image], .image-preview img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}
[data-image-preview] { cursor: zoom-in; }
.image-preview {
  width: min(1080px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid #dfe5ed;
  border-radius: 10px;
  background: #fff;
  color: #172033;
  box-shadow: 0 16px 64px rgb(0 0 0 / 20%);
}
.image-preview::backdrop { background: rgb(12 22 38 / 72%); }
.image-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; border-bottom: 1px solid #e5e7ee; }
.image-preview-heading h2 { margin: 0; font-size: 16px; font-weight: 500; line-height: 1.7; }
.image-preview-close { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 6px; background: #f2f5f8; color: #172033; font: 26px/1 sans-serif; cursor: pointer; }
.image-preview-close:focus-visible { outline: 2px solid #1464f4; outline-offset: 3px; }
.image-preview-content { margin: 0; padding: 16px; overflow: auto; max-height: calc(100dvh - 108px); }
.image-preview img { display: block; width: 100%; height: auto; max-height: calc(100dvh - 160px); object-fit: contain; }
.image-preview-caption { margin: 12px 0 0; color: #667085; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
html:has(.image-preview[open]) { overflow: hidden; }
@media (max-width: 600px) {
  .image-preview { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .image-preview-heading { padding: 10px 12px; }
  .image-preview-content { padding: 10px; }
}
