// Bootstrap: apply persisted tweaks ASAP, then mount React tree.

(function applyInitialTweaks() {
  let saved = null;
  try {
    const raw = localStorage.getItem('dashboard-tweaks');
    if (raw) saved = JSON.parse(raw);
  } catch (e) {}
  const t = { ...(window.__TWEAKS__ || {}), ...(saved || {}) };
  document.body.dataset.theme = t.theme || 'luminous';
  document.body.dataset.accent = t.accent || 'green';
  document.body.dataset.animation = t.animation || 'max';
  document.body.dataset.grain = t.grain === false ? 'off' : 'on';
  document.body.dataset.ambient = t.ambient === false ? 'off' : 'on';
})();

function App() {
  return (
    <>
      <Dashboard />
      <TweaksPanel />
    </>
  );
}

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App />);
