/* VAI chat widget (AImpact). Uses the brand tokens from site.css. */
.vai { --vai-w: 400px; position: fixed; right: 22px; bottom: 22px; z-index: 90; font-family: var(--body); }
.vai-launch { position: relative; display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 22px 0 8px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; cursor: pointer; box-shadow: 0 14px 40px rgba(14,14,16,.35), inset 0 0 0 1px rgba(255,255,255,.08); transition: transform .2s, box-shadow .2s; }
.vai-launch:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 18px 46px rgba(230,13,2,.35); }
.vai-launch img { width: 52px; height: 52px; object-fit: contain; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff4a3d, var(--red-btn) 60%, #a50800); padding: 6px; }
.vai-launch-label { font: 800 1rem/1 var(--head); letter-spacing: .01em; }
.vai-launch-ring { position: absolute; left: 8px; top: 6px; width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 0 0 0 rgba(253,15,2,.55); animation: vai-pulse 2.4s infinite; pointer-events: none; }
@keyframes vai-pulse { 0% { box-shadow: 0 0 0 0 rgba(253,15,2,.55); } 70% { box-shadow: 0 0 0 16px rgba(253,15,2,0); } 100% { box-shadow: 0 0 0 0 rgba(253,15,2,0); } }
.vai[data-state="open"] .vai-launch { opacity: 0; pointer-events: none; transform: scale(.8); }

.vai-teaser { position: absolute; right: 0; bottom: 78px; width: 270px; background: #fff; color: var(--text); border-radius: 18px 18px 4px 18px; padding: 14px 34px 14px 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); font-size: .9rem; line-height: 1.5; animation: vai-in .35s ease-out; }
.vai-teaser p { margin: 0; }
.vai-teaser b { color: var(--ink); }
.vai-teaser-x { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 1.2rem; color: var(--muted); cursor: pointer; line-height: 1; padding: 4px; }

.vai-panel { position: absolute; right: 0; bottom: 0; width: var(--vai-w); height: min(640px, calc(100vh - 44px)); display: flex; flex-direction: column; background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px rgba(14,14,16,.35), 0 0 0 1px rgba(14,14,16,.06); transform-origin: bottom right; animation: vai-in .28s cubic-bezier(.2,.9,.3,1.2); }
.vai-panel[hidden] { display: none; }
@keyframes vai-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

.vai-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; background: var(--ink); color: #fff; overflow: hidden; }
.vai-head::before { content: ""; position: absolute; right: -60px; top: -90px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(253,15,2,.55), transparent 70%); pointer-events: none; }
.vai-head::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1.5px); background-size: 14px 14px; pointer-events: none; }
.vai-avatar { position: relative; z-index: 1; flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #ff4a3d, var(--red-btn) 60%, #a50800); box-shadow: 0 6px 18px rgba(253,15,2,.4); }
.vai-avatar img { width: 38px; height: 38px; object-fit: contain; }
.vai-title { position: relative; z-index: 1; display: grid; gap: 2px; flex: 1; min-width: 0; }
.vai-title b { font: 900 1.2rem/1 var(--head); letter-spacing: .02em; }
.vai-title span { font-size: .78rem; color: #b9b9c1; display: flex; align-items: center; gap: 6px; }
.vai-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fd06b; box-shadow: 0 0 0 3px rgba(47,208,107,.2); }
.vai-close { position: relative; z-index: 1; width: 38px; height: 38px; border-radius: 12px; border: 0; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; display: grid; place-items: center; }
.vai-close:hover { background: rgba(255,255,255,.16); }
.vai-close svg { width: 18px; height: 18px; }

.vai-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(#fafafa, #fff 120px); overscroll-behavior: contain; scroll-behavior: smooth; }
.vai-msg { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: .93rem; line-height: 1.55; word-wrap: break-word; animation: vai-msg .25s ease-out; }
@keyframes vai-msg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.vai-msg p { margin: 0 0 8px; }
.vai-msg p:last-child, .vai-msg ul:last-child { margin-bottom: 0; }
.vai-msg ul { margin: 4px 0 8px; padding-left: 18px; }
.vai-msg li { margin-bottom: 3px; }
.vai-bot { align-self: flex-start; background: #fff; color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: 0 2px 10px rgba(14,14,16,.04); }
.vai-bot b, .vai-bot strong { color: var(--ink); }
.vai-bot a { color: var(--red-ink); font-weight: 700; }
.vai-me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.vai-typing { display: flex; gap: 4px; align-items: center; padding: 14px 16px; }
.vai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: vai-bounce 1s infinite; }
.vai-typing i:nth-child(2) { animation-delay: .15s; }
.vai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes vai-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

.vai-chips { display: flex; gap: 8px; padding: 8px 16px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
.vai-chips::-webkit-scrollbar { display: none; }
.vai-chips[hidden] { display: none; }
.vai-chips button { flex: none; border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 13px; font: 600 .82rem/1 var(--body); cursor: pointer; white-space: nowrap; transition: .15s; }
.vai-chips button:hover { border-color: var(--red); color: var(--red-ink); }
.vai-chips button[data-form] { background: var(--red-btn); border-color: var(--red-btn); color: #fff; }

.vai-input { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 14px; border: 1.5px solid var(--line); border-radius: 18px; background: #fff; flex: none; transition: border-color .15s, box-shadow .15s; }
.vai-input:focus-within { border-color: var(--red); box-shadow: 0 0 0 4px rgba(253,15,2,.1); }
.vai-input textarea { flex: 1; border: 0; outline: 0; resize: none; font: 400 16px/1.4 var(--body); color: var(--ink); padding: 8px 0; max-height: 120px; background: transparent; }
.vai-input button { flex: none; width: 42px; height: 42px; border: 0; border-radius: 14px; background: var(--red-btn); color: #fff; cursor: pointer; display: grid; place-items: center; transition: transform .15s, opacity .15s; }
.vai-input button:hover { transform: scale(1.05); }
.vai-input button:disabled { opacity: .45; transform: none; cursor: default; }
.vai-input button svg { width: 19px; height: 19px; margin-left: 2px; }
.vai-foot { flex: none; margin: 0; padding: 8px 16px 12px; text-align: center; font-size: .72rem; color: var(--muted); }
.vai-foot a { color: inherit; }

.vai-lead { align-self: stretch; background: #fff; border: 1.5px solid var(--ink); border-radius: 18px; padding: 16px; display: grid; gap: 10px; animation: vai-msg .25s ease-out; }
.vai-lead h4 { margin: 0; font: 800 1rem var(--head); color: var(--ink); }
.vai-lead p.sub { margin: -4px 0 2px; font-size: .82rem; color: var(--muted); }
.vai-lead input[type=text], .vai-lead input[type=email], .vai-lead input[type=tel] { width: 100%; font: 400 16px/1.3 var(--body); padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink); }
.vai-lead input:focus { outline: none; border-color: var(--red); }
.vai-lead label.c { display: grid; grid-template-columns: 18px 1fr; gap: 8px; font-size: .72rem; line-height: 1.45; color: var(--muted); }
.vai-lead label.c input { margin: 2px 0 0; accent-color: var(--red-btn); }
.vai-lead label.c a { color: inherit; }
.vai-lead .row { display: flex; gap: 8px; }
.vai-lead button[type=submit] { flex: 1; border: 0; border-radius: 999px; background: var(--red-btn); color: #fff; font: 700 .92rem var(--body); padding: 12px; cursor: pointer; }
.vai-lead button.later { border: 0; background: none; color: var(--muted); font: 600 .85rem var(--body); cursor: pointer; }
.vai-lead .err { color: var(--red-ink); font-size: .82rem; font-weight: 600; margin: 0; }

@media (max-width: 600px) {
  .vai { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .vai-launch { height: 58px; padding: 0 18px 0 6px; }
  .vai-launch img, .vai-launch-ring { width: 46px; height: 46px; }
  .vai-launch-ring { left: 6px; top: 6px; }
  .vai-teaser { bottom: 70px; width: min(270px, calc(100vw - 28px)); }
  .vai[data-state="open"] { inset: 0; right: 0; bottom: 0; }
  .vai-panel { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; animation: vai-up .3s cubic-bezier(.2,.9,.3,1); }
  @keyframes vai-up { from { transform: translateY(100%); } to { transform: none; } }
  .vai-head { padding-top: calc(16px + env(safe-area-inset-top)); }
  .vai-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .vai-msg { max-width: 90%; }
}
@media (prefers-reduced-motion: reduce) {
  .vai-launch-ring, .vai-typing i { animation: none; }
  .vai-panel, .vai-msg, .vai-teaser, .vai-lead { animation: none; }
}
