/** Previous profile avatars — masonry restore grid on profile settings. */

.pav-avatar-catalog-wrap:not(.hidden) {
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  border-top: 1px solid rgb(var(--border));
}

.pav-avatar-display-wrap {
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  border-top: 1px solid rgb(var(--border));
}

.pav-avatar-current__preview {
  display: inline-block;
}

/* Flex-column masonry (balanced in profile-avatar-history.js) */
.pav-avatar-history-grid {
  --pav-avatar-history-gap: 0.625rem;
  width: 100%;
  min-width: 0;
}

.pav-avatar-history-grid.pav-avatar-history-masonry-host {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--pav-avatar-history-gap);
}

.pav-avatar-history-masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--pav-avatar-history-gap);
}

.pav-avatar-history-card {
  position: relative;
  min-width: 0;
  width: 100%;
}

.pav-avatar-history-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  width: 100%;
  padding: 0.375rem;
  padding-top: 1.625rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--muted) / 0.25);
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pav-avatar-history-item:hover,
.pav-avatar-history-item:focus-visible {
  background: rgb(var(--accent) / 0.45);
  border-color: rgb(var(--primary) / 0.45);
  outline: none;
}

.pav-avatar-history-item__delete {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  padding: 0;
  border-radius: 0.375rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--card) / 0.92);
  color: rgb(var(--muted-foreground));
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pav-avatar-history-item__delete:hover,
.pav-avatar-history-item__delete:focus-visible {
  background: rgb(var(--destructive) / 0.12);
  border-color: rgb(var(--destructive) / 0.45);
  color: rgb(var(--destructive));
  outline: none;
}

.pav-avatar-history-item__img-frame {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(var(--muted));
  border-radius: 0.375rem;
  overflow: hidden;
}

.pav-avatar-history-item__img-frame--poster {
  aspect-ratio: 2 / 3;
}

.pav-avatar-history-item__img-frame--square {
  aspect-ratio: 1 / 1;
}

.pav-avatar-history-item__img-frame--wide {
  aspect-ratio: 16 / 9;
}

.pav-avatar-history-item__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.pav-avatar-history-item__label {
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pav-avatar-history-item__date {
  font-size: 0.625rem;
  line-height: 1.2;
  color: rgb(var(--muted-foreground));
}
