/*
 * Universal shape policy.
 *
 * MaxSportsure cards and media use pointed corners. Controls and labels use
 * rounded geometry, while avatars and intentional icon controls are circles.
 *
 * The repeated :not() IDs deliberately give this final policy enough
 * specificity to beat legacy component rules that also use !important.
 */

:root {
  --ms-control-radius: 14px;
  --ms-pill-radius: 999px;
  --ms-circle-radius: 50%;
  --ms-panel-radius: 20px;
}
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  *,
  *::before,
  *::after
) {
  border-radius: 0 !important;
}

/* Standard form and search controls are rounded, but remain distinct from pills. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
  input[type="search"],
  select,
  textarea,
  [contenteditable="true"][role="textbox"],
  [class*="search-field"],
  [class*="search-input"],
  .watch-clock-control__inputs,
  [data-ui-control]
) {
  border-radius: var(--ms-control-radius) !important;
}

/* Buttons and button-like links remain pills. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  input[type="image"],
  [role="button"],
  [role="tab"],
  [aria-pressed],
  [data-selectable-control],
  a[class*="btn"],
  a[class*="button"],
  .media-album-card__empty-add-overlay,
  a[class*="pill"],
  a[class*="filter"],
  a[class*="chip"],
  a[class~="tab"],
  a[class$="-tab"],
  a[class*="-tab "],
  a[class*="-tab--"],
  a[class*="-tab-link"],
  a[class$="__tab"],
  a[class*="__tab "],
  a[class*="__tab--"],
  a[class*="__tab-link"],
  a[class*="action-link"],
  a[class$="__add"],
  a[class*="__add "],
  a[class*="__add--"],
  a[class$="-add"],
  a[class*="-add "],
  a[class*="-add--"],
  a[rel="prev"],
  a[rel="next"],
  [class*="pagination"] > a,
  label[class*="btn"],
  label[class*="button"],
  label[class*="pill"],
  .story-create-upload__trigger
) {
  border-radius: 999px !important;
}

/* Labels, privacy states, category peels, and user-type badges are pills. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  [class*="privacy-badge"],
  [class*="visibility-badge"],
  [class*="status-badge"],
  .media-post-grid--highlights .media-post-card__placeholder-label,
  [class*="public-badge"],
  [class*="private-badge"],
  [class*="category-peel"],
  [class*="category-badge"],
  [class*="user-type-badge"],
  [data-privacy-badge],
  .recommendation-detail-pill,
  .roster-guide-card__number-badge,
  .roster-player-thumb-card__number,
  .recommendation-detail-tag,
  [data-category-peel]
) {
  border-radius: var(--ms-pill-radius) !important;
}

/* Thumbnail labels share one compact pill treatment across modules and viewports. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .feed-thumb-type,
  .feed-card-post-type-overlay,
  .popular-card-media-type,
  .drill-sport-peel,
  .facility-category-peel
) {
  min-height: 0 !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  clip-path: none !important;
}

/* Toggle and switch tracks use the same pill geometry as other controls. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  [class*="toggle"],
  [class~="switch"],
  [class$="-switch"],
  [class*="-switch "],
  [class$="__switch"],
  [class*="__switch "],
  [role="switch"],
  [data-toggle]
) {
  border-radius: var(--ms-pill-radius) !important;
}

/* Filter controls are intentionally pill-shaped, even when implemented as links. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  [class*="filter-pill"],
  [class*="filter"][class*="pill"],
  [data-filter-pill],
  [role="tab"][class*="pill"]
) {
  border-radius: 999px !important;
}

/* Only the Profile Home user-type label is an intentional badge. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  body.profile-home-shell .profile-header--universal.profile-header--with-banner .profile-user-type
) {
  border-radius: 999px !important;
  font-size: 9px !important;
  padding: 2px 7px !important;
}

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  body.profile-home-shell .profile-header--universal.profile-header--with-banner .profile-user-type-text
) {
  font-size: 9px !important;
}

/* The labeled cover-photo control is a pill on every viewport. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .profile-media-edit-trigger--banner
) {
  border-radius: var(--ms-pill-radius) !important;
}

/* Comment entry controls keep their comfortable rounded treatment. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  input[class*="comment"],
  textarea[class*="comment"],
  [class*="comment-input-shell"],
  [data-comment-input],
  input[placeholder*="comment" i],
  textarea[placeholder*="comment" i]
) {
  border-radius: 999px !important;
}

/* Profile identities remain circular. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .profile-avatar-media-shell,
  .profile-header--universal .profile-universal-info-left,
  .profile-header--universal .profile-avatar-rect--athlete-shell,
  .profile-header--universal .profile-avatar-rect--athlete-shell img,
  [class~="avatar"],
  [class$="-avatar"],
  [class*="-avatar "],
  [class$="__avatar"],
  [class*="__avatar "],
  [class*="avatar--"],
  [class*="avatar-rect"],
  [data-profile-avatar]
) {
  border-radius: 50% !important;
  aspect-ratio: 1 / 1;
  overflow: hidden !important;
}

/* Keep avatar edit controls outside the circular crop. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .profile-avatar-media-shell,
  .profile-header--universal .profile-universal-info-left
) {
  overflow: visible !important;
}

/* Avatar images keep a true circular crop instead of stretching in wrappers. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  img[class~="avatar"],
  img[class$="-avatar"],
  img[class*="-avatar "],
  img[class$="__avatar"],
  img[class*="__avatar "],
  img[class*="avatar--"],
  img[class*="avatar-rect"],
  img[data-profile-avatar],
  [data-profile-avatar] img,
  [class~="avatar"] > img,
  [class$="-avatar"] > img,
  [class*="-avatar "] > img,
  [class$="__avatar"] > img,
  [class*="__avatar "] > img
) {
  border-radius: var(--ms-circle-radius) !important;
  aspect-ratio: 1 / 1;
  object-fit: cover !important;
}

/* Explicit icon-only/circular controls remain circles. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  [class*="icon-button"],
  [class*="icon-btn"],
  [class*="circle-button"],
  [class*="circular-button"],
  [class*="play-button"],
  [class*="play-overlay"],
  .ms-video-play-overlay,
  [class*="close-button"],
  [class*="close-btn"],
  [class*="back-button"][class*="icon"],
  [class*="action-menu-trigger"],
  [class*="lock-badge"],
  [class*="lock-icon"],
  /* Profile type text is not a file-type icon ("profile-type" contains "file-type"). */
  [class*="file-type"]:not([class*="profile-type"]),
  [class*="file-icon"],
  [class*="icon-badge"],
  .profile-header-name-edit,
  .universal-actions-trigger,
  .settings-back,
  [data-circular-control],
  [data-actions-trigger],
  [aria-label="More actions"],
  [aria-label="More options"]
) {
  border-radius: 50% !important;
  aspect-ratio: 1 / 1;
}

