export function millisecondsUntilNextLocalDay(now: Date): number { const next = new Date(now); next.setHours(24, 0, 0, 0); return Math.max(next.getTime() - now.getTime(), 1); }