.avc-language {
    position: relative;
    display: flex;
    align-items: center;
    justify-self: end;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 12px;
}

.avh5-topbar > .avc-language {
    --avc-ink: var(--avh5-ink, #10201e);
    --avc-muted: var(--avh5-muted, #5f6f68);
    --avc-border: var(--avh5-line, #d9e3dd);
    --avc-surface: var(--avh5-card, #ffffff);
    --avc-soft: #f3f7f1;
    --avc-accent: var(--avh5-sea, #0f766e);
    --avc-accent-strong: #0b4f48;
    flex: 0 0 auto;
}

.avc-language a {
    color: var(--avc-ink);
    font-size: 0.92rem;
    font-weight: 750;
    text-decoration: none;
}

.avc-language a[aria-current="true"] {
    color: var(--avc-accent);
}

.avc-language__quick {
    display: flex;
    align-items: center;
    gap: 6px;
}

.avc-language__quick-link {
    min-width: 40px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--avc-border);
    border-radius: 6px;
    background: var(--avc-surface);
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.avc-language__quick-link:hover,
.avc-language__quick-link:focus-visible {
    border-color: var(--avc-accent);
    background: var(--avc-soft);
}

.avc-language__menu {
    position: relative;
}

.avc-language__trigger {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--avc-border);
    border-radius: 6px;
    background: var(--avc-surface);
    color: var(--avc-ink);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 750;
    list-style: none;
    white-space: nowrap;
}

.avc-language__trigger::-webkit-details-marker {
    display: none;
}

.avc-language__trigger:hover,
.avc-language__trigger:focus-visible,
.avc-language__menu[open] .avc-language__trigger {
    border-color: var(--avc-accent);
    background: var(--avc-soft);
}

.avc-language__trigger:focus-visible,
.avc-language a:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.28);
    outline-offset: 2px;
}

.avc-language__trigger-code,
.avc-language__option-code {
    color: var(--avc-accent-strong);
    font-weight: 850;
}

.avc-language__chevron {
    display: inline-block;
    margin-left: 2px;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 160ms ease;
}

.avc-language__menu[open] .avc-language__chevron {
    transform: rotate(180deg);
}

.avc-language__panel {
    box-sizing: border-box;
    position: absolute;
    z-index: 100;
    top: calc(100% + 10px);
    right: 0;
    width: min(420px, calc(100vw - 32px));
    max-height: min(520px, calc(100vh - 120px));
    overflow-y: auto;
    padding: 14px;
    border: 1px solid var(--avc-border);
    border-radius: 8px;
    background: var(--avc-surface);
    box-shadow: 0 18px 44px rgba(16, 32, 30, 0.16);
}

.avc-language__panel-title {
    margin: 0 0 10px;
    color: var(--avc-muted);
    font-size: 0.86rem;
    font-weight: 750;
}

.avc-language__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.avc-language__list li {
    min-width: 0;
    margin: 0;
}

.avc-language__option-link {
    min-height: 48px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
}

.avc-language__option-link:hover,
.avc-language__option-link:focus-visible {
    border-color: var(--avc-border);
    background: var(--avc-soft);
}

.avc-language__option-link[aria-current="true"] {
    border-color: rgba(15, 118, 110, 0.36);
    background: var(--avc-soft);
}

.avc-language__option-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 1200px) {
    .avc-language__quick {
        display: none;
    }
}

@media (max-width: 820px) {
    .avc-language {
        justify-self: center;
        justify-content: center;
    }

    .avc-language__panel {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }

    .avh5-topbar > .avc-language {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: end;
        margin-left: 0;
    }

    .avh5-topbar > .avc-language .avc-language__panel {
        right: 0;
        left: auto;
        transform: none;
    }
}

@media (max-width: 520px) {
    .avc-language__panel {
        width: min(360px, calc(100vw - 24px));
        padding: 10px;
    }

    .avc-language__list {
        grid-template-columns: 1fr;
    }

    .avh5-topbar > .avc-language .avc-language__panel {
        right: -12px;
    }

    .avc-language__option-link {
        min-height: 52px;
    }
}
