.detail-layout:has(.keep-gallery) { align-items: start; }
.keep-gallery { min-width: 0; }
.keep-gallery__frame {
  display: block;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: zoom-in;
}
.keep-gallery__frame img { width: 100%; height: 100%; object-fit: contain; }
.keep-gallery__frame img.is-pixel { image-rendering: pixelated; }
.keep-gallery figcaption { margin-block: 8px 12px; color: var(--muted); font-size: .9rem; }
.keep-gallery__choices:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.keep-gallery__choices button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 44px;
  min-width: 0;
  padding: 3px 3px 5px;
  color: var(--cream);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  font: inherit;
  font-size: .82rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.keep-gallery__choices img { aspect-ratio: 2 / 1; object-fit: cover; }
.keep-gallery__choices button:hover { border-color: var(--gold); }
.keep-gallery__choices button[aria-pressed=true] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--night);
  font-weight: 700;
}
@media (max-width: 380px) {
  .keep-gallery__choices:not([hidden]) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
