<!-- generated by scripts/gen-docs.mjs from docs/system/page-layout.md. Edit the source and rerun. -->
# Page layout

## Description
One page shape: titled sections in a main column, and cards in a side column that sits beside it when the page's box has room for both, 840px, and under it at full width otherwise.

`import { PageColumns } from "@/components/cobalt/ui/page-columns"`, source `registry/cobalt/ui/page-columns.tsx`, status `ready-with-gaps`.
`import { Section } from "@/components/cobalt/ui/section"`, source `registry/cobalt/ui/section.tsx`, status `ready-with-gaps`.
`import { RailCard } from "@/components/cobalt/ui/rail-card"`, source `registry/cobalt/ui/rail-card.tsx`, status `ready-with-gaps`.
Foundation: `team components (hand-rolled; RailCard on the shadcn Card)`. Traps checked: `trap/surface-double-edge`, `trap/surface-matches-parent`, `trap/decor-pointer`, `trap/text-measure`, `trap/viewport-height`, `trap/safe-area`, `trap/list-dead-gap`, `trap/overflow-scrollbar`, `trap/link-as-button`.

PageColumns: at 1280 the columns sit in a row 40px apart, the rail is 320px wide, sticky at 96px from the top, and the main column takes the rest: 480px in the showcase's 888px shell, which is 56 characters of `text-sm` and 49 of `text-base` (`.design-system/evidence/page-columns/columns-1280x800.json`). At 390 the columns stack 40px apart, the step between the main column's sections, both 310px wide, with no horizontal scroll, and `railFirst` puts the rail above the main column (`.design-system/evidence/page-columns/columns-390.json`). `trap/text-measure` is answered by the measure above and by Limits: in a full 72rem shell the main column computes to 744px, 87 characters of `text-sm`, so running text inside it keeps `max-w-prose`. `trap/viewport-height` is answered by the sticky rail's room: a rail taller than the viewport minus 96px hides its bottom (Limits). `trap/safe-area` n/a: the columns set no edge padding of their own; the shell's `--gutter` and the fixed bars own the insets. `trap/overflow-scrollbar` n/a: neither column caps its height.

Section: the heading is 20px at weight 600 on a baseline row with a 16px gap, and the content follows 16px below (`.design-system/evidence/section/grow-heading-390.json`). At 390, beside a link action and two icon controls (a 157px group), the heading wraps to a second line at 15 characters; with neither slot filled it wraps at 34. `trap/link-as-button` is answered by the action rendered as a link (Rules).

RailCard: the card draws no border (0px) and no shadow (none), its corner is 16px, its padding 16px and its gap 16px beside the main column (24px each once PageColumns stacks it under the main column, so it matches the cards there), the small Card's, on `--card` over the page tint, and its heading is 16px at weight 600 (`.design-system/evidence/rail-card/surface-and-heading-1280-consistency.json`). In the 320px rail at 1280 the heading wraps to a second line at 40 characters. `trap/surface-double-edge` and `trap/surface-matches-parent` are answered by the flat surface (Foundation and Anti-slop). Its 280px content column holds about 33 characters of `text-sm`, under the 75 a reading column allows, and a rail card carries a line or two, never prose (Limits). `trap/link-as-button` and `trap/list-dead-gap` are answered by the action inside the card rather than on it (Rules).

The traps that do not apply: `trap/surface-double-edge` and `trap/surface-matches-parent` n/a for PageColumns and Section, which have no fill and no border. `trap/decor-pointer` n/a: no part has a decorative layer. `trap/viewport-height` and `trap/safe-area` n/a for Section and RailCard, which size to their content and never reach a viewport edge. `trap/list-dead-gap` n/a for PageColumns and Section, whose own children are not clickable rows; a list inside answers it. `trap/overflow-scrollbar` n/a: no part caps a height, so `overflow-hidden` on the rail card clips nothing that is not an image.

### Overview
PageColumns sets the page's two columns inside the width the shell sets, so the content starts at the same place on every page. Each titled block in the main column is a Section, with one heading size and no surface. Each block in the side column is a RailCard, the small card with a heading.

### Foundation
| Given by the foundation | Added by the team |
|---|---|
| PageColumns. Not applicable: hand-rolled. A `div`, a `div` and an `aside` | Everything: `data-slot="page-columns"` as a container of its own (`@container/page-columns`), so the box the page gets, not the window, decides the columns; inside it `flex flex-col gap-10`, the same 40px stacked as the main column's sections and side by side, that turns to a row (`@min-[52.5rem]/page-columns:flex-row`) once the box holds 30rem of main column, the 2.5rem gap and the 20rem rail, 840px at the default text size and later with larger text, since both sides are rem; the main column `flex min-w-0 flex-1 flex-col gap-10`, so sections inside it are 40px apart, a wide table never widens the page, and the main column takes all the room the rail leaves; the rail `aside` 320px (`w-80`, `shrink-0`), sticky and `self-start` only side by side, with `gap-4` between its cards, sticking `--page-top` from the top, 96px (`--spacing(24)`) when no ancestor sets it, so a host whose content scrolls in a box of its own or under a header of another height sets the one variable (the docs' desktop Expand view sets 24px, where the rail sat 96px below the main column before); below 52.5rem the rail stacks under the main column at its full width, in a phone, beside a shell's sidebar, in a split view or a docs frame alike (before, on the window's `lg:`, a box under 840px in a window over 1024px wrapped the rail at 320px beside an empty strip); stacked, the rail is part of the one column, so its small cards take a card's own inset, `--pad-card`, 24px, through `--card-spacing` (`@max-[52.5rem]/page-columns:[&>[data-slot=card][data-size=sm]]`), and every card in the column has one inset, the same as a card anywhere else on a phone: in the record block at 390 the Adviser card's text sat 16px in under Key facts' 24px, and now both sit 24px in; side by side the rail keeps the small card's 16px, its 320px being a narrow column of its own; an `ItemGroup` list keeps its rows' own 14px inset in either column; `railFirst` as `@max-[52.5rem]/page-columns:order-first`, so the rail leads only when the page stacks |
| Section. Not applicable: hand-rolled. A `section` with `aria-labelledby`, an `h2`, and two `div`s | Everything: `data-slot="section"` and `flex flex-col gap-4`; the heading row `flex items-baseline justify-between gap-4` so a link action sits on the heading's baseline; the `h2` at `text-xl font-semibold tracking-tight` (D21) with `scroll-mt-24` so an anchor jump lands it under the 96px header; the group at the end `flex max-w-full min-w-0 shrink-0 items-center gap-3`, never wider than the column, so a long translated action wraps inside it, rendered only when `action` or `controls` is given, so the heading takes the whole row otherwise; the row wraps (`flex-wrap`), so a heading too long to share its line puts the group on the next line instead of pushing it off the page, and the heading breaks a word with no spaces (`wrap-anywhere`); `heading` typed as a string so a page has one heading size |
| RailCard. `Card` at `size="sm"`: the flat surface, `--card-spacing` at 16px, `overflow-hidden`, `rounded-2xl`, `render` through Base UI `useRender`; `CardTitle` at `text-base font-semibold` through the same `render` | The fixed shape: `render={<section aria-labelledby={id} />}` with the title as `<h2 id={id}>`, so every rail block is a landmark with a level-two heading; the small Card's 16px spacing kept on every side (`px-(--card-spacing)` adds the sides, since the content is not wrapped in `CardContent`), so a rail card is 16px inside and 16px between its heading and its content, the same as any small card; `min-w-0` so a long word inside never widens the rail; a `heading` string in place of the card's free header, so the rail has one heading size and no description, action or footer slots |

