/* ============================================================
   PROFILE MENU — avatar dropdown in topbar
   Uses the native <details> + <summary> pattern (CSS-only open/close).
   Matches existing HTML class names: __panel, __option, __divider.
   ============================================================ */

.profile-menu {
  position: relative;
  /* Hide the default <details> marker arrow on the summary */
}

.profile-menu summary {
  list-style: none;
  cursor: pointer;
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-menu .avatar {
  user-select: none;
}

/* Dropdown panel — appears below the avatar when <details open> */
.profile-menu__panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
  animation: profile-menu-in 120ms ease-out;
}

@keyframes profile-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.profile-menu__header {
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-1);
}

.profile-menu__name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  display: block;
}

.profile-menu__email {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  display: block;
  margin-top: 2px;
}

.profile-menu__option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background var(--transition-fast);
}

.profile-menu__option:hover {
  background: var(--bg-subtle);
}

.profile-menu__option:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.profile-menu__option svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.profile-menu__divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-1) 0;
}

.profile-menu__option--danger {
  color: var(--color-danger-text);
}

.profile-menu__option--danger svg {
  color: var(--color-danger);
}
