/* Abate Law Chatbox â brand: #8C1D40 maroon, Lexend Deca */

#abate-chat-root, #abate-chat-root * {
    box-sizing: border-box;
    font-family: "Lexend Deca", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Floating launcher bubble */
#abate-chat-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #8C1D40;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
}
#abate-chat-launcher:hover { transform: scale(1.05); background: #751635; }
#abate-chat-launcher svg { width: 28px; height: 28px; fill: #fff; }

/* Invitation bubble next to launcher */
#abate-chat-invite {
    position: fixed;
    bottom: 34px;
    right: 96px;
    max-width: 260px;
    background: #fff;
    color: #333;
    border: 1px solid #e5e5e8;
    border-left: 4px solid #8C1D40;
    border-radius: 12px;
    padding: 12px 34px 12px 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    font-size: 13px;
    line-height: 18px;
    cursor: pointer;
    z-index: 2147482999;
    opacity: 0;
    transform: translateY(6px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
#abate-chat-invite.abate-invite-show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    animation: abate-invite-nudge 2.4s ease-in-out 0.4s 2;
}
#abate-chat-invite strong {
    display: block;
    color: #8C1D40;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}
#abate-chat-invite span {
    display: block;
    color: #555;
}
#abate-chat-invite::after {
    content: "";
    position: absolute;
    right: -8px;
    bottom: 22px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #fff;
    filter: drop-shadow(1px 0 0 #e5e5e8);
}
#abate-chat-invite-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: transparent;
    border: 0;
    color: #999;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}
#abate-chat-invite-close:hover { color: #333; }
@keyframes abate-invite-nudge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
@media (max-width: 480px) {
    #abate-chat-invite {
        right: 84px;
        bottom: 24px;
        max-width: 200px;
        font-size: 12px;
    }
}

/* Chat panel */
#abate-chat-panel {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 2147483000;
}
#abate-chat-panel.abate-open { display: flex; }

.abate-chat-header {
    background: #8C1D40;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.abate-chat-header strong { font-size: 16px; font-weight: 500; }
.abate-chat-header .abate-sub { font-size: 12px; opacity: 0.85; display: block; margin-top: 2px; }
.abate-chat-header button {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.abate-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f7f7f8;
}

.abate-disclaimer {
    background: #fff3e0;
    border-left: 3px solid #8C1D40;
    color: #333;
    font-size: 12px;
    line-height: 17px;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.abate-msg {
    max-width: 85%;
    padding: 10px 13px;
    margin-bottom: 10px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 20px;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.abate-msg.user {
    background: #8C1D40;
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}
.abate-msg.assistant {
    background: #fff;
    border: 1px solid #e5e5e8;
    border-bottom-left-radius: 4px;
}
.abate-msg.typing { color: #888; font-style: italic; }

.abate-chat-footer {
    border-top: 1px solid #e5e5e8;
    padding: 10px 12px;
    background: #fff;
}
.abate-input-row { display: flex; gap: 8px; align-items: flex-end; }
.abate-chat-footer textarea {
    flex: 1;
    resize: none;
    border: 1px solid #d0d0d4;
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 14px;
    line-height: 20px;
    max-height: 120px;
    outline: none;
    font-family: inherit;
}
.abate-chat-footer textarea:focus { border-color: #8C1D40; }
.abate-chat-footer button.abate-send {
    background: #8C1D40;
    color: #fff;
    border: 0;
    padding: 9px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.abate-chat-footer button.abate-send:disabled { background: #c7a2ac; cursor: not-allowed; }
.abate-legal { font-size: 10px; color: #888; text-align: center; margin-top: 6px; }

/* Consent gate â always shown first */
.abate-consent { padding: 18px 18px 16px; }
.abate-consent h3 {
    margin: 0 0 10px;
    color: #8C1D40;
    font-size: 18px;
    font-weight: 500;
    line-height: 24px;
}
.abate-consent-body {
    font-size: 12px;
    line-height: 18px;
    color: #333;
    background: #fff;
    border: 1px solid #e5e5e8;
    border-radius: 8px;
    padding: 12px 14px;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 14px;
}
.abate-consent-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.abate-consent-actions button {
    border: 0;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
}
.abate-btn-primary { background: #8C1D40; color: #fff; }
.abate-btn-primary:hover { background: #751635; }
.abate-btn-secondary { background: #f0f0f2; color: #333; }
.abate-btn-secondary:hover { background: #e3e3e6; }

/* Gate form (when require_email is ON) */
.abate-gate { padding: 20px 16px; }
.abate-gate h3 { margin: 0 0 6px; color: #8C1D40; font-size: 18px; font-weight: 500; }
.abate-gate p { margin: 0 0 14px; font-size: 13px; color: #555; }
.abate-gate label { display: block; font-size: 12px; margin-bottom: 4px; color: #444; }
.abate-gate input {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #d0d0d4;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-family: inherit;
}
.abate-gate input:focus { outline: none; border-color: #8C1D40; }
.abate-gate button {
    width: 100%;
    background: #8C1D40;
    color: #fff;
    border: 0;
    padding: 11px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 480px) {
    #abate-chat-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 88px;
        height: calc(100vh - 110px);
    }
    #abate-chat-launcher { bottom: 16px; right: 16px; }
}
