/* Talk to AI — floating assistant */
#ai-chat-fab {
    position: fixed;
    right: 18px;
    bottom: 88px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #2563EB, #1B3A6B);
    color: #fff;
    font-size: 20px;
    box-shadow: 0 10px 24px rgba(27, 58, 107, .35);
    cursor: pointer;
    z-index: 4000;
}

#ai-chat-fab:hover { transform: translateY(-2px); }

#ai-chat-panel {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: min(400px, calc(100vw - 24px));
    height: min(620px, calc(100vh - 36px));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 4001;
}

#ai-chat-panel.d-none { display: none !important; }

.ai-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #2563EB, #1B3A6B);
    color: #fff;
    font-size: 15px;
}

.ai-chat-head button {
    background: rgba(255, 255, 255, .18);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    margin-left: 6px;
    cursor: pointer;
}

.ai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #F4F6FA;
}

.ai-msg { display: flex; margin-bottom: 10px; }
.ai-msg.user { justify-content: flex-end; }

.ai-bubble {
    max-width: 85%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.55;
    background: #fff;
    color: #0F172A;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .07);
    white-space: normal;
    word-break: break-word;
}

.ai-msg.user .ai-bubble { background: #2563EB; color: #fff; }

.ai-typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 4px;
    border-radius: 50%;
    background: #94A3B8;
    animation: aiBlink 1.2s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes aiBlink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.ai-empty { text-align: center; color: #64748B; padding: 26px 12px; }
.ai-empty i { font-size: 34px; color: #2563EB; }
.ai-empty p { margin: 12px 0 16px; font-size: 14px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ai-chips button {
    border: 1px solid #CBD5E1;
    background: #fff;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #1B3A6B;
}

.ai-chat-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #E2E8F0;
    background: #fff;
}

#ai-chat-input {
    flex: 1;
    resize: none;
    border: 1px solid #CBD5E1;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 14.5px;
    font-family: inherit;
    max-height: 110px;
    min-height: 46px;
}

#ai-chat-send {
    width: 46px;
    border: none;
    border-radius: 12px;
    background: #2563EB;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

@media (max-width: 640px) {
    #ai-chat-fab { bottom: 92px; right: 14px; }
    #ai-chat-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 88vh; border-radius: 18px 18px 0 0; }
}

/* follow-up option chips after every reply */
.ai-reply-chips{display:flex;flex-wrap:wrap;gap:8px;padding:4px 10px 12px;}
.ai-reply-chips button{
    border:1px solid #C7D8FF;background:#EFF4FF;color:#1B3A6B;
    border-radius:999px;padding:9px 14px;font-size:13px;font-weight:600;
    cursor:pointer;min-height:40px;
}
.ai-reply-chips button:hover{background:#DCE7FF;}
.ai-reply-chips button.ai-chip-yes{background:#16A34A;border-color:#16A34A;color:#fff;}
.ai-reply-chips button.ai-chip-no{background:#fff;border-color:#D8DEE9;color:#5A6782;}