## Examples
A section of a fund's page with a link and a control after its heading, a whole page that Expand opens at a desktop's width, and a rail card with one action. The setup checklist in a rail card is on the Steps page.

Real uses, 0 call sites (`rg -n "<PageColumns\b|<Section\b|<RailCard\b" app registry --glob '!registry/cobalt/ui/*'`): the showcase chrome titles its blocks with its own `section` and `h2` and renders no rail yet, the matches in `registry/cobalt/SKILL.md` are prose in the generated skill, not call sites, and the examples folder does not count.

Uses inside the examples folder, which stand in for product screens until the first one lands on the system:
- A research tool's home page, two sections beside two rail cards, `docs/system/examples/page-layout/page.tsx:35`.
- An adviser's record in the blocks, its key figures beside a rail card of the funds it advises, and a filings feed beside a chart card (`rg -n "<PageColumns" docs/system/examples`).
- Sections around a data table, a row of cards, a segmented control, a popover's trigger and a paged list, 22 in all (`rg -n "<Section\b" docs/system/examples`).

### Example files
| File | Covers | Caption |
|---|---|---|
| `docs/system/examples/page-layout/default.tsx` | default | A section of a fund's page: its heading, a See all link on the heading's baseline, and the quarter it shows chosen after it |
| `docs/system/examples/page-layout/default.tsx` | state:section-with-controls | A segmented control for the quarter after the heading and its link, right-aligned |
| `docs/system/examples/page-layout/page.tsx` | composition:PageColumns | Two sections in the main column and two rail cards in the rail. Expand opens it at a desktop's width, with the rail beside the main column; in a narrower frame or on a phone the rail sits under it |
| `docs/system/examples/page-layout/page.tsx` | state:section-with-action | A See all link on the heading's baseline |
| `docs/system/examples/page-layout/page.tsx` | state:stacked | The rail after the main column, on a phone or in a frame narrower than both columns |
| `docs/system/examples/page-layout/page.tsx` | state:two-columns | The rail beside the main column, 40px apart, in the Expand view at a desktop's width; the inline frame is narrower than the 840px the two columns need |
| Not applicable: no example passes `railFirst`, which `rule/page-columns-main-first-by-default` keeps for a rail the user acts on first | state:rail-first | The rail above the main column on a phone |
| Not applicable: reached when the box holds both columns, on a page whose main column is taller than the rail | state:sticky | The rail stays 96px from the top while the main column scrolls |
| `docs/system/examples/page-layout/profile-summary.tsx` | state:rail-card-with-action | Edit profile, one secondary button inside the card below its text |
| `docs/system/examples/page-layout/profile-summary.tsx` | composition:Avatar | Your profile in the side column, with one secondary button to edit it |

Example: A section of a fund's page: its heading, a See all link on the heading's baseline, and the quarter it shows chosen after it (`docs/system/examples/page-layout/default.tsx`)

```tsx
import { useState } from "react";

import { Section } from "@/components/cobalt/ui/section";
import { SegmentedControl } from "@/components/cobalt/ui/segmented-control";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/cobalt/ui/table";
import { TextLink } from "@/components/cobalt/ui/text-link";

type Quarter = "q2" | "q3";

// The five largest positions in each quarter's 13F, already on the page, so a choice answers at once.
const positions: Record<Quarter, { holding: string; value: string; weight: string }[]> = {
  q2: [
    { holding: "Fenwick Semiconductor", value: "$2.6B", weight: "8.4%" },
    { holding: "Oakline Energy", value: "$2.2B", weight: "7.1%" },
    { holding: "Marlow Health", value: "$1.9B", weight: "6.2%" },
    { holding: "Brightwater Rail", value: "$1.4B", weight: "4.5%" },
    { holding: "Kestrel Payments", value: "$1.1B", weight: "3.6%" },
  ],
  q3: [
    { holding: "Fenwick Semiconductor", value: "$3.0B", weight: "9.3%" },
    { holding: "Marlow Health", value: "$2.0B", weight: "6.2%" },
    { holding: "Oakline Energy", value: "$1.8B", weight: "5.6%" },
    { holding: "Kestrel Payments", value: "$1.5B", weight: "4.6%" },
    { holding: "Elmstead Foods", value: "$1.2B", weight: "3.7%" },
  ],
};

export default function Example() {
  const [quarter, setQuarter] = useState<Quarter>("q3");
  return (
    <Section
      className="w-full max-w-xl"
      id="example-section-positions"
      heading="Largest positions"
      action={
        <TextLink href="#example-section-positions" className="text-sm">
          See all
        </TextLink>
      }
      controls={
        <SegmentedControl
          label="Quarter"
          value={quarter}
          onChange={setQuarter}
          options={[
            { value: "q2", label: "Q2" },
            { value: "q3", label: "Q3" },
          ]}
        />
      }
    >
      <div className="rounded-2xl bg-card px-4 py-1">
        <Table aria-label={`Largest positions, ${quarter === "q2" ? "second" : "third"} quarter of 2026`}>
          <TableHeader>
            <TableRow>
              <TableHead>Holding</TableHead>
              <TableHead align="end">Value</TableHead>
              <TableHead align="end">Weight</TableHead>
            </TableRow>
          </TableHeader>
          <TableBody>
            {positions[quarter].map((p) => (
              <TableRow key={p.holding}>
                <TableHead scope="row">{p.holding}</TableHead>
                <TableCell align="end">{p.value}</TableCell>
                <TableCell align="end">{p.weight}</TableCell>
              </TableRow>
            ))}
          </TableBody>
        </Table>
      </div>
    </Section>
  );
}
```

Example: Two sections in the main column and two rail cards in the rail. Expand opens it at a desktop's width, with the rail beside the main column; in a narrower frame or on a phone the rail sits under it (`docs/system/examples/page-layout/page.tsx`)

