# Meridian Design Language

> A visual and interaction system for products built for engineers — dense where it matters, calm everywhere else, and polished down to the last pixel. v1.0, October 2026. Rules only: https://design.chopper.dev/rules.md. MCP server: https://design.chopper.dev/mcp. The site: https://design.chopper.dev.

MUST / MUST NOT are non-negotiable. SHOULD / SHOULD NOT are the default; deviate only with a short comment saying why. MAY is allowed when it helps. AVOID is allowed but a smell. Cite a rule by its ID (MER-01.1). Rules with a tool behind them are enforced by @meridian/eslint-plugin.

A visual and interaction system for products built for engineers — dense where it matters, calm everywhere else, and polished down to the last pixel. Quiet tools for loud work. Version 1.0, October 2026: foundations, components, kit, patterns and tokens.

## 01. Principles

**Four rules that settle every argument.**

When two good options conflict, the principle higher on this list wins. Our users are engineers: they read fast, they notice sloppiness, and they live in these screens for hours.

Rules:

- `MER-01.1` [MUST] When two good options conflict, let the principle higher on this list win.
- `MER-01.2` [MUST] Content is the interface: chrome recedes so data, logs and code can lead; color is information, not decoration — if everything is highlighted, nothing is.
- `MER-01.3` [MUST] Use one accent per screen; neutrals do the rest.
- `MER-01.4` [MUST] Precise, never cold: pixel-aligned grids and tabular numbers, softened by warm neutrals, generous radii and plain-spoken words.
- `MER-01.5` [MUST] Use warm Graphite grays, not blue-steel.
- `MER-01.6` [MUST] Keyboard first, mouse friendly: make every action reachable from ⌘K and show shortcuts where actions live, so power is discoverable.
- `MER-01.7` [MUST] Design focus states; never leave them at the default.
- `MER-01.8` [MUST] Calm by default, honest under load: motion is quick and purposeful; errors say what happened, why, and what to do next — no blame, no mystery.
- `MER-01.9` [MUST NOT] Exceed 240ms for any duration; durations top out at 240ms.

| # | Principle | Summary | Note |
|---|---|---|---|
| 01 | Content is the interface. | Chrome recedes so data, logs and code can lead. Color is information, not decoration — if everything is highlighted, nothing is. | One accent per screen. Neutrals do the rest. |
| 02 | Precise, never cold. | Pixel-aligned grids and tabular numbers, softened by warm neutrals, generous radii and plain-spoken words. | Warm Graphite grays, not blue-steel. |
| 03 | Keyboard first, mouse friendly. | Every action is reachable from ⌘ K. Shortcuts are shown where actions live, so power is discoverable. | Focus states are designed, not default. |
| 04 | Calm by default, honest under load. | Motion is quick and purposeful. Errors say what happened, why, and what to do next — no blame, no mystery. | Durations top out at 240ms. |

## 02. Influences

**Four references. One point of view.**

We borrow deliberately — and leave behind what doesn't serve a technical audience. The result should feel familiar to anyone who loves well-made tools, without imitating any one of them.

Rules:

- `MER-02.1` [MUST NOT] Take from Apple: oversized marketing imagery, hidden affordances, gesture-only controls.
- `MER-02.2` [MUST NOT] Take from Laravel Cloud: brand red as UI accent, heavy 3D illustration.
- `MER-02.3` [MUST NOT] Take from Notion: emoji-as-icon, hand-drawn illustration in product UI.
- `MER-02.4` [MUST NOT] Take from Celerium: violet as the main accent, product-specific coined names.

| Reference | Borrow | Leave behind |
|---|---|---|
| Apple (clarity · deference · depth) | Typography as the main design tool; tight display tracking. Restraint: generous whitespace, one idea per section. Materials and motion that explain hierarchy. | Oversized marketing imagery, hidden affordances, gesture-only controls. |
| Laravel Cloud | Dark-first surfaces that make status color pop. Mono for anything machine: IDs, regions, commands. Hairline borders and dense, scannable layouts. | Brand red as UI accent, heavy 3D illustration. |
| Notion | Warm grays that read like quality paper. Soft tinted pills for properties and labels. Barely-there layered shadows instead of hard drops. | Emoji-as-icon, hand-drawn illustration in product UI. |
| Celerium | Outlined-hexagon status, never filled. Tinted mono kind tags for resource types. Plan-before-apply: staged changes, diff rows, one apply bar. | Violet as the main accent, product-specific coined names. |

## 03. Color: Graphite neutrals

**Graphite: a warm neutral for long sessions.**

Ninety percent of every screen is Graphite. Its faint yellow-brown undertone keeps dense UIs from feeling clinical — paper, not glass. Steps are tuned so adjacent surfaces stay distinguishable on uncalibrated monitors.

Rules:

- `MER-03.1` [MUST] Separate surfaces with a single 1px `border` step or one shade of fill — never both at full strength.
- `MER-03.2` [MUST] Use **text-2** for body copy in dense UI and **text** only for headings, values and primary labels.
- `MER-03.3` [MUST NOT] Use pure `#000` text or pure gray (`#808080`) — they clash with the warm ramp and look printed-on.

| Step | Hex | Role label |
|---|---|---|
| 0 | `FFFFFF` | surface |
| 25 | `FCFCFB` | canvas |
| 50 | `F7F7F5` | subtle |
| 100 | `F0EFEC` | muted |
| 200 | `E6E5E1` | border |
| 300 | `D3D2CD` | strong |
| 400 | `A6A59F` | text-4 |
| 500 | `72716C` | text-3 |
| 600 | `5B5A56` | text-2 |
| 700 | `403F3C` | |
| 800 | `2A2A28` | |
| 850 | `1F1F1E` | |
| 900 | `181817` | |
| 950 | `111110` | text |
| 1000 | `0A0A09` | dark bg |

## 04. Color: Accent & semantic

**One accent. Four signals.**

**Cobalt** marks what you can act on: primary calls to action, links, focus and selection. Semantic colors are reserved for state — they never decorate.

Rules:

- `MER-04.1` [MUST] Use Cobalt only for what you can act on: primary calls to action, links, focus and selection.
- `MER-04.2` [MUST NOT] Use semantic colors to decorate; they are reserved for state.
- `MER-04.3` [MUST] Use accent 500 in the light theme, 600 for hover, 400 in the dark theme, and tint 50 for selected rows.
- `MER-04.4` [MUST NOT] Use Special (violet) for status; it marks what's new or what you own.
- `MER-04.5` [MUST NOT] Communicate state with color alone; every semantic color ships with a label, an icon, or a shape (dot, ring) so it survives color-blindness and grayscale printing.

Cobalt ramp (500 is the base; 500 on white: 5.1:1 · AA):

| Step | 50 | 100 | 200 | 300 | 400 | 500 ★ | 600 | 700 | 800 | 900 |
|---|---|---|---|---|---|---|---|---|---|---|
| Hex | `EEF3FF` | `DCE6FF` | `B9CCFF` | `8EAEFF` | `5E88FB` | `2E63F0` | `2150D6` | `1B40AD` | `1A3684` | `172C63` |

Light theme accent **500** · hover **600** · dark theme accent **400** · tints **50** for selected rows.

| Signal | Hex | Means | Examples |
|---|---|---|---|
| Success | `1F9D5C` | Healthy · Passed · Live — deploy succeeded, checks green, service running. | Running, Passed |
| Warning | `C97C06` | Degraded · Pending — needs attention soon; nothing is broken yet. | Degraded, Queued |
| Critical | `DC3E42` | Failed · Down · Destructive — something broke, or an action can't be undone. | Failed, Offline |
| Special | `7C3AED` | New · Yours · Beta — marks what's new or what you own. Never for status. | New, Beta |

## 05. Color: Light & dark roles

**Light. Dark is first-class.**

Components reference roles, never raw ramp values. Themes swap the mapping; components never change.

Dark: Not an inversion. Surfaces get *lighter* as they rise, borders carry more weight than shadows, and the accent shifts one step brighter.

Rules:

- `MER-05.1` [MUST] Reference roles in components, never raw ramp values.
- `MER-05.2` [MUST NOT] Change components per theme; themes swap the role mapping only.
- `MER-05.3` [MUST NOT] Build dark as an inversion of light.
- `MER-05.4` [MUST] In dark, make surfaces lighter as they rise, let borders carry more weight than shadows, and shift the accent one step brighter.

| Role | Use | Light | Dark |
|---|---|---|---|
| `--bg` | Page canvas | g-25 | g-1000 |
| `--surface` | Cards, inputs, menus | g-0 | g-950 |
| `--subtle` | Sidebars, table heads | g-50 | g-900 |
| `--muted` | Hover, tracks, chips | g-100 | g-850 |
| `--border` | Dividers, outlines | g-200 | `262624` |
| `--text` | Headings, values | g-950 | `EDEDEA` |
| `--text-2` | Body, labels | g-600 | `A3A29C` |
| `--text-3` | Meta, placeholders | g-500 | `7E7D78` |
| `--accent` | Actions, focus, links | c-500 | c-400 |

## 06. Typography: Families

**Inter for people. Geist Mono for machines.**

Two working families and one rare guest. Inter's optical sizing gives us Apple-like display tracking and a compact UI cut from a single variable file. Anything a computer produced or will consume — IDs, hashes, regions, commands — is set in mono.

Rules:

- `MER-06.1` [MUST] Set anything a computer produced or will consume — IDs, hashes, regions, commands — in mono.
- `MER-06.2` [MUST] Use Inter weights 400 · 500 · 600 in UI; 700 only for marketing.
- `MER-06.3` [MUST] Use tabular numbers (`tnum`) in tables.
- `MER-06.4` [MUST] Size Geist Mono at ~92% of the adjacent sans.
- `MER-06.5` [MUST NOT] Use the Instrument serif in product UI.
- `MER-06.6` [MUST NOT] Use the serif accent more than once per view; it is one italic word in a marketing headline.

| Family | Role | Status | Weights | Notes |
|---|---|---|---|---|
| Inter | Sans · UI & display | Primary | 400 · 500 · 600 (700 for marketing) | Features: cv11, ss01, ss03, tnum in tables |
| Geist Mono | Mono · code & data | Secondary | 400 · 500 · 600 | Size: ~92% of adjacent sans |
| Instrument (Serif italic) | Serif · accent | Rare | — | One italic word in a marketing headline. Never in product UI, never more than once per view. Use: hero emphasis · pull quotes |

## 07. Typography: Scale

**A scale built for density.**

Product UI lives between 12 and 20px; marketing reaches up to 72. Tracking tightens as size grows — the single biggest reason text reads as "Apple-quality" rather than default.

Rules:

- `MER-07.1` [MUST] Keep product UI text between 12 and 20px; only marketing goes larger (up to 72).
- `MER-07.2` [MUST] Tighten tracking as size grows, per the scale.

| Token | Size / line | Weight | Tracking | Sample |
|---|---|---|---|---|
| `display-xl` | 64 / 64 | 600 | −4.5% | Ship it calmly. |
| `display` | 44 / 46 | 600 | −3.5% | Infrastructure, simplified |
| `title-1` | 28 / 32 | 600 | −2.5% | Production environment |
| `title-2` | 20 / 26 | 600 | −1.8% | Deployments |
| `title-3` | 16 / 22 | 600 | −1.2% | Environment variables |
| `body` | 14 / 21 | 400 | −0.6% | Builds run in isolated containers… |
| `body-sm` | 13 / 20 | 400 | −0.4% | Last deployed 4 minutes ago… |
| `caption` | 12 / 16 | 400 | 0% | Updated Oct 20, 2026 at 17:45 EDT |
| `label-mono` | 11 / 16 | 500 | +3% · CAPS | REGION · STATUS · LATENCY |
| `code` | 12.5 / 20 | 400 | 0% | `php artisan migrate --force` |

## 08. Spacing & layout

