/* Плавающая кнопка: стили изолированы от сеток и кнопок темы. */
.ct-floating-contact {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    left: auto;
    bottom: max(22px, env(safe-area-inset-bottom));
    width: max-content;
    max-width: calc(100vw - 24px);
    z-index: 9000;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.35; 
}
/* Если Jivo включён, располагаем плавающую кнопку над ним справа. */
.ct-floating-contact--with-jivo {
    right: max(var(--ct-jivo-right, 40px), env(safe-area-inset-right));
    bottom: calc(48px + env(safe-area-inset-bottom));
}
.ct-floating-contact *,
.ct-floating-contact *::before,
.ct-floating-contact *::after {
    box-sizing: border-box;
}
.ct-floating-contact__menu[hidden] { display: none !important; }
.ct-floating-contact__menu {
    position: absolute;
    right: 0;
    left: auto;
    bottom: calc(100% + 10px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(250px, calc(100vw - 30px));
    max-height: 65vh;
    max-height: min(65vh, calc(100dvh - 180px));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 3px 0;
    scrollbar-width: thin;
}
.ct-floating-contact__item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 56px;
    padding: 8px 12px;
    border-radius: 16px;
    background: #198f43;
    color: #fff;
    box-shadow: none;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.25;
    transition: background-color .15s ease, transform .15s ease;
}
.ct-floating-contact__item:link,
.ct-floating-contact__item:visited { color: #fff; }
.ct-floating-contact__item:hover,
.ct-floating-contact__item:focus-visible {
    background: #107637;
    color: #fff;
    transform: translateY(-1px);
}
.ct-floating-contact__item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    color: #198f43;
    background: #fff;
    border-radius: 50%;
    overflow: hidden;
}
.ct-floating-contact__item-icon svg { width: 22px; height: 22px; }
.ct-floating-contact__img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: contain;
}
.ct-floating-contact__item-name { min-width: 0; overflow-wrap: anywhere; }
.ct-floating-contact__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 66px;
    padding: 9px 21px 9px 12px;
    border: 0;
    border-radius: 100px;
    background: linear-gradient(112deg, #12883d 0%, #27a955 100%);
    color: #fff;
    box-shadow: none;
    font: inherit;
    font-weight: 800;
    font-size: 19px;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    appearance: none;
    -webkit-appearance: none;
    transition: filter .15s ease, transform .15s ease;
}
.ct-floating-contact__toggle:hover { filter: brightness(1.07); transform: translateY(-1px); }
.ct-floating-contact__toggle:focus-visible,
.ct-floating-contact__item:focus-visible { outline: 3px solid #1483c9; outline-offset: 3px; }
.ct-floating-contact__star {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .25);
}
.ct-floating-contact__star svg { width: 24px; height: 24px; }
.ct-floating-contact__close { display: none; font-size: 30px; font-weight: 400; line-height: 1; }  
.ct-floating-contact.is-open .ct-floating-contact__star { display: none; }
.ct-floating-contact.is-open .ct-floating-contact__close { display: block; }
@media (max-width: 600px) {
    .ct-floating-contact { right: max(12px, env(safe-area-inset-right)); left: auto; bottom: calc(15px + env(safe-area-inset-bottom)); }
    .ct-floating-contact--with-jivo {
        right: max(var(--ct-jivo-right, 20px), env(safe-area-inset-right));
        bottom: calc(101px + env(safe-area-inset-bottom));
    }
/* На телефонах оставляем только иконку: круглая кнопка без текста. */
    .ct-floating-contact__toggle {
        width: 58px;
        height: 58px;
        min-height: 58px;
        padding: 0;
        gap: 0;
        border-radius: 50%;
    }
    .ct-floating-contact__toggle-label { display: none; }
    .ct-floating-contact__star { width: 40px; height: 40px; flex-basis: 40px; }
    .ct-floating-contact__item { min-height: 52px; padding: 7px 11px; font-size: 15px; }
    .ct-floating-contact__item-icon { width: 36px; height: 36px; flex-basis: 36px; }
    .ct-floating-contact__menu { width: min(236px, calc(100vw - 24px)); max-height: 61vh; max-height: min(61vh, calc(100dvh - 160px)); }
}
@media (prefers-reduced-motion: reduce) {
    .ct-floating-contact__toggle, .ct-floating-contact__item { transition: none; }
}
