/* Full-screen image inspection. These rules intentionally upscale small native captures. */
html.rcw-gallery-open { overflow: hidden; }
.rcw-image-gallery {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: var(--surface-solid, #faf9f4);
  color: var(--text, #171b24);
  overflow: hidden;
}
.rcw-image-gallery[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
.rcw-image-gallery::backdrop { background: var(--surface-solid, #faf9f4); backdrop-filter: none; }
.rcw-image-gallery .gallery-toolbar { display: flex; align-items: center; min-height: 44px; gap: 16px; padding: 0; }
.rcw-image-gallery .gallery-title { font: 750 1rem/1.3 var(--font-body, sans-serif); }
.rcw-image-gallery .gallery-counter { margin-left: auto; color: var(--muted, #596375); font: 650 .9rem/1.3 var(--font-body, sans-serif); font-variant-numeric: tabular-nums; }
.rcw-image-gallery .gallery-viewer { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; margin: 0; gap: 12px; }
.rcw-image-gallery .gallery-image-stage { position: relative; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.rcw-image-gallery .gallery-dialog-image {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: contain;
  image-rendering: auto;
  clip-path: none;
}
.rcw-image-gallery[data-kind='screenshot'] .gallery-dialog-image { image-rendering: pixelated; }
.rcw-image-gallery[data-kind='label'] .gallery-dialog-image { clip-path: inset(0 round var(--artwork-corner-radius, 12px)); }
.rcw-image-gallery[data-kind='box'] .gallery-dialog-image { clip-path: inset(0 round 3%); }
.rcw-image-gallery .gallery-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong, #727a89);
  border-radius: 50%;
  color: var(--text, #171b24);
  background: var(--surface-solid, #faf9f4);
  box-shadow: 0 4px 18px rgb(0 0 0 / .14);
  font: 500 1.9rem/1 var(--font-body, sans-serif);
  cursor: pointer;
}
.rcw-image-gallery .gallery-control[hidden] { display: none; }
.rcw-image-gallery .gallery-control:hover { border-color: currentColor; }
.rcw-image-gallery .gallery-control:focus-visible { outline: 3px solid var(--text, #171b24); outline-offset: 3px; }
.rcw-image-gallery .gallery-close { position: static; }
.rcw-image-gallery .gallery-previous,
.rcw-image-gallery .gallery-next { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); }
.rcw-image-gallery .gallery-previous { left: 8px; }
.rcw-image-gallery .gallery-next { right: 8px; }
.rcw-image-gallery .gallery-dialog-caption { max-width: 80ch; min-height: 1.4em; margin: 0 auto; color: var(--muted, #596375); font: 500 .9rem/1.5 var(--font-body, sans-serif); text-align: center; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .rcw-image-gallery[open] { gap: 8px; }
  .rcw-image-gallery .gallery-toolbar { gap: 10px; }
  .rcw-image-gallery .gallery-control { width: 44px; height: 44px; }
  .rcw-image-gallery .gallery-previous { left: 0; }
  .rcw-image-gallery .gallery-next { right: 0; }
  .rcw-image-gallery .gallery-dialog-caption { font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .rcw-image-gallery *, .rcw-image-gallery *::before, .rcw-image-gallery *::after { animation: none; transition: none; }
}
