#bacc-chat-root,
#bacc-chat-root * {
    box-sizing: border-box;
}

#bacc-chat-root {
    position: fixed;
    bottom: 22px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #172033;
}

#bacc-chat-root.bacc-position-right { right: 22px; }
#bacc-chat-root.bacc-position-left { left: 22px; }

.bacc-chat-toggle {
    min-width: 76px;
    height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--bacc-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(17, 33, 55, .24);
}

.bacc-chat-panel {
    position: absolute;
    bottom: 62px;
    width: min(380px, calc(100vw - 28px));
    height: min(610px, calc(100vh - 105px));
    border: 1px solid #dbe1e8;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 18px 50px rgba(17, 33, 55, .25);
}

.bacc-position-right .bacc-chat-panel { right: 0; }
.bacc-position-left .bacc-chat-panel { left: 0; }

.bacc-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 14px 16px;
    background: var(--bacc-primary);
    color: #fff;
}

.bacc-chat-header strong,
.bacc-chat-header span { display: block; }
.bacc-chat-header strong { font-size: 16px; }
.bacc-chat-header span { margin-top: 3px; font-size: 12px; opacity: .86; }
.bacc-chat-header button { border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 13px; }

.bacc-chat-messages {
    height: calc(100% - 244px);
    min-height: 220px;
    overflow-y: auto;
    padding: 16px;
    background: #f4f6f8;
}

.bacc-message { display: flex; margin: 0 0 12px; }
.bacc-message > div { max-width: 86%; padding: 10px 12px; border-radius: 13px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.bacc-message-user { justify-content: flex-end; }
.bacc-message-user > div { background: var(--bacc-primary); color: #fff; border-bottom-right-radius: 4px; }
.bacc-message-assistant > div { background: #fff; border: 1px solid #e0e5eb; border-bottom-left-radius: 4px; }
.bacc-message-system > div { max-width: 100%; background: #fff4df; border: 1px solid #efd7a7; color: #704b00; font-size: 13px; }

.bacc-chat-whatsapp { padding: 10px 14px 0; background: #fff; }
.bacc-chat-whatsapp a { display: block; padding: 10px 12px; border: 1px solid var(--bacc-primary); border-radius: 10px; color: var(--bacc-primary); text-align: center; text-decoration: none; font-weight: 700; font-size: 14px; }

.bacc-chat-form { padding: 12px 14px 14px; background: #fff; border-top: 1px solid #e5e9ee; }
.bacc-chat-form textarea { width: 100%; resize: none; padding: 10px 11px; border: 1px solid #cbd3dc; border-radius: 10px; font: inherit; font-size: 14px; }
.bacc-chat-form textarea:focus { outline: 2px solid color-mix(in srgb, var(--bacc-primary) 25%, transparent); border-color: var(--bacc-primary); }
.bacc-chat-form > button { width: 100%; margin-top: 9px; padding: 10px 14px; border: 0; border-radius: 10px; background: var(--bacc-primary); color: #fff; font-weight: 700; cursor: pointer; }
.bacc-chat-form > button:disabled { opacity: .65; cursor: wait; }

.bacc-consent { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 11px; line-height: 1.35; color: #566274; }
.bacc-consent input { margin-top: 2px; flex: 0 0 auto; }
.bacc-honeypot { position: absolute !important; left: -99999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.bacc-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 480px) {
    #bacc-chat-root { left: 14px !important; right: 14px !important; bottom: 14px; }
    .bacc-chat-toggle { float: right; }
    .bacc-chat-panel { left: 0 !important; right: 0 !important; width: 100%; bottom: 60px; height: calc(100vh - 92px); }
}
