/* Universal avatar geometry. This intentionally loads after square_corners.css. */
:where(
  .universal-avatar,
  [data-profile-avatar],
  [class~="avatar"],
  [class$="-avatar"],
  [class*="-avatar "],
  [class$="__avatar"],
  [class*="__avatar "],
  [class$="-avatar-fallback"],
  [class*="-avatar-fallback "],
  [class$="-avatar-placeholder"],
  [class*="-avatar-placeholder "],
  [class$="profile-photo"],
  [class*="profile-photo "],
  [class$="profile-image"],
  [class*="profile-image "],
  .profile-avatar-rect,
  .profile-sidebar-avatar-frame
):not(.profile-media-menu-shell--avatar):not(.profile-media-menu--avatar):not(.profile-media-edit-trigger--avatar) {
  aspect-ratio: 1 / 1;
  border-radius: 9999px !important;
  overflow: hidden !important;
}

:where(
  img.universal-avatar,
  img[data-profile-avatar],
  [data-profile-avatar] img,
  img[class*="avatar"],
  [class*="avatar"] img,
  img[class*="profile-photo"],
  [class*="profile-photo"] img,
  img[class*="profile-image"],
  [class*="profile-image"] img,
  .detail-uploader-row__avatar img,
  .uda-comment-avatar
) {
  aspect-ratio: 1 / 1;
  border-radius: 9999px !important;
  object-fit: cover !important;
}

:where(
  .universal-avatar,
  [data-profile-avatar],
  [class$="-avatar"],
  [class*="-avatar "],
  [class$="__avatar"],
  [class*="__avatar "],
  .profile-avatar-rect,
  .profile-sidebar-avatar-frame
) > img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 9999px !important;
  object-fit: cover !important;
}

/* The outer profile-photo ring stays circular without clipping its edit menu. */
.profile-avatar-media-shell {
  aspect-ratio: 1 / 1;
  border-radius: 9999px !important;
}

/* Documents retain square cards; only identity, status, and controls are round. */
.profile-page--documents .ms-doc-card-shell,
.profile-page--documents .ms-doc-card {
  border-radius: 0 !important;
}

.profile-page--documents .ms-doc-card-owner-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0 42px 14px 0;
}

.profile-page--documents .ms-doc-card-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 50% !important;
  background: #eef2f7;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.profile-page--documents .ms-doc-card-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50% !important;
  object-fit: cover !important;
}

.profile-page--documents .ms-doc-card-owner-name {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-page--documents .ms-doc-card-body {
  align-items: center;
  gap: 16px;
}

.profile-page--documents .ms-doc-icon {
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
  overflow: hidden;
}

.profile-page--documents :is(
  .ms-doc-inline-lock,
  .ms-doc-lock-badge,
  .ms-doc-privacy-lock,
  .ms-doc-card-menu-toggle,
  .universal-actions-trigger
) {
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
}

.profile-page--documents .ms-doc-privacy-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: rgba(153, 27, 27, 0.1);
  line-height: 1;
}

.profile-page--documents .ms-doc-privacy-badge {
  border-radius: 999px !important;
}

.profile-page--documents .ms-module-add-button {
  border-radius: 999px !important;
}

.profile-page--documents .ms-doc-card-info {
  gap: 6px;
}

@media (max-width: 640px) {
  .profile-page--documents .ms-doc-card {
    padding: 18px;
  }

  .profile-page--documents .ms-doc-card-owner-row {
    margin-bottom: 12px;
  }

  .profile-page--documents .ms-doc-card-body {
    gap: 14px;
    padding-right: 28px;
  }
}
