Resolves the effective light/dark mode from (in priority order) an explicit mode, a dark/light
class on <html>/<body>, then prefers-color-scheme. Framework-neutral (DOM only) — lives here so
both the neutral @sheetxl/react layer and the MUI studio resolve the SAME preference the same way
(no drift). Re-resolves on class mutations + media changes when no explicit mode is given.
Resolves the effective light/dark mode from (in priority order) an explicit
mode, adark/lightclass on<html>/<body>, thenprefers-color-scheme. Framework-neutral (DOM only) — lives here so both the neutral@sheetxl/reactlayer and the MUI studio resolve the SAME preference the same way (no drift). Re-resolves on class mutations + media changes when no explicitmodeis given.