const defaults = { theme: 'dark', contrast: false, reducedMotion: false, largeTouch: false };
export const settingsService = {
  get: () => ({ ...defaults, ...JSON.parse(localStorage.getItem('limbforge-settings') || '{}') }),
  save(settings) { localStorage.setItem('limbforge-settings', JSON.stringify(settings)); document.documentElement.classList.toggle('dark', settings.theme === 'dark'); document.documentElement.classList.toggle('light', settings.theme === 'light'); document.documentElement.classList.toggle('high-contrast', settings.contrast); document.documentElement.classList.toggle('reduce-motion', settings.reducedMotion); document.documentElement.classList.toggle('large-touch', settings.largeTouch); },
  apply() { this.save(this.get()); },
};