{# Default theme-color is the warm light paper. The bootstrap script below swaps the value for dark before paint, and re-syncs whenever the resolved theme changes. #} {# Theme bootstrap — must run BEFORE tokens.css to avoid a flash-of-wrong-theme. Resolves the user's preference (localStorage 'agent-drop-theme' = 'light' | 'dark', else OS prefers-color-scheme) and writes data-theme on . tokens.css's [data-theme="dark"] block then takes effect on first paint. 'auto' (or no stored value) means follow the OS — and in that mode we listen to prefers-color-scheme changes so OS flips re-apply live without reload. Exposed on window.AgentDropTheme so the Appearance settings page can write a new preference and re-resolve from one place. #}