/* Spark AI site chat widget (local draft) */
#spark-chat-root{position:fixed;right:20px;bottom:20px;z-index:9999;font-family:Montserrat,system-ui,-apple-system,"Segoe UI",sans-serif;color:#0f172a}
#spark-chat-root *,#spark-chat-root *::before,#spark-chat-root *::after{box-sizing:border-box}
.sc-launch{appearance:none;border:0;padding:0;width:64px;height:64px;border-radius:50%;cursor:pointer;background:transparent;display:grid;place-items:center;box-shadow:0 14px 34px rgba(15,23,42,.28);transition:transform .2s ease,box-shadow .2s}
.sc-launch:hover{transform:translateY(-2px);box-shadow:0 18px 40px rgba(234,88,12,.35)}
.sc-launch:focus-visible{outline:3px solid #ea580c;outline-offset:3px}
.sc-launch .spark-av{width:56px;height:56px}
.sc-launch[aria-expanded="true"]{opacity:0;pointer-events:none;transform:scale(.85)}

.sc-panel{position:absolute;right:0;bottom:0;width:min(380px,calc(100vw - 24px));height:min(560px,calc(100vh - 24px));display:flex;flex-direction:column;background:#fff;border-radius:22px;border:1px solid #e2e8f0;box-shadow:0 28px 60px -18px rgba(15,23,42,.45),0 0 0 1px rgba(234,88,12,.08);overflow:hidden;opacity:0;transform:translateY(12px) scale(.96);pointer-events:none;transition:opacity .22s ease,transform .22s ease}
.sc-panel.open{opacity:1;transform:none;pointer-events:auto}
.sc-head{display:flex;align-items:center;gap:12px;padding:14px 16px;background:linear-gradient(180deg,#fff 0%,#fff7ed 100%);border-bottom:1px solid #f1e7dc}
.sc-head .spark-av{width:40px;height:40px}
.sc-head .spark-av .sa-core{inset:3px}
.sc-head .spark-av .sa-glow{inset:-6px}
.sc-head .spark-av .sa-dot::before{width:5px;height:5px;margin-left:-2.5px}
.sc-htext{flex:1;min-width:0}
.sc-htext b{display:block;font-size:15px;font-weight:800;color:#0f172a;letter-spacing:-.01em}
.sc-online{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:#16a34a}
.sc-online i{width:7px;height:7px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 0 rgba(34,197,94,.55);animation:scPulse 1.6s ease-out infinite}
.sc-close{appearance:none;border:0;background:#f8fafc;width:34px;height:34px;border-radius:10px;cursor:pointer;color:#64748b;display:grid;place-items:center}
.sc-close:hover{background:#fff1e7;color:#ea580c}
.sc-close:focus-visible{outline:2px solid #ea580c;outline-offset:2px}
.sc-close svg{width:18px;height:18px}

.sc-body{flex:1;overflow:auto;padding:16px;background:#f8fafc;display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth}
.sc-msg{max-width:92%;padding:11px 13px;border-radius:16px;font-size:13.5px;line-height:1.5;font-weight:500}
.sc-msg.bot{align-self:flex-start;background:#fff;border:1px solid #e2e8f0;color:#0f172a;border-bottom-left-radius:6px;box-shadow:0 4px 14px rgba(15,23,42,.05)}
.sc-msg.user{align-self:flex-end;background:#ea580c;color:#fff;border-bottom-right-radius:6px;box-shadow:0 8px 18px rgba(234,88,12,.28)}
.sc-msg a{color:#ea580c;font-weight:700;text-decoration:none}
.sc-msg.bot a{color:#ea580c}
.sc-msg .sc-cta{display:inline-flex;align-items:center;gap:6px;margin-top:10px;padding:8px 12px;border-radius:999px;background:#ea580c;color:#fff!important;font-size:12.5px;font-weight:800;text-decoration:none}
.sc-msg .sc-cta:hover{filter:brightness(1.05)}

.sc-chips{display:flex;flex-wrap:wrap;gap:8px;padding:0 16px 12px;background:#f8fafc;border-top:0}
.sc-chip{appearance:none;border:1px solid #fed7aa;background:#fff;color:#9a3412;font:inherit;font-size:12.5px;font-weight:700;padding:8px 12px;border-radius:999px;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}
.sc-chip:hover{background:#fff7ed;border-color:#ea580c;transform:translateY(-1px)}
.sc-chip:focus-visible{outline:2px solid #ea580c;outline-offset:2px}

.sc-foot{display:flex;gap:8px;padding:12px 14px;border-top:1px solid #e2e8f0;background:#fff}
.sc-foot input{flex:1;min-width:0;height:42px;border-radius:12px;border:1px solid #e2e8f0;padding:0 12px;font:inherit;font-size:13.5px;font-weight:500;color:#0f172a;background:#f8fafc}
.sc-foot input:focus{outline:2px solid #ea580c;outline-offset:0;border-color:#ea580c;background:#fff}
.sc-send{appearance:none;border:0;height:42px;min-width:42px;padding:0 14px;border-radius:12px;background:#ea580c;color:#fff;font:inherit;font-size:13px;font-weight:800;cursor:pointer}
.sc-send:hover{filter:brightness(1.05)}
.sc-send:focus-visible{outline:2px solid #ea580c;outline-offset:2px}
.sc-send:disabled{opacity:.55;cursor:default}

.sc-typing{align-self:flex-start;display:inline-flex;align-items:center;gap:10px;padding:8px 10px;border-radius:16px;background:#fff;border:1px solid #e2e8f0}
.sc-typing .spark-av{width:28px;height:28px}
.sc-typing .spark-av .sa-core{inset:2px}
.sc-typing .spark-av .sa-glow{inset:-4px}
.sc-typing .spark-av .sa-dot::before{width:3.5px;height:3.5px;margin-left:-1.75px}
.sc-dots{display:inline-flex;gap:4px}
.sc-dots i{width:6px;height:6px;border-radius:50%;background:#fb923c;opacity:.45;animation:scDot 1.1s ease-in-out infinite}
.sc-dots i:nth-child(2){animation-delay:.15s}
.sc-dots i:nth-child(3){animation-delay:.3s}

@keyframes scPulse{0%{box-shadow:0 0 0 0 rgba(34,197,94,.55)}100%{box-shadow:0 0 0 8px transparent}}
@keyframes scDot{0%,100%{transform:translateY(0);opacity:.35}50%{transform:translateY(-3px);opacity:1}}

@media (max-width:600px){
  #spark-chat-root{right:12px;bottom:12px;left:12px}
  .sc-panel{right:0;left:0;width:100%;height:min(78vh,640px);border-radius:20px 20px 16px 16px}
  .sc-launch{margin-left:auto}
}
@media (prefers-reduced-motion:reduce){
  .sc-panel,.sc-launch,.sc-chip{transition:none}
  .sc-online i,.sc-dots i{animation:none}
}

/* Mic (CRM-style orange) + optional speaker toggle */
.sc-speak{appearance:none;border:0;background:#f8fafc;width:34px;height:34px;border-radius:10px;cursor:pointer;color:#64748b;display:grid;place-items:center;flex-shrink:0}
.sc-speak:hover{background:#fff1e7;color:#ea580c}
.sc-speak.on{background:#fff7ed;color:#ea580c}
.sc-speak:focus-visible{outline:2px solid #ea580c;outline-offset:2px}
.sc-speak svg{width:18px;height:18px}

.sc-foot{align-items:center}
.sc-mic{appearance:none;border:0;width:42px;height:42px;border-radius:12px;cursor:pointer;display:grid;place-items:center;flex-shrink:0;background:#fff7ed;color:#ea580c;border:1px solid #fed7aa;transition:background .15s,box-shadow .15s,transform .15s,color .15s}
.sc-mic:hover{background:#ffedd5;border-color:#ea580c}
.sc-mic:focus-visible{outline:2px solid #ea580c;outline-offset:2px}
.sc-mic:disabled{opacity:.55;cursor:default}
.sc-mic svg{width:20px;height:20px}
.sc-mic.listening{background:#ea580c;color:#fff;border-color:#ea580c;box-shadow:0 0 0 0 rgba(234,88,12,.55);animation:scMicPulse 1.2s ease-out infinite}
.sc-mic.listening svg{transform:scale(1.05)}
@keyframes scMicPulse{0%{box-shadow:0 0 0 0 rgba(234,88,12,.55)}100%{box-shadow:0 0 0 12px transparent}}
@media (prefers-reduced-motion:reduce){
  .sc-mic.listening{animation:none}
}
