User clicks "Login with Google"
→ AuthService: generate code_verifier + code_challenge (SHA256)
→ Start local HTTP listener on random port
→ Open browser: /v1/auth/login/google?redirect_uri=localhost:{port}&code_challenge=...
→ API: set apex_redirect cookie, redirect to Google
→ User authorizes → Google redirects to /v1/auth/callback/google
→ API: authenticate, find/create UserEntity, issue one-time code
→ Browser redirects to localhost:{port}/callback?code=...
→ AuthService: POST /v1/auth/exchange → JWT + refresh token
→ Store tokens in auth.dat → LoginCompleted event
→ ShellViewModel shows authenticated UI
User types message in Coach tab
→ AIService: POST /v1/ai/chat
body: { SessionContext: {track, lap times, insights, segment deltas},
Messages: [{role, content}, ...] }
→ AiController → AiService
→ Build system prompt ("You are ApexLab Coach...")
→ Call Claude Messages API (claude-sonnet-4-6, max 1024 tokens)
→ Return reply → display in Coach tab
→ User appends follow-up → full history sent each turn