Resolves the effective light/dark mode from (in priority order) an explicit mode, a dark/light
class on <html>/<body>, then the ThemeModeFallback (prefers-color-scheme when 'system').
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 (and media changes
when following the system) when no explicit mode is given.
Resolves the effective light/dark mode from (in priority order) an explicit
mode, adark/lightclass on<html>/<body>, then the ThemeModeFallback (prefers-color-schemewhen'system'). 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 (and media changes when following the system) when no explicitmodeis given.