/* Thème de la maquette : contenu clair sur fond gris très pâle, cartes blanches, zones sombres (en-tête, accueil, onglets), accent framboise. */
:root {
  --bg: #f4f4f9; --surface: #ffffff; --surface-2: #f1f0f7; --line: #e7e6f0;
  --ink: #17142b; --ink-2: #55526b; --ink-3: #75728c;
  --accent: #d42550; --accent-2: #b31d42; --accent-ink: #ffffff; --accent-soft: rgba(232, 48, 90, .1);
  --btn: #e8305a; --btn-2: #b31d42;
  --good: #12805a; --warn: #f5a623; --hot: #ff6a3d; --danger: #c62828;
  --radius: 18px; --radius-s: 12px; --tap: 48px;
  --shadow: 0 8px 24px rgba(23, 20, 43, .08);
  /* Rangs par muscle, du plus bas au plus haut */
  --t0: #dcdbe8; --t1: #b0764a; --t2: #9aa4b3; --t3: #e6b63c; --t4: #2bb8a6; --t5: #4f8dff; --t6: #a66bf0;
  --night: #17142b;
  color-scheme: light;
}
/* Zone sombre : mêmes composants, couleurs inversées. */
.dark { --surface: #221e3d; --surface-2: #2d2850; --line: #3a3560; --ink: #ffffff; --ink-2: #cfcbe6; --ink-3: #a09cbd;
  --accent: #ff6b8b; --accent-soft: rgba(255, 107, 139, .18); --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  background: var(--night); color: var(--ink); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  padding-bottom: calc(100px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; }
h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
[hidden] { display: none !important; }
svg.i { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.fill { fill: currentColor; stroke: none; }

/* ---------- En-tête : niveau, EXP, régularité ---------- */
#top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
#me { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; padding: 0; border: 0; background: transparent; text-align: left; }
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  background: var(--surface-2); border: 3px solid var(--accent); }
.avatar svg { width: 30px; height: auto; display: block; }
.me-level { display: grid; gap: 4px; min-width: 96px; }
.me-level b { font-size: .88rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.top-stats { display: flex; align-items: center; gap: 6px; }
.pill { min-height: 36px; padding: 0 12px 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  display: inline-flex; align-items: center; gap: 4px; font-size: .88rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.pill svg.i { width: 18px; height: 18px; }
.pill.on { color: var(--ink); }
.pill.on svg.i { color: var(--hot); }

/* ---------- Mise en page ---------- */
main { padding: 16px; max-width: 640px; margin: 0 auto; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); box-shadow: var(--shadow); }
.hero { border-color: transparent; background: linear-gradient(140deg, #2b2450 0%, var(--night) 70%); color: #fff;
  --surface: #221e3d; --surface-2: #2d2850; --line: #3a3560; --ink: #ffffff; --ink-2: #cfcbe6; --ink-3: #a09cbd; --accent: #ff6b8b; --accent-soft: rgba(255, 107, 139, .18); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-2); font-size: .9rem; }
.small { color: var(--ink-3); font-size: .8rem; }
.eyebrow { color: var(--ink-3); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.hero .eyebrow { color: var(--accent); }
.section { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.section h3 { font-size: 1.15rem; font-weight: 800; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2);
  font-size: .72rem; font-weight: 700; letter-spacing: .03em; white-space: nowrap; flex: none; }
.tag.on { background: var(--accent-soft); color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { text-align: center; color: var(--ink-2); padding: 28px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }
.err { color: var(--danger); font-size: .9rem; }

/* ---------- Boutons et champs ---------- */
button, .btn { font: inherit; min-height: var(--tap); padding: 0 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-weight: 700; cursor: pointer; }
button.primary { border: 0; color: #fff; background: var(--btn); box-shadow: 0 3px 0 var(--btn-2); font-weight: 800; }
button.big { min-height: 56px; font-size: 1.02rem; }
button.ghost { background: transparent; }
button.danger { color: var(--danger); background: transparent; }
button.block { width: 100%; }
button.small-btn { min-height: 38px; padding: 0 14px; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; flex: none; }
button.icon { min-height: 44px; width: 44px; padding: 0; background: transparent; border: 0; color: var(--ink-2); display: inline-grid; place-items: center; flex: none; }
button.back { justify-self: start; min-height: 40px; padding: 0 12px 0 4px; border: 0; background: transparent; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
button.with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:disabled { opacity: .5; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: grid; gap: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
input, select, textarea { font: inherit; font-size: 16px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; width: 100%; min-height: var(--tap); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input[type="file"] { padding: 8px; color: var(--ink-2); }
input[type="file"]::file-selector-button { font: inherit; font-weight: 700; margin-right: 12px; min-height: 36px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--surface-2); color: var(--ink); }
textarea { min-height: 84px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
legend { padding: 0; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }

/* Choix en pastilles (profil) : des boutons radio habillés */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; display: block; text-transform: none; letter-spacing: 0; }
.choice input { position: absolute; inset: 0; opacity: 0; min-height: 0; margin: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2); font-size: .92rem; font-weight: 700; }
.choice input:checked + span { background: var(--btn); border-color: var(--btn); color: #fff; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Actions principales (séance libre, routine, programme) */
.action { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 12px 16px; text-align: left; border-radius: var(--radius);
  background: var(--surface); box-shadow: 0 3px 0 var(--line); font-weight: 400; }
.action .ico { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.action strong { display: block; font-size: 1.02rem; font-weight: 700; }
.action .muted { display: block; }

/* ---------- Listes ---------- */
.list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); text-align: left; width: 100%; min-height: 64px; font-weight: 400; color: var(--ink); }
.item strong { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .chev { color: var(--ink-3); width: 20px; height: 20px; }
.value { text-align: right; flex: none; }
.value strong { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.value .small { display: block; }
.routine { padding: 14px; gap: 10px; }
.routine .ex { display: flex; align-items: center; gap: 10px; font-size: .92rem; min-width: 0; }
.routine .ex i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.routine .ex b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.routine .ex span { color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Chiffres clés ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 6px; text-align: center; min-width: 0; }
.stat b { display: block; font-size: clamp(1.05rem, 5.2vw, 1.35rem); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { display: block; margin-top: 4px; color: var(--ink-3); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hero .stat, .card .stat { background: var(--surface-2); border-color: transparent; }
.bignum { font-size: 2rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.bars { width: 100%; height: 56px; display: block; }
.bars rect { fill: var(--accent); }
.bars rect.bg { fill: var(--surface-2); }

/* ---------- Barres de progression ---------- */
progress { width: 100%; height: 10px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 5px; overflow: hidden; background: var(--surface-2); display: block; }
progress::-webkit-progress-bar { background: var(--surface-2); }
progress::-webkit-progress-value { background: var(--accent); border-radius: 5px; }
progress::-moz-progress-bar { background: var(--accent); }
.me-level progress { height: 8px; }
.me-level small { font-size: .68rem; color: var(--ink-3); font-variant-numeric: tabular-nums; line-height: 1; }
.me-level { min-width: 124px; }
.hero progress, .hero progress::-webkit-progress-bar { background: color-mix(in srgb, #fff 18%, transparent); }

/* ---------- Semaine et calendrier ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.week span { display: block; color: var(--ink-3); font-size: .72rem; font-weight: 700; }
.week i { display: grid; place-items: center; height: 38px; max-width: 38px; margin: 4px auto 0; border-radius: 50%; background: var(--surface-2);
  font-style: normal; font-size: .82rem; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.week .on i { background: var(--warn); color: #1c1300; }
.week .today span { color: var(--ink); }
.week .today i { box-shadow: 0 0 0 2px var(--accent); }
.week.month i { border-radius: 10px; max-width: none; margin-top: 0; }
.week.month .off i { visibility: hidden; }

/* ---------- Silhouette des muscles ---------- */
.body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 320px; margin: 0 auto; width: 100%; }
.body svg { width: 100%; height: auto; display: block; }
.body svg { filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .35)); }
.fig .base { fill: color-mix(in srgb, var(--ink-3) 34%, var(--surface)); }
.fig .m { fill: color-mix(in srgb, var(--ink-3) 58%, var(--surface)); stroke: var(--surface); stroke-width: 1.4; stroke-linejoin: round; }
.fig .head { fill: color-mix(in srgb, var(--ink-3) 46%, var(--surface)); }
.fig .eye { fill: var(--ink); }
.fig .smile { fill: none; stroke: var(--ink); stroke-width: 15; stroke-linecap: round; }
.fig .grip { fill: var(--accent); }
.fig .t0 { fill: color-mix(in srgb, var(--accent) 45%, var(--surface)); } .fig .t1 { fill: var(--t1); } .fig .t2 { fill: var(--t2); } .fig .t3 { fill: var(--t3); } .fig .t4 { fill: var(--t4); } .fig .t5 { fill: var(--t5); } .fig .t6 { fill: var(--t6); }
.fig .hit { fill: var(--accent); }
.fig .r0 { fill: var(--good); } .fig .r1 { fill: var(--warn); } .fig .r2 { fill: var(--hot); }
.fig.mascot .m { fill: color-mix(in srgb, var(--accent) 42%, var(--surface-2)); stroke: var(--surface); }
.fig.mascot .base, .fig.mascot .head { fill: color-mix(in srgb, var(--accent) 24%, var(--surface-2)); }
.hero-mascot { position: relative; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: end center; overflow: hidden; margin: 0 auto;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 30%, var(--surface)), var(--surface) 72%); border: 3px solid var(--line); }
.hero-mascot svg { width: 120px; height: auto; display: block; }
.hero-mascot.t1, .avatar.t1 { border-color: var(--t1); } .hero-mascot.t2, .avatar.t2 { border-color: var(--t2); } .hero-mascot.t3, .avatar.t3 { border-color: var(--t3); }
.hero-mascot.t4, .avatar.t4 { border-color: var(--t4); } .hero-mascot.t5, .avatar.t5 { border-color: var(--t5); } .hero-mascot.t6, .avatar.t6 { border-color: var(--t6); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: .78rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.k-r0 { background: var(--good); } .k-r1 { background: var(--warn); } .k-r2 { background: var(--hot); }
.rank { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.medal { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 900; color: #14131c; background: var(--t0); }
.medal.t0 { color: var(--ink-2); }
.medal.t1 { background: var(--t1); } .medal.t2 { background: var(--t2); } .medal.t3 { background: var(--t3); } .medal.t4 { background: var(--t4); } .medal.t5 { background: var(--t5); } .medal.t6 { background: var(--t6); }
.rank strong { display: block; }
.rank .tier { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.rank progress { height: 6px; margin-top: 6px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.seg button { min-height: 40px; border: 0; background: transparent; color: var(--ink-2); border-radius: 10px; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }

/* ---------- Catalogue de machines ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; flex: none; font-size: .85rem; font-weight: 700; background: var(--surface); color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.mgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mcard { display: grid; gap: 0; padding: 0; overflow: hidden; text-align: left; background: var(--surface); border-radius: var(--radius); min-height: 0; font-weight: 400; align-content: start; }
.mcard .pic { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); }
.mcard .pic svg.i { width: 40px; height: 40px; stroke-width: 1.6; }
.mcard .txt { padding: 10px 12px 12px; display: grid; gap: 2px; min-width: 0; }
.mcard strong { font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mcard .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo { width: 100%; max-height: 280px; object-fit: cover; border-radius: var(--radius); display: block; }
.block h3 { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.block p { color: var(--ink); font-size: .95rem; }
.sets { display: grid; gap: 6px; }
.set { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; min-height: 52px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-s); font-variant-numeric: tabular-nums; }
.card .set { background: var(--surface-2); border-color: transparent; }
.set .n { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 800; }
.set strong { font-weight: 700; display: block; }
.set .small { display: block; }
.build { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px 6px; align-items: center; padding: 12px; border-radius: var(--radius-s); background: var(--surface-2); }
.build .fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.build input { min-height: 42px; padding: 6px; text-align: center; }

.code { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--surface-2); min-width: 0; }
.code strong { font-size: 1.5rem; font-weight: 900; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.code .small { overflow-wrap: anywhere; }
button.member { display: block; text-align: left; border: 0; padding: 0; min-height: 44px; min-width: 0; font-weight: 400; }
button.member strong, button.member .small { display: block; overflow-wrap: anywhere; }
.build .roles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
.build select { min-height: 42px; padding: 6px 8px; }
form.row input, form.row select { flex: 1; min-width: 0; }

/* ---------- Tutoriel animé d'un mouvement ---------- */
dialog.tuto { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); padding: 0; width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 32px); overflow-y: auto; }
.tuto-in { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); padding: 18px; }
#exercise { scroll-margin-top: 80px; }
dialog.tuto::backdrop { background: rgba(10, 6, 18, .72); }
.tuto .body { max-width: 240px; }
.tuto .step { background: var(--surface-2); border-radius: var(--radius-s); padding: 14px; display: grid; gap: 4px; min-height: 108px; align-content: start; }
.tuto ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: .95rem; }
.fig .hit2 { fill: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.k-hit { background: var(--accent); } .k-hit2 { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
button.fav.on { color: #a86400; }
button.fav.on svg.i { fill: currentColor; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid3 button { padding: 0 6px; }
@media (prefers-reduced-motion: no-preference) {
  /* Les muscles principaux « battent » pendant la lecture, comme pendant l'effort. */
  .tuto.playing .fig .hit { animation: effort 1.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .tuto.playing .fig .hit2 { animation: effort 1.5s ease-in-out .2s infinite; transform-box: fill-box; transform-origin: center; }
  @keyframes effort { 0%, 100% { opacity: .78; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
}

/* ---------- Séance en cours : un tableau de séries par exercice ---------- */
.wbar { position: sticky; top: calc(65px + env(safe-area-inset-top)); z-index: 4; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px;
  border-radius: var(--radius); box-shadow: var(--shadow); }
.wbar .clock { font-size: 1.5rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; display: block; }
.restbar { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 10px; }
.restbar #rest-now { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.restbar #rest-now b { font-variant-numeric: tabular-nums; }
.wcard { padding: 14px 12px; gap: 10px; }
.wcard .head { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.srow { display: grid; grid-template-columns: 32px minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 6px; align-items: center; }
.srow.th { color: var(--ink-3); font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; text-align: center; }
.srow .n { height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; font-variant-numeric: tabular-nums; }
.srow .prev { height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); font-size: .82rem; font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.srow input { min-height: 44px; padding: 4px; text-align: center; font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; border-color: transparent;
  background: var(--surface-2); -moz-appearance: textfield; appearance: textfield; }
.srow input::-webkit-outer-spin-button, .srow input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.srow .ok { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); border: 0; }
.srow.done input { background: transparent; color: var(--good); opacity: 1; -webkit-text-fill-color: var(--good); }
.srow.done .ok { background: var(--good); color: #fff; }
.srow.done .n { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); }

/* ---------- Bilan de séance ---------- */
.finish { display: grid; gap: 16px; text-align: center; padding-top: 3vh; grid-template-columns: minmax(0, 1fr); }
.hero-mascot.win { overflow: visible; border-color: var(--good); }
.hero-mascot.win svg { border-radius: 0 0 60px 60px; }
.finish .check { position: absolute; right: -6px; bottom: -6px; width: 44px !important; height: 44px !important; border: 3px solid var(--bg); }
.finish .check svg.i { width: 24px !important; height: 24px !important; }
.finish .check { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: var(--good); color: #04160e; }
.finish .check svg.i { width: 40px; height: 40px; stroke-width: 3; }
.finish .card { text-align: left; }
.xpgain { font-size: 1.5rem; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- Onglets ---------- */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(6, 1fr);
  padding: 6px 4px; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); border-radius: 22px; box-shadow: 0 12px 30px rgba(23, 20, 43, .35); }
#tabs button { border: 0; border-radius: var(--radius-s); background: transparent; color: var(--ink-3); min-height: 56px; padding: 4px 0;
  display: grid; justify-items: center; align-content: center; gap: 3px; font-size: .62rem; font-weight: 700; letter-spacing: 0; min-width: 0; }
#tabs button svg.i { width: 24px; height: 24px; pointer-events: none; }
#tabs button span { pointer-events: none; }
#tabs button[aria-current="page"] { color: var(--accent); }

/* ---------- Minuteur de repos ---------- */
#timer { position: fixed; left: 10px; right: 10px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 7; max-width: 620px; margin: 0 auto;
  border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; box-shadow: var(--shadow); }
.timer-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#timer-label { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#timer-time { font-size: 2.4rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
#timer.over { border-color: var(--good); }
#timer.over #timer-time, #timer.over #timer-label { color: var(--good); }
.timer-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
#timer-fill { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; }
.timer-actions { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.timer-actions button { min-height: 44px; }
body.has-timer { padding-bottom: calc(280px + env(safe-area-inset-bottom)); }

#toast { position: fixed; left: 16px; right: 16px; top: calc(72px + env(safe-area-inset-top)); z-index: 9; max-width: 608px; margin: 0 auto;
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--radius-s); font-weight: 700; box-shadow: var(--shadow); }

/* ---------- Connexion et profil ---------- */
.auth { display: grid; gap: 18px; padding-top: 6vh; grid-template-columns: minmax(0, 1fr); }
.auth-head { display: grid; justify-items: center; gap: 10px; text-align: center; }
.logo-v img { display: block; width: 220px; max-width: 70vw; height: auto; }
.brand-mark { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); box-shadow: var(--shadow); }
.brand-mark svg.i { width: 44px; height: 44px; stroke-width: 2.4; }
.auth-head h2 { font-size: 1.9rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 900; }
.profile-head { display: grid; justify-items: center; gap: 8px; text-align: center; }

/* ---------- Courbes et tableaux ---------- */
.chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.tip { font-size: .9rem; min-height: 1.4em; font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9rem; }
th, td { white-space: nowrap; text-align: right; padding: 10px 4px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--ink-3); font-weight: 800; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.scroll { overflow-x: auto; }

/* ---------- Accueil (maquette) ---------- */
.darkzone { margin: -16px -16px 0; padding: 6px 16px 20px; border-radius: 0 0 28px 28px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.darkzone h2 { font-size: 1.6rem; }
.card.today { background: linear-gradient(135deg, #2f2757 0%, #1d1936 100%); border-color: transparent; box-shadow: none; }
.card.today h3 { font-size: 1.35rem; font-weight: 800; }
.card.today .tag { justify-self: start; text-transform: uppercase; letter-spacing: .08em; }
ul.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--ink-2); font-size: .95rem; }
ul.facts li { display: flex; align-items: center; gap: 10px; }
ul.facts svg.i { width: 20px; height: 20px; color: var(--accent); }
.week.checks i { border-radius: 12px; max-width: none; height: 36px; background: transparent; color: var(--ink); font-size: .95rem; }
.week.checks .today i { background: var(--btn); color: #fff; box-shadow: none; }
.week.checks .today span { color: var(--accent); }
.week.checks .on i { background: transparent; color: var(--ink); }
.week.checks em { display: grid; place-items: center; width: 20px; height: 20px; margin: 4px auto 0; border-radius: 50%; font-style: normal; }
.week.checks .on em { background: var(--btn); color: #fff; }
.week.checks em svg.i { width: 12px; height: 12px; stroke-width: 3.4; }
.stats.tiles .stat { background: var(--surface); border: 1px solid var(--line); padding: 14px 6px; box-shadow: var(--shadow); display: grid; justify-items: center; gap: 2px; }
.stats.tiles .stat b { font-size: 1.05rem; }
.stats.tiles .stat span { text-transform: none; letter-spacing: 0; font-size: .78rem; font-weight: 500; margin-top: 0; }
i.ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); font-style: normal; }
i.ico.hot { background: rgba(255, 106, 61, .14); color: var(--hot); }
i.ico.gold { background: rgba(245, 166, 35, .16); color: #c98300; }
i.ico svg.i { width: 22px; height: 22px; }
.item.challenge { box-shadow: var(--shadow); }
.item.challenge progress { height: 6px; margin-top: 8px; }
.item.challenge strong { white-space: normal; font-size: .95rem; }
progress::-webkit-progress-value { background: var(--btn); }
progress::-moz-progress-bar { background: var(--btn); }

/* ---------- Indicateurs de chargement ---------- */
.loader { display: grid; justify-items: center; gap: 12px; padding: 48px 16px; color: var(--ink-2); font-size: .92rem; text-align: center; }
.loader.inline { grid-auto-flow: column; justify-content: start; justify-items: start; align-items: center; padding: 12px 14px; text-align: left; background: var(--surface-2); border-radius: var(--radius-s); }
#gym-results .loader { padding: 14px; }
.spin { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); flex: none; }
.loader.inline .spin { width: 22px; height: 22px; }
button.loading { position: relative; color: transparent !important; }
button.loading svg { visibility: hidden; }
button.loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--ink-3); border-top-color: var(--ink); }
button.primary.loading::after { border-color: rgba(255, 255, 255, .45); border-top-color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .spin, button.loading::after { animation: spin .8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
}
.gym-name { font-size: 1.25rem; font-weight: 800; display: block; }
img.avatar-s { object-fit: cover; }

/* ---------- Tableau de bord (administration, club) ---------- */
details.fold { background: var(--surface-2); border-radius: var(--radius-s); padding: 0 14px; }
details.fold summary { display: flex; align-items: center; gap: 10px; min-height: 56px; cursor: pointer; list-style: none; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
details.fold[open] summary::after { content: "–"; }
details.fold summary .small { display: block; }
details.fold > :not(summary) { margin-bottom: 12px; }
details.fold .routine { padding: 0; display: grid; gap: 6px; }
details.fold .routine .ex span { white-space: normal; text-align: right; }
.side-logo, #tabs .only-desk { display: none; }
.cols { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 6px; min-width: 0; }
.kpi b { font-size: 2rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart .area { fill: var(--accent-soft); }
.donut-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; align-items: center; }
.donut { width: 100%; height: auto; display: block; }
.donut .ring { fill: none; stroke: var(--surface-2); stroke-width: 16; }
.donut .arc { fill: none; stroke-width: 16; transform: rotate(-90deg); transform-origin: 60px 60px; }
.donut .axis { fill: var(--ink-3); font-size: 9px; }
.donut-n { fill: var(--ink); font-size: 22px; font-weight: 900; }
.arc.role-client { stroke: var(--accent); } .arc.role-coach { stroke: var(--t6); } .arc.role-gym { stroke: var(--t5); } .arc.role-admin { stroke: var(--warn); }
.sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex: none; }
.sw.role-client { background: var(--accent); } .sw.role-coach { background: var(--t6); } .sw.role-gym { background: var(--t5); } .sw.role-admin { background: var(--warn); }
.avatar-s { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; }

@media (min-width: 560px) { .mgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Bureau : barre latérale à gauche, contenu large ---------- */
@media (min-width: 1024px) {
  body.shell { padding: 0 0 40px 248px; }
  body.has-timer { padding-bottom: 240px; }
  #tabs { top: 0; right: auto; width: 248px; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 4px; padding: 18px 14px;
    left: 0; bottom: 0; border-radius: 0; box-shadow: none; overflow-y: auto; }
  .side-logo { display: block; padding: 6px 8px 18px; }
  .side-logo img { display: block; width: 150px; height: auto; }
  #tabs .only-desk:not([hidden]) { display: flex; }
  #tabs button { display: flex; grid-template-columns: none; justify-content: flex-start; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px;
    font-size: .95rem; letter-spacing: 0; color: #cfc4dd; }
  #tabs button svg.i { width: 22px; height: 22px; }
  #tabs button[aria-current="page"] { background: var(--btn); color: #fff; }
  #top { padding-left: 28px; padding-right: 28px; }
  main { max-width: 760px; padding: 24px 28px; }
  main.wide { max-width: 1240px; margin: 0; }
  .darkzone { margin: 0; padding: 22px; border-radius: 24px; }
  .only-mobile { display: none; }
  #timer { left: 268px; right: auto; width: 420px; bottom: 20px; margin: 0; }
  #toast { left: 268px; right: auto; width: 420px; margin: 0; }
  .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols .span2 { grid-column: span 2; }
  .mgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #network .build { grid-template-columns: minmax(0, 1.4fr) 0 minmax(0, 2fr); }
  #network .build .roles { grid-column: 3; }
}

@media (prefers-reduced-motion: no-preference) {
  button { transition: transform .08s, background-color .15s; }
  button:active { transform: translateY(1px); }
  #timer-fill { transition: transform .25s linear; }
}
#club-board { display: grid; gap: 14px; }
#club-board:empty { display: none; }
/* Séance chrono : le temps en grand, un seul bouton pour le repos. Le minuteur du bas est remplacé par cet écran. */
#wbody { display: grid; gap: 14px; }
#wbody[hidden] { display: none; }
body.chrono-mode #timer { display: none; }
body.chrono-mode.has-timer { padding-bottom: 0; }
.chrono { justify-items: center; text-align: center; gap: 12px; padding: 22px 16px; background: var(--night); }
.chrono > * { width: 100%; }
.chrono .tag { width: auto; }
.chrono-time { font-size: clamp(3.6rem, 22vw, 6rem); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.chrono.resting .chrono-time { color: var(--accent); }
.chrono .stats { margin-top: 4px; }

/* ---------- Accueil et menu du bas calqués sur la maquette ---------- */
button.link { background: none; border: 0; box-shadow: none; padding: 4px 0; min-height: 0; color: var(--accent); font-weight: 600; font-size: .95rem; justify-self: center; width: auto; }
#top .avatar { width: 52px; height: 52px; border: 3px solid var(--btn); }
#top .me-level b { font-size: 1.15rem; }
#top .me-level small { font-size: .78rem; color: var(--ink-2); }
#xpbar { height: 7px; }
#xpbar::-webkit-progress-value { background: linear-gradient(90deg, #ff6b8b 0%, #ff8fb0 45%, #5a7bd8 100%); }
#xpbar::-moz-progress-bar { background: linear-gradient(90deg, #ff6b8b 0%, #ff8fb0 45%, #5a7bd8 100%); }
#top .pill { min-height: 44px; padding: 0 16px 0 12px; font-size: 1.05rem; font-weight: 800; gap: 8px; }
#top .pill svg.i { width: 22px; height: 22px; color: var(--hot); }
.darkzone h2 { font-size: 1.75rem; font-weight: 800; }
.darkzone > div > .muted { font-size: 1.02rem; }
.card.today { position: relative; overflow: hidden; gap: 12px; padding: 18px 14px 14px; border: 1px solid rgba(255, 255, 255, .09);
  background: radial-gradient(120% 90% at 100% 0%, #3a3160 0%, #221d40 45%, #1b1733 100%); }
.card.today > :not(.today-art) { position: relative; z-index: 1; }
.card.today h3 { font-size: 1.5rem; }
.today-art { position: absolute; right: -18px; top: 6px; width: 46%; max-width: 210px; opacity: .9; pointer-events: none; }
.today-art svg { width: 100%; height: auto; display: block; }
ul.facts { gap: 10px; font-size: 1rem; color: var(--ink); }
ul.facts li i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: var(--ink); font-style: normal; flex: none; }
ul.facts li i svg.i { width: 17px; height: 17px; color: inherit; }
ul.facts li i.gold { color: #ffc93c; }
ul.facts li i.gold svg.i { fill: currentColor; }
.card.today button.primary { border-radius: 16px; min-height: 58px; font-size: 1.08rem; background: linear-gradient(90deg, #ff4f7b, #f0306a); }
.week.checks { gap: 6px; }
.week.checks > div { display: grid; justify-items: center; gap: 6px; }
.week.checks b { display: grid; justify-items: center; gap: 4px; width: 100%; max-width: 44px; padding: 8px 0 10px; border-radius: 16px; background: var(--surface-2); font-weight: 500; }
.week.checks b span { font-size: .8rem; color: var(--ink-3); }
.week.checks b i, .week.checks .on b i, .week.checks .today b i { height: auto; background: transparent; font-size: 1.05rem; font-weight: 600; font-style: normal; color: var(--ink); box-shadow: none; }
.week.checks .today b { background: linear-gradient(180deg, #ff4f7b, #ee2f68); box-shadow: 0 6px 14px rgba(232, 48, 90, .35); }
.week.checks .today b span, .week.checks .today b i { color: #fff; }
.week.checks em { width: 26px; height: 26px; margin: 0; }
.week.checks .on em { background: #ff5c85; }
.week.checks em svg.i { width: 14px; height: 14px; }
.stats.tiles { gap: 12px; }
.stats.tiles .stat { padding: 18px 6px 16px; border-radius: 20px; border-color: transparent; gap: 4px; }
.stats.tiles .stat b { font-size: 1.3rem; font-weight: 800; }
.stats.tiles .stat span { font-size: .92rem; color: var(--ink-3); }
i.big { display: grid; place-items: center; height: 44px; font-style: normal; }
i.big svg.i { width: 40px; height: 40px; stroke-width: 2.2; }
i.big.hot { color: #ff3d5e; } i.big.hot svg.i { fill: currentColor; }
i.big.night { color: var(--night); stroke-width: 2.6; }
i.big.pink { color: var(--btn); } i.big.pink svg.i { fill: currentColor; }
.section button.link { justify-self: end; }
.item.challenge { border-radius: 20px; border-color: transparent; padding: 14px; gap: 12px; align-items: center; }
.item.challenge i.ico { width: 52px; height: 52px; border-radius: 16px; }
.item.challenge i.ico svg.i { width: 26px; height: 26px; }
.item.challenge i.ico.gold { background: #ffe9c2; color: #f59a0b; }
.item.challenge i.ico.violet { background: #e4dcfb; color: #3b2a8c; }
.item.challenge .grow { display: grid; gap: 6px; min-width: 0; }
.item.challenge small { font-size: .88rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.item.challenge progress { height: 8px; margin: 0; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row progress { flex: 1; }
.reward { flex: none; padding: 7px 10px; border-radius: 12px; background: #ffdbe5; color: var(--accent); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.item.challenge progress::-webkit-progress-value, .bar-row progress::-webkit-progress-value { background: linear-gradient(90deg, #f0306a, #ff6b8b); }
#tabs { grid-template-columns: repeat(5, 1fr); }
#tabs button span { font-size: .78rem; }
#tabs button[aria-current="page"] { color: #ff5c85; }
#tabs button[aria-current="page"] svg.i { fill: currentColor; }
@media (max-width: 1023px) {
  #tabs button svg.i { width: 26px; height: 26px; }
  body.on-home #top { position: static; padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: 12px; }
}
@media (min-width: 1024px) {
  #tabs { grid-template-columns: minmax(0, 1fr); }
  #tabs button[aria-current="page"] { color: #fff; }
  #tabs button[aria-current="page"] svg.i { fill: none; }
  .today-art { max-width: 240px; }
}
#tabs [data-tab="rangs"] svg.i { stroke-width: 2.8; }

/* ---------- Échelle des applications natives (repères iOS / Android) ----------
   Texte courant 16-17 px, secondaire 15, légende 12-13, titre d'écran 22, barre du haut 56, barre d'onglets 49 avec
   libellés de 10-11 px, boutons de 44 à 50 px, marges de 16, cartes à coins de 16. */
:root { --radius: 16px; --radius-s: 12px; --tap: 44px; }
body { font-size: 16px; line-height: 1.38; }
main { gap: 12px; }
h2 { font-size: 1.375rem; font-weight: 700; }
h3 { font-size: 1.0625rem; font-weight: 600; }
.section { margin-top: 4px; }
.section h3 { font-size: 1.0625rem; font-weight: 700; }
.muted { font-size: .9375rem; }
.small { font-size: .8125rem; }
button, .btn { font-weight: 600; font-size: 1rem; border-radius: 12px; padding: 0 16px; }
button.primary { font-weight: 600; box-shadow: none; }
button.big { min-height: 50px; font-size: 1.0625rem; }
button.link { font-size: .9375rem; font-weight: 500; min-height: 0; }
button.small-btn { font-size: .875rem; }
input, select, textarea { min-height: 44px; padding: 10px 12px; }
.card { padding: 14px; gap: 10px; }
.action { min-height: 60px; padding: 10px 14px; gap: 12px; }
.action .ico { width: 38px; height: 38px; border-radius: 10px; }
.action strong { font-size: 1rem; font-weight: 600; }
.item { min-height: 56px; padding: 10px 14px; }
.stat b { font-size: 1.125rem; font-weight: 700; }
.stat span { font-size: .6875rem; font-weight: 600; }

#top { min-height: calc(56px + env(safe-area-inset-top)); padding: calc(6px + env(safe-area-inset-top)) 16px 6px; }
#top .avatar { width: 40px; height: 40px; border-width: 2px; }
#top .avatar svg { width: 26px; }
#top .me-level { gap: 3px; min-width: 112px; }
#top .me-level b { font-size: .9375rem; font-weight: 700; }
#top .me-level small { font-size: .6875rem; }
#xpbar { height: 5px; }
#top .pill { min-height: 32px; padding: 0 12px 0 9px; font-size: .9375rem; font-weight: 700; gap: 6px; }
#top .pill svg.i { width: 17px; height: 17px; }
/* La barre de séance se cale juste sous la barre du haut, sans passer dessous. */
.wbar { top: calc(60px + env(safe-area-inset-top)); padding: 8px 8px 8px 14px; }
.wbar .clock { font-size: 1.25rem; font-weight: 700; }

.darkzone { gap: 12px; padding: 4px 16px 16px; border-radius: 0 0 24px 24px; }
.darkzone h2 { font-size: 1.5rem; font-weight: 700; }
.darkzone > div > .muted { font-size: .9375rem; }
.card.today { padding: 14px 12px 12px; gap: 10px; border-radius: 18px; }
.card.today h3 { font-size: 1.25rem; font-weight: 700; }
.card.today .tag { font-size: .6875rem; min-height: 22px; }
.today-art { width: 40%; max-width: 170px; top: 10px; }
ul.facts { gap: 8px; font-size: .9375rem; }
ul.facts li i { width: 26px; height: 26px; }
ul.facts li i svg.i { width: 15px; height: 15px; }
.card.today button.primary { min-height: 50px; font-size: 1.0625rem; border-radius: 14px; }
.week.checks b { max-width: 40px; padding: 6px 0 8px; border-radius: 14px; gap: 2px; }
.week.checks b span { font-size: .6875rem; }
.week.checks b i, .week.checks .on b i, .week.checks .today b i { font-size: .9375rem; }
.week.checks em { width: 20px; height: 20px; }
.week.checks em svg.i { width: 11px; height: 11px; }
.stats.tiles { gap: 10px; }
.stats.tiles .stat { padding: 12px 4px 12px; border-radius: 16px; gap: 2px; }
.stats.tiles .stat b { font-size: 1.0625rem; font-weight: 700; }
.stats.tiles .stat span { font-size: .8125rem; font-weight: 400; }
i.big { height: 32px; }
i.big svg.i { width: 28px; height: 28px; }
.item.challenge { padding: 12px; border-radius: 16px; gap: 10px; }
.item.challenge i.ico { width: 42px; height: 42px; border-radius: 12px; }
.item.challenge i.ico svg.i { width: 22px; height: 22px; }
.item.challenge strong { font-size: .9375rem; font-weight: 600; }
.item.challenge small { font-size: .8125rem; }
.item.challenge progress { height: 6px; }
.reward { padding: 5px 8px; border-radius: 10px; font-size: .75rem; font-weight: 600; }

.chrono { padding: 18px 14px; gap: 10px; }
.chrono-time { font-size: clamp(3rem, 17vw, 4.25rem); font-weight: 700; }

@media (max-width: 1023px) {
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  #tabs { padding: 4px; bottom: calc(8px + env(safe-area-inset-bottom)); border-radius: 20px; }
  #tabs button { min-height: 49px; gap: 2px; padding: 2px 0; }
  #tabs button svg.i { width: 24px; height: 24px; }
  #tabs button span { font-size: .65625rem; font-weight: 500; }
  body.on-home #top { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; }
}

/* Question oui / non dans la page, et bouton pour masquer le minuteur de repos. */
dialog.ask { border: 0; border-radius: 16px; background: var(--surface); color: var(--ink); padding: 18px 16px 14px; width: min(340px, calc(100vw - 48px)); box-shadow: 0 20px 50px rgba(23, 20, 43, .35); }
dialog.ask::backdrop { background: rgba(10, 6, 18, .55); }
dialog.ask p { margin: 0 0 14px; font-size: 1rem; text-align: center; }
dialog.ask .row { gap: 8px; }
.timer-hide { min-height: 30px; padding: 0 10px; font-size: .8125rem; font-weight: 500; border-radius: 999px; flex: none; }
#timer { padding: 10px 12px; gap: 8px; }
#timer-time { font-size: 1.75rem; font-weight: 700; }
.timer-actions button { min-height: 40px; font-size: .9375rem; }
body.has-timer { padding-bottom: calc(230px + env(safe-area-inset-bottom)); }

/* ---------- Profil d'après la maquette ---------- */
button.icon.round { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); color: var(--ink); flex: none; }
button.icon.round svg.i { width: 20px; height: 20px; }
.subhead { gap: 8px; align-items: center; }
.profile-top { gap: 14px; padding-top: 10px; }
.profile-top h2 { font-size: 1.375rem; }
.pid { gap: 14px; align-items: center; }
.big-avatar { width: 76px; height: 76px; border: 3px solid var(--btn); background: #1d1936; }
.big-avatar svg { width: 52px; height: auto; }
.plevel { font-size: 1.0625rem; font-weight: 700; display: block; }
.pid .muted { margin: 2px 0; font-size: .875rem; }
.pid small { font-size: .8125rem; color: var(--ink-2); display: block; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
progress.xp { height: 5px; }
progress.xp::-webkit-progress-value { background: linear-gradient(90deg, #ff6b8b 0%, #ff8fb0 45%, #5a7bd8 100%); }
.dark .stats.tiles .stat { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .09); box-shadow: none; }
.dark .stats.tiles .stat span { color: var(--ink-2); }
i.big.violet { color: #b9a4ff; }
.dark i.big.night { color: #fff; }
.plist { padding: 4px 14px; gap: 0; }
.prow { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 8px 0; background: none; border: 0; border-radius: 0; text-align: left; font-weight: 400; color: var(--ink); }
.prow + .prow { border-top: 1px solid var(--line); }
.prow > i { width: 28px; display: grid; place-items: center; color: var(--ink); font-style: normal; flex: none; }
.prow > i svg.i { width: 24px; height: 24px; }
.prow strong { display: block; font-size: 1rem; font-weight: 600; }
.prow small { display: block; font-size: .8125rem; color: var(--ink-3); }
.prow svg.chev { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
@media (max-width: 1023px) {
  body.no-top #top { display: none; }
  body.no-top main { padding-top: calc(16px + env(safe-area-inset-top)); }
  body.no-top .darkzone { margin-top: calc(-16px - env(safe-area-inset-top)); padding-top: calc(14px + env(safe-area-inset-top)); }
  body.no-top .wbar { top: calc(8px + env(safe-area-inset-top)); }
}
/* Photo de la carte du jour (découpée dans la maquette) : fondue dans la carte par la gauche et par le bas. */
img.today-art { right: 0; top: 0; width: 44%; max-width: 190px; height: 78%; object-fit: cover; object-position: center top; opacity: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%), linear-gradient(180deg, #000 70%, transparent 100%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, #000 38%), linear-gradient(180deg, #000 70%, transparent 100%); mask-composite: intersect; }

/* ---------- Progression d'après la maquette : écran sombre, cartes claires ---------- */
body.dark-page { background: var(--night); }
body.dark-page main > h2, .pg-title, .pg-h3 { color: #fff; }
.pg-h3 { font-size: 1.0625rem; font-weight: 700; margin: 6px 0 0; }
.pg-note { color: #b9b6cc; border-color: rgba(255, 255, 255, .18); }
.chips-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips-tabs::-webkit-scrollbar { display: none; }
.chips-tabs button { min-height: 34px; padding: 0 14px; border-radius: 10px; font-size: .8125rem; font-weight: 500; flex: none; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.chips-tabs button[aria-pressed="true"] { background: linear-gradient(90deg, #ff4f7b, #f0306a); color: #fff; border-color: transparent; font-weight: 600; }
body.dark-page .chips-tabs button { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); color: #d9d6ea; }
body.dark-page .chips-tabs button[aria-pressed="true"] { background: linear-gradient(90deg, #ff4f7b, #f0306a); color: #fff; border-color: transparent; }
.levelcard { display: flex; align-items: center; gap: 12px; }
.levelcard small, .minicard small, .mrank small { display: block; font-size: .8125rem; color: var(--ink-3); }
.levelcard strong { display: block; font-size: 1.0625rem; font-weight: 700; margin: 2px 0; }
.levelcard progress { height: 6px; margin-top: 8px; }
.hexlevel { position: relative; width: 56px; height: 62px; display: grid; place-items: center; flex: none; }
.hexlevel svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: #2b2550; stroke: #6f63c9; stroke-width: 3; }
.hexlevel b { position: relative; color: #fff; font-size: 1.5rem; font-weight: 800; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.minicard { gap: 8px; }
.minicard .row { gap: 10px; align-items: center; }
.minicard strong { display: block; font-size: 1.125rem; font-weight: 700; line-height: 1.1; }
.figzone { padding: 8px 0; background: transparent; }
.fig .m.h1 { fill: #f7a8bd; }
.fig .m.h2 { fill: #f0457a; }
.mrank { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); min-width: 0; }
.mrank .grow { min-width: 0; }
.mrank strong { display: block; font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrank progress { height: 5px; margin-top: 5px; }
.mrank .medal { flex: none; font-style: normal; }
button.link.light { color: #ff8fb0; }
body.dark-page .legend { color: #d9d6ea; }

.figzone .body svg.fig { max-height: 300px; width: auto; }
.figzone .body { justify-content: center; }

/* ---------- Club d'après la maquette : onglets et carte sombre de la salle ---------- */
#club-tabs[hidden] { display: none; }
.gymhero { position: relative; overflow: hidden; border-radius: 16px; background: linear-gradient(135deg, #2f2757 0%, #17142b 100%); min-height: 150px; }
.gymhero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.gh-body { position: relative; padding: 16px 14px; display: grid; gap: 8px; }
.gymhero .gym-name { font-size: 1.25rem; font-weight: 700; color: #fff; }
.gh-code { margin: 0; font-size: .9375rem; color: #e6e3f5; }
.gh-code b { padding: 2px 8px; border-radius: 8px; background: rgba(255, 255, 255, .14); letter-spacing: .06em; font-weight: 600; }
.cols > [hidden], #club-board[hidden] { display: none; }
@media (min-width: 1024px) { .cols > [data-pane] { grid-column: span 2; } }

/* ---------- Séance en cours d'après la maquette ---------- */
.wsum { display: flex; align-items: center; gap: 12px; padding: 10px; }
.wsum img { width: 72px; height: 52px; object-fit: cover; border-radius: 10px; flex: none; }
.wsum strong { display: block; font-size: 1rem; font-weight: 700; }
.wsum small { display: block; font-size: .8125rem; color: var(--accent); }
#wprog { display: grid; gap: 6px; font-size: .875rem; }
#wprog[hidden] { display: none; }
#wprog progress { height: 6px; }
.wcard .head strong { font-size: 1.0625rem; font-weight: 700; }
.srow { grid-template-columns: 28px minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 8px; padding: 3px 4px; border: 1.5px solid transparent; border-radius: 12px; }
.srow.th { font-size: .75rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-2); padding: 0 4px; }
.srow .n { height: 38px; background: transparent; font-weight: 600; font-size: .9375rem; }
.srow .prev { height: 38px; background: transparent; font-size: .8125rem; font-weight: 400; }
.srow input { min-height: 38px; font-size: 1rem; font-weight: 600; background: var(--surface-2); border-radius: 10px; }
.srow .ok { width: 26px; height: 26px; min-height: 26px; justify-self: center; background: transparent; border: 2px solid #c9c6d8; color: transparent; }
.srow .ok svg.i { width: 14px; height: 14px; stroke-width: 3.2; }
.srow.done .ok { background: var(--btn); border-color: var(--btn); color: #fff; }
.srow.done input { color: var(--ink); -webkit-text-fill-color: var(--ink); background: var(--surface-2); }
.srow.done .n { background: transparent; color: var(--ink); }
/* La série en cours (la première pas encore validée) est encadrée en rose. */
.srow.th ~ .srow:not(.done) { border-color: var(--btn); }
.srow.th ~ .srow:not(.done) ~ .srow:not(.done) { border-color: transparent; }
.srow.th ~ .srow:not(.done) .ok { border-color: var(--btn); }
.srow.th ~ .srow:not(.done) ~ .srow:not(.done) .ok { border-color: #c9c6d8; }
.wcard [data-validate] { margin-top: 4px; background: linear-gradient(90deg, #ff4f7b, #f0306a); border-radius: 14px; }

/* Animations des mouvements : carré sombre, coins arrondis, dans le tutoriel et sur l'exercice en cours de la séance. */
video.tuto-vid, video.wvid { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: #17142b; }
video.wvid { aspect-ratio: 16 / 10; object-fit: contain; }
video.tuto-vid { max-height: 300px; object-fit: contain; }

/* Avatar sans mascotte : initiale du membre. Indicateur de chargement de page. */
b.initial { font-size: 1.125rem; font-weight: 700; color: #fff; line-height: 1; }
.avatar { background: linear-gradient(135deg, #ff4f7b, #7c5ce0); }
.big-avatar b.initial { font-size: 2rem; }
.hero-mascot { display: grid; place-items: center; background: linear-gradient(135deg, #ff4f7b, #7c5ce0); }
.hero-mascot b.initial { font-size: 2.5rem; }
main > .loader { min-height: 46vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-3); font-size: .875rem; }
main > .loader .spin { width: 34px; height: 34px; border-width: 3px; border-color: color-mix(in srgb, var(--btn) 22%, transparent); border-top-color: var(--btn); }
body.dark-page main > .loader { color: #b9b6cc; }

/* ---------- Alignement général sur la maquette : pas de capitales, boutons et puces roses, titres sobres ---------- */
.eyebrow { font-size: .8125rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
label, legend { font-size: .8125rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
button.small-btn { letter-spacing: 0; text-transform: none; font-size: .875rem; font-weight: 600; min-height: 36px; border-radius: 10px; }
.stat span { letter-spacing: 0; text-transform: none; font-size: .75rem; font-weight: 400; }
.rank .tier { letter-spacing: 0; text-transform: none; font-size: .8125rem; font-weight: 500; }
.block h3 { letter-spacing: 0; text-transform: none; font-size: .8125rem; font-weight: 600; color: var(--ink-3); }
#timer-label { letter-spacing: 0; text-transform: none; font-size: .875rem; font-weight: 500; }
th { letter-spacing: 0; text-transform: none; font-size: .75rem; font-weight: 500; }
.auth-head h2 { font-size: 1.5rem; text-transform: none; letter-spacing: 0; font-weight: 700; }
button.primary { background: linear-gradient(90deg, #ff4f7b, #f0306a); border-radius: 14px; }
button.danger { border-radius: 12px; }
.chip { min-height: 34px; border-radius: 10px; font-size: .8125rem; font-weight: 500; background: var(--surface-2); border: 1px solid var(--line); }
.chip[aria-pressed="true"] { background: linear-gradient(90deg, #ff4f7b, #f0306a); color: #fff; border-color: transparent; font-weight: 600; }
.seg button[aria-pressed="true"] { background: linear-gradient(90deg, #ff4f7b, #f0306a); color: #fff; }
button.back { color: var(--ink); font-size: 1.0625rem; font-weight: 700; gap: 8px; padding-left: 0; }
button.back svg.i { width: 22px; height: 22px; }
.tag { font-size: .75rem; font-weight: 500; border-radius: 8px; }
input, select, textarea { background: var(--surface-2); border-color: transparent; border-radius: 12px; }
.card > h2, .card > h3:first-child { font-size: 1.125rem; font-weight: 700; }
/* Listes d'actions (onglet Séances) : même dessin que les lignes du profil. */
.action { background: var(--surface); border: 0; box-shadow: var(--shadow); border-radius: 16px; }
.action .ico { background: #ffe3ea; color: var(--btn); }
.action strong { font-size: 1rem; }
.action .muted { font-size: .8125rem; color: var(--ink-3); }
/* Silhouettes : jamais plus hautes qu'un tiers d'écran en dehors de la page Progression. */
.card > .body svg.fig, .tuto .body svg.fig { max-height: 250px; width: auto; }
.card > .body, .tuto .body { justify-content: center; }
/* Cartes de machine : vignette plus basse, titre sur deux lignes. */
.mcard { border-radius: 16px; box-shadow: var(--shadow); border: 0; }
.mcard .pic { aspect-ratio: 16 / 10; background: linear-gradient(135deg, #2f2757, #17142b); color: #b9a4ff; }
.mcard .pic svg.i { width: 30px; height: 30px; }
.mcard strong { font-size: .9375rem; font-weight: 600; }
/* Création du profil : avatar plus petit. */
.hero-mascot { width: 84px; height: 84px; }
.hero-mascot b.initial { font-size: 2rem; }

/* Calendriers (bilan de séance, statistiques) : jour d'entraînement en rose, comme les pastilles de l'accueil. */
.week:not(.checks) .on i { background: linear-gradient(180deg, #ff4f7b, #ee2f68); color: #fff; }
.week:not(.checks) .today i { box-shadow: 0 0 0 2px #ff8fb0; }
.week:not(.checks) span { font-weight: 500; }
/* Sur un bloc déjà gris, les champs passent en blanc pour rester visibles. */
.build input, .build select, .build textarea, details.fold input, details.fold select, details.fold textarea, .code input, .step input { background: var(--surface); }

/* ---------- Proportions mesurées sur la maquette mobile (écran de 375 points de large) ----------
   Marges latérales de 14, cartes à coins de 20 avec 20 de marge intérieure, boutons de 58, lignes de liste de 64,
   barre d'onglets de 84 collée aux bords, titres de 28 (écran) et 19 (section). */
:root { --radius: 20px; --radius-s: 14px; --tap: 48px; }
main { padding: 16px 14px; gap: 16px; }
h2 { font-size: 1.5rem; font-weight: 700; }
.section { margin-top: 8px; }
.section h3, .pg-h3 { font-size: 1.1875rem; font-weight: 700; }
.card { padding: 20px 18px; gap: 14px; border-radius: 20px; }
button, .btn { min-height: 48px; border-radius: 14px; }
button.big, .card.today button.primary, .wcard [data-validate] { min-height: 58px; font-size: 1.0625rem; font-weight: 600; border-radius: 18px; }
button.small-btn { min-height: 40px; }
button.link { min-height: 0; font-size: 1rem; }
input, select, textarea { min-height: 50px; padding: 12px 14px; }

@media (max-width: 1023px) {
  /* En-tête de l'accueil */
  body.on-home #top { padding: calc(14px + env(safe-area-inset-top)) 18px 10px; min-height: 0; }
  #top .avatar { width: 62px; height: 62px; border-width: 3px; }
  #top b.initial { font-size: 1.5rem; }
  #top .me-level { gap: 6px; min-width: 140px; }
  #top .me-level b { font-size: 1.375rem; font-weight: 700; }
  #top .me-level small { font-size: .8125rem; }
  #xpbar { height: 7px; }
  #top .pill { min-height: 52px; padding: 0 20px 0 16px; font-size: 1.25rem; gap: 10px; border-radius: 26px; }
  #top .pill svg.i { width: 26px; height: 26px; }
  /* Zone sombre et carte du jour */
  .darkzone { margin: -16px -14px 0; padding: 6px 18px 20px; gap: 18px; border-radius: 0 0 28px 28px; }
  body.no-top .darkzone { margin-top: calc(-16px - env(safe-area-inset-top)); padding-top: calc(16px + env(safe-area-inset-top)); }
  .darkzone h2 { font-size: 1.8125rem; font-weight: 700; }
  .darkzone > div > .muted { font-size: 1.0625rem; margin-top: 4px; }
  .card.today { padding: 22px 16px 16px; gap: 14px; border-radius: 22px; }
  .card.today h3 { font-size: 1.5625rem; }
  .card.today .tag { min-height: 28px; padding: 0 12px; font-size: .8125rem; font-weight: 600; border-radius: 10px; }
  ul.facts { gap: 12px; font-size: 1.0625rem; }
  ul.facts li { gap: 12px; }
  ul.facts li i { width: 28px; height: 28px; }
  ul.facts li i svg.i { width: 16px; height: 16px; }
  img.today-art { width: 46%; max-width: 200px; height: 76%; }
  /* Semaine */
  .week.checks { gap: 8px; }
  .week.checks b { max-width: 40px; padding: 10px 0 12px; border-radius: 14px; gap: 6px; }
  .week.checks b span { font-size: .75rem; }
  .week.checks b i, .week.checks .on b i, .week.checks .today b i { font-size: 1.0625rem; }
  .week.checks em { width: 22px; height: 22px; }
  .week.checks em svg.i { width: 12px; height: 12px; }
  /* Tuiles */
  .stats.tiles { gap: 10px; }
  .stats.tiles .stat { padding: 22px 6px 20px; border-radius: 18px; gap: 6px; min-height: 120px; align-content: center; }
  .stats.tiles .stat b { font-size: 1.25rem; font-weight: 700; }
  .stats.tiles .stat span { font-size: .875rem; }
  i.big { height: 40px; }
  i.big svg.i { width: 36px; height: 36px; }
  /* Défis */
  .item.challenge { padding: 14px; border-radius: 18px; gap: 14px; min-height: 72px; }
  .item.challenge i.ico { width: 48px; height: 48px; border-radius: 14px; }
  .item.challenge i.ico svg.i { width: 26px; height: 26px; }
  .item.challenge strong { font-size: .90625rem; }
  .reward { padding: 7px 10px; font-size: .8125rem; border-radius: 10px; }
  /* Barre d'onglets de la maquette : flottante, fermée et arrondie sur ses quatre coins, fixée en bas de l'écran. */
  body { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
  #tabs { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 8px 6px; border-radius: 26px; }
  #tabs button { min-height: 60px; gap: 6px; }
  #tabs button svg.i { width: 26px; height: 26px; }
  #tabs button span { font-size: .75rem; font-weight: 500; }
  #timer { bottom: calc(100px + env(safe-area-inset-bottom)); }
  /* Listes (profil, actions) */
  .plist { padding: 4px 18px; }
  .prow { min-height: 64px; gap: 16px; }
  .prow strong { font-size: .96875rem; }
  .action { min-height: 72px; padding: 14px 16px; gap: 14px; border-radius: 18px; }
  .action .ico { width: 44px; height: 44px; border-radius: 12px; }
  .item { min-height: 64px; padding: 12px 16px; border-radius: 18px; }
  /* Profil */
  .profile-top { gap: 18px; }
  .big-avatar { width: 84px; height: 84px; }
  .plevel { font-size: 1.1875rem; }
  /* Séance en cours */
  .wsum { padding: 12px; gap: 14px; }
  .wsum img { width: 86px; height: 62px; border-radius: 12px; }
  .wsum strong { font-size: 1.0625rem; }
  .wcard { padding: 18px 14px; gap: 12px; }
  .wcard .head strong { font-size: 1.25rem; }
  .srow { gap: 10px; padding: 6px 6px; border-radius: 14px; }
  .srow.th { font-size: .8125rem; padding: 0 6px; }
  .srow input { min-height: 40px; padding: 4px; font-size: 1.0625rem; }
  .srow .n, .srow .prev { height: 40px; }
  .srow .ok { width: 26px; height: 26px; min-height: 26px; }
  .wbar { padding: 12px 12px 12px 18px; border-radius: 20px; }
  .wbar .clock { font-size: 1.5rem; }
  /* Progression */
  .chips-tabs { gap: 10px; }
  .chips-tabs button { min-height: 38px; padding: 0 16px; font-size: .875rem; border-radius: 12px; }
  .levelcard strong { font-size: 1.1875rem; }
  .hexlevel { width: 64px; height: 70px; }
  .minicard strong { font-size: 1.25rem; }
  .mrank { padding: 14px; border-radius: 16px; }
  .mrank strong { font-size: .9375rem; }
  .gh-body { padding: 20px 18px; gap: 10px; }
  .gymhero .gym-name { font-size: 1.4375rem; }
}

/* ---------- Mascotte (kit mascotte/) ---------- */
.avatar:has(svg.mascotte), #top .avatar:has(svg.mascotte), .big-avatar:has(svg.mascotte) { border: 0; background: none; overflow: visible; }
.avatar svg.mascotte { width: 100%; height: 100%; display: block; }
fitness-mascotte.mlive { display: block; margin: 0 auto; }
fitness-mascotte.m-hero { width: 150px; }
svg.mdefs { position: absolute; width: 0; height: 0; overflow: hidden; }
#top .avatar svg.mascotte, .big-avatar svg.mascotte { width: 100%; height: 100%; }
fitness-mascotte svg { width: 100%; height: auto; display: block; }
.empty.with-mascot { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; }
.empty.with-mascot .em { width: 72px; flex: none; }
.empty.with-mascot .em svg { width: 100%; height: auto; display: block; }
.empty.with-mascot p { margin: 0; color: var(--ink-2); font-size: .9375rem; }

/* ---------- Compte administrateur : trois onglets (Catalogue, Administration, Compte), pas de barre de niveau ---------- */
body.is-admin #top { display: none; }
.exgroup { display: grid; gap: 10px; }
.exgroup[hidden] { display: none; }
@media (max-width: 1023px) {
  body.is-admin #tabs { grid-template-columns: repeat(3, 1fr); }
  body.is-admin #tabs .only-desk:not([hidden]) { display: grid; }
}

body.is-admin #tabs [data-tab="admin"] { order: -1; }

label.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 10px; background: var(--surface-2); font-size: .9375rem; color: var(--ink); }
label.check input { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--btn); }
fieldset { border: 0; padding: 0; margin: 0; }

/* ---------- Lot 1 : fiche de salle, annuaire, galerie ---------- */
.gympane { display: grid; gap: 16px; }
.gympane[hidden] { display: none; }
.gym-logo { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; background: #fff; flex: none; }
.gymhero .row { gap: 12px; align-items: center; }
p.pre { white-space: pre-line; margin: 0; }
.plist .prow a { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
table.hours { width: 100%; border-collapse: collapse; font-size: .9375rem; }
table.hours th { text-align: left; font-weight: 500; color: var(--ink-2); padding: 7px 0; font-size: .9375rem; }
table.hours td { text-align: right; padding: 7px 0; font-variant-numeric: tabular-nums; }
table.hours tr + tr th, table.hours tr + tr td { border-top: 1px solid var(--line); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; }
.gphoto { position: relative; display: block; }
.gphoto button.icon { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; min-height: 30px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(23, 20, 43, .75); color: #fff; border: 0; }
.gphoto button.icon svg.i { width: 16px; height: 16px; }
.hoursform { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
label.addphoto input { margin-top: 6px; }
.gymrow .tag { flex: none; }
@media (min-width: 1024px) { .gallery { grid-template-columns: repeat(6, minmax(0, 1fr)); } .hoursform { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Lot 2 : liste à cocher des exercices d'une machine. */
.checklist { display: grid; gap: 6px; max-height: 340px; overflow-y: auto; padding: 2px; }
label.check.wide { display: flex; width: 100%; }
label.check.wide small { color: var(--ink-3); font-size: .8125rem; flex: none; }
label.check.wide[hidden] { display: none; }

/* ---------- Lot 3 : carte musculaire de la mascotte (maquettes 11, 14, 15, 16) ---------- */
/* Carte musculaire v2 (mascotte/src/carte.js) : silhouette sombre sous les muscles, qui dessine les séparations. */
.fig.carte .base { fill: #9d99b4; stroke: #9d99b4; }
.fig.carte .m { fill: #dedbe9; stroke: none; transition: fill .25s ease; }
.dark-page .fig.carte .base { fill: #14112a; stroke: #14112a; }
.dark-page .fig.carte .m { fill: #49436f; }
.dark-page .fig.carte .neutre { fill: #322d55; }
.dark-page .fig.carte .fibre { stroke: #0d0b1c; }
.fig.carte .m.r0 { fill: var(--good); } .fig.carte .m.r1 { fill: var(--warn); } .fig.carte .m.r2 { fill: var(--accent); }
.fig.carte .m.hit { fill: var(--accent); } .fig.carte .m.hit2 { fill: #f7a8bd; }
.fig.carte .m.h1 { fill: #f7a8bd; } .fig.carte .m.h2 { fill: var(--accent); }
.fig.carte .m.t0 { fill: #dedbe9; }
.dark-page .fig.carte .m.t0 { fill: #49436f; }
.body svg.carte { filter: none; }
.k-r2 { background: var(--accent); }
.fig.carte .m.t1 { fill: var(--t1); } .fig.carte .m.t2 { fill: var(--t2); } .fig.carte .m.t3 { fill: var(--t3); }
.fig.carte .m.t4 { fill: var(--t4); } .fig.carte .m.t5 { fill: var(--t5); } .fig.carte .m.t6 { fill: var(--t6); }

/* ---------- Lot 4 : notes de séance, saisie hors ligne ---------- */
.wnote summary { font-weight: 600; cursor: pointer; }
.wnote textarea { width: 100%; margin-top: 10px; resize: vertical; }
.srow.pending .ok { opacity: .55; outline: 2px dashed var(--warn); outline-offset: 2px; }
#offline { position: fixed; left: 12px; right: 12px; top: calc(8px + env(safe-area-inset-top)); z-index: 60; padding: 8px 12px; border-radius: 12px;
  background: #17142b; color: #fff; font-size: .8125rem; text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
#offline[hidden] { display: none; }

/* ---------- Lot 5 : anneau de l'avatar à la couleur du rang personnel ---------- */
#top .avatar.rkn { border-color: #b9b6c9; } #top .avatar.rk0 { border-color: #6f7482; } #top .avatar.rk1 { border-color: #c67a2b; } #top .avatar.rk2 { border-color: #93a3b8; }
#top .avatar.rk3 { border-color: #e6b63c; } #top .avatar.rk4 { border-color: #4fc9bd; } #top .avatar.rk5 { border-color: #4f8dff; } #top .avatar.rk6 { border-color: #e8305a; }
#top .avatar.rk7 { border-color: #a66bf0; } #top .avatar.rk8 { border-color: #ff3d9a; }
.rankhint { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px; border-radius: 12px; background: #fff5f8; font-size: .8125rem; color: #17142b; }
.rankhint .badge { width: 24px; height: 24px; flex: none; }
.rankhint b.rk0 { color: #6f7482; } .rankhint b.rk1 { color: #c67a2b; } .rankhint b.rk2 { color: #6f8196; } .rankhint b.rk3 { color: #c7971c; } .rankhint b.rk4 { color: #2ba598; }
.rankhint b.rk5 { color: #4f8dff; } .rankhint b.rk6 { color: #e8305a; } .rankhint b.rk7 { color: #a66bf0; } .rankhint b.rk8 { color: #ff3d9a; }
.today-art.mascot-art { display: block; }
.today-art.mascot-art svg { width: 100%; height: auto; display: block; }

/* ---------- Lot 6 : cloche des notifications ---------- */
#top .bell { position: relative; width: 40px; height: 40px; min-height: 0; padding: 0; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; box-shadow: none; flex: none; }
#top .bell svg { width: 20px; height: 20px; }
#top .bell i { display: none; position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: #f0457a; border: 2px solid #17142b; }
#top .bell.on i { display: block; }

/* ---------- Séance en cours d'après la maquette 08 ---------- */
.wsum-art { width: 58px; flex: none; }
.wsum-art svg { width: 100%; height: auto; display: block; }
.wsum small { color: var(--ink-3); }
.wchip { flex: none; padding: 4px 10px; border-radius: 9px; font-size: .72rem; font-weight: 600; background: #ffe7ef; color: #f0457a; white-space: nowrap; }
.wchip:empty { display: none; }
.wcard .wmuscles { color: var(--ink-3); }
.wcard .wvid { border-radius: 18px; }
.rankhint .grow { display: grid; gap: 5px; min-width: 0; }
.rankhint .rbar { display: block; height: 7px; border-radius: 4px; background: #f3d9e2; overflow: hidden; }
.rankhint .rbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #ff5a8e, #e8305a); }
.rbar .rw0 { width: 3%; } .rbar .rw1 { width: 10%; } .rbar .rw2 { width: 20%; } .rbar .rw3 { width: 30%; } .rbar .rw4 { width: 40%; } .rbar .rw5 { width: 50%; }
.rbar .rw6 { width: 60%; } .rbar .rw7 { width: 70%; } .rbar .rw8 { width: 80%; } .rbar .rw9 { width: 90%; } .rbar .rw10 { width: 100%; }
.wtools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wtool { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 12px; background: #f4f2fb; color: var(--ink); font-size: .8125rem; font-weight: 600; box-shadow: none; }
.wtool svg { width: 16px; height: 16px; }
.srow .prev { color: var(--ink-3); }
.restbar { border-radius: 18px; }

/* ---------- Version ordinateur d'après les maquettes desktop (menu latéral sombre, barre du haut, cartes claires) ---------- */
.side-label, #tabs .side-switch { display: none; }
@media (min-width: 1024px) {
  body.shell { padding: 0 0 40px 236px; background: #f4f4f9; }
  #tabs { width: 236px; padding: 22px 14px; gap: 3px; background: #17142b; display: flex; flex-direction: column; }
  #tabs[hidden] { display: none; }
  .side-logo { padding: 0 8px 18px; }
  .side-label { display: block; color: #8f8bb0; font-size: .65rem; letter-spacing: .09em; text-transform: uppercase; margin: 0 14px 8px; font-weight: 600; }
  #tabs button { min-height: 44px; padding: 0 14px; border-radius: 11px; font-size: .875rem; font-weight: 500; color: #cfcbe6; gap: 12px; width: 100%; }
  #tabs button svg.i { width: 20px; height: 20px; }
  #tabs button[aria-current="page"] { background: linear-gradient(90deg, #ff5a8e, #e8305a); color: #fff; font-weight: 600; box-shadow: 0 8px 18px rgba(232, 48, 90, .3); }
  #tabs .side-switch:not([hidden]) { display: flex; margin-top: auto; background: #221e3d; font-size: .78rem; }
  /* Barre du haut : le compte à droite, sur fond clair. */
  #top { position: static; background: transparent; color: #17142b; justify-content: flex-end; gap: 14px; padding: 18px 28px 0; min-height: 0; box-shadow: none; }
  #top #me { order: 2; color: inherit; }
  #top .me-level b { color: #17142b; }
  #top .me-level small { color: #6b6884; }
  #top .me-level progress { display: none; }
  #top .bell { background: #fff; color: #17142b; box-shadow: 0 2px 8px rgba(23, 20, 43, .06); }
  #top .bell i { border-color: #fff; }
  #top .pill { background: #fff; color: #17142b; box-shadow: 0 2px 8px rgba(23, 20, 43, .06); }
  main { max-width: 1180px; margin: 0; padding: 12px 28px 28px; }
  body.dark-page { background: #17142b; }
  body.dark-page #top .me-level b, body.dark-page #top { color: #fff; }
}

/* Blocs de l'accueil et liste des exercices de la séance : sans effet sur téléphone. */
.hb { display: contents; }
.wnav { display: none; }

/* Version ordinateur : accueil (maquette a01) et séance en cours (maquette a03) sur trois colonnes. */
@media (min-width: 1024px) {
  body.on-home main#view { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; align-items: start; }
  body.on-home main#view > * { grid-column: span 6; }
  body.on-home main#view > .darkzone { grid-column: span 4; align-self: stretch; margin: 0; border-radius: 24px; background: linear-gradient(120deg, #17142b 30%, #3a2a66); }
  body.on-home main#view > .hb { display: grid; gap: 12px; align-content: start; grid-template-columns: minmax(0, 1fr); }
  body.on-home main#view > .hb-side, body.on-home main#view > .hb-week, body.on-home main#view > .hb-last, body.on-home main#view > .hb-recup { grid-column: span 2; }
  body.on-home main#view > .darkzone { order: -3; }
  body.on-home main#view > .hb-side { order: -2; }
  body.on-home main#view > .hb-week, body.on-home main#view > .hb-recup, body.on-home main#view > .hb-last { order: -1; }
  body.on-home .hb-defis .list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  .wbar { max-width: 560px; }
  #wbody { display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; gap: 16px 20px; align-items: start; }
  #wbody[hidden] { display: none; }
  #wbody > * { grid-column: 3; }
  #wbody > #wprog, #wbody > #chrono-hint { grid-column: 1 / -1; }
  #wbody > .wnav { grid-column: 1; grid-row: 2 / span 6; display: grid; gap: 8px; padding: 16px; }
  #wbody > #cards { grid-column: 2; grid-row: 2 / span 6; }
  #wbody > #wprog, #wbody > #chrono-hint { grid-row: 1; }
  #cards > .wcard:not(.focus) { display: none; }
  .wnav h3 { margin: 0 0 4px; font-size: 1rem; }
  .wnav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 2px solid transparent; border-radius: 14px; background: var(--bg, #f5f4f9); text-align: left; }
  .wnav-item[aria-current] { border-color: var(--accent); background: #fff; }
  .wnav-item i { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cfcbdc; display: grid; place-items: center; color: #fff; }
  .wnav-item.done i { background: var(--accent); border-color: var(--accent); }
  .wnav-item i svg { width: 12px; height: 12px; }
  .wnav-item b { display: block; font-size: .9375rem; }
  .wnav-item small { display: block; color: var(--ink-3); font-size: .8125rem; }
  .wnav-add { justify-content: center; width: 100%; }
  .wcard [data-goto-add] { display: none; }
}

/* Téléphone : écran figé comme une application native (pas de zoom, pas de déplacement de droite à gauche, pas de rebond). */
@media (max-width: 1023px) {
  html, body { overflow-x: clip; overscroll-behavior: none; touch-action: pan-x pan-y; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  main { overflow-x: clip; }
  /* Sans compte, pas de barre d'onglets : la page ne réserve pas sa place (l'écran de bienvenue ne défile plus). */
  body:has(#tabs[hidden]) { padding-bottom: env(safe-area-inset-bottom); }
}

/* Mise à jour de l'application : fenêtre des nouveautés et pastille « Mise à jour disponible ». */
dialog.update { border: 0; padding: 0; border-radius: 24px; background: var(--surface); color: var(--ink); width: min(440px, calc(100vw - 28px)); max-height: min(640px, calc(100dvh - 48px)); box-shadow: 0 24px 60px rgba(23, 20, 43, .45); overflow: hidden; }
dialog.update[open] { display: flex; flex-direction: column; }
dialog.update::backdrop { background: rgba(10, 6, 18, .72); }
.up-head { display: flex; align-items: center; gap: 14px; padding: 18px; background: linear-gradient(120deg, #17142b 30%, #3a2a66); color: #fff; }
.up-head h3 { margin: 0; font-size: 1.1875rem; }
.up-head p { margin: 2px 0 0; font-size: .875rem; color: #cfcbe6; }
.up-art { flex: none; width: 64px; }
.up-art svg { display: block; width: 100%; height: auto; }
.up-body { padding: 4px 18px; overflow-y: auto; overscroll-behavior: contain; }
.up-body section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.up-body section:last-child { border-bottom: 0; }
.up-body h4 { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 1rem; }
.up-body h4 small { font-weight: 500; font-size: .8125rem; color: var(--ink-3); }
.up-title { margin: 2px 0 0; font-size: .875rem; color: var(--ink-3); }
.up-body ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.up-body li { font-size: .9375rem; line-height: 1.35; }
.up-tag { display: inline-block; margin-right: 8px; padding: 2px 8px; border-radius: 999px; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: #e8e5f7; color: #5a45c9; vertical-align: 1px; }
.up-tag.t-nouveau { background: #ffe3ec; color: #d9265a; }
.up-tag.t-correction { background: #dff5ec; color: #14805a; }
.up-foot { padding: 14px 18px 16px; display: grid; gap: 6px; justify-items: center; border-top: 1px solid var(--line); }
.up-foot .small { margin: 0; color: var(--ink-3); }
#update-chip { position: fixed; z-index: 8; left: 50%; transform: translateX(-50%); bottom: calc(100px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 999px;
  background: linear-gradient(90deg, #ff5a8e, #e8305a); color: #fff; font-weight: 600; font-size: .875rem; box-shadow: 0 10px 24px rgba(232, 48, 90, .4); white-space: nowrap; }
#update-chip svg { width: 18px; height: 18px; }
body.has-timer #update-chip { bottom: auto; top: calc(12px + env(safe-area-inset-top)); }
.whatsnew { display: block; margin: 4px auto 0; font-size: .8125rem; }
@media (min-width: 1024px) { #update-chip { left: auto; right: 28px; transform: none; bottom: 28px; } }

.rolereq { border-left: 4px solid var(--warn); }
.rolereq p { margin: 4px 0 0; font-size: .875rem; }
/* Séance à la maison : exercice infaisable avec le matériel de l'adhérent, et ce qu'il peut faire à la place. */
.homeswap { display: grid; gap: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; }
/* Série sans charge (répétitions seules ou durée) : une seule case de saisie. */
.srow.one { grid-template-columns: 28px minmax(0, .9fr) minmax(0, 2fr) 36px; }
.srow .dur { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 6px; align-items: center; }
.srow .dur .setchrono { width: 40px; min-height: 38px; padding: 0; border: 0; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.srow .dur .setchrono.on { background: var(--btn); color: #fff; }
/* Animations de récompense (§ 6 quinquies.4) : un voile plein écran, une étape à la fois, passable d'un toucher. */
.celebrate { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 70% 10%, #34295f 0, #1d1936 50%, #14112a 100%); color: #fff; text-align: center; overflow: hidden; cursor: pointer; }
.celebrate .cel-step { position: relative; z-index: 1; width: min(420px, 100%); }
.celebrate .cel-box { display: grid; gap: 14px; justify-items: center; }
.celebrate .cel-mascot { width: 190px; }
.celebrate .cel-mascot .mlive, .celebrate .cel-mascot svg { width: 100%; height: auto; display: block; }
.celebrate .cel-title { font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.celebrate .cel-title.xl { font-size: 2.4rem; }
.celebrate .cel-xp { font-size: 2rem; font-weight: 800; color: #ff8fb5; font-variant-numeric: tabular-nums; }
.celebrate .cel-eyebrow { font-size: .85rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #ff8fb5; }
.celebrate .cel-sub { margin: 0; color: #cfc9e6; }
.celebrate .cel-ico { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: #ff2f7d; }
.celebrate .cel-ico svg.i { width: 48px; height: 48px; }
.celebrate .cel-list { display: grid; gap: 4px; color: #cfc9e6; }
.celebrate .cel-badges { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.celebrate .cel-badge { display: grid; gap: 6px; justify-items: center; max-width: 120px; }
.celebrate .cel-badge small { color: #cfc9e6; }
.celebrate .cel-rank { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 150px; }
.celebrate .cel-old { opacity: .45; }
/* Les tailles de badge et les boutons de l'application sont définis pour ses écrans (.mq) : le voile a les siens. */
.celebrate .badge { display: block; }
.celebrate .badge.b56 { width: 64px; height: 64px; } .celebrate .badge.b76 { width: 92px; height: 92px; } .celebrate .badge.b96 { width: 150px; height: 150px; }
.celebrate .cel-actions .btn { display: flex; align-items: center; justify-content: center; min-height: 50px; border: 0; border-radius: 14px; background: linear-gradient(90deg, #ff5a8e, #e8305a); color: #fff; font-weight: 600; font-size: 15px; }
.celebrate .cel-actions { display: grid; gap: 10px; width: 100%; margin-top: 8px; }
.celebrate .cel-actions .btn.ghost { background: transparent; color: #fff; border: 1px solid #ffffff44; }
.celebrate .cel-skip { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 2; min-height: 36px; padding: 6px 14px; border-radius: 18px; border: 1px solid #ffffff33; background: #ffffff14; color: #fff; font-size: .82rem; }
.celebrate .cel-hint { position: absolute; left: 0; right: 0; bottom: max(22px, env(safe-area-inset-bottom)); margin: 0; font-size: .8rem; color: #8f8aad; }
.celebrate .cel-confetti { position: absolute; inset: 0; pointer-events: none; }
.celebrate .cel-confetti i { position: absolute; top: -18px; width: 9px; height: 15px; border-radius: 2px; opacity: 0; }
.celebrate .cel-confetti i.c0 { background: #ff2f7d; } .celebrate .cel-confetti i.c1 { background: #ff8fb5; } .celebrate .cel-confetti i.c2 { background: #f5c044; }
.celebrate .cel-confetti i.c3 { background: #7c6cff; } .celebrate .cel-confetti i.c4 { background: #2bb8a6; }
@keyframes cel-in { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes cel-pop { 0% { opacity: 0; transform: scale(.3) rotate(-12deg); } 60% { opacity: 1; transform: scale(1.14) rotate(4deg); } 100% { opacity: 1; transform: none; } }
@keyframes cel-fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(105vh) rotate(540deg); } }
@keyframes cel-old { from { opacity: 1; transform: none; } to { opacity: .45; transform: translateX(-6px) scale(.9); } }
@media (prefers-reduced-motion: no-preference) {
  .celebrate .cel-step { animation: cel-in .35s ease-out both; }
  .celebrate .cel-ico, .celebrate .cel-badge { animation: cel-pop .6s cubic-bezier(.2, .9, .3, 1.3) both; }
  .celebrate .cel-badge:nth-child(2) { animation-delay: .15s; } .celebrate .cel-badge:nth-child(3) { animation-delay: .3s; }
  .celebrate .cel-rang .cel-new { animation: cel-pop .9s cubic-bezier(.2, .9, .3, 1.3) .25s both; }
  .celebrate .cel-rang .cel-old { animation: cel-old .5s ease-in both; }
  .celebrate .cel-confetti i { animation: cel-fall 2.2s linear both; }
}
/* Un message (carte enregistrée, erreur de partage) doit rester lisible au-dessus du voile. */
#toast { z-index: 500; }
/* Calculateur de disques (§ 6 quinquies.7) : la barre vue de côté, un disque par pastille, du plus lourd au plus léger. */
dialog.platecalc { width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; text-align: left; }
dialog.platecalc h2 { margin: 0 0 10px; font-size: 1.2rem; }
dialog.platecalc h3 { margin: 14px 0 6px; font-size: 1rem; }
dialog.platecalc .choices { margin-bottom: 8px; }
dialog.platecalc .chip[aria-pressed="true"] { background: var(--btn); color: #fff; border-color: var(--btn); }
.pc-bar { display: flex; align-items: center; gap: 3px; min-height: 96px; padding: 8px 0; overflow-x: auto; }
.pc-bar .pc-sleeve { flex: 0 0 34px; height: 10px; border-radius: 3px; background: #9aa0b4; }
.pc-bar .pc-plate { flex: 0 0 auto; width: 22px; border-radius: 5px; display: grid; place-items: center; background: #262140; color: #fff; }
.pc-bar .pc-plate b { font-size: .62rem; font-weight: 700; writing-mode: vertical-rl; }
.pc-bar .p25 { height: 92px; background: #e8305a; } .pc-bar .p20 { height: 92px; background: #3f6fd8; } .pc-bar .p15 { height: 80px; background: #e0a82e; color: #2a2140; }
.pc-bar .p10 { height: 66px; background: #2b9c6a; } .pc-bar .p5 { height: 50px; width: 18px; background: #f1eff8; color: #2a2140; }
.pc-bar .p2_5 { height: 40px; width: 15px; background: #55506e; } .pc-bar .p1_25 { height: 32px; width: 13px; background: #8f8aad; }
.pc-warm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pc-warm div { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.pc-warm small { color: var(--ink-3); }
/* Quatre outils sous une série quand le calculateur de disques est proposé. */
.wtools { grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); }
/* Types de série et supersets (§ 6 quinquies.7) : le numéro d'une série à faire est un bouton, É = échauffement, D = dégressive. */
.srow button.n { width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 10px; box-shadow: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.srow .n.k-echauffement { border-radius: 10px; background: color-mix(in srgb, var(--warn) 24%, transparent); color: color-mix(in srgb, var(--warn) 55%, var(--ink)); }
.srow .n.k-degressive { border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.wkindtip { margin: 0; color: var(--ink-3); }
.wcard.in-superset { border-left: 4px solid var(--btn); }
.wlink { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); font-size: .8125rem; }
.wlink svg { flex: none; width: 16px; height: 16px; color: var(--accent); }
.wtool[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
