.language-picker { position: relative; }
.language-picker-button, .language-picker-option, .language-popup-actions button, .language-offer button {
    min-height: 2.75rem;
    max-width: 100%;
    white-space: normal;
}
.language-popup-dialog, .language-country-list {
    width: 100%;
    max-width: 28rem;
    overflow: auto;
}
.language-picker-menu {
    position: absolute;
    right: 0;
    left: auto;
    top: 100%;
    z-index: 30;
    min-width: 100%;
    width: 12rem;
    width: -webkit-max-content;
    width: max-content;
    max-width: 22rem;
    max-width: calc(100vw - 16px);
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    background: #fff;
    color: #111;
    border: 1px solid #ccc;
    padding: .5rem;
}
[dir="rtl"] .language-picker-menu {
    right: auto;
    left: 0;
}
.language-picker-option { display: flex; align-items: center; width: auto; max-width: none; white-space: nowrap; text-align: left; }
.language-picker-option > * + * { margin-left: .5rem; }
.language-picker-menu .language-picker-option > span,
.language-picker-menu .language-picker-option > small { white-space: nowrap; }
.language-picker-option:focus, .language-picker-button:focus, .language-popup-dialog :focus {
    outline: 3px solid #0b5fff;
    outline-offset: 2px;
}
.language-popup { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0,0,0,.35); z-index: 80; display: flex; align-items: flex-end; justify-content: center; padding: 1rem; }
.language-popup-dialog { background: #fff; color: #111; width: 100%; max-width: 36rem; max-height: 85vh; overflow: auto; padding: 1rem; position: relative; }
.language-country-list { list-style: none; margin: 0; padding: 0; max-height: 12rem; }
.language-country-list li { display: flex; align-items: center; padding: .4rem; }
.language-country-list li > * + * { margin-left: .5rem; }
.language-offer, .language-popup-actions, .language-picker-error { display: flex; flex-wrap: wrap; align-items: center; margin: -.25rem; }
.language-offer > *, .language-popup-actions > *, .language-picker-error > * { margin: .25rem; }
@media (max-width: 40rem) {
    .language-popup { align-items: stretch; top: 4.5rem; z-index: 1040; }
    .language-popup-dialog { width: 100%; max-height: 100%; }
}
