/* HNT.ROCKS: keep portrait and landscape avatars square inside their existing frames.
   Scope to known member/profile widgets so Crown decoration, presence and other media stay unchanged. */
.members-mini .hnt-crown-avatar,
.hnt-crown-avatar.member-avatar,
.hnt-crown-avatar.profile-avatar-wrap,
.hnt-crown-avatar.profile-edit-preview-avatar {
  display:block!important;
  aspect-ratio:1 / 1!important;
  flex-shrink:0!important;
  box-sizing:border-box!important;
  min-width:0;
  min-height:0;
  position:relative!important;
  isolation:isolate;
}
/* Compact cards have no explicit wrapper size without this safeguard. */
.members-mini .hnt-crown-avatar {
  width:31px!important;
  height:31px!important;
  flex:0 0 31px!important;
  border-radius:50%!important;
}
.hnt-crown-avatar.member-avatar {
  border-radius:50%!important;
}
.hnt-crown-avatar.profile-avatar-wrap,
.hnt-crown-avatar.profile-edit-preview-avatar {
  border-radius:50%!important;
}
/* Do not let portrait intrinsic height expand the grid row beyond the crown ring. */
.members-mini .hnt-crown-avatar > img,
.hnt-crown-avatar.member-avatar > img,
.hnt-crown-avatar.profile-avatar-wrap > img,
.hnt-crown-avatar.profile-edit-preview-avatar > img {
  position:absolute!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  min-width:0!important;
  min-height:0!important;
  aspect-ratio:1 / 1!important;
  object-fit:cover!important;
  object-position:center 35%!important;
  border-radius:50%!important;
  box-sizing:border-box!important;
}
/* Preserve the inner spacing of existing profile and member crown frames. */
.hnt-crown-avatar.member-avatar > img {
  top:2px!important;
  left:2px!important;
  width:calc(100% - 4px)!important;
  height:calc(100% - 4px)!important;
}
.hnt-crown-avatar.profile-avatar-wrap > img {
  top:4px!important;
  left:4px!important;
  width:calc(100% - 8px)!important;
  height:calc(100% - 8px)!important;
}
.hnt-crown-avatar.profile-edit-preview-avatar > img,
.members-mini .hnt-crown-avatar > img {
  top:0!important;
  left:0!important;
}
/* Direct <img> avatars (profile editor, profile friend tiles) share the same crop behavior. */
.profile-edit-avatar-box > img,
.profile-friend-avatar img {
  display:block!important;
  width:100%!important;
  height:100%!important;
  aspect-ratio:1 / 1!important;
  object-fit:cover!important;
  object-position:center 35%!important;
  box-sizing:border-box!important;
  border-radius:50%!important;
}