```tsx
import { Button } from "@/components/cobalt/ui/button";
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemTitle } from "@/components/cobalt/ui/item";
import { PageColumns } from "@/components/cobalt/ui/page-columns";
import { RailCard } from "@/components/cobalt/ui/rail-card";
import { RelativeTime } from "@/components/cobalt/ui/relative-time";
import { Section } from "@/components/cobalt/ui/section";
import { TextLink } from "@/components/cobalt/ui/text-link";

// A fixed moment, so the times read the same on every visit.
const now = Date.UTC(2026, 9, 16, 15, 0);
const hour = 3_600_000;

const following = [
  { id: "harbour", name: "Harbour Large Cap Core" },
  { id: "calder", name: "Calder Global Equity" },
  { id: "northgate", name: "Northgate Short Duration" },
];

const filings = [
  { id: "harbour-13f", fund: "Harbour Large Cap Core", what: "Filed a 13F", at: now - 3 * hour },
  { id: "calder-adv", fund: "Calder Global Equity", what: "Amended its Form ADV", at: now - 50 * hour },
  { id: "northgate-pf", fund: "Northgate Short Duration", what: "Filed a Form PF", at: now - 9 * 24 * hour },
];

const searches = [
  { id: "private-credit", name: "Private credit over $1 billion", about: "Funds that filed in the last 90 days" },
  { id: "harbour-adviser", name: "Harbour Capital Advisors", about: "Every fund the adviser manages" },
];

export default function Example() {
  return (
    <PageColumns
      rail={
        <>
          <RailCard id="example-page-following" heading="Following">
            <ul className="flex flex-col gap-2 text-sm">
              {following.map((fund) => (
                <li key={fund.id}>
                  <TextLink href={`#${fund.id}`}>{fund.name}</TextLink>
                </li>
              ))}
            </ul>
          </RailCard>
          <RailCard id="example-page-alerts" heading="Filing alerts">
            <p className="text-sm text-muted-foreground">An email when a fund you follow files.</p>
            <Button variant="secondary" size="sm" className="w-fit" render={<a href="#example-page-alerts" />}>
              Edit alerts
            </Button>
          </RailCard>
        </>
      }
    >
      <Section
        id="example-page-filings"
        heading="Recent filings"
        action={
          <TextLink href="#example-page-filings" className="text-sm">
            See all
          </TextLink>
        }
      >
        <ItemGroup variant="card" render={<ul aria-label="Recent filings" />}>
          {filings.map((filing) => (
            <li key={filing.id}>
              <Item render={<a href={`#${filing.id}`} />}>
                <ItemContent>
                  <ItemTitle>{filing.fund}</ItemTitle>
                  <ItemDescription>{filing.what}</ItemDescription>
                </ItemContent>
                <ItemActions>
                  <RelativeTime value={filing.at} now={now} timeZone="UTC" />
                </ItemActions>
              </Item>
            </li>
          ))}
        </ItemGroup>
      </Section>
      <Section id="example-page-searches" heading="Saved searches">
        <ItemGroup variant="card" render={<ul aria-label="Saved searches" />}>
          {searches.map((search) => (
            <li key={search.id}>
              <Item render={<a href={`#${search.id}`} />}>
                <ItemContent>
                  <ItemTitle>{search.name}</ItemTitle>
                  <ItemDescription>{search.about}</ItemDescription>
                </ItemContent>
              </Item>
            </li>
          ))}
        </ItemGroup>
      </Section>
    </PageColumns>
  );
}
```

Example: Your profile in the side column, with one secondary button to edit it (`docs/system/examples/page-layout/profile-summary.tsx`)

```tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/cobalt/ui/avatar";
import { Button } from "@/components/cobalt/ui/button";
import { RailCard } from "@/components/cobalt/ui/rail-card";

export default function Example() {
  return (
    <div className="w-full max-w-xs">
      <RailCard id="example-rail-profile" heading="Your profile">
        <div className="flex min-w-0 items-center gap-3">
          {/* Her name is written beside it, so the picture is not read again. */}
          <Avatar size="lg" decorative>
            <AvatarImage src="/photos/portrait-2.webp" />
            <AvatarFallback />
          </Avatar>
          <div className="flex min-w-0 flex-col">
            <p className="truncate text-sm font-medium" title="Maya Chen">
              Maya Chen
            </p>
            <p className="line-clamp-2 text-sm text-muted-foreground">
              Covers private credit funds at Juniper Ridge Advisers
            </p>
          </div>
        </div>
        <p className="text-sm text-muted-foreground">
          People at your firm can see your name and your saved searches.
        </p>
        <Button variant="secondary" size="sm" className="w-fit" render={<a href="#example-rail-profile" />}>
          Edit profile
        </Button>
      </RailCard>
    </div>
  );
}
```

## Variants
Not applicable: none of the three parts has a variant axis.
- PageColumns: one page shape. `railFirst` is a state of the stacked layout, not a second shape.
- Section: one heading size, 20px at weight 600, so blocks of different content still read as one page.
- RailCard: the card at `size="sm"` with one heading size, 16px at weight 600, so the rail looks the same on every page.

## States
| State | Trigger | What the user can do | Shown by, besides color | Checked by |
|---|---|---|---|---|
| PageColumns two-columns | the PageColumns box at least 52.5rem wide, 840px at the default text size: 30rem of main column, the 2.5rem gap and the 20rem rail | read the main column with the rail beside it | the rail 320px wide to the right, 40px from the main column | screenshot |
| PageColumns stacked | the box under 52.5rem, on a phone, beside a sidebar, in a split view or a docs frame, or with text set larger | read one column, the rail after the main column | one column, the rail as wide as the main column, its cards at the card's 24px inset like the main column's, 40px between the two, the step between sections (before, a box under 840px in a 1024px window kept the rail 320px wide beside an empty strip: 320 under 624px of sections in the docs frame, measured 2026-10-17) | screenshot |
| PageColumns rail-first | `railFirst` while stacked | read the rail before the main column | the rail above the main column | test |
| PageColumns sticky | two-columns, and the main column taller than the rail | scroll the main column while the rail stays | the rail held 96px from the top | by hand |
| Section default | render | read the heading, jump to it from the page outline | the `h2` and the 16px gap to the content | test |
| Section with-action | `action` given | follow the link beside the heading | the link on the heading's baseline, right-aligned; a link there takes `py-1 -my-1`, a 28px box for its 20px line that moves nothing, and `touch-target`, 44px under a coarse pointer (measured 20px tall on desktop and phone before, 28px on desktop and 44x44 on iPhone 13 emulation after, 2026-10-17) | test |
| Section with-controls | `controls` given | operate the content's controls beside the heading | the controls after the action, right-aligned, 12px apart | test |
| RailCard default | render | read it, jump to it from the page outline, and use the controls inside it | the 16px corner, the 16px padding and the `h2` | test |
| RailCard with-action | a `Button` or link among the children | press the action | the control below the text, inside the padding | screenshot |

Example: A segmented control for the quarter after the heading and its link, right-aligned (`docs/system/examples/page-layout/default.tsx`)

```tsx
import { useState } from "react";

import { Section } from "@/components/cobalt/ui/section";
import { SegmentedControl } from "@/components/cobalt/ui/segmented-control";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/cobalt/ui/table";
import { TextLink } from "@/components/cobalt/ui/text-link";

type Quarter = "q2" | "q3";

// The five largest positions in each quarter's 13F, already on the page, so a choice answers at once.
const positions: Record<Quarter, { holding: string; value: string; weight: string }[]> = {
  q2: [
    { holding: "Fenwick Semiconductor", value: "$2.6B", weight: "8.4%" },
    { holding: "Oakline Energy", value: "$2.2B", weight: "7.1%" },
    { holding: "Marlow Health", value: "$1.9B", weight: "6.2%" },
    { holding: "Brightwater Rail", value: "$1.4B", weight: "4.5%" },
    { holding: "Kestrel Payments", value: "$1.1B", weight: "3.6%" },
  ],
  q3: [
    { holding: "Fenwick Semiconductor", value: "$3.0B", weight: "9.3%" },
    { holding: "Marlow Health", value: "$2.0B", weight: "6.2%" },
    { holding: "Oakline Energy", value: "$1.8B", weight: "5.6%" },
    { holding: "Kestrel Payments", value: "$1.5B", weight: "4.6%" },
    { holding: "Elmstead Foods", value: "$1.2B", weight: "3.7%" },
  ],
};

export default function Example() {
  const [quarter, setQuarter] = useState<Quarter>("q3");
  return (
    <Section
      className="w-full max-w-xl"
      id="example-section-positions"
      heading="Largest positions"
      action={
        <TextLink href="#example-section-positions" className="text-sm">
          See all
        </TextLink>
      }
      controls={
        <SegmentedControl
          label="Quarter"
          value={quarter}
          onChange={setQuarter}
          options={[
            { value: "q2", label: "Q2" },
            { value: "q3", label: "Q3" },
          ]}
        />
      }
    >
      <div className="rounded-2xl bg-card px-4 py-1">
        <Table aria-label={`Largest positions, ${quarter === "q2" ? "second" : "third"} quarter of 2026`}>
          <TableHeader>
            <TableRow>
              <TableHead>Holding</TableHead>
              <TableHead align="end">Value</TableHead>
              <TableHead align="end">Weight</TableHead>
            </TableRow>
          </TableHeader>
          <TableBody>
            {positions[quarter].map((p) => (
              <TableRow key={p.holding}>
                <TableHead scope="row">{p.holding}</TableHead>
                <TableCell align="end">{p.value}</TableCell>
                <TableCell align="end">{p.weight}</TableCell>
              </TableRow>
            ))}
          </TableBody>
        </Table>
      </div>
    </Section>
  );
}
```

Example: A See all link on the heading's baseline (`docs/system/examples/page-layout/page.tsx`)

```tsx
import { Button } from "@/components/cobalt/ui/button";
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemTitle } from "@/components/cobalt/ui/item";
import { PageColumns } from "@/components/cobalt/ui/page-columns";
import { RailCard } from "@/components/cobalt/ui/rail-card";
import { RelativeTime } from "@/components/cobalt/ui/relative-time";
import { Section } from "@/components/cobalt/ui/section";
import { TextLink } from "@/components/cobalt/ui/text-link";

