# GPTPortal UI Redesign — "Precision Instrument" — Plan ## Context The frontend (`public/portal.html` + `public/setup.html`, vanilla JS, no build step) already has a token-based CSS layer (`chat.css`: teal accent, IBM Plex Sans, dual themes) but reads as clean-generic, and is undermined by debt: the model dropdown and several UI chunks are built in JS with hardcoded charcoal hexes (`cssText`) that break light mode and force ~66 `!important` defenses; three competing toast systems; shortcuts bound in three files; blocking `alert()`s; emoji-as-chrome in JS-generated content; a config-save flow that wipes `document.body` after shutting down the server. Outcome: a holistic redesign — OKLCH token system, modular type scale, distinctive visual identity, unified UX primitives — keeping the no-build vanilla stack and every existing feature (SSE streaming + thinking blocks, model search + operators, OpenRouter merge, prompt-cache toggle, voice, uploads, image gen, presets, compare, both editors, export, all shortcuts, both themes). ## Decisions - **Aesthetic**: "Precision instrument" cockpit; dark-first, both themes first-class. (User delegated taste in full.) - **Type**: Instrument Sans (UI) + Bricolage Grotesque (display) + JetBrains Mono (code AND data, `tabular-nums`); 1.2 modular scale as rem tokens. - **Color**: OKLCH rebuild; 4-step elevation ramp + hairline low-alpha borders; teal accent retained but retuned; per-provider hue tokens (openai/anthropic/google/mistral/meta/deepseek/xai/openrouter) used in model rows, avatars, chips, compare columns. - **Signature moves**: ⌘K command-palette model selector; floating pill composer with integrated context meter; role avatars; code-block header bars; display-font welcome hero; noise + glow atmosphere; SVG sprite replaces all emoji chrome. - **Behavioral UX fixes in scope**: restart overlay (poll `GET /model`, no body-wipe), kill `alert()`s, kill generated-image auto-download, honest deep-research progress. - **No build step introduced**; plain ``/`