/* Account center: account, work identity and security are separate concepts. */
@media (min-width: 721px) {
  .app:has(.account-center) .sidebar {
    overflow: visible !important;
  }
}

.account-center {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 30;
  width: 360px;
  max-height: min(680px, calc(100dvh - 40px));
  overflow: auto;
  padding: 8px;
  color: var(--web-ink, var(--slm-ink, #172238));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(249, 252, 255, 0.985));
  border: 1px solid var(--web-line, var(--slm-line, rgba(23, 34, 56, 0.12)));
  border-radius: var(--web-radius-floating, 16px);
  box-shadow: 0 20px 52px rgba(20, 43, 78, 0.16), 0 2px 8px rgba(20, 43, 78, 0.06);
  animation: account-center-in 160ms cubic-bezier(.23, 1, .32, 1);
}

@keyframes account-center-in {
  from { opacity: 0; transform: translateY(6px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.account-center button {
  font: inherit;
}

.account-center-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 4px 10px;
  border-bottom: 1px solid var(--web-line-soft, var(--slm-line-soft, rgba(23, 34, 56, 0.07)));
}

.account-center-profile {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 5px 6px;
  border-radius: 10px;
  text-align: left;
  color: inherit;
  transition: background-color 140ms ease;
}

.account-center-profile:hover,
.account-center-profile:focus-visible {
  background: var(--web-brand-wash, var(--slm-brand-wash, rgba(0, 110, 230, .08)));
}

.account-center-avatar-wrap {
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--web-brand-wash, #f2f7fd);
  border: 1px solid rgba(0, 110, 230, .12);
}

.account-center-avatar-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.account-center-profile-copy,
.account-center-current-row > span:nth-child(2),
.account-center-row > span:nth-child(2),
.account-center-role > span,
.account-center-account > span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-center-profile-copy strong,
.account-center-current-row strong,
.account-center-row strong,
.account-center-role strong,
.account-center-account strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.account-center-profile-copy span,
.account-center-current-row small,
.account-center-row small,
.account-center-role small,
.account-center-account small {
  overflow: hidden;
  color: var(--web-muted, var(--slm-muted, #6d7b8f));
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.account-center-arrow,
.account-center-close,
.account-center-row > i,
.account-center-role > i,
.account-center-account > i {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--web-muted, var(--slm-muted, #6d7b8f));
}

.account-center-arrow {
  transform: rotate(-90deg);
}

.account-center-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--web-muted, var(--slm-muted, #6d7b8f));
}

.account-center-close:hover,
.account-center-close:focus-visible {
  color: var(--web-ink, var(--slm-ink, #172238));
  background: var(--web-brand-wash, #f2f7fd);
}

.account-center-current {
  margin: 10px 0 12px;
  padding: 11px 12px;
  border: 1px solid var(--web-line, var(--slm-line, rgba(23, 34, 56, .12)));
  border-radius: var(--web-radius-panel, 12px);
  background: var(--web-brand-wash, #f2f7fd);
}

.account-center-current-kicker,
.account-center-section-label {
  display: block;
  color: var(--web-muted, var(--slm-muted, #6d7b8f));
  font-size: 11px;
  letter-spacing: .02em;
}

.account-center-current-kicker {
  margin-bottom: 8px;
}

.account-center-current-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.account-center-current-icon,
.account-center-row-icon,
.account-center-account-mark,
.account-center-account-plus {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--web-brand-deep, var(--slm-brand-deep, #004fb8));
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(0,110,230,.12);
}

.account-center-link {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  color: var(--web-brand-deep, #004fb8);
  font-size: 12px;
  font-weight: 620;
}

.account-center-link:hover,
.account-center-link:focus-visible {
  background: #fff;
}

.account-center-section-label {
  margin: 8px 6px 5px;
}

.account-center-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-center-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 9px;
  text-align: left;
  color: var(--web-ink, var(--slm-ink, #172238));
  transition: background-color 140ms ease, color 140ms ease;
}

.account-center-row:hover,
.account-center-row:focus-visible {
  background: var(--web-brand-wash, #f2f7fd);
}

.account-center-row > i {
  font-style: normal;
}

.account-center-row.is-danger {
  color: var(--web-risk, var(--slm-risk, #b54d48));
}

.account-center-row.is-danger .account-center-row-icon {
  color: var(--web-risk, #b54d48);
  background: #fff8f7;
  border-color: rgba(181, 77, 72, .18);
}

.account-center-divider {
  height: 1px;
  margin: 7px 8px;
  background: var(--web-line-soft, var(--slm-line-soft, rgba(23, 34, 56, .07)));
}

.account-center-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 2px 5px 0;
  color: var(--web-ink-soft, var(--slm-ink-soft, #415066));
  font-size: 12px;
  font-weight: 620;
}

.account-center-back {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 5px 6px 0;
  color: var(--web-brand-deep, var(--slm-brand-deep, #004fb8));
  font-size: 12px;
}

.account-center-back svg {
  transform: rotate(90deg);
}

.account-center-hint {
  margin: 2px 6px 10px;
  color: var(--web-muted, var(--slm-muted, #6d7b8f));
  font-size: 11px;
  line-height: 1.5;
}

.account-center-role-list,
.account-center-account-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-center-role {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 9px;
  text-align: left;
  color: var(--web-ink, var(--slm-ink, #172238));
  transition: background-color 140ms ease;
}

.account-center-role:hover,
.account-center-role:focus-visible {
  background: #f3f7fb;
}

.account-center-role.is-on {
  background: var(--web-brand-wash, #f2f7fd);
}

.account-center-role img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  object-position: center 22%;
  border: 1px solid rgba(0, 110, 230, .12);
}

.account-center-role.is-on > i {
  color: var(--web-brand-deep, #004fb8);
}

.account-center-role-open {
  transform: rotate(-90deg);
}

.account-center-account {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 9px;
  text-align: left;
}

.account-center-account.is-current {
  background: var(--web-brand-wash, #f2f7fd);
}

.account-center-account-mark {
  color: var(--web-safe, var(--slm-ok, #27745d));
  background: var(--web-surface, #fff);
  border-color: rgba(39, 116, 93, .18);
}

.account-center-account em {
  color: var(--web-safe, var(--slm-ok, #27745d));
  font-size: 11px;
  font-style: normal;
  font-weight: 620;
}

.account-center-account-add:hover,
.account-center-account-add:focus-visible {
  background: #f3f7fb;
}

.account-center-account-plus {
  color: var(--web-brand-deep, #004fb8);
  background: var(--web-brand-wash, #f2f7fd);
}

.acct-identity-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid var(--web-line, var(--slm-line, rgba(23, 34, 56, .12)));
  border-radius: var(--web-radius-panel, 12px);
  background: var(--web-brand-wash, #f2f7fd);
}

.acct-identity-card img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  object-fit: cover;
  object-position: center 22%;
}

.acct-identity-card > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.acct-identity-card strong {
  color: var(--web-ink, var(--slm-ink, #172238));
  font-size: 13px;
  font-weight: 650;
}

.acct-identity-card span {
  overflow: hidden;
  color: var(--web-muted, var(--slm-muted, #6d7b8f));
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-identity-card .btn {
  min-height: 34px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .mobile-account-trigger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 52px !important;
    color: var(--slm-muted, #6d7b8f);
    font-size: 11px;
  }

  .mobile-account-trigger .bn-ico {
    width: 24px;
    height: 24px;
    overflow: hidden;
    border-radius: 8px;
  }

  .mobile-account-trigger .bn-ico img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 22%;
  }

  .mobile-account-trigger[aria-expanded="true"] {
    color: var(--slm-brand-deep, #004fb8);
  }

  #mobile-account-layer {
    position: relative;
    z-index: 40;
  }

  .account-center {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(64px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(72dvh, 620px);
    border-radius: 16px;
  }

  .account-center:after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
  }

  .account-center-close {
    width: 36px;
    height: 36px;
  }

  .account-center-row,
  .account-center-role,
  .account-center-account {
    min-height: 52px;
  }
}

@media (min-width: 721px) {
  .mobile-account-trigger,
  #mobile-account-layer {
    display: none !important;
  }
}

/* Minimal account surface: labels carry the hierarchy, not helper copy. */
.account-center {
  width: 320px;
  padding: 6px;
}

.account-center-head {
  padding: 4px 3px 8px;
}

.account-center-profile-copy span,
.account-center-current-row small,
.account-center-role small,
.account-center-account small {
  font-size: 10.5px;
}

.account-center-current {
  margin: 8px 0 10px;
  padding: 9px 10px;
}

.account-center-current-kicker {
  margin-bottom: 6px;
  font-size: 10px;
}

.account-center-row {
  min-height: 44px;
  padding: 5px 7px;
}

.account-center-row-icon {
  width: 28px;
  height: 28px;
}

.account-center-divider {
  margin: 5px 6px;
}

.account-center-title-row {
  min-height: 34px;
}

.account-center-role {
  min-height: 44px;
}

.account-center-role img {
  width: 30px;
  height: 30px;
}
