/* KF Translator — language switcher (bottom-right) */
.kft-switcher {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
}
.kft-switcher__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #1d2327;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 999px;
    padding: 9px 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s ease, box-shadow .15s ease;
}
.kft-switcher__toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.16);
}
.kft-switcher .kft-flag { font-size: 18px; line-height: 1; }
.kft-switcher .kft-code { font-weight: 600; letter-spacing: .5px; }
.kft-switcher .kft-caret { font-size: 12px; opacity: .7; }

.kft-switcher__menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    min-width: 200px;
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    border: 1px solid rgba(0,0,0,0.06);
    list-style: none;
    padding: 6px 0;
    margin: 0;
    display: none;
}
.kft-switcher.is-open .kft-switcher__menu { display: block; }
.kft-switcher .kft-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    color: #1d2327;
}
.kft-switcher .kft-item a:hover { background: #f4f6f8; }
.kft-switcher .kft-item.is-active a { background: #eef5ff; font-weight: 600; }
.kft-switcher .kft-item .kft-name { white-space: nowrap; }

@media (max-width: 768px) {
    /* Move switcher to bottom-LEFT on mobile to avoid covering theme's hamburger / bottom nav */
    .kft-switcher { right: auto; left: 10px; bottom: 10px; }
    .kft-switcher__menu { right: auto; left: 0; }
    /* Push above iOS Safari bottom bar */
    @supports (bottom: env(safe-area-inset-bottom)) {
        .kft-switcher { bottom: calc(10px + env(safe-area-inset-bottom)); }
    }
    .kft-switcher__toggle { padding: 10px 14px; }
    /* Larger tap targets in the menu */
    .kft-switcher .kft-item a { padding: 11px 16px; }
}
