/* Language switcher (generated into each page by tools/build_i18n.py). */
.lang-switch { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px;
  font-size: 12px; margin: 10px auto 0; }
.lang-switch a { color: inherit; opacity: 0.7; text-decoration: none; }
.lang-switch a:hover { opacity: 1; text-decoration: underline; }
.lang-switch a[aria-current="page"] { opacity: 1; font-weight: 600; }

/* Header language menu (generated into each page's header by tools/build_i18n.py).
   A native <details>: opens with click, Enter or Space; i18n.js closes it on an
   outside click or Escape. Colours follow the page's own variables (in use:
   --bg-panel or --bg-card with --text-primary, and --bg2 with --text1). */
.lang-menu { position: relative; display: inline-block; font-size: 13px; line-height: 1; }
.lang-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center;
  gap: 5px; padding: 6px 8px; border-radius: 6px; color: inherit; opacity: 0.85; user-select: none; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary:hover, .lang-menu[open] > summary { opacity: 1; background: rgba(127, 127, 127, 0.15); }
.lang-menu > summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.lang-menu-globe { flex: none; }
.lang-menu-code { font-weight: 600; letter-spacing: 0.02em; }
.lang-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1000; min-width: 180px;
  display: flex; flex-direction: column; padding: 6px; border-radius: 8px; text-align: start;
  background: var(--bg-panel, var(--bg-card, var(--bg2, #141821))); color: var(--text-primary, var(--text1, #e9e9ee));
  border: 1px solid var(--border, rgba(127, 127, 127, 0.3)); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28); }
.lang-menu-list a { display: block; padding: 8px 10px; border-radius: 5px; color: inherit;
  text-decoration: none; white-space: nowrap; font-size: 13px; text-transform: none;
  letter-spacing: normal; font-weight: 400; opacity: 1; }
.lang-menu-list a:hover, .lang-menu-list a:focus-visible { background: rgba(127, 127, 127, 0.18); outline: none; }
.lang-menu-list a[aria-current="page"] { font-weight: 600; }
.lang-menu-list a[aria-current="page"]::after { content: " \2713"; }
/* Pages without a top nav (sign-up, invitation): top-right corner of the page. */
.lang-menu-corner { position: absolute; top: 14px; right: 16px; z-index: 1000; }

/* Narrow screens: the header's links get tighter and may wrap, so the language menu
   fits beside them (translated labels are longer than the English ones). */
@media (max-width: 600px) {
  .topnav .topnav-links, .topnav .topnav-right { flex-wrap: wrap; justify-content: flex-end; row-gap: 2px; gap: 4px; }
  .topnav .topnav-link { padding: 6px 8px; letter-spacing: 0.03em; }
  nav .nav-links { flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem 0.75rem; }
  .topnav .topnav-brand, .topnav .topnav-logo, nav .nav-logo { flex: none; }
  .lang-menu > summary { padding: 6px 6px; }
}
