{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chat",
  "title": "Chat",
  "author": "superzero11 <https://github.com/superzero11/uiset>",
  "description": "A conversation built on UI SDK: thread that follows new messages, messages with avatars, actions and versions, suggestions, plans and a thinking shimmer.",
  "dependencies": [
    "@ui-sdk/core@0.1.0-beta.5",
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://uiset.dev/r/uiset.json",
    "https://uiset.dev/r/button.json"
  ],
  "files": [
    {
      "path": "registry/uiset/ui/chat.tsx",
      "content": "\"use client\"\n\nimport { announce, createStickToBottom } from \"@ui-sdk/core\"\nimport { Avatar, AvatarFallback, AvatarImage } from \"@ui-sdk/react/avatar\"\nimport {\n  Collapsible,\n  CollapsiblePanel,\n  CollapsibleTrigger,\n} from \"@ui-sdk/react/collapsible\"\nimport { Toggle, ToggleGroup } from \"@ui-sdk/react/toggle\"\nimport { Toolbar, ToolbarButton } from \"@ui-sdk/react/toolbar\"\nimport { useEffect, useMemo, useRef, useSyncExternalStore, type ReactNode } from \"react\"\nimport { Button } from \"./button\"\nimport \"./chat/chat.css\"\n\ntype Role = \"user\" | \"assistant\" | \"system\"\n\nfunction Icon({ path }: { path: string }) {\n  return (\n    <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\" className=\"chat-icon\">\n      <path d={path} />\n    </svg>\n  )\n}\n\nconst icons = {\n  copy: \"M8 8h11v11H8zM5 16V5h11\",\n  check: \"M5 12.5l4.5 4.5L19 7.5\",\n  retry: \"M4 12a8 8 0 1 0 2.4-5.7M4 4v4.5h4.5\",\n  edit: \"M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4\",\n  up: \"M7 11v9H4v-9zM7 11l4-8a2.5 2.5 0 0 1 2.5 2.5V9h5.2a2 2 0 0 1 2 2.3l-1.2 7A2 2 0 0 1 17.5 20H7\",\n  down: \"M7 13V4H4v9zM7 13l4 8a2.5 2.5 0 0 0 2.5-2.5V15h5.2a2 2 0 0 0 2-2.3l-1.2-7A2 2 0 0 0 17.5 4H7\",\n  left: \"M15 5l-7 7 7 7\",\n  right: \"M9 5l7 7-7 7\",\n}\n\nfunction ChatThread({\n  label = \"Conversation\",\n  children,\n}: {\n  label?: string\n  children: ReactNode\n}) {\n  const scroller = useRef<HTMLDivElement>(null)\n  const stick = useMemo(() => createStickToBottom({ threshold: 32 }), [])\n  const state = useSyncExternalStore(\n    (listener) => stick.subscribe(listener),\n    () => stick.get(),\n    () => stick.get(),\n  )\n\n  useEffect(() => {\n    if (!scroller.current) return\n    return stick.connect(scroller.current)\n  }, [stick])\n\n  return (\n    <div className=\"chat-thread\">\n      <div\n        ref={scroller}\n        className=\"chat-thread-scroller\"\n        role=\"region\"\n        aria-label={label}\n        tabIndex={0}\n      >\n        <div role=\"log\" className=\"chat-thread-log\">\n          {children}\n        </div>\n      </div>\n      {state.unseen && !state.following && (\n        <Button\n          variant=\"outline\"\n          className=\"chat-thread-jump\"\n          onClick={() => stick.scrollToBottom({ behavior: \"smooth\" })}\n        >\n          Jump to latest\n        </Button>\n      )}\n    </div>\n  )\n}\n\nfunction ChatEmpty({ title, children }: { title: string; children?: ReactNode }) {\n  return (\n    <div className=\"chat-empty\">\n      <p className=\"chat-empty-title\">{title}</p>\n      {children}\n    </div>\n  )\n}\n\nfunction ChatMessage({\n  from,\n  name,\n  avatar,\n  time,\n  streaming = false,\n  actions,\n  children,\n}: {\n  from: Role\n  name?: string\n  avatar?: { src?: string; fallback: string }\n  time?: Date\n  streaming?: boolean\n  actions?: ReactNode\n  children: ReactNode\n}) {\n  const who =\n    name ?? (from === \"user\" ? \"You\" : from === \"assistant\" ? \"Assistant\" : \"System\")\n  return (\n    <div\n      className=\"chat-message\"\n      data-from={from}\n      data-streaming={streaming ? \"\" : undefined}\n      aria-busy={streaming || undefined}\n    >\n      {avatar && (\n        <Avatar className=\"chat-message-avatar\" role=\"img\" aria-label={who}>\n          {avatar.src && <AvatarImage src={avatar.src} alt=\"\" />}\n          <AvatarFallback>{avatar.fallback}</AvatarFallback>\n        </Avatar>\n      )}\n      <div className=\"chat-message-body\">\n        <div className=\"chat-message-meta\">\n          <span className=\"chat-message-name\">{who}</span>\n          {time && (\n            <time dateTime={time.toISOString()}>\n              {new Intl.DateTimeFormat(undefined, { timeStyle: \"short\" }).format(time)}\n            </time>\n          )}\n        </div>\n        <div className=\"chat-message-content\">{children}</div>\n        {actions}\n      </div>\n    </div>\n  )\n}\n\ntype Feedback = \"good\" | \"bad\" | null\n\nfunction ChatMessageActions({\n  text,\n  onRetry,\n  onEdit,\n  feedback,\n  onFeedbackChange,\n  label = \"Message actions\",\n}: {\n  text?: string\n  onRetry?: () => void\n  onEdit?: () => void\n  feedback?: Feedback\n  onFeedbackChange?: (feedback: Feedback) => void\n  label?: string\n}) {\n  const copy = async () => {\n    if (!text) return\n    await navigator.clipboard.writeText(text)\n    announce(\"Copied\")\n  }\n  return (\n    <Toolbar aria-label={label} className=\"chat-actions\">\n      {text !== undefined && (\n        <ToolbarButton aria-label=\"Copy message\" onClick={copy}>\n          <Icon path={icons.copy} />\n        </ToolbarButton>\n      )}\n      {onRetry && (\n        <ToolbarButton aria-label=\"Retry message\" onClick={onRetry}>\n          <Icon path={icons.retry} />\n        </ToolbarButton>\n      )}\n      {onEdit && (\n        <ToolbarButton aria-label=\"Edit message\" onClick={onEdit}>\n          <Icon path={icons.edit} />\n        </ToolbarButton>\n      )}\n      {onFeedbackChange && (\n        <ToggleGroup\n          aria-label=\"Feedback on this response\"\n          value={feedback ? [feedback] : []}\n          onValueChange={(value) => onFeedbackChange((value[0] as Feedback) ?? null)}\n        >\n          <Toggle value=\"good\" aria-label=\"Good response\">\n            <Icon path={icons.up} />\n          </Toggle>\n          <Toggle value=\"bad\" aria-label=\"Bad response\">\n            <Icon path={icons.down} />\n          </Toggle>\n        </ToggleGroup>\n      )}\n    </Toolbar>\n  )\n}\n\nfunction ChatBranch({\n  index,\n  count,\n  onIndexChange,\n}: {\n  index: number\n  count: number\n  onIndexChange: (index: number) => void\n}) {\n  if (count < 2) return null\n  return (\n    <div className=\"chat-branch\" role=\"group\" aria-label=\"Versions\">\n      <Button\n        variant=\"ghost\"\n        aria-label=\"Previous version\"\n        disabled={index === 0}\n        onClick={() => onIndexChange(index - 1)}\n      >\n        <Icon path={icons.left} />\n      </Button>\n      <span aria-live=\"polite\">\n        {index + 1} of {count}\n      </span>\n      <Button\n        variant=\"ghost\"\n        aria-label=\"Next version\"\n        disabled={index === count - 1}\n        onClick={() => onIndexChange(index + 1)}\n      >\n        <Icon path={icons.right} />\n      </Button>\n    </div>\n  )\n}\n\nfunction ChatSuggestions({\n  suggestions,\n  onSelect,\n  label = \"Suggestions\",\n}: {\n  suggestions: string[]\n  onSelect: (suggestion: string) => void\n  label?: string\n}) {\n  return (\n    <Toolbar aria-label={label} className=\"chat-suggestions\">\n      {suggestions.map((suggestion) => (\n        <ToolbarButton key={suggestion} onClick={() => onSelect(suggestion)}>\n          {suggestion}\n        </ToolbarButton>\n      ))}\n    </Toolbar>\n  )\n}\n\nfunction ChatShimmer({ children = \"Thinking…\" }: { children?: ReactNode }) {\n  return <span className=\"chat-shimmer\">{children}</span>\n}\n\ntype TaskStatus = \"pending\" | \"running\" | \"done\" | \"failed\"\ntype Task = { id: string; title: string; status: TaskStatus; detail?: string }\n\nconst taskWords: Record<TaskStatus, string> = {\n  pending: \"To do\",\n  running: \"In progress\",\n  done: \"Done\",\n  failed: \"Failed\",\n}\n\nfunction ChatTasks({\n  title = \"Plan\",\n  tasks,\n  defaultOpen = true,\n}: {\n  title?: string\n  tasks: Task[]\n  defaultOpen?: boolean\n}) {\n  const done = tasks.filter((task) => task.status === \"done\").length\n  return (\n    <Collapsible className=\"chat-tasks\" defaultOpen={defaultOpen}>\n      <CollapsibleTrigger className=\"chat-disclosure\">\n        <span>{title}</span>\n        <span className=\"chat-visually-hidden\">, </span>\n        <span className=\"chat-disclosure-meta\">\n          {done} of {tasks.length} done\n        </span>\n      </CollapsibleTrigger>\n      <CollapsiblePanel>\n        <ol className=\"chat-task-list\">\n          {tasks.map((task) => (\n            <li key={task.id} data-status={task.status}>\n              <span className=\"chat-task-mark\" aria-hidden=\"true\" />\n              <span className=\"chat-task-title\">{task.title}</span>\n              <span className=\"chat-task-status\">{taskWords[task.status]}</span>\n              {task.detail && <span className=\"chat-task-detail\">{task.detail}</span>}\n            </li>\n          ))}\n        </ol>\n      </CollapsiblePanel>\n    </Collapsible>\n  )\n}\n\nexport {\n  ChatBranch,\n  ChatEmpty,\n  ChatMessage,\n  ChatMessageActions,\n  ChatShimmer,\n  ChatSuggestions,\n  ChatTasks,\n  ChatThread,\n  Icon as ChatIcon,\n  icons as chatIcons,\n}\nexport type {\n  Feedback as ChatFeedback,\n  Role as ChatRole,\n  Task as ChatTask,\n  TaskStatus as ChatTaskStatus,\n}\n",
      "type": "registry:ui",
      "target": "@ui/chat.tsx"
    },
    {
      "path": "registry/uiset/ui/chat/chat.css",
      "content": "@layer ui-sdk, uiset.tokens, uiset.base, uiset.skin;\n\n@layer uiset.base {\n  :where([data-uiset]) {\n    --chat-bubble: var(--ui-primary);\n    --chat-bubble-text: var(--ui-primary-foreground);\n    --chat-surface: var(--ui-muted);\n    --chat-code-bg: var(--ui-muted);\n\n    /* Code token colors live in code/code.css, shared with the IDE kit. */\n  }\n\n  /* A user's plain message and the files they attached (the chat-app template). */\n  .chat-plain {\n    margin: 0;\n  }\n\n  .chat-file-note {\n    color: var(--ui-muted-foreground);\n    font-size: 0.8125rem;\n  }\n\n  .chat-visually-hidden {\n    position: absolute;\n    width: 1px;\n    height: 1px;\n    overflow: hidden;\n    clip-path: inset(50%);\n    white-space: nowrap;\n  }\n\n  .chat-icon {\n    width: 1rem;\n    height: 1rem;\n    fill: none;\n    stroke: currentColor;\n    stroke-width: 1.75;\n    stroke-linecap: round;\n    stroke-linejoin: round;\n  }\n\n  /* Thread */\n\n  .chat-thread {\n    position: relative;\n    min-height: 0;\n  }\n\n  .chat-thread-scroller {\n    max-height: var(--chat-thread-height, 26rem);\n    overflow-y: auto;\n    overscroll-behavior: contain;\n    border-radius: var(--ui-radius, 0px);\n\n    &:focus-visible {\n      outline: 2px solid var(--ui-ring-border);\n      outline-offset: 2px;\n    }\n  }\n\n  .chat-thread-log {\n    display: flex;\n    flex-direction: column;\n    gap: 1rem;\n    padding: 0.25rem 0.25rem 0.75rem;\n  }\n\n  .chat-thread-jump {\n    position: absolute;\n    bottom: 0.5rem;\n    left: 50%;\n    translate: -50% 0;\n    box-shadow: var(--ui-shadow);\n  }\n\n  .chat-empty {\n    display: grid;\n    justify-items: center;\n    gap: 0.75rem;\n    padding: 2.5rem 1rem;\n    text-align: center;\n    color: var(--ui-muted-foreground);\n  }\n\n  .chat-empty-title {\n    margin: 0;\n    font-size: 1.125rem;\n    font-weight: 600;\n    color: var(--ui-foreground);\n  }\n\n  /* Messages */\n\n  .chat-message {\n    display: grid;\n    grid-template-columns: auto minmax(0, 1fr);\n    gap: 0.625rem;\n    align-items: start;\n\n    &:not(:has(.chat-message-avatar)) {\n      grid-template-columns: minmax(0, 1fr);\n    }\n  }\n\n  .chat-message-avatar {\n    width: 1.75rem;\n    height: 1.75rem;\n    font-size: 0.75rem;\n  }\n\n  .chat-message-body {\n    display: grid;\n    gap: 0.25rem;\n    min-width: 0;\n  }\n\n  .chat-message-meta {\n    display: flex;\n    align-items: baseline;\n    gap: 0.5rem;\n    font-size: 0.75rem;\n    color: var(--ui-muted-foreground);\n  }\n\n  .chat-message-name {\n    font-weight: 600;\n    color: var(--ui-foreground);\n  }\n\n  .chat-message-content {\n    display: grid;\n    gap: 0.5rem;\n    line-height: 1.55;\n    /* A long URL or token wraps rather than widening the message. (Short messages stay on\n       one line because a person's bubble may use 90% of the row, see below.) */\n    overflow-wrap: anywhere;\n  }\n\n  /* The body takes the row and puts the bubble at its end; a bubble's 90% is of the row,\n     not of a body shrunk to the name and time above it. */\n  .chat-message[data-from=\"user\"] {\n    grid-template-columns: minmax(0, 1fr) auto;\n\n    .chat-message-avatar {\n      order: 2;\n    }\n\n    .chat-message-body {\n      justify-items: end;\n    }\n\n    .chat-message-content {\n      max-width: min(36rem, 90%);\n      padding: 0.5rem 0.875rem;\n      border-radius: calc(var(--ui-radius, 0px) + 10px);\n      background: var(--chat-bubble);\n      color: var(--chat-bubble-text);\n    }\n  }\n\n  /* Without an avatar, a person's bubble sits flush at the end of the row. */\n  .chat-message[data-from=\"user\"]:not(:has(.chat-message-avatar)) {\n    grid-template-columns: minmax(0, 1fr);\n  }\n\n  /* Files in a person's own bubble read in the bubble's text color. */\n  .chat-message[data-from=\"user\"] .chat-message-content :is(a, figcaption) {\n    color: inherit;\n  }\n\n  .chat-message[data-from=\"system\"] .chat-message-content {\n    color: var(--ui-muted-foreground);\n    font-style: italic;\n  }\n\n  .chat-message[data-streaming] .chat-message-content > :last-child::after {\n    content: \"▍\";\n    margin-inline-start: 1px;\n    animation: chat-blink 1s steps(2) infinite;\n  }\n\n  @keyframes chat-blink {\n    50% {\n      opacity: 0;\n    }\n  }\n\n  :is(.chat-actions, .chat-suggestions)[data-slot=\"toolbar\"] {\n    padding: 0;\n    border: 0;\n    background: none;\n    box-shadow: none;\n  }\n\n  .chat-actions,\n  .chat-suggestions {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 0.25rem;\n  }\n\n  .chat-actions {\n    :is([data-slot=\"toolbar-button\"], [data-slot=\"toggle\"]) {\n      height: 1.875rem;\n      width: 1.875rem;\n      padding: 0;\n      border-color: transparent;\n      background: transparent;\n      color: var(--ui-muted-foreground);\n\n      &:hover {\n        background: var(--ui-muted);\n        color: var(--ui-foreground);\n      }\n\n      &[data-pressed] {\n        color: var(--ui-foreground);\n        background: var(--ui-muted);\n      }\n    }\n\n    [data-slot=\"toggle-group\"] {\n      display: flex;\n      gap: 0.25rem;\n    }\n  }\n\n  /* Suggestions are chips you can press: an outline, and a fill on hover. */\n  .chat-suggestions [data-slot=\"toolbar-button\"] {\n    height: auto;\n    min-height: 2rem;\n    padding: 0.375rem 0.875rem;\n    border: 1px solid var(--ui-border);\n    border-radius: 999px;\n    background: var(--ui-background);\n    color: var(--ui-foreground);\n    text-align: start;\n    white-space: normal;\n\n    &:hover:not([data-disabled]) {\n      border-color: var(--ui-input);\n      background: var(--ui-muted);\n    }\n  }\n\n  .chat-branch {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.25rem;\n    font-size: 0.75rem;\n    color: var(--ui-muted-foreground);\n    font-variant-numeric: tabular-nums;\n\n    [data-slot=\"button\"] {\n      width: 1.75rem;\n      height: 1.75rem;\n      padding: 0;\n    }\n  }\n\n  .chat-shimmer {\n    background: linear-gradient(\n        90deg,\n        var(--ui-muted-foreground) 0 40%,\n        var(--ui-foreground) 50%,\n        var(--ui-muted-foreground) 60% 100%\n      )\n      0 0 / 300% 100%;\n    background-clip: text;\n    color: transparent;\n    animation: chat-shimmer 1.8s linear infinite;\n  }\n\n  @keyframes chat-shimmer {\n    from {\n      background-position: 100% 0;\n    }\n    to {\n      background-position: 0 0;\n    }\n  }\n\n  /* Disclosures: reasoning, tools, sources, tasks */\n\n  .chat-disclosure {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 0.75rem;\n    width: 100%;\n    height: auto;\n    min-height: 2.25rem;\n    padding: 0.375rem 0.625rem;\n    border: 1px solid var(--ui-border);\n    border-radius: calc(var(--ui-radius, 0px) + 4px);\n    background: var(--ui-background);\n    color: var(--ui-foreground);\n    font: inherit;\n    font-size: 0.8125rem;\n    text-align: start;\n    cursor: pointer;\n\n    &[data-open] {\n      border-end-start-radius: 0;\n      border-end-end-radius: 0;\n    }\n\n    /* The label takes the room, so a status (\"Done\") sits by the chevron at the end\n       rather than floating in the middle. */\n    & > :first-child {\n      flex: 1 1 auto;\n      min-inline-size: 0;\n    }\n  }\n\n  .chat-disclosure-meta,\n  .chat-tool-status {\n    color: var(--ui-muted-foreground);\n    font-size: 0.75rem;\n  }\n\n  :is(.chat-reasoning, .chat-tool, .chat-sources, .chat-tasks)\n    [data-slot=\"collapsible-panel\"] {\n    padding: 0.625rem;\n    border: 1px solid var(--ui-border);\n    border-top: 0;\n    border-end-start-radius: calc(var(--ui-radius, 0px) + 4px);\n    border-end-end-radius: calc(var(--ui-radius, 0px) + 4px);\n    font-size: 0.8125rem;\n  }\n\n  .chat-reasoning-panel {\n    color: var(--ui-muted-foreground);\n    white-space: pre-wrap;\n  }\n\n  .chat-tool-name {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.5rem;\n    font-weight: 500;\n  }\n\n  .chat-tool-mark {\n    width: 0.5rem;\n    height: 0.5rem;\n    border: 1.5px solid currentColor;\n    border-radius: 50%;\n  }\n\n  .chat-tool[data-status=\"done\"] .chat-tool-mark {\n    background: currentColor;\n  }\n\n  .chat-tool[data-status=\"running\"] .chat-tool-mark {\n    border-style: dashed;\n    animation: chat-blink 1s ease-in-out infinite;\n  }\n\n  .chat-tool[data-status=\"approval\"] {\n    --chat-tool-accent: oklch(0.72 0.16 75);\n\n    .chat-disclosure {\n      border-color: var(--chat-tool-accent);\n    }\n\n    .chat-tool-mark {\n      border-color: var(--chat-tool-accent);\n      background: var(--chat-tool-accent);\n    }\n  }\n\n  :is(.chat-tool[data-status=\"error\"], .chat-tool[data-status=\"denied\"]) .chat-tool-mark {\n    border-radius: 1px;\n    rotate: 45deg;\n  }\n\n  .chat-tool-panel {\n    display: grid;\n    gap: 0.625rem;\n\n    h4 {\n      margin: 0 0 0.25rem;\n      font-size: 0.75rem;\n      font-weight: 600;\n      color: var(--ui-muted-foreground);\n    }\n\n    pre {\n      margin: 0;\n      padding: 0.5rem;\n      max-height: 14rem;\n      overflow: auto;\n      border-radius: var(--ui-radius, 0px);\n      background: var(--chat-code-bg);\n      font-family: var(--ui-font-mono);\n      font-size: 0.75rem;\n    }\n  }\n\n  .chat-tool-error {\n    margin: 0;\n    color: var(--ui-destructive);\n  }\n\n  .chat-source-list,\n  .chat-task-list {\n    display: grid;\n    gap: 0.375rem;\n    margin: 0;\n    padding: 0;\n    list-style: none;\n  }\n\n  .chat-source-list li {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0 0.5rem;\n  }\n\n  .chat-source-host {\n    color: var(--ui-muted-foreground);\n    font-size: 0.75rem;\n  }\n\n  .chat-citation {\n    display: inline-grid;\n    place-items: center;\n    min-width: 1.25rem;\n    height: 1.25rem;\n    margin-inline: 0.125rem;\n    padding-inline: 0.25rem;\n    border-radius: 999px;\n    background: var(--ui-muted);\n    color: var(--ui-foreground);\n    font-size: 0.6875rem;\n    font-weight: 600;\n    vertical-align: 0.125em;\n    text-decoration: none;\n  }\n\n  .chat-citation-card {\n    max-width: 18rem;\n    font-size: 0.8125rem;\n\n    p {\n      margin: 0 0 0.25rem;\n    }\n  }\n\n  .chat-citation-title {\n    font-weight: 600;\n  }\n\n  .chat-task-list li {\n    display: grid;\n    grid-template-columns: auto minmax(0, 1fr) auto;\n    align-items: center;\n    gap: 0 0.5rem;\n  }\n\n  .chat-task-mark {\n    width: 0.75rem;\n    height: 0.75rem;\n    border: 1.5px solid var(--ui-muted-foreground);\n    border-radius: 50%;\n  }\n\n  .chat-task-list li[data-status=\"done\"] {\n    .chat-task-mark {\n      border-color: var(--ui-primary);\n      background: var(--ui-primary);\n    }\n\n    .chat-task-title {\n      color: var(--ui-muted-foreground);\n    }\n  }\n\n  .chat-task-list li[data-status=\"running\"] .chat-task-mark {\n    border-style: dashed;\n    border-color: var(--ui-primary);\n  }\n\n  .chat-task-list li[data-status=\"failed\"] .chat-task-mark {\n    border-color: var(--ui-destructive);\n    border-radius: 2px;\n  }\n\n  .chat-task-status {\n    color: var(--ui-muted-foreground);\n    font-size: 0.75rem;\n  }\n\n  .chat-task-detail {\n    grid-column: 2 / -1;\n    color: var(--ui-muted-foreground);\n    font-size: 0.75rem;\n  }\n\n  .chat-image {\n    margin: 0;\n\n    img {\n      max-width: 100%;\n      height: auto;\n      border-radius: calc(var(--ui-radius, 0px) + 4px);\n    }\n\n    figcaption {\n      margin-top: 0.25rem;\n      font-size: 0.75rem;\n      color: var(--ui-muted-foreground);\n    }\n  }\n\n  /* Response: markdown */\n\n  .chat-response {\n    display: grid;\n    gap: 0.625rem;\n\n    > * {\n      margin: 0;\n    }\n\n    :is(ul, ol) {\n      margin: 0;\n      padding-inline-start: 1.25rem;\n    }\n\n    li + li {\n      margin-top: 0.25rem;\n    }\n\n    :is(h1, h2, h3, h4) {\n      margin: 0.5rem 0 0;\n      font-size: 1rem;\n      line-height: 1.3;\n    }\n\n    a {\n      color: inherit;\n      text-underline-offset: 0.2em;\n    }\n\n    :not(pre) > code {\n      padding: 0.0625rem 0.3125rem;\n      border-radius: calc(var(--ui-radius, 0px) / 2 + 2px);\n      background: var(--chat-code-bg);\n      font-family: var(--ui-font-mono);\n      font-size: 0.875em;\n    }\n\n    blockquote {\n      padding-inline-start: 0.75rem;\n      border-inline-start: 3px solid var(--ui-border);\n      color: var(--ui-muted-foreground);\n    }\n\n    hr {\n      margin: 0.25rem 0;\n    }\n\n    img {\n      max-width: 100%;\n      height: auto;\n    }\n  }\n\n  .chat-table {\n    max-width: 100%;\n    overflow-x: auto;\n\n    table {\n      border-collapse: collapse;\n      font-size: 0.8125rem;\n    }\n\n    :is(th, td) {\n      padding: 0.375rem 0.625rem;\n      border: 1px solid var(--ui-border);\n      text-align: start;\n    }\n  }\n\n  .chat-code {\n    margin: 0;\n    overflow: hidden;\n    border: 1px solid var(--ui-border);\n    border-radius: calc(var(--ui-radius, 0px) + 4px);\n    background: var(--chat-code-bg);\n\n    pre {\n      margin: 0;\n      padding: 0.75rem;\n      overflow-x: auto;\n      font-family: var(--ui-font-mono);\n      font-size: 0.8125rem;\n      line-height: 1.6;\n      color: var(--shiki-foreground);\n      tab-size: 2;\n\n      &:focus-visible {\n        outline: 2px solid var(--ui-ring-border);\n        outline-offset: -2px;\n      }\n    }\n\n    &[data-wrap] pre {\n      white-space: pre-wrap;\n      overflow-wrap: anywhere;\n    }\n  }\n\n  .chat-code-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 0.5rem;\n    padding: 0.25rem 0.25rem 0.25rem 0.75rem;\n    border-bottom: 1px solid var(--ui-border);\n    font-size: 0.75rem;\n    color: var(--ui-muted-foreground);\n  }\n\n  .chat-code-actions {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.25rem;\n\n    :is([data-slot=\"toggle\"], [data-slot=\"button\"]) {\n      height: 1.75rem;\n      min-width: 1.75rem;\n      padding: 0 0.5rem;\n      font-size: 0.75rem;\n    }\n  }\n\n  /* Composer */\n\n  .chat-composer,\n  .chat-composer > [data-slot=\"file-input\"] {\n    display: block;\n    width: 100%;\n    max-width: none;\n  }\n\n  .chat-composer-box {\n    display: grid;\n    gap: 0.375rem;\n    padding: 0.5rem;\n    border: 1px solid var(--ui-input);\n    border-radius: calc(var(--ui-radius, 0px) + 8px);\n    background: var(--ui-background);\n\n    &:focus-within {\n      outline: 2px solid var(--ui-ring-border);\n      outline-offset: 1px;\n    }\n\n    &[data-drag-over] {\n      outline: 2px dashed var(--ui-ring-border);\n    }\n  }\n\n  .chat-composer-input {\n    width: 100%;\n    min-height: 2.5rem;\n    max-height: 12rem;\n    padding: 0.375rem 0.5rem;\n    border: 0;\n    background: transparent;\n    color: inherit;\n    font: inherit;\n    resize: none;\n    field-sizing: content;\n  }\n\n  /* The composer box draws the focus ring for the field inside it. */\n  [data-uiset] .chat-composer-input[data-slot]:focus-visible {\n    outline: none;\n\n    &::placeholder {\n      color: var(--ui-muted-foreground);\n    }\n  }\n\n  /* Wraps on a phone, so the model picker and usage never widen the page. */\n  .chat-composer-toolbar {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 0.375rem;\n  }\n\n  .chat-composer-spacer {\n    flex: 1;\n  }\n\n  .chat-composer-attach {\n    width: 2rem;\n    height: 2rem;\n    padding: 0;\n  }\n\n  .chat-attachments {\n    display: flex;\n    flex-direction: row;\n    flex-wrap: wrap;\n    gap: 0.375rem;\n    margin: 0;\n    padding: 0;\n    border: 0;\n    border-radius: 0;\n    list-style: none;\n\n    &:empty {\n      display: none;\n    }\n  }\n\n  .chat-attachment {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.375rem;\n    min-height: 0;\n    max-width: 16rem;\n    padding: 0.25rem 0.25rem 0.25rem 0.625rem;\n    border: 1px solid var(--ui-border);\n    border-radius: 999px;\n    background: var(--ui-muted);\n    font-size: 0.75rem;\n\n    [data-slot=\"file-input-item-remove\"] {\n      width: 1.5rem;\n      height: 1.5rem;\n      padding: 0;\n    }\n  }\n\n  .chat-attachment-name {\n    flex: 0 1 auto;\n    text-align: start;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n\n  .chat-attachment-size {\n    color: var(--ui-muted-foreground);\n  }\n\n  .chat-menu {\n    min-width: 14rem;\n  }\n\n  .chat-menu-label {\n    font-weight: 500;\n  }\n\n  .chat-menu-hint,\n  .chat-model-description {\n    display: block;\n    font-size: 0.75rem;\n    color: var(--ui-muted-foreground);\n  }\n\n  .chat-model-trigger {\n    height: 2rem;\n    min-width: 8rem;\n    font-size: 0.8125rem;\n  }\n\n  .chat-model-name {\n    display: block;\n  }\n\n  /* Each model's description sits under its name, as a command's does in the menu. */\n  .chat-model-list [data-slot=\"select-item\"] {\n    flex-direction: column;\n    align-items: flex-start;\n    gap: 0.0625rem;\n    padding-block: 0.4375rem;\n  }\n\n  .chat-usage {\n    white-space: nowrap;\n    display: inline-flex;\n    flex-direction: row;\n    align-items: center;\n    gap: 0.5rem;\n    min-width: 0;\n    width: auto;\n    font-size: 0.75rem;\n    color: var(--ui-muted-foreground);\n\n    [data-slot=\"meter-track\"] {\n      width: 4rem;\n      height: 0.375rem;\n    }\n\n    &[data-level=\"medium\"] [data-slot=\"meter-indicator\"] {\n      background: oklch(0.72 0.16 75);\n    }\n\n    &[data-level=\"high\"] [data-slot=\"meter-indicator\"] {\n      background: var(--ui-destructive);\n    }\n  }\n\n  .chat-dialog-actions {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.5rem;\n  }\n\n  /* Chat list */\n\n  /* No clipping here: focus rings on full-width rows (a chat, the rename field) stay whole.\n     The padding gives them room; the margin keeps the list aligned with what's around it. */\n  .chat-threads {\n    display: grid;\n    align-content: start;\n    gap: 0.5rem;\n    min-width: 0;\n    padding: 0.25rem;\n    margin: -0.25rem;\n\n    ul {\n      display: grid;\n      gap: 0.125rem;\n      margin: 0;\n      padding: 0;\n      list-style: none;\n    }\n\n    li {\n      display: flex;\n      align-items: center;\n      gap: 0.25rem;\n      min-width: 0;\n      border-radius: var(--ui-radius, 0px);\n\n      &[data-active] {\n        background: var(--ui-muted);\n      }\n    }\n  }\n\n  .chat-thread-link {\n    flex: 1 1 0;\n    justify-content: space-between;\n    min-width: 0;\n    overflow: hidden;\n    height: auto;\n    min-height: 2.25rem;\n    gap: 0.5rem;\n    text-align: start;\n\n    time {\n      flex-shrink: 0;\n      font-size: 0.75rem;\n      color: var(--ui-muted-foreground);\n    }\n  }\n\n  .chat-thread-title {\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n\n  .chat-thread-more {\n    flex-shrink: 0;\n    width: 2rem;\n    height: 2rem;\n    padding: 0;\n    color: var(--ui-muted-foreground);\n\n    &:hover:not([data-disabled]),\n    &[data-open] {\n      background: var(--ui-muted);\n      color: var(--ui-foreground);\n    }\n  }\n\n  .chat-thread-rename {\n    flex: 1;\n  }\n\n  .chat-threads-empty {\n    margin: 0.5rem 0;\n    color: var(--ui-muted-foreground);\n  }\n\n  /* Launcher */\n\n  .chat-launcher {\n    position: fixed;\n    inset: auto 1.25rem 1.25rem auto;\n    z-index: 5;\n    width: 3.25rem;\n    height: 3.25rem;\n    padding: 0;\n    border-radius: 50%;\n    background: var(--ui-primary);\n    color: var(--ui-primary-foreground);\n    box-shadow: var(--ui-shadow);\n\n    .chat-icon {\n      width: 1.375rem;\n      height: 1.375rem;\n    }\n  }\n\n  .chat-launcher-panel {\n    display: grid;\n    grid-template-rows: auto minmax(0, 1fr);\n    gap: 0.75rem;\n    width: min(24rem, calc(100vw - 2rem));\n    height: min(36rem, calc(100dvh - 7rem));\n    padding: 1rem;\n  }\n\n  .chat-launcher-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n\n    [data-slot=\"popover-title\"] {\n      margin: 0;\n      font-size: 1rem;\n    }\n\n    [data-slot=\"popover-close\"] {\n      width: 2rem;\n      height: 2rem;\n      padding: 0;\n    }\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    .chat-shimmer {\n      animation: none;\n      background: none;\n      color: var(--ui-muted-foreground);\n    }\n\n    .chat-message[data-streaming] .chat-message-content > :last-child::after,\n    .chat-tool[data-status=\"running\"] .chat-tool-mark {\n      animation: none;\n    }\n  }\n\n  @media (forced-colors: active) {\n    .chat-shimmer {\n      background: none;\n      color: CanvasText;\n    }\n\n    .chat-message[data-from=\"user\"] .chat-message-content,\n    .chat-attachment,\n    .chat-citation {\n      border: 1px solid CanvasText;\n    }\n\n    .chat-code pre span {\n      forced-color-adjust: auto;\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/chat/chat.css"
    }
  ],
  "type": "registry:ui"
}