## Project rules

- Pages call `src/api/*` only: thin HTTP functions for the V2 contract (`/api/v2`, cookie session, CSRF header, problem+json errors).
- There is no mock server. In development Vite proxies `/api` to the backend (`API_PROXY`, default http://127.0.0.1:4100).
- Permission keys live in `P` (`src/lib/roles.ts`). Page access by URL is in `src/lib/route-perms.ts`; add a rule when you add a page.
- Shared page blocks: `components/pbps/blocks.tsx` (View, Tbl, useAct, DecisionBox, SubNav, DownloadButton) and `form.tsx`.
- A route file exports only `Route`. `x.tsx` beside a folder `x/` becomes a layout: use `x/index.tsx`.
- App pages under `/p/$pid` are client-only (`ssr: false`).
