:root {
    --wfc-bubble: #25D366;
    --wfc-header: #075E54;
    --wfc-chat-bg: #ECE5DD;
    --wfc-balloon: #FFD700;
    --wfc-balloon-text: #000;
    --wfc-white: #ffffff;
    --wfc-shadow: 0 8px 32px rgba(0,0,0,.22);
    --wfc-radius: 16px;
    --wfc-anim: cubic-bezier(.34,1.56,.64,1);
    --wfc-w: 340px;
    --wfc-bubble-size: 64px;
    --wfc-send-size: 44px;
}

.wfc-root {
    position: fixed;
    bottom: 28px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
}
.wfc-root.is-ready {
    visibility: visible;
    opacity: 1;
}
.wfc-root *,
.wfc-root *::before,
.wfc-root *::after { box-sizing: border-box; }
.wfc--right { right: 28px; }
.wfc--left  { left: 28px; }

.wfc-bubble {
    position: relative;
    display: block !important;
    width: var(--wfc-bubble-size) !important;
    height: var(--wfc-bubble-size) !important;
    min-width: var(--wfc-bubble-size);
    min-height: var(--wfc-bubble-size);
    padding: 0 !important;
    border-radius: 50% !important;
    background: var(--wfc-bubble) !important;
    border: none !important;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37,211,102,.45);
    transition: transform .25s var(--wfc-anim), box-shadow .25s ease, background .2s, opacity .25s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    z-index: 1;
    overflow: hidden;
    line-height: 0;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform, opacity;
}
.wfc-bubble:hover,
.wfc-bubble:focus-visible {
    background: #075E54 !important;
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(7,94,84,.55);
}
.wfc-bubble:active {
    background: #064d45 !important;
    transform: scale(.95);
}
.wfc-bubble-icon-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    display: block;
    z-index: 2;
    transform: translate3d(-50%, -50%, 0);
    -webkit-transform: translate3d(-50%, -50%, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    pointer-events: none;
}
.wfc-bubble-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 31px !important;
    height: 31px !important;
    display: block;
    transform: translate3d(-50%, calc(-50% - 1px), 0);
    -webkit-transform: translate3d(-50%, calc(-50% - 1px), 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.wfc-bubble-icon path { vector-effect: non-scaling-stroke; }

.wfc-bubble-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 3px solid var(--wfc-bubble);
    opacity: 0;
    animation: wfc-pulse 2.5s ease-out infinite;
}
@keyframes wfc-pulse {
    0%   { transform: scale(1); opacity: .7; }
    70%  { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

.wfc-root.is-open .wfc-bubble {
    transform: translateZ(0) scale(0.001) rotate(-45deg);
    -webkit-transform: translateZ(0) scale(0.001) rotate(-45deg);
    pointer-events: none;
    opacity: 0;
    transition: transform .35s var(--wfc-anim), opacity .25s;
}
.wfc-root.is-open .wfc-bubble-pulse { animation: none; }

.wfc-window {
    position: absolute;
    bottom: 0;
    width: var(--wfc-w);
    max-width: calc(100vw - 56px);
    border-radius: var(--wfc-radius);
    overflow: hidden;
    background: var(--wfc-white);
    box-shadow: var(--wfc-shadow);
    display: flex;
    flex-direction: column;
    transform: scale(.4) translateY(60px);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: transform .45s var(--wfc-anim), opacity .35s ease;
}
.wfc--left .wfc-window { transform-origin: bottom left; }
.wfc--right .wfc-window { right: 0; }
.wfc--left .wfc-window { left: 0; }

.wfc-root.is-open .wfc-window {
    transform: scale(1) translateY(-76px);
    opacity: 1;
    pointer-events: auto;
}

.wfc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--wfc-header);
    color: var(--wfc-white);
}
.wfc-header-avatar { position: relative; flex-shrink: 0; }
.wfc-avatar-img,
.wfc-avatar-fallback {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.25);
    font-size: 20px;
    font-weight: 700;
    color: var(--wfc-white);
}
.wfc-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #4ade80;
    border: 2px solid var(--wfc-header);
}
.wfc-header-info { flex: 1; min-width: 0; }
.wfc-header-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wfc-header-status { font-size: 12px; opacity: .85; }
.wfc-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
    flex-shrink: 0;
    line-height: 1;
}
.wfc-close:hover { background: rgba(255,255,255,.15); color: var(--wfc-white); }

