.account-menu-dialog {
  width: min(420px, calc(100vw - 32px));
  max-height: 90vh;
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--style-line, #e4d5c2);
  border-radius: 14px;
  background: var(--style-surface, #fffefc);
  color: var(--style-ink, #3d2b3f);
  box-shadow: 0 24px 80px color-mix(in srgb, var(--style-shadow, #3d2b3f) 17%, transparent);
  font: inherit;
}

.account-menu-dialog::backdrop {
  background: color-mix(in srgb, var(--style-shadow, #3d2b3f) 45%, transparent);
  backdrop-filter: blur(3px);
}

.account-menu-dialog * { box-sizing: border-box; }

.account-menu-dialog button:focus-visible,
.account-menu-dialog input:focus-visible,
.account-menu-dialog select:focus-visible {
  outline: 3px solid var(--style-amber, #aa6825);
  outline-offset: 2px;
}

.account-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 25px 17px;
  border-bottom: 1px solid var(--style-line, #e4d5c2);
}

.account-menu-head h2 {
  margin: 0;
  font-size: 19px;
}

.account-menu-head button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.account-menu-head button:hover { background: var(--style-soft, #f8e9d0); }
.account-menu-head .icon { width: 18px; }
.account-menu-body { padding: 23px 25px 25px; }

.account-menu-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 0 20px;
}

.account-menu-identity > div { display: grid; min-width: 0; }

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

.account-menu-identity strong { font-size: 17px; }
.account-menu-identity span { color: var(--style-muted, #776377); }

.account-menu-identity small {
  margin-top: 4px;
  color: var(--style-accent, var(--style-primary, #713d7b));
  font-weight: 650;
}

.account-menu-avatar { width: 38px; height: 38px; flex: 0 0 auto; }
.account-menu-avatar-large { width: 58px; height: 58px; flex: 0 0 auto; }

.account-menu-row-avatar {
  position: relative;
  display: flex;
  flex: 0 0 auto;
}

.account-menu-role-mark {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  color: var(--style-amber, #aa6825);
  filter: drop-shadow(0 0 1px var(--style-surface, #fffefc)) drop-shadow(0 0 1px var(--style-surface, #fffefc));
}

.account-menu-role-mark .icon {
  display: block;
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.account-menu-identity-avatar .account-menu-role-mark {
  right: -4px;
  bottom: -3px;
  width: 21px;
  height: 21px;
}

.account-menu-identity-avatar .account-menu-role-mark .icon {
  width: 21px;
  height: 21px;
}

.account-menu-actions,
.account-menu-list { display: grid; gap: 9px; }

.account-menu-module-actions {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--style-line, #e4d5c2);
}

.account-menu-actions button,
.account-menu-actions a,
.account-menu-account,
.account-menu-back,
.account-menu-primary {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--style-line, #e4d5c2);
  border-radius: 8px;
  background: var(--style-surface, #fffefc);
  color: var(--style-ink, #3d2b3f);
  font: 600 12px/1.3 inherit;
  text-align: left;
  cursor: pointer;
}

.account-menu-actions button:hover,
.account-menu-actions a:hover,
.account-menu-account:hover,
.account-menu-back:hover {
  background: var(--style-soft, #f8e9d0);
  border-color: var(--style-muted, #776377);
}

.account-menu-actions .icon,
.account-menu-back .icon,
.account-menu-account > .icon { width: 18px; height: 18px; }

.account-menu-danger { color: var(--style-danger, #a74444) !important; }

.account-menu-back {
  width: auto;
  margin: 0 0 18px;
  padding-left: 4px;
  border-color: transparent;
  background: transparent;
  color: var(--style-muted, #776377);
}

.account-menu-body h3 { margin: 0 0 12px; font-size: 14px; }
.account-menu-body .account-menu-section-title {
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--style-line, #e4d5c2);
}
.account-menu-switch-actions { margin-top: 18px; }
.account-menu-account-copy { display: grid; min-width: 0; flex: 1; }

.account-menu-account-copy > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-account small {
  color: var(--style-muted, #776377);
  font-weight: 400;
}

.account-menu-account.current {
  cursor: default;
  background: var(--style-soft, #f8e9d0);
}

.account-menu-form { display: grid; gap: 14px; }

.account-menu-form label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
}

.account-menu-form input,
.account-menu-form select {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--style-line, #e4d5c2);
  border-radius: 7px;
  background: var(--style-surface, #fffefc);
  color: var(--style-ink, #3d2b3f);
  font: inherit;
}

.account-menu-primary {
  justify-content: center;
  border-color: var(--style-action, var(--style-primary, #713d7b));
  background: var(--style-action, var(--style-primary, #713d7b));
  color: var(--style-action-ink, #fffefc);
  text-align: center;
}

.account-menu-primary:hover {
  border-color: var(--style-action-hover, var(--style-primary-dark, #4f2857));
  background: var(--style-action-hover, var(--style-primary-dark, #4f2857));
}

.account-menu-error { min-height: 1.2em; color: var(--style-danger, #a74444); }

.account-menu-success {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.account-menu-success > .icon {
  width: 34px;
  height: 34px;
  color: var(--style-accent, var(--style-primary, #713d7b));
}

.account-menu-dialog[aria-busy="true"] { cursor: progress; }
.account-menu-dialog[aria-busy="true"] button { pointer-events: none; opacity: .65; }

.participant-menu-extra { margin-top: 14px; }
.participant-forget { display: grid; gap: 12px; }
.participant-forget h3,
.participant-forget p { margin: 0; }
.participant-forget p { color: var(--style-muted, #776377); line-height: 1.55; }

@media (max-width: 600px) {
  .account-menu-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .account-menu-head { padding: 20px; }
  .account-menu-body { padding: 20px; }

  .account-menu-actions button,
  .account-menu-actions a,
  .account-menu-account,
  .account-menu-back,
  .account-menu-primary {
    min-height: 44px;
    font-size: 13px;
  }
}