**A 4px grid, a 12-column page.**

Every margin, gap and size is a step on this scale. Components use the small end (4–16); layouts use the large end (24–96). If a value isn't here, the design isn't finished.

Rules:

- `MER-08.1` [MUST] Make every margin, gap and size a step on the spacing scale; if a value isn't on it, the design isn't finished.
- `MER-08.2` [SHOULD] Use the small end (4–16) inside components and the large end (24–96) for layouts.
- `MER-08.3` [SHOULD] Inside a component, make padding ≥ the gap between its children; between sections, double it.
- `MER-08.4` [MUST NOT] Collapse tables to cards at small widths; they scroll horizontally.

| Token | px |
|---|---|
| `space-1` | 4 |
| `space-2` | 8 |
| `space-3` | 12 |
| `space-4` | 16 |
| `space-5` | 20 |
| `space-6` | 24 |
| `space-8` | 32 |
| `space-10` | 40 |
| `space-12` | 48 |
| `space-16` | 64 |
| `space-24` | 96 |
| `space-32` | 128 |

App layout (1440 viewport): header 52 (breadcrumbs + switcher · search); route tabs 40; page header centered 1200; 12 columns. Content max-width **1200** · gutters **24** · page padding **32** (desktop) / **16** (mobile).

| Breakpoint | Min | Behavior |
|---|---|---|
| `sm` | 640 | Single column; tables scroll horizontally, never collapse to cards |
| `md` | 768 | Tabs scroll sideways; breadcrumbs collapse to the last crumb |
| `lg` | 1024 | Full header, all tabs visible; 2-up card grids |
| `xl` | 1280 | Inspector panels; 3–4 up grids; reading width capped at 720 |

## 09. Shape & elevation

**Soft corners, barely-there depth.**

Radius scales with the size of the thing: small controls are crisp, large containers are soft. Shadows are layered and low-contrast, always paired with a hairline ring so edges stay sharp on any background.

Rules:

- `MER-09.1` [MUST] Scale radius with the size of the thing: small controls crisp, large containers soft.
- `MER-09.2` [MUST] Keep shadows layered and low-contrast, always paired with a hairline ring.
- `MER-09.3` [MUST] Pair the e4 modal elevation with a scrim.

| Radius | px | Use |
|---|---|---|
| `xs` | 4 | kbd, tags |
| `sm` | 6 | badges |
| `md` | 8 | buttons, inputs |
| `lg` | 12 | cards, menus |
| `xl` | 16 | dialogs, panels |
| `2xl` | 24 | marketing tiles |
| `full` | — | avatars, switches |

| Elevation | Name | Use |
|---|---|---|
| e0 | flat | Hairline only. Tables, sections. |
| e1 | raised | Buttons, inputs. |
| e2 | card | Cards, tiles. |
| e3 | overlay | Menus, popovers. |
| e4 | modal | Dialogs, ⌘K. With scrim. |

## 10. Motion

**Fast, physical, and then gone.**

Motion explains where something came from and where it went. It is never a reward for waiting. Engineers repeat actions hundreds of times a day — nothing should slow the hundredth click.

Rules:

- `MER-10.1` [MUST NOT] Use motion as a reward for waiting; nothing should slow the hundredth click.
- `MER-10.2` [MUST] Exit faster than you enter (~70% of the enter duration).
- `MER-10.3` [MUST] Scale from 0.96, never from 0.
- `MER-10.4` [MUST] Honor `prefers-reduced-motion`: swap movement for a 120ms opacity fade.
- `MER-10.5` [MUST NOT] Animate layout on data refresh, bounce buttons, or use skeletons for loads under 300ms.

| Curve | Value | Use |
|---|---|---|
| `ease-out` | `.16, 1, .3, 1` | Default. Things entering: menus, toasts, panels. |
| `ease-in-out` | `.65, 0, .35, 1` | Things moving on-screen: tab indicators, reorders. |
| `spring` | stiff 400 · damp 32 | Direct manipulation: drag, switch thumb, sheet release. |

| Duration | ms | Use |
|---|---|---|
| `instant` | 0 | Hover color, focus ring |
| `fast` | 120 | |
| `base` | 180 | |
| `slow` | 240 | |

## 11. Iconography

**Outline icons on a 24px grid.**

Icons come from `lucide-react` at a 1.5px stroke with round caps — the kit already depends on it. Icons label actions; they never replace a label the first time a user meets an action.

Rules:

- `MER-11.1` [MUST] Take icons from `lucide-react` at a 1.5px stroke with round caps and joins.
- `MER-11.2` [MUST NOT] Replace a label with an icon the first time a user meets an action.
- `MER-11.3` [MUST] Match icon color to adjacent text: **text-2** in nav, **text** when active.
- `MER-11.4` [MUST] Give icon-only buttons a tooltip with the label and its shortcut.
- `MER-11.5` [MUST NOT] Mix filled and outline styles, or color icons with the accent for decoration.

| Spec | Value |
|---|---|
| Grid | 24 × 24, 2px live-area padding |
| Stroke | 1.5px · round caps & joins |
| Sizes | 14 · 16 · 20 · 24 |

Sample set: home, search, server, database, globe, box, layers, git-branch, terminal, activity, shield, key, lock, users, bell, settings, cpu, zap, rocket, clock, info, alert-triangle, check-circle, x, plus, copy, external-link, chart, book, command.

## 12. Brand

**A line, and the point that matters.**

The mark is an ink tile holding a meridian arc and one Cobalt marker — the same idea as the whole system: calm structure, one highlighted signal. It needs no letterform, so it survives a rename.

Rules:

- `MER-12.1` [MUST] Keep clear space of half the mark's height on every side.
- `MER-12.2` [MUST NOT] Show the mark below 16px on screen; below that use the favicon file, which has thicker strokes.
- `MER-12.3` [MUST] Keep the point Cobalt 400; the tile is ink (inverts in dark) and the arc is the tile's foreground.
- `MER-12.4` [MUST NOT] Recolour the point, rotate the arc, add effects, or place the mark on a busy image.
- `MER-12.5` [MUST] Check trademark and domains before committing to a name.

| Spec | Value |
|---|---|
| Clear space | Half the mark's height on every side (dashed). |
| Minimum | 16px on screen; below that use the favicon file, which has thicker strokes. |
| Colour | Tile is ink (inverts in dark), the arc is the tile's foreground, the point is always Cobalt 400. |
| Wordmark | Inter 600, −3% tracking, 0.68× the mark's height, 0.4em gap. |
| Files | `brand/mark.svg`, `mark-on-dark.svg`, `favicon.svg` (follows OS theme), `og-card.svg`; `<Logo />` in the kit. |

Name — "Meridian" is a working title. Candidates:

| Candidate | Rationale |
|---|---|
| Datum | The reference point everything is measured from. |
| Plumb | True vertical; "plumb" means exactly right. |
| Strata | Layers — tokens, components, patterns. |
| Bezel | The frame around the content. |
| Meridian | Keep it; crowded trademark space. |

Check trademark and domains before committing. The mark works with any of them.

## 13. Buttons

**Ink acts. Cobalt converts.**

In product UI the primary button is ink — it reads as confident without shouting. Cobalt is reserved for the one conversion moment on a page (sign up, deploy, upgrade). One primary per view.

Rules:

- `MER-13.1` [MUST] Make the product UI primary button ink.
- `MER-13.2` [MUST] Reserve the Cobalt accent button for the one conversion moment on a page (sign up, deploy, upgrade).
- `MER-13.3` [MUST] Use one primary per view.
- `MER-13.4` [MUST] Label with a verb + object: "Deploy branch", not "OK".
- `MER-13.5` [MUST] Put the primary action on the right of a group.
- `MER-13.6` [MUST] Keep danger outlined; the confirm inside the dialog is the only solid red.
- `MER-13.7` [MUST NOT] Place two accent buttons side by side, or use danger for anything reversible.
- `MER-13.8` [MUST NOT] Disable a button without saying why — show a tooltip or inline reason.

| Variant | Use | Notes |
|---|---|---|
| Primary | Main action | Ink fill. With icon / key: e.g. Deploy ⌘↵ |
| Accent | Conversion | Cobalt fill. e.g. Start building → |
| Secondary | Everything else | Outlined surface. e.g. Cancel, Copy URL |
| Ghost | Toolbars, rows | No chrome at rest; icon-only allowed (refresh, filter, more) |
| Danger | Destructive | Outlined · solid only to confirm (e.g. "Delete api-gateway") |

States shown: default, hover, focus (Cobalt ring), disabled (faded), with icon / key.

| Size | Height |
|---|---|
| Small | 28 |
| Medium | 32 |
| Large | 40 |

## 14. Inputs & forms

**Forms that respect a fast typist.**

Labels sit above fields, always visible. Validate on blur, not on keystroke. Machine values — URLs, keys, CIDRs — get mono inside the field so characters like `0`/`O` and `l`/`1` are unmistakable.

Rules:

- `MER-14.1` [MUST] Put labels above fields, always visible.
- `MER-14.2` [MUST] Validate on blur, not on keystroke.
- `MER-14.3` [MUST] Set machine values — URLs, keys, CIDRs — in mono inside the field.

States: rest, focus (Cobalt ring), error (red border, message with warning icon below, e.g. "Add a top-level domain, like app.example.com"), disabled (filled, read-only).

Example form "Create environment" (Step 2 of 3): Name with helper text ("Lowercase letters, numbers and dashes."), Region select (mono, globe icon) and Instance size select side by side, Custom domain, Database URL marked "· optional" (disabled: "Managed by Meridian"); footer actions Back (secondary) then Create environment (primary) on the right.

Affixes & search: search field with ⌘ K keys ("Search or jump to…"); prefix/suffix field (`https://` my-app `.meridian.app`); masked secret with copy button (`sk_live_••••••••••••3f9a`).

## 15. Selection controls

**Switches act now. Checkboxes wait for save.**

A switch applies immediately and needs no submit button. Checkboxes and radios collect choices for a form. Segmented controls switch views, never settings.

Rules:

- `MER-15.1` [MUST] Use a switch only for settings that apply immediately, with no submit button.
- `MER-15.2` [MUST] Use checkboxes and radios to collect choices for a form that is saved.
- `MER-15.3` [MUST NOT] Use segmented controls for settings; they switch views.
- `MER-15.4` [MUST] Use tabs to navigate between pages of one object, and segmented controls to change a view's lens.
- `MER-15.5` [SHOULD] Use radio cards for choices that need explanation.

| Control | Behavior | Example |
|---|---|---|
| Switch | Applies immediately | Auto-deploy from main — "Every push builds and ships."; Maintenance mode — "Serves a 503 page." |
| Checkbox | Waits for save; parent shows indeterminate with count | "Notify me about — 2 of 3 selected" |
| Segmented | Changes a view's lens | Overview / Logs / Metrics; 1h / 24h / 7d / 30d |
| Tabs | Navigate pages of one object (underline) | General / Domains / Variables / Danger zone |
| Radio cards | Choices that need explanation | Hobby $0 · Pro $20/mo · Scale $120/mo with specs line |

## 16. Badges, status & keys

**Small things, read thousands of times.**

Badges are soft tints with 6px corners — Notion's property pills, tuned for density. Status always pairs a shape with a word. Keyboard keys appear wherever the shortcut exists.

Rules:

- `MER-16.1` [MUST] Render badges as soft tints with 6px corners.
- `MER-16.2` [MUST] Always pair status shape with a word.
- `MER-16.3` [MUST] Show keyboard keys wherever the shortcut exists.
- `MER-16.4` [MUST] Draw status as an outlined hexagon, never filled.
- `MER-16.5` [MUST] Write badge labels in sentence case, one or two words.
- `MER-16.6` [MUST] Use OS-native glyphs (⌘ ⇧ ⌥) on macOS and words (Ctrl, Shift) elsewhere.
- `MER-16.7` [MUST NOT] Fill the hexagon, or use status colors anywhere except hexagons, badges and banners.

