/* Keep the Calltouch counter and the Envybox chat window, but hide their launchers. */
iframe#CalltouchWidgetFrame,
iframe[name="CalltouchWidgetFrame"],
.ws-chat .ws-chat-btn-container,
.ws-chat .ws-chat-invitation-container {
    display: none !important;
    visibility: hidden !important;
}

.ws-chat .ws-chat-container {
    max-width: 100vw;
}

body {
    --contact-dock-bottom: calc(var(--contact-dock-nav-height, 0px) + 16px + env(safe-area-inset-bottom, 0px));
    --contact-dock-right: max(16px, env(safe-area-inset-right, 0px));
    --contact-dock-size: 52px;
}

.contact-dock {
    position: fixed;
    z-index: 1000;
    right: var(--contact-dock-right);
    bottom: var(--contact-dock-bottom);
}

.contact-dock[hidden],
.contact-dock__options[hidden],
.contact-dock__toggle[aria-expanded="false"] .contact-dock__close,
.contact-dock__toggle[aria-expanded="true"] .contact-dock__bubble,
.contact-dock__status:empty {
    display: none;
}

.contact-dock__toggle,
.contact-dock__action {
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
}

.contact-dock__toggle {
    width: var(--contact-dock-size);
    height: var(--contact-dock-size);
    background: #f6c44f;
}

.contact-dock__options {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    width: 60px;
    max-height: calc(100dvh - var(--contact-dock-bottom) - 68px);
    padding: 8px;
    margin: 0 -4px 0 0;
    overflow: auto;
}

.contact-dock__action {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    background: var(--contact-icon-color);
}

.contact-dock__action--mail { --contact-icon-color: #f6c44f; }
.contact-dock__action--vk { --contact-icon-color: #4680c2; }
.contact-dock__action--telegram { --contact-icon-color: #0088cc; }
.contact-dock__action--chat { --contact-icon-color: #f5c854; }

.contact-dock :is(a, button):focus-visible {
    outline: 2px solid #1e1e1e;
    outline-offset: 2px;
}

.contact-dock svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.contact-dock__toggle .contact-dock__bubble {
    width: 28px;
    height: 28px;
}

.contact-dock__status {
    position: absolute;
    right: calc(100% + 8px);
    bottom: 68px;
    width: min(172px, calc(100vw - 100px));
    padding: 8px 10px;
    border-radius: 12px;
    background: #fff;
    color: #1e1e1e;
    font-size: 13px;
    line-height: 1.35;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .18);
}

@media (max-width: 1199px) {
    body:is(.mobile-menu-open, :has(.cookie-banner.visible)) .contact-dock {
        display: none;
    }
}

body:has(.contact-dock:not([hidden])) .page-up {
    z-index: 1000;
    right: calc(var(--contact-dock-right) + var(--contact-dock-size) + 12px);
    bottom: var(--contact-dock-bottom);
    transition: opacity 160ms ease-out;
}

/* The shared visually-hidden utility normally moves the button out of its fixed position. */
body:has(.contact-dock:not([hidden])) .page-up.visually-hidden {
    position: fixed !important;
    margin: 0 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    body:has(.contact-dock:not([hidden])) .page-up {
        transition: none;
    }
}
