#sait-chat-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100000;
    font-family: Arial, sans-serif;
}

#sait-chat-widget [hidden] {
    display: none !important;
}

#sait-chat-toggle {
    border: 0;
    border-radius: 30px;
    padding: 16px 22px;
    background: #fe0056;
    color: #fff;
    font: 600 15px Arial, sans-serif;
    box-shadow: 0 5px 22px #0003;
    cursor: pointer;
}

#sait-chat-panel {
    position: absolute;
    right: 0;
    bottom: 64px;
    display: flex;
    flex-direction: column;
    width: min(420px, calc(100vw - 32px));
    height: min(720px, calc(100vh - 110px));
    height: min(720px, calc(100dvh - 110px));
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 45px #0004;
}

#sait-chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

#sait-chat-toolbar a {
    color: #555;
    font-size: 12px;
    text-decoration: underline;
}

#sait-chat-close {
    border: 0;
    padding: 4px 10px;
    background: transparent;
    color: #222;
    font-size: 24px;
    cursor: pointer;
}

#sait-chat-frame {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    border: 0;
    background: #fff;
}

@media (max-width: 480px) {
    #sait-chat-widget {
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
    }

    #sait-chat-panel {
        position: fixed;
        inset: 8px;
        width: auto;
        height: calc(100vh - 16px);
        height: calc(100dvh - 16px);
    }
}

/* Мягкое привлечение внимания к кнопке */
#sait-chat-toggle {
    transition: transform 180ms ease, box-shadow 180ms ease;
}

#sait-chat-toggle.sait-chat-attention {
    animation: sait-chat-pulse 1.3s ease-out 2;
}

@keyframes sait-chat-pulse {
    0% {
        box-shadow:
            0 5px 22px #0003,
            0 0 0 0 rgba(254, 0, 86, 0.28);
    }

    100% {
        box-shadow:
            0 5px 22px #0003,
            0 0 0 14px rgba(254, 0, 86, 0);
    }
}

@media (hover: hover) {
    #sait-chat-toggle:hover {
        transform: translateY(-2px);
    }
}

#sait-chat-toggle:focus-visible {
    outline: 3px solid #1769e0;
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    #sait-chat-toggle {
        animation: none !important;
        transition: none;
        transform: none !important;
    }
}