/* Malay profile readability: larger type and layouts that give long copy room to breathe. */
html[lang="ms"] .profile-header {
  min-height: 64px;
  padding-right: 16px;
  padding-left: 16px;
}

html[lang="ms"] .profile-header h1 {
  font-size: clamp(22px, 5.9vw, 24px);
  line-height: 1.3;
  letter-spacing: -.3px;
}

html[lang="ms"] .profile-user {
  min-height: 224px;
  padding-top: 14px;
}

html[lang="ms"] .profile-avatar-button,
html[lang="ms"] .profile-avatar-button > img {
  width: 70px;
  height: 70px;
}

html[lang="ms"] .profile-user__meta {
  top: 14px;
  right: 15px;
  left: 98px;
}

html[lang="ms"] .profile-user__meta > div > strong {
  font-size: clamp(11px, 2.95vw, 12.5px);
  line-height: 1.4;
  letter-spacing: -.1px;
  white-space: normal;
  overflow-wrap: anywhere;
}

html[lang="ms"] .profile-user__meta > div > span {
  min-height: 23px;
  padding: 3px 7px;
  font-size: clamp(9px, 2.45vw, 10px);
  line-height: 1.35;
}

html[lang="ms"] .profile-user__meta p {
  margin-top: 4px;
  font-size: clamp(10.5px, 2.8vw, 11.5px);
  line-height: 1.45;
}

html[lang="ms"] .vip-card {
  top: 110px;
  min-height: 100px;
  padding: 12px 14px;
  border-radius: 11px;
}

html[lang="ms"] .vip-card > div strong {
  font-size: clamp(14px, 3.8vw, 16px);
  line-height: 1.4;
}

html[lang="ms"] .vip-card > small {
  margin-top: 8px;
  font-size: clamp(10px, 2.7vw, 11px);
  line-height: 1.45;
}

html[lang="ms"] .profile-assets {
  min-height: 196px;
}

html[lang="ms"] .profile-assets .section-title {
  min-height: 50px;
  padding-right: 14px;
  padding-left: 14px;
}

html[lang="ms"] .profile-assets .section-title h2 {
  font-size: clamp(14px, 3.75vw, 15.5px);
  line-height: 1.4;
}

html[lang="ms"] .profile-assets__grid {
  min-height: 146px;
  padding: 0 9px 10px;
}

html[lang="ms"] .profile-assets__grid > a {
  min-height: 136px;
  padding: 8px 7px;
  grid-template-columns: 42px minmax(0, 1fr) 12px;
  column-gap: 7px;
}

html[lang="ms"] .profile-assets__grid > a > svg:first-child {
  width: 41px;
  height: 41px;
}

html[lang="ms"] .profile-assets__grid small {
  min-height: 34px;
  font-size: clamp(10px, 2.7vw, 11px);
  line-height: 1.4;
}

html[lang="ms"] .profile-assets__grid strong {
  margin-top: 3px;
  font-size: clamp(17px, 4.65vw, 19px);
  line-height: 1.35;
}

html[lang="ms"] .profile-assets__grid span {
  margin-top: 3px;
  font-size: clamp(9px, 2.45vw, 10px);
  line-height: 1.4;
}

html[lang="ms"] .profile-functions {
  min-height: 370px;
  padding: 0 10px 12px;
}

html[lang="ms"] .profile-functions h2 {
  min-height: 52px;
  padding: 15px 4px 9px;
  font-size: clamp(14px, 3.75vw, 15.5px);
  line-height: 1.4;
}

html[lang="ms"] .profile-functions__grid {
  min-height: 306px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(72px, auto));
  gap: 6px 8px;
}

html[lang="ms"] .profile-functions__grid > a {
  min-height: 72px;
  padding: 6px 10px;
  flex-direction: row;
  justify-content: flex-start;
  border-radius: 12px;
  background: #f7faff;
  font-size: clamp(11px, 3vw, 12.5px);
  line-height: 1.4;
  text-align: left;
}

html[lang="ms"] .profile-functions__grid .icon-bubble {
  width: 42px;
  height: 42px;
  margin-top: 0;
}

html[lang="ms"] .profile-functions__grid > a span:last-child {
  max-width: none;
  min-height: 0;
  margin: 0 0 0 9px;
  overflow-wrap: anywhere;
}

