/*
|--------------------------------------------------------------------------
| FORTIVOX ASSISTANT — FLOATING WIDGET STYLES
|--------------------------------------------------------------------------
| Self-contained, namespaced under .fv-assistant-* so it never collides
| with host pages (admin Bootstrap, client Bootstrap, public marketing).
*/

#fv-assistant-root,#fv-assistant-root *{box-sizing:border-box}
#fv-assistant-root{position:fixed;right:18px;bottom:18px;z-index:2147483600;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,sans-serif}
html[dir="rtl"] #fv-assistant-root{right:auto;left:18px}

.fv-assistant-bubble{position:relative;width:58px;height:58px;border-radius:50%;border:0;cursor:pointer;
    background:linear-gradient(135deg,#5b8cff 0%,#7a3cff 100%);color:#fff;font-size:22px;
    box-shadow:0 10px 30px rgba(91,140,255,.35),0 4px 10px rgba(0,0,0,.15);transition:transform .15s ease}
.fv-assistant-bubble:hover{transform:scale(1.06)}
.fv-assistant-bubble-dot{position:absolute;top:6px;right:6px;width:10px;height:10px;border-radius:50%;background:#22c55e;border:2px solid #fff;display:none}
.fv-assistant-bubble.is-active .fv-assistant-bubble-dot{display:block}

.fv-assistant-panel{display:none;position:absolute;right:0;bottom:74px;width:380px;max-width:calc(100vw - 24px);height:560px;max-height:calc(100vh - 96px);
    background:#fff;color:#0f172a;border-radius:16px;box-shadow:0 24px 64px rgba(15,23,42,.25);overflow:hidden;flex-direction:column}
html[dir="rtl"] .fv-assistant-panel{right:auto;left:0}
.fv-assistant-panel.is-open{display:flex}

.fv-assistant-header{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:linear-gradient(135deg,#5b8cff,#7a3cff);color:#fff}
.fv-assistant-header-left{display:flex;align-items:center;gap:10px}
.fv-assistant-avatar{width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.18);display:inline-flex;align-items:center;justify-content:center;font-size:15px}
.fv-assistant-title{font-weight:600;font-size:14px;line-height:1.1}
.fv-assistant-sub{font-size:11px;opacity:.85}
.fv-assistant-header-right{display:flex;gap:4px}
.fv-assistant-iconbtn{background:rgba(255,255,255,.15);border:0;color:#fff;width:28px;height:28px;border-radius:8px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.fv-assistant-iconbtn:hover{background:rgba(255,255,255,.28)}

.fv-assistant-body{flex:1;overflow-y:auto;padding:14px;background:#f8fafc;display:flex;flex-direction:column;gap:10px;font-size:13.5px;line-height:1.5}
.fv-assistant-body h6{font-size:13px;margin:0 0 6px;color:#1e293b;font-weight:600}
.fv-assistant-body ul,.fv-assistant-body ol{padding-left:18px;margin:6px 0}
html[dir="rtl"] .fv-assistant-body ul,html[dir="rtl"] .fv-assistant-body ol{padding-left:0;padding-right:18px}
.fv-assistant-body code{background:#e2e8f0;padding:1px 5px;border-radius:4px;font-size:12px}

.fv-msg{max-width:88%;padding:9px 12px;border-radius:12px;word-wrap:break-word;overflow-wrap:break-word}
.fv-msg-user{align-self:flex-end;background:#5b8cff;color:#fff;border-bottom-right-radius:4px}
html[dir="rtl"] .fv-msg-user{align-self:flex-start;border-bottom-right-radius:12px;border-bottom-left-radius:4px}
.fv-msg-assistant{align-self:flex-start;background:#fff;border:1px solid #e2e8f0;border-bottom-left-radius:4px}
html[dir="rtl"] .fv-msg-assistant{align-self:flex-end;border-bottom-left-radius:12px;border-bottom-right-radius:4px}
.fv-msg-system{align-self:center;background:#fef3c7;border:1px solid #fde68a;color:#92400e;font-size:12px}
.fv-msg-meta{font-size:10.5px;opacity:.65;margin-top:4px;display:flex;gap:6px;flex-wrap:wrap}
.fv-msg-actions{margin-top:8px;display:flex;flex-wrap:wrap;gap:6px}
.fv-msg-actionbtn{font-size:12px;padding:5px 10px;border-radius:999px;border:1px solid #cbd5e1;background:#fff;color:#0f172a;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:5px}
.fv-msg-actionbtn:hover{background:#f1f5f9}
.fv-msg-actionbtn i{font-size:11px}

.fv-assistant-typing{display:inline-flex;gap:4px;padding:8px 12px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;align-self:flex-start;width:fit-content}
.fv-assistant-typing span{width:6px;height:6px;border-radius:50%;background:#94a3b8;animation:fvBlink 1.2s infinite ease-in-out}
.fv-assistant-typing span:nth-child(2){animation-delay:.15s}
.fv-assistant-typing span:nth-child(3){animation-delay:.3s}
@keyframes fvBlink{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}

.fv-assistant-suggest{padding:8px 12px;background:#fff;border-top:1px solid #e2e8f0;display:flex;flex-wrap:wrap;gap:6px;max-height:96px;overflow-y:auto}
.fv-suggest-chip{font-size:12px;padding:5px 10px;border-radius:999px;border:1px solid #cbd5e1;background:#f8fafc;cursor:pointer;color:#0f172a}
.fv-suggest-chip:hover{background:#eef2ff;border-color:#a5b4fc}

.fv-assistant-form{display:flex;align-items:center;gap:6px;padding:10px 12px;background:#fff;border-top:1px solid #e2e8f0}
.fv-assistant-form input{flex:1;border:1px solid #cbd5e1;background:#f8fafc;color:#0f172a;border-radius:999px;padding:9px 14px;font-size:13.5px;outline:none}
.fv-assistant-form input:focus{border-color:#5b8cff;background:#fff}
.fv-assistant-send{border:0;width:38px;height:38px;border-radius:50%;background:linear-gradient(135deg,#5b8cff,#7a3cff);color:#fff;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.fv-assistant-send:disabled{opacity:.5;cursor:not-allowed}

@media (max-width: 480px){
    .fv-assistant-panel{width:calc(100vw - 24px);height:calc(100vh - 96px);bottom:74px;right:12px}
    html[dir="rtl"] .fv-assistant-panel{right:auto;left:12px}
    #fv-assistant-root{right:12px;bottom:12px}
    html[dir="rtl"] #fv-assistant-root{right:auto;left:12px}
}

/* Dedicated page layout reuses the same chat panel inline. */
.fv-assistant-inline #fv-assistant-root{position:static}
.fv-assistant-inline .fv-assistant-bubble{display:none}
.fv-assistant-inline .fv-assistant-panel{display:flex;position:relative;bottom:auto;right:auto;width:100%;height:72vh;max-height:780px;box-shadow:0 8px 28px rgba(15,23,42,.08)}

/* Fallback / "didn't understand" card. */
.fv-escalate-card{background:#eef2ff;border:1px solid #c7d2fe;color:#1e293b;max-width:100%;text-align:left}
html[dir="rtl"] .fv-escalate-card{text-align:right}
.fv-escalate-card strong{display:block;margin-bottom:6px;color:#312e81}

/* Knowledge-base browse: breadcrumb + category grid + question list. */
.fv-kb-crumb{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:12px;color:#475569;padding:4px 2px 2px;border-bottom:1px solid #e2e8f0;margin-bottom:4px}
.fv-kb-crumb-link{background:none;border:0;color:#5b8cff;cursor:pointer;font-size:12px;padding:2px 4px;text-decoration:none}
.fv-kb-crumb-link:hover{text-decoration:underline}
.fv-kb-crumb-sep{color:#94a3b8}
.fv-kb-crumb-current{color:#0f172a;font-weight:600;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.fv-kb-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.fv-kb-card{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:12px;border:1px solid #e2e8f0;background:#fff;border-radius:12px;cursor:pointer;text-align:left;transition:.15s;position:relative;color:#0f172a}
html[dir="rtl"] .fv-kb-card{text-align:right}
.fv-kb-card:hover{border-color:#a5b4fc;background:#f5f3ff;transform:translateY(-1px);box-shadow:0 4px 12px rgba(91,140,255,.12)}
.fv-kb-card-ico{width:32px;height:32px;border-radius:8px;background:linear-gradient(135deg,#5b8cff,#7a3cff);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:14px}
.fv-kb-card-name{font-size:13px;font-weight:600;line-height:1.25}
.fv-kb-card-count{position:absolute;top:8px;right:8px;font-size:10.5px;background:#e2e8f0;color:#475569;padding:1px 7px;border-radius:999px}
html[dir="rtl"] .fv-kb-card-count{right:auto;left:8px}

.fv-kb-qlist,.fv-kb-related{display:flex;flex-direction:column;gap:4px;margin-top:4px}
.fv-kb-qitem{display:flex;align-items:center;gap:8px;padding:9px 11px;background:#fff;border:1px solid #e2e8f0;border-radius:10px;cursor:pointer;font-size:13px;color:#0f172a;text-align:left;line-height:1.35}
html[dir="rtl"] .fv-kb-qitem{text-align:right}
.fv-kb-qitem:hover{background:#f5f3ff;border-color:#a5b4fc}
.fv-kb-qitem i{color:#5b8cff;flex-shrink:0}
.fv-kb-related{margin-top:8px}
.fv-kb-related-head{font-size:11.5px;font-weight:600;text-transform:uppercase;color:#64748b;letter-spacing:.05em;margin:6px 2px 2px}

.fv-kb-article{max-width:100%}
.fv-kb-answer{font-size:13.5px;line-height:1.55;color:#1e293b}
.fv-kb-answer h1,.fv-kb-answer h2,.fv-kb-answer h3,.fv-kb-answer h4,.fv-kb-answer h5{font-size:13.5px;margin:8px 0 4px;font-weight:600}
.fv-kb-answer p{margin:6px 0}
.fv-kb-answer pre{background:#0f172a;color:#e2e8f0;padding:8px 10px;border-radius:8px;overflow-x:auto;font-size:12px}

/* Inline ticket form rendered inside the body for authenticated clients. */
.fv-kb-ticket{display:flex;flex-direction:column;gap:6px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:12px}
.fv-kb-ticket h6{font-size:13.5px;font-weight:600;color:#0f172a;margin:0}
.fv-kb-ticket-intro{font-size:12px;color:#64748b;margin-bottom:4px}
.fv-kb-ticket label{font-size:11.5px;font-weight:600;color:#334155;margin-top:6px}
.fv-kb-ticket input,.fv-kb-ticket select,.fv-kb-ticket textarea{border:1px solid #cbd5e1;border-radius:8px;padding:7px 10px;font-size:13px;font-family:inherit;background:#f8fafc;color:#0f172a;outline:none;width:100%}
.fv-kb-ticket input:focus,.fv-kb-ticket select:focus,.fv-kb-ticket textarea:focus{border-color:#5b8cff;background:#fff}
.fv-kb-ticket textarea{resize:vertical;min-height:90px}
.fv-kb-ticket-actions{display:flex;justify-content:flex-end;gap:6px;margin-top:8px}
.fv-msg-actionbtn.fv-primary{background:linear-gradient(135deg,#5b8cff,#7a3cff);color:#fff;border-color:transparent}
.fv-msg-actionbtn.fv-primary:hover{filter:brightness(1.05);background:linear-gradient(135deg,#5b8cff,#7a3cff)}
