/* CWOA Lite AI — floating chat widget. Self-contained, does not touch cwoa-app.css. */

.cwoa-lai-toggle {
    position: fixed;
    /* Site already has its own "scroll to top" FAB at right:16px/bottom:18px, z-index:50000
       (cwoa-scroll-top.css) — sit above it, not on top of it, so both stay clickable. */
    right: 20px;
    bottom: 82px;
    z-index: 60000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: none;
    border-radius: 999px;
    background: var(--cwoa-accent, #2271b1);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

.cwoa-lai-toggle::before {
    content: '💬';
    font-size: 16px;
}

.cwoa-lai {
    position: fixed;
    right: 20px;
    bottom: 146px;
    z-index: 60000;
    width: min(360px, calc(100vw - 32px));
}

.cwoa-lai-panel {
    display: flex;
    flex-direction: column;
    height: min(480px, 70vh);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.cwoa-lai-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--cwoa-accent, #2271b1);
    color: #fff;
}

.cwoa-lai-head-title {
    font-weight: 700;
    font-size: 14px;
}

.cwoa-lai-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}

.cwoa-lai-log {
    flex: 1;
    overflow-y: auto;
    /* Without this, scrolling to the top/bottom of the chat log "leaks" into scrolling the page
       behind the fixed panel (scroll chaining) — feels like the page scroll is misbehaving. */
    overscroll-behavior: contain;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f7f8fa;
}

.cwoa-lai-msg {
    max-width: 88%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.cwoa-lai-msg--bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #1b1b1b;
}

.cwoa-lai-msg--user {
    align-self: flex-end;
    background: var(--cwoa-accent, #2271b1);
    color: #fff;
}

.cwoa-lai-typing {
    opacity: 0.6;
}

.cwoa-lai-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 10px;
    background: #f7f8fa;
}

.cwoa-lai-quick-btn {
    border: 1px solid var(--cwoa-accent, #2271b1);
    color: var(--cwoa-accent, #2271b1);
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12.5px;
    cursor: pointer;
}

.cwoa-lai-quick-btn:hover {
    background: var(--cwoa-accent, #2271b1);
    color: #fff;
}

.cwoa-lai-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
}

.cwoa-lai-input {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13.5px;
}

.cwoa-lai-send {
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    background: var(--cwoa-accent, #2271b1);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

@keyframes cwoaLaiPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 113, 177, 0.55);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(34, 113, 177, 0);
    }
}

.cwoa-lai-focus-pulse {
    animation: cwoaLaiPulse 1.3s ease-out 2;
    border-radius: var(--cwoa-radius, 12px);
}

@media (prefers-reduced-motion: reduce) {
    .cwoa-lai-focus-pulse {
        animation: none;
        outline: 2px solid var(--cwoa-accent, #2271b1);
        outline-offset: 2px;
    }
}
