/* Layout: carnet de coaching — en-tête, onglets collants, sections en colonne lisible. */
:root {
  --bg: #f3f6f2;
  --surface: #ffffff;
  --surface-2: #e8eee8;
  --ink: #16211b;
  --muted: #56645b;
  --line: #d3ddd5;
  --accent: #1d5c45;
  --accent-ink: #ffffff;
  --accent-soft: #d6e9df;
  --saffron: #b5730f;
  --saffron-soft: #f6e7cc;
  --ok: #23774f;
  --warn: #a06300;
  --alert: #b3352b;
  --ok-soft: #dcefe3;
  --warn-soft: #f8ebd2;
  --alert-soft: #f7dcd8;
  --macro-p: #1d5c45;
  --macro-c: #c58a24;
  --macro-f: #7a5a9c;
  --pack-blue: #34407a;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 10px;
  --gutter: 16px;
  /* Zones système (barre d'état, barre de gestes) : variables injectées par
     l'appli Android (Capacitor), sinon valeurs du navigateur. */
  --sat: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --sab: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101713;
    --surface: #18221c;
    --surface-2: #213029;
    --ink: #e7efe9;
    --muted: #a3b3a8;
    --line: #2e4036;
    --accent: #6cc39a;
    --accent-ink: #0d1a13;
    --accent-soft: #1f3a2d;
    --saffron: #e2a94a;
    --saffron-soft: #3a2d16;
    --ok: #6cc39a;
    --warn: #e2a94a;
    --alert: #f08a7f;
    --ok-soft: #1f3a2d;
    --warn-soft: #3a2d16;
    --alert-soft: #3d1f1c;
    --macro-p: #6cc39a;
    --macro-c: #e2a94a;
    --macro-f: #b598d6;
    --pack-blue: #8a96d6;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #101713;
  --surface: #18221c;
  --surface-2: #213029;
  --ink: #e7efe9;
  --muted: #a3b3a8;
  --line: #2e4036;
  --accent: #6cc39a;
  --accent-ink: #0d1a13;
  --accent-soft: #1f3a2d;
  --saffron: #e2a94a;
  --saffron-soft: #3a2d16;
  --ok: #6cc39a;
  --warn: #e2a94a;
  --alert: #f08a7f;
  --ok-soft: #1f3a2d;
  --warn-soft: #3a2d16;
  --alert-soft: #3d1f1c;
  --macro-p: #6cc39a;
  --macro-c: #e2a94a;
  --macro-f: #b598d6;
  --pack-blue: #8a96d6;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 500; }
p { margin: 0; }
ul { margin: 0; padding-left: 1.2em; }
li + li { margin-top: 0.25em; }

.num, .data { font-family: var(--font-data); font-variant-numeric: tabular-nums; }

/* ---------- En-tête et onglets ---------- */
.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 18px 12px;
  padding-inline: var(--gutter);
  max-width: 1080px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 46px; height: 23px; fill: var(--ink); flex: none; }
.brand-word { display: block; height: 17px; width: auto; fill: var(--ink); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.01em; }
.brand-tag { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; }
.header-summary { font-size: 0.9rem; color: var(--muted); min-width: 0; }

.bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: var(--sab);
  box-shadow: 0 -2px 12px rgb(0 0 0 / 0.06);
}
.tabs-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 640px;
  margin: 0 auto;
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 58px; padding: 6px 2px;
  font: inherit; color: var(--muted); background: none; border: 0; cursor: pointer;
  border-top: 3px solid transparent;
}
.nav-ico { display: grid; place-items: center; width: 44px; height: 28px; border-radius: 999px; transition: background-color 0.15s; }
.nav-ico .ico { width: 22px; height: 22px; }
.nav-lbl { font-size: 0.74rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nav-btn[aria-current="page"] { color: var(--accent); }
.nav-btn[aria-current="page"] .nav-ico { background: var(--accent-soft); }
.nav-btn[aria-current="page"] .ico { stroke-width: 2.3; }
body { padding-bottom: calc(66px + var(--sab)); padding-top: var(--sat); }
/* Fond opaque sous la barre d'état pour que rien ne passe en transparence. */
body::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: var(--sat);
  background: var(--bg); z-index: 30; pointer-events: none;
}

.subnav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: -8px; }
.subnav::-webkit-scrollbar { display: none; }
.subnav-btn {
  flex: none; min-height: 40px; padding: 8px 16px; border-radius: 999px;
  font: 700 0.92rem var(--font-body); color: var(--muted);
  background: var(--surface-2); border: 1px solid transparent; cursor: pointer;
}
.subnav-btn[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.back-btn { justify-self: start; margin-bottom: -12px; }

.coach-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 8px 16px; border-radius: 999px;
  font: 700 0.95rem var(--font-body); color: var(--accent-ink); background: var(--accent);
  border: 0; cursor: pointer;
}
.coach-btn .ico { width: 20px; height: 20px; }
.coach-btn[hidden] { display: none; }
.header-summary { flex-basis: 100%; }
.today-card .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.today-card .stat { padding: 10px; }
.today-card .stat .value { font-size: 1.25rem; }
.tab:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app-main {
  max-width: 1080px;
  margin: 0 auto;
  padding-block: 24px 40px;
  padding-inline: var(--gutter);
  display: grid;
  gap: 28px;
}
.app-main:focus { outline: none; }