html[lang="ms"] .invite-banner {
  min-height: 150px;
  padding: 16px 14px;
}

html[lang="ms"] .invite-banner > div {
  width: calc(100% - 112px);
}

html[lang="ms"] .invite-banner strong {
  font-size: clamp(13.5px, 3.65vw, 15px);
  line-height: 1.4;
}

html[lang="ms"] .invite-banner span {
  margin-top: 5px;
  font-size: clamp(10px, 2.7vw, 11px);
  line-height: 1.45;
}

html[lang="ms"] .invite-banner button {
  min-height: 34px;
  margin-top: 9px;
  padding: 7px 10px;
  font-size: clamp(10.5px, 2.85vw, 11.5px);
  line-height: 1.35;
}

html[lang="ms"] .invite-banner > svg {
  width: 112px;
}

html[lang="ms"] .profile-other {
  min-height: 112px;
}

html[lang="ms"] .profile-other > a {
  min-height: 56px;
  padding: 10px 14px;
  font-size: clamp(12.5px, 3.4vw, 14px);
  line-height: 1.4;
}

html[lang="ms"] .profile-other > a > em {
  font-size: clamp(11px, 2.95vw, 12px);
  line-height: 1.4;
}

@media (max-width: 350px) {
  html[lang="ms"] .profile-user {
    min-height: 236px;
  }

  html[lang="ms"] .profile-avatar-button,
  html[lang="ms"] .profile-avatar-button > img {
    width: 64px;
    height: 64px;
  }

  html[lang="ms"] .profile-user__meta {
    right: 10px;
    left: 84px;
  }

  html[lang="ms"] .vip-card {
    top: 120px;
  }

  html[lang="ms"] .profile-assets {
    min-height: 286px;
  }

  html[lang="ms"] .profile-assets__grid {
    min-height: 236px;
    grid-template-columns: minmax(0, 1fr);
  }

  html[lang="ms"] .profile-assets__grid > a {
    min-height: 118px;
    grid-template-columns: 40px minmax(0, 1fr) 12px;
  }

  html[lang="ms"] .profile-assets__grid > a + a {
    border-top: 1px solid #f0f2f5;
    border-left: 0;
  }

  html[lang="ms"] .profile-assets__grid small {
    min-height: 0;
    font-size: 10.5px;
  }

  html[lang="ms"] .profile-functions {
    min-height: 382px;
  }

  html[lang="ms"] .profile-functions__grid {
    min-height: 318px;
    grid-template-rows: repeat(4, minmax(75px, auto));
    gap: 6px;
  }

  html[lang="ms"] .profile-functions__grid > a {
    min-height: 75px;
    padding-right: 7px;
    padding-left: 7px;
    font-size: 11px;
  }

  html[lang="ms"] .profile-functions__grid .icon-bubble {
    width: 39px;
    height: 39px;
  }

  html[lang="ms"] .profile-functions__grid > a span:last-child {
    margin-left: 7px;
  }

  html[lang="ms"] .invite-banner {
    min-height: 162px;
  }

  html[lang="ms"] .invite-banner > div {
    width: calc(100% - 92px);
  }

  html[lang="ms"] .invite-banner > svg {
    width: 96px;
  }
}

/* Restore document scrolling and a slim scrollbar on desktop mouse devices. */
@media (hover: hover) and (pointer: fine) {
  html:has(.profile-screen) {
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    overscroll-behavior-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #aebed1 #edf3fa;
  }

  html:has(.profile-screen) body,
  html:has(.profile-screen) #root {
    height: auto !important;
    max-height: none !important;
    min-height: 100vh;
    overflow-x: clip !important;
    overflow-y: visible !important;
    overscroll-behavior-y: auto;
  }

  html:has(.profile-screen) .profile-screen {
    height: auto !important;
    max-height: none !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
    touch-action: auto;
  }

  html:has(.profile-screen)::-webkit-scrollbar {
    display: block !important;
    width: 8px;
  }

  html:has(.profile-screen)::-webkit-scrollbar-track {
    background: #edf3fa;
  }

  html:has(.profile-screen)::-webkit-scrollbar-thumb {
    min-height: 42px;
    border: 2px solid #edf3fa;
    border-radius: 999px;
    background: #aebed1;
  }
}
