/* AILV mobile contact disclosure. Desktop presentation is unchanged. */
@media (max-width: 767px) {
    body.ailv-mobile-tools-ready {
        padding-bottom: calc(var(--ailv-mobile-tools-bar-height, 64px) + 12px) !important;
    }

    .ailv-mobile-tools-duplicate {
        display: none !important;
    }

    .ailv-mobile-bottom-bar {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-height: 64px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .ailv-mobile-bottom-bar > a,
    .ailv-mobile-chat-toggle {
        min-width: 0;
        min-height: 44px;
    }

    .ailv-mobile-chat-toggle {
        appearance: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        margin: 0;
        padding: 8px 4px;
        border: 0;
        border-left: 1px solid #374151;
        border-radius: 0;
        background: transparent;
        color: #fff;
        font: 600 12px/1.35 "Segoe UI", Arial, sans-serif;
        cursor: pointer;
        touch-action: manipulation;
    }

    .ailv-mobile-chat-toggle > svg {
        width: 20px;
        height: 20px;
        flex: none;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .ailv-mobile-chat-toggle[aria-expanded="true"] {
        background: #70ad3b;
        color: #26312c;
    }

    .ailv-mobile-chat-toggle:focus-visible,
    .ailv-mobile-bottom-bar > a:focus-visible {
        outline: 2px solid #c3e4a8;
        outline-offset: -4px;
    }

    .ailv-mobile-chat-panel {
        display: none !important;
        right: 12px !important;
        bottom: calc(var(--ailv-mobile-tools-bar-height, 64px) + 12px) !important;
        left: auto !important;
        z-index: 9997;
        width: max-content;
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - var(--ailv-mobile-tools-bar-height, 64px) - 100px);
        max-height: calc(100dvh - var(--ailv-mobile-tools-bar-height, 64px) - 100px);
        gap: 8px !important;
        padding: 12px;
        overflow-y: auto;
        overscroll-behavior: contain;
        border: 1px solid #dfe7df;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 12px 35px rgba(38, 49, 44, .2);
    }

    .ailv-mobile-chat-panel.is-open {
        display: flex !important;
    }

    .ailv-mobile-chat-panel > a {
        min-width: 44px;
        min-height: 44px;
        flex-shrink: 0;
    }

    .ailv-mobile-chat-panel > a:focus-visible {
        outline: 3px solid #26312c;
        outline-offset: 3px;
    }

    /* Above the header (9999), below the existing menu/mask (99999/99998). */
    body .gt_switcher_wrapper {
        position: fixed !important;
        top: 18px !important;
        right: 68px !important;
        bottom: auto !important;
        left: auto !important;
        z-index: 10000 !important;
        width: max-content;
        max-width: 130px;
        margin: 0 !important;
    }

    body.admin-bar .gt_switcher_wrapper {
        top: 64px !important;
    }

    body .gt_switcher_wrapper .gt_float_switcher {
        position: relative;
        max-width: 130px;
        border-radius: 5px;
        font-size: 12px;
        line-height: 1.25;
    }

    body .gt_switcher_wrapper .gt-selected .gt-current-lang {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 4px 7px;
        font-size: 12px;
        line-height: 1.25;
    }

    body .gt_switcher_wrapper .gt-selected img {
        width: 20px;
        height: auto;
        margin-right: 5px;
    }

    body .gt_switcher_wrapper .gt_float_switcher .gt_options {
        position: absolute;
        top: 100%;
        right: 0;
        bottom: auto;
        left: auto;
        min-width: 160px;
        max-width: calc(100vw - 24px);
        max-height: min(60vh, 360px);
        overflow-y: auto;
    }
}

@media (max-width: 359px) {
    body .gt_switcher_wrapper {
        right: 62px !important;
        max-width: 110px;
    }

    body .gt_switcher_wrapper .gt_float_switcher {
        max-width: 110px;
    }

    body .gt_switcher_wrapper .gt-selected .gt-current-lang {
        padding-right: 5px;
        padding-left: 5px;
        font-size: 11px;
    }
}


/* Keep one mobile language control when the site-wide translation widget loads. */
@media (max-width: 767px) {
    body.ailv-mobile-has-translation-widget .ailv-language-switcher { display: none !important; }
    body .gt_switcher_wrapper > .gt_switcher-popup { display: flex; align-items: center; min-height: 44px; padding: 4px 7px; border: 1px solid #dfe7df; border-radius: 5px; }
}

/* Language switching disabled at the owner's request; content and URLs are retained. */
html body .ailv-language-switcher { display: none !important; }
