/*
 * User profile pictures across the admin panel and web dashboard
 * (plan-37.md) — see UserAvatarHelper. Size comes in per element via
 * --avatar-size so one rule serves table rows, headers and profile cards.
 */

.user-avatar {
  --avatar-size: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  background: var(--coral-container);
}

.user-avatar-initial {
  color: var(--on-coral-container);
  font-weight: 600;
  font-size: calc(var(--avatar-size) * 0.45);
  line-height: 1;
  user-select: none;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  vertical-align: middle;
}

.user-chip-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Signed-in user in the dashboard/admin header — both headers are dark. */
.nav-user {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.nav-user:hover .user-chip-label {
  text-decoration: underline;
}

.nav-user .user-avatar {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

/* Header stays one row on phones: keep the picture, drop the name. */
@media (max-width: 640px) {
  .nav-user .user-chip-label {
    display: none;
  }
}

/* Larger picture at the top of the web account pages. */
.account-profile > .user-avatar,
.account-info > .user-avatar {
  margin-bottom: 0.75rem;
}
