.language-picker { display:inline-flex; align-items:center; width:136px; flex-shrink:0; }
.login-screen > .language-picker { position:absolute; top:24px; left:24px; }
@media(max-width:600px) { .topbar-actions { flex-wrap:wrap; } }

/* Local SVGs keep flags consistent on Windows and mobile without emoji fonts. */
.language-picker .choices__item[data-value="tr"]::before,
.language-picker .choices__item[data-value="en"]::before {
  content:""; display:inline-block; width:21px; height:14px; margin-inline-end:7px;
  vertical-align:-2px; background-size:100% 100%; background-repeat:no-repeat;
  border-radius:2px; box-shadow:0 0 0 1px rgba(0,0,0,.12);
}
.language-picker .choices__item[data-value="tr"]::before,
.pbx-language-picker .choices__item[data-value="tr"]::before { background-image:url('/img/flags/tr.svg'); }
.language-picker .choices__item[data-value="en"]::before,
.pbx-language-picker .choices__item[data-value="en"]::before { background-image:url('/img/flags/gb.svg'); }
.pbx-language-picker .choices__item::before {
    content:""; display:inline-block; width:20px; height:14px; margin-inline-end:8px;
    background-size:cover; background-position:center; border-radius:2px; vertical-align:-2px;
}

.language-picker .choices__item { white-space:nowrap; }

/* Keep navigation scrollable while the language control stays at the bottom. */
#sidebar { height:100dvh; overflow:hidden; }
#sidebar .sidebar-brand { flex-shrink:0; }
#sidebar .sidebar-nav { min-height:0; overflow-y:auto; }
.sidebar-footer { flex-shrink:0; margin-top:12px; padding-top:12px; border-top:1px solid var(--border-subtle); }
.sidebar-footer .language-picker { width:100%; }
@media(max-width:860px) {
  #sidebar { height:auto; overflow:visible; }
  #sidebar .sidebar-footer { display:none; grid-column:1 / -1; }
  #sidebar.mobile-open { height:100dvh; overflow:hidden; grid-template-rows:auto minmax(0,1fr) auto; }
  #sidebar.mobile-open .sidebar-nav { max-height:none; align-self:stretch; }
  #sidebar.mobile-open .sidebar-footer { display:block; padding-bottom:env(safe-area-inset-bottom); }
}
