html.album-viewing { overflow: hidden; }
.album-viewer {
  --viewer-ink: #fdfaff;
  width: min(1080px, calc(100% - 48px));
  height: min(850px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--viewer-ink);
  background: #231e27;
  border: 1px solid #635769;
  border-radius: 16px;
}
.album-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.album-viewer::backdrop { background: rgb(20 15 24 / 85%); }
.viewer-heading, .viewer-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px clamp(12px, 3vw, 28px);
}
.viewer-heading h2 { font-size: clamp(1.05rem, 2vw, 1.5rem); line-height: 1.25; letter-spacing: -.015em; color: inherit; }
.viewer-stage { display: grid; place-items: center; min-height: 0; background: #151217; touch-action: pan-y pinch-zoom; }
.viewer-stage img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.album-viewer button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; color: inherit; border: 1px solid #75697b; border-radius: 8px;
  font: inherit; font-weight: 600; line-height: 1.2; min-height: 44px; padding: 6px 13px; cursor: pointer;
}
.album-viewer button:hover { background: #46374d; }
.album-viewer button:focus-visible { outline: 3px solid #82c9e7; outline-offset: 2px; }
.album-viewer button span { font-size: 1.5rem; font-weight: 400; line-height: 1; }
.viewer-count { color: #e6ddeb; font-variant-numeric: tabular-nums; text-align: center; }
@media (max-width: 650px), (max-height: 460px) {
  .album-viewer { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .viewer-heading { padding-top: max(8px, env(safe-area-inset-top)); }
  .viewer-controls { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: no-preference) {
  .album-viewer[open] { animation: viewer-open 150ms ease-out; }
  @keyframes viewer-open { from { opacity: .4; } }
}
