/* Compact language switcher — public header & shared contexts */
.lang-switcher {
    position: relative;
    display: inline-block;
    text-align: left;
}

.lang-switcher__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.5rem;
    min-height: 2rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    color: #4b5563;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.lang-switcher__toggle:hover {
    color: #0f172a;
    background-color: rgba(15, 23, 42, 0.04);
}

.lang-switcher__toggle:focus-visible {
    outline: none;
    border-color: rgba(5, 150, 105, 0.45);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.lang-switcher.is-open .lang-switcher__toggle {
    color: #0f172a;
    background-color: rgba(15, 23, 42, 0.05);
}

.lang-switcher__icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    opacity: 0.72;
}

.lang-switcher__code {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lang-switcher__chevron {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    opacity: 0.55;
    transition: transform 0.2s ease, opacity 0.15s ease;
}

.lang-switcher.is-open .lang-switcher__chevron {
    transform: rotate(180deg);
    opacity: 0.85;
}

.lang-switcher__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.375rem);
    z-index: 50;
    min-width: 10.5rem;
    padding: 0.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.08),
        0 10px 24px -4px rgba(15, 23, 42, 0.1);
    transform: translateY(-0.375rem) scale(0.98);
    transform-origin: top right;
    transition:
        opacity 0.16s ease,
        transform 0.16s ease;
}

.lang-switcher__menu[hidden] {
    display: none !important;
}

.lang-switcher.is-open .lang-switcher__menu:not([hidden]) {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.lang-switcher__option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    font-size: 0.8125rem;
    color: #374151;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.lang-switcher__option:hover,
.lang-switcher__option:focus-visible {
    background-color: #f3f4f6;
    color: #111827;
    outline: none;
}

.lang-switcher__option.is-active {
    background-color: #ecfdf5;
    color: #047857;
}

.lang-switcher__option-code {
    min-width: 1.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.lang-switcher__option-name {
    flex: 1;
    font-size: 0.8125rem;
    color: #6b7280;
}

.lang-switcher__option.is-active .lang-switcher__option-name {
    color: #059669;
}

.lang-switcher__check {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    color: #059669;
}

/* Dashboard topbar: match icon button height */
.dash-topbar .lang-switcher__toggle {
    min-height: 2.25rem;
    padding-inline: 0.625rem;
}
