/* Avatar-linked colour profiles. This is intentionally the final profile layer. */

#profileModal .profile-cover-card .profile-cover {
  background-color: var(--profile-cover-color, #b9a9da) !important;
  background-image: none !important;
}

#profileModal .profile-cover-card .profile-cover::before,
#profileModal .profile-cover-card .profile-cover::after,
#profileModal .profile-cover-card .profile-cover > img,
#profileModal .profile-cover-card .cover-edit,
#profileModal .profile-cover-card .cover-picker-popover {
  display: none !important;
}

@media (min-width: 761px) {
  #profileModal .profile-cover-card {
    min-height: 442px !important;
  }

  #profileModal .profile-cover-card .avatar-picker-current {
    top: 14px !important;
    bottom: 10px !important;
    left: 10px !important;
    width: 50% !important;
    z-index: 25 !important;
    overflow: visible !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #profileModal .profile-cover-card .avatar-picker-current::before,
  #profileModal .profile-cover-card .avatar-picker-current::after,
  #profileModal .profile-cover-card .avatar-picker-current.is-picker-editing::before,
  #profileModal .profile-cover-card .avatar-picker-current.is-picker-editing::after {
    display: none !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #profileModal .profile-cover-card .avatar-picker-current > img,
  #profileModal .profile-cover-card .avatar-picker-current.is-picker-editing > img {
    width: 100% !important;
    height: 100% !important;
    opacity: 1 !important;
    transform: scale(.94) !important;
    transform-origin: center bottom !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    object-fit: contain !important;
    object-position: center bottom !important;
  }

  #profileModal .profile-cover-card .profile-summary-card {
    top: 46px !important;
    right: 20px !important;
    bottom: 16px !important;
    left: 42% !important;
  }

  #profileModal .profile-summary-card .profile-name-line {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 48px !important;
  }

  #profileModal .profile-summary-card .avatar-edit {
    position: absolute !important;
    top: 50% !important;
    right: 2px !important;
    bottom: auto !important;
    left: auto !important;
    display: grid !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    place-items: center !important;
    transform: translateY(-50%) !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 8px 18px rgba(16, 22, 35, .13) !important;
  }

  #profileModal .profile-summary-card .avatar-edit:hover {
    transform: translateY(-50%) scale(1.06) !important;
    background: var(--accent) !important;
  }

  #profileModal .avatar-picker-popover {
    z-index: 50 !important;
  }
}

@media (max-width: 760px) {
  #mobileProfileEditButton {
    display: none !important;
  }

  #mobileProfileContent .m-profile-hero,
  #mobileProfileContent.is-editing .m-profile-hero {
    min-height: 366px !important;
    height: 366px !important;
    overflow: hidden !important;
  }

  #mobileProfileContent .m-profile-cover,
  #mobileProfileContent.is-editing .m-profile-cover {
    position: absolute !important;
    inset: 0 !important;
    height: auto !important;
    background-color: var(--m-profile-cover-color, #b9a9da) !important;
    background-image: none !important;
    border-radius: inherit !important;
  }

  #mobileProfileContent .m-profile-cover::before,
  #mobileProfileContent .m-profile-cover::after {
    display: none !important;
    background: none !important;
  }

  #mobileProfileContent .m-profile-avatar-stage,
  #mobileProfileContent.is-editing .m-profile-avatar-stage {
    top: 14px !important;
    bottom: 10px !important;
    left: -10px !important;
    width: 58% !important;
    z-index: 3 !important;
  }

  #mobileProfileContent .m-profile-avatar,
  #mobileProfileContent.is-editing .m-profile-avatar {
    transform: scale(.94) !important;
    transform-origin: center bottom !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #mobileProfileContent .m-profile-main,
  #mobileProfileContent.is-editing .m-profile-main {
    top: 38px !important;
    right: 12px !important;
    bottom: auto !important;
    left: 43% !important;
    z-index: 4 !important;
    height: 244px !important;
    min-height: 244px !important;
    padding: 13px 11px 10px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto auto !important;
    align-content: start !important;
    overflow: hidden !important;
  }

  #mobileProfileContent .m-profile-main > *,
  #mobileProfileContent.is-editing .m-profile-main > *,
  #mobileProfileContent .m-profile-identity,
  #mobileProfileContent.is-editing .m-profile-identity,
  #mobileProfileContent .m-profile-name-row,
  #mobileProfileContent.is-editing .m-profile-name-row {
    width: 100% !important;
    min-width: 0 !important;
  }

  #mobileProfileContent.is-editing .m-profile-stats,
  #mobileProfileContent.is-editing .m-profile-email-stat,
  #mobileProfileContent.is-editing .m-mobile-achievements {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }

  #mobileProfileContent.is-editing .m-profile-stats {
    max-height: none !important;
    margin: 8px 0 0 !important;
    overflow: visible !important;
    border-top-color: var(--m-line) !important;
  }

  #mobileProfileContent.is-editing .m-profile-email-stat {
    display: flex !important;
  }

  #mobileProfileContent .m-profile-name-row {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 32px !important;
  }

  #mobileProfileContent .m-profile-inline-edit {
    position: absolute !important;
    top: 50% !important;
    right: 0 !important;
    display: grid !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    place-items: center !important;
    transform: translateY(-50%) !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #fff !important;
    color: var(--m-ink) !important;
    box-shadow: 0 6px 14px rgba(20, 28, 44, .1) !important;
  }

  #mobileProfileContent .m-profile-inline-edit:active {
    transform: translateY(-50%) scale(.93) !important;
    background: var(--accent) !important;
    color: #fff !important;
  }

  #mobileProfileContent .m-profile-identity h2,
  #mobileProfileContent.is-editing .m-profile-identity h2 {
    padding-right: 30px !important;
    font-size: clamp(21px, 5.6vw, 27px) !important;
  }

  #mobileProfileContent .m-profile-identity p {
    margin-top: 1px !important;
  }

  #mobileProfileContent .m-profile-stats {
    margin: 8px 0 0 !important;
  }

  #mobileProfileContent .m-profile-stats span {
    padding: 6px 5px !important;
  }

  #mobileProfileContent .m-profile-email-stat {
    min-height: 42px !important;
    margin: 0 !important;
    padding: 5px 7px !important;
  }

  #mobileProfileContent .m-mobile-achievements {
    gap: 5px !important;
    margin: 7px 0 0 !important;
  }

  #mobileProfileContent .m-mobile-achievements button {
    height: 30px !important;
  }

  #mobileProfileContent .m-profile-data .m-cover-choice-row,
  #mobileProfileContent .m-cover-choice-row {
    display: none !important;
  }
}
