.psb-language-selector-wrap {
    display: inline-block;
    font-family: inherit;
    line-height: 1;
}

/* v1.4.3: one compact selector is used on both desktop and mobile. */
.psb-language-switcher-desktop {
    display: none !important;
}

.psb-mobile-language-switcher {
    display: inline-block;
    position: relative;
    margin: 0;
    padding: 0;
    font-family: inherit;
    line-height: 1;
}

.psb-mobile-language-switcher > summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 72px;
    min-height: 36px;
    padding: 7px 10px;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 8px;
    background: #4d2f80;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.16);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.psb-mobile-language-switcher > summary::-webkit-details-marker {
    display: none;
}

.psb-mobile-language-switcher > summary::marker {
    display: none;
    content: '';
}

.psb-mobile-language-switcher > summary:hover,
.psb-mobile-language-switcher > summary:focus-visible {
    filter: brightness(1.06);
    outline: none;
}

.psb-mobile-current-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 19px;
    line-height: 1;
    width: 21px;
    height: 19px;
    overflow: hidden;
    flex: 0 0 auto;
}

.psb-mobile-current-code {
    letter-spacing: .3px;
}

.psb-mobile-chevron {
    font-size: 10px;
    opacity: .88;
    transition: transform .15s ease;
}

.psb-mobile-language-switcher[open] .psb-mobile-chevron {
    transform: rotate(180deg);
}

.psb-mobile-language-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1000001;
    display: flex;
    flex-direction: column;
    min-width: 154px;
    padding: 5px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 9px;
    background: rgba(255,255,255,.99);
    box-shadow: 0 5px 18px rgba(0,0,0,.18);
    box-sizing: border-box;
}

.psb-mobile-lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 7px 9px;
    border-radius: 6px;
    color: #111 !important;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none !important;
    white-space: nowrap;
}

.psb-mobile-lang-option:hover,
.psb-mobile-lang-option:focus {
    background: #f3f0f8;
    text-decoration: none !important;
}

.psb-mobile-lang-option.is-active {
    background: #4d2f80;
    color: #fff !important;
    font-weight: 700;
}

.psb-mobile-lang-option > span:first-child {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 18px;
    line-height: 1;
}

/* Safe launch placement. It does not modify theme/header markup. */
.psb-auto-language-switcher {
    position: fixed;
    top: 14px;
    right: 18px;
    z-index: 999999;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    color: #111;
}

.admin-bar .psb-auto-language-switcher {
    top: 46px;
}

/* Shortcode placement inside a theme opens to the right by default; the
   automatic fixed selector opens leftward from the top-right corner. */
:not(.psb-auto-language-switcher) > .psb-language-selector-wrap .psb-mobile-language-menu {
    left: 0;
    right: auto;
}

@media (max-width: 782px) {
    .psb-auto-language-switcher {
        top: 6px;
        right: 8px;
    }

    .admin-bar .psb-auto-language-switcher {
        top: 52px;
    }

    .psb-mobile-language-switcher > summary {
        min-width: 68px;
        min-height: 34px;
        padding: 6px 9px;
        gap: 5px;
    }

    .psb-mobile-current-flag {
        font-size: 18px;
        width: 20px;
        height: 18px;
    }
}

@media (max-width: 420px) {
    .psb-mobile-language-switcher > summary {
        min-width: 64px;
        min-height: 32px;
        padding: 5px 8px;
    }

    .psb-mobile-current-flag {
        font-size: 17px;
        width: 19px;
        height: 17px;
    }
}
