.rl-header__actions {
  display: flex;
  align-items: center;
  gap: var(--rh-space-2);
}

.rl-account { position: relative; }

.rl-account__toggle {
  display: flex;
  align-items: center;
  gap: var(--rh-space-2);
  cursor: pointer;
  list-style: none;
}

.rl-account__toggle::-webkit-details-marker { display: none; }

.rl-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: var(--rh-radius-full);
  overflow: hidden;
  background: var(--rh-surface-sunken);
  color: var(--rh-text);
  font-family: var(--rh-font-display);
  font-size: var(--rh-text-xs);
  font-weight: var(--rh-weight-bold);
  line-height: 1;
  letter-spacing: 0.02em;
  vertical-align: middle;
  user-select: none;
}

.rl-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rl-avatar svg { width: 62%; height: 62%; }

.rl-avatar--small { width: 20px; height: 20px; font-size: 0.5625rem; }

.rl-avatar--large { width: 36px; height: 36px; font-size: var(--rh-text-sm); }

.rl-avatar--extralarge { width: 72px; height: 72px; font-size: var(--rh-text-xl); font-weight: var(--rh-weight-black); }

.rl-avatar--tool { background: var(--rh-text-strong); color: var(--rh-surface); }

.rl-avatar--nameless { color: var(--rl-text-meta); }

.rl-account__name {
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rl-account__mark {
  flex: 0 0 auto;
  width: 0.375rem;
  height: 0.375rem;
  border-right: var(--rh-border-width-strong) solid currentColor;
  border-bottom: var(--rh-border-width-strong) solid currentColor;
  transform: rotate(45deg);
}

.rl-account[open] .rl-account__mark { transform: rotate(-135deg); }

.rl-account__panel {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + var(--rh-space-1));
  z-index: 5;
  min-width: 15rem;
  padding: var(--rh-space-1);
  color: var(--rh-text);
  text-align: start;
}

.rl-account__who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--rh-space-2);
  border-bottom: var(--rh-border-width) solid var(--rh-border);
  margin-bottom: var(--rh-space-1);
}

.rl-account__whoname { font-weight: var(--rh-weight-medium); color: var(--rh-text-strong); }
.rl-account__whomail { font: var(--rh-text-caption); color: var(--rl-text-meta); word-break: break-all; }

.rl-account__roles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rh-space-1);
  margin-top: var(--rh-space-1);
}

.rl-account__pill {
  display: inline-flex;
  align-items: center;
  padding: 1px var(--rh-space-2);
  border: var(--rh-border-width) solid currentColor;
  border-radius: var(--rh-radius-full);
  font-family: var(--rh-font-mono);
  font-size: var(--rh-text-xs);
  letter-spacing: var(--rh-tracking-eyebrow);
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.8;
}

.rl-account__panel .rl-account__pill { color: var(--rl-text-meta); opacity: 1; }

.rl-account__list { list-style: none; margin: 0; padding: 0; }

.rl-account__link {
  display: block;
  padding: var(--rh-space-2);
  border-radius: var(--rh-radius-sm);
  color: var(--rh-text);
  text-decoration: none;
}

.rl-account__link:hover { background: var(--rh-surface-subtle); color: var(--rh-text-strong); }

.rl-account--inverse > .rl-account__toggle {
  color: var(--rh-text-inverse);
  background: transparent;
  border-color: transparent;
}

.rl-account--inverse > .rl-account__toggle:hover {
  color: var(--rh-text-inverse);
  background: rgb(255 255 255 / 0.12);
}

.rl-account--inverse .rl-avatar {
  color: var(--rh-text-inverse);
  background: rgb(255 255 255 / 0.16);
}

@media (max-width: 39.999rem) {
  .rl-header__actions,
  .rl-account__toggle { min-width: 0; }

  .rl-account__name { max-width: 8ch; }

  .rl-account__toggle .rl-account__pill { display: none; }
}
