/* Responsive fixes loaded after the legacy theme layers. */
@media (max-width: 767.98px) {
  body.happy-profile-ui.happy-page-user .container-p-y > .card[data-style="modern_v1"]:first-child {
    min-height: 330px !important;
    border-radius: 16px !important;
  }

  body.happy-profile-ui.happy-page-user .container-p-y > .card[data-style="modern_v1"]:first-child .user-profile-header-banner,
  body.happy-profile-ui.happy-page-user .container-p-y > .card[data-style="modern_v1"]:first-child .happy-profile-cover-target {
    width: 100% !important;
    height: 100% !important;
    min-height: 330px !important;
    border-radius: 16px !important;
  }

  body.happy-profile-ui.happy-page-user .user-profile-header {
    right: 20px !important;
    bottom: 20px !important;
    left: 20px !important;
    display: grid !important;
    min-height: 0 !important;
    grid-template-columns: 88px minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 16px !important;
  }

  body.happy-profile-ui.happy-page-user .user-profile-header > .flex-shrink-0,
  body.happy-profile-ui.happy-page-user .v_avatar-user,
  body.happy-profile-ui.happy-page-user .v_avatar-user .user-profile-img,
  body.happy-profile-ui.happy-page-user .user-profile-img {
    width: 88px !important;
    height: 88px !important;
  }

  body.happy-profile-ui.happy-page-user .user-profile-header > .flex-shrink-0,
  body.happy-profile-ui.happy-page-user .user-profile-header > .flex-grow-1 {
    min-width: 0 !important;
    margin: 0 !important;
  }

  body.happy-profile-ui.happy-page-user .happy-public-profile-content {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 12px !important;
    margin: 0 !important;
  }

  body.happy-profile-ui.happy-page-user .happy-public-profile-content > .user-profile-info {
    width: 100% !important;
    min-width: 0 !important;
    text-align: left !important;
  }

  body.happy-profile-ui.happy-page-user .user-profile-info h1,
  body.happy-profile-ui.happy-page-user .user-profile-info .h4 {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 6px 8px !important;
    margin: 0 0 7px !important;
    font-size: 22px !important;
    line-height: 1.2 !important;
  }

  body.happy-profile-ui.happy-page-user .user-profile-info > ul {
    justify-content: flex-start !important;
    gap: 6px !important;
    margin: 0 !important;
  }

  body.happy-profile-ui.happy-page-user .happy-public-profile-details {
    margin-top: 9px !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
  }

  body.happy-profile-ui.happy-page-user .happy-public-profile-dates {
    display: flex !important;
    width: 100% !important;
    height: auto !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 5px 16px !important;
  }

  body.happy-profile-ui.happy-page-user .happy-public-profile-dates > span {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  body.happy-profile-ui.happy-page-user .happy-public-profile-actions {
    display: flex !important;
    width: 100% !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 !important;
  }

  body.happy-profile-ui.happy-page-user .happy-public-profile-action {
    min-width: 0 !important;
    height: 38px !important;
    padding: 0 13px !important;
    font-size: 12px !important;
  }
}

/* Public profile identity: align member status, role, UID, and school verification. */
body.happy-profile-ui.happy-page-user .user-profile-info h1,
body.happy-profile-ui.happy-page-user .user-profile-info .h4 {
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
}

body.happy-profile-ui.happy-page-user .user-profile-info h1 .lao-member-rank-hero,
body.happy-profile-ui.happy-page-user .user-profile-info .h4 .lao-member-rank-hero {
  display: inline-flex !important;
  height: 24px !important;
  align-items: center !important;
  margin: 0 !important;
  line-height: 24px !important;
}

body.happy-profile-ui.happy-page-user .user-profile-info h1 .lao-member-rank-hero img,
body.happy-profile-ui.happy-page-user .user-profile-info .h4 .lao-member-rank-hero img {
  width: auto !important;
  max-width: 98px !important;
  height: 24px !important;
}

body.happy-profile-ui.happy-page-user .user-profile-info h1 .happy-level-name-badge,
body.happy-profile-ui.happy-page-user .user-profile-info .h4 .happy-level-name-badge,
body.happy-profile-ui.happy-page-user .user-profile-info h1 .lao-title-badge-hero,
body.happy-profile-ui.happy-page-user .user-profile-info .h4 .lao-title-badge-hero,
body.happy-profile-ui.happy-page-user .happy-public-profile-uid {
  box-sizing: border-box !important;
  display: inline-flex !important;
  height: 24px !important;
  min-height: 24px !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 9px !important;
  border: 1px solid rgba(255, 255, 255, 0.42) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.16) !important;
  color: rgba(255, 255, 255, 0.96) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

body.happy-profile-ui.happy-page-user .happy-public-profile-details {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 8px !important;
}

body.happy-profile-ui.happy-page-user .happy-public-profile-dates {
  flex-wrap: wrap !important;
}

body.happy-profile-ui.happy-page-user .happy-public-profile-school {
  display: inline-flex !important;
  align-self: flex-start !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.happy-profile-ui.happy-page-user .happy-public-profile-school > span {
  display: inline-flex !important;
  min-height: 26px !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 10px !important;
  border: 1px solid rgba(137, 209, 255, 0.5) !important;
  border-radius: 999px !important;
  background: rgba(90, 162, 216, 0.2) !important;
  color: rgba(244, 251, 255, 0.98) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  text-shadow: 0 1px 4px rgba(5, 12, 22, 0.26) !important;
}

body.happy-profile-ui.happy-page-user .happy-public-profile-school > span i {
  color: #9adfff !important;
  font-size: 14px !important;
}

body.happy-profile-ui.happy-page-user .user-profile-header .user-profile-info h1 > .happy-public-profile-uid,
body.happy-profile-ui.happy-page-user .user-profile-header .user-profile-info .h4 > .happy-public-profile-uid {
  color: rgba(255, 255, 255, 0.96) !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

body.happy-profile-ui.happy-page-user .user-profile-header .happy-public-profile-details .happy-public-profile-school > span {
  color: rgba(244, 251, 255, 0.98) !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

@media (max-width: 640px) {
  body.happy-profile-ui.happy-page-user .user-profile-info h1,
  body.happy-profile-ui.happy-page-user .user-profile-info .h4 {
    gap: 6px !important;
  }

  body.happy-profile-ui.happy-page-user .happy-public-profile-details {
    gap: 7px !important;
  }

  body.happy-profile-ui.happy-page-user .happy-public-profile-dates {
    gap: 8px 14px !important;
  }
}

@media (max-width: 480px) {
  body.happy-profile-ui.happy-page-user .container-p-y > .card[data-style="modern_v1"]:first-child,
  body.happy-profile-ui.happy-page-user .container-p-y > .card[data-style="modern_v1"]:first-child .user-profile-header-banner,
  body.happy-profile-ui.happy-page-user .container-p-y > .card[data-style="modern_v1"]:first-child .happy-profile-cover-target {
    min-height: 350px !important;
  }

  body.happy-profile-ui.happy-page-user .user-profile-header {
    right: 14px !important;
    bottom: 16px !important;
    left: 14px !important;
    grid-template-columns: 72px minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body.happy-profile-ui.happy-page-user .user-profile-header > .flex-shrink-0,
  body.happy-profile-ui.happy-page-user .v_avatar-user,
  body.happy-profile-ui.happy-page-user .v_avatar-user .user-profile-img,
  body.happy-profile-ui.happy-page-user .user-profile-img {
    width: 72px !important;
    height: 72px !important;
  }

  body.happy-profile-ui.happy-page-user .user-profile-info h1,
  body.happy-profile-ui.happy-page-user .user-profile-info .h4 {
    gap: 5px 6px !important;
    font-size: 19px !important;
  }

  body.happy-profile-ui.happy-page-user .happy-public-profile-content { gap: 10px !important; }

  body.happy-profile-ui.happy-page-user .happy-public-profile-dates {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 3px !important;
  }

  body.happy-profile-ui.happy-page-user .happy-public-profile-action {
    height: 36px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
  }
}

/* Desktop header actions, loaded last to neutralize legacy size variants. */
@media (min-width: 1200px) {
  html.happy-topnav-layout #desktop_nav_menu_legacy > .navbar-nav:last-child {
    align-items: center !important;
    gap: 6px !important;
  }

  html.happy-topnav-layout #desktop_nav_menu_legacy > .navbar-nav:last-child > .happy-nav-search.happy-top-search-button {
    order: 98 !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
    margin: 0 !important;
  }

  html.happy-topnav-layout #desktop_nav_menu_legacy > .navbar-nav:last-child > .dropdown:has(> .nav-item.username) {
    order: 99 !important;
    width: 44px !important;
    min-width: 44px !important;
    flex: 0 0 44px !important;
    margin: 0 !important;
  }

  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-create-btn,
  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-friend-btn,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-rank-btn,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-store-btn,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-wallet-btn,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-sign-btn,
  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-message-btn,
  html.happy-topnav-layout #desktop_nav_menu_legacy a[href="#statelySearchModal"],
  html.happy-topnav-layout.happy-sidebar-expanded #desktop_nav_menu_legacy .happy-top-create-btn,
  html.happy-topnav-layout.happy-sidebar-expanded #desktop_nav_menu_legacy .happy-top-friend-btn,
  html.happy-topnav-layout.happy-sidebar-expanded #desktop_nav_menu_legacy .lao-economy-rank-btn,
  html.happy-topnav-layout.happy-sidebar-expanded #desktop_nav_menu_legacy .lao-economy-store-btn,
  html.happy-topnav-layout.happy-sidebar-expanded #desktop_nav_menu_legacy .lao-economy-wallet-btn,
  html.happy-topnav-layout.happy-sidebar-expanded #desktop_nav_menu_legacy .lao-economy-sign-btn,
  html.happy-topnav-layout.happy-sidebar-expanded #desktop_nav_menu_legacy .happy-top-message-btn,
  html.happy-topnav-layout.happy-sidebar-expanded #desktop_nav_menu_legacy a[href="#statelySearchModal"] {
    display: inline-flex !important;
    box-sizing: border-box !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #e9e2e6 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #3f424a !important;
    box-shadow: 0 2px 8px rgba(49, 42, 46, 0.045) !important;
    font-size: 0 !important;
    line-height: 1 !important;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease !important;
  }

  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-create-btn,
  html.happy-topnav-layout.happy-sidebar-expanded #desktop_nav_menu_legacy .happy-top-create-btn {
    border-color: #e94f87 !important;
    background: #e94f87 !important;
    color: #fff !important;
    box-shadow: 0 5px 14px rgba(233, 79, 135, 0.24) !important;
  }

  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-create-btn:hover,
  html.happy-topnav-layout.happy-sidebar-expanded #desktop_nav_menu_legacy .happy-top-create-btn:hover {
    border-color: #d93d75 !important;
    background: #d93d75 !important;
    color: #fff !important;
    box-shadow: 0 7px 18px rgba(217, 61, 117, 0.28) !important;
    transform: translateY(-1px) !important;
  }

  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-friend-btn:hover,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-rank-btn:hover,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-store-btn:hover,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-wallet-btn:hover,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-sign-btn:hover,
  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-message-btn:hover,
  html.happy-topnav-layout #desktop_nav_menu_legacy a[href="#statelySearchModal"]:hover {
    border-color: #edcbd8 !important;
    background: #fff4f8 !important;
    color: #cf477a !important;
    box-shadow: 0 6px 16px rgba(76, 54, 64, 0.1) !important;
    transform: translateY(-1px) !important;
  }

  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-create-btn:focus-visible,
  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-friend-btn:focus-visible,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-rank-btn:focus-visible,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-store-btn:focus-visible,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-wallet-btn:focus-visible,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-sign-btn:focus-visible,
  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-message-btn:focus-visible,
  html.happy-topnav-layout #desktop_nav_menu_legacy a[href="#statelySearchModal"]:focus-visible {
    outline: 3px solid rgba(233, 79, 135, 0.2) !important;
    outline-offset: 2px !important;
  }

  html.happy-topnav-layout #desktop_nav_menu_legacy > .navbar-nav:last-child > .happy-nav-search.happy-top-search-button > a.nav-link:has(> i) {
    border: 1px solid #e9e2e6 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #3f424a !important;
    box-shadow: 0 2px 8px rgba(49, 42, 46, 0.045) !important;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease !important;
  }

  html.happy-topnav-layout #desktop_nav_menu_legacy > .navbar-nav:last-child > .happy-nav-search.happy-top-search-button > a.nav-link:has(> i):hover {
    border-color: #edcbd8 !important;
    background: #fff4f8 !important;
    color: #cf477a !important;
    box-shadow: 0 6px 16px rgba(76, 54, 64, 0.1) !important;
    transform: translateY(-1px) !important;
  }

  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-create-btn span,
  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-friend-btn span,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-rank-btn span,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-store-btn span,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-wallet-btn span,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-sign-btn span,
  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-message-btn span,
  html.happy-topnav-layout #desktop_nav_menu_legacy a[href="#statelySearchModal"] span {
    display: none !important;
  }

  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-create-btn i,
  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-friend-btn i,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-rank-btn i,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-store-btn i,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-wallet-btn i,
  html.happy-topnav-layout #desktop_nav_menu_legacy .lao-economy-sign-btn i,
  html.happy-topnav-layout #desktop_nav_menu_legacy .happy-top-message-btn i,
  html.happy-topnav-layout #desktop_nav_menu_legacy a[href="#statelySearchModal"] i {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    background: none !important;
    font-size: 22px !important;
    line-height: 1 !important;
  }

  html.happy-topnav-layout #desktop_nav_menu_legacy .dropdown > .nav-item.username > .nav-link,
  html.happy-topnav-layout #desktop_nav_menu_legacy .dropdown > .nav-item.username > .nav-link img {
    box-sizing: border-box !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
  }
}
