> For the complete documentation index, see [llms.txt](https://nytshift.gitbook.io/nytshift-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nytshift.gitbook.io/nytshift-docs/design-decisions-and-proposals/css-architecture.md).

# CSS architecture and reviewed exceptions

The canonical source inventory is `apps/web/app/styles.css`. `scripts/split-route-css.mjs` deterministically emits independently loaded base, landing, command-deck, terminal and identity sheets. The source file is retained as the reviewable migration ledger; it is not imported by the application.

Initial decoded CSS budgets are 180,000 bytes per route. Terminal and identity interaction-only selectors are deferred until the first pointer or keyboard interaction. `pnpm css:check` rejects stale generated sheets, and the browser performance gate records actual route bytes separately.

## Breakpoint names

CSS custom properties cannot be used in media-query conditions, so reviewed numeric conditions are named here and enforced as an allowlist:

|   Width | Name            | Use                                     |
| ------: | --------------- | --------------------------------------- |
|   380px | micro           | exceptionally narrow phones             |
|   520px | compact-sheet   | dense sheets and emergency controls     |
|   600px | compact-card    | small command-deck cards                |
|   650px | mobile          | primary terminal and landing transition |
|   680px | customer-stack  | customer route cards                    |
|   720px | sheet           | wide mobile sheets                      |
|   760px | command-mobile  | command deck navigation and panels      |
|   820px | dossier-stack   | dossier and trust sections              |
|   900px | workspace-stack | chart and workspace toolbars            |
|   980px | tablet          | terminal rail/workspace transition      |
| 1,100px | command-desktop | command deck wide layout                |
| 1,180px | laptop          | landing and terminal laptop layout      |
| 1,360px | dense-desktop   | terminal density adjustment             |
| 1,440px | wide-desktop    | advanced-chart chrome                   |

New breakpoints require a named use case and visual evidence at the adjacent existing widths.

## `!important` exception policy

`!important` is permitted only for these reviewed categories:

* focus-visible and screen-reader-only accessibility utilities;
* reduced-motion guarantees that must override authored animation;
* operational typography and 44px mobile target floors that override legacy component shorthand;
* semantic positive, warning and negative status utilities;
* third-party/advanced-chart chrome visibility and containment overrides;
* legacy terminal error/readability corrections pending component-local CSS migration.

Generated-file occurrence ceilings are frozen in `route-css.test.ts`. They prevent silent growth; reducing a ceiling is always allowed. Adding an occurrence requires moving the rule into one of the categories above, documenting why normal cascade order is insufficient and reviewing affected desktop/mobile screenshots.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://nytshift.gitbook.io/nytshift-docs/design-decisions-and-proposals/css-architecture.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
