.avatar-art[data-atlas] {
  background-size: var(--avatar-sheet-size, 400%) var(--avatar-sheet-height, 300%);
}
.avatar-art[data-atlas="cinema-masters"] { background-image: url('/art/avatars-cinema-masters.webp'); }
.avatar-art[data-atlas="cinema-faces"] { background-image: url('/art/avatars-cinema-faces.webp'); }
.avatar-art[data-atlas="cinema-friends"] { background-image: url('/art/avatars-cinema-friends.webp'); }
.avatar-art[data-atlas="abstract-earth"] { background-image: url('/art/avatars-abstract-earth.webp'); }
.avatar-art[data-atlas="abstract-weather"] { background-image: url('/art/avatars-abstract-weather.webp'); }
.avatar-art[data-atlas="abstract-cosmos"] { background-image: url('/art/avatars-abstract-cosmos.webp'); }
.avatar-art[data-atlas="abstract-street"] { background-image: url('/art/avatars-abstract-street.webp'); }
.avatar-art[data-atlas="abstract-electric"] { background-image: url('/art/avatars-abstract-electric.webp'); }
.avatar-art[data-atlas="meme-faces"] { background-image: url('/art/avatars-meme-faces.webp'); }
.avatar-art[data-atlas="meme-reactions"] { background-image: url('/art/avatars-meme-reactions.webp'); }
.avatar-art[data-atlas="meme-workers"] { background-image: url('/art/avatars-meme-workers.webp'); }
.avatar-art[data-atlas="meme-stunned"] { background-image: url('/art/avatars-meme-stunned.webp'); }
.avatar-art[data-atlas="meme-classic-v2"] { background-image: url('/art/avatars-meme-classic-v2.webp'); }

.avatar-categories {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.avatar-categories legend {
  margin-bottom: .35rem;
  padding: 0;
  font-weight: 700;
}
.avatar-category-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .3rem;
}
.avatar-category-choice {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  min-height: var(--control-height);
  padding: .3rem .1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-action);
  background: var(--background);
  color: var(--muted);
  font-size: .82rem;
  white-space: nowrap;
  cursor: pointer;
}
.avatar-category-choice input {
  min-height: 0;
  padding: 0;
}
.avatar-category-choice:has(input:checked) {
  background: var(--selected-surface);
  border-color: var(--selected-edge);
  color: var(--accent);
  font-weight: 700;
}
.avatar-category-choice:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.appearance-choice .choice-frame {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}
.appearance-choice .choice-frame .avatar-art {
  width: 100%;
  max-width: 3.8rem;
}
.appearance-choice > .choice-name {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
#profileDialog[open] {
  --profile-dialog-padding: 1rem;
  max-height: min(92dvh, 43rem);
}
.profile-form .profile-save-actions {
  position: sticky;
  bottom: calc(-1 * var(--profile-dialog-padding));
  padding-block: .45rem .6rem;
  background: var(--surface);
  z-index: 1;
}
.profile-save-actions button {
  width: 100%;
}
@media (max-height: 700px) {
  #profileDialog[open] {
    --profile-dialog-padding: .75rem;
    padding-block: var(--profile-dialog-padding);
  }
  #profileDialog > h2 {
    margin-bottom: .45rem;
  }
  .profile-form {
    gap: .55rem;
    margin-top: .4rem;
  }
  .profile-form .profile-editor-identity .profile-appearance {
    width: 3.45rem;
  }
  .profile-form .profile-editor-identity .avatar-art {
    width: 3.25rem;
  }
  .profile-form .appearance-rail {
    grid-auto-columns: clamp(4.5rem, 25%, 5.5rem);
  }
  .profile-form .appearance-choice .choice-frame .avatar-art {
    max-width: 3.25rem;
  }
}
@media (max-height: 600px) {
  .profile-form { gap: .4rem; }
  .appearance-picker .choice-frame { max-height: 3.45rem; }
  .profile-form .profile-save-actions { padding-block: .36rem .48rem; }
}
