.king-photo-viewer { position:fixed; inset:0; width:calc(100% - 32px); max-width:1440px; height:calc(100dvh - 32px); max-height:none; margin:auto; padding:0; border:1px solid var(--memory-control-edge); border-radius:16px; background:var(--memory-page); color:var(--memory-ink); box-sizing:border-box; overflow:hidden; }
.king-photo-viewer[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; }
.king-photo-viewer::backdrop { background:rgba(8,9,11,.88); }
.king-photo-viewer > header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 16px; border-bottom:1px solid var(--memory-edge); background:var(--memory-surface); }
.king-photo-viewer h2 { margin:0; min-width:0; color:inherit; font-size:16px; line-height:1.5; overflow-wrap:anywhere; }
.king-photo-viewer > header > div { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:10px; flex:0 1 auto; }
.king-photo-viewer button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:9px 14px; border:1px solid var(--memory-control-edge); border-radius:10px; background:var(--memory-surface); color:var(--memory-ink); font:inherit; font-size:14px; line-height:1.5; cursor:pointer; }
.king-photo-viewer button:not(:disabled):hover { border-color:var(--memory-focus); background:var(--memory-hover); }
.king-photo-viewer button:focus-visible { outline:2px solid var(--memory-focus); outline-offset:2px; }
.king-photo-viewer button:disabled { opacity:.4; cursor:default; }
.king-photo-viewer .king-photo-close { width:44px; flex:0 0 44px; padding:0; font-size:28px; }
.king-photo-stage { display:flex; min-width:0; min-height:0; padding:16px; box-sizing:border-box; overflow:auto; scrollbar-color:var(--memory-muted) var(--memory-page); cursor:grab; user-select:none; }
.king-photo-stage.is-dragging { cursor:grabbing; }
.king-photo-stage:focus-visible { outline:2px solid var(--memory-focus); outline-offset:-3px; }
.king-photo-viewer[data-photo-sizing=fit] .king-photo-stage { display:grid; place-items:center; }
.king-photo-artwork { flex:0 0 auto; max-width:none; min-width:0; margin:auto; }
.king-photo-artwork img { -webkit-user-drag:none; }
.king-photo-scale-controls { display:flex; align-items:center; gap:4px; }
.king-photo-scale-controls button { width:44px; padding:0; font-size:22px; }
.king-photo-viewer .king-photo-artwork .king-gallery-imgs { display:block; position:relative; width:100%; height:auto; min-height:0; padding:0; }
.king-photo-artwork .king-studio-memory-mount { width:100%; margin:0; }
.king-photo-artwork .king-studio-photo { display:block; width:100%; }
.king-photo-artwork img.gallery-img,.king-photo-artwork > img { display:block; width:100% !important; height:auto !important; max-height:none !important; max-width:100%; margin:0; object-fit:contain; }
.king-photo-artwork > .king-designed-memory { margin:0; width:100%; max-width:none; }
.king-photo-viewer > nav { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:10px 20px; padding:12px 16px; background:var(--memory-surface); border-top:1px solid var(--memory-edge); }
.king-photo-viewer > nav[hidden] { display:none; }
.king-photo-viewer > nav button { min-width:120px; }
.king-photo-viewer output { min-width:60px; text-align:center; font-size:14px; font-variant-numeric:tabular-nums; }
.king-photo-pan-hint { flex:1 1 100%; text-align:center; color:var(--memory-muted); font-size:13px; }
.king-photo-pan-hint[hidden] { display:none; }
@media(max-width:600px) {
  .king-photo-viewer { width:100%; height:100dvh; border-radius:0; border:0; }
  .king-photo-viewer > header { flex-wrap:wrap; gap:10px; padding:10px 12px; }
  .king-photo-viewer h2 { flex:1 1 100%; font-size:15px; }
  .king-photo-viewer > header > div { flex:1 1 100%; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px; }
  .king-photo-scale-controls { grid-column:1 / 3; }
  .king-photo-viewer .king-photo-close { grid-column:3; grid-row:1; }
  .king-photo-sizing { grid-column:1; min-width:0; }
  .king-photo-original { grid-column:2 / 4; min-width:0; }
  .king-photo-viewer > nav { gap:10px; padding:10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .king-photo-viewer > nav button { flex:1; min-width:0; }
}
