.wa-live-chat {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1100;
    font-family: var(--font-b, Arial, sans-serif);
}

.wa-live-chat-toggle {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f766e 0%, #075985 100%);
    color: #ffffff;
    box-shadow: 0 16px 36px rgba(7, 89, 133, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wa-live-chat-toggle::after {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: inherit;
    border: 1px solid rgba(20, 184, 166, 0.38);
    animation: wa-live-chat-pulse 2s ease-out infinite;
    pointer-events: none;
}

.wa-live-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 42px rgba(7, 89, 133, 0.35);
}

.wa-live-chat-toggle-icon,
.wa-live-chat-head-icon,
.wa-live-chat-option i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wa-live-chat-toggle-icon svg {
    width: 29px;
    height: 29px;
    fill: currentColor;
}

.wa-live-chat-notif {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef233c;
    color: #ffffff;
    border: 2px solid #ffffff;
    font-size: 0.72rem;
    line-height: 16px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(239, 35, 60, 0.36);
    animation: wa-live-chat-shake 1.7s ease-in-out infinite;
}

.wa-live-chat.is-offline .wa-live-chat-toggle {
    background: linear-gradient(135deg, #7c5a38 0%, #8a6541 100%);
}

.wa-live-chat-panel {
    width: min(350px, calc(100vw - 28px));
    max-height: min(680px, calc(100vh - 104px));
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.24);
    border: 1px solid rgba(15, 23, 42, 0.08);
    overflow: hidden;
    display: none;
    flex-direction: column;
    margin-bottom: 12px;
    position: absolute;
    right: 0;
    bottom: 64px;
}

.wa-live-chat.open .wa-live-chat-panel {
    display: flex;
}

.wa-live-chat-head {
    background: linear-gradient(135deg, #0f766e 0%, #075985 100%);
    color: #ffffff;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 28px;
    gap: 12px;
    align-items: start;
}

.wa-live-chat-head-icon {
    width: 36px;
    height: 36px;
}

.wa-live-chat-head-icon svg {
    width: 34px;
    height: 34px;
    fill: currentColor;
}

.wa-live-chat-head strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.2;
}

.wa-live-chat-head small {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.wa-live-chat-head button,
.wa-live-chat-panel-title button {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.wa-live-chat-head button {
    font-size: 1.3rem;
    line-height: 1;
}

.wa-live-chat-menu {
    display: grid;
    gap: 10px;
    padding: 14px 18px 18px;
    background: #ffffff;
}

.wa-live-chat-menu-note {
    margin: 0 0 6px;
    color: #9ca3af;
    font-size: 0.78rem;
    font-weight: 600;
}

.wa-live-chat-option {
    width: 100%;
    min-height: 74px;
    border: 0;
    border-left: 2px solid #d1d5db;
    background: #f7f8fa;
    color: #334155;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 26px;
    gap: 12px;
    align-items: center;
    padding: 11px 12px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.wa-live-chat-option:hover {
    background: #f1f5f9;
    border-color: #22c55e;
    transform: translateY(-1px);
}

.wa-live-chat-option.is-live {
    border-color: #22c55e;
}

.wa-live-chat-option-avatar {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: #0f766e;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: 0;
}

.wa-live-chat-option.is-whatsapp .wa-live-chat-option-avatar {
    background: #e5e7eb;
    color: #64748b;
}

.wa-live-chat-option.is-message .wa-live-chat-option-avatar {
    background: #e0f2fe;
    color: #075985;
}

.wa-live-chat-option strong,
.wa-live-chat-option small {
    display: block;
}

.wa-live-chat-option strong {
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.25;
}

.wa-live-chat-option small {
    margin-top: 3px;
    color: #9ca3af;
    font-size: 0.74rem;
    line-height: 1.3;
}

.wa-live-chat-option i svg {
    width: 24px;
    height: 24px;
    fill: #22c55e;
}

.wa-live-chat-panel-title {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin-bottom: 4px;
}

.wa-live-chat-panel-title button {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #eef2f7;
    color: #334155;
    font-size: 1.3rem;
    line-height: 1;
}

.wa-live-chat-panel-title strong,
.wa-live-chat-panel-title small {
    display: block;
}

.wa-live-chat-panel-title strong {
    color: #0f172a;
    font-size: 0.95rem;
}

.wa-live-chat-panel-title small {
    color: #64748b;
    font-size: 0.76rem;
    line-height: 1.35;
}

.wa-live-chat-profile,
.wa-live-chat-lead {
    display: grid;
    gap: 9px;
    padding: 14px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.wa-live-chat-profile input,
.wa-live-chat-lead input,
.wa-live-chat-lead textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    min-height: 40px;
    padding: 9px 10px;
    font-size: 0.88rem;
    color: #111827;
    background: #ffffff;
}

.wa-live-chat-lead label {
    display: grid;
    gap: 5px;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
}

.wa-live-chat-lead textarea {
    min-height: 92px;
    resize: vertical;
}

.wa-live-chat-profile button[type="submit"],
.wa-live-chat-form button,
.wa-live-chat-lead button[type="submit"] {
    border: 0;
    background: #0f766e;
    color: #ffffff;
    border-radius: 8px;
    min-height: 40px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.wa-live-chat-profile-hint,
.wa-live-chat-lead-status {
    margin: 0;
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.45;
}

.wa-live-chat.has-profile .wa-live-chat-profile {
    display: none;
}

.wa-live-chat.needs-profile .wa-live-chat-body,
.wa-live-chat.needs-profile .wa-live-chat-form {
    display: none;
}

.wa-live-chat [data-panel] {
    display: none;
}

.wa-live-chat[data-mode="menu"] [data-panel="menu"],
.wa-live-chat[data-mode="lead"] [data-panel="lead"] {
    display: grid;
}

.wa-live-chat[data-mode="chat"] .wa-live-chat-profile {
    display: grid;
}

.wa-live-chat[data-mode="chat"].has-profile .wa-live-chat-profile {
    display: none;
}

.wa-live-chat[data-mode="chat"] .wa-live-chat-body,
.wa-live-chat[data-mode="chat"] .wa-live-chat-form {
    display: flex;
}

.wa-live-chat[data-mode="chat"].needs-profile .wa-live-chat-body,
.wa-live-chat[data-mode="chat"].needs-profile .wa-live-chat-form {
    display: none;
}

.wa-live-chat-body {
    height: 340px;
    overflow: auto;
    padding: 12px;
    background: #f8fafc;
    flex-direction: column;
}

.wa-live-msg {
    margin-bottom: 9px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wa-live-msg .bubble {
    max-width: 82%;
    padding: 8px 10px;
    border-radius: 10px;
    background: #e5e7eb;
    color: #111827;
    font-size: 0.9rem;
    white-space: pre-wrap;
    line-height: 1.45;
}

.wa-live-msg.me {
    justify-content: flex-end;
    align-items: flex-end;
}

.wa-live-msg.me .bubble {
    background: #d1fae5;
}

.wa-live-time {
    font-size: 0.7rem;
    color: #6b7280;
    margin: 0 4px;
}

.wa-live-msg.system {
    justify-content: center;
}

.wa-live-msg.system .bubble {
    background: #fef3c7;
    color: #92400e;
    font-size: 0.82rem;
}

.wa-live-chat-form {
    border-top: 1px solid #e5e7eb;
    padding: 10px;
    gap: 8px;
    background: #ffffff;
}

.wa-live-chat-form textarea {
    flex: 1;
    resize: none;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    min-height: 44px;
    max-height: 100px;
    padding: 8px;
    font-size: 0.9rem;
}

.wa-live-chat-form button {
    padding: 0 12px;
}

@keyframes wa-live-chat-pulse {
    0% {
        transform: scale(0.98);
        opacity: 0;
    }
    25% {
        opacity: 0.75;
    }
    100% {
        transform: scale(1.15);
        opacity: 0;
    }
}

@keyframes wa-live-chat-shake {
    0%, 72%, 100% {
        transform: rotate(0) scale(1);
    }
    76% {
        transform: rotate(-12deg) scale(1.08);
    }
    80% {
        transform: rotate(10deg) scale(1.08);
    }
    84% {
        transform: rotate(-8deg) scale(1.05);
    }
    88% {
        transform: rotate(6deg) scale(1.03);
    }
}

@media (max-width: 640px) {
    .wa-live-chat {
        right: 12px;
        bottom: 12px;
    }

    .wa-live-chat-toggle {
        width: 54px;
        height: 54px;
    }

    .wa-live-chat-panel {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 88px);
        bottom: 60px;
    }

    .wa-live-chat-body {
        height: min(320px, calc(100vh - 330px));
    }
}
