Commit 9e93cd800 for llama.cpp

commit 9e93cd800121f0f96786f7cf38f692c40eec4de5
Author: Aleksander Grygier <aleksander.grygier@gmail.com>
Date:   Wed Nov 18 08:27:44 2026 +0100

    ui: a Storybook for Llama UI and Llama Chat (#32485)

    * ui: Llama UI's own Storybook in ui/lib/ui

    The library gets its Storybook (`npm run storybook`, `npm run
    build-storybook`) with a story for everything it holds, under Llama UI:
    the foundations, the 29 base components (as actions, forms, display,
    overlays and navigation), the app components (ActionIcon, SearchInput,
    SyntaxHighlightedCode), the Model UI and the native app mockups. The
    stories import the package by its published names, aliased onto src/lib,
    run as tests under `npm test` (the storybook project in vite.config.ts),
    and are type-checked with the rest of the package. `npm run dev` starts
    Storybook next to the SvelteKit check page; the toolbar switches the
    color mode and the surface theme, and pages that are mostly prose are
    .svx, through mdsvex.

    Assisted-by: Claude (Opus 5.5 Medium)

    * ui: a Storybook for Llama Chat

    Llama Chat's Storybook gets an introduction, Agents › Design guidelines
    (DESIGN.md), Llama UI's stories as the library has them, and Llama Chat:
    its own foundations (safe areas, the splash screens), then one section per
    src/lib/components/app/<area> (Chat with the chat screen, form, messages,
    attachments and tabs; Content, Models, MCP, Navigation, Settings, Dialogs,
    Forms, Actions, Badges, Misc, Servers and PWA), each accessibility story
    next to its component's. It replaces the flat pages it had (chat message,
    chat form, markdown content, the PWA refresh alert and their fixtures,
    and the ChatForm single-row exploration).

    The stories run on the new tokens and surfaces with the color mode and
    surface theme in the toolbar (by mode-watcher's key, the ColorMode and
    SurfaceTheme enums and applySurfaceTheme), and pages that are mostly
    prose are .svx in an editorial frame (AGENTS.md says how to write them
    and where a story goes). The story tests run Llama Chat's stories and
    leave the library's to the library. The brand and communications pages
    are in ggml-org/llama-brand; the logo files come from @ggml-org/llama-brand.

    Assisted-by: Claude (Opus 5.5 Medium)

    * ui: let the ChatScreen story store its reply before the next one starts

    The ContinueConversation story ended while its reply was still being stored,
    and the next story reset the stores under it. It now waits for the reply to
    finish.

    Assisted-by: Claude (Fable 5.2)

    * ui: publish the Storybook to its Hugging Face Space on every UI change

    A new UI Storybook workflow builds ui/apps/chat's Storybook whenever
    ui/apps/chat or ui/lib/ui changes on master (or on demand) and uploads it
    to the static Space ggml-org/Llama-UI-storybook, with a Space card naming
    the commit it was built from. Files the new build no longer has are
    removed; the Space's .gitattributes stays. It runs only in
    ggml-org/llama.cpp, takes the UI's Hugging Face token
    (HF_TOKEN_UI_STATIC_OUTPUT), and the Space can be changed with the
    HF_SPACE_UI_STORYBOOK variable.

    Assisted-by: Claude (Opus 5.5 Medium)

    * ui: run the library's tests, its stories among them, in CI

    The Library checks job type-checked and packed ui/lib/ui but never ran its
    tests, so the library's stories, which now hold every library component's,
    went untested in CI. It installs Chromium and runs `npm test`.

    Assisted-by: Claude (Opus 5.5 Medium)

    * ui: draw a floating panel's rim on its border, so its edge is one line

    Menus, popovers, dialogs and the other matte-float panels carry a 1px border that the
    surface made transparent, and drew their inner highlight as an inset shadow. An inset
    shadow sits inside the border, so the 1px of fill between it and the outer ring showed
    as a second edge. The border now draws the highlight, right inside the ring.

    Assisted-by: Claude (Opus 5.5 Medium)

diff --git a/.github/workflows/ui-storybook.yml b/.github/workflows/ui-storybook.yml
new file mode 100644
index 000000000..e757bb05f
--- /dev/null
+++ b/.github/workflows/ui-storybook.yml
@@ -0,0 +1,81 @@
+name: UI Storybook
+
+# Builds Llama UI and Llama Chat's Storybook (ui/apps/chat) and publishes it to its Hugging Face Space
+# whenever the UI changes on master, so the Space always shows the latest build.
+
+on:
+  workflow_dispatch:
+  push:
+    branches:
+      - master
+    paths: [
+      '.github/workflows/ui-storybook.yml',
+      'ui/apps/chat/**',
+      'ui/lib/ui/**'
+    ]
+
+cache-mode: none
+permissions:
+  contents: read
+
+# only the newest build matters: a newer push replaces a deploy still in progress
+concurrency:
+  group: ${{ github.workflow }}
+  cancel-in-progress: true
+
+jobs:
+  deploy:
+    name: Deploy to Hugging Face Spaces
+    if: github.repository == 'ggml-org/llama.cpp'
+    runs-on: ubuntu-24.04
+
+    env:
+      HF_SPACE: ${{ vars.HF_SPACE_UI_STORYBOOK || 'ggml-org/llama-ui-storybook' }}
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v6
+
+      - name: Setup Node.js
+        uses: actions/setup-node@v6
+        with:
+          node-version: "24"
+          package-manager-cache: false
+
+      - name: Install dependencies
+        run: npm ci
+        working-directory: ui/apps/chat
+
+      - name: Build Storybook
+        run: npm run build-storybook
+        working-directory: ui/apps/chat
+
+      - name: Write the Space card
+        run: |
+          cat > ui/apps/chat/storybook-static/README.md << EOF
+          ---
+          title: Llama UI Storybook
+          emoji: 🦙
+          colorFrom: gray
+          colorTo: gray
+          sdk: static
+          pinned: false
+          ---
+
+          The Storybook of Llama UI and Llama Chat, built from [ggml-org/llama.cpp](https://github.com/ggml-org/llama.cpp) (\`ui/apps/chat\`) at ${GITHUB_SHA}.
+          EOF
+
+      - name: Install Hugging Face Hub CLI
+        run: |
+          python3 -m venv .venv-hf
+          .venv-hf/bin/pip install -U huggingface_hub==1.28.0
+
+      - name: Upload to the Space
+        env:
+          HF_TOKEN: ${{ secrets.HF_TOKEN_UI_STATIC_OUTPUT }}
+        run: |
+          # --delete '*' removes files the new build no longer has; the Space's .gitattributes is always kept
+          .venv-hf/bin/hf upload "$HF_SPACE" ui/apps/chat/storybook-static . \
+            --repo-type space \
+            --delete '*' \
+            --commit-message "Storybook from ggml-org/llama.cpp@${GITHUB_SHA::10}"
diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yml
index abf55d709..96fb51625 100644
--- a/.github/workflows/ui.yml
+++ b/.github/workflows/ui.yml
@@ -132,6 +132,15 @@ jobs:
         run: npm run check
         working-directory: ui/lib/ui

+      - name: Install Playwright browsers
+        run: npx playwright install --with-deps chromium
+        working-directory: ui/lib/ui
+
+      # the unit tests and the Storybook stories (ui/lib/ui/tests/stories), which run as tests in Chromium
+      - name: Run tests
+        run: npm test
+        working-directory: ui/lib/ui
+
       - name: Build the package
         run: npm run prepack
         working-directory: ui/lib/ui
diff --git a/ui/apps/chat/.storybook/color-scheme.ts b/ui/apps/chat/.storybook/color-scheme.ts
new file mode 100644
index 000000000..4ebfb46ee
--- /dev/null
+++ b/ui/apps/chat/.storybook/color-scheme.ts
@@ -0,0 +1,24 @@
+import { MEDIA_QUERIES } from '#lib/constants/pwa.constants.ts';
+import { ColorMode } from '#lib/enums/ui.enums.ts';
+import { modeStorageKey } from 'mode-watcher';
+
+/** The class on `<html>` that turns the dark theme on, as mode-watcher sets it. */
+export const DARK_CLASS = ColorMode.DARK;
+
+/** Turns the dark theme on or off. */
+export function setDarkClass(isDark: boolean) {
+	document.documentElement.classList.toggle(DARK_CLASS, isDark);
+}
+
+/**
+ * Sets the dark class from the saved mode-watcher mode, or the system preference
+ * when there is none. Docs pages render no story, so preview.ts calls this too.
+ */
+export function applyColorScheme() {
+	const mode = localStorage.getItem(modeStorageKey.current) || ColorMode.SYSTEM;
+	const isDark =
+		mode === ColorMode.DARK ||
+		(mode === ColorMode.SYSTEM && window.matchMedia(MEDIA_QUERIES.PREFERS_DARK).matches);
+
+	setDarkClass(isDark);
+}
diff --git a/ui/apps/chat/.storybook/decorators/ModeWatcherDecorator.svelte b/ui/apps/chat/.storybook/decorators/ModeWatcherDecorator.svelte
index 8bded8b3f..82fa0b10a 100644
--- a/ui/apps/chat/.storybook/decorators/ModeWatcherDecorator.svelte
+++ b/ui/apps/chat/.storybook/decorators/ModeWatcherDecorator.svelte
@@ -1,33 +1,24 @@
 <script lang="ts">
 	import { ModeWatcher } from 'mode-watcher';
 	import { onMount } from 'svelte';
+	import { ColorMode } from '#lib/enums/ui.enums.ts';
+	import { applyColorScheme, setDarkClass } from '../color-scheme';

 	interface Props {
 		children?: any;
+		/** a mode the story is always shown in, rather than the viewer's */
+		forced?: ColorMode.DARK | ColorMode.LIGHT;
 	}

-	let { children }: Props = $props();
+	let { children, forced }: Props = $props();

 	onMount(() => {
-		const root = document.documentElement;
-		const theme = localStorage.getItem('mode-watcher-mode') || 'system';
-
-		if (theme === 'dark') {
-			root.classList.add('dark');
-		} else if (theme === 'light') {
-			root.classList.remove('dark');
-		} else {
-			const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
-			if (prefersDark) {
-				root.classList.add('dark');
-			} else {
-				root.classList.remove('dark');
-			}
-		}
+		if (forced) setDarkClass(forced === ColorMode.DARK);
+		else applyColorScheme();
 	});
 </script>

-<ModeWatcher />
+{#if !forced}<ModeWatcher />{/if}

 {#if children}
 	{@const Component = children}
diff --git a/ui/apps/chat/.storybook/docs.css b/ui/apps/chat/.storybook/docs.css
new file mode 100644
index 000000000..4a2f1facc
--- /dev/null
+++ b/ui/apps/chat/.storybook/docs.css
@@ -0,0 +1,91 @@
+@reference '../src/app.css';
+
+/*
+ * MDX pages that wrap their content in <Unstyled><div className="ds-docs"> drop
+ * Storybook's docs theme and take colours, font and type roles from the design system.
+ */
+.sbdocs-wrapper:has(.ds-docs) {
+	background: var(--surface-page);
+}
+
+.ds-docs {
+	@apply mx-auto max-w-3xl font-sans text-body text-fg-default;
+
+	& :where(h1) {
+		@apply mb-4 text-heading;
+	}
+
+	& :where(h2) {
+		@apply mt-10 mb-3 border-b border-line-default pb-2 text-title;
+	}
+
+	& :where(h3) {
+		@apply mt-6 mb-2 text-body font-semibold;
+	}
+
+	& :where(h4, h5, h6) {
+		@apply mt-4 mb-2 text-label;
+	}
+
+	& :where(p, ul, ol, blockquote, table, pre) {
+		@apply my-3;
+	}
+
+	& :where(ul) {
+		@apply list-disc pl-6;
+	}
+
+	& :where(ol) {
+		@apply list-decimal pl-6;
+	}
+
+	& :where(li) {
+		@apply my-1;
+	}
+
+	& :where(strong) {
+		@apply font-semibold;
+	}
+
+	& :where(a) {
+		@apply underline underline-offset-2 hover:text-fg-muted;
+	}
+
+	& :where(blockquote) {
+		@apply border-l-2 border-line-default pl-4 text-fg-muted;
+	}
+
+	/* a note that stands out from the running text: a quiet panel with the accent on its edge */
+	& :where(.callout) {
+		@apply my-6 rounded-panel border-l-2 border-(--art-cinder) bg-surface-muted px-5 py-4;
+
+		& > :where(p) {
+			@apply my-0;
+		}
+	}
+
+	& :where(hr) {
+		@apply my-8 border-line-default;
+	}
+
+	/* inline code only, with a selector that outranks the code the Markdown block renders */
+	& :not(pre) > code {
+		@apply rounded-control border-0 bg-surface-code px-1 py-0.5 font-mono text-[0.875em] text-(--fg-code);
+	}
+
+	& :where(pre) {
+		@apply overflow-x-auto rounded-panel bg-surface-code p-4 text-body-sm;
+	}
+
+	& :where(table) {
+		@apply w-full border-collapse text-body-sm;
+	}
+
+	& :where(th, td) {
+		@apply border-b border-line-default px-3 py-2 text-left align-top;
+	}
+
+	& :where(th) {
+		@apply text-label;
+	}
+}
diff --git a/ui/apps/chat/.storybook/main.ts b/ui/apps/chat/.storybook/main.ts
index b02ecc5d5..076f24481 100644
--- a/ui/apps/chat/.storybook/main.ts
+++ b/ui/apps/chat/.storybook/main.ts
@@ -4,8 +4,19 @@ import { fileURLToPath } from 'url';

 const __dirname = dirname(fileURLToPath(import.meta.url));

+// Llama UI's stories live with the library (ui/lib/ui/tests/stories), which runs and tests them in its own
+// Storybook; this one shows them too, under Llama UI, next to Llama Chat's own. The library's front page stays its own.
+const LLAMA_UI_STORIES = resolve(__dirname, '../../../lib/ui/tests/stories');
+
 const config: StorybookConfig = {
-	stories: ['../tests/stories/**/*.mdx', '../tests/stories/**/*.stories.@(js|ts|svelte)'],
+	stories: [
+		'../tests/stories/**/*.mdx',
+		'../tests/stories/**/*.stories.@(js|ts|svelte)',
+		{
+			directory: '../../../lib/ui/tests/stories',
+			files: '{foundations,components,app,models,mockups}/**/*.stories.svelte'
+		}
+	],
 	addons: [
 		'@storybook/addon-svelte-csf',
 		'@chromatic-com/storybook',
@@ -18,7 +29,18 @@ const config: StorybookConfig = {
 	viteFinal: async (config) => {
 		config.server = config.server || {};
 		config.server.fs = config.server.fs || {};
-		config.server.fs.allow = [...(config.server.fs.allow || []), resolve(__dirname, '../tests')];
+		config.server.fs.allow = [
+			...(config.server.fs.allow || []),
+			resolve(__dirname, '../tests'),
+			LLAMA_UI_STORIES
+		];
+		// the library's stories import Storybook from where they live, where only this app's packages are installed
+		config.resolve = config.resolve || {};
+		config.resolve.dedupe = [
+			...(config.resolve.dedupe || []),
+			'@storybook/addon-svelte-csf',
+			'storybook'
+		];
 		return config;
 	}
 };
diff --git a/ui/apps/chat/.storybook/manager-head.html b/ui/apps/chat/.storybook/manager-head.html
new file mode 100644
index 000000000..5964c8fa3
--- /dev/null
+++ b/ui/apps/chat/.storybook/manager-head.html
@@ -0,0 +1,86 @@
+<!--
+	Old links keep working: stories that moved redirect to where they are now (the brand pages that became Llama UI's
+	foundations, and the old UI section, which became Llama UI for the library and Llama Chat for the app), and a link
+	to a story that no longer exists opens Storybook's start page instead of the "Couldn't find story" error.
+-->
+<script>
+	(function () {
+		var match = location.search.match(/[?&]path=\/(story|docs)\/([^&]+)/);
+
+		if (!match) return;
+
+		var id = decodeURIComponent(match[2]);
+
+		// moved stories, old id: new id
+		var moved = {
+			'brand-colors-primitives--primitives': 'llama-ui-foundations-colors--primitives',
+			'brand-logo-app-icons--splash-screens': 'llama-chat-foundations-brand--splash-screens',
+			'brand-logo-usage--splash-screens': 'llama-chat-foundations-brand--splash-screens',
+			'introduction-design-guidelines--docs': 'agents-design-guidelines--docs'
+		};
+
+		// renamed groups, old id prefix: new id prefix, the first that matches wins (the UI section, split in two)
+		var renamed = [
+			[
+				'ui-blocks-chat-chatscreen-chatscreenform-accessibility',
+				'llama-chat-chat-chatform-chatscreenform-accessibility'
+			],
+			[
+				'ui-blocks-chat-chatmessagestatistics-accessibility',
+				'llama-chat-chat-chatmessages-chatmessagestatistics-accessibility'
+			],
+			['ui-blocks-chat-chatscreen-chatattachments-', 'llama-chat-chat-chatattachments-'],
+			['ui-blocks-chat-chatscreen-chatform-', 'llama-chat-chat-chatform-'],
+			['ui-blocks-chat-chatscreen-chatmessages-', 'llama-chat-chat-chatmessages-'],
+			['ui-blocks-chat-chatscreen-chattabs-', 'llama-chat-chat-chattabs-'],
+			['ui-blocks-chat-chatscreen-', 'llama-chat-chat-chatscreen-'],
+			['ui-blocks-content-syntaxhighlightedcode', 'llama-ui-app-components-syntaxhighlightedcode'],
+			['ui-blocks-app-pwarefreshalert', 'llama-chat-pwa-pwarefreshalert'],
+			['ui-blocks-app-serversplash', 'llama-chat-servers-serversplash'],
+			['ui-blocks-app-scrollcarousel', 'llama-chat-misc-scrollcarousel'],
+			['ui-blocks-', 'llama-chat-'],
+			['ui-actions-actionicon', 'llama-ui-app-components-actionicon'],
+			['ui-actions-', 'llama-ui-components-actions-'],
+			['ui-display-', 'llama-ui-components-display-'],
+			['ui-forms-', 'llama-ui-components-forms-'],
+			['ui-navigation-', 'llama-ui-components-navigation-'],
+			['ui-overlays-', 'llama-ui-components-overlays-'],
+			['ui-foundations-brand', 'llama-chat-foundations-brand'],
+			['ui-foundations-safe-areas', 'llama-chat-foundations-safe-areas'],
+			['ui-foundations-', 'llama-ui-foundations-'],
+			['ui-patterns-actionicon', 'llama-ui-app-components-actionicon'],
+			['ui-patterns-searchinput', 'llama-ui-app-components-searchinput'],
+			['ui-patterns-glasskey', 'llama-chat-actions-glasskey'],
+			['ui-patterns-infobadges', 'llama-chat-badges-infobadges'],
+			['ui-patterns-dialogconfirmation', 'llama-chat-dialogs-dialogconfirmation'],
+			['ui-patterns-inputwithsuggestions', 'llama-chat-forms-inputwithsuggestions'],
+			['ui-patterns-keyvaluepairs', 'llama-chat-forms-keyvaluepairs'],
+			['ui-patterns-', 'llama-chat-misc-']
+		];
+
+		function go(to) {
+			var url =
+				location.pathname +
+				(to ? '?path=/' + (/--docs$/.test(to) ? 'docs' : 'story') + '/' + to : '');
+
+			if (url !== location.pathname + location.search) location.replace(url);
+		}
+
+		if (moved[id]) return go(moved[id]);
+
+		for (var i = 0; i < renamed.length; i++) {
+			if (id.indexOf(renamed[i][0]) === 0)
+				return go(renamed[i][1] + id.slice(renamed[i][0].length));
+		}
+
+		// any other id: open the start page if the story is gone
+		fetch('./index.json')
+			.then(function (response) {
+				return response.json();
+			})
+			.then(function (index) {
+				if (!index.entries || !index.entries[id]) go('');
+			})
+			.catch(function () {});
+	})();
+</script>
diff --git a/ui/apps/chat/.storybook/mockups/MacDock.svelte b/ui/apps/chat/.storybook/mockups/MacDock.svelte
new file mode 100644
index 000000000..0c2fdfad9
--- /dev/null
+++ b/ui/apps/chat/.storybook/mockups/MacDock.svelte
@@ -0,0 +1,174 @@
+<!--
+	The macOS Dock, for picturing an app icon in it: the translucent shelf, its apps on Apple's icon grid (the plate 824
+	of each 1024 tile, as the files are drawn), a dot under the running ones, a separator before the trash, and the
+	name label macOS shows over the app under the pointer. The other apps are neutral placeholders (plain plates with a
+	Lucide glyph), so the one shown is the only real icon. Lay it on MockDesktop.
+-->
+<script lang="ts" module>
+	import { Folder, Globe, Mail, MessageCircle, Music, Settings, Trash2 } from '@lucide/svelte';
+	import type { Component } from 'svelte';
+
+	export interface DockApp {
+		/** a placeholder's plate colours, top to bottom, and its glyph */
+		colors?: [string, string];
+		glyph?: Component;
+		/** an app's real icon: a full 1024 macOS tile, its plate on Apple's grid */
+		icon?: string;
+		name: string;
+		running?: boolean;
+	}
+
+	// the neutral apps around the one shown: calm plates, a generic glyph each
+	export const PLACEHOLDERS: DockApp[] = [
+		{ colors: ['#5ea8ff', '#2f6fdc'], glyph: Folder, name: 'Files', running: true },
+		{ colors: ['#7cc8ff', '#2d8fe0'], glyph: Globe, name: 'Browser', running: true },
+		{ colors: ['#6fd28a', '#2fa35a'], glyph: MessageCircle, name: 'Messages' },
+		{ colors: ['#8fb6ff', '#4d74e8'], glyph: Mail, name: 'Mail' },
+		{ colors: ['#ff8a9a', '#e5435e'], glyph: Music, name: 'Music' },
+		{ colors: ['#b8bcc4', '#7d828c'], glyph: Settings, name: 'Settings' }
+	];
+</script>
+
+<script lang="ts">
+	interface Props {
+		/** the apps, left to right; the trash follows a separator */
+		apps?: DockApp[];
+		/** the app whose name label shows, as under the pointer */
+		labelled?: string;
+		mode?: 'dark' | 'light';
+	}
+
+	let { apps = PLACEHOLDERS, labelled, mode = 'light' }: Props = $props();
+</script>
+
+{#snippet tile(app: DockApp)}
+	<span class="tile">
+		{#if app.name === labelled}<span class="label">{app.name}</span>{/if}
+
+		{#if app.icon}
+			<img alt={app.name} src={app.icon} />
+		{:else}
+			{@const Glyph = app.glyph ?? Folder}
+			<svg viewBox="0 0 1024 1024">
+				<defs>
+					<linearGradient id="plate-{app.name}" x1="0" x2="0" y1="0" y2="1">
+						<stop offset="0" stop-color={app.colors?.[0] ?? '#d0d4da'} />
+						<stop offset="1" stop-color={app.colors?.[1] ?? '#9aa0aa'} />
+					</linearGradient>
+				</defs>
+				<rect fill="url(#plate-{app.name})" height="824" rx="185.4" width="824" x="100" y="100" />
+			</svg>
+			<span class="glyph"><Glyph strokeWidth={1.75} /></span>
+		{/if}
+
+		<span class={['dot', app.running && 'on']}></span>
+	</span>
+{/snippet}
+
+<div aria-hidden="true" class={['dock', mode]}>
+	{#each apps as app (app.name)}{@render tile(app)}{/each}
+
+	<span class="separator"></span>
+
+	{@render tile({ colors: ['#c4c8cf', '#8e939c'], glyph: Trash2, name: 'Trash' })}
+</div>
+
+<style>
+	.dock {
+		display: flex;
+		align-items: flex-end;
+		align-self: center;
+		margin-bottom: 6px;
+		padding: 4px 4px 2px;
+		border: 1px solid rgb(255 255 255 / 0.55);
+		border-radius: 22px;
+		background: rgb(255 255 255 / 0.32);
+		box-shadow:
+			0 0 0 1px rgb(0 0 0 / 0.08),
+			0 10px 30px -10px rgb(0 0 0 / 0.25);
+		backdrop-filter: blur(24px) saturate(1.6);
+		font:
+			400 13px / 1 -apple-system,
+			BlinkMacSystemFont,
+			'SF Pro Text',
+			system-ui,
+			sans-serif;
+	}
+	.dark {
+		border-color: rgb(255 255 255 / 0.14);
+		background: rgb(40 40 46 / 0.4);
+		box-shadow:
+			0 0 0 1px rgb(0 0 0 / 0.45),
+			0 10px 30px -10px rgb(0 0 0 / 0.6);
+	}
+	.tile {
+		position: relative;
+		display: grid;
+		place-items: center;
+		width: 60px;
+		height: 66px;
+		padding-bottom: 6px;
+	}
+	.tile img,
+	.tile svg {
+		grid-area: 1 / 1;
+		width: 60px;
+		height: 60px;
+		filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.18));
+	}
+	/* positioned, so it paints over the plate, which its drop shadow lifts into a later layer */
+	.glyph {
+		position: relative;
+		grid-area: 1 / 1;
+		display: grid;
+		place-items: center;
+		color: white;
+	}
+	.glyph :global(svg) {
+		width: 26px;
+		height: 26px;
+		filter: none;
+	}
+	.dot {
+		position: absolute;
+		bottom: 1px;
+		width: 4px;
+		height: 4px;
+		border-radius: 50%;
+	}
+	.dot.on {
+		background: rgb(0 0 0 / 0.6);
+	}
+	.dark .dot.on {
+		background: rgb(255 255 255 / 0.75);
+	}
+	.separator {
+		align-self: stretch;
+		width: 1px;
+		margin: 8px 6px 10px;
+		background: rgb(0 0 0 / 0.16);
+	}
+	.dark .separator {
+		background: rgb(255 255 255 / 0.18);
+	}
+	/* the name macOS shows over the app under the pointer */
+	.label {
+		position: absolute;
+		bottom: calc(100% + 6px);
+		left: 50%;
+		translate: -50%;
+		padding: 5px 10px;
+		border: 1px solid rgb(255 255 255 / 0.6);
+		border-radius: 8px;
+		background: rgb(246 246 246 / 0.85);
+		box-shadow: 0 4px 14px -4px rgb(0 0 0 / 0.25);
+		color: rgb(0 0 0 / 0.85);
+		white-space: nowrap;
+		backdrop-filter: blur(20px);
+	}
+	.dark .label {
+		border-color: rgb(255 255 255 / 0.12);
+		background: rgb(44 44 48 / 0.85);
+		color: rgb(255 255 255 / 0.92);
+	}
+</style>
diff --git a/ui/apps/chat/.storybook/mockups/MacMenuBar.svelte b/ui/apps/chat/.storybook/mockups/MacMenuBar.svelte
new file mode 100644
index 000000000..5a524adb0
--- /dev/null
+++ b/ui/apps/chat/.storybook/mockups/MacMenuBar.svelte
@@ -0,0 +1,119 @@
+<!--
+	A macOS menu bar, for picturing a menu bar app: as in current macOS, no background of its own, the text and icons
+	straight on the wallpaper (lay it on MockDesktop). The front app's menus on the left, the status items on the right:
+	the app's own (its template icon, drawn in the bar's ink, pressed when its menu is open), then the system's (real SF
+	Symbols, see MacStatusIcon) and the clock. Set in the system font, so on a Mac it is San Francisco.
+-->
+<script lang="ts">
+	import MacStatusIcon, { type MacStatusIconName } from './MacStatusIcon.svelte';
+
+	interface Props {
+		/** the front app's name, then its menus */
+		app?: string;
+		clock?: string;
+		menus?: string[];
+		mode?: 'dark' | 'light';
+		/** the app's status item is pressed, as when its menu is open */
+		pressed?: boolean;
+		/** the app's status item: a template icon's paths and viewBox (the Llama app's MenuIcon by default) */
+		statusIcon?: { paths: string[]; viewBox: string };
+	}
+
+	// the Llama app's menu bar icon, from ggml-org/Llama-macOS (Llama/Assets.xcassets/MenuIcon.imageset/MenuIcon.svg)
+	const LLAMA_MENU_ICON = {
+		paths: [
+			'M15 10.1467L12.7658 14.02L12.7632 14.0183C12.3692 14.6283 11.6912 15 10.9602 15H3.8L6.6 10.1467H15Z',
+			'M6.6 10.1467H1L5.65738 2.07393C6.04075 1.40941 6.74959 1 7.51677 1H11.8769L6.6 10.1467Z'
+		],
+		viewBox: '0 0 16 16'
+	};
+
+	const SYSTEM: MacStatusIconName[] = ['sound', 'wifi', 'battery', 'spotlight', 'controlCenter'];
+
+	let {
+		app = 'Finder',
+		clock = 'Wed Sep 23  10:24',
+		menus = ['File', 'Edit', 'View', 'Go', 'Window', 'Help'],
+		mode = 'light',
+		pressed = true,
+		statusIcon = LLAMA_MENU_ICON
+	}: Props = $props();
+</script>
+
+<div aria-hidden="true" class={['bar', mode]}>
+	<div class="menus">
+		<span class="app">{app}</span>
+
+		{#each menus as menu (menu)}<span>{menu}</span>{/each}
+	</div>
+
+	<div class="status">
+		<span class={['item', pressed && 'pressed']}>
+			<svg class="status-icon" fill="currentColor" viewBox={statusIcon.viewBox}>
+				{#each statusIcon.paths as d (d)}<path {d} />{/each}
+			</svg>
+		</span>
+
+		{#each SYSTEM as name (name)}<span class="item"><MacStatusIcon {name} /></span>{/each}
+
+		<span class="clock">{clock}</span>
+	</div>
+</div>
+
+<style>
+	.bar {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		gap: 1rem;
+		height: 28px;
+		padding: 0 10px 0 16px;
+		font:
+			500 13px / 1 -apple-system,
+			BlinkMacSystemFont,
+			'SF Pro Text',
+			system-ui,
+			sans-serif;
+		white-space: pre;
+		color: rgb(0 0 0 / 0.85);
+		/* the faint scrim current macOS lays under the bar for legibility */
+		background: linear-gradient(rgb(255 255 255 / 0.18), rgb(255 255 255 / 0));
+	}
+	.dark {
+		color: rgb(255 255 255 / 0.92);
+		background: linear-gradient(rgb(0 0 0 / 0.18), rgb(0 0 0 / 0));
+	}
+	.menus {
+		display: flex;
+		gap: 20px;
+		overflow: hidden;
+	}
+	.app {
+		font-weight: 700;
+	}
+	.status {
+		display: flex;
+		align-items: center;
+		gap: 4px;
+	}
+	.item {
+		display: flex;
+		align-items: center;
+		height: 22px;
+		padding: 0 7px;
+		border-radius: 6px;
+	}
+	.pressed {
+		background: rgb(0 0 0 / 0.12);
+	}
+	.dark .pressed {
+		background: rgb(255 255 255 / 0.22);
+	}
+	.status-icon {
+		width: 16px;
+		height: 16px;
+	}
+	.clock {
+		padding: 0 4px 0 7px;
+	}
+</style>
diff --git a/ui/apps/chat/.storybook/mockups/MacStatusIcon.svelte b/ui/apps/chat/.storybook/mockups/MacStatusIcon.svelte
new file mode 100644
index 000000000..2b857aa5a
--- /dev/null
+++ b/ui/apps/chat/.storybook/mockups/MacStatusIcon.svelte
@@ -0,0 +1,56 @@
+<!--
+	A macOS menu bar status icon, for the menu bar mockup: the real SF Symbols, copied from llama.app's site
+	(ggml-org/llama-pages, src/lib/components/app/misc/MacStatusIcon.svelte), where each was exported from SF Symbols at
+	medium weight and its paths taken from the PDF. Each sizes itself from the surrounding font size, keeping the sizes
+	macOS draws them at relative to each other, Wi-Fi at 1em.
+-->
+<script lang="ts" module>
+	const icons = {
+		// `battery.100percent.bolt`
+		battery: {
+			d: 'M26.79 68.3L48.17 68.3C46.78 65.37 47.13 63.11 48.76 58.75L25.43 58.75C20.39 58.75 15.64 58.03 12.92 55.32C10.2 52.61 9.56 47.93 9.56 42.87L9.56 25.56C9.56 20.39 10.21 15.74 12.91 12.97C15.62 10.25 20.41 9.6 25.56 9.6L57 9.6L64.8 0L26.7 0C17.96 0 10.97 0.99 5.93 6.03C0.93 11.03 0 17.93 0 26.69L0 41.52C0 50.39 0.92 57.3 5.92 62.33C10.98 67.32 17.9 68.3 26.79 68.3ZM66.69 68.3L103.36 68.3C112.24 68.3 119.18 67.32 124.22 62.33C129.21 57.28 130.14 50.39 130.14 41.52L130.14 26.79C130.14 17.91 129.21 11 124.22 6.02C119.16 0.99 112.24 0 103.36 0L83.27 0C84.62 2.85 84.32 5.13 82.72 9.6L104.71 9.6C109.75 9.6 114.49 10.27 117.21 12.98C119.93 15.74 120.58 20.37 120.58 25.48L120.58 42.87C120.58 47.93 119.91 52.6 117.21 55.32C114.5 58.05 109.75 58.75 104.71 58.75L74.45 58.75ZM137.27 47.4C141.31 47.15 146.74 41.96 146.74 34.15C146.74 26.34 141.31 21.15 137.27 20.9ZM23.53 52.59L48.85 52.59L51.04 46.75L45.25 46.75C40.77 46.35 37.16 42.63 37.16 37.87C37.16 35.5 38.06 33.22 39.56 31.36L52.03 15.75L23.61 15.75C20.52 15.75 18.66 16.16 17.45 17.41C16.2 18.68 15.71 20.48 15.71 23.61L15.71 44.82C15.71 47.84 16.2 49.62 17.45 50.89C18.72 52.13 20.53 52.59 23.53 52.59ZM79.4 52.59L106.61 52.59C109.68 52.59 111.47 52.14 112.67 50.89C113.93 49.62 114.43 47.83 114.43 44.82L114.43 23.48C114.43 20.46 113.93 18.68 112.73 17.42C111.47 16.17 109.62 15.75 106.61 15.75L82.58 15.75L80.4 21.6L86.16 21.6C90.68 21.99 94.28 25.72 94.28 30.44C94.28 32.8 93.39 35.12 91.88 36.94ZM44.21 37.87C44.21 39.21 45.34 40.23 46.76 40.23L63.23 40.23L54.45 63.73C53.17 67.16 56.86 69.06 59.07 66.31L86.27 32.55C86.8 31.85 87.1 31.14 87.1 30.44C87.1 29.09 86.01 28.07 84.6 28.07L68.12 28.07L76.9 4.61C78.18 1.18 74.51-0.76 72.29 1.99L45.09 35.76C44.56 36.46 44.21 37.16 44.21 37.87Z',
+			height: '0.83em',
+			viewBox: '0 0 147 69'
+		},
+		// `switch.2`
+		controlCenter: {
+			d: 'M21.56 94.88L72.61 94.88C84.63 94.88 94.21 86.42 94.21 74.13C94.21 61.84 84.63 53.38 72.61 53.38L21.56 53.38C9.53 53.38 0 61.84 0 74.13C0 86.42 9.53 94.88 21.56 94.88ZM58.69 86.13C51.82 86.13 46.28 81.23 46.28 74.08C46.28 66.97 51.82 62.07 58.69 62.07L73.46 62.07C80.38 62.07 85.87 66.97 85.87 74.12C85.87 81.23 80.38 86.13 73.46 86.13ZM23.69 45.88L70.48 45.88C83.83 45.88 94.21 36.63 94.21 22.94C94.21 9.25 83.83 0 70.48 0L23.69 0C10.38 0 0 9.25 0 22.94C0 36.63 10.38 45.88 23.69 45.88ZM23.69 37.1C15.53 37.1 9.07 31.43 9.07 22.94C9.07 14.45 15.53 8.78 23.69 8.78L70.48 8.78C78.67 8.78 85.1 14.46 85.1 22.94C85.1 31.42 78.67 37.1 70.48 37.1ZM23.69 33.91L37.69 33.91C43.95 33.91 49.03 29.45 49.03 22.94C49.03 16.39 43.95 11.92 37.69 11.92L23.69 11.92C17.42 11.92 12.35 16.39 12.35 22.9C12.35 29.45 17.42 33.91 23.69 33.91Z',
+			height: '1.15em',
+			viewBox: '0 0 95 96'
+		},
+		// `speaker.wave.2.fill`
+		sound: {
+			d: 'M96.57 78.34C98.77 79.72 101.46 79.24 102.97 76.99C109.33 68.04 113.04 55.99 113.04 43.65C113.04 31.31 109.37 19.18 102.97 10.32C101.46 8.06 98.77 7.58 96.57 8.96C94.27 10.41 93.92 13.25 95.62 15.81C100.87 23.4 103.82 33.35 103.82 43.65C103.82 53.96 100.78 63.86 95.62 71.5C93.96 74.05 94.27 76.9 96.57 78.34ZM77.07 65.33C79.13 66.65 81.83 66.2 83.32 64.07C87.23 58.81 89.59 51.38 89.59 43.65C89.59 35.92 87.23 28.53 83.32 23.22C81.83 21.1 79.13 20.66 77.07 22.02C74.74 23.58 74.28 26.42 76.15 29.17C78.87 32.99 80.36 38.19 80.36 43.65C80.36 49.11 78.83 54.28 76.15 58.14C74.32 60.93 74.74 63.72 77.07 65.33ZM53.42 87.37C57.02 87.37 59.7 84.7 59.7 81.08L59.7 6.55C59.7 2.97 57.02 0.05 53.33 0.05C50.86 0.05 49.1 1.08 46.4 3.61L25.96 22.73C25.68 23.01 25.3 23.18 24.87 23.18L11.03 23.18C3.89 23.18 0 27.13 0 34.71L0 52.83C0 60.36 3.89 64.35 11.03 64.35L24.86 64.35C25.29 64.35 25.67 64.47 25.95 64.75L46.4 84.06C48.87 86.35 50.91 87.37 53.42 87.37Z',
+			height: '1.06em',
+			viewBox: '0 0 114 88'
+		},
+		// `magnifyingglass`
+		spotlight: {
+			d: 'M0 39.74C0 61.68 17.81 79.45 39.75 79.45C47.88 79.45 55.36 76.97 61.6 72.72L84.03 95.21C85.46 96.6 87.32 97.27 89.24 97.27C93.38 97.27 96.38 94.12 96.38 90.03C96.38 88.1 95.65 86.31 94.36 84.93L72.05 62.58C76.72 56.16 79.45 48.29 79.45 39.74C79.45 17.81 61.68 0 39.75 0C17.81 0 0 17.81 0 39.74ZM10.16 39.74C10.16 23.4 23.4 10.16 39.75 10.16C56.06 10.16 69.33 23.4 69.33 39.74C69.33 56.05 56.06 69.33 39.75 69.33C23.4 69.33 10.16 56.05 10.16 39.74Z',
+			height: '1.18em',
+			viewBox: '0 0 97 98'
+		},
+		// `wifi`
+		wifi: {
+			d: 'M2.47 31.72C5.39 34.67 9.81 34.17 13.45 30.93C24.88 20.73 39.15 15.42 55.02 15.42C70.85 15.42 85.21 20.82 96.6 30.93C100.18 34.17 104.61 34.59 107.58 31.67C110.56 28.64 110.92 24.12 107.9 20.98C95.65 8.52 75.64 0 55.02 0C34.41 0 14.35 8.56 2.15 21.02C-0.91 24.12-0.56 28.64 2.47 31.72ZM22.5 51.75C25.94 55.08 30.17 54.38 33.65 51.59C39.5 47.02 47.21 44.02 55.02 44.08C62.82 44.02 70.55 47.07 76.4 51.63C79.86 54.39 84.23 54.95 87.59 51.67C90.74 48.52 91.24 43.63 87.83 40.6C79.85 33.6 67.95 28.81 55.02 28.81C42.05 28.81 30.14 33.6 22.22 40.6C19.15 43.33 18.79 48.04 22.5 51.75ZM49.69 78.8C53.17 82.07 56.79 82.07 60.28 78.8L67.32 72.05C70.78 68.7 71.52 64.55 67.65 61.6C64.22 59.05 59.78 57.38 55.03 57.38C50.21 57.38 45.8 59.04 42.4 61.65C38.53 64.55 39.3 68.76 42.76 72.06Z',
+			height: '1em',
+			viewBox: '0 0 110 83'
+		}
+	};
+
+	export type MacStatusIconName = keyof typeof icons;
+</script>
+
+<script lang="ts">
+	interface Props {
+		name: MacStatusIconName;
+	}
+
+	let { name }: Props = $props();
+
+	const icon = $derived(icons[name]);
+</script>
+
+<svg style:height={icon.height} style:width="auto" fill="currentColor" viewBox={icon.viewBox}>
+	<path d={icon.d} />
+</svg>
diff --git a/ui/apps/chat/.storybook/mockups/MockDesktop.svelte b/ui/apps/chat/.storybook/mockups/MockDesktop.svelte
new file mode 100644
index 000000000..51facca51
--- /dev/null
+++ b/ui/apps/chat/.storybook/mockups/MockDesktop.svelte
@@ -0,0 +1,76 @@
+<!--
+	A crop of a desktop for the OS mockups, laid out at a screen's size (at least width, filling a wider frame) and
+	scaled down to fit a narrower one, like a screenshot: the wallpaper llama.app's site uses for its menu bar picture
+	(ggml-org/llama-pages), a clear daytime sky in light, the same sky at night in dark, with the mockup laid on it.
+	align puts the mockup at the top (a menu bar), at the bottom (a Dock, a taskbar), in the middle, or splits it, the
+	first at the top and the last at the bottom (a menu bar over a Dock).
+-->
+<script lang="ts">
+	import type { Snippet } from 'svelte';
+
+	interface Props {
+		align?: 'between' | 'bottom' | 'center' | 'top';
+		children: Snippet;
+		/** the screen's size the mockup is laid out at, in px: it scales down, as a screenshot would, to fit */
+		height?: number;
+		mode?: 'dark' | 'light';
+		width?: number;
+	}
+
+	let { align = 'center', children, height = 192, mode = 'light', width = 960 }: Props = $props();
+
+	// the frame's width: wider than the screen, the screen widens to fill it; narrower, it scales down
+	let fit = $state(0);
+	const scale = $derived(fit ? Math.min(1, fit / width) : 1);
+	const stage = $derived(Math.max(width, fit));
+</script>
+
+<div style:height="{height * scale}px" class="frame" bind:clientWidth={fit}>
+	<div
+		style:width="{stage}px"
+		style:height="{height}px"
+		style:scale
+		class={['desktop', mode, align]}
+	>
+		{@render children()}
+	</div>
+</div>
+
+<style>
+	.frame {
+		overflow: hidden;
+		border-radius: 14px;
+		box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08);
+	}
+	.desktop {
+		display: flex;
+		flex-direction: column;
+		transform-origin: 0 0;
+		color-scheme: light;
+	}
+	.light {
+		background:
+			radial-gradient(ellipse at 15% 10%, #dcecfb 0%, transparent 55%),
+			radial-gradient(ellipse at 90% 95%, #e8f2fc 0%, transparent 50%),
+			linear-gradient(160deg, #c4ddf6 0%, #d0e4f7 55%, #dfecf9 100%);
+	}
+	.dark {
+		background:
+			radial-gradient(ellipse at 15% 10%, #22385c 0%, transparent 55%),
+			radial-gradient(ellipse at 90% 95%, #1e3752 0%, transparent 50%),
+			linear-gradient(160deg, #152238 0%, #172a42 55%, #1a3049 100%);
+		color-scheme: dark;
+	}
+	.top {
+		justify-content: flex-start;
+	}
+	.center {
+		justify-content: center;
+	}
+	.bottom {
+		justify-content: flex-end;
+	}
+	.between {
+		justify-content: space-between;
+	}
+</style>
diff --git a/ui/apps/chat/.storybook/mockups/WindowsTaskbar.svelte b/ui/apps/chat/.storybook/mockups/WindowsTaskbar.svelte
new file mode 100644
index 000000000..dc2e8afdf
--- /dev/null
+++ b/ui/apps/chat/.storybook/mockups/WindowsTaskbar.svelte
@@ -0,0 +1,234 @@
+<!--
+	A Windows 11 taskbar, for picturing an app on it: the full-width bar in its translucent material, the start button,
+	the search box and the pinned apps centred (a short underline under the running ones, a longer one in the accent
+	colour under the active one), and the tray on the right: the hidden icons' chevron, the app's tray icon, network,
+	sound and battery, and the two-line clock. The other apps are neutral placeholders (plain tiles with a Lucide
+	glyph), so the one shown is the only real icon. Set in Segoe UI where there is one. Lay it on MockDesktop.
+-->
+<script lang="ts" module>
+	import {
+		BatteryCharging,
+		ChevronUp,
+		Folder,
+		Globe,
+		Mail,
+		Search,
+		Settings,
+		Volume2,
+		Wifi
+	} from '@lucide/svelte';
+	import type { Component } from 'svelte';
+
+	export interface TaskbarApp {
+		/** the active app: its window is in front */
+		active?: boolean;
+		/** a placeholder's tile colour and glyph */
+		color?: string;
+		glyph?: Component;
+		/** an app's real taskbar icon */
+		icon?: string;
+		name: string;
+		running?: boolean;
+	}
+
+	export const PLACEHOLDERS: TaskbarApp[] = [
+		{ color: '#f2b84b', glyph: Folder, name: 'Files', running: true },
+		{ color: '#3a8ee6', glyph: Globe, name: 'Browser', running: true },
+		{ color: '#4b7bec', glyph: Mail, name: 'Mail' },
+		{ color: '#7d828c', glyph: Settings, name: 'Settings' }
+	];
+</script>
+
+<script lang="ts">
+	interface Props {
+		/** the pinned apps, after the start button and the search box */
+		apps?: TaskbarApp[];
+		clock?: [string, string];
+		mode?: 'dark' | 'light';
+		/** the app's tray icon: a glyph's paths and viewBox, drawn in the taskbar's ink */
+		trayIcon?: { paths: string[]; viewBox: string };
+	}
+
+	let {
+		apps = PLACEHOLDERS,
+		clock = ['10:24 AM', '9/23/2026'],
+		mode = 'light',
+		trayIcon
+	}: Props = $props();
+</script>
+
+<div aria-hidden="true" class={['taskbar', mode]}>
+	<div class="centre">
+		<!-- the start button: a plain four-pane glyph -->
+		<span class="button">
+			<svg class="start" viewBox="0 0 24 24">
+				<rect height="10.5" rx="1.5" width="10.5" x="1.5" y="1.5" />
+				<rect height="10.5" rx="1.5" width="10.5" x="12.75" y="1.5" />
+				<rect height="10.5" rx="1.5" width="10.5" x="1.5" y="12.75" />
+				<rect height="10.5" rx="1.5" width="10.5" x="12.75" y="12.75" />
+			</svg>
+		</span>
+
+		<span class="search"><Search size={16} strokeWidth={1.75} />Search</span>
+
+		{#each apps as app (app.name)}
+			{@const Glyph = app.glyph ?? Folder}
+			<span class={['button', app.active && 'active']}>
+				{#if app.icon}
+					<img alt={app.name} src={app.icon} />
+				{:else}
+					<span style:background={app.color} class="tile"><Glyph size={15} strokeWidth={2} /></span>
+				{/if}
+
+				{#if app.running || app.active}<span class="underline"></span>{/if}
+			</span>
+		{/each}
+	</div>
+
+	<div class="tray">
+		<span class="tray-button"><ChevronUp size={16} strokeWidth={1.75} /></span>
+
+		{#if trayIcon}
+			<span class="tray-button">
+				<svg class="tray-icon" fill="currentColor" viewBox={trayIcon.viewBox}>
+					{#each trayIcon.paths as d (d)}<path {d} />{/each}
+				</svg>
+			</span>
+		{/if}
+
+		<span class="tray-button system">
+			<Wifi size={16} strokeWidth={1.75} />
+			<Volume2 size={16} strokeWidth={1.75} />
+			<BatteryCharging size={16} strokeWidth={1.75} />
+		</span>
+
+		<span class="clock"><span>{clock[0]}</span><span>{clock[1]}</span></span>
+	</div>
+</div>
+
+<style>
+	.taskbar {
+		position: relative;
+		display: flex;
+		align-items: center;
+		justify-content: flex-end;
+		height: 48px;
+		padding: 0 8px;
+		border-top: 1px solid rgb(0 0 0 / 0.08);
+		background: rgb(238 242 247 / 0.82);
+		backdrop-filter: blur(30px) saturate(1.4);
+		color: rgb(0 0 0 / 0.9);
+		font:
+			400 12px / 1.35 'Segoe UI Variable Text',
+			'Segoe UI',
+			system-ui,
+			sans-serif;
+	}
+	.dark {
+		border-top-color: rgb(255 255 255 / 0.08);
+		background: rgb(28 32 40 / 0.82);
+		color: rgb(255 255 255 / 0.92);
+	}
+	.centre {
+		position: absolute;
+		left: 50%;
+		display: flex;
+		align-items: center;
+		gap: 4px;
+		translate: -50%;
+	}
+	.button {
+		position: relative;
+		display: grid;
+		place-items: center;
+		width: 40px;
+		height: 40px;
+		border-radius: 6px;
+	}
+	.active {
+		background: rgb(255 255 255 / 0.6);
+		box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.05);
+	}
+	.dark .active {
+		background: rgb(255 255 255 / 0.08);
+		box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.05);
+	}
+	.start {
+		width: 22px;
+		height: 22px;
+		fill: #2f7de1;
+	}
+	.dark .start {
+		fill: #5aa6ff;
+	}
+	.search {
+		display: flex;
+		align-items: center;
+		gap: 8px;
+		width: 168px;
+		height: 32px;
+		margin: 0 4px;
+		padding: 0 12px;
+		border: 1px solid rgb(0 0 0 / 0.06);
+		border-radius: 16px;
+		background: rgb(255 255 255 / 0.75);
+		color: rgb(0 0 0 / 0.55);
+	}
+	.dark .search {
+		border-color: rgb(255 255 255 / 0.06);
+		background: rgb(255 255 255 / 0.06);
+		color: rgb(255 255 255 / 0.6);
+	}
+	.button img,
+	.tile {
+		width: 24px;
+		height: 24px;
+		border-radius: 5px;
+	}
+	.tile {
+		display: grid;
+		place-items: center;
+		color: white;
+	}
+	.underline {
+		position: absolute;
+		bottom: 1px;
+		width: 6px;
+		height: 3px;
+		border-radius: 2px;
+		background: rgb(0 0 0 / 0.4);
+	}
+	.dark .underline {
+		background: rgb(255 255 255 / 0.5);
+	}
+	.active .underline {
+		width: 16px;
+		background: #2f7de1;
+	}
+	.dark .active .underline {
+		background: #5aa6ff;
+	}
+	.tray {
+		display: flex;
+		align-items: center;
+		gap: 2px;
+	}
+	.tray-button {
+		display: flex;
+		align-items: center;
+		gap: 10px;
+		height: 40px;
+		padding: 0 8px;
+		border-radius: 6px;
+	}
+	.tray-icon {
+		width: 16px;
+		height: 16px;
+	}
+	.clock {
+		display: flex;
+		flex-direction: column;
+		align-items: flex-end;
+		padding: 0 8px;
+	}
+</style>
diff --git a/ui/apps/chat/.storybook/mockups/index.ts b/ui/apps/chat/.storybook/mockups/index.ts
new file mode 100644
index 000000000..c4783bde1
--- /dev/null
+++ b/ui/apps/chat/.storybook/mockups/index.ts
@@ -0,0 +1,15 @@
+// OS mockups for the stories: a desktop's wallpaper, and on it the macOS Dock and menu bar or the Windows taskbar,
+// to picture the brand's icons where the apps put them
+export {
+	default as MacDock,
+	PLACEHOLDERS as MAC_DOCK_PLACEHOLDERS,
+	type DockApp
+} from './MacDock.svelte';
+export { default as MacMenuBar } from './MacMenuBar.svelte';
+export { default as MacStatusIcon } from './MacStatusIcon.svelte';
+export { default as MockDesktop } from './MockDesktop.svelte';
+export {
+	default as WindowsTaskbar,
+	PLACEHOLDERS as WINDOWS_TASKBAR_PLACEHOLDERS,
+	type TaskbarApp
+} from './WindowsTaskbar.svelte';
diff --git a/ui/apps/chat/.storybook/preview.ts b/ui/apps/chat/.storybook/preview.ts
index c26ceaec6..671aa2f95 100644
--- a/ui/apps/chat/.storybook/preview.ts
+++ b/ui/apps/chat/.storybook/preview.ts
@@ -1,8 +1,16 @@
 import '../src/app.css';
+import { MEDIA_QUERIES } from '#lib/constants/pwa.constants.ts';
+import { SurfaceTheme } from '#lib/enums/ui.enums.ts';
+import { applySurfaceTheme } from '#lib/utils/css.ts';
+import './docs.css';
+import { applyColorScheme } from './color-scheme';
 import ModeWatcherDecorator from './decorators/ModeWatcherDecorator.svelte';
 import TooltipProviderDecorator from './decorators/TooltipProviderDecorator.svelte';
 import type { Preview } from '@storybook/sveltekit';

+applyColorScheme();
+window.matchMedia(MEDIA_QUERIES.PREFERS_DARK).addEventListener('change', applyColorScheme);
+
 const preview: Preview = {
 	parameters: {
 		controls: {
@@ -16,6 +24,57 @@ const preview: Preview = {
 			disabled: true
 		},

+		options: {
+			// sidebar sections: the introduction and the guidelines for agents, then the two layers as the code has them.
+			// Llama UI is the library (ui/lib/ui): its foundations, base components, app components, Model UI and mockups.
+			// Llama Chat is the app (ui/apps/chat): its own foundations, then one folder per src/lib/components/app/<area>,
+			// the full chat screen leading Chat. The brand and communications are in llama-brand's Storybook
+			storySort: {
+				order: [
+					'Introduction',
+					'Agents',
+					['Design guidelines'],
+					'Llama UI',
+					[
+						'Foundations',
+						['Colors', 'Typography', 'Sizing', 'Shapes', 'Elevation', 'Surfaces'],
+						'Components',
+						['Actions', 'Forms', 'Display', 'Overlays', 'Navigation'],
+						'App components',
+						'Models',
+						'Mockups'
+					],
+					'Llama Chat',
+					[
+						'Foundations',
+						['Safe areas', 'Brand'],
+						'Chat',
+						[
+							'ChatScreen',
+							['ChatScreen', '*'],
+							'ChatForm',
+							'ChatMessages',
+							'ChatAttachments',
+							'ChatTabs'
+						],
+						'Content',
+						'Models',
+						'MCP',
+						'Navigation',
+						'Settings',
+						['DialogSettingsChat', 'Navigation', 'Sections'],
+						'Dialogs',
+						'Forms',
+						'Actions',
+						'Badges',
+						'Misc',
+						'Servers',
+						'PWA'
+					]
+				]
+			}
+		},
+
 		a11y: {
 			// 'todo' - show a11y violations in the test UI only
 			// 'error' - fail CI on a11y violations
@@ -23,11 +82,50 @@ const preview: Preview = {
 			test: 'todo'
 		}
 	},
+	// read by tests/stories/pace.ts; the test runner always plays at full speed
+	globalTypes: {
+		interactionPace: {
+			description: 'Speed of the interactions a story plays',
+			toolbar: {
+				dynamicTitle: true,
+				icon: 'timer',
+				items: [
+					{ title: 'Human pace', value: 'human' },
+					{ title: 'Instant', value: 'instant' }
+				],
+				title: 'Interaction pace'
+			}
+		},
+		// the light surface theme: Paper (white panels on a grey page) or Matte (grey glass on white)
+		surface: {
+			description: 'Light surface theme',
+			toolbar: {
+				dynamicTitle: true,
+				icon: 'paintbrush',
+				items: [
+					{ title: 'Paper', value: SurfaceTheme.PAPER },
+					{ title: 'Matte', value: SurfaceTheme.MATTE }
+				],
+				title: 'Surface'
+			}
+		}
+	},
+	initialGlobals: {
+		interactionPace: 'human',
+		surface: SurfaceTheme.PAPER
+	},
 	decorators: [
-		(story) => ({
+		(story, context) => {
+			applySurfaceTheme(context.globals.surface);
+
+			return story();
+		},
+		// `parameters.colorScheme` fixes a story to light or dark, whatever the viewer chose (a scene in a store screenshot)
+		(story, context) => ({
 			Component: ModeWatcherDecorator,
 			props: {
-				children: story
+				children: story,
+				forced: context.parameters.colorScheme
 			}
 		}),
 		(story) => ({
diff --git a/ui/apps/chat/AGENTS.md b/ui/apps/chat/AGENTS.md
index efb369e1a..c4c0a0f3c 100644
--- a/ui/apps/chat/AGENTS.md
+++ b/ui/apps/chat/AGENTS.md
@@ -1,6 +1,22 @@
 # Instructions for ui/apps/chat

-These add to the repository's [AGENTS.md](../../../AGENTS.md) for work in `ui/apps/chat`: **Llama Chat**, the chat client that llama-server bundles. **Llama UI**, the library, is `ui/lib/ui` (`@ggml-org/llama-ui`): Chat imports its tokens, fonts and base components from there (`@ggml-org/llama-ui/ui/<name>`) and keeps no copy of them. `DESIGN.md` lives here.
+These add to the repository's [AGENTS.md](../../../AGENTS.md) for work in `ui/apps/chat`: **Llama Chat**, the chat client that llama-server bundles. **Llama UI**, the library, is `ui/lib/ui` (`@ggml-org/llama-ui`): Chat imports its tokens, fonts and base components from there (`@ggml-org/llama-ui/ui/<name>`) and keeps no copy of them. `DESIGN.md` and the Storybook live here; the brand book, `BRAND.md`, and the brand and communications pages are in [ggml-org/llama-brand](https://github.com/ggml-org/llama-brand), with their own Storybook.

 - **Design:** [DESIGN.md](DESIGN.md) holds the tokens, roles and rules, written for agents. Follow it for anything visual; when it and the CSS disagree, the CSS wins and DESIGN.md is updated.
+- **Stories:** a story lives with the code it shows. Llama UI's (its foundations, base components, app components and Model UI) are in `ui/lib/ui/tests/stories`, titled `Llama UI/...`, and run as the library's tests; this app's Storybook shows them too. Llama Chat's are in `tests/stories/<area>`, one folder per `src/lib/components/app/<area>` (`chat/` has one per Chat folder), titled `Llama Chat/<Area>/<Component>`. An accessibility story sits next to its component's, as `<Component>.a11y.stories.svelte`, titled `.../<Component>/Accessibility`.
 - **Components:** the `SKILL.md` next to a component folder (such as [src/lib/components/app/SKILL.md](src/lib/components/app/SKILL.md)) holds that folder's conventions.
+
+## Content is Markdown, custom pieces are Svelte: .svx
+
+Anything that is mostly content (a doc, an overview, a showcase or a Storybook page with prose) is written in Markdown, and whatever Markdown cannot express (a live example, a diagram, a real component) is a Svelte component placed in it. Together that is a `.svx` page, compiled by [mdsvex](https://mdsvex.pngwk.com).
+
+- Write the prose as plain Markdown, so it reads well as source, for people and for agents alike.
+- Put each custom piece in its own `.svelte` file and import it in the page's `<script>`. Keep logic and styles out of the `.svx` file.
+- Frame the page with a Svelte component that sets its typography, and show it in Storybook as a fullscreen story, as `introduction/Introduction.stories.svelte` does. Storybook's MDX is rendered with React and cannot hold Svelte components, so use MDX only for pages that are Markdown alone, such as Design guidelines.
+- Do not add another Markdown-to-HTML pipeline. Content goes through mdsvex; user and assistant messages go through `MarkdownContent`.
+
+### mdsvex versions
+
+- `ui/apps/chat` is on mdsvex `0.12.7`, which only Storybook's `.svx` pages use. llama-brand's Storybook pages, the logo showcase and the type specimen among them, are on `1.0.0-next.3`.
+- mdsvex 1.0 is the direction. Move `ui/apps/chat` to it, pinned to an exact `next` version, while it only serves Storybook pages; write new `.svx` pages so they work on both.
+- Messages: 1.0's `@mdsvex/render` can render a document as it streams in (`@mdsvex/render/stream`) and as Svelte (`Node.svelte`). The plan is to swap the unified/remark/rehype pipeline inside `MarkdownContent` for it, keeping `MarkdownContent`'s API, so chat messages, the live-preview Markdown editor and the Notebook (which all render through `MarkdownContent`) switch together. Check parity first: GFM, math, Mermaid, the safe-HTML config, file-mention badges and the code-block actions, plus bundle size and streaming performance.
diff --git a/ui/apps/chat/DESIGN.md b/ui/apps/chat/DESIGN.md
index c91d011bb..708a656d5 100644
--- a/ui/apps/chat/DESIGN.md
+++ b/ui/apps/chat/DESIGN.md
@@ -758,7 +758,8 @@ This file is the how, written for agents first. Its principles, as rules to appl
 - **Recognisable, easy to change.** Keep the character in the icon, the type and one
   accent, so an app built on Llama UI can restyle it through component tokens alone.
 - **Design lives in code.** The CSS is the source of truth; prefer what is generated or
-  derived over hand-tuned values, and record the reason next to the value.
+  derived over hand-tuned values, and record the reason next to the value. Content pages are
+  Markdown with Svelte components in them, as `.svx` (see `AGENTS.md`).
 - **Reuse before adding.** An existing role before a new token, an existing component before
   a new one.

@@ -778,7 +779,8 @@ Design tokens come in three tiers, each in its own file under `ui/lib/ui/src/lib
    them as `bg-(--button-primary-background)` and similar.

 The front matter of this file mirrors those three files. When they disagree, the CSS wins
-and this file should be updated to match.
+and this file should be updated to match. Storybook shows every tier under **Llama UI ›
+Foundations › Colors**.

 Light mode is the base. A semantic token whose dark value differs has a `-dark` twin here,
 and components list a `-dark` entry wherever their colours change. Translucent component
@@ -808,7 +810,8 @@ cinder, the accent orange; never from the status colours, and never red.
 Light mode has two surface themes, which share everything else (the palette, buttons, fields,
 badges, shadows and dark mode): **Paper**, the default, sets white panels, fields and keys on a
 faint grey page (`neutral-25`); **Matte** sets grey glass on a white page. Matte is the
-`theme-matte` class on `<html>`, chosen with the Light surfaces setting (Settings → General), and only its surface tokens differ: `surface-page`,
+`theme-matte` class on `<html>`, chosen with the Light surfaces setting (Settings → General) or
+the Surface switch in Storybook's toolbar, and only its surface tokens differ: `surface-page`,
 `surface-glass`, `surface-code`, `field-background` and `float-panel-background-modal`.

 - **Surfaces:** `surface-page` for the page, `surface-muted` for quiet panels,
@@ -916,7 +919,8 @@ layout: solid behind the status bar and the row of corner controls under it, fad
 instead of colliding with the clock or the chat's header. A route needs no fade of its own;
 what covers the whole screen, like the expanded chat form, hides it, and it fades out as the
 page slides aside for the sidebar. Check
-pinned content with the insets simulated, since they are 0 in a desktop browser.
+pinned content with the insets simulated (the Safe areas page in
+Storybook does this), since they are 0 in a desktop browser.

 ## Elevation & Depth

diff --git a/ui/apps/chat/src/app.css b/ui/apps/chat/src/app.css
index 9b7d1aeb6..4c7fd9016 100644
--- a/ui/apps/chat/src/app.css
+++ b/ui/apps/chat/src/app.css
@@ -1,7 +1,9 @@
 @import 'tailwindcss';
 @source '.';
-/* stories may use classes the app does not, so tailwind scans them too */
+/* stories may use classes the app does not, so tailwind scans them too: the app's and Llama UI's,
+   which this Storybook shows as well */
 @source '../tests/stories';
+@source '../../../lib/ui/tests/stories';
 @plugin '@tailwindcss/forms';
 @plugin '@tailwindcss/typography';
 @import 'tw-animate-css';
diff --git a/ui/apps/chat/tests/stories/ChatFormSingleRow.stories.svelte b/ui/apps/chat/tests/stories/ChatFormSingleRow.stories.svelte
deleted file mode 100644
index d2879c6fc..000000000
--- a/ui/apps/chat/tests/stories/ChatFormSingleRow.stories.svelte
+++ /dev/null
@@ -1,51 +0,0 @@
-<script lang="ts" module>
-	import Preview from './fixtures/ChatFormSingleRowPreview.svelte';
-	import { defineMeta } from '@storybook/addon-svelte-csf';
-
-	const { Story } = defineMeta({
-		parameters: {
-			layout: 'centered'
-		},
-		title: 'Scrapbook/ChatForm single row'
-	});
-
-	const SHORT = 'What is the meaning of life?';
-	const TWO_LINES = 'What is the meaning of life?\nAnswer in one sentence.';
-
-	// the default is --chat-form-single-row-radius in app.css; the card is about 3.375rem tall
-	const RADII = [
-		['2rem', 'a pill (2rem)'],
-		['1.5rem', '1.5rem, like the two-row form on a desktop'],
-		['1.25rem', '1.25rem (the default)'],
-		['1rem', '1rem'],
-		['0.75rem', '0.75rem']
-	] as const;
-</script>
-
-<Story name="Empty">
-	<Preview />
-</Story>
-
-<Story name="Short text">
-	<Preview initial={SHORT} />
-</Story>
-
-<Story name="Two lines">
-	<Preview initial={TWO_LINES} />
-</Story>
-
-<Story name="Before: two rows">
-	<Preview today />
-</Story>
-
-<Story name="Radius variations">
-	<div class="flex flex-col gap-6">
-		{#each RADII as [radius, label] (radius)}
-			<div class="flex flex-col gap-1.5">
-				<span class="text-xs text-muted-foreground">{label}</span>
-
-				<Preview initial={SHORT} {radius} />
-			</div>
-		{/each}
-	</div>
-</Story>
diff --git a/ui/apps/chat/tests/stories/ChatMessage.stories.svelte b/ui/apps/chat/tests/stories/ChatMessage.stories.svelte
deleted file mode 100644
index ff9518a70..000000000
--- a/ui/apps/chat/tests/stories/ChatMessage.stories.svelte
+++ /dev/null
@@ -1,416 +0,0 @@
-<script lang="ts" module>
-	import { JOKES_TABLE_MD, WIDE_CELL_TABLE_MD } from './fixtures/mobile-tables.js';
-	import { defineMeta } from '@storybook/addon-svelte-csf';
-	import ChatMessage from '#lib/components/app/chat/ChatMessages/ChatMessage/ChatMessage.svelte';
-	import type { ChatMessageActions } from '#lib/types/index.ts';
-
-	const { Story } = defineMeta({
-		component: ChatMessage,
-		parameters: {
-			layout: 'centered'
-		},
-		title: 'Components/ChatScreen/ChatMessage'
-	});
-
-	const chatActions: ChatMessageActions = {
-		continueAssistantMessage: () => {},
-		copy: () => {},
-		delete: () => {},
-		editUserMessagePreserveResponses: () => {},
-		editWithBranching: () => {},
-		editWithReplacement: () => {},
-		forkConversation: () => {},
-		navigateToSibling: () => {},
-		regenerateCompaction: () => {},
-		regenerateWithBranching: () => {}
-	};
-
-	// Mock messages for different scenarios
-	const userMessage: DatabaseMessage = {
-		children: [],
-		content: 'What is the meaning of life, the universe, and everything?',
-		convId: 'conv-1',
-		id: '1',
-		parent: '',
-		role: 'user',
-		thinking: '',
-		timestamp: Date.now() - 1000 * 60 * 5,
-		type: 'message'
-	};
-
-	const assistantMessage: DatabaseMessage = {
-		children: [],
-		content:
-			'The answer to the ultimate question of life, the universe, and everything is **42**.\n\nThis comes from Douglas Adams\' "The Hitchhiker\'s Guide to the Galaxy," where a supercomputer named Deep Thought calculated this answer over 7.5 million years. However, the question itself was never properly formulated, which is why the answer seems meaningless without context.',
-		convId: 'conv-1',
-		id: '2',
-		parent: '1',
-		role: 'assistant',
-		thinking: '',
-		timestamp: Date.now() - 1000 * 60 * 3,
-		type: 'message'
-	};
-
-	const assistantWithTable: DatabaseMessage = {
-		children: [],
-		content: `${JOKES_TABLE_MD}\n\n${WIDE_CELL_TABLE_MD}`,
-		convId: 'conv-1',
-		id: '7',
-		parent: '1',
-		role: 'assistant',
-		thinking: '',
-		timestamp: Date.now() - 1000 * 60 * 3,
-		type: 'message'
-	};
-
-	const assistantWithReasoning: DatabaseMessage = {
-		children: [],
-		content: "Here's the concise answer, now that I've thought it through carefully for you.",
-		convId: 'conv-1',
-		id: '3',
-		parent: '1',
-		role: 'assistant',
-		thinking:
-			"Let's consider the user's question step by step:\\n\\n1. Identify the core problem\\n2. Evaluate relevant information\\n3. Formulate a clear answer\\n\\nFollowing this process ensures the final response stays focused and accurate.",
-		timestamp: Date.now() - 1000 * 60 * 2,
-		type: 'message'
-	};
-	const rawOutputMessage: DatabaseMessage = {
-		children: [],
-		content:
-			'<|channel|>analysis<|message|>User greeted me. Initiating overcomplicated analysis: Is this a trap? No, just a normal hello. Respond calmly, act like a helpful assistant, and do not start explaining quantum physics again. Confidence 0.73. Engaging socially acceptable greeting protocol...<|end|>Hello there! How can I help you today?',
-		convId: 'conv-1',
-		id: '6',
-		parent: '1',
-		role: 'assistant',
-		thinking: '',
-		timestamp: Date.now() - 1000 * 60,
-		type: 'message'
-	};
-
-	let processingMessage = $state({
-		children: [],
-		content: '',
-		convId: 'conv-1',
-		id: '4',
-		parent: '1',
-		role: 'assistant',
-		thinking: '',
-		timestamp: 0, // No timestamp = processing
-		type: 'message'
-	});
-
-	const compactionMessage: DatabaseMessage = {
-		children: [],
-		content:
-			'The user asked about the ultimate answer and its origin. Key facts: the answer is **42**, from Douglas Adams\' "The Hitchhiker\'s Guide to the Galaxy", computed by Deep Thought over 7.5 million years.\n\nNothing is left to do unless the user wants the question itself discussed.',
-		convId: 'conv-1',
-		id: '8',
-		// The model the server reports for the summary request.
-		model: 'ggml-org/Qwen3.8-Flash-Next',
-		parent: '1',
-		role: 'user',
-		thinking: '',
-		timestamp: Date.now() - 1000 * 60 * 30,
-		// The pre-encode stamps the reduced prompt on the node; `compaction`
-		// keeps the summary request's own timings for the stats row.
-		timings: {
-			cache_n: 0,
-			compaction: {
-				cache_n: 0,
-				predicted_ms: 12000,
-				predicted_n: 300,
-				prompt_ms: 18200,
-				prompt_n: 42200
-			},
-			predicted_n: 0,
-			prompt_n: 3204
-		},
-		type: 'compaction'
-	};
-
-	// The turn the compaction summarized: its timings are the context size
-	// the node's toggle reports as the "before" number.
-	const preCompactionAssistant: DatabaseMessage = {
-		children: [],
-		content: 'Deep Thought took 7.5 million years to answer.',
-		convId: 'conv-1',
-		id: '7',
-		parent: '1',
-		role: 'assistant',
-		thinking: '',
-		timestamp: Date.now() - 1000 * 60 * 31,
-		timings: { cache_n: 0, predicted_n: 118, prompt_n: 42200 },
-		type: 'message'
-	};
-
-	const compactionPendingMessage: DatabaseMessage = {
-		children: [],
-		content: '',
-		convId: 'conv-1',
-		id: '9',
-		parent: '1',
-		role: 'user',
-		thinking: '',
-		timestamp: Date.now() - 1000 * 60 * 29,
-		type: 'compaction'
-	};
-
-	// The same node once the prompt is through and the summary is streaming.
-	const compactionGeneratingMessage: DatabaseMessage = {
-		children: [],
-		content:
-			'The user asked about the ultimate answer and its origin. Key facts: the answer is **42**',
-		convId: 'conv-1',
-		id: '10',
-		model: 'ggml-org/Qwen3.8-Flash-Next',
-		parent: '1',
-		role: 'user',
-		thinking: '',
-		timestamp: Date.now() - 1000 * 60 * 29,
-		type: 'compaction'
-	};
-
-	let streamingMessage = $state({
-		children: [],
-		content: '',
-		convId: 'conv-1',
-		id: '5',
-		parent: '1',
-		role: 'assistant',
-		thinking: '',
-		timestamp: 0, // No timestamp = streaming
-		type: 'message'
-	});
-</script>
-
-<Story
-	args={{
-		message: userMessage
-	}}
-	name="User"
-	play={async () => {
-		const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts');
-
-		settingsStore.updateConfig('showRawOutputSwitch', false);
-	}}
-/>
-
-<Story
-	args={{
-		class: 'max-w-[56rem] w-[calc(100vw-2rem)]',
-		message: assistantMessage
-	}}
-	name="Assistant"
-	play={async () => {
-		const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts');
-
-		settingsStore.updateConfig('showRawOutputSwitch', false);
-	}}
-/>
-
-<Story
-	args={{
-		class: 'max-w-[56rem] w-[calc(100vw-2rem)]',
-		message: assistantWithTable
-	}}
-	name="AssistantWithTable"
-	play={async () => {
-		const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts');
-
-		settingsStore.updateConfig('showRawOutputSwitch', false);
-	}}
-/>
-
-<Story
-	args={{
-		class: 'max-w-[56rem] w-[calc(100vw-2rem)]',
-		message: assistantWithReasoning
-	}}
-	name="AssistantWithReasoning"
-	play={async () => {
-		const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts');
-
-		settingsStore.updateConfig('showRawOutputSwitch', false);
-	}}
-/>
-
-<Story
-	args={{
-		class: 'max-w-[56rem] w-[calc(100vw-2rem)]',
-		message: rawOutputMessage
-	}}
-	name="RawLlmOutput"
-	play={async () => {
-		const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts');
-
-		settingsStore.updateConfig('showRawOutputSwitch', true);
-	}}
-/>
-
-<Story
-	args={{
-		class: 'max-w-[56rem] w-[calc(100vw-2rem)]',
-		message: compactionMessage
-	}}
-	name="Compaction"
-	play={async () => {
-		const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts');
-		const { conversationsStore } = await import('#lib/stores/conversations/index.svelte.ts');
-
-		settingsStore.updateConfig('showMessageStats', true);
-		settingsStore.updateConfig('showRawOutputSwitch', false);
-		// The toggle reads the before size from the branch, so the story needs
-		// the summarized turn in the active message list.
-		conversationsStore.activeMessages = [preCompactionAssistant, compactionMessage];
-	}}
-/>
-
-<Story
-	args={{
-		class: 'max-w-[56rem] w-[calc(100vw-2rem)]',
-		message: compactionPendingMessage
-	}}
-	name="CompactionPrefill"
-	play={async () => {
-		const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts');
-		const { chatActivityStore } = await import('#lib/stores/chat/activity.svelte.ts');
-		const { chatStore } = await import('#lib/stores/chat/index.svelte.ts');
-
-		settingsStore.updateConfig('showRawOutputSwitch', false);
-
-		// The summary request reports its prompt progress through the shared
-		// processing state; seed one so the story shows the prefill detail.
-		chatActivityStore.markCompacting('conv-1', compactionPendingMessage.id);
-		chatStore.processing.setActiveConversation('conv-1');
-		chatStore.processing.setState('conv-1', {
-			contextTotal: 32768,
-			contextUsed: 10000,
-			hasNextToken: false,
-			outputTokensMax: -1,
-			outputTokensUsed: 0,
-			progressPercent: 42,
-			promptProgress: { cache: 0, processed: 4200, time_ms: 6000, total: 10000 },
-			promptTokens: 0,
-			speculative: false,
-			status: 'preparing',
-			temperature: 0.8,
-			tokensDecoded: 0,
-			tokensPerSecond: 0,
-			tokensRemaining: -1,
-			topP: 0.95
-		});
-	}}
-/>
-
-<Story
-	args={{
-		class: 'max-w-[56rem] w-[calc(100vw-2rem)]',
-		message: compactionGeneratingMessage
-	}}
-	name="CompactionGenerating"
-	play={async () => {
-		const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts');
-		const { chatActivityStore } = await import('#lib/stores/chat/activity.svelte.ts');
-		const { chatStore } = await import('#lib/stores/chat/index.svelte.ts');
-
-		settingsStore.updateConfig('showRawOutputSwitch', false);
-
-		// Prompt processing is over, so only the generated tokens are reported.
-		chatActivityStore.markCompacting('conv-1', compactionGeneratingMessage.id);
-		chatStore.processing.setActiveConversation('conv-1');
-		chatStore.processing.setState('conv-1', {
-			contextTotal: 32768,
-			contextUsed: 45200,
-			hasNextToken: true,
-			outputTokensMax: -1,
-			outputTokensUsed: 128,
-			promptTokens: 42200,
-			speculative: false,
-			status: 'generating',
-			temperature: 0.8,
-			tokensDecoded: 128,
-			tokensPerSecond: 25,
-			tokensRemaining: -1,
-			topP: 0.95
-		});
-	}}
-/>
-
-<Story
-	args={{
-		message: streamingMessage
-	}}
-	asChild
-	name="WithReasoningContent"
-	play={async () => {
-		const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts');
-
-		settingsStore.updateConfig('showRawOutputSwitch', false);
-		// Phase 1: Stream reasoning content in chunks
-		let reasoningText =
-			'I need to think about this carefully. Let me break down the problem:\n\n1. The user is asking for help with something complex\n2. I should provide a thorough and helpful response\n3. I need to consider multiple approaches\n4. The best solution would be to explain step by step\n\nThis approach will ensure clarity and understanding.';
-		let reasoningChunk = 'I';
-		let i = 0;
-
-		while (i < reasoningText.length) {
-			const chunkSize = Math.floor(Math.random() * 5) + 3; // Random 3-7 characters
-			const chunk = reasoningText.slice(i, i + chunkSize);
-
-			reasoningChunk += chunk;
-
-			// Update the reactive state directly
-			streamingMessage.thinking = reasoningChunk;
-
-			i += chunkSize;
-			await new Promise((resolve) => setTimeout(resolve, 50));
-		}
-
-		const regularText =
-			"Based on my analysis, here's the solution:\n\n**Step 1:** First, we need to understand the requirements clearly.\n\n**Step 2:** Then we can implement the solution systematically.\n\n**Step 3:** Finally, we test and validate the results.\n\nThis approach ensures we cover all aspects of the problem effectively.";
-
-		let contentChunk = '';
-
-		i = 0;
-
-		while (i < regularText.length) {
-			const chunkSize = Math.floor(Math.random() * 5) + 3; // Random 3-7 characters
-			const chunk = regularText.slice(i, i + chunkSize);
-
-			contentChunk += chunk;
-
-			// Update the reactive state directly
-			streamingMessage.content = contentChunk;
-
-			i += chunkSize;
-			await new Promise((resolve) => setTimeout(resolve, 50));
-		}
-
-		streamingMessage.timestamp = Date.now();
-	}}
->
-	<div class="w-[56rem]">
-		<ChatMessage {chatActions} message={streamingMessage} />
-	</div>
-</Story>
-
-<Story
-	args={{
-		message: processingMessage
-	}}
-	name="Processing"
-	play={async () => {
-		const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts');
-
-		settingsStore.updateConfig('showRawOutputSwitch', false);
-		// Import the chat store to simulate loading state
-		const { chatStore } = await import('#lib/stores/chat/index.svelte.ts');
-
-		// Set loading state to true to trigger the processing UI
-		chatStore.isLoading = true;
-
-		// Simulate the processing state hook behavior
-		// This will show the "Generating..." text and parameter details
-		await new Promise((resolve) => setTimeout(resolve, 100));
-	}}
-/>
diff --git a/ui/apps/chat/tests/stories/ChatScreenForm.stories.svelte b/ui/apps/chat/tests/stories/ChatScreenForm.stories.svelte
deleted file mode 100644
index 1240b595b..000000000
--- a/ui/apps/chat/tests/stories/ChatScreenForm.stories.svelte
+++ /dev/null
@@ -1,95 +0,0 @@
-<script lang="ts" module>
-	import jpgAsset from './fixtures/assets/1.jpg?url';
-	import pdfAsset from './fixtures/assets/example.pdf?raw';
-	import svgAsset from './fixtures/assets/hf-logo.svg?url';
-	import { defineMeta } from '@storybook/addon-svelte-csf';
-	import ChatScreenForm from '#lib/components/app/chat/ChatScreen/ChatScreenForm.svelte';
-	import { expect } from 'storybook/test';
-
-	const { Story } = defineMeta({
-		component: ChatScreenForm,
-		parameters: {
-			layout: 'centered'
-		},
-		title: 'Components/ChatScreen/ChatScreenForm'
-	});
-
-	let fileAttachments = $state([
-		{
-			file: new File([''], '1.jpg', { type: 'image/jpeg' }),
-			id: '1',
-			name: '1.jpg',
-			preview: jpgAsset,
-			size: 44891,
-			type: 'image/jpeg'
-		},
-		{
-			file: new File([''], 'hf-logo.svg', { type: 'image/svg+xml' }),
-			id: '2',
-			name: 'hf-logo.svg',
-			preview: svgAsset,
-			size: 1234,
-			type: 'image/svg+xml'
-		},
-		{
-			file: new File([pdfAsset], 'example.pdf', { type: 'application/pdf' }),
-			id: '3',
-			name: 'example.pdf',
-			size: 351048,
-			type: 'application/pdf'
-		}
-	]);
-</script>
-
-<Story
-	args={{ class: 'max-w-[56rem] w-[calc(100vw-2rem)]' }}
-	name="Default"
-	play={async ({ canvas, userEvent }) => {
-		const editor = await canvas.findByRole('textbox');
-		const submitButton = await canvas.findByRole('button', { name: 'Send' });
-
-		// Expect the input to be focused after the component is mounted
-		await expect(editor).toHaveFocus();
-
-		// Expect the submit button to be disabled
-		await expect(submitButton).toBeDisabled();
-
-		const text = 'What is the meaning of life?';
-
-		await userEvent.clear(editor);
-		await userEvent.type(editor, text);
-
-		await expect(editor).toHaveTextContent(text);
-
-		const fileInput = document.querySelector('input[type="file"]');
-
-		await expect(fileInput).not.toHaveAttribute('accept');
-	}}
-/>
-
-<Story args={{ class: 'max-w-[56rem] w-[calc(100vw-2rem)]', isLoading: true }} name="Loading" />
-
-<Story
-	args={{
-		class: 'max-w-[56rem] w-[calc(100vw-2rem)]',
-		uploadedFiles: fileAttachments
-	}}
-	name="FileAttachments"
-	play={async ({ canvas }) => {
-		const jpgAttachment = canvas.getByAltText('1.jpg');
-		const svgAttachment = canvas.getByAltText('hf-logo.svg');
-		const pdfFileExtension = canvas.getByText('PDF');
-		const pdfAttachment = canvas.getByText('example.pdf');
-		const pdfSize = canvas.getByText('342.82 KB');
-
-		await expect(jpgAttachment).toBeInTheDocument();
-		await expect(jpgAttachment).toHaveAttribute('src', jpgAsset);
-
-		await expect(svgAttachment).toBeInTheDocument();
-		await expect(svgAttachment).toHaveAttribute('src', svgAsset);
-
-		await expect(pdfFileExtension).toBeInTheDocument();
-		await expect(pdfAttachment).toBeInTheDocument();
-		await expect(pdfSize).toBeInTheDocument();
-	}}
-/>
diff --git a/ui/apps/chat/tests/stories/DesignGuidelines.mdx b/ui/apps/chat/tests/stories/DesignGuidelines.mdx
new file mode 100644
index 000000000..d4b35cec5
--- /dev/null
+++ b/ui/apps/chat/tests/stories/DesignGuidelines.mdx
@@ -0,0 +1,30 @@
+import { Markdown, Meta, Source, Unstyled } from '@storybook/addon-docs/blocks';
+import designMd from '../../DESIGN.md?raw';
+
+export const [, tokens, guidelines] = designMd.split(/^---$/m);
+
+<Meta title="Agents/Design guidelines" />
+
+<Unstyled>
+<div className="ds-docs">
+
+# Design guidelines
+
+<div className="callout">
+
+**Written for agents first.** This is the how of Llama UI, in a form an agent can follow when it builds or changes the UI: the tokens, the roles and the rules, precise rather than persuasive. People can read it too.
+
+</div>
+
+Rendered from `ui/apps/chat/DESIGN.md`. The implementation lives in `ui/lib/ui/src/lib/styles`, and every token and surface below can be seen under **Llama UI** in this Storybook. The logo, type and colours are in llama-brand's Storybook.
+
+<Markdown>{guidelines}</Markdown>
+
+## Tokens
+
+The machine-readable half of `ui/apps/chat/DESIGN.md`, in the [DESIGN.md format](https://github.com/google-labs-code/design.md). Check it with `npx @google/design.md lint DESIGN.md`.
+
+<Source code={tokens.trim()} language="yaml" dark />
+
+</div>
+</Unstyled>
diff --git a/ui/apps/chat/tests/stories/Introduction.mdx b/ui/apps/chat/tests/stories/Introduction.mdx
deleted file mode 100644
index 7ee918268..000000000
--- a/ui/apps/chat/tests/stories/Introduction.mdx
+++ /dev/null
@@ -1,44 +0,0 @@
-import { Meta } from '@storybook/addon-docs/blocks';
-
-<Meta title="Introduction" />
-
-# Llama Chat
-
-Welcome to **Llama UI**, the component library of Llama Chat! This Storybook showcases the components used in Llama Chat, the modern web interface for the llama-server.
-
-## 🚀 About This Project
-
-Llama Chat is a modern web interface for the llama-server, built with SvelteKit and ShadCN UI. Features include:
-
-- **Real-time chat conversations** with AI assistants
-- **Multi-conversation management** with persistent storage
-- **Advanced parameter tuning** for model behavior
-- **File upload support** for multimodal interactions
-- **Responsive design** that works on desktop and mobile
-
-## 🎨 Design System
-
-The UI is built using:
-
-- **SvelteKit** - Modern web framework with excellent performance
-- **Tailwind CSS** - Utility-first CSS framework for rapid styling
-- **ShadCN/UI** - High-quality, accessible component library
-- **Lucide Icons** - Beautiful, consistent icon set
-
-## 🔧 Development
-
-This Storybook serves as both documentation and a development environment for the UI components. Each story demonstrates:
-
-- **Component variations** - Different states and configurations
-- **Interactive examples** - Live components you can interact with
-- **Usage patterns** - How components work together
-- **Styling consistency** - Unified design language
-
-## 🚀 Getting Started
-
-To explore the components:
-
-1. **Browse the sidebar** to see all available components
-2. **Click on stories** to see different component states
-3. **Use the controls panel** to interact with component props
-4. **Check the docs tab** for detailed component information
diff --git a/ui/apps/chat/tests/stories/MarkdownContent.stories.svelte b/ui/apps/chat/tests/stories/MarkdownContent.stories.svelte
deleted file mode 100644
index a3d3662f6..000000000
--- a/ui/apps/chat/tests/stories/MarkdownContent.stories.svelte
+++ /dev/null
@@ -1,139 +0,0 @@
-<script lang="ts" module>
-	import { AI_TUTORIAL_MD } from './fixtures/ai-tutorial.js';
-	import { API_DOCS_MD } from './fixtures/api-docs.js';
-	import { BLOG_POST_MD } from './fixtures/blog-post.js';
-	import { DATA_ANALYSIS_MD } from './fixtures/data-analysis.js';
-	import { EMPTY_MD } from './fixtures/empty.js';
-	import { MATH_FORMULAS_MD } from './fixtures/math-formulas.js';
-	import { README_MD } from './fixtures/readme.js';
-	import { defineMeta } from '@storybook/addon-svelte-csf';
-	import { MarkdownContent } from '#lib/components/app/index.ts';
-	import { expect } from 'storybook/test';
-
-	const { Story } = defineMeta({
-		component: MarkdownContent,
-		parameters: {
-			layout: 'centered'
-		},
-		title: 'Components/MarkdownContent'
-	});
-</script>
-
-<Story args={{ class: 'max-w-[56rem] w-[calc(100vw-2rem)]', content: EMPTY_MD }} name="Empty" />
-
-<Story
-	args={{ class: 'max-w-[56rem] w-[calc(100vw-2rem)]', content: AI_TUTORIAL_MD }}
-	name="AI Tutorial"
-/>
-
-<Story
-	args={{ class: 'max-w-[56rem] w-[calc(100vw-2rem)]', content: API_DOCS_MD }}
-	name="API Documentation"
-/>
-
-<Story
-	args={{ class: 'max-w-[56rem] w-[calc(100vw-2rem)]', content: BLOG_POST_MD }}
-	name="Technical Blog"
-/>
-
-<Story
-	args={{ class: 'max-w-[56rem] w-[calc(100vw-2rem)]', content: DATA_ANALYSIS_MD }}
-	name="Data Analysis"
-/>
-
-<Story
-	args={{ class: 'max-w-[56rem] w-[calc(100vw-2rem)]', content: README_MD }}
-	name="README file"
-/>
-
-<Story
-	args={{ class: 'max-w-[56rem] w-[calc(100vw-2rem)]', content: MATH_FORMULAS_MD }}
-	name="Math Formulas"
-/>
-
-<Story
-	args={{
-		class: 'max-w-[56rem] w-[calc(100vw-2rem)]',
-		content: `# URL Links Test
-
-Here are some example URLs that should open in new tabs:
-
-- [Hugging Face Homepage](https://huggingface.co)
-- [GitHub Repository](https://github.com/ggml-org/llama.cpp)
-- [OpenAI Website](https://openai.com)
-- [Google Search](https://www.google.com)
-
-You can also test inline links like https://example.com or https://docs.python.org.
-
-All links should have \`target="_blank"\` and \`rel="noopener noreferrer"\` attributes for security.`
-	}}
-	name="URL Links"
-	play={async (context) => {
-		const { canvasElement } = context;
-
-		// Wait for component to render
-		await new Promise((resolve) => setTimeout(resolve, 100));
-
-		// Find all links in the rendered content
-		const links = (canvasElement as HTMLElement).querySelectorAll(
-			'a[href]'
-		) as NodeListOf<HTMLAnchorElement>;
-		const linkList = Array.from(links) as HTMLAnchorElement[];
-
-		// Test that we have the expected number of links
-		expect(links.length).toBeGreaterThan(0);
-
-		// Test each link for proper attributes
-		links.forEach((link: HTMLAnchorElement) => {
-			const href = link.getAttribute('href');
-
-			// Test that external links have proper security attributes
-			if (href && (href.startsWith('http://') || href.startsWith('https://'))) {
-				expect(link.getAttribute('target')).toBe('_blank');
-				expect(link.getAttribute('rel')).toBe('noopener noreferrer');
-			}
-		});
-
-		// Test specific links exist
-		const hugginFaceLink = linkList.find(
-			(link) => link.getAttribute('href') === 'https://huggingface.co'
-		);
-
-		expect(hugginFaceLink).toBeTruthy();
-		expect(hugginFaceLink?.textContent).toBe('Hugging Face Homepage');
-
-		const githubLink = linkList.find(
-			(link) => link.getAttribute('href') === 'https://github.com/ggml-org/llama.cpp'
-		);
-
-		expect(githubLink).toBeTruthy();
-		expect(githubLink?.textContent).toBe('GitHub Repository');
-
-		const openaiLink = linkList.find((link) => link.getAttribute('href') === 'https://openai.com');
-
-		expect(openaiLink).toBeTruthy();
-		expect(openaiLink?.textContent).toBe('OpenAI Website');
-
-		const googleLink = linkList.find(
-			(link) => link.getAttribute('href') === 'https://www.google.com'
-		);
-
-		expect(googleLink).toBeTruthy();
-		expect(googleLink?.textContent).toBe('Google Search');
-
-		// Test inline links (auto-linked URLs)
-		const exampleLink = linkList.find(
-			(link) => link.getAttribute('href') === 'https://example.com'
-		);
-
-		expect(exampleLink).toBeTruthy();
-
-		const pythonDocsLink = linkList.find(
-			(link) => link.getAttribute('href') === 'https://docs.python.org'
-		);
-
-		expect(pythonDocsLink).toBeTruthy();
-
-		console.log(`✅ URL Links test passed - Found ${links.length} links with proper attributes`);
-	}}
-/>
diff --git a/ui/apps/chat/tests/stories/ModelsSelector.stories.svelte b/ui/apps/chat/tests/stories/ModelsSelector.stories.svelte
deleted file mode 100644
index 2894596fc..000000000
--- a/ui/apps/chat/tests/stories/ModelsSelector.stories.svelte
+++ /dev/null
@@ -1,268 +0,0 @@
-<script lang="ts" module>
-	import { defineMeta } from '@storybook/addon-svelte-csf';
-	import ModelsSelectorList from '#lib/components/app/models/ModelsSelector/ModelsSelectorList.svelte';
-	import ModelsSelectorOption from '#lib/components/app/models/ModelsSelector/ModelsSelectorOption.svelte';
-	import { ServerModelStatus } from '#lib/enums/index.ts';
-	import { modelsStore } from '#lib/stores/models/index.svelte.ts';
-	import type { GroupedModelOptions, ModelItem } from '#lib/utils/index.ts';
-
-	const { Story } = defineMeta({
-		parameters: {
-			layout: 'centered'
-		},
-		title: 'Components/ModelsSelector'
-	});
-
-	const mockModel = (id: string, name: string, orgName?: string, tags?: string[]): ModelOption => ({
-		capabilities: [],
-		id,
-		model: orgName ? `${orgName}/${name}` : name,
-		name,
-		parsedId: {
-			activatedParams: null,
-			modelName: name,
-			orgName: orgName ?? null,
-			params: null,
-			quantization: null,
-			raw: orgName ? `${orgName}/${name}` : name,
-			tags: tags ?? []
-		},
-		tags
-	});
-
-	const mockRouterEntry = (modelName: string, status: ServerModelStatus): ApiModelDataEntry => ({
-		created: Date.now(),
-		id: modelName,
-		in_cache: true,
-		object: 'model',
-		owned_by: 'llamacpp',
-		path: `/models/${modelName}`,
-		status: { value: status }
-	});
-</script>
-
-<script lang="ts">
-	let selectedModel = $state<string | null>(null);
-	let activeId = $state<string | null>(null);
-
-	function mockModelsStore() {
-		modelsStore.favoriteModelIds = new Set(['qwen2.5-7b', 'llama3.2-3b']);
-
-		// Mock router models with various statuses for ModelLoadedStates story
-		modelsStore.routerModels = [
-			mockRouterEntry('meta/Model (loading)', ServerModelStatus.LOADING),
-			mockRouterEntry('meta/Model (loaded)', ServerModelStatus.LOADED),
-			mockRouterEntry('meta/Model (sleeping)', ServerModelStatus.SLEEPING),
-			mockRouterEntry('meta/Model (failed)', ServerModelStatus.FAILED)
-		];
-	}
-
-	mockModelsStore();
-
-	const loadedModels: ModelItem[] = [
-		{ option: mockModel('llama3.1-8b', 'Llama-3.1-8B-Instruct', 'meta') },
-		{ option: mockModel('mistral-7b', 'Mistral-7B-v0.3', 'mistralai') }
-	];
-
-	const favoriteModels: ModelItem[] = [
-		{ option: mockModel('qwen2.5-7b', 'Qwen2.5-7B-Instruct', 'Qwen') },
-		{ option: mockModel('llama3.2-3b', 'Llama-3.2-3B-Instruct', 'meta') }
-	];
-
-	const availableModels: ModelItem[] = [
-		{
-			option: mockModel('deepseek-coder-6.7b', 'DeepSeek-Coder-6.7B', 'deepseek', ['coding'])
-		},
-		{ option: mockModel('gemma-2-9b', 'Gemma-2-9B-IT', 'google') },
-		{ option: mockModel('phi-3-mini', 'Phi-3-mini-4k', 'microsoft') },
-		{ option: mockModel('codellama-7b', 'CodeLlama-7B', 'codellama', ['coding']) },
-		{ option: mockModel('neural-chat-7b', 'Neural-Chat-7B-v3-3', 'intel') }
-	];
-
-	const groupedOptions: GroupedModelOptions = {
-		available: [
-			{
-				items: [availableModels[0]],
-				orgName: 'deepseek'
-			},
-			{
-				items: [availableModels[1]],
-				orgName: 'google'
-			},
-			{
-				items: [availableModels[2]],
-				orgName: 'microsoft'
-			},
-			{
-				items: [availableModels[3]],
-				orgName: 'codellama'
-			},
-			{
-				items: [availableModels[4]],
-				orgName: 'intel'
-			}
-		]
-	};
-
-	function handleSelect(modelId: string) {
-		const opt = [...loadedModels, ...favoriteModels, ...availableModels].find(
-			(m) => m.option.id === modelId
-		);
-
-		if (opt) {
-			selectedModel = opt.option.model;
-			activeId = modelId;
-		}
-	}
-</script>
-
-<Story name="List">
-	<div class="w-80 rounded-lg border border-border bg-popover p-2 shadow-md">
-		<ModelsSelectorList
-			{activeId}
-			currentModel={selectedModel}
-			favorites={favoriteModels}
-			groups={groupedOptions}
-			onSelect={handleSelect}
-		/>
-	</div>
-</Story>
-
-<Story name="SingleLoaded">
-	<div class="w-80 rounded-lg border border-border bg-popover p-2 shadow-md">
-		<ModelsSelectorList
-			activeId={null}
-			currentModel={null}
-			groups={{ available: [] }}
-			loaded={[loadedModels[0]]}
-			onSelect={handleSelect}
-		/>
-	</div>
-</Story>
-
-<Story name="WithFavoritesOnly">
-	<div class="w-80 rounded-lg border border-border bg-popover p-2 shadow-md">
-		<ModelsSelectorList
-			activeId={null}
-			currentModel={null}
-			favorites={favoriteModels}
-			groups={{ available: [] }}
-			onSelect={handleSelect}
-		/>
-	</div>
-</Story>
-
-<Story name="ModelLoadedStates">
-	<div class="w-80 rounded-lg border border-border bg-popover p-2 shadow-md">
-		<div class="px-2 py-2 text-[13px] font-semibold text-muted-foreground/70 select-none">
-			Server model states
-		</div>
-
-		<ModelsSelectorOption
-			hideOrgName={true}
-			isFav={false}
-			isHighlighted={false}
-			isSelected={false}
-			onKeyDown={() => {}}
-			onMouseEnter={() => {}}
-			onSelect={() => {}}
-			option={mockModel('model-idle', 'Model (idle)', 'meta')}
-		/>
-
-		<ModelsSelectorOption
-			hideOrgName={true}
-			isFav={false}
-			isHighlighted={false}
-			isSelected={false}
-			onKeyDown={() => {}}
-			onMouseEnter={() => {}}
-			onSelect={() => {}}
-			option={mockModel('model-loading', 'Model (loading)', 'meta')}
-		/>
-
-		<ModelsSelectorOption
-			hideOrgName={true}
-			isFav={false}
-			isHighlighted={false}
-			isSelected={false}
-			onKeyDown={() => {}}
-			onMouseEnter={() => {}}
-			onSelect={() => {}}
-			option={mockModel('model-loaded', 'Model (loaded)', 'meta')}
-		/>
-
-		<ModelsSelectorOption
-			hideOrgName={true}
-			isFav={false}
-			isHighlighted={false}
-			isSelected={false}
-			onKeyDown={() => {}}
-			onMouseEnter={() => {}}
-			onSelect={() => {}}
-			option={mockModel('model-sleeping', 'Model (sleeping)', 'meta')}
-		/>
-
-		<ModelsSelectorOption
-			hideOrgName={true}
-			isFav={false}
-			isHighlighted={false}
-			isSelected={false}
-			onKeyDown={() => {}}
-			onMouseEnter={() => {}}
-			onSelect={() => {}}
-			option={mockModel('model-failed', 'Model (failed)', 'meta')}
-		/>
-	</div>
-</Story>
-
-<Story name="ModelSelectedStates">
-	<div class="w-80 rounded-lg border border-border bg-popover p-2 shadow-md">
-		<div class="px-2 py-2 text-[13px] font-semibold text-muted-foreground/70 select-none">
-			Selection states
-		</div>
-
-		<ModelsSelectorOption
-			hideOrgName={true}
-			isFav={false}
-			isHighlighted={false}
-			isSelected={false}
-			onKeyDown={() => {}}
-			onMouseEnter={() => {}}
-			onSelect={() => {}}
-			option={mockModel('normal-model', 'Normal Model', 'meta')}
-		/>
-
-		<ModelsSelectorOption
-			hideOrgName={true}
-			isFav={false}
-			isHighlighted={false}
-			isSelected={true}
-			onKeyDown={() => {}}
-			onMouseEnter={() => {}}
-			onSelect={() => {}}
-			option={mockModel('selected-model', 'Selected Model', 'meta')}
-		/>
-
-		<ModelsSelectorOption
-			hideOrgName={true}
-			isFav={false}
-			isHighlighted={true}
-			isSelected={false}
-			onKeyDown={() => {}}
-			onMouseEnter={() => {}}
-			onSelect={() => {}}
-			option={mockModel('highlighted-model', 'Highlighted Model', 'meta')}
-		/>
-
-		<ModelsSelectorOption
-			hideOrgName={true}
-			isFav={true}
-			isHighlighted={false}
-			isSelected={false}
-			onKeyDown={() => {}}
-			onMouseEnter={() => {}}
-			onSelect={() => {}}
-			option={mockModel('fav-model', 'Favorite Model', 'Qwen')}
-		/>
-	</div>
-</Story>
diff --git a/ui/apps/chat/tests/stories/PwaRefreshAlert.stories.svelte b/ui/apps/chat/tests/stories/PwaRefreshAlert.stories.svelte
deleted file mode 100644
index 615fb1fc0..000000000
--- a/ui/apps/chat/tests/stories/PwaRefreshAlert.stories.svelte
+++ /dev/null
@@ -1,64 +0,0 @@
-<script lang="ts" module>
-	import { defineMeta } from '@storybook/addon-svelte-csf';
-	import PwaRefreshAlert from '#lib/components/pwa/PwaRefreshAlert.svelte';
-	import { expect } from 'storybook/test';
-
-	const { Story } = defineMeta({
-		component: PwaRefreshAlert,
-		parameters: {
-			layout: 'centered'
-		},
-		title: 'Components/PwaRefreshAlert'
-	});
-</script>
-
-<Story
-	args={{ needRefresh: true, updateServiceWorker: () => console.log('reload') }}
-	name="Default"
-	play={async ({ canvas }) => {
-		const title = canvas.getByText('Update available');
-
-		await expect(title).toBeInTheDocument();
-
-		const description = canvas.getByText(/A new version is available/);
-
-		await expect(description).toBeInTheDocument();
-
-		const button = canvas.getByRole('button', { name: 'Reload' });
-
-		await expect(button).toBeInTheDocument();
-	}}
-/>
-
-<Story
-	args={{ needRefresh: false, updateServiceWorker: () => console.log('reload') }}
-	name="Hidden"
-	play={async ({ canvas }) => {
-		const title = canvas.queryByText('Update available');
-
-		await expect(title).not.toBeInTheDocument();
-	}}
-/>
-
-<Story
-	args={{
-		needRefresh: true,
-		updateServiceWorker: () => console.log('reload')
-	}}
-	name="ClickReload"
-	play={async ({ canvas, userEvent }) => {
-		const button = canvas.getByRole('button', { name: 'Reload' });
-
-		await expect(button).toBeInTheDocument();
-
-		await userEvent.click(button);
-
-		const title = canvas.queryByText('Update available');
-
-		await expect(title).not.toBeInTheDocument();
-
-		const reloadBtn = canvas.queryByRole('button', { name: 'Reload' });
-
-		await expect(reloadBtn).not.toBeInTheDocument();
-	}}
-/>
diff --git a/ui/apps/chat/tests/stories/actions/ActionIconCopyToClipboard.stories.svelte b/ui/apps/chat/tests/stories/actions/ActionIconCopyToClipboard.stories.svelte
new file mode 100644
index 000000000..b3fecbd7c
--- /dev/null
+++ b/ui/apps/chat/tests/stories/actions/ActionIconCopyToClipboard.stories.svelte
@@ -0,0 +1,23 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { ActionIconCopyToClipboard } from '#lib/components/app/index.ts';
+
+	// Llama UI's ActionIcon that copies a text, under messages, code blocks and commands
+	const { Story } = defineMeta({
+		component: ActionIconCopyToClipboard,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Actions/ActionIconCopyToClipboard'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2}>
+		<StateGalleryItem label="Copy to clipboard" note="a green check for 1.5s after copying">
+			<ActionIconCopyToClipboard text="llama-server -m model.gguf" />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/actions/GlassKey.stories.svelte b/ui/apps/chat/tests/stories/actions/GlassKey.stories.svelte
new file mode 100644
index 000000000..b2d2c510a
--- /dev/null
+++ b/ui/apps/chat/tests/stories/actions/GlassKey.stories.svelte
@@ -0,0 +1,40 @@
+<script lang="ts" module>
+	import { ArrowDown } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { GlassKey, MenuIcon } from '#lib/components/app/index.ts';
+	import { ICON_CLASS_DEFAULT } from '#lib/constants/index.ts';
+
+	// a round matte glass key over the page: a phone's menu and context gauge keys, and the key
+	// back to a chat's bottom; the text under them shows how the glass softens what scrolls by
+	const { Story } = defineMeta({
+		component: GlassKey,
+		parameters: { layout: 'fullscreen' },
+		title: 'Llama Chat/Actions/GlassKey'
+	});
+
+	const LINES = Array.from(
+		{ length: 8 },
+		(_, index) => `Line ${index + 1}: what scrolls under a glass key softens behind its icon.`
+	);
+</script>
+
+<Story asChild name="Over the page">
+	<div class="relative min-h-80 p-6">
+		<div class="flex flex-col gap-2 text-sm">
+			{#each LINES as line (line)}
+				<p>{line}</p>
+			{/each}
+		</div>
+
+		<div class="absolute inset-x-6 top-10 flex items-center justify-between">
+			<GlassKey icon={MenuIcon} label="Expand navigation" />
+
+			<GlassKey
+				icon={ArrowDown}
+				iconClass={ICON_CLASS_DEFAULT}
+				label="Scroll to bottom"
+				size="sm"
+			/>
+		</div>
+	</div>
+</Story>
diff --git a/ui/apps/chat/tests/stories/badges/InfoBadges.stories.svelte b/ui/apps/chat/tests/stories/badges/InfoBadges.stories.svelte
new file mode 100644
index 000000000..27e604312
--- /dev/null
+++ b/ui/apps/chat/tests/stories/badges/InfoBadges.stories.svelte
@@ -0,0 +1,53 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { Clock, Gauge } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { BadgeInfo, BadgesModality } from '#lib/components/app/index.ts';
+	import { ModelModality } from '#lib/enums/index.ts';
+
+	// the clickable info badges for message statistics and models, and the modality icons
+	const { Story } = defineMeta({
+		component: BadgeInfo,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Badges/InfoBadges'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={3}>
+		<StateGalleryItem label="BadgeInfo">
+			<div class="flex flex-wrap items-center gap-2">
+				<BadgeInfo>
+					{#snippet icon()}
+						<Gauge class="size-icon-xs" />
+					{/snippet}
+
+					42.7 t/s
+				</BadgeInfo>
+
+				<BadgeInfo>
+					{#snippet icon()}
+						<Clock class="size-icon-xs" />
+					{/snippet}
+
+					3.2 s
+				</BadgeInfo>
+
+				<BadgeInfo>qwen3-8b</BadgeInfo>
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="BadgesModality" note="vision, audio">
+			<BadgesModality modalities={[ModelModality.VISION, ModelModality.AUDIO]} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="BadgesModality" note="all">
+			<BadgesModality
+				modalities={[ModelModality.VISION, ModelModality.AUDIO, ModelModality.VIDEO]}
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/brand/assets/OpticalCentre.svelte b/ui/apps/chat/tests/stories/brand/assets/OpticalCentre.svelte
new file mode 100644
index 000000000..d8c148915
--- /dev/null
+++ b/ui/apps/chat/tests/stories/brand/assets/OpticalCentre.svelte
@@ -0,0 +1,550 @@
+<!--
+	How the icon sits in a circle crop (the avatars, the PWA icon), animated in steps: the icon holds at the exact
+	centre, lifts, is nudged left to where the files place it, is measured, and eases back, on a loop. Below it, a tile
+	for each step, as in the logo overview's origin: each lights up once the animation reaches it, and a click moves
+	the animation there (with reduced motion it doesn't loop, and a click shows the step at once). The avatar shows light and dark, then measured as it moves: the icon's box, the
+	centre lines, the margins all round, and a circle in the gap between the crop and each of the icon's outer points,
+	touching both (its rounded corners, its sharp corners and the tips at its middle). The files' placement comes from
+	the file itself (its translate and scale), so the figure follows the files.
+-->
+<script lang="ts">
+	import Figure from '../logo-showcase/lib/components/Figure.svelte';
+	import Figures from '../logo-showcase/lib/components/Figures.svelte';
+	import { PATHS, SIZE } from '../logo-showcase/lib/logo';
+	import { untrack } from 'svelte';
+	import { cubicInOut } from 'svelte/easing';
+	import { prefersReducedMotion, Tween } from 'svelte/motion';
+
+	interface Props {
+		/** the canvas's side and the icon's placement in it, as in its SVG */
+		placement: { scale: number; size: number; x: number; y: number };
+	}
+
+	let { placement }: Props = $props();
+
+	const side = $derived(SIZE * placement.scale);
+	const centred = $derived((placement.size - side) / 2);
+	// the files' lift and nudge, as fractions of the icon's size: 1/40 up and 1/100 left in the brand's files
+	const lift = $derived(Math.round(side / (centred - placement.y)));
+	const nudge = $derived(Math.round(side / (centred - placement.x)));
+
+	type Point = [number, number];
+
+	/**
+	 * A path's outer corners, in the icon's own 600 units: its rounded corner (its curve's control points), its sharp
+	 * one (its corner farthest from the icon's centre) and its tip at the middle (its corner farthest to the side).
+	 */
+	function outerCorners(d: string) {
+		const points: Point[] = [];
+
+		let curve: Point[] = [];
+		let at: Point = [0, 0];
+
+		for (const [, command, args] of d.matchAll(/([MLCHVZ])([^MLCHVZ]*)/g)) {
+			const n = args.trim()
+				? args
+						.trim()
+						.split(/[\s,]+/)
+						.map(Number)
+				: [];
+
+			if (command === 'C') {
+				curve = [at, [n[0], n[1]], [n[2], n[3]], [n[4], n[5]]];
+				at = [n[4], n[5]];
+			} else if (command === 'H') at = [n[0], at[1]];
+			else if (command === 'V') at = [at[0], n[0]];
+			else if (command !== 'Z') at = [n[0], n[1]];
+
+			points.push(at);
+		}
+
+		const reach = ([x, y]: Point) => Math.hypot(x - SIZE / 2, y - SIZE / 2);
+
+		return {
+			curve,
+			sharp: points.reduce((far, p) => (reach(p) > reach(far) ? p : far)),
+			tip: points.reduce((far, p) =>
+				Math.abs(p[0] - SIZE / 2) > Math.abs(far[0] - SIZE / 2) ? p : far
+			)
+		};
+	}
+
+	// the foot, then the blade
+	const CORNERS = PATHS.map(outerCorners);
+	const NAMES = ['foot', 'blade'];
+
+	/**
+	 * The gaps between the circle crop and the icon's outer corners, with the icon at x y: each filled by the circle
+	 * that touches the crop and the corner, at a rounded corner's apex (its curve's midpoint, along its bisector) and
+	 * at a sharp corner's point, and measured by that circle's diameter.
+	 */
+	function gaps(x: number, y: number) {
+		const c = placement.size / 2;
+		const onCanvas = ([px, py]: number[]) => [
+			x + px * placement.scale - c,
+			y + py * placement.scale - c
+		];
+		// the circle touching the crop and the point v (from the centre), along n: |v + r n| = c - r, solved for r
+		const fill = (v: number[], n: number[]) => {
+			const r = (c * c - v[0] ** 2 - v[1] ** 2) / (2 * (v[0] * n[0] + v[1] * n[1] + c));
+
+			return { cx: c + v[0] + r * n[0], cy: c + v[1] + r * n[1], gap: 2 * r };
+		};
+		const outward = (v: number[]) => {
+			const d = Math.hypot(v[0], v[1]);
+
+			return fill(v, [v[0] / d, v[1] / d]);
+		};
+
+		return CORNERS.flatMap(({ curve: [p0, p1, p2, p3], sharp, tip }, i) => {
+			const apex = [0, 1].map((k) => (p0[k] + 3 * p1[k] + 3 * p2[k] + p3[k]) / 8);
+			const tangent = [0, 1].map((k) => p3[k] + p2[k] - p1[k] - p0[k]);
+			const length = Math.hypot(tangent[0], tangent[1]);
+
+			let n = [tangent[1] / length, -tangent[0] / length];
+
+			if (n[0] * (apex[0] - SIZE / 2) + n[1] * (apex[1] - SIZE / 2) < 0) n = [-n[0], -n[1]];
+
+			return [
+				{ ...fill(onCanvas(apex), n), kind: 'rounded', name: NAMES[i] },
+				{ ...outward(onCanvas(sharp)), kind: 'sharp', name: NAMES[i] },
+				{ ...outward(onCanvas(tip)), kind: 'middle', name: NAMES[i] }
+			];
+		});
+	}
+
+	/** For each kind of corner, whether the pair is even (within half a pixel) or which comes nearer the crop. */
+	function balance(g: ReturnType<typeof gaps>) {
+		return ['rounded', 'sharp', 'middle']
+			.map((kind) => {
+				const [a, b] = g.filter((gap) => gap.kind === kind);
+
+				if (Math.abs(a.gap - b.gap) < 0.5) return `${kind} even`;
+
+				return `${kind}: the ${a.gap < b.gap ? a.name : b.name}’s nearer`;
+			})
+			.join(' · ');
+	}
+
+	// the steps, in order: centred, lifted, nudged left to the files' placement, then measured there
+	const STEPS = ['centred', 'lifted', 'nudged', 'measured'] as const;
+	// how long each step holds before the next
+	const HOLDS = [1500, 900, 900, 4500];
+
+	// how far the icon has been lifted and nudged, from the exact centre (0) to the files' placement (1); the measures
+	// draw on only once it has arrived, and clear before it leaves
+	const lifted = new Tween(0, { duration: 1000, easing: cubicInOut });
+	const nudged = new Tween(0, { duration: 900, easing: cubicInOut });
+	let step = $state(0);
+	let measured = $state(false);
+	// where the loop (re)starts: a click on a tile moves it there
+	let from = $state({ at: 0 });
+	const uid = $props.id();
+
+	const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
+
+	// the loop that's running: a click starts another, and a stale one stops at its next await
+	let run = 0;
+
+	/** Moves the icon to step i (lifted from the second, nudged from the third, measured at the last), then shows it. */
+	async function show(i: number, id: number, duration?: number) {
+		const options = duration === undefined ? undefined : { duration };
+
+		if (i < 3 && measured) {
+			measured = false;
+
+			if (duration !== 0) await wait(500);
+		}
+
+		if (id !== run) return;
+
+		await Promise.all([lifted.set(i >= 1 ? 1 : 0, options), nudged.set(i >= 2 ? 1 : 0, options)]);
+
+		if (id !== run) return;
+
+		step = i;
+		measured = i === 3;
+	}
+
+	$effect(() => {
+		const start = from.at;
+		const id = untrack(() => ++run);
+
+		if (prefersReducedMotion.current) {
+			untrack(() => show(start, id, 0));
+
+			return;
+		}
+
+		untrack(async () => {
+			for (let i = start; id === run; i = (i + 1) % STEPS.length) {
+				await show(i, id);
+
+				if (id !== run) break;
+
+				await wait(HOLDS[i]);
+			}
+		});
+
+		// unmounted, or restarted: this loop is stale
+		return () => run++;
+	});
+
+	/** The icon's top left with it lifted and nudged by l and n (0 to 1 of the files' lift and nudge). */
+	const at = (l: number, n: number) => ({
+		x: centred + (placement.x - centred) * n,
+		y: centred + (placement.y - centred) * l
+	});
+
+	const shown = $derived.by(() => {
+		const { x, y } = at(lifted.current, nudged.current);
+		const g = gaps(x, y);
+		const label = [
+			'At the exact centre',
+			`Lifted 1/${lift} of its height`,
+			`Lifted 1/${lift} and nudged 1/${nudge} left, as in the files`,
+			`Lifted 1/${lift} and nudged 1/${nudge} left, as in the files`
+		][step];
+
+		return { gaps: g, key: 'shown', label, note: balance(g), x, y };
+	});
+
+	// each tile's drawing, at its step's placement
+	const tiles = $derived(STEPS.map((name, i) => ({ name, ...at(i >= 1 ? 1 : 0, i >= 2 ? 1 : 0) })));
+	const titles = { centred: 'Centred', lifted: 'Lifted', measured: 'Measured', nudged: 'Nudged' };
+
+	const round = (n: number) => Math.round(n * 10) / 10;
+</script>
+
+<figure aria-label="Icon placements" class="m-0 grid min-w-0 gap-6">
+	<!-- the placement as it moves: the avatar light and dark, small as it shows, then measured -->
+	{#each [shown] as panel (panel.key)}
+		<section class="grid gap-4">
+			<div class="grid gap-1">
+				<h3 class="text-sm font-medium">{panel.label}</h3>
+
+				<p class={['fade-note text-xs text-muted-foreground', measured && 'shown']}>{panel.note}</p>
+			</div>
+
+			<div class="flex flex-wrap items-center gap-8">
+				{#each [['#FAFAFA', '#111111'], ['#111111', '#FAFAFA']] as [ground, ink] (ground)}
+					<svg
+						class="block size-24 shrink-0 rounded-full border border-border/60"
+						viewBox="0 0 {placement.size} {placement.size}"
+					>
+						<circle
+							cx={placement.size / 2}
+							cy={placement.size / 2}
+							fill={ground}
+							r={placement.size / 2}
+						/>
+
+						<g fill={ink} transform="translate({panel.x} {panel.y}) scale({placement.scale})">
+							{#each PATHS as d (d)}<path {d} />{/each}
+						</g>
+					</svg>
+				{/each}
+
+				<div class="w-full sm:ml-8 sm:w-[calc((100%-3rem)/3)]">
+					<svg
+						class="block aspect-square w-full overflow-hidden rounded-card border border-border/60"
+						viewBox="0 0 {placement.size} {placement.size}"
+					>
+						<rect fill="#FAFAFA" height={placement.size} width={placement.size} />
+
+						<!-- the circle it is cropped to, and its centre lines -->
+						<circle
+							class="guide muted"
+							cx={placement.size / 2}
+							cy={placement.size / 2}
+							r={placement.size / 2}
+						/>
+
+						<line
+							class="guide muted"
+							x1="0"
+							x2={placement.size}
+							y1={placement.size / 2}
+							y2={placement.size / 2}
+						/>
+
+						<line
+							class="guide muted"
+							x1={placement.size / 2}
+							x2={placement.size / 2}
+							y1="0"
+							y2={placement.size}
+						/>
+
+						<g fill="#111111" transform="translate({panel.x} {panel.y}) scale({placement.scale})">
+							{#each PATHS as d (d)}<path {d} />{/each}
+						</g>
+
+						<!-- the measures: drawn on once the icon has arrived, in turn, and cleared before it moves back -->
+						<g class={['measures', measured && 'shown']}>
+							<!-- the icon's box, dashed, revealed by a solid copy drawn on in its mask, then its centre lines -->
+							<mask id="{uid}-box">
+								<rect
+									class="draw"
+									fill="none"
+									height={side}
+									pathLength="1"
+									stroke="white"
+									stroke-width={placement.size / 40}
+									width={side}
+									x={panel.x}
+									y={panel.y}
+								/>
+							</mask>
+
+							<rect
+								class="guide"
+								height={side}
+								mask="url(#{uid}-box)"
+								width={side}
+								x={panel.x}
+								y={panel.y}
+							/>
+
+							<line
+								style:--delay="350ms"
+								class="guide solid draw"
+								pathLength="1"
+								stroke-width={placement.size / 320}
+								x1={panel.x}
+								x2={panel.x + side}
+								y1={panel.y + side / 2}
+								y2={panel.y + side / 2}
+							/>
+
+							<line
+								style:--delay="450ms"
+								class="guide solid draw"
+								pathLength="1"
+								stroke-width={placement.size / 320}
+								x1={panel.x + side / 2}
+								x2={panel.x + side / 2}
+								y1={panel.y}
+								y2={panel.y + side}
+							/>
+
+							<!-- the gaps between the crop and the icon's outer corners, each filled by a circle touching both -->
+							{#each panel.gaps as g, i (g.kind + g.name)}
+								<circle
+									style:--delay="{600 + i * 90}ms"
+									class={['gap draw', g.kind]}
+									cx={g.cx}
+									cy={g.cy}
+									pathLength="1"
+									r={g.gap / 2}
+									stroke-width={placement.size / 320}
+								/>
+
+								<text
+									style:--delay="{1100 + i * 60}ms"
+									class="margin fade"
+									font-size={placement.size * 0.04}
+									x={g.cx}
+									y={g.cy}>{round(g.gap)}</text
+								>
+							{/each}
+
+							<!-- the margins round the icon's box: above and below in the square's corners, outside the crop -->
+							{#each [{ at: [0.08, panel.y / 2], value: panel.y }, { at: [0.92, (placement.size + panel.y + side) / 2], value: placement.size - panel.y - side }] as m (m.at[0])}
+								<text
+									style:--delay="1300ms"
+									class="margin fade"
+									font-size={placement.size * 0.045}
+									x={placement.size * m.at[0]}
+									y={m.at[1]}>{round(m.value)}</text
+								>
+							{/each}
+
+							{#each [{ value: panel.x, x: panel.x / 2 }, { value: placement.size - panel.x - side, x: (placement.size + panel.x + side) / 2 }] as m (m.x)}
+								<text
+									style:--delay="1300ms"
+									class="margin fade"
+									font-size={placement.size * 0.045}
+									x={m.x}
+									y={placement.size * 0.42}>{round(m.value)}</text
+								>
+							{/each}
+						</g>
+					</svg>
+				</div>
+			</div>
+		</section>
+	{/each}
+
+	<!-- the steps, as tiles: each lights up once the animation reaches it, and a click moves the animation there -->
+	<Figures layout="steps">
+		{#each tiles as tile, i (tile.name)}
+			<Figure
+				action="Show {titles[tile.name]} in the animation"
+				dim={i > step}
+				n={String(i + 1).padStart(2, '0')}
+				onclick={() => (from = { at: i })}
+				title={titles[tile.name]}
+				view="0 0 {placement.size} {placement.size}"
+			>
+				{#snippet drawing()}
+					<circle
+						class="tile-crop"
+						cx={placement.size / 2}
+						cy={placement.size / 2}
+						r={placement.size / 2 - 1}
+					/>
+
+					<line
+						class="tile-axis"
+						x1="0"
+						x2={placement.size}
+						y1={placement.size / 2}
+						y2={placement.size / 2}
+					/>
+
+					<line
+						class="tile-axis"
+						x1={placement.size / 2}
+						x2={placement.size / 2}
+						y1="0"
+						y2={placement.size}
+					/>
+
+					<g
+						fill="var(--l-shape)"
+						transform="translate({tile.x} {tile.y}) scale({placement.scale})"
+					>
+						{#each PATHS as d (d)}<path {d} />{/each}
+					</g>
+
+					{#if tile.name === 'measured'}
+						{#each gaps(tile.x, tile.y) as g (g.kind + g.name)}
+							<circle class={['gap tile-gap', g.kind]} cx={g.cx} cy={g.cy} r={g.gap / 2} />
+						{/each}
+					{:else}
+						<rect class="tile-box" height={side} width={side} x={tile.x} y={tile.y} />
+					{/if}
+				{/snippet}
+
+				{#if tile.name === 'centred'}
+					At the exact centre of the square, the icon reads low: its weight sits in the wide foot.
+				{:else if tile.name === 'lifted'}
+					Up 1/{lift} of its height, it looks centred.
+				{:else if tile.name === 'nudged'}
+					Left 1/{nudge} of its width: where the files place it, in the avatars and the PWA icon.
+				{:else}
+					Each gap between the crop and the icon's outer points, filled by a circle touching both.
+				{/if}
+			</Figure>
+		{/each}
+	</Figures>
+
+	<figcaption class="text-xs text-muted-foreground">
+		The icon fills {Math.round((side / placement.size) * 100)}% of the side; the numbers are pixels
+		at {placement.size}
+		× {placement.size}. Each circle fills the gap between the circle crop and one of the icon’s
+		outer points: orange at the rounded corners (the blade’s top left, the foot’s bottom right),
+		grey at the sharp corners (the blade’s top right, the foot’s bottom left), blue at the tips in
+		the middle (the blade’s left, the foot’s right). No placement evens all three pairs, since the
+		tips are even only without a sideways nudge; lifted 1/{lift} and nudged 1/{nudge} left, the files
+		keep every pair within a few pixels.
+	</figcaption>
+</figure>
+
+<style>
+	.guide {
+		fill: none;
+		stroke: #ee6c1e;
+		stroke-dasharray: 4 3;
+		stroke-width: 1px;
+		vector-effect: non-scaling-stroke;
+	}
+	.guide.solid {
+		stroke-dasharray: none;
+	}
+	.guide.muted {
+		stroke: #a3a3a3;
+	}
+	.gap {
+		fill: color-mix(in srgb, #ee6c1e 12%, transparent);
+		stroke: #ee6c1e;
+	}
+	.gap.sharp {
+		fill: color-mix(in srgb, #a3a3a3 14%, transparent);
+		stroke: #a3a3a3;
+	}
+	.gap.middle {
+		fill: color-mix(in srgb, #3b82f6 10%, transparent);
+		stroke: #3b82f6;
+	}
+	/* the tiles' marks: the crop and its centre lines, faint, and the icon's box */
+	.tile-crop,
+	.tile-axis {
+		fill: none;
+		stroke: var(--l-line);
+		stroke-width: 1px;
+		vector-effect: non-scaling-stroke;
+	}
+	.tile-axis {
+		stroke-dasharray: 4 3;
+	}
+	.tile-box {
+		fill: none;
+		stroke: #ee6c1e;
+		stroke-dasharray: 4 3;
+		stroke-width: 1px;
+		vector-effect: non-scaling-stroke;
+	}
+	.tile-gap {
+		stroke-width: 1px;
+		vector-effect: non-scaling-stroke;
+	}
+	.margin {
+		dominant-baseline: middle;
+		fill: #ee6c1e;
+		font-family: var(--font-mono, monospace);
+		text-anchor: middle;
+	}
+
+	/* drawn on: a stroke traced from nothing along its length, then the fills and numbers faded in, each after its
+	   --delay; cleared quicker, all at once */
+	.measures .draw {
+		stroke-dasharray: 1;
+		stroke-dashoffset: 1;
+		vector-effect: none;
+		transition: stroke-dashoffset 300ms ease-in;
+	}
+	.measures.shown .draw {
+		stroke-dashoffset: 0;
+		transition: stroke-dashoffset 700ms cubic-bezier(0.65, 0, 0.35, 1) var(--delay, 0ms);
+	}
+	.measures .gap {
+		fill-opacity: 0;
+		transition:
+			stroke-dashoffset 300ms ease-in,
+			fill-opacity 250ms ease-in;
+	}
+	.measures.shown .gap {
+		fill-opacity: 1;
+		transition:
+			stroke-dashoffset 700ms cubic-bezier(0.65, 0, 0.35, 1) var(--delay, 0ms),
+			fill-opacity 500ms ease-out calc(var(--delay, 0ms) + 500ms);
+	}
+	.measures .fade,
+	.fade-note {
+		opacity: 0;
+		transition: opacity 250ms ease-in;
+	}
+	.measures.shown .fade,
+	.fade-note.shown {
+		opacity: 1;
+		transition: opacity 400ms ease-out var(--delay, 1300ms);
+	}
+	@media (prefers-reduced-motion: reduce) {
+		.measures *,
+		.fade-note {
+			transition: none !important;
+		}
+	}
+</style>
diff --git a/ui/apps/chat/tests/stories/brand/assets/files/native/macos/icon_512x512@2x.png b/ui/apps/chat/tests/stories/brand/assets/files/native/macos/icon_512x512@2x.png
new file mode 100644
index 000000000..159c77502
Binary files /dev/null and b/ui/apps/chat/tests/stories/brand/assets/files/native/macos/icon_512x512@2x.png differ
diff --git a/ui/apps/chat/tests/stories/brand/assets/files/native/windows/Square150x150Logo.scale-400.png b/ui/apps/chat/tests/stories/brand/assets/files/native/windows/Square150x150Logo.scale-400.png
new file mode 100644
index 000000000..748ca35a5
Binary files /dev/null and b/ui/apps/chat/tests/stories/brand/assets/files/native/windows/Square150x150Logo.scale-400.png differ
diff --git a/ui/apps/chat/tests/stories/brand/assets/files/native/windows/Square44x44Logo.scale-400.png b/ui/apps/chat/tests/stories/brand/assets/files/native/windows/Square44x44Logo.scale-400.png
new file mode 100644
index 000000000..970ef0295
Binary files /dev/null and b/ui/apps/chat/tests/stories/brand/assets/files/native/windows/Square44x44Logo.scale-400.png differ
diff --git a/ui/apps/chat/tests/stories/brand/fonts/LlamaMono.woff2 b/ui/apps/chat/tests/stories/brand/fonts/LlamaMono.woff2
new file mode 100644
index 000000000..c8cd45657
Binary files /dev/null and b/ui/apps/chat/tests/stories/brand/fonts/LlamaMono.woff2 differ
diff --git a/ui/apps/chat/tests/stories/brand/fonts/fonts.css b/ui/apps/chat/tests/stories/brand/fonts/fonts.css
new file mode 100644
index 000000000..8d9409b2f
--- /dev/null
+++ b/ui/apps/chat/tests/stories/brand/fonts/fonts.css
@@ -0,0 +1,8 @@
+/* Llama Mono for the brand showcases (logo and type); Llama Sans is the design system's own (src/app.css) */
+@font-face {
+	font-family: 'Llama Mono';
+	src: url('./LlamaMono.woff2') format('woff2');
+	font-weight: 400 700;
+	font-style: normal;
+	font-display: block;
+}
diff --git a/ui/apps/chat/tests/stories/brand/logo-showcase/ShowcaseFrame.svelte b/ui/apps/chat/tests/stories/brand/logo-showcase/ShowcaseFrame.svelte
new file mode 100644
index 000000000..05899dc7f
--- /dev/null
+++ b/ui/apps/chat/tests/stories/brand/logo-showcase/ShowcaseFrame.svelte
@@ -0,0 +1,58 @@
+<!--
+	The logo showcase's frame: the grey card the page sits on, with the showcase's colours and fonts. A copy of the
+	page template in ggml-org/llama-brand (logo/showcase/src/lib/templates/Doc.svelte); the showcase in lib/ is copied
+	from there too, so change them there first.
+-->
+<script lang="ts">
+	import './lib/styles/logo.css';
+	import '../fonts/fonts.css';
+	import type { Snippet } from 'svelte';
+
+	let { children }: { children: Snippet } = $props();
+</script>
+
+<div class="logo">{@render children()}</div>
+
+<style>
+	.logo {
+		--body: 'Llama Sans', var(--font-sans);
+		--mono: 'Llama Mono', ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
+		display: grid;
+		gap: 40px;
+		max-width: 1180px;
+		margin: 0 auto;
+		padding: clamp(16px, 4vw, 48px);
+		background: var(--l-bg);
+		color: var(--l-ink);
+		font: 16px/1.55 var(--body);
+	}
+	.logo > :global(*) {
+		margin: 0;
+		min-width: 0;
+	}
+	/* a kicker, its heading and the lead read as one block, 10px apart */
+	.logo > :global(.kicker) {
+		margin-bottom: -30px;
+		font: 500 12px var(--mono);
+		letter-spacing: 0.08em;
+		text-transform: uppercase;
+		color: var(--l-muted);
+	}
+	.logo > :global(h2) {
+		font:
+			700 clamp(32px, 5vw, 56px) / 1.15 'Llama Sans',
+			var(--body);
+	}
+	.logo > :global(h2 + p) {
+		max-width: 62ch;
+		margin-top: -30px;
+		color: var(--l-muted);
+		font:
+			400 17px / 1.5 'Llama Sans',
+			var(--body);
+	}
+	/* the origin's tiles sit closer under the animation they follow */
+	.logo > :global(.steps) {
+		margin-top: -20px;
+	}
+</style>
diff --git a/ui/apps/chat/tests/stories/brand/logo-showcase/lib/components/Figure.svelte b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/components/Figure.svelte
new file mode 100644
index 000000000..e155eec28
--- /dev/null
+++ b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/components/Figure.svelte
@@ -0,0 +1,189 @@
+<!-- One small drawing on a card with its caption: a step of the origin (with its number) or a rule of the icon.
+     The drawing is a snippet in the icon's own coordinates; the caption is the children. dim fades it back;
+     with onclick, the whole card is a button labelled by action. -->
+<script lang="ts">
+	import type { Snippet } from 'svelte';
+
+	let {
+		action,
+		children,
+		dim = false,
+		drawing,
+		n,
+		onclick,
+		title,
+		view = '-60 -60 720 720'
+	}: {
+		title: string;
+		n?: string;
+		view?: string;
+		dim?: boolean;
+		onclick?: () => void;
+		action?: string;
+		drawing: Snippet;
+		children?: Snippet;
+	} = $props();
+</script>
+
+<figure class:faded={dim} class="panel">
+	{#if onclick}<button aria-label={action ?? title} class="go" {onclick} type="button"
+		></button>{/if}
+
+	{#if n}<span class="step">{n}</span>{/if}
+
+	<svg aria-label={title} role="img" viewBox={view}>{@render drawing()}</svg>
+
+	<figcaption><strong>{title}</strong>{@render children?.()}</figcaption>
+</figure>
+
+<style>
+	.panel {
+		position: relative;
+		margin: 0;
+		display: grid;
+		gap: 10px;
+		align-content: start;
+		min-width: 0;
+		padding: 14px;
+		border-radius: 12px;
+		background: var(--l-panel);
+		transition:
+			opacity 400ms ease-out,
+			box-shadow 160ms ease-out;
+	}
+	.faded {
+		opacity: 0.25;
+	}
+	.go {
+		position: absolute;
+		inset: 0;
+		padding: 0;
+		border: 0;
+		border-radius: inherit;
+		background: none;
+		cursor: pointer;
+	}
+	.go:focus-visible {
+		outline: 2px solid var(--l-ink);
+		outline-offset: 2px;
+	}
+	.panel:has(> .go:hover) {
+		box-shadow: inset 0 0 0 1px var(--l-rule);
+		opacity: 1;
+	}
+	.panel svg {
+		display: block;
+		width: 100%;
+		height: auto;
+	}
+	figcaption {
+		display: grid;
+		gap: 2px;
+		font:
+			400 14px / 1.5 'Llama Sans',
+			var(--body);
+		color: var(--l-muted);
+	}
+	strong {
+		color: var(--l-ink);
+		font:
+			600 15px / normal 'Llama Sans',
+			var(--body);
+	}
+	.step {
+		font: 500 11px var(--mono);
+		letter-spacing: 0.08em;
+		color: var(--l-muted);
+	}
+
+	/* the drawings' marks, for every figure's drawing snippet */
+	svg :global(.guide) {
+		stroke: var(--l-line);
+		stroke-width: 1;
+		stroke-dasharray: 6 4;
+		fill: none;
+		vector-effect: non-scaling-stroke;
+	}
+	svg :global(.joint) {
+		fill: var(--l-line);
+	}
+	svg :global(.cell) {
+		fill: var(--l-faint);
+		stroke: var(--l-ink);
+		stroke-width: 2.5;
+		vector-effect: non-scaling-stroke;
+	}
+	svg :global(.cell-outline) {
+		fill: none;
+		stroke: var(--l-ink);
+		stroke-width: 2;
+		vector-effect: non-scaling-stroke;
+	}
+	svg :global(.ghost) {
+		fill: none;
+		stroke: var(--l-line);
+		stroke-width: 1.5;
+		vector-effect: non-scaling-stroke;
+	}
+	svg :global(.lifted) {
+		fill: none;
+		stroke: var(--l-ink);
+		stroke-width: 1.5;
+		stroke-dasharray: 5 5;
+		vector-effect: non-scaling-stroke;
+	}
+	/* the grid of ideal triangles the lean puts the L on */
+	svg :global(.tri) {
+		stroke: var(--l-line);
+		stroke-opacity: 0.45;
+		stroke-width: 1;
+		vector-effect: non-scaling-stroke;
+	}
+	/* the empty centre that makes the + an L, marked in the accent */
+	svg :global(.mark) {
+		fill: var(--l-mark);
+		fill-opacity: 0.12;
+		stroke: var(--l-mark);
+		stroke-width: 2.5;
+		stroke-dasharray: 7 5;
+		vector-effect: non-scaling-stroke;
+	}
+	svg :global(.mark-joint) {
+		fill: var(--l-mark);
+	}
+	svg :global(.strike) {
+		fill: var(--l-bolt-core);
+		stroke: var(--l-bolt-glow);
+		stroke-width: 2;
+		stroke-linejoin: round;
+		vector-effect: non-scaling-stroke;
+		filter: drop-shadow(0 0 2px var(--l-bolt-glow)) drop-shadow(0 0 6px var(--l-bolt-halo));
+	}
+	svg :global(.hi) {
+		stroke: var(--l-ink);
+		stroke-width: 2.5;
+		fill: none;
+		vector-effect: non-scaling-stroke;
+	}
+	svg :global(.dim) {
+		stroke: var(--l-ink);
+		stroke-width: 1.5;
+		stroke-dasharray: 4 4;
+		vector-effect: non-scaling-stroke;
+	}
+	svg :global(.arc) {
+		stroke: var(--l-ink);
+		stroke-width: 2;
+		fill: none;
+		vector-effect: non-scaling-stroke;
+	}
+	svg :global(.note) {
+		font:
+			500 30px 'Llama Sans',
+			var(--body);
+		fill: var(--l-ink);
+	}
+	svg :global(.note.on-shape) {
+		fill: var(--l-bg);
+	}
+</style>
diff --git a/ui/apps/chat/tests/stories/brand/logo-showcase/lib/components/Figures.svelte b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/components/Figures.svelte
new file mode 100644
index 000000000..623c34703
--- /dev/null
+++ b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/components/Figures.svelte
@@ -0,0 +1,31 @@
+<!-- A grid of <Figure>s: "steps" fit the origin's five tiles on one row where they can, "rules" lay the six rule
+     panels out 3 x 2 on wide screens, 2 x 3 on tablets and in one column on phones. -->
+<script lang="ts">
+	import type { Snippet } from 'svelte';
+	let { children, layout = 'rules' }: { layout?: 'steps' | 'rules'; children: Snippet } = $props();
+</script>
+
+<div class={['figures', layout]}>{@render children()}</div>
+
+<style>
+	.figures {
+		display: grid;
+		gap: 16px;
+	}
+	.steps {
+		grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
+	}
+	.rules {
+		grid-template-columns: repeat(3, minmax(0, 1fr));
+	}
+	@media (max-width: 860px) {
+		.rules {
+			grid-template-columns: repeat(2, minmax(0, 1fr));
+		}
+	}
+	@media (max-width: 520px) {
+		.rules {
+			grid-template-columns: minmax(0, 1fr);
+		}
+	}
+</style>
diff --git a/ui/apps/chat/tests/stories/brand/logo-showcase/lib/logo.ts b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/logo.ts
new file mode 100644
index 000000000..f8a067f45
--- /dev/null
+++ b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/logo.ts
@@ -0,0 +1,72 @@
+// Geometry of the Llama icon (ggml-org/llama-brand, icon/icon-light.svg, a 600 x 600 drawing).
+// Everything the logo page draws is derived from these numbers.
+
+export type Pt = [number, number];
+
+export const SIZE = 600;
+export const SPLIT = 392; // where the two blades meet
+export const PATHS = [
+	'M600 392L504.249 558L504.137 557.929C487.252 584.069 458.193 600 426.864 600H120L240 392H600Z',
+	'M240 392H0L199.602 46.0254C216.032 17.5463 246.411 3.25756e-05 279.29 0H466.154L240 392Z'
+];
+
+// the four slanted edges, as two points each
+export const edges: Record<string, [Pt, Pt]> = {
+	lowerRight: [
+		[600, 392],
+		[504.249, 558]
+	],
+	shared: [
+		[466.154, 0],
+		[120, 600]
+	], // upper blade's right edge and lower blade's left edge: one line
+	upperLeft: [
+		[0, 392],
+		[199.602, 46.0254]
+	]
+};
+
+export const angle = (a: Pt, b: Pt) =>
+	(Math.atan2(Math.abs(b[1] - a[1]), Math.abs(b[0] - a[0])) * 180) / Math.PI;
+
+// the rounded corners: tangent points, the sharp corner they replace, and the circle they follow
+function corner(tangentEdge: Pt, tangentFlat: Pt, sharp: Pt, inward: 1 | -1) {
+	const trim = Math.hypot(tangentFlat[0] - sharp[0], tangentFlat[1] - sharp[1]);
+	const r = trim * Math.tan(Math.PI / 3); // the corner is 120°, so r = trim · tan 60°
+
+	return {
+		centre: [tangentFlat[0], tangentFlat[1] + inward * r] as Pt,
+		r,
+		sharp,
+		tangentEdge,
+		tangentFlat,
+		trim
+	};
+}
+const xAt = (e: [Pt, Pt], y: number) =>
+	e[0][0] + ((y - e[0][1]) * (e[1][0] - e[0][0])) / (e[1][1] - e[0][1]);
+
+export const corners = [
+	corner([199.602, 46.0254], [279.29, 0], [xAt(edges.upperLeft, 0), 0], 1),
+	corner([504.249, 558], [426.864, 600], [xAt(edges.lowerRight, 600), 600], -1)
+];
+
+/** Extend the line through a and b to the edges of a box (x0, y0, x1, y1). */
+export function extend(a: Pt, b: Pt, box: [number, number, number, number]): [Pt, Pt] {
+	const [x0, y0, x1, y1] = box;
+	const dx = b[0] - a[0],
+		dy = b[1] - a[1];
+	const ts: number[] = [];
+
+	if (dx) ts.push((x0 - a[0]) / dx, (x1 - a[0]) / dx);
+
+	if (dy) ts.push((y0 - a[1]) / dy, (y1 - a[1]) / dy);
+
+	const inside = ts
+		.map((t) => [a[0] + dx * t, a[1] + dy * t] as Pt)
+		.filter(([x, y]) => x >= x0 - 1e-6 && x <= x1 + 1e-6 && y >= y0 - 1e-6 && y <= y1 + 1e-6);
+
+	inside.sort((p, q) => p[0] - q[0] || p[1] - q[1]);
+
+	return [inside[0], inside.at(-1)!];
+}
diff --git a/ui/apps/chat/tests/stories/brand/logo-showcase/lib/styles/logo.css b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/styles/logo.css
new file mode 100644
index 000000000..59afe43b4
--- /dev/null
+++ b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/styles/logo.css
@@ -0,0 +1,50 @@
+/* The logo showcase's colours, shared by every drawing (the blueprint, the origin animation, the step tiles and the
+   rule panels). Grayscale after the brand: black icon on light grey in light mode, white icon on near-black in dark
+   mode; construction lines in a mid grey that reads over both the icon and the ground. Greys follow the llama.cpp
+   design system's neutrals. Dark mode follows the design system's .dark class on <html>. */
+:root {
+	--l-bg: oklch(0.97 0 0); /* neutral-100 */
+	--l-shape: #111111;
+	--l-shape-2: #6b6b6b;
+	--l-faint: rgba(17, 17, 17, 0.16);
+	--l-line: oklch(0.708 0 0); /* neutral-400 */
+	--l-ink: #111111;
+	--l-muted: oklch(0.556 0 0); /* fg-muted */
+	--l-panel: oklch(1 0 0); /* surface-raised */
+	--l-rule: oklch(0.922 0 0); /* line-field */
+	--l-mark: #ee6c1e; /* cinder, the one accent: marks a detail, such as the L's empty centre */
+	--l-bolt: #ee6c1e; /* cinder, as in the .cpp of the llama.cpp lockup: the L flashes in it */
+	/* the lightning: a white-hot core, a yellow glow around it and a blue halo beyond; the L flashes in --l-bolt */
+	--l-bolt-core: #ffffff;
+	--l-bolt-glow: #ffd23f;
+	--l-bolt-halo: #3d8bff;
+	--l-ink-glow: 0.3; /* the L's glow in light mode, where it is black */
+	/* the strike's night sky, light mode only */
+	--l-night: 1;
+	--l-night-sky: oklch(0.16 0 0);
+	--l-night-ink: #fafafa;
+	/* in light mode the bolt is solid, so it reads crisply inside the black L (see-through yellow over black turns olive) */
+	--l-bolt-alpha: 1;
+	--l-bolt-tint: 0;
+	--l-paper: oklch(0.985 0 0); /* neutral-50 */
+	--l-grid: rgba(17, 17, 17, 0.05);
+	--l-grid-major: rgba(17, 17, 17, 0.13);
+}
+:root.dark {
+	--l-bg: oklch(0.16 0 0);
+	--l-shape: #fafafa;
+	--l-shape-2: #9e9e9e;
+	--l-faint: rgba(250, 250, 250, 0.18);
+	--l-line: oklch(0.439 0 0);
+	--l-ink: #fafafa;
+	--l-muted: oklch(0.708 0 0);
+	--l-panel: oklch(0.205 0 0);
+	--l-rule: oklch(1 0 0 / 0.12);
+	--l-bolt-alpha: 0.85;
+	--l-bolt-tint: 0.3;
+	--l-ink-glow: 1;
+	--l-night: 0;
+	--l-paper: oklch(0.205 0 0);
+	--l-grid: rgba(250, 250, 250, 0.05);
+	--l-grid-major: rgba(250, 250, 250, 0.13);
+}
diff --git a/ui/apps/chat/tests/stories/brand/logo-usage/IconUsage.svelte b/ui/apps/chat/tests/stories/brand/logo-usage/IconUsage.svelte
new file mode 100644
index 000000000..e7658f03b
--- /dev/null
+++ b/ui/apps/chat/tests/stories/brand/logo-usage/IconUsage.svelte
@@ -0,0 +1,966 @@
+<!--
+	How the Llama icon is used, one case per section (section picks which; each is a story of Brand/Logo/Usage, but
+	the splash screens, which are UI/Foundations/Brand): as its two glyphs of Llama Sans (U+E000 for text, U+E001, the
+	capital form at the lockup's proportion) in display type and buttons, the two lockups in context (Llama in Sans,
+	llama.cpp in Mono), in a download badge and in running text, then as the web app's favicon, PWA, maskable and Apple
+	touch icons and its splash screens, with their proportions and placement drawn in, the native apps' icons as they
+	ship (from ggml-org/Llama-macOS and Llama-Windows), and in the social avatars, with how it is optically centred in
+	a circle. The app icons follow Llama Chat's own pwa-assets.config.ts (PWA_ASSET_GENERATOR) and
+	make-icons-circular.js, but are drawn with the L: the files it ships still carry the old llama.cpp mark. It sits
+	in the logo showcase's frame (ShowcaseFrame), on its colours.
+-->
+<script lang="ts">
+	import {
+		MAC_DOCK_PLACEHOLDERS,
+		MacDock,
+		MacMenuBar,
+		MockDesktop,
+		WINDOWS_TASKBAR_PLACEHOLDERS,
+		WindowsTaskbar
+	} from '../../../../.storybook/mockups';
+	import macosIcon from '../assets/files/native/macos/icon_512x512@2x.png';
+	import windowsIcon from '../assets/files/native/windows/Square44x44Logo.scale-400.png';
+	import windowsTile from '../assets/files/native/windows/Square150x150Logo.scale-400.png';
+	import OpticalCentre from '../assets/OpticalCentre.svelte';
+	import { PATHS, SIZE } from '../logo-showcase/lib/logo';
+	import avatarSvg from '@ggml-org/llama-brand/logo/svg/social/x/x-avatar-light.svg?raw';
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import { Download } from '@lucide/svelte';
+	import { PWA_ASSET_GENERATOR, THEME_COLORS } from '#lib/constants/index.ts';
+
+	// the inks of llama-brand's light and dark favicons
+	const FAVICON_COLORS = { DARK: '#fafafa', LIGHT: '#111111' } as const;
+
+	// @vite-pwa/assets-generator's default padding for the maskable and Apple touch icons
+	const GENERATOR_ICON_PADDING = 0.3;
+	// make-icons-circular.js scales the maskable icon to 85% before cutting the circle
+	const CIRCULAR_ICON_SCALE = 0.85;
+	// the icon sits 1/40 of its height above centre and 1/100 of its width left of it, in a square or a circle: its
+	// weight is low (the wide bottom bar), so mathematically centred it reads as sitting low, and so placed a circle
+	// round it clears its rounded corners, sharp corners and middle tips nearly evenly (as in the brand's -bg files,
+	// social avatars and app icons)
+	const OPTICAL_LIFT = 1 / 40;
+	const OPTICAL_NUDGE = 1 / 100;
+
+	// every output starts from favicon.svg, the icon already shrunk by the favicon padding
+	const favicon = 1 - PWA_ASSET_GENERATOR.FAVICON_PADDING;
+	const square = (1 - GENERATOR_ICON_PADDING) * favicon;
+	const circle = CIRCULAR_ICON_SCALE * square;
+	// the splash icon is fitted into this share of the screen's shorter side
+	const splash = (1 - PWA_ASSET_GENERATOR.SPLASH_PADDING) * favicon;
+
+	const percent = (f: number) => `${Math.round(f * 1000) / 10}%`;
+
+	// the social avatar's icon placement, read from its file: its side, and the icon's translate and scale
+	const avatar = (() => {
+		const [, x, y, scale] = avatarSvg
+			.match(/translate\(([\d.]+) ([\d.]+)\) scale\(([\d.]+)\)/)!
+			.map(Number);
+
+		return { scale, size: Number(avatarSvg.match(/width="(\d+)"/)![1]), x, y };
+	})();
+
+	// the native apps' icons as they ship: the macOS one hand-made as an appiconset, the Windows ones as the
+	// package's assets
+	const nativeIcons = [
+		{
+			files: 'AppIcon.appiconset, 16 to 1024',
+			href: 'https://github.com/ggml-org/Llama-macOS/tree/main/Llama/Assets.xcassets/AppIcon.appiconset',
+			label: 'macOS',
+			spec: ['white icon on a #3F4040 squircle', 'Apple’s 824 plate on 1024'],
+			src: macosIcon
+		},
+		{
+			files: 'Square44x44Logo.*.png',
+			href: 'https://github.com/ggml-org/Llama-Windows/tree/main/Assets',
+			label: 'Windows, taskbar',
+			spec: ['white icon on #111111', 'icon 66% of the square'],
+			src: windowsIcon
+		},
+		{
+			files: 'Square150x150Logo.*.png',
+			href: 'https://github.com/ggml-org/Llama-Windows/tree/main/Assets',
+			label: 'Windows, Start tile',
+			spec: ['white icon on #111111', 'with a wide 310 × 150 tile'],
+			src: windowsTile
+		}
+	];
+
+	// the native apps where their OS puts them: Llama in the Dock (running, its name label showing), its status item in
+	// the menu bar, and on the Windows taskbar (active) and in its tray
+	const dockApps = [
+		...MAC_DOCK_PLACEHOLDERS.slice(0, 3),
+		{ icon: macosIcon, name: 'Llama', running: true },
+		...MAC_DOCK_PLACEHOLDERS.slice(3)
+	];
+	const taskbarApps = [
+		...WINDOWS_TASKBAR_PLACEHOLDERS.slice(0, 2),
+		{ active: true, icon: windowsIcon, name: 'Llama', running: true },
+		...WINDOWS_TASKBAR_PLACEHOLDERS.slice(2)
+	];
+	// Windows' tray icon: the icon alone, as llama.ico and llama-white.ico are, in the taskbar's ink
+	const trayIcon = { paths: PATHS, viewBox: `0 0 ${SIZE} ${SIZE}` };
+
+	interface AppIcon {
+		background: string | null; // null: transparent, shown on a checkerboard (a dark one for a light icon)
+		dark?: boolean;
+		files: string;
+		guide?: 'apple' | 'safe';
+		ink: string;
+		label: string;
+		round?: boolean;
+		scale: number;
+		spec: string[];
+	}
+
+	const icons: AppIcon[] = [
+		{
+			background: null,
+			files: 'favicon.svg, favicon.ico',
+			ink: FAVICON_COLORS.LIGHT,
+			label: 'Favicon',
+			scale: favicon,
+			spec: [
+				`icon ${percent(favicon)} of the canvas`,
+				`${percent((1 - favicon) / 2)} margin all round`,
+				'transparent, ink for light tabs'
+			]
+		},
+		{
+			background: null,
+			dark: true,
+			files: 'favicon-dark.svg, favicon-dark.ico',
+			ink: FAVICON_COLORS.DARK,
+			label: 'Favicon, dark',
+			scale: favicon,
+			spec: [
+				`icon ${percent(favicon)} of the canvas`,
+				'transparent, light for dark tabs',
+				'picked by prefers-color-scheme'
+			]
+		},
+		{
+			background: THEME_COLORS.BACKGROUND_LIGHT,
+			files: 'pwa-64x64, -192x192, -512x512.png',
+			ink: FAVICON_COLORS.LIGHT,
+			label: 'PWA',
+			round: true,
+			scale: circle,
+			spec: [
+				`icon ${percent(circle)} of the circle`,
+				'the maskable icon at 85%, cut round',
+				'white, transparent outside'
+			]
+		},
+		{
+			background: THEME_COLORS.BACKGROUND_LIGHT,
+			files: 'maskable-icon-512x512.png',
+			guide: 'safe',
+			ink: FAVICON_COLORS.LIGHT,
+			label: 'Maskable',
+			scale: square,
+			spec: [
+				`icon ${percent(square)} of the square`,
+				'inside the 80% safe circle',
+				'launchers crop to any shape'
+			]
+		},
+		{
+			background: THEME_COLORS.BACKGROUND_LIGHT,
+			files: 'apple-touch-icon-180x180.png',
+			guide: 'apple',
+			ink: FAVICON_COLORS.LIGHT,
+			label: 'Apple touch',
+			scale: square,
+			spec: [
+				`icon ${percent(square)} of the square`,
+				'square file, white',
+				'iOS rounds the corners'
+			]
+		}
+	];
+
+	const splashes = [
+		{
+			background: THEME_COLORS.BACKGROUND_LIGHT,
+			files: 'apple-splash-portrait-*.png',
+			h: 2556,
+			ink: FAVICON_COLORS.LIGHT,
+			label: 'iPhone',
+			w: 1179
+		},
+		{
+			background: THEME_COLORS.BACKGROUND_DARK,
+			files: 'apple-splash-portrait-dark-*.png',
+			h: 2556,
+			ink: FAVICON_COLORS.DARK,
+			label: 'iPhone, dark',
+			w: 1179
+		},
+		{
+			background: THEME_COLORS.BACKGROUND_LIGHT,
+			files: 'apple-splash-landscape-*.png',
+			h: 2048,
+			ink: FAVICON_COLORS.LIGHT,
+			label: 'iPad, landscape',
+			w: 2732
+		}
+	];
+
+	// the icon placed in a w × h box at `scale` of its shorter side, centred, lifted and nudged optically
+	function placed(w: number, h: number, scale: number) {
+		const side = Math.min(w, h) * scale;
+		const x = (w - side) / 2 - side * OPTICAL_NUDGE;
+		const y = (h - side) / 2 - side * OPTICAL_LIFT;
+
+		return { side, transform: `translate(${x} ${y}) scale(${side / SIZE})`, x, y };
+	}
+
+	// llama.app's hero, the day sky and the night sky, as on the brand's boards
+	const NIGHT_SKY =
+		'radial-gradient(ellipse at 15% 10%, #22385c 0%, transparent 55%), radial-gradient(ellipse at 90% 95%, #1e3752 0%, transparent 50%), linear-gradient(160deg, #152238 0%, #172a42 55%, #1a3049 100%)';
+	const DAY_SKY =
+		'radial-gradient(ellipse at 15% 10%, #dcecfb 0%, transparent 55%), radial-gradient(ellipse at 90% 95%, #e8f2fc 0%, transparent 50%), linear-gradient(160deg, #c4ddf6 0%, #d0e4f7 55%, #dfecf9 100%)';
+
+	const badges = [
+		{ name: 'Llama', platform: 'macOS', top: 'Download for' },
+		{ name: 'llama.cpp', platform: 'GitHub', top: 'Get it on' }
+	];
+
+	let {
+		section
+	}: {
+		section: 'badge' | 'buttons' | 'context' | 'glyphs' | 'icons' | 'splash' | 'text';
+	} = $props();
+</script>
+
+<!-- 1. in type -->
+{#if section === 'glyphs'}
+	<p class="kicker">In Llama Sans · U+E002, U+E001 and U+E000</p>
+
+	<h2>Three glyphs of the font</h2>
+
+	<p>
+		The icon is a character of Llama Sans, in two sizes, so anything set in it can carry the mark
+		without an image, in the text's colour and weight. U+E001 is the one to reach for: the icon 1.24
+		times the cap height, centred on the capitals, with the lockup's gap after it. Use it in small
+		text, in controls and before a name, where a cap-height mark would read as smaller than the
+		letters. U+E000 sits on the baseline at exactly the cap height: keep it for headlines, where the
+		icon should sit quietly among large capitals and not stand out. In all caps, the case feature
+		swaps U+E000 for U+E001. U+E002 is the lockup: U+E001 with the space after it built in, typed
+		straight before the name, in Llama Sans or in Llama Mono, which carries it too.
+	</p>
+
+	<div class="display" data-readme="icon-glyphs">
+		<p class="lockup mono">llama.cpp</p>
+
+		<p class="lockup">Llama</p>
+	</div>
+
+	<div class="pair" data-readme="icon-glyphs">
+		<p>
+			<span class="tag">U+E002 · the lockup</span><span class="small-sample">Llama</span>
+		</p>
+
+		<p>
+			<span class="tag">U+E001 · small text, controls, names</span><span class="small-sample"
+				>Models run locally in  Llama.</span
+			>
+		</p>
+
+		<p>
+			<span class="tag">U+E000 · headlines</span><span class="sample">Run it in  Llama</span>
+		</p>
+	</div>
+{/if}
+
+<!-- 2. in buttons -->
+{#if section === 'buttons'}
+	<p class="kicker">In buttons</p>
+
+	<h2>Open in Llama</h2>
+
+	<p>
+		Buttons always take the capital glyph, U+E001: at a label's size the cap-height glyph reads as
+		smaller than the letters beside it. As a glyph, the icon centres on the button's line box like
+		the label's capitals, with a word space after it, so it needs no icon slot and no nudging. These
+		are the design system's own buttons.
+	</p>
+
+	<div class="buttons" data-readme="icon-buttons">
+		<div class="row">
+			<Button size="sm"><span class="glyph"></span> Open in Llama</Button>
+
+			<Button><span class="glyph"></span> Open in Llama</Button>
+
+			<Button size="lg"><span class="glyph"></span> Open in Llama</Button>
+		</div>
+
+		<div class="row">
+			<Button variant="outline"><span class="glyph"></span> llama.app</Button>
+
+			<Button variant="secondary"><span class="glyph"></span> Run with llama.cpp</Button>
+
+			<Button variant="ghost"><span class="glyph"></span> llama.cpp</Button>
+
+			<Button aria-label="Llama" size="icon" variant="outline"><span class="glyph"></span></Button>
+		</div>
+	</div>
+{/if}
+
+<!-- 3. the lockups: Llama in Llama Sans, llama.cpp in Llama Mono -->
+{#if section === 'context'}
+	<p class="kicker">The lockups in context</p>
+
+	<h2>Where the name goes</h2>
+
+	<p>
+		The two lockups at the sizes they are used at: the README banner, app headers, a terminal, a
+		footer and a hero. Llama, the app, is set in Llama Sans with its capital L; llama.cpp, the
+		engine, in Llama Mono and all lowercase, as it is typed in a terminal. Both start with the
+		lockup glyph, U+E002: the capital icon with the gap built in, so the lockup is one character and
+		the name. Llama Mono's is drawn a little larger: with the icons matched, llama.cpp's wider,
+		heavier letters set at 90% of Llama's. The llama.cpp lockup always sits on a neutral ground
+		(white, the greys, ink); only the Llama lockup goes on colour, the day sky and the night sky.
+	</p>
+
+	<div class="contexts">
+		<!-- the README banner, as on github.com/ggml-org/llama.cpp: the cover, 3:1, the lockup centred at its size -->
+		{#each ['dark', 'light'] as const as tone (tone)}
+			<div class="ctx banner mono {tone}" data-readme="banner-llama-cpp">
+				<span class="mark">llama<span class="cpp">.cpp</span></span>
+			</div>
+		{/each}
+
+		<div class="ctx header mono" data-readme="lockup-in-context">
+			<span style:font-size="16.2px" class="mark">llama<span class="cpp">.cpp</span></span>
+
+			<span class="links">docs · server · cli</span>
+
+			<Button size="sm">Download</Button>
+		</div>
+
+		<div class="ctx header dark" data-readme="lockup-in-context">
+			<span style:font-size="16px" class="mark">Llama</span>
+
+			<span class="links">Settings</span>
+		</div>
+
+		<!-- terminal output: Llama Mono's own one-cell icon, so the columns line up -->
+		<pre class="ctx terminal" data-readme="lockup-in-context"><span class="prompt">$</span
+			> llama-server -m model.gguf --port 9931
+<span class="banner"> llama.cpp</span> b6123 · listening on http://127.0.0.1:9931
+<span class="banner"> llama.cpp</span> b6123 · slot 0 ready, ctx 32768</pre>
+
+		<div class="ctx footer mono" data-readme="lockup-in-context">
+			<span style:font-size="11.7px" class="mark">llama<span class="cpp">.cpp</span></span>
+
+			<span class="links">MIT licence · ggml-org</span>
+		</div>
+
+		<!-- the hero, on the day sky and the night sky: the Llama lockup (llama.cpp's stays on neutral grounds) -->
+		{#each [{ field: DAY_SKY, ink: '#111111', name: 'day sky' }, { field: NIGHT_SKY, ink: '#fafafa', name: 'night sky' }] as b (b.name)}
+			<div
+				style:background={b.field}
+				style:color={b.ink}
+				class="ctx hero"
+				data-readme="banner-llama"
+			>
+				<span style:font-size="clamp(40px, 7vw, 64px)" class="mark">Llama</span>
+			</div>
+		{/each}
+	</div>
+{/if}
+
+<!-- 4. a download badge -->
+{#if section === 'badge'}
+	<p class="kicker">Download badge</p>
+
+	<h2>Get the app</h2>
+
+	<p>
+		Our own equivalent of a store badge, for links to download Llama or get llama.cpp: a dark key
+		with the icon at the height of its two lines and a small line over the name. 48 px high (40 for
+		a compact one), radius 10, the icon the capital glyph (U+E001) at 18 px, 14 from the left edge
+		and 10 from the text.
+	</p>
+
+	<div class="badges" data-readme="icon-badges">
+		{#each badges as b (b.name)}
+			{#each ['dark', 'light'] as const as tone (tone)}
+				<a class="badge {tone}" href="#top" onclick={(e) => e.preventDefault()}>
+					<span aria-hidden="true" class="badge-icon"></span>
+
+					<span class="badge-text">
+						<span class="badge-top">{b.top}</span>
+
+						<span class="badge-name">{b.platform}</span>
+					</span>
+				</a>
+			{/each}
+		{/each}
+
+		<a class="badge dark compact" href="#top" onclick={(e) => e.preventDefault()}>
+			<span aria-hidden="true" class="badge-icon"></span>
+
+			<span class="badge-text">
+				<span class="badge-top">Download for</span>
+
+				<span class="badge-name">macOS</span>
+			</span>
+		</a>
+
+		<a class="badge light compact" href="#top" onclick={(e) => e.preventDefault()}>
+			<Download aria-hidden="true" class="badge-lucide" />
+
+			<span class="badge-text">
+				<span class="badge-top">Get the model</span>
+
+				<span class="badge-name">GGUF</span>
+			</span>
+		</a>
+	</div>
+{/if}
+
+<!-- 5. in running text -->
+{#if section === 'text'}
+	<p class="kicker">In running text</p>
+
+	<h2>Inline, at any size</h2>
+
+	<p>
+		In small text the icon takes its capital form, U+E001, so it holds its own next to the letters;
+		in a headline, the cap-height U+E000 sits quietly among the capitals. Use it before the name it
+		stands for, never as a word on its own.
+	</p>
+
+	<div class="inline" data-readme="icon-inline">
+		<p style:font-size="14px">
+			Models load with  llama.cpp and run locally in  Llama, on your own machine.
+		</p>
+
+		<p style:font-size="17px">
+			Models load with  llama.cpp and run locally in  Llama, on your own machine.
+		</p>
+
+		<p class="big">Run it in  Llama.</p>
+	</div>
+{/if}
+
+<!-- 6. app icons -->
+{#if section === 'icons'}
+	<p class="kicker">App icons and avatars</p>
+
+	<h2>On the tab, the home screen and the profile</h2>
+
+	<!-- first how the icon is placed, optically centred, which every icon below is built on -->
+	<p>
+		Every icon starts from the same placement. Centred exactly, the L reads low, its weight in the
+		wide foot; so the icon is lifted {Math.round(OPTICAL_LIFT * 1000) / 10}% of its height and
+		nudged
+		{Math.round(OPTICAL_NUDGE * 1000) / 10}% of its width left, and looks centred. Cut to a circle,
+		as in the social avatars and the PWA icon, it then clears the circle's edge at its corners and
+		tips nearly evenly. Drawn from the avatar file itself, the icon at 56% of a square, which every
+		platform crops round.
+	</p>
+
+	<div class="optical">
+		<OpticalCentre placement={avatar} />
+	</div>
+
+	<p class="icons-intro">
+		The web app's favicon, PWA, maskable and Apple touch icons, with their proportions drawn in. All
+		of them start from the favicon, the icon with a {percent(
+			PWA_ASSET_GENERATOR.FAVICON_PADDING / 2
+		)} margin; the square icons add the generator's 30% padding, and the PWA icon is the maskable one
+		at 85%, cut round. The files Llama Chat ships still carry the old llama.cpp mark; these are drawn
+		with the L.
+	</p>
+
+	<div class="icons">
+		{#each icons as icon (icon.label)}
+			{@const p = placed(100, 100, icon.scale)}
+			<figure class="icon-card">
+				<svg
+					class:checker={!icon.background}
+					class:checker-dark={!icon.background && icon.dark}
+					class="icon-art"
+					viewBox="0 0 100 100"
+				>
+					{#if icon.background}
+						{#if icon.round}
+							<circle cx="50" cy="50" fill={icon.background} r="50" />
+						{:else}
+							<rect fill={icon.background} height="100" width="100" />
+						{/if}
+					{/if}
+
+					<g fill={icon.ink} transform={p.transform}>
+						{#each PATHS as d (d)}<path {d} />{/each}
+					</g>
+
+					<!-- the icon's box -->
+					<rect class="guide" height={p.side} width={p.side} x={p.x} y={p.y} />
+
+					{#if icon.guide === 'safe'}
+						<circle class="guide safe" cx="50" cy="50" r="40" />
+					{:else if icon.guide === 'apple'}
+						<rect class="guide safe" height="100" rx="22.5" width="100" />
+					{/if}
+				</svg>
+
+				<figcaption>
+					<span class="icon-label">{icon.label}</span>
+
+					{#each icon.spec as line (line)}<span class="icon-spec">{line}</span>{/each}
+
+					<span class="icon-files">{icon.files}</span>
+				</figcaption>
+			</figure>
+		{/each}
+	</div>
+
+	<!-- the native apps' icons as they ship, from ggml-org/Llama-macOS and ggml-org/Llama-Windows -->
+	<p class="icon-label native-title">Native app icons</p>
+
+	<div class="icons">
+		{#each nativeIcons as icon (icon.label)}
+			<figure class="icon-card">
+				<img alt={icon.label} class="icon-art native-art" src={icon.src} />
+
+				<figcaption>
+					<a class="icon-label" href={icon.href}>{icon.label}</a>
+
+					{#each icon.spec as line (line)}<span class="icon-spec">{line}</span>{/each}
+
+					<span class="icon-files">{icon.files}</span>
+				</figcaption>
+			</figure>
+		{/each}
+	</div>
+
+	<!-- the native apps in place, light and dark: a Mac's desktop, the menu bar over the Dock, and a PC's taskbar -->
+	<div class="in-place" data-readme="icon-in-place">
+		{#each ['light', 'dark'] as const as mode (mode)}
+			<figure class="in-place-card">
+				<MockDesktop align="between" height={250} {mode}>
+					<MacMenuBar {mode} />
+
+					<MacDock apps={dockApps} labelled="Llama" {mode} />
+				</MockDesktop>
+
+				<figcaption class="icon-label">macOS, the menu bar and the Dock, {mode}</figcaption>
+			</figure>
+
+			<figure class="in-place-card">
+				<MockDesktop align="bottom" height={170} {mode}>
+					<WindowsTaskbar apps={taskbarApps} {mode} {trayIcon} />
+				</MockDesktop>
+
+				<figcaption class="icon-label">Windows, the taskbar and the tray, {mode}</figcaption>
+			</figure>
+		{/each}
+	</div>
+{/if}
+
+<!-- 7. splash screens -->
+{#if section === 'splash'}
+	<p class="kicker">Splash screens</p>
+
+	<h2>While the app opens</h2>
+
+	<p>
+		For now the splash screens are the icon alone, centred on the light or dark page colour at
+		{percent(splash)} of the screen's shorter side, for every iPhone and iPad size, upright and on its
+		side. A designed splash screen will follow.
+	</p>
+
+	<div class="splashes" data-readme="icon-splash">
+		{#each splashes as s (s.label)}
+			{@const p = placed(s.w, s.h, splash)}
+			<figure class="splash-card">
+				<svg style:aspect-ratio="{s.w} / {s.h}" class="splash-art" viewBox="0 0 {s.w} {s.h}">
+					<rect fill={s.background} height={s.h} width={s.w} />
+
+					<g fill={s.ink} transform={p.transform}>
+						{#each PATHS as d (d)}<path {d} />{/each}
+					</g>
+
+					<rect class="guide" height={p.side} width={p.side} x={p.x} y={p.y} />
+				</svg>
+
+				<figcaption>
+					<span class="icon-label">{s.label}</span>
+
+					<span class="icon-spec">{s.w} × {s.h} · icon {Math.round(p.side)} px</span>
+
+					<span class="icon-files">{s.files}</span>
+				</figcaption>
+			</figure>
+		{/each}
+	</div>
+{/if}
+
+<style>
+	.glyph {
+		font-family: 'Llama Sans', var(--body);
+	}
+
+	/* 1 */
+	.display {
+		display: grid;
+		gap: 4px;
+	}
+	.lockup {
+		margin: 0;
+		font:
+			700 clamp(48px, 9vw, 112px) / 1.15 'Llama Sans',
+			var(--body);
+	}
+	/* llama.cpp's U+E002 is 1 / 0.9 times Llama Sans's: at 90% of the size the icon matches Llama's, the name smaller */
+	.lockup.mono {
+		font-family: var(--mono);
+		font-size: clamp(43px, 8.1vw, 101px);
+	}
+
+	/* 2 */
+	.buttons {
+		display: grid;
+		gap: 16px;
+		padding: clamp(20px, 3vw, 32px);
+		border-radius: 16px;
+		background: var(--l-panel);
+	}
+	.row {
+		display: flex;
+		flex-wrap: wrap;
+		align-items: center;
+		gap: 10px;
+	}
+
+	.pair {
+		display: flex;
+		flex-wrap: wrap;
+		gap: 12px 40px;
+	}
+	.pair p {
+		display: grid;
+		gap: 4px;
+		margin: 0;
+	}
+	.tag {
+		margin: 0;
+		font: 500 11px var(--mono);
+		letter-spacing: 0.08em;
+		text-transform: uppercase;
+		color: var(--l-muted);
+	}
+	.small-sample {
+		font:
+			400 15px / 1.5 'Llama Sans',
+			var(--body);
+	}
+	.sample {
+		font:
+			700 44px / 1.15 'Llama Sans',
+			var(--body);
+	}
+
+	/* 3 */
+	.contexts {
+		display: grid;
+		gap: 12px;
+	}
+	.ctx {
+		display: flex;
+		align-items: center;
+		gap: 16px;
+		min-width: 0;
+		padding: 0 16px;
+		border-radius: 14px;
+		background: var(--l-panel);
+		color: var(--l-ink);
+		overflow: hidden;
+	}
+	.ctx .mark {
+		flex: none;
+		font-family: 'Llama Sans', var(--body);
+		font-weight: 700;
+		line-height: 1;
+		white-space: nowrap;
+	}
+	.ctx .cpp {
+		color: var(--art-cinder);
+	}
+	.ctx .links {
+		margin-left: auto;
+		font:
+			400 13px / 1.25 'Llama Sans',
+			var(--body);
+		color: var(--l-muted);
+		white-space: nowrap;
+	}
+	.ctx.header {
+		height: 56px;
+		container-type: inline-size;
+	}
+	/* in a narrow header the links step aside, as they would in the app */
+	@container (max-width: 26rem) {
+		.ctx.header .links {
+			display: none;
+		}
+		.ctx.header :global(button) {
+			margin-left: auto;
+		}
+	}
+	.ctx.dark {
+		background: #111111;
+		color: #fafafa;
+	}
+	.ctx.dark .links {
+		color: rgb(250 250 250 / 0.6);
+	}
+	.ctx.footer {
+		height: 64px;
+	}
+	.ctx.hero {
+		justify-content: center;
+	}
+	.ctx.hero {
+		min-height: 220px;
+	}
+	/* the cover's proportions: 3:1, the icon about 16% of its height, so the type is 5.4% of its width */
+	.ctx.banner {
+		justify-content: center;
+		aspect-ratio: 3;
+		container-type: inline-size;
+		border-radius: 0;
+	}
+	.ctx.banner .mark {
+		font-size: 5.4cqw;
+	}
+	.ctx.banner.dark {
+		background: #111111;
+		color: #fafafa;
+	}
+	.ctx.banner.light {
+		background: #fafafa;
+		color: #111111;
+		box-shadow: inset 0 0 0 1px var(--l-rule);
+	}
+
+	/* llama.cpp's lockup in Llama Mono, which carries the same U+E002 */
+	.ctx.mono .mark,
+	.ctx.mono .links {
+		font-family: var(--mono);
+	}
+	.ctx.terminal {
+		display: block;
+		margin: 0;
+		padding: 16px;
+		background: #111111;
+		color: #fafafa;
+		font: 400 13px / 1.6 var(--mono);
+		overflow-x: auto;
+	}
+	.terminal .prompt {
+		color: rgb(250 250 250 / 0.5);
+	}
+	.terminal .banner {
+		color: var(--art-cinder);
+		font-weight: 700;
+	}
+
+	/* 4 */
+	.badges {
+		display: flex;
+		flex-wrap: wrap;
+		align-items: center;
+		gap: 12px;
+		padding: clamp(20px, 3vw, 32px);
+		border-radius: 16px;
+		background: var(--l-panel);
+	}
+	.badge {
+		display: inline-flex;
+		align-items: center;
+		gap: 10px;
+		height: 48px;
+		padding: 0 18px 0 14px;
+		border-radius: 10px;
+		text-decoration: none;
+	}
+	.badge.dark {
+		background: #111111;
+		color: #fafafa;
+		box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14);
+	}
+	.badge.light {
+		background: #fafafa;
+		color: #111111;
+		box-shadow: inset 0 0 0 1px rgb(17 17 17 / 0.16);
+	}
+	/* the capital glyph at 20 px: an 18 px icon */
+	.badge-icon {
+		font:
+			700 20px / 1 'Llama Sans',
+			var(--body);
+	}
+	.badge :global(.badge-lucide) {
+		width: 22px;
+		height: 22px;
+	}
+	.badge-text {
+		display: grid;
+		text-align: left;
+	}
+	.badge-top {
+		font:
+			500 10px / 1.2 'Llama Sans',
+			var(--body);
+		letter-spacing: 0.02em;
+		opacity: 0.75;
+	}
+	.badge-name {
+		font:
+			600 18px / 1.15 'Llama Sans',
+			var(--body);
+		letter-spacing: -0.01em;
+	}
+	.badge.compact {
+		height: 40px;
+		padding: 0 15px 0 12px;
+		gap: 8px;
+		border-radius: 8px;
+	}
+	.compact .badge-icon {
+		font-size: 17px;
+	}
+	.compact .badge-top {
+		font-size: 9px;
+	}
+	.compact .badge-name {
+		font-size: 15px;
+	}
+
+	/* 5 */
+	.inline {
+		display: grid;
+		gap: 12px;
+	}
+	.inline p {
+		margin: 0;
+		max-width: 62ch;
+		font-family: 'Llama Sans', var(--body);
+		line-height: 1.5;
+	}
+	.inline .big {
+		font:
+			700 clamp(28px, 4vw, 44px) / 1.15 'Llama Sans',
+			var(--body);
+	}
+
+	/* 6 and 7 */
+	.icons {
+		display: grid;
+		grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
+		gap: 20px;
+	}
+	.splashes {
+		display: flex;
+		flex-wrap: wrap;
+		align-items: flex-end;
+		gap: 24px;
+	}
+	figure {
+		display: grid;
+		gap: 10px;
+		align-content: start;
+		margin: 0;
+	}
+	.icon-art {
+		display: block;
+		width: 100%;
+		aspect-ratio: 1;
+		border-radius: 12px;
+		background: var(--l-panel);
+	}
+	.icon-art.checker {
+		/* fixed, like the tab it shows on: light for the dark icon, dark for the light one */
+		background: repeating-conic-gradient(#ebebeb 0 25%, #fafafa 0 50%) 0 0 / 12px 12px;
+	}
+	.icon-art.checker-dark {
+		background: repeating-conic-gradient(#1f1f1f 0 25%, #111111 0 50%) 0 0 / 12px 12px;
+	}
+	.splash-art {
+		display: block;
+		height: clamp(180px, 30vw, 280px);
+		border-radius: 12px;
+		box-shadow: 0 0 0 1px var(--l-rule);
+	}
+	.guide {
+		fill: none;
+		stroke: var(--l-mark);
+		stroke-width: 1px;
+		stroke-dasharray: 3 3;
+		vector-effect: non-scaling-stroke;
+	}
+	.guide.safe {
+		stroke: var(--l-muted);
+	}
+	figcaption {
+		display: grid;
+		gap: 2px;
+	}
+	.icon-label {
+		font:
+			600 15px / 1.3 'Llama Sans',
+			var(--body);
+	}
+	.icon-spec {
+		font:
+			400 13px / 1.4 'Llama Sans',
+			var(--body);
+		color: var(--l-muted);
+	}
+	.icon-files {
+		margin-top: 2px;
+		font: 500 11px / 1.4 var(--mono);
+		color: var(--l-muted);
+		overflow-wrap: anywhere;
+	}
+	.optical {
+		max-width: 54rem;
+		margin-top: 2rem;
+	}
+	/* the icons' lead, after the placement, set like the section's own under its heading */
+	.icons-intro {
+		max-width: 62ch;
+		margin-top: 2.5rem;
+		color: var(--l-muted);
+		font:
+			400 17px / 1.5 'Llama Sans',
+			var(--body);
+	}
+	/* the native apps' icons: their files as they are, on their own grounds */
+	.native-title {
+		margin-top: 2.5rem;
+		margin-bottom: -20px;
+	}
+	.native-art {
+		border-radius: 0;
+		background: transparent;
+		object-fit: contain;
+	}
+	/* the native apps in place, each desktop across */
+	.in-place {
+		display: grid;
+		gap: 24px;
+	}
+	.in-place-card {
+		display: grid;
+		gap: 8px;
+		min-width: 0;
+		margin: 0;
+	}
+</style>
diff --git a/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsList.stories.svelte b/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsList.stories.svelte
new file mode 100644
index 000000000..a145cef3a
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsList.stories.svelte
@@ -0,0 +1,141 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import {
+		audioAttachment,
+		gradientAttachment,
+		imageAttachment,
+		logoAttachment,
+		mcpPromptAttachment,
+		mcpResourceAttachment,
+		notesAttachment,
+		pdfAsImagesAttachment,
+		pdfAttachment,
+		textAttachment,
+		uploadedArchive,
+		uploadedAudio,
+		uploadedGradient,
+		uploadedImage,
+		uploadedLogo,
+		uploadedMcpPrompt,
+		uploadedMcpPromptError,
+		uploadedMcpPromptLoading,
+		uploadedNotes,
+		uploadedPdf,
+		uploadedText,
+		uploadedVideo,
+		videoAttachment
+	} from '../screen/fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatAttachmentsList from '#lib/components/app/chat/ChatAttachments/ChatAttachmentsList/ChatAttachmentsList.svelte';
+
+	const { Story } = defineMeta({
+		component: ChatAttachmentsList,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatAttachments/ChatAttachmentsList'
+	});
+
+	const onFileRemove = (id: string) => console.log('remove', id);
+</script>
+
+<Story asChild name="States">
+	<StateGallery columns={1}>
+		<StateGalleryItem label="Pending uploads" note="chat form, removable">
+			<ChatAttachmentsList
+				class="w-[40rem]"
+				{onFileRemove}
+				uploadedFiles={[uploadedImage, uploadedText, uploadedPdf]}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Images only" note="readonly">
+			<ChatAttachmentsList
+				attachments={[imageAttachment, logoAttachment, gradientAttachment]}
+				class="w-[40rem]"
+				imageHeight="h-48"
+				imageWidth="max-w-72"
+				readonly
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Files only">
+			<ChatAttachmentsList
+				class="w-[40rem]"
+				{onFileRemove}
+				uploadedFiles={[
+					uploadedText,
+					uploadedNotes,
+					uploadedPdf,
+					uploadedAudio,
+					uploadedVideo,
+					uploadedArchive
+				]}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Mixed, removable">
+			<ChatAttachmentsList
+				class="w-[40rem]"
+				{onFileRemove}
+				uploadedFiles={[uploadedImage, uploadedLogo, uploadedText, uploadedPdf, uploadedAudio]}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Mixed, readonly" note="as shown in a sent message">
+			<ChatAttachmentsList
+				attachments={[
+					imageAttachment,
+					textAttachment,
+					pdfAttachment,
+					pdfAsImagesAttachment,
+					audioAttachment,
+					videoAttachment
+				]}
+				class="w-[40rem]"
+				imageHeight="h-48"
+				imageWidth="max-w-72"
+				readonly
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Readonly text file">
+			<ChatAttachmentsList attachments={[notesAttachment]} class="w-[40rem]" readonly />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="MCP prompts" note="ready, loading, error">
+			<ChatAttachmentsList
+				class="w-[40rem]"
+				{onFileRemove}
+				uploadedFiles={[uploadedMcpPrompt, uploadedMcpPromptLoading, uploadedMcpPromptError]}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="MCP, readonly">
+			<ChatAttachmentsList
+				attachments={[mcpPromptAttachment, mcpResourceAttachment]}
+				class="w-[40rem]"
+				readonly
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Single row overflow">
+			<ChatAttachmentsList
+				class="w-[28rem]"
+				limitToSingleRow
+				{onFileRemove}
+				uploadedFiles={[
+					uploadedImage,
+					uploadedLogo,
+					uploadedGradient,
+					uploadedText,
+					uploadedNotes,
+					uploadedPdf,
+					uploadedAudio,
+					uploadedVideo
+				]}
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsListItemMcpResource.stories.svelte b/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsListItemMcpResource.stories.svelte
new file mode 100644
index 000000000..5553ee002
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsListItemMcpResource.stories.svelte
@@ -0,0 +1,61 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import {
+		mcpResourceAttachment,
+		mcpResourceImageAttachment,
+		toMcpResourceAttachment
+	} from '../screen/fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatAttachmentsListItemMcpResource from '#lib/components/app/chat/ChatAttachments/ChatAttachmentsList/ChatAttachmentsListItem/ChatAttachmentsListItemMcpResource.svelte';
+
+	const { Story } = defineMeta({
+		component: ChatAttachmentsListItemMcpResource,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatAttachments/ChatAttachmentsListItemMcpResource'
+	});
+
+	const onclick = () => console.log('preview');
+</script>
+
+<Story asChild name="States">
+	<StateGallery columns={3}>
+		<StateGalleryItem label="Text resource">
+			<ChatAttachmentsListItemMcpResource
+				attachment={toMcpResourceAttachment(mcpResourceAttachment)}
+				{onclick}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Image resource">
+			<ChatAttachmentsListItemMcpResource
+				attachment={toMcpResourceAttachment(mcpResourceImageAttachment)}
+				{onclick}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Removable">
+			<ChatAttachmentsListItemMcpResource
+				attachment={toMcpResourceAttachment(mcpResourceAttachment)}
+				onRemove={(id: string) => console.log('remove', id)}
+				{onclick}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Loading">
+			<ChatAttachmentsListItemMcpResource
+				attachment={toMcpResourceAttachment(mcpResourceAttachment, { loading: true })}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Error">
+			<ChatAttachmentsListItemMcpResource
+				attachment={toMcpResourceAttachment(mcpResourceAttachment, {
+					error: 'Resource not found'
+				})}
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsPreview.stories.svelte b/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsPreview.stories.svelte
new file mode 100644
index 000000000..00c6a6d97
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsPreview.stories.svelte
@@ -0,0 +1,136 @@
+<script lang="ts" module>
+	import {
+		gradientAttachment,
+		imageAttachment,
+		logoAttachment,
+		pdfAttachment,
+		textAttachment,
+		uploadedArchive,
+		uploadedAudio,
+		uploadedVideo
+	} from '../screen/fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatAttachmentsPreview from '#lib/components/app/chat/ChatAttachments/ChatAttachmentsPreview/ChatAttachmentsPreview.svelte';
+	import { AttachmentType } from '#lib/enums/index.ts';
+	import { expect, waitFor } from 'storybook/test';
+
+	const { Story } = defineMeta({
+		component: ChatAttachmentsPreview,
+		parameters: {
+			layout: 'fullscreen'
+		},
+		title: 'Llama Chat/Chat/ChatAttachments/ChatAttachmentsPreview'
+	});
+
+	// same backdrop as DialogChatAttachmentsPreview
+	const frameClass = 'flex h-screen flex-col bg-neutral-950';
+
+	// valid base64 that is not a PDF: pdf.js throws InvalidPDFException
+	const brokenPdfAttachment: DatabaseMessageExtraPdfFile = {
+		base64Data: btoa('this is not a pdf'),
+		content: 'Extracted text of the broken PDF.',
+		name: 'broken.pdf',
+		processedAsImages: false,
+		size: 17,
+		type: AttachmentType.PDF
+	};
+</script>
+
+<!-- several items: nav buttons and thumbnail strip are shown -->
+<Story asChild name="Default">
+	<div class={frameClass}>
+		<ChatAttachmentsPreview
+			attachments={[imageAttachment, logoAttachment, gradientAttachment, textAttachment]}
+			class="min-h-0 flex-1"
+			previewFocusIndex={1}
+			uploadedFiles={[uploadedAudio, uploadedVideo]}
+		/>
+	</div>
+</Story>
+
+<Story asChild name="Image">
+	<div class={frameClass}>
+		<ChatAttachmentsPreview attachments={[imageAttachment]} class="min-h-0 flex-1" />
+	</div>
+</Story>
+
+<Story asChild name="Text">
+	<div class={frameClass}>
+		<ChatAttachmentsPreview attachments={[textAttachment]} class="min-h-0 flex-1" />
+	</div>
+</Story>
+
+<!-- pages come from the pre-rendered images of the stored attachment -->
+<Story asChild name="Pdf">
+	<div class={frameClass}>
+		<ChatAttachmentsPreview attachments={[pdfAttachment]} class="min-h-0 flex-1" />
+	</div>
+</Story>
+
+<!-- unknown model has no vision modality: shows the "Preview only" alert -->
+<Story asChild name="PdfWithoutVision">
+	<div class={frameClass}>
+		<ChatAttachmentsPreview
+			activeModelId="text-only-model"
+			attachments={[pdfAttachment]}
+			class="min-h-0 flex-1"
+		/>
+	</div>
+</Story>
+
+<Story asChild name="Audio">
+	<div class={frameClass}>
+		<ChatAttachmentsPreview class="min-h-0 flex-1" uploadedFiles={[uploadedAudio]} />
+	</div>
+</Story>
+
+<!-- no preview URL: no player -->
+<Story asChild name="AudioUnavailable">
+	<div class={frameClass}>
+		<ChatAttachmentsPreview
+			class="min-h-0 flex-1"
+			uploadedFiles={[{ ...uploadedAudio, preview: undefined }]}
+		/>
+	</div>
+</Story>
+
+<Story asChild name="Video">
+	<div class={frameClass}>
+		<ChatAttachmentsPreview class="min-h-0 flex-1" uploadedFiles={[uploadedVideo]} />
+	</div>
+</Story>
+
+<Story asChild name="VideoUnavailable">
+	<div class={frameClass}>
+		<ChatAttachmentsPreview
+			class="min-h-0 flex-1"
+			uploadedFiles={[{ ...uploadedVideo, preview: undefined }]}
+		/>
+	</div>
+</Story>
+
+<Story asChild name="Unavailable">
+	<div class={frameClass}>
+		<ChatAttachmentsPreview class="min-h-0 flex-1" uploadedFiles={[uploadedArchive]} />
+	</div>
+</Story>
+
+<!-- conversion fails once: shows the error and does not retry -->
+<Story
+	asChild
+	name="PdfConversionError"
+	play={async ({ canvas }) => {
+		await waitFor(() => expect(canvas.getByText('Failed to load PDF images')).toBeInTheDocument(), {
+			timeout: 5000
+		});
+
+		// a retry loop would flip back to the loading state
+		await new Promise((resolve) => setTimeout(resolve, 500));
+		await expect(canvas.queryByText('Converting PDF to images...')).not.toBeInTheDocument();
+		await expect(canvas.getByText('Failed to load PDF images')).toBeInTheDocument();
+	}}
+>
+	<div class={frameClass}>
+		<ChatAttachmentsPreview attachments={[brokenPdfAttachment]} class="min-h-0 flex-1" />
+	</div>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormActionReasoning.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormActionReasoning.stories.svelte
new file mode 100644
index 000000000..5abcd806d
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/form/ChatFormActionReasoning.stories.svelte
@@ -0,0 +1,56 @@
+<script lang="ts" module>
+	import {
+		modelServerProps,
+		ReasoningEffort,
+		resetPointerEvents,
+		seedStores,
+		ServerRole
+	} from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatFormActionReasoning from '#lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionReasoning.svelte';
+	import { screen } from 'storybook/test';
+
+	const { Story } = defineMeta({
+		beforeEach: resetPointerEvents,
+		component: ChatFormActionReasoning,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatForm/ChatFormActionReasoning'
+	});
+
+	function seedEffort(
+		reasoningEffort: ReasoningEffort,
+		serverProps: ApiLlamaCppServerProps = modelServerProps()
+	) {
+		return () => seedStores({ reasoningEffort, serverProps, serverRole: ServerRole.MODEL });
+	}
+
+	const templateLevelsProps = modelServerProps({
+		chat_template_caps: { reasoning_effort_levels: ['low', 'medium', 'high', 'xhigh'] }
+	});
+</script>
+
+<Story beforeEach={seedEffort(ReasoningEffort.DEFAULT)} name="Default" />
+
+<Story beforeEach={seedEffort(ReasoningEffort.OFF)} name="Off" />
+
+<Story beforeEach={seedEffort(ReasoningEffort.HIGH)} name="High" />
+
+<Story
+	beforeEach={seedEffort(ReasoningEffort.MEDIUM)}
+	name="MenuOpen"
+	play={async ({ canvas, userEvent }) => {
+		await userEvent.click(canvas.getByRole('button', { name: 'Reasoning effort' }));
+		await screen.findByRole('menu');
+	}}
+/>
+
+<Story
+	beforeEach={seedEffort(ReasoningEffort.XHIGH, templateLevelsProps)}
+	name="TemplateLevelsMenuOpen"
+	play={async ({ canvas, userEvent }) => {
+		await userEvent.click(canvas.getByRole('button', { name: 'Reasoning effort' }));
+		await screen.findByRole('menu');
+	}}
+/>
diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormActionRecord.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormActionRecord.stories.svelte
new file mode 100644
index 000000000..4ddd18fc4
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/form/ChatFormActionRecord.stories.svelte
@@ -0,0 +1,48 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatFormActionRecord from '#lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionRecord.svelte';
+
+	const { Story } = defineMeta({
+		component: ChatFormActionRecord,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatForm/ChatFormActionRecord'
+	});
+</script>
+
+<Story asChild name="States">
+	<StateGallery columns={5}>
+		<StateGalleryItem label="Idle">
+			<ChatFormActionRecord hasAudioModality />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Recording">
+			<ChatFormActionRecord hasAudioModality isRecording />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Loading">
+			<ChatFormActionRecord hasAudioModality isLoading />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled">
+			<ChatFormActionRecord disabled hasAudioModality />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="No audio" note="model lacks audio">
+			<ChatFormActionRecord hasAudioModality={false} />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
+
+<!-- separate: play hovers the button to open its tooltip -->
+<Story
+	args={{ hasAudioModality: false }}
+	name="NoAudioModalityTooltip"
+	play={async ({ canvas, userEvent }) => {
+		// the tooltip trigger wraps the disabled button, hover the trigger
+		await userEvent.hover(canvas.getAllByRole('button', { name: 'Start recording' })[0]);
+	}}
+/>
diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormActionSubmit.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormActionSubmit.stories.svelte
new file mode 100644
index 000000000..caf929080
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/form/ChatFormActionSubmit.stories.svelte
@@ -0,0 +1,42 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatFormActionSubmit from '#lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionSubmit.svelte';
+
+	const { Story } = defineMeta({
+		component: ChatFormActionSubmit,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatForm/ChatFormActionSubmit'
+	});
+</script>
+
+<Story asChild name="States">
+	<StateGallery columns={5}>
+		<StateGalleryItem label="Empty" note="nothing to send">
+			<ChatFormActionSubmit canSend={false} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Enabled">
+			<ChatFormActionSubmit canSend />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled">
+			<ChatFormActionSubmit canSend disabled />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="No model" note="tooltip on hover">
+			<ChatFormActionSubmit canSend={false} tooltipLabel="Please select a model first" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Unavailable" note="error, tooltip on hover">
+			<ChatFormActionSubmit
+				canSend={false}
+				showErrorState
+				tooltipLabel="Selected model is not available, please select another"
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormContextGauge.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormContextGauge.stories.svelte
new file mode 100644
index 000000000..a0416fd5d
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/form/ChatFormContextGauge.stories.svelte
@@ -0,0 +1,110 @@
+<script lang="ts" module>
+	import {
+		conversation,
+		conversationMessages,
+		MODEL_NAME,
+		modelServerProps,
+		routerModels,
+		seedStores,
+		ServerRole
+	} from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatFormContextGauge from '#lib/components/app/chat/ChatForm/ChatFormContextGauge/ChatFormContextGauge.svelte';
+	import ContextGaugePopup from '#lib/components/app/chat/ChatForm/ChatFormContextGauge/ContextGaugePopup.svelte';
+	import { gaugePopupClose } from '#lib/components/app/chat/ChatForm/ChatFormContextGauge/gauge-popup.svelte.ts';
+	import { userEvent, within } from 'storybook/test';
+
+	const { Story } = defineMeta({
+		component: ChatFormContextGauge,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatForm/ChatFormContextGauge'
+	});
+
+	const N_CTX = 32768;
+
+	// the popup state is module-wide, so close it around each story
+	function seedUsage(promptTokens: number) {
+		return () => {
+			gaugePopupClose();
+
+			const restore = seedStores({
+				activeConversation: conversation,
+				activeMessages: conversationMessages(promptTokens),
+				modelProps: {
+					[MODEL_NAME]: modelServerProps({
+						default_generation_settings: { n_ctx: N_CTX }
+					} as Partial<ApiLlamaCppServerProps>)
+				},
+				serverProps: modelServerProps(),
+				serverRole: ServerRole.MODEL
+			});
+
+			return () => {
+				gaugePopupClose();
+				restore();
+			};
+		};
+	}
+
+	function seedModelNotLoaded() {
+		gaugePopupClose();
+
+		const restore = seedStores({
+			activeConversation: conversation,
+			activeMessages: conversationMessages(4000),
+			models: routerModels,
+			routerModels: [],
+			selectedModelId: routerModels[0].id,
+			serverProps: modelServerProps({ role: ServerRole.ROUTER }),
+			serverRole: ServerRole.ROUTER
+		});
+
+		return () => {
+			gaugePopupClose();
+			restore();
+		};
+	}
+
+	async function openPopup({ canvasElement }: { canvasElement: HTMLElement }) {
+		const canvas = within(canvasElement);
+
+		canvas.getByRole('button', { name: 'Context usage' }).focus();
+		await userEvent.keyboard('{Enter}');
+		await canvas.findByRole('status');
+	}
+</script>
+
+{#snippet frame()}
+	<!-- the popup positions itself against the closest form -->
+	<form class="relative mt-96 flex w-80 justify-end rounded-3xl border p-3">
+		<ChatFormContextGauge />
+
+		<ContextGaugePopup />
+	</form>
+{/snippet}
+
+<Story asChild beforeEach={seedUsage(6000)} name="Default" play={openPopup}>
+	{@render frame()}
+</Story>
+
+<Story asChild beforeEach={seedUsage(6000)} name="DialOnly">
+	{@render frame()}
+</Story>
+
+<Story asChild beforeEach={seedUsage(27500)} name="Warning" play={openPopup}>
+	{@render frame()}
+</Story>
+
+<Story asChild beforeEach={seedUsage(31500)} name="Critical" play={openPopup}>
+	{@render frame()}
+</Story>
+
+<Story asChild beforeEach={seedUsage(36000)} name="OverLimit" play={openPopup}>
+	{@render frame()}
+</Story>
+
+<Story asChild beforeEach={seedModelNotLoaded} name="ModelNotLoaded" play={openPopup}>
+	{@render frame()}
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormCurrentWorkingDirectory.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormCurrentWorkingDirectory.stories.svelte
new file mode 100644
index 000000000..32f19d1c4
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/form/ChatFormCurrentWorkingDirectory.stories.svelte
@@ -0,0 +1,105 @@
+<script lang="ts" module>
+	import {
+		cwdServerTools,
+		directoryResults,
+		globSearchResult,
+		pendingGlobSearch,
+		seedStores,
+		SERVER_HOME,
+		type StoreSeed,
+		toGlobEntries
+	} from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatFormCurrentWorkingDirectory from '#lib/components/app/chat/ChatForm/ChatFormCurrentWorkingDirectory/ChatFormCurrentWorkingDirectory.svelte';
+	import { FileMentionEntryType } from '#lib/enums/index.ts';
+	import { fn } from 'storybook/test';
+	import type { ComponentProps } from 'svelte';
+
+	const { Story } = defineMeta({
+		args: {
+			directory: null,
+			isOpen: false,
+			onChange: fn(),
+			onClose: fn(),
+			onOpen: fn(),
+			query: ''
+		},
+		component: ChatFormCurrentWorkingDirectory,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatForm/ChatFormCurrentWorkingDirectory'
+	});
+
+	const directoryEntries = toGlobEntries(
+		directoryResults.map((path) => ({ path, type: FileMentionEntryType.DIRECTORY }))
+	);
+
+	function seedSearch(seed: StoreSeed = {}) {
+		return () => seedStores({ serverHome: SERVER_HOME, serverTools: cwdServerTools, ...seed });
+	}
+</script>
+
+{#snippet template(args: ComponentProps<typeof ChatFormCurrentWorkingDirectory>)}
+	<!-- the picker anchors to the form; the chip sits below it -->
+	<div class="relative mt-80 grid w-[32rem]">
+		<div class="h-12 rounded-3xl border"></div>
+
+		<ChatFormCurrentWorkingDirectory {...args} />
+	</div>
+{/snippet}
+
+<Story beforeEach={seedSearch()} name="Default" {template} />
+
+<Story
+	args={{ directory: `${SERVER_HOME}/llama.cpp/ui/apps/chat` }}
+	beforeEach={seedSearch()}
+	name="WithDirectory"
+	{template}
+/>
+
+<Story
+	args={{ directory: `${SERVER_HOME}/llama.cpp/ui/apps/chat`, disabled: true }}
+	beforeEach={seedSearch()}
+	name="Disabled"
+	{template}
+/>
+
+<Story args={{ isOpen: true }} beforeEach={seedSearch()} name="PickerOpen" {template} />
+
+<Story
+	args={{ isOpen: true, query: 'llama' }}
+	beforeEach={seedSearch({ globSearch: globSearchResult(directoryEntries) })}
+	name="PickerWithResults"
+	{template}
+/>
+
+<Story
+	args={{ isOpen: true, query: 'searching' }}
+	beforeEach={seedSearch({ globSearch: pendingGlobSearch() })}
+	name="PickerSearching"
+	{template}
+/>
+
+<Story
+	args={{ isOpen: true, query: 'nowhere' }}
+	beforeEach={seedSearch({ globSearch: globSearchResult([]) })}
+	name="PickerNoMatch"
+	{template}
+/>
+
+<Story
+	args={{ isOpen: true, query: 'root' }}
+	beforeEach={seedSearch({
+		globSearch: async () => ({ error: 'path is outside the allowed roots' })
+	})}
+	name="PickerSearchError"
+	{template}
+/>
+
+<Story
+	args={{ isOpen: true }}
+	beforeEach={seedSearch({ serverTools: [] })}
+	name="PickerSearchUnavailable"
+	{template}
+/>
diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormInput.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormInput.stories.svelte
new file mode 100644
index 000000000..5c41912fe
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/form/ChatFormInput.stories.svelte
@@ -0,0 +1,49 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { SERVER_HOME } from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatFormInput from '#lib/components/app/chat/ChatForm/ChatFormInput/ChatFormInput.svelte';
+
+	const { Story } = defineMeta({
+		component: ChatFormInput,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatForm/ChatFormInput'
+	});
+
+	const common = {
+		class: 'w-full px-5 py-1.5',
+		placeholder: 'Type a message...'
+	};
+
+	const multilineValue =
+		'Explain how the KV cache works in llama.cpp.\nKeep it short, and list the main flags that change its size.';
+
+	const mentionValue = `Summarize [README.md](file://${SERVER_HOME}/llama.cpp/README.md) and [chat](file://${SERVER_HOME}/llama.cpp/ui/apps/chat/) please`;
+</script>
+
+<Story asChild name="States">
+	<StateGallery columns={2}>
+		<StateGalleryItem label="Empty" note="placeholder">
+			<ChatFormInput {...common} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Multiline text">
+			<ChatFormInput {...common} value={multilineValue} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled">
+			<ChatFormInput {...common} disabled value="Waiting for the model to load" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Code span">
+			<ChatFormInput {...common} value="Why does `npm run check` fail after `npm install`?" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="File mentions">
+			<ChatFormInput {...common} value={mentionValue} />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormPickerCommand.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormPickerCommand.stories.svelte
new file mode 100644
index 000000000..1c3b4825d
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/form/ChatFormPickerCommand.stories.svelte
@@ -0,0 +1,46 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { chatCommands } from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatFormPickerCommand from '#lib/components/app/chat/ChatForm/ChatFormPickers/ChatFormPickerCommand.svelte';
+	import { fn } from 'storybook/test';
+
+	const { Story } = defineMeta({
+		component: ChatFormPickerCommand,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatForm/ChatFormPickerCommand'
+	});
+
+	const common = { commands: chatCommands, isOpen: true, onClose: fn(), onSelect: fn() };
+</script>
+
+<!--
+	the popover is portalled and opens above its anchor, so each cell reserves
+	room above a fixed-height anchor to keep the popovers apart
+-->
+{#snippet anchored(query: string)}
+	<div class="flex h-96 flex-col justify-end">
+		<div class="relative h-12 w-full rounded-3xl border">
+			<ChatFormPickerCommand {...common} {query} />
+		</div>
+	</div>
+{/snippet}
+
+<Story asChild name="States">
+	<StateGallery columns={3}>
+		<StateGalleryItem label="All commands">
+			{@render anchored('')}
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Filtered" note="query: dir">
+			{@render anchored('dir')}
+		</StateGalleryItem>
+
+		<StateGalleryItem label="No match" note="query: xyz">
+			{@render anchored('xyz')}
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormPickerMcpPrompts.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormPickerMcpPrompts.stories.svelte
new file mode 100644
index 000000000..ccb5835bc
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/form/ChatFormPickerMcpPrompts.stories.svelte
@@ -0,0 +1,74 @@
+<script lang="ts" module>
+	import { mcpPrompts, mcpServers, override, seedStores } from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatFormPickerMcpPrompts from '#lib/components/app/chat/ChatForm/ChatFormPickers/ChatFormPickerMcpPrompts/ChatFormPickerMcpPrompts.svelte';
+	import { mcpStore } from '#lib/stores/index.ts';
+	import { fn, screen } from 'storybook/test';
+	import type { ComponentProps } from 'svelte';
+
+	const { Story } = defineMeta({
+		args: {
+			isOpen: true,
+			onClose: fn(),
+			onPromptLoadComplete: fn(),
+			onPromptLoadError: fn(),
+			onPromptLoadStart: fn()
+		},
+		component: ChatFormPickerMcpPrompts,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatForm/ChatFormPickerMcpPrompts'
+	});
+
+	// keeps the picker in its loading state
+	function seedLoading() {
+		const restore = seedStores({ mcpServers });
+		const restoreInit = override(
+			mcpStore,
+			'ensureInitialized',
+			() => new Promise<boolean>(() => {})
+		);
+
+		return () => {
+			restoreInit();
+			restore();
+		};
+	}
+</script>
+
+{#snippet template(args: ComponentProps<typeof ChatFormPickerMcpPrompts>)}
+	<!-- the popover anchors to its parent and opens above it -->
+	<div class="relative mt-96 h-12 w-[32rem] rounded-3xl border">
+		<ChatFormPickerMcpPrompts {...args} />
+	</div>
+{/snippet}
+
+<Story beforeEach={() => seedStores({ mcpPrompts, mcpServers })} name="Default" {template} />
+
+<Story
+	beforeEach={() => seedStores({ mcpPrompts: mcpPrompts.slice(0, 2), mcpServers })}
+	name="FewPrompts"
+	{template}
+/>
+
+<Story
+	args={{ searchQuery: 'review' }}
+	beforeEach={() => seedStores({ mcpPrompts, mcpServers })}
+	name="Filtered"
+	{template}
+/>
+
+<Story beforeEach={seedLoading} name="Loading" {template} />
+
+<Story beforeEach={() => seedStores({ mcpPrompts: [], mcpServers })} name="Empty" {template} />
+
+<Story
+	beforeEach={() => seedStores({ mcpPrompts, mcpServers })}
+	name="ArgumentForm"
+	play={async ({ userEvent }) => {
+		await userEvent.click(await screen.findByText('Code review'));
+		await screen.findByRole('button', { name: 'Use Prompt' });
+	}}
+	{template}
+/>
diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormPickerMention.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormPickerMention.stories.svelte
new file mode 100644
index 000000000..30ce00ebd
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/form/ChatFormPickerMention.stories.svelte
@@ -0,0 +1,78 @@
+<script lang="ts" module>
+	import {
+		cwdServerTools,
+		globSearchResult,
+		mentionEntries,
+		pendingGlobSearch,
+		seedStores,
+		SERVER_HOME,
+		toGlobEntries
+	} from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatFormPickerMention from '#lib/components/app/chat/ChatForm/ChatFormPickers/ChatFormPickerMention.svelte';
+	import { fn } from 'storybook/test';
+	import type { ComponentProps } from 'svelte';
+
+	const { Story } = defineMeta({
+		args: {
+			isOpen: true,
+			onClose: fn(),
+			onSelect: fn(),
+			query: 'chat',
+			scopePath: SERVER_HOME
+		},
+		component: ChatFormPickerMention,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatForm/ChatFormPickerMention'
+	});
+
+	const searchTools = { serverHome: SERVER_HOME, serverTools: cwdServerTools };
+</script>
+
+{#snippet template(args: ComponentProps<typeof ChatFormPickerMention>)}
+	<!-- the popover anchors to its parent and opens above it -->
+	<div class="relative mt-80 h-12 w-[32rem] rounded-3xl border">
+		<ChatFormPickerMention {...args} />
+	</div>
+{/snippet}
+
+<Story
+	beforeEach={() =>
+		seedStores({ ...searchTools, globSearch: globSearchResult(toGlobEntries(mentionEntries)) })}
+	name="Default"
+	{template}
+/>
+
+<Story
+	args={{ query: 'loading' }}
+	beforeEach={() => seedStores({ ...searchTools, globSearch: pendingGlobSearch() })}
+	name="Loading"
+	{template}
+/>
+
+<Story
+	args={{ query: 'nothing' }}
+	beforeEach={() => seedStores({ ...searchTools, globSearch: globSearchResult([]) })}
+	name="NoMatch"
+	{template}
+/>
+
+<Story
+	args={{ query: 'denied' }}
+	beforeEach={() =>
+		seedStores({
+			...searchTools,
+			globSearch: async () => ({ error: 'path is outside the allowed roots' })
+		})}
+	name="SearchError"
+	{template}
+/>
+
+<Story
+	args={{ query: 'readme' }}
+	beforeEach={() => seedStores({ serverHome: SERVER_HOME, serverTools: [] })}
+	name="SearchUnavailable"
+	{template}
+/>
diff --git a/ui/apps/chat/tests/stories/a11y/ChatScreenForm.a11y.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatScreenForm.a11y.stories.svelte
similarity index 95%
rename from ui/apps/chat/tests/stories/a11y/ChatScreenForm.a11y.stories.svelte
rename to ui/apps/chat/tests/stories/chat/form/ChatScreenForm.a11y.stories.svelte
index 81bc7f1f7..b1058822a 100644
--- a/ui/apps/chat/tests/stories/a11y/ChatScreenForm.a11y.stories.svelte
+++ b/ui/apps/chat/tests/stories/chat/form/ChatScreenForm.a11y.stories.svelte
@@ -10,7 +10,7 @@
 			layout: 'centered'
 		},
 		tags: ['!dev'],
-		title: 'Components/ChatScreen/ChatScreenForm/Accessibility'
+		title: 'Llama Chat/Chat/ChatForm/ChatScreenForm/Accessibility'
 	});
 </script>

diff --git a/ui/apps/chat/tests/stories/chat/form/ChatScreenForm.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatScreenForm.stories.svelte
new file mode 100644
index 000000000..818b9830b
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/form/ChatScreenForm.stories.svelte
@@ -0,0 +1,208 @@
+<script lang="ts" module>
+	import {
+		cwdServerTools,
+		fileAttachments,
+		FORM_CLASS,
+		globSearchResult,
+		jpgAsset,
+		loadingAttachment,
+		mcpResources,
+		mcpServers,
+		mentionEntries,
+		modelServerProps,
+		ReasoningEffort,
+		resetPointerEvents,
+		routerModels,
+		seedStores,
+		SERVER_HOME,
+		ServerRole,
+		svgAsset,
+		toGlobEntries
+	} from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatScreenForm from '#lib/components/app/chat/ChatScreen/ChatScreenForm.svelte';
+	import { ATTACHMENT_TOOLTIP_TEXT } from '#lib/constants/index.ts';
+	import { expect, screen } from 'storybook/test';
+
+	const { Story } = defineMeta({
+		beforeEach: resetPointerEvents,
+		component: ChatScreenForm,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatForm/ChatScreenForm'
+	});
+
+	const modelServer = {
+		serverProps: modelServerProps(),
+		serverRole: ServerRole.MODEL
+	};
+</script>
+
+<Story
+	args={{ class: FORM_CLASS }}
+	name="Default"
+	play={async ({ canvas, userEvent }) => {
+		const editor = await canvas.findByRole('textbox');
+		const submitButton = await canvas.findByRole('button', { name: 'Send' });
+
+		// Expect the input to be focused after the component is mounted
+		await expect(editor).toHaveFocus();
+
+		// Expect the submit button to be disabled
+		await expect(submitButton).toBeDisabled();
+
+		const text = 'What is the meaning of life?';
+
+		await userEvent.clear(editor);
+		await userEvent.type(editor, text);
+
+		await expect(editor).toHaveTextContent(text);
+
+		const fileInput = document.querySelector('input[type="file"]');
+
+		await expect(fileInput).not.toHaveAttribute('accept');
+	}}
+/>
+
+<Story
+	args={{ class: FORM_CLASS }}
+	beforeEach={() => seedStores(modelServer)}
+	name="WithText"
+	play={async ({ canvas, userEvent }) => {
+		const editor = await canvas.findByRole('textbox');
+
+		await userEvent.type(editor, 'Explain how the KV cache works in llama.cpp');
+	}}
+/>
+
+<Story
+	args={{ class: FORM_CLASS }}
+	beforeEach={() => seedStores(modelServer)}
+	name="WithCodeSpan"
+	play={async ({ canvas, userEvent }) => {
+		const editor = await canvas.findByRole('textbox');
+
+		// the live-preview editor renders a complete code span as it is typed
+		await userEvent.type(editor, 'Why does `npm run check` fail after `npm install`?');
+	}}
+/>
+
+<Story args={{ class: FORM_CLASS, isLoading: true }} name="Loading" />
+
+<Story args={{ class: FORM_CLASS, disabled: true }} name="Disabled" />
+
+<Story
+	args={{
+		class: FORM_CLASS,
+		uploadedFiles: fileAttachments
+	}}
+	name="WithFileAttachments"
+	play={async ({ canvas }) => {
+		const jpgAttachment = canvas.getByAltText('1.jpg');
+		const svgAttachment = canvas.getByAltText('hf-logo.svg');
+
+		await expect(jpgAttachment).toHaveAttribute('src', jpgAsset);
+		await expect(svgAttachment).toHaveAttribute('src', svgAsset);
+		await expect(canvas.getByText('example.pdf')).toBeInTheDocument();
+		await expect(canvas.getByText('342.82 KB')).toBeInTheDocument();
+	}}
+/>
+
+<Story
+	args={{ class: FORM_CLASS, uploadedFiles: [fileAttachments[0], loadingAttachment] }}
+	name="WithLoadingAttachment"
+/>
+
+<Story
+	args={{ class: FORM_CLASS }}
+	beforeEach={() =>
+		seedStores({
+			config: { autoMicOnEmpty: true },
+			serverProps: modelServerProps({ modalities: { audio: true, video: false, vision: true } }),
+			serverRole: ServerRole.MODEL
+		})}
+	name="WithRecordButton"
+/>
+
+<Story
+	args={{ class: FORM_CLASS }}
+	beforeEach={() => seedStores({ ...modelServer, reasoningEffort: ReasoningEffort.HIGH })}
+	name="WithReasoningEffort"
+/>
+
+<Story
+	args={{ class: FORM_CLASS }}
+	beforeEach={() =>
+		seedStores({
+			models: routerModels,
+			selectedModelId: 'removed-model',
+			serverProps: modelServerProps({ role: ServerRole.ROUTER }),
+			serverRole: ServerRole.ROUTER
+		})}
+	name="ModelNotAvailable"
+	play={async ({ canvas, userEvent }) => {
+		const editor = await canvas.findByRole('textbox');
+
+		await userEvent.type(editor, 'Hello');
+	}}
+/>
+
+<Story
+	args={{ class: FORM_CLASS }}
+	beforeEach={() => seedStores({ mcpResources, mcpServers })}
+	name="WithMcpResources"
+/>
+
+<Story
+	args={{ class: FORM_CLASS }}
+	beforeEach={() =>
+		seedStores({
+			...modelServer,
+			pendingCwd: `${SERVER_HOME}/llama.cpp/ui/apps/chat`,
+			serverHome: SERVER_HOME,
+			serverTools: cwdServerTools
+		})}
+	name="WithWorkingDirectory"
+/>
+
+<Story
+	args={{ class: FORM_CLASS }}
+	name="AddMenuOpen"
+	play={async ({ canvas, userEvent }) => {
+		await userEvent.click(await canvas.findByRole('button', { name: ATTACHMENT_TOOLTIP_TEXT }));
+		await screen.findByRole('menu');
+	}}
+/>
+
+<Story
+	args={{ class: FORM_CLASS }}
+	beforeEach={() =>
+		seedStores({
+			...modelServer,
+			mcpServers,
+			serverHome: SERVER_HOME,
+			serverTools: cwdServerTools
+		})}
+	name="CommandPickerOpen"
+	play={async ({ canvas, userEvent }) => {
+		await userEvent.type(await canvas.findByRole('textbox'), '/');
+		await screen.findByText('/prompt');
+	}}
+/>
+
+<Story
+	args={{ class: FORM_CLASS }}
+	beforeEach={() =>
+		seedStores({
+			...modelServer,
+			globSearch: globSearchResult(toGlobEntries(mentionEntries)),
+			serverHome: SERVER_HOME,
+			serverTools: cwdServerTools
+		})}
+	name="MentionPickerOpen"
+	play={async ({ canvas, userEvent }) => {
+		await userEvent.type(await canvas.findByRole('textbox'), 'Look at @chat');
+		await screen.findByText('ChatForm.svelte');
+	}}
+/>
diff --git a/ui/apps/chat/tests/stories/chat/form/fixtures.ts b/ui/apps/chat/tests/stories/chat/form/fixtures.ts
new file mode 100644
index 000000000..499c87028
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/form/fixtures.ts
@@ -0,0 +1,463 @@
+import jpgAsset from '../../fixtures/assets/1.jpg?url';
+import pdfAsset from '../../fixtures/assets/example.pdf?inline';
+import svgAsset from '../../fixtures/assets/hf-logo.svg?url';
+import {
+	BuiltInTool,
+	ChatFormCommandAction,
+	FileMentionEntryType,
+	MessageRole,
+	MessageType,
+	MimeTypeText,
+	ReasoningEffort,
+	ServerRole,
+	SpecialFileType,
+	ToolSource
+} from '#lib/enums/index.ts';
+import { ToolsService } from '#lib/services/tools.service.ts';
+import {
+	conversationsStore,
+	mcpStore,
+	modelsStore,
+	serverStore,
+	settingsStore,
+	toolsStore
+} from '#lib/stores/index.ts';
+import type {
+	ChatFormCommand,
+	DatabaseConversation,
+	DatabaseMessage,
+	FileMentionEntry,
+	GlobEntry,
+	MCPPromptInfo,
+	MCPResourceInfo,
+	MCPServerSettingsEntry,
+	ServerToolInfo
+} from '#lib/types/index.ts';
+
+export const FORM_CLASS = 'max-w-[56rem] w-[calc(100vw-2rem)]';
+
+export const MODEL_PATH = '/models/Qwen3-8B-Q4_K_M.gguf';
+export const MODEL_NAME = 'Qwen3-8B-Q4_K_M.gguf';
+export const SERVER_HOME = '/home/user';
+export const CONVERSATION_ID = 'story-conversation';
+
+export { jpgAsset, svgAsset };
+
+export const fileAttachments: ChatUploadedFile[] = [
+	{
+		file: new File([''], '1.jpg', { type: 'image/jpeg' }),
+		id: '1',
+		name: '1.jpg',
+		preview: jpgAsset,
+		size: 44891,
+		type: 'image/jpeg'
+	},
+	{
+		file: new File([''], 'hf-logo.svg', { type: 'image/svg+xml' }),
+		id: '2',
+		name: 'hf-logo.svg',
+		preview: svgAsset,
+		size: 1234,
+		type: 'image/svg+xml'
+	},
+	{
+		// the PDF inlined as a data URL and decoded to its bytes: ?raw read it as UTF-8 text, which mangled the binary
+		// and left control characters in the built chunk
+		file: new File(
+			[Uint8Array.from(atob(pdfAsset.split(',')[1]), (c) => c.charCodeAt(0))],
+			'example.pdf',
+			{ type: 'application/pdf' }
+		),
+		id: '3',
+		name: 'example.pdf',
+		size: 351048,
+		type: 'application/pdf'
+	},
+	{
+		file: new File(['# Notes\n\nShort text file.'], 'notes.md', { type: MimeTypeText.MARKDOWN }),
+		id: '4',
+		name: 'notes.md',
+		size: 26,
+		textContent: '# Notes\n\nShort text file.',
+		type: MimeTypeText.MARKDOWN
+	}
+];
+
+export const loadingAttachment: ChatUploadedFile = {
+	file: new File([], 'loading'),
+	id: 'loading-prompt',
+	isLoading: true,
+	mcpPrompt: { promptName: 'code_review', serverName: 'github' },
+	name: 'Code review',
+	size: 0,
+	type: SpecialFileType.MCP_PROMPT
+};
+
+export const mcpServers: MCPServerSettingsEntry[] = [
+	{ enabled: true, id: 'github', name: 'GitHub', url: 'https://api.githubcopilot.com/mcp/' },
+	{ enabled: true, id: 'docs', name: 'Docs', url: 'https://docs.example.com/mcp' }
+];
+
+export const mcpPrompts: MCPPromptInfo[] = [
+	{
+		arguments: [
+			{ description: 'Repository in owner/name form', name: 'repo', required: true },
+			{ description: 'Pull request number', name: 'pr', required: true },
+			{ description: 'Focus area, e.g. security', name: 'focus' }
+		],
+		description: 'Review a pull request and list the main issues',
+		name: 'code_review',
+		serverName: 'github',
+		title: 'Code review'
+	},
+	{
+		description: 'Summarize open issues by label',
+		name: 'issue_summary',
+		serverName: 'github',
+		title: 'Issue summary'
+	},
+	{
+		arguments: [{ description: 'Topic to explain', name: 'topic', required: true }],
+		description: 'Explain a topic from the docs',
+		name: 'explain',
+		serverName: 'docs',
+		title: 'Explain'
+	},
+	{
+		description: 'Write release notes from the changelog',
+		name: 'release_notes',
+		serverName: 'docs'
+	}
+];
+
+export const mcpResources: MCPResourceInfo[] = [
+	{
+		mimeType: MimeTypeText.MARKDOWN,
+		name: 'README.md',
+		serverName: 'github',
+		uri: 'repo://ggml-org/llama.cpp/README.md'
+	},
+	{
+		mimeType: MimeTypeText.PLAIN,
+		name: 'server-api.txt',
+		serverName: 'docs',
+		title: 'Server API',
+		uri: 'docs://server/api'
+	}
+];
+
+export const chatCommands: ChatFormCommand[] = [
+	{
+		action: ChatFormCommandAction.PROMPT,
+		description: 'Insert an MCP prompt',
+		disabled: false,
+		name: 'prompt'
+	},
+	{
+		action: ChatFormCommandAction.CWD,
+		description: 'Set working directory',
+		disabled: false,
+		keywords: ['current working directory'],
+		name: 'cwd'
+	},
+	{
+		action: ChatFormCommandAction.MODEL,
+		description: 'Select model',
+		disabled: false,
+		name: 'model'
+	},
+	{
+		action: ChatFormCommandAction.COMPACT,
+		description: 'Summarize the conversation to free up context',
+		disabled: true,
+		keywords: ['summarize', 'context'],
+		name: 'compact'
+	}
+];
+
+export const mentionEntries: FileMentionEntry[] = [
+	{
+		name: 'src',
+		path: `${SERVER_HOME}/llama.cpp/ui/apps/chat/src`,
+		type: FileMentionEntryType.DIRECTORY
+	},
+	{
+		name: 'ChatForm.svelte',
+		path: `${SERVER_HOME}/llama.cpp/ui/apps/chat/src/lib/components/app/chat/ChatForm/ChatForm.svelte`,
+		type: FileMentionEntryType.FILE
+	},
+	{
+		name: 'chat.d.ts',
+		path: `${SERVER_HOME}/llama.cpp/ui/apps/chat/src/lib/types/chat.d.ts`,
+		type: FileMentionEntryType.FILE
+	}
+];
+
+export const directoryResults = [
+	`${SERVER_HOME}/llama.cpp`,
+	`${SERVER_HOME}/llama.cpp/tools`,
+	`${SERVER_HOME}/llama.cpp/ui/apps/chat`,
+	`${SERVER_HOME}/llama.cpp/tools/server`
+];
+
+/** Server tools that make the cwd chip and the mention search available. */
+export const cwdServerTools: ServerToolInfo[] = [
+	BuiltInTool.SERVER_FILE_GLOB_SEARCH,
+	BuiltInTool.SERVER_READ_FILE
+].map((tool) => ({
+	definition: { function: { name: tool, parameters: {} }, type: 'function' },
+	display_name: tool,
+	permissions: { write: false },
+	tool,
+	type: ToolSource.SERVER,
+	uses_cwd: true
+}));
+
+export function modelServerProps(
+	overrides: Partial<ApiLlamaCppServerProps> = {}
+): ApiLlamaCppServerProps {
+	return {
+		default_generation_settings: { n_ctx: 32768 },
+		modalities: { audio: false, video: false, vision: true },
+		model_path: MODEL_PATH,
+		...overrides
+	} as unknown as ApiLlamaCppServerProps;
+}
+
+export const routerModels: ModelOption[] = [
+	{ capabilities: [], id: 'qwen3-8b', model: 'Qwen/Qwen3-8B-GGUF', name: 'Qwen3-8B' },
+	{ capabilities: [], id: 'gemma-3-4b', model: 'google/gemma-3-4b-it-GGUF', name: 'gemma-3-4b-it' }
+];
+
+export const conversation: DatabaseConversation = {
+	currNode: 'a2',
+	id: CONVERSATION_ID,
+	lastModified: Date.now(),
+	name: 'Story conversation'
+};
+
+/** A short user/assistant exchange whose last turn used `promptTokens` of context. */
+export function conversationMessages(promptTokens: number, outputTokens = 512): DatabaseMessage[] {
+	const base = {
+		children: [],
+		convId: CONVERSATION_ID,
+		timestamp: Date.now(),
+		type: MessageType.TEXT
+	};
+
+	return [
+		{ ...base, content: 'Explain the KV cache.', id: 'u1', parent: null, role: MessageRole.USER },
+		{
+			...base,
+			content: 'The KV cache stores keys and values of past tokens.',
+			id: 'a1',
+			model: MODEL_NAME,
+			parent: 'u1',
+			role: MessageRole.ASSISTANT,
+			timings: { predicted_ms: 4200, predicted_n: 380, prompt_ms: 120, prompt_n: 240 }
+		},
+		{ ...base, content: 'And how big can it get?', id: 'u2', parent: 'a1', role: MessageRole.USER },
+		{
+			...base,
+			content: 'It grows with the context length.',
+			id: 'a2',
+			model: MODEL_NAME,
+			parent: 'u2',
+			role: MessageRole.ASSISTANT,
+			timings: {
+				cache_n: 620,
+				predicted_ms: outputTokens * 11,
+				predicted_n: outputTokens,
+				prompt_ms: 300,
+				prompt_n: promptTokens - 620
+			}
+		}
+	] as DatabaseMessage[];
+}
+
+/** Store state a story needs; every field left out keeps the current value. */
+export interface StoreSeed {
+	activeConversation?: DatabaseConversation | null;
+	activeMessages?: DatabaseMessage[];
+	config?: Record<string, unknown>;
+	globSearch?: (params: Record<string, unknown>) => Promise<Record<string, unknown>>;
+	mcpPrompts?: MCPPromptInfo[];
+	mcpResources?: MCPResourceInfo[];
+	mcpServers?: MCPServerSettingsEntry[];
+	modelProps?: Record<string, ApiLlamaCppServerProps>;
+	models?: ModelOption[];
+	pendingCwd?: string | null;
+	reasoningEffort?: ReasoningEffort;
+	routerModels?: ApiModelDataEntry[];
+	selectedModelId?: string | null;
+	selectedModelName?: string | null;
+	serverHome?: string | null;
+	serverProps?: ApiLlamaCppServerProps | null;
+	serverRole?: ServerRole | null;
+	serverTools?: ServerToolInfo[];
+}
+
+interface ToolsStoreInternals {
+	_serverHome: string | null | undefined;
+	_serverTools: ServerToolInfo['definition'][];
+	cwdAwareTools: Set<string>;
+}
+
+interface PropsCache {
+	cache: { delete(key: string): boolean; set(key: string, value: ApiLlamaCppServerProps): void };
+	cacheVersion: number;
+}
+
+type Restore = () => void;
+
+/** Override an object member; the restore puts back the original. */
+export function override<T extends object, K extends keyof T>(
+	target: T,
+	key: K,
+	value: T[K]
+): Restore {
+	const hadOwn = Object.prototype.hasOwnProperty.call(target, key);
+	const previous = target[key];
+
+	Object.defineProperty(target, key, { configurable: true, value, writable: true });
+
+	return () => {
+		if (hadOwn) target[key] = previous;
+		else delete target[key];
+	};
+}
+
+/**
+ * Seed the global stores for one story. Nothing is persisted. Return the
+ * result from `beforeEach` so Storybook restores the stores afterwards.
+ */
+export function seedStores(seed: StoreSeed): Restore {
+	const restores: Restore[] = [];
+	const tools = toolsStore as unknown as ToolsStoreInternals;
+	const props = modelsStore.props as unknown as PropsCache;
+	const set = <T extends object, K extends keyof T>(target: T, key: K, value: T[K]) => {
+		const previous = target[key];
+
+		target[key] = value;
+		restores.push(() => (target[key] = previous));
+	};
+
+	if (seed.serverRole !== undefined) set(serverStore, 'role', seed.serverRole);
+
+	if (seed.serverProps !== undefined) set(serverStore, 'props', seed.serverProps);
+
+	if (seed.models) set(modelsStore, 'models', seed.models);
+
+	if (seed.routerModels) set(modelsStore, 'routerModels', seed.routerModels);
+
+	if (seed.selectedModelId !== undefined) set(modelsStore, 'selectedModelId', seed.selectedModelId);
+
+	if (seed.selectedModelName !== undefined)
+		set(modelsStore, 'selectedModelName', seed.selectedModelName);
+
+	if (seed.config || seed.mcpServers) {
+		set(settingsStore, 'config', {
+			...settingsStore.config,
+			...seed.config,
+			...(seed.mcpServers ? { mcpServers: JSON.stringify(seed.mcpServers) } : {})
+		});
+	}
+
+	if (seed.reasoningEffort !== undefined)
+		set(conversationsStore.preferences, 'pendingReasoningEffort', seed.reasoningEffort);
+
+	if (seed.pendingCwd !== undefined)
+		set(conversationsStore.preferences, 'pendingCwd', seed.pendingCwd);
+
+	if (seed.activeConversation !== undefined)
+		set(conversationsStore, 'activeConversation', seed.activeConversation);
+
+	if (seed.activeMessages) set(conversationsStore, 'activeMessages', seed.activeMessages);
+
+	if (seed.serverTools) {
+		set(
+			tools,
+			'_serverTools',
+			seed.serverTools.map((t) => t.definition)
+		);
+		set(
+			tools,
+			'cwdAwareTools',
+			new Set(seed.serverTools.filter((t) => t.uses_cwd).map((t) => t.tool))
+		);
+	}
+
+	if (seed.serverHome !== undefined) set(tools, '_serverHome', seed.serverHome);
+
+	if (seed.modelProps) {
+		for (const [id, value] of Object.entries(seed.modelProps)) {
+			props.cache.set(id, value);
+			restores.push(() => props.cache.delete(id));
+		}
+
+		props.cacheVersion++;
+	}
+
+	if (seed.globSearch) {
+		const globSearch = seed.globSearch;
+
+		restores.push(
+			override(ToolsService, 'executeToolRaw', async (toolName, params) => {
+				if (toolName !== BuiltInTool.SERVER_FILE_GLOB_SEARCH) return {};
+
+				return globSearch(params);
+			})
+		);
+	}
+
+	if (seed.mcpPrompts) {
+		const prompts = seed.mcpPrompts;
+
+		restores.push(override(mcpStore, 'ensureInitialized', async () => true));
+		restores.push(override(mcpStore, 'getAllPrompts', async () => prompts));
+	}
+
+	if (seed.mcpResources) {
+		for (const resource of seed.mcpResources) {
+			const attachment = mcpStore.resources.addAttachment(resource);
+
+			mcpStore.resources.updateAttachmentContent(attachment.id, [
+				{ mimeType: resource.mimeType, text: `Content of ${resource.name}`, uri: resource.uri }
+			]);
+		}
+
+		restores.push(() => mcpStore.resources.clearAttachments());
+	}
+
+	return () => {
+		for (const restore of restores.reverse()) restore();
+	};
+}
+
+/** A `file_glob_search` stand-in that returns `paths` relative to the server home. */
+export function globSearchResult(entries: GlobEntry[], delayMs = 0) {
+	return async () => {
+		if (delayMs > 0) await new Promise((resolve) => setTimeout(resolve, delayMs));
+
+		return { base: SERVER_HOME, entries };
+	};
+}
+
+/** Never resolves: keeps a picker in its loading state. */
+export function pendingGlobSearch() {
+	return () => new Promise<Record<string, unknown>>(() => {});
+}
+
+export function toGlobEntries(paths: { path: string; type: FileMentionEntryType }[]): GlobEntry[] {
+	return paths.map(({ path, type }) => ({
+		path: path.replace(`${SERVER_HOME}/`, ''),
+		type: type === FileMentionEntryType.DIRECTORY ? 'dir' : 'file'
+	}));
+}
+
+export { ReasoningEffort, ServerRole };
+
+/** An open menu that unmounts leaves `pointer-events: none` on the body; clear it. */
+export function resetPointerEvents() {
+	document.body.style.pointerEvents = '';
+}
diff --git a/ui/apps/chat/tests/stories/chat/messages/ActionIconsStoryHost.svelte b/ui/apps/chat/tests/stories/chat/messages/ActionIconsStoryHost.svelte
new file mode 100644
index 000000000..8715b6940
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/messages/ActionIconsStoryHost.svelte
@@ -0,0 +1,90 @@
+<script lang="ts">
+	// Story-only host: sets the per-message contexts that ChatMessage.svelte
+	// normally provides, so ChatMessageActionIcons can render alone.
+	import ChatMessageActionIcons from '#lib/components/app/chat/ChatMessages/ChatMessageActions/ChatMessageActionIcons/ChatMessageActionIcons.svelte';
+	import { setChatMessageActionsContext } from '#lib/contexts/index.ts';
+	import { useChatMessageEditContext } from '#lib/hooks/use-chat-message-edit-context.svelte.ts';
+	import type { ChatMessageDeletionInfo, ChatMessageSiblingInfo } from '#lib/types/index.ts';
+
+	interface Props {
+		justify: 'start' | 'end';
+		actionsPosition: 'left' | 'right';
+		siblingInfo?: ChatMessageSiblingInfo | null;
+		deletionInfo?: ChatMessageDeletionInfo | null;
+		showDeleteDialog?: boolean;
+		forkable?: boolean;
+		onRegenerate?: () => void;
+		onContinue?: () => void;
+		showRawOutputSwitch?: boolean;
+	}
+
+	let {
+		actionsPosition,
+		deletionInfo = null,
+		forkable = true,
+		justify,
+		onContinue,
+		onRegenerate,
+		showDeleteDialog = false,
+		showRawOutputSwitch = false,
+		siblingInfo = null
+	}: Props = $props();
+
+	let currentSiblingInfo = $derived(siblingInfo);
+	let deleteDialogOpen = $derived(showDeleteDialog);
+	let forkDialogOpen = $state(false);
+	let rawOutputEnabled = $state(false);
+
+	useChatMessageEditContext({
+		getContent: () => '',
+		getExtras: () => [],
+		onSave: () => {}
+	});
+
+	setChatMessageActionsContext({
+		confirmDelete: () => {},
+		copy: () => {},
+		get deletionInfo() {
+			return deletionInfo;
+		},
+		get forkConversation() {
+			return forkable ? () => {} : undefined;
+		},
+		navigateToSibling: (siblingId: string) => {
+			if (!currentSiblingInfo) return;
+
+			currentSiblingInfo = {
+				...currentSiblingInfo,
+				currentIndex: currentSiblingInfo.siblingIds.indexOf(siblingId)
+			};
+		},
+		requestDelete: () => {
+			deleteDialogOpen = true;
+		},
+		setShowDeleteDialog: (show: boolean) => {
+			deleteDialogOpen = show;
+		},
+		setShowForkDialog: (show: boolean) => {
+			forkDialogOpen = show;
+		},
+		get showDeleteDialog() {
+			return deleteDialogOpen;
+		},
+		get showForkDialog() {
+			return forkDialogOpen;
+		},
+		get siblingInfo() {
+			return currentSiblingInfo;
+		}
+	});
+</script>
+
+<ChatMessageActionIcons
+	{actionsPosition}
+	{justify}
+	{onContinue}
+	onRawOutputToggle={(enabled) => (rawOutputEnabled = enabled)}
+	{onRegenerate}
+	{rawOutputEnabled}
+	{showRawOutputSwitch}
+/>
diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessage.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessage.stories.svelte
new file mode 100644
index 000000000..aaf5f3d6e
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessage.stories.svelte
@@ -0,0 +1,275 @@
+<script lang="ts" module>
+	import {
+		agenticToolMessages,
+		assistantAgenticWithStatsMessage,
+		assistantInterruptedReasoningMessage,
+		assistantMessage,
+		assistantWithReasoningMessage,
+		assistantWithStatsMessage,
+		assistantWithToolCallsMessage,
+		compactionGeneratingMessage,
+		compactionMessage,
+		compactionPendingMessage,
+		CONV_ID,
+		cwdChangeMessage,
+		cwdClearedMessage,
+		generatingProcessingState,
+		mcpPromptMessage,
+		noopChatActions,
+		preCompactionAssistantMessage,
+		promptProcessingState,
+		rawOutputMessage,
+		REASONING_TEXT,
+		seedChatStory,
+		siblingInfo,
+		STORY_CLASS,
+		systemLongMessage,
+		systemMessage,
+		toolResultMessages,
+		userAttachmentsOnlyMessage,
+		userMarkdownMessage,
+		userMessage,
+		userWithAttachmentsMessage
+	} from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatMessage from '#lib/components/app/chat/ChatMessages/ChatMessage/ChatMessage.svelte';
+	import { MessageRole } from '#lib/enums/index.ts';
+	import { chatActivityStore } from '#lib/stores/chat/activity.svelte.ts';
+	import { chatStore } from '#lib/stores/index.ts';
+
+	const { Story } = defineMeta({
+		args: {
+			chatActions: noopChatActions,
+			class: STORY_CLASS
+		},
+		component: ChatMessage,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatMessages/ChatMessage'
+	});
+
+	const STREAM_ANSWER =
+		"Based on my analysis, here's the solution:\n\n**Step 1:** Understand the requirements.\n\n**Step 2:** Implement the solution step by step.\n\n**Step 3:** Test and validate the results.";
+
+	// Mutated by the streaming story's play function.
+	let streamingMessage = $state<DatabaseMessage>({
+		children: [],
+		content: '',
+		convId: CONV_ID,
+		id: 'assistant-streaming',
+		parent: userMessage.id,
+		reasoningContent: '',
+		role: MessageRole.ASSISTANT,
+		timestamp: 0,
+		type: 'text'
+	});
+
+	async function streamInto(field: 'content' | 'reasoningContent', text: string) {
+		for (let i = 0; i < text.length; i += 6) {
+			streamingMessage[field] = text.slice(0, i + 6);
+			await new Promise((resolve) => setTimeout(resolve, 30));
+		}
+	}
+</script>
+
+<Story args={{ message: assistantMessage }} beforeEach={() => seedChatStory()} name="Default" />
+
+<Story args={{ message: userMessage }} beforeEach={() => seedChatStory()} name="User" />
+
+<Story
+	args={{ message: userMarkdownMessage }}
+	beforeEach={() => seedChatStory()}
+	name="UserMarkdown"
+/>
+
+<Story
+	args={{ message: userMarkdownMessage }}
+	beforeEach={() => seedChatStory({ settings: { renderUserContentAsMarkdown: false } })}
+	name="UserPlainText"
+/>
+
+<Story
+	args={{ message: userWithAttachmentsMessage }}
+	beforeEach={() => seedChatStory()}
+	name="UserWithAttachments"
+/>
+
+<Story
+	args={{ message: userAttachmentsOnlyMessage }}
+	beforeEach={() => seedChatStory()}
+	name="UserAttachmentsOnly"
+/>
+
+<Story
+	args={{ message: userMessage, nextAssistantMessage: assistantWithStatsMessage }}
+	beforeEach={() => seedChatStory()}
+	name="UserWithReadingStats"
+/>
+
+<Story
+	args={{ isLastUserMessage: true, message: userMessage }}
+	beforeEach={() => seedChatStory({ loading: true, processing: promptProcessingState })}
+	name="UserReadingLive"
+/>
+
+<Story args={{ message: systemMessage }} beforeEach={() => seedChatStory()} name="System" />
+
+<Story args={{ message: systemLongMessage }} beforeEach={() => seedChatStory()} name="SystemLong" />
+
+<Story
+	args={{ message: assistantMessage }}
+	beforeEach={() => seedChatStory({ settings: { enableContinueGeneration: true } })}
+	name="AssistantWithContinue"
+/>
+
+<Story
+	args={{ message: assistantWithReasoningMessage }}
+	beforeEach={() => seedChatStory()}
+	name="AssistantWithReasoning"
+/>
+
+<Story
+	args={{ message: assistantInterruptedReasoningMessage }}
+	beforeEach={() => seedChatStory()}
+	name="AssistantReasoningCancelled"
+/>
+
+<Story
+	asChild
+	beforeEach={() => seedChatStory({ loading: true, streamingMessageId: streamingMessage.id })}
+	name="AssistantReasoningStreaming"
+	play={async () => {
+		streamingMessage.timestamp = 0;
+		streamingMessage.content = '';
+		streamingMessage.reasoningContent = '';
+
+		await streamInto('reasoningContent', REASONING_TEXT);
+		await streamInto('content', STREAM_ANSWER);
+
+		chatStore.chatStreamingStates.delete(CONV_ID);
+		chatActivityStore.localEnded(CONV_ID);
+		streamingMessage.timestamp = Date.now();
+	}}
+>
+	<ChatMessage
+		chatActions={noopChatActions}
+		class={STORY_CLASS}
+		isLastAssistantMessage
+		message={streamingMessage}
+	/>
+</Story>
+
+<Story
+	args={{
+		isLastAssistantMessage: true,
+		message: { ...assistantMessage, content: '', id: 'assistant-processing', timestamp: 0 }
+	}}
+	beforeEach={() => seedChatStory({ loading: true, processing: promptProcessingState })}
+	name="AssistantProcessing"
+/>
+
+<Story
+	args={{
+		isLastAssistantMessage: true,
+		message: {
+			...assistantMessage,
+			id: 'assistant-generating',
+			model: assistantWithStatsMessage.model,
+			timestamp: 0
+		}
+	}}
+	beforeEach={() =>
+		seedChatStory({
+			loading: true,
+			processing: generatingProcessingState,
+			streamingMessageId: 'assistant-generating'
+		})}
+	name="AssistantGenerating"
+/>
+
+<Story
+	args={{ message: assistantWithToolCallsMessage, toolMessages: toolResultMessages }}
+	beforeEach={() => seedChatStory()}
+	name="AssistantWithToolCalls"
+/>
+
+<Story
+	args={{ message: assistantAgenticWithStatsMessage, toolMessages: agenticToolMessages }}
+	beforeEach={() => seedChatStory({ settings: { showAgenticTurnStats: true } })}
+	name="AssistantAgenticMultiTurn"
+/>
+
+<Story
+	args={{ message: assistantWithStatsMessage }}
+	beforeEach={() => seedChatStory()}
+	name="AssistantWithStatistics"
+/>
+
+<Story
+	args={{ message: rawOutputMessage }}
+	beforeEach={() => seedChatStory({ settings: { showRawOutputSwitch: true } })}
+	name="RawOutput"
+	play={async ({ canvas, userEvent }) => {
+		await userEvent.click(await canvas.findByRole('switch'));
+	}}
+/>
+
+<Story
+	args={{ message: assistantMessage, siblingInfo }}
+	beforeEach={() => seedChatStory()}
+	name="WithBranching"
+/>
+
+<Story
+	args={{ message: compactionMessage }}
+	beforeEach={() =>
+		seedChatStory({ activeMessages: [preCompactionAssistantMessage, compactionMessage] })}
+	name="Compaction"
+/>
+
+<Story
+	args={{ message: compactionPendingMessage }}
+	beforeEach={() =>
+		seedChatStory({
+			compactingNodeId: compactionPendingMessage.id,
+			loading: true,
+			processing: promptProcessingState
+		})}
+	name="CompactionPrefill"
+/>
+
+<Story
+	args={{ message: compactionGeneratingMessage }}
+	beforeEach={() =>
+		seedChatStory({
+			compactingNodeId: compactionGeneratingMessage.id,
+			loading: true,
+			processing: generatingProcessingState
+		})}
+	name="CompactionGenerating"
+/>
+
+<Story args={{ message: cwdChangeMessage }} beforeEach={() => seedChatStory()} name="CwdChange" />
+
+<Story args={{ message: cwdClearedMessage }} beforeEach={() => seedChatStory()} name="CwdCleared" />
+
+<Story args={{ message: mcpPromptMessage }} beforeEach={() => seedChatStory()} name="McpPrompt" />
+
+<Story
+	args={{ message: userWithAttachmentsMessage }}
+	beforeEach={() => seedChatStory({ pendingEditMessageId: userWithAttachmentsMessage.id })}
+	name="EditUser"
+/>
+
+<Story
+	args={{ message: assistantWithReasoningMessage }}
+	beforeEach={() => seedChatStory({ pendingEditMessageId: assistantWithReasoningMessage.id })}
+	name="EditAssistant"
+/>
+
+<Story
+	args={{ message: systemMessage }}
+	beforeEach={() => seedChatStory({ pendingEditMessageId: systemMessage.id })}
+	name="EditSystem"
+/>
diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessageActionCard.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageActionCard.stories.svelte
new file mode 100644
index 000000000..a834943e1
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageActionCard.stories.svelte
@@ -0,0 +1,42 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatMessageActionCardContinueRequest from '#lib/components/app/chat/ChatMessages/ChatMessageActions/ChatMessageActionCard/ChatMessageActionCardContinueRequest.svelte';
+	import ChatMessageActionCardPermissionRequest from '#lib/components/app/chat/ChatMessages/ChatMessageActions/ChatMessageActionCard/ChatMessageActionCardPermissionRequest.svelte';
+	import { BuiltInTool } from '#lib/enums/index.ts';
+
+	const { Story } = defineMeta({
+		component: ChatMessageActionCardPermissionRequest,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatMessages/ChatMessageActionCard'
+	});
+
+	const onDecision = () => {};
+</script>
+
+<Story asChild name="States">
+	<StateGallery columns={2}>
+		<StateGalleryItem label="Permission" note="MCP server tool">
+			<ChatMessageActionCardPermissionRequest
+				{onDecision}
+				serverLabel="GitHub"
+				toolName="create_issue"
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Permission, built-in tool">
+			<ChatMessageActionCardPermissionRequest
+				{onDecision}
+				serverLabel=""
+				toolName={BuiltInTool.SERVER_EXEC_SHELL_COMMAND}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Continue request">
+			<ChatMessageActionCardContinueRequest {onDecision} />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessageActionIcons.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageActionIcons.stories.svelte
new file mode 100644
index 000000000..958dcad91
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageActionIcons.stories.svelte
@@ -0,0 +1,78 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import ActionIconsStoryHost from './ActionIconsStoryHost.svelte';
+	import { siblingInfo } from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		args: {
+			actionsPosition: 'left',
+			justify: 'start'
+		},
+		component: ActionIconsStoryHost,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatMessages/ChatMessageActionIcons'
+	});
+
+	const onRegenerate = () => {};
+</script>
+
+<Story asChild name="States">
+	<StateGallery columns={3}>
+		<StateGalleryItem label="Assistant" note="regenerate + continue">
+			<ActionIconsStoryHost
+				actionsPosition="left"
+				justify="start"
+				onContinue={() => {}}
+				{onRegenerate}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="User" note="right aligned">
+			<ActionIconsStoryHost actionsPosition="right" justify="end" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="No fork">
+			<ActionIconsStoryHost actionsPosition="left" forkable={false} justify="start" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Raw output switch">
+			<ActionIconsStoryHost
+				actionsPosition="left"
+				justify="start"
+				{onRegenerate}
+				showRawOutputSwitch
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Branching">
+			<ActionIconsStoryHost actionsPosition="left" justify="start" {onRegenerate} {siblingInfo} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Branching, first version">
+			<ActionIconsStoryHost
+				actionsPosition="left"
+				justify="start"
+				{onRegenerate}
+				siblingInfo={{ ...siblingInfo, currentIndex: 0 }}
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
+
+<!-- Separate: the delete dialog opens in a portal over the whole page. -->
+<Story
+	args={{
+		deletionInfo: {
+			assistantMessages: 2,
+			messageTypes: ['user', 'assistant'],
+			totalCount: 4,
+			userMessages: 2
+		},
+		showDeleteDialog: true
+	}}
+	name="DeleteDialog"
+/>
diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessageReasoningBlock.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageReasoningBlock.stories.svelte
new file mode 100644
index 000000000..de7b1ec14
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageReasoningBlock.stories.svelte
@@ -0,0 +1,60 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import {
+		reasoningInterruptedSection,
+		reasoningPendingSection,
+		reasoningSection,
+		seedChatStory
+	} from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatMessageReasoningBlock from '#lib/components/app/chat/ChatMessages/ChatMessageReasoningBlock.svelte';
+
+	const { Story } = defineMeta({
+		component: ChatMessageReasoningBlock,
+		parameters: {
+			layout: 'padded'
+		},
+		title: 'Llama Chat/Chat/ChatMessages/ChatMessageReasoningBlock'
+	});
+</script>
+
+<Story asChild beforeEach={() => seedChatStory()} name="States">
+	<StateGallery columns={1}>
+		<StateGalleryItem label="Collapsed">
+			<ChatMessageReasoningBlock isStreaming={false} open={false} section={reasoningSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Expanded" note="markdown">
+			<ChatMessageReasoningBlock isStreaming={false} open section={reasoningSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Streaming">
+			<ChatMessageReasoningBlock isStreaming open section={reasoningPendingSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Cancelled">
+			<ChatMessageReasoningBlock
+				isStreaming={false}
+				open={false}
+				section={reasoningInterruptedSection}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Error">
+			<ChatMessageReasoningBlock
+				hasReasoningError
+				isStreaming={false}
+				open={false}
+				section={reasoningInterruptedSection}
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
+
+<!-- Separate: turns off the global renderThinkingAsMarkdown setting. -->
+<Story
+	args={{ isStreaming: false, open: true, section: reasoningSection }}
+	beforeEach={() => seedChatStory({ settings: { renderThinkingAsMarkdown: false } })}
+	name="ExpandedPlainText"
+/>
diff --git a/ui/apps/chat/tests/stories/a11y/ChatMessageStatistics.a11y.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageStatistics.a11y.stories.svelte
similarity index 94%
rename from ui/apps/chat/tests/stories/a11y/ChatMessageStatistics.a11y.stories.svelte
rename to ui/apps/chat/tests/stories/chat/messages/ChatMessageStatistics.a11y.stories.svelte
index 8fdf46b40..7e7df3885 100644
--- a/ui/apps/chat/tests/stories/a11y/ChatMessageStatistics.a11y.stories.svelte
+++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageStatistics.a11y.stories.svelte
@@ -9,7 +9,7 @@
 			layout: 'centered'
 		},
 		tags: ['!dev'],
-		title: 'Components/ChatMessageStatistics/Accessibility'
+		title: 'Llama Chat/Chat/ChatMessages/ChatMessageStatistics/Accessibility'
 	});
 </script>

diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessageStatistics.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageStatistics.stories.svelte
new file mode 100644
index 000000000..b511a3138
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageStatistics.stories.svelte
@@ -0,0 +1,74 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { agenticTimings } from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatMessageStatistics from '#lib/components/app/chat/ChatMessages/ChatMessageStatistics/ChatMessageStatistics.svelte';
+	import { ChatMessageStatisticsMode, ChatMessageStatsView } from '#lib/enums/index.ts';
+
+	const { Story } = defineMeta({
+		component: ChatMessageStatistics,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatMessages/ChatMessageStatistics'
+	});
+
+	const stats = {
+		predictedMs: 3120,
+		predictedTokens: 164,
+		promptMs: 412,
+		promptTokens: 1830
+	};
+</script>
+
+<Story asChild name="States">
+	<StateGallery columns={1}>
+		<StateGalleryItem label="Default" note="generation view">
+			<ChatMessageStatistics {...stats} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Reading view">
+			<ChatMessageStatistics {...stats} initialView={ChatMessageStatsView.READING} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Tools view" note="agentic">
+			<ChatMessageStatistics {...stats} {agenticTimings} initialView={ChatMessageStatsView.TOOLS} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Summary view" note="agentic">
+			<ChatMessageStatistics
+				{...stats}
+				{agenticTimings}
+				initialView={ChatMessageStatsView.SUMMARY}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Agentic without summary">
+			<ChatMessageStatistics {...stats} {agenticTimings} hideSummary />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Generation only">
+			<ChatMessageStatistics {...stats} mode={ChatMessageStatisticsMode.GENERATION} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Reading only">
+			<ChatMessageStatistics {...stats} mode={ChatMessageStatisticsMode.READING} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Live, processing prompt">
+			<ChatMessageStatistics
+				isLive
+				isProcessingPrompt
+				predictedMs={undefined}
+				predictedTokens={undefined}
+				promptMs={6000}
+				promptTokens={4200}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Live, generating">
+			<ChatMessageStatistics {...stats} isLive predictedMs={5120} predictedTokens={128} />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessageToolCallBlock.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageToolCallBlock.stories.svelte
new file mode 100644
index 000000000..ed1030895
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageToolCallBlock.stories.svelte
@@ -0,0 +1,156 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import {
+		defaultToolMarkdownSection,
+		defaultToolPendingSection,
+		defaultToolSection,
+		defaultToolStreamingSection,
+		editFileErrorSection,
+		editFileSection,
+		execShellFailedSection,
+		execShellPendingSection,
+		execShellSection,
+		execShellTimedOutSection,
+		fileGlobSearchSection,
+		getDatetimeSection,
+		getInfoSection,
+		grepSearchSection,
+		readFileSection,
+		readMediaSection,
+		runJavascriptErrorSection,
+		runJavascriptSection,
+		searchResultsSection,
+		seedChatStory,
+		writeFileSection
+	} from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatMessageToolCallBlock from '#lib/components/app/chat/ChatMessages/ChatMessage/ChatMessageToolCall/ChatMessageToolCallBlock.svelte';
+	import { AgenticSectionType } from '#lib/enums/index.ts';
+
+	const { Story } = defineMeta({
+		component: ChatMessageToolCallBlock,
+		parameters: {
+			layout: 'padded'
+		},
+		title: 'Llama Chat/Chat/ChatMessages/ChatMessageToolCallBlock'
+	});
+</script>
+
+<Story asChild beforeEach={() => seedChatStory()} name="States">
+	<StateGallery columns={1} title="Generic block">
+		<StateGalleryItem label="Default">
+			<ChatMessageToolCallBlock isStreaming={false} open section={defaultToolSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Collapsed">
+			<ChatMessageToolCallBlock isStreaming={false} open={false} section={defaultToolSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Markdown result">
+			<ChatMessageToolCallBlock isStreaming={false} open section={defaultToolMarkdownSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Pending">
+			<ChatMessageToolCallBlock isStreaming open section={defaultToolPendingSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Streaming args">
+			<ChatMessageToolCallBlock isStreaming open section={defaultToolStreamingSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Truncated" note="no args received">
+			<ChatMessageToolCallBlock
+				isStreaming={false}
+				open
+				section={{ ...defaultToolStreamingSection, toolArgs: undefined }}
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+
+	<StateGallery columns={1} title="Per tool">
+		<StateGalleryItem label="Get datetime">
+			<ChatMessageToolCallBlock isStreaming={false} open section={getDatetimeSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Get datetime, pending">
+			<ChatMessageToolCallBlock
+				isStreaming
+				open
+				section={{
+					...getDatetimeSection,
+					toolResult: undefined,
+					type: AgenticSectionType.TOOL_CALL_PENDING
+				}}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Get info">
+			<ChatMessageToolCallBlock isStreaming={false} open section={getInfoSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Read file">
+			<ChatMessageToolCallBlock isStreaming={false} open section={readFileSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Edit file">
+			<ChatMessageToolCallBlock isStreaming={false} open section={editFileSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Edit file, error">
+			<ChatMessageToolCallBlock isStreaming={false} open section={editFileErrorSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Write file">
+			<ChatMessageToolCallBlock isStreaming={false} open section={writeFileSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="File glob search">
+			<ChatMessageToolCallBlock isStreaming={false} open section={fileGlobSearchSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Grep search">
+			<ChatMessageToolCallBlock isStreaming={false} open section={grepSearchSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Run JavaScript">
+			<ChatMessageToolCallBlock isStreaming={false} open section={runJavascriptSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Run JavaScript, error">
+			<ChatMessageToolCallBlock isStreaming={false} open section={runJavascriptErrorSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Read media">
+			<ChatMessageToolCallBlock isStreaming={false} open section={readMediaSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Search results">
+			<ChatMessageToolCallBlock isStreaming={false} open section={searchResultsSection} />
+		</StateGalleryItem>
+	</StateGallery>
+
+	<StateGallery columns={1} title="Shell command">
+		<StateGalleryItem label="Completed">
+			<ChatMessageToolCallBlock isStreaming={false} open section={execShellSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Failed">
+			<ChatMessageToolCallBlock isStreaming={false} open section={execShellFailedSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Timed out">
+			<ChatMessageToolCallBlock isStreaming={false} open section={execShellTimedOutSection} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Running">
+			<ChatMessageToolCallBlock
+				conversationCwd="/home/user/projects/app"
+				isExecuting
+				isStreaming
+				open
+				section={execShellPendingSection}
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessageUserPending.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageUserPending.stories.svelte
new file mode 100644
index 000000000..cdb32f16d
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageUserPending.stories.svelte
@@ -0,0 +1,34 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { userAttachments } from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatMessageUserPending from '#lib/components/app/chat/ChatMessages/ChatMessage/ChatMessageUser/ChatMessageUserPending.svelte';
+
+	const { Story } = defineMeta({
+		component: ChatMessageUserPending,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatMessages/ChatMessageUserPending'
+	});
+
+	const props = {
+		content: 'Also check the tests folder before you answer.',
+		onDelete: () => {},
+		onEdit: () => {},
+		onSendImmediately: () => {}
+	};
+</script>
+
+<Story asChild name="States">
+	<StateGallery columns={1}>
+		<StateGalleryItem label="Default" note="hover for actions">
+			<ChatMessageUserPending {...props} class="w-full" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="With attachments">
+			<ChatMessageUserPending {...props} class="w-full" extras={[userAttachments[0]]} />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/messages/fixtures.ts b/ui/apps/chat/tests/stories/chat/messages/fixtures.ts
new file mode 100644
index 000000000..41aae1b3d
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/messages/fixtures.ts
@@ -0,0 +1,728 @@
+import {
+	AgenticSectionType,
+	AttachmentType,
+	BuiltInTool,
+	MessageRole,
+	MessageType
+} from '#lib/enums/index.ts';
+import { chatActivityStore } from '#lib/stores/chat/activity.svelte.ts';
+import { chatStore, conversationsStore, settingsStore } from '#lib/stores/index.ts';
+import type {
+	AgenticSection,
+	ApiChatCompletionToolCall,
+	ApiProcessingState,
+	ChatMessageActions,
+	ChatMessageAgenticTimings,
+	ChatMessageSiblingInfo,
+	DatabaseMessage,
+	DatabaseMessageExtra,
+	SettingsConfigValue
+} from '#lib/types/index.ts';
+
+export const CONV_ID = 'conv-1';
+export const MODEL_NAME = 'ggml-org/gpt-oss-20b-GGUF';
+export const STORY_CLASS = 'max-w-[56rem] w-[calc(100vw-2rem)]';
+
+const NOW = Date.now();
+
+export const noopChatActions: ChatMessageActions = {
+	continueAssistantMessage: () => {},
+	copy: () => {},
+	delete: () => {},
+	editUserMessagePreserveResponses: () => {},
+	editWithBranching: () => {},
+	editWithReplacement: () => {},
+	forkConversation: () => {},
+	navigateToSibling: () => {},
+	regenerateCompaction: () => {},
+	regenerateWithBranching: () => {}
+};
+
+function createMessage(
+	fields: Pick<DatabaseMessage, 'id' | 'role' | 'content'> & Partial<DatabaseMessage>
+): DatabaseMessage {
+	return {
+		children: [],
+		convId: CONV_ID,
+		parent: null,
+		timestamp: NOW - 1000 * 60,
+		type: MessageType.TEXT,
+		...fields
+	};
+}
+
+function toolCallsJson(calls: { id: string; name: string; args: unknown }[]): string {
+	const toolCalls: ApiChatCompletionToolCall[] = calls.map((call) => ({
+		function: { arguments: JSON.stringify(call.args), name: call.name },
+		id: call.id,
+		type: 'function'
+	}));
+
+	return JSON.stringify(toolCalls);
+}
+
+// Small inline images so the stories need no binary assets.
+const SVG_IMAGE_URL = `data:image/svg+xml;base64,${btoa(
+	'<svg xmlns="http://www.w3.org/2000/svg" width="320" height="200" viewBox="0 0 320 200"><defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#f59e0b"/><stop offset="1" stop-color="#ef4444"/></linearGradient></defs><rect width="320" height="200" fill="url(#g)"/><circle cx="160" cy="100" r="48" fill="#fff" fill-opacity="0.85"/></svg>'
+)}`;
+const CHART_IMAGE_URL = `data:image/svg+xml;base64,${btoa(
+	'<svg xmlns="http://www.w3.org/2000/svg" width="240" height="160" viewBox="0 0 240 160"><rect width="240" height="160" fill="#0f172a"/><rect x="30" y="90" width="30" height="50" fill="#38bdf8"/><rect x="80" y="60" width="30" height="80" fill="#38bdf8"/><rect x="130" y="30" width="30" height="110" fill="#38bdf8"/><rect x="180" y="70" width="30" height="70" fill="#38bdf8"/></svg>'
+)}`;
+
+/* User messages */
+
+export const userMessage = createMessage({
+	content: 'What is the meaning of life, the universe, and everything?',
+	id: 'user-1',
+	role: MessageRole.USER
+});
+
+export const userMarkdownMessage = createMessage({
+	content:
+		'Can you review this function?\n\n```ts\nexport function sum(values: number[]): number {\n\treturn values.reduce((acc, v) => acc + v, 0);\n}\n```\n\n- Is it safe for empty arrays?\n- Should it accept `bigint`?',
+	id: 'user-markdown',
+	role: MessageRole.USER
+});
+
+export const userAttachments: DatabaseMessageExtra[] = [
+	{
+		base64Url: SVG_IMAGE_URL,
+		name: 'sunset.svg',
+		size: 412,
+		type: AttachmentType.IMAGE
+	},
+	{
+		content: 'id,name,score\n1,Ada,98\n2,Linus,91\n3,Grace,95\n',
+		name: 'scores.csv',
+		size: 46,
+		type: AttachmentType.TEXT
+	},
+	{
+		base64Data: btoa('%PDF-1.4\n%mock\n'),
+		content: 'Quarterly report. Revenue grew 12 percent quarter over quarter.',
+		name: 'report.pdf',
+		processedAsImages: false,
+		size: 18_432,
+		type: AttachmentType.PDF
+	}
+];
+
+export const userWithAttachmentsMessage = createMessage({
+	content: 'Summarize the attached files and describe the image.',
+	extra: userAttachments,
+	id: 'user-attachments',
+	role: MessageRole.USER
+});
+
+export const userAttachmentsOnlyMessage = createMessage({
+	content: '',
+	extra: [userAttachments[0]],
+	id: 'user-attachments-only',
+	role: MessageRole.USER
+});
+
+/* System messages */
+
+export const systemMessage = createMessage({
+	content: 'You are a helpful assistant. Answer briefly and use **markdown** when it helps.',
+	id: 'system-1',
+	role: MessageRole.SYSTEM,
+	type: MessageType.SYSTEM
+});
+
+export const systemLongMessage = createMessage({
+	content: [
+		'You are a senior software engineer helping with the llama.cpp web UI.',
+		'',
+		'## Rules',
+		'',
+		'1. Read the relevant files before you answer.',
+		'2. Keep answers short and concrete.',
+		'3. Prefer existing helpers over new abstractions.',
+		'4. Use ASCII only in code comments.',
+		'5. Never invent API fields; read the types first.',
+		'6. Point to file paths when you mention code.',
+		'',
+		'## Style',
+		'',
+		'- Use simple words.',
+		'- Avoid long comments.',
+		'- Show code only when it is needed.'
+	].join('\n'),
+	id: 'system-long',
+	role: MessageRole.SYSTEM,
+	type: MessageType.SYSTEM
+});
+
+/* Assistant messages */
+
+export const assistantMessage = createMessage({
+	content:
+		'The answer to the ultimate question of life, the universe, and everything is **42**.\n\nThis comes from Douglas Adams\' "The Hitchhiker\'s Guide to the Galaxy," where a supercomputer named Deep Thought calculated this answer over 7.5 million years. However, the question itself was never properly formulated, which is why the answer seems meaningless without context.',
+	id: 'assistant-1',
+	parent: 'user-1',
+	role: MessageRole.ASSISTANT
+});
+
+export const REASONING_TEXT =
+	"Let's consider the question step by step:\n\n1. Identify the core problem\n2. Evaluate relevant information\n3. Formulate a clear answer\n\nFollowing this process keeps the final response focused and accurate.";
+
+export const assistantWithReasoningMessage = createMessage({
+	content: "Here's the concise answer, now that I've thought it through: **42**.",
+	id: 'assistant-reasoning',
+	parent: 'user-1',
+	reasoningContent: REASONING_TEXT,
+	role: MessageRole.ASSISTANT
+});
+
+// Reasoning with no answer after it, on a finished turn: the block shows "Cancelled".
+export const assistantInterruptedReasoningMessage = createMessage({
+	content: '',
+	id: 'assistant-reasoning-interrupted',
+	parent: 'user-1',
+	reasoningContent: 'The user asks about the meaning of life. I should first check which',
+	role: MessageRole.ASSISTANT
+});
+
+export const assistantWithStatsMessage = createMessage({
+	content: assistantMessage.content,
+	id: 'assistant-stats',
+	model: MODEL_NAME,
+	parent: 'user-1',
+	role: MessageRole.ASSISTANT,
+	timings: {
+		cache_n: 128,
+		predicted_ms: 3120,
+		predicted_n: 164,
+		prompt_ms: 412,
+		prompt_n: 1830
+	}
+});
+
+export const rawOutputMessage = createMessage({
+	content: 'Hello there! How can I help you today?',
+	id: 'assistant-raw',
+	parent: 'user-1',
+	reasoningContent:
+		'User greeted me. Is this a trap? No, just a normal hello. Respond calmly and do not start explaining quantum physics again.',
+	role: MessageRole.ASSISTANT
+});
+
+/* Agentic (tool calls) */
+
+export const agenticTimings: ChatMessageAgenticTimings = {
+	llm: { predicted_ms: 5400, predicted_n: 312, prompt_ms: 980, prompt_n: 4210 },
+	perTurn: [
+		{
+			llm: { predicted_ms: 1800, predicted_n: 96, prompt_ms: 610, prompt_n: 2400 },
+			toolCalls: [
+				{ duration_ms: 42, name: BuiltInTool.SERVER_GET_INFO, success: true },
+				{ duration_ms: 318, name: BuiltInTool.SERVER_EXEC_SHELL_COMMAND, success: true }
+			],
+			toolsMs: 360,
+			turn: 1
+		},
+		{
+			llm: { predicted_ms: 3600, predicted_n: 216, prompt_ms: 370, prompt_n: 1810 },
+			toolCalls: [],
+			toolsMs: 0,
+			turn: 2
+		}
+	],
+	toolCalls: [
+		{ duration_ms: 42, name: BuiltInTool.SERVER_GET_INFO, success: true },
+		{ duration_ms: 318, name: BuiltInTool.SERVER_EXEC_SHELL_COMMAND, success: true }
+	],
+	toolCallsCount: 2,
+	toolsMs: 360,
+	turns: 2
+};
+
+export const assistantWithToolCallsMessage = createMessage({
+	content: 'Let me check the environment first.',
+	id: 'assistant-tools',
+	parent: 'user-1',
+	reasoningContent: 'I need the working directory and the file list before I answer.',
+	role: MessageRole.ASSISTANT,
+	toolCalls: toolCallsJson([
+		{ args: {}, id: 'call-info', name: BuiltInTool.SERVER_GET_INFO },
+		{ args: { command: 'ls -la' }, id: 'call-ls', name: BuiltInTool.SERVER_EXEC_SHELL_COMMAND }
+	])
+});
+
+export const toolResultMessages: DatabaseMessage[] = [
+	createMessage({
+		content: JSON.stringify({ cwd: '/home/user/projects/llama.cpp', os: 'linux' }),
+		id: 'tool-info',
+		parent: 'assistant-tools',
+		role: MessageRole.TOOL,
+		toolCallId: 'call-info'
+	}),
+	createMessage({
+		content:
+			'total 24\ndrwxr-xr-x  6 user user 4096 Oct 28 10:12 .\ndrwxr-xr-x 12 user user 4096 Oct 27 09:01 ..\n-rw-r--r--  1 user user 1067 Oct 20 14:33 LICENSE\n-rw-r--r--  1 user user 2311 Oct 28 10:12 README.md\ndrwxr-xr-x  4 user user 4096 Oct 28 10:10 src\ndrwxr-xr-x  3 user user 4096 Oct 26 18:40 tools\n[exit code: 0]',
+		id: 'tool-ls',
+		parent: 'tool-info',
+		role: MessageRole.TOOL,
+		toolCallId: 'call-ls',
+		toolCwd: '/home/user/projects/llama.cpp'
+	})
+];
+
+// Continuation turn after the tool results; it closes the agentic session.
+export const agenticFinalTurnMessage = createMessage({
+	content:
+		'The project root holds `README.md`, `LICENSE` and two folders: `src` and `tools`. The shell runs on Linux in `~/projects/llama.cpp`.',
+	id: 'assistant-tools-final',
+	parent: 'tool-ls',
+	role: MessageRole.ASSISTANT
+});
+
+export const agenticToolMessages: DatabaseMessage[] = [
+	...toolResultMessages,
+	agenticFinalTurnMessage
+];
+
+export const assistantAgenticWithStatsMessage: DatabaseMessage = {
+	...assistantWithToolCallsMessage,
+	id: 'assistant-tools-stats',
+	model: MODEL_NAME,
+	timings: {
+		agentic: agenticTimings,
+		predicted_ms: 1800,
+		predicted_n: 96,
+		prompt_ms: 610,
+		prompt_n: 2400
+	}
+};
+
+/* Compaction */
+
+export const preCompactionAssistantMessage = createMessage({
+	content: 'Deep Thought took 7.5 million years to answer.',
+	id: 'assistant-pre-compaction',
+	parent: 'user-1',
+	role: MessageRole.ASSISTANT,
+	timestamp: NOW - 1000 * 60 * 31,
+	timings: { cache_n: 0, predicted_n: 118, prompt_n: 42200 }
+});
+
+export const compactionMessage = createMessage({
+	content:
+		'The user asked about the ultimate answer and its origin. Key facts: the answer is **42**, from Douglas Adams\' "The Hitchhiker\'s Guide to the Galaxy", computed by Deep Thought over 7.5 million years.\n\nNothing is left to do unless the user wants the question itself discussed.',
+	id: 'compaction-1',
+	model: MODEL_NAME,
+	parent: 'assistant-pre-compaction',
+	role: MessageRole.USER,
+	timestamp: NOW - 1000 * 60 * 30,
+	// The pre-encode stamps the reduced prompt; `compaction` keeps the summary request timings.
+	timings: {
+		cache_n: 0,
+		compaction: {
+			cache_n: 0,
+			predicted_ms: 12000,
+			predicted_n: 300,
+			prompt_ms: 18200,
+			prompt_n: 42200
+		},
+		predicted_n: 0,
+		prompt_n: 3204
+	},
+	type: MessageType.COMPACTION
+});
+
+export const compactionPendingMessage = createMessage({
+	content: '',
+	id: 'compaction-pending',
+	parent: 'assistant-pre-compaction',
+	role: MessageRole.USER,
+	type: MessageType.COMPACTION
+});
+
+export const compactionGeneratingMessage = createMessage({
+	content:
+		'The user asked about the ultimate answer and its origin. Key facts: the answer is **42**',
+	id: 'compaction-generating',
+	model: MODEL_NAME,
+	parent: 'assistant-pre-compaction',
+	role: MessageRole.USER,
+	type: MessageType.COMPACTION
+});
+
+/* Synthetic and MCP prompt */
+
+export const cwdChangeMessage = createMessage({
+	content: 'Set working directory to [file:///home/user/projects/llama.cpp](~/projects/llama.cpp)',
+	id: 'cwd-change',
+	isSynthetic: true,
+	role: MessageRole.USER
+});
+
+export const cwdClearedMessage = createMessage({
+	content: 'Working directory cleared',
+	id: 'cwd-cleared',
+	isSynthetic: true,
+	role: MessageRole.USER
+});
+
+export const mcpPromptMessage = createMessage({
+	content: '',
+	extra: [
+		{
+			arguments: { language: 'TypeScript', path: 'src/lib/utils/agentic.ts' },
+			content:
+				'Review the TypeScript file at src/lib/utils/agentic.ts. Point out bugs first, then style issues.',
+			name: 'code_review',
+			promptName: 'code_review',
+			serverName: 'github',
+			type: AttachmentType.MCP_PROMPT
+		}
+	],
+	id: 'mcp-prompt',
+	role: MessageRole.USER
+});
+
+/* Branching */
+
+export const siblingInfo: ChatMessageSiblingInfo = {
+	currentIndex: 1,
+	message: assistantMessage,
+	siblingIds: ['assistant-0', assistantMessage.id, 'assistant-2'],
+	totalSiblings: 3
+};
+
+/* Tool call sections, as deriveAgenticSections builds them */
+
+function toolSection(
+	toolName: string,
+	args: unknown,
+	toolResult?: string,
+	type: AgenticSectionType = AgenticSectionType.TOOL_CALL
+): AgenticSection {
+	return {
+		content: toolResult ?? '',
+		toolArgs: typeof args === 'string' ? args : JSON.stringify(args),
+		toolCallId: `call-${toolName}`,
+		toolName,
+		toolResult,
+		type
+	};
+}
+
+export const defaultToolSection = toolSection(
+	'get_weather',
+	{ city: 'Warsaw', units: 'metric' },
+	JSON.stringify({ city: 'Warsaw', condition: 'cloudy', humidity: 71, temperature: 9 })
+);
+
+export const defaultToolPendingSection = toolSection(
+	'get_weather',
+	{ city: 'Warsaw', units: 'metric' },
+	undefined,
+	AgenticSectionType.TOOL_CALL_PENDING
+);
+
+export const defaultToolStreamingSection = toolSection(
+	'get_weather',
+	'{"city": "Wars',
+	undefined,
+	AgenticSectionType.TOOL_CALL_STREAMING
+);
+
+export const defaultToolMarkdownSection = toolSection(
+	'summarize_issue',
+	{ issue: 31273 },
+	'## Issue 31273\n\n**Status:** open\n\nThe reasoning menu should list the effort levels the chat template supports.'
+);
+
+export const getDatetimeSection = toolSection(
+	BuiltInTool.BROWSER_GET_DATETIME,
+	{},
+	JSON.stringify({ result: 'Wednesday, October 28, 2026, 10:15:00 CET' })
+);
+
+export const getInfoSection = toolSection(
+	BuiltInTool.SERVER_GET_INFO,
+	{},
+	JSON.stringify({ cwd: '/home/user/projects/llama.cpp', os: 'linux' })
+);
+
+export const readFileSection = toolSection(
+	BuiltInTool.SERVER_READ_FILE,
+	{ end_line: 9, path: 'src/lib/utils/sum.ts', start_line: 1 },
+	'export function sum(values: number[]): number {\n\treturn values.reduce((acc, v) => acc + v, 0);\n}\n\nexport function mean(values: number[]): number {\n\tif (values.length === 0) return 0;\n\n\treturn sum(values) / values.length;\n}'
+);
+
+export const editFileSection = toolSection(
+	BuiltInTool.SERVER_EDIT_FILE,
+	{
+		edits: [
+			{
+				new_text: '\tif (values.length === 0) return Number.NaN;',
+				old_text: '\tif (values.length === 0) return 0;'
+			}
+		],
+		path: 'src/lib/utils/sum.ts'
+	},
+	JSON.stringify({ edits_applied: 1, result: 'File edited' })
+);
+
+export const editFileErrorSection = toolSection(
+	BuiltInTool.SERVER_EDIT_FILE,
+	{
+		edits: [{ new_text: 'const b = 2;', old_text: 'const a = 1;' }],
+		path: 'src/lib/utils/sum.ts'
+	},
+	JSON.stringify({ error: 'old_text not found in file' })
+);
+
+export const writeFileSection = toolSection(
+	BuiltInTool.SERVER_WRITE_FILE,
+	{
+		content: '# Notes\n\n- Sum is safe for empty arrays.\n- Mean returns NaN for empty input.\n',
+		path: 'docs/notes.md'
+	},
+	JSON.stringify({ bytes: 79, result: 'File written' })
+);
+
+export const execShellSection: AgenticSection = {
+	...toolSection(
+		BuiltInTool.SERVER_EXEC_SHELL_COMMAND,
+		{ command: 'npm test -- --run' },
+		' RUN  v4.1.12 /home/user/projects/app\n\n  src/sum.test.ts (3 tests) 4ms\n  src/mean.test.ts (2 tests) 3ms\n\n Test Files  2 passed (2)\n      Tests  5 passed (5)\n[exit code: 0]'
+	),
+	toolCwd: '/home/user/projects/app'
+};
+
+export const execShellFailedSection: AgenticSection = {
+	...toolSection(
+		BuiltInTool.SERVER_EXEC_SHELL_COMMAND,
+		{ command: 'cat missing.txt' },
+		'cat: missing.txt: No such file or directory\n[exit code: 1]'
+	),
+	toolCwd: '/home/user/projects/app'
+};
+
+export const execShellTimedOutSection: AgenticSection = {
+	...toolSection(
+		BuiltInTool.SERVER_EXEC_SHELL_COMMAND,
+		{ command: 'sleep 600' },
+		'[exit code: -1] [exit due to timed out]'
+	),
+	toolCwd: '/home/user/projects/app'
+};
+
+export const execShellPendingSection: AgenticSection = toolSection(
+	BuiltInTool.SERVER_EXEC_SHELL_COMMAND,
+	{ command: 'npm run build' },
+	undefined,
+	AgenticSectionType.TOOL_CALL_PENDING
+);
+
+export const fileGlobSearchSection = toolSection(
+	BuiltInTool.SERVER_FILE_GLOB_SEARCH,
+	{ exclude: '**/node_modules/**', include: '**/*.svelte', path: 'src/lib/components' },
+	JSON.stringify({
+		plain_text_response:
+			'src/lib/components/app/chat/ChatMessages/ChatMessage/ChatMessage.svelte\nsrc/lib/components/app/chat/ChatMessages/ChatMessageReasoningBlock.svelte\nsrc/lib/components/app/chat/ChatMessages/ChatMessageEditForm.svelte\n---\nTotal matches: 3'
+	})
+);
+
+export const grepSearchSection = toolSection(
+	BuiltInTool.SERVER_GREP_SEARCH,
+	{
+		include: '**/*.ts',
+		path: 'src/lib',
+		pattern: 'deriveAgenticSections',
+		return_line_numbers: true
+	},
+	JSON.stringify({
+		plain_text_response:
+			'src/lib/utils/agentic.ts:209:export function deriveAgenticSections(\nsrc/lib/utils/index.ts:88:\tderiveAgenticSections,\n---\nTotal matches: 2'
+	})
+);
+
+export const runJavascriptSection = toolSection(
+	BuiltInTool.BROWSER_RUN_JAVASCRIPT,
+	{
+		code: 'const values = [3, 1, 2];\nconsole.log(values.sort());\nreturn values.length;',
+		timeout_ms: 5000
+	},
+	'[1,2,3]\n3'
+);
+
+export const runJavascriptErrorSection = toolSection(
+	BuiltInTool.BROWSER_RUN_JAVASCRIPT,
+	{ code: 'undefinedFunction();' },
+	JSON.stringify({ error: 'ReferenceError: undefinedFunction is not defined' })
+);
+
+export const readMediaSection: AgenticSection = {
+	...toolSection(
+		BuiltInTool.BROWSER_READ_MEDIA,
+		{ path: '/home/user/charts/usage.svg' },
+		'File: /home/user/charts/usage.svg\nSize: 512 bytes\nMIME: image/svg+xml\n[Attachment saved: mcp-attachment-usage.svg]'
+	),
+	toolResultExtras: [
+		{
+			base64Url: CHART_IMAGE_URL,
+			name: 'mcp-attachment-usage.svg',
+			type: AttachmentType.IMAGE
+		}
+	]
+};
+
+export const searchResultsSection = toolSection(
+	'web_search_exa',
+	{ query: 'llama.cpp speculative decoding' },
+	[
+		'Title: Speculative decoding in llama.cpp',
+		'URL: https://github.com/ggml-org/llama.cpp/tree/master/examples/speculative',
+		'Published: 2025-03-14',
+		'Author: N/A',
+		'Highlights:',
+		'Use a small draft model to propose tokens that the main model verifies in one batch.',
+		'---',
+		'Title: llama-server README',
+		'URL: https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md',
+		'Published: N/A',
+		'Author: ggml-org',
+		'Highlights:',
+		'The server accepts --model-draft to enable speculative decoding.'
+	].join('\n')
+);
+
+/* Reasoning sections */
+
+export const reasoningSection: AgenticSection = {
+	content: REASONING_TEXT,
+	type: AgenticSectionType.REASONING
+};
+
+export const reasoningPendingSection: AgenticSection = {
+	content: REASONING_TEXT,
+	type: AgenticSectionType.REASONING_PENDING
+};
+
+export const reasoningInterruptedSection: AgenticSection = {
+	content: 'The user asks about the meaning of life. I should first check which',
+	type: AgenticSectionType.REASONING,
+	wasInterrupted: true
+};
+
+/* Store seeding */
+
+export const promptProcessingState: ApiProcessingState = {
+	contextTotal: 32768,
+	contextUsed: 10000,
+	hasNextToken: false,
+	outputTokensMax: -1,
+	outputTokensUsed: 0,
+	progressPercent: 42,
+	promptProgress: { cache: 0, processed: 4200, time_ms: 6000, total: 10000 },
+	promptTokens: 0,
+	speculative: false,
+	status: 'preparing',
+	temperature: 0.8,
+	tokensDecoded: 0,
+	tokensPerSecond: 0,
+	tokensRemaining: -1,
+	topP: 0.95
+};
+
+export const generatingProcessingState: ApiProcessingState = {
+	contextTotal: 32768,
+	contextUsed: 45200,
+	hasNextToken: true,
+	outputTokensMax: -1,
+	outputTokensUsed: 128,
+	promptTokens: 42200,
+	speculative: false,
+	status: 'generating',
+	temperature: 0.8,
+	tokensDecoded: 128,
+	tokensPerSecond: 25,
+	tokensRemaining: -1,
+	topP: 0.95
+};
+
+export interface ChatStorySeed {
+	settings?: Record<string, SettingsConfigValue>;
+	/** Branch the compaction toggle reads its "before" size from. */
+	activeMessages?: DatabaseMessage[];
+	/** Marks the conversation as having a local pipe (chatStore.isLoading). */
+	loading?: boolean;
+	/** Message id of a live stream (chatStore.isStreaming()). */
+	streamingMessageId?: string;
+	processing?: ApiProcessingState;
+	compactingNodeId?: string;
+	/** Opens the edit form of this message on mount. */
+	pendingEditMessageId?: string;
+}
+
+// Pinned so stories look the same whatever the viewer has in localStorage.
+const STORY_SETTINGS_DEFAULTS: Record<string, SettingsConfigValue> = {
+	enableContinueGeneration: false,
+	renderThinkingAsMarkdown: true,
+	renderUserContentAsMarkdown: true,
+	showAgenticTurnStats: false,
+	showMessageStats: true,
+	showRawOutputSwitch: false
+};
+
+/**
+ * Seed the global stores a chat message reads. Use as a story `beforeEach`:
+ * it runs before render and the returned cleanup resets the stores, so state
+ * does not leak into the next story.
+ */
+export function seedChatStory(seed: ChatStorySeed = {}): () => void {
+	const settings = { ...STORY_SETTINGS_DEFAULTS, ...seed.settings };
+	const previousSettings = Object.fromEntries(
+		Object.keys(settings).map((key) => [key, settingsStore.config[key]])
+	);
+
+	for (const [key, value] of Object.entries(settings)) {
+		settingsStore.updateConfig(key, value);
+	}
+
+	conversationsStore.activeConversation = {
+		currNode: null,
+		id: CONV_ID,
+		lastModified: NOW,
+		name: 'Storybook conversation'
+	};
+	conversationsStore.activeMessages = seed.activeMessages ?? [];
+
+	if (seed.loading) chatActivityStore.markLocal(CONV_ID);
+
+	if (seed.streamingMessageId) {
+		chatStore.chatStreamingStates.set(CONV_ID, {
+			messageId: seed.streamingMessageId,
+			response: ''
+		});
+	}
+
+	if (seed.processing) {
+		chatStore.processing.setActiveConversation(CONV_ID);
+		chatStore.processing.setState(CONV_ID, seed.processing);
+	}
+
+	if (seed.compactingNodeId) chatActivityStore.markCompacting(CONV_ID, seed.compactingNodeId);
+
+	if (seed.pendingEditMessageId) chatStore.pendingEditMessageId = seed.pendingEditMessageId;
+
+	return () => {
+		for (const [key, value] of Object.entries(previousSettings)) {
+			settingsStore.updateConfig(key, value);
+		}
+
+		chatActivityStore.localEnded(CONV_ID);
+		chatActivityStore.endCompacting(CONV_ID);
+		chatStore.chatStreamingStates.delete(CONV_ID);
+		chatStore.processing.setState(CONV_ID, null);
+		chatStore.processing.setActiveConversation(null);
+		chatStore.pendingEditMessageId = null;
+		conversationsStore.activeMessages = [];
+		conversationsStore.activeConversation = null;
+	};
+}
diff --git a/ui/apps/chat/tests/stories/chat/screen/ChatScreen.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/ChatScreen.stories.svelte
new file mode 100644
index 000000000..da7aba545
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/screen/ChatScreen.stories.svelte
@@ -0,0 +1,242 @@
+<script lang="ts" module>
+	import { getPace } from '../../pace';
+	import {
+		installFakeServer,
+		openScreenConversation,
+		SCREEN_CONVERSATION_ID,
+		seedNewChat
+	} from './chat-screen.fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatScreen from '#lib/components/app/chat/ChatScreen/ChatScreen.svelte';
+	import { chatStore, conversationsStore, serverStore } from '#lib/stores/index.ts';
+	import { expect, waitFor, within } from 'storybook/test';
+
+	const newChatRoute = {
+		sveltekit_experimental: {
+			state: { page: { params: {}, route: { id: '/(chat)' }, url: new URL('http://localhost/#/') } }
+		}
+	};
+
+	const conversationRoute = {
+		sveltekit_experimental: {
+			state: {
+				page: {
+					params: { id: SCREEN_CONVERSATION_ID },
+					route: { id: '/(chat)/chat/[id]' },
+					url: new URL(`http://localhost/#/chat/${SCREEN_CONVERSATION_ID}`)
+				}
+			}
+		}
+	};
+
+	const { Story } = defineMeta({
+		component: ChatScreen,
+		parameters: {
+			layout: 'fullscreen'
+		},
+		title: 'Llama Chat/Chat/ChatScreen/ChatScreen'
+	});
+
+	// the streamed reply ends with this sentence, so it is on screen only once the stream is done
+	const REPLY_END = 'at a small cost in quality.';
+
+	/** Stores and the fake server for a story; async so the conversation is in IndexedDB before render. */
+	function setup(
+		options: {
+			conversation?: boolean;
+			server?: Parameters<typeof installFakeServer>[0];
+			/** Streams this many times slower than the pace, to leave time to act mid-reply. */
+			slowStream?: number;
+		} = {}
+	) {
+		return async (context: { globals?: Record<string, unknown> }) => {
+			const pace = getPace(context);
+			const restoreStores = seedNewChat();
+			const restoreServer = installFakeServer({
+				chunkDelayMs: pace.streamChunkMs * (options.slowStream ?? 1),
+				...options.server
+			});
+
+			if (options.conversation) await openScreenConversation();
+
+			return () => {
+				chatStore.stopGeneration();
+				restoreServer();
+				restoreStores();
+			};
+		};
+	}
+
+	/** Types the message key by key at the story's pace, then sends it with Enter. */
+	async function send(
+		context: { canvasElement: HTMLElement; globals?: Record<string, unknown> },
+		text: string
+	) {
+		const { pause, user } = getPace(context);
+		const textarea = await within(context.canvasElement).findByRole('textbox');
+
+		await pause();
+		await user.type(textarea, text);
+		await pause();
+		await user.keyboard('{Enter}');
+	}
+</script>
+
+<Story
+	args={{ showCenteredEmpty: true }}
+	beforeEach={setup()}
+	name="Default"
+	parameters={newChatRoute}
+	play={async (context) => {
+		const { canvas } = context;
+
+		await expect(await canvas.findByText('Hello there')).toBeInTheDocument();
+		await expect(canvas.getByRole('textbox')).toHaveFocus();
+		await expect(canvas.getByRole('button', { name: 'Send' })).toBeDisabled();
+	}}
+/>
+
+<Story
+	args={{ showCenteredEmpty: true }}
+	beforeEach={setup()}
+	name="SendFirstMessage"
+	parameters={newChatRoute}
+	play={async (context) => {
+		const { canvas, step } = context;
+
+		await step('type and send a message', async () => {
+			await send(context, 'What does quantization do?');
+		});
+
+		await step('the message moves into the chat and the reply streams in', async () => {
+			await expect(await canvas.findByText('What does quantization do?')).toBeInTheDocument();
+			await expect(
+				await canvas.findByText(REPLY_END, { exact: false }, { timeout: 8000 })
+			).toBeInTheDocument();
+		});
+
+		await step('the form is ready for the next message', async () => {
+			await waitFor(() => expect(chatStore.isLoading).toBe(false));
+			// the editor is empty again: at most its placeholder is left
+			await expect(canvas.getByRole('textbox')).toHaveTextContent(/^(Type a message\.\.\.)?$/);
+			await expect(conversationsStore.activeMessages.map((m) => m.role)).toEqual([
+				'user',
+				'assistant'
+			]);
+		});
+	}}
+/>
+
+<Story
+	args={{ showCenteredEmpty: false }}
+	beforeEach={setup({ conversation: true })}
+	name="Conversation"
+	parameters={conversationRoute}
+	play={async (context) => {
+		const { canvas } = context;
+
+		await expect(
+			await canvas.findByText('What is the difference between Q4_K_M and Q8_0?')
+		).toBeInTheDocument();
+		await expect(canvas.getByText('How do I run one with llama-server?')).toBeInTheDocument();
+		await expect(canvas.getByRole('table')).toBeInTheDocument();
+		await expect(canvas.queryByText('Hello there')).not.toBeVisible();
+	}}
+/>
+
+<Story
+	args={{ showCenteredEmpty: false }}
+	beforeEach={setup({ conversation: true })}
+	name="ContinueConversation"
+	parameters={conversationRoute}
+	play={async (context) => {
+		const { canvas } = context;
+
+		await canvas.findByText('How do I run one with llama-server?');
+
+		await send(context, 'Which one fits in 8 GB of VRAM?');
+
+		await expect(await canvas.findByText('Which one fits in 8 GB of VRAM?')).toBeInTheDocument();
+		await expect(
+			await canvas.findByText(REPLY_END, { exact: false }, { timeout: 8000 })
+		).toBeInTheDocument();
+
+		// the follow-up joins the existing branch: 4 earlier turns plus the new pair
+		await waitFor(() => expect(conversationsStore.activeMessages).toHaveLength(6));
+		// the reply is stored before the next story resets the stores
+		await waitFor(() => expect(chatStore.isLoading).toBe(false));
+	}}
+/>
+
+<Story
+	args={{ showCenteredEmpty: true }}
+	beforeEach={setup({ slowStream: 4 })}
+	name="StopGeneration"
+	parameters={newChatRoute}
+	play={async (context) => {
+		const { canvas, step, userEvent } = context;
+
+		await send(context, 'Tell me about quantization');
+
+		await step('stop the reply while it streams', async () => {
+			const stop = await canvas.findByRole('button', { name: 'Stop' }, { timeout: 4000 });
+
+			await canvas.findByText('Sure.', { exact: false }, { timeout: 8000 });
+			await getPace(context).pause();
+			await userEvent.click(stop);
+		});
+
+		await step('the partial reply stays and the form is ready again', async () => {
+			await waitFor(() => expect(chatStore.isLoading).toBe(false));
+			await expect(canvas.getByText('Sure.', { exact: false })).toBeInTheDocument();
+			await expect(canvas.queryByText(REPLY_END, { exact: false })).not.toBeInTheDocument();
+			await expect(canvas.getByRole('button', { name: 'Send' })).toBeInTheDocument();
+		});
+	}}
+/>
+
+<Story
+	args={{ showCenteredEmpty: true }}
+	beforeEach={setup({
+		server: { errorMessage: 'the request exceeds the available context size', status: 500 }
+	})}
+	name="ServerErrorReply"
+	parameters={newChatRoute}
+	play={async (context) => {
+		await send(context, 'Summarize this very long document');
+
+		// the dialog is portalled to the body, outside the canvas
+		const page = within(document.body);
+
+		await expect(await page.findByRole('alertdialog', {}, { timeout: 4000 })).toBeInTheDocument();
+		await expect(page.getByText('Server Error')).toBeInTheDocument();
+		await expect(
+			page.getByText('the request exceeds the available context size', { exact: false })
+		).toBeInTheDocument();
+	}}
+/>
+
+<Story
+	args={{ showCenteredEmpty: true }}
+	beforeEach={async (context) => {
+		const restore = await setup()(context);
+
+		serverStore.error = 'Failed to fetch server properties: connection refused';
+		serverStore.status = 500;
+
+		return () => {
+			serverStore.error = null;
+			serverStore.status = null;
+			restore();
+		};
+	}}
+	name="ServerUnavailable"
+	parameters={newChatRoute}
+	play={async (context) => {
+		const { canvas } = context;
+
+		await expect(await canvas.findByText(/connection refused/)).toBeInTheDocument();
+		// the markdown editor is a contenteditable, disabled by turning that off
+		await expect(canvas.getByRole('textbox')).toHaveAttribute('contenteditable', 'false');
+	}}
+/>
diff --git a/ui/apps/chat/tests/stories/chat/screen/ChatScreenActionScrollDown.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/ChatScreenActionScrollDown.stories.svelte
new file mode 100644
index 000000000..2e3ef989a
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/screen/ChatScreenActionScrollDown.stories.svelte
@@ -0,0 +1,19 @@
+<script lang="ts" module>
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatScreenActionScrollDown from '#lib/components/app/chat/ChatScreen/ChatScreenActionScrollDown.svelte';
+
+	const { Story } = defineMeta({
+		component: ChatScreenActionScrollDown,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatScreen/ChatScreenActionScrollDown'
+	});
+</script>
+
+<!-- the button floats above its zero-height anchor, so give it room -->
+<Story asChild name="Default">
+	<div class="flex h-32 w-80 flex-col justify-end rounded-lg border border-dashed border-border">
+		<ChatScreenActionScrollDown onclick={() => console.log('scroll to bottom')} />
+	</div>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/screen/ChatScreenDragOverlay.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/ChatScreenDragOverlay.stories.svelte
new file mode 100644
index 000000000..b4a8780eb
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/screen/ChatScreenDragOverlay.stories.svelte
@@ -0,0 +1,20 @@
+<script lang="ts" module>
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatScreenDragOverlay from '#lib/components/app/chat/ChatScreen/ChatScreenDragOverlay.svelte';
+
+	const { Story } = defineMeta({
+		component: ChatScreenDragOverlay,
+		parameters: {
+			layout: 'fullscreen'
+		},
+		title: 'Llama Chat/Chat/ChatScreen/ChatScreenDragOverlay'
+	});
+</script>
+
+<Story asChild name="Default">
+	<div class="flex h-screen items-center justify-center p-8 text-muted-foreground">
+		Page content behind the overlay
+	</div>
+
+	<ChatScreenDragOverlay />
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/screen/ChatScreenGreeting.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/ChatScreenGreeting.stories.svelte
new file mode 100644
index 000000000..732a92c09
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/screen/ChatScreenGreeting.stories.svelte
@@ -0,0 +1,33 @@
+<script lang="ts" module>
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatScreenGreeting from '#lib/components/app/chat/ChatScreen/ChatScreenGreeting.svelte';
+	import { serverStore } from '#lib/stores/index.ts';
+
+	const { Story } = defineMeta({
+		component: ChatScreenGreeting,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatScreen/ChatScreenGreeting'
+	});
+
+	function seedAudio(audio: boolean) {
+		serverStore.props = {
+			...serverStore.props,
+			modalities: { audio, video: false, vision: false }
+		} as ApiLlamaCppServerProps;
+	}
+</script>
+
+<!-- the wrapper stands in for the form wrapper: on desktop the greeting sits in its top padding -->
+<Story asChild beforeEach={() => seedAudio(false)} name="Default">
+	<div class="relative h-40 w-[40rem]" style="--chat-form-padding-top: 10rem">
+		<ChatScreenGreeting isEmpty />
+	</div>
+</Story>
+
+<Story asChild beforeEach={() => seedAudio(true)} name="WithAudioModality">
+	<div class="relative h-40 w-[40rem]" style="--chat-form-padding-top: 10rem">
+		<ChatScreenGreeting isEmpty />
+	</div>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/screen/ChatScreenServerError.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/ChatScreenServerError.stories.svelte
new file mode 100644
index 000000000..1dff6c44c
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/screen/ChatScreenServerError.stories.svelte
@@ -0,0 +1,56 @@
+<script lang="ts" module>
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatScreenServerError from '#lib/components/app/chat/ChatScreen/ChatScreenServerError.svelte';
+	import { serverStore } from '#lib/stores/index.ts';
+
+	const { Story } = defineMeta({
+		component: ChatScreenServerError,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatScreen/ChatScreenServerError'
+	});
+
+	function seedServer(state: { error: string | null; loading?: boolean; status?: number | null }) {
+		serverStore.error = state.error;
+		serverStore.loading = state.loading ?? false;
+		serverStore.status = state.status ?? null;
+	}
+</script>
+
+<Story
+	asChild
+	beforeEach={() =>
+		seedServer({ error: 'Failed to fetch server properties: connection refused', status: 500 })}
+	name="Default"
+>
+	<div class="w-[48rem]">
+		<ChatScreenServerError />
+	</div>
+</Story>
+
+<Story
+	asChild
+	beforeEach={() =>
+		seedServer({
+			error: 'Failed to fetch server properties: connection refused',
+			loading: true,
+			status: 500
+		})}
+	name="Retrying"
+>
+	<div class="w-[48rem]">
+		<ChatScreenServerError />
+	</div>
+</Story>
+
+<!-- HTTP 503 while the server is still loading the model -->
+<Story
+	asChild
+	beforeEach={() => seedServer({ error: 'Loading model', status: 503 })}
+	name="LoadingModel"
+>
+	<div class="w-[48rem]">
+		<ChatScreenServerError />
+	</div>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/screen/ChatScreenStreamResumeStatus.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/ChatScreenStreamResumeStatus.stories.svelte
new file mode 100644
index 000000000..63aa0ac85
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/screen/ChatScreenStreamResumeStatus.stories.svelte
@@ -0,0 +1,27 @@
+<script lang="ts" module>
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatScreenStreamResumeStatus from '#lib/components/app/chat/ChatScreen/ChatScreenStreamResumeStatus.svelte';
+	import { StreamConnectionState } from '#lib/enums/index.ts';
+	import { chatStore } from '#lib/stores/index.ts';
+
+	const { Story } = defineMeta({
+		component: ChatScreenStreamResumeStatus,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatScreen/ChatScreenStreamResumeStatus'
+	});
+</script>
+
+<!-- only RESUMING renders; STREAMING and LOST render nothing -->
+<Story
+	asChild
+	beforeEach={() => {
+		chatStore.streamConnectionState = StreamConnectionState.RESUMING;
+	}}
+	name="Default"
+>
+	<div class="w-[48rem]">
+		<ChatScreenStreamResumeStatus />
+	</div>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/screen/attachments/ChatAttachmentsPreview.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/attachments/ChatAttachmentsPreview.stories.svelte
deleted file mode 100644
index 2a4aecb68..000000000
--- a/ui/apps/chat/tests/stories/chat/screen/attachments/ChatAttachmentsPreview.stories.svelte
+++ /dev/null
@@ -1,47 +0,0 @@
-<script lang="ts" module>
-	import { defineMeta } from '@storybook/addon-svelte-csf';
-	import ChatAttachmentsPreview from '#lib/components/app/chat/ChatAttachments/ChatAttachmentsPreview/ChatAttachmentsPreview.svelte';
-	import { AttachmentType } from '#lib/enums/index.ts';
-	import { expect, waitFor } from 'storybook/test';
-
-	const { Story } = defineMeta({
-		component: ChatAttachmentsPreview,
-		parameters: {
-			layout: 'fullscreen'
-		},
-		title: 'Components/ChatScreen/ChatAttachments/ChatAttachmentsPreview'
-	});
-
-	// same backdrop as DialogChatAttachmentsPreview
-	const frameClass = 'flex h-screen flex-col bg-neutral-950';
-
-	// valid base64 that is not a PDF: pdf.js throws InvalidPDFException
-	const brokenPdfAttachment: DatabaseMessageExtraPdfFile = {
-		base64Data: btoa('this is not a pdf'),
-		content: 'Extracted text of the broken PDF.',
-		name: 'broken.pdf',
-		processedAsImages: false,
-		size: 17,
-		type: AttachmentType.PDF
-	};
-</script>
-
-<!-- conversion fails once: shows the error and does not retry -->
-<Story
-	asChild
-	name="PdfConversionError"
-	play={async ({ canvas }) => {
-		await waitFor(() => expect(canvas.getByText('Failed to load PDF images')).toBeInTheDocument(), {
-			timeout: 5000
-		});
-
-		// a retry loop would flip back to the loading state
-		await new Promise((resolve) => setTimeout(resolve, 500));
-		await expect(canvas.queryByText('Converting PDF to images...')).not.toBeInTheDocument();
-		await expect(canvas.getByText('Failed to load PDF images')).toBeInTheDocument();
-	}}
->
-	<div class={frameClass}>
-		<ChatAttachmentsPreview attachments={[brokenPdfAttachment]} class="min-h-0 flex-1" />
-	</div>
-</Story>
diff --git a/ui/apps/chat/tests/stories/chat/screen/chat-screen.fixtures.ts b/ui/apps/chat/tests/stories/chat/screen/chat-screen.fixtures.ts
new file mode 100644
index 000000000..b0613ef13
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/screen/chat-screen.fixtures.ts
@@ -0,0 +1,179 @@
+import { MODEL_NAME, modelServerProps, seedStores } from '../form/fixtures';
+import { MessageRole, MessageType, ServerRole } from '#lib/enums/index.ts';
+import { DatabaseService } from '#lib/services/database.service.ts';
+import { chatStore, conversationsStore } from '#lib/stores/index.ts';
+
+export const SCREEN_CONVERSATION_ID = 'story-chat-screen';
+
+export const REPLY_TEXT =
+	'Sure. Quantization stores the weights with fewer bits, so the model takes less memory and runs faster, at a small cost in quality.';
+
+const minutesAgo = (minutes: number) => Date.now() - minutes * 60_000;
+const turn = (
+	id: string,
+	parent: string | null,
+	children: string[],
+	fields: Partial<DatabaseMessage>
+): DatabaseMessage => ({
+	children,
+	content: '',
+	convId: SCREEN_CONVERSATION_ID,
+	id,
+	parent,
+	role: MessageRole.USER,
+	timestamp: minutesAgo(10),
+	toolCalls: '',
+	type: MessageType.TEXT,
+	...fields
+});
+
+/** A finished conversation in the export format, written to IndexedDB as the app would import it. */
+export const screenConversation: ExportedConversation = {
+	conv: {
+		currNode: 'a2',
+		id: SCREEN_CONVERSATION_ID,
+		lastModified: minutesAgo(2),
+		name: 'Running GGUF models locally'
+	},
+	messages: [
+		turn('root', null, ['u1'], { role: MessageRole.SYSTEM, type: MessageType.ROOT }),
+		turn('u1', 'root', ['a1'], {
+			content: 'What is the difference between Q4_K_M and Q8_0?',
+			timestamp: minutesAgo(9)
+		}),
+		turn('a1', 'u1', ['u2'], {
+			content:
+				'Both are GGUF quantization types:\n\n| Type | Bits per weight | Quality |\n| --- | --- | --- |\n| Q4_K_M | ~4.8 | good |\n| Q8_0 | ~8.5 | near lossless |\n\nPick **Q4_K_M** when memory is tight and **Q8_0** when quality matters most.',
+			model: MODEL_NAME,
+			reasoningContent:
+				'The user compares two quant types. Give bits per weight and the trade-off, keep it short.',
+			role: MessageRole.ASSISTANT,
+			timestamp: minutesAgo(8),
+			timings: { predicted_ms: 3100, predicted_n: 96, prompt_ms: 180, prompt_n: 42 }
+		}),
+		turn('u2', 'a1', ['a2'], {
+			content: 'How do I run one with llama-server?',
+			timestamp: minutesAgo(3)
+		}),
+		turn('a2', 'u2', [], {
+			content:
+				'Point the server at the file and open the web UI:\n\n```sh\nllama-server -m Qwen3-8B-Q4_K_M.gguf --port 9931\n```\n\nThen visit `http://localhost:9931`.',
+			model: MODEL_NAME,
+			role: MessageRole.ASSISTANT,
+			timestamp: minutesAgo(2),
+			timings: { cache_n: 120, predicted_ms: 2400, predicted_n: 64, prompt_ms: 90, prompt_n: 30 }
+		})
+	]
+};
+
+export interface FakeServerOptions {
+	/** Text streamed back for a chat completion. */
+	reply?: string;
+	/** Delay between streamed chunks, in ms. */
+	chunkDelayMs?: number;
+	/** HTTP status for the completion request; anything but 200 is an error reply. */
+	status?: number;
+	/** Error message sent with a failed completion. */
+	errorMessage?: string;
+}
+
+const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
+const json = (body: unknown, status = 200) =>
+	new Response(JSON.stringify(body), { headers: { 'Content-Type': 'application/json' }, status });
+
+function streamReply(reply: string, chunkDelayMs: number, signal?: AbortSignal | null): Response {
+	const encoder = new TextEncoder();
+	const words = reply.split(/(?<= )/);
+	const sse = (data: unknown) => encoder.encode(`data: ${JSON.stringify(data)}\n\n`);
+	const body = new ReadableStream<Uint8Array>({
+		async start(controller) {
+			for (const word of words) {
+				if (signal?.aborted) return controller.error(new DOMException('Aborted', 'AbortError'));
+
+				controller.enqueue(
+					sse({ choices: [{ delta: { content: word }, index: 0 }], model: MODEL_NAME })
+				);
+				await sleep(chunkDelayMs);
+			}
+
+			controller.enqueue(
+				sse({
+					choices: [{ delta: {}, finish_reason: 'stop', index: 0 }],
+					model: MODEL_NAME,
+					timings: {
+						predicted_ms: words.length * chunkDelayMs,
+						predicted_n: words.length,
+						prompt_ms: 40,
+						prompt_n: 24
+					}
+				})
+			);
+			controller.enqueue(encoder.encode('data: [DONE]\n\n'));
+			controller.close();
+		}
+	});
+
+	return new Response(body, { headers: { 'Content-Type': 'text/event-stream' } });
+}
+
+/**
+ * Stand-in for llama-server: answers chat completions with a streamed reply and
+ * every other API call with a harmless empty result. Returns the restore.
+ */
+export function installFakeServer(options: FakeServerOptions = {}): () => void {
+	const { chunkDelayMs = 30, errorMessage = 'Internal server error', reply = REPLY_TEXT } = options;
+	const status = options.status ?? 200;
+	const realFetch = window.fetch;
+
+	window.fetch = async (input, init) => {
+		const url = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url;
+
+		if (url.includes('/v1/chat/completions') && !url.includes('/control')) {
+			if (status !== 200) return json({ error: { code: status, message: errorMessage } }, status);
+
+			const body = JSON.parse(String(init?.body ?? '{}'));
+
+			if (!body.stream) {
+				return json({
+					choices: [{ message: { content: reply, role: 'assistant' } }],
+					timings: { cache_n: 0, prompt_n: 24 }
+				});
+			}
+
+			return streamReply(reply, chunkDelayMs, init?.signal);
+		}
+
+		if (url.includes('/props')) return json(modelServerProps());
+
+		if (url.includes('/v1/models')) return json({ data: [], object: 'list' });
+
+		return json({}, 404);
+	};
+
+	return () => {
+		window.fetch = realFetch;
+	};
+}
+
+/** Single-model server state plus an empty new-chat screen. */
+export function seedNewChat(): () => void {
+	const restore = seedStores({
+		activeConversation: null,
+		activeMessages: [],
+		config: { conversationTabs: false, showMessageStats: true },
+		serverProps: modelServerProps(),
+		serverRole: ServerRole.MODEL
+	});
+
+	chatStore.dismissErrorDialog();
+
+	return restore;
+}
+
+/** Writes the fixture conversation to IndexedDB and opens it like the chat route does. */
+export async function openScreenConversation(): Promise<void> {
+	await DatabaseService.deleteConversation(SCREEN_CONVERSATION_ID).catch(() => {});
+	await DatabaseService.importConversations([structuredClone(screenConversation)]);
+	await conversationsStore.loadConversations();
+	await conversationsStore.loadConversation(SCREEN_CONVERSATION_ID);
+}
diff --git a/ui/apps/chat/tests/stories/chat/screen/fixtures.ts b/ui/apps/chat/tests/stories/chat/screen/fixtures.ts
new file mode 100644
index 000000000..7eca3838a
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/screen/fixtures.ts
@@ -0,0 +1,286 @@
+import photoUrl from '../../fixtures/assets/1.jpg';
+import clipVideoUrl from '../../fixtures/assets/clip.webm';
+import hfLogoUrl from '../../fixtures/assets/hf-logo.svg';
+import toneAudioUrl from '../../fixtures/assets/tone.wav';
+import { AttachmentType, SpecialFileType } from '#lib/enums/index.ts';
+import type {
+	DatabaseMessageExtraAudioFile,
+	DatabaseMessageExtraImageFile,
+	DatabaseMessageExtraLegacyContext,
+	DatabaseMessageExtraMcpPrompt,
+	DatabaseMessageExtraMcpResource,
+	DatabaseMessageExtraPdfFile,
+	DatabaseMessageExtraTextFile,
+	DatabaseMessageExtraVideoFile,
+	MCPResourceAttachment
+} from '#lib/types/index.ts';
+
+export { clipVideoUrl, hfLogoUrl, photoUrl, toneAudioUrl };
+
+export const gradientImageUrl = `data:image/svg+xml;utf8,${encodeURIComponent(
+	'<svg xmlns="http://www.w3.org/2000/svg" width="320" height="200"><defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#f97316"/><stop offset="1" stop-color="#8b5cf6"/></linearGradient></defs><rect width="320" height="200" fill="url(#g)"/></svg>'
+)}`;
+
+export const sampleCode = `import { serverStore } from '#lib/stores/index.ts';
+
+export async function loadProps(): Promise<void> {
+	await serverStore.fetch();
+
+	if (serverStore.error) {
+		console.error('Server unavailable:', serverStore.error);
+	}
+}
+`;
+
+export const sampleNotes = `Meeting notes - release planning
+
+- Ship the matte glass surfaces behind a flag first.
+- Collect feedback from the nightly build users.
+- Remove the flag once the dark theme contrast is fixed.
+- Follow up on the attachment preview performance numbers from last week.`;
+
+export const samplePdfText = `Attention Is All You Need
+
+Abstract. The dominant sequence transduction models are based on complex recurrent or convolutional neural networks that include an encoder and a decoder.`;
+
+// Stored message attachments (DatabaseMessageExtra)
+
+export const imageAttachment: DatabaseMessageExtraImageFile = {
+	base64Url: photoUrl,
+	name: 'mountain-lake.jpg',
+	size: 44_891,
+	type: AttachmentType.IMAGE
+};
+
+export const logoAttachment: DatabaseMessageExtraImageFile = {
+	base64Url: hfLogoUrl,
+	name: 'hf-logo.svg',
+	size: 35_285,
+	type: AttachmentType.IMAGE
+};
+
+export const gradientAttachment: DatabaseMessageExtraImageFile = {
+	base64Url: gradientImageUrl,
+	name: 'gradient.svg',
+	size: 412,
+	type: AttachmentType.IMAGE
+};
+
+export const textAttachment: DatabaseMessageExtraTextFile = {
+	content: sampleCode,
+	name: 'load-props.ts',
+	size: sampleCode.length,
+	type: AttachmentType.TEXT
+};
+
+export const notesAttachment: DatabaseMessageExtraTextFile = {
+	content: sampleNotes,
+	name: 'notes.md',
+	size: sampleNotes.length,
+	type: AttachmentType.TEXT
+};
+
+export const legacyContextAttachment: DatabaseMessageExtraLegacyContext = {
+	content: 'Pasted context from the old UI.',
+	name: 'Pasted content',
+	type: AttachmentType.LEGACY_CONTEXT
+};
+
+// PDF pages are pre-rendered so the preview does not need pdf.js
+export const pdfAttachment: DatabaseMessageExtraPdfFile = {
+	base64Data: '',
+	content: samplePdfText,
+	images: [photoUrl, gradientImageUrl],
+	name: 'attention-is-all-you-need.pdf',
+	processedAsImages: false,
+	size: 2_215_244,
+	type: AttachmentType.PDF
+};
+
+export const pdfAsImagesAttachment: DatabaseMessageExtraPdfFile = {
+	...pdfAttachment,
+	name: 'scanned-invoice.pdf',
+	processedAsImages: true,
+	size: 351_048
+};
+
+export const audioAttachment: DatabaseMessageExtraAudioFile = {
+	base64Data: '',
+	mimeType: 'audio/wav',
+	name: 'voice-memo.wav',
+	size: 8_078,
+	type: AttachmentType.AUDIO
+};
+
+export const videoAttachment: DatabaseMessageExtraVideoFile = {
+	base64Data: '',
+	mimeType: 'video/webm',
+	name: 'screen-recording.webm',
+	size: 8_101,
+	type: AttachmentType.VIDEO
+};
+
+export const mcpPromptAttachment: DatabaseMessageExtraMcpPrompt = {
+	arguments: { language: 'TypeScript', topic: 'error handling' },
+	content:
+		'Review the following TypeScript code and suggest improvements for error handling. Focus on edge cases.',
+	name: 'code-review',
+	promptName: 'code-review',
+	serverName: 'github',
+	type: AttachmentType.MCP_PROMPT
+};
+
+export const mcpResourceAttachment: DatabaseMessageExtraMcpResource = {
+	content: '# llama.cpp\n\nInference of LLMs in pure C/C++.',
+	mimeType: 'text/markdown',
+	name: 'README.md',
+	serverName: 'filesystem',
+	type: AttachmentType.MCP_RESOURCE,
+	uri: 'file:///workspace/llama.cpp/README.md'
+};
+
+export const mcpResourceImageAttachment: DatabaseMessageExtraMcpResource = {
+	content: '',
+	mimeType: 'image/png',
+	name: 'architecture.png',
+	serverName: 'filesystem',
+	type: AttachmentType.MCP_RESOURCE,
+	uri: 'file:///workspace/docs/architecture.png'
+};
+
+export function toMcpResourceAttachment(
+	extra: DatabaseMessageExtraMcpResource,
+	overrides: Partial<MCPResourceAttachment> = {}
+): MCPResourceAttachment {
+	return {
+		id: `resource-${extra.name}`,
+		resource: {
+			mimeType: extra.mimeType,
+			name: extra.name,
+			serverName: extra.serverName,
+			title: extra.name,
+			uri: extra.uri
+		},
+		...overrides
+	};
+}
+
+// Pending uploads (ChatUploadedFile)
+
+export function createUploadedFile(
+	name: string,
+	type: string,
+	extra: Partial<ChatUploadedFile> = {}
+): ChatUploadedFile {
+	const content = extra.textContent ?? '';
+
+	return {
+		file: new File([content], name, { type }),
+		id: `upload-${name}`,
+		name,
+		size: extra.size ?? content.length,
+		type,
+		...extra
+	};
+}
+
+export const uploadedImage = createUploadedFile('mountain-lake.jpg', 'image/jpeg', {
+	preview: photoUrl,
+	size: 44_891
+});
+
+export const uploadedLogo = createUploadedFile('hf-logo.svg', 'image/svg+xml', {
+	preview: hfLogoUrl,
+	size: 35_285
+});
+
+export const uploadedGradient = createUploadedFile('gradient.svg', 'image/svg+xml', {
+	preview: gradientImageUrl,
+	size: 412
+});
+
+export const uploadedText = createUploadedFile('load-props.ts', 'text/typescript', {
+	textContent: sampleCode
+});
+
+export const uploadedNotes = createUploadedFile('notes.md', 'text/markdown', {
+	textContent: sampleNotes
+});
+
+export const uploadedPdf = createUploadedFile('attention-is-all-you-need.pdf', 'application/pdf', {
+	size: 2_215_244,
+	textContent: samplePdfText
+});
+
+export const uploadedAudio = createUploadedFile('voice-memo.wav', 'audio/wav', {
+	preview: toneAudioUrl,
+	size: 8_078
+});
+
+export const uploadedVideo = createUploadedFile('screen-recording.webm', 'video/webm', {
+	preview: clipVideoUrl,
+	size: 8_101
+});
+
+export const uploadedArchive = createUploadedFile('dataset.zip', 'application/zip', {
+	size: 5_242_880
+});
+
+export const uploadedMcpPrompt = createUploadedFile('summarize-issue', SpecialFileType.MCP_PROMPT, {
+	mcpPrompt: {
+		arguments: { issue: '#31273' },
+		promptName: 'summarize-issue',
+		serverName: 'github'
+	},
+	textContent: 'Summarize the discussion in issue #31273 and list the open questions.'
+});
+
+export const uploadedMcpPromptLoading = createUploadedFile(
+	'triage-bug',
+	SpecialFileType.MCP_PROMPT,
+	{
+		isLoading: true,
+		mcpPrompt: { arguments: { label: 'bug' }, promptName: 'triage-bug', serverName: 'github' }
+	}
+);
+
+export const uploadedMcpPromptError = createUploadedFile(
+	'release-notes',
+	SpecialFileType.MCP_PROMPT,
+	{
+		loadError: 'MCP server "github" is not connected',
+		mcpPrompt: { promptName: 'release-notes', serverName: 'github' }
+	}
+);
+
+// Conversations for the tab strip
+
+export const tabConversations: DatabaseConversation[] = [
+	{ currNode: 'm-1', id: 'conv-1', lastModified: Date.now() - 60_000, name: 'Rust borrow checker' },
+	{ currNode: 'm-2', id: 'conv-2', lastModified: Date.now() - 120_000, name: 'Trip to Kyoto' },
+	{ currNode: 'm-3', id: 'conv-3', lastModified: Date.now() - 180_000, name: 'GGUF quantization' },
+	{
+		currNode: 'm-4',
+		id: 'conv-4',
+		lastModified: Date.now() - 240_000,
+		name: 'A very long conversation title that has to be truncated inside the tab'
+	},
+	{ currNode: 'm-5', id: 'conv-5', lastModified: Date.now() - 300_000, name: 'Sourdough starter' },
+	{
+		currNode: 'm-6',
+		id: 'conv-6',
+		lastModified: Date.now() - 360_000,
+		name: 'SQL window functions'
+	},
+	{
+		currNode: 'm-7',
+		id: 'conv-7',
+		lastModified: Date.now() - 420_000,
+		name: 'Weekly report draft'
+	},
+	{ currNode: 'm-8', id: 'conv-8', lastModified: Date.now() - 480_000, name: 'Svelte 5 runes' },
+	{ currNode: 'm-9', id: 'conv-9', lastModified: Date.now() - 540_000, name: 'Bike maintenance' },
+	{ currNode: 'm-10', id: 'conv-10', lastModified: Date.now() - 600_000, name: 'Tax questions' },
+	{ currNode: 'm-11', id: 'conv-11', lastModified: Date.now() - 660_000, name: 'Piano practice' },
+	{ currNode: 'm-12', id: 'conv-12', lastModified: Date.now() - 720_000, name: 'CUDA kernels' }
+];
diff --git a/ui/apps/chat/tests/stories/chat/tabs/ChatTabs.stories.svelte b/ui/apps/chat/tests/stories/chat/tabs/ChatTabs.stories.svelte
new file mode 100644
index 000000000..0d9a88e1c
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/tabs/ChatTabs.stories.svelte
@@ -0,0 +1,96 @@
+<script lang="ts" module>
+	import { tabConversations } from '../screen/fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatTabs from '#lib/components/app/chat/ChatTabs/ChatTabs.svelte';
+	import { NEW_CHAT_TAB_ID } from '#lib/constants/index.ts';
+	import { chatStore, conversationsStore, tabsStore } from '#lib/stores/index.ts';
+
+	const { Story } = defineMeta({
+		component: ChatTabs,
+		parameters: {
+			layout: 'fullscreen'
+		},
+		title: 'Llama Chat/Chat/ChatTabs/ChatTabs'
+	});
+
+	const chatRoute = (id: string) => ({
+		sveltekit_experimental: {
+			state: { page: { params: { id }, route: { id: '/(chat)/chat/[id]' } } }
+		}
+	});
+
+	const newChatRoute = {
+		sveltekit_experimental: { state: { page: { params: {}, route: { id: '/(chat)' } } } }
+	};
+
+	function seedTabs(openTabs: string[], loadingIds: string[] = []) {
+		conversationsStore.conversations = tabConversations;
+		tabsStore.openTabs = openTabs;
+
+		for (const conv of tabConversations) {
+			chatStore.setChatLoading(conv.id, loadingIds.includes(conv.id));
+		}
+	}
+</script>
+
+<Story
+	asChild
+	beforeEach={() => seedTabs(['conv-1', 'conv-2', 'conv-3'])}
+	name="Default"
+	parameters={chatRoute('conv-2')}
+>
+	<div class="w-[56rem]" style="--sidebar-width: 0px">
+		<ChatTabs />
+	</div>
+</Story>
+
+<!-- a new-chat tab is open, so the New chat button is hidden -->
+<Story
+	asChild
+	beforeEach={() => seedTabs(['conv-1', 'conv-2', NEW_CHAT_TAB_ID])}
+	name="NewChatTabActive"
+	parameters={newChatRoute}
+>
+	<div class="w-[56rem]" style="--sidebar-width: 0px">
+		<ChatTabs />
+	</div>
+</Story>
+
+<Story
+	asChild
+	beforeEach={() => seedTabs(['conv-1', 'conv-2', 'conv-3', 'conv-5'], ['conv-1', 'conv-3'])}
+	name="WithLoadingTabs"
+	parameters={chatRoute('conv-1')}
+>
+	<div class="w-[56rem]" style="--sidebar-width: 0px">
+		<ChatTabs />
+	</div>
+</Story>
+
+<!-- more tabs than fit: edge fades show and the active tab scrolls into view -->
+<Story
+	asChild
+	beforeEach={() =>
+		seedTabs(
+			tabConversations.map((c) => c.id),
+			['conv-6']
+		)}
+	name="ManyTabsOverflow"
+	parameters={chatRoute('conv-9')}
+>
+	<div class="w-[40rem]" style="--sidebar-width: 0px">
+		<ChatTabs />
+	</div>
+</Story>
+
+<!-- conversation id not in the store: falls back to the unnamed label -->
+<Story
+	asChild
+	beforeEach={() => seedTabs(['conv-1', 'conv-missing'])}
+	name="UnnamedChat"
+	parameters={chatRoute('conv-missing')}
+>
+	<div class="w-[56rem]" style="--sidebar-width: 0px">
+		<ChatTabs />
+	</div>
+</Story>
diff --git a/ui/apps/chat/tests/stories/chat/tabs/ChatTabsItem.stories.svelte b/ui/apps/chat/tests/stories/chat/tabs/ChatTabsItem.stories.svelte
new file mode 100644
index 000000000..969a18d41
--- /dev/null
+++ b/ui/apps/chat/tests/stories/chat/tabs/ChatTabsItem.stories.svelte
@@ -0,0 +1,63 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { SquarePen } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ChatTabsItem from '#lib/components/app/chat/ChatTabs/ChatTabsItem.svelte';
+	import { NEW_CHAT_LABEL, NEW_CHAT_TAB_ID } from '#lib/constants/index.ts';
+
+	const { Story } = defineMeta({
+		component: ChatTabsItem,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Chat/ChatTabs/ChatTabsItem'
+	});
+
+	const tab = { href: '#/chat/conv-1', id: 'conv-1', name: 'Rust borrow checker' };
+
+	const handlers = {
+		onActivate: (id: string) => console.log('activate', id),
+		onClose: (id: string) => console.log('close', id),
+		onStop: (id: string) => console.log('stop', id)
+	};
+</script>
+
+<Story asChild name="States">
+	<StateGallery columns={3}>
+		<StateGalleryItem label="Idle" note="dimmed until hovered">
+			<ChatTabsItem {...handlers} {tab} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Active">
+			<ChatTabsItem {...handlers} isActive {tab} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="New chat">
+			<ChatTabsItem
+				{...handlers}
+				isActive
+				tab={{ href: '#/', icon: SquarePen, id: NEW_CHAT_TAB_ID, name: NEW_CHAT_LABEL }}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Loading" note="hover the spinner to stop">
+			<ChatTabsItem {...handlers} isLoading {tab} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Active, loading">
+			<ChatTabsItem {...handlers} isActive isLoading {tab} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Long name" note="truncated">
+			<ChatTabsItem
+				{...handlers}
+				isActive
+				tab={{
+					...tab,
+					name: 'A very long conversation title that has to be truncated inside the tab'
+				}}
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/content/CollapsibleTerminalBlock.stories.svelte b/ui/apps/chat/tests/stories/content/CollapsibleTerminalBlock.stories.svelte
new file mode 100644
index 000000000..840eeb12e
--- /dev/null
+++ b/ui/apps/chat/tests/stories/content/CollapsibleTerminalBlock.stories.svelte
@@ -0,0 +1,26 @@
+<script lang="ts" module>
+	import { SquareTerminal } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import CollapsibleTerminalBlock from '#lib/components/app/content/CollapsibleTerminalBlock.svelte';
+
+	const { Story } = defineMeta({
+		component: CollapsibleTerminalBlock,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Content/CollapsibleTerminalBlock'
+	});
+</script>
+
+<Story asChild name="Default">
+	<div class="w-[36rem]">
+		<CollapsibleTerminalBlock icon={SquareTerminal} open subtitle="exit 0" title="cargo test">
+			<pre class="p-3 font-mono text-xs">running 3 tests
+test borrow::longest ... ok
+test borrow::shorter ... ok
+test borrow::equal ... ok
+
+test result: ok. 3 passed; 0 failed</pre>
+		</CollapsibleTerminalBlock>
+	</div>
+</Story>
diff --git a/ui/apps/chat/tests/stories/content/MarkdownContent.stories.svelte b/ui/apps/chat/tests/stories/content/MarkdownContent.stories.svelte
new file mode 100644
index 000000000..a569a0643
--- /dev/null
+++ b/ui/apps/chat/tests/stories/content/MarkdownContent.stories.svelte
@@ -0,0 +1,18 @@
+<script lang="ts" module>
+	import { AI_TUTORIAL_MD } from '../fixtures/ai-tutorial.js';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { MarkdownContent } from '#lib/components/app/index.ts';
+
+	const { Story } = defineMeta({
+		component: MarkdownContent,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Content/MarkdownContent'
+	});
+</script>
+
+<Story
+	args={{ class: 'max-w-[56rem] w-[calc(100vw-2rem)]', content: AI_TUTORIAL_MD }}
+	name="Default"
+/>
diff --git a/ui/apps/chat/tests/stories/dialogs/DialogConfirmation.stories.svelte b/ui/apps/chat/tests/stories/dialogs/DialogConfirmation.stories.svelte
new file mode 100644
index 000000000..677c8f449
--- /dev/null
+++ b/ui/apps/chat/tests/stories/dialogs/DialogConfirmation.stories.svelte
@@ -0,0 +1,43 @@
+<script lang="ts" module>
+	import { Trash2 } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { DialogConfirmation } from '#lib/components/app/index.ts';
+
+	// the shared confirm dialog; Enter confirms
+	const { Story } = defineMeta({
+		component: DialogConfirmation,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Dialogs/DialogConfirmation'
+	});
+</script>
+
+<script lang="ts">
+	let defaultOpen = $state(true);
+	let destructiveOpen = $state(true);
+</script>
+
+<Story asChild name="Default">
+	<DialogConfirmation
+		bind:open={defaultOpen}
+		confirmText="Continue"
+		description="The model will be unloaded and the new one loaded in its place."
+		onCancel={() => (defaultOpen = false)}
+		onConfirm={() => (defaultOpen = false)}
+		title="Switch model?"
+	/>
+</Story>
+
+<Story asChild name="Destructive">
+	<DialogConfirmation
+		bind:open={destructiveOpen}
+		confirmText="Delete"
+		description="This conversation and its messages will be removed from this browser."
+		icon={Trash2}
+		onCancel={() => (destructiveOpen = false)}
+		onConfirm={() => (destructiveOpen = false)}
+		title="Delete conversation?"
+		variant="destructive"
+	/>
+</Story>
diff --git a/ui/apps/chat/tests/stories/editorial/Chapters.svelte b/ui/apps/chat/tests/stories/editorial/Chapters.svelte
new file mode 100644
index 000000000..439b5597d
--- /dev/null
+++ b/ui/apps/chat/tests/stories/editorial/Chapters.svelte
@@ -0,0 +1,153 @@
+<!--
+	The chapter navigation: the page's section heads as a list fixed at the right, centred. Every chapter is set at one size;
+	inactive ones are dimmed, and the one being read is in the full foreground colour. Clicking a chapter scrolls to
+	it. Shown only where there is room beside the text.
+-->
+<script lang="ts">
+	let { root }: { root: HTMLElement | undefined } = $props();
+
+	let chapters: { el: HTMLElement; id: string; n: string; title: string }[] = $state([]);
+	let active = $state(0);
+
+	// runs once the page it navigates is mounted
+	$effect(() => {
+		if (!root) return;
+
+		const list = [...root.querySelectorAll<HTMLElement>(':scope > h2')].map((el, i) => {
+			const n = String(i + 1).padStart(2, '0');
+
+			el.id ||= `chapter-${n}`;
+
+			return { el, id: el.id, n, title: el.textContent?.trim() ?? '' };
+		});
+
+		chapters = list;
+
+		// the active chapter is the last one whose head has passed 40% of the way down the screen
+		let frame = 0;
+
+		const update = () => {
+			frame = 0;
+			const line = window.innerHeight * 0.4;
+			const index = list.findLastIndex(({ el }) => el.getBoundingClientRect().top <= line);
+
+			active = Math.max(0, index);
+		};
+		const onScroll = () => (frame ||= requestAnimationFrame(update));
+
+		update();
+		window.addEventListener('scroll', onScroll, { passive: true });
+		window.addEventListener('resize', onScroll);
+
+		return () => {
+			cancelAnimationFrame(frame);
+			window.removeEventListener('scroll', onScroll);
+			window.removeEventListener('resize', onScroll);
+		};
+	});
+
+	function go(event: MouseEvent, el: HTMLElement) {
+		event.preventDefault();
+		const reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+
+		window.scrollTo({
+			behavior: reduce ? 'auto' : 'smooth',
+			top: el.getBoundingClientRect().top + window.scrollY - 32
+		});
+	}
+</script>
+
+{#if chapters.length}
+	<nav aria-label="Chapters" class="chapters">
+		<ol>
+			{#each chapters as chapter, i (chapter.id)}
+				<li>
+					<a
+						aria-current={i === active ? 'location' : undefined}
+						class={{ active: i === active }}
+						href="#{chapter.id}"
+						onclick={(event) => go(event, chapter.el)}
+					>
+						<span class="n">{chapter.n}</span>
+
+						<span class="title">{chapter.title}</span>
+					</a>
+				</li>
+			{/each}
+		</ol>
+	</nav>
+{/if}
+
+<style>
+	.chapters {
+		--mono: 'Llama Mono', ui-monospace, monospace;
+		position: fixed;
+		top: 50%;
+		right: clamp(16px, 2.5vw, 40px);
+		z-index: 10;
+		display: none;
+		width: 13rem;
+		transform: translateY(-50%);
+	}
+
+	/* only where the column leaves room for it */
+	@media (width >= 1440px) {
+		.chapters {
+			display: block;
+		}
+	}
+
+	ol {
+		display: grid;
+		gap: 2px;
+		margin: 0;
+		padding: 0;
+		list-style: none;
+	}
+
+	a {
+		display: grid;
+		grid-template-columns: 1.75rem 1fr;
+		align-items: baseline;
+		padding-block: 4px;
+		color: var(--fg-muted);
+		font-size: 14px;
+		line-height: 1.3;
+		text-decoration: none;
+		opacity: 0.6;
+		transition:
+			color 200ms ease-out,
+			opacity 200ms ease-out;
+	}
+
+	a:hover {
+		opacity: 1;
+	}
+
+	a.active {
+		color: var(--fg-default);
+		font-weight: 500;
+		opacity: 1;
+	}
+
+	.n {
+		font: 500 10px var(--mono);
+		letter-spacing: 0.04em;
+	}
+
+	a.active .n {
+		color: var(--art-cinder);
+	}
+
+	a:focus-visible {
+		border-radius: 4px;
+		outline: 2px solid var(--line-focus);
+		outline-offset: 2px;
+	}
+
+	@media (prefers-reduced-motion: reduce) {
+		a {
+			transition: none;
+		}
+	}
+</style>
diff --git a/ui/apps/chat/tests/stories/editorial/Editorial.svelte b/ui/apps/chat/tests/stories/editorial/Editorial.svelte
new file mode 100644
index 000000000..cdc71ad11
--- /dev/null
+++ b/ui/apps/chat/tests/stories/editorial/Editorial.svelte
@@ -0,0 +1,205 @@
+<!--
+	The page the Storybook's prose pages are set on: an editorial column of running text at a reading size, with figures that
+	break out wider and pull quotes in Display. Numbered section heads, the numbers in cinder (the mark on a detail),
+	and the chapter navigation fixed at the right.
+-->
+<script lang="ts">
+	import '../brand/fonts/fonts.css';
+	import Chapters from './Chapters.svelte';
+	import type { Snippet } from 'svelte';
+
+	let { children }: { children: Snippet } = $props();
+
+	let article: HTMLElement | undefined = $state();
+</script>
+
+<article bind:this={article} class="editorial">{@render children()}</article>
+
+<Chapters root={article} />
+
+<style>
+	.editorial {
+		--mono: 'Llama Mono', ui-monospace, 'SF Mono', Menlo, monospace;
+		--text: min(40rem, calc(100% - 32px));
+		display: grid;
+		grid-template-columns:
+			[full-start] minmax(16px, 1fr) [wide-start] minmax(0, 9rem) [text-start] var(--text)
+			[text-end] minmax(0, 9rem) [wide-end] minmax(16px, 1fr) [full-end];
+		counter-reset: section;
+		min-height: 100vh;
+		padding: clamp(40px, 8vw, 112px) 0 clamp(64px, 10vw, 160px);
+		background: var(--surface-page);
+		color: var(--fg-default);
+		font: 400 18px / 1.6 var(--font-sans);
+		text-wrap: pretty;
+	}
+
+	.editorial > :global(*) {
+		grid-column: text;
+		margin: 0;
+		min-width: 0;
+	}
+
+	.editorial > :global(* + *) {
+		margin-top: 1.1em;
+	}
+
+	.editorial > :global(.wide) {
+		grid-column: wide;
+	}
+
+	/* the masthead: a kicker, the title in Display, the lead and a rule under it */
+	.editorial > :global(.kicker) {
+		color: var(--fg-muted);
+		font: 500 12px / 1.4 var(--mono);
+		letter-spacing: 0.08em;
+		text-transform: uppercase;
+	}
+
+	.editorial > :global(h1) {
+		grid-column: wide;
+		margin-top: 20px;
+		font-size: clamp(48px, 9vw, 112px);
+		font-weight: 700;
+		letter-spacing: -0.01em;
+		line-height: 1;
+	}
+
+	.editorial > :global(.lead) {
+		margin-top: 32px;
+		color: var(--fg-muted);
+		font-size: clamp(20px, 2.4vw, 24px);
+		line-height: 1.45;
+		text-wrap: balance;
+	}
+
+	.editorial > :global(.lead strong) {
+		color: var(--fg-default);
+		font-weight: 500;
+	}
+
+	/* each section opens on a hairline, its number above the heading */
+	.editorial > :global(h2) {
+		counter-increment: section;
+		margin-top: clamp(72px, 10vw, 120px);
+		padding-top: 20px;
+		border-top: 1px solid var(--line-default);
+		font-size: clamp(28px, 3.6vw, 40px);
+		font-weight: 600;
+		letter-spacing: -0.005em;
+		line-height: 1.15;
+		text-wrap: balance;
+	}
+
+	.editorial > :global(h2)::before {
+		content: counter(section, decimal-leading-zero);
+		display: block;
+		margin-bottom: 16px;
+		color: var(--art-cinder);
+		font: 500 13px / 1 var(--mono);
+		letter-spacing: 0.04em;
+	}
+
+	.editorial > :global(h2 + *) {
+		margin-top: 24px;
+	}
+
+	.editorial :global(strong) {
+		font-weight: 600;
+	}
+
+	.editorial :global(em) {
+		font-style: italic;
+	}
+
+	.editorial :global(a) {
+		text-decoration: underline;
+		text-decoration-color: var(--line-default);
+		text-underline-offset: 3px;
+	}
+
+	.editorial :global(:not(pre) > code) {
+		padding: 0.1em 0.3em;
+		border-radius: 6px;
+		background: var(--surface-code);
+		font: 0.85em var(--mono);
+	}
+
+	/* a footnote marker, and the note it points to: small and muted, under the figure */
+	.editorial :global(sup) {
+		color: var(--art-cinder);
+		font: 500 0.75em var(--mono);
+		line-height: 0;
+	}
+
+	.editorial > :global(.note) {
+		color: var(--fg-muted);
+		font-size: 14px;
+		line-height: 1.5;
+	}
+
+	.editorial > :global(ul) {
+		padding-left: 1.2em;
+		list-style: disc;
+	}
+
+	.editorial > :global(ul li + li) {
+		margin-top: 0.5em;
+	}
+
+	.editorial > :global(ul li::marker) {
+		color: var(--fg-muted);
+	}
+
+	/* a pull quote: Display size, wider than the text, with a cinder rule */
+	.editorial > :global(.pull) {
+		grid-column: wide;
+		margin-block: clamp(40px, 6vw, 72px);
+		padding-left: clamp(16px, 3vw, 32px);
+		border-left: 2px solid var(--art-cinder);
+		font-size: clamp(28px, 4.4vw, 48px);
+		font-weight: 600;
+		letter-spacing: -0.01em;
+		line-height: 1.12;
+		text-wrap: balance;
+	}
+
+	.editorial > :global(.pull + *) {
+		margin-top: 0;
+	}
+
+	/* the closing rules: big numbers in the margin */
+	.editorial > :global(ol) {
+		counter-reset: rule;
+		display: grid;
+		gap: 20px;
+		margin-top: 32px;
+		list-style: none;
+	}
+
+	/* the number set inline in the indent, so it sits on the first line's baseline and the item's text, code and links
+	flow as one run */
+	.editorial > :global(ol li) {
+		counter-increment: rule;
+		padding-bottom: 20px;
+		padding-left: 3rem;
+		border-bottom: 1px solid var(--line-default);
+		font-size: 20px;
+		line-height: 1.45;
+	}
+
+	.editorial > :global(ol li)::before {
+		content: counter(rule);
+		display: inline-block;
+		width: 3rem;
+		margin-left: -3rem;
+		color: var(--fg-muted);
+		font: 500 13px var(--mono);
+	}
+
+	.editorial > :global(.colophon) {
+		margin-top: 72px;
+		color: var(--fg-muted);
+		font: 400 13px / 1.6 var(--mono);
+	}
+</style>
diff --git a/ui/apps/chat/tests/stories/editorial/Figure.svelte b/ui/apps/chat/tests/stories/editorial/Figure.svelte
new file mode 100644
index 000000000..25f92ac9a
--- /dev/null
+++ b/ui/apps/chat/tests/stories/editorial/Figure.svelte
@@ -0,0 +1,60 @@
+<!-- A figure on the editorial page: a quiet panel, wider than the text, with a numbered caption under it -->
+<script lang="ts">
+	import type { Snippet } from 'svelte';
+
+	let {
+		caption,
+		children,
+		n,
+		plain = false
+	}: { caption: string; children: Snippet; n: number; plain?: boolean } = $props();
+</script>
+
+<figure class="wide">
+	<div class={['panel', { plain }]}>{@render children()}</div>
+
+	<figcaption>
+		<span class="n">Fig. {n}</span>
+		{caption}
+	</figcaption>
+</figure>
+
+<style>
+	figure {
+		margin-block: clamp(32px, 5vw, 56px) !important;
+	}
+
+	/* muted text a step darker than the page's, so it keeps 4.5:1 on the panel's tint */
+	.panel {
+		--figure-muted: color-mix(in oklab, var(--fg-muted) 75%, var(--fg-default));
+		display: grid;
+		padding: clamp(20px, 4vw, 48px);
+		border: 1px solid var(--line-default);
+		border-radius: 14px;
+		background: color-mix(in oklab, var(--fg-default) 2.5%, var(--surface-page));
+		font-size: 16px;
+		line-height: 1.5;
+	}
+
+	.panel.plain {
+		padding: 0;
+		border: 0;
+		background: none;
+	}
+
+	figcaption {
+		max-width: 40rem;
+		margin-top: 14px;
+		color: var(--fg-muted);
+		font-size: 14px;
+		line-height: 1.5;
+	}
+
+	.n {
+		margin-right: 8px;
+		color: var(--fg-default);
+		font: 500 11px var(--mono);
+		letter-spacing: 0.08em;
+		text-transform: uppercase;
+	}
+</style>
diff --git a/ui/apps/chat/tests/stories/fixtures/ChatFormSingleRowPreview.svelte b/ui/apps/chat/tests/stories/fixtures/ChatFormSingleRowPreview.svelte
deleted file mode 100644
index b25549bfa..000000000
--- a/ui/apps/chat/tests/stories/fixtures/ChatFormSingleRowPreview.svelte
+++ /dev/null
@@ -1,57 +0,0 @@
-<script lang="ts" module>
-	import { ServerRole } from '#lib/enums/index.ts';
-	import { ModelsService } from '#lib/services/index.ts';
-	import { modelsStore, serverStore } from '#lib/stores/index.ts';
-	import type { ModelOption } from '#lib/types/models.js';
-
-	const model = (id: string, name: string, orgName: string, params: string): ModelOption => ({
-		capabilities: [],
-		id,
-		model: id,
-		name,
-		parsedId: {
-			activatedParams: null,
-			modelName: name,
-			orgName,
-			params,
-			quantization: 'Q4_K_M',
-			raw: id,
-			sidecar: null,
-			tags: []
-		}
-	});
-
-	const MODELS = [
-		model('ggml-org/Qwen3-8B-GGUF:Q4_K_M', 'Qwen3-8B', 'ggml-org', '8B'),
-		model('unsloth/Llama-3.2-3B-GGUF:Q4_K_M', 'Llama-3.2-3B', 'unsloth', '3B')
-	];
-
-	// a router with models to pick from, the first one selected: what the chat form shows
-	// with a server behind it. The selector fetches its list on mount, so it is served the same
-	serverStore.role = ServerRole.ROUTER;
-	ModelsService.list = async () => ({ data: MODELS.map(({ id }) => ({ id })) }) as never;
-	modelsStore.models = MODELS;
-	modelsStore.selectedModelId = MODELS[0].id;
-</script>
-
-<script lang="ts">
-	import ChatForm from '#lib/components/app/chat/ChatForm/ChatForm.svelte';
-	import { untrack } from 'svelte';
-
-	interface Props {
-		initial?: string;
-		/** The single row's corner radius, any CSS length. */
-		radius?: string;
-		/** The chat form without the single row, as it was before. */
-		today?: boolean;
-		width?: string;
-	}
-
-	let { initial = '', radius, today = false, width = '52rem' }: Props = $props();
-
-	let value = $state(untrack(() => initial));
-</script>
-
-<div style:--chat-form-single-row-radius={radius} style:width>
-	<ChatForm bind:value singleRow={!today} />
-</div>
diff --git a/ui/apps/chat/tests/stories/fixtures/api-docs.ts b/ui/apps/chat/tests/stories/fixtures/api-docs.ts
deleted file mode 100644
index 7b499956f..000000000
--- a/ui/apps/chat/tests/stories/fixtures/api-docs.ts
+++ /dev/null
@@ -1,160 +0,0 @@
-// API Documentation
-export const API_DOCS_MD = String.raw`
-# REST API Documentation
-
-## 🔐 Authentication
-
-All API requests require authentication using **Bearer tokens**. Include your API key in the Authorization header:
-
-${'```'}http
-GET /api/v1/users
-Host: api.example.com
-Authorization: Bearer YOUR_API_KEY
-Content-Type: application/json
-${'```'}
-
-## 📍 Endpoints
-
-### Users API
-
-#### **GET** /api/v1/users
-
-Retrieve a paginated list of users.
-
-**Query Parameters:**
-
-| Parameter | Type | Default | Description |
-|-----------|------|---------|-------------|
-| page | integer | 1 | Page number |
-| limit | integer | 20 | Items per page |
-| sort | string | "created_at" | Sort field |
-| order | string | "desc" | Sort order |
-
-**Response:** 200 OK
-
-${'```'}json
-{
-  "data": [
-    {
-      "id": "usr_1234567890",
-      "email": "user@example.com",
-      "name": "John Doe",
-      "role": "admin",
-      "created_at": "2024-01-15T10:30:00Z"
-    }
-  ],
-  "pagination": {
-    "page": 1,
-    "limit": 20,
-    "total": 156,
-    "pages": 8
-  }
-}
-${'```'}
-
-#### **POST** /api/v1/users
-
-Create a new user account.
-
-**Request Body:**
-
-${'```'}json
-{
-  "email": "newuser@example.com",
-  "password": "SecurePassword123!",
-  "name": "Jane Smith",
-  "role": "user"
-}
-${'```'}
-
-**Response:** 201 Created
-
-${'```'}json
-{
-  "id": "usr_9876543210",
-  "email": "newuser@example.com",
-  "name": "Jane Smith",
-  "role": "user",
-  "created_at": "2024-01-21T09:15:00Z"
-}
-${'```'}
-
-### Error Responses
-
-The API returns errors in a consistent format:
-
-${'```'}json
-{
-  "error": {
-    "code": "VALIDATION_ERROR",
-    "message": "Invalid request parameters",
-    "details": [
-      {
-        "field": "email",
-        "message": "Email format is invalid"
-      }
-    ]
-  }
-}
-${'```'}
-
-### Rate Limiting
-
-| Tier | Requests/Hour | Burst |
-|------|--------------|-------|
-| **Free** | 1,000 | 100 |
-| **Pro** | 10,000 | 500 |
-| **Enterprise** | Unlimited | - |
-
-**Headers:**
-- X-RateLimit-Limit
-- X-RateLimit-Remaining
-- X-RateLimit-Reset
-
-### Webhooks
-
-Configure webhooks to receive real-time events:
-
-${'```'}javascript
-// Webhook payload
-{
-  "event": "user.created",
-  "timestamp": "2024-01-21T09:15:00Z",
-  "data": {
-    "id": "usr_9876543210",
-    "email": "newuser@example.com"
-  },
-  "signature": "sha256=abcd1234..."
-}
-${'```'}
-
-### SDK Examples
-
-**JavaScript/TypeScript:**
-
-${'```'}typescript
-import { ApiClient } from '@example/api-sdk';
-
-const client = new ApiClient({
-  apiKey: process.env.API_KEY
-});
-
-const users = await client.users.list({
-  page: 1,
-  limit: 20
-});
-${'```'}
-
-**Python:**
-
-${'```'}python
-from example_api import Client
-
-client = Client(api_key=os.environ['API_KEY'])
-users = client.users.list(page=1, limit=20)
-${'```'}
-
----
-
-📚 [Full API Reference](https://api.example.com/docs) | 💬 [Support](https://support.example.com)
-`;
diff --git a/ui/apps/chat/tests/stories/fixtures/assets/beautiful-flowers-lotus.webp b/ui/apps/chat/tests/stories/fixtures/assets/beautiful-flowers-lotus.webp
deleted file mode 100644
index 6efcffc3b..000000000
Binary files a/ui/apps/chat/tests/stories/fixtures/assets/beautiful-flowers-lotus.webp and /dev/null differ
diff --git a/ui/apps/chat/tests/stories/fixtures/assets/clip.webm b/ui/apps/chat/tests/stories/fixtures/assets/clip.webm
new file mode 100644
index 000000000..b033e8745
Binary files /dev/null and b/ui/apps/chat/tests/stories/fixtures/assets/clip.webm differ
diff --git a/ui/apps/chat/tests/stories/fixtures/assets/tone.wav b/ui/apps/chat/tests/stories/fixtures/assets/tone.wav
new file mode 100644
index 000000000..80c7e08cd
Binary files /dev/null and b/ui/apps/chat/tests/stories/fixtures/assets/tone.wav differ
diff --git a/ui/apps/chat/tests/stories/fixtures/blog-post.ts b/ui/apps/chat/tests/stories/fixtures/blog-post.ts
deleted file mode 100644
index 3eb2ed758..000000000
--- a/ui/apps/chat/tests/stories/fixtures/blog-post.ts
+++ /dev/null
@@ -1,125 +0,0 @@
-// Blog Post Content
-export const BLOG_POST_MD = String.raw`
-# Understanding Rust's Ownership System
-
-*Published on March 15, 2024 • 8 min read*
-
-Rust's ownership system is one of its most distinctive features, enabling memory safety without garbage collection. In this post, we'll explore how ownership works and why it's revolutionary for systems programming.
-
-## What is Ownership?
-
-Ownership is a set of rules that governs how Rust manages memory. These rules are checked at compile time, ensuring memory safety without runtime overhead.
-
-### The Three Rules of Ownership
-
-1. **Each value has a single owner**
-2. **There can only be one owner at a time**
-3. **When the owner goes out of scope, the value is dropped**
-
-## Memory Management Without GC
-
-Traditional approaches to memory management:
-
-- **Manual management** (C/C++): Error-prone, leads to bugs
-- **Garbage collection** (Java, Python): Runtime overhead
-- **Ownership** (Rust): Compile-time safety, zero runtime cost
-
-## Basic Examples
-
-### Variable Scope
-
-${'```'}rust
-fn main() {
-    let s = String::from("hello");  // s comes into scope
-
-    // s is valid here
-    println!("{}", s);
-
-}  // s goes out of scope and is dropped
-${'```'}
-
-### Move Semantics
-
-${'```'}rust
-fn main() {
-    let s1 = String::from("hello");
-    let s2 = s1;  // s1 is moved to s2
-
-    // println!("{}", s1);  // ❌ ERROR: s1 is no longer valid
-    println!("{}", s2);     // ✅ OK: s2 owns the string
-}
-${'```'}
-
-## Borrowing and References
-
-Instead of transferring ownership, you can **borrow** values:
-
-### Immutable References
-
-${'```'}rust
-fn calculate_length(s: &String) -> usize {
-    s.len()  // s is a reference, doesn't own the String
-}
-
-fn main() {
-    let s1 = String::from("hello");
-    let len = calculate_length(&s1);  // Borrow s1
-    println!("Length of '{}' is {}", s1, len);  // s1 still valid
-}
-${'```'}
-
-### Mutable References
-
-${'```'}rust
-fn main() {
-    let mut s = String::from("hello");
-
-    let r1 = &mut s;
-    r1.push_str(", world");
-    println!("{}", r1);
-
-    // let r2 = &mut s;  // ❌ ERROR: cannot borrow twice
-}
-${'```'}
-
-## Common Pitfalls
-
-### Dangling References
-
-${'```'}rust
-fn dangle() -> &String {  // ❌ ERROR: missing lifetime specifier
-    let s = String::from("hello");
-    &s  // s will be dropped, leaving a dangling reference
-}
-${'```'}
-
-### ✅ Solution
-
-${'```'}rust
-fn no_dangle() -> String {
-    let s = String::from("hello");
-    s  // Ownership is moved out
-}
-${'```'}
-
-## Benefits
-
-- ✅ **No null pointer dereferences**
-- ✅ **No data races**
-- ✅ **No use-after-free**
-- ✅ **No memory leaks**
-
-## Conclusion
-
-Rust's ownership system eliminates entire classes of bugs at compile time. While it has a learning curve, the benefits in safety and performance are worth it.
-
-## Further Reading
-
-- [The Rust Book - Ownership](https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html)
-- [Rust by Example - Ownership](https://doc.rust-lang.org/rust-by-example/scope/move.html)
-- [Rustlings Exercises](https://github.com/rust-lang/rustlings)
-
----
-
-*Questions? Reach out on [Twitter](https://twitter.com/rustlang) or join the [Rust Discord](https://discord.gg/rust-lang)*
-`;
diff --git a/ui/apps/chat/tests/stories/fixtures/data-analysis.ts b/ui/apps/chat/tests/stories/fixtures/data-analysis.ts
deleted file mode 100644
index 6fec32dad..000000000
--- a/ui/apps/chat/tests/stories/fixtures/data-analysis.ts
+++ /dev/null
@@ -1,124 +0,0 @@
-// Data Analysis Report
-export const DATA_ANALYSIS_MD = String.raw`
-# Q4 2024 Business Analytics Report
-
-*Executive Summary • Generated on January 15, 2025*
-
-## 📊 Key Performance Indicators
-
-${'```'}
-Daily Active Users (DAU):   1.2M (+65% YoY)
-Monthly Active Users (MAU): 4.5M (+48% YoY)
-User Retention (Day 30):    68% (+12pp YoY)
-Average Session Duration:   24min (+35% YoY)
-${'```'}
-
-## 🎯 Product Performance
-
-### Feature Adoption Rates
-
-1. **AI Assistant**: 78% of users (↑ from 45%)
-2. **Collaboration Tools**: 62% of users (↑ from 38%)
-3. **Analytics Dashboard**: 54% of users (↑ from 31%)
-4. **Mobile App**: 41% of users (↑ from 22%)
-
-### Customer Satisfaction
-
-| Metric | Q4 2024 | Q3 2024 | Change |
-|--------|---------|---------|--------|
-| **NPS Score** | 72 | 68 | +4 |
-| **CSAT** | 4.6/5 | 4.4/5 | +0.2 |
-| **Support Tickets** | 2,340 | 2,890 | -19% |
-| **Resolution Time** | 4.2h | 5.1h | -18% |
-
-## 💰 Revenue Metrics
-
-### Monthly Recurring Revenue (MRR)
-
-- **Current MRR**: $2.8M (+42% YoY)
-- **New MRR**: $340K
-- **Expansion MRR**: $180K
-- **Churned MRR**: $95K
-- **Net New MRR**: $425K
-
-### Customer Acquisition
-
-${'```'}
-Cost per Acquisition (CAC): $127 (-23% YoY)
-Customer Lifetime Value:    $1,840 (+31% YoY)
-LTV:CAC Ratio:             14.5:1
-Payback Period:            3.2 months
-${'```'}
-
-## 🌍 Geographic Performance
-
-### Revenue by Region
-
-1. **North America**: 45% ($1.26M)
-2. **Europe**: 32% ($896K)
-3. **Asia-Pacific**: 18% ($504K)
-4. **Other**: 5% ($140K)
-
-### Growth Opportunities
-
-- **APAC**: 89% YoY growth potential
-- **Latin America**: Emerging market entry
-- **Middle East**: Enterprise expansion
-
-## 📱 Channel Performance
-
-### Traffic Sources
-
-| Channel | Sessions | Conversion | Revenue |
-|---------|----------|------------|---------|
-| **Organic Search** | 45% | 3.2% | $1.1M |
-| **Direct** | 28% | 4.1% | $850K |
-| **Social Media** | 15% | 2.8% | $420K |
-| **Paid Ads** | 12% | 5.5% | $430K |
-
-### Marketing ROI
-
-- **Content Marketing**: 340% ROI
-- **Email Campaigns**: 280% ROI
-- **Social Media**: 190% ROI
-- **Paid Search**: 220% ROI
-
-## 🔍 User Behavior Analysis
-
-### Session Patterns
-
-- **Peak Hours**: 9-11 AM, 2-4 PM EST
-- **Mobile Usage**: 67% of sessions
-- **Average Pages/Session**: 4.8
-- **Bounce Rate**: 23% (↓ from 31%)
-
-### Feature Usage Heatmap
-
-Most used features in order:
-1. Dashboard (89% of users)
-2. Search (76% of users)
-3. Reports (64% of users)
-4. Settings (45% of users)
-5. Integrations (32% of users)
-
-## 💡 Recommendations
-
-1. **Invest** in AI capabilities (+$2M budget)
-2. **Expand** sales team in APAC region
-3. **Improve** onboarding to reduce churn
-4. **Launch** enterprise security features
-
-## Appendix
-
-### Methodology
-
-Data collected from:
-- Internal analytics (Amplitude)
-- Customer surveys (n=2,450)
-- Financial systems (NetSuite)
-- Market research (Gartner)
-
----
-
-*Report prepared by Data Analytics Team • [View Interactive Dashboard](https://analytics.example.com)*
-`;
diff --git a/ui/apps/chat/tests/stories/fixtures/empty.ts b/ui/apps/chat/tests/stories/fixtures/empty.ts
deleted file mode 100644
index 05286e7a7..000000000
--- a/ui/apps/chat/tests/stories/fixtures/empty.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-// Empty state
-export const EMPTY_MD = '';
diff --git a/ui/apps/chat/tests/stories/fixtures/math-formulas.ts b/ui/apps/chat/tests/stories/fixtures/math-formulas.ts
deleted file mode 100644
index 1355256b2..000000000
--- a/ui/apps/chat/tests/stories/fixtures/math-formulas.ts
+++ /dev/null
@@ -1,221 +0,0 @@
-/* eslint-disable no-irregular-whitespace */
-// Math Formulas Content
-export const MATH_FORMULAS_MD = String.raw`
-# Mathematical Formulas and Expressions
-
-This document demonstrates various mathematical notation and formulas that can be rendered using LaTeX syntax in markdown.
-
-## Basic Arithmetic
-
-### Addition and Summation
-$$\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$$
-
-## Algebra
-
-### Quadratic Formula
-The solutions to $ax^2 + bx + c = 0$ are:
-$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
-
-### Binomial Theorem
-$$(x + y)^n = \sum_{k=0}^{n} \binom{n}{k} x^{n-k} y^k$$
-
-## Calculus
-
-### Derivatives
-The derivative of $f(x) = x^n$ is:
-$$f'(x) = nx^{n-1}$$
-
-### Integration
-$$\int_a^b f(x) \, dx = F(b) - F(a)$$
-
-### Fundamental Theorem of Calculus
-$$\frac{d}{dx} \int_a^x f(t) \, dt = f(x)$$
-
-## Linear Algebra
-
-### Matrix Multiplication
-If $A$ is an $m \times n$ matrix and $B$ is an $n \times p$ matrix, then:
-$$C_{ij} = \sum_{k=1}^{n} A_{ik} B_{kj}$$
-
-### Eigenvalues and Eigenvectors
-For a square matrix $A$, if $Av = \lambda v$ for some non-zero vector $v$, then:
-- $\lambda$ is an eigenvalue
-- $v$ is an eigenvector
-
-## Statistics and Probability
-
-### Normal Distribution
-The probability density function is:
-$$f(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2}$$
-
-### Bayes' Theorem
-$$P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}$$
-
-### Central Limit Theorem
-For large $n$, the sample mean $\bar{X}$ is approximately:
-$$\bar{X} \sim N\left(\mu, \frac{\sigma^2}{n}\right)$$
-
-## Trigonometry
-
-### Pythagorean Identity
-$$\sin^2\theta + \cos^2\theta = 1$$
-
-### Euler's Formula
-$$e^{i\theta} = \cos\theta + i\sin\theta$$
-
-### Taylor Series for Sine
-$$\sin x = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!} x^{2n+1} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots$$
-
-## Complex Analysis
-
-### Complex Numbers
-A complex number can be written as:
-$$z = a + bi = r e^{i\theta}$$
-
-where $r = |z| = \sqrt{a^2 + b^2}$ and $\theta = \arg(z)$
-
-### Cauchy-Riemann Equations
-For a function $f(z) = u(x,y) + iv(x,y)$ to be analytic:
-$$\frac{\partial u}{\partial x} = \frac{\partial v}{\partial y}, \quad \frac{\partial u}{\partial y} = -\frac{\partial v}{\partial x}$$
-
-## Differential Equations
-
-### First-order Linear ODE
-$$\frac{dy}{dx} + P(x)y = Q(x)$$
-
-Solution: $y = e^{-\int P(x)dx}\left[\int Q(x)e^{\int P(x)dx}dx + C\right]$
-
-### Heat Equation
-$$\frac{\partial u}{\partial t} = \alpha \frac{\partial^2 u}{\partial x^2}$$
-
-## Number Theory
-
-### Prime Number Theorem
-$$\pi(x) \sim \frac{x}{\ln x}$$
-
-where $\pi(x)$ is the number of primes less than or equal to $x$.
-
-### Fermat's Last Theorem
-For $n > 2$, there are no positive integers $a$, $b$, and $c$ such that:
-$$a^n + b^n = c^n$$
-
-## Set Theory
-
-### De Morgan's Laws
-$$\overline{A \cup B} = \overline{A} \cap \overline{B}$$
-$$\overline{A \cap B} = \overline{A} \cup \overline{B}$$
-
-## Advanced Topics
-
-### Riemann Zeta Function
-$$\zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s} = \prod_{p \text{ prime}} \frac{1}{1-p^{-s}}$$
-
-### Maxwell's Equations
-$$\nabla \cdot \mathbf{E} = \frac{\rho}{\epsilon_0}$$
-$$\nabla \cdot \mathbf{B} = 0$$
-$$\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}$$
-$$\nabla \times \mathbf{B} = \mu_0\mathbf{J} + \mu_0\epsilon_0\frac{\partial \mathbf{E}}{\partial t}$$
-
-### Schrödinger Equation
-$$i\hbar\frac{\partial}{\partial t}\Psi(\mathbf{r},t) = \hat{H}\Psi(\mathbf{r},t)$$
-
-## Inline Math Examples
-
-Here are some inline mathematical expressions:
-
-- The golden ratio: $\phi = \frac{1 + \sqrt{5}}{2} \approx 1.618$
-- Euler's number: $e = \lim_{n \to \infty} \left(1 + \frac{1}{n}\right)^n$
-- Pi: $\pi = 4 \sum_{n=0}^{\infty} \frac{(-1)^n}{2n+1}$
-- Square root of 2: $\sqrt{2} = 1.41421356...$
-
-## Fractions and Radicals
-
-Complex fraction: $\frac{\frac{a}{b} + \frac{c}{d}}{\frac{e}{f} - \frac{g}{h}}$
-
-Nested radicals: $\sqrt{2 + \sqrt{3 + \sqrt{4 + \sqrt{5}}}}$
-
-## Summations and Products
-
-### Geometric Series
-$$\sum_{n=0}^{\infty} ar^n = \frac{a}{1-r} \quad \text{for } |r| < 1$$
-
-### Product Notation
-$$n! = \prod_{k=1}^{n} k$$
-
-### Double Summation
-$$\sum_{i=1}^{m} \sum_{j=1}^{n} a_{ij}$$
-
-## Limits
-
-$$\lim_{x \to 0} \frac{\sin x}{x} = 1$$
-
-$$\lim_{n \to \infty} \left(1 + \frac{x}{n}\right)^n = e^x$$
-
-## Further Bracket Styles and Amounts
-
--  \( \mathrm{GL}_2(\mathbb{F}_7) \): Group of invertible matrices with entries in \(\mathbb{F}_7\).
-- Some kernel of \(\mathrm{SL}_2(\mathbb{F}_7)\):
-  \[
-  \left\{ \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix} \right\} = \{\pm I\}
-  \]
-- Algebra:
-\[
-x = \frac{-b \pm \sqrt{\,b^{2}-4ac\,}}{2a}
-\]
-- $100 and $12.99 are amounts, not LaTeX.
-- I have $10, $3.99 and $x + y$ and $100x$. The amount is $2,000.
-- Emma buys 2 cupcakes for $3 each and 1 cookie for $1.50. How much money does she spend in total?
-- Maria has $20. She buys a notebook for $4.75 and a pack of pencils for $3.25. How much change does she receive?
-- 1 kg の質量は
-  \[
-  E = (1\ \text{kg}) \times (3.0 \times 10^8\ \text{m/s})^2 \approx 9.0 \times 10^{16}\ \text{J}
-  \]
-  というエネルギーに相当します。これは約 21 百万トンの TNT が爆発したときのエネルギーに匹敵します。
-- Algebra: \[
-x = \frac{-b \pm \sqrt{\,b^{2}-4ac\,}}{2a}
-\]
-- Algebraic topology, Homotopy Groups of $\mathbb{S}^3$:
-$$\pi_n(\mathbb{S}^3) = \begin{cases}
-\mathbb{Z} & n = 3 \\
-0 & n > 3, n \neq 4 \\
-\mathbb{Z}_2 & n = 4 \\
-\end{cases}$$
-- Spacer preceded by backslash:
-\[
-\boxed{
-\begin{aligned}
-N_{\text{att}}^{\text{(MHA)}} &=
-h \bigl[\, d_{\text{model}}\;d_{k} + d_{\text{model}}\;d_{v}\, \bigr]   && (\text{Q,K,V の重み})\\
-&\quad+ h(d_{k}+d_{k}+d_{v})                                          && (\text{バイアス Q,K,V)}\\[4pt]
-&\quad+ (h d_{v})\, d_{\text{model}}                                 && (\text{出力射影 }W^{O})\\
-&\quad+ d_{\text{model}}                                            && (\text{バイアス }b^{O})
-\end{aligned}}
-\]
-
-## Formulas in a Table
-
-| Area | Expression | Comment |
-|------|------------|---------|
-| **Algebra** | \[
-x = \frac{-b \pm \sqrt{\,b^{2}-4ac\,}}{2a}
-\] | Quadratic formula |
-| | \[
-(a+b)^{n} = \sum_{k=0}^{n}\binom{n}{k}\,a^{\,n-k}\,b^{\,k}
-\] | Binomial theorem |
-| | \(\displaystyle \prod_{k=1}^{n}k = n! \) | Factorial definition |
-| **Geometry** | \( \mathbf{a}\cdot \mathbf{b} = \|\mathbf{a}\|\,\|\mathbf{b}\|\,\cos\theta \) | Dot product & angle |
-
-## No math (but chemical)
-
-Balanced chemical reaction with states:
-
-\[
-\ce{2H2(g) + O2(g) -> 2H2O(l)}
-\]
-
-The standard enthalpy change for the reaction is: $\Delta H^\circ = \pu{-572 kJ mol^{-1}}$.
-
----
-
-*This document showcases various mathematical notation and formulas that can be rendered in markdown using LaTeX syntax.*
-`;
diff --git a/ui/apps/chat/tests/stories/fixtures/mobile-tables.ts b/ui/apps/chat/tests/stories/fixtures/mobile-tables.ts
deleted file mode 100644
index 3e9cc3231..000000000
--- a/ui/apps/chat/tests/stories/fixtures/mobile-tables.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-// Table-heavy answers, to check the table layout at a phone width.
-export const JOKES_TABLE_MD = String.raw`
-Sure! Here are the jokes in a table:
-
-| No. | Joke |
-|-----|------|
-| 1 | Why don't scientists trust atoms? Because they make up everything. |
-| 2 | I told my wife she was drawing her eyebrows too high. She looked surprised. |
-| 3 | Why did the scarecrow win an award? Because he was outstanding in his field. |
-| 4 | I'm reading a book about anti-gravity. It's impossible to put down. |
-| 5 | Why don't skeletons fight each other? They don't have the guts. |
-| 6 | I used to hate clowns, but they all have their fat-sies. |
-| 7 | What do you call a fake noodle? An impasta. |
-| 8 | Why did the bicycle fall over? Because it was two-tired. |
-| 9 | I would tell you a chemistry joke, but I know I wouldn't get a reaction. |
-| 10 | Why did the golfer bring two pairs of pants? In case he got a hole in one. |
-`;
-
-export const WIDE_CELL_TABLE_MD = String.raw`
-Some endpoints, in a table, for reference:
-
-| Name | Endpoint | Description |
-|------|----------|-------------|
-| Completions | https://huggingface.co/api/models/ggml-org/gpt-oss-20b-GGUF/summary | Long endpoint description |
-| Models | ./v1/models | Lists the models loaded in the server slot |
-| Props | ./props | Server capabilities and default sampling |
-`;
diff --git a/ui/apps/chat/tests/stories/fixtures/readme.ts b/ui/apps/chat/tests/stories/fixtures/readme.ts
deleted file mode 100644
index e8b573d6c..000000000
--- a/ui/apps/chat/tests/stories/fixtures/readme.ts
+++ /dev/null
@@ -1,136 +0,0 @@
-// README Content
-export const README_MD = String.raw`
-# 🚀 Awesome Web Framework
-
-[![npm version](https://img.shields.io/npm/v/awesome-framework.svg)](https://www.npmjs.com/package/awesome-framework)
-[![Build Status](https://github.com/awesome/framework/workflows/CI/badge.svg)](https://github.com/awesome/framework/actions)
-[![Coverage](https://codecov.io/gh/awesome/framework/branch/main/graph/badge.svg)](https://codecov.io/gh/awesome/framework)
-[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
-
-> A modern, fast, and flexible web framework for building scalable applications
-
-## ✨ Features
-
-- 🎯 **Type-Safe** - Full TypeScript support out of the box
-- ⚡ **Lightning Fast** - Built on Vite for instant HMR
-- 📦 **Zero Config** - Works out of the box for most use cases
-- 🎨 **Flexible** - Unopinionated with sensible defaults
-- 🔧 **Extensible** - Plugin system for custom functionality
-- 📱 **Responsive** - Mobile-first approach
-- 🌍 **i18n Ready** - Built-in internationalization
-- 🔒 **Secure** - Security best practices by default
-
-## 📦 Installation
-
-${'```'}bash
-npm install awesome-framework
-# or
-yarn add awesome-framework
-# or
-pnpm add awesome-framework
-${'```'}
-
-## 🚀 Quick Start
-
-### Create a new project
-
-${'```'}bash
-npx create-awesome-app my-app
-cd my-app
-npm run dev
-${'```'}
-
-### Basic Example
-
-${'```'}javascript
-import { createApp } from 'awesome-framework';
-
-const app = createApp({
-  port: 3000,
-  middleware: ['cors', 'helmet', 'compression']
-});
-
-app.get('/', (req, res) => {
-  res.json({ message: 'Hello World!' });
-});
-
-app.listen(() => {
-  console.log('Server running on http://localhost:3000');
-});
-${'```'}
-
-## 📖 Documentation
-
-### Core Concepts
-
-- [Getting Started](https://docs.awesome.dev/getting-started)
-- [Configuration](https://docs.awesome.dev/configuration)
-- [Routing](https://docs.awesome.dev/routing)
-- [Middleware](https://docs.awesome.dev/middleware)
-- [Database](https://docs.awesome.dev/database)
-- [Authentication](https://docs.awesome.dev/authentication)
-
-### Advanced Topics
-
-- [Performance Optimization](https://docs.awesome.dev/performance)
-- [Deployment](https://docs.awesome.dev/deployment)
-- [Testing](https://docs.awesome.dev/testing)
-- [Security](https://docs.awesome.dev/security)
-
-## 🛠️ Development
-
-### Prerequisites
-
-- Node.js >= 18
-- pnpm >= 8
-
-### Setup
-
-${'```'}bash
-git clone https://github.com/awesome/framework.git
-cd framework
-pnpm install
-pnpm dev
-${'```'}
-
-### Testing
-
-${'```'}bash
-pnpm test        # Run unit tests
-pnpm test:e2e    # Run end-to-end tests
-pnpm test:watch  # Run tests in watch mode
-${'```'}
-
-## 🤝 Contributing
-
-We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
-
-### Contributors
-
-<a href="https://github.com/awesome/framework/graphs/contributors">
-  <img src="https://contrib.rocks/image?repo=awesome/framework" />
-</a>
-
-## 📊 Benchmarks
-
-| Framework | Requests/sec | Latency (ms) | Memory (MB) |
-|-----------|-------------|--------------|-------------|
-| **Awesome** | **45,230** | **2.1** | **42** |
-| Express | 28,450 | 3.5 | 68 |
-| Fastify | 41,200 | 2.3 | 48 |
-| Koa | 32,100 | 3.1 | 52 |
-
-*Benchmarks performed on MacBook Pro M2, Node.js 20.x*
-
-## 📝 License
-
-MIT © [Awesome Team](https://github.com/awesome)
-
-## 🙏 Acknowledgments
-
-Special thanks to all our sponsors and contributors who make this project possible.
-
----
-
-**[Website](https://awesome.dev)** • **[Documentation](https://docs.awesome.dev)** • **[Discord](https://discord.gg/awesome)** • **[Twitter](https://twitter.com/awesomeframework)**
-`;
diff --git a/ui/apps/chat/tests/stories/fixtures/storybook-mocks.ts b/ui/apps/chat/tests/stories/fixtures/storybook-mocks.ts
deleted file mode 100644
index 41a1a8a49..000000000
--- a/ui/apps/chat/tests/stories/fixtures/storybook-mocks.ts
+++ /dev/null
@@ -1,87 +0,0 @@
-import { serverStore } from '#lib/stores/llama-server.svelte.ts';
-import { modelsStore } from '#lib/stores/models/index.svelte.ts';
-
-/**
- * Mock server properties for Storybook testing
- * This utility allows setting mock server configurations without polluting production code
- */
-export function mockServerProps(props: Partial<ApiLlamaCppServerProps>): void {
-	// Reset any pointer-events from previous tests (dropdown cleanup)
-	const body = document.querySelector('body');
-
-	if (body) body.style.pointerEvents = '';
-
-	// Directly set the props for testing purposes
-	(serverStore as unknown as { props: ApiLlamaCppServerProps }).props = {
-		modalities: {
-			audio: props.modalities?.audio ?? false,
-			video: props.modalities?.video ?? false,
-			vision: props.modalities?.vision ?? false
-		},
-		model_path: props.model_path || 'test-model',
-		...props
-	} as ApiLlamaCppServerProps;
-
-	// Set router mode role so activeModelId can be set
-	(serverStore as unknown as { props: ApiLlamaCppServerProps }).props.role = 'ROUTER';
-
-	// Also mock modelsStore methods for modality checking
-	const vision = props.modalities?.vision ?? false;
-	const audio = props.modalities?.audio ?? false;
-	const video = props.modalities?.video ?? false;
-
-	// eslint-disable-next-line @typescript-eslint/no-explicit-any
-	(modelsStore as any).modelSupportsVision = () => vision;
-	// eslint-disable-next-line @typescript-eslint/no-explicit-any
-	(modelsStore as any).modelSupportsAudio = () => audio;
-	// eslint-disable-next-line @typescript-eslint/no-explicit-any
-	(modelsStore as any).modelSupportsVideo = () => video;
-
-	// Mock models list with a test model so activeModelId can be resolved
-	// eslint-disable-next-line @typescript-eslint/no-explicit-any
-	(modelsStore as any).models = [
-		{
-			id: 'test-model',
-			model: 'test-model',
-			name: 'Test Model'
-		}
-	];
-
-	// Mock selectedModelId
-	// eslint-disable-next-line @typescript-eslint/no-explicit-any
-	(modelsStore as any).selectedModelId = 'test-model';
-}
-
-/**
- * Reset server store to clean state for testing
- */
-export function resetServerStore(): void {
-	(serverStore as unknown as { props: ApiLlamaCppServerProps }).props = {
-		modalities: {
-			audio: false,
-			video: false,
-			vision: false
-		},
-		model_path: ''
-	} as ApiLlamaCppServerProps;
-	(serverStore as unknown as { error: string }).error = '';
-	(serverStore as unknown as { loading: boolean }).loading = false;
-}
-
-/**
- * Common mock configurations for Storybook stories
- */
-export const mockConfigs = {
-	audioOnly: {
-		modalities: { audio: true, vision: false }
-	},
-	bothModalities: {
-		modalities: { audio: true, vision: true }
-	},
-	noModalities: {
-		modalities: { audio: false, video: false, vision: false }
-	},
-	visionOnly: {
-		modalities: { audio: false, vision: true }
-	}
-} as const;
diff --git a/ui/apps/chat/tests/stories/forms/HighlightedMatch.stories.svelte b/ui/apps/chat/tests/stories/forms/HighlightedMatch.stories.svelte
new file mode 100644
index 000000000..9eb502f47
--- /dev/null
+++ b/ui/apps/chat/tests/stories/forms/HighlightedMatch.stories.svelte
@@ -0,0 +1,31 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { HighlightedMatch } from '#lib/components/app/index.ts';
+
+	// how a search query is marked in the sidebar's, the model lists' and the pickers' results
+	const { Story } = defineMeta({
+		component: HighlightedMatch,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Forms/HighlightedMatch'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2}>
+		<StateGalleryItem label="Match" note="the query marked in the result">
+			<span class="text-body-sm">
+				<HighlightedMatch query="llama" text="Meta-Llama-3.1-8B-Instruct" />
+			</span>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="No match">
+			<span class="text-body-sm">
+				<HighlightedMatch query="qwen" text="Meta-Llama-3.1-8B-Instruct" />
+			</span>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/forms/InputWithSuggestions.stories.svelte b/ui/apps/chat/tests/stories/forms/InputWithSuggestions.stories.svelte
new file mode 100644
index 000000000..57f4e8fee
--- /dev/null
+++ b/ui/apps/chat/tests/stories/forms/InputWithSuggestions.stories.svelte
@@ -0,0 +1,68 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { InputWithSuggestions } from '#lib/components/app/index.ts';
+
+	// a field with an autocomplete list under it; the caller owns the suggestions and the keys
+	const { Story } = defineMeta({
+		component: InputWithSuggestions,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Forms/InputWithSuggestions'
+	});
+
+	const noop = () => {};
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={3} minItemWidth="16rem">
+		<StateGalleryItem label="Idle">
+			<InputWithSuggestions
+				name="model"
+				onBlur={noop}
+				onFocus={noop}
+				onInput={noop}
+				onKeydown={noop}
+				onSelectSuggestion={noop}
+				value=""
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Suggestions">
+			<div class="h-48">
+				<InputWithSuggestions
+					autocompleteIndex={1}
+					isAutocompleteActive
+					name="model"
+					onBlur={noop}
+					onFocus={noop}
+					onInput={noop}
+					onKeydown={noop}
+					onSelectSuggestion={noop}
+					suggestions={[
+						'ggml-org/gemma-3-4b-it-GGUF',
+						'ggml-org/Qwen3-8B-GGUF',
+						'ggml-org/gpt-oss-20b-GGUF'
+					]}
+					value="ggml-org/"
+				/>
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Loading">
+			<InputWithSuggestions
+				isAutocompleteActive
+				isLoadingSuggestions
+				name="model"
+				onBlur={noop}
+				onFocus={noop}
+				onInput={noop}
+				onKeydown={noop}
+				onSelectSuggestion={noop}
+				value="ggml-org/"
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/forms/KeyValuePairs.stories.svelte b/ui/apps/chat/tests/stories/forms/KeyValuePairs.stories.svelte
new file mode 100644
index 000000000..50e6a7e37
--- /dev/null
+++ b/ui/apps/chat/tests/stories/forms/KeyValuePairs.stories.svelte
@@ -0,0 +1,47 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { KeyValuePairs } from '#lib/components/app/index.ts';
+	import type { KeyValuePair } from '#lib/types/index.ts';
+
+	// the editable key and value list, as used for MCP server headers
+	const { Story } = defineMeta({
+		component: KeyValuePairs,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Forms/KeyValuePairs'
+	});
+</script>
+
+<script lang="ts">
+	let pairs = $state<KeyValuePair[]>([
+		{ key: 'Authorization', value: 'Bearer sk-local' },
+		{ key: 'X-Workspace', value: 'research' }
+	]);
+	let emptyPairs = $state<KeyValuePair[]>([]);
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2} minItemWidth="20rem">
+		<StateGalleryItem label="With pairs">
+			<KeyValuePairs
+				addButtonLabel="Add header"
+				onPairsChange={(next) => (pairs = next)}
+				{pairs}
+				sectionLabel="Headers"
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Empty">
+			<KeyValuePairs
+				addButtonLabel="Add header"
+				emptyMessage="No headers configured."
+				onPairsChange={(next) => (emptyPairs = next)}
+				pairs={emptyPairs}
+				sectionLabel="Headers"
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/foundations/Brand.stories.svelte b/ui/apps/chat/tests/stories/foundations/Brand.stories.svelte
new file mode 100644
index 000000000..23f9fbd3a
--- /dev/null
+++ b/ui/apps/chat/tests/stories/foundations/Brand.stories.svelte
@@ -0,0 +1,18 @@
+<script lang="ts" module>
+	import ShowcaseFrame from '../brand/logo-showcase/ShowcaseFrame.svelte';
+	import IconUsage from '../brand/logo-usage/IconUsage.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	// the brand where the web app shows it: the splash screens, the icon on the page colour while the app opens
+	const { Story } = defineMeta({
+		parameters: {
+			controls: { disable: true },
+			layout: 'fullscreen'
+		},
+		title: 'Llama Chat/Foundations/Brand'
+	});
+</script>
+
+<Story asChild name="Splash screens">
+	<ShowcaseFrame><IconUsage section="splash" /></ShowcaseFrame>
+</Story>
diff --git a/ui/apps/chat/tests/stories/foundations/SafeAreas.stories.svelte b/ui/apps/chat/tests/stories/foundations/SafeAreas.stories.svelte
new file mode 100644
index 000000000..d2d37842e
--- /dev/null
+++ b/ui/apps/chat/tests/stories/foundations/SafeAreas.stories.svelte
@@ -0,0 +1,86 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	// the safe-area utilities from src/lib/styles/safe-area.css, in phone frames that simulate an
+	// installed iPhone app's insets (they are 0 in a desktop browser)
+	const { Story } = defineMeta({
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Foundations/Safe areas'
+	});
+
+	/** An iPhone's status bar and home indicator, as an installed app sees them. */
+	const SIMULATED_INSETS = '--safe-area-top: 47px; --safe-area-bottom: 34px;';
+</script>
+
+{#snippet phone(content: () => ReturnType<import('svelte').Snippet>)}
+	<div
+		class="relative h-[34rem] w-64 overflow-hidden rounded-[2.5rem] border-4 border-foreground/80 bg-background"
+		style={SIMULATED_INSETS}
+	>
+		{@render content()}
+
+		<!-- the insets, tinted over whatever is drawn under them -->
+		<div
+			class="pointer-events-none absolute inset-x-0 top-0 flex h-(--safe-area-top) items-center justify-center bg-rose-500/20 text-[10px] font-medium text-rose-700 dark:text-rose-300"
+		>
+			status bar · --safe-area-top
+		</div>
+
+		<div
+			class="pointer-events-none absolute inset-x-0 bottom-0 flex h-(--safe-area-bottom) items-center justify-center bg-rose-500/20 text-[10px] font-medium text-rose-700 dark:text-rose-300"
+		>
+			home indicator · --safe-area-bottom
+		</div>
+	</div>
+{/snippet}
+
+{#snippet unpadded()}
+	<div class="flex h-full flex-col justify-between p-4 text-sm">
+		<p class="font-medium">Page title under the status bar</p>
+
+		<p class="text-muted-foreground">Bottom bar over the home indicator</p>
+	</div>
+{/snippet}
+
+{#snippet page()}
+	<div class="flex h-full flex-col justify-between px-4 pt-safe-12 pb-safe-2 text-sm">
+		<p class="font-medium">Page title, 3rem below the status bar</p>
+
+		<p class="rounded-full bg-muted px-3 py-2 text-center text-muted-foreground">
+			Bottom bar, clear of the home indicator
+		</p>
+	</div>
+{/snippet}
+
+{#snippet sheet()}
+	<div class="relative h-full bg-muted/50 px-4 pt-safe text-sm">
+		<p class="pt-2 text-muted-foreground">Type a message...</p>
+
+		<!-- absolute positions ignore the sheet's padding: the control takes its own offset -->
+		<span
+			class="absolute top-safe-2.5 right-2.5 flex size-8 items-center justify-center rounded-full bg-background text-xs shadow-sm"
+		>
+			⤡
+		</span>
+	</div>
+{/snippet}
+
+<Story asChild name="Default">
+	<StateGallery columns={3} minItemWidth="16rem">
+		<StateGalleryItem label="Unpadded" note="what to avoid">
+			{@render phone(unpadded)}
+		</StateGalleryItem>
+
+		<StateGalleryItem label="pt-safe-12 · pb-safe-2" note="a page and its bottom bar">
+			{@render phone(page)}
+		</StateGalleryItem>
+
+		<StateGalleryItem label="pt-safe · top-safe-2.5" note="a sheet that fills the screen">
+			{@render phone(sheet)}
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/helpers/StateGallery.svelte b/ui/apps/chat/tests/stories/helpers/StateGallery.svelte
new file mode 100644
index 000000000..30399e9a0
--- /dev/null
+++ b/ui/apps/chat/tests/stories/helpers/StateGallery.svelte
@@ -0,0 +1,52 @@
+<!--
+	Lays out one component in several visual states side by side, each under a small
+	label. `columns` sets a fixed column count; leave it out to fill the row with
+	cells of at least `minItemWidth`, or of exactly `itemWidth`. Either way a cell
+	narrows to the gallery's width on a narrower screen, one to a row. `width` caps
+	the gallery (72rem by default).
+-->
+<script lang="ts">
+	import type { Snippet } from 'svelte';
+
+	interface Props {
+		children: Snippet;
+		columns?: number;
+		/** a fixed cell width: as many cells to a row as fit, each this wide */
+		itemWidth?: string;
+		minItemWidth?: string;
+		title?: string;
+		width?: string;
+	}
+
+	let {
+		children,
+		columns,
+		itemWidth,
+		minItemWidth = '14rem',
+		title,
+		width = '72rem'
+	}: Props = $props();
+
+	let gridTemplate = $derived(
+		columns
+			? `repeat(${columns}, minmax(0, 1fr))`
+			: itemWidth
+				? `repeat(auto-fill, minmax(min(${itemWidth}, 100%), ${itemWidth}))`
+				: `repeat(auto-fill, minmax(min(${minItemWidth}, 100%), 1fr))`
+	);
+</script>
+
+<section style:width="min({width}, calc(100vw - 2rem))" class="p-4">
+	{#if title}
+		<h2 class="mb-4 text-sm font-medium text-muted-foreground">{title}</h2>
+	{/if}
+
+	<!-- a query container, so a cell can take the gallery's whole width (StateGalleryItem's `full`) -->
+	<div
+		style:container-type="inline-size"
+		style:grid-template-columns={gridTemplate}
+		class="grid items-start gap-x-6 gap-y-8"
+	>
+		{@render children()}
+	</div>
+</section>
diff --git a/ui/apps/chat/tests/stories/helpers/StateGalleryItem.svelte b/ui/apps/chat/tests/stories/helpers/StateGalleryItem.svelte
new file mode 100644
index 000000000..005bea001
--- /dev/null
+++ b/ui/apps/chat/tests/stories/helpers/StateGalleryItem.svelte
@@ -0,0 +1,35 @@
+<!-- One labelled cell of a StateGallery. `span` lets a wide state take several columns, `full` the whole row. -->
+<script lang="ts">
+	import type { Snippet } from 'svelte';
+
+	interface Props {
+		children: Snippet;
+		/** the gallery's whole width, past its columns when they don't fill it */
+		full?: boolean;
+		label: string;
+		note?: string;
+		span?: number;
+	}
+
+	let { children, full = false, label, note, span = 1 }: Props = $props();
+</script>
+
+<figure
+	style:grid-column={full ? '1 / -1' : `span ${span}`}
+	style:width={full ? '100cqw' : undefined}
+	class="m-0 flex min-w-0 flex-col gap-2"
+>
+	<figcaption class="flex items-baseline gap-2 text-[11px] font-medium tracking-wide uppercase">
+		<span class="text-muted-foreground">{label}</span>
+
+		{#if note}
+			<span class="truncate font-normal tracking-normal text-muted-foreground/70 normal-case"
+				>{note}</span
+			>
+		{/if}
+	</figcaption>
+
+	<div class="min-w-0">
+		{@render children()}
+	</div>
+</figure>
diff --git a/ui/apps/chat/tests/stories/introduction/Introduction.stories.svelte b/ui/apps/chat/tests/stories/introduction/Introduction.stories.svelte
new file mode 100644
index 000000000..a0eb2594a
--- /dev/null
+++ b/ui/apps/chat/tests/stories/introduction/Introduction.stories.svelte
@@ -0,0 +1,20 @@
+<script lang="ts" module>
+	import Editorial from '../editorial/Editorial.svelte';
+	import Introduction from './Introduction.svx';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	// the Storybook's front page: what it is for, how we think, how the products fit together and how it is laid out
+	const { Story } = defineMeta({
+		parameters: {
+			controls: { disable: true },
+			layout: 'fullscreen'
+		},
+		title: 'Introduction'
+	});
+</script>
+
+<Story asChild name="Introduction">
+	<Editorial>
+		<Introduction />
+	</Editorial>
+</Story>
diff --git a/ui/apps/chat/tests/stories/introduction/Introduction.svx b/ui/apps/chat/tests/stories/introduction/Introduction.svx
new file mode 100644
index 000000000..ff870aa64
--- /dev/null
+++ b/ui/apps/chat/tests/stories/introduction/Introduction.svx
@@ -0,0 +1,60 @@
+<!--
+	The Storybook's front page (Introduction): in short, what this Storybook is for, how we think, how the products fit
+	together and how the sections are laid out. Written for people first and readable as plain Markdown by agents too.
+	Set in the Editorial.
+-->
+
+<script>
+	import Figure from '../editorial/Figure.svelte';
+	import Principles from './Principles.svelte';
+	import Products from './Products.svelte';
+	import Sections from './Sections.svelte';
+	import Stack from './Stack.svelte';
+	import Uses from './Uses.svelte';
+</script>
+
+<p class="kicker">Llama · Storybook</p>
+
+# Introduction
+
+<p class="lead">This is where <strong>Llama UI</strong> and <strong>Llama Chat</strong> are designed, built and checked. Everything in it is the real component, font or file, so what you see here is what ships. The <strong>Llama Brand</strong> and the communications made with it have their own Storybook, in llama-brand.</p>
+
+## In short
+
+The component library **Llama UI**, built on the **Llama Brand** (the icon, Llama Sans and Llama Mono, the colours), and the app **Llama Chat** built from it, in one place, for the people and agents who design and build Llama products.
+
+<Figure n={1} caption="The building blocks, from the bottom: the Llama Brand, in llama-brand, Llama UI built on it and Llama Chat built from that. The communications are made from the brand and the app, in llama-brand too.">
+	<Stack />
+</Figure>
+
+## What it's for
+
+<Figure n={2} caption="Four uses.">
+	<Uses />
+</Figure>
+
+## How we think
+
+<Figure n={3} caption="Five ideas, each drawn with the real system: the devices a model runs on, the first run's recommendation, the three places the character lives, a control on its grid and one token chain.">
+	<Principles />
+</Figure>
+
+## How it fits together
+
+<Figure n={4} caption="The products and their repositories. llama-brand supplies the brand; llama.cpp holds the engine, Llama UI in ui/lib/ui and Llama Chat in ui/apps/chat, this Storybook's home; the native apps run llama-server and open Llama Chat. llama.app shows models the way Llama Chat does.">
+	<Products />
+</Figure>
+
+Inside Llama UI, the tokens go from primitives to semantic roles to components, in `ui/lib/ui/src/lib/styles/tokens/`, and `DESIGN.md` is generated from them. Llama UI draws the interface and handles interaction; each app owns its own state.
+
+## How it's laid out
+
+<Figure n={5} caption="The sections, in sidebar order.">
+	<Sections />
+</Figure>
+
+## Working in it
+
+- Run it with `npm run storybook` in `ui/apps/chat`.
+- Pages that are mostly prose, like this one, are `.svx`: Markdown with Svelte components in it. `AGENTS.md` says how to write them.
+- Where a guideline and a story disagree, the story is right: it's the real thing.
diff --git a/ui/apps/chat/tests/stories/introduction/Principles.svelte b/ui/apps/chat/tests/stories/introduction/Principles.svelte
new file mode 100644
index 000000000..326b03a6e
--- /dev/null
+++ b/ui/apps/chat/tests/stories/introduction/Principles.svelte
@@ -0,0 +1,228 @@
+<!--
+	How we think, as five tiles, each with a small picture of the idea made from the real system: the devices a model
+	runs on, the first run's recommendation, the three places the character lives, a control on its grid, and one
+	decision through the three token tiers.
+-->
+<script lang="ts">
+	import { PATHS, SIZE } from '../brand/logo-showcase/lib/logo';
+	import { Badge } from '@ggml-org/llama-ui/ui/badge';
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import { Laptop, Lock, Monitor, Smartphone, UserX, WifiOff } from '@lucide/svelte';
+</script>
+
+<div class="principles">
+	<section class="principle wide card-surface rounded-card">
+		<div class="picture">
+			<div class="devices">
+				<Smartphone aria-hidden="true" size={28} />
+
+				<Laptop aria-hidden="true" size={36} />
+
+				<Monitor aria-hidden="true" size={36} />
+			</div>
+
+			<div class="chips">
+				<Badge variant="outline"><WifiOff aria-hidden="true" />Offline</Badge>
+
+				<Badge variant="outline"><UserX aria-hidden="true" />No account</Badge>
+
+				<Badge variant="outline"><Lock aria-hidden="true" />Stays on the device</Badge>
+			</div>
+		</div>
+
+		<h3>Personal, on hardware you already have</h3>
+
+		<p>Private by default, and open to everyone.</p>
+	</section>
+
+	<section class="principle card-surface rounded-card">
+		<div class="picture">
+			<div class="pick rounded-panel bg-surface-lifted elevated-control">
+				<Badge>Recommended</Badge>
+
+				<span class="pick-note">Reads, sees and hears</span>
+
+				<Button size="sm">Download</Button>
+			</div>
+		</div>
+
+		<h3>Simple by default</h3>
+
+		<p>Choices made for you to start; every setting when you want it.</p>
+	</section>
+
+	<section class="principle card-surface rounded-card">
+		<div class="picture character">
+			<svg aria-hidden="true" class="icon" viewBox="0 0 {SIZE} {SIZE}">
+				{#each PATHS as d (d)}<path {d} />{/each}
+			</svg>
+
+			<span class="aa">Aa</span>
+
+			<span aria-hidden="true" class="cinder"></span>
+		</div>
+
+		<h3>Recognisable, easy to change</h3>
+
+		<p>The icon, the type, one accent. The rest is neutral.</p>
+	</section>
+
+	<section class="principle card-surface rounded-card">
+		<div class="picture grid-bg rounded-panel">
+			<Button size="sm" variant="outline">Run</Button>
+		</div>
+
+		<h3>Function first</h3>
+
+		<p>Every element has a job and a reason for its size.</p>
+	</section>
+
+	<section class="principle card-surface rounded-card">
+		<div class="picture chain">
+			<code>--neutral-900</code>
+
+			<span aria-hidden="true">↓</span>
+
+			<code>--action-primary</code>
+
+			<span aria-hidden="true">↓</span>
+
+			<code>--button-primary-background</code>
+		</div>
+
+		<h3>Design lives in code</h3>
+
+		<p>Change a primitive and the rest follows.</p>
+	</section>
+</div>
+
+<style>
+	.principles {
+		display: grid;
+		grid-template-columns: repeat(2, minmax(0, 1fr));
+		gap: 8px;
+	}
+
+	.principle {
+		display: grid;
+		grid-template-rows: auto auto 1fr;
+		gap: 6px;
+		padding: 16px;
+	}
+
+	.wide {
+		grid-column: span 2;
+	}
+
+	.picture {
+		display: grid;
+		place-items: center;
+		min-height: 112px;
+		margin-bottom: 8px;
+	}
+
+	.devices {
+		display: flex;
+		align-items: end;
+		gap: 20px;
+		color: var(--fg-default);
+	}
+
+	.wide .picture {
+		gap: 14px;
+	}
+
+	.chips {
+		display: flex;
+		flex-wrap: wrap;
+		justify-content: center;
+		gap: 6px;
+	}
+
+	.pick {
+		display: grid;
+		justify-items: start;
+		gap: 8px;
+		padding: 12px 14px;
+	}
+
+	.pick-note {
+		color: var(--figure-muted);
+		font-size: 12px;
+	}
+
+	.character {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		gap: 16px;
+	}
+
+	.icon {
+		width: 40px;
+		height: 40px;
+		fill: currentColor;
+	}
+
+	.aa {
+		font-size: 40px;
+		font-weight: 600;
+		line-height: 1;
+	}
+
+	.cinder {
+		width: 18px;
+		height: 18px;
+		border-radius: 50%;
+		background: var(--art-cinder);
+	}
+
+	.grid-bg {
+		background-image:
+			linear-gradient(
+				color-mix(in oklab, var(--line-default) 50%, transparent) 1px,
+				transparent 1px
+			),
+			linear-gradient(
+				90deg,
+				color-mix(in oklab, var(--line-default) 50%, transparent) 1px,
+				transparent 1px
+			);
+		background-position: center;
+		background-size: 8px 8px;
+	}
+
+	.chain {
+		gap: 2px;
+		color: var(--figure-muted);
+		font-size: 12px;
+	}
+
+	.chain code {
+		color: var(--fg-default);
+		font: 500 12px var(--mono);
+	}
+
+	h3 {
+		margin: 0;
+		font-size: 16px;
+		font-weight: 600;
+	}
+
+	p {
+		margin: 0;
+		color: var(--figure-muted);
+		font-size: 13px;
+		line-height: 1.45;
+	}
+
+	@media (width < 640px) {
+		.principles {
+			grid-template-columns: minmax(0, 1fr);
+		}
+
+		.wide {
+			grid-column: auto;
+		}
+	}
+</style>
diff --git a/ui/apps/chat/tests/stories/introduction/Products.svelte b/ui/apps/chat/tests/stories/introduction/Products.svelte
new file mode 100644
index 000000000..88827eb2f
--- /dev/null
+++ b/ui/apps/chat/tests/stories/introduction/Products.svelte
@@ -0,0 +1,343 @@
+<!--
+	How the products and their repositories relate: llama-brand is the source of the brand, llama.cpp holds the engine
+	with Llama UI (ui/lib/ui) and Llama Chat (ui/apps/chat, which the server bundles), and the native apps run the server
+	and open Llama Chat. Checked against the repos: both apps manage a llama-server process and show its built-in web
+	UI, and Llama-Windows is a port of Llama-macOS. Each repo's label starts with the icon, typed as Llama Mono's U+E002
+	(the capital icon with its gap). Two columns on wide screens, one on narrow ones.
+-->
+<script lang="ts">
+	import { Badge } from '@ggml-org/llama-ui/ui/badge';
+</script>
+
+<div class="map">
+	<section class="card card-surface rounded-card brand">
+		<header>
+			<span class="repo">&#xE002;ggml-org/llama-brand</span>
+
+			<span class="source">The source</span>
+		</header>
+
+		<h3>llama-brand</h3>
+
+		<p>The fonts, the logo and the brand files, generated by its own scripts.</p>
+
+		<div class="tags">
+			{#each ['Llama Sans', 'Llama Mono', 'The icon', 'Lockups', 'App icons'] as tag (tag)}
+				<Badge variant="outline">{tag}</Badge>
+			{/each}
+		</div>
+	</section>
+
+	<div class="link down to-cpp">
+		<span class="line"></span>
+
+		<span class="label">The fonts and the icon, copied into <code>ui/lib/ui</code></span>
+	</div>
+
+	<div class="link down to-apps">
+		<span class="line"></span>
+
+		<span class="label">The icon and the app icons</span>
+	</div>
+
+	<section class="card card-surface rounded-card cpp">
+		<header>
+			<span class="repo">&#xE002;ggml-org/llama.cpp</span>
+		</header>
+
+		<h3 class="mono">llama.cpp</h3>
+
+		<div class="parts">
+			<div class="part rounded-panel bg-surface-lifted elevated-control">
+				<span class="part-name">The engine</span>
+
+				<span class="part-note"
+					><code>llama-server</code>: models on your own machine, behind an API</span
+				>
+			</div>
+
+			<div class="part rounded-panel bg-surface-lifted elevated-control">
+				<span class="part-name">Llama UI <span class="arrow">→</span> Llama Chat</span>
+
+				<span class="part-note"
+					><code>ui/lib/ui</code>: the components. <code>ui/apps/chat</code>: the chat client the
+					server bundles</span
+				>
+			</div>
+		</div>
+	</section>
+
+	<div class="link across">
+		<span class="line"></span>
+
+		<span class="label">Run <code>llama-server</code> and open Llama Chat</span>
+	</div>
+
+	<section class="card card-surface rounded-card apps">
+		<header>
+			<span class="repo">&#xE002;The native Llama apps</span>
+		</header>
+
+		<div class="app rounded-panel bg-surface-lifted elevated-control">
+			<h3>Llama for Mac</h3>
+
+			<span class="repo">&#xE002;ggml-org/Llama-macOS</span>
+
+			<span class="part-note">A menu bar app, in Swift</span>
+		</div>
+
+		<div class="app rounded-panel bg-surface-lifted elevated-control">
+			<h3>Llama for Windows</h3>
+
+			<span class="repo">&#xE002;ggml-org/Llama-Windows</span>
+
+			<span class="part-note">A tray app, in WinUI 3 and C#, ported from the Mac app</span>
+		</div>
+	</section>
+</div>
+
+<style>
+	.map {
+		display: grid;
+		grid-template-areas:
+			'brand brand brand'
+			'to-cpp . to-apps'
+			'cpp across apps';
+		grid-template-columns: minmax(0, 1fr) minmax(7rem, 10rem) minmax(0, 1fr);
+	}
+
+	.card {
+		display: grid;
+		gap: 10px;
+		align-content: start;
+		padding: 20px;
+	}
+
+	.brand {
+		grid-area: brand;
+	}
+
+	.cpp {
+		grid-area: cpp;
+	}
+
+	.apps {
+		grid-area: apps;
+	}
+
+	header {
+		display: flex;
+		gap: 8px;
+		align-items: center;
+	}
+
+	.repo {
+		color: var(--figure-muted);
+		font: 500 12px var(--mono);
+	}
+
+	/* the one accent: a cinder dot on the brand's source */
+	.source {
+		display: inline-flex;
+		gap: 6px;
+		align-items: center;
+		margin-left: auto;
+		font: 500 11px var(--mono);
+		letter-spacing: 0.08em;
+		text-transform: uppercase;
+	}
+
+	.source::before {
+		content: '';
+		width: 8px;
+		height: 8px;
+		border-radius: 50%;
+		background: var(--art-cinder);
+	}
+
+	h3 {
+		margin: 0;
+		font-size: 24px;
+		font-weight: 600;
+		line-height: 1.15;
+	}
+
+	h3.mono {
+		font-family: var(--mono);
+		font-size: 22px;
+		font-weight: 700;
+	}
+
+	p {
+		margin: 0;
+		color: var(--figure-muted);
+		font-size: 15px;
+	}
+
+	.tags {
+		display: flex;
+		flex-wrap: wrap;
+		gap: 6px;
+		margin-top: 4px;
+	}
+
+	.parts {
+		display: grid;
+		gap: 8px;
+		margin-top: 4px;
+	}
+
+	.part,
+	.app {
+		display: grid;
+		gap: 4px;
+		padding: 12px 14px;
+	}
+
+	.app h3 {
+		font-size: 18px;
+	}
+
+	.part-name {
+		font-size: 15px;
+		font-weight: 600;
+	}
+
+	.arrow {
+		color: var(--figure-muted);
+		font-weight: 400;
+	}
+
+	.part-note {
+		color: var(--figure-muted);
+		font-size: 13px;
+	}
+
+	code {
+		font: 500 0.92em var(--mono);
+	}
+
+	/* a connector: a hairline with an arrowhead, and its label beside it */
+	.link {
+		position: relative;
+		display: grid;
+		align-items: center;
+	}
+
+	.link .label {
+		color: var(--figure-muted);
+		font-size: 13px;
+		line-height: 1.4;
+	}
+
+	.down {
+		grid-template-columns: 1px 1fr;
+		gap: 12px;
+		min-height: 72px;
+		padding-left: 32px;
+	}
+
+	.down .line,
+	.across .line {
+		position: relative;
+		background: var(--fg-default);
+	}
+
+	.down .line {
+		align-self: stretch;
+	}
+
+	.down .line::after,
+	.across .line::after {
+		content: '';
+		position: absolute;
+		border: 5px solid transparent;
+	}
+
+	.down .line::after {
+		bottom: -1px;
+		left: -5px;
+		border-top: 7px solid var(--fg-default);
+		border-bottom: 0;
+	}
+
+	.to-cpp {
+		grid-area: to-cpp;
+	}
+
+	.to-apps {
+		grid-area: to-apps;
+	}
+
+	/* the apps run the engine: an arrow from the apps back to llama.cpp */
+	.across {
+		grid-area: across;
+		grid-template-rows: auto 1px;
+		gap: 10px;
+		align-content: center;
+		padding-inline: 8px;
+		text-align: center;
+	}
+
+	.across .label {
+		order: -1;
+	}
+
+	.across .line {
+		height: 1px;
+	}
+
+	.across .line::after {
+		top: -5px;
+		left: -1px;
+		border-right: 7px solid var(--fg-default);
+		border-left: 0;
+	}
+
+	@media (width < 720px) {
+		.map {
+			grid-template-areas: 'brand' 'to-cpp' 'cpp' 'across' 'apps' 'to-apps';
+			grid-template-columns: 1fr;
+		}
+
+		/* on one column the apps' arrow points up to llama.cpp, and the brand's second arrow becomes a note under them */
+		.across {
+			grid-template-columns: 1px 1fr;
+			grid-template-rows: none;
+			gap: 12px;
+			min-height: 72px;
+			padding-left: 32px;
+			text-align: left;
+		}
+
+		.across .label {
+			order: 0;
+		}
+
+		.across .line {
+			align-self: stretch;
+			height: auto;
+		}
+
+		.across .line::after {
+			top: -1px;
+			left: -5px;
+			border: 5px solid transparent;
+			border-top: 0;
+			border-bottom: 7px solid var(--fg-default);
+		}
+
+		.to-apps {
+			min-height: 0;
+			padding-top: 12px;
+		}
+
+		.to-apps .line {
+			display: none;
+		}
+
+		.to-apps .label::before {
+			content: 'From llama-brand: ';
+		}
+	}
+</style>
diff --git a/ui/apps/chat/tests/stories/introduction/Sections.svelte b/ui/apps/chat/tests/stories/introduction/Sections.svelte
new file mode 100644
index 000000000..568b5ac19
--- /dev/null
+++ b/ui/apps/chat/tests/stories/introduction/Sections.svelte
@@ -0,0 +1,182 @@
+<!--
+	How this Storybook is laid out, as one column in sidebar order: each section is a stop on a rail, with its icon, what
+	it holds and the pages under it, as in the sidebar. Introduction is marked as where you are, in cinder.
+-->
+<script lang="ts">
+	import { PATHS, SIZE } from '../brand/logo-showcase/lib/logo';
+	import { BookOpen, Bot, LayoutGrid, MessageSquare } from '@lucide/svelte';
+
+	const sections = [
+		{
+			here: true,
+			holds: 'What this is, and how it fits together',
+			icon: BookOpen,
+			name: 'Introduction',
+			pages: []
+		},
+		{
+			holds: 'The rules, for agents',
+			icon: Bot,
+			name: 'Agents',
+			pages: ['Design guidelines']
+		},
+		{
+			holds: 'The library: its foundations, components and Model UI',
+			icon: LayoutGrid,
+			name: 'Llama UI',
+			pages: ['Foundations', 'Components', 'App components', 'Models', 'Mockups']
+		},
+		{
+			holds: 'The app: its screens and the parts they are built from',
+			icon: MessageSquare,
+			name: 'Llama Chat',
+			pages: [
+				'Foundations',
+				'Chat',
+				'Content',
+				'Models',
+				'MCP',
+				'Navigation',
+				'Settings',
+				'Dialogs'
+			]
+		}
+	];
+</script>
+
+<ol class="sections">
+	{#each sections as section (section.name)}
+		<li class="section">
+			<span
+				class={['glyph rounded-control bg-surface-lifted elevated-control', { here: section.here }]}
+			>
+				{#if section.icon}
+					<section.icon aria-hidden="true" size={16} />
+				{:else}
+					<svg aria-hidden="true" class="icon" viewBox="0 0 {SIZE} {SIZE}">
+						{#each PATHS as d (d)}<path {d} />{/each}
+					</svg>
+				{/if}
+			</span>
+
+			<div class="body card-surface rounded-card">
+				<p class="head">
+					<b>{section.name}</b>
+
+					{#if section.here}<span class="you">You are here</span>{/if}
+				</p>
+
+				<p class="holds">{section.holds}</p>
+
+				{#if section.pages.length}
+					<ul class="pages">
+						{#each section.pages as page (page)}
+							<li class="page rounded-control">{page}</li>
+						{/each}
+					</ul>
+				{/if}
+			</div>
+		</li>
+	{/each}
+</ol>
+
+<style>
+	.sections {
+		position: relative;
+		display: grid;
+		gap: 8px;
+		margin: 0;
+		padding: 0;
+		list-style: none;
+	}
+
+	/* the rail the sections sit on, from the first glyph to the last */
+	.sections::before {
+		position: absolute;
+		top: 24px;
+		bottom: 24px;
+		left: 17px;
+		width: 1px;
+		background: var(--line-default);
+		content: '';
+	}
+
+	.section {
+		display: grid;
+		grid-template-columns: 36px minmax(0, 1fr);
+		gap: 12px;
+		align-items: start;
+		margin: 0;
+	}
+
+	.glyph {
+		position: relative;
+		display: grid;
+		place-items: center;
+		width: 36px;
+		height: 36px;
+		margin-top: 8px;
+	}
+
+	.glyph.here {
+		color: var(--art-cinder);
+	}
+
+	.icon {
+		width: 16px;
+		height: 16px;
+		fill: currentColor;
+	}
+
+	.body {
+		display: grid;
+		gap: 4px;
+		padding: 12px 14px;
+	}
+
+	p {
+		margin: 0;
+	}
+
+	.head {
+		display: flex;
+		align-items: baseline;
+		gap: 10px;
+	}
+
+	b {
+		font-size: 15px;
+		font-weight: 600;
+	}
+
+	.you {
+		color: var(--art-cinder);
+		font: 500 11px var(--mono);
+		letter-spacing: 0.06em;
+		text-transform: uppercase;
+	}
+
+	.holds {
+		color: var(--figure-muted);
+		font-size: 13px;
+		line-height: 1.4;
+	}
+
+	.pages {
+		display: flex;
+		flex-wrap: wrap;
+		gap: 4px;
+		margin: 6px 0 0;
+		padding: 0;
+		list-style: none;
+	}
+
+	.page {
+		margin: 0;
+		padding: 2px 8px;
+		border: 1px solid var(--line-default);
+		color: var(--figure-muted);
+		font-size: 12px;
+		line-height: 1.5;
+	}
+</style>
diff --git a/ui/apps/chat/tests/stories/introduction/Stack.svelte b/ui/apps/chat/tests/stories/introduction/Stack.svelte
new file mode 100644
index 000000000..dc0564852
--- /dev/null
+++ b/ui/apps/chat/tests/stories/introduction/Stack.svelte
@@ -0,0 +1,129 @@
+<!--
+	What this Storybook holds, as building blocks: the Llama Brand at the base, Llama UI built on it, Llama Chat built
+	from Llama UI, and the communications made from the brand and the app beside them. Llama Chat, the one people use,
+	carries the cinder mark; the brand carries the icon, typed as Llama Sans's lockup glyph. Beside Llama Chat, a
+	dashed, dimmed slot for the other apps anyone can build on Llama UI.
+-->
+<div class="stack">
+	<div class="block chat card-surface rounded-card">
+		<span class="n">03</span>
+
+		<h3>Llama Chat</h3>
+
+		<p>The app, built from Llama UI</p>
+	</div>
+
+	<div class="block apps rounded-card">
+		<h3>Other apps</h3>
+
+		<p>Yours, built on Llama UI</p>
+	</div>
+
+	<div class="block comms card-surface rounded-card">
+		<h3>Communications</h3>
+
+		<p>Posts, store screenshots, link previews and swag, made from the brand and the app</p>
+	</div>
+
+	<div class="block ui card-surface rounded-card">
+		<span class="n">02</span>
+
+		<h3>Llama UI</h3>
+
+		<p>The components and their tokens</p>
+	</div>
+
+	<div class="block brand card-surface rounded-card">
+		<span class="n">01</span>
+
+		<!-- the lockup glyph, U+E002: Llama Sans's capital icon with the gap before the name built in -->
+		<h3>&#xE002;Llama Brand</h3>
+
+		<p>The icon, Llama Sans and Llama Mono, the colours</p>
+	</div>
+</div>
+
+<style>
+	.stack {
+		display: grid;
+		grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 2fr);
+		grid-template-areas:
+			'chat apps comms'
+			'ui ui comms'
+			'brand brand brand';
+		gap: 8px;
+	}
+
+	.block {
+		display: grid;
+		grid-template-columns: auto minmax(0, 1fr);
+		gap: 4px 12px;
+		align-content: center;
+		align-items: baseline;
+		padding: 16px 20px;
+	}
+
+	.chat {
+		grid-area: chat;
+	}
+
+	.ui {
+		grid-area: ui;
+	}
+
+	/* not one of ours: a slot, dashed and dimmed, for whatever someone builds next */
+	.apps {
+		grid-area: apps;
+		grid-template-columns: minmax(0, 1fr);
+		border: 1.5px dashed color-mix(in oklab, var(--fg-muted) 55%, transparent);
+		opacity: 0.7;
+	}
+
+	.apps p {
+		grid-column: 1;
+	}
+
+	.brand {
+		grid-area: brand;
+	}
+
+	.comms {
+		grid-area: comms;
+		grid-template-columns: minmax(0, 1fr);
+	}
+
+	.n {
+		color: var(--figure-muted);
+		font: 500 12px var(--mono);
+	}
+
+	/* the one accent: the app people use */
+	.chat .n {
+		color: var(--art-cinder);
+	}
+
+	h3 {
+		margin: 0;
+		font-size: 18px;
+		font-weight: 600;
+	}
+
+	p {
+		grid-column: 2;
+		margin: 0;
+		color: var(--figure-muted);
+		font-size: 15px;
+		line-height: 1.45;
+	}
+
+	.comms p {
+		grid-column: 1;
+	}
+
+	@media (max-width: 640px) {
+		.stack {
+			grid-template-columns: minmax(0, 1fr);
+			grid-template-areas: 'chat' 'apps' 'ui' 'brand' 'comms';
+		}
+	}
+</style>
diff --git a/ui/apps/chat/tests/stories/introduction/Uses.svelte b/ui/apps/chat/tests/stories/introduction/Uses.svelte
new file mode 100644
index 000000000..4c10841d7
--- /dev/null
+++ b/ui/apps/chat/tests/stories/introduction/Uses.svelte
@@ -0,0 +1,80 @@
+<!--
+	What this Storybook is for, as four tiles: designing with the real system, building from the components, checking with
+	the accessibility addon and handing over to agents. Each has its icon, its name and one line.
+-->
+<script lang="ts">
+	import { Blocks, CircleCheck, PenTool, Send } from '@lucide/svelte';
+
+	const uses = [
+		{
+			icon: PenTool,
+			line: 'Try a change on the real components and tokens, in both themes',
+			name: 'Designing'
+		},
+		{
+			icon: Blocks,
+			line: 'Look up a component, its states and tokens, light and dark',
+			name: 'Building'
+		},
+		{
+			icon: CircleCheck,
+			line: 'Every story is the real code, checked for accessibility',
+			name: 'Checking'
+		},
+		{
+			icon: Send,
+			line: 'The rules are written for agents in DESIGN.md, from the tokens',
+			name: 'Handing over'
+		}
+	];
+</script>
+
+<div class="uses">
+	{#each uses as use (use.name)}
+		<section class="use card-surface rounded-card">
+			<span class="glyph rounded-control bg-surface-lifted elevated-control">
+				<use.icon aria-hidden="true" size={18} />
+			</span>
+
+			<h3>{use.name}</h3>
+
+			<p>{use.line}</p>
+		</section>
+	{/each}
+</div>
+
+<style>
+	.uses {
+		display: grid;
+		grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
+		gap: 8px;
+	}
+
+	.use {
+		display: grid;
+		gap: 8px;
+		align-content: start;
+		padding: 16px;
+	}
+
+	.glyph {
+		display: grid;
+		place-items: center;
+		width: 36px;
+		height: 36px;
+		margin-bottom: 4px;
+	}
+
+	h3 {
+		margin: 0;
+		font-size: 16px;
+		font-weight: 600;
+	}
+
+	p {
+		margin: 0;
+		color: var(--figure-muted);
+		font-size: 13px;
+		line-height: 1.45;
+	}
+</style>
diff --git a/ui/apps/chat/tests/stories/mcp/McpCapabilitiesBadges.stories.svelte b/ui/apps/chat/tests/stories/mcp/McpCapabilitiesBadges.stories.svelte
new file mode 100644
index 000000000..695c680e1
--- /dev/null
+++ b/ui/apps/chat/tests/stories/mcp/McpCapabilitiesBadges.stories.svelte
@@ -0,0 +1,15 @@
+<script lang="ts" module>
+	import { capabilities } from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import McpCapabilitiesBadges from '#lib/components/app/mcp/McpCapabilitiesBadges.svelte';
+
+	const { Story } = defineMeta({
+		component: McpCapabilitiesBadges,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/MCP/McpCapabilitiesBadges'
+	});
+</script>
+
+<Story args={{ capabilities, onBrowseResources: () => console.log('browse') }} name="Default" />
diff --git a/ui/apps/chat/tests/stories/mcp/McpConnectionLogs.stories.svelte b/ui/apps/chat/tests/stories/mcp/McpConnectionLogs.stories.svelte
new file mode 100644
index 000000000..289afe743
--- /dev/null
+++ b/ui/apps/chat/tests/stories/mcp/McpConnectionLogs.stories.svelte
@@ -0,0 +1,18 @@
+<script lang="ts" module>
+	import { connectionLogs } from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import McpConnectionLogs from '#lib/components/app/mcp/McpConnectionLogs.svelte';
+
+	const { Story } = defineMeta({
+		component: McpConnectionLogs,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/MCP/McpConnectionLogs'
+	});
+</script>
+
+<Story
+	args={{ class: 'w-[32rem]', connectionTimeMs: 301, defaultExpanded: true, logs: connectionLogs }}
+	name="Default"
+/>
diff --git a/ui/apps/chat/tests/stories/mcp/McpServerCard.stories.svelte b/ui/apps/chat/tests/stories/mcp/McpServerCard.stories.svelte
new file mode 100644
index 000000000..bd7c8b218
--- /dev/null
+++ b/ui/apps/chat/tests/stories/mcp/McpServerCard.stories.svelte
@@ -0,0 +1,41 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { seedServerHealth, servers } from './fixtures';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import McpServerCard from '#lib/components/app/mcp/McpServerCard/McpServerCard.svelte';
+
+	const { Story } = defineMeta({
+		component: McpServerCard,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/MCP/McpServerCard'
+	});
+
+	const handlers = {
+		onDelete: () => console.log('delete'),
+		onToggle: (enabled: boolean) => console.log('toggle', enabled),
+		onUpdate: (updates: object) => console.log('update', updates)
+	};
+</script>
+
+<Story asChild beforeEach={seedServerHealth} name="Default">
+	<StateGallery columns={2} minItemWidth="24rem">
+		<StateGalleryItem label="Connected">
+			<McpServerCard {...handlers} enabled server={servers.connected} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Connecting">
+			<McpServerCard {...handlers} enabled server={servers.connecting} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Error">
+			<McpServerCard {...handlers} enabled server={servers.error} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled">
+			<McpServerCard {...handlers} enabled={false} server={servers.disabled} />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/mcp/fixtures.ts b/ui/apps/chat/tests/stories/mcp/fixtures.ts
new file mode 100644
index 000000000..06f39e137
--- /dev/null
+++ b/ui/apps/chat/tests/stories/mcp/fixtures.ts
@@ -0,0 +1,109 @@
+import {
+	HealthCheckStatus,
+	MCPConnectionPhase,
+	MCPLogLevel,
+	MCPTransportType
+} from '#lib/enums/index.ts';
+import { mcpStore } from '#lib/stores/index.ts';
+import type {
+	HealthCheckState,
+	MCPCapabilitiesInfo,
+	MCPConnectionLog,
+	MCPServerSettingsEntry
+} from '#lib/types/index.ts';
+
+const startedAt = new Date('2026-10-29T09:00:00Z');
+const log = (
+	offsetMs: number,
+	phase: MCPConnectionPhase,
+	message: string,
+	level = MCPLogLevel.INFO
+): MCPConnectionLog => ({
+	level,
+	message,
+	phase,
+	timestamp: new Date(startedAt.getTime() + offsetMs)
+});
+
+export const connectionLogs: MCPConnectionLog[] = [
+	log(0, MCPConnectionPhase.TRANSPORT_CREATING, 'Creating streamable HTTP transport'),
+	log(42, MCPConnectionPhase.TRANSPORT_READY, 'Transport ready'),
+	log(118, MCPConnectionPhase.INITIALIZING, 'Sending initialize request'),
+	log(204, MCPConnectionPhase.CAPABILITIES_EXCHANGED, 'Negotiated protocol 2025-06-18'),
+	log(266, MCPConnectionPhase.LISTING_TOOLS, 'Listing tools'),
+	log(301, MCPConnectionPhase.CONNECTED, 'Connected with 3 tools')
+];
+
+export const errorLogs: MCPConnectionLog[] = [
+	log(0, MCPConnectionPhase.TRANSPORT_CREATING, 'Creating streamable HTTP transport'),
+	log(5_000, MCPConnectionPhase.ERROR, 'Request timed out after 5000 ms', MCPLogLevel.ERROR)
+];
+
+export const capabilities: MCPCapabilitiesInfo = {
+	client: { elicitation: { form: true }, roots: { listChanged: true }, sampling: true },
+	server: {
+		completions: true,
+		logging: true,
+		prompts: { listChanged: true },
+		resources: { listChanged: true, subscribe: true },
+		tools: { listChanged: true }
+	}
+};
+
+const server = (id: string, name: string, enabled = true): MCPServerSettingsEntry => ({
+	displayName: name,
+	enabled,
+	id,
+	url: `https://${id}.example.com/mcp`
+});
+
+export const servers = {
+	connected: server('docs', 'Docs search'),
+	connecting: server('files', 'Filesystem'),
+	disabled: server('weather', 'Weather', false),
+	error: server('tracker', 'Issue tracker')
+};
+
+const states: Record<string, HealthCheckState> = {
+	[servers.connected.id]: {
+		capabilities,
+		connectionTimeMs: 301,
+		logs: connectionLogs,
+		protocolVersion: '2025-06-18',
+		serverInfo: { name: 'docs-search', version: '1.4.0' },
+		status: HealthCheckStatus.SUCCESS,
+		tools: [
+			{ description: 'Full text search over the docs', name: 'search_docs' },
+			{ description: 'Fetch one page by path', name: 'get_page' },
+			{ description: 'List the table of contents', name: 'list_sections' }
+		],
+		transportType: MCPTransportType.STREAMABLE_HTTP
+	},
+	[servers.connecting.id]: {
+		logs: connectionLogs.slice(0, 3),
+		phase: MCPConnectionPhase.INITIALIZING,
+		status: HealthCheckStatus.CONNECTING
+	},
+	[servers.error.id]: {
+		logs: errorLogs,
+		message: 'Request timed out after 5000 ms',
+		phase: MCPConnectionPhase.ERROR,
+		status: HealthCheckStatus.ERROR
+	}
+};
+
+// health states normally come from a live probe; the setter is private, so reach it directly
+type HealthAccess = {
+	health: { clear: (id: string) => void; setState: (id: string, state: HealthCheckState) => void };
+};
+
+/** Seeds one health state per fixture server; returns the cleanup. */
+export function seedServerHealth(): () => void {
+	const { health } = mcpStore as unknown as HealthAccess;
+
+	for (const [id, state] of Object.entries(states)) health.setState(id, state);
+
+	return () => {
+		for (const id of Object.keys(states)) health.clear(id);
+	};
+}
diff --git a/ui/apps/chat/tests/stories/misc/CollapsibleSection.stories.svelte b/ui/apps/chat/tests/stories/misc/CollapsibleSection.stories.svelte
new file mode 100644
index 000000000..886612b62
--- /dev/null
+++ b/ui/apps/chat/tests/stories/misc/CollapsibleSection.stories.svelte
@@ -0,0 +1,37 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { CollapsibleSection } from '#lib/components/app/index.ts';
+
+	// the animated show and hide section used by sidebar groups and model lists
+	const { Story } = defineMeta({
+		component: CollapsibleSection,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Misc/CollapsibleSection'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2} minItemWidth="16rem">
+		{#each [true, false] as defaultOpen (defaultOpen)}
+			<StateGalleryItem label={defaultOpen ? 'Open' : 'Closed'}>
+				<CollapsibleSection {defaultOpen}>
+					{#snippet trigger()}
+						<span class="text-label">Pinned</span>
+					{/snippet}
+
+					<ul class="space-y-1 pt-2 text-body-sm text-fg-muted">
+						<li>Explain quantization</li>
+
+						<li>Rust borrow checker notes</li>
+
+						<li>Trip plan for Lisbon</li>
+					</ul>
+				</CollapsibleSection>
+			</StateGalleryItem>
+		{/each}
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/misc/KeyboardShortcutInfo.stories.svelte b/ui/apps/chat/tests/stories/misc/KeyboardShortcutInfo.stories.svelte
new file mode 100644
index 000000000..c9c1dbb8b
--- /dev/null
+++ b/ui/apps/chat/tests/stories/misc/KeyboardShortcutInfo.stories.svelte
@@ -0,0 +1,35 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { KeyboardShortcutInfo } from '#lib/components/app/index.ts';
+
+	// shortcut hints in menus; hidden by default and shown by the row's hover, so forced visible here
+	const { Story } = defineMeta({
+		component: KeyboardShortcutInfo,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Misc/KeyboardShortcutInfo'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={3} minItemWidth="10rem">
+		<StateGalleryItem label="Default">
+			<KeyboardShortcutInfo class="opacity-100" keys={['cmd', 'k']} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="With shift">
+			<KeyboardShortcutInfo class="opacity-100" keys={['shift', 'cmd', 'o']} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Destructive">
+			<KeyboardShortcutInfo
+				class="opacity-100"
+				keys={['shift', 'cmd', 'd']}
+				variant="destructive"
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/a11y/ScrollCarousel.a11y.stories.svelte b/ui/apps/chat/tests/stories/misc/ScrollCarousel.a11y.stories.svelte
similarity index 91%
rename from ui/apps/chat/tests/stories/a11y/ScrollCarousel.a11y.stories.svelte
rename to ui/apps/chat/tests/stories/misc/ScrollCarousel.a11y.stories.svelte
index 0b91f1914..12c777cca 100644
--- a/ui/apps/chat/tests/stories/a11y/ScrollCarousel.a11y.stories.svelte
+++ b/ui/apps/chat/tests/stories/misc/ScrollCarousel.a11y.stories.svelte
@@ -10,7 +10,7 @@
 			layout: 'centered'
 		},
 		tags: ['!dev'],
-		title: 'Components/ScrollCarousel/Accessibility'
+		title: 'Llama Chat/Misc/ScrollCarousel/Accessibility'
 	});
 </script>

@@ -36,9 +36,9 @@
 		<button type="button">before</button>

 		<ScrollCarousel class="w-96" variant={ScrollCarouselVariant.CENTER}>
-			<div class="h-12 w-12 shrink-0 bg-muted"></div>
+			<div class="size-12 shrink-0 bg-muted"></div>

-			<div class="h-12 w-12 shrink-0 bg-muted"></div>
+			<div class="size-12 shrink-0 bg-muted"></div>
 		</ScrollCarousel>

 		<button type="button">after</button>
diff --git a/ui/apps/chat/tests/stories/misc/ScrollCarousel.stories.svelte b/ui/apps/chat/tests/stories/misc/ScrollCarousel.stories.svelte
new file mode 100644
index 000000000..856800ecb
--- /dev/null
+++ b/ui/apps/chat/tests/stories/misc/ScrollCarousel.stories.svelte
@@ -0,0 +1,36 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { ScrollCarousel } from '#lib/components/app/index.ts';
+	import { ScrollCarouselVariant } from '#lib/enums/index.ts';
+
+	// the horizontal scroller behind attachment rows and chat tabs
+	const { Story } = defineMeta({
+		component: ScrollCarousel,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Misc/ScrollCarousel'
+	});
+
+	const items = Array.from({ length: 12 }, (_, index) => index + 1);
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={1}>
+		{#each [ScrollCarouselVariant.TOP, ScrollCarouselVariant.CENTER] as variant (variant)}
+			<StateGalleryItem label={variant} note="arrows always shown">
+				<ScrollCarousel alwaysShowArrows class="w-[min(32rem,calc(100vw-4rem))]" {variant}>
+					{#each items as item (item)}
+						<div
+							class="flex h-16 w-24 shrink-0 items-center justify-center rounded-card border border-line-default bg-surface-muted text-label-sm text-fg-muted"
+						>
+							{item}
+						</div>
+					{/each}
+				</ScrollCarousel>
+			</StateGalleryItem>
+		{/each}
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/misc/TruncatedText.stories.svelte b/ui/apps/chat/tests/stories/misc/TruncatedText.stories.svelte
new file mode 100644
index 000000000..119dbb57c
--- /dev/null
+++ b/ui/apps/chat/tests/stories/misc/TruncatedText.stories.svelte
@@ -0,0 +1,31 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { TruncatedText } from '#lib/components/app/index.ts';
+
+	// one line of text that shows the full value in a tooltip only when it is cut off
+	const { Story } = defineMeta({
+		component: TruncatedText,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Misc/TruncatedText'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2}>
+		<StateGalleryItem label="Fits">
+			<div class="w-56 text-body-sm">
+				<TruncatedText text="qwen3-8b" />
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Truncated" note="hover for the tooltip">
+			<div class="w-56 text-body-sm">
+				<TruncatedText text="unsloth/Meta-Llama-3.1-70B-Instruct-GGUF:Q4_K_M" />
+			</div>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/a11y/ModelsManager.a11y.stories.svelte b/ui/apps/chat/tests/stories/models/ModelsManager.a11y.stories.svelte
similarity index 95%
rename from ui/apps/chat/tests/stories/a11y/ModelsManager.a11y.stories.svelte
rename to ui/apps/chat/tests/stories/models/ModelsManager.a11y.stories.svelte
index d5b116de9..af9fc9b04 100644
--- a/ui/apps/chat/tests/stories/a11y/ModelsManager.a11y.stories.svelte
+++ b/ui/apps/chat/tests/stories/models/ModelsManager.a11y.stories.svelte
@@ -10,7 +10,7 @@
 			layout: 'centered'
 		},
 		tags: ['!dev'],
-		title: 'Components/ModelsManager/Accessibility'
+		title: 'Llama Chat/Models/ModelsManager/Accessibility'
 	});

 	const option: ModelOption = {
diff --git a/ui/apps/chat/tests/stories/ModelsManager.stories.svelte b/ui/apps/chat/tests/stories/models/ModelsManager.stories.svelte
similarity index 82%
rename from ui/apps/chat/tests/stories/ModelsManager.stories.svelte
rename to ui/apps/chat/tests/stories/models/ModelsManager.stories.svelte
index 4f09345f0..c030f3609 100644
--- a/ui/apps/chat/tests/stories/ModelsManager.stories.svelte
+++ b/ui/apps/chat/tests/stories/models/ModelsManager.stories.svelte
@@ -14,7 +14,7 @@
 		parameters: {
 			layout: 'fullscreen'
 		},
-		title: 'Components/ModelsManager'
+		title: 'Llama Chat/Models/ModelsManager'
 	});

 	const option = (model: string, name: string, contextLength?: number): ModelOption => ({
@@ -71,7 +71,7 @@
 	const isFavorite = (picked: ModelOption) => modelsStore.favoriteModelIds.has(picked.model);
 </script>

-<Story name="Manager">
+<Story name="Default">
 	<div class="h-[36rem] bg-background p-4">
 		<ModelsManagerModelsTable
 			groups={[
@@ -86,25 +86,3 @@
 		/>
 	</div>
 </Story>
-
-<Story name="QuantsFolded">
-	<div class="h-[24rem] bg-background p-4">
-		<ModelsManagerModelsTable
-			groups={[section(ModelsTableGroupKind.LOCAL, [repo(qwen, [qwen, qwenQ8])])]}
-			{isFavorite}
-			onSelect={(picked: ModelOption) => (selectedId = picked.id)}
-			{selectedId}
-		/>
-	</div>
-</Story>
-
-<Story name="Empty">
-	<div class="h-[24rem] bg-background p-4">
-		<ModelsManagerModelsTable
-			groups={[]}
-			{isFavorite}
-			onSelect={(picked: ModelOption) => (selectedId = picked.id)}
-			{selectedId}
-		/>
-	</div>
-</Story>
diff --git a/ui/apps/chat/tests/stories/models/ModelsSelector.stories.svelte b/ui/apps/chat/tests/stories/models/ModelsSelector.stories.svelte
new file mode 100644
index 000000000..3aa5c6045
--- /dev/null
+++ b/ui/apps/chat/tests/stories/models/ModelsSelector.stories.svelte
@@ -0,0 +1,98 @@
+<script lang="ts" module>
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ModelsSelectorList from '#lib/components/app/models/ModelsSelector/ModelsSelectorList.svelte';
+	import { modelsStore } from '#lib/stores/models/index.svelte.ts';
+	import type { GroupedModelOptions, ModelItem } from '#lib/utils/index.ts';
+
+	const { Story } = defineMeta({
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Models/ModelsSelector'
+	});
+
+	const mockModel = (id: string, name: string, orgName?: string, tags?: string[]): ModelOption => ({
+		capabilities: [],
+		id,
+		model: orgName ? `${orgName}/${name}` : name,
+		name,
+		parsedId: {
+			activatedParams: null,
+			modelName: name,
+			orgName: orgName ?? null,
+			params: null,
+			quantization: null,
+			raw: orgName ? `${orgName}/${name}` : name,
+			tags: tags ?? []
+		},
+		tags
+	});
+</script>
+
+<script lang="ts">
+	let selectedModel = $state<string | null>(null);
+	let activeId = $state<string | null>(null);
+
+	modelsStore.favoriteModelIds = new Set(['qwen2.5-7b', 'llama3.2-3b']);
+
+	const favoriteModels: ModelItem[] = [
+		{ option: mockModel('qwen2.5-7b', 'Qwen2.5-7B-Instruct', 'Qwen') },
+		{ option: mockModel('llama3.2-3b', 'Llama-3.2-3B-Instruct', 'meta') }
+	];
+
+	const availableModels: ModelItem[] = [
+		{
+			option: mockModel('deepseek-coder-6.7b', 'DeepSeek-Coder-6.7B', 'deepseek', ['coding'])
+		},
+		{ option: mockModel('gemma-2-9b', 'Gemma-2-9B-IT', 'google') },
+		{ option: mockModel('phi-3-mini', 'Phi-3-mini-4k', 'microsoft') },
+		{ option: mockModel('codellama-7b', 'CodeLlama-7B', 'codellama', ['coding']) },
+		{ option: mockModel('neural-chat-7b', 'Neural-Chat-7B-v3-3', 'intel') }
+	];
+
+	const groupedOptions: GroupedModelOptions = {
+		available: [
+			{
+				items: [availableModels[0]],
+				orgName: 'deepseek'
+			},
+			{
+				items: [availableModels[1]],
+				orgName: 'google'
+			},
+			{
+				items: [availableModels[2]],
+				orgName: 'microsoft'
+			},
+			{
+				items: [availableModels[3]],
+				orgName: 'codellama'
+			},
+			{
+				items: [availableModels[4]],
+				orgName: 'intel'
+			}
+		]
+	};
+
+	function handleSelect(modelId: string) {
+		const opt = [...favoriteModels, ...availableModels].find((m) => m.option.id === modelId);
+
+		if (opt) {
+			selectedModel = opt.option.model;
+			activeId = modelId;
+		}
+	}
+</script>
+
+<Story name="Default">
+	<div class="w-80 rounded-xl border matte-float p-1.5">
+		<ModelsSelectorList
+			{activeId}
+			currentModel={selectedModel}
+			favorites={favoriteModels}
+			groups={groupedOptions}
+			onSelect={handleSelect}
+		/>
+	</div>
+</Story>
diff --git a/ui/apps/chat/tests/stories/SidebarNavigation.stories.svelte b/ui/apps/chat/tests/stories/navigation/SidebarNavigation.stories.svelte
similarity index 58%
rename from ui/apps/chat/tests/stories/SidebarNavigation.stories.svelte
rename to ui/apps/chat/tests/stories/navigation/SidebarNavigation.stories.svelte
index a759fe16b..8c4f05ca8 100644
--- a/ui/apps/chat/tests/stories/SidebarNavigation.stories.svelte
+++ b/ui/apps/chat/tests/stories/navigation/SidebarNavigation.stories.svelte
@@ -1,16 +1,14 @@
 <script lang="ts" module>
 	import { defineMeta } from '@storybook/addon-svelte-csf';
 	import SidebarNavigation from '#lib/components/app/navigation/SidebarNavigation/SidebarNavigation.svelte';
-	import { expect } from 'storybook/test';
 	import { waitFor } from 'storybook/test';
-	import { screen } from 'storybook/test';

 	const { Story } = defineMeta({
 		component: SidebarNavigation,
 		parameters: {
 			layout: 'centered'
 		},
-		title: 'Components/SidebarNavigation'
+		title: 'Llama Chat/Navigation/SidebarNavigation'
 	});
 </script>

@@ -67,46 +65,3 @@
 		<SidebarNavigation />
 	</div>
 </Story>
-
-<Story
-	asChild
-	name="SearchActive"
-	play={async ({ userEvent }) => {
-		const { conversationsStore } = await import('#lib/stores/conversations/index.svelte.ts');
-
-		waitFor(() =>
-			setTimeout(() => {
-				conversationsStore.conversations = mockConversations;
-			}, 0)
-		);
-
-		// Expand sidebar first, then click Search in the expanded button list
-		const logoTrigger = screen.getByRole('button', { name: /expand navigation/i });
-
-		await userEvent.click(logoTrigger);
-		const searchTrigger = screen.getByText('Search');
-
-		await userEvent.click(searchTrigger);
-
-		await expect(await screen.findByRole('combobox')).toHaveFocus();
-	}}
->
-	<div class="flex-column h-screen w-72 bg-background">
-		<SidebarNavigation />
-	</div>
-</Story>
-
-<Story
-	asChild
-	name="Empty"
-	play={async () => {
-		// Mock empty conversations store
-		const { conversationsStore } = await import('#lib/stores/conversations/index.svelte.ts');
-
-		conversationsStore.conversations = [];
-	}}
->
-	<div class="flex-column h-screen w-72 bg-background">
-		<SidebarNavigation />
-	</div>
-</Story>
diff --git a/ui/apps/chat/tests/stories/a11y/SidebarNavigationConversationItem.a11y.stories.svelte b/ui/apps/chat/tests/stories/navigation/SidebarNavigationConversationItem.a11y.stories.svelte
similarity index 92%
rename from ui/apps/chat/tests/stories/a11y/SidebarNavigationConversationItem.a11y.stories.svelte
rename to ui/apps/chat/tests/stories/navigation/SidebarNavigationConversationItem.a11y.stories.svelte
index b607b4ff0..349013fce 100644
--- a/ui/apps/chat/tests/stories/a11y/SidebarNavigationConversationItem.a11y.stories.svelte
+++ b/ui/apps/chat/tests/stories/navigation/SidebarNavigationConversationItem.a11y.stories.svelte
@@ -17,7 +17,7 @@
 			layout: 'centered'
 		},
 		tags: ['!dev'],
-		title: 'Components/SidebarNavigationConversationItem/Accessibility'
+		title: 'Llama Chat/Navigation/SidebarNavigationConversationItem/Accessibility'
 	});
 </script>

diff --git a/ui/apps/chat/tests/stories/pace.ts b/ui/apps/chat/tests/stories/pace.ts
new file mode 100644
index 000000000..c042f4d51
--- /dev/null
+++ b/ui/apps/chat/tests/stories/pace.ts
@@ -0,0 +1,37 @@
+import { userEvent } from 'storybook/test';
+
+/** Toolbar values of the `interactionPace` global, see .storybook/preview.ts. */
+export enum InteractionPace {
+	HUMAN = 'human',
+	INSTANT = 'instant'
+}
+
+export interface Pace {
+	/** Delay between streamed reply chunks of a fake server. */
+	streamChunkMs: number;
+	/** Waits before the next action, as if reading the screen first. */
+	pause: (ms?: number) => Promise<void>;
+	/** A user-event instance that types key by key at the chosen pace. */
+	user: ReturnType<typeof userEvent.setup>;
+}
+
+// the test runner drives a Playwright browser, which always plays stories at full speed
+const isTestRun = typeof navigator !== 'undefined' && navigator.webdriver;
+const HUMAN = { beforeActionMs: 900, streamChunkMs: 110, typingMs: 55 };
+const INSTANT = { beforeActionMs: 0, streamChunkMs: 30, typingMs: 0 };
+
+/**
+ * Pace for a story's `beforeEach` or `play`: human in the Storybook UI (unless the
+ * toolbar says instant), instant in the test suite.
+ */
+export function getPace(context: { globals?: Record<string, unknown> }): Pace {
+	const human = !isTestRun && context.globals?.interactionPace !== InteractionPace.INSTANT;
+	const timings = human ? HUMAN : INSTANT;
+
+	return {
+		pause: (ms = timings.beforeActionMs) =>
+			ms > 0 ? new Promise((resolve) => setTimeout(resolve, ms)) : Promise.resolve(),
+		streamChunkMs: timings.streamChunkMs,
+		user: userEvent.setup({ delay: timings.typingMs })
+	};
+}
diff --git a/ui/apps/chat/tests/stories/pwa/PwaRefreshAlert.stories.svelte b/ui/apps/chat/tests/stories/pwa/PwaRefreshAlert.stories.svelte
new file mode 100644
index 000000000..85d574104
--- /dev/null
+++ b/ui/apps/chat/tests/stories/pwa/PwaRefreshAlert.stories.svelte
@@ -0,0 +1,31 @@
+<script lang="ts" module>
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import PwaRefreshAlert from '#lib/components/pwa/PwaRefreshAlert.svelte';
+	import { expect } from 'storybook/test';
+
+	const { Story } = defineMeta({
+		component: PwaRefreshAlert,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/PWA/PwaRefreshAlert'
+	});
+</script>
+
+<Story
+	args={{ needRefresh: true, updateServiceWorker: () => console.log('reload') }}
+	name="Default"
+	play={async ({ canvas }) => {
+		const title = canvas.getByText('Update available');
+
+		await expect(title).toBeInTheDocument();
+
+		const description = canvas.getByText(/A new version is available/);
+
+		await expect(description).toBeInTheDocument();
+
+		const button = canvas.getByRole('button', { name: 'Reload' });
+
+		await expect(button).toBeInTheDocument();
+	}}
+/>
diff --git a/ui/apps/chat/tests/stories/servers/ServerSplash.stories.svelte b/ui/apps/chat/tests/stories/servers/ServerSplash.stories.svelte
new file mode 100644
index 000000000..6b34ae952
--- /dev/null
+++ b/ui/apps/chat/tests/stories/servers/ServerSplash.stories.svelte
@@ -0,0 +1,31 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import ServerErrorSplash from '#lib/components/app/servers/ServerErrorSplash.svelte';
+	import ServerLoadingSplash from '#lib/components/app/servers/ServerLoadingSplash.svelte';
+
+	// the loading and error splashes are the two screens shown before the app connects
+	const { Story } = defineMeta({
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama Chat/Servers/ServerSplash'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2}>
+		<StateGalleryItem label="Loading">
+			<ServerLoadingSplash class="h-96" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Error">
+			<ServerErrorSplash
+				class="h-96"
+				error="Failed to fetch: the server at localhost:9931 is not reachable"
+				onRetry={() => console.log('retry')}
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/apps/chat/tests/stories/settings/DialogSettingsChat.stories.svelte b/ui/apps/chat/tests/stories/settings/DialogSettingsChat.stories.svelte
new file mode 100644
index 000000000..eac7c7410
--- /dev/null
+++ b/ui/apps/chat/tests/stories/settings/DialogSettingsChat.stories.svelte
@@ -0,0 +1,26 @@
+<script lang="ts" module>
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import DialogSettingsChat from '#lib/components/app/dialogs/DialogSettingsChat.svelte';
+
+	// the whole settings dialog; each section has its own story under Settings/Sections
+	const { Story } = defineMeta({
+		component: DialogSettingsChat,
+		parameters: {
+			layout: 'fullscreen'
+		},
+		title: 'Llama Chat/Settings/DialogSettingsChat'
+	});
+</script>
+
+<Story
+	args={{ initialSection: 'general', open: true }}
+	globals={{ viewport: { isRotated: false, value: 'desktop' } }}
+	name="Desktop"
+/>
+
+<!-- full screen, with the sections in a scrolling row under the title -->
+<Story
+	args={{ initialSection: 'general', open: true }}
+	globals={{ viewport: { isRotated: false, value: 'mobile2' } }}
+	name="Mobile"
+/>
diff --git a/ui/apps/chat/tests/stories/settings/SettingsNavigation.stories.svelte b/ui/apps/chat/tests/stories/settings/SettingsNavigation.stories.svelte
new file mode 100644
index 000000000..0aa3d9727
--- /dev/null
+++ b/ui/apps/chat/tests/stories/settings/SettingsNavigation.stories.svelte
@@ -0,0 +1,34 @@
+<script lang="ts" module>
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import {
+		SettingsChatDesktopSidebar,
+		SettingsChatMobileHeader
+	} from '#lib/components/app/settings/index.ts';
+	import { SETTINGS_CHAT_SECTIONS } from '#lib/constants/index.ts';
+	import type { SettingsSection, SettingsSectionTitle } from '#lib/types/index.ts';
+
+	// the settings section switcher: a sidebar list from md up, a scrolling row below it
+	const { Story } = defineMeta({
+		title: 'Llama Chat/Settings/Navigation'
+	});
+</script>
+
+<script lang="ts">
+	let activeTitle: SettingsSectionTitle = $state(SETTINGS_CHAT_SECTIONS[0].title);
+
+	const isActive = (section: SettingsSection) => section.title === activeTitle;
+	const onSectionChange = (title: SettingsSectionTitle) => (activeTitle = title);
+</script>
+
+<Story asChild globals={{ viewport: { isRotated: false, value: 'desktop' } }} name="Desktop">
+	<SettingsChatDesktopSidebar {isActive} {onSectionChange} sections={SETTINGS_CHAT_SECTIONS} />
+</Story>
+
+<Story
+	asChild
+	globals={{ viewport: { isRotated: false, value: 'mobile2' } }}
+	name="Mobile"
+	parameters={{ layout: 'fullscreen' }}
+>
+	<SettingsChatMobileHeader {isActive} {onSectionChange} sections={SETTINGS_CHAT_SECTIONS} />
+</Story>
diff --git a/ui/apps/chat/tests/stories/settings/SettingsSections.stories.svelte b/ui/apps/chat/tests/stories/settings/SettingsSections.stories.svelte
new file mode 100644
index 000000000..24b2c5c13
--- /dev/null
+++ b/ui/apps/chat/tests/stories/settings/SettingsSections.stories.svelte
@@ -0,0 +1,34 @@
+<script lang="ts" module>
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import DialogSettingsChat from '#lib/components/app/dialogs/DialogSettingsChat.svelte';
+	import { SETTINGS_SECTIONS } from '#lib/constants/index.ts';
+
+	// one story per settings section, each opening the dialog on that section
+	const { Story } = defineMeta({
+		component: DialogSettingsChat,
+		parameters: {
+			layout: 'fullscreen'
+		},
+		title: 'Llama Chat/Settings/Sections'
+	});
+</script>
+
+<Story args={{ initialSection: SETTINGS_SECTIONS.GENERAL.slug, open: true }} name="General" />
+
+<Story args={{ initialSection: SETTINGS_SECTIONS.DISPLAY.slug, open: true }} name="Display" />
+
+<Story args={{ initialSection: SETTINGS_SECTIONS.TOOLS.slug, open: true }} name="Tools" />
+
+<Story args={{ initialSection: SETTINGS_SECTIONS.AGENTIC.slug, open: true }} name="Agentic" />
+
+<Story
+	args={{ initialSection: SETTINGS_SECTIONS.IMPORT_EXPORT.slug, open: true }}
+	name="Import/Export"
+/>
+
+<Story
+	args={{ initialSection: SETTINGS_SECTIONS.SAMPLING_PENALTIES.slug, open: true }}
+	name="Sampling & Penalties"
+/>
+
+<Story args={{ initialSection: SETTINGS_SECTIONS.DEVELOPER.slug, open: true }} name="Developer" />
diff --git a/ui/apps/chat/tests/stories/svx.d.ts b/ui/apps/chat/tests/stories/svx.d.ts
new file mode 100644
index 000000000..88dce6044
--- /dev/null
+++ b/ui/apps/chat/tests/stories/svx.d.ts
@@ -0,0 +1,6 @@
+// .svx pages (mdsvex) import as Svelte components
+declare module '*.svx' {
+	import type { Component } from 'svelte';
+	const page: Component;
+	export default page;
+}
diff --git a/ui/apps/chat/vite.config.ts b/ui/apps/chat/vite.config.ts
index 7f24f5963..cf88572a9 100644
--- a/ui/apps/chat/vite.config.ts
+++ b/ui/apps/chat/vite.config.ts
@@ -129,6 +129,8 @@ export default defineConfig(({ mode }) => {
 					],
 					test: {
 						browser: { ...browserBaseConfig, instances: [{ browser: 'chromium', headless: true }] },
+						// Llama UI's stories, shown in this Storybook too, are tested by the library itself (ui/lib/ui)
+						exclude: ['../../lib/ui/tests/**'],
 						name: 'ui'
 					}
 				}
diff --git a/ui/lib/ui/.gitignore b/ui/lib/ui/.gitignore
index cd8a373ca..1409f221a 100644
--- a/ui/lib/ui/.gitignore
+++ b/ui/lib/ui/.gitignore
@@ -24,3 +24,5 @@ vite.config.js.timestamp-*
 vite.config.ts.timestamp-*
 .vitest/

+*storybook.log
+storybook-static
diff --git a/ui/lib/ui/.storybook/color-scheme.ts b/ui/lib/ui/.storybook/color-scheme.ts
new file mode 100644
index 000000000..3b5feab66
--- /dev/null
+++ b/ui/lib/ui/.storybook/color-scheme.ts
@@ -0,0 +1,12 @@
+/**
+ * Sets the `dark` class from the saved mode-watcher mode, or the system preference
+ * when there is none. Docs pages render no story, so preview.ts calls this too.
+ */
+export function applyColorScheme() {
+	const mode = localStorage.getItem('mode-watcher-mode') || 'system';
+	const isDark =
+		mode === 'dark' ||
+		(mode === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
+
+	document.documentElement.classList.toggle('dark', isDark);
+}
diff --git a/ui/lib/ui/.storybook/decorators/ModeWatcherDecorator.svelte b/ui/lib/ui/.storybook/decorators/ModeWatcherDecorator.svelte
new file mode 100644
index 000000000..a20701dd6
--- /dev/null
+++ b/ui/lib/ui/.storybook/decorators/ModeWatcherDecorator.svelte
@@ -0,0 +1,26 @@
+<script lang="ts">
+	import { ModeWatcher } from 'mode-watcher';
+	import { onMount } from 'svelte';
+	import { applyColorScheme } from '../color-scheme';
+
+	interface Props {
+		children?: any;
+		/** a mode the story is always shown in, rather than the viewer's */
+		forced?: 'dark' | 'light';
+	}
+
+	let { children, forced }: Props = $props();
+
+	onMount(() => {
+		if (forced) document.documentElement.classList.toggle('dark', forced === 'dark');
+		else applyColorScheme();
+	});
+</script>
+
+{#if !forced}<ModeWatcher />{/if}
+
+{#if children}
+	{@const Component = children}
+
+	<Component />
+{/if}
diff --git a/ui/lib/ui/.storybook/decorators/TooltipProviderDecorator.svelte b/ui/lib/ui/.storybook/decorators/TooltipProviderDecorator.svelte
new file mode 100644
index 000000000..ba0cabc56
--- /dev/null
+++ b/ui/lib/ui/.storybook/decorators/TooltipProviderDecorator.svelte
@@ -0,0 +1,13 @@
+<script lang="ts">
+	import * as Tooltip from '../../src/lib/components/ui/tooltip';
+
+	interface Props {
+		children: any;
+	}
+
+	let { children }: Props = $props();
+</script>
+
+<Tooltip.Provider>
+	{@render children()}
+</Tooltip.Provider>
diff --git a/ui/lib/ui/.storybook/docs.css b/ui/lib/ui/.storybook/docs.css
new file mode 100644
index 000000000..4a2f1facc
--- /dev/null
+++ b/ui/lib/ui/.storybook/docs.css
@@ -0,0 +1,91 @@
+@reference '../src/app.css';
+
+/*
+ * MDX pages that wrap their content in <Unstyled><div className="ds-docs"> drop
+ * Storybook's docs theme and take colours, font and type roles from the design system.
+ */
+.sbdocs-wrapper:has(.ds-docs) {
+	background: var(--surface-page);
+}
+
+.ds-docs {
+	@apply mx-auto max-w-3xl font-sans text-body text-fg-default;
+
+	& :where(h1) {
+		@apply mb-4 text-heading;
+	}
+
+	& :where(h2) {
+		@apply mt-10 mb-3 border-b border-line-default pb-2 text-title;
+	}
+
+	& :where(h3) {
+		@apply mt-6 mb-2 text-body font-semibold;
+	}
+
+	& :where(h4, h5, h6) {
+		@apply mt-4 mb-2 text-label;
+	}
+
+	& :where(p, ul, ol, blockquote, table, pre) {
+		@apply my-3;
+	}
+
+	& :where(ul) {
+		@apply list-disc pl-6;
+	}
+
+	& :where(ol) {
+		@apply list-decimal pl-6;
+	}
+
+	& :where(li) {
+		@apply my-1;
+	}
+
+	& :where(strong) {
+		@apply font-semibold;
+	}
+
+	& :where(a) {
+		@apply underline underline-offset-2 hover:text-fg-muted;
+	}
+
+	& :where(blockquote) {
+		@apply border-l-2 border-line-default pl-4 text-fg-muted;
+	}
+
+	/* a note that stands out from the running text: a quiet panel with the accent on its edge */
+	& :where(.callout) {
+		@apply my-6 rounded-panel border-l-2 border-(--art-cinder) bg-surface-muted px-5 py-4;
+
+		& > :where(p) {
+			@apply my-0;
+		}
+	}
+
+	& :where(hr) {
+		@apply my-8 border-line-default;
+	}
+
+	/* inline code only, with a selector that outranks the code the Markdown block renders */
+	& :not(pre) > code {
+		@apply rounded-control border-0 bg-surface-code px-1 py-0.5 font-mono text-[0.875em] text-(--fg-code);
+	}
+
+	& :where(pre) {
+		@apply overflow-x-auto rounded-panel bg-surface-code p-4 text-body-sm;
+	}
+
+	& :where(table) {
+		@apply w-full border-collapse text-body-sm;
+	}
+
+	& :where(th, td) {
+		@apply border-b border-line-default px-3 py-2 text-left align-top;
+	}
+
+	& :where(th) {
+		@apply text-label;
+	}
+}
diff --git a/ui/lib/ui/.storybook/main.ts b/ui/lib/ui/.storybook/main.ts
new file mode 100644
index 000000000..b02ecc5d5
--- /dev/null
+++ b/ui/lib/ui/.storybook/main.ts
@@ -0,0 +1,25 @@
+import type { StorybookConfig } from '@storybook/sveltekit';
+import { dirname, resolve } from 'path';
+import { fileURLToPath } from 'url';
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+
+const config: StorybookConfig = {
+	stories: ['../tests/stories/**/*.mdx', '../tests/stories/**/*.stories.@(js|ts|svelte)'],
+	addons: [
+		'@storybook/addon-svelte-csf',
+		'@chromatic-com/storybook',
+		'@storybook/addon-vitest',
+		'@storybook/addon-a11y',
+		'@storybook/addon-docs',
+		'@storybook/addon-mcp'
+	],
+	framework: '@storybook/sveltekit',
+	viteFinal: async (config) => {
+		config.server = config.server || {};
+		config.server.fs = config.server.fs || {};
+		config.server.fs.allow = [...(config.server.fs.allow || []), resolve(__dirname, '../tests')];
+		return config;
+	}
+};
+export default config;
diff --git a/ui/lib/ui/.storybook/preview.ts b/ui/lib/ui/.storybook/preview.ts
new file mode 100644
index 000000000..9994a5554
--- /dev/null
+++ b/ui/lib/ui/.storybook/preview.ts
@@ -0,0 +1,92 @@
+import type { Preview } from '@storybook/sveltekit';
+import '../src/app.css';
+import './docs.css';
+import { applyColorScheme } from './color-scheme';
+import ModeWatcherDecorator from './decorators/ModeWatcherDecorator.svelte';
+import TooltipProviderDecorator from './decorators/TooltipProviderDecorator.svelte';
+
+applyColorScheme();
+window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', applyColorScheme);
+
+const preview: Preview = {
+	parameters: {
+		controls: {
+			matchers: {
+				color: /(background|color)$/i,
+				date: /Date$/i
+			}
+		},
+
+		backgrounds: {
+			disabled: true
+		},
+
+		options: {
+			// the package's own sections, in the order Llama Chat's Storybook (ui/apps/chat) shows them under Llama UI:
+			// the foundations, the base components, the app components, then the Model UI and the mockups
+			storySort: {
+				order: [
+					'Introduction',
+					'Llama UI',
+					[
+						'Foundations',
+						['Colors', 'Typography', 'Sizing', 'Shapes', 'Elevation', 'Surfaces'],
+						'Components',
+						['Actions', 'Forms', 'Display', 'Overlays', 'Navigation'],
+						'App components',
+						'Models',
+						'Mockups'
+					]
+				]
+			}
+		},
+
+		a11y: {
+			// 'todo' - show a11y violations in the test UI only
+			// 'error' - fail CI on a11y violations
+			// 'off' - skip a11y checks entirely
+			test: 'todo'
+		}
+	},
+	globalTypes: {
+		// the light surface theme: Paper (white panels on a grey page) or Matte (grey glass on white)
+		surface: {
+			description: 'Light surface theme',
+			toolbar: {
+				dynamicTitle: true,
+				icon: 'paintbrush',
+				items: [
+					{ title: 'Paper', value: 'paper' },
+					{ title: 'Matte', value: 'matte' }
+				],
+				title: 'Surface'
+			}
+		}
+	},
+	initialGlobals: {
+		surface: 'paper'
+	},
+	decorators: [
+		(story, context) => {
+			document.documentElement.classList.toggle('theme-matte', context.globals.surface === 'matte');
+
+			return story();
+		},
+		// `parameters.colorScheme` fixes a story to light or dark, whatever the viewer chose (a scene in a store screenshot)
+		(story, context) => ({
+			Component: ModeWatcherDecorator,
+			props: {
+				children: story,
+				forced: context.parameters.colorScheme
+			}
+		}),
+		(story) => ({
+			Component: TooltipProviderDecorator,
+			props: {
+				children: story
+			}
+		})
+	]
+};
+
+export default preview;
diff --git a/ui/lib/ui/README.md b/ui/lib/ui/README.md
index 7aee651c7..2c701d8a6 100644
--- a/ui/lib/ui/README.md
+++ b/ui/lib/ui/README.md
@@ -67,7 +67,9 @@ shows in the app at once and the app keeps no copy of a component or a token. Fo

 ## Development

-- `npm run dev`: a small SvelteKit check page (`src/routes`)
+- `npm run storybook`: the package's Storybook, with a story for everything it holds; the stories run as tests in
+  `npm test`, and Llama Chat's Storybook (in `ui/apps/chat`) shows them under Llama UI
+- `npm run dev`: Storybook and a small SvelteKit check page (`src/routes`)
 - `npm run check`: svelte-check
 - `npm run prepack`: build the library into `dist/` and run publint
 - `node scripts/npm-version-check.mjs`: what the release workflow would make of this folder, against the real registry
diff --git a/ui/lib/ui/package-lock.json b/ui/lib/ui/package-lock.json
index 1a88b0fa6..e202661ec 100644
--- a/ui/lib/ui/package-lock.json
+++ b/ui/lib/ui/package-lock.json
@@ -20,6 +20,13 @@
 				"vaul-svelte": "1.0.0-next.7"
 			},
 			"devDependencies": {
+				"@chromatic-com/storybook": "^5.5.1",
+				"@storybook/addon-a11y": "^10.6.2",
+				"@storybook/addon-docs": "^10.6.2",
+				"@storybook/addon-mcp": "10.6.2",
+				"@storybook/addon-svelte-csf": "^5.1.5",
+				"@storybook/addon-vitest": "^10.6.2",
+				"@storybook/sveltekit": "^10.6.2",
 				"@sveltejs/adapter-auto": "^8.0.0",
 				"@sveltejs/kit": "^3.0.0",
 				"@sveltejs/package": "^2.5.8",
@@ -28,9 +35,11 @@
 				"@types/node": "^24",
 				"@vitest/browser-playwright": "5.0.5",
 				"@vitest/coverage-v8": "5.0.5",
+				"mdsvex": "0.12.7",
 				"mode-watcher": "^1.1.0",
 				"playwright": "^1.60.0",
 				"publint": "^0.3.21",
+				"storybook": "^10.6.2",
 				"svelte": "^5.57.1",
 				"svelte-check": "^4.6.0",
 				"tailwindcss": "^4.3.3",
@@ -48,6 +57,13 @@
 				"tw-animate-css": "^1.4.0"
 			}
 		},
+		"node_modules/@adobe/css-tools": {
+			"version": "4.5.0",
+			"resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.5.0.tgz",
+			"integrity": "sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/@babel/code-frame": {
 			"version": "7.29.7",
 			"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
@@ -140,124 +156,1362 @@
 			"dev": true,
 			"license": "MIT"
 		},
-		"node_modules/@floating-ui/core": {
-			"version": "1.8.0",
-			"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz",
-			"integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==",
+		"node_modules/@chromatic-com/storybook": {
+			"version": "5.5.1",
+			"resolved": "https://registry.npmjs.org/@chromatic-com/storybook/-/storybook-5.5.1.tgz",
+			"integrity": "sha512-DOtUEBIJHmqsOWg+Hi1t5m5FTNlyzL0NpZUwQob+ex30nDvL4p+MrYctmvEqH/QT72mf9mLXbz3Uj8aoWD2OYA==",
+			"dev": true,
 			"license": "MIT",
 			"dependencies": {
-				"@floating-ui/utils": "^0.2.12"
+				"@neoconfetti/react": "^1.0.0",
+				"chromatic": "^18.0.1",
+				"jsonfile": "^6.1.0",
+				"strip-ansi": "^7.1.0"
+			},
+			"engines": {
+				"node": ">=20.0.0",
+				"yarn": ">=1.22.18"
+			},
+			"peerDependencies": {
+				"storybook": "^0.0.0-0 || ^10.1.0 || ^10.1.0-0 || ^10.2.0-0 || ^10.3.0-0 || ^10.4.0-0 || ^10.5.0-0 || ^10.6.0-0 || ^11.0.0-0"
 			}
 		},
-		"node_modules/@floating-ui/dom": {
-			"version": "1.8.0",
-			"resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.8.0.tgz",
-			"integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==",
+		"node_modules/@emnapi/core": {
+			"version": "1.9.2",
+			"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.2.tgz",
+			"integrity": "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==",
+			"dev": true,
 			"license": "MIT",
+			"optional": true,
 			"dependencies": {
-				"@floating-ui/core": "^1.8.0",
-				"@floating-ui/utils": "^0.2.12"
+				"@emnapi/wasi-threads": "1.2.1",
+				"tslib": "^2.4.0"
 			}
 		},
-		"node_modules/@floating-ui/utils": {
-			"version": "0.2.12",
-			"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.12.tgz",
-			"integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==",
-			"license": "MIT"
-		},
-		"node_modules/@ggml-org/llama-brand": {
-			"version": "0.1.0",
-			"resolved": "https://codeload.github.com/ggml-org/llama-brand/tar.gz/f05540643c1ca2a18d732ed6491c839686da9a3a",
-			"integrity": "sha512-kRDXUIUdfcDt7w4hh3JrFTpqxf2i7R0PHVLGnwUdr4L8EMqE32mEECoXUz1uoUlFaQ+h6QaVHvJWS5y98AoaYA==",
-			"license": "CC-BY-NC-4.0"
-		},
-		"node_modules/@internationalized/date": {
-			"version": "3.12.4",
-			"resolved": "https://registry.npmjs.org/@internationalized/date/-/date-3.12.4.tgz",
-			"integrity": "sha512-M1dEn4c1U1HsSlaVR8upZtSqvXrTkHDfv18H01uCSJyjVLDxnBR38v/fMxecmlwXKR4i9HeZcmgQAPE6A+aGJQ==",
-			"license": "Apache-2.0",
+		"node_modules/@emnapi/runtime": {
+			"version": "1.9.2",
+			"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.2.tgz",
+			"integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==",
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
 			"dependencies": {
-				"@swc/helpers": "^0.5.0"
+				"tslib": "^2.4.0"
 			}
 		},
-		"node_modules/@jridgewell/gen-mapping": {
-			"version": "0.3.13",
-			"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
-			"integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
+		"node_modules/@emnapi/wasi-threads": {
+			"version": "1.2.1",
+			"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz",
+			"integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==",
 			"dev": true,
 			"license": "MIT",
+			"optional": true,
 			"dependencies": {
-				"@jridgewell/sourcemap-codec": "^1.5.0",
-				"@jridgewell/trace-mapping": "^0.3.24"
+				"tslib": "^2.4.0"
 			}
 		},
-		"node_modules/@jridgewell/remapping": {
-			"version": "2.3.5",
-			"resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",
-			"integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",
+		"node_modules/@esbuild/aix-ppc64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz",
+			"integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==",
+			"cpu": [
+				"ppc64"
+			],
 			"dev": true,
 			"license": "MIT",
-			"dependencies": {
-				"@jridgewell/gen-mapping": "^0.3.5",
-				"@jridgewell/trace-mapping": "^0.3.24"
+			"optional": true,
+			"os": [
+				"aix"
+			],
+			"engines": {
+				"node": ">=18"
 			}
 		},
-		"node_modules/@jridgewell/resolve-uri": {
-			"version": "3.1.2",
-			"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
-			"integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+		"node_modules/@esbuild/android-arm": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz",
+			"integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==",
+			"cpu": [
+				"arm"
+			],
 			"dev": true,
 			"license": "MIT",
+			"optional": true,
+			"os": [
+				"android"
+			],
 			"engines": {
-				"node": ">=6.0.0"
+				"node": ">=18"
 			}
 		},
-		"node_modules/@jridgewell/sourcemap-codec": {
-			"version": "1.6.0",
-			"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",
-			"integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",
+		"node_modules/@esbuild/android-arm64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz",
+			"integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==",
+			"cpu": [
+				"arm64"
+			],
 			"dev": true,
-			"license": "MIT"
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"android"
+			],
+			"engines": {
+				"node": ">=18"
+			}
 		},
-		"node_modules/@jridgewell/trace-mapping": {
-			"version": "0.3.31",
-			"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
-			"integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
+		"node_modules/@esbuild/android-x64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz",
+			"integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"android"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/darwin-arm64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz",
+			"integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"darwin"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/darwin-x64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz",
+			"integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"darwin"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/freebsd-arm64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz",
+			"integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"freebsd"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/freebsd-x64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz",
+			"integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"freebsd"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/linux-arm": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz",
+			"integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==",
+			"cpu": [
+				"arm"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/linux-arm64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz",
+			"integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/linux-ia32": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz",
+			"integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==",
+			"cpu": [
+				"ia32"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/linux-loong64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz",
+			"integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==",
+			"cpu": [
+				"loong64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/linux-mips64el": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz",
+			"integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==",
+			"cpu": [
+				"mips64el"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/linux-ppc64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz",
+			"integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==",
+			"cpu": [
+				"ppc64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/linux-riscv64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz",
+			"integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==",
+			"cpu": [
+				"riscv64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/linux-s390x": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz",
+			"integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==",
+			"cpu": [
+				"s390x"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/linux-x64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz",
+			"integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/netbsd-arm64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz",
+			"integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"netbsd"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/netbsd-x64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz",
+			"integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"netbsd"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/openbsd-arm64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz",
+			"integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"openbsd"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/openbsd-x64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz",
+			"integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"openbsd"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/openharmony-arm64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz",
+			"integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"openharmony"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/sunos-x64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz",
+			"integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"sunos"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/win32-arm64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz",
+			"integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"win32"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/win32-ia32": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz",
+			"integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==",
+			"cpu": [
+				"ia32"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"win32"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@esbuild/win32-x64": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz",
+			"integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"win32"
+			],
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@floating-ui/core": {
+			"version": "1.8.0",
+			"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz",
+			"integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==",
+			"license": "MIT",
+			"dependencies": {
+				"@floating-ui/utils": "^0.2.12"
+			}
+		},
+		"node_modules/@floating-ui/dom": {
+			"version": "1.8.0",
+			"resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.8.0.tgz",
+			"integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==",
+			"license": "MIT",
+			"dependencies": {
+				"@floating-ui/core": "^1.8.0",
+				"@floating-ui/utils": "^0.2.12"
+			}
+		},
+		"node_modules/@floating-ui/utils": {
+			"version": "0.2.12",
+			"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.12.tgz",
+			"integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==",
+			"license": "MIT"
+		},
+		"node_modules/@ggml-org/llama-brand": {
+			"version": "0.1.0",
+			"resolved": "https://codeload.github.com/ggml-org/llama-brand/tar.gz/f05540643c1ca2a18d732ed6491c839686da9a3a",
+			"integrity": "sha512-kRDXUIUdfcDt7w4hh3JrFTpqxf2i7R0PHVLGnwUdr4L8EMqE32mEECoXUz1uoUlFaQ+h6QaVHvJWS5y98AoaYA==",
+			"license": "CC-BY-NC-4.0"
+		},
+		"node_modules/@internationalized/date": {
+			"version": "3.12.4",
+			"resolved": "https://registry.npmjs.org/@internationalized/date/-/date-3.12.4.tgz",
+			"integrity": "sha512-M1dEn4c1U1HsSlaVR8upZtSqvXrTkHDfv18H01uCSJyjVLDxnBR38v/fMxecmlwXKR4i9HeZcmgQAPE6A+aGJQ==",
+			"license": "Apache-2.0",
+			"dependencies": {
+				"@swc/helpers": "^0.5.0"
+			}
+		},
+		"node_modules/@jridgewell/gen-mapping": {
+			"version": "0.3.13",
+			"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
+			"integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@jridgewell/sourcemap-codec": "^1.5.0",
+				"@jridgewell/trace-mapping": "^0.3.24"
+			}
+		},
+		"node_modules/@jridgewell/remapping": {
+			"version": "2.3.5",
+			"resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",
+			"integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@jridgewell/gen-mapping": "^0.3.5",
+				"@jridgewell/trace-mapping": "^0.3.24"
+			}
+		},
+		"node_modules/@jridgewell/resolve-uri": {
+			"version": "3.1.2",
+			"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+			"integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=6.0.0"
+			}
+		},
+		"node_modules/@jridgewell/sourcemap-codec": {
+			"version": "1.6.0",
+			"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",
+			"integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",
+			"dev": true,
+			"license": "MIT"
+		},
+		"node_modules/@jridgewell/trace-mapping": {
+			"version": "0.3.31",
+			"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
+			"integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@jridgewell/resolve-uri": "^3.1.0",
+				"@jridgewell/sourcemap-codec": "^1.4.14"
+			}
+		},
+		"node_modules/@lucide/svelte": {
+			"version": "1.46.0",
+			"resolved": "https://registry.npmjs.org/@lucide/svelte/-/svelte-1.46.0.tgz",
+			"integrity": "sha512-Ru8jDjoCVLJ7J7pPRUdY+odSBV2BI6rj68JTmT+ENq/ZwYOPGPAiKVvKz+XLyAoK4HAwlRTzZHpsMvrHfsetqg==",
+			"license": "ISC",
+			"peerDependencies": {
+				"svelte": "^5"
+			}
+		},
+		"node_modules/@mdx-js/react": {
+			"version": "3.1.1",
+			"resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-3.1.1.tgz",
+			"integrity": "sha512-f++rKLQgUVYDAtECQ6fn/is15GkEH9+nZPM3MS0RcxVqoTfawHvDlSCH7JbMhAM6uJ32v3eXLvLmLvjGu7PTQw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@types/mdx": "^2.0.0"
+			},
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/unified"
+			},
+			"peerDependencies": {
+				"@types/react": ">=16",
+				"react": ">=16"
+			}
+		},
+		"node_modules/@napi-rs/wasm-runtime": {
+			"version": "1.2.5",
+			"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.5.tgz",
+			"integrity": "sha512-HshSvXzmBxNzqejd3k/KemgQ3hdREUYFRRrgxOZ+gPljDIsO2SDZrVZMd4Z/HsxudQbE62OVyVFE8z9BCurfjA==",
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"dependencies": {
+				"@tybys/wasm-util": "^0.10.3"
+			},
+			"engines": {
+				"node": "^20.19.0 || ^22.13.0 || >=23.5.0"
+			},
+			"funding": {
+				"type": "github",
+				"url": "https://github.com/sponsors/Brooooooklyn"
+			},
+			"peerDependencies": {
+				"@emnapi/core": "^1.7.1 || ^2.0.0-alpha.4",
+				"@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.4"
+			}
+		},
+		"node_modules/@neoconfetti/react": {
+			"version": "1.0.0",
+			"resolved": "https://registry.npmjs.org/@neoconfetti/react/-/react-1.0.0.tgz",
+			"integrity": "sha512-klcSooChXXOzIm+SE5IISIAn3bYzYfPjbX7D7HoqZL84oAfgREeSg5vSIaSFH+DaGzzvImTyWe1OyrJ67vik4A==",
+			"dev": true,
+			"license": "MIT"
+		},
+		"node_modules/@oxc-parser/binding-android-arm-eabi": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.127.0.tgz",
+			"integrity": "sha512-0LC7ye4hvqbIKxAzThzvswgHLFu2AURKzYLeSVvLdu2TBOYWQDmHnTqPLeA597BcUCxiLqLsS4CJ5uoI5WYWCQ==",
+			"cpu": [
+				"arm"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"android"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-android-arm64": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.127.0.tgz",
+			"integrity": "sha512-b5jtVTH6AU5CJXHNdj7Jj9IEiR9yVjjnwHzPJhGyHGPdcsZSzBCkS9GBbV33niRMvKthDwQRFRJfI4a+k4PvYg==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"android"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-darwin-arm64": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.127.0.tgz",
+			"integrity": "sha512-obCE8B7ISKkJidjlhv9xRGJPOSDG2Yu6PRga9Ruaz35uintHxbp1Ki/Yc71wx4rj3Edrm0a1kzG1TAwit0wFpg==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"darwin"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-darwin-x64": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.127.0.tgz",
+			"integrity": "sha512-JL6Xb5IwPQT8rUzlpsX7E+AgfcdNklXNPFp8pjCQQ5MQOQo5rtEB2ui+3Hgg9Sn7Y9Egj6YOLLiHhLpdAe12Aw==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"darwin"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-freebsd-x64": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.127.0.tgz",
+			"integrity": "sha512-SDQ/3MQFw58fqQz3Z1PhSKFF3JoCF4gmlNjziDm8X02tTahCw0qJbd7FGPDKw1i4VTBZene9JPyC3mHtSvi+wA==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"freebsd"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-linux-arm-gnueabihf": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.127.0.tgz",
+			"integrity": "sha512-Av+D1MIqzV0YMGPT9we2SIZaMKD7Cxs4CvXSx/yxaWHewZjYEjScpOf5igc8IILASViw4WTnjlwUdI1KzVtDHQ==",
+			"cpu": [
+				"arm"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-linux-arm-musleabihf": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.127.0.tgz",
+			"integrity": "sha512-Cs2fdJ8cPpFdeebj6p4dag8A4+56hPvZ0AhQQzlaLswGz1tz7bXt1nETLeorrM9+AMcWFFkqxcXwDGfTVidY8g==",
+			"cpu": [
+				"arm"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-linux-arm64-gnu": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.127.0.tgz",
+			"integrity": "sha512-qdOfTcT6SY8gsJrrV92uyEUyjqMGPpIB5JZUG6QN5dukYd+7/j0kX6MwK1DgQj39jtUYixxPiaRUiEN1+0CXgQ==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"libc": [
+				"glibc"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-linux-arm64-musl": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.127.0.tgz",
+			"integrity": "sha512-EoTCZneNFU/P2qrpEM+RHmQwt+CvDkyGESG6qhr7KaegXLZwePfbrkCDfAk8/rhxbDUVGsZILX+2tqPzFtoFWA==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"libc": [
+				"musl"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-linux-ppc64-gnu": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.127.0.tgz",
+			"integrity": "sha512-zALjmZYgxFLHjXeudcDF0xFGNydTAtkAeXAr2EuC17ywCyFxcmQra4w0BMde0Yi/re4Bi4iwEoEXtYN7l6eBLQ==",
+			"cpu": [
+				"ppc64"
+			],
+			"dev": true,
+			"libc": [
+				"glibc"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-linux-riscv64-gnu": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.127.0.tgz",
+			"integrity": "sha512-fPP8M6zQLS7Jz7o9d5ArUSuAuSK3e+WCYVrCpdzeCOejidtZExJ9tjhDrAd3HEPqARBCPmdpqxESPFqy44vkBQ==",
+			"cpu": [
+				"riscv64"
+			],
+			"dev": true,
+			"libc": [
+				"glibc"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-linux-riscv64-musl": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.127.0.tgz",
+			"integrity": "sha512-7IcC4Ao02oGpfnjt+X/oF4U2mllo2qoSkw5xxiXNKL9MCTsTiAC6616beOuehdxGcnz1bRoPC1RQ2f1GQDdN+g==",
+			"cpu": [
+				"riscv64"
+			],
+			"dev": true,
+			"libc": [
+				"musl"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-linux-s390x-gnu": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.127.0.tgz",
+			"integrity": "sha512-pbXIhiNFHoqWeqDNLiJ9JkpHz1IM9k4DXa66x+1GTWMG7iLxtkXgE53iiuKSXwmk3zIYmaPVfBvgcAhS583K4Q==",
+			"cpu": [
+				"s390x"
+			],
+			"dev": true,
+			"libc": [
+				"glibc"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-linux-x64-gnu": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.127.0.tgz",
+			"integrity": "sha512-MYCguB9RvBvlSd6gbuNI7QwiLoCCAlGnlRJFPrzLI6U1/9wkC/WK6LtBAUln55H1Ctqw45PWmqrobKoMhsYQzQ==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"libc": [
+				"glibc"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-linux-x64-musl": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.127.0.tgz",
+			"integrity": "sha512-5eY0B/bxf1xIUxb4NOTvOI3KWtBQfPWYyKAzgcrCt0mDibSZygVpO1Pz8bkeiSZ5Jj9+M09dkggG3H8I5d0Uyg==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"libc": [
+				"musl"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-openharmony-arm64": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.127.0.tgz",
+			"integrity": "sha512-Gld0ajrFTUXNtdw20fVBuTQx66FA75nIVg+//pPfR3sXkuABB4mTBhl3r9JNzrJpgW//qiwxf0nWXUWGJSL3UQ==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"openharmony"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-wasm32-wasi": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-wasm32-wasi/-/binding-wasm32-wasi-0.127.0.tgz",
+			"integrity": "sha512-T6KVD7rhLzFlwGRXMnxUFfkCZD8FHnb968wVXW1mXzgRFc5RNXOBY2mPPDZ77x5Ln76ltLMgtPg0cOkU1NSrEQ==",
+			"cpu": [
+				"wasm32"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"dependencies": {
+				"@emnapi/core": "1.9.2",
+				"@emnapi/runtime": "1.9.2",
+				"@napi-rs/wasm-runtime": "^1.1.4"
+			},
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-win32-arm64-msvc": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.127.0.tgz",
+			"integrity": "sha512-Ujvw4X+LD1CCGULcsQcvb4YNVoBGqt+JHgNNzGGaCImELiZLk477ifUH53gIbE7EKd933NdTi25JWEr9K2HwXw==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"win32"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-win32-ia32-msvc": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.127.0.tgz",
+			"integrity": "sha512-0cwxKO7KHQQQfo4Uf4B2SQrhgm+cJaP9OvFFhx52Tkg4bezsacu83GB2/In5bC415Ueeym+kXdnge/57rbSfTw==",
+			"cpu": [
+				"ia32"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"win32"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-parser/binding-win32-x64-msvc": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.127.0.tgz",
+			"integrity": "sha512-rOrnSQSCbhI2kowr9XxE7m9a8oQXnBHjnS6j95LxxAnEZ0+Fz20WlRXG4ondQb+ejjt2KOsa65sE6++L6kUd+w==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"win32"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-project/runtime": {
+			"version": "0.154.0",
+			"resolved": "https://registry.npmjs.org/@oxc-project/runtime/-/runtime-0.154.0.tgz",
+			"integrity": "sha512-cBQNGoh659BNgvA8OC/e4BNDtFkv03dJaYdkp2adgOQNtISNAPQ+nB4S8XvWtNk7Xl+0g+7aa+iRGR25Xycd1Q==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxc-project/types": {
+			"version": "0.154.0",
+			"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.154.0.tgz",
+			"integrity": "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==",
+			"dev": true,
+			"license": "MIT",
+			"funding": {
+				"url": "https://github.com/sponsors/oxc-project"
+			}
+		},
+		"node_modules/@oxc-resolver/binding-android-arm-eabi": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.21.2.tgz",
+			"integrity": "sha512-xQoCRv+gKax9KTdwdaQNnAFOai8neay7g3jExDIORzhbrejwGSJaZNTdOJHR5ziLg2joMxOCMOFMo4zuxza2uQ==",
+			"cpu": [
+				"arm"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"android"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-android-arm64": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.21.2.tgz",
+			"integrity": "sha512-HF5oiE2L05yInPYCFD/4uxSrEZW4SuIfn99Y6L1xnJnzl066JR+MJs2rIdstw8A2MPlAKH+13dpFPNycjqzvGg==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"android"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-darwin-arm64": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.21.2.tgz",
+			"integrity": "sha512-UX4u49CVCAD8QZNELaW8eMGgMAGwFWYEPbvNsh+3r/gs4NX3KfpiACMVwRQT0EuH3uat9hM5Zl+Ppm9pJD8tgg==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"darwin"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-darwin-x64": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.21.2.tgz",
+			"integrity": "sha512-J9xPx7YBkrRmJ+xl561ztnMWEc1aOyjEIxBiGX1dVb3u7bGSnfObfcZk+Pd+uM0HZAPNsQ1xvD8j52A/uOSqNQ==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"darwin"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-freebsd-x64": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.21.2.tgz",
+			"integrity": "sha512-fRlt7OvSaQkWj6+EDTVxawVxOlqJB2QSnBfkeCyK4RTvsGctbw3BiH2Tb7DzMs7bikc4BRBpvWP5zF9K8b54Zg==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"freebsd"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-linux-arm-gnueabihf": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.21.2.tgz",
+			"integrity": "sha512-gK+vPUcPQITkGwBKpZGrcDHSlU6eDGl7AQacxS2CEKAZIBHWkOVFeJwLZ4tYnA1acJqRM5lt7yYwPCVqGHIJ7A==",
+			"cpu": [
+				"arm"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-linux-arm-musleabihf": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.21.2.tgz",
+			"integrity": "sha512-L/Rgas7SrOKy/z7IH+HxSFRqVO4PuLDKLEGKvnhoCBBq3UJ0YzGBou3qMzaAGgkJwsIvX2pBF+7ojzfUhLiZxQ==",
+			"cpu": [
+				"arm"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-linux-arm64-gnu": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.21.2.tgz",
+			"integrity": "sha512-CUEYvlX1Fk7E9kUMzuswru1J9HLxMwnpDeQGjQuI4ZH+iNCoa2X9T+pvyzrbsgl7WnIeTFTlNlHsRfVdf5g9/g==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"libc": [
+				"glibc"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-linux-arm64-musl": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.21.2.tgz",
+			"integrity": "sha512-ViN1ZibQyxwC67GpoP33oo+S9UyUnkog13vzQb9+v9bCNvrVzJuk0MRdacjtv/9xfRMVF/eqHFyl8YOeykI10Q==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"libc": [
+				"musl"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-linux-ppc64-gnu": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.21.2.tgz",
+			"integrity": "sha512-CU1sCqWnhGqYD5I1HedHk5pujrn7ssDkNB/AEQd/pd3D/EojVSgJUlpbafwIbyhia3PgIfkvdFpRPWSALzVumA==",
+			"cpu": [
+				"ppc64"
+			],
+			"dev": true,
+			"libc": [
+				"glibc"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-linux-riscv64-gnu": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.21.2.tgz",
+			"integrity": "sha512-jWVyZtIHca4Gb96x7dag+y69vlei7ffjrsveLkmf2ZhqEAz6ZSBnY1GWvgZUaZlwZP62A3xD092BW97Q5VGc+g==",
+			"cpu": [
+				"riscv64"
+			],
+			"dev": true,
+			"libc": [
+				"glibc"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-linux-riscv64-musl": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.21.2.tgz",
+			"integrity": "sha512-LF29obFqNgBUgDX7rmUK7M4D0JQG5LxhYzn3xXmECcHU9aQAdWG7NiY052qybtesEdwHQXKNTWYQ7mTsybNvWg==",
+			"cpu": [
+				"riscv64"
+			],
+			"dev": true,
+			"libc": [
+				"musl"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-linux-s390x-gnu": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.21.2.tgz",
+			"integrity": "sha512-+NYcm+cCHBbtdQQ3A4phQTSuVRYnNHz7wrl9XRAPEovcdoqi0mb1K5ZOl+jN54ZD+q1zz3V0vltbFJmzecJKmw==",
+			"cpu": [
+				"s390x"
+			],
+			"dev": true,
+			"libc": [
+				"glibc"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-linux-x64-gnu": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.21.2.tgz",
+			"integrity": "sha512-UQqZDdG2r2HhAOsZEgufkIWHPQ886IUyuJQkoZByvzhW8j51R4UNzGBJFkTiTnLhQnggwJRdJgFWK4uY6ZVIMw==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"libc": [
+				"glibc"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-linux-x64-musl": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.21.2.tgz",
+			"integrity": "sha512-3Q9PMRjalWkT6NZ4jfujuqTCFwoWErg3y3BnOgb544B8IMw4PktiwWOigMfOHNRLMghZeJ7hpfpZf4CP7rV7Og==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"libc": [
+				"musl"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-openharmony-arm64": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-openharmony-arm64/-/binding-openharmony-arm64-11.21.2.tgz",
+			"integrity": "sha512-Eljeq3ndtyKhM+Es8LITi4Zl2htzuRZcrPMF3kMCsrILztvU6AjZ3FuEhHHKobPUB9rMpzLpJP5bDqXI7r+iog==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"openharmony"
+			]
+		},
+		"node_modules/@oxc-resolver/binding-wasm32-wasi": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.21.2.tgz",
+			"integrity": "sha512-HGDbNsIywqc4LxU38+CTJNnB/6BF7rheWOJ259b4eE0aEnelYblC8x+1tEd63bp31fYne63RQz9Jb4yVnC7Yig==",
+			"cpu": [
+				"wasm32"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"dependencies": {
+				"@emnapi/core": "1.11.0",
+				"@emnapi/runtime": "1.11.0",
+				"@napi-rs/wasm-runtime": "^1.1.5"
+			},
+			"engines": {
+				"node": ">=14.0.0"
+			}
+		},
+		"node_modules/@oxc-resolver/binding-wasm32-wasi/node_modules/@emnapi/core": {
+			"version": "1.11.0",
+			"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.0.tgz",
+			"integrity": "sha512-l9Oo58x0HOP5znGzVhYW9U3e5wVuA4LAZU2AGezTmkhO1CgQRFDhDg4nneHsu/t3WniXg9QrG2nIXL/ZS8ln8Q==",
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"dependencies": {
+				"@emnapi/wasi-threads": "1.2.2",
+				"tslib": "^2.4.0"
+			}
+		},
+		"node_modules/@oxc-resolver/binding-wasm32-wasi/node_modules/@emnapi/runtime": {
+			"version": "1.11.0",
+			"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.0.tgz",
+			"integrity": "sha512-55coeOFKHv1ywEcUXJtWU5f+Jr/W5tZDvZig8DLKSwUN1JpROQ4rk/SNOQiFWmaR/VKF4zuFyW1B8JduOSv6Pg==",
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"dependencies": {
+				"tslib": "^2.4.0"
+			}
+		},
+		"node_modules/@oxc-resolver/binding-wasm32-wasi/node_modules/@emnapi/wasi-threads": {
+			"version": "1.2.2",
+			"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz",
+			"integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==",
 			"dev": true,
 			"license": "MIT",
+			"optional": true,
 			"dependencies": {
-				"@jridgewell/resolve-uri": "^3.1.0",
-				"@jridgewell/sourcemap-codec": "^1.4.14"
-			}
-		},
-		"node_modules/@lucide/svelte": {
-			"version": "1.46.0",
-			"resolved": "https://registry.npmjs.org/@lucide/svelte/-/svelte-1.46.0.tgz",
-			"integrity": "sha512-Ru8jDjoCVLJ7J7pPRUdY+odSBV2BI6rj68JTmT+ENq/ZwYOPGPAiKVvKz+XLyAoK4HAwlRTzZHpsMvrHfsetqg==",
-			"license": "ISC",
-			"peerDependencies": {
-				"svelte": "^5"
+				"tslib": "^2.4.0"
 			}
 		},
-		"node_modules/@oxc-project/runtime": {
-			"version": "0.154.0",
-			"resolved": "https://registry.npmjs.org/@oxc-project/runtime/-/runtime-0.154.0.tgz",
-			"integrity": "sha512-cBQNGoh659BNgvA8OC/e4BNDtFkv03dJaYdkp2adgOQNtISNAPQ+nB4S8XvWtNk7Xl+0g+7aa+iRGR25Xycd1Q==",
+		"node_modules/@oxc-resolver/binding-win32-arm64-msvc": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.21.2.tgz",
+			"integrity": "sha512-iWx25CBEgH49iE9q5coEGI/jb1jl5kkCY9z6U5Og67xCkQ/WFMDc2J5U78+AE91SUxM2NqSLhJC8/PLfWnImww==",
+			"cpu": [
+				"arm64"
+			],
 			"dev": true,
 			"license": "MIT",
-			"engines": {
-				"node": "^20.19.0 || >=22.12.0"
-			}
+			"optional": true,
+			"os": [
+				"win32"
+			]
 		},
-		"node_modules/@oxc-project/types": {
-			"version": "0.154.0",
-			"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.154.0.tgz",
-			"integrity": "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==",
+		"node_modules/@oxc-resolver/binding-win32-x64-msvc": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.21.2.tgz",
+			"integrity": "sha512-VPoCAhKvCQTlG7vxqaBXcmuvbh77BfnGXj8g0pbvVXpm1F/R8rDVwqIWcEbMzrI1JvJlm8v7T9uMVQb6UctMRg==",
+			"cpu": [
+				"x64"
+			],
 			"dev": true,
 			"license": "MIT",
-			"funding": {
-				"url": "https://github.com/sponsors/oxc-project"
-			}
+			"optional": true,
+			"os": [
+				"win32"
+			]
 		},
 		"node_modules/@oxfmt/binding-android-arm-eabi": {
 			"version": "0.73.0",
@@ -957,135 +2211,452 @@
 				"x64"
 			],
 			"dev": true,
-			"libc": [
-				"musl"
-			],
+			"libc": [
+				"musl"
+			],
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"linux"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxlint/binding-openharmony-arm64": {
+			"version": "1.88.0",
+			"resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.88.0.tgz",
+			"integrity": "sha512-DBUcx/KwYdg1DAz+G01P/GFv512J04EsZadbHptx2FTpWT/MWRg21ZToNHt9pnsfQRBQ3et/g+vqzbvrdAVbuA==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"openharmony"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxlint/binding-win32-arm64-msvc": {
+			"version": "1.88.0",
+			"resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.88.0.tgz",
+			"integrity": "sha512-xeVd0n4XG5HvynxfYvXi6uB+JvZbVZataowPS8cYpMbYg9mwE4sSyElFQd4LVJFifq8bRLDSR18XgEildmcXAg==",
+			"cpu": [
+				"arm64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"win32"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxlint/binding-win32-ia32-msvc": {
+			"version": "1.88.0",
+			"resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.88.0.tgz",
+			"integrity": "sha512-MA6iOw//amleaz2mVMsZrA7NHlEexjTrhIxSMFCXQi6IUuQO+3Od00GZhr2iCYw6RFzMW36jkKK/WHBXMsoQAw==",
+			"cpu": [
+				"ia32"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"win32"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxlint/binding-win32-x64-msvc": {
+			"version": "1.88.0",
+			"resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.88.0.tgz",
+			"integrity": "sha512-3Sz6rVWe8Dy+ufsXurFN1GX2dX43F/lQMSLelK9gFjiba7nHvLlqlhR5cHlWVnCpSqUY1hN9pyCX9XToe6ve6g==",
+			"cpu": [
+				"x64"
+			],
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"os": [
+				"win32"
+			],
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			}
+		},
+		"node_modules/@oxlint/plugins": {
+			"version": "1.88.0",
+			"resolved": "https://registry.npmjs.org/@oxlint/plugins/-/plugins-1.88.0.tgz",
+			"integrity": "sha512-G2xbfWTrbqYRhR/vfeKNMQf/sS3/ti0iKJAAkRxHuXWZH/hne/dyIb9QKk5LuR6cJLARxsL6FMoAYmfspd74MQ==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/oxc-project"
+			}
+		},
+		"node_modules/@polka/url": {
+			"version": "1.0.0-next.29",
+			"resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz",
+			"integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==",
+			"dev": true,
+			"license": "MIT"
+		},
+		"node_modules/@publint/pack": {
+			"version": "0.1.7",
+			"resolved": "https://registry.npmjs.org/@publint/pack/-/pack-0.1.7.tgz",
+			"integrity": "sha512-4EDEmvxWtgsCnnVeBvtFIFZtUhPPt1+bA9JrSwU4Sa//6oKtzCSlGGXYJr44OD9aGISymbieJ4mCKHUygUDU+g==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"tinyexec": "^1.3.0"
+			},
+			"engines": {
+				"node": ">=18"
+			},
+			"funding": {
+				"url": "https://bjornlu.com/sponsor"
+			}
+		},
+		"node_modules/@rolldown/pluginutils": {
+			"version": "1.0.1",
+			"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz",
+			"integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==",
+			"dev": true,
+			"license": "MIT"
+		},
+		"node_modules/@standard-schema/spec": {
+			"version": "1.1.0",
+			"resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
+			"integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
+			"dev": true,
+			"license": "MIT"
+		},
+		"node_modules/@storybook/addon-a11y": {
+			"version": "10.6.2",
+			"resolved": "https://registry.npmjs.org/@storybook/addon-a11y/-/addon-a11y-10.6.2.tgz",
+			"integrity": "sha512-zleS+btwrTRcUf3opbZntKsEt6PTqAtxsek08tx5jh5fRvd6wWmtnwW3uaBcypfIKnheTB3KGljJwFX+Mc+Umg==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@storybook/global": "^5.0.0",
+				"axe-core": "^4.2.0"
+			},
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/storybook"
+			},
+			"peerDependencies": {
+				"storybook": "^10.6.2"
+			}
+		},
+		"node_modules/@storybook/addon-docs": {
+			"version": "10.6.2",
+			"resolved": "https://registry.npmjs.org/@storybook/addon-docs/-/addon-docs-10.6.2.tgz",
+			"integrity": "sha512-f7Rv/rzX1sk4lUDTeoIRkXWcWvNwLv7vBnfpFGb3f88MliB+M4ZekGKNiKtrmi44uLFt52gzwwPzj2eGDu0DQQ==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@mdx-js/react": "^3.0.0",
+				"@storybook/icons": "^2.0.2",
+				"@storybook/react-dom-shim": "10.6.2",
+				"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
+				"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
+				"ts-dedent": "^2.0.0",
+				"unplugin": "^2.3.5"
+			},
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/storybook"
+			},
+			"peerDependencies": {
+				"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
+				"storybook": "^10.6.2"
+			},
+			"peerDependenciesMeta": {
+				"@types/react": {
+					"optional": true
+				}
+			}
+		},
+		"node_modules/@storybook/addon-mcp": {
+			"version": "10.6.2",
+			"resolved": "https://registry.npmjs.org/@storybook/addon-mcp/-/addon-mcp-10.6.2.tgz",
+			"integrity": "sha512-AY18igxEq+8pEmzFreSklY6nxYe5xHZdqOqHCg10vT6Ms7pYb0XdnSG94mesJ6Zp+1E4o65WDfmsgMadEvJsfw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@tmcp/adapter-valibot": "^0.1.5",
+				"@tmcp/transport-http": "^0.8.5",
+				"tmcp": "^1.19.4",
+				"valibot": "^1.4.0"
+			},
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/storybook"
+			},
+			"peerDependencies": {
+				"@storybook/addon-vitest": "^10.6.2",
+				"storybook": "^10.6.2"
+			},
+			"peerDependenciesMeta": {
+				"@storybook/addon-vitest": {
+					"optional": true
+				}
+			}
+		},
+		"node_modules/@storybook/addon-svelte-csf": {
+			"version": "5.1.5",
+			"resolved": "https://registry.npmjs.org/@storybook/addon-svelte-csf/-/addon-svelte-csf-5.1.5.tgz",
+			"integrity": "sha512-lYc9tyFIowXtd/hlapngtGhw6YUZMSU5KezHqJl84lRkahsNtmtqHl/mJjRRJG2ZQIWgw6xBUi4PvVvTxPwqzQ==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@storybook/csf": "^0.1.13",
+				"dedent": "^1.5.3",
+				"es-toolkit": "^1.26.1",
+				"esrap": "^1.2.2",
+				"magic-string": "^0.30.12",
+				"svelte-ast-print": "^0.4.0",
+				"zimmerframe": "^1.1.2"
+			},
+			"peerDependencies": {
+				"@storybook/svelte": "^0.0.0-0 || ^8.2.0 || ^9.0.0 || ^9.1.0-0 || ^10.0.0-0 || ^10.1.0-0 || ^10.2.0-0 || ^10.3.0-0 || ^10.4.0-0 || ^10.5.0-0 || ^10.6.0-0 || ^11.0.0-0",
+				"@sveltejs/vite-plugin-svelte": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0",
+				"storybook": "^0.0.0-0 || ^8.2.0 || ^9.0.0 || ^9.1.0-0 || ^10.0.0-0 || ^10.1.0-0 || ^10.2.0-0 || ^10.3.0-0 || ^10.4.0-0 || ^10.5.0-0 || ^10.6.0-0 || ^11.0.0-0",
+				"svelte": "^5.0.0",
+				"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
+			}
+		},
+		"node_modules/@storybook/addon-svelte-csf/node_modules/esrap": {
+			"version": "1.4.9",
+			"resolved": "https://registry.npmjs.org/esrap/-/esrap-1.4.9.tgz",
+			"integrity": "sha512-3OMlcd0a03UGuZpPeUC1HxR3nA23l+HEyCiZw3b3FumJIN9KphoGzDJKMXI1S72jVS1dsenDyQC0kJlO1U9E1g==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@jridgewell/sourcemap-codec": "^1.4.15"
+			}
+		},
+		"node_modules/@storybook/addon-svelte-csf/node_modules/magic-string": {
+			"version": "0.30.21",
+			"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
+			"integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@jridgewell/sourcemap-codec": "^1.5.5"
+			}
+		},
+		"node_modules/@storybook/addon-vitest": {
+			"version": "10.6.2",
+			"resolved": "https://registry.npmjs.org/@storybook/addon-vitest/-/addon-vitest-10.6.2.tgz",
+			"integrity": "sha512-gyyBzncvUyEgWQR3LinnGuI4UsWIUYLyw1u8i244aTxmY4uxCYjsDmUNkaSr8xQzNz8nh2Ckh3G4bO4SvJ6nJQ==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@storybook/global": "^5.0.0",
+				"@storybook/icons": "^2.0.2"
+			},
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/storybook"
+			},
+			"peerDependencies": {
+				"@vitest/browser": "^3.0.0 || ^4.0.0 || ^5.0.0",
+				"@vitest/browser-playwright": "^4.0.0 || ^5.0.0",
+				"@vitest/runner": "^3.0.0 || ^4.0.0 || ^5.0.0",
+				"storybook": "^10.6.2",
+				"vitest": "^3.0.0 || ^4.0.0 || ^5.0.0"
+			},
+			"peerDependenciesMeta": {
+				"@vitest/browser": {
+					"optional": true
+				},
+				"@vitest/browser-playwright": {
+					"optional": true
+				},
+				"@vitest/runner": {
+					"optional": true
+				},
+				"vitest": {
+					"optional": true
+				}
+			}
+		},
+		"node_modules/@storybook/builder-vite": {
+			"version": "10.6.2",
+			"resolved": "https://registry.npmjs.org/@storybook/builder-vite/-/builder-vite-10.6.2.tgz",
+			"integrity": "sha512-SzeQEGjvybdhP2coF4aIX6JX/7rZTrQCpRU3vAEO/R98Vr3xM8jdg7a3nvt91TeF/P8iWqljLIpaDjTdk2r/sQ==",
+			"dev": true,
 			"license": "MIT",
-			"optional": true,
-			"os": [
-				"linux"
-			],
-			"engines": {
-				"node": "^20.19.0 || >=22.12.0"
+			"dependencies": {
+				"ts-dedent": "^2.0.0"
+			},
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/storybook"
+			},
+			"peerDependencies": {
+				"storybook": "^10.6.2",
+				"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
 			}
 		},
-		"node_modules/@oxlint/binding-openharmony-arm64": {
-			"version": "1.88.0",
-			"resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.88.0.tgz",
-			"integrity": "sha512-DBUcx/KwYdg1DAz+G01P/GFv512J04EsZadbHptx2FTpWT/MWRg21ZToNHt9pnsfQRBQ3et/g+vqzbvrdAVbuA==",
-			"cpu": [
-				"arm64"
-			],
+		"node_modules/@storybook/csf": {
+			"version": "0.1.13",
+			"resolved": "https://registry.npmjs.org/@storybook/csf/-/csf-0.1.13.tgz",
+			"integrity": "sha512-7xOOwCLGB3ebM87eemep89MYRFTko+D8qE7EdAAq74lgdqRR5cOUtYWJLjO2dLtP94nqoOdHJo6MdLLKzg412Q==",
 			"dev": true,
 			"license": "MIT",
-			"optional": true,
-			"os": [
-				"openharmony"
-			],
-			"engines": {
-				"node": "^20.19.0 || >=22.12.0"
+			"dependencies": {
+				"type-fest": "^2.19.0"
 			}
 		},
-		"node_modules/@oxlint/binding-win32-arm64-msvc": {
-			"version": "1.88.0",
-			"resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.88.0.tgz",
-			"integrity": "sha512-xeVd0n4XG5HvynxfYvXi6uB+JvZbVZataowPS8cYpMbYg9mwE4sSyElFQd4LVJFifq8bRLDSR18XgEildmcXAg==",
-			"cpu": [
-				"arm64"
-			],
+		"node_modules/@storybook/global": {
+			"version": "5.0.0",
+			"resolved": "https://registry.npmjs.org/@storybook/global/-/global-5.0.0.tgz",
+			"integrity": "sha512-FcOqPAXACP0I3oJ/ws6/rrPT9WGhu915Cg8D02a9YxLo0DE9zI+a9A5gRGvmQ09fiWPukqI8ZAEoQEdWUKMQdQ==",
+			"dev": true,
+			"license": "MIT"
+		},
+		"node_modules/@storybook/icons": {
+			"version": "2.2.0",
+			"resolved": "https://registry.npmjs.org/@storybook/icons/-/icons-2.2.0.tgz",
+			"integrity": "sha512-FpUB/xizIrV1ILhCIYFo+TtQNN9YEoLjfcnAW0JtOXL+BcM2aisSysI0B54JMWDnljriXySBHgN6ps4s9lb75A==",
 			"dev": true,
 			"license": "MIT",
-			"optional": true,
-			"os": [
-				"win32"
-			],
-			"engines": {
-				"node": "^20.19.0 || >=22.12.0"
+			"peerDependencies": {
+				"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
 			}
 		},
-		"node_modules/@oxlint/binding-win32-ia32-msvc": {
-			"version": "1.88.0",
-			"resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.88.0.tgz",
-			"integrity": "sha512-MA6iOw//amleaz2mVMsZrA7NHlEexjTrhIxSMFCXQi6IUuQO+3Od00GZhr2iCYw6RFzMW36jkKK/WHBXMsoQAw==",
-			"cpu": [
-				"ia32"
-			],
+		"node_modules/@storybook/react-dom-shim": {
+			"version": "10.6.2",
+			"resolved": "https://registry.npmjs.org/@storybook/react-dom-shim/-/react-dom-shim-10.6.2.tgz",
+			"integrity": "sha512-k0262Vqxjk3wHeg3g/QO/ENDrkC7kkbuwsFSXOdYr7Sl888tsF1DAS7uQ/gr+s/BRz1FLYRX7wBY3smEUV4MJg==",
 			"dev": true,
 			"license": "MIT",
-			"optional": true,
-			"os": [
-				"win32"
-			],
-			"engines": {
-				"node": "^20.19.0 || >=22.12.0"
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/storybook"
+			},
+			"peerDependencies": {
+				"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
+				"@types/react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
+				"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
+				"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
+				"storybook": "^10.6.2"
+			},
+			"peerDependenciesMeta": {
+				"@types/react": {
+					"optional": true
+				},
+				"@types/react-dom": {
+					"optional": true
+				}
 			}
 		},
-		"node_modules/@oxlint/binding-win32-x64-msvc": {
-			"version": "1.88.0",
-			"resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.88.0.tgz",
-			"integrity": "sha512-3Sz6rVWe8Dy+ufsXurFN1GX2dX43F/lQMSLelK9gFjiba7nHvLlqlhR5cHlWVnCpSqUY1hN9pyCX9XToe6ve6g==",
-			"cpu": [
-				"x64"
-			],
+		"node_modules/@storybook/svelte": {
+			"version": "10.6.2",
+			"resolved": "https://registry.npmjs.org/@storybook/svelte/-/svelte-10.6.2.tgz",
+			"integrity": "sha512-P4LfcT2fGEYcqn4CFVkel/TvCHFxLUF8E/H/M8LqU/beJGr0f0c87L64QvDaJJiGjARRWTK1mvd0z8eSYO96Nw==",
 			"dev": true,
 			"license": "MIT",
-			"optional": true,
-			"os": [
-				"win32"
-			],
-			"engines": {
-				"node": "^20.19.0 || >=22.12.0"
+			"dependencies": {
+				"ts-dedent": "^2.0.0",
+				"type-fest": "^5.6.0"
+			},
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/storybook"
+			},
+			"peerDependencies": {
+				"storybook": "^10.6.2",
+				"svelte": "^5.0.0"
 			}
 		},
-		"node_modules/@oxlint/plugins": {
-			"version": "1.88.0",
-			"resolved": "https://registry.npmjs.org/@oxlint/plugins/-/plugins-1.88.0.tgz",
-			"integrity": "sha512-G2xbfWTrbqYRhR/vfeKNMQf/sS3/ti0iKJAAkRxHuXWZH/hne/dyIb9QKk5LuR6cJLARxsL6FMoAYmfspd74MQ==",
+		"node_modules/@storybook/svelte-vite": {
+			"version": "10.6.2",
+			"resolved": "https://registry.npmjs.org/@storybook/svelte-vite/-/svelte-vite-10.6.2.tgz",
+			"integrity": "sha512-IjSm98aMRNX0iH5A0i8VK1oUOak8Vq8r0O1xHozb7esjz0bVTznwx6sOGKkfhV8k0n1Vn5e2YzvXJR5m5Rqo8A==",
 			"dev": true,
 			"license": "MIT",
-			"engines": {
-				"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+			"dependencies": {
+				"@storybook/builder-vite": "10.6.2",
+				"@storybook/svelte": "10.6.2",
+				"magic-string": "^1.1.0",
+				"svelte2tsx": "^0.7.55",
+				"typescript": "^4.9.4 || ^5.0.0"
 			},
 			"funding": {
-				"url": "https://github.com/sponsors/oxc-project"
+				"type": "opencollective",
+				"url": "https://opencollective.com/storybook"
+			},
+			"peerDependencies": {
+				"@sveltejs/vite-plugin-svelte": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0",
+				"storybook": "^10.6.2",
+				"svelte": "^5.0.0",
+				"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
 			}
 		},
-		"node_modules/@polka/url": {
-			"version": "1.0.0-next.29",
-			"resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz",
-			"integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==",
+		"node_modules/@storybook/svelte-vite/node_modules/typescript": {
+			"version": "5.9.3",
+			"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
+			"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
 			"dev": true,
-			"license": "MIT"
+			"license": "Apache-2.0",
+			"bin": {
+				"tsc": "bin/tsc",
+				"tsserver": "bin/tsserver"
+			},
+			"engines": {
+				"node": ">=14.17"
+			}
 		},
-		"node_modules/@publint/pack": {
-			"version": "0.1.7",
-			"resolved": "https://registry.npmjs.org/@publint/pack/-/pack-0.1.7.tgz",
-			"integrity": "sha512-4EDEmvxWtgsCnnVeBvtFIFZtUhPPt1+bA9JrSwU4Sa//6oKtzCSlGGXYJr44OD9aGISymbieJ4mCKHUygUDU+g==",
+		"node_modules/@storybook/svelte/node_modules/type-fest": {
+			"version": "5.10.0",
+			"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.10.0.tgz",
+			"integrity": "sha512-NoSdpq/WEiAg5sjmBkmV/hfxv6HJH4NqPNrqjtSO5CwRmpsDfaf4begxW34KdJykH/l1yHtwBWQkCRdoXO8mPA==",
 			"dev": true,
-			"license": "MIT",
+			"license": "(MIT OR CC0-1.0)",
 			"dependencies": {
-				"tinyexec": "^1.3.0"
+				"tagged-tag": "^1.0.0"
 			},
 			"engines": {
-				"node": ">=18"
+				"node": ">=20"
 			},
 			"funding": {
-				"url": "https://bjornlu.com/sponsor"
+				"url": "https://github.com/sponsors/sindresorhus"
 			}
 		},
-		"node_modules/@rolldown/pluginutils": {
-			"version": "1.0.1",
-			"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz",
-			"integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==",
-			"dev": true,
-			"license": "MIT"
-		},
-		"node_modules/@standard-schema/spec": {
-			"version": "1.1.0",
-			"resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
-			"integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
+		"node_modules/@storybook/sveltekit": {
+			"version": "10.6.2",
+			"resolved": "https://registry.npmjs.org/@storybook/sveltekit/-/sveltekit-10.6.2.tgz",
+			"integrity": "sha512-YfwJz+rlArrZSiMhTLA7TrPSwmcK3vqKa0yIDZaRfmQuP8YuwQop1CCic719VZ9kbYgMbsboCOAhZIr/ZtMreg==",
 			"dev": true,
-			"license": "MIT"
+			"license": "MIT",
+			"dependencies": {
+				"@storybook/builder-vite": "10.6.2",
+				"@storybook/svelte": "10.6.2",
+				"@storybook/svelte-vite": "10.6.2"
+			},
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/storybook"
+			},
+			"peerDependencies": {
+				"storybook": "^10.6.2",
+				"svelte": "^5.0.0",
+				"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
+			}
 		},
 		"node_modules/@sveltejs/acorn-typescript": {
 			"version": "1.0.13",
@@ -1868,6 +3439,33 @@
 				"dequal": "^2.0.3"
 			}
 		},
+		"node_modules/@testing-library/jest-dom": {
+			"version": "6.9.1",
+			"resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.9.1.tgz",
+			"integrity": "sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@adobe/css-tools": "^4.4.0",
+				"aria-query": "^5.0.0",
+				"css.escape": "^1.5.1",
+				"dom-accessibility-api": "^0.6.3",
+				"picocolors": "^1.1.1",
+				"redent": "^3.0.0"
+			},
+			"engines": {
+				"node": ">=14",
+				"npm": ">=6",
+				"yarn": ">=1"
+			}
+		},
+		"node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": {
+			"version": "0.6.3",
+			"resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz",
+			"integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/@testing-library/svelte-core": {
 			"version": "1.1.3",
 			"resolved": "https://registry.npmjs.org/@testing-library/svelte-core/-/svelte-core-1.1.3.tgz",
@@ -1895,6 +3493,63 @@
 				"@testing-library/dom": ">=7.21.4"
 			}
 		},
+		"node_modules/@tmcp/adapter-valibot": {
+			"version": "0.1.7",
+			"resolved": "https://registry.npmjs.org/@tmcp/adapter-valibot/-/adapter-valibot-0.1.7.tgz",
+			"integrity": "sha512-MkY4yiyx6k/eeft7Ktnp3RSWrflwWF2PvhmVBSSSGjclJLdIOhhIY1wgp7LVKWwHKiYjOnaL8fQqx1kfdk4xkA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@standard-schema/spec": "^1.0.0",
+				"@valibot/to-json-schema": "^1.3.0",
+				"valibot": "^1.1.0"
+			},
+			"peerDependencies": {
+				"tmcp": "^1.17.0 || ^1.20.0-next.0",
+				"valibot": "^1.1.0"
+			}
+		},
+		"node_modules/@tmcp/session-manager": {
+			"version": "0.2.2",
+			"resolved": "https://registry.npmjs.org/@tmcp/session-manager/-/session-manager-0.2.2.tgz",
+			"integrity": "sha512-UrCRpTsxh5XnMbplspvftEYboiZWgAiXqqAUbyFTHoHMJ0LoNDy8bQd0+7qtxtT4S5Qsnv650gvs/Nbec5NTCQ==",
+			"dev": true,
+			"license": "MIT",
+			"peerDependencies": {
+				"tmcp": "^1.16.3"
+			}
+		},
+		"node_modules/@tmcp/transport-http": {
+			"version": "0.8.6",
+			"resolved": "https://registry.npmjs.org/@tmcp/transport-http/-/transport-http-0.8.6.tgz",
+			"integrity": "sha512-iLcxu+tEMbkVHbhFfyXQhxfPDDTfm+F0kEw8Xg/a1rm29s4cBg1vwcpbtk02XTxsdDh8RJ1AZkQwF9WDGeb/IA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@tmcp/session-manager": "^0.2.2",
+				"esm-env": "^1.2.2"
+			},
+			"peerDependencies": {
+				"@tmcp/auth": "^0.3.3 || ^0.4.0",
+				"tmcp": "^1.18.0"
+			},
+			"peerDependenciesMeta": {
+				"@tmcp/auth": {
+					"optional": true
+				}
+			}
+		},
+		"node_modules/@tybys/wasm-util": {
+			"version": "0.10.4",
+			"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz",
+			"integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==",
+			"dev": true,
+			"license": "MIT",
+			"optional": true,
+			"dependencies": {
+				"tslib": "^2.4.0"
+			}
+		},
 		"node_modules/@types/aria-query": {
 			"version": "5.0.4",
 			"resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz",
@@ -1927,6 +3582,30 @@
 			"dev": true,
 			"license": "MIT"
 		},
+		"node_modules/@types/json-schema": {
+			"version": "7.0.15",
+			"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
+			"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
+			"dev": true,
+			"license": "MIT"
+		},
+		"node_modules/@types/mdast": {
+			"version": "4.0.4",
+			"resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",
+			"integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@types/unist": "*"
+			}
+		},
+		"node_modules/@types/mdx": {
+			"version": "2.0.14",
+			"resolved": "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.14.tgz",
+			"integrity": "sha512-T48PeuJtvLosNTPVhfnIp3i/n3a4g4Bad7YCq5k64D4u7NwDrAotikQ+5+sjtUvBmxCMlbo3dVL+C2dP0rWHzg==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/@types/node": {
 			"version": "24.19.2",
 			"resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz",
@@ -1937,6 +3616,23 @@
 				"undici-types": ">=7.24.0 <7.24.7"
 			}
 		},
+		"node_modules/@types/unist": {
+			"version": "2.0.11",
+			"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz",
+			"integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==",
+			"dev": true,
+			"license": "MIT"
+		},
+		"node_modules/@valibot/to-json-schema": {
+			"version": "1.8.0",
+			"resolved": "https://registry.npmjs.org/@valibot/to-json-schema/-/to-json-schema-1.8.0.tgz",
+			"integrity": "sha512-a0M+uwCuQZEPAo65NYkFSJ14O5c213KoSZmPdoCfuFvUhfULi4T2Z6Tpjv6lTVMW9RoLm74RpRAjNEa43KcN+g==",
+			"dev": true,
+			"license": "MIT",
+			"peerDependencies": {
+				"valibot": "^1.5.0"
+			}
+		},
 		"node_modules/@vitest/browser": {
 			"version": "5.0.5",
 			"resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-5.0.5.tgz",
@@ -2037,13 +3733,98 @@
 			"resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz",
 			"integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==",
 			"dev": true,
-			"funding": [
-				"https://github.com/sponsors/sxzz",
-				"https://opencollective.com/debug"
-			],
+			"funding": [
+				"https://github.com/sponsors/sxzz",
+				"https://opencollective.com/debug"
+			],
+			"license": "MIT",
+			"engines": {
+				"node": ">=12.20.0"
+			}
+		},
+		"node_modules/@vitest/expect": {
+			"version": "3.2.4",
+			"resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz",
+			"integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@types/chai": "^5.2.2",
+				"@vitest/spy": "3.2.4",
+				"@vitest/utils": "3.2.4",
+				"chai": "^5.2.0",
+				"tinyrainbow": "^2.0.0"
+			},
+			"funding": {
+				"url": "https://opencollective.com/vitest"
+			}
+		},
+		"node_modules/@vitest/expect/node_modules/@vitest/pretty-format": {
+			"version": "3.2.4",
+			"resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz",
+			"integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"tinyrainbow": "^2.0.0"
+			},
+			"funding": {
+				"url": "https://opencollective.com/vitest"
+			}
+		},
+		"node_modules/@vitest/expect/node_modules/@vitest/spy": {
+			"version": "3.2.4",
+			"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz",
+			"integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"tinyspy": "^4.0.3"
+			},
+			"funding": {
+				"url": "https://opencollective.com/vitest"
+			}
+		},
+		"node_modules/@vitest/expect/node_modules/@vitest/utils": {
+			"version": "3.2.4",
+			"resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz",
+			"integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@vitest/pretty-format": "3.2.4",
+				"loupe": "^3.1.4",
+				"tinyrainbow": "^2.0.0"
+			},
+			"funding": {
+				"url": "https://opencollective.com/vitest"
+			}
+		},
+		"node_modules/@vitest/expect/node_modules/chai": {
+			"version": "5.3.3",
+			"resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz",
+			"integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"assertion-error": "^2.0.1",
+				"check-error": "^2.1.1",
+				"deep-eql": "^5.0.1",
+				"loupe": "^3.1.0",
+				"pathval": "^2.0.0"
+			},
+			"engines": {
+				"node": ">=18"
+			}
+		},
+		"node_modules/@vitest/expect/node_modules/tinyrainbow": {
+			"version": "2.0.0",
+			"resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz",
+			"integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==",
+			"dev": true,
 			"license": "MIT",
 			"engines": {
-				"node": ">=12.20.0"
+				"node": ">=14.0.0"
 			}
 		},
 		"node_modules/@vitest/istanbul-lib-coverage": {
@@ -2320,6 +4101,13 @@
 				"node": ">=20.0.0"
 			}
 		},
+		"node_modules/@webcontainer/env": {
+			"version": "1.1.1",
+			"resolved": "https://registry.npmjs.org/@webcontainer/env/-/env-1.1.1.tgz",
+			"integrity": "sha512-6aN99yL695Hi9SuIk1oC88l9o0gmxL1nGWWQ/kNy81HigJ0FoaoTXpytCj6ItzgyCEwA9kF1wixsTuv5cjsgng==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/@yuku-core/binding-android-arm64": {
 			"version": "0.19.0",
 			"resolved": "https://registry.npmjs.org/@yuku-core/binding-android-arm64/-/binding-android-arm64-0.19.0.tgz",
@@ -2569,6 +4357,19 @@
 				"node": ">=12"
 			}
 		},
+		"node_modules/ast-types": {
+			"version": "0.16.3",
+			"resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.16.3.tgz",
+			"integrity": "sha512-FvWoWYfSCM6kRxCSH+MGLHIKKGRL6A6AW7Zek2O32REPQRdg131428uRTKMBYAeRd3XXAaHDS60Wpri7CdKDrA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"tslib": "^2.0.1"
+			},
+			"engines": {
+				"node": ">=4"
+			}
+		},
 		"node_modules/ast-v8-to-istanbul": {
 			"version": "1.0.7",
 			"resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.7.tgz",
@@ -2588,6 +4389,16 @@
 			"dev": true,
 			"license": "MIT"
 		},
+		"node_modules/axe-core": {
+			"version": "4.14.0",
+			"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.14.0.tgz",
+			"integrity": "sha512-9WTZxEjsZ7b13TH8JPmbV2z8CHbl80/2hm3XPEG4JgNdQLK81IBRXmSxHfMAOkSqQeRxT/0dwNDz2GOm3zzpcQ==",
+			"dev": true,
+			"license": "MPL-2.0",
+			"engines": {
+				"node": ">=4"
+			}
+		},
 		"node_modules/axobject-query": {
 			"version": "4.1.0",
 			"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz",
@@ -2666,6 +4477,22 @@
 				"svelte": "^5.30.2"
 			}
 		},
+		"node_modules/bundle-name": {
+			"version": "4.1.1",
+			"resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.1.tgz",
+			"integrity": "sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"run-applescript": "^7.0.0"
+			},
+			"engines": {
+				"node": ">=18"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/sindresorhus"
+			}
+		},
 		"node_modules/chai": {
 			"version": "6.3.0",
 			"resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz",
@@ -2676,6 +4503,16 @@
 				"node": ">=18"
 			}
 		},
+		"node_modules/check-error": {
+			"version": "2.1.3",
+			"resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz",
+			"integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">= 16"
+			}
+		},
 		"node_modules/chokidar": {
 			"version": "5.0.0",
 			"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz",
@@ -2692,6 +4529,40 @@
 				"url": "https://paulmillr.com/funding/"
 			}
 		},
+		"node_modules/chromatic": {
+			"version": "18.13.0",
+			"resolved": "https://registry.npmjs.org/chromatic/-/chromatic-18.13.0.tgz",
+			"integrity": "sha512-AdN6tHB9anx/sdJKIMQ7JkQQV2RhVe1iTvXOFLlwFBRecbl9rp50h/25N0sZJDdpx22gG7Y81HoUALOORfMuxQ==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"semver": "^7.3.5"
+			},
+			"bin": {
+				"chroma": "dist/bin.cjs",
+				"chromatic": "dist/bin.cjs",
+				"chromatic-cli": "dist/bin.cjs"
+			},
+			"engines": {
+				"node": ">=22.0.0"
+			},
+			"peerDependencies": {
+				"@chromatic-com/cypress": "^0.*.* || ^1.0.0",
+				"@chromatic-com/playwright": "^0.*.* || ^1.0.0",
+				"@chromatic-com/vitest": "^0.*.* || ^1.0.0"
+			},
+			"peerDependenciesMeta": {
+				"@chromatic-com/cypress": {
+					"optional": true
+				},
+				"@chromatic-com/playwright": {
+					"optional": true
+				},
+				"@chromatic-com/vitest": {
+					"optional": true
+				}
+			}
+		},
 		"node_modules/clsx": {
 			"version": "2.1.1",
 			"resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
@@ -2722,6 +4593,28 @@
 				"url": "https://opencollective.com/express"
 			}
 		},
+		"node_modules/css.escape": {
+			"version": "1.5.1",
+			"resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz",
+			"integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==",
+			"dev": true,
+			"license": "MIT"
+		},
+		"node_modules/dedent": {
+			"version": "1.7.2",
+			"resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz",
+			"integrity": "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==",
+			"dev": true,
+			"license": "MIT",
+			"peerDependencies": {
+				"babel-plugin-macros": "^3.1.0"
+			},
+			"peerDependenciesMeta": {
+				"babel-plugin-macros": {
+					"optional": true
+				}
+			}
+		},
 		"node_modules/dedent-js": {
 			"version": "1.0.1",
 			"resolved": "https://registry.npmjs.org/dedent-js/-/dedent-js-1.0.1.tgz",
@@ -2729,6 +4622,16 @@
 			"dev": true,
 			"license": "MIT"
 		},
+		"node_modules/deep-eql": {
+			"version": "5.0.2",
+			"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz",
+			"integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=6"
+			}
+		},
 		"node_modules/deepmerge": {
 			"version": "4.3.1",
 			"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
@@ -2739,6 +4642,49 @@
 				"node": ">=0.10.0"
 			}
 		},
+		"node_modules/default-browser": {
+			"version": "5.5.1",
+			"resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.1.tgz",
+			"integrity": "sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"bundle-name": "^4.1.0",
+				"default-browser-id": "^5.0.0"
+			},
+			"engines": {
+				"node": ">=18"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/sindresorhus"
+			}
+		},
+		"node_modules/default-browser-id": {
+			"version": "5.0.1",
+			"resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.1.tgz",
+			"integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=18"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/sindresorhus"
+			}
+		},
+		"node_modules/define-lazy-prop": {
+			"version": "3.0.0",
+			"resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz",
+			"integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=12"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/sindresorhus"
+			}
+		},
 		"node_modules/dequal": {
 			"version": "2.0.3",
 			"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
@@ -2793,12 +4739,81 @@
 			"dev": true,
 			"license": "MIT"
 		},
+		"node_modules/es-toolkit": {
+			"version": "1.52.0",
+			"resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.52.0.tgz",
+			"integrity": "sha512-XTNEJQh1tY1ZJVcf6ayP/2n4ZPyaHlW2FWs7xvw5ddPuhUVjLD3olQVQS7kf58JbAB48iL0uL/jerTrjtV3lDA==",
+			"dev": true,
+			"license": "MIT",
+			"workspaces": [
+				"docs",
+				"benchmarks",
+				"tests/types",
+				"tests/browser-compat"
+			]
+		},
+		"node_modules/esbuild": {
+			"version": "0.28.2",
+			"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz",
+			"integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==",
+			"dev": true,
+			"hasInstallScript": true,
+			"license": "MIT",
+			"bin": {
+				"esbuild": "bin/esbuild"
+			},
+			"engines": {
+				"node": ">=18"
+			},
+			"optionalDependencies": {
+				"@esbuild/aix-ppc64": "0.28.2",
+				"@esbuild/android-arm": "0.28.2",
+				"@esbuild/android-arm64": "0.28.2",
+				"@esbuild/android-x64": "0.28.2",
+				"@esbuild/darwin-arm64": "0.28.2",
+				"@esbuild/darwin-x64": "0.28.2",
+				"@esbuild/freebsd-arm64": "0.28.2",
+				"@esbuild/freebsd-x64": "0.28.2",
+				"@esbuild/linux-arm": "0.28.2",
+				"@esbuild/linux-arm64": "0.28.2",
+				"@esbuild/linux-ia32": "0.28.2",
+				"@esbuild/linux-loong64": "0.28.2",
+				"@esbuild/linux-mips64el": "0.28.2",
+				"@esbuild/linux-ppc64": "0.28.2",
+				"@esbuild/linux-riscv64": "0.28.2",
+				"@esbuild/linux-s390x": "0.28.2",
+				"@esbuild/linux-x64": "0.28.2",
+				"@esbuild/netbsd-arm64": "0.28.2",
+				"@esbuild/netbsd-x64": "0.28.2",
+				"@esbuild/openbsd-arm64": "0.28.2",
+				"@esbuild/openbsd-x64": "0.28.2",
+				"@esbuild/openharmony-arm64": "0.28.2",
+				"@esbuild/sunos-x64": "0.28.2",
+				"@esbuild/win32-arm64": "0.28.2",
+				"@esbuild/win32-ia32": "0.28.2",
+				"@esbuild/win32-x64": "0.28.2"
+			}
+		},
 		"node_modules/esm-env": {
 			"version": "1.2.2",
 			"resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz",
 			"integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==",
 			"license": "MIT"
 		},
+		"node_modules/esprima": {
+			"version": "4.0.1",
+			"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+			"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+			"dev": true,
+			"license": "BSD-2-Clause",
+			"bin": {
+				"esparse": "bin/esparse.js",
+				"esvalidate": "bin/esvalidate.js"
+			},
+			"engines": {
+				"node": ">=4"
+			}
+		},
 		"node_modules/esrap": {
 			"version": "2.4.0",
 			"resolved": "https://registry.npmjs.org/esrap/-/esrap-2.4.0.tgz",
@@ -2900,12 +4915,57 @@
 				"node": ">=12.0.0"
 			}
 		},
+		"node_modules/indent-string": {
+			"version": "4.0.0",
+			"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
+			"integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=8"
+			}
+		},
 		"node_modules/inline-style-parser": {
 			"version": "0.2.7",
 			"resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz",
 			"integrity": "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==",
 			"license": "MIT"
 		},
+		"node_modules/is-docker": {
+			"version": "3.0.0",
+			"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz",
+			"integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==",
+			"dev": true,
+			"license": "MIT",
+			"bin": {
+				"is-docker": "cli.js"
+			},
+			"engines": {
+				"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/sindresorhus"
+			}
+		},
+		"node_modules/is-inside-container": {
+			"version": "1.0.0",
+			"resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz",
+			"integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"is-docker": "^3.0.0"
+			},
+			"bin": {
+				"is-inside-container": "cli.js"
+			},
+			"engines": {
+				"node": ">=14.16"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/sindresorhus"
+			}
+		},
 		"node_modules/is-reference": {
 			"version": "3.0.3",
 			"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz",
@@ -2916,6 +4976,22 @@
 				"@types/estree": "^1.0.6"
 			}
 		},
+		"node_modules/is-wsl": {
+			"version": "3.1.1",
+			"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz",
+			"integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"is-inside-container": "^1.0.0"
+			},
+			"engines": {
+				"node": ">=16"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/sindresorhus"
+			}
+		},
 		"node_modules/jiti": {
 			"version": "2.7.0",
 			"resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz",
@@ -2933,6 +5009,33 @@
 			"dev": true,
 			"license": "MIT"
 		},
+		"node_modules/json-rpc-2.0": {
+			"version": "1.8.1",
+			"resolved": "https://registry.npmjs.org/json-rpc-2.0/-/json-rpc-2.0-1.8.1.tgz",
+			"integrity": "sha512-BmN42JKn6FI36pcMMzHCXQhpKNEfbeqgSIcUYHKnifq0/4Ey6PDinovwUOgajT7NsgUtpWdDXaCWlpI4LHXN3g==",
+			"dev": true,
+			"license": "MIT"
+		},
+		"node_modules/jsonc-parser": {
+			"version": "3.3.1",
+			"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz",
+			"integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==",
+			"dev": true,
+			"license": "MIT"
+		},
+		"node_modules/jsonfile": {
+			"version": "6.2.1",
+			"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz",
+			"integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"universalify": "^2.0.0"
+			},
+			"optionalDependencies": {
+				"graceful-fs": "^4.1.6"
+			}
+		},
 		"node_modules/kleur": {
 			"version": "4.1.5",
 			"resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
@@ -3223,6 +5326,13 @@
 			"dev": true,
 			"license": "MIT"
 		},
+		"node_modules/loupe": {
+			"version": "3.2.1",
+			"resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz",
+			"integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/lz-string": {
 			"version": "1.5.0",
 			"resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz",
@@ -3254,6 +5364,34 @@
 				"source-map-js": "^1.2.1"
 			}
 		},
+		"node_modules/mdsvex": {
+			"version": "0.12.7",
+			"resolved": "https://registry.npmjs.org/mdsvex/-/mdsvex-0.12.7.tgz",
+			"integrity": "sha512-gx4bReLCUvq+MPErHXYeyX+TEq1hsS2KfiZtEOMNTcbibSouFy8AHc5h04KbGCl+g5tLuo4/lbgRVYRnc7bJZw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@types/mdast": "^4.0.4",
+				"@types/unist": "^2.0.3",
+				"prism-svelte": "^0.4.7",
+				"prismjs": "^1.17.1",
+				"unist-util-visit": "^2.0.1",
+				"vfile-message": "^2.0.4"
+			},
+			"peerDependencies": {
+				"svelte": "^3.56.0 || ^4.0.0 || ^5.0.0-next.120"
+			}
+		},
+		"node_modules/min-indent": {
+			"version": "1.0.1",
+			"resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
+			"integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=4"
+			}
+		},
 		"node_modules/mode-watcher": {
 			"version": "1.1.0",
 			"resolved": "https://registry.npmjs.org/mode-watcher/-/mode-watcher-1.1.0.tgz",
@@ -3321,6 +5459,104 @@
 				"node": ">=12.20.0"
 			}
 		},
+		"node_modules/open": {
+			"version": "10.2.0",
+			"resolved": "https://registry.npmjs.org/open/-/open-10.2.0.tgz",
+			"integrity": "sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"default-browser": "^5.2.1",
+				"define-lazy-prop": "^3.0.0",
+				"is-inside-container": "^1.0.0",
+				"wsl-utils": "^0.1.0"
+			},
+			"engines": {
+				"node": ">=18"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/sindresorhus"
+			}
+		},
+		"node_modules/oxc-parser": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.127.0.tgz",
+			"integrity": "sha512-bkgD4qHlN7WxLdX8bLXdaU54TtQtAIg/ZBAfm0aje/mo3MRDo3P0hZSgr4U7O3xfX+fQmR5AP04JS/TGcZLcFA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@oxc-project/types": "^0.127.0"
+			},
+			"engines": {
+				"node": "^20.19.0 || >=22.12.0"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/Boshen"
+			},
+			"optionalDependencies": {
+				"@oxc-parser/binding-android-arm-eabi": "0.127.0",
+				"@oxc-parser/binding-android-arm64": "0.127.0",
+				"@oxc-parser/binding-darwin-arm64": "0.127.0",
+				"@oxc-parser/binding-darwin-x64": "0.127.0",
+				"@oxc-parser/binding-freebsd-x64": "0.127.0",
+				"@oxc-parser/binding-linux-arm-gnueabihf": "0.127.0",
+				"@oxc-parser/binding-linux-arm-musleabihf": "0.127.0",
+				"@oxc-parser/binding-linux-arm64-gnu": "0.127.0",
+				"@oxc-parser/binding-linux-arm64-musl": "0.127.0",
+				"@oxc-parser/binding-linux-ppc64-gnu": "0.127.0",
+				"@oxc-parser/binding-linux-riscv64-gnu": "0.127.0",
+				"@oxc-parser/binding-linux-riscv64-musl": "0.127.0",
+				"@oxc-parser/binding-linux-s390x-gnu": "0.127.0",
+				"@oxc-parser/binding-linux-x64-gnu": "0.127.0",
+				"@oxc-parser/binding-linux-x64-musl": "0.127.0",
+				"@oxc-parser/binding-openharmony-arm64": "0.127.0",
+				"@oxc-parser/binding-wasm32-wasi": "0.127.0",
+				"@oxc-parser/binding-win32-arm64-msvc": "0.127.0",
+				"@oxc-parser/binding-win32-ia32-msvc": "0.127.0",
+				"@oxc-parser/binding-win32-x64-msvc": "0.127.0"
+			}
+		},
+		"node_modules/oxc-parser/node_modules/@oxc-project/types": {
+			"version": "0.127.0",
+			"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.127.0.tgz",
+			"integrity": "sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==",
+			"dev": true,
+			"license": "MIT",
+			"funding": {
+				"url": "https://github.com/sponsors/Boshen"
+			}
+		},
+		"node_modules/oxc-resolver": {
+			"version": "11.21.2",
+			"resolved": "https://registry.npmjs.org/oxc-resolver/-/oxc-resolver-11.21.2.tgz",
+			"integrity": "sha512-w5tLwYN3Zo24w5EeWJjJWZOwhYqTtC8PS2B1tIt7BZUuqTIcU07sQValbDw+rq7+AuAGzOHklgK+ifsy4lpXfw==",
+			"dev": true,
+			"license": "MIT",
+			"funding": {
+				"url": "https://github.com/sponsors/Boshen"
+			},
+			"optionalDependencies": {
+				"@oxc-resolver/binding-android-arm-eabi": "11.21.2",
+				"@oxc-resolver/binding-android-arm64": "11.21.2",
+				"@oxc-resolver/binding-darwin-arm64": "11.21.2",
+				"@oxc-resolver/binding-darwin-x64": "11.21.2",
+				"@oxc-resolver/binding-freebsd-x64": "11.21.2",
+				"@oxc-resolver/binding-linux-arm-gnueabihf": "11.21.2",
+				"@oxc-resolver/binding-linux-arm-musleabihf": "11.21.2",
+				"@oxc-resolver/binding-linux-arm64-gnu": "11.21.2",
+				"@oxc-resolver/binding-linux-arm64-musl": "11.21.2",
+				"@oxc-resolver/binding-linux-ppc64-gnu": "11.21.2",
+				"@oxc-resolver/binding-linux-riscv64-gnu": "11.21.2",
+				"@oxc-resolver/binding-linux-riscv64-musl": "11.21.2",
+				"@oxc-resolver/binding-linux-s390x-gnu": "11.21.2",
+				"@oxc-resolver/binding-linux-x64-gnu": "11.21.2",
+				"@oxc-resolver/binding-linux-x64-musl": "11.21.2",
+				"@oxc-resolver/binding-openharmony-arm64": "11.21.2",
+				"@oxc-resolver/binding-wasm32-wasi": "11.21.2",
+				"@oxc-resolver/binding-win32-arm64-msvc": "11.21.2",
+				"@oxc-resolver/binding-win32-x64-msvc": "11.21.2"
+			}
+		},
 		"node_modules/oxfmt": {
 			"version": "0.73.0",
 			"resolved": "https://registry.npmjs.org/oxfmt/-/oxfmt-0.73.0.tgz",
@@ -3458,6 +5694,16 @@
 			"dev": true,
 			"license": "MIT"
 		},
+		"node_modules/pathval": {
+			"version": "2.0.1",
+			"resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz",
+			"integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">= 14.16"
+			}
+		},
 		"node_modules/picocolors": {
 			"version": "1.1.1",
 			"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
@@ -3561,6 +5807,23 @@
 				"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
 			}
 		},
+		"node_modules/prism-svelte": {
+			"version": "0.4.7",
+			"resolved": "https://registry.npmjs.org/prism-svelte/-/prism-svelte-0.4.7.tgz",
+			"integrity": "sha512-yABh19CYbM24V7aS7TuPYRNMqthxwbvx6FF/Rw920YbyBWO3tnyPIqRMgHuSVsLmuHkkBS1Akyof463FVdkeDQ==",
+			"dev": true,
+			"license": "MIT"
+		},
+		"node_modules/prismjs": {
+			"version": "1.30.0",
+			"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz",
+			"integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=6"
+			}
+		},
 		"node_modules/publint": {
 			"version": "0.3.25",
 			"resolved": "https://registry.npmjs.org/publint/-/publint-0.3.25.tgz",
@@ -3577,10 +5840,33 @@
 				"publint": "src/cli.js"
 			},
 			"engines": {
-				"node": ">=18"
+				"node": ">=18"
+			},
+			"funding": {
+				"url": "https://bjornlu.com/sponsor"
+			}
+		},
+		"node_modules/react": {
+			"version": "19.3.1",
+			"resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz",
+			"integrity": "sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=0.10.0"
+			}
+		},
+		"node_modules/react-dom": {
+			"version": "19.3.1",
+			"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.1.tgz",
+			"integrity": "sha512-Y0bARz53lhEC1NMCASs0/j+faB/zqt3R8hpvg1e8+61ZVJ4UL0UdC4cBbXfZMcIuhrfgeILTLe+ZeBCavQPtKQ==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"scheduler": "^0.28.0"
 			},
-			"funding": {
-				"url": "https://bjornlu.com/sponsor"
+			"peerDependencies": {
+				"react": "^19.3.1"
 			}
 		},
 		"node_modules/react-is": {
@@ -3604,6 +5890,50 @@
 				"url": "https://paulmillr.com/funding/"
 			}
 		},
+		"node_modules/recast": {
+			"version": "0.23.21",
+			"resolved": "https://registry.npmjs.org/recast/-/recast-0.23.21.tgz",
+			"integrity": "sha512-mFAyJq9vUbSTARLZUvAEf1z3YxlvAwswbmxMx2mPA/MSm4KmpwvwvhsH/NIrZhyOuwD60Lzyw2qh83uCbgTPYw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"ast-types": "^0.16.1",
+				"esprima": "~4.0.0",
+				"source-map": "~0.6.1",
+				"tiny-invariant": "^1.3.3",
+				"tslib": "^2.0.1"
+			},
+			"engines": {
+				"node": ">= 4"
+			}
+		},
+		"node_modules/redent": {
+			"version": "3.0.0",
+			"resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz",
+			"integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"indent-string": "^4.0.0",
+				"strip-indent": "^3.0.0"
+			},
+			"engines": {
+				"node": ">=8"
+			}
+		},
+		"node_modules/run-applescript": {
+			"version": "7.1.0",
+			"resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz",
+			"integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=18"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/sindresorhus"
+			}
+		},
 		"node_modules/runed": {
 			"version": "0.25.0",
 			"resolved": "https://registry.npmjs.org/runed/-/runed-0.25.0.tgz",
@@ -3633,6 +5963,13 @@
 				"node": ">=6"
 			}
 		},
+		"node_modules/scheduler": {
+			"version": "0.28.0",
+			"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz",
+			"integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/scule": {
 			"version": "1.3.0",
 			"resolved": "https://registry.npmjs.org/scule/-/scule-1.3.0.tgz",
@@ -3668,6 +6005,16 @@
 				"node": ">=18"
 			}
 		},
+		"node_modules/source-map": {
+			"version": "0.6.1",
+			"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+			"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+			"dev": true,
+			"license": "BSD-3-Clause",
+			"engines": {
+				"node": ">=0.10.0"
+			}
+		},
 		"node_modules/source-map-js": {
 			"version": "1.2.2",
 			"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",
@@ -3678,6 +6025,13 @@
 				"node": ">=0.10.0"
 			}
 		},
+		"node_modules/sqids": {
+			"version": "0.3.0",
+			"resolved": "https://registry.npmjs.org/sqids/-/sqids-0.3.0.tgz",
+			"integrity": "sha512-lOQK1ucVg+W6n3FhRwwSeUijxe93b51Bfz5PMRMihVf1iVkl82ePQG7V5vwrhzB11v0NtsR25PSZRGiSomJaJw==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/std-env": {
 			"version": "4.3.0",
 			"resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz",
@@ -3685,6 +6039,110 @@
 			"dev": true,
 			"license": "MIT"
 		},
+		"node_modules/storybook": {
+			"version": "10.6.2",
+			"resolved": "https://registry.npmjs.org/storybook/-/storybook-10.6.2.tgz",
+			"integrity": "sha512-qHDINMiapxFUxYb+xC3j8u7Y+85X3u+/PlytE/wmnyg+bU0agCW3jUmWP4vIh2MioO2jTK/2B3Lcw6IpRFzQBA==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@storybook/global": "^5.0.0",
+				"@storybook/icons": "^2.0.2",
+				"@testing-library/dom": "^10.4.1",
+				"@testing-library/jest-dom": "6.9.1",
+				"@testing-library/user-event": "^14.6.3",
+				"@vitest/expect": "3.2.4",
+				"@vitest/spy": "3.2.4",
+				"@webcontainer/env": "^1.1.1",
+				"esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0 || ^0.25.0 || ^0.26.0 || ^0.27.0 || ^0.28.0",
+				"jsonc-parser": "^3.3.1",
+				"open": "^10.2.0",
+				"oxc-parser": "^0.127.0",
+				"oxc-resolver": "11.21.2",
+				"recast": "^0.23.5",
+				"semver": "^7.7.3",
+				"use-sync-external-store": "^1.5.0",
+				"ws": "^8.21.1"
+			},
+			"bin": {
+				"storybook": "dist/bin/dispatcher.js"
+			},
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/storybook"
+			},
+			"peerDependencies": {
+				"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
+				"prettier": "^2 || ^3",
+				"vite-plus": "^0.1.15 || ^0.2.0"
+			},
+			"peerDependenciesMeta": {
+				"@types/react": {
+					"optional": true
+				},
+				"prettier": {
+					"optional": true
+				},
+				"vite-plus": {
+					"optional": true
+				}
+			}
+		},
+		"node_modules/storybook/node_modules/@vitest/spy": {
+			"version": "3.2.4",
+			"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz",
+			"integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"tinyspy": "^4.0.3"
+			},
+			"funding": {
+				"url": "https://opencollective.com/vitest"
+			}
+		},
+		"node_modules/strip-ansi": {
+			"version": "7.2.0",
+			"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
+			"integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"ansi-regex": "^6.2.2"
+			},
+			"engines": {
+				"node": ">=12"
+			},
+			"funding": {
+				"url": "https://github.com/chalk/strip-ansi?sponsor=1"
+			}
+		},
+		"node_modules/strip-ansi/node_modules/ansi-regex": {
+			"version": "6.4.0",
+			"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.4.0.tgz",
+			"integrity": "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=12"
+			},
+			"funding": {
+				"url": "https://github.com/chalk/ansi-regex?sponsor=1"
+			}
+		},
+		"node_modules/strip-indent": {
+			"version": "3.0.0",
+			"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
+			"integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"min-indent": "^1.0.0"
+			},
+			"engines": {
+				"node": ">=8"
+			}
+		},
 		"node_modules/style-to-object": {
 			"version": "1.0.14",
 			"resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.14.tgz",
@@ -3721,6 +6179,51 @@
 				"node": ">=18"
 			}
 		},
+		"node_modules/svelte-ast-print": {
+			"version": "0.4.2",
+			"resolved": "https://registry.npmjs.org/svelte-ast-print/-/svelte-ast-print-0.4.2.tgz",
+			"integrity": "sha512-hRHHufbJoArFmDYQKCpCvc0xUuIEfwYksvyLYEQyH+1xb5LD5sM/IthfooCdXZQtOIqXz6xm7NmaqdfwG4kh6w==",
+			"dev": true,
+			"funding": [
+				{
+					"type": "github",
+					"url": "https://github.com/sponsors/xeho91"
+				},
+				{
+					"type": "opencollective",
+					"url": "https://opencollective.com/xeho91"
+				}
+			],
+			"license": "MIT",
+			"dependencies": {
+				"esrap": "1.2.2",
+				"zimmerframe": "1.1.2"
+			},
+			"engines": {
+				"node": ">=18"
+			},
+			"peerDependencies": {
+				"svelte": "^5.0.0"
+			}
+		},
+		"node_modules/svelte-ast-print/node_modules/esrap": {
+			"version": "1.2.2",
+			"resolved": "https://registry.npmjs.org/esrap/-/esrap-1.2.2.tgz",
+			"integrity": "sha512-F2pSJklxx1BlQIQgooczXCPHmcWpn6EsP5oo73LQfonG9fIlIENQ8vMmfGXeojP9MrkzUNAfyU5vdFlR9shHAw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@jridgewell/sourcemap-codec": "^1.4.15",
+				"@types/estree": "^1.0.1"
+			}
+		},
+		"node_modules/svelte-ast-print/node_modules/zimmerframe": {
+			"version": "1.1.2",
+			"resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz",
+			"integrity": "sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/svelte-check": {
 			"version": "4.7.7",
 			"resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.7.7.tgz",
@@ -3842,6 +6345,19 @@
 			"integrity": "sha512-dMCuwDUY6Noz3zVKLefBC4wq+aJV20yc7vWmM7uTNGwtQSFF5kX7OUIUsxuVajz/bdt5Xqdah3/0NLjth+cM5A==",
 			"license": "MIT"
 		},
+		"node_modules/tagged-tag": {
+			"version": "1.0.0",
+			"resolved": "https://registry.npmjs.org/tagged-tag/-/tagged-tag-1.0.0.tgz",
+			"integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=20"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/sindresorhus"
+			}
+		},
 		"node_modules/tailwind-merge": {
 			"version": "3.7.0",
 			"resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.7.0.tgz",
@@ -3895,6 +6411,13 @@
 				"url": "https://opencollective.com/webpack"
 			}
 		},
+		"node_modules/tiny-invariant": {
+			"version": "1.3.3",
+			"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
+			"integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/tinybench": {
 			"version": "6.2.2",
 			"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.2.tgz",
@@ -3952,6 +6475,31 @@
 				"node": ">=14.0.0"
 			}
 		},
+		"node_modules/tinyspy": {
+			"version": "4.0.6",
+			"resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.6.tgz",
+			"integrity": "sha512-u8KszXvGfU68hVcZpRHKG28T0krMuv2G5nDhiHaMLen/gIuFEgIJhaJuO69qjnXg5paSrbPMFfx3brNuN8eVSg==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=14.0.0"
+			}
+		},
+		"node_modules/tmcp": {
+			"version": "1.20.1",
+			"resolved": "https://registry.npmjs.org/tmcp/-/tmcp-1.20.1.tgz",
+			"integrity": "sha512-fpUliSYZnYOlFbgpUtUAdyKWoLsjyyt1DZc/zvpY5r0aUUUwcp57od4iJGemLcrEQrRF2V7Niktmt7S5DYIqhw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@standard-schema/spec": "^1.0.0",
+				"@types/json-schema": "^7.0.15",
+				"json-rpc-2.0": "^1.7.1",
+				"sqids": "^0.3.0",
+				"uri-template-matcher": "^1.1.1",
+				"valibot": "^1.1.0"
+			}
+		},
 		"node_modules/totalist": {
 			"version": "3.0.1",
 			"resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz",
@@ -3962,6 +6510,23 @@
 				"node": ">=6"
 			}
 		},
+		"node_modules/ts-dedent": {
+			"version": "2.3.0",
+			"resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.3.0.tgz",
+			"integrity": "sha512-JfJeIHke7y2egdGGgRAvpCwYFUsHlM2gPcrVOxFkznt/4uzQ7HFmvE63iFHVLBJNDuyDOQgijDK/tXH/f6Msjg==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">=6.10"
+			}
+		},
+		"node_modules/tslib": {
+			"version": "2.8.1",
+			"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+			"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
+			"dev": true,
+			"license": "0BSD"
+		},
 		"node_modules/tw-animate-css": {
 			"version": "1.4.0",
 			"resolved": "https://registry.npmjs.org/tw-animate-css/-/tw-animate-css-1.4.0.tgz",
@@ -3972,6 +6537,19 @@
 				"url": "https://github.com/sponsors/Wombosvideo"
 			}
 		},
+		"node_modules/type-fest": {
+			"version": "2.19.0",
+			"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
+			"integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==",
+			"dev": true,
+			"license": "(MIT OR CC0-1.0)",
+			"engines": {
+				"node": ">=12.20"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/sindresorhus"
+			}
+		},
 		"node_modules/typescript": {
 			"version": "6.0.3",
 			"resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz",
@@ -3993,6 +6571,120 @@
 			"dev": true,
 			"license": "MIT"
 		},
+		"node_modules/unist-util-is": {
+			"version": "4.1.0",
+			"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz",
+			"integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==",
+			"dev": true,
+			"license": "MIT",
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/unified"
+			}
+		},
+		"node_modules/unist-util-stringify-position": {
+			"version": "2.0.3",
+			"resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz",
+			"integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@types/unist": "^2.0.2"
+			},
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/unified"
+			}
+		},
+		"node_modules/unist-util-visit": {
+			"version": "2.0.3",
+			"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz",
+			"integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@types/unist": "^2.0.0",
+				"unist-util-is": "^4.0.0",
+				"unist-util-visit-parents": "^3.0.0"
+			},
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/unified"
+			}
+		},
+		"node_modules/unist-util-visit-parents": {
+			"version": "3.1.1",
+			"resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz",
+			"integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@types/unist": "^2.0.0",
+				"unist-util-is": "^4.0.0"
+			},
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/unified"
+			}
+		},
+		"node_modules/universalify": {
+			"version": "2.0.1",
+			"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
+			"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
+			"dev": true,
+			"license": "MIT",
+			"engines": {
+				"node": ">= 10.0.0"
+			}
+		},
+		"node_modules/unplugin": {
+			"version": "2.3.11",
+			"resolved": "https://registry.npmjs.org/unplugin/-/unplugin-2.3.11.tgz",
+			"integrity": "sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@jridgewell/remapping": "^2.3.5",
+				"acorn": "^8.15.0",
+				"picomatch": "^4.0.3",
+				"webpack-virtual-modules": "^0.6.2"
+			},
+			"engines": {
+				"node": ">=18.12.0"
+			}
+		},
+		"node_modules/uri-template-matcher": {
+			"version": "1.1.2",
+			"resolved": "https://registry.npmjs.org/uri-template-matcher/-/uri-template-matcher-1.1.2.tgz",
+			"integrity": "sha512-uZc1h12jdO3m/R77SfTEOuo6VbMhgWznaawKpBjRGSJb7i91x5PgI37NQJtG+Cerxkk0yr1pylBY2qG1kQ+aEQ==",
+			"dev": true,
+			"license": "ISC"
+		},
+		"node_modules/use-sync-external-store": {
+			"version": "1.7.0",
+			"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.7.0.tgz",
+			"integrity": "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A==",
+			"dev": true,
+			"license": "MIT",
+			"peerDependencies": {
+				"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+			}
+		},
+		"node_modules/valibot": {
+			"version": "1.5.0",
+			"resolved": "https://registry.npmjs.org/valibot/-/valibot-1.5.0.tgz",
+			"integrity": "sha512-nil6AkP2TChWL43Z5uJ6GTxX01CUA+g8LWUM+N/rB9NBbkUMaUsi9PUNzlUPgoKASgmx9f7eGOYpJ04/fSa6FQ==",
+			"dev": true,
+			"license": "MIT",
+			"peerDependencies": {
+				"typescript": ">=5"
+			},
+			"peerDependenciesMeta": {
+				"typescript": {
+					"optional": true
+				}
+			}
+		},
 		"node_modules/vaul-svelte": {
 			"version": "1.0.0-next.7",
 			"resolved": "https://registry.npmjs.org/vaul-svelte/-/vaul-svelte-1.0.0-next.7.tgz",
@@ -4025,6 +6717,21 @@
 				"svelte": "^5.7.0"
 			}
 		},
+		"node_modules/vfile-message": {
+			"version": "2.0.4",
+			"resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz",
+			"integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"@types/unist": "^2.0.0",
+				"unist-util-stringify-position": "^2.0.0"
+			},
+			"funding": {
+				"type": "opencollective",
+				"url": "https://opencollective.com/unified"
+			}
+		},
 		"node_modules/vite": {
 			"name": "@voidzero-dev/vite-plus-core",
 			"version": "1.3.0",
@@ -4332,6 +7039,13 @@
 				"node": ">=12.20.0"
 			}
 		},
+		"node_modules/webpack-virtual-modules": {
+			"version": "0.6.2",
+			"resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz",
+			"integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==",
+			"dev": true,
+			"license": "MIT"
+		},
 		"node_modules/why-is-node-running": {
 			"version": "3.2.1",
 			"resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz",
@@ -4367,6 +7081,22 @@
 				}
 			}
 		},
+		"node_modules/wsl-utils": {
+			"version": "0.1.0",
+			"resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.1.0.tgz",
+			"integrity": "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==",
+			"dev": true,
+			"license": "MIT",
+			"dependencies": {
+				"is-wsl": "^3.1.0"
+			},
+			"engines": {
+				"node": ">=18"
+			},
+			"funding": {
+				"url": "https://github.com/sponsors/sindresorhus"
+			}
+		},
 		"node_modules/yuku-core": {
 			"version": "0.19.0",
 			"resolved": "https://registry.npmjs.org/yuku-core/-/yuku-core-0.19.0.tgz",
diff --git a/ui/lib/ui/package.json b/ui/lib/ui/package.json
index 5a93894fb..d0648d601 100644
--- a/ui/lib/ui/package.json
+++ b/ui/lib/ui/package.json
@@ -65,7 +65,7 @@
 		"./surfaces.css": "./dist/styles/surfaces.css"
 	},
 	"scripts": {
-		"dev": "vp dev",
+		"dev": "bash scripts/dev.sh",
 		"build": "vp build && npm run prepack",
 		"preview": "vp preview",
 		"prepare": "svelte-kit sync || echo ''",
@@ -74,9 +74,18 @@
 		"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
 		"test:unit": "vp test",
 		"test": "npm run test:unit -- --run",
+		"storybook": "storybook dev -p 6006",
+		"build-storybook": "storybook build",
 		"watch:package": "svelte-kit sync && svelte-package -w"
 	},
 	"devDependencies": {
+		"@chromatic-com/storybook": "^5.5.1",
+		"@storybook/addon-a11y": "^10.6.2",
+		"@storybook/addon-docs": "^10.6.2",
+		"@storybook/addon-mcp": "10.6.2",
+		"@storybook/addon-svelte-csf": "^5.1.5",
+		"@storybook/addon-vitest": "^10.6.2",
+		"@storybook/sveltekit": "^10.6.2",
 		"@sveltejs/adapter-auto": "^8.0.0",
 		"@sveltejs/kit": "^3.0.0",
 		"@sveltejs/package": "^2.5.8",
@@ -85,9 +94,11 @@
 		"@types/node": "^24",
 		"@vitest/browser-playwright": "5.0.5",
 		"@vitest/coverage-v8": "5.0.5",
+		"mdsvex": "0.12.7",
 		"mode-watcher": "^1.1.0",
 		"playwright": "^1.60.0",
 		"publint": "^0.3.21",
+		"storybook": "^10.6.2",
 		"svelte": "^5.57.1",
 		"svelte-check": "^4.6.0",
 		"tailwindcss": "^4.3.3",
diff --git a/ui/lib/ui/scripts/dev.sh b/ui/lib/ui/scripts/dev.sh
new file mode 100755
index 000000000..6c7552b13
--- /dev/null
+++ b/ui/lib/ui/scripts/dev.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Development script for @ggml-org/llama-ui (a Svelte library, not an app).
+#
+# Storybook on :6006 is the primary surface for building and testing components.
+# The SvelteKit sandbox (src/routes) runs via `vp dev` on :5173 as a demo harness.
+# To develop against the built package output from another repo, also run:
+#   npm run watch:package
+#
+# Usage:
+#   npm run dev
+
+echo "Starting development servers..."
+
+storybook dev -p 6006 --ci &
+vp dev &
+
+# Wait for all background processes
+wait
diff --git a/ui/lib/ui/src/lib/styles/surfaces.css b/ui/lib/ui/src/lib/styles/surfaces.css
index fa4aeb7ef..9f38783fd 100644
--- a/ui/lib/ui/src/lib/styles/surfaces.css
+++ b/ui/lib/ui/src/lib/styles/surfaces.css
@@ -131,15 +131,14 @@
 }

 /* Floating panel (menus, popovers, drawers): frosted fill, faint rim, lifted shadow. The edge is the hairline ring
-   baked into the shadow, not the border, so the two never draw a double edge; the border stays transparent so the
-   panel keeps its size. */
+   baked into the shadow; the panel's 1px border is its rim, the inner highlight right inside the ring. An inset
+   shadow for the rim would sit inside the border instead, and the 1px between the two would draw a double edge. */
 @utility matte-float {
 	background-color: var(--float-background, var(--float-panel-background));
-	border-color: transparent;
+	border-color: var(--float-panel-highlight);
 	color: var(--float-panel-text);
 	backdrop-filter: blur(var(--blur-surface)) saturate(1.5);
 	box-shadow:
-		inset 0 0 0 1px var(--float-panel-highlight),
 		var(--float-panel-shadow),
 		0 0 0 var(--elevation-ring-width) var(--float-panel-edge);
 }
diff --git a/ui/lib/ui/src/routes/+page.svelte b/ui/lib/ui/src/routes/+page.svelte
index d9c7b2d52..bb9fc89c0 100644
--- a/ui/lib/ui/src/routes/+page.svelte
+++ b/ui/lib/ui/src/routes/+page.svelte
@@ -5,10 +5,12 @@
 	const next = { light: 'dark', dark: 'system', system: 'light' } as const;
 </script>

-<!-- a quick check that the package's theme and components work in a SvelteKit app -->
+<!-- a quick check that the package's theme and components work in a SvelteKit app; Storybook is the showcase -->
 <div class="flex min-h-screen flex-col items-center justify-center gap-6 p-6">
 	<h1 class="text-heading">@ggml-org/llama-ui</h1>

+	<p class="text-body-sm text-muted-foreground">The full set is in Storybook: <code>npm run storybook</code></p>
+
 	<div class="flex flex-wrap items-center justify-center gap-3">
 		<Button>Default</Button>
 		<Button variant="secondary">Secondary</Button>
diff --git a/ui/apps/chat/tests/stories/a11y/ActionIcon.a11y.stories.svelte b/ui/lib/ui/tests/stories/app/ActionIcon.a11y.stories.svelte
similarity index 93%
rename from ui/apps/chat/tests/stories/a11y/ActionIcon.a11y.stories.svelte
rename to ui/lib/ui/tests/stories/app/ActionIcon.a11y.stories.svelte
index cef659d6c..2a0635015 100644
--- a/ui/apps/chat/tests/stories/a11y/ActionIcon.a11y.stories.svelte
+++ b/ui/lib/ui/tests/stories/app/ActionIcon.a11y.stories.svelte
@@ -10,7 +10,7 @@
 			layout: 'centered'
 		},
 		tags: ['!dev'],
-		title: 'Components/ActionIcon/Accessibility'
+		title: 'Llama UI/App components/ActionIcon/Accessibility'
 	});
 </script>

diff --git a/ui/lib/ui/tests/stories/app/ActionIcon.stories.svelte b/ui/lib/ui/tests/stories/app/ActionIcon.stories.svelte
new file mode 100644
index 000000000..ee3b1a62f
--- /dev/null
+++ b/ui/lib/ui/tests/stories/app/ActionIcon.stories.svelte
@@ -0,0 +1,34 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { Pencil, RefreshCw, Trash2 } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { ActionIcon } from '@ggml-org/llama-ui/app/actions';
+
+	// the small icon buttons under messages, code blocks and list rows
+	const { Story } = defineMeta({
+		component: ActionIcon,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/App components/ActionIcon'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2}>
+		<StateGalleryItem label="Ghost" note="default">
+			<div class="flex items-center gap-1">
+				<ActionIcon ariaLabel="Edit" icon={Pencil} tooltip="Edit" />
+
+				<ActionIcon ariaLabel="Regenerate" icon={RefreshCw} tooltip="Regenerate" />
+
+				<ActionIcon ariaLabel="Delete" icon={Trash2} tooltip="Delete" />
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled">
+			<ActionIcon ariaLabel="Edit" disabled icon={Pencil} tooltip="Edit" />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/app/SearchInput.stories.svelte b/ui/lib/ui/tests/stories/app/SearchInput.stories.svelte
new file mode 100644
index 000000000..13db4d2be
--- /dev/null
+++ b/ui/lib/ui/tests/stories/app/SearchInput.stories.svelte
@@ -0,0 +1,31 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { SearchInput } from '@ggml-org/llama-ui/app/forms';
+
+	// the search field of the sidebar, model lists and pickers, and how matches are marked
+	const { Story } = defineMeta({
+		component: SearchInput,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/App components/SearchInput'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2}>
+		<StateGalleryItem label="Empty">
+			<SearchInput placeholder="Search conversations..." />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="With value" note="clear button">
+			<SearchInput value="llama" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Small">
+			<SearchInput placeholder="Filter models..." size="sm" />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/app/SyntaxHighlightedCode.stories.svelte b/ui/lib/ui/tests/stories/app/SyntaxHighlightedCode.stories.svelte
new file mode 100644
index 000000000..e3bd6cc2a
--- /dev/null
+++ b/ui/lib/ui/tests/stories/app/SyntaxHighlightedCode.stories.svelte
@@ -0,0 +1,23 @@
+<script lang="ts" module>
+	import { SyntaxHighlightedCode } from '@ggml-org/llama-ui/app/content';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: SyntaxHighlightedCode,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/App components/SyntaxHighlightedCode'
+	});
+
+	const code = `fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
+    if x.len() > y.len() { x } else { y }
+}
+
+fn main() {
+    let a = String::from("borrow");
+    println!("{}", longest(&a, "checker"));
+}`;
+</script>
+
+<Story args={{ class: 'w-[36rem]', code, language: 'rust' }} name="Default" />
diff --git a/ui/lib/ui/tests/stories/brand/fonts/LlamaMono.woff2 b/ui/lib/ui/tests/stories/brand/fonts/LlamaMono.woff2
new file mode 100644
index 000000000..f43b2588d
Binary files /dev/null and b/ui/lib/ui/tests/stories/brand/fonts/LlamaMono.woff2 differ
diff --git a/ui/lib/ui/tests/stories/brand/fonts/OFL.txt b/ui/lib/ui/tests/stories/brand/fonts/OFL.txt
new file mode 100644
index 000000000..04e95fc55
--- /dev/null
+++ b/ui/lib/ui/tests/stories/brand/fonts/OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
\ No newline at end of file
diff --git a/ui/lib/ui/tests/stories/brand/fonts/fonts.css b/ui/lib/ui/tests/stories/brand/fonts/fonts.css
new file mode 100644
index 000000000..8d9409b2f
--- /dev/null
+++ b/ui/lib/ui/tests/stories/brand/fonts/fonts.css
@@ -0,0 +1,8 @@
+/* Llama Mono for the brand showcases (logo and type); Llama Sans is the design system's own (src/app.css) */
+@font-face {
+	font-family: 'Llama Mono';
+	src: url('./LlamaMono.woff2') format('woff2');
+	font-weight: 400 700;
+	font-style: normal;
+	font-display: block;
+}
diff --git a/ui/lib/ui/tests/stories/components/actions/Button.stories.svelte b/ui/lib/ui/tests/stories/components/actions/Button.stories.svelte
new file mode 100644
index 000000000..bbabfd5a0
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/actions/Button.stories.svelte
@@ -0,0 +1,54 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import type { ButtonSize, ButtonVariant } from '@ggml-org/llama-ui/ui/button';
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import { Plus, Trash2 } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Button,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Actions/Button'
+	});
+
+	const variants: NonNullable<ButtonVariant>[] = [
+		'default',
+		'secondary',
+		'tertiary',
+		'outline',
+		'ghost',
+		'destructive'
+	];
+	const sizes: NonNullable<ButtonSize>[] = ['sm', 'default', 'lg'];
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={4}>
+		{#each variants as variant (variant)}
+			<StateGalleryItem label={variant}>
+				<div class="flex flex-wrap items-center gap-2">
+					{#each sizes as size (size)}
+						<Button {size} {variant}>Button</Button>
+					{/each}
+
+					<Button aria-label="Add" size="icon" {variant}>
+						<Plus />
+					</Button>
+
+					<Button disabled {variant}>Disabled</Button>
+				</div>
+			</StateGalleryItem>
+		{/each}
+
+		<StateGalleryItem label="With icon">
+			<div class="flex flex-wrap items-center gap-2">
+				<Button><Plus /> New chat</Button>
+
+				<Button variant="destructive"><Trash2 /> Delete</Button>
+			</div>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/actions/ButtonGroup.stories.svelte b/ui/lib/ui/tests/stories/components/actions/ButtonGroup.stories.svelte
new file mode 100644
index 000000000..9704b419c
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/actions/ButtonGroup.stories.svelte
@@ -0,0 +1,92 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import * as ButtonGroup from '@ggml-org/llama-ui/ui/button-group';
+	import { ChevronDown, Copy, Pencil, Trash2 } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: ButtonGroup.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Actions/ButtonGroup'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2} minItemWidth="16rem">
+		<StateGalleryItem label="Outline">
+			<ButtonGroup.Root>
+				<Button variant="outline">Copy</Button>
+
+				<Button variant="outline">Edit</Button>
+
+				<Button variant="outline">Delete</Button>
+			</ButtonGroup.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Icons">
+			<ButtonGroup.Root>
+				<Button aria-label="Copy" size="icon" variant="outline"><Copy /></Button>
+
+				<Button aria-label="Edit" size="icon" variant="outline"><Pencil /></Button>
+
+				<Button aria-label="Delete" size="icon" variant="outline"><Trash2 /></Button>
+			</ButtonGroup.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Split" note="with separator">
+			<ButtonGroup.Root>
+				<Button variant="outline">Send</Button>
+
+				<ButtonGroup.Separator />
+
+				<Button aria-label="More options" size="icon" variant="outline"><ChevronDown /></Button>
+			</ButtonGroup.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Small split" note="as in tool permission requests">
+			<ButtonGroup.Root>
+				<Button size="sm" variant="outline">Allow once</Button>
+
+				<ButtonGroup.Separator />
+
+				<Button aria-label="More allow options" class="px-2" size="sm" variant="outline">
+					<ChevronDown />
+				</Button>
+			</ButtonGroup.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Primary split">
+			<ButtonGroup.Root>
+				<Button>Send</Button>
+
+				<ButtonGroup.Separator />
+
+				<Button aria-label="More options" size="icon"><ChevronDown /></Button>
+			</ButtonGroup.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Primary">
+			<ButtonGroup.Root>
+				<Button>Copy</Button>
+
+				<Button>Edit</Button>
+
+				<Button>Delete</Button>
+			</ButtonGroup.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Secondary">
+			<ButtonGroup.Root>
+				<Button variant="secondary">Copy</Button>
+
+				<Button variant="secondary">Edit</Button>
+
+				<Button variant="secondary">Delete</Button>
+			</ButtonGroup.Root>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/actions/Toggle.stories.svelte b/ui/lib/ui/tests/stories/components/actions/Toggle.stories.svelte
new file mode 100644
index 000000000..15594608f
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/actions/Toggle.stories.svelte
@@ -0,0 +1,66 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import { Toggle } from '@ggml-org/llama-ui/ui/toggle';
+	import { Bold, Italic, WrapText } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Toggle,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Actions/Toggle'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={4} minItemWidth="10rem">
+		<StateGalleryItem label="Off">
+			<Toggle aria-label="Bold" size="icon"><Bold /></Toggle>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="On">
+			<Toggle aria-label="Bold" pressed size="icon"><Bold /></Toggle>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Outline">
+			<div class="flex gap-2">
+				<Toggle aria-label="Italic" size="icon" variant="outline"><Italic /></Toggle>
+
+				<Toggle aria-label="Italic" pressed size="icon" variant="outline"><Italic /></Toggle>
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Sizes" note="sm, default, lg">
+			<div class="flex items-center gap-2">
+				<Toggle size="sm" variant="outline">Wrap</Toggle>
+
+				<Toggle variant="outline">Wrap</Toggle>
+
+				<Toggle size="lg" variant="outline">Wrap</Toggle>
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled">
+			<Toggle aria-label="Bold" disabled size="icon"><Bold /></Toggle>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Next to Button" note="same height, padding and corners" span={3}>
+			<div class="flex items-center gap-2">
+				<Button variant="outline">Button</Button>
+
+				<Toggle variant="outline">Toggle</Toggle>
+
+				<Button variant="outline"><WrapText /> Wrap</Button>
+
+				<Toggle pressed variant="outline"><WrapText /> Wrap</Toggle>
+
+				<Button aria-label="Bold" size="icon" variant="outline"><Bold /></Button>
+
+				<Toggle aria-label="Bold" size="icon" variant="outline"><Bold /></Toggle>
+			</div>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/actions/ToggleGroup.stories.svelte b/ui/lib/ui/tests/stories/components/actions/ToggleGroup.stories.svelte
new file mode 100644
index 000000000..73eabcf47
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/actions/ToggleGroup.stories.svelte
@@ -0,0 +1,75 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import type { ToggleSize } from '@ggml-org/llama-ui/ui/toggle';
+	import * as ToggleGroup from '@ggml-org/llama-ui/ui/toggle-group';
+	import { AlignCenter, AlignLeft, AlignRight } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: ToggleGroup.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Actions/ToggleGroup'
+	});
+
+	const sizes: NonNullable<ToggleSize>[] = ['icon-sm', 'icon', 'icon-lg'];
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2} minItemWidth="16rem">
+		<StateGalleryItem label="Single" note="icons">
+			<ToggleGroup.Root size="icon-sm" type="single" value="center">
+				<ToggleGroup.Item aria-label="Align left" value="left"><AlignLeft /></ToggleGroup.Item>
+
+				<ToggleGroup.Item aria-label="Align center" value="center"><AlignCenter /></ToggleGroup.Item
+				>
+
+				<ToggleGroup.Item aria-label="Align right" value="right"><AlignRight /></ToggleGroup.Item>
+			</ToggleGroup.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Nothing pressed">
+			<ToggleGroup.Root type="multiple" value={[]}>
+				<ToggleGroup.Item value="tools">Tools</ToggleGroup.Item>
+
+				<ToggleGroup.Item value="vision">Vision</ToggleGroup.Item>
+
+				<ToggleGroup.Item value="audio">Audio</ToggleGroup.Item>
+			</ToggleGroup.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Multiple" note="the unpressed keys mute">
+			<ToggleGroup.Root type="multiple" value={['tools', 'vision']}>
+				<ToggleGroup.Item value="tools">Tools</ToggleGroup.Item>
+
+				<ToggleGroup.Item value="vision">Vision</ToggleGroup.Item>
+
+				<ToggleGroup.Item value="audio">Audio</ToggleGroup.Item>
+			</ToggleGroup.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Sizes" note="icon-sm, icon, icon-lg">
+			<div class="flex items-center gap-3">
+				{#each sizes as size (size)}
+					<ToggleGroup.Root {size} type="single" value="left">
+						<ToggleGroup.Item aria-label="Align left" value="left"><AlignLeft /></ToggleGroup.Item>
+
+						<ToggleGroup.Item aria-label="Align right" value="right"
+							><AlignRight /></ToggleGroup.Item
+						>
+					</ToggleGroup.Root>
+				{/each}
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled">
+			<ToggleGroup.Root disabled size="icon-sm" type="single" value="left">
+				<ToggleGroup.Item aria-label="Align left" value="left"><AlignLeft /></ToggleGroup.Item>
+
+				<ToggleGroup.Item aria-label="Align right" value="right"><AlignRight /></ToggleGroup.Item>
+			</ToggleGroup.Root>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/display/Alert.stories.svelte b/ui/lib/ui/tests/stories/components/display/Alert.stories.svelte
new file mode 100644
index 000000000..85e7ca7cb
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/display/Alert.stories.svelte
@@ -0,0 +1,77 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import * as Alert from '@ggml-org/llama-ui/ui/alert';
+	import { CircleAlert, CircleCheck, Info, TriangleAlert } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Alert.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Display/Alert'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2} minItemWidth="20rem">
+		<StateGalleryItem label="Default">
+			<Alert.Root>
+				<Info />
+
+				<Alert.Title>Model is loading</Alert.Title>
+
+				<Alert.Description>The first reply can take a few seconds.</Alert.Description>
+			</Alert.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Destructive">
+			<Alert.Root variant="destructive">
+				<CircleAlert />
+
+				<Alert.Title>Context is full</Alert.Title>
+
+				<Alert.Description>Start a new chat or remove some attachments.</Alert.Description>
+			</Alert.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Success">
+			<Alert.Root variant="success">
+				<CircleCheck />
+
+				<Alert.Title>Model loaded</Alert.Title>
+
+				<Alert.Description>Qwen 2.5 7B is ready on port 9931.</Alert.Description>
+			</Alert.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Warning">
+			<Alert.Root variant="warning">
+				<TriangleAlert />
+
+				<Alert.Title>Low memory</Alert.Title>
+
+				<Alert.Description>Gemma 2 27B needs 16.6 GB; 12 GB is free.</Alert.Description>
+			</Alert.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Info">
+			<Alert.Root variant="info">
+				<Info />
+
+				<Alert.Title>Update available</Alert.Title>
+
+				<Alert.Description>llama.cpp b9726 adds faster prompt processing.</Alert.Description>
+			</Alert.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Title only">
+			<Alert.Root>
+				<Info />
+
+				<Alert.Title>Saved to this browser</Alert.Title>
+			</Alert.Root>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/display/Badge.stories.svelte b/ui/lib/ui/tests/stories/components/display/Badge.stories.svelte
new file mode 100644
index 000000000..86862b0fa
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/display/Badge.stories.svelte
@@ -0,0 +1,35 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { Badge, type BadgeVariant } from '@ggml-org/llama-ui/ui/badge';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Badge,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Display/Badge'
+	});
+
+	const variants: NonNullable<BadgeVariant>[] = [
+		'default',
+		'secondary',
+		'outline',
+		'destructive',
+		'success',
+		'warning',
+		'danger',
+		'info'
+	];
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={4} minItemWidth="8rem">
+		{#each variants as variant (variant)}
+			<StateGalleryItem label={variant}>
+				<Badge {variant}>Q4_K_M</Badge>
+			</StateGalleryItem>
+		{/each}
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/display/Card.stories.svelte b/ui/lib/ui/tests/stories/components/display/Card.stories.svelte
new file mode 100644
index 000000000..3119820d4
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/display/Card.stories.svelte
@@ -0,0 +1,33 @@
+<script lang="ts" module>
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import * as Card from '@ggml-org/llama-ui/ui/card';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Card.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Display/Card'
+	});
+</script>
+
+<Story asChild name="Default">
+	<Card.Root class="w-96">
+		<Card.Header>
+			<Card.Title>Qwen3.8-27B</Card.Title>
+
+			<Card.Description>131k context, vision and tool use</Card.Description>
+		</Card.Header>
+
+		<Card.Content class="text-sm text-muted-foreground">
+			Loaded on the server and ready to answer.
+		</Card.Content>
+
+		<Card.Footer class="justify-end gap-2">
+			<Button size="sm" variant="ghost">Unload</Button>
+
+			<Button size="sm">Start chat</Button>
+		</Card.Footer>
+	</Card.Root>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/display/Collapsible.stories.svelte b/ui/lib/ui/tests/stories/components/display/Collapsible.stories.svelte
new file mode 100644
index 000000000..2546c3c2a
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/display/Collapsible.stories.svelte
@@ -0,0 +1,52 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import * as Collapsible from '@ggml-org/llama-ui/ui/collapsible';
+	import { ChevronsUpDown } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Collapsible.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Display/Collapsible'
+	});
+</script>
+
+{#snippet section(open: boolean)}
+	<Collapsible.Root class="w-72 space-y-2" {open}>
+		<div class="flex items-center justify-between">
+			<span class="text-sm font-medium">Advanced sampling</span>
+
+			<Collapsible.Trigger>
+				{#snippet child({ props })}
+					<Button {...props} aria-label="Toggle" size="icon" variant="ghost">
+						<ChevronsUpDown />
+					</Button>
+				{/snippet}
+			</Collapsible.Trigger>
+		</div>
+
+		<div class="rounded-md border px-4 py-2 font-mono text-sm">temperature 0.8</div>
+
+		<Collapsible.Content class="space-y-2">
+			<div class="rounded-md border px-4 py-2 font-mono text-sm">top_p 0.95</div>
+
+			<div class="rounded-md border px-4 py-2 font-mono text-sm">min_p 0.05</div>
+		</Collapsible.Content>
+	</Collapsible.Root>
+{/snippet}
+
+<Story asChild name="Default">
+	<StateGallery columns={2} minItemWidth="18rem">
+		<StateGalleryItem label="Closed">
+			{@render section(false)}
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Open">
+			{@render section(true)}
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/display/Empty.stories.svelte b/ui/lib/ui/tests/stories/components/display/Empty.stories.svelte
new file mode 100644
index 000000000..4e24b3fc8
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/display/Empty.stories.svelte
@@ -0,0 +1,32 @@
+<script lang="ts" module>
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import * as Empty from '@ggml-org/llama-ui/ui/empty';
+	import { MessagesSquare } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Empty.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Display/Empty'
+	});
+</script>
+
+<Story asChild name="Default">
+	<Empty.Root class="w-96 border">
+		<Empty.Header>
+			<Empty.Media variant="icon">
+				<MessagesSquare />
+			</Empty.Media>
+
+			<Empty.Title>No conversations yet</Empty.Title>
+
+			<Empty.Description>Your chats are saved in this browser and show up here.</Empty.Description>
+		</Empty.Header>
+
+		<Empty.Content>
+			<Button size="sm">New chat</Button>
+		</Empty.Content>
+	</Empty.Root>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/display/ScrollArea.stories.svelte b/ui/lib/ui/tests/stories/components/display/ScrollArea.stories.svelte
new file mode 100644
index 000000000..5f352b904
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/display/ScrollArea.stories.svelte
@@ -0,0 +1,29 @@
+<script lang="ts" module>
+	import { ScrollArea } from '@ggml-org/llama-ui/ui/scroll-area';
+	import { Separator } from '@ggml-org/llama-ui/ui/separator';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: ScrollArea,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Display/ScrollArea'
+	});
+
+	const chats = Array.from({ length: 30 }, (_, i) => `Conversation ${i + 1}`);
+</script>
+
+<Story asChild name="Default">
+	<ScrollArea class="h-72 w-56 rounded-md border">
+		<div class="p-4">
+			<h4 class="mb-4 text-sm font-medium">Conversations</h4>
+
+			{#each chats as chat (chat)}
+				<div class="text-sm">{chat}</div>
+
+				<Separator class="my-2" />
+			{/each}
+		</div>
+	</ScrollArea>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/display/Separator.stories.svelte b/ui/lib/ui/tests/stories/components/display/Separator.stories.svelte
new file mode 100644
index 000000000..8a659c0d9
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/display/Separator.stories.svelte
@@ -0,0 +1,34 @@
+<script lang="ts" module>
+	import { Separator } from '@ggml-org/llama-ui/ui/separator';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Separator,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Display/Separator'
+	});
+</script>
+
+<Story asChild name="Default">
+	<div class="w-80 text-sm">
+		<p class="font-medium">Qwen3.8-27B</p>
+
+		<p class="text-muted-foreground">Loaded, 131k context</p>
+
+		<Separator class="my-4" />
+
+		<div class="flex h-5 items-center gap-4">
+			<span>Chat</span>
+
+			<Separator orientation="vertical" />
+
+			<span>Models</span>
+
+			<Separator orientation="vertical" />
+
+			<span>Settings</span>
+		</div>
+	</div>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/display/Skeleton.stories.svelte b/ui/lib/ui/tests/stories/components/display/Skeleton.stories.svelte
new file mode 100644
index 000000000..ae2dba5ff
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/display/Skeleton.stories.svelte
@@ -0,0 +1,40 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { Skeleton } from '@ggml-org/llama-ui/ui/skeleton';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Skeleton,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Display/Skeleton'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2} minItemWidth="16rem">
+		<StateGalleryItem label="Text lines">
+			<div class="space-y-2">
+				<Skeleton class="h-4 w-3/4" />
+
+				<Skeleton class="h-4 w-full" />
+
+				<Skeleton class="h-4 w-1/2" />
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="List item">
+			<div class="flex items-center gap-3">
+				<Skeleton class="size-10 rounded-full" />
+
+				<div class="flex-1 space-y-2">
+					<Skeleton class="h-4 w-2/3" />
+
+					<Skeleton class="h-3 w-1/3" />
+				</div>
+			</div>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/display/Table.stories.svelte b/ui/lib/ui/tests/stories/components/display/Table.stories.svelte
new file mode 100644
index 000000000..d253cc53a
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/display/Table.stories.svelte
@@ -0,0 +1,60 @@
+<script lang="ts" module>
+	import * as Table from '@ggml-org/llama-ui/ui/table';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Table.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Display/Table'
+	});
+
+	const rows = [
+		{ context: '131k', model: 'Qwen3.8-27B', quant: 'Q4_K_M', size: '16.4 GB' },
+		{ context: '131k', model: 'Qwen3.8-27B', quant: 'Q8_0', size: '28.7 GB' },
+		{ context: '8k', model: 'Llama-3.2-3B', quant: 'Q4_K_M', size: '2.0 GB' }
+	];
+</script>
+
+<Story asChild name="Default">
+	<div class="w-[36rem]">
+		<Table.Root>
+			<Table.Caption>Models on this server</Table.Caption>
+
+			<Table.Header>
+				<Table.Row>
+					<Table.Head>Model</Table.Head>
+
+					<Table.Head>Quant</Table.Head>
+
+					<Table.Head>Context</Table.Head>
+
+					<Table.Head class="text-right">Size</Table.Head>
+				</Table.Row>
+			</Table.Header>
+
+			<Table.Body>
+				{#each rows as row (row.model + row.quant)}
+					<Table.Row>
+						<Table.Cell class="font-medium">{row.model}</Table.Cell>
+
+						<Table.Cell>{row.quant}</Table.Cell>
+
+						<Table.Cell>{row.context}</Table.Cell>
+
+						<Table.Cell class="text-right">{row.size}</Table.Cell>
+					</Table.Row>
+				{/each}
+			</Table.Body>
+
+			<Table.Footer>
+				<Table.Row>
+					<Table.Cell colspan={3}>Total</Table.Cell>
+
+					<Table.Cell class="text-right">47.1 GB</Table.Cell>
+				</Table.Row>
+			</Table.Footer>
+		</Table.Root>
+	</div>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/forms/Checkbox.stories.svelte b/ui/lib/ui/tests/stories/components/forms/Checkbox.stories.svelte
new file mode 100644
index 000000000..a091f0675
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/forms/Checkbox.stories.svelte
@@ -0,0 +1,39 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { Checkbox } from '@ggml-org/llama-ui/ui/checkbox';
+	import { Label } from '@ggml-org/llama-ui/ui/label';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Checkbox,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Forms/Checkbox'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={5} minItemWidth="8rem">
+		<StateGalleryItem label="Off">
+			<Label class="flex items-center gap-2"><Checkbox /> Tools</Label>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="On">
+			<Label class="flex items-center gap-2"><Checkbox checked /> Tools</Label>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Indeterminate">
+			<Label class="flex items-center gap-2"><Checkbox indeterminate /> Tools</Label>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Invalid">
+			<Label class="flex items-center gap-2"><Checkbox aria-invalid="true" /> Accept</Label>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled">
+			<Label class="flex items-center gap-2"><Checkbox disabled /> Tools</Label>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/forms/Input.stories.svelte b/ui/lib/ui/tests/stories/components/forms/Input.stories.svelte
new file mode 100644
index 000000000..14404c5a9
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/forms/Input.stories.svelte
@@ -0,0 +1,38 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { Input } from '@ggml-org/llama-ui/ui/input';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Input,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Forms/Input'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2}>
+		<StateGalleryItem label="Empty">
+			<Input placeholder="http://localhost:9931" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Filled">
+			<Input value="http://localhost:9931" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Invalid">
+			<Input aria-invalid="true" value="not a url" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled">
+			<Input disabled value="Read only" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="File">
+			<Input type="file" />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/forms/Label.stories.svelte b/ui/lib/ui/tests/stories/components/forms/Label.stories.svelte
new file mode 100644
index 000000000..dcf3a927d
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/forms/Label.stories.svelte
@@ -0,0 +1,21 @@
+<script lang="ts" module>
+	import { Input } from '@ggml-org/llama-ui/ui/input';
+	import { Label } from '@ggml-org/llama-ui/ui/label';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Label,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Forms/Label'
+	});
+</script>
+
+<Story asChild name="Default">
+	<div class="grid w-72 gap-2">
+		<Label for="story-api-key">API key</Label>
+
+		<Input id="story-api-key" placeholder="sk-..." />
+	</div>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/forms/RadioGroup.stories.svelte b/ui/lib/ui/tests/stories/components/forms/RadioGroup.stories.svelte
new file mode 100644
index 000000000..1e31f1268
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/forms/RadioGroup.stories.svelte
@@ -0,0 +1,43 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { Label } from '@ggml-org/llama-ui/ui/label';
+	import * as RadioGroup from '@ggml-org/llama-ui/ui/radio-group';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: RadioGroup.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Forms/RadioGroup'
+	});
+
+	const options = ['System', 'Light', 'Dark'];
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2} minItemWidth="12rem">
+		<StateGalleryItem label="Enabled">
+			<RadioGroup.Root value="System">
+				{#each options as option (option)}
+					<Label class="flex items-center gap-2">
+						<RadioGroup.Item value={option} />
+						{option}
+					</Label>
+				{/each}
+			</RadioGroup.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled">
+			<RadioGroup.Root disabled value="Dark">
+				{#each options as option (option)}
+					<Label class="flex items-center gap-2">
+						<RadioGroup.Item value={option} />
+						{option}
+					</Label>
+				{/each}
+			</RadioGroup.Root>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/forms/Select.stories.svelte b/ui/lib/ui/tests/stories/components/forms/Select.stories.svelte
new file mode 100644
index 000000000..bd3e17432
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/forms/Select.stories.svelte
@@ -0,0 +1,60 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import * as Select from '@ggml-org/llama-ui/ui/select';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Select.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Forms/Select'
+	});
+
+	const themes = [
+		{ label: 'System', value: 'system' },
+		{ label: 'Light', value: 'light' },
+		{ label: 'Dark', value: 'dark' }
+	];
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={3} minItemWidth="12rem">
+		<StateGalleryItem label="Placeholder">
+			<Select.Root type="single">
+				<Select.Trigger class="w-44">Choose a theme</Select.Trigger>
+			</Select.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Selected">
+			<Select.Root type="single" value="dark">
+				<Select.Trigger class="w-44">Dark</Select.Trigger>
+			</Select.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled">
+			<Select.Root disabled type="single" value="system">
+				<Select.Trigger class="w-44">System</Select.Trigger>
+			</Select.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="With options" note="click to open the list" span={3}>
+			<div class="h-48">
+				<Select.Root type="single" value="light">
+					<Select.Trigger class="w-44">Light</Select.Trigger>
+
+					<Select.Content>
+						<Select.Group>
+							<Select.Label>Theme</Select.Label>
+
+							{#each themes as theme (theme.value)}
+								<Select.Item label={theme.label} value={theme.value} />
+							{/each}
+						</Select.Group>
+					</Select.Content>
+				</Select.Root>
+			</div>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/forms/Switch.stories.svelte b/ui/lib/ui/tests/stories/components/forms/Switch.stories.svelte
new file mode 100644
index 000000000..c9cb3453f
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/forms/Switch.stories.svelte
@@ -0,0 +1,35 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { Label } from '@ggml-org/llama-ui/ui/label';
+	import { Switch } from '@ggml-org/llama-ui/ui/switch';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Switch,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Forms/Switch'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={4} minItemWidth="9rem">
+		<StateGalleryItem label="Off">
+			<Label class="flex items-center gap-2"><Switch /> Stream</Label>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="On">
+			<Label class="flex items-center gap-2"><Switch checked /> Stream</Label>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled, off">
+			<Label class="flex items-center gap-2"><Switch disabled /> Stream</Label>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled, on">
+			<Label class="flex items-center gap-2"><Switch checked disabled /> Stream</Label>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/forms/Textarea.stories.svelte b/ui/lib/ui/tests/stories/components/forms/Textarea.stories.svelte
new file mode 100644
index 000000000..779c15222
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/forms/Textarea.stories.svelte
@@ -0,0 +1,34 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import { Textarea } from '@ggml-org/llama-ui/ui/textarea';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Textarea,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Forms/Textarea'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2}>
+		<StateGalleryItem label="Empty">
+			<Textarea placeholder="You are a helpful assistant." />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Filled">
+			<Textarea value="You are a concise assistant. Answer in plain English and cite sources." />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Invalid">
+			<Textarea aria-invalid="true" value="{'{'} not valid json" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled">
+			<Textarea disabled value="Set by the server" />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/navigation/Tabs.stories.svelte b/ui/lib/ui/tests/stories/components/navigation/Tabs.stories.svelte
new file mode 100644
index 000000000..fea7c211d
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/navigation/Tabs.stories.svelte
@@ -0,0 +1,71 @@
+<script lang="ts" module>
+	import StateGallery from '../../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../../helpers/StateGalleryItem.svelte';
+	import * as Tabs from '@ggml-org/llama-ui/ui/tabs';
+	import { Cpu, MessageSquare, Wrench } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Tabs.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Navigation/Tabs'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2} minItemWidth="20rem">
+		<StateGalleryItem label="Default" note="segmented track">
+			<Tabs.Root value="general">
+				<Tabs.List>
+					<Tabs.Trigger value="general">General</Tabs.Trigger>
+
+					<Tabs.Trigger value="sampling">Sampling</Tabs.Trigger>
+
+					<Tabs.Trigger value="tools">Tools</Tabs.Trigger>
+				</Tabs.List>
+
+				<Tabs.Content class="pt-2 text-fg-muted" value="general">General settings.</Tabs.Content>
+
+				<Tabs.Content class="pt-2 text-fg-muted" value="sampling">Sampling settings.</Tabs.Content>
+
+				<Tabs.Content class="pt-2 text-fg-muted" value="tools">Tool settings.</Tabs.Content>
+			</Tabs.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="With icons">
+			<Tabs.Root value="chat">
+				<Tabs.List>
+					<Tabs.Trigger value="chat"><MessageSquare /> Chat</Tabs.Trigger>
+
+					<Tabs.Trigger value="model"><Cpu /> Model</Tabs.Trigger>
+
+					<Tabs.Trigger value="tools"><Wrench /> Tools</Tabs.Trigger>
+				</Tabs.List>
+			</Tabs.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Line">
+			<Tabs.Root value="general">
+				<Tabs.List variant="line">
+					<Tabs.Trigger value="general">General</Tabs.Trigger>
+
+					<Tabs.Trigger value="sampling">Sampling</Tabs.Trigger>
+
+					<Tabs.Trigger value="tools">Tools</Tabs.Trigger>
+				</Tabs.List>
+			</Tabs.Root>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Disabled tab">
+			<Tabs.Root value="general">
+				<Tabs.List>
+					<Tabs.Trigger value="general">General</Tabs.Trigger>
+
+					<Tabs.Trigger disabled value="sampling">Sampling</Tabs.Trigger>
+				</Tabs.List>
+			</Tabs.Root>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/overlays/AlertDialog.stories.svelte b/ui/lib/ui/tests/stories/components/overlays/AlertDialog.stories.svelte
new file mode 100644
index 000000000..755767ac9
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/overlays/AlertDialog.stories.svelte
@@ -0,0 +1,41 @@
+<script lang="ts" module>
+	import * as AlertDialog from '@ggml-org/llama-ui/ui/alert-dialog';
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: AlertDialog.Root,
+		parameters: {
+			layout: 'fullscreen'
+		},
+		title: 'Llama UI/Components/Overlays/AlertDialog'
+	});
+</script>
+
+<Story asChild name="Default">
+	<div class="grid h-screen place-items-center">
+		<AlertDialog.Root open>
+			<AlertDialog.Trigger>
+				{#snippet child({ props })}
+					<Button {...props} variant="destructive">Delete conversation</Button>
+				{/snippet}
+			</AlertDialog.Trigger>
+
+			<AlertDialog.Content>
+				<AlertDialog.Header>
+					<AlertDialog.Title>Delete this conversation?</AlertDialog.Title>
+
+					<AlertDialog.Description>
+						All of its messages are removed from this browser. This cannot be undone.
+					</AlertDialog.Description>
+				</AlertDialog.Header>
+
+				<AlertDialog.Footer>
+					<AlertDialog.Cancel>Cancel</AlertDialog.Cancel>
+
+					<AlertDialog.Action>Delete</AlertDialog.Action>
+				</AlertDialog.Footer>
+			</AlertDialog.Content>
+		</AlertDialog.Root>
+	</div>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/overlays/Dialog.stories.svelte b/ui/lib/ui/tests/stories/components/overlays/Dialog.stories.svelte
new file mode 100644
index 000000000..70da80ada
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/overlays/Dialog.stories.svelte
@@ -0,0 +1,51 @@
+<script lang="ts" module>
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import * as Dialog from '@ggml-org/llama-ui/ui/dialog';
+	import { Input } from '@ggml-org/llama-ui/ui/input';
+	import { Label } from '@ggml-org/llama-ui/ui/label';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Dialog.Root,
+		parameters: {
+			layout: 'fullscreen'
+		},
+		title: 'Llama UI/Components/Overlays/Dialog'
+	});
+</script>
+
+<Story asChild name="Default">
+	<div class="grid h-screen place-items-center">
+		<Dialog.Root open>
+			<Dialog.Trigger>
+				{#snippet child({ props })}
+					<Button {...props} variant="outline">Rename conversation</Button>
+				{/snippet}
+			</Dialog.Trigger>
+
+			<Dialog.Content class="sm:max-w-md">
+				<Dialog.Header>
+					<Dialog.Title>Rename conversation</Dialog.Title>
+
+					<Dialog.Description>The new name shows in the sidebar and in search.</Dialog.Description>
+				</Dialog.Header>
+
+				<div class="grid gap-2">
+					<Label for="story-dialog-name">Name</Label>
+
+					<Input id="story-dialog-name" value="Rust borrow checker" />
+				</div>
+
+				<Dialog.Footer>
+					<Dialog.Close>
+						{#snippet child({ props })}
+							<Button {...props} variant="outline">Cancel</Button>
+						{/snippet}
+					</Dialog.Close>
+
+					<Button>Save</Button>
+				</Dialog.Footer>
+			</Dialog.Content>
+		</Dialog.Root>
+	</div>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/overlays/Drawer.stories.svelte b/ui/lib/ui/tests/stories/components/overlays/Drawer.stories.svelte
new file mode 100644
index 000000000..cf91454ba
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/overlays/Drawer.stories.svelte
@@ -0,0 +1,49 @@
+<script lang="ts" module>
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import * as Drawer from '@ggml-org/llama-ui/ui/drawer';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Drawer.Root,
+		parameters: {
+			layout: 'fullscreen'
+		},
+		title: 'Llama UI/Components/Overlays/Drawer'
+	});
+</script>
+
+<Story asChild name="Default">
+	<div class="grid h-screen place-items-center">
+		<Drawer.Root open>
+			<Drawer.Trigger>
+				{#snippet child({ props })}
+					<Button {...props} variant="outline">Choose a model</Button>
+				{/snippet}
+			</Drawer.Trigger>
+
+			<Drawer.Content>
+				<div class="mx-auto w-full max-w-sm">
+					<Drawer.Header>
+						<Drawer.Title>Choose a model</Drawer.Title>
+
+						<Drawer.Description>Used on phones in place of the dropdown.</Drawer.Description>
+					</Drawer.Header>
+
+					<div class="space-y-1 px-4 text-sm">
+						<div class="rounded-md bg-accent px-3 py-2">Qwen3.8-27B</div>
+
+						<div class="rounded-md px-3 py-2">Llama-3.2-3B</div>
+					</div>
+
+					<Drawer.Footer>
+						<Drawer.Close>
+							{#snippet child({ props })}
+								<Button {...props} variant="outline">Close</Button>
+							{/snippet}
+						</Drawer.Close>
+					</Drawer.Footer>
+				</div>
+			</Drawer.Content>
+		</Drawer.Root>
+	</div>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/overlays/DropdownMenu.stories.svelte b/ui/lib/ui/tests/stories/components/overlays/DropdownMenu.stories.svelte
new file mode 100644
index 000000000..a71d3117a
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/overlays/DropdownMenu.stories.svelte
@@ -0,0 +1,71 @@
+<script lang="ts" module>
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import * as DropdownMenu from '@ggml-org/llama-ui/ui/dropdown-menu';
+	import { Download, Pencil, Trash2 } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: DropdownMenu.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Overlays/DropdownMenu'
+	});
+</script>
+
+<Story asChild name="Default">
+	<div class="h-96">
+		<DropdownMenu.Root open>
+			<DropdownMenu.Trigger>
+				{#snippet child({ props })}
+					<Button {...props} variant="outline">Conversation</Button>
+				{/snippet}
+			</DropdownMenu.Trigger>
+
+			<DropdownMenu.Content class="w-56">
+				<DropdownMenu.Group>
+					<DropdownMenu.Label>Conversation</DropdownMenu.Label>
+
+					<DropdownMenu.Item>
+						<Pencil /> Rename
+						<DropdownMenu.Shortcut>F2</DropdownMenu.Shortcut>
+					</DropdownMenu.Item>
+
+					<DropdownMenu.Item><Download /> Export</DropdownMenu.Item>
+				</DropdownMenu.Group>
+
+				<DropdownMenu.Separator />
+
+				<DropdownMenu.CheckboxItem checked>Show statistics</DropdownMenu.CheckboxItem>
+
+				<DropdownMenu.CheckboxItem>Render markdown in user messages</DropdownMenu.CheckboxItem>
+
+				<DropdownMenu.Separator />
+
+				<DropdownMenu.RadioGroup value="medium">
+					<DropdownMenu.GroupHeading>Reasoning</DropdownMenu.GroupHeading>
+
+					<DropdownMenu.RadioItem value="low">Low</DropdownMenu.RadioItem>
+
+					<DropdownMenu.RadioItem value="medium">Medium</DropdownMenu.RadioItem>
+
+					<DropdownMenu.RadioItem value="high">High</DropdownMenu.RadioItem>
+				</DropdownMenu.RadioGroup>
+
+				<DropdownMenu.Separator />
+
+				<DropdownMenu.Sub>
+					<DropdownMenu.SubTrigger>Move to</DropdownMenu.SubTrigger>
+
+					<DropdownMenu.SubContent>
+						<DropdownMenu.Item>Work</DropdownMenu.Item>
+
+						<DropdownMenu.Item>Personal</DropdownMenu.Item>
+					</DropdownMenu.SubContent>
+				</DropdownMenu.Sub>
+
+				<DropdownMenu.Item variant="destructive"><Trash2 /> Delete</DropdownMenu.Item>
+			</DropdownMenu.Content>
+		</DropdownMenu.Root>
+	</div>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/overlays/HoverCard.stories.svelte b/ui/lib/ui/tests/stories/components/overlays/HoverCard.stories.svelte
new file mode 100644
index 000000000..21df9ba57
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/overlays/HoverCard.stories.svelte
@@ -0,0 +1,36 @@
+<script lang="ts" module>
+	import * as HoverCard from '@ggml-org/llama-ui/ui/hover-card';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: HoverCard.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Overlays/HoverCard'
+	});
+</script>
+
+<Story asChild name="Default">
+	<div class="h-56">
+		<HoverCard.Root open>
+			<HoverCard.Trigger>
+				{#snippet child({ props })}
+					<a {...props} class="text-sm underline-offset-4 hover:underline" href="#hover-card"
+						>ggml-org/Qwen3.8-27B-GGUF</a
+					>
+				{/snippet}
+			</HoverCard.Trigger>
+
+			<HoverCard.Content class="w-72">
+				<div class="space-y-1">
+					<p class="text-sm font-medium">Qwen3.8-27B</p>
+
+					<p class="text-sm text-muted-foreground">
+						131k context, tool use and vision. Quantized to Q4_K_M, 16.4 GB.
+					</p>
+				</div>
+			</HoverCard.Content>
+		</HoverCard.Root>
+	</div>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/overlays/Popover.stories.svelte b/ui/lib/ui/tests/stories/components/overlays/Popover.stories.svelte
new file mode 100644
index 000000000..d4ccd0b17
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/overlays/Popover.stories.svelte
@@ -0,0 +1,45 @@
+<script lang="ts" module>
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import { Input } from '@ggml-org/llama-ui/ui/input';
+	import { Label } from '@ggml-org/llama-ui/ui/label';
+	import * as Popover from '@ggml-org/llama-ui/ui/popover';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Popover.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Overlays/Popover'
+	});
+</script>
+
+<Story asChild name="Default">
+	<div class="h-72">
+		<Popover.Root open>
+			<Popover.Trigger>
+				{#snippet child({ props })}
+					<Button {...props} variant="outline">Sampling</Button>
+				{/snippet}
+			</Popover.Trigger>
+
+			<Popover.Content class="w-72">
+				<div class="grid gap-3">
+					<p class="text-sm font-medium">Sampling</p>
+
+					<div class="grid grid-cols-3 items-center gap-2">
+						<Label for="story-temp">Temperature</Label>
+
+						<Input class="col-span-2 h-8" id="story-temp" value="0.8" />
+					</div>
+
+					<div class="grid grid-cols-3 items-center gap-2">
+						<Label for="story-top-p">Top P</Label>
+
+						<Input class="col-span-2 h-8" id="story-top-p" value="0.95" />
+					</div>
+				</div>
+			</Popover.Content>
+		</Popover.Root>
+	</div>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/overlays/Submenus.stories.svelte b/ui/lib/ui/tests/stories/components/overlays/Submenus.stories.svelte
new file mode 100644
index 000000000..fcce8a6b9
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/overlays/Submenus.stories.svelte
@@ -0,0 +1,139 @@
+<script lang="ts" module>
+	import * as ContextMenu from '@ggml-org/llama-ui/ui/context-menu';
+	import * as DropdownMenu from '@ggml-org/llama-ui/ui/dropdown-menu';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { expect, screen, waitFor, within } from 'storybook/test';
+
+	const { Story } = defineMeta({
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Overlays/Submenus'
+	});
+
+	const ROWS = Array.from({ length: 12 }, (_, index) => `Recent chat ${index + 1}`);
+
+	/**
+	 * A submenu opens beside a menu that scrolls and draws as glass. Its first item has to be
+	 * what the pointer hits at its centre: when the submenu stays inside the menu's clipping box,
+	 * the item is laid out but cut off, and the point lands on whatever is behind the menu.
+	 *
+	 * It also has to look like the menu it opens from (the same surface and corners), with its
+	 * first row level with the row that opens it.
+	 */
+	async function expectSubmenuLikeMenu(trigger: HTMLElement) {
+		const submenu = await waitFor(() => {
+			const element = document.querySelector<HTMLElement>('[data-slot$="menu-sub-content"]');
+
+			expect(element).not.toBeNull();
+
+			return element!;
+		});
+		const item = within(submenu).getByRole('menuitem', { name: 'Work' });
+
+		await waitFor(() => {
+			const { height, left, top, width } = item.getBoundingClientRect();
+			const hit = document.elementFromPoint(left + width / 2, top + height / 2);
+
+			expect(item.contains(hit), 'the submenu is cut off by the menu it opens from').toBe(true);
+		});
+
+		const menu = trigger.closest<HTMLElement>('[role="menu"]')!;
+		const menuStyle = getComputedStyle(menu);
+		const submenuStyle = getComputedStyle(submenu);
+
+		expect(submenuStyle.borderRadius).toBe(menuStyle.borderRadius);
+		expect(submenuStyle.backdropFilter).toBe(menuStyle.backdropFilter);
+		expect(submenuStyle.backgroundColor).toBe(menuStyle.backgroundColor);
+		expect(submenuStyle.boxShadow).toBe(menuStyle.boxShadow);
+		// the submenu zooms and slides in, so its rows settle a moment after it shows
+		await waitFor(() =>
+			expect(item.getBoundingClientRect().top).toBeCloseTo(trigger.getBoundingClientRect().top, 0)
+		);
+	}
+</script>
+
+<Story
+	asChild
+	name="DropdownMenuSubmenu"
+	play={async ({ userEvent }) => {
+		const trigger = await screen.findByRole('menuitem', { name: 'Move to' });
+
+		await userEvent.hover(trigger);
+
+		await expectSubmenuLikeMenu(trigger);
+	}}
+>
+	<div class="h-96 w-[32rem]">
+		<DropdownMenu.Root open>
+			<DropdownMenu.Trigger>Conversation</DropdownMenu.Trigger>
+
+			<DropdownMenu.Content align="start" class="max-h-56 w-52" side="bottom">
+				<DropdownMenu.Sub>
+					<DropdownMenu.SubTrigger>Move to</DropdownMenu.SubTrigger>
+
+					<DropdownMenu.SubContent>
+						<DropdownMenu.Item>Work</DropdownMenu.Item>
+
+						<DropdownMenu.Item>Personal</DropdownMenu.Item>
+					</DropdownMenu.SubContent>
+				</DropdownMenu.Sub>
+
+				<DropdownMenu.Separator />
+
+				{#each ROWS as row (row)}
+					<DropdownMenu.Item>{row}</DropdownMenu.Item>
+				{/each}
+			</DropdownMenu.Content>
+		</DropdownMenu.Root>
+	</div>
+</Story>
+
+<Story
+	asChild
+	name="ContextMenuSubmenu"
+	play={async ({ canvas, userEvent }) => {
+		const area = await canvas.findByText('Right-click here');
+		const { height, left, top, width } = area.getBoundingClientRect();
+
+		await userEvent.pointer({
+			coords: { clientX: left + width / 2, clientY: top + height / 2 },
+			keys: '[MouseRight]',
+			target: area
+		});
+
+		const trigger = await screen.findByRole('menuitem', { name: 'Move to' });
+
+		await userEvent.hover(trigger);
+
+		await expectSubmenuLikeMenu(trigger);
+	}}
+>
+	<div class="h-96 w-[32rem]">
+		<ContextMenu.Root>
+			<ContextMenu.Trigger
+				class="flex h-24 w-52 items-center justify-center rounded-lg border border-dashed text-sm text-muted-foreground"
+			>
+				Right-click here
+			</ContextMenu.Trigger>
+
+			<ContextMenu.Content class="max-h-56 w-52">
+				<ContextMenu.Sub>
+					<ContextMenu.SubTrigger>Move to</ContextMenu.SubTrigger>
+
+					<ContextMenu.SubContent>
+						<ContextMenu.Item>Work</ContextMenu.Item>
+
+						<ContextMenu.Item>Personal</ContextMenu.Item>
+					</ContextMenu.SubContent>
+				</ContextMenu.Sub>
+
+				<ContextMenu.Separator />
+
+				{#each ROWS as row (row)}
+					<ContextMenu.Item>{row}</ContextMenu.Item>
+				{/each}
+			</ContextMenu.Content>
+		</ContextMenu.Root>
+	</div>
+</Story>
diff --git a/ui/lib/ui/tests/stories/components/overlays/Tooltip.stories.svelte b/ui/lib/ui/tests/stories/components/overlays/Tooltip.stories.svelte
new file mode 100644
index 000000000..a335ecebb
--- /dev/null
+++ b/ui/lib/ui/tests/stories/components/overlays/Tooltip.stories.svelte
@@ -0,0 +1,28 @@
+<script lang="ts" module>
+	import { Button } from '@ggml-org/llama-ui/ui/button';
+	import * as Tooltip from '@ggml-org/llama-ui/ui/tooltip';
+	import { Copy } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	const { Story } = defineMeta({
+		component: Tooltip.Root,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Components/Overlays/Tooltip'
+	});
+</script>
+
+<Story asChild name="Default">
+	<div class="flex h-32 items-end">
+		<Tooltip.Root open>
+			<Tooltip.Trigger>
+				{#snippet child({ props })}
+					<Button {...props} aria-label="Copy" size="icon" variant="outline"><Copy /></Button>
+				{/snippet}
+			</Tooltip.Trigger>
+
+			<Tooltip.Content>Copy to clipboard</Tooltip.Content>
+		</Tooltip.Root>
+	</div>
+</Story>
diff --git a/ui/lib/ui/tests/stories/editorial/Chapters.svelte b/ui/lib/ui/tests/stories/editorial/Chapters.svelte
new file mode 100644
index 000000000..439b5597d
--- /dev/null
+++ b/ui/lib/ui/tests/stories/editorial/Chapters.svelte
@@ -0,0 +1,153 @@
+<!--
+	The chapter navigation: the page's section heads as a list fixed at the right, centred. Every chapter is set at one size;
+	inactive ones are dimmed, and the one being read is in the full foreground colour. Clicking a chapter scrolls to
+	it. Shown only where there is room beside the text.
+-->
+<script lang="ts">
+	let { root }: { root: HTMLElement | undefined } = $props();
+
+	let chapters: { el: HTMLElement; id: string; n: string; title: string }[] = $state([]);
+	let active = $state(0);
+
+	// runs once the page it navigates is mounted
+	$effect(() => {
+		if (!root) return;
+
+		const list = [...root.querySelectorAll<HTMLElement>(':scope > h2')].map((el, i) => {
+			const n = String(i + 1).padStart(2, '0');
+
+			el.id ||= `chapter-${n}`;
+
+			return { el, id: el.id, n, title: el.textContent?.trim() ?? '' };
+		});
+
+		chapters = list;
+
+		// the active chapter is the last one whose head has passed 40% of the way down the screen
+		let frame = 0;
+
+		const update = () => {
+			frame = 0;
+			const line = window.innerHeight * 0.4;
+			const index = list.findLastIndex(({ el }) => el.getBoundingClientRect().top <= line);
+
+			active = Math.max(0, index);
+		};
+		const onScroll = () => (frame ||= requestAnimationFrame(update));
+
+		update();
+		window.addEventListener('scroll', onScroll, { passive: true });
+		window.addEventListener('resize', onScroll);
+
+		return () => {
+			cancelAnimationFrame(frame);
+			window.removeEventListener('scroll', onScroll);
+			window.removeEventListener('resize', onScroll);
+		};
+	});
+
+	function go(event: MouseEvent, el: HTMLElement) {
+		event.preventDefault();
+		const reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+
+		window.scrollTo({
+			behavior: reduce ? 'auto' : 'smooth',
+			top: el.getBoundingClientRect().top + window.scrollY - 32
+		});
+	}
+</script>
+
+{#if chapters.length}
+	<nav aria-label="Chapters" class="chapters">
+		<ol>
+			{#each chapters as chapter, i (chapter.id)}
+				<li>
+					<a
+						aria-current={i === active ? 'location' : undefined}
+						class={{ active: i === active }}
+						href="#{chapter.id}"
+						onclick={(event) => go(event, chapter.el)}
+					>
+						<span class="n">{chapter.n}</span>
+
+						<span class="title">{chapter.title}</span>
+					</a>
+				</li>
+			{/each}
+		</ol>
+	</nav>
+{/if}
+
+<style>
+	.chapters {
+		--mono: 'Llama Mono', ui-monospace, monospace;
+		position: fixed;
+		top: 50%;
+		right: clamp(16px, 2.5vw, 40px);
+		z-index: 10;
+		display: none;
+		width: 13rem;
+		transform: translateY(-50%);
+	}
+
+	/* only where the column leaves room for it */
+	@media (width >= 1440px) {
+		.chapters {
+			display: block;
+		}
+	}
+
+	ol {
+		display: grid;
+		gap: 2px;
+		margin: 0;
+		padding: 0;
+		list-style: none;
+	}
+
+	a {
+		display: grid;
+		grid-template-columns: 1.75rem 1fr;
+		align-items: baseline;
+		padding-block: 4px;
+		color: var(--fg-muted);
+		font-size: 14px;
+		line-height: 1.3;
+		text-decoration: none;
+		opacity: 0.6;
+		transition:
+			color 200ms ease-out,
+			opacity 200ms ease-out;
+	}
+
+	a:hover {
+		opacity: 1;
+	}
+
+	a.active {
+		color: var(--fg-default);
+		font-weight: 500;
+		opacity: 1;
+	}
+
+	.n {
+		font: 500 10px var(--mono);
+		letter-spacing: 0.04em;
+	}
+
+	a.active .n {
+		color: var(--art-cinder);
+	}
+
+	a:focus-visible {
+		border-radius: 4px;
+		outline: 2px solid var(--line-focus);
+		outline-offset: 2px;
+	}
+
+	@media (prefers-reduced-motion: reduce) {
+		a {
+			transition: none;
+		}
+	}
+</style>
diff --git a/ui/lib/ui/tests/stories/editorial/Editorial.svelte b/ui/lib/ui/tests/stories/editorial/Editorial.svelte
new file mode 100644
index 000000000..068b55624
--- /dev/null
+++ b/ui/lib/ui/tests/stories/editorial/Editorial.svelte
@@ -0,0 +1,202 @@
+<!--
+	The page the Storybook's prose pages are set on: an editorial column of running text at a reading size, with figures that
+	break out wider and pull quotes in Display. Numbered section heads, the numbers in cinder (the mark on a detail),
+	and the chapter navigation fixed at the right.
+-->
+<script lang="ts">
+	import '../brand/fonts/fonts.css';
+	import Chapters from './Chapters.svelte';
+	import type { Snippet } from 'svelte';
+
+	let { children }: { children: Snippet } = $props();
+
+	let article: HTMLElement | undefined = $state();
+</script>
+
+<article bind:this={article} class="editorial">{@render children()}</article>
+
+<Chapters root={article} />
+
+<style>
+	.editorial {
+		--mono: 'Llama Mono', ui-monospace, 'SF Mono', Menlo, monospace;
+		--text: min(40rem, calc(100% - 32px));
+		display: grid;
+		grid-template-columns:
+			[full-start] minmax(16px, 1fr) [wide-start] minmax(0, 9rem) [text-start] var(--text)
+			[text-end] minmax(0, 9rem) [wide-end] minmax(16px, 1fr) [full-end];
+		counter-reset: section;
+		min-height: 100vh;
+		padding: clamp(40px, 8vw, 112px) 0 clamp(64px, 10vw, 160px);
+		background: var(--surface-page);
+		color: var(--fg-default);
+		font: 400 18px / 1.6 var(--font-sans);
+		text-wrap: pretty;
+	}
+
+	.editorial > :global(*) {
+		grid-column: text;
+		margin: 0;
+		min-width: 0;
+	}
+
+	.editorial > :global(* + *) {
+		margin-top: 1.1em;
+	}
+
+	.editorial > :global(.wide) {
+		grid-column: wide;
+	}
+
+	/* the masthead: a kicker, the title in Display, the lead and a rule under it */
+	.editorial > :global(.kicker) {
+		color: var(--fg-muted);
+		font: 500 12px / 1.4 var(--mono);
+		letter-spacing: 0.08em;
+		text-transform: uppercase;
+	}
+
+	.editorial > :global(h1) {
+		grid-column: wide;
+		margin-top: 20px;
+		font-size: clamp(48px, 9vw, 112px);
+		font-weight: 700;
+		letter-spacing: -0.01em;
+		line-height: 1;
+	}
+
+	.editorial > :global(.lead) {
+		margin-top: 32px;
+		color: var(--fg-muted);
+		font-size: clamp(20px, 2.4vw, 24px);
+		line-height: 1.45;
+		text-wrap: balance;
+	}
+
+	.editorial > :global(.lead strong) {
+		color: var(--fg-default);
+		font-weight: 500;
+	}
+
+	/* each section opens on a hairline, its number above the heading */
+	.editorial > :global(h2) {
+		counter-increment: section;
+		margin-top: clamp(72px, 10vw, 120px);
+		padding-top: 20px;
+		border-top: 1px solid var(--line-default);
+		font-size: clamp(28px, 3.6vw, 40px);
+		font-weight: 600;
+		letter-spacing: -0.005em;
+		line-height: 1.15;
+		text-wrap: balance;
+	}
+
+	.editorial > :global(h2)::before {
+		content: counter(section, decimal-leading-zero);
+		display: block;
+		margin-bottom: 16px;
+		color: var(--art-cinder);
+		font: 500 13px / 1 var(--mono);
+		letter-spacing: 0.04em;
+	}
+
+	.editorial > :global(h2 + *) {
+		margin-top: 24px;
+	}
+
+	.editorial :global(strong) {
+		font-weight: 600;
+	}
+
+	.editorial :global(em) {
+		font-style: italic;
+	}
+
+	.editorial :global(a) {
+		text-decoration: underline;
+		text-decoration-color: var(--line-default);
+		text-underline-offset: 3px;
+	}
+
+	.editorial :global(:not(pre) > code) {
+		padding: 0.1em 0.3em;
+		border-radius: 6px;
+		background: var(--surface-code);
+		font: 0.85em var(--mono);
+	}
+
+	/* a footnote marker, and the note it points to: small and muted, under the figure */
+	.editorial :global(sup) {
+		color: var(--art-cinder);
+		font: 500 0.75em var(--mono);
+		line-height: 0;
+	}
+
+	.editorial > :global(.note) {
+		color: var(--fg-muted);
+		font-size: 14px;
+		line-height: 1.5;
+	}
+
+	.editorial > :global(ul) {
+		padding-left: 1.2em;
+		list-style: disc;
+	}
+
+	.editorial > :global(ul li + li) {
+		margin-top: 0.5em;
+	}
+
+	.editorial > :global(ul li::marker) {
+		color: var(--fg-muted);
+	}
+
+	/* a pull quote: Display size, wider than the text, with a cinder rule */
+	.editorial > :global(.pull) {
+		grid-column: wide;
+		margin-block: clamp(40px, 6vw, 72px);
+		padding-left: clamp(16px, 3vw, 32px);
+		border-left: 2px solid var(--art-cinder);
+		font-size: clamp(28px, 4.4vw, 48px);
+		font-weight: 600;
+		letter-spacing: -0.01em;
+		line-height: 1.12;
+		text-wrap: balance;
+	}
+
+	.editorial > :global(.pull + *) {
+		margin-top: 0;
+	}
+
+	/* the closing rules: big numbers in the margin */
+	.editorial > :global(ol) {
+		counter-reset: rule;
+		display: grid;
+		gap: 20px;
+		margin-top: 32px;
+		list-style: none;
+	}
+
+	.editorial > :global(ol li) {
+		counter-increment: rule;
+		display: grid;
+		grid-template-columns: 3rem 1fr;
+		align-items: baseline;
+		padding-bottom: 20px;
+		border-bottom: 1px solid var(--line-default);
+		font-size: 20px;
+		line-height: 1.45;
+	}
+
+	.editorial > :global(ol li)::before {
+		content: counter(rule);
+		color: var(--fg-muted);
+		font: 500 13px var(--mono);
+	}
+
+	.editorial > :global(.colophon) {
+		margin-top: 72px;
+		color: var(--fg-muted);
+		font: 400 13px / 1.6 var(--mono);
+	}
+</style>
diff --git a/ui/lib/ui/tests/stories/foundations/Colors.stories.svelte b/ui/lib/ui/tests/stories/foundations/Colors.stories.svelte
new file mode 100644
index 000000000..f4738de42
--- /dev/null
+++ b/ui/lib/ui/tests/stories/foundations/Colors.stories.svelte
@@ -0,0 +1,37 @@
+<script lang="ts" module>
+	import { componentGroups, primitiveGroups, semanticGroups } from './tokens';
+	import TokenTier from './TokenTier.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	// read from ui/lib/ui/src/lib/styles/tokens/*.css, so the swatches follow the CSS as it changes
+	const { Story } = defineMeta({
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Foundations/Colors'
+	});
+</script>
+
+<Story asChild name="Primitives">
+	<TokenTier
+		groups={primitiveGroups}
+		intro="Raw values named by what they are. Only semantic tokens point at these; components never use them directly."
+		showReference={false}
+	/>
+</Story>
+
+<Story asChild name="Semantic">
+	<TokenTier
+		groups={semanticGroups}
+		intro="Named by purpose. Each points at a primitive, and this is the only tier that changes between light and dark. Switch the theme to see the dark values."
+		showReference={true}
+	/>
+</Story>
+
+<Story asChild name="Components">
+	<TokenTier
+		groups={componentGroups}
+		intro="One group per component. They point at semantic tokens, so both themes follow automatically."
+		showReference={true}
+	/>
+</Story>
diff --git a/ui/lib/ui/tests/stories/foundations/Elevation.stories.svelte b/ui/lib/ui/tests/stories/foundations/Elevation.stories.svelte
new file mode 100644
index 000000000..dfa297416
--- /dev/null
+++ b/ui/lib/ui/tests/stories/foundations/Elevation.stories.svelte
@@ -0,0 +1,36 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	// the elevation tokens from ui/lib/ui/src/lib/styles/tokens/semantic.css, each on a plain sample
+	const { Story } = defineMeta({
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Foundations/Elevation'
+	});
+
+	const levels = [
+		{ name: 'elevation-inset', note: 'fields, recessed' },
+		{ name: 'elevation-control', note: 'buttons and tabs' },
+		{ name: 'elevation-surface', note: 'chat form, cards, sidebar' },
+		{ name: 'elevation-raised', note: 'menus, popovers, dialogs' },
+		{ name: 'elevation-tooltip', note: 'tooltips' }
+	];
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={5} minItemWidth="10rem">
+		{#each levels as level (level.name)}
+			<StateGalleryItem label={level.name} note={level.note}>
+				<div class="p-4">
+					<div
+						style:box-shadow="var(--{level.name})"
+						class="h-20 rounded-card bg-surface-raised"
+					></div>
+				</div>
+			</StateGalleryItem>
+		{/each}
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/foundations/Shapes.stories.svelte b/ui/lib/ui/tests/stories/foundations/Shapes.stories.svelte
new file mode 100644
index 000000000..0f56ef937
--- /dev/null
+++ b/ui/lib/ui/tests/stories/foundations/Shapes.stories.svelte
@@ -0,0 +1,33 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	// the corner roles from ui/lib/ui/src/lib/styles/tokens/semantic.css
+	const { Story } = defineMeta({
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Foundations/Shapes'
+	});
+
+	const radii = [
+		{ name: 'rounded-control', note: '8px, buttons, fields, badges' },
+		{ name: 'rounded-panel', note: '10px, menus and dialogs' },
+		{ name: 'rounded-card', note: '14px, cards' },
+		{ name: 'rounded-container', note: '16px, the sidebar' },
+		{ name: 'rounded-surface', note: '24px, chat form, bubbles' },
+		{ name: 'rounded-surface-lg', note: '32px, chat form on mobile' },
+		{ name: 'rounded-full', note: 'lamps, avatars, round icon buttons' }
+	];
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={4}>
+		{#each radii as radius (radius.name)}
+			<StateGalleryItem label={radius.name} note={radius.note}>
+				<div class="h-24 border border-line-default bg-surface-muted {radius.name}"></div>
+			</StateGalleryItem>
+		{/each}
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/foundations/Sizing.stories.svelte b/ui/lib/ui/tests/stories/foundations/Sizing.stories.svelte
new file mode 100644
index 000000000..53e8477c1
--- /dev/null
+++ b/ui/lib/ui/tests/stories/foundations/Sizing.stories.svelte
@@ -0,0 +1,82 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { Settings } from '@lucide/svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	// control heights and icon sizes from ui/lib/ui/src/lib/styles/tokens/semantic.css, and the 4px spacing grid
+	const { Story } = defineMeta({
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Foundations/Sizing'
+	});
+
+	const heights = [
+		{ name: 'h-control-sm', note: '32px' },
+		{ name: 'h-control-md', note: '36px, default' },
+		{ name: 'h-control-lg', note: '40px' }
+	];
+	const icons = [
+		{ name: 'size-icon-xs', note: '12px' },
+		{ name: 'size-icon-sm', note: '14px' },
+		{ name: 'size-icon-md', note: '16px, default' },
+		{ name: 'size-icon-lg', note: '20px' }
+	];
+	const spacing = [
+		{ name: 'xs', px: 4 },
+		{ name: 'sm', px: 8 },
+		{ name: 'md', px: 12 },
+		{ name: 'lg', px: 16 },
+		{ name: 'xl', px: 24 },
+		{ name: '2xl', px: 32 }
+	];
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={1}>
+		<StateGalleryItem label="Control heights">
+			<div class="flex items-end gap-3">
+				{#each heights as height (height.name)}
+					<div class="flex flex-col items-center gap-2">
+						<div
+							class="flex w-20 items-center justify-center rounded-control border border-line-default bg-surface-muted {height.name}"
+						></div>
+
+						<span class="font-mono text-[11px] text-fg-muted">{height.name}</span>
+
+						<span class="text-caption text-fg-muted">{height.note}</span>
+					</div>
+				{/each}
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Icon sizes">
+			<div class="flex items-end gap-5">
+				{#each icons as icon (icon.name)}
+					<div class="flex flex-col items-center gap-2">
+						<Settings class={icon.name} />
+
+						<span class="font-mono text-[11px] text-fg-muted">{icon.name}</span>
+
+						<span class="text-caption text-fg-muted">{icon.note}</span>
+					</div>
+				{/each}
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="Spacing" note="4px grid">
+			<div class="flex flex-col gap-2">
+				{#each spacing as step (step.name)}
+					<div class="flex items-center gap-3">
+						<span class="w-8 font-mono text-[11px] text-fg-muted">{step.name}</span>
+
+						<div style:width="{step.px}px" class="h-3 rounded-sm bg-muted-foreground/40"></div>
+
+						<span class="text-caption text-fg-muted">{step.px}px</span>
+					</div>
+				{/each}
+			</div>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/foundations/Surfaces.stories.svelte b/ui/lib/ui/tests/stories/foundations/Surfaces.stories.svelte
new file mode 100644
index 000000000..61fbf156e
--- /dev/null
+++ b/ui/lib/ui/tests/stories/foundations/Surfaces.stories.svelte
@@ -0,0 +1,91 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	// the matte utilities from src/app.css, each on a neutral sample
+	const { Story } = defineMeta({
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Foundations/Surfaces'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={3}>
+		<StateGalleryItem label="matte-glass" note="chat form, cards">
+			<div class="matte-glass h-28 rounded-3xl"></div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="matte-glass" note="focus within">
+			<div class="matte-glass flex h-28 items-center rounded-3xl px-4">
+				<input
+					class="w-full bg-transparent text-sm outline-none placeholder:engraved"
+					placeholder="Click to see the focus edge"
+				/>
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="inset-group-surface" note="rows grouped in a glass panel">
+			<!-- shown inside a sidebar-surface, the only place it reads as intended -->
+			<div class="sidebar-surface flex h-28 flex-col justify-end rounded-(--sidebar-radius) p-2">
+				<div class="inset-group-surface flex flex-col gap-1 p-1 text-sm">
+					<span class="rounded-md px-2 py-1">Models</span>
+
+					<span class="rounded-md px-2 py-1">Settings</span>
+				</div>
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="matte-float" note="menus, popovers, dialogs">
+			<div class="matte-float h-28 rounded-xl border"></div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="matte-key" note="buttons keep their own fill">
+			<div class="flex h-28 items-center justify-center gap-3">
+				<div class="matte-key size-10 rounded-full bg-background"></div>
+
+				<div class="matte-key h-9 w-24 rounded-md bg-secondary"></div>
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="matte-well" note="inputs, switches">
+			<div class="flex h-28 items-center">
+				<div class="matte-well h-9 w-full rounded-md border border-input bg-background"></div>
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="matte-sheen" note="user message bubble">
+			<div class="matte-sheen flex h-28 items-center rounded-2xl bg-primary/5 px-4 text-sm">
+				A user message
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="engraved" note="placeholder text">
+			<div class="flex h-28 items-center text-sm text-muted-foreground engraved">
+				Ask anything...
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="status-lamp" note="red, yellow, green">
+			<div class="flex h-28 items-center gap-4">
+				<span class="status-lamp orb-danger size-2 rounded-full"></span>
+
+				<span class="status-lamp orb-warning size-2 rounded-full"></span>
+
+				<span class="status-lamp orb-success size-2 rounded-full"></span>
+			</div>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="matte-orb" note="recording button">
+			<div class="flex h-28 items-center gap-4">
+				<span class="matte-orb orb-danger size-8 rounded-full"></span>
+
+				<span class="matte-orb orb-warning size-8 rounded-full"></span>
+
+				<span class="matte-orb orb-success size-8 rounded-full"></span>
+			</div>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/foundations/TokenTier.svelte b/ui/lib/ui/tests/stories/foundations/TokenTier.svelte
new file mode 100644
index 000000000..b371519d6
--- /dev/null
+++ b/ui/lib/ui/tests/stories/foundations/TokenTier.svelte
@@ -0,0 +1,50 @@
+<!-- One tier of colour tokens as swatches, grouped as in its CSS: each with its name and its value (showReference: the
+     light and dark values it points at, by primitive name). -->
+<script lang="ts">
+	import { reference, type TokenGroup } from './tokens';
+
+	let {
+		groups,
+		intro,
+		showReference
+	}: { groups: TokenGroup[]; intro: string; showReference: boolean } = $props();
+</script>
+
+<div class="w-[min(72rem,calc(100vw-2rem))] space-y-8 p-4">
+	<p class="max-w-2xl text-body-sm text-fg-muted">{intro}</p>
+
+	{#each groups as group (group.title)}
+		<section>
+			<h2 class="mb-3 text-label text-fg-muted first-letter:uppercase">{group.title}</h2>
+
+			<div class="grid grid-cols-[repeat(auto-fill,minmax(11rem,1fr))] gap-4">
+				{#each group.tokens as token (token.name)}
+					<figure class="m-0 flex flex-col gap-2">
+						<div
+							style:background-color="var(--{token.name})"
+							class="h-14 rounded-control border border-line-default"
+						></div>
+
+						<figcaption class="flex flex-col gap-0.5 font-mono text-[11px] leading-4">
+							<span class="text-fg-default">--{token.name}</span>
+
+							{#if showReference}
+								<span class="truncate text-fg-muted" title={token.light}
+									>light: {reference(token.light)}</span
+								>
+
+								{#if token.dark}
+									<span class="truncate text-fg-muted" title={token.dark}
+										>dark: {reference(token.dark)}</span
+									>
+								{/if}
+							{:else}
+								<span class="truncate text-fg-muted" title={token.light}>{token.light}</span>
+							{/if}
+						</figcaption>
+					</figure>
+				{/each}
+			</div>
+		</section>
+	{/each}
+</div>
diff --git a/ui/lib/ui/tests/stories/foundations/Typography.stories.svelte b/ui/lib/ui/tests/stories/foundations/Typography.stories.svelte
new file mode 100644
index 000000000..c33aa2368
--- /dev/null
+++ b/ui/lib/ui/tests/stories/foundations/Typography.stories.svelte
@@ -0,0 +1,59 @@
+<script lang="ts" module>
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	// the type roles from ui/lib/ui/src/lib/styles/tokens/semantic.css: each sets size, line height and weight
+	const { Story } = defineMeta({
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Foundations/Typography'
+	});
+
+	const roles = [
+		{ name: 'text-heading', spec: '24/32 600', use: 'rare page headings' },
+		{ name: 'text-title', spec: '18/28 600', use: 'dialog and section titles' },
+		{ name: 'text-body', spec: '16/24 400', use: 'chat messages and the chat input' },
+		{ name: 'text-body-sm', spec: '14/20 400', use: 'most text, fields and lists' },
+		{ name: 'text-label', spec: '14/20 500', use: 'buttons and field labels' },
+		{ name: 'text-label-sm', spec: '12/16 500', use: 'badges and compact labels' },
+		{ name: 'text-caption', spec: '12/16 400', use: 'tooltips, hints and metadata' }
+	];
+</script>
+
+<Story asChild name="Default">
+	<div class="w-[min(52rem,calc(100vw-2rem))] space-y-6 p-4">
+		{#each roles as role (role.name)}
+			<div class="grid grid-cols-[9rem_1fr] items-baseline gap-6">
+				<div class="flex flex-col gap-0.5 font-mono text-[11px] text-muted-foreground">
+					<span>{role.name}</span>
+
+					<span class="opacity-70">{role.spec}</span>
+				</div>
+
+				<div class="flex flex-col gap-1">
+					<span class={role.name}>The quick brown llama runs locally</span>
+
+					<span class="text-caption text-fg-muted">{role.use}</span>
+				</div>
+			</div>
+		{/each}
+
+		<div class="grid grid-cols-[9rem_1fr] items-baseline gap-6">
+			<span class="font-mono text-[11px] text-muted-foreground">text-fg-muted</span>
+
+			<span class="text-body-sm text-fg-muted">Secondary text and hints</span>
+		</div>
+
+		<div class="grid grid-cols-[9rem_1fr] items-baseline gap-6">
+			<span class="font-mono text-[11px] text-muted-foreground">font-mono</span>
+
+			<code class="font-mono text-body-sm">llama-server -m model.gguf --port 9931</code>
+		</div>
+
+		<div class="grid grid-cols-[9rem_1fr] items-baseline gap-6">
+			<span class="font-mono text-[11px] text-muted-foreground">engraved</span>
+
+			<span class="text-body text-fg-muted engraved">Ask anything...</span>
+		</div>
+	</div>
+</Story>
diff --git a/ui/lib/ui/tests/stories/foundations/tokens.ts b/ui/lib/ui/tests/stories/foundations/tokens.ts
new file mode 100644
index 000000000..51c9499ed
--- /dev/null
+++ b/ui/lib/ui/tests/stories/foundations/tokens.ts
@@ -0,0 +1,69 @@
+import components from '@ggml-org/llama-ui/styles/tokens/components.css?raw';
+import primitives from '@ggml-org/llama-ui/styles/tokens/primitives.css?raw';
+import semantic from '@ggml-org/llama-ui/styles/tokens/semantic.css?raw';
+
+export interface ColorToken {
+	name: string;
+	/** What the token points at in light mode, as written in the CSS. */
+	light: string;
+	/** The dark-mode value when it differs, as written in the CSS. */
+	dark?: string;
+}
+
+export interface TokenGroup {
+	title: string;
+	tokens: ColorToken[];
+}
+
+// colour tokens only: lengths, shadows and blur are documented elsewhere
+const COLOR_VALUE =
+	/oklch|color-mix|transparent|var\(--(neutral|cool-gray|sand|art|red|yellow|green|amber|blue|white|black|surface|fg|line|edge|action|field|status|highlight|sheen|user-bubble|fg-danger)/;
+const NOT_COLOR = /px|rem|var\(--(length|elevation|blur|radius|font|line-height)/;
+
+function block(css: string, selector: string): string {
+	const start = css.indexOf(`${selector} {`);
+
+	if (start === -1) return '';
+
+	return css.slice(start, css.indexOf('\n}', start));
+}
+
+function values(css: string): Map<string, string> {
+	return new Map([...css.matchAll(/--([a-z0-9-]+):\s*([^;]+);/g)].map((m) => [m[1], m[2].trim()]));
+}
+
+/** Groups the colour tokens of one tier by the comments that head each group in its CSS. */
+function groups(css: string): TokenGroup[] {
+	const dark = values(block(css, '.dark'));
+	const out: TokenGroup[] = [];
+
+	for (const line of block(css, ':root').split('\n')) {
+		const comment = line.match(/^\t\/\* (.+?)(?::.*)? \*\/$/);
+		const token = line.match(/^\t--([a-z0-9-]+):\s*([^;]+);/);
+
+		if (comment) {
+			out.push({ title: comment[1], tokens: [] });
+		} else if (token && COLOR_VALUE.test(token[2]) && !NOT_COLOR.test(token[2])) {
+			if (!out.length) out.push({ title: 'tokens', tokens: [] });
+
+			out[out.length - 1].tokens.push({
+				dark: dark.get(token[1]),
+				light: token[2],
+				name: token[1]
+			});
+		}
+	}
+
+	return out.filter((group) => group.tokens.length);
+}
+
+export const primitiveGroups = groups(primitives);
+export const semanticGroups = groups(semantic);
+export const componentGroups = groups(components);
+
+/** Shortens var(--neutral-950) to neutral-950 and a color-mix to "neutral-900 at 90%". */
+export function reference(value: string): string {
+	return value
+		.replace(/color-mix\(in oklch, var\(--([a-z0-9-]+)\) (\d+)%, transparent\)/g, '$1 at $2%')
+		.replace(/var\(--([a-z0-9-]+)\)/g, '$1');
+}
diff --git a/ui/lib/ui/tests/stories/helpers/StateGallery.svelte b/ui/lib/ui/tests/stories/helpers/StateGallery.svelte
new file mode 100644
index 000000000..30399e9a0
--- /dev/null
+++ b/ui/lib/ui/tests/stories/helpers/StateGallery.svelte
@@ -0,0 +1,52 @@
+<!--
+	Lays out one component in several visual states side by side, each under a small
+	label. `columns` sets a fixed column count; leave it out to fill the row with
+	cells of at least `minItemWidth`, or of exactly `itemWidth`. Either way a cell
+	narrows to the gallery's width on a narrower screen, one to a row. `width` caps
+	the gallery (72rem by default).
+-->
+<script lang="ts">
+	import type { Snippet } from 'svelte';
+
+	interface Props {
+		children: Snippet;
+		columns?: number;
+		/** a fixed cell width: as many cells to a row as fit, each this wide */
+		itemWidth?: string;
+		minItemWidth?: string;
+		title?: string;
+		width?: string;
+	}
+
+	let {
+		children,
+		columns,
+		itemWidth,
+		minItemWidth = '14rem',
+		title,
+		width = '72rem'
+	}: Props = $props();
+
+	let gridTemplate = $derived(
+		columns
+			? `repeat(${columns}, minmax(0, 1fr))`
+			: itemWidth
+				? `repeat(auto-fill, minmax(min(${itemWidth}, 100%), ${itemWidth}))`
+				: `repeat(auto-fill, minmax(min(${minItemWidth}, 100%), 1fr))`
+	);
+</script>
+
+<section style:width="min({width}, calc(100vw - 2rem))" class="p-4">
+	{#if title}
+		<h2 class="mb-4 text-sm font-medium text-muted-foreground">{title}</h2>
+	{/if}
+
+	<!-- a query container, so a cell can take the gallery's whole width (StateGalleryItem's `full`) -->
+	<div
+		style:container-type="inline-size"
+		style:grid-template-columns={gridTemplate}
+		class="grid items-start gap-x-6 gap-y-8"
+	>
+		{@render children()}
+	</div>
+</section>
diff --git a/ui/lib/ui/tests/stories/helpers/StateGalleryItem.svelte b/ui/lib/ui/tests/stories/helpers/StateGalleryItem.svelte
new file mode 100644
index 000000000..005bea001
--- /dev/null
+++ b/ui/lib/ui/tests/stories/helpers/StateGalleryItem.svelte
@@ -0,0 +1,35 @@
+<!-- One labelled cell of a StateGallery. `span` lets a wide state take several columns, `full` the whole row. -->
+<script lang="ts">
+	import type { Snippet } from 'svelte';
+
+	interface Props {
+		children: Snippet;
+		/** the gallery's whole width, past its columns when they don't fill it */
+		full?: boolean;
+		label: string;
+		note?: string;
+		span?: number;
+	}
+
+	let { children, full = false, label, note, span = 1 }: Props = $props();
+</script>
+
+<figure
+	style:grid-column={full ? '1 / -1' : `span ${span}`}
+	style:width={full ? '100cqw' : undefined}
+	class="m-0 flex min-w-0 flex-col gap-2"
+>
+	<figcaption class="flex items-baseline gap-2 text-[11px] font-medium tracking-wide uppercase">
+		<span class="text-muted-foreground">{label}</span>
+
+		{#if note}
+			<span class="truncate font-normal tracking-normal text-muted-foreground/70 normal-case"
+				>{note}</span
+			>
+		{/if}
+	</figcaption>
+
+	<div class="min-w-0">
+		{@render children()}
+	</div>
+</figure>
diff --git a/ui/lib/ui/tests/stories/introduction/Introduction.stories.svelte b/ui/lib/ui/tests/stories/introduction/Introduction.stories.svelte
new file mode 100644
index 000000000..a427498e6
--- /dev/null
+++ b/ui/lib/ui/tests/stories/introduction/Introduction.stories.svelte
@@ -0,0 +1,20 @@
+<script lang="ts" module>
+	import Editorial from '../editorial/Editorial.svelte';
+	import Introduction from './Introduction.svx';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+
+	// the Storybook's front page: what the package is and how it keeps in step with ui/apps/chat
+	const { Story } = defineMeta({
+		parameters: {
+			controls: { disable: true },
+			layout: 'fullscreen'
+		},
+		title: 'Introduction'
+	});
+</script>
+
+<Story asChild name="Introduction">
+	<Editorial>
+		<Introduction />
+	</Editorial>
+</Story>
diff --git a/ui/lib/ui/tests/stories/introduction/Introduction.svx b/ui/lib/ui/tests/stories/introduction/Introduction.svx
new file mode 100644
index 000000000..aae0bf52d
--- /dev/null
+++ b/ui/lib/ui/tests/stories/introduction/Introduction.svx
@@ -0,0 +1,44 @@
+<!--
+	The Storybook's front page (Introduction): what this package is, what's in it so far and how it keeps in step with
+	Llama UI in llama.cpp. Set in the Editorial, like the Storybook it is taken from.
+-->
+
+<p class="kicker">Llama UI · package</p>
+
+# Introduction
+
+<p class="lead"><strong>@ggml-org/llama-ui</strong> is Llama UI as a package: the tokens, fonts, surfaces and components of Llama Chat, for llama.app first and the Llama apps after.</p>
+
+## Where it comes from
+
+The package lives in llama.cpp, in `ui/lib/ui`, and Llama Chat, in `ui/apps/chat`, is built on it: its tokens, fonts and base components come from here. The stories of everything the package holds live here, next to it, and run as its tests. Llama Chat's Storybook shows the same stories under **Llama UI**, next to Llama Chat's own; the **Brand** and the **Communications** have their own Storybook, in llama-brand.
+
+The tokens, the fonts and the base components are changed here, and Llama Chat takes them as they are. What both still keep a copy of, the Model UI among them, flows one way for now, from `ui/apps/chat` to here.
+
+## What's in it
+
+- **Foundations:** the primitive, semantic and component tokens, the type, corner, icon and control-height roles, the matte surfaces and elevations, and Llama Sans and Llama Mono.
+- **Components:** the 29 base components Llama Chat is built from, Alert to Tooltip, grouped as actions, forms, display, overlays and navigation.
+- **App components:** the small parts an app on the library shares: ActionIcon, SearchInput and SyntaxHighlightedCode.
+- **Model UI:** how a model is shown in Llama Chat and on llama.app: its name and badges, capability icons, maker's avatar and quant chips, under **Models**. They take model data in and report what the user did out.
+
+## Using it
+
+Import the theme right after Tailwind, then the components:
+
+```css
+@import 'tailwindcss';
+@import 'tw-animate-css';
+@import '@ggml-org/llama-ui/theme.css';
+```
+
+```svelte
+<script lang="ts">
+	import { Badge, Button } from '@ggml-org/llama-ui';
+</script>
+
+<Button variant="secondary">View on Hugging Face</Button>
+<Badge variant="success">Downloaded</Badge>
+```
+
+Use the toolbar to switch between light and dark, and between the Paper and Matte light surfaces.
diff --git a/ui/lib/ui/tests/stories/mockups/AppMockups.stories.svelte b/ui/lib/ui/tests/stories/mockups/AppMockups.stories.svelte
new file mode 100644
index 000000000..030051d5f
--- /dev/null
+++ b/ui/lib/ui/tests/stories/mockups/AppMockups.stories.svelte
@@ -0,0 +1,59 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { MacMenu, WindowsTray } from '@ggml-org/llama-ui';
+
+	// the native apps' UIs as the brand draws them, for pages and communications: Llama for Mac's menu and Llama for
+	// Windows' tray flyout, each with its parts marked the way llama.app's hero numbers them
+	const { Story } = defineMeta({
+		parameters: {
+			controls: { disable: true },
+			layout: 'centered'
+		},
+		title: 'Llama UI/Mockups/App mockups'
+	});
+</script>
+
+{#snippet number(part: string)}
+	<span
+		class="flex size-6 items-center justify-center rounded-full bg-foreground text-[13px] font-semibold text-background ring-2 ring-background"
+		title={part}>{part[0].toUpperCase()}</span
+	>
+{/snippet}
+
+<Story asChild name="Mac menu">
+	<StateGallery columns={3} minItemWidth="20rem">
+		<StateGalleryItem label="Default">
+			<MacMenu />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="First launch, a download in progress">
+			<MacMenu downloading={0.42} installed={[]} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="With a page's marks">
+			<MacMenu annotate={number} />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
+
+<Story asChild name="Windows tray">
+	<StateGallery columns={2} minItemWidth="28rem">
+		<StateGalleryItem label="Default">
+			<WindowsTray />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="With a page's marks">
+			<WindowsTray annotate={number} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="A model's page">
+			<WindowsTray view="details" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="The Models card alone">
+			<WindowsTray card />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/models/ModelCapabilityIcons.stories.svelte b/ui/lib/ui/tests/stories/models/ModelCapabilityIcons.stories.svelte
new file mode 100644
index 000000000..c7ddc5a73
--- /dev/null
+++ b/ui/lib/ui/tests/stories/models/ModelCapabilityIcons.stories.svelte
@@ -0,0 +1,54 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { ModelCapabilityIcons } from '@ggml-org/llama-ui/models';
+
+	// what a model can do, as muted icons with a tooltip each: modalities (vision, audio, video) after capabilities
+	// (tool use, reasoning)
+	const { Story } = defineMeta({
+		component: ModelCapabilityIcons,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Models/ModelCapabilityIcons'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={3} minItemWidth="10rem">
+		<StateGalleryItem label="vision">
+			<ModelCapabilityIcons modalities={{ audio: false, video: false, vision: true }} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="reads, sees and hears">
+			<ModelCapabilityIcons modalities={{ audio: true, video: false, vision: true }} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="reasoning and tools">
+			<ModelCapabilityIcons supportsThinking supportsToolUse />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="everything">
+			<ModelCapabilityIcons
+				modalities={{ audio: true, video: true, vision: true }}
+				supportsThinking
+				supportsToolUse
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="larger" note="as in a model's header">
+			<ModelCapabilityIcons
+				gapClass="gap-2"
+				iconSize="size-icon-md"
+				modalities={{ audio: true, video: false, vision: true }}
+				supportsThinking
+				supportsToolUse
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="nothing" note="renders no box at all">
+			<ModelCapabilityIcons />
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/models/ModelCard.stories.svelte b/ui/lib/ui/tests/stories/models/ModelCard.stories.svelte
new file mode 100644
index 000000000..34285d875
--- /dev/null
+++ b/ui/lib/ui/tests/stories/models/ModelCard.stories.svelte
@@ -0,0 +1,54 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { Database, Download, ScrollText } from '@lucide/svelte';
+	import { ModelCapabilityIcons, ModelCard, ModelId, ModelOrgAvatar } from '@ggml-org/llama-ui/models';
+
+	// the surface every model card shares, Llama Chat's Discover and models page among them: the avatar and name are the
+	// card's one button (or link), capabilities and a description in the body, facts at the foot
+	const { Story } = defineMeta({
+		component: ModelCard,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Models/ModelCard'
+	});
+</script>
+
+{#snippet card(selected = false, dimmed = false)}
+	<ModelCard class="w-72" {dimmed} onSelect={() => {}} {selected} tooltip="ggml-org/gpt-oss-20b-GGUF">
+		{#snippet avatar()}
+			<ModelOrgAvatar org="openai" quantOrg="ggml-org" />
+		{/snippet}
+
+		{#snippet title()}
+			<ModelId hideOrgName name="gpt-oss-20b-GGUF" params="20B" stackId />
+		{/snippet}
+
+		<ModelCapabilityIcons asBadges supportsThinking supportsToolUse />
+
+		<p class="line-clamp-2 text-xs text-muted-foreground">
+			OpenAI's open-weight model for local reasoning and agents, with tool use and adjustable reasoning effort.
+		</p>
+
+		{#snippet footer()}
+			<span class="flex items-center gap-3 whitespace-nowrap">
+				<span class="inline-flex items-center gap-1"><Database class="size-icon-xs" />12.1 GB</span>
+				<span class="inline-flex items-center gap-1"><ScrollText class="size-icon-xs" />131.07K</span>
+			</span>
+		{/snippet}
+
+		{#snippet footerEnd()}
+			<span class="inline-flex items-center gap-1 text-muted-foreground"><Download class="size-icon-xs" />1.2M</span>
+		{/snippet}
+	</ModelCard>
+{/snippet}
+
+<Story asChild name="Default">
+	<StateGallery columns={3} minItemWidth="18rem">
+		<StateGalleryItem label="default">{@render card()}</StateGalleryItem>
+		<StateGalleryItem label="selected" note="its details are open">{@render card(true)}</StateGalleryItem>
+		<StateGalleryItem label="dimmed" note="a hidden model">{@render card(false, true)}</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/models/ModelFamilyCard.stories.svelte b/ui/lib/ui/tests/stories/models/ModelFamilyCard.stories.svelte
new file mode 100644
index 000000000..df61f0f1d
--- /dev/null
+++ b/ui/lib/ui/tests/stories/models/ModelFamilyCard.stories.svelte
@@ -0,0 +1,69 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { ModelFamilyCard } from '@ggml-org/llama-ui/models';
+
+	// a model family as llama.app's catalog shows it: one card for every size and quant of the family, its capabilities
+	// as icons, its sizes in one line. Data from llama.app's catalog and the Hub
+	const { Story } = defineMeta({
+		component: ModelFamilyCard,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Models/ModelFamilyCard'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={3} minItemWidth="18rem">
+		<StateGalleryItem label="several sizes" note="sees, hears, reasons, uses tools">
+			<ModelFamilyCard
+				description="Google's most capable open agentic models for your laptops, with vision, audio, and support for 140+ languages."
+				href="#gemma-4"
+				memGb={16}
+				modalities={{ audio: true, video: false, vision: true }}
+				name="Gemma 4"
+				org="google"
+				quantOrg="ggml-org"
+				released="Mar 2026"
+				sizeRange={{ max: 33_400_000_000, min: 4_590_807_392 }}
+				sizes="E2B–31B · 5 sizes"
+				supportsThinking
+				supportsToolUse
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="one size">
+			<ModelFamilyCard
+				description="Liquid AI's fast local model for reasoning and tool use."
+				href="#lfm-2-5"
+				memGb={24}
+				name="LFM 2.5"
+				org="LiquidAI"
+				quantOrg="ggml-org"
+				released="Oct 2026"
+				sizeRange={{ max: 25_493_733_408, min: 14_526_259_232 }}
+				sizes="24B-A2B"
+				supportsThinking
+				supportsToolUse
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="non-commercial" note="in place of the release month">
+			<ModelFamilyCard
+				description="Bespoke Labs' mid-sized decision model. Given a context and typed questions, it returns a probability for each option."
+				href="#bespoke-nimble"
+				memGb={16}
+				name="Bespoke Nimble"
+				nonCommercial
+				org="bespokelabs"
+				quantOrg="ggml-org"
+				sizeRange={{ max: 9_527_503_392, min: 6_324_185_632 }}
+				sizes="9B"
+				supportsThinking
+				supportsToolUse
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/models/ModelId.stories.svelte b/ui/lib/ui/tests/stories/models/ModelId.stories.svelte
new file mode 100644
index 000000000..6a161f83a
--- /dev/null
+++ b/ui/lib/ui/tests/stories/models/ModelId.stories.svelte
@@ -0,0 +1,78 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { ModelId, ModelOrgAvatar } from '@ggml-org/llama-ui/models';
+
+	// a model's name with its badges and icons, as Llama Chat's lists and llama.app's catalog show it; the models are
+	// from llama.app's catalog
+	const { Story } = defineMeta({
+		component: ModelId,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Models/ModelId'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={2} minItemWidth="20rem">
+		<StateGalleryItem label="name and params">
+			<ModelId name="gpt-oss" params="20B" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="with org and quant">
+			<ModelId name="gemma-4-E4B-it-GGUF" org="ggml-org" params="E4B" quantization="Q4_0" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="mixture of experts" note="active parameters joined to the total">
+			<ModelId activatedParams="A3B" name="Qwen3.6" params="35B" quantization="Q4_K_M" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="capabilities" note="vision, audio, reasoning, tool use">
+			<ModelId
+				modalities={{ audio: true, video: false, vision: true }}
+				name="gemma-4"
+				params="12B"
+				supportsThinking
+				supportsToolUse
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="draft model" note="an MTP head rides along">
+			<ModelId draftKinds={['mtp']} name="Qwen3.8" params="27B" quantization="Q4_K_M" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="tags">
+			<ModelId name="EmbeddingGemma 2" params="740M" tags={['embedding']} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="icons on a new line" note="with context and size, as in Discover">
+			<ModelId
+				contextLength={262144}
+				iconsOnNewLine
+				modalities={{ audio: false, video: false, vision: true }}
+				name="Qwen3.8-27B-GGUF"
+				sizeRange={{ max: 28_600_000_000, min: 16_400_000_000 }}
+				supportsThinking
+				supportsToolUse
+				wrap
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="in a row" note="with the maker's avatar">
+			<span class="flex items-center gap-2.5">
+				<ModelOrgAvatar org="openai" quantOrg="ggml-org" size="size-9" />
+
+				<ModelId
+					contextLength={131072}
+					iconsOnNewLine
+					name="gpt-oss-20b-GGUF"
+					sizeRange={{ max: 12_109_566_560, min: 12_109_566_560 }}
+					supportsThinking
+					supportsToolUse
+				/>
+			</span>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/models/ModelOrgAvatar.stories.svelte b/ui/lib/ui/tests/stories/models/ModelOrgAvatar.stories.svelte
new file mode 100644
index 000000000..e7a5a34de
--- /dev/null
+++ b/ui/lib/ui/tests/stories/models/ModelOrgAvatar.stories.svelte
@@ -0,0 +1,50 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { ModelOrgAvatar } from '@ggml-org/llama-ui/models';
+
+	// the maker's Hugging Face avatar, with the quantizer's in the corner when someone else published the GGUF; an
+	// org with no avatar falls back to its initial on a hue of its own
+	const { Story } = defineMeta({
+		component: ModelOrgAvatar,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Models/ModelOrgAvatar'
+	});
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={4} minItemWidth="8rem">
+		<StateGalleryItem label="maker">
+			<ModelOrgAvatar org="google" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="maker and quantizer">
+			<ModelOrgAvatar org="Qwen" quantOrg="ggml-org" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="inverted in dark" note="a dark mark on transparent">
+			<ModelOrgAvatar org="openai" quantOrg="ggml-org" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="no avatar" note="the monogram">
+			<ModelOrgAvatar org="no-such-org-on-the-hub" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="small" note="in a list row">
+			<ModelOrgAvatar org="LiquidAI" quantOrg="ggml-org" quantSize="size-3" size="size-5" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="large" note="in a model's header">
+			<ModelOrgAvatar
+				org="mistralai"
+				quantOrg="ggml-org"
+				quantPositionClass="-bottom-1.5 -right-1.5"
+				quantSize="size-6"
+				size="size-12"
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
diff --git a/ui/lib/ui/tests/stories/models/ModelQuantChip.stories.svelte b/ui/lib/ui/tests/stories/models/ModelQuantChip.stories.svelte
new file mode 100644
index 000000000..9ea11a1d5
--- /dev/null
+++ b/ui/lib/ui/tests/stories/models/ModelQuantChip.stories.svelte
@@ -0,0 +1,88 @@
+<script lang="ts" module>
+	import StateGallery from '../helpers/StateGallery.svelte';
+	import StateGalleryItem from '../helpers/StateGalleryItem.svelte';
+	import { defineMeta } from '@storybook/addon-svelte-csf';
+	import { ModelQuantChip, ModelQuantRow } from '@ggml-org/llama-ui/models';
+	import { minMemoryTierGb } from '@ggml-org/llama-ui/models';
+
+	// one quant of a model, in each state the app can give it; actions come back as callbacks, so the chip downloads
+	// nothing itself
+	const { Story } = defineMeta({
+		component: ModelQuantChip,
+		parameters: {
+			layout: 'centered'
+		},
+		title: 'Llama UI/Models/ModelQuantChip'
+	});
+
+	const Q4 = 16_400_000_000;
+	const Q8 = 28_600_000_000;
+</script>
+
+<Story asChild name="Default">
+	<StateGallery columns={3} minItemWidth="12rem">
+		<StateGalleryItem label="idle" note="downloads on click">
+			<ModelQuantChip label="Q4_K_M" sizeBytes={Q4} />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="downloading">
+			<ModelQuantChip
+				label="Q4_K_M"
+				progress={{ downloadedBytes: Q4 * 0.42, totalBytes: Q4 }}
+				sizeBytes={Q4}
+				state="downloading"
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="paused">
+			<ModelQuantChip label="Q4_K_M" sizeBytes={Q4} state="paused" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="downloaded" note="deletes on click">
+			<ModelQuantChip label="Q8_0" sizeBytes={Q8} state="downloaded" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="failed" note="retries on click">
+			<ModelQuantChip label="Q4_K_M" sizeBytes={Q4} state="failed" />
+		</StateGalleryItem>
+
+		<StateGalleryItem label="with a draft" note="the MTP head rides along">
+			<ModelQuantChip
+				companion={{ kind: 'mtp', quant: 'Q8_0', sizeBytes: 900_000_000 }}
+				label="Q4_K_M"
+				sizeBytes={Q4}
+			/>
+		</StateGalleryItem>
+
+		<StateGalleryItem label="as a link" note="hands the install to another app">
+			<ModelQuantChip
+				actionLabel="Install Q4_K_M in Llama"
+				href="llama://install?repo=ggml-org/Qwen3.8-27B-GGUF&quant=Q4_K_M"
+				label="Q4_K_M"
+				sizeBytes={Q4}
+			/>
+		</StateGalleryItem>
+	</StateGallery>
+</Story>
+
+<Story asChild name="Rows">
+	<div class="w-[min(36rem,calc(100vw-2rem))] divide-y divide-border p-4">
+		<ModelQuantRow bitDepth={8} memGb={minMemoryTierGb(Q8)}>
+			<ModelQuantChip label="Q8_0" sizeBytes={Q8} state="downloaded" />
+		</ModelQuantRow>
+
+		<ModelQuantRow bitDepth={4} memGb={minMemoryTierGb(Q4)}>
+			<ModelQuantChip label="Q4_K_M" sizeBytes={Q4} />
+			<ModelQuantChip label="Q4_0" sizeBytes={15_700_000_000} />
+
+			{#snippet command()}
+				<pre
+					class="overflow-x-auto rounded-panel bg-(--surface-code) px-3 py-2 text-xs text-(--fg-code)">llama serve -hf ggml-org/Qwen3.8-27B-GGUF:Q4_K_M</pre>
+			{/snippet}
+		</ModelQuantRow>
+
+		<ModelQuantRow bitDepth={2} memGb={minMemoryTierGb(10_200_000_000)}>
+			<ModelQuantChip label="Q2_K" sizeBytes={10_200_000_000} />
+		</ModelQuantRow>
+	</div>
+</Story>
diff --git a/ui/lib/ui/tests/stories/svx.d.ts b/ui/lib/ui/tests/stories/svx.d.ts
new file mode 100644
index 000000000..88dce6044
--- /dev/null
+++ b/ui/lib/ui/tests/stories/svx.d.ts
@@ -0,0 +1,6 @@
+// .svx pages (mdsvex) import as Svelte components
+declare module '*.svx' {
+	import type { Component } from 'svelte';
+	const page: Component;
+	export default page;
+}
diff --git a/ui/lib/ui/tsconfig.json b/ui/lib/ui/tsconfig.json
index c34626e67..2db8c1e95 100644
--- a/ui/lib/ui/tsconfig.json
+++ b/ui/lib/ui/tsconfig.json
@@ -3,5 +3,5 @@
   "compilerOptions": {
     "strict": true
   },
-  "include": ["src", "vite.config.ts"]
+  "include": ["src", "tests", "vite.config.ts"]
 }
diff --git a/ui/lib/ui/vite.config.ts b/ui/lib/ui/vite.config.ts
index e09bcd2a5..a9a6a40a1 100644
--- a/ui/lib/ui/vite.config.ts
+++ b/ui/lib/ui/vite.config.ts
@@ -3,9 +3,16 @@ import { playwright } from "vite-plus/test/browser-playwright";
 import adapter from "@sveltejs/adapter-auto";
 import { sveltekit } from "@sveltejs/kit/vite";
 import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
+import { mdsvex } from "mdsvex";
 import tailwindcss from "@tailwindcss/vite";
 import { defineConfig, lazyPlugins } from "vite-plus";
+import path from "node:path";
+import { fileURLToPath } from "node:url";
+import { storybookTest } from "@storybook/addon-vitest/vitest-plugin";
+const dirname =
+  typeof __dirname !== "undefined" ? __dirname : path.dirname(fileURLToPath(import.meta.url));

+// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
 export default defineConfig({
   fmt: {},
   lint: {
@@ -35,9 +42,24 @@ export default defineConfig({
       // If your environment is not supported, or you settled on a specific environment, switch out the adapter.
       // See https://svelte.dev/docs/kit/adapters for more information about adapters.
       adapter: adapter(),
-      // ui/apps/chat imports through $lib, which SvelteKit 3 dropped; keeping it lets its files be copied as they are
-      alias: { $lib: "src/lib" },
-      preprocess: [vitePreprocess()],
+      alias: {
+        // ui/apps/chat imports through $lib, which SvelteKit 3 dropped; keeping it lets its files be copied as they are
+        $lib: "src/lib",
+        // the stories import the package by its published entry points, as an app does, so that Llama Chat's
+        // Storybook can show them too (it maps the same names onto these sources, see ui/apps/chat/scripts/llama-ui.js)
+        "@ggml-org/llama-ui/ui/*": "src/lib/components/ui/*",
+        "@ggml-org/llama-ui/app/*": "src/lib/components/app/*",
+        "@ggml-org/llama-ui/models": "src/lib/components/models/index.ts",
+        "@ggml-org/llama-ui/constants": "src/lib/constants/index.ts",
+        "@ggml-org/llama-ui/enums": "src/lib/enums/index.ts",
+        "@ggml-org/llama-ui/code": "src/lib/utils/index.ts",
+        "@ggml-org/llama-ui/utils": "src/lib/components/ui/utils.ts",
+        "@ggml-org/llama-ui/styles/*": "src/lib/styles/*",
+        "@ggml-org/llama-ui": "src/lib/index.ts",
+      },
+      // Storybook's content pages are Markdown with Svelte in them (.svx), as in ui/apps/chat
+      extensions: [".svelte", ".svx"],
+      preprocess: [vitePreprocess(), mdsvex()],
     }),
   ]),
   test: {
@@ -82,6 +104,29 @@ export default defineConfig({
           exclude: ["src/**/*.svelte.{test,spec}.{js,ts}"],
         },
       },
+      {
+        extends: true,
+        plugins: [
+          // The plugin will run tests for the stories defined in your Storybook config
+          // See options at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon#storybooktest
+          storybookTest({
+            configDir: path.join(dirname, ".storybook"),
+          }),
+        ],
+        test: {
+          name: "storybook",
+          browser: {
+            enabled: true,
+            headless: true,
+            provider: playwright({}),
+            instances: [
+              {
+                browser: "chromium",
+              },
+            ],
+          },
+        },
+      },
     ],
   },
 });