.account-menu-anchor {
  position: relative;
  flex: 0 0 auto;
}

.avatar > img,
.account-menu-avatar > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.home-account-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 80;
  width: 428px;
  max-height: calc(100vh - 84px);
  overflow: auto;
  padding: 0;
  border: 1px solid #dfe2e6;
  border-radius: 8px;
  color: #282b30;
  background: #fff;
  box-shadow: 0 12px 32px rgba(27, 31, 38, .16);
  text-align: start;
  white-space: normal;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.home-account-menu[hidden] { display: none; }
.home-account-menu [hidden] { display: none !important; }
.home-account-menu button { font: inherit; letter-spacing: 0; }
.home-account-menu button:focus-visible { outline: 2px solid #276ef1; outline-offset: -2px; }
.home-account-menu button:disabled { color: #a0a5ac; cursor: not-allowed; }

.account-menu-identity {
  min-height: 76px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 14px 15px 12px;
  border-bottom: 1px solid #eceef1;
}

.account-menu-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: #252a3d;
  font-size: 12px;
  line-height: 1;
  font-weight: 650;
}

.account-menu-user {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.account-menu-user strong,
.account-menu-user > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-user strong { font-size: 14px; line-height: 20px; font-weight: 650; }
.account-menu-user > span { color: #7b8189; font-size: 11px; line-height: 17px; }

.account-menu-team {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid #d8dce1;
  border-radius: 6px;
  color: #464b52;
  background: #fff;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}

.account-menu-team:hover { border-color: #bac2cc; background: #f7f8f9; }
.account-menu-team svg { width: 14px; height: 14px; }

.account-menu-membership {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  border-bottom: 1px solid #eceef1;
  background: #fafafa;
}

.account-menu-membership-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.account-menu-membership-copy > svg { width: 19px; height: 19px; flex: 0 0 19px; color: #c78616; }
.account-menu-membership-copy > span { min-width: 0; display: grid; gap: 1px; }
.account-menu-membership-copy strong { font-size: 12px; line-height: 18px; font-weight: 600; }
.account-menu-membership-copy small { overflow: hidden; color: #858b93; font-size: 10px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-membership > button {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px 0 8px;
  border: 0;
  border-radius: 5px;
  color: #4f5968;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}
.account-menu-membership > button:hover { background: #eef0f2; }
.account-menu-membership > button svg { width: 14px; height: 14px; }

.account-menu-balance { padding: 13px 15px 12px; border-bottom: 1px solid #eceef1; }
.account-menu-balance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.account-menu-balance-head > span:first-child { display: grid; gap: 2px; }
.account-menu-balance-head small { color: #777d85; font-size: 11px; line-height: 17px; }
.account-menu-balance-head strong { color: #202329; font-size: 23px; line-height: 28px; font-weight: 650; font-variant-numeric: tabular-nums; }
.account-menu-balance-actions { display: flex; align-items: center; margin-top: 2px; }
.account-menu-balance-actions > i { width: 1px; height: 12px; margin: 0 4px; background: #d9dde1; }
.account-menu-balance-actions button {
  height: 26px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  color: #276ef1;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}
.account-menu-balance-actions button:hover:not(:disabled) { background: #edf3ff; }

.account-menu-credit-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 18px;
  margin: 11px 0 0;
}
.account-menu-credit-sources > div { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.account-menu-credit-sources dt { overflow: hidden; color: #777d85; font-size: 11px; line-height: 17px; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-credit-sources dd { margin: 0; color: #444950; font-size: 11px; line-height: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.account-menu-data-note { margin: 7px 0 0; color: #9a9fa6; font-size: 10px; line-height: 16px; }

.account-menu-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid #eceef1;
}
.account-menu-metrics section {
  min-width: 0;
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 15px;
}
.account-menu-metrics section + section { border-left: 1px solid #eceef1; }
.account-menu-metrics section > span { display: flex; align-items: center; gap: 5px; color: #777d85; font-size: 11px; line-height: 17px; }
.account-menu-metrics section > span svg { width: 14px; height: 14px; }
.account-menu-metrics strong { font-size: 14px; line-height: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.account-menu-metrics strong em { color: #9a9fa6; font-style: normal; font-weight: 500; }
.account-menu-metrics small { color: #9a9fa6; font-size: 10px; line-height: 15px; }
.account-menu-metrics button {
  width: max-content;
  height: 22px;
  margin-top: -1px;
  padding: 0;
  border: 0;
  color: #276ef1;
  background: transparent;
  font-size: 10px;
  line-height: 16px;
  cursor: pointer;
}

.account-menu-links { display: grid; padding: 5px 0; }
.account-menu-links > button {
  width: 100%;
  height: 38px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  border: 0;
  color: #3d4147;
  background: transparent;
  font-size: 12px;
  line-height: 18px;
  text-align: start;
  cursor: pointer;
}
.account-menu-links > button:hover { background: #f3f4f5; }
.account-menu-links > button > svg { width: 17px; height: 17px; }
.account-menu-links > button > svg:last-child { width: 14px; height: 14px; justify-self: end; color: #a0a5ac; }
.account-menu-links .account-menu-logout { grid-template-columns: 20px minmax(0, 1fr); border-top: 1px solid #eceef1; color: #8c4141; }
.account-menu-links .account-menu-login { color: #245fca; font-weight: 600; }

.account-menu-status {
  min-height: 28px;
  margin: 0;
  padding: 6px 15px 7px;
  border-top: 1px solid #eceef1;
  color: #858b93;
  background: #fafafa;
  font-size: 10px;
  line-height: 15px;
}
.account-menu-status.error { color: #a34c44; background: #fff8f7; }

@media (max-width: 720px) {
  .account-menu-anchor { position: static; }
  .home-account-menu {
    position: fixed;
    top: 66px;
    right: 8px;
    width: min(428px, calc(100vw - 16px));
    max-height: calc(100vh - 74px);
  }
}

@media (max-width: 430px) {
  .account-menu-identity { grid-template-columns: 40px minmax(0, 1fr) auto; padding-inline: 12px; }
  .account-menu-avatar { width: 40px; height: 40px; }
  .account-menu-team span { display: none; }
  .account-menu-team { width: 30px; justify-content: center; padding: 0; }
  .account-menu-membership,
  .account-menu-balance,
  .account-menu-metrics section,
  .account-menu-links > button,
  .account-menu-status { padding-inline: 12px; }
  .account-menu-credit-sources { gap-inline: 12px; }
}
