{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ai-chat-bubble-launcher",
  "title": "AI Chat Bubble Launcher",
  "description": "A floating support launcher for any page: a gradient-ringed bubble with an unread badge, a proactive teaser with quick-reply chips, and a panel with Home, Messages and Help tabs, streamed AI answers, a hand-off to a person and searchable help articles.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/ai-chat-bubble-launcher/ai-chat-bubble-launcher.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport interface LauncherMessage {\n  id: string;\n  from: \"user\" | \"assistant\" | \"agent\" | \"system\";\n  text: string;\n  time?: string;\n}\nexport interface LauncherThread {\n  id: string;\n  title: string;\n  preview: string;\n  time: string;\n  unread?: number;\n  messages: LauncherMessage[];\n}\nexport interface LauncherArticle {\n  id: string;\n  title: string;\n  collection: string;\n  body: string;\n}\n\nexport interface AIChatBubbleLauncherProps {\n  /** Name shown in the panel header. */\n  assistantName?: string;\n  greeting?: string;\n  /** Proactive message above the bubble. Set to null to turn it off. */\n  teaser?: { text: string; chips: string[]; delay?: number } | null;\n  suggestions?: string[];\n  threads?: LauncherThread[];\n  articles?: LauncherArticle[];\n  /** Return the assistant's reply. Defaults to built-in demo answers. */\n  getReply?: (text: string) => string | Promise<string>;\n  onHandoff?: (threadId: string) => void;\n  defaultOpen?: boolean;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { bg: \"#0A0A0A\", page: \"#0F0F0F\", text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.62)\", faint: \"rgba(245,244,241,0.36)\", panel: \"#111111\", card: \"#171717\", border: \"rgba(255,255,255,0.09)\", hover: \"rgba(255,255,255,0.05)\", chip: \"rgba(255,255,255,0.06)\", on: \"#F5F4F1\", onText: \"#0A0A0A\", accent: \"#FB923C\", accentSoft: \"rgba(251,146,60,0.14)\", user: \"#F5F4F1\", userText: \"#0A0A0A\", ok: \"#4ADE80\", skel: \"rgba(255,255,255,0.05)\", ring: \"rgba(245,244,241,0.6)\" },\n  light: { bg: \"#FAFAF8\", page: \"#F2F1EE\", text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.62)\", faint: \"rgba(10,10,10,0.4)\", panel: \"#FFFFFF\", card: \"#F7F6F3\", border: \"rgba(10,10,10,0.09)\", hover: \"rgba(10,10,10,0.03)\", chip: \"rgba(10,10,10,0.05)\", on: \"#0A0A0A\", onText: \"#FAFAF8\", accent: \"#EA580C\", accentSoft: \"rgba(234,88,12,0.1)\", user: \"#0A0A0A\", userText: \"#FAFAF8\", ok: \"#15803D\", skel: \"rgba(10,10,10,0.05)\", ring: \"rgba(10,10,10,0.5)\" },\n};\nconst GRADIENT = \"linear-gradient(90deg,#FB923C,#F472B6,#A78BFA,#60A5FA)\";\n\nconst DEFAULT_TEASER = { text: \"Hi, I can answer questions about plans, billing or your account in a few seconds.\", chips: [\"Compare plans\", \"Reset my password\", \"Talk to a person\"], delay: 1.2 };\nconst DEFAULT_SUGGESTIONS = [\"How does billing work?\", \"Can I change my plan later?\", \"Do you offer refunds?\", \"How do I invite my team?\"];\nconst DEFAULT_THREADS: LauncherThread[] = [\n  {\n    id: \"t1\",\n    title: \"Invoice for October\",\n    preview: \"Your invoice is attached. Anything else?\",\n    time: \"2h\",\n    unread: 2,\n    messages: [\n      { id: \"m1\", from: \"user\", text: \"Can I get the October invoice with our VAT number on it?\", time: \"10:12\" },\n      { id: \"m2\", from: \"assistant\", text: \"Of course. I added VAT number DE 312 455 908 and re-issued it.\", time: \"10:12\" },\n      { id: \"m3\", from: \"assistant\", text: \"Your invoice is attached. Anything else?\", time: \"10:13\" },\n    ],\n  },\n  {\n    id: \"t2\",\n    title: \"Adding a teammate\",\n    preview: \"You can invite people from Settings → Team.\",\n    time: \"Mon\",\n    messages: [\n      { id: \"m4\", from: \"user\", text: \"How do I add someone to our workspace?\", time: \"Mon\" },\n      { id: \"m5\", from: \"assistant\", text: \"You can invite people from Settings → Team. They get an email link that's valid for 7 days.\", time: \"Mon\" },\n    ],\n  },\n];\nconst DEFAULT_ARTICLES: LauncherArticle[] = [\n  { id: \"a1\", collection: \"Billing\", title: \"How billing works\", body: \"You're billed at the start of each month for the seats you have. Adding a seat mid-month is charged for the days left; removing one gives credit on the next invoice.\" },\n  { id: \"a2\", collection: \"Billing\", title: \"Changing or cancelling your plan\", body: \"Go to Settings → Billing and pick a new plan. Upgrades start right away; downgrades and cancellations take effect at the end of the current period.\" },\n  { id: \"a3\", collection: \"Billing\", title: \"Refunds\", body: \"Annual plans can be refunded in full within 14 days of purchase. Monthly plans aren't refunded, but you can cancel any time.\" },\n  { id: \"a4\", collection: \"Account\", title: \"Resetting your password\", body: \"On the sign-in screen choose Forgot password. The reset link is valid for one hour. If you use single sign-on, reset it with your identity provider instead.\" },\n  { id: \"a5\", collection: \"Account\", title: \"Turning on two-factor authentication\", body: \"Open Settings → Security and choose Authenticator app. Scan the code and save your backup codes somewhere safe.\" },\n  { id: \"a6\", collection: \"Team\", title: \"Inviting teammates\", body: \"Admins can invite people from Settings → Team. Invites last 7 days. Guests can see only the projects you share with them.\" },\n];\nconst DEMO_REPLIES: [RegExp, string][] = [\n  [/refund/i, \"Annual plans can be refunded in full within 14 days. Monthly plans aren't refunded, but you can cancel whenever you like and keep access until the period ends.\"],\n  [/(plan|upgrade|downgrade|compare|price|pricing)/i, \"There are three plans: Starter for solo work, Team with shared projects and roles, and Business with SSO and audit logs. You can switch at any time from Settings → Billing.\"],\n  [/(bill|invoice|vat|charge)/i, \"You're billed monthly per seat. Invoices are in Settings → Billing, and you can add a VAT number there so it shows on every invoice.\"],\n  [/(password|sign ?in|log ?in|2fa|two-factor)/i, \"Use Forgot password on the sign-in screen. The link works for an hour. If you sign in with SSO, reset it with your company's identity provider.\"],\n  [/(invite|team|teammate|seat|member)/i, \"Admins can invite people from Settings → Team. Each invite link lasts 7 days, and guests only see the projects you share with them.\"],\n];\nconst demoReply = (t: string) => DEMO_REPLIES.find(([r]) => r.test(t))?.[1] ?? \"Good question. I've noted it, and I'd suggest the Help tab for step-by-step guides. If you'd rather talk to a person, tap Talk to a person.\";\n\ntype Tab = \"home\" | \"messages\" | \"help\";\n\n// A breathing sphere of dots, after the orb in AI Dynamic Island 02: points on a Fibonacci\n// sphere, pushed in and out by three sine waves, lit from the top left with a cyan rim.\nconst ORB_N = 170;\nconst ORB_PTS = (() => {\n  const golden = Math.PI * (3 - Math.sqrt(5));\n  let seed = 97;\n  const rnd = () => {\n    seed = (seed * 16807) % 2147483647;\n    return seed / 2147483647;\n  };\n  return Array.from({ length: ORB_N }, (_, i) => {\n    const y = 1 - (2 * (i + 0.5)) / ORB_N;\n    const r = Math.sqrt(Math.max(0, 1 - y * y));\n    return { x: r * Math.cos(i * golden), y, z: r * Math.sin(i * golden), s: rnd(), ph: rnd() };\n  });\n})();\nconst ORB_BASE = [255, 255, 255];\nconst ORB_RIM = [124, 243, 255];\nconst clamp01 = (v: number) => (v < 0 ? 0 : v > 1 ? 1 : v);\n\nfunction drawOrb(ctx: CanvasRenderingContext2D, side: number, t: number) {\n  ctx.clearRect(0, 0, side, side);\n  const level = 0.22 + 0.14 * Math.sin(t * 1.3);\n  const amp = 0.4 + level;\n  const base = 0.72 + 0.12 * level;\n  const yaw = t * 0.45 * 0.6;\n  const cyw = Math.cos(yaw);\n  const syw = Math.sin(yaw);\n  const ct = Math.cos(0.3);\n  const st = Math.sin(0.3);\n  const R = side * 0.43;\n  const k = side / 44;\n  const ph = t * 1.4;\n  for (const p of ORB_PTS) {\n    const a1 = 1.8 * p.x + 1.4 * p.y + ph;\n    const a2 = 2.5 * p.y - 1.8 * p.z - ph * 1.3;\n    const a3 = 3.2 * p.z + 1.2 * p.x + ph * 1.7;\n    const wr = 1 + amp * (0.11 * Math.sin(a1) + 0.08 * Math.sin(a2) + 0.06 * Math.sin(a3));\n    const g = wr * base;\n    const lx = p.x * g;\n    const lz = p.z * g;\n    const x = lx * cyw + lz * syw;\n    let z = -lx * syw + lz * cyw;\n    let y = p.y * g;\n    const ty = y * ct - z * st;\n    z = y * st + z * ct;\n    y = ty;\n    // Normal of the unit sphere is good enough for lighting at this size.\n    const nx = p.x * cyw + p.z * syw;\n    let nz = -p.x * syw + p.z * cyw;\n    const ny = p.y * ct - nz * st;\n    nz = p.y * st + nz * ct;\n    const persp = 1 / (1 - z * 0.28);\n    const d = clamp01((z + 1) / 2);\n    const mod = clamp01(0.5 + (wr - 1) / (amp * 0.5));\n    const size = 0.35 + 0.65 * mod;\n    const lam = Math.max(0, nx * -0.34 + ny * -0.58 + nz * 0.74);\n    const light = 0.22 + 0.78 * Math.pow(lam, 0.9);\n    const rim = nz > 0 ? Math.pow(1 - nz, 3) : 0;\n    const tw = 0.9 + 0.1 * Math.sin(t * (1 + p.s * 2) + p.ph * 40);\n    const a = Math.min(1, light * (0.3 + 0.7 * Math.pow(d, 1.1)) * (0.45 + 0.55 * size) * tw * 1.15 + rim * 0.28 * (0.4 + 0.6 * d));\n    const r = (0.95 + 0.25 * p.s) * (0.4 + 0.6 * size) * (0.55 + 0.6 * d) * k;\n    if (a < 0.03 || r < 0.15) continue;\n    const m = Math.min(1, rim * 0.9 + level * 0.55) * 0.7;\n    const c = ORB_BASE.map((b, i) => Math.round(b + (ORB_RIM[i] - b) * m));\n    ctx.fillStyle = `rgba(${c[0]},${c[1]},${c[2]},${a.toFixed(3)})`;\n    ctx.beginPath();\n    ctx.arc(side / 2 + x * persp * R, side / 2 + y * persp * R, r, 0, Math.PI * 2);\n    ctx.fill();\n  }\n}\n\nfunction Orb({ size, still }: { size: number; still: boolean }) {\n  const ref = React.useRef<HTMLCanvasElement>(null);\n  React.useEffect(() => {\n    const canvas = ref.current;\n    const ctx = canvas?.getContext(\"2d\");\n    if (!canvas || !ctx) return;\n    const dpr = Math.min(window.devicePixelRatio || 1, 2);\n    canvas.width = Math.round(size * dpr);\n    canvas.height = Math.round(size * dpr);\n    ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n    if (still) {\n      drawOrb(ctx, size, 0.8);\n      return;\n    }\n    let raf = 0;\n    const start = performance.now();\n    const frame = (now: number) => {\n      drawOrb(ctx, size, (now - start) / 1000);\n      raf = requestAnimationFrame(frame);\n    };\n    raf = requestAnimationFrame(frame);\n    return () => cancelAnimationFrame(raf);\n  }, [size, still]);\n  return <canvas ref={ref} aria-hidden=\"true\" style={{ width: size, height: size }} className=\"block\" />;\n}\n\nfunction Sparkle({ size = 14, color }: { size?: number; color: string }) {\n  return (\n    <svg width={size} height={size} viewBox=\"0 0 24 24\" aria-hidden=\"true\" className=\"shrink-0\">\n      <path d=\"M12 2.5c.6 4.9 3.6 7.9 8.5 8.5-4.9.6-7.9 3.6-8.5 8.5-.6-4.9-3.6-7.9-8.5-8.5 4.9-.6 7.9-3.6 8.5-8.5Z\" fill={color} />\n    </svg>\n  );\n}\n\nexport function AIChatBubbleLauncher({\n  assistantName = \"Atlas\",\n  greeting = \"Hi there. How can we help?\",\n  teaser = DEFAULT_TEASER,\n  suggestions = DEFAULT_SUGGESTIONS,\n  threads: threadsProp,\n  articles = DEFAULT_ARTICLES,\n  getReply = demoReply,\n  onHandoff,\n  defaultOpen = false,\n  theme = \"dark\",\n  className,\n}: AIChatBubbleLauncherProps) {\n  const p = PALETTES[theme];\n  const reduce = !!useReducedMotion();\n  const uid = React.useId();\n  const [open, setOpen] = React.useState(defaultOpen);\n  const [tab, setTab] = React.useState<Tab>(\"home\");\n  const [threads, setThreads] = React.useState<LauncherThread[]>(() => threadsProp ?? DEFAULT_THREADS);\n  const [threadId, setThreadId] = React.useState<string | null>(null);\n  const [draft, setDraft] = React.useState(\"\");\n  const [typing, setTyping] = React.useState(false);\n  const [streaming, setStreaming] = React.useState<{ id: string; full: string; shown: number } | null>(null);\n  const [teaserOn, setTeaserOn] = React.useState(false);\n  const [teaserGone, setTeaserGone] = React.useState(false);\n  const [q, setQ] = React.useState(\"\");\n  const [articleId, setArticleId] = React.useState<string | null>(null);\n  const [votes, setVotes] = React.useState<Record<string, \"up\" | \"down\">>({});\n  const seq = React.useRef(0);\n  const launcherRef = React.useRef<HTMLButtonElement>(null);\n  const listRef = React.useRef<HTMLDivElement>(null);\n  const timers = React.useRef<ReturnType<typeof setTimeout>[]>([]);\n  const later = (fn: () => void, ms: number) => {\n    timers.current.push(setTimeout(fn, ms));\n  };\n  React.useEffect(() => {\n    const t = timers.current;\n    return () => t.forEach(clearTimeout);\n  }, []);\n\n  // Proactive teaser after a short delay, only while the panel is closed.\n  React.useEffect(() => {\n    if (!teaser || open || teaserGone) return;\n    const id = setTimeout(() => setTeaserOn(true), (teaser.delay ?? 1.2) * 1000);\n    return () => clearTimeout(id);\n  }, [teaser, open, teaserGone]);\n\n  // Reveal a streamed reply a few characters at a time.\n  React.useEffect(() => {\n    if (!streaming) return;\n    if (streaming.shown >= streaming.full.length) {\n      const done = streaming;\n      const id = setTimeout(() => {\n        setThreads((ts) => ts.map((t) => ({ ...t, messages: t.messages.map((m) => (m.id === done.id ? { ...m, text: done.full } : m)) })));\n        setStreaming(null);\n      }, 0);\n      return () => clearTimeout(id);\n    }\n    const id = setTimeout(() => setStreaming((s) => (s ? { ...s, shown: Math.min(s.full.length, s.shown + 3) } : s)), 18);\n    return () => clearTimeout(id);\n  }, [streaming]);\n\n  React.useEffect(() => {\n    if (!open) return;\n    const key = (e: KeyboardEvent) => {\n      if (e.key === \"Escape\") {\n        setOpen(false);\n        requestAnimationFrame(() => launcherRef.current?.focus());\n      }\n    };\n    window.addEventListener(\"keydown\", key);\n    return () => window.removeEventListener(\"keydown\", key);\n  }, [open]);\n\n  React.useEffect(() => {\n    const el = listRef.current;\n    if (el) el.scrollTop = el.scrollHeight;\n  }, [threads, typing, streaming?.shown, threadId]);\n\n  const unread = threads.reduce((n, t) => n + (t.unread ?? 0), 0);\n  const thread = threads.find((t) => t.id === threadId) ?? null;\n  const query = q.trim().toLowerCase();\n  const found = articles.filter((a) => !query || `${a.title} ${a.body} ${a.collection}`.toLowerCase().includes(query));\n  const collections = Array.from(new Set(articles.map((a) => a.collection)));\n  const article = articles.find((a) => a.id === articleId) ?? null;\n  const now = () => {\n    const d = new Date();\n    return `${String(d.getHours()).padStart(2, \"0\")}:${String(d.getMinutes()).padStart(2, \"0\")}`;\n  };\n\n  const openPanel = (next?: Tab) => {\n    setOpen(true);\n    setTeaserOn(false);\n    setTeaserGone(true);\n    if (next) setTab(next);\n  };\n  const openThread = (id: string) => {\n    setThreadId(id);\n    setTab(\"messages\");\n    setThreads((ts) => ts.map((t) => (t.id === id ? { ...t, unread: 0 } : t)));\n  };\n\n  const send = async (raw: string, into?: string) => {\n    const text = raw.trim();\n    if (!text || typing || streaming) return;\n    seq.current += 1;\n    const n = seq.current;\n    const userMsg: LauncherMessage = { id: `u${n}`, from: \"user\", text, time: now() };\n    let tid = into ?? threadId;\n    if (!tid) {\n      tid = `new${n}`;\n      const fresh: LauncherThread = { id: tid, title: text.length > 32 ? `${text.slice(0, 32)}…` : text, preview: text, time: \"now\", messages: [] };\n      setThreads((ts) => [fresh, ...ts]);\n    }\n    const target = tid;\n    setThreadId(target);\n    setTab(\"messages\");\n    setDraft(\"\");\n    setThreads((ts) => ts.map((t) => (t.id === target ? { ...t, preview: text, time: \"now\", messages: [...t.messages, userMsg] } : t)));\n    if (/talk to a (person|human)|agent/i.test(text)) {\n      handoff(target);\n      return;\n    }\n    setTyping(true);\n    const reply = await Promise.resolve(getReply(text));\n    later(\n      () => {\n        setTyping(false);\n        const id = `a${n}`;\n        setThreads((ts) => ts.map((t) => (t.id === target ? { ...t, preview: reply, messages: [...t.messages, { id, from: \"assistant\", text: \"\", time: now() }] } : t)));\n        if (reduce) setThreads((ts) => ts.map((t) => (t.id === target ? { ...t, messages: t.messages.map((m) => (m.id === id ? { ...m, text: reply } : m)) } : t)));\n        else setStreaming({ id, full: reply, shown: 0 });\n      },\n      reduce ? 0 : 900,\n    );\n  };\n\n  const handoff = (target: string) => {\n    onHandoff?.(target);\n    seq.current += 1;\n    const n = seq.current;\n    setThreads((ts) => ts.map((t) => (t.id === target ? { ...t, messages: [...t.messages, { id: `s${n}`, from: \"system\", text: \"Connecting you to the team. Usual reply time is under 5 minutes.\" }] } : t)));\n    later(() => {\n      setThreads((ts) => ts.map((t) => (t.id === target ? { ...t, preview: \"Sam here, I've read the chat so far.\", messages: [...t.messages, { id: `g${n}`, from: \"agent\", text: \"Hi, Sam here from support. I've read the chat so far, give me a moment.\", time: now() }] } : t)));\n    }, 1600);\n  };\n\n  const panelId = `${uid}-panel`;\n  const tabBtn = (id: Tab, label: string, icon: React.ReactNode, badge?: number) => (\n    <button\n      key={id}\n      type=\"button\"\n      role=\"tab\"\n      aria-selected={tab === id}\n      aria-controls={`${uid}-tabpanel`}\n      onClick={() => {\n        setTab(id);\n        if (id !== \"messages\") setThreadId(null);\n        if (id !== \"help\") setArticleId(null);\n      }}\n      className=\"relative flex flex-1 cursor-pointer flex-col items-center gap-1 border-0 bg-transparent py-2.5 text-[11.5px] font-medium outline-none focus-visible:ring-2\"\n      style={{ color: tab === id ? p.text : p.faint, [\"--tw-ring-color\" as string]: p.ring }}\n    >\n      <span className=\"relative\">\n        {icon}\n        {!!badge && <span className=\"absolute -top-1.5 -right-2.5 grid h-4 min-w-4 place-items-center rounded-full px-1 text-[10px] font-bold text-white\" style={{ background: p.accent }}>{badge}</span>}\n      </span>\n      {label}\n    </button>\n  );\n\n  const shown = (m: LauncherMessage) => (streaming && streaming.id === m.id ? streaming.full.slice(0, streaming.shown) : m.text);\n\n  return (\n    <div className={cn(\"@container relative isolate h-[640px] w-full overflow-hidden\", className)} style={{ background: p.page, color: p.text }}>\n      {/* A quiet page behind the launcher, so the widget is seen in context */}\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0 p-6 @[640px]:p-10\">\n        <div className=\"flex items-center justify-between\">\n          <span className=\"h-3 w-20 rounded-full\" style={{ background: p.skel }} />\n          <span className=\"flex gap-3\">\n            {[0, 1, 2].map((i) => (\n              <span key={i} className=\"h-3 w-12 rounded-full\" style={{ background: p.skel }} />\n            ))}\n          </span>\n        </div>\n        <div className=\"mt-16 max-w-md space-y-3\">\n          <span className=\"block h-8 w-4/5 rounded-lg\" style={{ background: p.skel }} />\n          <span className=\"block h-8 w-3/5 rounded-lg\" style={{ background: p.skel }} />\n          <span className=\"block h-3 w-full rounded-full\" style={{ background: p.skel }} />\n          <span className=\"block h-3 w-11/12 rounded-full\" style={{ background: p.skel }} />\n        </div>\n        <div className=\"mt-10 grid max-w-xl grid-cols-3 gap-3\">\n          {[0, 1, 2].map((i) => (\n            <span key={i} className=\"h-28 rounded-xl\" style={{ background: p.skel }} />\n          ))}\n        </div>\n      </div>\n\n      {/* Teaser */}\n      <AnimatePresence>\n        {teaser && teaserOn && !open && (\n          <motion.div\n            key=\"teaser\"\n            role=\"status\"\n            initial={reduce ? false : { opacity: 0, y: 12, scale: 0.96 }}\n            animate={{ opacity: 1, y: 0, scale: 1 }}\n            exit={reduce ? undefined : { opacity: 0, y: 8, scale: 0.97 }}\n            transition={{ type: \"spring\", stiffness: 380, damping: 30 }}\n            className=\"absolute right-5 bottom-[92px] z-20 w-[min(300px,calc(100%-40px))] origin-bottom-right\"\n          >\n            <div className=\"relative rounded-2xl border p-3.5 pr-9 shadow-[0_20px_40px_-20px_rgba(0,0,0,0.6)]\" style={{ background: p.panel, borderColor: p.border }}>\n              <button type=\"button\" onClick={() => { setTeaserOn(false); setTeaserGone(true); }} aria-label=\"Dismiss message\" className=\"absolute top-2 right-2 grid h-7 w-7 cursor-pointer place-items-center rounded-full border-0 bg-transparent text-[16px] outline-none focus-visible:ring-2\" style={{ color: p.faint, [\"--tw-ring-color\" as string]: p.ring }}>\n                ×\n              </button>\n              <p className=\"m-0 flex items-center gap-1.5 text-[12px] font-semibold\" style={{ color: p.accent }}>\n                <Sparkle size={12} color={p.accent} /> {assistantName}\n              </p>\n              <p className=\"m-0 mt-1 text-[13.5px] leading-[1.45]\">{teaser.text}</p>\n            </div>\n            <div className=\"mt-2 flex flex-wrap justify-end gap-1.5\">\n              {teaser.chips.map((c, i) => (\n                <motion.button\n                  key={c}\n                  type=\"button\"\n                  initial={reduce ? false : { opacity: 0, y: 6 }}\n                  animate={{ opacity: 1, y: 0 }}\n                  transition={{ delay: reduce ? 0 : 0.15 + i * 0.06 }}\n                  onClick={() => {\n                    openPanel(\"messages\");\n                    setThreadId(null);\n                    void send(c, undefined);\n                  }}\n                  className=\"h-8 cursor-pointer rounded-full border px-3 text-[12.5px] font-medium outline-none focus-visible:ring-2\"\n                  style={{ background: p.panel, borderColor: p.border, color: p.text, [\"--tw-ring-color\" as string]: p.ring }}\n                >\n                  {c}\n                </motion.button>\n              ))}\n            </div>\n          </motion.div>\n        )}\n      </AnimatePresence>\n\n      {/* Panel */}\n      <AnimatePresence>\n        {open && (\n          <motion.div\n            key=\"panel\"\n            id={panelId}\n            role=\"dialog\"\n            aria-label={`${assistantName} chat`}\n            initial={reduce ? false : { opacity: 0, y: 24, scale: 0.94 }}\n            animate={{ opacity: 1, y: 0, scale: 1 }}\n            exit={reduce ? undefined : { opacity: 0, y: 16, scale: 0.96 }}\n            transition={{ type: \"spring\", stiffness: 360, damping: 32 }}\n            className=\"absolute right-4 bottom-[88px] z-30 flex h-[min(520px,calc(100%-104px))] w-[min(380px,calc(100%-32px))] origin-bottom-right flex-col overflow-hidden rounded-[22px] border shadow-[0_30px_60px_-24px_rgba(0,0,0,0.65)]\"\n            style={{ background: p.panel, borderColor: p.border }}\n          >\n            {/* Header */}\n            <div className=\"relative shrink-0 px-4 pt-4 pb-3.5\">\n              <div className=\"flex items-center gap-3\">\n                {(thread || article) && (\n                  <button\n                    type=\"button\"\n                    onClick={() => {\n                      setThreadId(null);\n                      setArticleId(null);\n                    }}\n                    aria-label=\"Back\"\n                    className=\"grid h-8 w-8 shrink-0 cursor-pointer place-items-center rounded-full border-0 bg-transparent outline-none focus-visible:ring-2\"\n                    style={{ color: p.text, [\"--tw-ring-color\" as string]: p.ring }}\n                  >\n                    <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" className=\"shrink-0\">\n                      <path d=\"m15 18-6-6 6-6\" />\n                    </svg>\n                  </button>\n                )}\n                <span className=\"relative grid h-9 w-9 shrink-0 place-items-center rounded-full border\" style={{ background: p.card, borderColor: p.border }}>\n                  <Sparkle size={16} color={p.accent} />\n                  <span className=\"absolute -right-0.5 -bottom-0.5 h-2.5 w-2.5 rounded-full border-2\" style={{ background: p.ok, borderColor: p.panel }} />\n                </span>\n                <span className=\"min-w-0 flex-1\">\n                  <span className=\"block truncate text-[14.5px] font-semibold\">{thread ? thread.title : article ? article.collection : assistantName}</span>\n                  <span className=\"block truncate text-[12px]\" style={{ color: p.muted }}>\n                    {thread ? `${assistantName} and the support team` : \"Instant AI answers · team in ~5 min\"}\n                  </span>\n                </span>\n                <button type=\"button\" onClick={() => { setOpen(false); requestAnimationFrame(() => launcherRef.current?.focus()); }} aria-label=\"Close chat\" className=\"grid h-8 w-8 shrink-0 cursor-pointer place-items-center rounded-full border-0 bg-transparent text-[18px] outline-none focus-visible:ring-2\" style={{ color: p.muted, [\"--tw-ring-color\" as string]: p.ring }}>\n                  ×\n                </button>\n              </div>\n              <span aria-hidden=\"true\" className=\"absolute inset-x-0 bottom-0 h-px opacity-60\" style={{ background: GRADIENT }} />\n            </div>\n\n            {/* Body */}\n            <div id={`${uid}-tabpanel`} role=\"tabpanel\" className=\"relative min-h-0 flex-1\">\n              <AnimatePresence mode=\"wait\" initial={false}>\n                {tab === \"home\" && (\n                  <motion.div key=\"home\" initial={reduce ? false : { opacity: 0, x: -10 }} animate={{ opacity: 1, x: 0 }} exit={reduce ? undefined : { opacity: 0, x: -10 }} transition={{ duration: 0.18 }} className=\"absolute inset-0 overflow-y-auto overscroll-contain p-4\">\n                    <p className=\"m-0 text-[22px] leading-tight font-semibold tracking-[-0.02em]\">{greeting}</p>\n                    <form\n                      className=\"mt-4 flex items-center gap-2 rounded-xl border px-3\"\n                      style={{ background: p.card, borderColor: p.border }}\n                      onSubmit={(e) => {\n                        e.preventDefault();\n                        setThreadId(null);\n                        void send(draft);\n                      }}\n                    >\n                      <Sparkle size={14} color={p.accent} />\n                      <label className=\"sr-only\" htmlFor={`${uid}-ask`}>\n                        Ask a question\n                      </label>\n                      <input id={`${uid}-ask`} value={draft} onChange={(e) => setDraft(e.target.value)} placeholder=\"Ask a question…\" className=\"h-11 min-w-0 flex-1 border-0 bg-transparent text-[14px] outline-none\" style={{ color: p.text }} />\n                      <button type=\"submit\" disabled={!draft.trim()} aria-label=\"Send\" className=\"grid h-8 w-8 shrink-0 cursor-pointer place-items-center rounded-full border-0 outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-35\" style={{ background: p.on, color: p.onText, [\"--tw-ring-color\" as string]: p.ring }}>\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" className=\"shrink-0\">\n                          <path d=\"M12 19V5M5 12l7-7 7 7\" />\n                        </svg>\n                      </button>\n                    </form>\n                    <p className=\"m-0 mt-5 text-[11.5px] font-semibold tracking-[0.08em] uppercase\" style={{ color: p.faint }}>\n                      People often ask\n                    </p>\n                    <ul className=\"m-0 mt-2 list-none p-0\">\n                      {suggestions.map((s) => (\n                        <li key={s}>\n                          <button\n                            type=\"button\"\n                            onClick={() => {\n                              setThreadId(null);\n                              void send(s);\n                            }}\n                            className=\"flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg border-0 bg-transparent px-2 py-2.5 text-left text-[13.5px] outline-none hover:bg-[var(--h)] focus-visible:ring-2\"\n                            style={{ color: p.text, [\"--h\" as string]: p.hover, [\"--tw-ring-color\" as string]: p.ring }}\n                          >\n                            {s}\n                            <span aria-hidden=\"true\" style={{ color: p.faint }}>\n                              →\n                            </span>\n                          </button>\n                        </li>\n                      ))}\n                    </ul>\n                    <div className=\"mt-4 flex items-center gap-2.5 rounded-xl border px-3 py-2.5\" style={{ background: p.card, borderColor: p.border }}>\n                      <span className=\"h-2 w-2 shrink-0 rounded-full\" style={{ background: p.ok }} />\n                      <span className=\"text-[12.5px]\">\n                        All systems working <span style={{ color: p.faint }}>· updated 2 min ago</span>\n                      </span>\n                    </div>\n                  </motion.div>\n                )}\n\n                {tab === \"messages\" && !thread && (\n                  <motion.div key=\"list\" initial={reduce ? false : { opacity: 0, x: -10 }} animate={{ opacity: 1, x: 0 }} exit={reduce ? undefined : { opacity: 0, x: -10 }} transition={{ duration: 0.18 }} className=\"absolute inset-0 overflow-y-auto overscroll-contain p-2\">\n                    <ul className=\"m-0 list-none p-0\">\n                      {threads.map((t) => (\n                        <li key={t.id}>\n                          <button type=\"button\" onClick={() => openThread(t.id)} className=\"flex w-full cursor-pointer items-start gap-3 rounded-xl border-0 bg-transparent p-3 text-left outline-none hover:bg-[var(--h)] focus-visible:ring-2\" style={{ color: p.text, [\"--h\" as string]: p.hover, [\"--tw-ring-color\" as string]: p.ring }}>\n                            <span className=\"grid h-9 w-9 shrink-0 place-items-center rounded-full border\" style={{ background: p.card, borderColor: p.border }}>\n                              <Sparkle size={14} color={p.accent} />\n                            </span>\n                            <span className=\"min-w-0 flex-1\">\n                              <span className=\"flex items-baseline justify-between gap-2\">\n                                <span className={cn(\"truncate text-[14px]\", t.unread ? \"font-semibold\" : \"font-medium\")}>{t.title}</span>\n                                <span className=\"shrink-0 text-[11.5px]\" style={{ color: p.faint }}>\n                                  {t.time}\n                                </span>\n                              </span>\n                              <span className=\"mt-0.5 flex items-center gap-2\">\n                                <span className=\"min-w-0 flex-1 truncate text-[12.5px]\" style={{ color: t.unread ? p.text : p.muted }}>\n                                  {t.preview}\n                                </span>\n                                {!!t.unread && <span className=\"grid h-5 min-w-5 shrink-0 place-items-center rounded-full px-1 text-[11px] font-bold text-white\" style={{ background: p.accent }}>{t.unread}</span>}\n                              </span>\n                            </span>\n                          </button>\n                        </li>\n                      ))}\n                    </ul>\n                    <div className=\"p-2\">\n                      <button type=\"button\" onClick={() => setTab(\"home\")} className=\"h-10 w-full cursor-pointer rounded-xl border-0 text-[13.5px] font-semibold outline-none focus-visible:ring-2\" style={{ background: p.on, color: p.onText, [\"--tw-ring-color\" as string]: p.ring }}>\n                        New conversation\n                      </button>\n                    </div>\n                  </motion.div>\n                )}\n\n                {tab === \"messages\" && thread && (\n                  <motion.div key={`thread-${thread.id}`} initial={reduce ? false : { opacity: 0, x: 10 }} animate={{ opacity: 1, x: 0 }} exit={reduce ? undefined : { opacity: 0, x: 10 }} transition={{ duration: 0.18 }} className=\"absolute inset-0 flex flex-col\">\n                    <div ref={listRef} className=\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-3\" aria-live=\"polite\">\n                      <ul className=\"m-0 flex list-none flex-col gap-2 p-0\">\n                        {thread.messages.map((m) => (\n                          <motion.li key={m.id} initial={reduce ? false : { opacity: 0, y: 6 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.18 }} className={cn(\"flex\", m.from === \"user\" ? \"justify-end\" : m.from === \"system\" ? \"justify-center\" : \"justify-start\")}>\n                            {m.from === \"system\" ? (\n                              <span className=\"rounded-full px-3 py-1 text-center text-[11.5px]\" style={{ background: p.chip, color: p.muted }}>\n                                {m.text}\n                              </span>\n                            ) : (\n                              <span className=\"max-w-[85%]\">\n                                {m.from !== \"user\" && (\n                                  <span className=\"mb-1 flex items-center gap-1 text-[11px] font-semibold\" style={{ color: m.from === \"agent\" ? p.ok : p.accent }}>\n                                    {m.from === \"agent\" ? \"Sam · Support\" : <><Sparkle size={10} color={p.accent} /> {assistantName}</>}\n                                  </span>\n                                )}\n                                <span className=\"block rounded-2xl px-3.5 py-2.5 text-[13.5px] leading-[1.45] whitespace-pre-wrap\" style={m.from === \"user\" ? { background: p.user, color: p.userText, borderBottomRightRadius: 6 } : { background: p.card, color: p.text, borderBottomLeftRadius: 6, border: `1px solid ${p.border}` }}>\n                                  {shown(m)}\n                                  {streaming?.id === m.id && <span className=\"ml-0.5 inline-block h-3.5 w-1.5 animate-pulse align-[-2px]\" style={{ background: p.accent }} aria-hidden=\"true\" />}\n                                </span>\n                                {m.time && (\n                                  <span className={cn(\"mt-1 block text-[10.5px]\", m.from === \"user\" && \"text-right\")} style={{ color: p.faint }}>\n                                    {m.time}\n                                  </span>\n                                )}\n                              </span>\n                            )}\n                          </motion.li>\n                        ))}\n                        {typing && (\n                          <li className=\"flex\">\n                            <span className=\"flex items-center gap-1 rounded-2xl border px-3.5 py-3\" style={{ background: p.card, borderColor: p.border }} aria-label={`${assistantName} is typing`}>\n                              {[0, 1, 2].map((i) => (\n                                <motion.span key={i} className=\"h-1.5 w-1.5 rounded-full\" style={{ background: p.muted }} animate={reduce ? undefined : { y: [0, -4, 0], opacity: [0.5, 1, 0.5] }} transition={{ duration: 0.9, repeat: Infinity, delay: i * 0.15 }} />\n                              ))}\n                            </span>\n                          </li>\n                        )}\n                      </ul>\n                    </div>\n                    <div className=\"shrink-0 border-t px-3 py-3\" style={{ borderColor: p.border }}>\n                      {!thread.messages.some((m) => m.from === \"agent\" || m.from === \"system\") && (\n                        <div className=\"mb-2 flex gap-1.5 overflow-x-auto [scrollbar-width:none]\">\n                          {[\"That helped, thanks\", \"Talk to a person\"].map((c) => (\n                            <button key={c} type=\"button\" onClick={() => void send(c)} disabled={typing || !!streaming} className=\"h-7 shrink-0 cursor-pointer rounded-full border px-3 text-[12px] outline-none focus-visible:ring-2 disabled:opacity-40\" style={{ background: \"transparent\", borderColor: p.border, color: p.text, [\"--tw-ring-color\" as string]: p.ring }}>\n                              {c}\n                            </button>\n                          ))}\n                        </div>\n                      )}\n                      <form\n                        className=\"flex items-end gap-2 rounded-xl border px-3 py-1.5\"\n                        style={{ background: p.card, borderColor: p.border }}\n                        onSubmit={(e) => {\n                          e.preventDefault();\n                          void send(draft);\n                        }}\n                      >\n                        <label className=\"sr-only\" htmlFor={`${uid}-msg`}>\n                          Message\n                        </label>\n                        <input id={`${uid}-msg`} value={draft} onChange={(e) => setDraft(e.target.value)} placeholder=\"Write a message…\" className=\"h-9 min-w-0 flex-1 border-0 bg-transparent text-[14px] outline-none\" style={{ color: p.text }} />\n                        <button type=\"submit\" disabled={!draft.trim() || typing || !!streaming} aria-label=\"Send\" className=\"mb-0.5 grid h-8 w-8 shrink-0 cursor-pointer place-items-center rounded-full border-0 outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-35\" style={{ background: p.on, color: p.onText, [\"--tw-ring-color\" as string]: p.ring }}>\n                          <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" className=\"shrink-0\">\n                            <path d=\"M12 19V5M5 12l7-7 7 7\" />\n                          </svg>\n                        </button>\n                      </form>\n                    </div>\n                  </motion.div>\n                )}\n\n                {tab === \"help\" && !article && (\n                  <motion.div key=\"help\" initial={reduce ? false : { opacity: 0, x: 10 }} animate={{ opacity: 1, x: 0 }} exit={reduce ? undefined : { opacity: 0, x: 10 }} transition={{ duration: 0.18 }} className=\"absolute inset-0 overflow-y-auto overscroll-contain p-4\">\n                    <label className=\"flex items-center gap-2 rounded-xl border px-3\" style={{ background: p.card, borderColor: p.border }}>\n                      <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\" className=\"shrink-0\" style={{ color: p.faint }}>\n                        <circle cx=\"11\" cy=\"11\" r=\"7\" />\n                        <path d=\"m20 20-3.5-3.5\" />\n                      </svg>\n                      <span className=\"sr-only\">Search help articles</span>\n                      <input value={q} onChange={(e) => setQ(e.target.value)} placeholder=\"Search for help\" className=\"h-10 min-w-0 flex-1 border-0 bg-transparent text-[14px] outline-none\" style={{ color: p.text }} />\n                    </label>\n                    <p className=\"m-0 mt-3 text-[12px]\" style={{ color: p.faint }} aria-live=\"polite\">\n                      {query ? `${found.length} ${found.length === 1 ? \"article\" : \"articles\"}` : `${collections.length} collections · ${articles.length} articles`}\n                    </p>\n                    {collections.map((c) => {\n                      const items = found.filter((a) => a.collection === c);\n                      if (!items.length) return null;\n                      return (\n                        <div key={c} className=\"mt-3\">\n                          <p className=\"m-0 text-[11.5px] font-semibold tracking-[0.08em] uppercase\" style={{ color: p.faint }}>\n                            {c}\n                          </p>\n                          <ul className=\"m-0 mt-1 list-none p-0\">\n                            {items.map((a) => (\n                              <li key={a.id}>\n                                <button type=\"button\" onClick={() => setArticleId(a.id)} className=\"flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg border-0 bg-transparent px-2 py-2.5 text-left text-[13.5px] outline-none hover:bg-[var(--h)] focus-visible:ring-2\" style={{ color: p.text, [\"--h\" as string]: p.hover, [\"--tw-ring-color\" as string]: p.ring }}>\n                                  {a.title}\n                                  <span aria-hidden=\"true\" style={{ color: p.faint }}>\n                                    →\n                                  </span>\n                                </button>\n                              </li>\n                            ))}\n                          </ul>\n                        </div>\n                      );\n                    })}\n                    {!found.length && (\n                      <div className=\"mt-6 text-center\">\n                        <p className=\"m-0 text-[13.5px]\">No articles match “{q}”.</p>\n                        <button type=\"button\" onClick={() => { setThreadId(null); void send(q); setQ(\"\"); }} className=\"mt-3 h-9 cursor-pointer rounded-full border-0 px-4 text-[13px] font-semibold outline-none focus-visible:ring-2\" style={{ background: p.on, color: p.onText, [\"--tw-ring-color\" as string]: p.ring }}>\n                          Ask {assistantName} instead\n                        </button>\n                      </div>\n                    )}\n                  </motion.div>\n                )}\n\n                {tab === \"help\" && article && (\n                  <motion.div key={`art-${article.id}`} initial={reduce ? false : { opacity: 0, x: 10 }} animate={{ opacity: 1, x: 0 }} exit={reduce ? undefined : { opacity: 0, x: 10 }} transition={{ duration: 0.18 }} className=\"absolute inset-0 overflow-y-auto overscroll-contain p-5\">\n                    <h3 className=\"m-0 text-[19px] leading-tight font-semibold tracking-[-0.01em]\">{article.title}</h3>\n                    <p className=\"m-0 mt-3 text-[14px] leading-[1.6]\" style={{ color: p.muted }}>\n                      {article.body}\n                    </p>\n                    <div className=\"mt-6 rounded-xl border p-3 text-center\" style={{ borderColor: p.border }}>\n                      <p className=\"m-0 text-[13px]\" aria-live=\"polite\">\n                        {votes[article.id] ? \"Thanks for letting us know.\" : \"Did this answer your question?\"}\n                      </p>\n                      <div className=\"mt-2 flex justify-center gap-2\">\n                        {([\"up\", \"down\"] as const).map((v) => (\n                          <button key={v} type=\"button\" aria-pressed={votes[article.id] === v} aria-label={v === \"up\" ? \"Yes, it helped\" : \"No, it didn't\"} onClick={() => setVotes((x) => ({ ...x, [article.id]: v }))} className=\"grid h-9 w-12 cursor-pointer place-items-center rounded-full border text-[15px] outline-none focus-visible:ring-2\" style={{ background: votes[article.id] === v ? p.accentSoft : \"transparent\", borderColor: votes[article.id] === v ? p.accent : p.border, color: p.text, [\"--tw-ring-color\" as string]: p.ring }}>\n                            <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" className=\"shrink-0\" style={{ transform: v === \"down\" ? \"rotate(180deg)\" : undefined }}>\n                              <path d=\"M7 10v11M7 10l4-8a3 3 0 0 1 3 3v4h5a2 2 0 0 1 2 2.3l-1.4 7A2 2 0 0 1 17.6 21H7\" />\n                            </svg>\n                          </button>\n                        ))}\n                      </div>\n                      {votes[article.id] === \"down\" && (\n                        <button type=\"button\" onClick={() => { setArticleId(null); setThreadId(null); void send(`I still need help with: ${article.title}`); }} className=\"mt-3 h-8 cursor-pointer rounded-full border-0 px-3.5 text-[12.5px] font-semibold outline-none focus-visible:ring-2\" style={{ background: p.on, color: p.onText, [\"--tw-ring-color\" as string]: p.ring }}>\n                          Ask {assistantName}\n                        </button>\n                      )}\n                    </div>\n                  </motion.div>\n                )}\n              </AnimatePresence>\n            </div>\n\n            {/* Tabs */}\n            <div role=\"tablist\" aria-label=\"Chat sections\" className=\"flex shrink-0 border-t\" style={{ borderColor: p.border }}>\n              {tabBtn(\n                \"home\",\n                \"Home\",\n                <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinejoin=\"round\" aria-hidden=\"true\" className=\"shrink-0\">\n                  <path d=\"M4 11 12 4l8 7v9H4z\" />\n                </svg>,\n              )}\n              {tabBtn(\n                \"messages\",\n                \"Messages\",\n                <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinejoin=\"round\" aria-hidden=\"true\" className=\"shrink-0\">\n                  <path d=\"M4 5h16v11H9l-5 4z\" />\n                </svg>,\n                unread,\n              )}\n              {tabBtn(\n                \"help\",\n                \"Help\",\n                <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" aria-hidden=\"true\" className=\"shrink-0\">\n                  <circle cx=\"12\" cy=\"12\" r=\"9\" />\n                  <path d=\"M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6v.6M12 17h.01\" />\n                </svg>,\n              )}\n            </div>\n          </motion.div>\n        )}\n      </AnimatePresence>\n\n      {/* Launcher */}\n      <motion.button\n        ref={launcherRef}\n        type=\"button\"\n        aria-expanded={open}\n        aria-controls={panelId}\n        aria-label={open ? \"Close chat\" : unread ? `Open chat, ${unread} unread` : \"Open chat\"}\n        onClick={() => (open ? setOpen(false) : openPanel())}\n        whileHover={reduce ? undefined : { scale: 1.06 }}\n        whileTap={reduce ? undefined : { scale: 0.94 }}\n        className=\"absolute right-5 bottom-5 z-40 grid h-14 w-14 cursor-pointer place-items-center rounded-full border-0 outline-none focus-visible:ring-2 focus-visible:ring-offset-2\"\n        style={{ background: \"transparent\", color: \"#F5F4F1\", boxShadow: \"0 16px 32px -12px rgba(0,0,0,0.55)\", [\"--tw-ring-color\" as string]: p.accent, [\"--tw-ring-offset-color\" as string]: p.page }}\n      >\n        <span aria-hidden=\"true\" className=\"absolute -inset-[3px] -z-20 rounded-full opacity-90\" style={{ background: GRADIENT }} />\n        <span aria-hidden=\"true\" className=\"absolute inset-0 -z-10 rounded-full\" style={{ background: \"radial-gradient(circle at 50% 40%, #16181C, #070708 75%)\" }} />\n        <AnimatePresence mode=\"wait\" initial={false}>\n          <motion.span key={open ? \"x\" : \"chat\"} initial={reduce ? false : { rotate: -90, opacity: 0, scale: 0.6 }} animate={{ rotate: 0, opacity: 1, scale: 1 }} exit={reduce ? undefined : { rotate: 90, opacity: 0, scale: 0.6 }} transition={{ duration: 0.18 }} className=\"grid place-items-center\">\n            {open ? (\n              <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" aria-hidden=\"true\" className=\"shrink-0\">\n                <path d=\"m6 6 12 12M18 6 6 18\" />\n              </svg>\n            ) : (\n              <Orb size={50} still={reduce} />\n            )}\n          </motion.span>\n        </AnimatePresence>\n        <AnimatePresence>\n          {!open && unread > 0 && (\n            <motion.span key=\"badge\" initial={reduce ? false : { scale: 0 }} animate={{ scale: 1 }} exit={reduce ? undefined : { scale: 0 }} className=\"absolute -top-1 -right-1 grid h-5 min-w-5 place-items-center rounded-full border-2 px-1 text-[11px] font-bold text-white\" style={{ background: p.accent, borderColor: p.page }} aria-hidden=\"true\">\n              {unread}\n            </motion.span>\n          )}\n        </AnimatePresence>\n      </motion.button>\n    </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}