:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --bg-elevated: #ffffff;
  --bg-secondary: #f9f9fb;
  --surface: rgba(255,255,255,.96);
  --surface-subtle: #f2f2f7;
  --surface-selected: #eaf3ff;
  --text: #111114;
  --text-secondary: #6e6e73;
  --text-tertiary: #8e8e93;
  --separator: rgba(60,60,67,.16);
  --separator-strong: rgba(60,60,67,.28);
  --blue: #007aff;
  --blue-soft: #e8f2ff;
  --green: #34c759;
  --green-soft: #eaf8ee;
  --orange: #ff9500;
  --orange-soft: #fff3df;
  --red: #ff3b30;
  --red-soft: #fff0ef;
  --gray: #8e8e93;
  --shadow-float: 0 12px 34px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
  --radius-card: 18px;
  --radius-control: 13px;
  --nav-height: 74px;
  --dock-height: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --page-pad: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --bg-secondary: #111113;
    --surface: rgba(28,28,30,.96);
    --surface-subtle: #2c2c2e;
    --surface-selected: #102b49;
    --text: #f5f5f7;
    --text-secondary: #aeaeb2;
    --text-tertiary: #8e8e93;
    --separator: rgba(84,84,88,.55);
    --separator-strong: rgba(99,99,102,.72);
    --blue: #0a84ff;
    --blue-soft: #102b49;
    --green: #30d158;
    --green-soft: #10371b;
    --orange: #ff9f0a;
    --orange-soft: #3b2810;
    --red: #ff453a;
    --red-soft: #401b19;
    --shadow-float: 0 14px 38px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.36);
  }
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.secondary-text, .muted { color: var(--text-secondary); }
.small { font-size: 13px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: max(10px, env(safe-area-inset-top)) var(--page-pad) 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid transparent;
}
.app-header h1 { margin: 0; font-size: 32px; line-height: 1.05; letter-spacing: -.035em; font-weight: 760; }
.icon-button, .round-icon-button, .sync-icon-button {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; color: var(--blue); background: var(--surface-subtle);
}
.app-shell {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 10px var(--page-pad) calc(var(--nav-height) + var(--safe-bottom) + 28px);
  scroll-padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 28px);
}
.view { display: none; }
.view.active { display: block; animation: viewIn .18s ease-out; }
@keyframes viewIn { from { opacity: .45; transform: translateY(3px); } }
.page-intro { margin: 2px 0 18px; }
.page-intro h2 { margin: 0; font-size: 30px; letter-spacing: -.035em; }
.page-intro p { margin: 5px 0 0; color: var(--text-secondary); font-size: 15px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 24px 2px 10px; }
.section-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.context-label { display: block; color: var(--blue); font-size: 13px; font-weight: 650; }
.text-button { min-height: 44px; padding: 0 4px; border: 0; color: var(--blue); background: transparent; font-size: 15px; font-weight: 600; }

/* Accueil */
.today-card { margin-bottom: 14px; }
.today-session, .today-rest {
  position: relative; overflow: hidden; padding: 20px;
  border-radius: 24px; color: #fff;
  background: linear-gradient(145deg, #1677ff 0%, #0062d8 70%, #0050bc 100%);
  box-shadow: 0 12px 28px rgba(0,122,255,.22);
}
.today-rest { color: var(--text); background: var(--surface); box-shadow: none; border: 1px solid var(--separator); }
.today-session::after { content: ""; position: absolute; inset: auto -60px -90px auto; width: 190px; height: 190px; border-radius: 50%; background: rgba(255,255,255,.11); }
.today-label { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; font-size: 13px; font-weight: 650; opacity: .9; }
.today-label svg { width: 16px; height: 16px; }
.today-title-line { display: flex; align-items: center; gap: 10px; }
.today-title-line > span { font-size: 15px; font-weight: 700; }
.today-title-line small { padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 11px; }
.today-session h2, .today-rest h2 { margin: 7px 0 4px; font-size: 27px; letter-spacing: -.035em; }
.today-session p, .today-rest p { margin: 0; font-size: 15px; line-height: 1.42; opacity: .84; }
.today-meta { display: flex; flex-wrap: wrap; gap: 7px 13px; margin-top: 16px; font-size: 13px; opacity: .88; }
.today-session .primary-button { position: relative; z-index: 1; width: 100%; margin-top: 17px; color: var(--blue); background: #fff; box-shadow: none; }

.week-overview { padding: 17px 18px 14px; border: 1px solid var(--separator); border-radius: var(--radius-card); background: var(--surface); }
.week-overview-copy h2 { margin: 2px 0 3px; font-size: 22px; letter-spacing: -.025em; }
.week-overview-copy p { margin: 0; font-size: 14px; }
.week-overview-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 15px; }
.week-overview-stats div { min-width: 0; }
.week-overview-stats strong { display: block; font-size: 16px; white-space: nowrap; }
.week-overview-stats span { display: block; margin-top: 2px; color: var(--text-secondary); font-size: 10px; line-height: 1.15; }
.week-progress, .mini-progress, .progress-track { height: 4px; overflow: hidden; border-radius: 999px; background: var(--surface-subtle); }
.week-progress { margin-top: 13px; }
.week-progress span, .mini-progress span, .progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--blue); transition: width .25s ease; }

