.psynth-gallery-view {
  margin: 0;
}

.psynth-gallery-stage {
  display: block;
  border: 1px solid var(--strong-line);
  border-radius: 8px;
  overflow: hidden;
  background: #111923;
}

.psynth-gallery-stage img {
  display: block;
  width: 100%;
  aspect-ratio: 8 / 5;
  height: auto;
  object-fit: contain;
}

.psynth-gallery-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-block: 12px;
  text-align: center;
}

.psynth-gallery-toolbar button {
  min-width: 44px;
  min-height: 44px;
  background: var(--soft-panel);
  border: 1px solid var(--strong-line);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.psynth-gallery-toolbar button:hover {
  border-color: var(--accent);
}

.psynth-gallery-toolbar button:dir(rtl) span {
  display: inline-block;
  transform: scaleX(-1);
}

[data-gallery-caption] {
  grid-column: 2;
  overflow-wrap: anywhere;
}

[data-gallery-count] {
  display: inline-block;
  margin-inline-start: 0.45em;
  color: var(--muted);
  direction: ltr;
  white-space: nowrap;
}

.psynth-gallery-film {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 4px 10px;
}

.psynth-gallery-thumb {
  flex: 0 0 clamp(96px, 15vw, 150px);
  min-width: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.psynth-gallery-thumb img {
  display: block;
  width: 100%;
  height: auto;
  margin-block-end: 5px;
}

.psynth-gallery-thumb:hover,
.psynth-gallery-thumb[aria-current] {
  border-color: var(--accent);
  color: var(--text);
}

.psynth-gallery [data-gallery-toggle] {
  margin-block-start: 8px;
  padding-inline: 0;
  min-height: 44px;
  background: none;
  border-inline: 0;
  border-block-start: 0;
  font: inherit;
  cursor: pointer;
}

.psynth-gallery [data-gallery-toggle][hidden] {
  display: none;
}
