/* Stride Coaching — Styles */
  /* ── Reset & Base ── */
  *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
  :root {
    --c-bg: #0f0f0f; --c-surface: #1a1a1a; --c-surface2: #242424; --c-border: #2a2a2a;
    --c-text: #e8e8e8; --c-text2: #999; --c-accent: #f97316; --c-accent2: #fb923c;
    --c-green: #22c55e; --c-red: #ef4444; --c-yellow: #eab308; --c-blue: #3b82f6;
    --radius: 12px; --radius-sm: 8px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  }
  body { font-family: var(--font); background: var(--c-bg); color: var(--c-text); min-height: 100dvh; }
  
  /* ── App Shell ── */
  #app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
  
  /* ── Header ── */
  .app-header { padding: 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--c-border); }
  .app-header h1 { font-size: 18px; font-weight: 700; }
  .app-header .icon-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--c-surface2); border: none; color: var(--c-text); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
  
  /* ── Views ── */
  .view { display: none; flex: 1; padding: 16px; overflow-y: auto; }
  .view.active { display: block; }
  
  /* ── Bottom Nav ── */
  .bottom-nav { display: flex; border-top: 1px solid var(--c-border); background: var(--c-surface); padding: 8px 0; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; color: var(--c-text2); font-size: 10px; font-family: var(--font); cursor: pointer; padding: 4px; }
  .bottom-nav button svg { width: 22px; height: 22px; }
  .bottom-nav button.active { color: var(--c-accent); }
  
  /* ── Cards ── */
  .card { background: var(--c-surface); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; border: 1px solid var(--c-border); }
  .card h3 { font-size: 15px; margin-bottom: 8px; }
  .card p { font-size: 13px; color: var(--c-text2); line-height: 1.5; }
  
  /* ── Form Elements ── */
  .form-group { margin-bottom: 16px; }
  .form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--c-text2); text-transform: uppercase; letter-spacing: 0.5px; }
  .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--c-surface2); border: 1px solid var(--c-border); color: var(--c-text); font-size: 15px; font-family: var(--font); }
  .form-group input:focus, .form-group select:focus { outline: none; border-color: var(--c-accent); }
  .form-group input::placeholder { color: #555; }
  .form-row { display: flex; gap: 8px; }
  .form-row > * { flex: 1; }
  
  /* ── Buttons ── */
  .btn { display: block; width: 100%; padding: 14px; border-radius: var(--radius-sm); border: none; font-size: 15px; font-weight: 600; font-family: var(--font); cursor: pointer; text-align: center; }
  .btn-primary { background: var(--c-accent); color: #000; }
  .btn-primary:hover { background: var(--c-accent2); }
  .btn-outline { background: transparent; border: 1px solid var(--c-border); color: var(--c-text); }
  .btn-ghost { background: transparent; color: var(--c-accent); }
  .btn-sm { padding: 8px 16px; font-size: 13px; width: auto; display: inline-block; }
  
  /* ── Choice Grid ── */
  .choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .choice-btn { padding: 14px; border-radius: var(--radius-sm); background: var(--c-surface2); border: 1px solid var(--c-border); color: var(--c-text); font-size: 14px; font-family: var(--font); cursor: pointer; text-align: center; }
  .choice-btn.selected { border-color: var(--c-accent); background: #1a1005; }
  
  /* ── Day Picker ── */
  .day-picker { display: flex; gap: 4px; flex-wrap: wrap; }
  .day-picker button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--c-border); background: var(--c-surface2); color: var(--c-text2); font-size: 12px; font-weight: 600; cursor: pointer; }
  .day-picker button.selected { background: var(--c-accent); color: #000; border-color: var(--c-accent); }

  .profile-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .profile-info-grid div { display: flex; flex-direction: column; gap: 2px; }
  .profile-info-grid div span:last-child { font-size: 16px; font-weight: 600; color: #fff; }
  
  /* ── Progress Steps ── */
  .steps { display: flex; gap: 8px; margin-bottom: 20px; }
  .steps .step { flex: 1; height: 3px; border-radius: 2px; background: var(--c-border); }
  .steps .step.done { background: var(--c-accent); }
  .steps .step.current { background: var(--c-accent); opacity: 0.5; }
  
  /* ── Session Card ── */
  .session-card { background: var(--c-surface); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; border-left: 3px solid var(--c-accent); }
  .session-card.rest { border-left-color: var(--c-green); }
  .session-card.qualite { border-left-color: var(--c-yellow); }
  .session-card.sl { border-left-color: var(--c-blue); }
  .session-card .type-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin-bottom: 4px; }
  .session-card h4 { font-size: 15px; margin-bottom: 4px; }
  .session-card .meta { font-size: 12px; color: var(--c-text2); }
  
  /* ── Dashboard ── */
  .next-session { background: linear-gradient(135deg, #1a1005, #0f0f0f); border: 1px solid var(--c-accent); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
  .coach-message { background: var(--c-surface); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; border: 1px solid var(--c-border); font-style: italic; font-size: 14px; line-height: 1.6; }
  .adaptation-banner { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 13px; line-height: 1.5; display: flex; align-items: center; gap: 10px; }
  .adaptation-banner.lighten { background: #1a0f00; border: 1px solid #ff9800; color: #ffcc80; }
  .adaptation-banner.harden { background: #001a0f; border: 1px solid #4caf50; color: #a5d6a7; }
  .feedback-bar { display: flex; gap: 8px; margin-bottom: 16px; }
  .feedback-bar button { flex: 1; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--c-border); background: var(--c-surface2); color: var(--c-text); font-size: 13px; font-family: var(--font); cursor: pointer; }
  
  /* ── Modal ── */
  .modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100; align-items: flex-end; justify-content: center; }
  .modal-overlay.active { display: flex; }
  .modal { background: var(--c-surface); border-radius: var(--radius) var(--radius) 0 0; width: 100%; max-width: 480px; max-height: 85dvh; overflow-y: auto; padding: 20px; }
  .modal h3 { margin-bottom: 16px; }
  
  /* ── RPE Slider ── */
  .rpe-slider { display: flex; gap: 4px; margin-bottom: 16px; }
  .rpe-slider button { flex: 1; padding: 10px 4px; border-radius: var(--radius-sm); border: 1px solid var(--c-border); background: var(--c-surface2); color: var(--c-text); font-size: 12px; cursor: pointer; }
  .rpe-slider button.selected { background: var(--c-accent); color: #000; border-color: var(--c-accent); }
  
  /* ── Pain Map ── */
  .body-map { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 16px; }
  .body-map .zone { padding: 8px 20px; border-radius: var(--radius-sm); border: 1px solid var(--c-border); background: var(--c-surface2); color: var(--c-text2); font-size: 12px; cursor: pointer; }
  .body-map .zone.selected { background: var(--c-red); color: #fff; border-color: var(--c-red); }
  
  /* ── Calendar Strip ── */
  .calendar-strip { display: flex; gap: 2px; overflow-x: auto; padding: 8px 0; margin-bottom: 16px; }
  .calendar-strip .day { min-width: 44px; text-align: center; padding: 8px 4px; border-radius: var(--radius-sm); font-size: 11px; }
  .calendar-strip .day.today { background: var(--c-accent); color: #000; font-weight: 700; }
  .calendar-strip .day.has-session { border: 1px solid var(--c-accent); }
  .calendar-strip .day-label { font-size: 10px; color: var(--c-text2); }
  
  /* ── Utils ── */
  .text-center { text-align: center; }
  .text-muted { color: var(--c-text2); font-size: 13px; }
  .mt-2 { margin-top: 8px; }
  .mt-4 { margin-top: 16px; }
  .mb-2 { margin-bottom: 8px; }
  .mb-4 { margin-bottom: 16px; }
  .gap-2 { gap: 8px; }
  .flex { display: flex; }
  .hidden { display: none !important; }
  
  /* ── Chrono Input ── */
  .chrono-input { display: inline-flex; align-items: center; gap: 2px; background: var(--c-surface2); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 4px 8px; width: 100%; }
  .chrono-input:focus-within { border-color: var(--c-accent); }
  .chrono-input input { width: 2.2ch; min-width: 2.2ch; padding: 8px 2px; background: transparent; border: none; color: var(--c-text); font-size: 15px; font-family: var(--font); text-align: center; -moz-appearance: textfield; }
  .chrono-input input::-webkit-outer-spin-button, .chrono-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .chrono-input input:focus { outline: none; }
  .chrono-input .ci-label { font-size: 13px; color: var(--c-text2); font-weight: 600; user-select: none; }
  .chrono-input .ci-ghost { opacity: 0.3; }
  
  /* ── Validation ── */
  .validation-msg { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 13px; line-height: 1.5; white-space: pre-line; }
  .validation-msg.warning { background: #1a1600; border: 1px solid var(--c-yellow); color: var(--c-yellow); }
  .validation-msg.error { background: #1a0005; border: 1px solid var(--c-red); color: var(--c-red); }
  .validation-msg.info { background: #0a1a20; border: 1px solid var(--c-blue); color: var(--c-blue); }
  .validation-msg .vm-title { font-weight: 700; margin-bottom: 2px; }

  /* ── Injury Banner ── */
  .injury-banner { background: linear-gradient(135deg, #1a0005, #1a0a05); border: 1px solid var(--c-red); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; display: none; }
  .injury-banner.active { display: block; }
  .injury-banner h4 { color: var(--c-red); font-size: 14px; margin-bottom: 4px; }
  .injury-banner p { font-size: 13px; color: var(--c-text2); margin: 0; }

  /* ── Choice Grid (extends form-group) ── */
  .choice-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
  .choice-grid .choice-btn { padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--c-border); background: var(--c-surface2); color: var(--c-text); font-size: 13px; font-family: var(--font); cursor: pointer; }
  .choice-grid .choice-btn.selected { background: var(--c-accent); color: #000; border-color: var(--c-accent); }
  .choice-grid .choice-btn.red-selected { background: var(--c-red); color: #fff; border-color: var(--c-red); }

  /* ── Coach Chat ── */
  #coach-messages { padding: 4px 0; }
  #coach-messages::-webkit-scrollbar { width: 4px; }
  #coach-messages::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 2px; }

  /* ── Auth Tabs ── */
  .auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--c-border); }
  .auth-tab { flex: 1; padding: 12px; text-align: center; font-size: 14px; font-weight: 600; color: var(--c-text2); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; }
  .auth-tab.active { color: var(--c-accent); border-bottom-color: var(--c-accent); }

  /* ── Password Strength ── */
  .pw-strength { display: flex; gap: 4px; margin-top: 8px; }
  .pw-strength .seg { flex: 1; height: 4px; border-radius: 2px; background: var(--c-border); transition: background 0.3s; }
  .pw-strength .seg.l0 { background: var(--c-red); }
  .pw-strength .seg.l1 { background: var(--c-red); }
  .pw-strength .seg.l2 { background: var(--c-yellow); }
  .pw-strength .seg.l3 { background: var(--c-accent); }
  .pw-strength .seg.l4 { background: var(--c-green); }
  .pw-label { font-size: 11px; margin-top: 4px; color: var(--c-text2); }
  .pw-label.weak { color: var(--c-red); }
  .pw-label.ok { color: var(--c-yellow); }
  .pw-label.good { color: var(--c-accent); }
  .pw-label.strong { color: var(--c-green); }

  /* ── Field Errors ── */
  .field-error { font-size: 12px; color: var(--c-red); margin-top: 4px; display: none; }
  .field-error.visible { display: block; }

  /* ── Auth Switch Link ── */
  .auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--c-text2); }
  .auth-switch a { color: var(--c-accent); cursor: pointer; text-decoration: none; }

  /* ── Planning Week / Day Cards ── */
  .week-card { background: var(--c-surface); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; border: 1px solid var(--c-border); }
  .week-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--c-border); }
  .week-header h3 { font-size: 14px; font-weight: 700; }
  .week-header .phase-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; background: var(--c-surface2); color: var(--c-text2); }
  .week-header .deload-badge { background: var(--c-green); color: #000; }
  .day-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); margin-bottom: 4px; cursor: pointer; transition: background 0.15s; }
  .day-card:hover { background: var(--c-surface2); }
  .day-card .day-label { width: 32px; font-size: 11px; color: var(--c-text2); text-transform: uppercase; }
  .day-card .day-type { font-size: 10px; padding: 2px 6px; border-radius: 6px; font-weight: 700; text-transform: uppercase; }
  .day-card .day-type.ef { background: #0a2e0a; color: var(--c-green); }
  .day-card .day-type.qualite { background: #2e1a00; color: var(--c-yellow); }
  .day-card .day-type.sl { background: #001a2e; color: var(--c-blue); }
  .day-card .day-info { flex: 1; }
  .day-card .day-name { font-size: 13px; font-weight: 600; }
  .day-card .day-meta { font-size: 11px; color: var(--c-text2); }
  .empty-plan { text-align: center; padding: 40px 20px; }
  .empty-plan h3 { margin-bottom: 8px; }
  .empty-plan p { color: var(--c-text2); margin-bottom: 16px; }

  /* ── Spinner ── */
  .spinner { width: 32px; height: 32px; border: 3px solid var(--c-border); border-top-color: var(--c-accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto; }
  @keyframes spin { to { transform: rotate(360deg); } }