.weight-entry-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding: 13px 14px; border: 1px solid var(--separator); border-radius: var(--radius-card); background: var(--surface);
}
.weight-entry-copy { min-width: 0; display: flex; align-items: center; gap: 11px; }
.weight-entry-copy h3 { margin: 0; font-size: 16px; }
.weight-entry-copy p { margin: 2px 0 0; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.symbol-tile, .settings-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: var(--blue-soft); }
.symbol-tile svg { width: 20px; height: 20px; }
.compact-number-field, .inline-input { display: flex; align-items: center; gap: 4px; border-radius: 10px; background: var(--surface-subtle); }
.compact-number-field { min-width: 94px; padding: 0 10px; }
.compact-number-field input { width: 60px; height: 44px; padding: 0; border: 0; outline: 0; background: transparent; text-align: right; font-weight: 650; font-size: 17px; }
.compact-number-field span, .inline-input small { color: var(--text-secondary); font-size: 13px; }

.session-list { overflow: hidden; border: 1px solid var(--separator); border-radius: var(--radius-card); background: var(--surface); }
.session-card { width: 100%; display: block; padding: 0; border: 0; border-bottom: 1px solid var(--separator); background: transparent; text-align: left; }
.session-card:last-child { border-bottom: 0; }
.session-card-main { display: grid; grid-template-columns: 34px minmax(0,1fr) 26px; align-items: center; gap: 11px; padding: 13px 14px 8px; }
.session-index { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 14px; font-weight: 750; }
.session-index svg { width: 17px; height: 17px; }
.session-card.done .session-index { color: #fff; background: var(--green); }
.session-card.skipped .session-index { color: var(--red); background: var(--red-soft); }
.session-card-copy { min-width: 0; }
.session-day { margin: 0; color: var(--blue); font-size: 11px; font-weight: 650; }
.session-card-copy h3 { margin: 1px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 650; }
.session-card-go { color: var(--text-tertiary); }
.session-card-meta { display: flex; align-items: center; gap: 6px; padding: 0 14px 10px 59px; color: var(--text-secondary); font-size: 11px; white-space: nowrap; overflow: hidden; }
.session-card-meta span:last-child { overflow: hidden; text-overflow: ellipsis; }
.session-card .mini-progress { margin: 0 14px 0 59px; height: 2px; }

/* Mode séance */
body.session-mode .app-header, body.session-mode .bottom-nav, body.session-mode .resume-session { display: none !important; }
body.session-mode .app-shell { padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: calc(var(--dock-height) + var(--safe-bottom) + 22px); }
.session-topbar { display: flex; justify-content: space-between; margin-bottom: 7px; }
.round-icon-button { color: var(--blue); background: transparent; }
.session-compact-header { padding: 3px 2px 14px; }
.session-title-line { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.session-title-line h2 { margin: 2px 0 0; font-size: 30px; line-height: 1.08; letter-spacing: -.04em; }
.session-progress-value { color: var(--text-secondary); font-size: 15px; }
.session-compact-header > .secondary-text { margin: 6px 0 13px; font-size: 14px; }
.session-meta-row { display: flex; justify-content: space-between; margin-top: 6px; color: var(--text-secondary); font-size: 12px; }
.status-text { color: var(--blue); font-weight: 600; }
.session-input-strip { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.35fr); gap: 9px; margin-top: 13px; }
.session-input-strip > label, .session-input-strip > div { min-width: 0; padding: 10px 11px; border-radius: 14px; background: var(--surface); border: 1px solid var(--separator); }
.session-input-strip > label > span, .session-input-strip > div > span { display: block; margin-bottom: 7px; color: var(--text-secondary); font-size: 11px; }
.inline-input { width: fit-content; min-width: 88px; padding: 0 8px; }
.inline-input input { width: 54px; height: 34px; padding: 0; border: 0; outline: 0; background: transparent; text-align: right; font-size: 16px; font-weight: 650; }
 .compact-rating-row { min-width: 0; }
.compact-rating-row .rating-stepper { max-width: none; width: 100%; grid-template-columns: 36px minmax(54px,1fr) 36px; }
.compact-rating-row .rating-stepper button { height: 34px; }
.compact-rating-row .rating-stepper strong { font-size: 13px; }
.completion-meta { margin: 10px 0 0; color: var(--green); font-size: 13px; }

.exercise-list { display: grid; gap: 10px; }
.exercise-card { overflow: hidden; border: 1px solid var(--separator); border-radius: var(--radius-card); background: var(--surface); }
.exercise-card.completed { border-color: color-mix(in srgb, var(--green) 35%, var(--separator)); }
.exercise-card.has-issue { border-color: color-mix(in srgb, var(--orange) 40%, var(--separator)); }
.exercise-summary { width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; border: 0; background: transparent; text-align: left; }
.exercise-summary-copy { min-width: 0; }
.exercise-summary-copy h3 { margin: 0; font-size: 16px; font-weight: 650; }
.exercise-summary-copy p { margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); font-size: 12px; }
.exercise-state-icon { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: var(--text-tertiary); background: var(--surface-subtle); }
.exercise-card.completed .exercise-state-icon { color: #fff; background: var(--green); }
.exercise-chevron { display: grid; transition: transform .18s ease; }
.exercise-card.open .exercise-chevron { transform: rotate(180deg); }
.exercise-body { display: none; padding: 0 13px 14px; }
.exercise-card.open .exercise-body { display: block; animation: bodyIn .16s ease-out; }
@keyframes bodyIn { from { opacity: .3; transform: translateY(-3px); } }
.exercise-guidance { margin: 0 0 10px; border-top: 1px solid var(--separator); }
.exercise-guidance summary, .secondary-disclosure summary, .settings-disclosure summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; list-style: none; color: var(--blue); font-size: 14px; font-weight: 600; cursor: pointer; }
.exercise-guidance summary::-webkit-details-marker, .secondary-disclosure summary::-webkit-details-marker, .settings-disclosure summary::-webkit-details-marker { display: none; }
.guidance-content { padding: 0 0 11px; color: var(--text-secondary); font-size: 13px; line-height: 1.45; }
.guidance-content p { margin: 0 0 6px; }
.guidance-content p:last-child { margin-bottom: 0; }
.exercise-quick-actions { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 7px; }
.conform-button, .adjust-button, .more-button { min-height: 44px; border-radius: 12px; font-size: 14px; font-weight: 650; }
.conform-button { border: 0; color: #fff; background: var(--blue); }
.adjust-button { border: 1px solid var(--separator); color: var(--blue); background: var(--bg-elevated); }
.more-button { border: 1px solid var(--separator); background: var(--bg-elevated); font-size: 20px; letter-spacing: 2px; }
.issue-summary { margin-top: 9px; padding: 9px 10px; border-radius: 11px; color: var(--orange); background: var(--orange-soft); font-size: 12px; }
.exercise-rpe-panel, .sets-panel { margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--separator); }
.exercise-rpe-panel.hidden-panel, .sets-panel { display: none; }
.exercise-rpe-panel.open, .sets-panel.open { display: block; }
.panel-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-label-row span { font-size: 13px; font-weight: 600; }
.panel-label-row small { color: var(--text-secondary); font-size: 11px; }
.rpe-strip { display: flex; gap: 6px; overflow-x: auto; padding: 1px 0 4px; scrollbar-width: none; }
.rpe-strip::-webkit-scrollbar { display: none; }
.rpe-chip, .rating-button { min-width: 44px; height: 44px; display: grid; place-items: center; padding: 0 9px; border: 1px solid var(--separator); border-radius: 11px; color: var(--text-secondary); background: var(--bg-elevated); font-size: 13px; font-weight: 650; }
.rpe-chip.selected, .rating-button.selected { color: #fff; border-color: var(--blue); background: var(--blue); }
.rpe-other-button { min-width: 52px; }
.full-rpe-row { display: none; margin-top: 7px; }
.full-rpe-row.open { display: flex; }
.exercise-save-row { display: flex; gap: 8px; margin-top: 11px; }
.exercise-save-row .primary-button { flex: 1; }
.film-badge { display: inline-flex; align-items: center; gap: 5px; margin-top: 9px; color: var(--blue); font-size: 12px; }
.film-badge svg { width: 16px; height: 16px; }

.set-row { display: grid; grid-template-columns: 30px minmax(0,1fr) minmax(0,1fr) 44px; gap: 6px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--separator); }
.set-row:last-of-type { border-bottom: 0; }
.set-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--text-secondary); background: var(--surface-subtle); font-size: 12px; font-weight: 650; }
.set-row.checked .set-number { color: #fff; background: var(--green); }
.stepper { display: grid; grid-template-columns: 36px minmax(36px,1fr) 36px; align-items: center; overflow: hidden; border: 1px solid var(--separator); border-radius: 11px; background: var(--bg-elevated); }
.stepper button { height: 44px; border: 0; color: var(--blue); background: var(--surface-subtle); font-size: 20px; }
.stepper input { width: 100%; min-width: 0; height: 44px; padding: 0 2px; border: 0; outline: 0; background: transparent; text-align: center; font-size: 15px; font-weight: 650; }
.set-unit { display: block; margin-top: 2px; color: var(--text-tertiary); text-align: center; font-size: 9px; }
.set-check { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--separator); border-radius: 11px; color: var(--text-tertiary); background: var(--bg-elevated); }
.set-check.checked { color: #fff; border-color: var(--green); background: var(--green); }
.remove-set { display: none; }
.add-set { width: 100%; min-height: 44px; margin-top: 7px; border: 1px dashed var(--separator-strong); border-radius: 11px; color: var(--blue); background: transparent; font-size: 14px; font-weight: 600; }

/* Boutons */
.primary-button, .secondary-button, .danger-button, .list-action {
  min-height: 46px; padding: 0 15px; border-radius: 13px; font-weight: 650;
}
.primary-button { border: 0; color: #fff; background: var(--blue); }
.secondary-button { border: 1px solid var(--separator); color: var(--blue); background: var(--bg-elevated); }
.danger-button { border: 0; color: #fff; background: var(--red); }
.full-button { width: 100%; }
button:disabled { opacity: .45; cursor: default; }

/* Dock séance */
.training-dock {
  position: fixed; z-index: 45; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: calc(10px + var(--safe-bottom));
  min-height: var(--dock-height); display: grid; grid-template-columns: 48px minmax(92px,1fr) 58px 48px; align-items: center; gap: 5px; padding: 8px;
  border: 1px solid color-mix(in srgb, var(--separator) 70%, transparent); border-radius: 25px;
  background: color-mix(in srgb, var(--bg-elevated) 76%, transparent);
  box-shadow: var(--shadow-float); backdrop-filter: blur(26px) saturate(180%); -webkit-backdrop-filter: blur(26px) saturate(180%);
}
.dock-icon, .timer-main, .timer-add { min-height: 48px; border: 0; border-radius: 17px; background: transparent; }
.dock-icon { display: grid; place-items: center; color: var(--blue); }
.timer-main { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface-subtle); }
.timer-main strong { font-size: 17px; }
.timer-main small { color: var(--text-secondary); font-size: 10px; }
.timer-add { color: var(--blue); font-size: 13px; font-weight: 650; }
.complete-dock-button { grid-column: 2 / 5; min-height: 48px; border: 0; border-radius: 17px; color: #fff; background: var(--blue); font-size: 16px; font-weight: 650; }
.training-dock.ready { grid-template-columns: 48px 1fr; }
.training-dock.ready .timer-main, .training-dock.ready .timer-add, .training-dock.ready #nextExerciseBtn { display: none; }
.training-dock.ready .complete-dock-button { grid-column: 2; display: block !important; }

/* Navigation */
.bottom-nav {
  position: fixed; z-index: 40; left: 10px; right: 10px; bottom: calc(8px + var(--safe-bottom));
  height: var(--nav-height); display: grid; grid-template-columns: repeat(4,1fr); padding: 7px 6px;
  border: 1px solid color-mix(in srgb, var(--separator) 70%, transparent); border-radius: 24px;
  background: color-mix(in srgb, var(--bg-elevated) 76%, transparent); box-shadow: var(--shadow-float);
  backdrop-filter: blur(26px) saturate(180%); -webkit-backdrop-filter: blur(26px) saturate(180%);
}
.nav-item { min-width: 0; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 16px; color: var(--text-tertiary); background: transparent; }
.nav-item svg { width: 23px; height: 23px; }
.nav-item small { font-size: 10px; font-weight: 550; }
.nav-item.active { color: var(--blue); background: var(--blue-soft); }
.resume-session { position: fixed; z-index: 42; left: 18px; right: 18px; bottom: calc(var(--nav-height) + var(--safe-bottom) + 18px); min-height: 48px; border: 0; border-radius: 16px; color: #fff; background: var(--blue); box-shadow: var(--shadow-float); font-weight: 650; }
body.keyboard-open .bottom-nav, body.keyboard-open .resume-session { display: none !important; }
body.keyboard-open .app-shell { padding-bottom: 24px; }

/* Historique */
.segmented-control { display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-subtle); }
.segmented-control button { min-height: 36px; padding: 0 8px; border: 0; border-radius: 9px; color: var(--text-secondary); background: transparent; font-size: 13px; font-weight: 600; }
.segmented-control button.active { color: var(--text); background: var(--bg-elevated); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.history-segmented { margin-bottom: 14px; }
.compact-segmented { width: min(260px,100%); margin: 12px 0; }
.history-overview, .records-overview, .weight-history-overview { margin-bottom: 12px; }
.history-hero, .records-hero, .weight-history-hero { padding: 16px; border: 1px solid var(--separator); border-radius: var(--radius-card); background: var(--surface); }
.history-hero h3, .records-hero h3, .weight-history-hero h3 { margin: 0; font-size: 18px; }
.history-stats, .weight-history-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 13px; }
.history-stats div, .weight-history-stats div { min-width: 0; }
.history-stats strong, .weight-history-stats strong { display: block; font-size: 16px; }
.history-stats span, .weight-history-stats span { display: block; margin-top: 2px; color: var(--text-secondary); font-size: 10px; }
.history-list, .records-list, .weight-history-list { overflow: hidden; border: 1px solid var(--separator); border-radius: var(--radius-card); background: var(--surface); }
.history-card, .record-card, .weight-entry-card, .weight-month-group { border-bottom: 1px solid var(--separator); }
.history-card:last-child, .record-card:last-child, .weight-entry-card:last-child, .weight-month-group:last-child { border-bottom: 0; }
.history-card summary { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; list-style: none; cursor: pointer; }
.history-card summary::-webkit-details-marker { display: none; }
.history-card h3 { margin: 1px 0 0; font-size: 16px; }
.history-card p { margin: 2px 0 0; }
.history-body { padding: 12px 14px 14px; border-top: 1px solid var(--separator); }
.history-metrics { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin-bottom: 10px; }
.history-metrics div { padding: 10px; border-radius: 11px; background: var(--surface-subtle); }
.history-metrics strong { display: block; font-size: 15px; }
.history-metrics span { color: var(--text-secondary); font-size: 10px; }
.records-hero { display: flex; align-items: center; justify-content: space-between; }
.records-hero p { margin: 4px 0 0; color: var(--text-secondary); font-size: 13px; }
.records-medal { color: var(--orange); }
.record-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.record-copy { min-width: 0; }
.record-copy h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.record-copy p { margin: 3px 0 0; color: var(--text-secondary); font-size: 11px; }
.record-value { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 3px; text-align: right; }
.record-value strong { font-size: 18px; }
.record-value span { color: var(--text-secondary); font-size: 12px; }
.record-value small { grid-column: 1 / 3; color: var(--text-tertiary); font-size: 10px; }
.weight-history-title { display: flex; justify-content: space-between; gap: 12px; }
.weight-history-title p { margin: 4px 0 0; color: var(--text-secondary); font-size: 13px; }
.weight-scale-icon { color: var(--blue); }
.weight-chart-card { padding: 12px 10px 8px; border: 1px solid var(--separator); border-radius: var(--radius-card); background: var(--surface); }
.chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; padding: 0 4px 5px; color: var(--text-secondary); font-size: 11px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend small { margin-left: auto; }
.legend-dot.actual { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.legend-line.average { width: 14px; height: 2px; border-radius: 2px; background: var(--orange); }
.weight-chart { min-height: 170px; color: var(--blue); }
.weight-svg { width: 100%; height: auto; overflow: visible; }
.weight-grid-line { stroke: var(--separator); stroke-width: 1; }
.weight-chart-area { fill: url(#weightAreaGradient); color: var(--blue); }
.weight-chart-line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.weight-average-line { fill: none; stroke: var(--orange); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 4 4; }
.weight-chart-dot { fill: var(--blue); stroke: var(--bg-elevated); stroke-width: 1.5; }
.weight-chart-dot.latest { stroke-width: 2.5; }
.weight-value-pill { fill: var(--bg-elevated); stroke: var(--blue); stroke-width: 1; }
.weight-chart-value { fill: var(--text); font-size: 10px; font-weight: 650; }
.weight-chart-date { fill: var(--text-tertiary); font-size: 9px; }
.weight-chart-empty, .empty-state { padding: 24px 16px; color: var(--text-secondary); text-align: center; font-size: 14px; }
.weight-month-group > summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; list-style: none; cursor: pointer; font-size: 15px; font-weight: 650; }
.weight-month-group > summary::-webkit-details-marker { display: none; }
.weight-month-group > summary span { color: var(--text-secondary); font-size: 12px; font-weight: 500; }
.weight-month-body { border-top: 1px solid var(--separator); }
.weight-entry-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.weight-entry-date strong { display: block; font-size: 14px; }
.weight-delta { display: block; margin-top: 2px; font-size: 10px; }
.weight-delta.up { color: var(--orange); }
.weight-delta.down { color: var(--green); }
.weight-delta.neutral { color: var(--text-tertiary); }
.weight-entry-value strong { font-size: 17px; }
.weight-entry-value span { margin-left: 3px; color: var(--text-secondary); font-size: 11px; }

/* Bilan */
.review-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-bottom: 12px; }
.summary-tile { min-width: 0; padding: 11px 9px; border: 1px solid var(--separator); border-radius: 14px; background: var(--surface); }
.summary-tile strong { display: block; font-size: 16px; }
.summary-tile span { display: block; margin-top: 2px; color: var(--text-secondary); font-size: 9px; line-height: 1.15; }
.grouped-form, .settings-group { overflow: hidden; border: 1px solid var(--separator); border-radius: var(--radius-card); background: var(--surface); }
.review-question, .form-row, .textarea-row { padding: 12px 14px; border-bottom: 1px solid var(--separator); }
.review-question:last-child, .form-row:last-child, .textarea-row:last-child { border-bottom: 0; }
.review-question > span, .form-row > span, .textarea-row > span { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.rating-row { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.rating-row::-webkit-scrollbar { display: none; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-row > span { margin: 0; }
.form-row input { min-width: 0; width: 48%; height: 40px; padding: 0 10px; border: 0; border-radius: 10px; outline: 0; background: var(--surface-subtle); text-align: right; font-size: 16px; }
.textarea-row textarea { width: 100%; padding: 11px; border: 0; border-radius: 11px; outline: 0; color: var(--text); background: var(--surface-subtle); resize: vertical; font-size: 16px; }
.export-card { margin-top: 13px; padding: 17px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--separator); }
.export-card h3 { margin: 0; font-size: 19px; }
.export-card p { margin: 4px 0 14px; color: var(--text-secondary); font-size: 13px; }
.secondary-disclosure { margin-top: 8px; }
.list-action { width: 100%; border: 0; color: var(--blue); background: transparent; text-align: left; }
.report-preview { border-top: 1px solid var(--separator); }
.report-preview pre { max-height: 260px; overflow: auto; white-space: pre-wrap; color: var(--text-secondary); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }

/* Données */
.settings-group { margin-bottom: 13px; }
.settings-row { min-height: 58px; display: flex; align-items: center; gap: 11px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--separator); background: transparent; text-align: left; }
.settings-group > :last-child { border-bottom: 0; }
.settings-row-copy { min-width: 0; flex: 1; }
.settings-row-copy h3 { margin: 0; font-size: 15px; font-weight: 600; }
.settings-row-copy p { margin: 2px 0 0; color: var(--text-secondary); font-size: 11px; }
.sync-status-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--gray); }
.sync-status-dot.synced { background: var(--green); }
.sync-status-dot.syncing { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.sync-status-dot.pending { background: var(--orange); }
.sync-status-dot.error, .sync-status-dot.offline { background: var(--red); }
.sync-icon-button { margin-left: auto; background: transparent; }
.sync-icon-button.syncing svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.metadata-row { min-height: 48px; justify-content: space-between; color: var(--text-secondary); font-size: 12px; }
.metadata-row strong { color: var(--text); font-weight: 550; }
.settings-disclosure { border-bottom: 1px solid var(--separator); }
.settings-disclosure summary { padding: 0 14px; color: var(--blue); }
.settings-disclosure .list-action { border-top: 1px solid var(--separator); border-radius: 0; }
.import-main-action { width: 100%; }
.settings-icon.blue { color: #fff; background: var(--blue); }
.settings-icon svg { width: 19px; height: 19px; }
.row-chevron { width: 18px; height: 18px; color: var(--text-tertiary); }
.import-preview { margin: 10px; padding: 13px; border-radius: 13px; color: var(--text); background: var(--green-soft); font-size: 13px; }
.import-session-list { display: grid; gap: 5px; margin: 10px 0; }
.raw-import-disclosure { border-top: 1px solid var(--separator); }
.code-area { width: calc(100% - 28px); margin: 0 14px 10px; padding: 11px; border: 1px solid var(--separator); border-radius: 11px; outline: 0; color: var(--text); background: var(--surface-subtle); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; resize: vertical; }
.raw-import-disclosure .secondary-button { width: calc(100% - 28px); margin: 0 14px 14px; }
.settings-group-title { padding: 9px 14px 5px; color: var(--text-secondary); font-size: 11px; font-weight: 600; }
.list-button { width: 100%; justify-content: space-between; color: var(--text); }
.file-row { cursor: pointer; }
.file-row input { display: none; }
.version-label { margin: 18px 0 0; color: var(--text-tertiary); text-align: center; font-size: 11px; }

/* Dialogues / sheets */
.app-dialog { width: min(calc(100% - 28px), 520px); padding: 18px; border: 0; border-radius: 22px; color: var(--text); background: var(--bg-elevated); box-shadow: var(--shadow-float); }
.app-dialog::backdrop { background: rgba(0,0,0,.34); backdrop-filter: blur(2px); }
.sheet-dialog { width: min(100%, 680px); max-width: none; margin: auto 0 0; padding: 10px 16px calc(16px + var(--safe-bottom)); border-radius: 28px 28px 0 0; }
.sheet-dialog[open] { animation: sheetIn .2s ease-out; }
@keyframes sheetIn { from { transform: translateY(20px); opacity: .5; } }
.dialog-handle { width: 38px; height: 5px; margin: 0 auto 10px; border-radius: 999px; background: var(--separator-strong); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dialog-head h3 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.dialog-head p { margin: 3px 0 0; color: var(--text-secondary); font-size: 13px; }
.close-dialog { width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--text-secondary); background: var(--surface-subtle); font-size: 22px; }
.sheet-action-list { overflow: hidden; border-radius: 15px; background: var(--surface-subtle); }
.sheet-action-list button, .sheet-toggle-row { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border: 0; border-bottom: 1px solid var(--separator); background: transparent; text-align: left; font-size: 15px; }
.sheet-action-list > :last-child { border-bottom: 0; }
.sheet-toggle-row input { margin-left: auto; width: 20px; height: 20px; accent-color: var(--blue); }
.action-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #fff; font-size: 15px; font-weight: 700; }
.action-icon.warning { background: var(--orange); }
.action-icon.blue { background: var(--blue); }
.action-icon.gray { background: var(--gray); }
.action-icon.red { background: var(--red); }
.destructive-action { color: var(--red); }
.tag-selector { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.choice-chip { min-height: 44px; display: flex; align-items: center; justify-content: center; padding: 8px; border: 1px solid var(--separator); border-radius: 12px; background: var(--surface-subtle); text-align: center; font-size: 13px; }
.choice-chip input { display: none; }
.choice-chip:has(input:checked) { color: #fff; border-color: var(--blue); background: var(--blue); }
.conditional-fields { margin-top: 12px; padding: 12px; border-radius: 13px; background: var(--surface-subtle); }
.conditional-fields label { display: block; margin-bottom: 10px; }
.conditional-fields input[type="text"] { width: 100%; height: 44px; padding: 0 10px; border: 1px solid var(--separator); border-radius: 10px; color: var(--text); background: var(--bg-elevated); }
.inline-toggle { display: flex !important; align-items: center; gap: 8px; font-size: 13px; }
.inline-toggle input { width: 20px; height: 20px; accent-color: var(--blue); }
.finish-fields { overflow: hidden; margin-bottom: 13px; border: 1px solid var(--separator); border-radius: 15px; }
.sheet-rating-row { padding: 12px 14px; border-bottom: 1px solid var(--separator); }
.sheet-rating-row > span { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.sync-conflict-dialog { text-align: center; }
.sync-conflict-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 8px; border-radius: 16px; color: var(--orange); background: var(--orange-soft); }
.sync-conflict-actions { display: grid; gap: 8px; margin-top: 14px; }

.toast { position: fixed; z-index: 100; left: 50%; top: calc(14px + env(safe-area-inset-top)); max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 999px; color: #fff; background: rgba(20,20,22,.9); box-shadow: var(--shadow-float); opacity: 0; pointer-events: none; transform: translate(-50%,-10px); transition: .2s ease; font-size: 13px; font-weight: 600; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (min-width: 700px) {
  .bottom-nav { left: 50%; right: auto; width: 620px; transform: translateX(-50%); }
  .training-dock { left: 50%; right: auto; width: 620px; transform: translateX(-50%); }
}

@media (max-width: 390px) {
  :root { --page-pad: 13px; }
  .app-header h1 { font-size: 29px; }
  .today-session h2 { font-size: 25px; }
  .week-overview-stats { grid-template-columns: repeat(3,1fr); }
  .week-rpe-stat { display: none; }
  .review-summary { grid-template-columns: repeat(2,1fr); }
  .set-row { grid-template-columns: 28px minmax(0,1fr) minmax(0,1fr) 42px; gap: 4px; }
  .stepper { grid-template-columns: 32px minmax(30px,1fr) 32px; }
  .exercise-quick-actions { grid-template-columns: 1fr 1fr 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.history-month-label { padding: 10px 14px 5px; color: var(--text-secondary); background: var(--bg); font-size: 12px; font-weight: 600; }
.rating-stepper { display: grid; grid-template-columns: 44px minmax(74px,1fr) 44px; align-items: center; overflow: hidden; max-width: 190px; border: 1px solid var(--separator); border-radius: 12px; background: var(--bg-elevated); }
.rating-stepper button { height: 44px; border: 0; color: var(--blue); background: var(--surface-subtle); font-size: 20px; }
.rating-stepper strong { text-align: center; font-size: 15px; }
.field-label { display: block; margin-bottom: 7px; color: var(--text-secondary); font-size: 12px; font-weight: 600; }

.page-intro.compact-intro { margin-top: 0; }
.page-intro.compact-intro p { margin-top: 0; }