Badge variants: Default, Outline, Preview, Passed, Queued, Failed, Beta. With meaning (outlined, often mono): branch `main`, region `us-east-1`, `PHP 8.4`, hash `4be1c0a`. Kind tags (tinted mono): Service · web, Worker, Cron, Postgres, Redis, Volume.

| Status (outlined hexagon) | Example meta |
|---|---|
| Operational (green) | 99.99% |
| Building (blue) | 00:42 |
| Degraded (amber) | p95 812ms |
| Failed (red) | exit 137 |
| Stopped (gray) | — |

| Keyboard | Keys |
|---|---|
| Command menu | ⌘ K |
| New project | C |
| Go to deployments | G then D |
| Search logs | / |
| Close | Esc |

Banners — page-level messages: info (blue, "PHP 8.5 is available. Upgrade from settings at your next deploy."), warning (amber, "Certificate expires in 6 days. …"), critical (red, "Build failed at step 3 of 5. composer install exited with code 1. View logs →"). Bold lead sentence, then detail, optional link.

## 17. Cards & metrics

**Numbers first, chrome last.**

Cards group one object or one number. The value is the largest thing in the card; the label explains it in the smallest. Deltas are colored by *meaning* — a drop in error rate is green.

Rules:

- `MER-17.1` [MUST] Group one object or one number per card.
- `MER-17.2` [MUST] Make the value the largest thing in the card and the label the smallest.
- `MER-17.3` [MUST] Color deltas by meaning, not direction — a drop in error rate is green.
- `MER-17.4` [MUST] Draw meters in ink, turning amber past 80%.
- `MER-17.5` [MUST] Make the whole card the click target; keep secondary actions in a ⋯ menu.
- `MER-17.6` [MUST] Use tabular numerals so values don't jitter when they update.
- `MER-17.7` [MUST NOT] Nest cards in cards; use a divider or a subtle fill instead.

Metric card anatomy: label + period (e.g. "Requests · 24h"), large value with smaller unit (1.28M, 184ms, 0.42%, $504.20), delta line with arrow and context ("↑ 12.4% vs yesterday", "↓ 22ms faster" green, "↑ 0.18 pts since deploy" red), sparkline; budget card with meter ("84% of $600 budget").

Resource card: avatar tile, name + mono host, status hexagon + word (Live / Building / Failed), divider, branch · short hash and relative time.

Empty state card: icon, title ("No databases yet"), one-line explanation, action ("+ Add database"). Settings card: title, description, mono input, footer with help link and Save.

## 18. Tables

**Tables are the product. Treat them that way.**

44px rows, mono uppercase headers, hairline dividers, right-aligned numbers. On small screens tables scroll horizontally with a pinned first column — they never collapse into cards.

Rules:

- `MER-18.1` [MUST] Use 44px rows, mono uppercase headers, hairline dividers and right-aligned numbers.
- `MER-18.2` [MUST] On small screens scroll tables horizontally with a pinned first column.
- `MER-18.3` [MUST NOT] Collapse tables into cards.
- `MER-18.4` [MUST] Left-align text, right-align numbers and dates.
- `MER-18.5` [MUST] Show bulk actions in the toolbar only after selection.
- `MER-18.6` [MUST] Use relative time; reveal the exact timestamp on hover.
- `MER-18.7` [MUST NOT] Zebra-stripe; hairlines are enough at 44px.

Anatomy: toolbar (filter input, Status and Branch filter buttons; on selection "1 selected", Redeploy, ⋯), checkbox column, columns DEPLOYMENT (mono ID · environment), STATUS (hexagon + word), BRANCH (mono), AUTHOR, DURATION (right-aligned), CREATED (relative, right-aligned); selected row tinted (accent 50); footer "Showing 1–5 of 248" with Previous / Next.

## 19. Navigation

**Two levels. Never three.**

The header answers *where am I* (breadcrumbs with a project switcher) and *what can I look at* (route tabs). Settings pages add one left sub-nav. Anything deeper goes through ⌘ K.

Rules:

- `MER-19.1` [MUST] Answer *where am I* with breadcrumbs plus a project switcher, and *what can I look at* with route tabs.
- `MER-19.2` [MUST] Add a left sub-nav only on settings pages; send anything deeper through ⌘K.
- `MER-19.3` [MUST] Make tabs real routes (links with `aria-current`), not client-side tabs.
- `MER-19.4` [MUST] Make the middle crumb the project switcher; add search after 6 projects.
- `MER-19.5` [MUST NOT] Add a third level, or put a sidebar on anything but settings.

Header anatomy: mark · workspace (Acme) / project switcher (api-gateway ▾) / environment (production) + status ("Live"); right side: "Search or run a command ⌘K" and avatar. Route tabs: Overview, Deployments, Logs, Metrics, Databases, Domains, Activity, Settings (active tab underlined). Page header: title, mono meta line ("us-east-1 · deployed 4m ago from `main`"), actions Visit (secondary) and Deploy ⌘↵ (primary) on the right; activity rows below.

Settings sub-nav: General, Members, Alerts (active, muted fill), Budgets and quotas. Stepper · wizards: completed steps get a check, the current step is numbered and bold, later steps numbered and muted (Connect repository ✓, Choose region ✓, 3 Environment variables, 4 Dry run).

## 20. Overlays

**Layers that know their place.**

Command menu and dialogs take focus and dim the page. Menus and tooltips float without a scrim. Toasts confirm and offer undo — they never carry information you can't find elsewhere.

Rules:

- `MER-20.1` [MUST] Let the command menu and dialogs take focus and dim the page.
- `MER-20.2` [MUST NOT] Put a scrim behind menus and tooltips; they float.
- `MER-20.3` [MUST NOT] Put information in a toast that can't be found elsewhere; toasts confirm and offer undo.
- `MER-20.4` [MUST] Rank ⌘K results by recency and current context, not alphabetically.
- `MER-20.5` [MUST] Return focus to the trigger when any overlay closes.
- `MER-20.6` [MUST] Confirm destructive dialogs by typing the resource name.
- `MER-20.7` [MUST NOT] Auto-dismiss toasts that contain an error or an undo.

Command menu: query input with scope chip (api-gateway); grouped results (ACTIONS: "Deploy **main** to production ⌘↵", "Redeploy last successful build"; NAVIGATE: Deployments G D, Dependencies · settings); footer hints ↑↓ navigate · ↵ select · esc close.

Context menu: items with icons and shortcuts (Copy deployment ID ⌘C, Open preview URL, View build logs L), divider, Redeploy, destructive "Delete…" in red last. Tooltip: dark, label + key ("Refresh metrics R"). Toast: dark, success icon, title ("Deployment started"), detail with mono hash, action link "View".

## 21. Code & terminal

**Code is always dark, always copyable.**

Code blocks sit on Graphite 950 in both themes — they're a window into another tool. Every block names its file or language and offers copy. Commands start with a dimmed prompt that copy excludes.

Rules:

- `MER-21.1` [MUST] Set code blocks on Graphite 950 in both themes.
- `MER-21.2` [MUST] Name the file or language on every code block and offer copy.
- `MER-21.3` [MUST] Start commands with a dimmed prompt that copy excludes.
- `MER-21.4` [MUST] Give inline code a muted fill and a hairline border.

Syntax palette: Keyword (pink), Function (blue), Type (violet), String (green), Number (orange), Comment (gray).

```php
// app/Http/Middleware/EnsureTeam.php
final class EnsureTeam
{
    public function handle(Request $request, Closure $next): Response
    {
        // Resolve the team from the route, never the session.
        $team = $request->route('team');

        abort_unless($request->user()->belongsTo($team), 403);

        return $next($request);
    }
}
```

```text
$ meridian deploy --env=production
→ Uploading 2.4 MB … done
→ Building image … ✓ 38s
→ Running migrations … ✓ 3 applied
✓ Live at https://api.example.com
```

Runtime logs panel (header "Runtime logs", chip "web · 3 instances", "● Live"): timestamp, level (INFO blue, WARN amber, ERROR red), instance, message.

```text
17:45:02.114  INFO   web-1  GET /api/v1/projects 200 · 38ms
17:45:02.390  WARN   web-3  Slow query on deployments.created_at · 812ms
17:45:03.007  ERROR  web-2  POST /webhooks/github 500 · SignatureMismatchException
```

## 22. Application shell

**Dark mode, done properly.**

Surfaces step up in lightness, borders replace shadows, and the accent is used exactly once in the chart. Status colors carry the screen — everything else is Graphite.

Rules:

- `MER-22.1` [MUST] In dark mode, step surfaces up in lightness and replace shadows with borders.
- `MER-22.2` [MUST] Use the accent exactly once in a chart (e.g. the highlighted bar).
- `MER-22.3` [MUST] Let status colors carry the screen; everything else is Graphite.

Shell example (dark): header with breadcrumbs and search, route tabs, Overview page header with Visit and Deploy, three metric cards (Requests · 24h 1.28M ↑12.4%; p95 latency 184ms ↓22ms; Error rate 0.42% ↑0.18 pts), "Requests per hour" bar chart with 1h / 24h / 7d segmented control (one Cobalt bar), side panel with Regions meters (us-east-1 62%, eu-west-2 24%, ap-south-1 14%) and Recent deploys (Live / Failed / Old with mono hashes and relative times).

## 23. Staged changes

**Plan first. Apply once.**

Infrastructure edits never apply on blur. They stage into a plan, show as a diff, and ship together from one bar at the bottom of the page — the same flow as `meridian plan`. Personal settings still save instantly.

Rules:

- `MER-23.1` [MUST NOT] Apply infrastructure edits on blur.
- `MER-23.2` [MUST] Stage infrastructure edits into a plan, show them as a diff, and ship them together from one bar at the bottom of the page.
- `MER-23.3` [MUST] Save personal settings instantly.

Staged field rows carry a left rule and a tag: CHANGED (amber) or NEW (violet); unchanged or locked fields (Region "Set at creation") have neither and may be disabled.

Review changes panel ("Rolling restart · no downtime"): `~` changed rows show old (struck, red tint) → new (green tint); `+` added rows show the new value; footer shows cost delta ("Est. +$18/mo") and plan ID (`pl_4kq9`).

| Op | Key | Change |
|---|---|---|
| `~` | size | small → medium |
| `~` | instances | 2 → 3 |
| `+` | QUEUE_CONNECTION | redis |
| `~` | autoscaling | off → on · max 6 |

Same plan, from the CLI:

```text
$ meridian plan
~ size         small → medium
~ instances    2 → 3
+ env.QUEUE_CONNECTION = "redis"
4 changes · run meridian apply to ship
```

Apply bar (floating, dark, bottom center): "+1 ~3 staged" · Discard · "Review and apply ⌘S".

## 24. Page states

**Every state is a designed state.**

A screen isn't finished until it has been drawn loading, empty, failing, forbidden and stale. Each state keeps the page's layout, says what happened in plain words, and offers exactly one way forward.

Rules:

- `MER-24.1` [MUST] Draw every screen loading, empty, failing, forbidden and stale before calling it finished.
- `MER-24.2` [MUST] Keep the page's layout in each state, say what happened in plain words, and offer exactly one way forward.
- `MER-24.3` [MUST] Show loading skeletons only after 300ms, matching the real rows exactly so nothing jumps when data lands.

| State | Intent | Example |
|---|---|---|
| Loading | after 300ms | Skeletons match the real rows exactly, so nothing jumps when data lands. |
| Empty · first use | teach | "No deployments yet" — Push to `main` or deploy from here. Builds take about a minute. Deploy now + copyable `meridian deploy`. |
| Empty · no results | recover | "Nothing matches these filters" — shows filter chips (`status:failed`, `branch:main`); "248 deployments exist; none are failed builds from main." Clear filters. |
| Error · in panel | retry | "Couldn't load metrics" — The metrics service timed out after 10s. The rest of this page is current. Retry + copyable request ID. |
| Forbidden | who can help | "Billing needs the Owner role" — You're a Member. Ask Priya or Sam, who are Owners of Acme. Request access · Learn about roles. |
| Stale · reconnecting | keep working | Banner "Live updates paused. Showing data from 2m ago. Reconnecting…" above the still-visible data. |

