#fyokla-chat-widget {
    position: fixed;
    right: 22px;
    bottom: 76px;
    z-index: 10050;
    font-family: Arial, Helvetica, sans-serif;
}

body:has(.cookie-modal.active) #fyokla-chat-widget {
    display: none;
}

body.b2b-filter-sheet-open #fyokla-chat-widget {
    display: none;
}

#fyokla-chat-frame {
    display: none;
    width: min(400px, calc(100vw - 32px));
    height: min(640px, calc(100vh - 150px));
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--b2b-work-line, #e4e7ec);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 52px rgba(16, 24, 40, .2);
}

#fyokla-chat-frame.is-open {
    display: block;
}

#fyokla-chat-toggle {
    position: relative;
    display: grid;
    width: 62px;
    height: 62px;
    margin-left: auto;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #15191f url("/chat/assets/fyokla-avatar-256.png") center / cover no-repeat;
    box-shadow: 0 12px 28px rgba(16, 24, 40, .26), 0 0 0 3px rgba(227, 6, 19, .35);
    cursor: pointer;
}

#fyokla-chat-toggle::before {
    content: "";
    position: absolute;
    inset: -13px;
    z-index: -1;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(227, 6, 19, .25), rgba(227, 6, 19, 0) 68%);
    animation: fyokla-chat-pulse 3s ease-in-out infinite;
}

#fyokla-chat-label {
    position: absolute;
    right: 76px;
    bottom: 9px;
    min-width: max-content;
    padding: 9px 13px;
    border: 1px solid var(--b2b-work-line, #e4e7ec);
    border-radius: 11px;
    color: var(--b2b-work-ink, #101828);
    background: #fff;
    box-shadow: 0 9px 24px rgba(16, 24, 40, .14);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    pointer-events: none;
}

#fyokla-chat-label::before {
    content: "";
    position: absolute;
    right: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 3px 0 0 3px;
    background: var(--b2b-work-red, #e30613);
}

#fyokla-chat-toggle[aria-expanded="true"] #fyokla-chat-label {
    display: none;
}

#fyokla-chat-toggle[aria-expanded="true"] {
    background: #15191f;
    color: #fff;
}

#fyokla-chat-toggle[aria-expanded="true"]::after {
    content: "×";
    font-size: 38px;
    font-weight: 300;
    line-height: 1;
}

#fyokla-chat-toggle[aria-expanded="true"]::before {
    display: none;
}

@keyframes fyokla-chat-pulse {
    0%, 100% { transform: scale(.94); opacity: .55; }
    50% { transform: scale(1.08); opacity: 1; }
}

@media (max-width: 600px), (max-height: 600px) and (max-width: 900px) {
    #fyokla-chat-widget {
        left: 12px;
        right: 12px;
        bottom: max(78px, calc(env(safe-area-inset-bottom) + 68px));
    }

    #fyokla-chat-frame {
        width: 100%;
        height: min(78vh, calc(100vh - 145px));
        height: min(78dvh, calc(100dvh - 145px));
        border-radius: 15px;
    }

    #fyokla-chat-label {
        right: 72px;
        min-width: 0;
        white-space: nowrap;
    }

    body.fyokla-chat-open {
        overflow: hidden;
    }

    #fyokla-chat-widget.is-open {
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        display: grid;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
        grid-template-rows: minmax(0, 1fr) auto;
        gap: 8px;
        background: rgba(16, 24, 40, .48);
    }

    #fyokla-chat-widget.is-open #fyokla-chat-frame {
        grid-row: 1;
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 14px;
    }

    #fyokla-chat-widget.is-open #fyokla-chat-toggle {
        grid-row: 2;
        width: 100%;
        height: 48px;
        margin: 0;
        border-radius: 12px;
        color: #fff;
        background: #15191f;
        box-shadow: 0 8px 24px rgba(16, 24, 40, .24);
    }

    #fyokla-chat-widget.is-open #fyokla-chat-toggle::after {
        display: none;
    }

    #fyokla-chat-widget.is-open #fyokla-chat-label {
        position: static;
        display: block;
        min-width: 0;
        padding: 0;
        border: 0;
        color: inherit;
        background: transparent;
        box-shadow: none;
        font-size: 14px;
        pointer-events: none;
    }

    #fyokla-chat-widget.is-open #fyokla-chat-label::before {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    #fyokla-chat-toggle::before {
        animation: none;
    }
}
