.aml-language-picker {
    --aml-accent: #C8864A;
    --aml-bg: #FFFFFF;
    --aml-text: #1A1A1A;
    --aml-border: #EBEBEB;
    --aml-shadow: 0 16px 48px rgba(0,0,0,0.13);
    --aml-radius: 8px;
    --aml-dropdown-width: 220px;
    position: relative;
    display: inline-flex;
    align-items: center;
    color: inherit;
    font-family: inherit;
}

.aml-language-picker--topbar {
    position: relative;
}

.aml-language-picker__toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 4px;
    font: inherit;
    color: inherit;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

.aml-language-picker__toggle:hover,
.aml-language-picker.is-open .aml-language-picker__toggle {
    background: rgba(255, 255, 255, 0.08);
    color: var(--aml-accent);
}

.aml-language-picker__toggle:focus-visible,
.aml-language-picker__chip:focus-visible,
.aml-language-picker__item:focus-visible {
    outline: 2px solid var(--aml-accent);
    outline-offset: 2px;
}

.aml-language-picker__icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
}

.aml-language-picker__icon svg {
    width: 14px;
    height: 14px;
    stroke-width: 1.8;
}

.aml-language-picker__toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.aml-language-picker__arrow {
    font-size: 0.55rem;
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.aml-language-picker.is-open .aml-language-picker__arrow {
    transform: rotate(180deg);
}

.aml-language-picker__dropdown {
    position: absolute;
    top: calc(100% + 10px);
    min-width: var(--aml-dropdown-width);
    background: var(--aml-bg);
    color: var(--aml-text);
    border: 1px solid var(--aml-border);
    border-radius: var(--aml-radius);
    box-shadow: var(--aml-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    z-index: 1002;
    overflow: hidden;
}

.aml-language-picker--right .aml-language-picker__dropdown {
    right: 0;
}

.aml-language-picker--left .aml-language-picker__dropdown {
    left: 0;
}

.aml-language-picker__dropdown::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 16px;
    width: 12px;
    height: 12px;
    background: var(--aml-bg);
    border-top: 1px solid var(--aml-border);
    border-left: 1px solid var(--aml-border);
    transform: rotate(45deg);
}

.aml-language-picker--left .aml-language-picker__dropdown::before {
    left: 16px;
    right: auto;
}

.aml-language-picker.is-open .aml-language-picker__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.aml-language-picker__dropdown-header {
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--aml-border);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #6b6b6b;
}

.aml-language-picker__list {
    padding: 6px;
}

.aml-language-picker__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--aml-text);
    transition: background 0.2s ease;
}

.aml-language-picker__item:hover {
    background: #f0ece8;
}

.aml-language-picker__item.is-active {
    background: rgba(200, 134, 74, 0.12);
}

.aml-language-picker__item-code {
    min-width: 32px;
    text-align: center;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: #f0ece8;
    color: #6b6b6b;
    flex-shrink: 0;
}

.aml-language-picker__item.is-active .aml-language-picker__item-code {
    background: var(--aml-accent);
    color: #fff;
}

.aml-language-picker__item-name {
    flex: 1;
    min-width: 0;
    font-size: 0.88rem;
    font-weight: 500;
}

.aml-language-picker__item.is-active .aml-language-picker__item-name {
    color: var(--aml-accent);
    font-weight: 600;
}

.aml-language-picker__check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--aml-accent);
    position: relative;
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.aml-language-picker__check::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 3px;
    width: 4px;
    height: 8px;
    border: 1.5px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.aml-language-picker__item.is-active .aml-language-picker__check {
    opacity: 1;
    transform: scale(1);
}

.aml-language-picker--chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.aml-language-picker__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 30px;
    border: 1.5px solid transparent;
    background: #f0ece8;
    color: var(--aml-text);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 600;
}

.aml-language-picker__chip:hover {
    border-color: var(--aml-text);
    background: #fff;
}

.aml-language-picker__chip.is-active {
    background: rgba(200, 134, 74, 0.12);
    border-color: var(--aml-accent);
    color: var(--aml-accent);
}

.aml-language-picker__chip-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.06);
    min-width: 28px;
    text-align: center;
}

.aml-language-picker__chip.is-active .aml-language-picker__chip-code {
    background: var(--aml-accent);
    color: #fff;
}

body.aml-queue-overlay-open {
    overflow: hidden;
}

.aml-queue-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.46);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.aml-queue-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.aml-queue-overlay__dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    background: #fff;
    color: #111827;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
    padding: 28px 24px 24px;
}

.aml-queue-overlay__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #111827;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.aml-queue-overlay__spinner {
    width: 46px;
    height: 46px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--aml-accent);
    border-radius: 50%;
    animation: amlQueueSpin 0.9s linear infinite;
    margin-bottom: 18px;
}

.aml-queue-overlay__spinner[hidden],
.aml-queue-overlay__error[hidden],
.aml-queue-overlay__button[hidden] {
    display: none !important;
}

.aml-queue-overlay__badge {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(200, 134, 74, 0.12);
    color: #9a6434;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.aml-queue-overlay__title {
    margin: 0 0 10px;
    font-size: 28px;
    line-height: 1.2;
}

.aml-queue-overlay__message {
    margin: 0 0 14px;
    color: #4b5563;
    line-height: 1.65;
}

.aml-queue-overlay__meta {
    margin: 0 0 14px;
    font-size: 13px;
    color: #6b7280;
}

.aml-queue-overlay__error {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
    line-height: 1.55;
    word-break: break-word;
}

.aml-queue-overlay__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.aml-queue-overlay__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
}

.aml-queue-overlay__button--primary {
    background: var(--aml-accent);
    color: #fff;
    border-color: var(--aml-accent);
}

.aml-queue-overlay__button--secondary {
    background: #fff;
    color: #111827;
    border-color: #d1d5db;
}

@keyframes amlQueueSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .aml-language-picker__dropdown {
        min-width: min(260px, calc(100vw - 32px));
    }

    .aml-queue-overlay__dialog {
        padding: 24px 18px 18px;
    }

    .aml-queue-overlay__title {
        font-size: 24px;
    }
}
