.lev-lang {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 9999;
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.lev-lang * {
    box-sizing: border-box;
}

.lev-lang__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
    box-shadow: none;
    outline: none;
    min-height: 40px;
}

.lev-lang__btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.lev-lang__btn:focus-visible {
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, .08);
}

.lev-lang__flag {
    width: 22px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 2px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    line-height: 1;
}

.lev-lang__flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lev-lang__flag--code {
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    letter-spacing: .02em;
}

.lev-lang__name {
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 12px;
}

.lev-lang__arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: transform .2s ease;
}

.lev-lang__arrow svg {
    width: 12px;
    height: 12px;
    display: block;
}

.lev-lang[data-open="true"] .lev-lang__btn {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.lev-lang[data-open="true"] .lev-lang__arrow {
    transform: rotate(180deg);
}

.lev-lang__list {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    min-width: 100%;
    max-width: 240px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.lev-lang[data-open="true"] .lev-lang__list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear 0s;
}

.lev-lang__item {
    margin: 0;
    padding: 0;
}

.lev-lang__item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
    white-space: nowrap;
}

.lev-lang__item a:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.lev-lang__item.is-active a {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 600;
}

.lev-lang__item.is-active a::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16a34a;
    margin-left: auto;
    flex-shrink: 0;
}

.lev-lang__item-label {
    text-transform: none;
}

@media (max-width: 640px) {
    .lev-lang {
        left: 12px;
        bottom: 12px;
    }

    .lev-lang__btn {
        padding: 7px 10px 7px 8px;
        min-height: 36px;
    }

    .lev-lang__list {
        max-width: 200px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lev-lang__btn,
    .lev-lang__arrow,
    .lev-lang__list,
    .lev-lang__item a {
        transition: none;
    }
}
