#csw-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#csw-widget.csw-left {
    right: auto;
    left: 24px;
}

#csw-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #25D366;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s;
    position: relative;
    padding: 0;
}

#csw-toggle svg {
    width: 32px;
    height: 32px;
    display: block;
}

#csw-toggle:hover {
    transform: scale(1.08);
}

#csw-popup {
    display: none;
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    overflow: hidden;
}

#csw-widget.csw-left #csw-popup {
    right: auto;
    left: 0;
}

#csw-widget.open #csw-popup {
    display: block;
}

#csw-header {
    background: #075E54;
    color: #fff;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#csw-back {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    display: none;
}

#csw-back.visible {
    display: block;
}

#csw-header-text {
    flex: 1;
}

#csw-messages {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 360px;
    overflow-y: auto;
}

/* ===== Base message ===== */

.csw-msg {
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    unicode-bidi: plaintext;
    transition: background .15s;
    color: #333;
    max-width: 85%;
}

/* ===== Bot messages (left-aligned chat bubbles) ===== */

.csw-msg.csw-bot {
    align-self: flex-start;
    border-radius: 4px 16px 16px 16px;
    background: #f5f5f5;
    border-left: 3px solid #25D366;
    cursor: default;
}

/* ===== Answer replies (left-aligned, warm card style) ===== */

.csw-msg.csw-answer {
    background: #fff3e0;
    border-left: 3px solid #e65100;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    margin: 4px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.csw-msg.csw-answer:hover {
    background: #fff3e0;
}

/* ===== Options (right-aligned, user clickable) ===== */

.csw-msg:not(.csw-bot) {
    align-self: flex-end;
    border-radius: 16px 4px 16px 16px;
    cursor: pointer;
}

/* WhatsApp option (default) */
.csw-msg:not(.csw-bot) {
    background: #e8f5e9;
}

.csw-msg:not(.csw-bot):hover {
    background: #c8e6c9;
}

/* Link option */
.csw-msg.csw-link {
    background: #e3f2fd;
}

.csw-msg.csw-link:hover {
    background: #bbdefb;
}

/* Answer option */
.csw-msg.csw-answer-opt {
    background: #fff8e1;
}

.csw-msg.csw-answer-opt:hover {
    background: #ffecb3;
}

/* ===== Helper ===== */

.csw-tag {
    display: block;
    font-size: 11px;
    color: #1565c0;
    margin-top: 3px;
    word-break: break-all;
}