// A fixed moment, so the times read the same on every visit.
const now = Date.UTC(2026, 9, 16, 15, 0);
const hour = 3_600_000;

const following = [
  { id: "harbour", name: "Harbour Large Cap Core" },
  { id: "calder", name: "Calder Global Equity" },
  { id: "northgate", name: "Northgate Short Duration" },
];

const filings = [
  { id: "harbour-13f", fund: "Harbour Large Cap Core", what: "Filed a 13F", at: now - 3 * hour },
  { id: "calder-adv", fund: "Calder Global Equity", what: "Amended its Form ADV", at: now - 50 * hour },
  { id: "northgate-pf", fund: "Northgate Short Duration", what: "Filed a Form PF", at: now - 9 * 24 * hour },
];

const searches = [
  { id: "private-credit", name: "Private credit over $1 billion", about: "Funds that filed in the last 90 days" },
  { id: "harbour-adviser", name: "Harbour Capital Advisors", about: "Every fund the adviser manages" },
];

export default function Example() {
  return (
    <PageColumns
      rail={
        <>
          <RailCard id="example-page-following" heading="Following">
            <ul className="flex flex-col gap-2 text-sm">
              {following.map((fund) => (
                <li key={fund.id}>
                  <TextLink href={`#${fund.id}`}>{fund.name}</TextLink>
                </li>
              ))}
            </ul>
          </RailCard>
          <RailCard id="example-page-alerts" heading="Filing alerts">
            <p className="text-sm text-muted-foreground">An email when a fund you follow files.</p>
            <Button variant="secondary" size="sm" className="w-fit" render={<a href="#example-page-alerts" />}>
              Edit alerts
            </Button>
          </RailCard>
        </>
      }
    >
      <Section
        id="example-page-filings"
        heading="Recent filings"
        action={
          <TextLink href="#example-page-filings" className="text-sm">
            See all
          </TextLink>
        }
      >
        <ItemGroup variant="card" render={<ul aria-label="Recent filings" />}>
          {filings.map((filing) => (
            <li key={filing.id}>
              <Item render={<a href={`#${filing.id}`} />}>
                <ItemContent>
                  <ItemTitle>{filing.fund}</ItemTitle>
                  <ItemDescription>{filing.what}</ItemDescription>
                </ItemContent>
                <ItemActions>
                  <RelativeTime value={filing.at} now={now} timeZone="UTC" />
                </ItemActions>
              </Item>
            </li>
          ))}
        </ItemGroup>
      </Section>
      <Section id="example-page-searches" heading="Saved searches">
        <ItemGroup variant="card" render={<ul aria-label="Saved searches" />}>
          {searches.map((search) => (
            <li key={search.id}>
              <Item render={<a href={`#${search.id}`} />}>
                <ItemContent>
                  <ItemTitle>{search.name}</ItemTitle>
                  <ItemDescription>{search.about}</ItemDescription>
                </ItemContent>
              </Item>
            </li>
          ))}
        </ItemGroup>
      </Section>
    </PageColumns>
  );
}
```

Example: The rail after the main column, on a phone or in a frame narrower than both columns (`docs/system/examples/page-layout/page.tsx`)

```tsx
import { Button } from "@/components/cobalt/ui/button";
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemTitle } from "@/components/cobalt/ui/item";
import { PageColumns } from "@/components/cobalt/ui/page-columns";
import { RailCard } from "@/components/cobalt/ui/rail-card";
import { RelativeTime } from "@/components/cobalt/ui/relative-time";
import { Section } from "@/components/cobalt/ui/section";
import { TextLink } from "@/components/cobalt/ui/text-link";

// A fixed moment, so the times read the same on every visit.
const now = Date.UTC(2026, 9, 16, 15, 0);
const hour = 3_600_000;

const following = [
  { id: "harbour", name: "Harbour Large Cap Core" },
  { id: "calder", name: "Calder Global Equity" },
  { id: "northgate", name: "Northgate Short Duration" },
];

const filings = [
  { id: "harbour-13f", fund: "Harbour Large Cap Core", what: "Filed a 13F", at: now - 3 * hour },
  { id: "calder-adv", fund: "Calder Global Equity", what: "Amended its Form ADV", at: now - 50 * hour },
  { id: "northgate-pf", fund: "Northgate Short Duration", what: "Filed a Form PF", at: now - 9 * 24 * hour },
];

const searches = [
  { id: "private-credit", name: "Private credit over $1 billion", about: "Funds that filed in the last 90 days" },
  { id: "harbour-adviser", name: "Harbour Capital Advisors", about: "Every fund the adviser manages" },
];

export default function Example() {
  return (
    <PageColumns
      rail={
        <>
          <RailCard id="example-page-following" heading="Following">
            <ul className="flex flex-col gap-2 text-sm">
              {following.map((fund) => (
                <li key={fund.id}>
                  <TextLink href={`#${fund.id}`}>{fund.name}</TextLink>
                </li>
              ))}
            </ul>
          </RailCard>
          <RailCard id="example-page-alerts" heading="Filing alerts">
            <p className="text-sm text-muted-foreground">An email when a fund you follow files.</p>
            <Button variant="secondary" size="sm" className="w-fit" render={<a href="#example-page-alerts" />}>
              Edit alerts
            </Button>
          </RailCard>
        </>
      }
    >
      <Section
        id="example-page-filings"
        heading="Recent filings"
        action={
          <TextLink href="#example-page-filings" className="text-sm">
            See all
          </TextLink>
        }
      >
        <ItemGroup variant="card" render={<ul aria-label="Recent filings" />}>
          {filings.map((filing) => (
            <li key={filing.id}>
              <Item render={<a href={`#${filing.id}`} />}>
                <ItemContent>
                  <ItemTitle>{filing.fund}</ItemTitle>
                  <ItemDescription>{filing.what}</ItemDescription>
                </ItemContent>
                <ItemActions>
                  <RelativeTime value={filing.at} now={now} timeZone="UTC" />
                </ItemActions>
              </Item>
            </li>
          ))}
        </ItemGroup>
      </Section>
      <Section id="example-page-searches" heading="Saved searches">
        <ItemGroup variant="card" render={<ul aria-label="Saved searches" />}>
          {searches.map((search) => (
            <li key={search.id}>
              <Item render={<a href={`#${search.id}`} />}>
                <ItemContent>
                  <ItemTitle>{search.name}</ItemTitle>
                  <ItemDescription>{search.about}</ItemDescription>
                </ItemContent>
              </Item>
            </li>
          ))}
        </ItemGroup>
      </Section>
    </PageColumns>
  );
}
```

Example: The rail beside the main column, 40px apart, in the Expand view at a desktop's width; the inline frame is narrower than the 840px the two columns need (`docs/system/examples/page-layout/page.tsx`)

```tsx
import { Button } from "@/components/cobalt/ui/button";
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemTitle } from "@/components/cobalt/ui/item";
import { PageColumns } from "@/components/cobalt/ui/page-columns";
import { RailCard } from "@/components/cobalt/ui/rail-card";
import { RelativeTime } from "@/components/cobalt/ui/relative-time";
import { Section } from "@/components/cobalt/ui/section";
import { TextLink } from "@/components/cobalt/ui/text-link";

