/* ================= Polices ================= */
@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url(/fonts/barlow-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url(/fonts/barlow-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url(/fonts/barlow-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-display: swap; src: url(/fonts/barlow-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(/fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url(/fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-display: swap; src: url(/fonts/barlow-condensed-latin-800-normal.woff2) format('woff2'); }

/* ================= Jetons ================= */
:root {
  color-scheme: dark;
  --bg: #0e0f11;
  --s1: #16171a;
  --s2: #1d1f23;
  --s3: #26282d;
  --line: #2a2c31;
  --line-2: #3a3d44;
  --t1: #efefef;
  --t2: #9c9c9c;
  --t3: #6b6e75;
  --acc: #d4ff3a;          /* craie fluo : accent d'interface */
  --acc-ink: #10130a;
  --acc-soft: rgba(212, 255, 58, .12);
  --up: #3ddc84;
  --down: #ff7a6b;
  --danger: #eb6263;
  --c1: #338ced; --c2: #e76624; --c3: #00a888;
  --r: 14px;
  --r-sm: 10px;
  --side: 232px;
  --tab: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--t1);
  font: 400 15px/1.45 var(--body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: .01em; line-height: 1.1; }
h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 800; text-transform: uppercase; }
h2 { font-size: 20px; text-transform: uppercase; letter-spacing: .03em; }
h3 { font-size: 20px; }
p { margin: 0; }
b { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--t2); }
.small { font-size: 13px; }
.up { color: var(--up); }
.down { color: var(--down); }
i.up, i.down { font-style: normal; font-weight: 600; }
.ico { width: 20px; height: 20px; flex: none; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; } .row.wrap, .wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: grid; gap: 10px; }
.mt { margin-top: 24px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--acc); color: var(--acc-ink); }

/* ================= Boutons & champs ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--s3); border: 1px solid var(--line-2); color: var(--t1);
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), background .15s, border-color .15s;
}
.btn:hover { background: #2f3238; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.btn.primary:hover { background: #e2ff6e; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--s2); }
.btn.danger { color: var(--danger); border-color: rgba(235, 98, 99, .35); }
.btn.danger:not(.ghost) { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.dashed { background: transparent; border: 1.5px dashed var(--line-2); color: var(--t2); min-height: 52px; border-radius: var(--r); }
.btn.dashed:hover { color: var(--t1); border-color: var(--t3); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: transparent; border: 0; color: var(--t2); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--s3); color: var(--t1); }
.icon-btn:disabled { opacity: .25; pointer-events: none; }
.icon-btn.lg { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 999px; }
.icon-btn.xs { width: 22px; height: 22px; border-radius: 6px; vertical-align: middle; }
.icon-btn.xs .ico { width: 14px; height: 14px; }
.link { color: var(--t2); display: inline-flex; align-items: center; gap: 4px; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; }
.link:hover { color: var(--acc); }
.link .ico { width: 16px; height: 16px; }

input:not([type]), input[type=text], input[type=number], input[type=password], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--bg); border: 1px solid var(--line-2); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
textarea { resize: vertical; min-height: 80px; }
input[type=number]::-webkit-inner-spin-button { opacity: .3; }
::placeholder { color: var(--t3); }
input[type=datetime-local]::-webkit-calendar-picker-indicator { filter: invert(.7); }
.form { display: grid; gap: 14px; }
.form.two { grid-template-columns: 1fr 1fr; }
.form .span2, .span2 { grid-column: 1 / -1; }
.form label, .label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--t2); }
.form label.check { display: flex; align-items: center; gap: 10px; align-self: end; min-height: 44px; }
.form label.check input { width: 20px; height: 20px; accent-color: var(--acc); }
.hint { font-weight: 400; color: var(--t3); font-size: 12px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 13px; font-weight: 600; color: var(--t2); margin-bottom: 8px; }

/* Segmenté */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line-2); }
.seg label { position: relative; cursor: pointer; display: block; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: grid; place-items: center; min-height: 40px; border-radius: 999px; font-weight: 600; color: var(--t2); transition: background .2s var(--ease), color .2s; }
.seg input:checked + span { background: var(--acc); color: var(--acc-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 2px; }

/* Ressenti */
.energy { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.energy legend { grid-column: 1 / -1; }
.energy label { position: relative; cursor: pointer; }
.energy input { position: absolute; opacity: 0; }
.energy span { display: grid; place-items: center; gap: 2px; min-height: 56px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-2); font: 700 20px var(--display); }
.energy span small { font: 500 11px var(--body); color: var(--t2); }
.energy input:checked + span { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.energy input:checked + span small { color: var(--acc-ink); }

/* Puces / interrupteur */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--t2); font-weight: 600; font-size: 13px; cursor: pointer; transition: all .15s; }
.chip:hover { color: var(--t1); }
.chip.on { background: var(--t1); color: var(--bg); border-color: var(--t1); }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--t2); cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 38px; height: 22px; border-radius: 999px; background: var(--s3); border: 1px solid var(--line-2); position: relative; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--t2); transition: transform .2s var(--ease), background .2s; }
.switch input:checked + span { background: var(--acc-soft); border-color: var(--acc); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--acc); }
.switch input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 2px; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--s3); color: var(--t1); white-space: nowrap; }
.tag .ico { width: 14px; height: 14px; }
.tag.accent { background: var(--acc-soft); color: var(--acc); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge.b1 { background: rgba(51, 140, 237, .16); color: #7fb5f3; }
.badge.b2 { background: rgba(231, 102, 36, .16); color: #f19a6a; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--t2); }
.eyebrow .ico { width: 15px; height: 15px; }

/* ================= Structure ================= */
#app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side); padding: 26px 16px; display: flex; flex-direction: column; gap: 28px;
  border-right: 1px solid var(--line); background: var(--bg); z-index: 20;
}
.brand { font: 800 34px/1 var(--display); letter-spacing: -.01em; padding: 0 12px; }
.brand i { color: var(--acc); font-style: normal; }
.brand.big { font-size: 72px; padding: 0; }
#side-nav { display: grid; gap: 2px; }
#side-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--t2); font-weight: 600; transition: background .15s, color .15s; }
#side-nav a:hover { background: var(--s1); color: var(--t1); }
#side-nav a.on { background: var(--s2); color: var(--t1); }
#side-nav a.on .ico { color: var(--acc); }
.side-foot { margin-top: auto; padding: 0 12px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 0 var(--acc); animation: pulse 1.6s infinite; margin-left: auto; }
.view { margin-left: var(--side); padding: 36px clamp(16px, 4vw, 48px) 80px; max-width: calc(var(--side) + 1180px); outline: none; }
.view.enter { animation: rise .35s var(--ease); }
.tabbar, .more-sheet { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head .eyebrow { margin-bottom: 8px; }
.page-head p.muted { margin-top: 8px; }

.grid { display: grid; gap: 16px; }
.grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; margin-top: 16px; }
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.card > h2 { margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head.wrap { flex-wrap: wrap; }
.card.empty { text-align: center; display: grid; gap: 14px; justify-items: center; padding: 40px 20px; }
.empty { text-align: center; padding: 60px 0; display: grid; gap: 14px; justify-items: center; }

/* Tuiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 4px; align-content: start; text-align: left; min-width: 0; }
.tile > b { font: 700 32px/1.05 var(--display); letter-spacing: .01em; }
.tile > b small { font: 600 15px var(--body); color: var(--t2); margin-left: 3px; }
button.tile { cursor: pointer; color: inherit; transition: border-color .15s, background .15s; }
button.tile:hover { border-color: var(--line-2); }
button.tile.on { border-color: var(--acc); background: var(--s2); }
.pips { display: flex; gap: 4px; margin-top: 6px; }
.pips i { flex: 1; height: 5px; border-radius: 3px; background: var(--s3); }
.pips i.on { background: var(--acc); }
.progress { height: 10px; border-radius: 999px; background: var(--s3); overflow: hidden; margin: 14px 0 8px; }
.progress i { display: block; height: 100%; background: var(--acc); border-radius: 999px; transition: width .6s var(--ease); }
.progress.thin { height: 5px; margin: 0; grid-column: 1 / -1; }

/* ================= Accueil ================= */
.dash { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.dash .span2 { grid-column: 1 / -1; }
.dash .tiles { grid-template-columns: repeat(2, 1fr); }
.hero-weight { display: grid; gap: 6px; position: relative; overflow: hidden; transition: border-color .15s; }
.hero-weight:hover, a.card:hover { border-color: var(--line-2); }
.hero-num { font: 800 84px/0.95 var(--display); letter-spacing: -.01em; }
.hero-num small { font: 700 26px var(--display); color: var(--t2); margin-left: 6px; }
.hero-sub { display: flex; gap: 6px; flex-wrap: wrap; font-weight: 600; }
.hero-spark { margin: 8px 0 2px; }
.hero-spark svg { width: 100%; height: 56px; }
.cta { display: grid; gap: 10px; align-content: start; position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 100% 0%, rgba(212, 255, 58, .10), transparent 55%), var(--s1); }
.cta h3 { font-size: 30px; font-weight: 800; text-transform: uppercase; }
.cta .btn { justify-self: start; }
.cta-top { display: flex; align-items: center; gap: 8px; }
.cta.live { border-color: var(--acc); }
.pulse { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--acc); animation: pulse 1.6s infinite; }
.last-session { display: grid; gap: 12px; }
.last-session > div:first-child { display: grid; gap: 2px; }
.stats-inline { display: flex; gap: 18px; flex-wrap: wrap; color: var(--t2); font-size: 14px; }
.stats-inline b { color: var(--t1); font: 700 22px var(--display); margin-right: 3px; }
.pr-list { list-style: none; margin: 0; padding: 0; display: grid; }
.pr-list li, .pr-list li > a { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pr-list li > a { grid-column: 1 / -1; grid-template-columns: 1fr auto auto auto; border: 0; padding: 0; }
.pr-list li:last-child { border-bottom: 0; }
.pr-list b { font: 700 18px var(--display); }
.heat { display: grid; grid-template-rows: repeat(7, auto); gap: 4px; max-width: 640px; }
.hm { display: block; aspect-ratio: 1; border-radius: 4px; background: var(--s3); min-width: 8px; }
.hm.l1 { background: #1b3a5e; } .hm.l2 { background: #1b64be; } .hm.l3 { background: #338ced; } .hm.l4 { background: #84b9f3; }
.hm.fut { background: transparent; border: 1px dashed var(--line); }
.heat-legend { display: flex; align-items: center; gap: 5px; justify-content: flex-end; margin-top: 10px; font-size: 12px; color: var(--t2); }
.heat-legend .hm { width: 12px; min-width: 12px; }
.ex-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.ex-mini a { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--s2); transition: background .15s; }
.ex-mini a:hover { background: var(--s3); }
.ex-mini .name { font-weight: 600; }
.ex-mini svg { grid-row: 1 / 3; grid-column: 2; align-self: center; }

/* ================= Poids ================= */
.weight-grid { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); align-items: start; }
.weight-grid .span2 { grid-column: 1 / -1; }
.wtiles { grid-template-columns: repeat(3, 1fr); }
.entry { display: grid; gap: 16px; }
.entry h2 { margin: 0; }
.wform { display: grid; gap: 14px; }
.kg-input { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; align-items: center; }
.kg-input .step { height: 52px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--s2); color: var(--t1); display: grid; place-items: center; cursor: pointer; transition: background .15s, transform .1s; }
.kg-input .step:active { transform: scale(.93); background: var(--s3); }
.kg-field { position: relative; display: block; }
.kg-field input { text-align: center; font: 800 52px/1 var(--display); height: 84px; padding: 0 44px 0 14px; letter-spacing: .01em; -moz-appearance: textfield; }
.kg-field input::-webkit-inner-spin-button, .kg-field input::-webkit-outer-spin-button { -webkit-appearance: none; }
.kg-field span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font: 700 20px var(--display); color: var(--t2); pointer-events: none; }
.when { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.when input { min-width: 0; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--t2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; }
.lg-dia { width: 9px; height: 9px; transform: rotate(45deg); }
.lg-line { width: 18px; height: 2px; border-radius: 2px; }
.lg-dash { width: 18px; border-top: 2px dashed rgba(239, 239, 239, .45); }
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 340px; }
.chart-card p.small { margin-top: 10px; }

