/* élan. — identité : salle de sport la nuit. Noir profond, vert électrique, chiffres énormes. */

:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', Roboto, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, 'Segoe UI', Roboto, sans-serif;
  --radius: 22px;
  --radius-s: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b0b0e;
  --bg-glow: rgba(215, 255, 58, .07);
  --surface: #151519;
  --surface-2: #1e1e24;
  --surface-3: #2a2a32;
  --line: #2a2a31;
  --text: #f4f2ec;
  --muted: #9b99a4;
  --quiet: #6d6b76;
  --accent: #d7ff3a;
  --accent-ink: #0b0b0e;
  --accent-text: #d7ff3a;
  --accent-soft: rgba(215, 255, 58, .12);
  --hot: #ff7a3d;
  --hot-soft: rgba(255, 122, 61, .14);
  --info: #8fb8ff;
  --danger: #ff5c5c;
  --fig: #ece9e1;
  --fig-far: #7d7b85;
  --fig-focus: #d7ff3a;
  --fig-focus-far: #8aa41f;
  --plate: #2e2e36;
  --plate-line: #5a5a66;
  --metal: #c3c6ce;
  --furn: #26262e;
  --furn-soft: #32323c;
  --furn-wall: #1a1a20;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f2ec;
  --bg-glow: rgba(120, 160, 0, .08);
  --surface: #ffffff;
  --surface-2: #ebeae3;
  --surface-3: #dddbd2;
  --line: #e0ded5;
  --text: #121216;
  --muted: #615f6a;
  --quiet: #8a8893;
  --accent: #d0f53a;
  --accent-ink: #0b0b0e;
  --accent-text: #4d6a00;
  --accent-soft: rgba(150, 200, 0, .16);
  --hot: #d9531c;
  --hot-soft: rgba(217, 83, 28, .12);
  --info: #2f5fb8;
  --danger: #c62828;
  --fig: #2a2a31;
  --fig-far: #a3a1aa;
  --fig-focus: #7fa800;
  --fig-focus-far: #b7d36a;
  --plate: #3a3a42;
  --plate-line: #1c1c22;
  --metal: #8c9099;
  --furn: #d6d3c8;
  --furn-soft: #c8c5b9;
  --furn-wall: #e4e2da;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 400 16px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { opacity: .4; cursor: default; }