/* Documents keep square cards while rounding only their internal symbols. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .profile-page--documents .ms-doc-icon,
  .profile-page--documents .ms-doc-inline-lock,
  .profile-page--documents .ms-doc-lock-badge,
  .profile-page--documents .ms-doc-privacy-lock,
  .profile-page--documents .ms-doc-card-menu-toggle,
  .profile-page--documents .universal-actions-trigger
) {
  border-radius: 50% !important;
}

/*
 * Switch User is an intentional exception to the square-card policy: its
 * category choices are controls, and its current-profile marker is a radio.
 * Keep these overrides here so they win over the universal reset above.
 */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) body.select-user-page :where(
  .users-category-card
) {
  border-radius: 16px !important;
}

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) body.select-user-page :where(
  .users-active-dot
) {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 2px solid #cfd7e3;
  border-radius: 50% !important;
  background: #fff;
}

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) body.select-user-page .users-active-dot::after {
  width: 10px;
  height: 10px;
  border-radius: 50% !important;
  background: #111827;
  content: "";
  opacity: 0;
}

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) body.select-user-page .users-active-dot.is-active {
  border-color: #111827;
  background: #fff;
}

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) body.select-user-page .users-active-dot.is-active::after {
  opacity: 1;
}

/* Document visibility badges and the add action are intentional pills. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .profile-page--documents .ms-doc-privacy-badge,
  .profile-page--documents .ms-module-add-button,
  .hof-list-page .ms-module-add-button
) {
  border-radius: 999px !important;
}

/* Podcast episode filters and form fields are intentionally rounded. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .profile-page--episodes .podcast-filter-form select,
  .podcast-episode-form input:not([type="hidden"]):not([type="checkbox"]),
  .podcast-episode-form select,
  .podcast-episode-form textarea
) {
  border-radius: 14px !important;
}

/* Podcast episode actions and metadata peels remain pills. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .profile-page--episodes .ms-module-add-button,
  .profile-page--episodes .podcast-episode-add-btn,
  .podcast-episode-form button,
  .podcast-detail-page .podcast-detail-badge,
  .podcast-detail-page .podcast-category-peel
) {
  border-radius: 999px !important;
}

/* Episode overflow menus and form close controls are intentional circles. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .profile-page--episodes .universal-actions-trigger,
  .module-form-page:has(.podcast-episode-form) .module-form-close,
  .podcast-episode-form .podcast-guest-modal-close
) {
  border-radius: 50% !important;
}

/* Utility panels are rounded; the default square content-card policy stays intact.
 * Use explicit utility classes, never generic card or post selectors.
 * Do not clip overflow here: menus, focus rings and upload controls must remain usable.
 */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .module-form-card,
  .profile-add-edit-card,
  .add-edit-card,
  .settings-page,
  .settings-page-shell,
  .settings-title-card,
  .settings-section-card,
  .settings-information-card,
  .settings-form,
  .my-account-content-card,
  .ms-edit-section,
  .ms-edit-card,
  .sports-card-settings-section,
  .sports-card-entry-card,
  .modal-content,
  .modal-panel,
  .dialog-panel,
  .ms-confirm-card,
  .site-access-row,
  .site-access-empty,
  .universal-share-modal__card,
  .universal-actions-dropdown,
  .search-panel,
  .notifications-shell,
  .notifications-content,
  .timeline-module-menu,
  .messages-page-shell > .messages-card,
  .timeline-story-header,
  .timeline-story-rail,
  .timeline-story-header__actions,
  [data-ui-panel]
) {
  border-radius: var(--ms-panel-radius) !important;
}

