# Echoes v22: missing states (6 December 2026) Every state the launch still lacked, in the v22 style, light and dark, 390 and 1440. **Apply order:** after every earlier zip on #2600, including thinking #6 (`4e548df0…`) and the quicker thinking zip that replaces it. This zip only **adds** files. It does not replace or edit any existing file, so it does not conflict with the scroll fix, the Explore merge, the signed-in header or any thinking zip, and it can go in before or after them. Rules kept: Geist only, no gold, flat ink buttons, no gradients or glow, no arrows in text buttons, no card or pill walls. Motion is transform and opacity only, 120–320ms, `cubic-bezier(.2,.8,.2,1)`. Press feedback on pointerdown, hover only on fine pointers, reduced motion = fades. ## Files (all new) | File | What it is | | --- | --- | | `site/v22/states/states.css` | Styles for every in-app state. All classes start `st-`, all tokens `--st-`. Safe to load after any v22 stylesheet. | | `site/v22/states/states.js` | `window.EchoesStates`: builds each state's markup, opens and closes sheets (focus trap, Esc, focus return), press feedback. No dependencies. | | `site/v22/500.html` | Server error page. | | `site/v22/maintenance.html` | Planned maintenance page. | | `site/v22/pro/welcome/index.html` | "You're Pro" landing after checkout. | | `site/v22/checkout/cancelled/index.html` | Checkout cancelled. | | `site/v22/signin/link/index.html` | Magic link expired (default) or already used (`?reason=used`). | The page files follow `/v22/404/` exactly (same head, header, footer, `acct.css`, `v20.css`, `system.css`), plus `states.css`. They carry `noindex`. ## Wiring in-app states Add to the pages that need them (chat, app, chats, signin, account), after the page's own CSS and scripts: ```html ``` ### a. Daily limit reached (guest on `/v22/chat/`, Free on `/v22/app/`) ```js EchoesStates.limit({ plan: 'guest', resetTime: '{resetTime}', log: document.querySelector('#in'), form: document.querySelector('#form') }); EchoesStates.limit({ plan: 'free', resetTime: '{resetTime}', limit: N /* optional daily count */, log: ..., form: ... }); ``` - Adds a quiet note at the end of the chat (`.st-cap`, `role="status"`): "You've reached today's limit / Your chat is saved. Messages reset at {resetTime}." The link under it reopens the sheet. - Locks the composer (`.st-locked`, textarea disabled, placeholder "Messages reset at {resetTime}"). `EchoesStates.unlock(form)` undoes it. - Opens the upgrade sheet (`role="dialog"`). Guest: **Create free account** / Sign in. Free: **Go Pro** / Not now. Kicker: "Every Echo stays free". No price, no reply-length promise; Pro is described only as "far more messages each day", matching Pricing. - `limit` is optional. Leave it out and the copy doesn't name a number. `open:false` adds the note and lock without the sheet. - Options: `startUrl`, `signinUrl`, `proUrl` (defaults `/v22/start/`, `/v22/signin/`, `/v22/pricing/`). ### b. Sign-in errors (code step of `/v22/signin/` and `/v22/start/`) ```js EchoesStates.authError('wrong', { left: 2 /* optional */ }); EchoesStates.authError('expired', { resend: fn /* optional, defaults to clicking #resend */ }); EchoesStates.authError('locked', { until: msEpoch /* or minutes: N */, onUnlock: fn }); EchoesStates.clearAuth(); ``` - Renders `` under the bubble. While retrying the button reads "Trying again". Hide the reply's tool row while it is cut. - Works on both chats (`.m.e > .col > .bub`). ### d. Empty states `EchoesStates.empty(kind, opts)` returns markup: | Kind | Where | Copy | Action | | --- | --- | --- | --- | | `chats` | `/v22/chats/` `#list` when there are no chats (hide `.tools-top` and `#foot`) | No chats yet / Your conversations will gather here. Pick an Echo and ask the first question. | Start a chat (`newUrl`, default `/v22/explore/`) | | `memory` | Memory sheet: replace `
  • Nothing remembered yet.
  • ` with `
  • ` + `empty('memory')` + `
  • ` | Nothing saved yet / Things you ask an Echo to remember appear here. You can add one yourself below. | The existing add field below | | `search` | `/v22/chats/` `#list` when a search finds nothing (`{query: q}`) | No chats match "{query}" / Try a shorter word, or the name of an Echo. | Clear search (`[data-st-clear]`, wire it to the existing clear button) | Each has a hairline geometric mark (no faces, no illustration). The search one has `role="status"` so the result is announced. ### e. Delete confirmations (`role="alertdialog"`) ```js EchoesStates.confirmDelete({ kind: 'chat', title: chat.title, run: fn }); EchoesStates.confirmDelete({ kind: 'account', run: fn }); ``` - Chat: "Delete this chat?" / "{title}" moves to Recently deleted. After 30 days it's deleted for good. **Delete chat** (danger fill) and Cancel. - Account: "Delete your account?" / This deletes your account, every chat, your saved memory and your plan. It can't be undone. Type DELETE to confirm; **Delete account** stays disabled until it matches. - Focus goes to the dialog, Tab is trapped, Esc and the scrim cancel, focus returns to the button that opened it. On phones the destructive button sits above Cancel; from 700px Cancel is left, Delete right. - The account page already has its own delete sheets (`#sh-dc`, `#sh-da`, `role="dialog"`). Either switch them to this call, or just change their `role` to `alertdialog`. ### f, g. Pages | Page | Placeholders | | --- | --- | | `/v22/pro/welcome/` | `{billing}` (e.g. Monthly), `{renewDate}`, `{email}` | | `/v22/checkout/cancelled/` | none | | `/v22/500.html` | none. Serve it with status 500. On Pages, `/v22/500.html` redirects to `/v22/500`, so fetch `/v22/500` if a Worker serves it. | | `/v22/maintenance.html` | `{time}`. Serve it with status 503 and `Retry-After`. Same redirect note: `/v22/maintenance`. | | `/v22/signin/link/` | `{minutes}` | Point the checkout success URL at `/v22/pro/welcome/` and the cancel URL at `/v22/checkout/cancelled/`. The "Try again" / "Check again" buttons on 500 and maintenance reload the page (a few lines of inline JS). ## States and preview links Preview: https://knvrt-states-preview.pages.dev/ (every state, light and dark, plus screenshots at 390 and 1440). The preview drives each state from `?state=`; that driver (`/states/demo.js`) is not in this zip. ## Checks - Only new files. All 512 files of the thinking #6 tree are byte-identical in the preview tree (sha256, file by file). - 12 existing pages (home, Explore, chat empty and with a turn, app, chats, sign-in, start, account, pricing, 404, help) pixel-diffed against the live thinking #6 preview at 390 and 1440, light and dark, reduced motion: 43 of 48 identical on the first pass. The other 5 were a few anti-aliased pixels from timing (Explore 1440, the app composer's + at 390, a start button edge). On a re-check the live page differed from itself in the same places, and the base and preview trees, which are byte-identical, also differed run to run. So it's timing, not a change. - Each state screenshotted at 390 and 1440, light and dark (80 shots). No console or page errors.