.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
}

.gallery[data-align='end'] {
  justify-content: flex-end;
  align-self: flex-end;
}

.gallery[data-align='start'] {
  justify-content: flex-start;
  align-self: flex-start;
}

.frame {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--dsw-alias-border-l2-darkmode-thin);
  border-radius: 16px;
  background: var(--dsw-alias-interactive-bg-hover);
  cursor: zoom-in;
}

.frame[data-variant='tile'] {
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
}

.frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loading,
.error {
  color: var(--dsw-alias-label-tertiary);
  font-size: 12px;
  line-height: 18px;
}

.error {
  max-width: 240px;
  padding: 10px 12px;
  border: 1px solid var(--dsw-alias-border-l2-darkmode-thin);
  border-radius: 10px;
  background: var(--dsw-alias-interactive-bg-hover-danger);
  cursor: pointer;
}

/* A failed tile keeps the 64px grid cell instead of growing to its copy. */
.error[data-variant='tile'] {
  width: 64px;
  height: 64px;
  padding: 4px;
  overflow: hidden;
  border-radius: 16px;
}
