Fix dark mode not persisting across cached page navigations
The inline theme script in layout.edge only acted on first visit (no
cookie yet) and was a no-op when the cookie already existed. Pages
served from the browser cache (Cache-Control: public, max-age=60)
kept their stale server-rendered class, so toggling dark mode and
navigating back to a previously-visited tab lost the setting.
Now the script always reads the cookie and sets/removes the dark class
to match, running in <head> before paint so even cached responses are
corrected instantly.
Adds Playwright-based browser E2E tests (via @japa/browser-client)
that reproduce the bug: toggle dark on one profile tab, navigate to
another, navigate back, and assert the class survives.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>