/* The same picker is used by the homepage, guide and privacy page. */
.nav .brand, .nav .icon-btn { flex-shrink: 0; }
.nav .nav-right { flex: 0 0 auto; min-width: 0; max-width: calc(100% - 110px); }
.lang { min-width: 0; }
.lang summary { width: max-content; max-width: min(230px, calc(100vw - 184px)); height: auto; min-height: 36px; padding: 6px 10px; }
.lang summary > svg { flex: 0 0 18px; width: 18px; height: 18px; }
.lang-current { min-width: 0; line-height: 1.2; overflow-wrap: anywhere; white-space: normal; }
@media (min-width: 641px) {
  .nav .nav-links { min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; white-space: nowrap; }
  .nav .nav-links::-webkit-scrollbar { display: none; }
  .nav .nav-links a { flex: 0 0 auto; }
}
@media (max-width: 640px) {
  .nav .wrap { column-gap: 8px; grid-template-columns: auto minmax(0, 1fr); }
  .nav .brand { width: max-content; justify-self: start; }
  .nav .nav-right { gap: 8px; justify-self: end; max-width: 100%; }
  .lang summary { width: 36px; height: 36px; min-width: 36px; padding: 0; justify-content: center; }
  .lang summary .lang-current { display: none; }
}
.lang .lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 90;
  width: min(358px, calc(100vw - 24px)); min-width: 0;
  max-height: min(480px, calc(100vh - 100px)); padding: 0; gap: 0;
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: 18px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 18px 55px rgba(16, 18, 40, .18), 0 4px 12px rgba(16, 18, 40, .08);
}
.lang:not([open]) .lang-menu { display: none; }
.lang-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 11px; }
.lang-head > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px; min-width: 0; }
.lang-head strong { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.lang-head span { color: var(--text-3); font-size: 12px; }
.lang-close { display: grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--text-3); cursor: pointer; }
.lang-close[hidden], .lang-search[hidden], .lang-empty[hidden], .lang-foot[hidden] { display: none; }
.lang-close:hover { background: var(--bg-2); color: var(--text); }
.lang-close svg, .lang-search > svg { width: 17px; height: 17px; flex: none; }
.lang-search { display: flex; flex: 0 0 42px; align-items: center; gap: 9px; height: 42px; margin: 0 14px 10px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--bg-2); color: var(--text-3); }
.lang-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lang-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; }
.lang-search input::placeholder { color: var(--text-3); opacity: 1; }
.lang-results { min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 0 8px 7px; scrollbar-width: thin; scrollbar-color: #b9bccb transparent; }
.lang-results::-webkit-scrollbar { width: 6px; }
.lang-results::-webkit-scrollbar-track { background: transparent; }
.lang-results::-webkit-scrollbar-thumb { background: #b9bccb; border: 1px solid var(--surface); border-radius: 10px; }
@supports selector(::-webkit-scrollbar) { .lang-results { scrollbar-width: auto; } }
.lang-menu .lang-option { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 8px 9px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; line-height: 1.35; text-decoration: none; }
.lang-menu .lang-option[hidden] { display: none; }
.lang-menu .lang-option::after { content: ''; }
.lang-menu .lang-option:hover, .lang-menu .lang-option:focus-visible { background: var(--bg-2); color: var(--text); }
.lang-menu .lang-option[aria-current] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.lang-menu .lang-option[aria-current]::after { content: '\2713'; color: var(--brand); font-size: 15px; font-weight: 700; text-align: center; }
.lang-name { min-width: 0; overflow-wrap: anywhere; text-align: left; }
html[dir="rtl"] .lang-name { text-align: right; }
.lang-code { color: var(--text-3); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lang-empty { padding: 30px 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.lang-empty small { display: block; margin-top: 4px; font-size: 12px; }
.lang-foot { display: flex; flex: 0 0 auto; justify-content: space-between; gap: 10px; padding: 9px 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 11px; }
.lang summary:focus-visible, .lang-close:focus-visible, .lang-menu .lang-option:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
