.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--avatar-size, 40px);
  height: var(--avatar-size, 40px);
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-tint);
  color: var(--color-primary-text);
  overflow: hidden;
  isolation: isolate;
}

.avatar--ring {
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-primary-graphic);
}

.avatar__fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.avatar__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 読み込み完了まで下の代替表示が見えるようにする */
  background: var(--color-primary-subtle);
}

.avatar__initial {
  font-size: calc(var(--avatar-size) * 0.44);
  font-weight: var(--weight-bold);
  line-height: 1;
}

.avatar--xs .avatar__initial {
  font-size: 11px;
}
