/* Profile identity overlap and glass surfaces (issue #1112).
   The identity row now owns the overlap depth: the copy starts halfway into
   the cover's lower edge while the avatar keeps the same visual anchor. */
body.profile-page .profile-identity-card > .profile-identity {
  margin-block-start: calc(var(--profile-avatar-size, 161px) * -0.5) !important;
}

body.profile-page .profile-identity-card > .profile-identity > .profile-identity-copy {
  margin-block-start: 0 !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(255, 255, 255, .72) !important;
  border-radius: 16px !important;
  background: rgba(255, 253, 249, .68) !important;
  box-shadow: 0 14px 30px rgba(10, 28, 37, .12), inset 0 1px 0 rgba(255, 255, 255, .52) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.08) !important;
  backdrop-filter: blur(16px) saturate(1.08) !important;
}

/* Keep the cover action discoverable in the conventional top-right corner. */
body.profile-page .profile-identity-card .profile-cover-actions {
  inset-block-start: 12px !important;
  inset-block-end: auto !important;
  /* The profile page keeps RTL content while the cover control is a visual
     affordance: pin it to the physical right edge in every locale. */
  right: 12px !important;
  left: auto !important;
}

/* The edit form is a sibling surface, so it receives the same translucent
   treatment instead of reading as a detached opaque form. */
body.profile-page .profile-identity-card > .profile-details-form {
  padding: 18px 18px 22px !important;
  border: 1px solid rgba(255, 255, 255, .72) !important;
  border-radius: 16px !important;
  background: rgba(255, 253, 249, .68) !important;
  box-shadow: 0 14px 30px rgba(10, 28, 37, .1), inset 0 1px 0 rgba(255, 255, 255, .5) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.08) !important;
  backdrop-filter: blur(16px) saturate(1.08) !important;
}

@media (max-width: 700px) {
  body.profile-page .profile-identity-card > .profile-identity {
    margin-block-start: calc(var(--profile-avatar-size, 104px) * -0.5) !important;
  }

  body.profile-page .profile-identity-card > .profile-identity > .profile-identity-copy {
    padding: 9px 10px !important;
    border-radius: 13px !important;
  }

  body.profile-page .profile-identity-card .profile-cover-actions {
    inset-block-start: 8px !important;
    right: 8px !important;
    left: auto !important;
  }

  body.profile-page .profile-identity-card > .profile-details-form {
    padding: 14px 12px 16px !important;
    border-radius: 13px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.profile-page .profile-identity-card > .profile-identity > .profile-identity-copy,
  body.profile-page .profile-identity-card > .profile-details-form {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}
