> This problem is paper-only - see explanation for the canonical React solution.
A robust `useLocalStorage(key, initial)` hook must:
1. Be SSR-safe (no `localStorage` access on the server).
2. Sync across tabs via the `storage` event.
3. Tolerate JSON parse errors (corrupt data -> fall back to initial).
**For the auto-grader:** implement `safeParse(raw, fallback)` that returns `JSON.parse(raw)` if it parses, otherwise `fallback`. `raw` may be `null` (no value stored), in which case return `fallback`.