a, label { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.icon { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
.icon.gold { color: var(--hot); width: 1em; height: 1em; }
.icon.up { color: var(--accent-text); }
.icon.down { color: var(--info); }

/* ---------- Typo et briques ---------- */
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; margin-top: 10px; }
.lead { color: var(--muted); margin: 6px 0 4px; }
.page-title { font: 800 34px/1.05 var(--font-display); letter-spacing: -.035em; margin: 4px 0 14px; }
.h2 { display: flex; align-items: center; gap: 10px; font: 750 19px/1.2 var(--font-display); letter-spacing: -.02em; margin: 26px 0 12px; }
.card { display: block; background: var(--surface); border-radius: var(--radius); padding: 18px; margin-top: 14px; }
.card-title { font: 750 17px/1.25 var(--font-display); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.badge {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 11px;
  background: var(--accent); color: var(--accent-ink); font: 900 18px/1 var(--font-display);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px;
  border-radius: 16px; background: var(--surface-2); color: var(--text); font-weight: 650; font-size: 16px;
  transition: transform .15s var(--ease), background .2s;
}
.btn:active, .btn.pressed { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.xl { width: 100%; min-height: 66px; border-radius: 20px; font-size: 19px; letter-spacing: -.01em; }
.btn.go { box-shadow: 0 10px 40px -10px var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }
.icon-btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--surface-2); font-size: 20px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 14px; padding: 10px 4px; }
.link-btn.danger { color: var(--danger); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -18px; padding-inline: 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 10px 14px; border-radius: 999px; background: var(--surface); color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); }
.seg-ctl { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface-2); margin-top: 12px; }
.seg-ctl > * { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; border-radius: 12px; font-weight: 650; color: var(--muted); font-size: 15px; text-align: center; }
.seg-ctl > .on { background: var(--surface); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.seg-ctl.wide { margin: 0 0 6px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-s); background: var(--surface); font-size: 15px; margin-top: 12px; }
.note .icon { margin-top: 1px; }
.note small { color: var(--muted); }
.note.up { background: var(--accent-soft); }
.note.up .icon { color: var(--accent-text); }
.note.down { background: color-mix(in srgb, var(--info) 14%, transparent); }
.note.down .icon { color: var(--info); }
.note.info .icon { color: var(--muted); }
.warning { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-s); background: var(--hot-soft); color: var(--hot); font-weight: 650; font-size: 15px; margin-top: 12px; }
.safety { color: var(--quiet); font-size: 13px; margin: 26px 8px 8px; text-align: center; }
.safety .icon { width: 1.05em; height: 1.05em; margin-right: 4px; vertical-align: -.15em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin-top: 14px; }
.tile { background: var(--surface-2); border-radius: var(--radius-s); padding: 14px; }
.card .tile { background: var(--surface-2); }
.tile strong { display: block; font: 800 24px/1.1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile strong small { font-size: 14px; margin-left: 2px; color: var(--muted); }
.tile span { font-size: 13px; color: var(--muted); }
.empty-state { display: grid; place-items: center; gap: 12px; text-align: center; color: var(--muted); padding: 60px 20px; }
.empty-state .icon { width: 40px; height: 40px; color: var(--quiet); }
.empty-state.small { padding: 30px 10px; }
.switch { width: 58px; height: 34px; border-radius: 999px; background: var(--surface-3); position: relative; flex: none; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.switch.on { background: var(--accent); }
.switch.on i { transform: translateX(24px); }

/* ---------- Coquille ---------- */
.shell { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-top) + 6px) 18px calc(96px + var(--safe-bottom)); }
.app-top { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { display: flex; align-items: center; gap: 8px; font: 850 24px/1 var(--font-display); letter-spacing: -.05em; }
.brand i, .auth-title i { color: var(--accent-text); font-style: normal; }
.logo .logo-a { fill: var(--accent); opacity: .45; }
.logo .logo-b { fill: var(--accent); opacity: .72; }
.logo .logo-c { fill: var(--accent); }
.sync { width: 9px; height: 9px; border-radius: 50%; background: var(--quiet); display: inline-block; transition: background .3s; }
.sync.synced { background: #4ade80; }
.sync.pending, .sync.saving { background: var(--hot); }
.sync.saving { animation: blink 1s infinite; }
.sync.offline { background: var(--quiet); }
.sync.auth { background: var(--danger); }
@keyframes blink { 50% { opacity: .3; } }
.page { outline: none; }
.tabbar {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 2px;
  padding: 8px 10px calc(8px + var(--safe-bottom)); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line);
}
.tab { flex: 1; max-width: 130px; display: grid; justify-items: center; gap: 3px; padding: 6px 0; border-radius: 14px; color: var(--quiet); font-size: 11px; font-weight: 650; }
.tab .icon { width: 25px; height: 25px; }
.tab.on { color: var(--text); }
.tab.on .icon { color: var(--accent-text); }

/* ---------- Accueil ---------- */
.hello { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-weight: 600; margin: 8px 0 14px; }
.hello span { font-size: 14px; color: var(--quiet); }
.hero {
  position: relative; overflow: hidden; border-radius: 28px; padding: 22px 18px 18px;
  background: radial-gradient(120% 80% at 100% 0%, var(--bg-glow), transparent 60%), var(--surface);
}
.hero-letter {
  position: absolute; top: -40px; right: -12px; font: 900 230px/1 var(--font-display); letter-spacing: -.08em;
  color: transparent; -webkit-text-stroke: 2px var(--accent); opacity: .22; pointer-events: none;
}
.hero-title { font: 850 44px/1 var(--font-display); letter-spacing: -.045em; margin-top: 6px; position: relative; }
.hero-sub { color: var(--muted); margin-top: 8px; font-size: 15px; position: relative; max-width: 80%; }
.hero-meta { color: var(--quiet); font-size: 14px; margin-top: 6px; }
.plan { margin: 18px 0 16px; display: grid; gap: 2px; }
.plan-row { display: flex; align-items: center; gap: 12px; padding: 6px 4px; border-radius: 14px; }
.plan-row:active { background: var(--surface-2); }
.thumb { width: 58px; height: 46px; flex: none; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.plan-name { flex: 1; min-width: 0; display: grid; }
.plan-name strong { font-weight: 650; font-size: 16px; line-height: 1.2; }
.plan-name small { color: var(--muted); font-size: 13px; }
.plan-load { font-weight: 750; font-variant-numeric: tabular-nums; font-size: 15px; text-align: right; max-width: 34%; line-height: 1.2; }
.plan-load.up { color: var(--accent-text); }
.regular { display: flex; justify-content: space-between; gap: 14px; align-items: stretch; }
.week { display: grid; gap: 8px; }
.week-dots { display: flex; gap: 8px; align-items: center; }
.week-dots i { width: 34px; height: 12px; border-radius: 6px; background: var(--surface-3); transition: background .3s; }
.week-dots i.on { background: var(--accent); }
.bonus { font-weight: 800; color: var(--accent-text); font-size: 14px; }
.week .muted { font-size: 14px; }
.streak { display: grid; justify-items: center; align-content: center; text-align: center; min-width: 96px; padding: 6px 10px; border-radius: 18px; background: var(--surface-2); color: var(--muted); }
.streak .icon { width: 24px; height: 24px; }
.streak strong { font: 850 34px/1 var(--font-display); color: var(--text); }
.streak span { font-size: 11px; line-height: 1.2; }
.streak.hot .icon { color: var(--hot); }
.last { display: flex; align-items: center; gap: 14px; }
.last-text { flex: 1; display: grid; gap: 2px; }
.last-text strong { font-size: 17px; }
.last-text small { color: var(--muted); }
.last.empty p { font-size: 14px; }

/* ---------- Personnage ---------- */
.fig-slot { position: relative; }
.fig-stage { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.figure { width: 100%; height: 100%; display: block; overflow: visible; }
.fig-pair { gap: 4px; }
.fig-pair figure { margin: 0; flex: 1; height: 100%; display: grid; grid-template-rows: 1fr auto; min-width: 0; }
.fig-pair figcaption { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.figure .seg { stroke-linecap: round; fill: none; }
.figure .outline { stroke: var(--outline, var(--bg)); stroke-linecap: round; }
.figure .outline-fill { fill: var(--outline, var(--bg)); }
.figure .seg.near { stroke: var(--fig); }
.figure .seg.far { stroke: var(--fig-far); }
.figure .seg.near.focus { stroke: var(--fig-focus); }
.figure .seg.far.focus { stroke: var(--fig-focus-far); }
.figure .joint.near, .figure .head { fill: var(--fig); }
.figure .joint.far { fill: var(--fig-far); }
.figure .joint.near.focus { fill: var(--fig-focus); }
.figure .eye { fill: var(--outline, var(--bg)); }
.figure .plate { fill: var(--plate); stroke: var(--plate-line); stroke-width: 1.3; }
.figure .plate-ring { fill: none; stroke: var(--plate-line); stroke-width: 1; opacity: .7; }
.figure .metal { fill: var(--metal); }
.figure .furn { fill: var(--furn); }
.figure .furn-soft { fill: var(--furn-soft); }
.figure .furn-wall { fill: var(--furn-wall); }
.figure .ground { stroke: var(--surface-3); stroke-width: 2; }
.figure .shadow { fill: #000; opacity: .18; }
.thumb, .card-fig, .warm-fig { --outline: var(--surface-2); }
.phase {
  position: absolute; left: 12px; top: 12px; z-index: 1; max-width: calc(100% - 80px);
  padding: 6px 11px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 650; color: var(--text);
}
.phase:empty { display: none; }

/* ---------- Mode séance ---------- */
body.in-session { background: var(--bg); }
.session { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-top) + 8px) 16px calc(24px + var(--safe-bottom)); min-height: 100dvh; }
.s-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: calc(var(--safe-top) + 6px) 0 10px; margin-top: calc(-1 * var(--safe-top) - 8px); background: var(--bg); }
.s-progress { flex: 1; display: flex; gap: 4px; }
.s-progress i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); transition: background .3s; }
.s-progress i.half { background: color-mix(in srgb, var(--accent) 40%, var(--surface-3)); }
.s-progress i.done { background: var(--accent); }
.s-progress i.now { background: var(--text); }
.s-clock { font: 700 16px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--muted); min-width: 48px; text-align: right; }
.s-body { padding-top: 4px; }
.s-title { font: 850 32px/1.05 var(--font-display); letter-spacing: -.04em; }
.s-title.huge { font-size: 52px; margin: 6px 0 4px; }
.s-stage {
  position: relative; height: min(40vh, 330px); min-height: 220px; margin: 4px -16px 12px; border-radius: 0 0 28px 28px;
  background: radial-gradient(70% 60% at 50% 70%, var(--bg-glow), transparent 70%), var(--surface);
  --outline: var(--surface);
}
.s-stage .stage-fig, .detail-stage .stage-fig { position: absolute; inset: 0; padding: 14px 10px 4px; }
.s-count { position: absolute; right: 14px; top: 12px; font: 850 28px/1 var(--font-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.s-count small { font-size: 16px; color: var(--muted); }
.s-head .muted { margin-top: 4px; font-size: 15px; }
.cues { display: grid; gap: 6px; margin-top: 14px; }
.cues li { position: relative; padding-left: 22px; font-size: 16px; font-weight: 550; line-height: 1.35; }
.cues li::before { content: ''; position: absolute; left: 4px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 14px; }
.level { display: grid; justify-items: center; gap: 2px; padding: 9px 2px; border-radius: 14px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 650; line-height: 1.15; text-align: center; min-height: 64px; }
.level b { font: 850 20px/1 var(--font-display); color: var(--text); }
.level.on { background: var(--accent); color: var(--accent-ink); }
.level.on b { color: var(--accent-ink); }
.alt-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 14px; border-radius: var(--radius-s); background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px; text-align: left; border: 1px dashed var(--surface-3); }
.metrics { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
.metric.goal { grid-template-columns: auto 1fr; align-items: center; column-gap: 14px; }
.metric.goal .kicker { grid-column: 1 / -1; }
.metric.goal .metric-num { font-size: 40px; }
.metric.load .metric-num { font-size: 52px; }
.metric.load .step-btn { width: 64px; height: 58px; border-radius: 18px; font-size: 24px; }
.metric { background: var(--surface); border-radius: var(--radius); padding: 14px 14px 12px; display: grid; align-content: start; gap: 6px; min-width: 0; }
.metric small { color: var(--muted); font-size: 13px; }
.metric-num { font: 850 44px/1 var(--font-display); letter-spacing: -.05em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-num small { font-size: 17px; font-weight: 700; letter-spacing: 0; margin-left: 3px; color: var(--muted); }
.metric-text { font: 800 21px/1.15 var(--font-display); letter-spacing: -.02em; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stepper .metric-num { text-align: center; flex: 1; }
.stepper.big { margin: 12px 0 4px; }
.stepper.big .metric-num { font-size: 52px; }
.step-btn { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 14px; background: var(--surface-2); font-size: 20px; }
.step-btn:active { background: var(--surface-3); transform: scale(.94); }
.set-area { margin-top: 16px; padding: 16px; border-radius: 26px; background: var(--surface); }
.set-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.set-no { font: 700 18px/1 var(--font-display); color: var(--muted); }
.set-no b { font-size: 30px; color: var(--text); letter-spacing: -.03em; }
.side-tag { padding: 8px 13px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 800; font-size: 15px; }
.done-sets { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.done-sets ul { display: flex; flex-wrap: wrap; gap: 6px; }
.done-sets li { display: flex; align-items: baseline; gap: 4px; padding: 7px 11px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }
.done-sets li small { font-weight: 600; color: var(--muted); }
.done-sets li em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--accent-text); }
.done-sets li.just { animation: pop .5s var(--ease); }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: none; opacity: 1; } }
.reps { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 7px; margin-bottom: 12px; }
.rep { min-height: 56px; border-radius: 15px; background: var(--surface-2); color: var(--quiet); font: 800 22px/1 var(--font-display); font-variant-numeric: tabular-nums; transition: transform .12s, background .15s; }
.rep.in { color: var(--text); }
.rep.on { background: var(--text); color: var(--bg); transform: scale(1.04); }
.rep:active { transform: scale(.92); }
.ex-done { display: flex; align-items: center; gap: 10px; color: var(--accent-text); font: 800 20px/1.2 var(--font-display); margin-bottom: 12px; }
.ex-done .icon { width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.ex-done.skipped { color: var(--muted); }
.ex-done.skipped .icon { background: var(--surface-3); color: var(--muted); }
.set-area .btn.ghost { width: 100%; margin-bottom: 8px; }
.chrono { position: relative; width: min(66vw, 240px); aspect-ratio: 1; margin: 4px auto 16px; }
.chrono svg, .rest-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.ring { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.chrono-val { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.chrono-val strong { font: 850 86px/1 var(--font-display); letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.chrono-val span { color: var(--muted); font-weight: 650; }
.chrono.counting .ring { stroke: var(--hot); }
.chrono.counting strong { color: var(--hot); }
.chrono.reached strong { color: var(--accent-text); }
.btn.stop { background: var(--text); color: var(--bg); }
.s-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.nav-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 52px; border-radius: 16px; background: var(--surface); color: var(--muted); font-weight: 650; font-size: 15px; }
.nav-btn:active { background: var(--surface-2); }
.s-cta { display: grid; gap: 8px; margin-top: 22px; }

.warm-list { display: grid; gap: 10px; margin-top: 18px; }
.warm-card { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 22px; background: var(--surface); transition: opacity .3s; }
.warm-card.done { opacity: .55; }
.warm-fig { width: 104px; height: 82px; flex: none; border-radius: 16px; background: var(--surface-2); overflow: hidden; }
.warm-text { flex: 1; display: grid; gap: 2px; justify-items: start; }
.warm-text strong { font-size: 16px; line-height: 1.2; }
.warm-text span { color: var(--muted); font-size: 14px; }
.warm-timer { font: 850 22px/1 var(--font-display); color: var(--hot) !important; margin-top: 4px; font-variant-numeric: tabular-nums; }
.chip-btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 8px 12px; border-radius: 999px; background: var(--surface-2); font-weight: 700; font-size: 14px; }
.check-btn { display: grid; place-items: center; width: 54px; height: 54px; flex: none; border-radius: 50%; border: 2px solid var(--surface-3); color: transparent; font-size: 22px; transition: all .2s var(--ease); }
.check-btn[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); animation: pop .4s var(--ease); }

.records { display: grid; gap: 8px; }
.records li { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--hot-soft); font-weight: 650; }
.records li .icon { color: var(--hot); width: 26px; height: 26px; }
.records li.pop { animation: pop .6s var(--ease) both; }
.records li.pop:nth-child(2) { animation-delay: .12s; }
.records li.pop:nth-child(3) { animation-delay: .24s; }
.records li.pop:nth-child(n+4) { animation-delay: .36s; }
.next-list { display: grid; gap: 2px; background: var(--surface); border-radius: var(--radius); padding: 6px 14px; }
.next-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.next-list li:last-child { border: 0; }
.next-list strong { display: flex; gap: 4px; align-items: center; font-variant-numeric: tabular-nums; white-space: nowrap; }

.rest {
  position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 14px;
  padding: calc(var(--safe-top) + 20px) 24px calc(var(--safe-bottom) + 24px);
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; } }
.rest-ring { position: relative; width: min(78vw, 320px); aspect-ratio: 1; }
.rest-ring .ring, .rest-ring .ring-bg { stroke-width: 7; }
.rest-ring strong { position: absolute; inset: 0; display: grid; place-items: center; font: 850 96px/1 var(--font-display); letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.rest-next { color: var(--muted); font-weight: 650; font-size: 17px; text-align: center; }
.rest-actions { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 10px; width: min(100%, 420px); margin-top: 8px; }
.rest-actions .btn { min-height: 64px; font-size: 17px; }
.rest-actions .btn.ghost { background: var(--surface); color: var(--text); }
body.flash::after { content: ''; position: fixed; inset: 0; z-index: 30; background: var(--accent); pointer-events: none; animation: flash .9s ease forwards; }
@keyframes flash { 0% { opacity: .55; } 100% { opacity: 0; } }

/* ---------- Historique ---------- */
.sessions { display: grid; gap: 8px; margin-top: 12px; }
.week-head { font-size: 13px; font-weight: 700; color: var(--quiet); text-transform: uppercase; letter-spacing: .1em; margin: 12px 0 0 4px; }
.session-card { background: var(--surface); border-radius: var(--radius); }
.session-card summary { display: flex; align-items: center; gap: 12px; padding: 14px; list-style: none; cursor: pointer; }
.session-card summary::-webkit-details-marker { display: none; }
.sc-text { flex: 1; display: grid; }
.sc-text small { color: var(--muted); }
.chev { color: var(--quiet); transition: transform .2s; }
.session-card[open] .chev { transform: rotate(90deg); }
.detail { display: grid; gap: 2px; padding: 0 14px 4px; }
.detail li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.detail li > div:first-child { display: grid; }
.detail li small { color: var(--muted); }
.detail .sets { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; align-content: center; max-width: 55%; }
.detail .sets span { padding: 3px 8px; border-radius: 8px; background: var(--surface-2); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.detail .sets em { font-style: normal; font-size: 10px; color: var(--muted); margin-right: 2px; }
.session-card .link-btn { margin: 0 10px 8px; }
.chart-card { padding: 16px 14px; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-base { stroke: var(--surface-3); stroke-width: 1.5; }
.c-axis { fill: var(--quiet); font-size: 10px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.c-line { fill: none; stroke: var(--fig-focus); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-area { fill: var(--accent-soft); }
.c-dot { fill: var(--fig-focus); stroke: var(--surface); stroke-width: 2; }
.c-bar { fill: color-mix(in srgb, var(--fig-focus) 55%, var(--surface)); }
.c-bar.last { fill: var(--fig-focus); }
.c-hit { fill: transparent; }
.c-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.c-cross.on { opacity: 1; }
.chart-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 700; white-space: nowrap; pointer-events: none; }

/* ---------- Bibliothèque ---------- */
.ex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ex-card, .warm-mini { display: grid; gap: 2px; padding: 8px 8px 12px; border-radius: var(--radius); background: var(--surface); height: 100%; }
.ex-card:active { transform: scale(.98); }
.card-fig { height: 108px; border-radius: 16px; background: var(--surface-2); margin-bottom: 8px; overflow: hidden; }
.ex-card strong, .warm-mini strong { font-size: 15px; line-height: 1.2; padding: 0 4px; }
.ex-card small, .warm-mini small { color: var(--muted); font-size: 13px; padding: 0 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 650; padding: 8px 0; }
.detail-stage { position: relative; height: min(38vh, 300px); min-height: 210px; border-radius: 26px; background: radial-gradient(70% 60% at 50% 70%, var(--bg-glow), transparent 70%), var(--surface); margin: 6px 0 16px; --outline: var(--surface); }
.target-line { margin-top: 8px; color: var(--muted); }
.target-line strong { color: var(--text); }
.plan-card .note { background: var(--surface-2); }
.plan-card .note.up { background: var(--accent-soft); }
.level-list { display: grid; gap: 6px; margin-top: 10px; }
.level-list li { display: flex; align-items: center; gap: 6px; border-radius: 16px; background: var(--surface-2); padding-right: 8px; }
.level-list li.current { outline: 2px solid var(--accent); }
.level-row { flex: 1; display: flex; align-items: center; gap: 12px; padding: 8px; text-align: left; }
.level-row[aria-pressed='true'] .thumb { outline: 2px solid var(--text); }
.level-row span { flex: 1; display: grid; }
.level-row small { color: var(--muted); font-size: 13px; }
.level-row em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--accent-text); white-space: nowrap; }
.level-list .thumb { --outline: var(--surface-3); background: var(--surface-3); }
.ladder { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ladder span { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--quiet); }
.ladder .past { color: var(--text); }
.ladder .on { background: var(--accent); color: var(--accent-ink); }
.mini-hist { display: grid; gap: 2px; background: var(--surface); border-radius: var(--radius); padding: 4px 14px; }
.mini-hist li { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.mini-hist li:last-child { border: 0; }
.mini-hist span, .mini-hist small { color: var(--muted); font-size: 14px; }
.mini-hist strong { font-variant-numeric: tabular-nums; }

/* ---------- Réglages ---------- */
.setting.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.setting .muted { font-size: 14px; margin-top: 4px; }
.setting .sync { margin-right: 4px; }

/* ---------- Connexion ---------- */
.auth { max-width: 420px; margin: 0 auto; min-height: 100dvh; display: grid; align-content: center; gap: 10px; padding: calc(var(--safe-top) + 30px) 24px calc(var(--safe-bottom) + 30px); }
.auth-mark .logo { width: 72px; height: 50px; }
.auth-title { font: 900 64px/1 var(--font-display); letter-spacing: -.06em; }
.auth-sub { color: var(--muted); font-size: 17px; margin-bottom: 22px; }
.login { display: grid; gap: 8px; }
.login label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-top: 8px; }
.login input { min-height: 56px; padding: 0 16px; border-radius: 16px; border: 2px solid transparent; background: var(--surface); font-size: 17px; outline: none; }
.login input:focus { border-color: var(--accent); }
.login-status { min-height: 22px; color: var(--danger); font-size: 15px; margin: 6px 0; }

/* ---------- Fenêtres ---------- */
dialog { border: 0; padding: 0; border-radius: 26px; background: var(--surface); color: var(--text); width: min(92vw, 420px); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); }
.confirm { padding: 22px; }
.confirm h2 { font: 800 21px/1.2 var(--font-display); }
.confirm p { color: var(--muted); margin-top: 8px; }
.notice {
  position: fixed; z-index: 40; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translate(-50%, 20px);
  padding: 14px 18px; border-radius: 16px; background: var(--text); color: var(--bg); font-weight: 700;
  opacity: 0; pointer-events: none; transition: all .3s var(--ease); width: max-content; max-width: 90vw; text-align: center;
}
.notice.visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 700px) {
  .ex-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Récup active et jour terminé ---------- */
.badge.r { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1.5px var(--accent); }
.hero.recovery .hero-letter { -webkit-text-stroke-width: 1.5px; opacity: .16; }
.hero-why { position: relative; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: 14px; line-height: 1.4; }
.hero.done .hero-title { display: flex; align-items: center; gap: 12px; }
.done-tick { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); animation: pop .5s var(--ease) both; }
.done-tick .icon { width: 24px; height: 24px; }
.hero.done .hero-sub { max-width: none; line-height: 1.5; }
.next-up { position: relative; display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px; border-radius: 18px; background: var(--surface-2); }
.next-up > span:last-child { display: grid; gap: 2px; min-width: 0; }
.next-up strong { font-size: 17px; }
.next-up small { color: var(--muted); font-size: 13px; }
.week-strip { display: flex; gap: 5px; }
.week-strip li { display: grid; justify-items: center; gap: 4px; }
.week-strip span { font-size: 11px; font-weight: 700; color: var(--quiet); }
.week-strip b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--surface-3); font: 850 13px/1 var(--font-display); color: transparent; }
.week-strip li.lift b { background: var(--accent); color: var(--accent-ink); }
.week-strip li.rec b { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1.5px var(--accent); }
.week-strip li.off b { opacity: .45; }
.week-strip li.today span { color: var(--text); }
.week-strip li.today b { outline: 2px solid var(--text); outline-offset: 2px; }
.streak small { margin-top: 4px; font-size: 10px; color: var(--quiet); }
.warm-text em { font-style: normal; color: var(--quiet); font-size: 13px; line-height: 1.35; }
.s-lead { margin-top: 8px; font-size: 15px; line-height: 1.45; }
.center { text-align: center; }
.small { font-size: 13px; }
.regular { position: relative; display: block; }
.regular .week { gap: 10px; }
.regular .streak { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 12px 6px 8px; border-radius: 999px; }
.regular .streak .icon { width: 18px; height: 18px; }
.regular .streak strong { font-size: 20px; }
.regular .streak span { font-size: 12px; font-weight: 650; }
.week-strip li { flex: 1; }
.week-strip b { width: 100%; max-width: 40px; height: 34px; border-radius: 10px; font-size: 14px; }
