/* A separate top-layer content viewer; no styling or mutation of app dialogs. */
.content-photo-viewer {
  --photo-ink: #fcf8fb;
  --photo-muted: #dacbd7;
  --photo-control: #3b273b;
  position: fixed;
  inset: 0;
  z-index: 10000;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: #160f19;
  color: var(--photo-ink);
  overscroll-behavior: contain;
  overflow: hidden;
  font-family: inherit;
}
.content-photo-viewer:not([open]) { display: none; }
.content-photo-viewer::backdrop { background: #160f19; }
.content-photo-viewer .photo-viewer-shell {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.content-photo-viewer .photo-viewer-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: #211624;
}
.content-photo-viewer h2 { margin: 0; font-size: 1.125rem; color: var(--photo-ink); }
.content-photo-viewer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  box-sizing: border-box;
  margin: 0;
  padding: 9px 13px;
  border: 1px solid #806782;
  border-radius: 12px;
  background: var(--photo-control);
  color: var(--photo-ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.3;
  text-shadow: none;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.content-photo-viewer button:focus-visible { outline: 3px solid #edcf8c; outline-offset: 3px; }
.content-photo-viewer button:disabled { opacity: 0.45; cursor: default; }
.content-photo-viewer button:not(:disabled):hover { background: #513753; }
.content-photo-viewer .photo-viewer-close span { font-size: 1.45rem; line-height: 1; }
.content-photo-viewer .photo-viewer-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: auto;
  isolation: isolate;
}
.content-photo-viewer .photo-viewer-image {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  transform-origin: center center;
  -webkit-touch-callout: default;
  user-select: auto;
  -webkit-user-select: auto;
  touch-action: auto;
}
.content-photo-viewer .photo-viewer-image[hidden] { display: none; }
.content-photo-viewer .photo-viewer-stage.is-zoomed .photo-viewer-image { cursor: grab; }
.content-photo-viewer .photo-viewer-stage.is-panning .photo-viewer-image { cursor: grabbing; }
.content-photo-viewer .photo-viewer-footer {
  flex: 0 0 auto;
  box-sizing: border-box;
  max-height: 48%;
  overflow: auto;
  padding: 10px 14px 12px;
  background: #211624;
}
.content-photo-viewer .photo-viewer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.content-photo-viewer .photo-viewer-zoom { min-width: 3.1em; color: var(--photo-ink); text-align: center; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.content-photo-viewer .photo-viewer-save { background: #e8d7e5; color: #281b2c; border-color: #e8d7e5; }
.content-photo-viewer .photo-viewer-save:not(:disabled):hover { background: #f4e7f1; }
.content-photo-viewer .photo-viewer-help,
.content-photo-viewer .photo-viewer-status {
  margin: 8px auto 0;
  max-width: 68ch;
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--photo-muted);
}
.content-photo-viewer .photo-viewer-status:empty { display: none; }
.content-photo-viewer .photo-viewer-status[role="alert"] { color: #ffd0cd; }
@media (max-height: 420px) and (min-width: 560px) {
  .content-photo-viewer .photo-viewer-header { padding-top: 4px; padding-bottom: 4px; }
  .content-photo-viewer .photo-viewer-footer { padding-top: 4px; padding-bottom: 4px; }
  .content-photo-viewer .photo-viewer-help { font-size: 0.75rem; margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .content-photo-viewer *, .content-photo-viewer *::before, .content-photo-viewer *::after { animation: none; transition: none; }
}
