body.image-preview-open { overflow: hidden; }
#image-preview {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  border-radius: 0; background: #111; color: #fff; box-shadow: none;
}
#image-preview[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
#image-preview::backdrop { background: #111; }
#image-preview .image-preview-toolbar {
  display: flex; align-items: center; gap: 12px; min-height: 56px;
  padding: max(6px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  background: #202020; font-size: 14px;
}
#image-preview .image-preview-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#image-preview a { color: #fff; white-space: nowrap; padding: 10px 0; }
#image-preview button { min-height: 44px; padding: 8px 14px; background: #333; color: #fff; border: 1px solid #666; }
#image-preview :is(a, button):focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#image-preview .image-preview-stage { position: relative; min-width: 0; min-height: 0; padding: 0; }
#image-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
#image-preview img[hidden] { display: none; }
#image-preview [role="status"] { position: absolute; inset: 0; margin: 0; padding: 24px; display: grid; place-items: center; text-align: center; color: #fff; }
#image-preview [role="status"][hidden] { display: none; }
@media print { body.image-preview-open { overflow: visible; } #image-preview[open] { display: none !important; } }
