/**
 * Header Account dropdown (avatar, top-right) — transcribed from
 * docs/design-reference/extracted/menu-account.html.
 *
 * A 260px panel (README.md §1, binding) hung under the avatar: a header row
 * carrying the avatar, the member's name in the heading face and their cohort
 * beneath it, then a padded list of plain rows with muted 18px-wide glyphs.
 * Square corners and a light drop shadow, like every other surface here.
 *
 * Literal pixel type from the capture is written calc(Npx * var(--text-scale)),
 * the convention modules/hub.css established.
 */

.account-menu { position: relative; }

.account-menu-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 50%;
}

.account-menu-toggle:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 2px;
}

.account-menu-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.account-menu-avatar.user-avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-fill);
  color: #fff;
  font-family: var(--font-ui);
  font-size: calc(14.5px * var(--text-scale));
  letter-spacing: 0.06em;
}

/* ── Panel ──────────────────────────────────────────────────── */

.account-menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  width: 260px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 0;
  box-shadow: var(--shadow-md);
  z-index: 1101;
  display: none;
  overflow: hidden;
}

.account-menu-panel.open { display: block; }

/* ── Who you are ────────────────────────────────────────────── */

.account-menu-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.account-menu-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

.account-menu-header-avatar.user-avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-fill);
  color: #fff;
  font-family: var(--font-ui);
  font-size: calc(15px * var(--text-scale));
  letter-spacing: 0.06em;
}

.account-menu-identity { min-width: 0; }

.account-menu-name {
  display: block;
  font-family: var(--font-heading);
  font-size: calc(16px * var(--text-scale));
  font-weight: 500;
  color: var(--navy-primary);
}

.account-menu-cohort {
  display: block;
  font-family: var(--font-body);
  font-size: calc(12.5px * var(--text-scale));
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Destinations ───────────────────────────────────────────── */

.account-menu-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
}

/* button_to wraps sign-out in a form; keep it flush with its neighbours. */
.account-menu-list form { margin: 0; }

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: var(--tap);
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: calc(15px * var(--text-scale));
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.account-menu-item:hover {
  background: var(--bg-secondary);
  color: var(--navy-primary);
}

.account-menu-item i {
  width: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  text-align: center;
}
