.chat-toggle {
    position: fixed;
    right: 90px;
    bottom: 55px;
    border: 0;
    background: rgba(43, 109, 229, 0.8);
    color: #fff;
    border-radius: 999px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(43, 109, 229, 0.28);
    z-index: 99999;
}

.chat-toggle:hover {
    background: #215ccc;
}

.chat-widget {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 380px;
    max-width: calc(100vw - 20px);
    height: 620px;
    max-height: calc(100vh - 110px);
    background: #fff;
    border: 1px solid #dcdfe5;
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 100000;
}

.chat-widget.open {
    display: flex;
}

.chat-header {
    background: #2b6de5;
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chat-widget.is-closed .chat-header {
    background: #6c757d;
}

.chat-title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
}

.chat-status {
    margin: 0;
    font-size: 13px;
    opacity: 0.92;
}

.chat-close {
    border: 0;
    background: rgba(255,255,255,0.15);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.chat-close:hover {
    background: rgba(255,255,255,0.22);
}

.chat-body {
    flex: 1;
    background: #f5f6f8;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-welcome {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.55;
    color: #444;
    max-width: 88%;
}

.chat-offline-box {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 14px;
    padding: 14px;
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}

.chat-offline-box p {
    margin: 0 0 10px;
}

.chat-offline-box p:last-child {
    margin-bottom: 0;
}

.whatsapp-btn {
    display: inline-block;
    margin-top: 8px;
    background: #25D366;
    color: #fff;
    text-decoration: none;
    padding: 11px 16px;
    border-radius: 10px;
    font-weight: 700;
}

.whatsapp-btn:hover {
    opacity: 0.92;
}

.msg {
    max-width: 82%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.msg.visitor {
    align-self: flex-end;
    background: #dff3df;
    border: 1px solid #cfe8cf;
}

.msg.staff {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e3e3e3;
}

.msg-meta {
    margin-top: 6px;
    font-size: 11px;
    color: #777;
}

.chat-footer {
    background: #fff;
    border-top: 1px solid #e5e5e5;
    padding: 14px;
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #cfcfcf;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
}

.chat-input:focus {
    border-color: #2b6de5;
    box-shadow: 0 0 0 3px rgba(43, 109, 229, 0.12);
}

.chat-send {
    border: 0;
    background: #2b6de5;
    color: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.chat-send:hover {
    background: #215ccc;
}

.chat-input:disabled,
.chat-send:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.chat-note {
    margin-top: 10px;
    font-size: 12px;
    color: #777;
}

@media (max-width: 640px) {
    .chat-widget {
        right: 10px;
        bottom: 70px;
        width: calc(100vw - 20px);
        height: 70vh;
        max-height: 70vh;
        border-radius: 16px;
    }

    .chat-toggle {
        right: 85px;
        bottom: 45px;
    }
}