/* Painted headers follow the enclosing panel, without clipping its contents. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .module-form-header,
  .profile-add-edit-card-header,
  .universal-share-modal__header
) {
  border-radius: var(--ms-panel-radius) var(--ms-panel-radius) 0 0 !important;
}

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .desktop-left-menu-link,
  .desktop-left-menu-label,
  .settings-item,
  .ms-edit-list .ms-row,
  .timeline-module-menu__section,
  .timeline-module-menu__link,
  .universal-share-option,
  .profile-about-shell .about-link
) {
  border-radius: var(--ms-control-radius) !important;
}

/* Site Access white utility surfaces follow the shared panel/control language. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .site-access-row__icon
) {
  border-radius: var(--ms-control-radius) !important;
}

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .site-access-row__pin-wrap
) {
  border-radius: var(--ms-pill-radius) !important;
}

/* Compact badges and upload icons retain circular geometry. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .site-access-row__pin-order,
  .story-create-upload__icon
) {
  border-radius: var(--ms-circle-radius) !important;
}

/* Utility rows and menu actions are not regular content posts. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .universal-action-item,
  .notification-item,
  .notification-row,
  .notification-item__link,
  .notification-card,
  .timeline-hub-tab,
  .timeline-hub-manage,
  .top-user-card__rank,
  .top-user-card__trophy
) {
  border-radius: var(--ms-control-radius) !important;
}

/* Training Log media and timeline marker, not the surrounding content cards. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .training-log-session-media__thumb,
  .training-log-day-nav,
  .training-log-session-media__thumb img,
  .training-log-session-media__thumb video
) {
  border-radius: var(--ms-control-radius) !important;
}
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :is(.training-log-timeline-dot, .food-journal-timeline-dot) {
  border-radius: var(--ms-circle-radius) !important;
}

/* Round the painted Add Story surface and center the plus, not the whole rail. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .timeline-story-circle--add .timeline-story-circle__ring,
  .timeline-story-circle--add .timeline-story-circle__avatar
) {
  border-radius: var(--ms-circle-radius) !important;
}
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .timeline-story-circle--add .timeline-story-circle__avatar
) {
  display: grid !important;
  place-items: center !important;
}

/* Icon-only overflow triggers keep their hit area and keyboard focus outline. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .universal-actions-trigger,
  .universal-actions-trigger:hover,
  .universal-actions-trigger:focus,
  .universal-actions-trigger:active
) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Universal thumbnail action controls. Permission checks remain in templates/views. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) .universal-actions-menu--card {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  bottom: auto !important;
  left: auto !important;
  margin: 0 !important;
  transform: none !important;
}
/* Media/Documents already position an outer thumbnail-action wrapper. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :is(.card-thumbnail-action, .card-action-top-right) {
  top: 12px !important;
  right: 12px !important;
}
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :is(.card-thumbnail-action, .card-action-top-right) > .universal-actions-menu--card {
  position: static !important;
}
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) .universal-actions-menu--card > .universal-actions-trigger {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: var(--ms-circle-radius) !important;
  background: #fff !important;
  border: 1px solid #000 !important;
  color: #000 !important;
  font: 800 20px/1 Arial, sans-serif !important;
  box-shadow: none !important;
  transform: none !important;
}
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) .universal-actions-menu--card > .universal-actions-trigger:focus-visible {
  outline: 2px solid #2563eb !important;
  outline-offset: 2px !important;
}

/* Navigation tooltip backgrounds, not the icons they describe. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .desktop-left-menu-link[data-tooltip]
)::after {
  border-radius: var(--ms-control-radius) !important;
}

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .timeline-module-button,
  .championship-thumb-media .championship-level-badge,
  .timeline-story-circle--add,
  .timeline-story-circle--add .timeline-story-circle__name,
  .profile-edit-button
) {
  border-radius: var(--ms-pill-radius) !important;
}

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .module-form-close,
  .profile-add-edit-card-close,
  .add-edit-close,
  .universal-share-modal__close,
  .universal-share-modal__back
) {
  border-radius: var(--ms-circle-radius) !important;
}

/* Messages utility surfaces: shape only, preserving layout and interaction areas. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) .messages-page-shell :is(
  .messages-card, .thread-header-card, .thread-messages-panel, .thread-composer,
  .thread-participants-panel
) { border-radius: var(--ms-panel-radius) !important; }

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) .messages-page-shell :is(
  .messages-list-row, .thread-composer-input-row, .thread-compose-input,
  .message-bubble, .message-rich-post-card, .message-shared-card, .message-media-card,
  .message-document-access-card, .thread-share-preview, .thread-media-preview-card,
  .thread-reply-preview, .thread-empty-state, .thread-form-errors,
  .thread-emoji-menu, .message-reaction-menu, .thread-participants-row,
  .messages-new-page .message-recipient
) { border-radius: var(--ms-control-radius) !important; }

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) .messages-page-shell :is(
  .messages-search-input, .thread-send, .message-date-divider > span,
  .message-reaction-chip, .message-shared-card-btn, .message-interaction-button,
  .messages-new, .messages-compose-submit, .message-rich-post-card__type
) { border-radius: var(--ms-pill-radius) !important; }

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) .messages-page-shell :is(
  .thread-attachment-button, .thread-header-back, .messages-compose-button,
  .thread-participants-close, .thread-media-preview-remove, .thread-lightbox-close,
  .messages-new-page .message-check
) { border-radius: var(--ms-circle-radius) !important; }

/* Keep native checkbox semantics/multi-selection, with a circular visual control. */
.messages-new-page .message-check {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border: 2px solid #94a3b8;
  background: #fff;
  cursor: pointer;
}
.messages-new-page .message-check:checked {
  border-color: #111827;
  background: #111827 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 10 3 3 7-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
}
.messages-new-page .message-check:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}
@media (forced-colors: active) {
  .messages-new-page .message-check:checked {
    background: Highlight;
    border-color: Highlight;
    box-shadow: inset 0 0 0 4px Canvas;
    forced-color-adjust: none;
  }
}