## 25. System pages

**When the page itself can't be shown.**

Full-page states keep the logo and nothing else — no navigation that might also be broken. Every one includes an identifier support can trace, and a route back to working ground.

Rules:

- `MER-25.1` [MUST] Keep the logo and nothing else on full-page states — no navigation that might also be broken.
- `MER-25.2` [MUST] Include an identifier support can trace on every system page.
- `MER-25.3` [MUST] Include a route back to working ground on every system page.

| Page | Eyebrow | Title | Body | Actions |
|---|---|---|---|---|
| 404 | 404 · Not found | No project called "api-gatewy" | Did you mean `api-gateway`? It might also live in another workspace. | Go to api-gateway · Switch workspace |
| 500 | 500 · Server error | Something failed on our side | Nothing you did caused this, and your services are unaffected. We've been alerted; quoting the ID below speeds things up. | Try again · Status page ↗ · copyable `req_…` ID |
| Session expired | Session expired | Sign in again to continue | You were signed out after 12 hours. Your unsaved changes to **Runtime settings** are kept and will be waiting. | Sign in as carson@acme.dev · Use another account |
| Maintenance (dark) | Scheduled maintenance | The dashboard is down for an upgrade | Your apps, databases and the API keep running. Deploys from git queue up and run when we're back. | Countdown (00:18:42 remaining · started 17:30 EDT) |

## 26. Phones

**Same system at 390px.**

Nothing is redesigned for phones — it reflows. The breadcrumb shrinks to the switcher, tabs scroll, tables scroll with a pinned first column, and the staged bar becomes a full-width footer.

Rules:

- `MER-26.1` [MUST NOT] Redesign for phones; reflow the same system.
- `MER-26.2` [MUST] On phones shrink the breadcrumb to the switcher, scroll tabs, scroll tables with a pinned first column, and make the staged bar a full-width footer.
- `MER-26.3` [MUST] Grow touch targets to 44px; type to 15px.
- `MER-26.4` [MUST] Pin the identifying column; let the rest scroll.
- `MER-26.5` [MUST] Fade the tab row's edge to show it scrolls.
- `MER-26.6` [MUST] Put the primary action in thumb reach.
- `MER-26.7` [MUST NOT] Turn tables into cards or hide columns silently.

Examples at 390px: Overview (2-up metric cards, recent deploys, full-width Deploy button at the bottom); Deployments (filter chips, table with pinned DEPLOYMENT column, hint "← Scroll for author and created →"); Settings (CHANGED / NEW tags, staged footer "+1 ~2 staged · Discard · Review").

## 27. Marketing pages

**Show the product. Then get out of the way.**

