This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in node_modules/next/dist/docs/ before writing any code. Heed deprecation notices.
Read CONTEXT.md for the domain language, and docs/adr/ for decisions already settled.
Workspace state lives in one Zustand store (src/lib/workspace/store.ts). Its actions are events that update every coupled slice at once and guard their own transitions against mode — add behaviour there rather than putting state back into components.
Logic that can be pure is pure and tested: page operations (src/lib/pdf/pages.ts), output planning (src/lib/pdf/plan.ts), and the rotation maths (src/lib/pdf/geometry.ts). bun run test runs them.