// A fixed moment, so the times read the same on every visit.
const now = Date.UTC(2026, 9, 16, 15, 0);
const hour = 3_600_000;

const following = [
  { id: "harbour", name: "Harbour Large Cap Core" },
  { id: "calder", name: "Calder Global Equity" },
  { id: "northgate", name: "Northgate Short Duration" },
];

const filings = [
  { id: "harbour-13f", fund: "Harbour Large Cap Core", what: "Filed a 13F", at: now - 3 * hour },
  { id: "calder-adv", fund: "Calder Global Equity", what: "Amended its Form ADV", at: now - 50 * hour },
  { id: "northgate-pf", fund: "Northgate Short Duration", what: "Filed a Form PF", at: now - 9 * 24 * hour },
];

const searches = [
  { id: "private-credit", name: "Private credit over $1 billion", about: "Funds that filed in the last 90 days" },
  { id: "harbour-adviser", name: "Harbour Capital Advisors", about: "Every fund the adviser manages" },
];

export default function Example() {
  return (
    <PageColumns
      rail={
        <>
          <RailCard id="example-page-following" heading="Following">
            <ul className="flex flex-col gap-2 text-sm">
              {following.map((fund) => (
                <li key={fund.id}>
                  <TextLink href={`#${fund.id}`}>{fund.name}</TextLink>
                </li>
              ))}
            </ul>
          </RailCard>
          <RailCard id="example-page-alerts" heading="Filing alerts">
            <p className="text-sm text-muted-foreground">An email when a fund you follow files.</p>
            <Button variant="secondary" size="sm" className="w-fit" render={<a href="#example-page-alerts" />}>
              Edit alerts
            </Button>
          </RailCard>
        </>
      }
    >
      <Section
        id="example-page-filings"
        heading="Recent filings"
        action={
          <TextLink href="#example-page-filings" className="text-sm">
            See all
          </TextLink>
        }
      >
        <ItemGroup variant="card" render={<ul aria-label="Recent filings" />}>
          {filings.map((filing) => (
            <li key={filing.id}>
              <Item render={<a href={`#${filing.id}`} />}>
                <ItemContent>
                  <ItemTitle>{filing.fund}</ItemTitle>
                  <ItemDescription>{filing.what}</ItemDescription>
                </ItemContent>
                <ItemActions>
                  <RelativeTime value={filing.at} now={now} timeZone="UTC" />
                </ItemActions>
              </Item>
            </li>
          ))}
        </ItemGroup>
      </Section>
      <Section id="example-page-searches" heading="Saved searches">
        <ItemGroup variant="card" render={<ul aria-label="Saved searches" />}>
          {searches.map((search) => (
            <li key={search.id}>
              <Item render={<a href={`#${search.id}`} />}>
                <ItemContent>
                  <ItemTitle>{search.name}</ItemTitle>
                  <ItemDescription>{search.about}</ItemDescription>
                </ItemContent>
              </Item>
            </li>
          ))}
        </ItemGroup>
      </Section>
    </PageColumns>
  );
}
```

Example: Edit profile, one secondary button inside the card below its text (`docs/system/examples/page-layout/profile-summary.tsx`)

```tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/cobalt/ui/avatar";
import { Button } from "@/components/cobalt/ui/button";
import { RailCard } from "@/components/cobalt/ui/rail-card";

