#bibuaran-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: Arial, sans-serif;
}

#bibuaran-chat-bubble {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #1a5632;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    position: relative;
    transition: transform 0.2s ease;
}
#bibuaran-chat-bubble:hover {
    transform: scale(1.06);
}
#bibuaran-chat-bubble svg {
    width: 26px;
    height: 26px;
}

#bibuaran-chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #eb5a00;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

#bibuaran-chat-panel {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 340px;
    max-width: calc(100vw - 40px);
    height: 480px;
    max-height: 70vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#bibuaran-chat-header {
    background: #1a5632;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 15px;
}
#bibuaran-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

#bibuaran-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#bibuaran-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bibuaran-chat-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.4;
    word-wrap: break-word;
}
.bibuaran-chat-msg.customer {
    align-self: flex-end;
    background: #1a5632;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.bibuaran-chat-msg.bot,
.bibuaran-chat-msg.agent {
    align-self: flex-start;
    background: #f0f0f0;
    color: #222;
    border-bottom-left-radius: 4px;
}
.bibuaran-chat-msg.agent {
    background: #e8f3ec;
}

#bibuaran-chat-quick-replies {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bibuaran-chat-quick-btn {
    background: #fff;
    border: 1px solid #1a5632;
    color: #1a5632;
    border-radius: 16px;
    padding: 7px 12px;
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}
.bibuaran-chat-quick-btn:hover {
    background: #f0f7f2;
}

#bibuaran-chat-escalate-wrap {
    text-align: center;
    margin-top: 4px;
}
#bibuaran-chat-escalate-btn {
    background: none;
    border: none;
    color: #eb5a00;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

#bibuaran-chat-guest-form {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#bibuaran-chat-guest-form p {
    font-size: 12.5px;
    margin: 0;
    color: #555;
}
#bibuaran-chat-guest-form input {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

#bibuaran-chat-departments {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bibuaran-chat-dept-btn {
    background: #1a5632;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
}

#bibuaran-chat-input-wrap {
    display: flex;
    border-top: 1px solid #eee;
    padding: 8px;
    gap: 8px;
}
#bibuaran-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
}
#bibuaran-chat-send {
    background: #1a5632;
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
#bibuaran-chat-send svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 480px) {
    #bibuaran-chat-panel {
        width: calc(100vw - 24px);
        right: -8px;
        height: 65vh;
    }
}
