--- id: S04 name: Gmail purpose: Connect Gmail so statements arrive without manual uploads size: 1280x800 --- ## Content and actions - Connection card: account, status, last sync result, "Sync now" (results appear in S03), "Disconnect" (confirm; already-fetched statements stay). - "What to fetch": Gmail label (default "statements"), sender domains (prefilled with the eight supported issuers), daily auto-sync toggle. - "Needs your attention": newly detected cards that need a profile chosen; once chosen, future statements for that card are filed automatically. ## States - Connected: `screen.html`. - Not connected: `states/not-connected.html`. "Connect Gmail" opens Google's consent screen (read-only scope), then returns here. - Syncing: "Sync now" becomes "Syncing… 2 of 5" with a progress text. Error: banner "Gmail sign-in expired. Reconnect" or "Gmail limit reached, will retry at 14:00". ## Notes and open questions - Read-only scope only. Fetched PDFs are cached on this machine. ## Change log - Initial design.