/* High-resolution originals are measured inside a definite stage, never used as its intrinsic minimum size. */
.pimg-viewer { width: min(1400px, calc(100vw - 40px)); height: min(1000px, calc(100vh - 40px)); height: min(1000px, calc(100dvh - 40px)); min-width: 0; min-height: 0; border: 1px solid rgba(204,223,246,.15); box-shadow: 0 32px 100px rgba(0,0,0,.38); }
.pimg-viewer header, .pimg-viewer footer { flex: 0 0 auto; }
.pimg-viewer header { padding: 12px 16px; border-bottom: 1px solid rgba(212,228,246,.08); }
.pimg-viewer header strong { font-weight: 600; }
.pimg-viewer-tools { flex-wrap: wrap; justify-content: flex-end; }
.pimg-viewer-tools .pimg-icon { width: 44px; height: 44px; min-width: 44px; border-radius: 12px; color: #d5e4f7; }
.pimg-viewer-tools .pimg-icon:focus-visible, .pimg-nav:focus-visible { outline: 2px solid #83b8f6; outline-offset: 2px; }
.pimg-zoom { min-width: 58px; }
.pimg-measured-stage { flex: 1 1 0; width: 100%; min-width: 0; min-height: 0; background: radial-gradient(ellipse at 50% 45%, #1c293c, #0d1725 90%); }
.pimg-measured-stage > img { position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; object-fit: contain; transform-origin: center; transition: none; pointer-events: none; filter: none; }
.pimg-image-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #b6c7dc; padding: 24px; text-align: center; font-size: 13px; }
.pimg-image-state p { margin: 0; color: #839bb7; }
.pimg-image-state button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; border: 1px solid #8eadd146; border-radius: 12px; background: #ffffff0a; color: #d7e9ff; padding: 10px 15px; cursor: pointer; font: inherit; }
.pimg-viewer footer { border-top: 1px solid rgba(212,228,246,.08); padding: 11px 16px; }
.atelier-photo-original { position: relative; overflow: hidden; }
.atelier-photo-original > .pimg-measured-stage { position: absolute; inset: 0; height: 100%; }
.pimg .pimg-thumb img { object-fit: contain; }
@media (max-width: 720px) {
  .pimg-viewer-backdrop { padding: 0 !important; }
  .pimg-viewer { width: 100vw; height: 100vh; height: 100dvh; border: 0; border-radius: 0; }
  .pimg-viewer header { gap: 8px; padding: 10px 10px 8px; }
  .pimg-viewer header > div:first-child { flex-basis: 100%; }
  .pimg-viewer header strong { font-size: 14px; }
  .pimg-viewer header span { font-size: 11px; line-height: 1.5; }
  .pimg-viewer-tools { width: 100%; justify-content: flex-start; gap: 1px; }
  .pimg-viewer-tools .pimg-icon { width: 40px; min-width: 40px; height: 44px; }
  .pimg-viewer footer { gap: 6px; padding: 9px 10px max(9px, env(safe-area-inset-bottom)); }
  .pimg-viewer footer .pimg-trash-note { display: none; }
  .pimg-nav.prev { left: 6px; } .pimg-nav.next { right: 6px; }
}

.pimg-measured-stage .pimg-nav { background: rgba(13,28,46,.68); border:1px solid rgba(211,231,255,.18); backdrop-filter:blur(8px); }
