.lang-menu { position: relative; flex: none; }
.lang-menu summary { list-style: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; cursor: pointer; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); border: 1px solid var(--border); background: var(--surface-2); }
.lang-button:hover, .lang-menu[open] .lang-button { color: var(--text); }
.lang-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 230px; max-height: min(420px, 70vh); overflow-y: auto; padding: 6px; display: grid; background: #0e111b; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); }
[dir="rtl"] .lang-list { right: auto; left: 0; }
.lang-list button { all: unset; cursor: pointer; padding: 8px 12px; border-radius: 8px; font-size: 0.93rem; }
.lang-list button:hover { background: var(--surface-2); }
.lang-list button[aria-current="true"] { color: var(--accent-2); font-weight: 600; }
.lang-loading main { transition: opacity 0.2s; opacity: 0.85; }
/* On phones the menu sits at the end of the page links' row. */
@media (max-width: 820px) {
  .lang-menu { order: 4; }
  .lang-menu ~ .shell-account, .shell-nav:has(~ .lang-menu) { min-width: 0; }
  .shell-header .shell-nav:has(~ .lang-menu) { width: auto; flex: 1 1 calc(100% - 90px); }
  .lang-button { padding: 5px 10px; gap: 4px; font-size: 0.78rem; }
}