.app-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding-block: 0 32px;
  padding-inline: var(--gutter);
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- Bandeau d'installation ---------- */
.install-banner {
  max-width: 1080px;
  margin: 12px auto 0;
  margin-inline: max(var(--gutter), calc((100% - 1080px) / 2));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

/* ---------- Blocs génériques ---------- */
.section { display: grid; gap: 14px; min-width: 0; }
.section-head { display: grid; gap: 4px; }
.lede { color: var(--muted); max-width: 65ch; }
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.stack { display: grid; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.notice {
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--warn-soft);
  color: var(--ink);
  border-left: 4px solid var(--warn);
}
.notice.info { background: var(--accent-soft); border-left-color: var(--accent); }
.notice.alert { background: var(--alert-soft); border-left-color: var(--alert); }
.notice ul { margin-top: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.alert { background: var(--alert-soft); color: var(--alert); }
.chip.info { background: var(--accent-soft); color: var(--accent); }
.chip.saffron { background: var(--saffron-soft); color: var(--saffron); }

.btn {
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  border-radius: 8px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: 0.9rem; }

/* ---------- Formulaire ---------- */
.form { display: grid; gap: 18px; }
.fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; min-width: 0; }
.fieldset legend { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; padding: 0; }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.field { display: grid; gap: 4px; min-width: 0; }
.field label, .field .label { font-size: 0.9rem; font-weight: 700; }
.field small { color: var(--muted); font-size: 0.8rem; }
input[type="text"], input[type="number"], input[type="date"], select {
  font: inherit;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 0.92rem;
}
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.checks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.errors { margin: 0; }

/* ---------- Bilan ---------- */
.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.stat { display: grid; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stat .value { font-family: var(--font-data); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 0.8rem; color: var(--muted); margin-left: 4px; }
.stat .caption { font-size: 0.82rem; color: var(--muted); }
.stat.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.stat.primary .caption, .stat.primary .value small { color: var(--accent-ink); opacity: 0.85; }

.macro-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.macro-bar span { display: block; height: 100%; }
.macro-legend { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.macro-legend div { display: grid; grid-template-columns: 12px 1fr; column-gap: 8px; align-items: baseline; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.macro-legend .data { grid-column: 2; font-size: 1.05rem; }
.macro-legend .caption { grid-column: 2; font-size: 0.8rem; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
td.data { white-space: nowrap; }

/* ---------- Entraînement ---------- */
.week { display: grid; gap: 8px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day-cell {
  font: inherit;
  text-align: left;
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
}
.day-cell .d { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.day-cell .t { font-size: 0.85rem; font-weight: 700; overflow-wrap: anywhere; }
.day-cell .m { font-family: var(--font-data); font-size: 0.78rem; color: var(--muted); }
.day-cell.strength { border-top: 4px solid var(--accent); }
.day-cell.cardio { border-top: 4px solid var(--saffron); }
.day-cell.rest { border-top: 4px solid var(--line); background: var(--bg); }
.day-cell[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 1px; }

.session-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.exercise-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.exercise {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.exercise:last-child { border-bottom: 0; }
.exercise .name { font-weight: 700; }
.exercise .cue { grid-column: 1 / -1; font-size: 0.88rem; color: var(--muted); }
.exercise .rx { font-family: var(--font-data); font-size: 0.9rem; text-align: right; white-space: nowrap; }
.exercise .rx small { display: block; color: var(--muted); font-size: 0.78rem; }

/* ---------- Alimentation ---------- */
.day-picker { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.day-pill {
  font: inherit;
  font-size: 0.88rem;
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.day-pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
.meal { display: grid; gap: 8px; --meal: var(--accent); --meal-soft: var(--accent-soft); border-top: 5px solid var(--meal); overflow: hidden; }
.meal[data-type="breakfast"] { --meal: #e8962e; --meal-soft: #fdf0dc; }
.meal[data-type="lunch"] { --meal: #d0573a; --meal-soft: #fbe6df; }
.meal[data-type="dinner"] { --meal: #5a5fc4; --meal-soft: #e8e8fa; }
.meal[data-type="snack"] { --meal: #2f9e7e; --meal-soft: #dcf2ea; }
.meal .eyebrow { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--meal-soft); color: var(--meal); font-weight: 700; }
.meal .ingredients li::marker, .meal .ingredients .qty { color: var(--meal); }
.meal .alt summary { color: var(--meal); }
.partner-dish { display: grid; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--meal-soft); }
.partner-dish .btn { justify-self: start; }
.club-input { flex: 1 1 160px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; text-transform: uppercase; background: var(--surface); color: inherit; }
.club-badge { margin: 0; display: flex; gap: 8px; align-items: center; }
.club-badge a { color: var(--accent); font-weight: 700; font-size: 0.9rem; }
.club-card h4 { margin: 0; }
.class-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.class-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); }
.class-item.today { border-color: var(--accent); background: var(--accent-soft); }
.club-card-full { position: fixed; inset: 0; z-index: 1000; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; color: #111; }
.club-card-full img { max-width: 100%; max-height: 75vh; object-fit: contain; }
.club-reward { display: grid; gap: 8px; }
.club-card-full.reward { background: var(--accent); color: #fff; text-align: center; }
.reward-streak { font: 800 3.2rem var(--font-display); margin: 0; }
.health-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.health-q { display: grid; gap: 6px; }
.seasonal { background: #10221b; color: #f2f5f3; border-color: #10221b; }
.seasonal h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; letter-spacing: -0.5px; }
.seasonal .eyebrow, .seasonal .caption-muted { color: #a9c2b6; }
.seasonal .btn.ghost { color: #f2f5f3; border-color: #a9c2b6; }
.shop-partner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.water-sponsor { grid-column: 1 / -1; margin: 4px 0 0; }
.meal-photo { display: block; width: calc(100% + 2 * 18px); max-width: none; margin: calc(-1 * 18px) calc(-1 * 18px) 4px; aspect-ratio: 16 / 9; object-fit: cover; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .meal[data-type="breakfast"] { --meal: #f2b45c; --meal-soft: #3a2c16; }
  :root:not([data-theme="light"]) .meal[data-type="lunch"] { --meal: #ee8a6f; --meal-soft: #3b211a; }
  :root:not([data-theme="light"]) .meal[data-type="dinner"] { --meal: #9ea2f0; --meal-soft: #24254a; }
  :root:not([data-theme="light"]) .meal[data-type="snack"] { --meal: #6cc9a9; --meal-soft: #173a2f; }
}
:root[data-theme="dark"] .meal[data-type="breakfast"] { --meal: #f2b45c; --meal-soft: #3a2c16; }
:root[data-theme="dark"] .meal[data-type="lunch"] { --meal: #ee8a6f; --meal-soft: #3b211a; }
:root[data-theme="dark"] .meal[data-type="dinner"] { --meal: #9ea2f0; --meal-soft: #24254a; }
:root[data-theme="dark"] .meal[data-type="snack"] { --meal: #6cc9a9; --meal-soft: #173a2f; }
.meal-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.meal-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.meal-macros { font-family: var(--font-data); font-size: 0.82rem; color: var(--muted); }
.ingredients { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; font-size: 0.93rem; }
.ingredients li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted var(--line); padding: 3px 0; }
.ingredients .qty { font-family: var(--font-data); font-size: 0.85rem; white-space: nowrap; color: var(--muted); }

details.alt { border-top: 1px dashed var(--line); padding-top: 8px; display: grid; gap: 6px; }
details.alt summary { cursor: pointer; font-size: 0.9rem; font-weight: 700; color: var(--accent); }
details.alt[open] summary { margin-bottom: 4px; }
details.rule { border-bottom: 1px solid var(--line); padding: 10px 0; }
details.rule summary { cursor: pointer; font-weight: 700; font-family: var(--font-display); }
details.rule ul { margin-top: 8px; }

/* ---------- Compléments ---------- */
.supp { display: grid; gap: 8px; }
.supp-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: center; }
.supp dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 0.92rem; }
.supp dt { color: var(--muted); }
.supp dd { margin: 0; min-width: 0; }
.supp .cautions { font-size: 0.88rem; color: var(--warn); }
.supp.recommande { border-left: 4px solid var(--ok); }
.supp.medical { border-left: 4px solid var(--alert); }
.supp.envisager { border-left: 4px solid var(--saffron); }
.avoid-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.avoid-list li { display: grid; gap: 2px; }

/* Routine par moment de la journée */
.moment-group { display: grid; gap: 10px; }
.moment-title { display: flex; align-items: baseline; gap: 10px; padding-left: 10px; border-left: 4px solid var(--line); }
.moment-title span { font-family: var(--font-body); font-weight: 400; font-size: 0.88rem; color: var(--muted); }
.moment-matin { border-left-color: var(--macro-c); }
.moment-midi { border-left-color: var(--accent); }
.moment-soir { border-left-color: var(--macro-f); }

/* ---------- Pack (mention discrète) ---------- */
.pack-note { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--radius); border: 1px dashed var(--line); color: var(--muted); font-size: 0.92rem; max-width: 70ch; }
.pack-note strong { color: var(--ink); }
.pack-warn { color: var(--warn); font-size: 0.86rem; }
.pack-note h3 { color: var(--ink); }
.pack-moments { list-style: none; padding: 0; display: grid; gap: 4px; }
.pack-moments li { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 8px; }
.pack-moments li > span:last-child { min-width: 0; }
.pack-dot { width: 18px; height: 8px; border-radius: 4px; display: inline-block; flex: none; }
.pack-matin { background: var(--macro-c); }
.pack-midi { background: var(--accent); }
.pack-soir { background: var(--pack-blue); }
.pack-link { font-weight: 700; color: var(--accent); }
.pack-link:hover { text-decoration-thickness: 2px; }

/* ---------- Quotidien ---------- */
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width 0.25s ease; }
.habit {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.habit:last-child { border-bottom: 0; }
.habit input[type="checkbox"] { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); }
.habit label { font-weight: 700; cursor: pointer; }
.habit .detail { grid-column: 2; font-size: 0.88rem; color: var(--muted); }
.habit.done label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--accent); }
.water { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.glasses { display: flex; flex-wrap: wrap; gap: 4px; }
.glass { width: 14px; height: 20px; border: 2px solid var(--accent); border-top-width: 0; border-radius: 0 0 4px 4px; }
.glass.full { background: var(--accent); }

/* ---------- Confidentialité ---------- */
.optional { font-family: var(--font-body); font-weight: 400; font-size: 0.85rem; color: var(--muted); }
.remember { padding: 12px; border-radius: var(--radius); background: var(--surface-2); }
.consent a, .app-footer a { color: var(--accent); font-weight: 700; }
.btn.danger { background: var(--alert); border-color: var(--alert); color: var(--surface); }
.prose .panel h2 { font-size: 1.1rem; margin-top: 6px; }
.prose .panel p, .prose .panel li { max-width: 65ch; }
.app-footer { display: grid; gap: 6px; }

/* ---------- Liste de courses ---------- */
.shop summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.shop-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.shop[open] summary { margin-bottom: 8px; }
.shop { display: grid; gap: 10px; }
.shop-aisles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.shop-aisle h3 { font-size: 0.95rem; margin-bottom: 4px; }
.shop-list { list-style: none; padding: 0; display: grid; gap: 2px; }
.shop-list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dotted var(--line); font-size: 0.92rem; }
.shop-list label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; min-width: 0; }
.shop-list input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.shop-list .qty { font-family: var(--font-data); font-size: 0.84rem; color: var(--muted); white-space: nowrap; }
.shop-list li.got span:not(.qty) { text-decoration: line-through; color: var(--muted); }

/* ---------- Défis et badges ---------- */
.flash { margin: 0; }
.caption-muted { font-size: 0.82rem; color: var(--muted); }
.challenge-list { list-style: none; padding: 0; display: grid; gap: 0; }
.challenge-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.challenge-item:last-child { border-bottom: 0; }
.challenge-item > div { display: grid; gap: 2px; min-width: 0; }
.challenge-item .detail { font-size: 0.86rem; color: var(--muted); }
.challenge { border-left: 4px solid var(--saffron); }
.badge-grid { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.badge { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 12px 8px; border-radius: var(--radius); border: 1px dashed var(--line); color: var(--muted); font-size: 0.82rem; }
.badge strong { color: var(--muted); font-size: 0.9rem; }
.badge-medal { font-size: 1.8rem; line-height: 1; }
.badge.earned { border-style: solid; border-color: var(--saffron); background: var(--saffron-soft); color: var(--ink); }
.badge.earned strong { color: var(--ink); }
.badge.earned .badge-medal { color: var(--saffron); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- Quiz ---------- */
.quiz { list-style: none; padding: 0; display: grid; gap: 16px; }
.quiz-q { display: grid; gap: 8px; }
.quiz-opts { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.quiz-opt { font: inherit; text-align: left; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.quiz-opt:hover:not([disabled]) { border-color: var(--accent); }
.quiz-opt[disabled] { cursor: default; }
.quiz-opt.right { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); font-weight: 700; }
.quiz-opt.wrong { background: var(--alert-soft); border-color: var(--alert); color: var(--alert); }
.quiz-why { font-size: 0.9rem; color: var(--muted); }
.quiz-why.ok { color: var(--ok); }

/* ---------- Roue ---------- */
.wheel-wrap { position: relative; width: min(260px, 80%); margin: 6px auto; aspect-ratio: 1; max-width: 100%; }
.wheel {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--accent) 0 60deg, var(--saffron) 60deg 120deg, var(--macro-f) 120deg 180deg, var(--accent) 180deg 240deg, var(--saffron) 240deg 300deg, var(--macro-f) 300deg 360deg);
  border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--line);
}
.wheel-label { position: absolute; left: 50%; top: 50%; font-family: var(--font-data); font-size: 0.82rem; font-weight: 700; color: var(--surface); white-space: nowrap; }
.wheel-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 20px solid var(--ink); z-index: 2; }

/* ---------- Ramadan ---------- */
.ramadan { border-top: 4px solid var(--saffron); }
.rgrid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.rcell { display: grid; place-items: center; aspect-ratio: 1; border-radius: 6px; font-family: var(--font-data); font-size: 0.8rem; background: var(--surface-2); color: var(--muted); }
.rcell.past { background: var(--accent-soft); color: var(--accent); }
.rcell.today { background: var(--saffron); color: var(--surface); font-weight: 700; }
.ramadan-past { list-style: none; padding: 0; display: grid; gap: 6px; margin-top: 8px; font-size: 0.9rem; }
.ramadan details summary { cursor: pointer; font-weight: 700; color: var(--accent); }

/* ---------- Avantages ---------- */
.perk { display: grid; gap: 6px; align-content: start; }
.perk.open { border-left: 4px solid var(--ok); }
.perk-soon, .perk-lock { font-size: 0.9rem; color: var(--muted); }
.perk-code { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.perk-code .data { font-size: 1.2rem; padding: 4px 10px; border: 2px dashed var(--accent); border-radius: 8px; }
.perk-group { margin: 22px 0 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.perk-group .caption-muted { font-size: 0.85rem; font-weight: 400; }

/* ---------- Suivi ---------- */
.weight-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.weight-form .field { flex: 1 1 140px; }

@media (max-width: 560px) {
  .rtable thead { display: none; }
  .rtable tr { display: grid; gap: 2px 12px; grid-template-columns: auto 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .rtable th, .rtable td { border: 0; padding: 0; }
  .rtable td:last-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  h1 { font-size: 1.55rem; }
  .week { grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Coach */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat { display: grid; gap: 10px; margin: 8px 0 12px; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 14px; line-height: 1.45; display: grid; gap: 6px; justify-items: start; overflow-wrap: anywhere; }
.bubble ul { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
.bubble.coach { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.coach.urgent { background: var(--alert-soft); border-color: var(--alert); }
.bubble.me { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip-btn { font: inherit; font-size: 0.88rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); cursor: pointer; text-align: left; }
.chip-btn:hover { filter: brightness(1.05); }
.chat-form { display: flex; gap: 8px; position: sticky; bottom: 0; padding: 10px 0; background: var(--bg); }
.chat-form input { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
/* Exercices par muscle */
.muscles { display: grid; gap: 8px; }
.muscle { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.muscle > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 700; list-style: none; }
.muscle > summary::-webkit-details-marker { display: none; }
.muscle > summary::after { content: "▾"; color: var(--muted); margin-left: 4px; }
.muscle[open] > summary::after { content: "▴"; }
.muscle > summary span:first-child { flex: 1; }
.muscle .exercise-list, .muscle .caption-muted { padding: 0 14px 10px; }

/* Illustrations des exercices */
.exercise.has-ill { grid-template-columns: 128px 1fr auto; }
.exercise.has-ill .ex-ill { grid-row: 1 / span 2; width: 128px; border-radius: 8px; background: var(--surface-2); padding: 4px; }
.exercise.has-ill .cue { grid-column: 2 / -1; }
@media (max-width: 480px) {
  .exercise.has-ill { grid-template-columns: 108px 1fr; gap: 2px 12px; }
  .exercise.has-ill .ex-ill { width: 108px; grid-row: 1 / span 3; }
  .exercise.has-ill .rx { text-align: left; white-space: normal; }
  .exercise.has-ill .rx small { display: inline; margin-left: 8px; }
  .exercise.has-ill .cue { grid-column: 2; }
}
.ill {
  width: 100%; height: auto; display: block; overflow: visible;
  --fig-skin: #d9a27b; --fig-skin-2: #b98460;
  --fig-shirt: #1f6b50; --fig-shirt-2: #164d3a;
  --fig-shorts: #2f3d57; --fig-shorts-2: #232e42;
  --fig-shoe: #3b4450; --fig-hair: #2a1f19;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ill { --fig-shirt: #4fae84; --fig-shirt-2: #3a8564; --fig-shorts: #5a6f96; --fig-shorts-2: #45577a; --fig-shoe: #c9d1d9; }
}
:root[data-theme="dark"] .ill { --fig-shirt: #4fae84; --fig-shirt-2: #3a8564; --fig-shorts: #5a6f96; --fig-shorts-2: #45577a; --fig-shoe: #c9d1d9; }
.ill line, .ill polyline, .ill circle, .ill rect, .ill polygon { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ill .ground { stroke: var(--line); stroke-width: 1.5; }
/* Personnage : peau, tee-shirt, short, chaussures, cheveux */
.ill .skin { stroke: var(--fig-skin); }
.ill .skin.back { stroke: var(--fig-skin-2); }
.ill .thigh { stroke-width: 8.5; }
.ill .shin { stroke-width: 6.5; }
.ill .upper { stroke-width: 6; }
.ill .fore { stroke-width: 5; }
.ill .neck { stroke-width: 4; }
.ill .hand { fill: var(--fig-skin); stroke: none; }
.ill .hand.back { fill: var(--fig-skin-2); }
.ill .face { fill: var(--fig-skin); stroke: none; }
.ill .hair { fill: var(--fig-hair); stroke: none; }
.ill .shirt { stroke: var(--fig-shirt); }
.ill .shirt.back { stroke: var(--fig-shirt-2); }
.ill .sleeve { stroke-width: 7.5; }
.ill polygon.shirt { fill: var(--fig-shirt); stroke-width: 4; }
.ill .shorts { stroke: var(--fig-shorts); }
.ill .shorts.back { stroke: var(--fig-shorts-2); }
.ill .shorts.thigh { stroke-width: 9.5; }
.ill polygon.shorts { fill: var(--fig-shorts); stroke-width: 4; }
.ill .shoe { stroke: var(--fig-shoe); stroke-width: 4.5; }
.ill .shoe.back { opacity: 0.8; }
/* Matériel */
.ill .gear, .ill .gear line { stroke: var(--muted); stroke-width: 2; }
.ill .gear.thick, .ill .gear .thick { stroke-width: 3.5; }
.ill .gear.dashed { stroke-dasharray: 3 3; }
.ill .gear.fill { fill: var(--muted); stroke: none; }
.ill rect.gear { fill: var(--surface); }
.ill .weight { stroke: var(--saffron); stroke-width: 2.5; }
.ill .weight.thick { stroke-width: 3; }
.ill .weight.fill { fill: var(--saffron); stroke: none; }
.ill .band { stroke: var(--alert); stroke-width: 1.5; stroke-dasharray: 2 2; }
.ill .cable { stroke: var(--muted); stroke-width: 1; }
.ill .breath { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
.ill .ghost { opacity: 0.3; }

/* Entraînement : sous-onglets */
.seg { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--surface-2); border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-btn { flex: 1 0 auto; font: inherit; font-weight: 700; font-size: 0.9rem; padding: 8px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg-btn[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.seg-btn.live { color: var(--alert); }
.day-cell.done { outline: 2px solid var(--ok); outline-offset: -2px; }

/* Muscles travaillés */
.muscle-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 4px; }
.mtag { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.ex-note { color: var(--ink); }
.warn-text { color: var(--alert); font-weight: 700; }
.chip-btn.on { background: var(--accent); color: var(--accent-ink); }
.lib-chips { position: sticky; top: 52px; z-index: 2; padding: 8px 0; background: var(--bg); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.lib-chips::-webkit-scrollbar { display: none; }
.lib-chips .chip-btn { white-space: nowrap; }

/* Séance en cours */
.wk-ex { display: grid; gap: 10px; }
.wk-head { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; align-items: start; }
.wk-head .ex-ill { width: 108px; border-radius: 8px; background: var(--surface-2); padding: 4px; }
.wk-head h3 { margin: 0 0 2px; font-size: 1.02rem; }
.wk-head p { margin: 2px 0 0; }
.sets { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.sets th { font-size: 0.75rem; color: var(--muted); font-weight: 700; text-align: center; padding: 4px 2px; }
.sets td { text-align: center; padding: 4px 2px; border-top: 1px solid var(--line); }
.sets .set-n { font-family: var(--font-data); font-weight: 700; width: 2.2em; }
.sets .set-prev { color: var(--muted); font-size: 0.8rem; }
.sets input { width: 100%; max-width: 72px; font: inherit; font-family: var(--font-data); text-align: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.sets tr.set-done td { background: var(--ok-soft); }
.sets tr.set-done input { background: transparent; border-color: transparent; font-weight: 700; }
.set-check { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--muted); font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.set-check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.wk-actions { align-items: center; }
.swap > summary { cursor: pointer; font-size: 0.9rem; font-weight: 700; color: var(--accent); padding: 6px 4px; }
.swap-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wk-end { margin: 8px 0 80px; }
.rest-bar { position: fixed; left: 50%; bottom: calc(78px + var(--sab)); transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: 0 6px 20px rgb(0 0 0 / 0.25); max-width: calc(100vw - 24px); }
.rest-bar .btn { white-space: nowrap; }
.rest-bar strong { font-family: var(--font-data); font-size: 1.3rem; min-width: 3.2em; text-align: center; }
.rest-bar .btn.ghost { color: var(--bg); border-color: var(--bg); }

/* Historique */
.wk-summary { border-left: 4px solid var(--ok); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats strong { display: block; font-family: var(--font-data); font-size: 1.25rem; color: var(--accent); }
.stats span { font-size: 0.8rem; color: var(--muted); }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 0.85rem; }
.cal-h { font-weight: 700; color: var(--muted); font-size: 0.75rem; }
.cal-d { padding: 6px 0; border-radius: 8px; font-family: var(--font-data); }
.cal-d.on { background: var(--ok); color: #fff; font-weight: 700; }
.cal-d.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; align-items: end; height: 140px; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.bar span { width: 100%; max-width: 28px; background: var(--accent); border-radius: 4px 4px 0 0; }
.bar small { font-size: 0.68rem; color: var(--muted); }
.records { list-style: none; padding: 0; margin: 0; display: grid; }
.records li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.records li:last-child { border-bottom: 0; }
.wk-log { border-bottom: 1px solid var(--line); padding: 8px 0; }
.wk-log > summary { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; cursor: pointer; }
.wk-log ul { margin: 8px 0; padding-left: 1.1em; display: grid; gap: 4px; }

/* Fiche exercice : vidéo + consignes, même format que les vidéos TikTok */
.ex-open { position: relative; border: 0; cursor: pointer; font: inherit; color: inherit; display: block; }
.ex-open:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ex-play { position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 50%; background: #1f7a4d; color: #fff; font-size: 0.8rem; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.wk-head .ex-open { width: 128px; flex: none; border-radius: 8px; background: var(--surface-2); padding: 4px; }
body.demo-open { overflow: hidden; }
.demo { position: fixed; inset: 0; z-index: 50; background: rgba(5, 20, 14, .72); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.demo-card { position: relative; width: min(440px, 100%); background: #0f2e22; color: #fff; border-radius: 24px; padding: 20px 18px 18px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.demo-brand { margin: 0; color: #3ccf7a; font-weight: 800; letter-spacing: .02em; }
.demo-card h2 { margin: 4px 0 8px; color: #fff; font-size: 1.5rem; line-height: 1.15; text-transform: uppercase; font-weight: 800; }
.demo-tag { display: inline-block; margin: 0 0 12px; padding: 4px 14px; border-radius: 999px; background: #1f7a4d; color: #fff; font-weight: 700; font-size: .9rem; }
.demo-media { background: #173f2f; border-radius: 18px; padding: 8px; }
.demo-video { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; background: #173f2f; }
.demo-ill { background: #f3f6f2; border-radius: 12px; padding: 8px; }
.demo-cues { list-style: none; margin: 14px 0 6px; padding: 0; text-align: left; display: grid; gap: 8px; }
.demo-cues li { position: relative; padding-left: 28px; line-height: 1.35; }
.demo-cues li::before { content: '✓'; position: absolute; left: 4px; color: #3ccf7a; font-weight: 800; }
.demo-sets { margin: 10px 0 0; color: #cfe9dc; font-weight: 700; }
.demo-note { margin: 10px 0 0; color: #9cc5b2; font-size: .78rem; }
.demo-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 1rem; cursor: pointer; }
.demo-close:focus-visible { outline: 3px solid #3ccf7a; }
.ex-open .ex-poster { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.ex-open .ex-vid { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: cover; border-radius: 6px; opacity: 0; transition: opacity .3s; }
.ex-open.vid-on .ex-vid { opacity: 1; }
.ex-open.vid-on .ex-play { opacity: .9; }
.notice.warn { background: var(--alert-soft); border-left-color: var(--alert); }
.file-btn { cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

.apk-help { color: var(--muted); font-size: 0.85rem; }

/* ---------- Vidéo de présentation (premier lancement) ---------- */
.intro { position: fixed; inset: 0; z-index: 60; background: #05140e; display: grid; place-items: center; }
.intro-frame { position: relative; width: min(100vw, calc(100dvh * 9 / 16)); aspect-ratio: 9 / 16; }
.intro-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #05140e; }
.intro-play { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; padding: 18px 26px; border: 0; border-radius: 22px; background: rgba(15, 46, 34, .9); color: #fff; font: inherit; font-weight: 800; font-size: 1.15rem; cursor: pointer; box-shadow: 0 8px 30px rgba(0,0,0,.45); }
.intro-play span { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #3ccf7a; color: #0f2e22; font-size: 1.6rem; padding-left: 4px; margin-bottom: 6px; }
.intro-play small { font-weight: 600; font-size: .8rem; color: #cfe9dc; }
.intro-skip { position: absolute; top: calc(12px + var(--sat)); right: 12px; padding: 8px 16px; border: 0; border-radius: 999px; background: rgba(0,0,0,.5); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.intro-start { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); padding: 14px 40px; font-size: 1.1rem; background: #fff; color: #0f2e22; }
.intro button:focus-visible { outline: 3px solid #3ccf7a; outline-offset: 2px; }

/* ---------- Chaîne WhatsApp ---------- */
.wa-btn { background: #25d366; border-color: #25d366; color: #073b1e; }
.wa-btn:hover { background: #1fbe5a; border-color: #1fbe5a; }
.social-btn { background: #111; border-color: #111; color: #fff; }
.social-btn:hover { background: #333; border-color: #333; }

/* ---------- Journal alimentaire ---------- */
.day-nav { display: flex; align-items: center; justify-content: center; gap: 16px; }
.day-nav strong { min-width: 9ch; text-align: center; }
.journal-list, .journal-foods { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.journal-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.journal-list li:last-child { border-bottom: 0; }
.journal-list small, .journal-foods small { display: block; color: var(--muted); font-size: 0.82rem; }
.journal-del { border: 0; background: var(--surface-2); color: var(--muted); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font: inherit; }
.journal-foods li { display: grid; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.journal-foods li:last-child { border-bottom: 0; }
.journal-sizes { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Pas (Health Connect) ---------- */
.steps-bars { height: 90px; grid-template-columns: repeat(7, 1fr); }
.steps-stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.steps-bars .bar.met span { background: var(--accent); }
.steps-bars .bar:not(.met) span { background: var(--surface-2); outline: 1px solid var(--line); }
.steps-goal summary { cursor: pointer; font-weight: 600; }
.steps-goal .chips { margin: 10px 0; }

/* Cycle de 8 semaines */
.cycle-steps { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.cycle-step {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 44px; border-radius: var(--radius); border: 2px solid transparent;
  font: 700 1rem var(--font-data); color: var(--ink); background: var(--surface-2); cursor: pointer;
}
.cycle-step small { font: 600 0.62rem var(--font-body); color: var(--muted); }
.cycle-step.base { background: var(--accent-soft); }
.cycle-step.build { background: var(--ok-soft); }
.cycle-step.push { background: var(--saffron-soft); }
.cycle-step.deload { background: var(--surface-2); }
.cycle-step.past { opacity: 0.55; }
.cycle-step[aria-pressed="true"] { border-color: var(--accent); opacity: 1; }

/* Rappels */
.reminder-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: space-between; }
.reminder-row .check { flex: 1 1 220px; }
.reminder-time {
  font: 600 1rem var(--font-data); padding: 8px 10px; min-height: 44px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
.reminder-time:disabled { opacity: 0.5; }
@media (max-width: 480px) {
  .brand-tag { display: none; }
  .app-header { padding-block: 12px 8px; }
}

/* Séance en blocs */
.block { display: grid; gap: 6px; }
.block + .block { border-top: 1px solid var(--line); padding-top: 14px; }
.block-title { font-size: 0.95rem; letter-spacing: 0.02em; color: var(--accent); }
.block.finisher ul { margin-top: 2px; }

/* Suggestion de charge */
.load-tip { display: inline-block; margin-top: 4px; padding: 4px 10px; border-radius: 8px; font-size: 0.86rem; font-weight: 700; background: var(--surface-2); color: var(--ink); }
.load-tip.up { background: var(--ok-soft); color: var(--ok); }
.load-tip.down { background: var(--warn-soft); color: var(--warn); }
.load-tip.first { font-weight: 400; color: var(--muted); }

/* Séance de cardio */
.cardio-pick { display: grid; gap: 4px; }
.cardio-pick .chips { margin-bottom: 6px; }
.chip-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cardio-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cardio-step { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); }
.cs-min { font: 700 1rem var(--font-data); color: var(--accent); }

/* Vitrine healthy */
.dish-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.dish { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); }
.dish .btn { grid-column: 1 / -1; justify-self: start; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.club-card-full.desk-break { background: var(--accent); color: #fff; text-align: center; }
.club-card-full.desk-break h2 { margin: 0; }
.club-card-full.desk-break p { max-width: 34ch; }
.club-card-full.desk-break .btn.ghost { color: #fff; border-color: #fff; }
.club-card-full.desk-break .btn:not(.ghost) { background: #fff; color: var(--accent); border-color: #fff; }
.club-card-full.desk-break .eyebrow { color: rgba(255, 255, 255, 0.85); }
.code-entry { padding: 12px 16px; }
.code-entry summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.code-entry[open] summary { margin-bottom: 10px; }
.code-entry .caption-muted { margin: 8px 0 0; }
.paste-box { width: 100%; min-height: 96px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 0.9rem; background: var(--surface); color: inherit; resize: vertical; box-sizing: border-box; }
.club-panel[style*="--club-color"] { border-left: 6px solid var(--club-color); }
.club-panel[style*="--club-color"] h3, .club-panel[style*="--club-color"] h2 { color: var(--club-color); }
.club-badge[style*="--club-color"] .chip { background: var(--club-color); color: #fff; border-color: var(--club-color); }

/* Accueil épuré : série, rappels, séance et menu du jour. */
.example-notice { justify-content: space-between; padding: 10px 12px; }
.example-notice p { margin: 0; }
.streak-hero { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.streak-hero.ok { background: var(--ok-soft); border-color: transparent; }
.streak-num { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); }
.streak-num > span:first-child { font-size: 1.9rem; }
.streak-num .data { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.streak-unit { font-size: .78rem; line-height: 1.15; color: var(--muted); }
.streak-side { flex: 1; display: grid; gap: 6px; }
.streak-side p { margin: 0; }
.notif-card { background: var(--saffron-soft); border-color: transparent; display: grid; gap: 10px; }
.notif-card p { margin: 0; }
.today-card { display: grid; gap: 0; padding: 4px 16px; }
.today-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; }
.today-line + .today-line { border-top: 1px solid var(--line); }
.today-line p { margin: 0; }
.h3 { font-size: 1.1rem; }
.more-habits summary { cursor: pointer; font-weight: 700; color: var(--accent); padding: 10px 0 4px; }
.app-footer p { font-size: .82rem; }
/* Bannière d'installation : sur l'Accueil seulement. */
body:not(.on-home) .install-banner { display: none; }
.apk-help { font-size: .8rem; }
.diag { margin: 0; padding-left: 18px; }

/* =====================================================================
   Thème FitVie sombre (version 67) : photos d'abord, titres sport,
   accent vert citron. Remplace les couleurs et polices ci-dessus.
   ===================================================================== */
@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: 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: 700; font-display: swap; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }
/* Arabe : Cairo, utilisée seulement pour les lettres arabes (unicode-range). */
@font-face { font-family: "Cairo"; font-weight: 400; font-display: swap; src: url(fonts/cairo-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: "Cairo"; font-weight: 600; font-display: swap; src: url(fonts/cairo-arabic-600-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: "Cairo"; font-weight: 700; font-display: swap; src: url(fonts/cairo-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }

:root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
  --bg: #0f1412;
  --surface: #171e1b;
  --surface-2: #212a26;
  --ink: #f2f5f3;
  --muted: #9aa8a0;
  --line: #26322d;
  --accent: #c6f36b;
  --accent-ink: #0f1412;
  --accent-soft: rgba(198, 243, 107, 0.13);
  --saffron: #f2b84b;
  --saffron-soft: rgba(242, 184, 75, 0.14);
  --ok: #c6f36b;
  --warn: #f2b84b;
  --alert: #ff8a7a;
  --ok-soft: rgba(198, 243, 107, 0.13);
  --warn-soft: rgba(242, 184, 75, 0.14);
  --alert-soft: rgba(255, 138, 122, 0.14);
  --macro-p: #c6f36b;
  --macro-c: #f2b84b;
  --macro-f: #b9a2ff;
  --pack-blue: #8a96d6;
  --font-display: "Barlow Condensed", "Cairo", "Arial Narrow", sans-serif;
  --font-body: "Barlow", "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-data: "Barlow", "Cairo", system-ui, sans-serif;
  --radius: 18px;
  color-scheme: dark;
}
body { font-size: 16px; line-height: 1.5; }
.num, .data { font-variant-numeric: tabular-nums; }
h1, h2, h3 { text-transform: uppercase; letter-spacing: 0.01em; font-weight: 700; }
h1 { font-size: 2.1rem; line-height: 1.02; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }
h4, .fieldset legend { font-family: var(--font-body); font-weight: 700; text-transform: none; }
.eyebrow { text-transform: none; letter-spacing: 0; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.lede { font-size: 0.98rem; }
.muted { color: var(--muted); }

/* Cartes : pas de bordure, coins arrondis, fond légèrement plus clair. */
.panel { border: 0; border-radius: var(--radius); background: var(--surface); }
.notice, .notice.info, .notice.alert, .notice.warn { border-left: 0; border-radius: 14px; }
.notice.info { background: var(--surface-2); }
.btn { border-radius: 999px; padding: 11px 20px; border: 0; }
.btn.ghost { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.btn.small { padding: 7px 14px; }
.chip { background: var(--surface-2); }
input, select, textarea { color: var(--ink); background: var(--surface-2); border-color: var(--line); }

/* En-tête et barre du bas */
.app-header { padding-block: 14px 4px; }
.brand-name { line-height: 0; margin: 0; }
.brand-tag { display: none; }
.coach-btn { background: var(--surface-2); color: var(--ink); padding: 4px 14px 4px 4px; gap: 8px; }
.face { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; }
.face.sm { width: 34px; height: 34px; }
.bottom-nav { background: #121816; border-top: 1px solid var(--line); box-shadow: none; }
.tabs-track { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nav-btn[aria-current="page"] .nav-ico { background: transparent; }
.subnav-btn { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.subnav-btn[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg-btn[aria-selected="true"] { background: var(--ink); color: var(--bg); }

/* Accueil */
.home-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.home-top .muted { font-size: 0.9rem; }
.avatar { padding: 0; border: 2px solid var(--accent); border-radius: 50%; background: none; cursor: pointer; }
.avatar .face { width: 48px; height: 48px; }
.streak-hero { background: transparent; border: 0; padding: 4px 0; gap: 18px; }
.streak-hero.ok { background: transparent; }
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring-bg { stroke: var(--surface-2); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .4s; }
.ring b { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 700 2rem/1 var(--font-display); }
.ring b small { font: 600 0.62rem var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }
.streak-title { font-weight: 700; font-size: 1.08rem; }
.streak-msg { color: var(--muted); font-size: 0.92rem; }
.hero {
  position: relative; display: block; width: 100%; height: 260px; border: 0; padding: 0; cursor: pointer;
  border-radius: 22px; overflow: hidden; background: var(--surface) center 30% / cover no-repeat; text-align: left; color: #fff;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(0, 0, 0, 0.88)); }
.hero-txt { position: absolute; left: 16px; right: 84px; bottom: 16px; z-index: 1; display: grid; gap: 4px; }
.tag { justify-self: start; background: var(--accent); color: var(--accent-ink); font: 700 0.72rem var(--font-body); letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 9px; border-radius: 6px; }
.hero-title { font: 700 2rem/1 var(--font-display); text-transform: uppercase; }
.hero-meta { color: #d3dbd6; font-size: 0.9rem; }
.play { position: absolute; right: 16px; bottom: 16px; z-index: 1; width: 58px; height: 58px; border-radius: 50%; background: var(--accent); }
.play::before { content: ""; position: absolute; left: 23px; top: 18px; border-left: 17px solid var(--accent-ink); border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: -6px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: 600 0.92rem var(--font-body); cursor: pointer; }
.meal-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-snap-type: x mandatory; }
.meal-row::-webkit-scrollbar { display: none; }
.meal-card {
  flex: 0 0 148px; height: 180px; border: 0; padding: 0; border-radius: 18px; overflow: hidden; position: relative; cursor: pointer;
  background: var(--surface-2) center / cover no-repeat; scroll-snap-align: start; text-align: left; color: #fff;
}
.meal-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.85)); }
.meal-card span { position: absolute; left: 10px; right: 8px; bottom: 9px; z-index: 1; display: grid; font-size: 0.9rem; line-height: 1.2; }
.meal-card small { color: #cfd8d3; font-size: 0.75rem; }
.notif-card { background: var(--surface); }
.habits-panel { padding: 6px 16px; }
.habits-panel .habit .detail { font-size: 0.85rem; }

/* Bienvenue : Salma et Yassine */
.welcome { position: relative; border-radius: 22px; overflow: hidden; background: var(--surface); }
.duo { display: grid; grid-template-columns: 1fr 1fr; height: 230px; }
.duo img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; display: block; }
.welcome-txt { padding: 16px; display: grid; gap: 10px; }
.welcome-title { font: 700 1.6rem/1.05 var(--font-display); text-transform: uppercase; }
.welcome-txt p:not(.welcome-title) { color: var(--muted); }
.welcome-txt .btn { justify-self: start; }

/* Coach */
.coach-pick { display: flex; gap: 10px; }
.coach-choice { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 0.95rem var(--font-body); cursor: pointer; }
.coach-choice img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.coach-choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.bubble.coach { position: relative; padding-left: 52px; }
.bubble-face { position: absolute; left: 10px; top: 10px; width: 32px; height: 32px; }
.seasonal { background: var(--surface); border: 1px solid rgba(198, 243, 107, 0.35); }
.seasonal h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.01em; font-size: 1.6rem; }
.seasonal .eyebrow { color: var(--accent); }
body.on-home .coach-btn { display: none; }

/* Salma et Yassine en action */
.coach-loop { position: relative; height: 210px; border-radius: 22px; overflow: hidden; background: var(--surface-2); }
.coach-loop video, .coach-loop img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.coach-loop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.85)); }
.coach-loop-txt { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1; display: grid; gap: 4px; color: #fff; }
.coach-loop-title { font: 700 1.7rem/1 var(--font-display); text-transform: uppercase; }
.coach-loop-sub { color: #d3dbd6; font-size: 0.9rem; }
.seasonal .coach-loop { margin: -18px -18px 4px; border-radius: 22px 22px 0 0; height: 190px; }
.duo-video { width: 100%; height: 300px; object-fit: cover; object-position: center 25%; display: block; }
.wk-summary .coach-loop { margin: -18px -18px 4px; border-radius: 22px 22px 0 0; height: 200px; }

/* Le coach parle */
.coach-says { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0 2px; font-size: 0.9rem; color: var(--ink); }
.coach-says .face { flex: none; width: 28px; height: 28px; }
.coach-says span { background: var(--surface-2); padding: 6px 10px; border-radius: 4px 12px 12px 12px; }
.coach-says b { color: var(--accent); font-weight: 700; margin-right: 2px; }
.coach-says.done span { background: var(--accent-soft); }
.streak-side .coach-says { margin: 2px 0 0; }
.rest-bar .face { width: 32px; height: 32px; }

/* Séance guidée plein écran */
.guided { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; display: grid; grid-template-rows: 1fr; }
.guided-media { position: absolute; inset: 0; }
.guided-media video, .guided-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.guided-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.55), transparent 22%, transparent 45%, rgba(0,0,0,.9)); }
.guided-top { position: absolute; left: 16px; right: 16px; top: calc(14px + var(--sat)); z-index: 1; display: grid; gap: 6px; }
.guided-top .progress { height: 6px; background: rgba(255,255,255,.2); border-radius: 99px; overflow: hidden; }
.guided-top .progress span { display: block; height: 100%; background: var(--accent); }
.guided-top .muted { color: #d3dbd6; font-size: .9rem; }
.guided-info { position: absolute; left: 16px; right: 16px; bottom: calc(18px + var(--sab)); z-index: 1; display: grid; gap: 8px; }
.guided-info .tag { justify-self: start; font-size: .85rem; }
.guided-info .tag.hot { background: #ff6b4a; color: #fff; }
.guided-left { font: 700 5rem/0.9 var(--font-display); }
.guided-next { color: #d3dbd6; font-size: .95rem; }
.guided .coach-says span { background: rgba(0,0,0,.55); color: #fff; }
.guided .btn.ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.guided-card { position: relative; border-radius: 22px; overflow: hidden; min-height: 300px; background: var(--surface); }
.guided-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.guided-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 25%, rgba(0,0,0,.9)); }
.guided-card-txt { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 1; display: grid; gap: 6px; color: #fff; }
.guided-card-txt .btn { justify-self: start; margin-top: 6px; }
.guided-hint { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border-radius: 16px; border: 1px solid rgba(198,243,107,.35); background: var(--surface); color: var(--ink); font: 600 .95rem var(--font-body); text-align: left; cursor: pointer; }
.guided-hint .go { margin-left: auto; color: var(--accent); font-size: 1.2rem; }

/* Verrouillage par empreinte */
#app-lock { position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; background: #0f1412; color: #f2f5f3; }
#app-lock[hidden] { display: none; }
#app-lock .lock-mark { width: 120px; height: 60px; fill: currentColor; }
#app-lock .lock-title { margin: 0; font-weight: 700; font-size: 1.1rem; }
html.locked body { overflow: hidden; }

/* Étapes d'installation sur iPhone */
.install-banner .ios-steps { margin: 6px 0 4px; padding-left: 20px; display: grid; gap: 4px; }

/* Vidéos « Comment ça marche ? » */
.tuto-row { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.tuto-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.tuto-btn span { color: #3ccf7a; }
.tuto-btn small { font-weight: 600; color: var(--muted); }
.tuto-lang { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; color: #fff; background: linear-gradient(180deg, rgba(5, 20, 14, 0.35), rgba(5, 20, 14, 0.82) 45%, rgba(5, 20, 14, 0.82) 70%, rgba(5, 20, 14, 0.35)); }
.tuto .intro-video { background: #05140e; }
.tuto-lang p { margin: 0 0 6px; font-weight: 800; font-size: 1.1rem; }
.tuto-lang .btn { min-width: 220px; font-size: 1.05rem; }
.tuto-lang[hidden] { display: none; }

/* ---------- Langue : choix au premier lancement, arabe de droite à gauche ---------- */
.lang-pick { position: fixed; inset: 0; z-index: 9000; background: var(--bg); display: grid; place-items: center; padding: 24px; }
.lang-pick-card { width: min(340px, 100%); display: grid; gap: 14px; text-align: center; }
.lang-pick-mark { width: 120px; height: auto; fill: var(--accent); margin: 0 auto 12px; }
.lang-pick-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin: 0; line-height: 1.2; }
.lang-pick .btn { width: 100%; font-size: 1.15rem; padding: 14px; }
.lang-block .row { gap: 10px; }
.lang-block .btn { min-width: 120px; }

[dir="rtl"] body { line-height: 1.7; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; line-height: 1.35; }
[dir="rtl"] .eyebrow, [dir="rtl"] .nav-lbl { letter-spacing: 0; }
[dir="rtl"] .exercise .rx { text-align: left; }
[dir="rtl"] input[type="number"], [dir="rtl"] input[type="date"], [dir="rtl"] input[type="time"] { direction: ltr; text-align: right; }
[dir="rtl"] .brand, [dir="rtl"] .brand-mark, [dir="rtl"] .brand-word, [dir="rtl"] .lock-mark { direction: ltr; }

/* Séances guidées : niveaux, préparation, repères, résumé */
.guided-levels { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.guided-target { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 4px 0 8px; font-weight: 700; }
.guided-target span { background: rgba(255, 255, 255, 0.12); border-radius: 999px; padding: 4px 10px; }
.guided-prep ul { margin: 6px 0 12px; padding-inline-start: 20px; display: grid; gap: 6px; }
.guided-prep-title { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; margin: 6px 0 4px; text-transform: uppercase; }
#g-count { font-size: 4rem; text-align: center; }
.guided-card .guided-levels .chip-btn { background: rgba(5, 20, 14, 0.72); color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.guided-card .guided-levels .chip-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
