{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chat-sidebar",
  "title": "Chat sidebar",
  "author": "superzero11 <https://github.com/superzero11/uiset>",
  "description": "A list of chats with rename and confirmed delete, and a floating assistant launcher.",
  "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/chat.json",
    "https://uiset.dev/r/button.json"
  ],
  "files": [
    {
      "path": "registry/uiset/ui/chat-sidebar.tsx",
      "content": "\"use client\"\n\nimport {\n  AlertDialog,\n  AlertDialogBackdrop,\n  AlertDialogClose,\n  AlertDialogContent,\n  AlertDialogDescription,\n  AlertDialogTitle,\n} from \"@ui-sdk/react/alert-dialog\"\nimport { Field, FieldLabel } from \"@ui-sdk/react/field\"\nimport { Input } from \"@ui-sdk/react/input\"\nimport { Menu, MenuContent, MenuItem, MenuTrigger } from \"@ui-sdk/react/menu\"\nimport {\n  Popover,\n  PopoverClose,\n  PopoverContent,\n  PopoverTitle,\n  PopoverTrigger,\n} from \"@ui-sdk/react/popover\"\nimport { useState, type ReactNode } from \"react\"\nimport { Button } from \"./button\"\nimport { ChatIcon } from \"./chat\"\nimport \"./chat/chat.css\"\n\ntype Thread = { id: string; title: string; updatedAt?: Date }\n\nconst more = \"M5 12h.01M12 12h.01M19 12h.01\"\nconst bubble = \"M4 5h16v11H9l-5 4z\"\nconst close = \"M6 6l12 12M18 6L6 18\"\n\nconst relative = new Intl.RelativeTimeFormat(undefined, {\n  numeric: \"auto\",\n  style: \"short\",\n})\n\nfunction ago(date: Date) {\n  const minutes = Math.round((date.getTime() - Date.now()) / 60000)\n  if (Math.abs(minutes) < 60) return relative.format(minutes, \"minute\")\n  const hours = Math.round(minutes / 60)\n  if (Math.abs(hours) < 24) return relative.format(hours, \"hour\")\n  return relative.format(Math.round(hours / 24), \"day\")\n}\n\nfunction ChatThreadList({\n  threads,\n  value,\n  onValueChange,\n  onNew,\n  onRename,\n  onDelete,\n  label = \"Chats\",\n}: {\n  threads: Thread[]\n  value?: string\n  onValueChange: (id: string) => void\n  onNew?: () => void\n  onRename?: (id: string, title: string) => void\n  onDelete?: (id: string) => void\n  label?: string\n}) {\n  const [editing, setEditing] = useState<string | null>(null)\n  const [deleting, setDeleting] = useState<Thread | null>(null)\n\n  const finish = (thread: Thread, title: string | null) => {\n    setEditing(null)\n    const next = title?.trim()\n    if (next && next !== thread.title) onRename?.(thread.id, next)\n  }\n\n  return (\n    <nav aria-label={label} className=\"chat-threads\">\n      {onNew && (\n        <Button variant=\"outline\" className=\"chat-threads-new\" onClick={onNew}>\n          New chat\n        </Button>\n      )}\n      {threads.length === 0 ? (\n        <p className=\"chat-threads-empty\">No chats yet.</p>\n      ) : (\n        <ul>\n          {threads.map((thread) => (\n            <li key={thread.id} data-active={thread.id === value ? \"\" : undefined}>\n              {editing === thread.id ? (\n                <Field className=\"chat-thread-rename\">\n                  <FieldLabel className=\"chat-visually-hidden\">\n                    Rename {thread.title}\n                  </FieldLabel>\n                  <Input\n                    autoFocus\n                    defaultValue={thread.title}\n                    onKeyDown={(event) => {\n                      if (event.key === \"Enter\") finish(thread, event.currentTarget.value)\n                      if (event.key === \"Escape\") finish(thread, null)\n                    }}\n                    onBlur={(event) => finish(thread, event.currentTarget.value)}\n                  />\n                </Field>\n              ) : (\n                <Button\n                  variant=\"ghost\"\n                  className=\"chat-thread-link\"\n                  // A verb of its own, so neither this nor \"More for …\" is the bare title a step\n                  // by that title would find twice.\n                  aria-label={`Open ${thread.title}`}\n                  aria-description={\n                    thread.updatedAt ? `Updated ${ago(thread.updatedAt)}` : undefined\n                  }\n                  aria-current={thread.id === value ? \"page\" : undefined}\n                  onClick={() => onValueChange(thread.id)}\n                >\n                  <span className=\"chat-thread-title\">{thread.title}</span>\n                  {thread.updatedAt && (\n                    <time dateTime={thread.updatedAt.toISOString()} aria-hidden=\"true\">\n                      {ago(thread.updatedAt)}\n                    </time>\n                  )}\n                </Button>\n              )}\n              {(onRename || onDelete) && editing !== thread.id && (\n                <Menu>\n                  <MenuTrigger\n                    className=\"chat-thread-more\"\n                    data-variant=\"ghost\"\n                    aria-label={`More for ${thread.title}`}\n                  >\n                    <ChatIcon path={more} />\n                  </MenuTrigger>\n                  <MenuContent>\n                    {onRename && (\n                      <MenuItem onSelect={() => setEditing(thread.id)}>Rename</MenuItem>\n                    )}\n                    {onDelete && (\n                      <MenuItem destructive onSelect={() => setDeleting(thread)}>\n                        Delete\n                      </MenuItem>\n                    )}\n                  </MenuContent>\n                </Menu>\n              )}\n            </li>\n          ))}\n        </ul>\n      )}\n      <AlertDialog\n        open={deleting !== null}\n        onOpenChange={(open) => !open && setDeleting(null)}\n      >\n        <AlertDialogBackdrop />\n        <AlertDialogContent>\n          <AlertDialogTitle>Delete “{deleting?.title}”?</AlertDialogTitle>\n          <AlertDialogDescription>\n            The chat and its messages are removed.\n          </AlertDialogDescription>\n          <div className=\"chat-dialog-actions\">\n            <AlertDialogClose>Keep it</AlertDialogClose>\n            <AlertDialogClose\n              value=\"confirm\"\n              data-variant=\"solid\"\n              data-agent-confirm={`Deletes the chat “${deleting?.title ?? \"\"}” and its messages`}\n              onClick={() => deleting && onDelete?.(deleting.id)}\n            >\n              Delete chat\n            </AlertDialogClose>\n          </div>\n        </AlertDialogContent>\n      </AlertDialog>\n    </nav>\n  )\n}\n\n// A floating assistant. It stays open while you click around the page; Escape, its\n// button and Close shut it.\nfunction ChatLauncher({\n  label = \"Open assistant\",\n  title = \"Assistant\",\n  children,\n}: {\n  label?: string\n  title?: string\n  children: ReactNode\n}) {\n  const [open, setOpen] = useState(false)\n  return (\n    <Popover\n      modal={false}\n      open={open}\n      onOpenChange={(next, details) => {\n        if (\n          !next &&\n          (details.reason === \"outside-press\" || details.reason === \"focus-out\")\n        ) {\n          details.cancel()\n          return\n        }\n        setOpen(next)\n      }}\n    >\n      <PopoverTrigger\n        className=\"chat-launcher\"\n        aria-label={open ? `Close ${title}` : label}\n      >\n        <ChatIcon path={open ? close : bubble} />\n      </PopoverTrigger>\n      <PopoverContent\n        className=\"chat-launcher-panel\"\n        side=\"top\"\n        align=\"end\"\n        sideOffset={12}\n      >\n        <header className=\"chat-launcher-header\">\n          <PopoverTitle>{title}</PopoverTitle>\n          <PopoverClose aria-label={`Close ${title}`}>\n            <ChatIcon path={close} />\n          </PopoverClose>\n        </header>\n        {children}\n      </PopoverContent>\n    </Popover>\n  )\n}\n\nexport { ChatLauncher, ChatThreadList }\nexport type { Thread as ChatThreadItem }\n",
      "type": "registry:ui",
      "target": "@ui/chat-sidebar.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"
}