/* Пусковая кнопка чата выглядит одинаково в зрительской части и панелях */
body:is(.quick-tickets-floating-controls-ready, .panel-support-chat-enabled) .online-chat-root.online-chat-root-Verbox #supportTrigger.trigger {
    z-index: 1020 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: var(--quick-tickets-touch-target, 44px) !important;
    min-width: var(--quick-tickets-touch-target, 44px) !important;
    max-width: var(--quick-tickets-touch-target, 44px) !important;
    height: var(--quick-tickets-touch-target, 44px) !important;
    min-height: var(--quick-tickets-touch-target, 44px) !important;
    max-height: var(--quick-tickets-touch-target, 44px) !important;
    border: 2px solid rgba(255, 255, 255, 0.96) !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: 0 4px 14px rgba(54, 54, 54, 0.22) !important;
    line-height: 0 !important;
    transition: box-shadow 150ms ease !important;
}

body:is(.quick-tickets-floating-controls-ready, .panel-support-chat-enabled) .online-chat-root.online-chat-root-Verbox #supportTrigger.trigger:hover,
body:is(.quick-tickets-floating-controls-ready, .panel-support-chat-enabled) .online-chat-root.online-chat-root-Verbox #supportTrigger.trigger:focus {
    box-shadow: 0 6px 18px rgba(54, 54, 54, 0.3) !important;
    outline: 2px solid var(--quick-tickets-color-focus, #a33d0d) !important;
    outline-offset: 2px !important;
}

body:is(.quick-tickets-floating-controls-ready, .panel-support-chat-enabled) .online-chat-root.online-chat-root-Verbox #supportTrigger .trigger-image {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    line-height: 0 !important;
}

body:is(.quick-tickets-floating-controls-ready, .panel-support-chat-enabled) .online-chat-root.online-chat-root-Verbox #supportTrigger .trigger-image img {
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
}

/* Кнопка скрытия остаётся рядом с чатом при изменении безопасной области экрана */
body.panel-support-chat-enabled {
    --panel-support-chat-right: 16px;
    --panel-support-chat-right: max(16px, env(safe-area-inset-right));
    --panel-support-chat-bottom: 16px;
    --panel-support-chat-bottom: max(16px, env(safe-area-inset-bottom));
}

/* На страницах зала оставляем место для кнопок масштаба при максимальном размере интерфейса */
body.panel-support-chat-enabled.panel-support-chat-with-hall {
    --panel-support-chat-bottom: 252px;
    --panel-support-chat-bottom: max(252px, env(safe-area-inset-bottom));
}

body.panel-support-chat-enabled .online-chat-root.online-chat-root-Verbox #supportTrigger.trigger {
    right: var(--panel-support-chat-right) !important;
    bottom: var(--panel-support-chat-bottom) !important;
}

body.panel-support-chat-enabled .panel-support-chat-dismiss {
    position: fixed;
    right: calc(var(--panel-support-chat-right) - 8px);
    bottom: calc(var(--panel-support-chat-bottom) + 34px);
    z-index: 1021;
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 1px solid #dedede;
    border-radius: 50%;
    appearance: none;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(54, 54, 54, 0.18);
    color: #6f6f6f;
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

body.panel-support-chat-enabled .panel-support-chat-dismiss::before,
body.panel-support-chat-enabled .panel-support-chat-dismiss::after {
    position: absolute;
    top: 10px;
    left: 5px;
    width: 12px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    content: '';
    transform: rotate(45deg);
}

body.panel-support-chat-enabled .panel-support-chat-dismiss::after {
    transform: rotate(-45deg);
}

body.panel-support-chat-enabled .panel-support-chat-dismiss:hover,
body.panel-support-chat-enabled .panel-support-chat-dismiss:focus-visible {
    border-color: #a33d0d;
    box-shadow: 0 3px 10px rgba(54, 54, 54, 0.24);
    color: #a33d0d;
}

body.panel-support-chat-enabled .panel-support-chat-dismiss:focus-visible {
    outline: 2px solid #a33d0d;
    outline-offset: 2px;
}

/* Скрытие действует до перезагрузки и сохраняется при повторном создании пусковой кнопки сервисом */
body.panel-support-chat-enabled.panel-support-chat-hidden .online-chat-root.online-chat-root-Verbox #supportTrigger.trigger,
body.panel-support-chat-enabled.panel-support-chat-hidden .panel-support-chat-dismiss,
body.panel-support-chat-enabled .panel-support-chat-dismiss[hidden] {
    display: none !important;
}

body.panel-support-chat-enabled.modal-open .online-chat-root.online-chat-root-Verbox,
body.panel-support-chat-enabled.modal-open .panel-support-chat-dismiss {
    visibility: hidden !important;
    pointer-events: none !important;
}

@media print {
    body.panel-support-chat-enabled .online-chat-root.online-chat-root-Verbox,
    body.panel-support-chat-enabled .panel-support-chat-dismiss {
        display: none !important;
    }
}
