.language-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--help-menu-offset);
  min-height: var(--help-control-height);
  padding: var(--app-compact-row-padding-block) var(--help-page-gutter);
  border: 0;
  border-radius: var(--app-pill-radius);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: var(--help-small-size);
  cursor: pointer;
  touch-action: manipulation;
  anchor-name: --language-trigger;
}
.language-trigger .chevron { transform: rotate(90deg); }
.language-switch:has(:popover-open) .chevron { transform: rotate(-90deg); }
.language-trigger:active { background: var(--help-press-background); }
.language-options {
  position: absolute;
  inset: auto;
  top: calc(max(var(--help-page-gutter), env(safe-area-inset-top)) + var(--help-control-height) + var(--help-menu-offset));
  right: max(calc((100vw - var(--help-page-width)) / 2 + var(--help-page-gutter) + var(--app-content-inset)),
    calc(max(var(--help-page-gutter), env(safe-area-inset-right)) + var(--app-content-inset)));
  width: var(--help-menu-width);
  margin: 0;
  padding: var(--help-menu-padding);
  border: 0;
  border-radius: var(--app-nested-radius);
  background: var(--card);
  box-shadow: var(--help-menu-shadow);
  color: var(--foreground);
}
@supports (top: anchor(bottom)) {
  .language-options {
    position-anchor: --language-trigger;
    top: calc(anchor(bottom) + var(--help-menu-offset));
    right: anchor(right);
  }
}
.language-options a {
  display: flex;
  align-items: center;
  min-height: var(--help-control-height);
  padding-inline: var(--help-page-gutter);
  border-radius: var(--app-nested-radius);
  color: var(--foreground);
  font-size: var(--help-small-size);
}
.language-options a[aria-current] { background: var(--help-selected-background); color: var(--app-link-foreground); }
.language-options a:active { background: var(--help-press-background); }
@media (hover: hover) {
  .language-trigger:hover, .language-options a:hover { background: var(--help-selected-background); }
}
