(async () => {
	try {
		const prefsRes = await fetch('/api/preferences');
		if (prefsRes.ok) {
			const prefs = await prefsRes.json();
			if (prefs.language) toLangSelect.value = prefs.language;
			if (prefs.model) modelSelect.value = prefs.model;
		}
	} catch (e) {}
})();