.wfc-body {
    flex: 1;
    position: relative;
    background: var(--wfc-chat-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M0 0h80v80H0z' fill='none'/%3E%3Cpath d='M40 20c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm-20 0c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm40 0c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z' fill='rgba(0,0,0,.04)'/%3E%3C/svg%3E");
    min-height: 160px;
    padding: 16px 12px 8px;
    overflow-y: auto;
}
.wfc-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    pointer-events: none;
    user-select: none;
    opacity: .04;
}
.wfc-watermark-icon {
    width: 56px !important;
    height: 56px !important;
    display: block;
}

.wfc-msg-wrap { position: relative; z-index: 1; }
.wfc-balloon {
    display: inline-block;
    background: var(--wfc-balloon);
    color: var(--wfc-balloon-text);
    border-radius: 0 10px 10px 10px;
    padding: 10px 14px 8px;
    max-width: 85%;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    animation: wfc-balloon-in .5s var(--wfc-anim) both;
    animation-delay: .25s;
}
@keyframes wfc-balloon-in {
    from { opacity: 0; transform: translateY(12px) scale(.94); }
    to { opacity: 1; transform: none; }
}
.wfc-balloon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid var(--wfc-balloon);
    border-left: 8px solid transparent;
}
.wfc-agent-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #075E54;
    margin-bottom: 4px;
}
.wfc-welcome-text { margin: 0; font-size: 14px; line-height: 1.5; }
.wfc-time {
    display: block;
    text-align: right;
    font-size: 11px;
    color: rgba(0,0,0,.45);
    margin-top: 4px;
}

.wfc-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f0f0f0;
    border-top: 1px solid rgba(0,0,0,.07);
}
.wfc-input {
    flex: 1;
    height: 42px;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 0 16px;
    font-size: 14px;
    outline: none;
    background: var(--wfc-white);
    transition: border-color .2s;
}
.wfc-input:focus { border-color: var(--wfc-bubble); }

.wfc-send {
    width: var(--wfc-send-size);
    height: var(--wfc-send-size);
    min-width: var(--wfc-send-size);
    min-height: var(--wfc-send-size);
    border-radius: 50%;
    border: none;
    background: var(--wfc-bubble);
    color: var(--wfc-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s, transform .2s;
    padding: 0;
    line-height: 0;
    overflow: hidden;
}
.wfc-send:hover  { background: #1da851; transform: scale(1.06); }
.wfc-send:active { transform: scale(.93); }
.wfc-send-icon-wrap {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.wfc-send-icon {
    width: 22px !important;
    height: 22px !important;
    display: block;
    transform: translate(1px,-1px);
}

.wfc-brand {
    text-align: center;
    padding: 4px 0 6px;
    font-size: 11px;
    color: #888;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-top: 1px solid rgba(0,0,0,.05);
}
.wfc-brand-icon {
    width: 12px !important;
    height: 12px !important;
    display: block;
}
.wfc-brand-icon path,
.wfc-brand-icon * {
    fill: #000 !important;
}


@supports (-webkit-touch-callout: none) {
    .wfc-bubble,
    .wfc-bubble-icon-wrap,
    .wfc-bubble-icon {
        transform-style: preserve-3d;
        -webkit-transform-style: preserve-3d;
    }
}

@media (max-width: 480px) {
    :root { --wfc-w: calc(100vw - 32px); }
    .wfc--right { right: 16px; }
    .wfc--left { left: 16px; }
    .wfc-root.is-open .wfc-window { transform: scale(1) translateY(-70px); }
}
