//! Server-rendered HTML UI (maud; auto-escaped) plus SSE live events.
//!
//! Routes:
//! * `GET /healthz` — unauthenticated, body `ok`.
//! * `GET /login`, `POST /login`, `POST /logout`.
//! * `GET /` — dashboard ("Needs you" first, then running, then recent).
//! * `GET /tasks/new`, `POST /tasks` — new-task form + creation.
//! * `GET /tasks/:id` — task page (chat timeline + side panel + cards).
//! * `GET /tasks/:id/events` — SSE stream of the task's events.
//! * `GET /tasks/:id/timeline?after=` — fragment: new timeline events.
//! * `GET /tasks/:id/panel` — fragment: side panel (status, todos, budget…).
//! * `GET /tasks/:id/cards` — fragment: pending/review cards.
//! * `GET /fragments/dashboard` — fragment: dashboard sections + title.
//! * `GET /static/app.js`, `GET /static/app.css` — bundled assets.
//! * `POST /tasks/:id/messages` — inbox a user message (answer or steering).
//! * `POST /tasks/:id/stop` (alias `/cancel`) — park with work kept.
//! * `POST /tasks/:id/discard` — terminal discard.
//! * `POST /tasks/:id/retry`.
//! * `POST /tasks/:id/plan/approve`, `POST /tasks/:id/plan/changes`.
//! * `POST /tasks/:id/approve` — approve the review (push).
//!
//! All state-changing routes are POST and additionally require an `Origin`
//! header exactly equal to `AGENTD_PUBLIC_ORIGIN`. Auth is a session cookie
//! (HttpOnly; Secure; SameSite=Strict). Security headers (CSP self-only,
//! nosniff, no-referrer, frame-ancestors none) are attached to every
//! response.
//!
//! Rendering contract: every page is server-rendered maud (auto-escaped).
//! Agent-authored text goes through [`crate::markdown::render_markdown`]
//! (safe subset) or plain escaped text — never raw HTML. There is no inline
//! `