(No intro paragraph; the page's guidance is in its notes.)

Rules:

- `MER-27.1` [MUST] Set the hero in display-xl, centered, max two lines.
- `MER-27.2` [MUST] Allow one serif italic word in the hero and nowhere else.
- `MER-27.3` [MUST] Use the accent for the conversion CTA, plus a copyable install command as the secondary.
- `MER-27.4` [MUST] Prove with real product UI or terminal output, not abstract 3D.
- `MER-27.5` [MUST NOT] Decorate with anything but a single accent-tinted glow.
- `MER-27.6` [MUST] Space sections at 128px and alternate one dark band per page to reset the eye.
- `MER-27.7` [MUST NOT] Use stock photos, gradient text, or "revolutionary".

| Part | Guidance |
|---|---|
| Hero | Display-xl, centered, max two lines. One serif italic word is allowed here and nowhere else. |
| CTAs | Accent for the conversion, plus a copyable install command as the secondary — engineers trust a CLI more than a sales call. |
| Proof | Real product UI or terminal output, not abstract 3D. A single accent-tinted glow is the only decoration. |
| Rhythm | Sections at 128px spacing; alternate one dark band per page, Laravel-Cloud style, to reset the eye. |

Example: nav (Product, Pricing, Docs, Changelog · Sign in · Start free), "New" pill announcement, hero "Deploy on Friday. *Sleep* on Friday.", subhead, CTAs "Start building →" (accent) and copyable `npx meridian init`, terminal proof below with an accent glow.

## 28. Documentation

**Docs read like a good book.**

(No intro paragraph; the page shows the layout.)

Layout: left nav with search ("Search docs /") and grouped sections (Getting started: Introduction, Quickstart, CLI; Deployments: Zero-downtime deploys (active), Build cache, Rollbacks, Preview environments; Data: Databases, Queues); article with Cobalt eyebrow (section), title, lead paragraph, info callout with left accent rule and inline code, H2 headings, named code blocks with Copy; right rail "On this page" (How it works, Release command, Health checks, Draining, Troubleshooting) and feedback.

```toml
# meridian.toml
[deploy]
release = "php artisan migrate --force"
health_check_path = "/up"
drain_seconds = 30
```

## 29. Data visualization

**Charts that answer one question.**

Most series are Graphite; the one that matters is Cobalt. Gridlines are hairlines, axes are mono, and the current value is labeled directly instead of in a legend.

Rules:

- `MER-29.1` [MUST] Draw most series in Graphite and the one that matters in Cobalt.
- `MER-29.2` [MUST] Draw gridlines as hairlines and set axes in mono.
- `MER-29.3` [SHOULD] Label the current value directly instead of in a legend.
- `MER-29.4` [MUST NOT] Use more than 6 categorical series; beyond that, group into "Other".
- `MER-29.5` [MUST] Use semantic colors only for uptime bars — one bar per day.

| Palette | Use | Values |
|---|---|---|
| Categorical | Up to 6 series. Beyond that, group into "Other". | 1 cobalt, 2 teal, 3 orange, 4 violet, 5 pink, 6 graphite |
| Sequential | Heatmaps, usage intensity, density. | Cobalt ramp, light to dark (7 steps) |
| Status | Uptime bars use semantic colors only — one bar per day. | success / warning / critical |

Example: "p95 latency · this week vs last" — value 184ms with green ↓11% delta, this week as solid Cobalt area line, last week as dashed Graphite line, mono day axis, crosshair with dark value tooltip.

## 30. Charts

**Charts that answer one question.**

Dependency-free SVG, sized to their container, keyboard and screen-reader readable (a hidden data table backs every chart). These are the real components, rendered.

Rules:

- `MER-30.1` [MUST] Back every chart with a hidden data table so it is keyboard and screen-reader readable.
- `MER-30.2` [MUST] Draw a compare series (last period) as a dashed Graphite line.
- `MER-30.3` [MUST] Keep 2xx neutral in stacked status areas so the 5xx spike reads.
- `MER-30.4` [MUST] Mark the bar that matters with one Cobalt bar.
- `MER-30.5` [MUST NOT] Colour more than one series Cobalt, or use status colours for anything but state.

| Component / prop | Behaviour |
|---|---|
| `LineChart` | Multiple series, nice ticks, crosshair tooltip, labels at the line end instead of a legend. |
| `compare` | Last period as a dashed Graphite line. |
| `threshold` | An SLO or budget line with its own label. |
| `AreaChart` | Filled or `stacked`; 2xx stays neutral so the 5xx spike reads. |
| `BarChart` | Single, grouped or stacked; one Cobalt bar marks the day that matters. |
| `ChartCard` | Title, value, delta and a range control around any chart. |

All charts are dependency-free SVG, sized to their container.

## 31. Data table

**Two thousand rows, no jank.**

Virtualised rendering keeps only visible rows in the DOM, so scrolling a fleet of thousands stays smooth while the sticky header, pinned columns and selection keep working.

Rules:

- `MER-31.1` [MUST] Virtualise large tables so only visible rows are in the DOM, keeping the sticky header, pinned columns and selection working.
- `MER-31.2` [MUST] Pin the identifier column.
- `MER-31.3` [MUST] When rows are selected, set the header checkbox to mixed and replace the toolbar with a bulk bar.
- `MER-31.4` [MUST] Sort with `aria-sort`.
- `MER-31.5` [MUST] Show skeletons while rows are loading.

| Part | Behaviour |
|---|---|
| `FilterBar` | Search, removable chips, "Add filter" by field, saved views. |
| Columns | Show/hide from a menu; drag or arrow-key resize; pin the identifier. |
| Selection | Header checkbox goes mixed; a bulk bar replaces the toolbar. |
| Rows | Sort with `aria-sort`, expand for detail, skeletons while loading. |

## 32. Time & terminal

**Say when. Then show the shell.**

Times are relative by default, exact on hover, and switch to UTC for the whole app from one toggle. The terminal is xterm.js in Meridian's always-dark palette.

Rules:

- `MER-32.1` [MUST] Show times relative by default and exact on hover.
- `MER-32.2` [MUST] Switch every timestamp between Local and UTC from one app-wide toggle.
- `MER-32.3` [MUST] Render relative times as a real `<time dateTime>` element.
- `MER-32.4` [MUST] Render the terminal with xterm.js in Meridian's always-dark palette.

| Component | Behaviour |
|---|---|
| `RelativeTime` | "4m ago", refreshes every 30s, renders a real `<time dateTime>`. |
| `TimeZoneToggle` | Local / UTC for every timestamp under the provider. |
| `Calendar` & `DatePicker` | Single or range, presets, min/max, full arrow-key grid. |
| `TimeInput` | 24h, validated, ↑/↓ steps the focused segment. |
| `Terminal` | SSR-safe, fits on resize, status in the bar; wire `onData` to your WebSocket. |

Examples: Recent activity list with Local / UTC segmented toggle ("Exact (follows the toggle) Oct 20, 2026, 17:41:00 EDT"); pickers (run date, report range `2026-10-14 → 2026-10-20`, maintenance window 24h local time, cron time with ↑↓ step); calendar range; interactive shell with "Connected" status; read-only build log with "Reconnecting" status.

## 33. Trees & layout

**Structure you can drive by keyboard.**

Shown in dark. Every piece here follows the ARIA pattern for its role and was exercised with the keyboard.

Rules:

- `MER-33.1` [MUST] Follow the ARIA pattern for each component's role and exercise it with the keyboard.
- `MER-33.2` [MUST NOT] Make a HoverCard the only path to information.

| Component | Behaviour |
|---|---|
| `TreeView` | Files or policies; type-ahead, lazy children, tri-state checkboxes that roll up. |
| `MultiSelect` | Async search, chips, Backspace removes the last. |
| `ContextMenu` | Right-click or Shift+F10, positioned at the pointer. |
| `HoverCard` | Rich preview after 400ms; never the only path to information. |
| `SplitPane` | Draggable or arrow-key separator; double-click resets. |
| `UnsavedChangesBar`, `ShortcutsDialog` (press `?`), `OnboardingChecklist` | — |

Examples: repository file tree with sizes and "Selected: app/Jobs/SyncDeployments.php"; role policy tree with tri-state checkboxes and `sensitive` / `critical` tags ("4 permissions granted"); "Run command on hosts" MultiSelect with host chips; context menu & hover card on deployment rows.

## 34. Marketing blocks

**A landing page in eleven parts.**

Import from `@meridian/ui/marketing`. One Cobalt CTA per page (the hero); everything else is ink or neutral.

Rules:

- `MER-34.1` [MUST] Use one Cobalt CTA per page (the hero); make everything else ink or neutral.
- `MER-34.2` [MUST] Fold MarketingNav links into a sheet on phones.
- `MER-34.3` [MUST] Give the Hero a pill, one serif word, a Cobalt CTA, a copyable command and a product shot with a single glow.
- `MER-34.4` [MUST] Ring exactly one PricingTable tier and align rows across tiers.

| Block | Behaviour |
|---|---|
| `MarketingNav` | Links fold into a sheet on phones. |
| `Hero` | Pill, one serif word, Cobalt CTA, copyable command, product shot with a single glow. |
| `LogoCloud`, `FeatureGrid`, `FeatureSplit`, `DarkBand`, `CtaBand` | — |
| `PricingTable` | Monthly/annual, one ringed tier, rows aligned across tiers. |
| `Faq`, `ChangelogEntry`, `Footer` | Footer with a live status hexagon. |

## 35. Auth & onboarding

**The first two minutes.**

Import from `@meridian/ui/auth`. Errors sit on the field they belong to; one form-level banner when the cause isn't a field.

Rules:

- `MER-35.1` [MUST] Put auth errors on the field they belong to.
- `MER-35.2` [MUST] Use one form-level banner only when the cause isn't a field.
- `MER-35.3` [MUST] Let OtpInput accept a pasted whole code, auto-advance, and set `autocomplete="one-time-code"`.

| Component | Behaviour |
|---|---|
| `AuthLayout` | Centred card, or split with a dark quote/terminal panel. |
| `SignInForm` / `SignUpForm` | Providers, password or emailed link, per-field errors. |
| `OtpInput` | Paste a whole code, auto-advance, `autocomplete="one-time-code"`. |
| `TwoFactorForm`, `RecoveryCodes` | Recovery codes: copy all, download .txt. |
| `InviteAccept` and `FirstRun` | Three ways to start, CLI included. |

Example "Sign in · centered": mark, "Sign in to Meridian", Continue with GitHub / Continue with SSO, "or" divider, Email, Password with "Forgot password?" and inline error ("That password doesn't match. Try again or reset it."), ink Sign in button, "Use a sign-in link instead", "No account? Create one", Terms · Privacy · Status.

## 36. Email

**Mail that reads like the product.**

react-email templates with inline styles (mail clients ignore classes), table-based layout, and a plain-text version where every link also appears as text.

Rules:

- `MER-36.1` [MUST] Build email with inline styles (mail clients ignore classes) and table-based layout.
- `MER-36.2` [MUST] Ship a plain-text version where every link also appears as text.
- `MER-36.3` [MUST] Include the logo as a hosted PNG, a "Why am I getting this?" line, an unsubscribe link and a postal address.
- `MER-36.4` [MUST NOT] Send an alert whose only content is a button; say what happened in the subject and first line.

| Spec | Value |
|---|---|
| Templates | Invite, MagicLink (with code), DeployFailed, UsageAlert, Invoice, WeeklyDigest. |
| Layout | Logo (hosted PNG via `logoUrl`), card, "Why am I getting this?", unsubscribe, postal address. |
| Previews | `emails/preview/*.html` and `.txt` in the kit. |

Examples: DeployFailed ("api-gateway failed at step 3 of 5", details table, dark error block, View full logs, "Or open:" link); UsageAlert ("Acme has used 84% of its budget", amber meter, Review usage); Invite ("Join Acme on Meridian", details table, Accept invitation, expiry).

## 37. Topology

**The site, as a diagram that updates.**

A deterministic layered layout from the data alone: same input, same map, every time. No force simulation, no jitter on reload.

Rules:

- `MER-37.1` [MUST] Lay topology out deterministically from the data alone: same input, same map, every time.
- `MER-37.2` [MUST NOT] Use force simulation or let the layout jitter on reload.
- `MER-37.3` [MUST] Draw a down link dashed with the word "down".
- `MER-37.4` [MUST] Turn a link at ≥ 80% load amber.
- `MER-37.5` [MUST] Give screen readers a hidden list of every link.

| Aspect | Behaviour |
|---|---|
| Layout | Tiers from the most upstream kind (ISP, then firewall, then switch), with crossing reduction and groups such as HA pairs and clusters. |
| Links | A down link is dashed with the word "down", and one at ≥ 80% turns amber. Speed and load appear on hover. |
| Selection | Selecting a device lights up its neighbours and dims the rest. Plain scroll moves the page; ⌘ + scroll zooms. |
| Keyboard | Arrows move to the nearest device in that direction. Screen readers get a hidden list of every link. |

Example "Site topology — acme-mcn-1 · 15 devices · 1 link down": Orthogonal / Straight segmented control, zoom controls (− 69% + fullscreen), minimap; nodes show icon, name, mono IP and status hexagon; groups "EDGE · HA PAIR", "CORE · MLAG", "CLUSTER · PVE"; link labels like "10G · 34%".

## 38. Racks & ports

**Schematic, not skeuomorphic.**

Racks and switch panels drawn the way an engineer sketches them. State is carried by shape as well as colour, so a printout or a colour-blind reader loses nothing.

Rules:

- `MER-38.1` [MUST] Draw racks and switch panels schematically, the way an engineer sketches them.
- `MER-38.2` [MUST] Carry port and device state by shape as well as colour.
- `MER-38.3` [MUST] Turn rack space and power meters amber at 80%.
- `MER-38.4` [MUST] Draw ports as: up filled with the speed, down hollow, disabled hatched, error "!", and a bolt for PoE.
- `MER-38.5` [MUST] Put odd ports on top, like the hardware.

| Aspect | Behaviour |
|---|---|
| Rack | U numbers on both rails, front and rear faces, half-depth hints, and space and power meters that turn amber at 80%. |
| Empty units | With `onPlaceAt`, each free U becomes a "+" target for placing a device. |
| Ports | Up is filled with the speed, down is hollow, disabled is hatched, error shows "!". A bolt marks PoE. |
| Layouts | 8, 24 or 48 ports with SFP+/QSFP uplinks; odd ports on top, like the hardware. |

Examples: "Rack A12 — acme-mcn-1 · Row C · 42U" with Front / Rear toggle (devices with status hexagons, blanks, patch panels, rear half-depth placeholder); device detail (Position U41, Mgmt IP, Mounted Front · full depth, Power 520 W); switch faceplate "Acme AS-4852P" (41 up · 7 down · 3 disabled · 1 error, PoE 42 / 600 W meter, ports 1–48 RJ45 · PoE and 49–52 SFP+, legend Up · speed / Down / Disabled / Error / PoE, "Select a port to see what's patched into it.").

## 39. Network inputs

**Fields that know what a /24 is.**

Every network field validates on blur, saves in its canonical form, and explains itself in the field's own words, not a generic "invalid value".

Rules:

- `MER-39.1` [MUST] Validate every network field on blur.
- `MER-39.2` [MUST] Save network values in their canonical form.
- `MER-39.3` [MUST NOT] Show a generic "invalid value"; explain the problem in the field's own words.
- `MER-39.4` [MUST] Compress pasted IPv6 on blur.
- `MER-39.5` [MUST] Warn about the reserved VLANs 1002–1005.
- `MER-39.6` [MUST] Flag private and documentation ASN ranges.

| Component | Behaviour |
|---|---|
| `IpInput` | v4, v6 or either. Pasted IPv6 is compressed on blur. |
| `CidrInput` | A live readout of network, broadcast, usable range and hosts. `within` checks the supernet; `overlaps` warns about existing ranges. |
| `SubnetCalculator` | Split a block into /N and see allocated, partly used and free ranges as one bar. |
| `MacInput` | Any notation in; colon, hyphen, Cisco dot or bare out. |
| `AsnInput` | 16- or 32-bit, shown in asdot, with private and documentation ranges flagged. |
| `VlanInput` | Lists and ranges like `10,20-29`, with a warning for the reserved 1002–1005. |
| `PortRangeInput` | Hints the service name and warns on an odd protocol. |

Example "Add site subnet" form: Site select (helper "Supernet 10.40.0.0/16"), Subnet `10.40.9.0/24` with readout (NETWORK, BROADCAST, USABLE, HOSTS 254, MASK) and helper "Must sit inside the site supernet."; Gateway with `v4` hint; Resolver · optional with `v6` hint ("IPv4 or IPv6. Pasted v6 is compressed on blur."); Access VLAN; Trunk VLANs with amber warning "1002–1005 are reserved defaults on most switches (FDDI and Token Ring)." and parsed chips ("17 VLANs"); Uplink MAC ("Any notation. Saved as Cisco dot format."); BGP peer ASN with `private` tag and asdot readout; Stratum port with tcp / udp / any segmented control; footer "Validated on blur · pushed on save", Cancel, Add subnet. Side panels: IPv6 delegation (delegated prefix, read-only management range "from Headscale"), "Existing at this site" list with VLAN tags.

## 40. Fleet views

**A thousand machines at a glance.**

Built for fleets: a single shared tooltip, one tab stop, and arrow-key travel through every cell. Two thousand items render without a hitch.

Rules:

- `MER-40.1` [MUST] Give fleet grids a single shared tooltip, one tab stop, and arrow-key travel through every cell.
- `MER-40.2` [MUST] Use a five-step Cobalt ramp for heatmap volume.
- `MER-40.3` [MUST] When heatmap `thresholds` apply, change cell shape too for warn and bad (a notched corner, a slash).
- `MER-40.4` [MUST] In a StatusGrid draw good solid, warn notched, bad slashed, off hollow, unknown dotted.

| Component | Behaviour |
|---|---|
| `Heatmap` | A five-step Cobalt ramp for volume. With `thresholds` it switches to warn and bad, and the cells change shape too: a notched corner, a slash. |
| `StatusGrid` | Good is solid, warn notched, bad slashed, off hollow, unknown dotted. The summary chips filter the grid. |

Examples: "Pool API requests by hour" (7 days × 24 hours, Fewer → More legend); "Share reject rate by site" (warn at 1%, bad at 5%; legend No data / < 1.00% / ≥ 1.00% / ≥ 5.00%); "Miners · acme-tx-west-02" StatusGrid (1,210 miners; chips Hashing / Degraded / Down / Off / Unknown; sm / md / lg size control; "Select a miner to see its telemetry.").

## 41. Consoles & logs

**Hands on the machine.**

VNC through noVNC, serial through xterm.js, one frame around both. Every failure state says why it failed and offers Reconnect.

Rules:

- `MER-41.1` [MUST] Wrap VNC (noVNC) and serial (xterm.js) consoles in one shared frame.
- `MER-41.2` [MUST] Make every console failure state say why it failed and offer Reconnect.
- `MER-41.3` [MUST] Pause LogStream follow mode when the user scrolls up.

| Component | Behaviour |
|---|---|
| `RemoteConsole` | Ctrl+Alt+Del, paste as keystrokes, fit or native scale, fullscreen. |
| `LogStream` | 50k lines, virtualised. Follow mode pauses when you scroll up. Level chips with counts, regex search and ANSI colour. |

Examples: console header with host, protocol (VNC · 1280×800 / iDRAC 9), status hexagon (Connected 38 ms / Failed) and toolbar; failure "Couldn't connect — The BMC refused the console session. Another operator may be connected, or the virtual console licence has expired." with Reconnect; LogStream "site c04 · all sources · Following · 800 lines" with Debug / Info / Warn / Error count chips, search, ERROR rows tinted red.

## 42. Config & diff

**Read the change before you push it.**

CodeMirror 6 in Meridian's palette, with a mode for Cisco and MikroTik configs. The diff is the one people sign off on: running on the left, candidate on the right.

Rules:

- `MER-42.1` [MUST] Show config diffs with running on the left and candidate on the right.
- `MER-42.2` [MUST] Report diagnostics with a gutter marker, a wavy underline, and a Problems list that jumps to the line.
- `MER-42.3` [MUST] Bind ⌘S to `onSave` in the code editor.

| Aspect | Behaviour |
|---|---|
| Diagnostics | Gutter marker, wavy underline, and a Problems list that jumps to the line. ⌘S calls `onSave`. |
| Languages | JSON, YAML, shell, TOML, nginx, properties, plus `ios` for switch configs. |
| `DiffViewer` | Split or unified, word-level highlights, unchanged runs folded. Renders on the server. |

Example editor "acme-core-sw1 · staged.cfg · DEVICE CONFIG" with Problems: "255.255.255.300 isn't a valid subnet mask. Each octet must be 0–255. Ln 13:23". Example diff "acme-core-sw1 · running-config +8 −2", Split / Unified, Apply; "Show 15 unchanged lines" folds; columns RUNNING · OCT 18 and CANDIDATE · STAGED.

## 43. Settings

**The pages every product needs.**

Settings blocks take data and callbacks and never fetch. `SettingsLayout` supplies the settings-only side nav; it becomes a select on phones.

Rules:

- `MER-43.1` [MUST] Make settings blocks take data and callbacks; they never fetch.
- `MER-43.2` [MUST] Use `SettingsLayout` for the settings-only side nav, which becomes a select on phones.
- `MER-43.3` [MUST] Warn when an API key's expiry is "never".
- `MER-43.4` [MUST] Show an API token only once.
- `MER-43.5` [MUST] Revoke an API key by typing the key's name.
- `MER-43.6` [MUST] Lock built-in roles; only custom roles are editable.
- `MER-43.7` [MUST] Collect every roles edit in the unsaved-changes bar.
- `MER-43.8` [MUST] Show unread notifications by dot and weight.
- `MER-43.9` [MUST] Turn usage meters amber at 80% of what's included, never red.
- `MER-43.10` [MUST NOT] Stop service when usage goes over; going over costs money but stops nothing.

| Component | Behaviour |
|---|---|
| `ApiKeysPanel` | Scopes per resource, expiry with a warning on "never", a token shown once, and revoke by typing the key's name. |
| `RolesMatrix` | Built-in roles locked, custom ones editable; the unsaved-changes bar collects every edit. |
| `MembersPanel` | Inline role select, 2FA status, pending invites, and an SSO-managed variant. |
| `NotificationCenter` | Bell, inbox and archive, unread shown by dot and weight, plus a channel preferences matrix. |

Examples: "API keys — Tokens for the CLI, CI and scripts. Each key acts as the person who created it." (summary "5 keys · 1 expiring this week · 1 expired", Create key; columns NAME, KEY (mono, truncated), SCOPES (mono chips), LAST USED, EXPIRES with amber "In 5 days" and red "Expired"; expired keys struck through). "Roles — Built-in roles cover most teams. Custom roles fine-tune access per resource." (7 roles · 19 permissions · Built-in roles are read-only; BUILT-IN 🔒 Owner, Admin, Developer, Billing, Viewer; CUSTOM Site Operator; grouped permissions with counts).

**Money, hooks and history.**

Usage meters follow the same rule as everywhere: amber at 80% of what's included, never red. Going over costs money but stops nothing.

| Component | Behaviour |
|---|---|
| `BillingOverview` + `UsagePanel` | Plan, card, invoices, metered usage, a daily chart and a spend limit. |
| `WebhooksPanel` | Success per endpoint, signing secret with rotation, grouped event subscriptions, and redeliver. |
| `AuditLog` | Grouped by day; who, what and from where; expand for a before/after diff; export to CSV. |

Examples: Usage (Spend so far, Projected with "Above your spend limit", Billing period days left; "Included usage — Meters turn amber at 80% of what your plan includes. Beyond that you pay per unit; nothing stops." with ink meters under 80% and amber at/over, e.g. "Over by 120 GB · +$10.80"; daily compute chart with Compute / Bandwidth / Storage segmented control and "Included pace" line). Webhooks ("3 endpoints · 1 failing", mono endpoint URLs, events, status hexagon Healthy / Failing / Disabled, 24h success bars). Audit log ("Every change made in acme by people, API keys and the system. Kept for 1 year.", search, Add filter, Export CSV, grouped TODAY, actor · action · mono target · IP and location · relative time).

## 44. Lint rules

**The rules in this book, as errors.**

A review checklist only works if someone reads it. These rules run in the editor and in CI. Components are matched by where they're imported from, not by tag name, so aliases still get caught.

Rules:

- `MER-44.1` [MUST] `stylex-import-vars-from-stylex-files`: import variables from `.stylex` entry points (autofix).
- `MER-44.2` [MUST NOT] `no-raw-colors`: use hex, rgb() or named colours in styles.
- `MER-44.3` [MUST] `danger-is-outlined`: use `dangerSolid` only inside a dialog.
- `MER-44.4` [MUST] `one-accent-per-file`: keep Cobalt to the single conversion moment.
- `MER-44.5` [MUST NOT] `status-needs-label`: show colour-only status or an icon-only badge.
- `MER-44.6` [MUST] `icon-button-label`: give icon buttons a `label`.
- `MER-44.7` [MUST] `one-staged-bar`: use one staged-changes bar per page.
- `MER-44.8` [MUST] `no-classname-on-kit`: style kit components with the `style` prop, not `className`.
- `MER-44.9` [MUST] `meter-no-bad-tone`: meters go amber, never red.
- `MER-44.10` [SHOULD] `prefer-longhand`: use `paddingBlock` over `"4px 8px"` shorthand.

Rules run in the editor and in CI; components are matched by import source, not tag name. Each rule has a docs page with ✓/✗ examples and a link back to the page of this book it enforces. 141 tests.

| Rule | Enforces |
|---|---|
| `stylex-import-vars-from-stylex-files` | Variables come from `.stylex` entry points; autofix |
| `no-raw-colors` | Hex, rgb() and named colours in styles |
| `danger-is-outlined` | `dangerSolid` only inside a dialog |
| `one-accent-per-file` | Cobalt is the single conversion moment |
| `status-needs-label` | No colour-only status or icon-only badge |
| `icon-button-label` | Icon buttons need `label` |
| `one-staged-bar` | One staged-changes bar per page |
| `no-classname-on-kit` | Use the `style` prop |
| `meter-no-bad-tone` | Meters go amber, never red |
| `prefer-longhand` | `paddingBlock` over `"4px 8px"` |

```js
// eslint.config.js
import meridian from "@meridian/eslint-plugin";
export default [meridian.configs.recommended];
```

```text
$ npx eslint .
app/deploys/page.tsx
  14:9   error  Solid danger only inside a dialog   danger-is-outlined
  22:24  error  Raw colour #DC3E42 in color         no-raw-colors
  31:7   error  Status needs a word                 status-needs-label
   3:10  error  Import colors from tokens.stylex    stylex-import-vars…
✖ 4 problems (4 errors) · 1 fixable with --fix
```

## 45. Figma library

**The same tokens, on the canvas.**

Generated from `palette.stylex.ts`, so design and code can't drift. Every fill, stroke, padding and radius is bound to a variable, and every component links to its React import.

Rules:

- `MER-45.1` [MUST] Generate the Figma library from `palette.stylex.ts` so design and code can't drift.
- `MER-45.2` [MUST] Bind every fill, stroke, padding and radius to a variable.
- `MER-45.3` [MUST] Link every Figma component to its React import.
- `MER-45.4` [MUST] Use each variable's StyleX name (e.g. `colors.surface`) as its code syntax.

| Aspect | Value |
|---|---|
| Variables | 115 in five collections. Color has Light and Dark modes aliased to the Graphite and Cobalt primitives. Each variable's code syntax is its StyleX name, such as `colors.surface`. |
| Styles | 12 text styles (Inter, Geist Mono) and 10 effect styles, including the hairline ring. |
| Components | 34 sets, 136 variants. Dev Mode shows the JSX. |
| Three routes | Run the builder plugin in any empty Figma file, import `variables.json` or the Tokens Studio file, or open the `.fig`. |

## 46. Quality & package

**Tested, then shipped as one package.**

The kit is `@meridian/ui`, published uncompiled so each app's StyleX compiler processes it. Every change runs types, unit and accessibility tests, and visual regression in light, dark and at phone width.

Rules:

- `MER-46.1` [MUST] Publish `@meridian/ui` uncompiled so each app's StyleX compiler processes it.
- `MER-46.2` [MUST] Run types, unit and accessibility tests, and visual regression in light, dark and at phone width, on every change.
- `MER-46.3` [MUST] Pass Vitest + Testing Library + axe checks for keyboard, focus and ARIA with no violations.

```sh
# Install in an app
npm i @meridian/ui @stylexjs/stylex
npm i -D @stylexjs/unplugin
```

```ts
// vite.config.ts
import stylex from "@stylexjs/unplugin";
export default defineConfig({ plugins: [stylex.vite(), react()] });
// The plugin finds @meridian/ui (it depends on StyleX) and compiles it.
```

```text
Entry points
"@meridian/ui"                 // components
"@meridian/ui/tokens"          // theme, type, global
"@meridian/ui/tokens.stylex"   // colors, space, radius… (vars)
"@meridian/ui/palette.stylex"  // media, light, dark
"@meridian/ui/marketing" · "/auth" · "/saas" · "/emails/*"
```

| Script | Does |
|---|---|
| `npm test` | Vitest + Testing Library + axe: keyboard, focus, ARIA, no violations |
| `npm run test:visual` | Playwright screenshots of every gallery view, light/dark, desktop/phone |
| `npm run stories` | Ladle stories for every component, with a theme toggle |
| `npm run gallery` | The live gallery app (Vite + StyleX dev CSS) |
| `npm run lint` | ESLint with `@meridian/eslint-plugin`: the book's rules as errors |
| `npm run typecheck` | Strict TypeScript across kit, tests and stories |
| `npm run build` | Emit `dist/` with types; StyleX stays uncompiled |

Verified: the packed tarball installs into a fresh Vite app, builds, and renders with app-side StyleX reading the package's tokens.

## 47. Voice & copy

**Talk like a senior engineer on a good day.**

Direct, specific and calm. We assume competence, skip the cheerleading, and always say what happened, why, and what to do next.

Rules:

- `MER-47.1` [MUST] Write direct, specific and calm copy; assume competence and skip the cheerleading.
- `MER-47.2` [MUST] Always say what happened, why, and what to do next.
- `MER-47.3` [MUST] Be specific over clever: name the resource, the number, the file ("3 migrations ran" beats "All set!").
- `MER-47.4` [MUST NOT] Use exclamation marks, "Oops", or blame in errors.
- `MER-47.5` [MUST] Use sentence case everywhere — buttons, headings, menus; proper nouns keep their capitals.
- `MER-47.6` [MUST] Show the command: if there's a CLI equivalent, put it next to the button.
- `MER-47.7` [AVOID] "Oops! Something went wrong" — prefer "Build failed: `composer install` exited with code 1."
- `MER-47.8` [AVOID] "Are you sure?" — prefer "Delete **api-gateway**? Its 2 databases and 248 deployments will be removed."
- `MER-47.9` [AVOID] "Your awesome app is now LIVE! 🚀" — prefer "Live at `api.example.com` · 1m 18s".
- `MER-47.10` [AVOID] "Click here to learn more" — prefer "Read the rollback guide" (the link names its target).
- `MER-47.11` [AVOID] "Invalid input" — prefer "Use lowercase letters, numbers and dashes."
- `MER-47.12` [AVOID] "Submit" — prefer "Create environment".
- `MER-47.13` [AVOID] "No data" — prefer "No deployments yet. Push to `main` to start one."

| Avoid | Prefer |
|---|---|
| Oops! Something went wrong 😕 | Build failed: `composer install` exited with code 1. |
| Are you sure? | Delete **api-gateway**? Its 2 databases and 248 deployments will be removed. |
| Your awesome app is now LIVE! 🚀 | Live at `api.example.com` · 1m 18s |
| Click here to learn more | Read the [rollback guide] |
| Invalid input | Use lowercase letters, numbers and dashes. |
| Submit | Create environment |
| No data | No deployments yet. Push to `main` to start one. |

## 48. Accessibility

**WCAG 2.2 AA is the floor, not the goal.**

Engineers use screen readers, magnifiers, high-contrast modes and keyboards exclusively. Accessibility is checked at the token level so components inherit it for free.

Rules:

- `MER-48.1` [MUST] Meet WCAG 2.2 AA as the floor.
- `MER-48.2` [MUST] Check accessibility at the token level so components inherit it.
- `MER-48.3` [MUST NOT] Use text-4 for information; it is decorative only.
- `MER-48.4` [MUST] Draw focus as a 2px Cobalt 400 ring with a 2px gap (offset by the background color), shown on `:focus-visible` only.
- `MER-48.5` [MUST] Give every hit area at least 24×24px, and 44×44 on touch.
- `MER-48.6` [MUST] Extend small controls' hit area with padding, not visual size.
- `MER-48.7` [MUST] Make every action keyboard reachable in visual order.
- `MER-48.8` [MUST] Give icon-only buttons an `aria-label`.
- `MER-48.9` [MUST] Announce status changes via a polite live region.
- `MER-48.10` [MUST NOT] Convey state by color alone.
- `MER-48.11` [MUST] Make dialogs trap focus and restore it on close.
- `MER-48.12` [MUST] Make layouts reflow at 400% zoom without loss.
- `MER-48.13` [MUST] Respect reduced-motion and forced-colors.
- `MER-48.14` [MUST] Make logs and code selectable plain text.
- `MER-48.15` [MUST] Let the status word carry the meaning; the hexagon only reinforces it.

| Pair | Contrast | Level |
|---|---|---|
| text on surface | 18.9:1 | AAA |
| text-2 on surface | 6.9:1 | AA |
| text-3 on surface | 4.8:1 | AA |
| white on accent | 5.1:1 | AA |
| dark text-2 | 7.7:1 | AAA |

text-4 is decorative only — never for information.

Focus: 2px ring, 2px gap. Cobalt 400 ring offset from the element by the background color, so it reads on any surface. Shown on `:focus-visible` only.

Targets: Minimum 24×24px hit area; 44×44 on touch. Small controls extend their hit area with padding, not visual size.

Color-independent status: the same statuses with color removed (Live, Queued, Failed, Building in grayscale). The word always carries the meaning; the hexagon only reinforces it.

## 49. Tokens: StyleX

**One source of truth.**

Every hex value lives once, as compile-time constants. Theme-aware variables read from them and follow the OS setting by default. Components read roles only — so a theme is just a different set of values.

Rules:

- `MER-49.1` [MUST] Define every hex value once, as compile-time constants.
- `MER-49.2` [MUST] Make theme-aware variables read from the constants and follow the OS setting by default.
- `MER-49.3` [MUST] Make components read roles only.
- `MER-49.4` [MUST] Import variables straight from the `.stylex.ts` file; StyleX can't follow them through an `index.ts` barrel.
- `MER-49.5` [MUST] Use `media.*` constants as style keys so breakpoints never drift between files.
- `MER-49.6` [MUST NOT] Hard-code a hex value in a component; if a role is missing, add it to the palette and the vars.

```ts
// tokens/palette.stylex.ts
export const media = stylex.defineConsts({
  dark: "@media (prefers-color-scheme: dark)",
  reducedMotion: "@media (prefers-reduced-motion: reduce)",
  phone: "@media (max-width: 639px)",
});

export const light = stylex.defineConsts({
  bg: "#FCFCFB", surface: "#FFFFFF", subtle: "#F7F7F5",
  border: "#E6E5E1", text: "#111110", text2: "#5B5A56",
  accent: "#2E63F0", ink: "#111110", good: "#1F9D5C",
  // …every role, plus kind tags and shadows
});

export const dark = stylex.defineConsts({
  bg: "#0A0A09", surface: "#111110", subtle: "#181817",
  border: "#262624", text: "#EDEDEA", text2: "#A3A29C",
  accent: "#5E88FB", ink: "#F2F2EF", good: "#3DC07A",
});
```

```ts
// tokens/tokens.stylex.ts
import { dark, light, media } from "./palette.stylex";

export const colors = stylex.defineVars({
  bg: { default: light.bg, [media.dark]: dark.bg },
  surface: { default: light.surface, [media.dark]: dark.surface },
  text: { default: light.text, [media.dark]: dark.text },
  accent: { default: light.accent, [media.dark]: dark.accent },
  // …
});

export const space = stylex.defineVars({
  s1: "4px", s2: "8px", s3: "12px", s4: "16px", /* … */
});
export const radius = stylex.defineVars({
  xs: "4px", sm: "6px", md: "8px", lg: "12px", xl: "16px",
});
export const motion = stylex.defineVars({
  easeOut: "cubic-bezier(.16, 1, .3, 1)", fast: "120ms",
});
// also: kinds, shadows, fonts, layout
```

## 50. StyleX in use

**Themes and components.**

With no theme applied, everything follows the OS. Spread `theme.dark` or `theme.light` to force one on any subtree. Components accept a `style` prop of StyleX styles for overrides.

Rules:

- `MER-50.1` [MUST] Follow the OS when no theme is applied; spread `theme.dark` or `theme.light` to force one on a subtree.
- `MER-50.2` [MUST] Override component styles through a `style` prop of StyleX styles — no `className`.
- `MER-50.3` [MUST NOT] Import constants (`ramp`, `light`, `dark`) in components.
- `MER-50.4` [MUST] Name roles for what they're for: `colors.surface`, `colors.text2`.
- `MER-50.5` [MUST] Name states with a suffix: `accentHover`, `borderStrong`.
- `MER-50.6` [MUST NOT] Use colour names in components (`blue500`).
- `MER-50.7` [MUST] Keep danger outlined everywhere except the confirm in a dialog.

```tsx
// components/Button.tsx — excerpt
import { colors, radius, shadows } from "../tokens/tokens.stylex";

const variants = stylex.create({
  primary: {
    backgroundColor: { default: colors.ink, ":hover": colors.inkHover },
    boxShadow: shadows.sm,
    color: colors.inkFg,
  },
  // Outlined everywhere except the confirm in a dialog
  danger: {
    backgroundColor: { default: colors.surface, ":hover": colors.badSoft },
    boxShadow: `inset 0 0 0 1px ${colors.badRing}`,
    color: colors.badFg,
  },
});

const sizes = stylex.create({
  md: { height: "32px", paddingInline: "12px", borderRadius: radius.md },
});

<button {...stylex.props(styles.base, focus.ring,
  variants[variant], sizes[size], style)} />
```

```tsx
// app/layout.tsx
import "@fontsource-variable/inter";
import "@fontsource-variable/geist-mono";
import { global, theme } from "@/meridian/tokens";

<html {...stylex.props(global.html)}>             // follows OS
<html {...stylex.props(theme.dark, global.html)}> // forced
```

| Naming | Rule |
|---|---|
| Constants | `ramp`, `light`, `dark` — never imported by components |
| Roles | What it's for: `colors.surface`, `colors.text2` |
| States | Suffix: `accentHover`, `borderStrong` |
| Overrides | A `style` prop of StyleX styles — no `className` |
| Never | Colour names in components (`blue500`) |

## 51. Component inventory

**155 components, one package.**

Every pattern in this book ships as a typed React component in `@meridian/ui`. Each one is styled with StyleX, reads only role tokens, and takes a `style` prop for overrides. Interactive ones are client components; overlays are built on native `<dialog>`.

Rules:

- `MER-51.1` [MUST] Ship every pattern as a typed React component in `@meridian/ui`, styled with StyleX, reading only role tokens, and taking a `style` prop for overrides.
- `MER-51.2` [MUST] Make interactive components client components.
- `MER-51.3` [MUST] Build overlays on native `<dialog>`.

| Group | Count | Components |
|---|---|---|
| Layout & type | 9 | Stack, Inline, Container, Divider, Heading, Text, Link, VisuallyHidden, SplitPane |
| Actions | 5 | Button, IconButton, ButtonGroup, CopyButton, Kbd |
| Forms | 10 | Field, Input, Textarea, Select, Checkbox, Radio, RadioGroup, ChoiceCards, Switch, UnsavedChangesBar |
| Forms · advanced | 8 | NumberInput, SecretInput, TagInput, Slider, FileDrop, Combobox, MultiSelect, OtpInput |
| Time | 7 | RelativeTime, TimeZoneProvider, TimeZoneToggle, Calendar, DatePicker, TimeInput, DateRangeInput |
| Status & feedback | 11 | Status, Badge, ChangeMark, KindTag, Meter, Progress, Spinner, Skeleton, Banner, EmptyState, Toast |
| Overlays | 10 | Dialog, ConfirmDialog, Drawer, Popover, Menu, ContextMenu, Tooltip, HoverCard, CommandPalette, ShortcutsDialog |
| Data | 13 | Card, StatCard, Table, DataTable, FilterBar, DescriptionList, Timeline, TreeView, Avatar, AvatarGroup, UptimeBar, Accordion, LogViewer |
| Charts | 5 | LineChart, AreaChart, BarChart, ChartCard, Sparkline |
| Navigation | 11 | AppHeader, Breadcrumbs, SwitcherButton, SearchTrigger, RouteTabs, Tabs, Segmented, SideNav, Stepper, Pagination, OnboardingChecklist |
| Code & plans | 6 | CodeBlock, InlineCode, Terminal, DiffList, DiffRow, StagedBar |
| Network inputs | 8 | IpInput, CidrInput, CidrReadout, SubnetCalculator, MacInput, AsnInput, VlanInput, PortRangeInput |
| Infrastructure | 5 | TopologyGraph, RackElevation, SwitchFaceplate, Heatmap, StatusGrid |
| Consoles & logs | 6 | RemoteConsole, SerialConsole, ConsoleFrame, CodeEditor, DiffViewer, LogStream |
| Brand | 2 | Logo, LogoMark |
| /marketing | 12 | MarketingNav, Hero, Section, LogoCloud, FeatureGrid, FeatureSplit, DarkBand, CtaBand, PricingTable, Faq, ChangelogEntry, Footer |
| /auth | 9 | AuthLayout, AuthQuote, SignInForm, SignUpForm, OrDivider, TwoFactorForm, RecoveryCodes, InviteAccept, FirstRun |
| /saas | 11 | SettingsLayout, SettingsSection, ApiKeysPanel, WebhooksPanel, RolesMatrix, AuditLog, NotificationCenter, NotificationPreferences, BillingOverview, UsagePanel, MembersPanel |
| /emails | 7 | EmailLayout, InviteEmail, MagicLinkEmail, DeployFailedEmail, UsageAlertEmail, InvoiceEmail, WeeklyDigestEmail |

Total: 155.

## 52. Review checklist

**Before it ships.**

Run every new screen through these eighteen checks. If one fails, it's not a matter of taste — the screen isn't finished yet.

Rules:

- `MER-52.1` [MUST] Only one accent-colored element is competing for attention.
- `MER-52.2` [MUST] All spacing is on the 4px scale; no one-off values.
- `MER-52.3` [MUST] Radii match size: controls 8, cards 12, dialogs 16.
- `MER-52.4` [MUST] Machine values (IDs, hashes, regions) are in mono.
- `MER-52.5` [MUST] Numbers are tabular and right-aligned in tables.
- `MER-52.6` [MUST] Looks intentional in both light and dark.
- `MER-52.7` [MUST] Every state is designed: empty, loading, error, partial.
- `MER-52.8` [MUST] Primary action is reachable from ⌘K and has a shortcut.
- `MER-52.9` [MUST] Hover, focus-visible and disabled states all exist.
- `MER-52.10` [MUST] Motion ≤ 240ms and respects reduced motion.
- `MER-52.11` [MUST] Destructive actions confirm with the resource name.
- `MER-52.12` [MUST] Tables scroll on mobile; nothing collapses to cards.
- `MER-52.13` [MUST] Sentence case on every label and heading.
- `MER-52.14` [MUST] Buttons are verb + object.
- `MER-52.15` [MUST] Errors say what happened, why, and what to do next.
- `MER-52.16` [MUST] No exclamation marks, emoji or "Oops" in system copy.
- `MER-52.17` [MUST] CLI equivalent shown where one exists.
- `MER-52.18` [MUST] Contrast meets AA; state never relies on color alone.

Groups: Visual (01–06), Interaction (07–12), Content (13–18).

## Get Meridian

The packages are not on the npm registry yet; npm installs them by URL from https://design.chopper.dev.

### @meridian/ui (tokens, themes and components, StyleX)

Published uncompiled, so the app's StyleX compiler processes it (`@stylexjs/unplugin` for Vite, webpack, Rspack, esbuild or Next.js).

```bash
npm i https://design.chopper.dev/packages/meridian-ui-0.1.0.tgz
npm i @stylexjs/stylex @fontsource-variable/inter @fontsource-variable/geist-mono
npm i -D @stylexjs/unplugin
```

Import components from `@meridian/ui`; variables only from `@meridian/ui/tokens.stylex` and `@meridian/ui/palette.stylex` (StyleX can't follow them through a barrel); themes and type from `@meridian/ui/tokens`; blocks from `@meridian/ui/marketing`, `/auth`, `/saas` and `/emails/<Template>`.

### @meridian/eslint-plugin (the rules as lint errors)

```bash
npm i -D https://design.chopper.dev/packages/meridian-eslint-plugin-0.1.0.tgz
npm i -D eslint @typescript-eslint/parser
```

```js
import tsParser from "@typescript-eslint/parser";
import meridian from "@meridian/eslint-plugin";

export default [
  {
    files: ["**/*.{ts,tsx}"],
    languageOptions: { parser: tsParser, parserOptions: { ecmaFeatures: { jsx: true } } },
  },
  meridian.configs.recommended, // or meridian.configs.strict
];
```

### Figma library

- https://design.chopper.dev/figma/Meridian-Library.fig: variables (colour roles in light and dark, space, radius, type), text and effect styles, and the component sets.

- https://design.chopper.dev/figma/variables.json: the same variables as JSON.

### Not on StyleX

The same tokens as plain CSS custom properties: https://design.chopper.dev/tokens.css, and as a Tailwind v4 theme: https://design.chopper.dev/tailwind.css.

## Component inventory (155)

- **Layout & type** (9): Stack, Inline, Container, Divider, Heading, Text, Link, VisuallyHidden, SplitPane
- **Actions** (5): Button, IconButton, ButtonGroup, CopyButton, Kbd
- **Forms** (10): Field, Input, Textarea, Select, Checkbox, Radio, RadioGroup, ChoiceCards, Switch, UnsavedChangesBar
- **Forms · advanced** (8): NumberInput, SecretInput, TagInput, Slider, FileDrop, Combobox, MultiSelect, OtpInput
- **Time** (7): RelativeTime, TimeZoneProvider, TimeZoneToggle, Calendar, DatePicker, TimeInput, DateRangeInput
- **Status & feedback** (11): Status, Badge, ChangeMark, KindTag, Meter, Progress, Spinner, Skeleton, Banner, EmptyState, Toast
- **Overlays** (10): Dialog, ConfirmDialog, Drawer, Popover, Menu, ContextMenu, Tooltip, HoverCard, CommandPalette, ShortcutsDialog
- **Data** (13): Card, StatCard, Table, DataTable, FilterBar, DescriptionList, Timeline, TreeView, Avatar, AvatarGroup, UptimeBar, Accordion, LogViewer
- **Charts** (5): LineChart, AreaChart, BarChart, ChartCard, Sparkline
- **Navigation** (11): AppHeader, Breadcrumbs, SwitcherButton, SearchTrigger, RouteTabs, Tabs, Segmented, SideNav, Stepper, Pagination, OnboardingChecklist
- **Code & plans** (6): CodeBlock, InlineCode, Terminal, DiffList, DiffRow, StagedBar
- **Network inputs** (8): IpInput, CidrInput, CidrReadout, SubnetCalculator, MacInput, AsnInput, VlanInput, PortRangeInput
- **Infrastructure** (5): TopologyGraph, RackElevation, SwitchFaceplate, Heatmap, StatusGrid
- **Consoles & logs** (6): RemoteConsole, SerialConsole, ConsoleFrame, CodeEditor, DiffViewer, LogStream
- **Brand** (2): Logo, LogoMark
- **@meridian/ui/auth** (9): AuthLayout, AuthQuote, SignInForm, SignUpForm, OrDivider, TwoFactorForm, RecoveryCodes, InviteAccept, FirstRun
- **@meridian/ui/saas** (11): SettingsLayout, SettingsSection, ApiKeysPanel, WebhooksPanel, RolesMatrix, AuditLog, NotificationCenter, NotificationPreferences, BillingOverview, UsagePanel, MembersPanel
- **@meridian/ui/emails** (7): EmailLayout, InviteEmail, MagicLinkEmail, DeployFailedEmail, UsageAlertEmail, InvoiceEmail, WeeklyDigestEmail
- **@meridian/ui/marketing** (12): MarketingNav, Hero, Section, LogoCloud, FeatureGrid, FeatureSplit, DarkBand, CtaBand, PricingTable, Faq, ChangelogEntry, Footer

## Tokens (tokens.css)

Components read the semantic roles only; the ramps are primitives. The dark theme is `[data-theme="dark"]`.

```css
/* Meridian Design Language · tokens.css · https://design.chopper.dev/tokens */

:root {
  /* Graphite */
  --g-0: #FFFFFF;
  --g-25: #FCFCFB;
  --g-50: #F7F7F5;
  --g-100: #F0EFEC;
  --g-200: #E6E5E1;
  --g-300: #D3D2CD;
  --g-400: #A6A59F;
  --g-500: #72716C;
  --g-600: #5B5A56;
  --g-700: #403F3C;
  --g-800: #2A2A28;
  --g-850: #1F1F1E;
  --g-900: #181817;
  --g-950: #111110;
  --g-1000: #0A0A09;
  /* Cobalt */
  --c-50: #EEF3FF;
  --c-100: #DCE6FF;
  --c-200: #B9CCFF;
  --c-300: #8EAEFF;
  --c-400: #5E88FB;
  --c-500: #2E63F0;
  --c-600: #2150D6;
  --c-700: #1B40AD;
  --c-800: #1A3684;
  --c-900: #172C63;
  /* Chart series */
  --chart-1: #2E63F0;
  --chart-2: #14A098;
  --chart-3: #E08A1E;
  --chart-4: #8F5BE0;
  --chart-5: #DB4A80;
  --chart-6: #72716C;
  /* Syntax (code is always on Graphite 950) */
  --syntax-keyword: #F27FA5;
  --syntax-function: #8EAEFF;
  --syntax-type: #C4A7FF;
  --syntax-string: #9FD79A;
  --syntax-number: #F2B36F;
  --syntax-comment: #6E6D68;
  --syntax-plain: #EDEDEA;
  /* Type */
  --font-sans: "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-serif: "Instrument Serif", Georgia, serif;
  /* Shape */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-instant: 0ms;
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --dur-slow: 240ms;

  /* Roles: light */
  color-scheme: light;
  --bg: var(--g-25);
  --surface: var(--g-0);
  --subtle: var(--g-50);
  --muted: var(--g-100);
  --border: var(--g-200);
  --border-strong: var(--g-300);
  --text: var(--g-950);
  --text-2: var(--g-600);
  --text-3: var(--g-500);
  --text-4: var(--g-400);
  --accent: var(--c-500);
  --accent-hover: var(--c-600);
  --accent-soft: var(--c-50);
  --accent-fg: var(--c-700);
  --focus: var(--c-400);
  --ink: var(--g-950);
  --ink-hover: var(--g-800);
  --on-ink: var(--g-0);
  --success: #1F9D5C;
  --success-soft: #E9F7EF;
  --success-fg: #187D49;
  --warning: #C97C06;
  --warning-soft: #FDF4E3;
  --warning-fg: #9C5F04;
  --critical: #DC3E42;
  --critical-soft: #FDECEC;
  --critical-fg: #B9282C;
  --critical-ring: rgba(220,62,66,.3);
  --special: #7C3AED;
  --special-soft: #F5F3FF;
  --special-fg: #6D28D9;
  --kind-service: #EEF2FF;
  --kind-service-fg: #3730A3;
  --kind-worker: #FFF7ED;
  --kind-worker-fg: #9A3412;
  --kind-cron: #F0FDFA;
  --kind-cron-fg: #115E59;
  --kind-postgres: #FDF4FF;
  --kind-postgres-fg: #86198F;
  --kind-redis: #ECFEFF;
  --kind-redis-fg: #155E75;
  --shadow-e0: 0 0 0 1px var(--border);
  --shadow-e1: 0 1px 2px rgba(17,17,16,.06), 0 0 0 1px rgba(17,17,16,.05);
  --shadow-e2: 0 1px 1px rgba(17,17,16,.03), 0 2px 4px rgba(17,17,16,.04), 0 8px 16px -4px rgba(17,17,16,.06), 0 0 0 1px rgba(17,17,16,.05);
  --shadow-e3: 0 2px 2px rgba(17,17,16,.03), 0 8px 12px rgba(17,17,16,.04), 0 24px 48px -12px rgba(17,17,16,.14), 0 0 0 1px rgba(17,17,16,.06);
  --shadow-e4: 0 0 0 1px rgba(17,17,16,.07), 0 32px 80px -16px rgba(17,17,16,.28), 0 12px 24px -8px rgba(17,17,16,.08);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--g-1000);
  --surface: var(--g-950);
  --subtle: var(--g-900);
  --muted: var(--g-850);
  --border: #262624;
  --border-strong: #34332F;
  --text: #EDEDEA;
  --text-2: #A3A29C;
  --text-3: #7E7D78;
  --text-4: #5C5B57;
  --accent: var(--c-400);
  --accent-hover: var(--c-300);
  --accent-soft: rgba(94,136,251,.14);
  --accent-fg: var(--c-300);
  --focus: var(--c-400);
  --ink: #F2F2EF;
  --ink-hover: #DCDCD8;
  --on-ink: var(--g-1000);
  --success: #3DC07A;
  --success-soft: rgba(61,192,122,.13);
  --success-fg: #3DC07A;
  --warning: #F2A93B;
  --warning-soft: rgba(242,169,59,.13);
  --warning-fg: #F2A93B;
  --critical: #F26B6E;
  --critical-soft: rgba(242,107,110,.13);
  --critical-fg: #F26B6E;
  --critical-ring: rgba(242,107,110,.35);
  --special: #A78BFA;
  --special-soft: rgba(167,139,250,.14);
  --special-fg: #A78BFA;
  --kind-service: rgba(55,48,163,.25);
  --kind-service-fg: #A5B4FC;
  --kind-worker: rgba(154,52,18,.25);
  --kind-worker-fg: #FDBA74;
  --kind-cron: rgba(17,94,89,.3);
  --kind-cron-fg: #5EEAD4;
  --kind-postgres: rgba(134,25,143,.25);
  --kind-postgres-fg: #F0ABFC;
  --kind-redis: rgba(21,94,117,.3);
  --kind-redis-fg: #67E8F9;
  --shadow-e0: 0 0 0 1px var(--border);
  --shadow-e1: 0 0 0 1px rgba(255,255,255,.06), 0 1px 2px rgba(0,0,0,.4);
  --shadow-e2: 0 0 0 1px rgba(255,255,255,.07), 0 8px 24px -6px rgba(0,0,0,.6);
  --shadow-e3: 0 0 0 1px rgba(255,255,255,.08), 0 24px 64px -12px rgba(0,0,0,.8);
  --shadow-e4: 0 0 0 1px rgba(255,255,255,.08), 0 32px 80px -16px rgba(0,0,0,.85);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
```
