/* RailLearn – saubere Sprachauswahl im Header */

.rl-language-picker,
.rl-language-picker * {
    box-sizing: border-box;
}

.rl-language-picker {
    position: relative;
    z-index: 5000;
    margin-left: auto;
    flex: 0 0 auto;
    font-family: Arial, Helvetica, sans-serif;
}

.rl-language-button,
.rl-language-option {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
}

.rl-language-button {
    width: 166px;
    min-height: 44px;
    padding: 8px 11px;
    display: grid;
    grid-template-columns: 24px 28px minmax(0, 1fr) 12px;
    align-items: center;
    gap: 7px;

    color: #ffffff;
    background: #2f3733;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    box-shadow: none;
    cursor: pointer;
}

.rl-language-button:hover,
.rl-language-button:focus-visible,
.rl-language-picker.is-open .rl-language-button {
    background: #39443f;
    outline: none;
}

.rl-language-button img,
.rl-language-option img {
    width: 24px;
    height: 16px;
    display: block;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.36);
    border-radius: 2px;
}

.rl-language-short {
    font-size: 0.70rem;
    font-weight: 900;
    line-height: 1;
}

.rl-language-name {
    min-width: 0;
    overflow: hidden;
    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rl-language-chevron {
    font-size: 0.72rem;
    line-height: 1;
    transition: transform 150ms ease;
}

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

.rl-language-menu[hidden] {
    display: none !important;
}

.rl-language-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 5001;

    width: 225px;
    max-height: min(410px, calc(100vh - 100px));
    padding: 7px;
    display: grid;
    gap: 3px;
    overflow-y: auto;

    background: #ffffff;
    border: 2px solid #202722;
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.30);
}

.rl-language-option {
    width: 100%;
    min-height: 42px;
    padding: 8px 9px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;

    color: #182019;
    background: transparent;
    border: 0;
    border-radius: 7px;
    text-align: left;
    cursor: pointer;
}

.rl-language-option:hover,
.rl-language-option:focus-visible {
    background: #e3e9e5;
    outline: none;
}

.rl-language-option.is-active {
    color: #ffffff;
    background: #657a70;
}

.rl-language-option span {
    min-width: 0;
    overflow: hidden;
    font-size: 0.86rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rl-language-option small {
    font-size: 0.68rem;
    font-weight: 900;
    opacity: 0.72;
}

@media (max-width: 900px) {
    .rl-language-picker {
        order: 2;
        margin-left: auto;
    }

    .rl-language-button {
        width: 108px;
        grid-template-columns: 24px 28px 12px;
    }

    .rl-language-name {
        display: none;
    }
}

@media (max-width: 520px) {
    .rl-language-button {
        width: 56px;
        grid-template-columns: 24px 12px;
        padding-inline: 8px;
    }

    .rl-language-short {
        display: none;
    }

    .rl-language-menu {
        right: -4px;
        width: 215px;
    }
}
