.image-preview-header button { flex-shrink: 0; white-space: nowrap; }
.preview-image-status { position: absolute; }
#previewMainImage { cursor: zoom-in; }
.preview-zoom { position: absolute; right: 8px; bottom: 8px; width: 44px; height: 44px; padding: 0; background: #fff; color: #222; font-size: 26px; }
.image-zoom-dialog { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: #111; color: #fff; overflow: hidden; }
.image-zoom-toolbar { height: 60px; padding: env(safe-area-inset-top, 0px) 12px 0; display: flex; justify-content: flex-end; gap: 12px; }
.image-zoom-toolbar button { flex: 0 0 44px; height: 44px; padding: 0; font-size: 28px; color: #fff; background: #333; }
#imageZoomViewport { height: calc(100% - 60px - env(safe-area-inset-top, 0px)); overflow: auto; touch-action: pan-y pinch-zoom; }
#imageZoomViewport.is-zoomed { touch-action: pan-x pan-y pinch-zoom; }
#imageZoomViewport img { display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; }
#imageZoomViewport.is-zoomed img { width: 200%; height: 200%; }
#previewMetadata { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#previewMetadata button { font-size: 12px; padding: 5px 8px; }
.history-heading { display: flex; align-items: center; justify-content: space-between; }
.history-heading h2 { font-size: 14px; }
#recentlyViewed { min-width: 0; }
#recentlyViewedList { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
#recentlyViewedList button { flex: 0 0 120px; width: 120px; padding: 4px; overflow: hidden; }
#recentlyViewedList img { display: block; width: 100%; height: 72px; object-fit: cover; }
#recentlyViewedList span { display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 920px) {
  .image-preview-dialog { width: 100%; max-width: 100vw; max-height: 100dvh; border: 0; }
  .image-preview-panel { padding: 10px; gap: 10px; }
  .preview-stage { position: relative; display: block; margin-inline: -10px; }
  .preview-image-wrap { min-height: 0; }
  .preview-stage img { height: auto; aspect-ratio: 1; max-height: 70dvh; display: block; }
  .preview-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 34px; min-height: 38px; }
  #previewPrevBtn { left: 4px; }
  #previewNextBtn { right: 4px; }
}
