` collapse.
- Never try to fit a sidebar into a mobile viewport by shrinking width — icon rails don't have room for text, offcanvas keeps both controls and content legible.
This is about behavior, not aesthetics. If you need a side panel on mobile, it slides over.
## 2.7. Reduced motion
Handled **once**, at the token layer. `packages/tokens/dist/tokens.css` ships a global
```css
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
```
…which zeroes every transition and animation duration system-wide when the user has set `prefers-reduced-motion`. **Components must never gate animations on `motion-safe:` / `motion-reduce:`** — the global rule covers it. The only exception is when a component has an animation that is *structural* (e.g. collapsible content height) and must explicitly be preserved; document the exception in the component.
## 3. Typography
- **Families** (one mode — Tidal 1.0 collapsed the old Internal/External duality):
- `font-sans` — **Inter** (UI, body, and everything below `h3`). Resolved via `var(--font-sans)`.
- `font-serif` — **Iowan Old Style** → Georgia → serif. (macOS system font; license a webfont to self-host for all platforms.)
- `font-mono` — **JetBrains Mono** (code).
- `font-heading` — **`h1`, `h2`, and `h3` headings**. Resolves to `var(--font-serif)` (Iowan Old Style → Georgia). `h4`+ stays sans. **Component titles are not headings** — they render as `` and take Figma's `paragraph-*` styles (see §8.11).
- **Heading weight**: `--font-heading-weight` is `400` (regular). Serif headings never take `font-medium` — the face carries its own weight, and a utility class would override the token. In this repo's docs a base `h1, h2, h3` rule applies family, weight, and tracking automatically.
- **Serif tracking is per level**, matching the Figma text styles exactly: **H1 `-3%`, H2 `-3%`, H3 `-2.5%`** (`Title-*` at 60px+ uses `-6%`; nothing ships that large yet). Applied by the base rule — **never hand-apply `tracking-tight` to a serif heading**, the utility overrides the rule and flattens every level to `-2.5%`.
- **Figma's heading styles start at 20px.** The ladder is H1 48 / H2 36 / H3 28 (all Iowan serif) → H4 24 / H5 20 (Inter) → `paragraph-lg` 17 / `paragraph-base` 14 / `paragraph-small` 12 / `paragraph-mini` 11. Anything at 17px or below is a **paragraph style**, not a heading style, whatever element it uses.
- **Allowed weights (only)**: `font-normal` (400), `font-medium` (500), `font-semibold` (600). Bold / extrabold / black / light / thin are deliberately **not exposed** through the Tailwind preset. If Figma ships a design that uses them, push back or translate to semibold.
- **Ratio-based size scale** anchored on a **14px base** — each step is a multiple of `--text-base`, emitted as `calc(var(--text-base) * ratio)`, so bumping the base re-flows the whole scale: `text-xs=10, text-sm=12, text-base=14, text-lg=17, text-xl=20, text-2xl=24, text-3xl=30`. `.typography-internal` / `.typography-external` are kept as back-compat aliases.
- **Leading (unitless, scale with font-size)**: `leading-tight` 1.25, `leading-snug` 1.375, `leading-normal` 1.5, `leading-relaxed` 1.65, `leading-loose` 2. **Rule: larger text → tighter leading.** `tight` for display / `text-3xl`+, `snug` for headings (`text-lg`–`2xl`), `normal` for dense UI (labels, table cells, menu rows), **`relaxed` for body & prose (the default — a bare `text-base` already resolves to it)**, `loose` only for airy/sparse layouts. You rarely set leading by hand.
- The Tailwind utility `text-base` resolves to `var(--text-base)`.
---
## 3.5. Surfaces & focus rings
**Surfaces are flat** (Tidal 1.0). Buttons, Select/Tabs/PageTab, Card, Popover, and Sidebar use solid fills — no gradients. Hover is a flat color shift via `transition-colors`, e.g. `bg-[var(--button-default)] hover:bg-[var(--button-default-hover)]`; the lilac CTA is `bg-primary hover:bg-[var(--button-primary-hover)]`. Shadows are kept. (The old `--gradient-button-*` vars and `bg-button-*` image utilities were removed.)
**Focus rings** are compound `box-shadow` tokens, not outlines:
- `shadow-ring-primary` — 1px solid `--border-focus` + 1px halo (lilac @ 70%)
- `shadow-ring-destructive` — 2px background spacer + 2px destructive ring (shadcn-style "gap" focus ring)
Apply via `focus-visible:shadow-ring-primary` (and `focus-visible:outline-none`).
## 4. Spacing, radius, shadows
- **Spacing — Tidal Compact scale.** Class numbers do **not** map to standard Tailwind pixels. Use this lookup or just trust the rules below:
| Class | px | | Class | px |
|---|---|---|---|---|
| `gap-1` | 2 | | `gap-3` | 10 |
| `gap-1.5` | 4 | | `gap-3.5` | 12 |
| `gap-2` | 6 | | `gap-4` | 14 |
| `gap-2.5` | 8 | | `gap-5` | 18 |
Heights (`h-*`) use the standard scale (`h-8 = 32px`).
- **Radius** (Tidal 1.0 — even +2 scale): `--radius` (6px) is the system base. `rounded-sm` = 4px, `rounded-md` = 8px, `rounded-lg` = 10px, `rounded-xl` = 12px, `rounded-full` = pills.
- **`--radius-popover` (12px, = `xl`)** is the canonical radius for **floating surfaces** (Popover, DropdownMenu, Command, future Tooltip). Apply via `rounded-[var(--radius-popover)]`. Do **not** use `rounded-lg` or `rounded-[var(--radius)]` on a floating surface — target the role, not the number, so the slot can drift independently.
- **Shadows**: `shadow-sm` (subtle), `shadow` (default elevation), `shadow-popover` (with backdrop blur). Never craft a one-off shadow inline.
### Canonical spacing rules
| Rule | Value | Class | Used by |
|---|---|---|---|
| Control horizontal padding | sm 8 / md 10 / lg 12 px | `px-2` / `px-2.5` / `px-3` | Button, Select, Toggle, Input |
| Internal gap (icon ↔ text within a control) | 6px | `gap-1.5` | Button, Badge, SelectTrigger |
| Group gap (sibling controls in a bar) | 4px | `gap-1` | TabsList, ToggleGroup, Pagination |
| List-item gap (menu rows) | 2px | `gap-0.5` | MenuItem, DropdownMenu |
| Form stack (Field) | 6px | `gap-2` | Field default — Label → control → description/error |
### Container density
`Card`, `Dialog`, `AlertDialog`, `Sheet`, `Popover`, `SidePanel` all accept a `density` prop (compact / comfortable). Card uses `padding="sm" | "lg"` for the same idea. Density cascades to sub-components via React context.
| Slot | Compact | Comfortable |
|---|---|---|
| Shell | 8–12px | 20–24px |
| Section gap (header / body / footer) | 8px | 16px |
| Header stack (title ↔ description) | 4px | 8px |
| Body stack | 8px | 16px |
| Anchor offset (floating surfaces) | 6px | n/a |
### Notification surfaces aligned
`Alert`, `Toast`, and `Sonner` share padding/gap math: shell `p-4` (14px), icon→body `gap-3` / `gap-x-[10px]` (10px), title↔description gap (2px) via `gap-y-1` (Alert grid) / `gap-1` (Toast wrapper) / `mt-1` (Sonner description).
### New semantic tokens (use these, not hex)
| Token | What | When |
|---|---|---|
| `--border-subtle` | Hairline border — `rgba(0,0,0,0.12)` light / `rgba(255,255,255,0.12)` dark | Floating surfaces (Popover/Dropdown/Command) where `--border-default` is too faint against the translucent fill. |
| `--surface-hover-overlay` | Subtle fill overlay — `rgba(0,0,0,0.03)` light / `rgba(255,255,255,0.04)` dark | Hover overlays on tokenized surfaces (Input, Textarea, Command input). Eliminates the `dark:hover:…` duplicate rule. |
| `--radius-popover` | `12px` | Radius of floating surfaces (= `xl`; see above). |
| `--header-height` | `56px` | Page header AND `Sidebar`/`SidePanel` header heights. Override on a parent to scale chrome together. |
| `--button-primary-border` | `#964aba` | Deeper viola for accent-tone button borders. The light lilac `--button-primary` loses saturation at 1px. |
**`dark:` is forbidden in components.** Every case that previously required a `dark:` override on a tokenized element must go through a token whose light/dark values are defined in `packages/tokens`. If you encounter a new case that isn't covered — add a token, don't patch with `dark:`.
---
## 4.5. Textarea action bar pattern
When a Textarea has an action bar below it (chat composer, command prompt, etc.), the bar splits into **two button groups**:
- **Left** — context: model picker, mode toggles, scope selectors. Anything that changes *where the input goes* or *what it means*.
- **Right** — actions: file upload, mic, then the **Send** button. Send is the only Primary button in the bar and sits at the far right.
Both groups use Ghost buttons (`variant="ghost"`, `size="sm"`) except for Send, which is Primary IconButton. Upload/mic on the right are IconButtons too. On the left, use labeled Ghost buttons (`"Claude Opus 4.6 ▾"`, `"+ Add"`).
**The hover / focus / invalid ring wraps the whole composer** (textarea + action bar) — not just the textarea. Strip the Textarea's own border/shadow/focus and move them to the outer wrapper via `focus-within:` and `has-[[aria-invalid=true]]:`. The action bar is part of the field, visually.
## 5. Component composition rules
1. **Reserve Accent for one CTA per page.** `` (high-contrast inverse default) is the workhorse CTA. `` (lilac) is the brand moment — reserved for the single most important action or CTA on a given view. If a design calls for multiple Accent buttons, push back: either keep them all on `tone="default"`, or identify the one that genuinely outranks the others and keep only that one on `tone="accent"`. Same rule for ``.
1a. **Card elevation: default to 0.** Most cards should render flat (`elevation={0}`). Only promote to `1` or `2` when a clear information hierarchy calls for it (a floating callout, a single "featured" card among peers). If multiple cards on a page would qualify for elevated, reconsider — probably only one should be.
1b. **CardHeader padding scales with CardTitle size.** CardTitle exposes a `size` prop (`sm | md | lg | xl`). When you bump the title to `lg` or `xl`, CardHeader automatically steps up both vertical and horizontal padding (via a `has-[[data-title-size]]:` selector) so the header gets proportional breathing room. You don't need to touch Card's `padding` prop to make a hero card feel right — just set `… `.
1d. **`variant × tone` is the canonical component API shape.** Any component with both a visual style axis and an intent axis uses two props: `variant` (style) and `tone` (intent). This matches `Button`, `IconButton`, and `Badge`:
- `Button` / `IconButton`: `variant: primary | default | outline | ghost | link` × `tone: default | destructive | success | accent`. A colored tone (`destructive | success | accent`) only applies to `primary` (filled), `outline`, and `link` — `default` and `ghost` are neutral-only.
- `Badge`: `variant: solid | secondary | tinted` × `tone: default | destructive | success | accent`. (No `outline` variant.) `secondary` is the soft "status" look — text at full hue, fill + border at 10% — and a `color` prop maps any CSS hue into that soft style (or into `tinted`'s solid-translucent fill). `solid` default is the neutral inverse chip; `solid accent` is lilac. Use `tinted` + `color` for user-generated/per-item hues, the named tones for fixed statuses.
Don't conflate the two into a single flat `variant` list (e.g. `"primary" | "destructive"`) — that muddles the mental model and makes compound cases like "outline + success" unreachable. Use `cva` compound variants to express the cell-by-cell styling.
1c. **Reuse `CardTitle` + `CardDescription` anywhere you need a title + description pair.** They work standalone — no `` parent required. Use them inside ``, ``, toolbar headers, whatever. For Popover/Dialog, pass `` (text-base). For Card, the default (`size="md"` → text-lg) is right. Never hand-roll `` + ` ` — the type scale will drift.
2. **Compose, don't reinvent.** If `Card`, `Button`, `Input` exists, use it. Don't wrap a `
` to imitate a card.
3. **Polymorphic via `asChild`** (Radix pattern) is preferred over `as` props.
4. **Variants live in the component** via `cva` (class-variance-authority). Don't pass `className` to override variant styles — add a variant.
5. **Forward refs** on every interactive component.
6. **Accept `className`** and merge with `cn()` (`packages/react/src/lib/cn.ts`).
7. **Accessibility is non-negotiable**: keyboard navigation, focus states (`focus-visible:ring-2 ring-primary`), proper roles. Use Radix Primitives for any interactive widget.
---
## 6. New-component checklist
When adding a component (P2+), every PR must include:
- [ ] `packages/react/src/components/
.tsx` — implementation, with `cva` variants, `forwardRef`, `displayName`
- [ ] `apps/docs/content/docs/components/.mdx` — usage, props table, all variants rendered, do/don't, accessibility notes
- [ ] A live preview (` `) in the MDX
- [ ] Source-of-truth note linking back to the Figma node ID
- [ ] Updated `CHANGELOG.md` entry
---
## 7. Forbidden patterns
| Don't | Why | Do instead |
|---|---|---|
| `font-bold` / `font-extrabold` / `font-black` / `font-light` | not in the allowed weight set | `font-semibold` (heaviest we use) |
| `bg-[#cd82f0]` | bypasses the system | `bg-primary` |
| `style={{ padding: 13 }}` | off-scale | `p-3` (12) or `p-3.5` (14) |
| `dark:…` on a tokenized component | duplicates dark logic | fix the token (or add a new semantic token — see §4) |
| `style={{ opacity: 0.5 }}` for disabled state | inline style can't be overridden | use `disabled:opacity-50 data-[disabled]:opacity-50` classes (see §2.4) |
| `disabled:text-foreground-disabled` / `disabled:bg-secondary` chrome dimming | drifts from canonical 50% opacity rule | use `disabled:opacity-50` (see §2.4) |
| `motion-safe:` / `motion-reduce:` in a component | reduced motion is global (see §2.7) | do nothing — the global rule handles it |
| `rounded-lg` on a Popover/Dropdown surface | wrong semantic | `rounded-[var(--radius-popover)]` |
| New component without MDX docs | invisible to consumers | follow §6 |
| Editing `dist/` files | regenerated on every build | edit the source in `src/` |
| Importing from `tailwindcss/colors` in a component | leaks primitives | go through a semantic token |
---
## 8. Screen-building patterns
Patterns codified from iterative design reviews of production screen mocks.
### 8.1 Components over custom markup
Always check `@liquidai/react` for an existing component before hand-building UI. Use design system primitives even if the result deviates from a reference design (e.g., an IDE mock). Consistency with the system matters more than mimicking an external product.
### 8.2 Defaults over overrides
Use components with zero `className` overrides first. Only add styling after confirming the default doesn't work. Overrides fighting component defaults are the #1 source of visual bugs in screen mocks.
### 8.3 No redundant information
If tabs already label a panel's content, don't add a separate header above them. Every element in a dense tool UI must earn its space.
### 8.4 Collapsible panels: header always visible
The trigger/header bar stays visible at all times — only the content body collapses. Hiding the header removes the user's ability to re-expand.
- Place the trigger row **outside** `CollapsibleContent`.
- `CollapsibleContent` wraps only the expandable body.
- Use `CollapsibleTrigger asChild` when the trigger needs to be a custom element (e.g., a row with tabs + badges + a toggle button).
### 8.5 Status color system
| Meaning | Color | Token | Tailwind utility |
|---------|-------|-------|-----------------|
| Error / failure | Red | `--status-error` | `text-status-error` |
| Warning / caution | Amber / gold | `--status-warning` | `text-status-warning` |
| Success / healthy | Green | `--status-success` | `text-status-success` |
| Informational | Cerulean | `--status-info` | `text-status-info` |
Never use green for warnings. Always pair color with an icon shape or text label — never rely on color alone. Prefer `text-status-*` utilities over raw `text-[var(--button-*)]` or Tailwind color classes (`text-amber-500`).
### 8.6 PageTabBar vs Tabs — when to use which
| Scenario | Component |
|----------|-----------|
| File tabs, editor tabs, query tabs, open documents — closeable, with icons | `PageTabBar` + `PageTab` |
| View switching within a panel (Terminal / Problems / Output, Settings sections) | `Tabs` + `TabsTrigger` |
`PageTab` has an `icon` prop for left-aligned decorations. Pass icons via `icon`, not as children — children become the text label. This prevents vertical stacking in small tab spaces.
### 8.7 Text sizing in tool UIs
| Size | Use for |
|------|---------|
| `text-sm` (14px) | Tool content: code, terminal output, diagnostics, form fields, panel body text |
| `text-xs` (12px) | Metadata only: status bars, column headers, timestamps, breadcrumbs |
Don't default to `text-xs` for primary content — it reads as uncomfortably compact.
### 8.8 Dark mode for screen mocks
Force dark mode via `next-themes` `setTheme("dark")` (see `apps/docs/app/(screens)/force-dark.tsx`). Do **not** add `class="dark"` to a wrapper div — CSS custom properties for dark mode are scoped to `html.dark`, so a dark class on a descendant div won't trigger them. Components like `PageTab` (`bg-button-default`) will resolve to light-mode values if the `html` element isn't in dark mode.
### 8.9 Dev workflow: component library changes
After editing files in `packages/react/src/components/`, the Next.js dev server HMR cache won't reliably update. Run:
```bash
rm -rf apps/docs/.next && npx next dev -p
```
### 8.10 Content alignment — share one gutter
Everything in a column should line up on a single left (and right) edge. Pick **one gutter** for a screen — the page's horizontal padding — and align every row of content to it: the page header, section headings, body text, toolbars, and **table / list rows**. Nothing should sit a few pixels off from its neighbours.
- **One gutter per screen.** The page (or panel) container owns it (e.g. `px-6`). Section content inherits it; don't sprinkle ad-hoc `px-*` that breaks the line.
- **Tables and lists align to the gutter, not to themselves.** A data table's borders/dividers may run **full-bleed** to the panel edge, but the cell *content* — the first column, the header labels, and the toolbar/search above it — must start on the same gutter as the page title. Pattern: full-bleed ``, then pad the first/last cells to the gutter (`[&_td:first-child]:pl-6 [&_td:last-child]:pr-6`). See the **Evaluation dashboard** example (`apps/docs/app/(screens)/evaluation-dashboard/`): the table borders span edge-to-edge, but the page title, search box, column headers, and every row's first column all share one left edge.
- **Vertical rhythm is shared too.** Within a section use one step (`space-y-4`); between top-level sections use `space-y-10`. Don't mix `space-y-3` / `space-y-4` / `space-y-6` on sibling sections.
- **Nested content aligns to its container's content box** — a control inside a `Card` aligns to the card's padding edge, not a new arbitrary indent.
Rule of thumb: if you can drop a single vertical line down the left of a screen and every heading, paragraph, control, and first table column touches it, the alignment is right.
### 8.11 Serif carries the heading levels; the nav-bar title opts out
The serif face (Iowan Old Style → Georgia) carries **`h1`, `h2`, and `h3`** — applied by a base `h1, h2, h3 :not(.font-sans)` rule in `globals.css` at weight `400` and `-2.5%` tracking. `h4`+ stays sans.
**Section labels at paragraph scale are sans.** Most "section headings" in a
dense screen — `General`, `Compute`, `Notifications` in a settings form — are
sized `text-lg` (17px), which is Figma's `paragraph-lg/medium`: **Inter, 17,
weight 500, 0% tracking**. They are correctly marked up as ``/`` for the
document outline, but they are not *styled* as headings, so they opt out:
``.
Serif is reserved for headings at genuine heading scale — `text-2xl` (24) and
above. In practice that is page titles and hero headings, roughly seven call
sites across the docs app, versus ~157 at paragraph scale.
**Rule of thumb: the element expresses structure, the size decides the family.**
`text-2xl`+ on an h1/h2/h3 → serif, tracking from the base rule. `text-lg` and
below → `font-sans font-medium`, no tracking utility.
**Component titles are paragraphs, not headings.** A card, dialog, sheet, or
side-panel title labels a *component*, not a region of the document — and Figma
styles every one of them with a `paragraph-*` text style, never a heading style
(check any component node: the Card at `4707:17850` uses
`paragraph-base/.../medium` and `paragraph-lg/.../medium`). They therefore
render as ` `, which keeps them out of the serif rule and out of the document
outline, so a grid of twenty cards doesn't emit twenty `
`s.
| Component | Element | Figma style |
|---|---|---|
| `CardTitle` | ` ` | `paragraph-base` / `paragraph-lg` medium |
| `DialogTitle` / `SheetTitle` / `AlertDialogTitle` | `
` via Radix `asChild` | `paragraph-base` medium |
| `SidePanelTitle` / `SidePanelSectionTitle` | `
` | `paragraph-base` / `paragraph-small` medium |
| `AlertTitle` | `
` | — below the serif range |
The dialog family wraps the ` ` in Radix's `Title` with `asChild`, so the
generated id — and therefore the dialog's `aria-labelledby` — is preserved. The
accessible name comes from the id reference, not the tag, so nothing is lost.
Never drop the Radix `Title` wrapper to "simplify" this.
Hand-rolled panel titles in a screen follow the same rule: `
`. **Rule of thumb: if it sits inside a bordered surface and labels
that surface, it is a `
`.** Serif is for headings that label a *region of the
page*.
The other place serif is **not** wanted is the compact title in the **app header
/ nav bar** next to the sidebar trigger.
- **Nav-bar / header-strip title** → **sans, `text-base font-medium`.** Because any bare `
` resolves to serif, opt out explicitly: ``. The `font-sans` class is the system's built-in escape hatch (see `globals.css`).
- **Big hero page heading** (its own region inside the content, often with a description below) → **serif**, the default `` (`text-2xl`, no `font-medium` — serif carries its own weight). This is where the serif belongs.
- **Section headings** (`h2`, `h3`) → **serif**, no `font-medium`. Weight and tracking come from the base rule; only set the size (`text-lg` for `h2`, `text-base`/`text-lg` for `h3`).
Why the nav-bar exception: serif crammed into a 56px header strip reads as decorative and fights the dense tool UI around it. The header-strip title is a *location label*, not a page heading, so it stays in the sans body family. Reference: the shared screen shell (`apps/docs/app/(screens)/_shell.tsx`) and the Evaluation dashboard header.
### 8.12 Agent interfaces (chat, reasoning, artifacts)
Anything where an agent talks, works or produces things for the user — chat threads, thinking/streaming states, reasoning traces, task progress, approval requests and artifact previews — follows **`AGENT_UI.md`** (draft). Key invariants: agent messages have no bubble; the agent asks before acting outside the conversation; reasoning is collapsed by default; every artifact uses the one shared preview shell. Figma reference: the **"Agent patterns [Draft]"** page of the main Tidal file.
---
## 9. File map (where things live)
```
design-tokens/ ← canonical Figma export (DTCG, do not edit by hand)
manifest.json
Semantics.{light,dark}/liquid.tokens.json
Typography.Liquid {Internal,External}.tokens.json
Tailwind Colors.Mode 1.tokens.json
Tailwind Primitives.{Liquid,Mode 2}.tokens.json
Liquid colors.Mode 1.tokens.json
Primitives.Mode 1.tokens.json
*.styles.tokens.json ← gradients/effects/text styles (TODO: importer)
packages/tokens/
scripts/build.ts ← importer: design-tokens/ → src/_generated.ts + dist/
src/
_generated.ts ← generated, do not edit
gradients.ts ← focus rings (hand-curated; surfaces are flat)
shadows.ts ← hand-curated supplements
index.ts ← public API
dist/ ← generated outputs (tokens.css, tokens.json, tailwind-preset.js)
apps/docs/
app/ ← Next.js app router pages
public/fonts/ ← Inter + Chakra Petch .woff2 files
```
---
## 10. Before you build — clarify and propose
### 10.1 Ask for clarity when the brief is underspecified
If a PRD, prompt, or design brief doesn't answer these questions, **stop and ask the prompter** before writing any code:
1. **What is the primary user task on this screen?** (If unclear, you can't identify Level 1.)
2. **What data is displayed, and how much of it?** (Determines table vs list vs cards, and whether pagination/filtering is needed.)
3. **What states need to exist?** (Empty, loading, error, partial, no-access — if the brief only describes the happy path, ask about the others.)
4. **What actions can the user take?** (Create, edit, delete, bulk operations — determines button placement, modals, confirmation flows.)
5. **What existing components should be used?** (If the brief doesn't reference the design system, ask which components from `@liquidai/react` are expected.)
Don't guess on ambiguous requirements. A 30-second clarification question saves hours of rework.
### 10.2 Propose the build plan before implementing
Before writing code for a new screen or major feature, present a short build plan to the prompter for approval:
```
## Build Plan: [Screen/Feature Name]
**Purpose:** What is this screen for?
**Layout:** Which page structure pattern? (List View, Detail View, Dashboard, Settings, etc.)
Reference: [cite which products/patterns from ux_patterns_researched.md inform this choice]
**Key components:**
- [Component] → [purpose] → [why this component vs alternatives]
**States:** Loading / Empty / Error / No-access — one line each describing what the user sees.
**Open questions:** Anything still ambiguous after reading the brief.
```
The prompter may approve, adjust, or redirect. **Do not write code until the plan is approved.** This applies to: new pages, new major components, layout changes, and navigation changes. It does not apply to trivial changes (adding a field, fixing a color, updating copy).
---
## 11. When in doubt
- Check Figma first (`mcp__figma__get_design_context` with the node ID).
- If it's not in Figma, **ask before inventing**. Don't extrapolate the system on your own.
- If you're patching a bug in code that drifts from Figma, fix the code to match Figma (or open a sync request).
**Sensible defaults** (reach for these when a brief is underspecified — the calmest, most neutral choice):
| Decision | Default | Escalate only when… |
|---|---|---|
| Control size | `md`, chosen **once per container** | dense/table context → `sm` (whole container); hero/presence → `lg`; never mixed within one container |
| Button | `variant="default"` (neutral) | the page's single primary action → `primary`; the one brand moment → `tone="accent"` |
| Tone | `default` (neutral) | the content genuinely signals error/success/info |
| Card elevation | `0` (flat) | a single floating/featured card needs to lift |
| Container density | `comfortable` | a genuinely dense inspector/toolbar → `compact` |
| Text color | `text-foreground` | captions / metadata / secondary → `text-muted-foreground` |
| Radius | the component's token (don't override) | never hand-pick a px radius |
One Primary and at most one accent per page. If two things both want to be primary, one of them isn't.
> **Gotcha:** the Tailwind `/opacity` modifier (e.g. `border-primary/50`, `bg-primary/10`) is **dropped** on these `var()`-based color tokens — it silently renders nothing and the base/fallback leaks through. Use a solid token (`border-primary`) or a dedicated `*-fill-NN` / `*-50` token instead.