/* Tableaux */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--t3); padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, .015); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl .actions { text-align: right; white-space: nowrap; width: 1%; }
.tbl.compact td { padding: 7px 8px; }

/* ================= Séances ================= */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.tpl { display: grid; gap: 12px; align-content: start; position: relative; border-top: 4px solid var(--c, var(--line-2)); }
.tpl h2 { font-size: 26px; font-weight: 800; }
.tpl.suggested h2 { padding-right: 90px; }
.tpl .tag.accent { position: absolute; top: 16px; right: 16px; }
.tpl.suggested { box-shadow: 0 0 0 1px var(--acc); }
.tpl.free { border-top-color: var(--line-2); border-top-style: dashed; }
.tpl-ex { margin: 0; padding: 0; list-style: none; counter-reset: ex; display: grid; gap: 0; }
.tpl-ex li { counter-increment: ex; display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tpl-ex li::before { content: counter(ex); color: var(--t3); font: 600 14px var(--display); }
.tpl-ex li:last-child { border: 0; }
a.tpl:hover { border-color: var(--line-2); border-top-color: var(--c); }

.session-head { border-left: 4px solid var(--c); padding-left: 16px; }
.clock { color: var(--acc); font-weight: 600; }
.session-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; padding: 16px 18px; border-radius: var(--r); background: var(--s1); border: 1px solid var(--line); margin-bottom: 16px; position: sticky; top: 0; z-index: 5; }
.session-stats > div { display: grid; }
.session-stats b { font: 700 26px/1 var(--display); }
.session-stats span { font-size: 12px; color: var(--t2); }
.ex-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 12px; margin-bottom: 12px; align-items: start; }
.ex-card { display: grid; gap: 12px; transition: border-color .3s; }
.ex-card.done { border-color: rgba(212, 255, 58, .35); }
.ex-card header { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.ex-idx { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--s3); font: 700 16px var(--display); color: var(--t2); }
.ex-card.done .ex-idx { background: var(--acc); color: var(--acc-ink); }
.ex-title h3 { font-size: 22px; font-weight: 700; }
.ex-title a:hover h3 { color: var(--acc); }
.ex-tools { display: flex; }
.ex-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #f2c46d; background: rgba(210, 142, 5, .1); padding: 7px 12px; border-radius: 10px; justify-self: start; }
.ex-note .ico { width: 16px; height: 16px; }
.ex-note.big { margin: -10px 0 20px; font-size: 15px; }
.ex-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.sets { display: grid; gap: 6px; }
.set-row { display: grid; grid-template-columns: 44px 1fr 1fr 96px; gap: 8px; align-items: center; }
.set-row.head span { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--t3); }
.set-row.head span:first-child { text-align: center; }
.set-n { display: grid; place-items: center; height: 44px; border-radius: 10px; background: var(--s2); font: 700 17px var(--display); color: var(--t2); }
.set-row.logged { min-height: 46px; border-radius: 12px; background: var(--s2); padding-right: 4px; }
.set-row.logged .set-n { background: transparent; color: var(--acc); }
.set-row.logged.warm .set-n { color: var(--t3); }
.set-row.logged.warm .val { color: var(--t2); }
.set-row.just { animation: pop .5s var(--ease); }
.val { font: 700 22px var(--display); padding-left: 14px; }
.val small { font: 500 13px var(--body); color: var(--t2); }
.set-end { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.pr-badge { display: inline-flex; align-items: center; gap: 3px; color: var(--acc); font: 700 15px var(--display); }
.pr-badge .ico { width: 18px; height: 18px; }
.set-row.pending input { text-align: center; font: 700 22px var(--display); min-height: 48px; padding: 4px 6px; }
.set-row.pending.saving { opacity: .5; pointer-events: none; }
.check-btn { height: 48px; border-radius: 12px; border: 1.5px solid var(--acc); background: transparent; color: var(--acc); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s, transform .1s; }
.check-btn:hover { background: var(--acc); color: var(--acc-ink); }
.check-btn:active { transform: scale(.94); }
.check-btn .ico { width: 24px; height: 24px; stroke-width: 2.6; }
.add-set { justify-self: start; }
.notes-card { margin: 16px 0; }
.empty-ex { padding: 30px; text-align: center; }

/* ================= Exercices ================= */
.search { position: relative; margin-bottom: 18px; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--t3); }
.search input { padding-left: 44px; border-radius: 999px; background: var(--s1); }
.ex-groups { display: grid; gap: 22px; }
.group-title { font-size: 15px; color: var(--t2); margin: 0 0 8px 4px; letter-spacing: .08em; }
.card.list { padding: 4px 0; }
.ex-row, .hist-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); transition: background .15s; }
.ex-row:last-child, .hist-row:last-child { border-bottom: 0; }
.ex-row:hover, .hist-row:hover { background: var(--s2); }
.ex-row-main { display: grid; flex: 1; min-width: 0; }
.ex-row-main b { font-size: 16px; }
.ex-row-side { display: flex; align-items: center; gap: 16px; }
.ex-row-num { display: grid; text-align: right; min-width: 74px; }
.ex-row-num b { font: 700 22px/1 var(--display); }
.chev { color: var(--t3); }
.archived { margin-top: 24px; }
.archived summary { cursor: pointer; margin-bottom: 10px; }
.ex-tiles { margin-bottom: 16px; }
.picker { display: grid; gap: 12px; }
.picker .search { margin: 0; }
.pick-list { display: grid; max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.pick { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.pick:last-child { border-bottom: 0; }
.pick:hover { background: var(--s2); }

/* Historique */
.month { margin-bottom: 26px; }
.month-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 4px 10px; }
.month-head h2 { text-transform: capitalize; }
.date-box { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--s2); border-left: 3px solid var(--c); flex: none; }
.date-box b { font: 800 22px/1 var(--display); }
.date-box span { font-size: 11px; color: var(--t2); text-transform: uppercase; letter-spacing: .05em; }
.hist-main { display: grid; flex: 1; min-width: 0; }

