/* ===== Chatbot Quantaris ===== */
.qchat-launcher {
    position: fixed; right: 22px; bottom: 22px; z-index: 900;
    width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
    background: linear-gradient(135deg, #22c7f5, #2563eb 55%, #8b2be2);
    color: #fff; font-size: 1.4rem; display: grid; place-items: center;
    box-shadow: 0 0 22px rgba(37,99,235,.55), 0 8px 24px rgba(0,0,0,.45);
    transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s;
}
.qchat-launcher:hover { transform: scale(1.07); box-shadow: 0 0 32px rgba(139,43,226,.6), 0 8px 24px rgba(0,0,0,.45); }
.qchat-launcher:focus-visible { outline: 2px solid #22c7f5; outline-offset: 3px; }
.qchat-launcher .qchat-dot { position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: #2dd4a4; border: 2px solid #05070f; }

.qchat-panel {
    position: fixed; right: 22px; bottom: 94px; z-index: 901;
    width: 380px; max-width: calc(100vw - 32px);
    height: 560px; max-height: calc(100vh - 120px);
    display: flex; flex-direction: column;
    background: #0b1020; color: #e6e9f5;
    border: 1px solid rgba(120,140,255,.25); border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 40px rgba(37,99,235,.2);
    font-family: 'Inter', system-ui, sans-serif; font-size: .92rem; line-height: 1.5;
    overflow: hidden;
    opacity: 0; transform: translateY(12px) scale(.98); pointer-events: none;
    transition: opacity .25s, transform .25s cubic-bezier(.2,.8,.2,1);
}
.qchat-panel.open { opacity: 1; transform: none; pointer-events: auto; }

.qchat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: linear-gradient(135deg, rgba(34,199,245,.14), rgba(139,43,226,.14)); border-bottom: 1px solid rgba(120,140,255,.18); }
.qchat-head img { width: 38px; height: 30px; }
.qchat-head .t { font-weight: 700; }
.qchat-head .s { font-size: .75rem; color: #8f97b8; display: flex; align-items: center; gap: 6px; }
.qchat-head .s::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #2dd4a4; }
.qchat-close { margin-left: auto; background: none; border: none; color: #8f97b8; font-size: 1.1rem; cursor: pointer; width: 34px; height: 34px; border-radius: 8px; }
.qchat-close:hover { color: #fff; background: rgba(255,255,255,.06); }

.qchat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.qchat-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.qchat-msg.bot { align-self: flex-start; background: #141a31; border: 1px solid rgba(120,140,255,.16); border-bottom-left-radius: 4px; }
.qchat-msg.user { align-self: flex-end; background: linear-gradient(135deg, #2563eb, #5b3dd9); color: #fff; border-bottom-right-radius: 4px; }
.qchat-msg.error { align-self: stretch; max-width: 100%; background: rgba(255,77,122,.08); border: 1px solid rgba(255,77,122,.35); color: #ff8fab; font-size: .85rem; }
.qchat-msg a { color: #22c7f5; }
.qchat-msg.user a { color: #fff; text-decoration: underline; }

.qchat-typing { display: inline-flex; gap: 4px; padding: 14px; }
.qchat-typing span { width: 7px; height: 7px; border-radius: 50%; background: #8f97b8; animation: qchat-bounce 1.2s infinite; }
.qchat-typing span:nth-child(2) { animation-delay: .15s; }
.qchat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes qchat-bounce { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

.qchat-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.qchat-suggest button { background: transparent; border: 1px solid rgba(34,199,245,.4); color: #22c7f5; border-radius: 999px; padding: 6px 12px; font-size: .78rem; cursor: pointer; font-family: inherit; }
.qchat-suggest button:hover { background: rgba(34,199,245,.1); }

.qchat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(120,140,255,.18); background: #080c18; }
.qchat-form textarea {
    flex: 1; resize: none; height: 44px; min-height: 0; max-height: 120px; padding: 11px 12px; width: auto;
    border-radius: 12px; border: 1px solid rgba(120,140,255,.2); background: #05070f; color: #e6e9f5;
    font-family: inherit; font-size: 1rem; line-height: 1.4;
}
.qchat-form textarea:focus { outline: none; border-color: #2563eb; }
.qchat-form button { width: 44px; height: 44px; border: none; border-radius: 12px; cursor: pointer; background: linear-gradient(135deg, #22c7f5, #2563eb, #8b2be2); color: #fff; font-size: 1rem; flex-shrink: 0; }
.qchat-form button[disabled] { opacity: .5; cursor: not-allowed; }
.qchat-note { font-size: .68rem; color: #5d6585; text-align: center; padding: 0 12px 8px; background: #080c18; }

@media (max-width: 480px) {
    .qchat-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
    .qchat-launcher { right: 16px; bottom: 16px; }
    .qchat-panel.open ~ .qchat-launcher { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .qchat-panel, .qchat-launcher { transition: none; }
    .qchat-typing span { animation: none; }
}
