/* Display pages are identified by the shared module-title component, not their
   module name or detail-like wrappers (journals also use those wrappers). */
:is(#module-title-layout#module-display, body.profile-subpage-shell):not(.add-edit-layout):has(.ms-universal-title-stack) {
  --module-title-top-space: 32px;
  --module-title-inline-space: 24px;
  --module-title-size: 18px;
}
:is(#module-title-layout#module-display, body.profile-subpage-shell):not(.add-edit-layout):has(.ms-universal-title-stack) .main.page-shell {
  padding-top: var(--module-title-top-space) !important;
}
:is(#module-title-layout#module-display, body.profile-subpage-shell).has-profile-compact-header:not(.add-edit-layout):has(.ms-universal-title-stack) .main.page-shell {
  padding-top: calc(var(--profile-compact-header-height, 76px) + var(--module-title-top-space)) !important;
}
/* Exactly one ancestor owns the top inset and one owns the content width. */
:is(#module-title-layout#module-display, body.profile-subpage-shell):not(.add-edit-layout)
:is(.main-grid, .profile-main-inner, .profile-page, .profile-body-card, .profile-body-content):has(.ms-universal-title-stack) {
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-inline: 0 !important;
}
:is(#module-title-layout#module-display, body.profile-subpage-shell):not(.add-edit-layout)
.profile-body-card:has(.ms-universal-title-stack) {
  box-sizing: border-box !important;
  width: calc(100% - 2 * var(--module-title-inline-space)) !important;
  max-width: var(--ms-universal-title-lane-max, 970px) !important;
  margin-inline: auto !important;
}
/* Both base-template headers and modules with their own header use this lane. */
:is(#module-title-layout#module-display, body.profile-subpage-shell):not(.add-edit-layout)
:is(.module-page-header, .events-index-title-row, .roster-guide__header-main):has(.ms-universal-title-stack) {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 32px !important;
  margin: 0 0 22px !important;
  padding: 0 !important;
  position: relative !important;
  top: auto !important;
  transform: none !important;
}
:is(#module-title-layout#module-display, body.profile-subpage-shell):not(.add-edit-layout)
:is(.ms-page-wrap, .roster-guide, .roster-guide__header-card, .events-index-head):has(.ms-universal-title-stack) {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  margin-top: 0 !important;
  margin-inline: 0 !important;
  padding-top: 0 !important;
  padding-inline: 0 !important;
}
:is(#module-title-layout#module-display, body.profile-subpage-shell):not(.add-edit-layout)
:is(.ms-universal-title-stack, .ms-universal-title-row, .ms-universal-title-link, .module-page-title-row):has(.ms-universal-title-text) {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  align-items: center !important;
}
:is(#module-title-layout#module-display, body.profile-subpage-shell):not(.add-edit-layout) .ms-universal-title-text {
  margin: 0 !important;
  padding: 0 !important;
  font-family: inherit !important;
  font-size: var(--module-title-size, 18px) !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  border: 0 !important;
}
@media (max-width: 1024px) {
  :is(#module-title-layout#module-display, body.profile-subpage-shell):not(.add-edit-layout):has(.ms-universal-title-stack) {
    --module-title-top-space: 20px;
    --module-title-inline-space: 14px;
  }
}
