// Today — the morning briefing home screen // Synthesizes: weather + sleep + calendar + bills + approvals + recovery function TodayScreen({ go, openCapture, pullProgress = 0 }) { const d = LifeData; const w = d.weather; const h = d.health.today; const baseline = d.health.baseline; const sleepDelta = (h.sleep_hours - baseline.sleep_hours).toFixed(1); const sleepBelow = h.sleep_hours < baseline.sleep_hours; const today = d.today instanceof Date ? d.today : new Date(d.today); const dateStr = today.toLocaleDateString('en-US', { weekday: 'long', day: 'numeric', month: 'long' }); // Next event const nowMin = today.getHours() * 60 + today.getMinutes(); const toMin = (s) => parseInt(s.slice(0,2)) * 60 + parseInt(s.slice(3,5)); const next = d.calendar.find(e => toMin(e.time) >= nowMin) || d.calendar[0]; const minsToNext = next ? toMin(next.time) - nowMin : 0; const haveSleep = h.sleep_hours > 0; const haveHRV = h.hrv_ms > 0; const haveHealth = haveSleep || haveHRV; return (