/* Programmes */
.form-card { margin-bottom: 16px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--s1); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--t1); }
.prog-items { display: grid; gap: 6px; margin-bottom: 12px; }
.prog-row { display: grid; grid-template-columns: 32px minmax(120px, 1fr) 72px 72px 72px 84px auto; gap: 8px; align-items: center; padding: 6px 0; }
.prog-row.head span { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--t3); }
.prog-row input { text-align: center; padding: 6px; }
.pf { display: block; }
.pf span { display: none; font-size: 11px; font-weight: 600; color: var(--t3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.prog-row + .prog-row:not(.head) { border-top: 1px solid var(--line); }

/* Outils */
.big-result { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0; padding: 14px 16px; border-radius: 12px; background: var(--s2); }
.big-result b { font: 800 36px var(--display); color: var(--acc); }
.plates { display: flex; align-items: center; gap: 3px; min-height: 120px; margin: 16px 0 8px; padding: 0 8px; overflow-x: auto; }
.bar-end { width: 70px; height: 14px; background: linear-gradient(#8a8d94, #55585e); border-radius: 3px; flex: none; }
.plate { display: grid; place-items: center; width: 26px; border-radius: 5px; font: 700 12px var(--display); color: #fff; writing-mode: vertical-rl; transform: rotate(180deg); flex: none; }
.plate.p25 { height: 112px; background: #c93838; } .plate.p20 { height: 104px; background: #2a62c9; } .plate.p15 { height: 92px; background: #d4a20a; color: #111; }
.plate.p10 { height: 78px; background: #1f9c50; } .plate.p5 { height: 62px; background: #e8e8e8; color: #111; } .plate.p2_5 { height: 50px; background: #333; border: 1px solid #555; } .plate.p1_25 { height: 40px; background: #777; }
.warmup { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.warmup li.work { color: var(--acc); list-style: '→ '; }
.mtiles { margin-bottom: 16px; }
.file-btn { cursor: pointer; }

/* ================= Connexion ================= */
#login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.login-bg { position: absolute; inset: 0; display: grid; align-content: center; pointer-events: none; opacity: .045; }
.login-bg span { font: 800 28vw/0.82 var(--display); white-space: nowrap; letter-spacing: -.02em; animation: drift 30s linear infinite alternate; }
.login-bg span:nth-child(2) { margin-left: -20vw; animation-direction: alternate-reverse; color: var(--acc); }
.login-card { position: relative; width: min(380px, 100%); }
#login-card { display: grid; gap: 14px; background: rgba(22, 23, 26, .85); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 20px; padding: 34px 28px; text-align: center; }
#login-card .muted { margin: -6px 0 10px; text-transform: uppercase; letter-spacing: .2em; font-size: 12px; font-weight: 600; }
#login-card input { text-align: center; min-height: 50px; }
.err { color: var(--down); min-height: 1.4em; font-size: 14px; }
.shake { animation: shake .4s; }

/* ================= Modales, toasts, minuteur ================= */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(5, 6, 8, .7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .2s; }
.modal-back.in { opacity: 1; }
.modal { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--s1); border: 1px solid var(--line-2); border-radius: 20px; transform: translateY(16px) scale(.98); transition: transform .25s var(--ease); }
.modal.wide { width: min(680px, 100%); }
.modal-back.in .modal { transform: none; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 8px; }
.modal header h2 { font-size: 22px; }
.modal-body { padding: 8px 20px 16px; display: grid; gap: 12px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 20px 20px; }
.modal footer .btn.danger.ghost { margin-right: auto; }
.summary { display: grid; gap: 16px; }
.summary h3 { display: flex; align-items: center; gap: 8px; text-transform: uppercase; }
.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.summary-grid div { background: var(--s2); border-radius: 12px; padding: 14px; display: grid; }
.summary-grid b { font: 800 30px var(--display); }
.summary-grid span { color: var(--t2); font-size: 13px; }

.toasts { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; background: #f4f4f4; color: #111; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transform: translateY(-20px); opacity: 0; transition: transform .3s var(--ease), opacity .3s; }
.toast.in { transform: none; opacity: 1; }
.toast .ico { width: 18px; height: 18px; color: #1a7f3c; }
.toast.err .ico { color: #c22; }
.toast.pr { background: var(--acc); color: var(--acc-ink); padding: 14px 22px; }
.toast.pr .ico { color: var(--acc-ink); width: 22px; height: 22px; }
.toast.pr.in { animation: prpop .6s var(--ease); }

.rest { position: fixed; z-index: 60; left: calc(var(--side) + 24px); right: 24px; bottom: 20px; max-width: 520px; margin: 0 auto; border-radius: 18px; overflow: hidden; background: #f4f4f4; color: #111; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: rise .3s var(--ease); }
.rest-fill { position: absolute; inset: 0; background: var(--acc); transform-origin: left; transition: transform .25s linear; }
.rest-inner { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; }
.rest-inner > div:first-child { display: grid; }
#rest-label { font-weight: 600; opacity: .75; }
#rest-time { font: 800 30px/1 var(--display); }
.rest-btns { display: flex; gap: 6px; }
.rest-btns button { min-width: 46px; height: 42px; border-radius: 12px; border: 0; background: rgba(0, 0, 0, .1); color: #111; font-weight: 700; cursor: pointer; }
.rest-btns button:hover { background: rgba(0, 0, 0, .18); }
.rest.done { background: var(--acc); animation: flash 1s ease-in-out 3; }
body.has-rest .view { padding-bottom: 140px; }

/* ================= Animations ================= */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(212, 255, 58, .6); } 70% { box-shadow: 0 0 0 9px rgba(212, 255, 58, 0); } 100% { box-shadow: 0 0 0 0 rgba(212, 255, 58, 0); } }
@keyframes pop { 0% { transform: scale(.96); background: var(--acc-soft); } 60% { transform: scale(1.015); } 100% { transform: none; } }
@keyframes prpop { 0% { transform: translateY(-20px) scale(.8); } 60% { transform: scale(1.06); } 100% { transform: none; } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes flash { 50% { filter: brightness(1.15); } }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-12vw); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================= Responsive ================= */
@media (max-width: 1100px) {
  .weight-grid { grid-template-columns: 1fr; }
  .wtiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .view { margin-left: 0; padding: 22px 14px calc(var(--tab) + var(--safe-b) + 30px); }
  body.has-rest .view { padding-bottom: calc(var(--tab) + var(--safe-b) + 110px); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(var(--tab) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: rgba(14, 15, 17, .92); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button { position: relative; display: grid; place-items: center; align-content: center; gap: 3px; background: none; border: 0; color: var(--t3); font-size: 11px; font-weight: 600; cursor: pointer; }
  .tabbar .on { color: var(--t1); }
  .tabbar .on .ico { color: var(--acc); }
  .tabbar .ico { width: 23px; height: 23px; }
  .tabbar a.main .ico { width: 50px; height: 34px; padding: 6px 13px; border-radius: 999px; background: var(--acc); color: var(--acc-ink) !important; }
  .tabbar .live-dot { position: absolute; top: 8px; right: calc(50% - 30px); margin: 0; border: 2px solid var(--bg); width: 12px; height: 12px; }
  .more-sheet {
    display: grid; position: fixed; left: 10px; right: 10px; bottom: calc(var(--tab) + var(--safe-b) + 10px); z-index: 55;
    background: var(--s2); border: 1px solid var(--line-2); border-radius: 18px; padding: 8px; gap: 2px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .6); transform: translateY(20px); opacity: 0; pointer-events: none; transition: all .25s var(--ease);
  }
  .more-sheet a { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; font-weight: 600; }
  .more-sheet a:active { background: var(--s3); }
  body.more-open .more-sheet { transform: none; opacity: 1; pointer-events: auto; }
  .rest { left: 10px; right: 10px; bottom: calc(var(--tab) + var(--safe-b) + 10px); }
  .toasts { top: calc(env(safe-area-inset-top, 0px) + 10px); }

  .dash, .grid.two-col { grid-template-columns: 1fr; }
  .page-head { margin-bottom: 18px; }
  .hero-num { font-size: 72px; }
  .wtiles { grid-template-columns: repeat(2, 1fr); }
  .chart-box { height: 240px; }
  .chart-box.tall { height: 280px; }
  .card { padding: 16px; }
  .session-stats { grid-template-columns: repeat(4, 1fr); padding: 12px 14px; top: 0; }
  .ex-list { grid-template-columns: 1fr; }
  .session-stats b { font-size: 22px; }
  .set-row { grid-template-columns: 38px 1fr 1fr 76px; gap: 6px; }
  .ex-tools .icon-btn { width: 32px; }
  .ex-row { padding: 12px 14px; }
  .ex-row-side svg { display: none; }
  .prog-row { grid-template-columns: repeat(4, 1fr); row-gap: 8px; padding: 12px 0; }
  .prog-row > .ex-idx { display: none; }
  .prog-row > b { grid-column: 1 / 3; }
  .prog-row > .row { grid-column: 3 / -1; grid-row: 1; justify-content: flex-end; }
  .prog-row .pf span { display: block; }
  .prog-row.head { display: none; }
  .hide-m { display: none; }
  .tbl td { white-space: nowrap; }
  .tbl { font-size: 13px; }
  .brand.big { font-size: 64px; }
  .modal-back { align-items: end; padding: 0; }
  .modal { width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh; padding-bottom: var(--safe-b); transform: translateY(40px); }
}
@media (max-width: 420px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile > b { font-size: 28px; }
  .form.two { grid-template-columns: 1fr 1fr; }
  .tpl-grid { grid-template-columns: 1fr; }
}
