html.image-preview-open, .image-preview-open body { overflow: hidden !important; }
.image-preview {
  position: fixed; inset: 0; margin: 0; box-sizing: border-box;
  width: 100%; height: 100dvh; max-width: none; max-height: none;
  padding: 0; border: 0; border-radius: 0; background: #111827; color: #fff;
  overflow: hidden; overscroll-behavior: contain; touch-action: pinch-zoom;
}
.image-preview[open] { display: flex; flex-direction: column; }
.image-preview::backdrop { background: #111827; }
.image-preview header { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex: none; padding: max(12px, env(safe-area-inset-top)) 12px 12px; }
.image-preview-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-preview button { flex: none; min-height: 44px; padding: 8px 16px; border: 1px solid #64748b;
  border-radius: 10px; color: #fff; background: #253249; font: inherit; cursor: pointer; }
.image-preview-content { position: relative; flex: 1; min-width: 0; min-height: 0; margin: 0 8px max(8px, env(safe-area-inset-bottom)); overflow: hidden; }
.image-preview-content img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.image-preview-content p { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; margin: 0; }
.image-preview [hidden] { display: none; }
