{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"tool-call-card-clean","type":"registry:ui","title":"Tool Call Card (Clean)","description":"An agent's tool call in one line – live timer, status and summary, folds open to highlighted arguments and result with copy, retry on errors and a group that sums them up","dependencies":[],"files":[{"path":"registry/tool-call-card-clean/tool-call-card-clean.tsx","type":"registry:ui","content":"\"use client\";\n\nimport {\n  Children,\n  isValidElement,\n  useEffect,\n  useId,\n  useLayoutEffect,\n  useRef,\n  useState,\n  type ReactElement,\n  type ReactNode,\n} from \"react\";\n\n/*\n * Tool Call Card (Clean) – one tool call of an AI agent, in a single self-contained file.\n * Clean style: one white card with hairline shadows, no tile and no tray. The header row holds the\n * tool's icon, its name in mono, a short summary and the status: a blue spinner with a live timer,\n * a blue check with the duration, or a red \"Failed\". Click it open to see the arguments and the\n * result as highlighted JSON on a faint panel, each with a small white copy button; long blocks are\n * capped with a fade and \"Show all\". Errors show the message and a white Retry button.\n * ToolCallGroup folds several cards into one quiet line: \"Used 3 tools · 2.4s\".\n * The styles are injected below, so no extra files are needed.\n */\n\nexport type ToolCallStatus = \"running\" | \"success\" | \"error\";\n\nexport type ToolCallCardProps = {\n  /** Tool name as the agent calls it, shown in mono – e.g. \"search_web\" */\n  name: string;\n  /** Short human summary – e.g. \"Searched the web for 'CRM pricing 2026'\" */\n  summary?: ReactNode;\n  /** Icon in the tile on the left – defaults to a wrench */\n  icon?: ReactNode;\n  status: ToolCallStatus;\n  /** Arguments the tool was called with – objects are pretty-printed, JSON strings parsed */\n  args?: unknown;\n  /** What the tool returned – objects are pretty-printed, JSON strings parsed, other text shown as is */\n  result?: unknown;\n  /** Error message, shown when status is \"error\" */\n  error?: string;\n  /** When the call started (ms since epoch, e.g. Date.now()) – the live timer counts from here */\n  startedAt?: number;\n  /** Final duration in ms – otherwise measured while the card shows \"running\" */\n  duration?: number;\n  /** Start expanded (uncontrolled) */\n  defaultOpen?: boolean;\n  /** Expanded state (controlled) */\n  open?: boolean;\n  onOpenChange?: (open: boolean) => void;\n  /** Opens the card when the call fails and closes it again on the next run, unless someone toggled it */\n  openOnError?: boolean;\n  /** Shows a Retry button next to the error */\n  onRetry?: () => void;\n  /** Height in px after which arguments and result are capped with a fade and \"Show all\" */\n  maxCodeHeight?: number;\n  className?: string;\n};\n\nexport type ToolCallGroupProps = {\n  /** ToolCallCard elements – the group reads their name, icon, status and duration */\n  children: ReactNode;\n  /** Label once all calls are done – defaults to \"Used 3 tools\" */\n  label?: string;\n  /** Label while any call is running */\n  runningLabel?: string;\n  /** Total duration in ms – otherwise the sum of the cards' durations, or the time measured while running */\n  duration?: number;\n  defaultOpen?: boolean;\n  open?: boolean;\n  onOpenChange?: (open: boolean) => void;\n  className?: string;\n};\n\n/* ---------- Card ---------- */\n\nexport function ToolCallCard({\n  name,\n  summary,\n  icon,\n  status,\n  args,\n  result,\n  error,\n  startedAt,\n  duration,\n  defaultOpen = false,\n  open: openProp,\n  onOpenChange,\n  openOnError = true,\n  onRetry,\n  maxCodeHeight = 220,\n  className,\n}: ToolCallCardProps) {\n  const id = useId();\n  const [openState, setOpenState] = useState(defaultOpen);\n  const open = openProp ?? openState;\n  const setOpen = (next: boolean) => {\n    if (openProp === undefined) setOpenState(next);\n    onOpenChange?.(next);\n  };\n\n  // Open on failure, close again on the next run – only while nobody has toggled it by hand\n  const [prevStatus, setPrevStatus] = useState(status);\n  const [autoOpened, setAutoOpened] = useState(false);\n  if (status !== prevStatus) {\n    setPrevStatus(status);\n    if (openProp === undefined && openOnError) {\n      if (status === \"error\" && !openState) {\n        setOpenState(true);\n        setAutoOpened(true);\n      } else if (prevStatus === \"error\" && autoOpened) {\n        setOpenState(false);\n        setAutoOpened(false);\n      }\n    }\n  }\n\n  const measured = useStopwatch(status === \"running\", startedAt, false);\n  const ms = status === \"running\" ? (measured ?? 0) : (duration ?? measured);\n\n  const announce =\n    status === \"running\" ? `${name} running` : status === \"success\" ? `${name} finished` : `${name} failed${error ? `: ${error}` : \"\"}`;\n\n  return (\n    <div\n      className={[\"ui-tclc\", className].filter(Boolean).join(\" \")}\n      data-status={status}\n      data-open={open || undefined}\n    >\n      {/* React 19 hoists this into <head> once, no matter how many cards render */}\n      <style href=\"ui-tool-call-clean\" precedence=\"default\">\n        {css}\n      </style>\n      <span className=\"ui-tclc-sr\" role=\"status\" aria-live=\"polite\">\n        {announce}\n      </span>\n\n      <button\n        type=\"button\"\n        className=\"ui-tclc__head\"\n        aria-expanded={open}\n        aria-controls={`${id}-body`}\n        onClick={() => {\n          setAutoOpened(false);\n          setOpen(!open);\n        }}\n      >\n        <span className=\"ui-tclc__icon\" aria-hidden=\"true\">\n          {icon ?? <WrenchIcon />}\n        </span>\n        <span className=\"ui-tclc__main\">\n          <code className=\"ui-tclc__name\" title={name}>\n            {name}\n          </code>\n          {summary != null && (\n            <span className=\"ui-tclc__summary\" dir=\"auto\" title={typeof summary === \"string\" ? summary : undefined}>\n              {summary}\n            </span>\n          )}\n        </span>\n        <span className=\"ui-tclc__status\" key={status}>\n          {status === \"running\" && <Spinner />}\n          {status === \"success\" && (\n            <svg className=\"ui-tclc__ok\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n              <circle cx=\"8\" cy=\"8\" r=\"7\" />\n              <path d=\"M5.1 8.2 7.1 10.1 10.9 6\" pathLength={1} />\n            </svg>\n          )}\n          {status === \"error\" && <ErrorIcon />}\n          <span className=\"ui-tclc__time\">\n            {status === \"error\" ? \"Failed\" : ms != null ? formatMs(ms, status === \"running\") : null}\n          </span>\n        </span>\n        <Chevron />\n      </button>\n\n      <div className=\"ui-tclc__body\" id={`${id}-body`} inert={!open}>\n        <div className=\"ui-tclc__clip\">\n          <div className=\"ui-tclc__sections\">\n            {status === \"error\" && (\n              <div className=\"ui-tclc__error\">\n                <ErrorIcon />\n                <p className=\"ui-tclc__error-text\" dir=\"auto\">{error ?? \"The tool call failed.\"}</p>\n                {onRetry && (\n                  <button type=\"button\" className=\"ui-tclc__retry\" onClick={onRetry}>\n                    <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n                      <path d=\"M2.75 8a5.25 5.25 0 1 0 1.6-3.77\" />\n                      <path d=\"M2.5 2.5v2.75h2.75\" />\n                    </svg>\n                    Retry\n                  </button>\n                )}\n              </div>\n            )}\n            {args !== undefined && <CodeSection label=\"Arguments\" value={args} cap={maxCodeHeight} />}\n            {result !== undefined ? (\n              <CodeSection label=\"Result\" value={result} cap={maxCodeHeight} />\n            ) : status === \"running\" ? (\n              <div className=\"ui-tclc__section\">\n                <div className=\"ui-tclc__section-head\">\n                  <span className=\"ui-tclc__label\">Result</span>\n                </div>\n                <p className=\"ui-tclc__pending\">Waiting for result…</p>\n              </div>\n            ) : null}\n            {args === undefined && result === undefined && status === \"success\" && (\n              <p className=\"ui-tclc__pending\">No arguments or result.</p>\n            )}\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n\n/* ---------- Group ---------- */\n\nexport function ToolCallGroup({\n  children,\n  label,\n  runningLabel = \"Using tools…\",\n  duration,\n  defaultOpen = false,\n  open: openProp,\n  onOpenChange,\n  className,\n}: ToolCallGroupProps) {\n  const id = useId();\n  const [openState, setOpenState] = useState(defaultOpen);\n  const open = openProp ?? openState;\n\n  // Read the cards' props to summarise them in the header\n  const calls = Children.toArray(children)\n    .filter(isValidElement)\n    .map((c) => (c as ReactElement<Partial<ToolCallCardProps>>).props);\n  const running = calls.some((c) => c.status === \"running\");\n  const failed = calls.filter((c) => c.status === \"error\").length;\n\n  // Time spent with tools running, added up across stretches (e.g. a pause before a retry)\n  // Counts from the earliest running card that knows when it started, so the group never shows less than its cards\n  const since = calls.reduce<number | undefined>(\n    (min, c) => (c.status === \"running\" && c.startedAt != null && (min == null || c.startedAt < min) ? c.startedAt : min),\n    undefined,\n  );\n  const measured = useStopwatch(running, since, true);\n  const sum = calls.length && calls.every((c) => c.duration != null) ? calls.reduce((t, c) => t + (c.duration ?? 0), 0) : null;\n  const ms = running ? measured : (duration ?? sum ?? measured);\n\n  const count = `Used ${calls.length.toLocaleString(\"en-US\")} ${calls.length === 1 ? \"tool\" : \"tools\"}`;\n  const title = running ? runningLabel : (label ?? count);\n  const icons = calls.slice(-3);\n\n  return (\n    <div\n      className={[\"ui-tclc-group\", className].filter(Boolean).join(\" \")}\n      data-running={running || undefined}\n      data-open={open || undefined}\n    >\n      <style href=\"ui-tool-call-clean\" precedence=\"default\">\n        {css}\n      </style>\n      <span className=\"ui-tclc-sr\" role=\"status\" aria-live=\"polite\">\n        {running ? runningLabel : `${count}${failed ? `, ${failed} failed` : \"\"}`}\n      </span>\n\n      <button\n        type=\"button\"\n        className=\"ui-tclc-group__head\"\n        aria-expanded={open}\n        aria-controls={`${id}-list`}\n        onClick={() => {\n          if (openProp === undefined) setOpenState(!open);\n          onOpenChange?.(!open);\n        }}\n      >\n        <span className=\"ui-tclc-group__stack\" aria-hidden=\"true\">\n          {icons.map((c, i) => (\n            <span className=\"ui-tclc__icon\" key={calls.length - icons.length + i}>\n              {c.icon ?? <WrenchIcon />}\n            </span>\n          ))}\n        </span>\n        <span className=\"ui-tclc-group__title\" key={running ? \"busy\" : \"done\"}>\n          <span className={running ? \"ui-tclc-group__label ui-tclc__shine\" : \"ui-tclc-group__label\"} data-text={title}>\n            {title}\n          </span>\n          {!running && failed > 0 && <span className=\"ui-tclc-group__failed\">· {failed} failed</span>}\n          {ms != null && <span className=\"ui-tclc-group__time\">· {formatMs(ms, running)}</span>}\n        </span>\n        <Chevron />\n      </button>\n\n      <div className=\"ui-tclc__body\" id={`${id}-list`} inert={!open}>\n        <div className=\"ui-tclc__clip\">\n          <div className=\"ui-tclc-group__list\">{children}</div>\n        </div>\n      </div>\n    </div>\n  );\n}\n\n/* ---------- Pieces ---------- */\n\nconst OPEN_MAX = 640;\n\nfunction CodeSection({ label, value, cap }: { label: string; value: unknown; cap: number }) {\n  const { text, json } = toText(value);\n  const pre = useRef<HTMLPreElement>(null);\n  const [full, setFull] = useState(false);\n  const [height, setHeight] = useState(0);\n\n  // Natural height of the block – decides whether it needs the cap and how far \"Show all\" opens\n  useLayoutEffect(() => {\n    const el = pre.current;\n    const inner = el?.firstElementChild;\n    if (!el || !inner) return;\n    const measure = () => setHeight(el.scrollHeight);\n    measure();\n    const ro = new ResizeObserver(measure);\n    ro.observe(inner);\n    return () => ro.disconnect();\n  }, [text]);\n\n  const capped = height > cap + 24;\n\n  return (\n    <div className=\"ui-tclc__section\">\n      <div className=\"ui-tclc__section-head\">\n        <span className=\"ui-tclc__label\">{label}</span>\n        <CopyButton text={text} label={label.toLowerCase()} />\n      </div>\n      <pre\n        ref={pre}\n        className=\"ui-tclc__code\"\n        data-capped={(capped && !full) || undefined}\n        data-scroll={(capped && full && height > OPEN_MAX) || undefined}\n        // Open, a very long block stops at a few screens and scrolls inside – no 200,000px card\n        style={capped ? { maxHeight: full ? Math.min(height, OPEN_MAX) : cap } : undefined}\n      >\n        <code>{json ? highlight(text) : text}</code>\n      </pre>\n      {capped && (\n        <button type=\"button\" className=\"ui-tclc__more\" aria-expanded={full} onClick={() => setFull(!full)}>\n          {full ? \"Show less\" : \"Show all\"}\n        </button>\n      )}\n    </div>\n  );\n}\n\nfunction CopyButton({ text, label }: { text: string; label: string }) {\n  const [copied, setCopied] = useState(false);\n  useEffect(() => {\n    if (!copied) return;\n    const t = window.setTimeout(() => setCopied(false), 1400);\n    return () => window.clearTimeout(t);\n  }, [copied]);\n\n  return (\n    <button\n      type=\"button\"\n      className=\"ui-tclc__copy\"\n      data-copied={copied || undefined}\n      aria-label={copied ? \"Copied\" : `Copy ${label}`}\n      title={copied ? \"Copied\" : `Copy ${label}`}\n      onClick={() => copyText(text).then((ok) => ok && setCopied(true))}\n    >\n      <svg className=\"ui-tclc__copy-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n        <rect x=\"5.5\" y=\"5.5\" width=\"8.5\" height=\"8.5\" rx=\"2\" />\n        <path d=\"M10.5 3.75v-.25A1.5 1.5 0 0 0 9 2H3.5A1.5 1.5 0 0 0 2 3.5V9a1.5 1.5 0 0 0 1.5 1.5h.25\" />\n      </svg>\n      <svg className=\"ui-tclc__copy-done\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n        <path d=\"M3.5 8.4 6.6 11.3 12.5 4.9\" pathLength={1} />\n      </svg>\n    </button>\n  );\n}\n\nfunction Spinner() {\n  return (\n    <svg className=\"ui-tclc__spinner\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n      <circle cx=\"8\" cy=\"8\" r=\"6\" />\n      <path d=\"M8 2a6 6 0 0 1 6 6\" />\n    </svg>\n  );\n}\n\nfunction ErrorIcon() {\n  return (\n    <svg className=\"ui-tclc__err\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n      <circle cx=\"8\" cy=\"8\" r=\"7\" />\n      <path d=\"M8 4.9v3.5M8 10.9v.1\" />\n    </svg>\n  );\n}\n\nfunction Chevron() {\n  return (\n    <svg className=\"ui-tclc__chevron\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n      <path d=\"M3.5 5.25 6 7.75l2.5-2.5\" />\n    </svg>\n  );\n}\n\nfunction WrenchIcon() {\n  return (\n    <svg viewBox=\"0 0 16 16\">\n      <path d=\"M10.2 2.4a3.5 3.5 0 0 0-4.3 4.6L2.6 10.3a1.4 1.4 0 0 0 2 2L7.9 9a3.5 3.5 0 0 0 4.6-4.3l-2 2-1.6-.4-.4-1.6 1.7-2.3Z\" />\n    </svg>\n  );\n}\n\n/* ---------- Helpers ---------- */\n\n/** Live ms while running, the final value after. accumulate = add up several running stretches. */\nfunction useStopwatch(running: boolean, startedAt: number | undefined, accumulate: boolean) {\n  const start = useRef<number | null>(null);\n  const base = useRef(0);\n  const [ms, setMs] = useState<number | null>(null);\n  useEffect(() => {\n    if (!running) {\n      if (start.current !== null) {\n        base.current += Date.now() - start.current;\n        start.current = null;\n        setMs(base.current);\n      }\n      return;\n    }\n    if (!accumulate) base.current = 0;\n    start.current = startedAt ?? Date.now();\n    const tick = () => setMs(base.current + Date.now() - (start.current ?? Date.now()));\n    tick();\n    const t = window.setInterval(tick, 100);\n    return () => window.clearInterval(t);\n  }, [running, startedAt, accumulate]);\n  return ms;\n}\n\n/** 0.4s, 12.3s, 2m 05s, 3h 12m, 2d 4h – the live timer always shows tenths below a minute */\nfunction formatMs(ms: number, live: boolean) {\n  if (!live && ms < 1000) return `${Math.max(1, Math.round(ms))}ms`;\n  if (ms < 60_000) return `${(Math.floor(ms / 100) / 10).toFixed(1)}s`;\n  const s = Math.floor(ms / 1000);\n  if (s < 3600) return `${Math.floor(s / 60)}m ${String(s % 60).padStart(2, \"0\")}s`;\n  const h = Math.floor(s / 3600);\n  if (h < 24) return `${h}h ${String(Math.floor(s / 60) % 60).padStart(2, \"0\")}m`;\n  return `${Math.floor(h / 24)}d ${h % 24}h`;\n}\n\nfunction toText(value: unknown): { text: string; json: boolean } {\n  if (typeof value === \"string\") {\n    const t = value.trim();\n    if (t.startsWith(\"{\") || t.startsWith(\"[\")) {\n      try {\n        return { text: JSON.stringify(JSON.parse(t), null, 2), json: true };\n      } catch {\n        /* not JSON – shown as plain text */\n      }\n    }\n    return { text: value, json: false };\n  }\n  try {\n    const s = JSON.stringify(value, null, 2);\n    return s === undefined ? { text: String(value), json: false } : { text: s, json: true };\n  } catch {\n    return { text: String(value), json: false };\n  }\n}\n\n// Strings (keys when followed by a colon), literals and numbers – everything else stays punctuation\nconst TOKEN = /(\"(?:[^\"\\\\]|\\\\.)*\")(\\s*:)?|\\b(?:true|false|null)\\b|-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?/g;\n\nfunction highlight(text: string): ReactNode[] {\n  const out: ReactNode[] = [];\n  const re = new RegExp(TOKEN.source, \"g\");\n  let last = 0;\n  let m: RegExpExecArray | null;\n  while ((m = re.exec(text))) {\n    if (m.index > last) out.push(text.slice(last, m.index));\n    if (m[1] && m[2]) {\n      out.push(\n        <span key={m.index} className=\"ui-tclc__t-key\">\n          {m[1]}\n        </span>,\n        m[2],\n      );\n    } else {\n      const kind = m[1] ? \"str\" : /^[tfn]/.test(m[0]) ? \"lit\" : \"num\";\n      out.push(\n        <span key={m.index} className={`ui-tclc__t-${kind}`}>\n          {m[0]}\n        </span>,\n      );\n    }\n    last = m.index + m[0].length;\n  }\n  if (last < text.length) out.push(text.slice(last));\n  return out;\n}\n\nasync function copyText(text: string) {\n  try {\n    await navigator.clipboard.writeText(text);\n    return true;\n  } catch {\n    // Older browsers and non-secure contexts\n    const area = document.createElement(\"textarea\");\n    area.value = text;\n    area.style.cssText = \"position:fixed;opacity:0\";\n    document.body.appendChild(area);\n    area.select();\n    const ok = document.execCommand(\"copy\");\n    area.remove();\n    return ok;\n  }\n}\n\nconst css = /* css */ `\n/* Colors and motion as variables – override them on .ui-tclc / .ui-tclc-group */\n.ui-tclc,\n.ui-tclc-group {\n  --ui-tclc-card: #ffffff;\n  --ui-tclc-strong: var(--aui-ink, #000000);\n  --ui-tclc-ink: var(--aui-ink, rgba(0, 0, 0, 0.88));\n  --ui-tclc-text: var(--aui-muted, rgba(0, 0, 0, 0.61));\n  --ui-tclc-muted: var(--aui-muted, rgba(0, 0, 0, 0.45));\n  --ui-tclc-faint: var(--aui-placeholder, rgba(0, 0, 0, 0.27));\n  --ui-tclc-icon: var(--aui-muted, rgba(0, 0, 0, 0.447));\n  --ui-tclc-line: var(--aui-border, rgba(0, 0, 0, 0.06));\n  --ui-tclc-wash: var(--aui-subtle, rgba(0, 0, 0, 0.03));\n  --ui-tclc-wash-big: var(--aui-subtle, rgba(0, 0, 0, 0.015));\n  /* The code panel: a 2% black frame, kept opaque so the fade of capped blocks can end on it */\n  --ui-tclc-code: #fafafa;\n  --ui-tclc-accent: rgba(0, 96, 226, 0.765);\n  --ui-tclc-red: var(--aui-red, #f04438);\n  --ui-tclc-red-bg: color-mix(in srgb, var(--aui-red, #f04438) 4%, transparent);\n  --ui-tclc-red-line: color-mix(in srgb, var(--aui-red, #f04438) 14%, transparent);\n  --ui-tclc-key: rgba(0, 0, 0, 0.88);\n  --ui-tclc-str: color-mix(in srgb, var(--aui-cyan, #14b3f0) 90%, transparent);\n  --ui-tclc-num: var(--aui-warning, #b25e00);\n  --ui-tclc-lit: var(--aui-purple, #a651f0);\n  --ui-tclc-shine: rgba(255, 255, 255, 0.82);\n  /* Strokes are shadows: a 0.5px hairline plus a soft lift */\n  --ui-tclc-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 1px 1px -1px rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n  --ui-tclc-focus: var(--aui-focus, rgba(0, 96, 226, 0.7));\n  --ui-tclc-ease: var(--aui-ease, cubic-bezier(0.22, 1, 0.36, 1));\n  --ui-tclc-mono: var(--aui-font-mono, ui-monospace, \"SF Mono\", Menlo, monospace);\n  box-sizing: border-box;\n  container-type: inline-size;\n  min-width: 0;\n  color: var(--ui-tclc-ink);\n  font-family: var(--aui-font, \"Inter\", \"InterVariable\", ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif);\n  font-size: 13px;\n  line-height: 20px;\n  font-weight: 400;\n  -webkit-font-smoothing: antialiased;\n}\n.ui-tclc *,\n.ui-tclc-group * { box-sizing: border-box; }\n\n.ui-tclc {\n  position: relative;\n  border-radius: var(--aui-radius-lg, 10px);\n  background: var(--aui-surface, var(--ui-tclc-card));\n  box-shadow: var(--aui-shadow-card, var(--ui-tclc-shadow));\n}\n.ui-tclc-sr {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  overflow: hidden;\n  clip-path: inset(50%);\n  white-space: nowrap;\n}\n\n/* Header row: icon, name + summary, status, chevron – everything truncates before it overflows */\n.ui-tclc__head {\n  all: unset;\n  box-sizing: border-box;\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  width: 100%;\n  min-height: 44px;\n  padding: 0 14px;\n  border-radius: var(--aui-radius-lg, 10px);\n  cursor: pointer;\n  transition: background-color 160ms ease, border-radius 0ms linear 380ms;\n}\n.ui-tclc[data-open] .ui-tclc__head {\n  border-radius: var(--aui-radius-lg, 10px) var(--aui-radius-lg, 10px) 0 0;\n  transition: background-color 160ms ease;\n}\n.ui-tclc__head:focus-visible,\n.ui-tclc-group__head:focus-visible,\n.ui-tclc__copy:focus-visible,\n.ui-tclc__more:focus-visible,\n.ui-tclc__retry:focus-visible {\n  outline: 2px solid var(--ui-tclc-focus);\n  outline-offset: 2px;\n}\n@media (hover: hover) {\n  .ui-tclc__head:hover { background: var(--ui-tclc-wash-big); }\n  .ui-tclc__head:hover .ui-tclc__chevron { stroke: var(--ui-tclc-ink); }\n  .ui-tclc-group__head:hover { background: var(--ui-tclc-wash); color: var(--ui-tclc-ink); }\n  .ui-tclc__copy:hover { background: var(--ui-tclc-wash-big); color: var(--ui-tclc-ink); }\n  .ui-tclc__more:hover { color: var(--ui-tclc-ink); }\n  .ui-tclc__retry:hover { background: var(--ui-tclc-wash-big); }\n}\n\n/* The tool's icon: a plain 16px glyph, no tile */\n.ui-tclc__icon {\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 16px;\n  height: 16px;\n  color: var(--ui-tclc-icon);\n}\n.ui-tclc__icon > svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }\n\n.ui-tclc__main {\n  display: flex;\n  align-items: baseline;\n  gap: 8px;\n  flex: 1;\n  min-width: 0;\n}\n.ui-tclc__name {\n  flex: 0 1 auto;\n  max-width: 55%;\n  overflow: hidden;\n  color: var(--ui-tclc-strong);\n  font-family: var(--ui-tclc-mono);\n  font-size: 12px;\n  font-weight: 500;\n  letter-spacing: 0;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n.ui-tclc__summary {\n  flex: 1 1 0;\n  min-width: 0;\n  overflow: hidden;\n  color: var(--ui-tclc-text);\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n\n.ui-tclc__status {\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  flex: none;\n  color: var(--ui-tclc-muted);\n  font-size: 12px;\n  line-height: 16px;\n  font-variant-numeric: tabular-nums;\n  white-space: nowrap;\n  animation: ui-tclc-in 360ms var(--ui-tclc-ease) both;\n}\n.ui-tclc[data-status=\"error\"] .ui-tclc__status { color: var(--ui-tclc-red); font-weight: 500; }\n.ui-tclc__status > svg { width: 14px; height: 14px; flex: none; fill: none; stroke-linecap: round; stroke-linejoin: round; }\n.ui-tclc__spinner circle { stroke: var(--ui-tclc-line); stroke-width: 1.6; }\n.ui-tclc__spinner path { stroke: var(--ui-tclc-accent); stroke-width: 1.6; }\n.ui-tclc__spinner { animation: ui-tclc-spin 800ms linear infinite; }\n/* Done: a solid blue dot whose white check draws itself */\n.ui-tclc__ok { animation: ui-tclc-pop 460ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }\n.ui-tclc__ok circle { fill: var(--ui-tclc-accent); }\n.ui-tclc__ok path { stroke: #fff; stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; animation: ui-tclc-draw 360ms var(--ui-tclc-ease) 160ms forwards; }\n.ui-tclc__err circle { fill: var(--ui-tclc-red); }\n.ui-tclc__err path { stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }\n\n.ui-tclc__chevron {\n  flex: none;\n  width: 12px;\n  height: 12px;\n  fill: none;\n  stroke: var(--ui-tclc-icon);\n  stroke-width: 1.2;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n  transition: transform 360ms var(--ui-tclc-ease), stroke 160ms ease;\n}\n.ui-tclc[data-open] > .ui-tclc__head .ui-tclc__chevron,\n.ui-tclc-group[data-open] > .ui-tclc-group__head .ui-tclc__chevron { transform: rotate(180deg); }\n\n/* Body: grows from 0fr to 1fr, so the height animates without measuring */\n.ui-tclc__body {\n  display: grid;\n  grid-template-rows: 0fr;\n  opacity: 0;\n  transition: grid-template-rows 380ms var(--ui-tclc-ease), opacity 240ms ease;\n}\n.ui-tclc[data-open] > .ui-tclc__body,\n.ui-tclc-group[data-open] > .ui-tclc__body {\n  grid-template-rows: 1fr;\n  opacity: 1;\n}\n.ui-tclc__clip { min-height: 0; overflow: hidden; }\n.ui-tclc__sections {\n  display: grid;\n  gap: 14px;\n  padding: 12px 14px 14px;\n  border-top: 0.5px solid var(--ui-tclc-line);\n}\n\n.ui-tclc__section { display: grid; gap: 6px; min-width: 0; }\n.ui-tclc__section-head {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 8px;\n  min-height: 28px;\n}\n/* Tiny uppercase labels: \"ARGUMENTS\", \"RESULT\" */\n.ui-tclc__label {\n  color: var(--ui-tclc-muted);\n  font-size: 10px;\n  line-height: 16px;\n  font-weight: 500;\n  letter-spacing: 0.5px;\n  text-transform: uppercase;\n}\n.ui-tclc__pending { margin: 0; color: var(--ui-tclc-muted); font-size: 12px; line-height: 16px; }\n\n/* Copy: a small white icon button with the card's hairline */\n.ui-tclc__copy {\n  all: unset;\n  position: relative;\n  display: grid;\n  place-items: center;\n  width: 28px;\n  height: 28px;\n  border-radius: calc(var(--aui-radius-sm, 5px) + 1px);\n  background: var(--aui-surface, var(--ui-tclc-card));\n  box-shadow: var(--ui-tclc-shadow);\n  color: var(--ui-tclc-icon);\n  cursor: pointer;\n  transition: background-color 160ms ease, color 160ms ease;\n}\n.ui-tclc__copy svg {\n  position: absolute;\n  width: 16px;\n  height: 16px;\n  fill: none;\n  stroke: currentColor;\n  stroke-width: 1.4;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n  transition: opacity 200ms ease, transform 320ms var(--ui-tclc-ease), filter 200ms ease;\n}\n.ui-tclc__copy-icon rect { fill: currentColor; stroke: none; }\n.ui-tclc__copy-done { opacity: 0; transform: scale(0.6); filter: blur(2px); stroke-width: 1.7; }\n.ui-tclc__copy[data-copied] { color: var(--ui-tclc-accent); }\n.ui-tclc__copy[data-copied] .ui-tclc__copy-icon { opacity: 0; transform: scale(0.6); filter: blur(2px); }\n.ui-tclc__copy[data-copied] .ui-tclc__copy-done { opacity: 1; transform: none; filter: none; }\n\n/* Code: a faint panel with a 0.5px frame; wraps instead of scrolling sideways, capped blocks fade out */\n.ui-tclc__code {\n  position: relative;\n  margin: 0;\n  padding: 10px 12px;\n  overflow: hidden;\n  border-radius: calc(var(--aui-radius-sm, 5px) + 3px);\n  background: var(--ui-tclc-code);\n  box-shadow: inset 0 0 0 0.5px var(--ui-tclc-line);\n  color: var(--ui-tclc-muted);\n  font-family: var(--ui-tclc-mono);\n  font-size: 12px;\n  line-height: 20px;\n  white-space: pre-wrap;\n  overflow-wrap: anywhere;\n  tab-size: 2;\n  transition: max-height 420ms var(--ui-tclc-ease);\n}\n.ui-tclc__code code { display: block; font: inherit; }\n.ui-tclc__code::after {\n  content: \"\";\n  position: absolute;\n  left: 0.5px;\n  right: 0.5px;\n  bottom: 0.5px;\n  height: 56px;\n  border-radius: 0 0 calc(var(--aui-radius-sm, 5px) + 2.5px) calc(var(--aui-radius-sm, 5px) + 2.5px);\n  background: linear-gradient(to bottom, transparent, var(--ui-tclc-code));\n  opacity: 0;\n  transition: opacity 240ms ease;\n  pointer-events: none;\n}\n.ui-tclc__code[data-capped]::after { opacity: 1; }\n.ui-tclc__code[data-scroll] { overflow-y: auto; overscroll-behavior: contain; }\n.ui-tclc__t-key { color: var(--ui-tclc-key); }\n.ui-tclc__t-str { color: var(--ui-tclc-str); }\n.ui-tclc__t-num { color: var(--ui-tclc-num); }\n.ui-tclc__t-lit { color: var(--ui-tclc-lit); }\n\n.ui-tclc__more {\n  all: unset;\n  justify-self: start;\n  padding: 2px 4px;\n  margin-left: -4px;\n  border-radius: 6px;\n  color: var(--ui-tclc-text);\n  font-size: 12px;\n  line-height: 16px;\n  font-weight: 500;\n  cursor: pointer;\n  transition: color 160ms ease;\n}\n\n/* Error: the message on a faint red panel and an optional white Retry button */\n.ui-tclc__error {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  min-height: 44px;\n  padding: 8px 8px 8px 12px;\n  border-radius: calc(var(--aui-radius-sm, 5px) + 3px);\n  background: var(--ui-tclc-red-bg);\n  box-shadow: inset 0 0 0 0.5px var(--ui-tclc-red-line);\n}\n.ui-tclc__error > .ui-tclc__err { flex: none; align-self: flex-start; width: 16px; height: 16px; margin-top: 6px; }\n.ui-tclc__error-text {\n  flex: 1;\n  min-width: 0;\n  /* A stack trace stops at 10 lines and scrolls, so Retry and the arguments stay close */\n  max-height: 200px;\n  margin: 0;\n  overflow-y: auto;\n  overscroll-behavior: contain;\n  white-space: pre-line;\n  color: var(--ui-tclc-red);\n  font-size: 13px;\n  line-height: 20px;\n  overflow-wrap: anywhere;\n}\n.ui-tclc__retry {\n  all: unset;\n  box-sizing: border-box;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  flex: none;\n  height: 28px;\n  padding: 0 10px 0 6px;\n  border-radius: calc(var(--aui-radius-sm, 5px) + 1px);\n  background: var(--aui-surface, var(--ui-tclc-card));\n  box-shadow: var(--ui-tclc-shadow);\n  color: var(--ui-tclc-strong);\n  font-size: 13px;\n  line-height: 20px;\n  font-weight: 500;\n  cursor: pointer;\n  transition: background-color 160ms ease;\n}\n.ui-tclc__retry svg { width: 16px; height: 16px; fill: none; stroke: var(--ui-tclc-icon); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }\n.ui-tclc__retry:active svg { transform: rotate(-60deg); transition: transform 200ms var(--ui-tclc-ease); }\n\n/* Group: one quiet line with the tool icons stacked on small white tiles, the cards below */\n.ui-tclc-group { display: grid; }\n.ui-tclc-group__head {\n  all: unset;\n  box-sizing: border-box;\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  justify-self: start;\n  max-width: 100%;\n  min-height: 32px;\n  margin-left: -6px;\n  padding: 4px 10px 4px 6px;\n  border-radius: calc(var(--aui-radius, 7px) + 1px);\n  color: var(--ui-tclc-ink);\n  cursor: pointer;\n  transition: background-color 160ms ease, color 160ms ease;\n}\n.ui-tclc-group__stack { display: flex; flex: none; padding: 0.5px; }\n.ui-tclc-group__stack .ui-tclc__icon {\n  width: 22px;\n  height: 22px;\n  border-radius: 6px;\n  background: var(--ui-tclc-card);\n  box-shadow: var(--ui-tclc-shadow);\n  animation: ui-tclc-pop 420ms var(--ui-tclc-ease) both;\n}\n.ui-tclc-group__stack .ui-tclc__icon + .ui-tclc__icon { margin-left: -4px; }\n.ui-tclc-group__stack .ui-tclc__icon > svg { width: 12px; height: 12px; stroke-width: 1.5; }\n.ui-tclc-group__title {\n  display: flex;\n  align-items: baseline;\n  gap: 6px;\n  min-width: 0;\n  white-space: nowrap;\n  animation: ui-tclc-in 360ms var(--ui-tclc-ease) both;\n}\n.ui-tclc-group__label {\n  position: relative;\n  min-width: 0;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  color: inherit;\n  font-weight: 500;\n}\n.ui-tclc-group__label.ui-tclc__shine { color: var(--ui-tclc-muted); }\n.ui-tclc-group__failed { flex: none; color: var(--ui-tclc-red); }\n.ui-tclc-group__time { flex: none; color: var(--ui-tclc-faint); font-variant-numeric: tabular-nums; }\n.ui-tclc-group__list { display: grid; gap: 8px; padding: 6px 0 2px; }\n\n/* A soft light sweeping over \"Using tools…\" */\n.ui-tclc__shine::after {\n  content: attr(data-text);\n  content: attr(data-text) / \"\";\n  position: absolute;\n  inset: 0;\n  white-space: nowrap;\n  color: transparent;\n  background: linear-gradient(90deg, transparent 38%, var(--ui-tclc-shine) 50%, transparent 62%) 100% 0 / 300% 100% no-repeat;\n  -webkit-background-clip: text;\n  background-clip: text;\n  animation: ui-tclc-sweep 1.8s linear infinite;\n  pointer-events: none;\n}\n\n@keyframes ui-tclc-in {\n  from { opacity: 0; transform: translateY(3px); filter: blur(2px); }\n  to { opacity: 1; transform: none; filter: none; }\n}\n@keyframes ui-tclc-pop {\n  from { opacity: 0; transform: scale(0.6); }\n  to { opacity: 1; transform: none; }\n}\n@keyframes ui-tclc-spin { to { transform: rotate(360deg); } }\n@keyframes ui-tclc-draw { to { stroke-dashoffset: 0; } }\n@keyframes ui-tclc-sweep {\n  from { background-position: 100% 0; }\n  to { background-position: 0% 0; }\n}\n\n/* Narrow (phones): a little less padding, the summary gives way first */\n@container (max-width: 360px) {\n  .ui-tclc__head { gap: 8px; padding: 0 12px; }\n  .ui-tclc__sections { padding: 12px 12px 12px; }\n}\n/* Touch screens: bigger tap targets */\n@media (pointer: coarse) {\n  .ui-tclc__head { min-height: 52px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .ui-tclc *,\n  .ui-tclc-group *,\n  .ui-tclc *::after,\n  .ui-tclc-group *::after {\n    animation-duration: 1ms !important;\n    animation-delay: 0ms !important;\n    animation-iteration-count: 1 !important;\n    transition-duration: 1ms !important;\n  }\n  .ui-tclc__shine::after { display: none; }\n  .ui-tclc__ok path { stroke-dashoffset: 0; }\n}\n\n/* Dark mode: follows a .dark class or data-theme=\"dark\" on any ancestor, e.g. <html> */\n:where(.dark, [data-theme=\"dark\"]) .ui-tclc,\n:where(.dark, [data-theme=\"dark\"]) .ui-tclc-group {\n  --ui-tclc-card: #1c1c1e;\n  --ui-tclc-strong: var(--aui-ink, #ffffff);\n  --ui-tclc-ink: var(--aui-ink, rgba(255, 255, 255, 0.9));\n  --ui-tclc-text: var(--aui-muted, rgba(255, 255, 255, 0.62));\n  --ui-tclc-muted: var(--aui-muted, rgba(255, 255, 255, 0.46));\n  --ui-tclc-faint: var(--aui-placeholder, rgba(255, 255, 255, 0.3));\n  --ui-tclc-icon: var(--aui-muted, rgba(255, 255, 255, 0.5));\n  --ui-tclc-line: var(--aui-border, rgba(255, 255, 255, 0.08));\n  --ui-tclc-wash: var(--aui-subtle, rgba(255, 255, 255, 0.04));\n  --ui-tclc-wash-big: var(--aui-subtle, rgba(255, 255, 255, 0.025));\n  --ui-tclc-code: #212123;\n  --ui-tclc-accent: var(--aui-blue, #4fb0fe);\n  --ui-tclc-red: var(--aui-danger, #ff8a7a);\n  --ui-tclc-red-bg: color-mix(in srgb, var(--aui-red, #ff6b5f) 7%, transparent);\n  --ui-tclc-red-line: color-mix(in srgb, var(--aui-red, #ff6b5f) 18%, transparent);\n  --ui-tclc-key: rgba(255, 255, 255, 0.9);\n  --ui-tclc-str: var(--aui-cyan, #5cc6ee);\n  --ui-tclc-num: var(--aui-orange, #f2a15c);\n  --ui-tclc-lit: #cfaff5;\n  --ui-tclc-shine: #ffffff;\n  --ui-tclc-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.4);\n  --ui-tclc-focus: var(--aui-focus, rgba(77, 141, 255, 0.8));\n}\n`;\n"}]}