.pboot-translate-switcher {
    position: relative;
    display: inline-block;
    margin-left: 12px;
    vertical-align: middle;
    z-index: 20;
}

/* Keep the native region-language markup and URLs intact without rendering a second control. */
.pboot-native-lang {
    display: none !important;
}

.header-right > .pboot-translate-switcher {
    display: inline-block;
    width: auto;
    height: auto;
    line-height: normal;
    text-align: left;
}

.pboot-translate-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid rgba(231, 229, 228, .55);
    border-radius: 2px;
    background: rgba(35, 53, 70, .42);
    color: #ffffff;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}

.pboot-translate-trigger:hover,
.pboot-translate-trigger:focus-visible {
    border-color: #ffffff;
    background: var(--color-active, #0054A3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
    outline: 0;
}

.pboot-translate-trigger-globe {
    width: 17px;
    height: 17px;
    object-fit: contain;
    opacity: .95;
}

.pboot-translate-trigger-arrow {
    width: 6px;
    height: 6px;
    margin-left: 2px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

.pboot-translate-overlay {
    position: fixed;
    z-index: 1050;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 20px 40px;
    background: rgba(17, 24, 39, .48);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}

.pboot-translate-overlay[hidden] {
    display: none;
}

.pboot-translate-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.pboot-translate-dialog {
    width: min(560px, 100%);
    max-height: min(560px, 76vh);
    overflow: auto;
    border: 1px solid #dce5ed;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 18px 54px rgba(15, 23, 42, .28);
    transform: translateY(-8px);
    transition: transform .18s ease;
}

.pboot-translate-overlay.is-open .pboot-translate-dialog {
    transform: translateY(0);
}

.pboot-translate-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px 14px;
    border-bottom: 3px solid var(--color-active, #0054A3);
    background: #f7fafc;
}

.pboot-translate-dialog-title {
    margin: 0;
    color: #263746;
    font-size: 18px;
    font-weight: 600;
}

.pboot-translate-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.pboot-translate-close:hover,
.pboot-translate-close:focus-visible {
    background: #eaf2f8;
    color: var(--color-active, #0054A3);
    outline: 0;
}

.pboot-translate-language-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 20px 22px 24px;
}

.pboot-translate-language {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 9px 12px;
    border: 1px solid #e3e7eb;
    border-radius: 3px;
    background: #ffffff;
    color: #27313b;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.pboot-translate-language:hover,
.pboot-translate-language:focus-visible,
.pboot-translate-language.is-current {
    border-color: var(--color-active, #0054A3);
    background: #edf5fb;
    color: var(--color-active, #0054A3);
    outline: 0;
}

.pboot-translate-language img {
    flex: 0 0 auto;
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 2px;
}

.pboot-translate-language-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.pboot-translate-open {
    overflow: hidden;
}

@media (max-width: 576px) {
    .header-right {
        gap: 8px;
    }

    .pboot-translate-switcher {
        flex: 0 0 34px;
        width: 34px;
        margin-left: 8px;
    }

    .header-right > .pboot-translate-switcher {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        line-height: 34px;
    }

    .pboot-translate-trigger {
        width: 34px;
        min-width: 34px;
        min-height: 34px;
        justify-content: center;
        padding-right: 8px;
        padding-left: 8px;
    }

    .pboot-translate-trigger-text,
    .pboot-translate-trigger-arrow {
        display: none;
    }

    .pboot-translate-trigger-text {
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pboot-translate-overlay {
        align-items: flex-start;
        padding: 72px 10px 20px;
    }

    .pboot-translate-dialog-header {
        padding: 16px 16px 12px;
    }

    .pboot-translate-language-list {
        grid-template-columns: 1fr;
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pboot-translate-trigger,
    .pboot-translate-overlay,
    .pboot-translate-dialog,
    .pboot-translate-language {
        transition: none;
    }
}