export default function Example() {
  return (
    <div className="w-full max-w-xs">
      <RailCard id="example-rail-profile" heading="Your profile">
        <div className="flex min-w-0 items-center gap-3">
          {/* Her name is written beside it, so the picture is not read again. */}
          <Avatar size="lg" decorative>
            <AvatarImage src="/photos/portrait-2.webp" />
            <AvatarFallback />
          </Avatar>
          <div className="flex min-w-0 flex-col">
            <p className="truncate text-sm font-medium" title="Maya Chen">
              Maya Chen
            </p>
            <p className="line-clamp-2 text-sm text-muted-foreground">
              Covers private credit funds at Juniper Ridge Advisers
            </p>
          </div>
        </div>
        <p className="text-sm text-muted-foreground">
          People at your firm can see your name and your saved searches.
        </p>
        <Button variant="secondary" size="sm" className="w-fit" render={<a href="#example-rail-profile" />}>
          Edit profile
        </Button>
      </RailCard>
    </div>
  );
}
```

### State precedence
- PageColumns two-columns and stacked: Not applicable: the box is one or the other, at 52.5rem. The box decides, not the window, so a shell's sidebar, a split view or a narrow frame stacks the page as a phone does.
- PageColumns rail-first and two-columns: two-columns wins. `@max-[52.5rem]/page-columns:order-first` applies only while stacked, so the rail is always on the right when the two sit side by side.
- PageColumns sticky and stacked: stacked wins. The rail is `static` while stacked and scrolls with the page.
- PageColumns sticky and two-columns: both show. The rail sticks only once the main column is taller than it; until then the two scroll together.
- Section with-action and with-controls: both show. The action comes first, then the controls, in one right-hand group.
- Section default and with-action: with-action wins. The right-hand group is rendered only when a slot is filled, so a heading alone takes the whole row.
- Section default and hover: Not applicable: a section has no hover; the link or controls inside it hover on their own.
- RailCard default and with-action: both show. The action is content inside the card and changes nothing about the surface.
- RailCard default and hover: Not applicable: a rail card has no hover; a button or link inside it hovers on its own.

### Motion
Not applicable: no motion. The rail sticks without a transition and the columns reflow at the box's 52.5rem with no animation; a section or a rail card neither enters nor changes state in place, and an anchor jump to its heading is the browser's own scroll.

## Props

<!-- Props generated from registry/cobalt/ui/page-columns.tsx, registry/cobalt/ui/section.tsx, registry/cobalt/ui/rail-card.tsx with TypeScript by scripts/props-table.mjs -->
### PageColumns

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `children` | `ReactNode` |  |  |
| `rail` | `ReactNode` |  |  |
| `className?` | `string` |  |  |
| `railFirst?` | `boolean` | `false` |  |

### Section

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `children` | `ReactNode` |  |  |
| `heading` | `string` |  |  |
| `id` | `string` |  |  |
| `action?` | `ReactNode` |  | The one text action beside the heading, usually a link to the full list. |
| `className?` | `string` |  |  |
| `controls?` | `ReactNode` |  | Buttons that belong to the section's content, such as a carousel's arrows, after the action. |

### RailCard

| Prop | Type | Default | Purpose |
|---|---|---|---|
| `children` | `ReactNode` |  |  |
| `heading` | `string` |  |  |
| `id` | `string` |  |  |
| `className?` | `string` |  |  |

PageColumns: `children` is the main column's content, stacked 40px apart. `rail` is the rail's content, stacked 16px apart. `railFirst` (default `false`) puts the rail before the main column while the page is stacked. `className` is merged last and is for placement. No native attribute passes through.

Section: `id` is required and is both the `h2`'s `id` and the section's `aria-labelledby`, so it is unique on the page. `heading` is a string, never a node. `action` is the one text action beside the heading, rendered as given. `controls` are the buttons that belong to the content, rendered after the action. `children` is the content. `className` is merged last and is for placement, such as a grid span. No native attribute passes through.

RailCard: `id` is required and is both the `h2`'s `id` and the section's `aria-labelledby`, so it is unique on the page. `heading` is a string, never a node, so the rail has one heading size. `children` is the card's content, rendered after the heading with a 16px gap. `className` is merged last and is for placement, such as an order in the rail. No native attribute passes through; a card that needs `render`, a description or a footer is Card.

## Usage

### When to use
- A page has a main column and the user's own things beside it, such as their saved items, the funds they follow or this week's plan: PageColumns, with a Section for each titled block in the main column and a RailCard for each block in the rail.
- Every page of the product, so the content starts at the same place on each.
- A block in the main column has one place to go for the full list, or a control that changes what it shows: the Section's `action` and `controls`.
- The same block appears in the rail of more than one page and must look the same on each: a RailCard.

### When not to use
- The page is a single form or a reading page with nothing for a rail. Use the shell's `main` with a Section instead, and leave PageColumns off.
- The page is a sign-in or an error page with one block in the middle. Use Empty inside the shell instead.
- Two things sit side by side inside the main column. Use a grid inside a Section instead; the rail belongs to the page.
- A block needs a surface in the main column, or a description, an action in its header, an image or a footer. Use Card instead, rendered as a section with an `h2`.
- The title names the whole page rather than one block. Use the shell's `h1` instead; each block under it is a Section, or a Card when it needs a surface.
- The control switches the whole block between views of the same data. Use Tabs instead, with the panels as the content.
- A rail block has nothing to show. Use Empty inside the rail card instead of leaving the card out, so the rail keeps its shape.

### Rules
- Follows `rule/layout-page-sets-width`.
- Follows `rule/layout-phone-is-one-column`.
- `rule/page-columns-rail-holds-rail-cards`: When the rail has content, pass 1 or more `RailCard`s in `rail`, instead of bare text, a `div` with a border or a `Card` at the default size, because the rail's cards share one surface, one heading size and one 16px gap, and that is what makes a page's rail read as the same rail on every page. Evidence: app 4/4 example rails hold only `RailCard`s (`rg -n "rail=" docs/system/examples`), the filing alerts block's among them, a `RailCard` with its line of words above its chart since 17 October; person D11. Check: review of every rail in the showcase; lint rule/component-override on PageColumns (scripts/check-system.mjs).
  - Don't: `<PageColumns rail={<div className="rounded-2xl border p-4"><h3>Saved</h3><p>Four items.</p></div>}>`
  - Do: `<PageColumns rail={<RailCard id="rail-saved" heading="Saved"><p>Four items.</p></RailCard>}>`
- `rule/page-columns-main-first-by-default`: When the page stacks on a phone, leave `railFirst` off so the main column leads, and pass `railFirst` only when the rail is the page's summary that the user acts on first, such as "Your week" on the home page, because a phone shows one column and whatever comes first is the page. Evidence: app 4/4 example pages leave `railFirst` off (`rg -n "<PageColumns" docs/system/examples`); principle heuristic: match between system and the real world, the page opens on what the user came for. Check: review of every `railFirst` in the showcase.
  - Don't: `<PageColumns railFirst rail={<RailCard id="rail-following" heading="People you follow">…</RailCard>}>{list}</PageColumns>`
  - Do: `<PageColumns rail={<RailCard id="rail-following" heading="People you follow">…</RailCard>}>{list}</PageColumns>`
- `rule/page-columns-sections-in-main`: When the main column holds more than 1 titled block, give each a `Section`, instead of headings and `div`s of the host's own, because the main column spaces its children 40px apart and Section gives each the one heading size and a landmark, so blocks of different content still read as one page. Evidence: single use `docs/system/examples/page-layout/page.tsx:56`, two Sections in one main column, the second at line 81; person D21. Check: review of every main column in the showcase.
  - Don't: `<PageColumns rail={rail}><h2 className="text-2xl font-bold">This week</h2><div>…</div><h3 className="mt-12 text-lg">Replies</h3><div>…</div></PageColumns>`
  - Do: `<PageColumns rail={rail}><Section id="events" heading="This week">…</Section><Section id="replies" heading="Replies">…</Section></PageColumns>`
- `rule/section-action-is-a-link`: When a section has an action beside its heading, render it as a `TextLink` with `className="text-sm"` to the full list, instead of a `Button` with an `onClick` or a button styled as a link that goes nowhere, because the action's one job is "See all", a navigation, and a button that looks like a link but is not one gives a screen reader "button" for a page move. Evidence: app 4/4 section actions in the examples are a `TextLink` (`rg -n -A2 "action=" docs/system/examples`); principle platform: a link navigates, a button acts. Check: lint trap/link-as-button (scripts/check-system.mjs); test `section.test.tsx` renders the action as given, so an `a` stays an `a`.
  - Don't: `<Section id="events" heading="This week" action={<Button variant="ghost" onClick={() => navigate("/events")}>See all</Button>}>`
  - Do: `<Section id="events" heading="This week" action={<TextLink href="/events" className="text-sm">See all</TextLink>}>`
- `rule/section-controls-are-named`: When a section's `controls` hold an icon-only button or a switch of views, give each an accessible name, with `aria-label` on a ghost `size="icon-sm"` button or `label` on a `SegmentedControl`, because the controls sit beside the heading and a screen reader reaches them before the content they change. Evidence: app 6/6 control groups in the examples carry a name (`rg -n -A6 "controls=" docs/system/examples`), such as `docs/system/examples/page-layout/default.tsx:43`; principle wcag: 4.1.2 Name, role, value. Check: lint trap/button-icon-name (scripts/check-system.mjs); test `button.test.tsx` on the unnamed icon button.
  - Don't: `<Section id="nearby" heading="Nearby" controls={<Button variant="ghost" size="icon-sm"><ChevronRightIcon className="size-4" /></Button>}>`
  - Do: `<Section id="nearby" heading="Nearby" controls={<Button variant="ghost" size="icon-sm" aria-label="Next"><ChevronRightIcon className="size-4" /></Button>}>`
- `rule/section-one-action`: When a section has more than one thing the user can do about it, put 1 text link in `action` and the rest in `controls` or in the content, instead of a row of 2 or more links beside the heading, because the right-hand group is `shrink-0` and every control in it takes width from the heading, which wraps at 15 characters beside a 157px group at 390. Evidence: app 22/22 sections in the examples pass at most 1 node to `action` (`rg -n "<Section" docs/system/examples`); measured wrap at 15 characters beside a 157px right-hand group at 390, .design-system/evidence/section/grow-heading-390.json. Check: review of every section in the showcase.
  - Don't: `<Section id="events" heading="This week" action={<><TextLink href="/events">See all</TextLink><TextLink href="/export">Export</TextLink><TextLink href="/share">Share</TextLink></>}>`
  - Do: `<Section id="events" heading="This week" action={<TextLink href="/events" className="text-sm">See all</TextLink>} controls={<Button variant="ghost" size="icon-sm" aria-label="More"><MoreIcon className="size-4" /></Button>}>`
- `rule/rail-card-id-is-the-heading`: When a rail card is rendered, give `id` a value unique on the page and written in words, such as `"rail-saved"`, instead of an index or a value shared with another card, because the `id` is both the heading's `id` and the section's `aria-labelledby`, and two sections with one `id` give a screen reader one landmark name for both. Evidence: app 6/6 rail cards in the examples carry a worded `id` unique in their file (`rg -n "<RailCard\b" docs/system/examples`); principle wcag: 1.3.1 Info and relationships, the landmark takes its name from the heading it points to. Check: test `rail-card.test.tsx` reads the `id` on the `h2` and the `aria-labelledby` on the section; review of duplicate ids on a page.
  - Don't: `{cards.map((card, i) => <RailCard key={i} id="rail" heading={card.heading}>{card.body}</RailCard>)}`
  - Do: `{cards.map((card) => <RailCard key={card.slug} id={`rail-${card.slug}`} heading={card.heading}>{card.body}</RailCard>)}`
- `rule/rail-card-action-inside`: When a rail card leads somewhere or does something, put a `Button` at `size="sm"` or a link inside the card after its text, instead of wrapping the card in a link or putting `onClick` on it, because the card is a `section` that may hold other controls, and a section that is one big link nests them and gives one tab stop for several actions. Evidence: app 5/5 rail cards with an action in the examples put a `Button` or a link inside, after their text (`rg -n -A12 "<RailCard\b" docs/system/examples`), such as `docs/system/examples/page-layout/profile-summary.tsx:29` and `docs/system/examples/page-layout/page.tsx:49`; principle platform: an interactive element never contains another. Check: lint trap/link-as-button (scripts/check-system.mjs); review.
  - Don't: `<a href="/saved"><RailCard id="rail-saved" heading="Saved"><p>Four items.</p></RailCard></a>`
  - Do: `<RailCard id="rail-saved" heading="Saved"><p>Four items.</p><Button variant="secondary" size="sm" className="w-fit" render={<a href="/saved" />}>Open</Button></RailCard>`
- `rule/rail-card-one-per-topic`: When a page's rail shows more than one of the user's things, give each its own `RailCard` stacked in the rail with the rail's 16px gap, instead of one card with 2 or more bold lines inside it, because the rail's point is that each block is a landmark the user can jump to, and two topics in one section give the outline one name for both. Evidence: single use `docs/system/examples/page-layout/page.tsx:38`, Following and Filing alerts as two cards; principle heuristic: recognition rather than recall, each block is found by its heading. Check: review of every rail in the showcase.
  - Don't: `<RailCard id="rail-mine" heading="Yours"><p className="font-semibold">Saved</p><p>Four items.</p><p className="font-semibold">Following</p><p>Nothing new.</p></RailCard>`
  - Do: `<RailCard id="rail-saved" heading="Saved"><p>Four items.</p></RailCard> <RailCard id="rail-following" heading="Following"><p>Nothing new.</p></RailCard>`

### Content
- Follows `rule/writing-heading-sentence-case`.
- Follows `rule/writing-link-object`.
- Follows `rule/writing-no-invented-numbers`.
- `rule/section-action-says-where`: When a section's action is written, name where it goes in 2 words or fewer, such as "See all" or "Open list", instead of "Click here", "More" or a sentence, because the link is read beside the heading and the heading already says what the list is. Evidence: app 4/4 section actions in the examples read "See all" (`rg -n -A1 "action=" docs/system/examples`); person D11. Check: lint copy/banned-word for "click here" and "learn more" (scripts/copy-check.mjs); review.
  - Don't: `action={<TextLink href="/events" className="text-sm">Click here to see all of this week's events</TextLink>}`
  - Do: `action={<TextLink href="/events" className="text-sm">See all</TextLink>}`
- `rule/rail-card-heading-is-a-noun`: When a rail card is named, write the thing it holds as a noun phrase of 1 to 3 words, such as "Saved" or "Your week", instead of a verb phrase or a sentence, because the heading is the landmark's name and is read in a list of landmarks beside the page's other headings. Evidence: app 6/6 rail card headings in the examples are noun phrases of 1 to 3 words (`rg -n "<RailCard\b" docs/system/examples`); person D11. Check: lint copy/casing on the heading slot (scripts/copy-check.mjs); review.
  - Don't: `<RailCard id="rail-saved" heading="Here are the things you saved for later">`
  - Do: `<RailCard id="rail-saved" heading="Saved">`

### Anti-slop
- `rule/page-columns-rail-has-no-box`: When the rail needs to look like a rail, leave the `aside` as it is, transparent with its cards on the page tint, instead of giving it a `bg-*`, a `border-l` or a `shadow-*` through `className`, because the rail cards already draw the surfaces and a box around them draws the same edge twice (D11). Evidence: person D11; app 4/4 example pages pass no `className` to PageColumns (`rg -n -A1 "<PageColumns" docs/system/examples`). Check: lint rule/component-override on PageColumns (scripts/check-system.mjs); review.
  - Don't: `<PageColumns className="[&>aside]:border-l [&>aside]:pl-6" rail={rail}>`
  - Do: `<PageColumns rail={rail}>`
- `rule/page-columns-no-sticky-override`: When the rail must stay in view, leave its sticky position and its `--page-top` offset as they are, setting `--page-top` on an ancestor when the header is another height, instead of a `sticky`, `fixed` or `top-*` on the rail's content or on a wrapper around PageColumns, because the 96px default is the header's height, the same offset Section's `scroll-mt-24` uses, and a second sticky offset puts the rail under the header or leaves a gap. Evidence: principle heuristic: consistency and standards, one offset for the header on every page; app 4/4 example rails pass no position class to their cards (`rg -n "sticky|fixed|top-" docs/system/examples/page-layout docs/system/examples/blocks/record.tsx docs/system/examples/blocks/filing-alerts.tsx`). Check: lint rule/component-override on RailCard and PageColumns (scripts/check-system.mjs); review.
  - Don't: `<PageColumns rail={<div className="sticky top-4"><RailCard id="rail-saved" heading="Saved">…</RailCard></div>}>`
  - Do: `<PageColumns rail={<RailCard id="rail-saved" heading="Saved">…</RailCard>}>`
- `rule/section-no-rule-under-heading`: When a section needs to be told apart from the one above it, leave the 40px of the main column's gap to do it, instead of a divider, a `border-b` on the heading row or a `border-t` on the section, because the owner's rule is no divider lines where spacing works and no border under a header (D11). Evidence: person D11; app 22/22 sections in the examples pass no `border-*` class (`rg -n "<Section" docs/system/examples`). Check: lint rule/component-override on Section (scripts/check-system.mjs); review.
  - Don't: `<Section id="notes" heading="Notes" className="border-t pt-6">`
  - Do: `<Section id="notes" heading="Notes">`
- `rule/section-no-eyebrow-or-subtitle`: When a section's heading needs context, put it in the first line of the content at `text-sm text-muted-foreground`, instead of a label in capitals above the heading or a second heading-sized line under it, because a label in capitals is banned (D11) and the heading row has one `h2`. Evidence: person D11; app 22/22 sections in the examples take a plain string `heading` with no label in capitals above it (`rg -n "uppercase" docs/system/examples` finds none). Check: lint rule/ban-uppercase (scripts/check-system.mjs); lint, `heading` is a string so a node fails the typecheck.
  - Don't: `<div><p className="text-xs uppercase tracking-wide">THIS WEEK</p><Section id="events" heading="Events">…</Section></div>`
  - Do: `<Section id="events" heading="This week"><p className="text-sm text-muted-foreground">Three events, two replies waiting.</p>…</Section>`
- `rule/rail-card-flat`: When a rail card needs to stand out, leave it as it is, the card colour on the page tint, instead of adding `border`, `shadow-*` or `ring-1` through `className`, because a card is flat (D11) and the rail card's one job is to look the same on every page. Evidence: person D11; measured 0px border and no shadow on the rendered rail card, .design-system/evidence/rail-card/surface-and-heading-1280.json; app 0/6 rail cards in the examples pass a `className` at all (`rg -n "<RailCard\b" docs/system/examples`). Check: lint rule/component-override on RailCard (scripts/check-system.mjs); probe `flatSurfaces` in probe.mjs.
  - Don't: `<RailCard id="rail-saved" heading="Saved" className="border shadow-md">`
  - Do: `<RailCard id="rail-saved" heading="Saved">`
- `rule/rail-card-no-second-heading-size`: When a rail card's heading needs more weight or a different size, leave the `heading` string as it is, 16px at weight 600, instead of passing a styled node or a `text-lg` class, because the rail has one heading size so that every page's rail reads as one set (D21), and `heading` is typed as a string for that reason. Evidence: person D21; app 6/6 rail card headings in the examples are plain strings (`rg -n "<RailCard\b" docs/system/examples`). Check: lint `heading: string` fails a node at typecheck; lint rule/component-override on RailCard (scripts/check-system.mjs).
  - Don't: `<RailCard id="rail-saved" heading={<span className="text-lg">Saved</span>}>`
  - Do: `<RailCard id="rail-saved" heading="Saved">`

### Limits
- `rule/page-columns-rail-height`: When the rail would run taller than 704px, which is 7 one-line rail cards at an 800px tall viewport, cut it to 6 cards or move a block into the main column as a Section, because a sticky rail taller than the viewport minus the 96px header hides its bottom until the page scrolls to the end. Evidence: measured rail height 768px at 7 cards against 704px of room at 1280 by 800, 656px at 6, .design-system/evidence/page-columns/columns-1280x800.json; app 4/4 example rails hold 2 cards or fewer. Check: probe `.design-system/scripts/measure-page.mjs` on the showcase at 1280 by 800.
  - Don't: `<PageColumns rail={<>{sevenBlocks.map((b) => <RailCard key={b.id} id={b.id} heading={b.heading}>{b.body}</RailCard>)}</>}>`
  - Do: `<PageColumns rail={<>{threeBlocks.map((b) => <RailCard key={b.id} id={b.id} heading={b.heading}>{b.body}</RailCard>)}</>}><Section id="more" heading="More">…</Section></PageColumns>`
- `rule/page-columns-prose-measure`: When the main column holds running text, give the text block `max-w-prose`, 65 characters, because the main column measures 56 characters of `text-sm` in the showcase's 888px shell at 1280 and computes to 87 in a full 72rem shell (744px at 8.55px per character, worked out from `--page`, `--gutter`, the 320px rail and the 40px gap, not measured on a page), past the 75 a reading line allows. Evidence: measured 56 characters at `text-sm` and 49 at `text-base` in a 480px main column at 1280, .design-system/evidence/page-columns/columns-1280x800.json; principle heuristic: trap/text-measure, 30 to 75 characters per line. Check: probe `.design-system/scripts/measure-page.mjs` on the showcase at 1280; review of running text in main columns.
  - Don't: `<Section id="about" heading="About"><p className="text-sm">{longParagraph}</p></Section>`
  - Do: `<Section id="about" heading="About"><p className="max-w-prose text-sm">{longParagraph}</p></Section>`
- `rule/section-heading-length`: When a heading sits beside an action and controls, keep it to 14 characters, and to 33 characters when neither slot is filled, because at 15 characters beside a 157px right-hand group, and at 34 alone, the heading wraps to a second line in the 310px column at 390. Evidence: measured wrap at 15 characters beside a link and two icon buttons, and at 34 with neither, in a 310px row at 390, .design-system/evidence/section/grow-heading-390.json; app 22/22 example headings are 18 characters or under, and the 6 beside controls 14 or under (`rg -n "<Section" docs/system/examples`). Check: probe `.design-system/scripts/measure-page.mjs` on the showcase at 390.
  - Don't: `<Section id="events" heading="Everything happening this week near you" action={seeAll} controls={arrows}>`
  - Do: `<Section id="events" heading="This week" action={seeAll} controls={arrows}>`
- `rule/rail-card-heading-length`: When a heading would run past 39 characters, shorten it, because at 40 characters it wraps to a second line in the 320px rail at 1280 and the card grows while the cards above and below keep one line. Evidence: measured wrap at 40 characters in a 288px heading column of a 320px card at 1280, .design-system/evidence/rail-card/surface-and-heading-1280-consistency.json; app 6/6 headings in the examples are 16 characters or under. Check: probe `.design-system/scripts/measure-page.mjs` on the showcase at 1280.
  - Don't: `<RailCard id="rail-following" heading="People you follow who posted something new this week">`
  - Do: `<RailCard id="rail-following" heading="People you follow">`

## Accessibility
Rests on a `div` for the main column and an `aside` for the rail (PageColumns), and on a `section` with `aria-labelledby` and an `h2` (Section, and RailCard through Card's `render`).

### Keyboard
| Key | Where focus is | Effect | Focus after | Checked by |
|---|---|---|---|---|
| Tab | before the page columns | reaches the first control in the main column, then the rail's, in document order, whatever the visual order on a phone | the first control in the main column | by hand |
| Tab | before a section | skips the heading and reaches the action, then the controls, then the first control in the content | the action, or the first control after it | by hand |
| Tab | before a rail card | skips the card and reaches the first control inside it, in document order | the first control inside, or the next control after the card | by hand |

### ARIA
| Part | Role | Accessible name from | States and properties | Announced | Checked by |
|---|---|---|---|---|---|
| PageColumns main column | none | none | none | nothing of its own; its sections are read in order | test |
| PageColumns rail | complementary | none; the rail cards inside name themselves | none | "complementary" when the reader lands on it; listed among the landmarks, and its rail cards as regions inside it | test |
| Section root | region | `aria-labelledby`, the heading | none | the heading and "region" when the reader lands on it; listed among the landmarks | test |
| Section heading | heading | its text | `aria-level` 2 | the text and "heading level 2" | test |
| Section action and controls | the host's: link, button, radiogroup | the host's | the host's | after the heading, before the content | by hand |
| RailCard root | region | `aria-labelledby`, the heading | none | the heading and "region" when the reader lands on it; listed among the landmarks | test |
| RailCard heading | heading | its text | `aria-level` 2 | the text and "heading level 2" | test |

With `railFirst`, the rail is drawn first on a phone but stays after the main column in the DOM, so focus and reading order run main column, then rail, while the eye meets the rail first: NEEDS REVIEW with a screen reader on a phone.

A section's heading is `--foreground` on `--background`, and a rail card's is `--card-foreground` on `--card`: contrast NEEDS REVIEW on the rendered page in both themes.

## Tokens
| Part | State | Token |
|---|---|---|
| PageColumns root | all | spacing step `gap-10`, stacked and side by side |
| PageColumns main column | all | spacing step `gap-10` |
| PageColumns rail | all | `w-80` side by side, `--page-top` (96px by default), spacing step `gap-4` |
| Section heading | all | `--foreground`; spacing steps `gap-4` and `scroll-mt-24` |
| Section right-hand group | all | spacing step `gap-3` |
| RailCard root | all | `--card`, `--card-foreground`, `--r-2xl`; `--card-spacing` from Card at `--spacing(4)` for the padding and the gap |

The width and the gutter come from the shell: `--page` and `--gutter` (`docs/system/layout.md`).

## Related
- Layout: the shell's width, gutter and breakpoints this sits inside.
- Card: the surface a rail card is, with its header, action and footer when a block needs them.
- Steps: the setup checklist in a rail card, under the bar that counts it.
- Empty: a page with one block in the middle, and what goes in a rail card with nothing to show.
- TextLink: the "See all" link in a section's `action`.
- Pagination: moves between pages of the list a section holds.
- ChartCard: a card with a chart's title, headline figure, change and note.