/* Clip previews themselves, not panels containing menus or keyboard focus. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) .messages-page-shell :is(
  .message-rich-post-card, .message-shared-card, .message-media-card, .thread-media-preview-card
) { overflow: hidden; }

/* Story media can be clickable without inheriting the generic button pill crop. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :is(
  .timeline-story-media > img, .timeline-story-media > video, .timeline-story-design__image,
  .timeline-story-design, .timeline-story-shared-card, .timeline-story-menu
) { border-radius: var(--ms-panel-radius) !important; }

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :is(
  .timeline-story-circle--own .timeline-story-circle__ring,
  .timeline-story-circle--own .timeline-story-circle__avatar,
  .timeline-story-circle--own .timeline-story-circle__avatar img,
  .timeline-story-menu__item
) { border-radius: var(--ms-control-radius) !important; }

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :is(
  .timeline-story-close, .timeline-story-menu-button
) { border-radius: var(--ms-circle-radius) !important; }

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) .timeline-story-cta {
  border-radius: var(--ms-pill-radius) !important;
}

/* Food Journal display utility controls and small meal thumbnails. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) .detail-page-shell--food-journal :is(
  .food-journal-day-nav,
  .food-journal-display-header__meta .detail-badge,
  .food-journal-card-action,
  .food-journal-media-thumb
) { border-radius: var(--ms-control-radius) !important; }

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) .detail-page-shell--food-journal .food-journal-media-thumb {
  overflow: hidden;
}

/* Bio highlights are pills; keep the surrounding content card rectangular. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) .bio-page .bio-highlight-chip {
  border-radius: var(--ms-pill-radius) !important;
}

/* Athletic Card utility UI: reuse site radii without rounding evidence media. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .ath-card-page .athletic-card-secondary-action,
  .ath-card-page .athletic-card-academics-link,
  .ath-card-page .athletic-card-film-tab,
  .ath-card-page .athletic-card-metric-menu-trigger,
  .ath-card-page .ath-btn,
  .profile-information-shell-card--athlete .universal-image-upload__change
) { border-radius: var(--ms-control-radius) !important; }

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .ath-media-modal-dialog,
  .profile-information-shell-card--athlete,
  .profile-information-shell-card--athlete .profile-quick-info-image-section
) { border-radius: var(--ms-panel-radius) !important; }

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .ath-card-page .athletic-card-hero-photo-wrap,
  .ath-card-page .athletic-card-hero-photo,
  .ath-card-page .metric-history-proof-thumb,
  .ath-card-page .metric-history-proof-thumb img,
  .profile-information-shell-card--athlete .universal-image-upload__shell,
  .profile-information-shell-card--athlete .universal-image-upload__preview
) { border-radius: var(--ms-control-radius) !important; }

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .ath-media-modal-close,
  .ath-metric-pin-control input[type="checkbox"],
  .metric-proof-lightbox-close,
  .ms-form-close,
  .profile-information-shell-card--athlete .ms-form-close
) { border-radius: var(--ms-circle-radius) !important; }

:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .ath-card-page .metric-detail-proof-panel,
  .ath-card-page .metric-detail-proof-panel img,
  .ath-card-page .metric-detail-proof-panel video
) { border-radius: 0 !important; }

/* Events use the shared control radius for date badges and numeric stats. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .events-wrap .events-card-date-badge,
  .events-detail-page .uda-action-count-value,
  .events-detail-page .module-chip
) {
  border-radius: var(--ms-control-radius) !important;
}

/* Avatar and cover crop dialogs intentionally use rounded, clipped surfaces. */
:root:not(#square-corner-policy-1):not(#square-corner-policy-2):not(#square-corner-policy-3):not(#square-corner-policy-4) :where(
  .ms-media-crop-modal .ms-modal-card,
  .ms-media-crop-modal .ms-crop-frame
) {
  border-radius: var(--ms-panel-radius) !important;
}
