/* 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="search"], 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; font-weight: 700; }
.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-foods li > .journal-del { justify-self: end; margin-top: -40px; }
.macros { gap: 10px; }
.macros .macro p { margin: 0 0 4px; }
.dish-editor { border: 1px solid var(--accent); }
.dish-names, .dish-label { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.dish-add { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; align-items: end; }
.dish-add .btn { grid-column: 1 / -1; justify-self: start; }
.dish-add select { width: 100%; min-width: 0; }
.dish-list li { grid-template-columns: minmax(0, 1fr) auto auto; }
.dish-qty { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: .9rem; }
.dish-qty input { width: 72px; }
.dish-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.dish-total .data { font-size: 1.4rem; }
.dish-total small { color: var(--muted); }
.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"]) {
  /* Palette pastel chaleureuse : crème, sauge, pêche, beurre, lavande. */
  --bg: #fbf6ef;
  --surface: #ffffff;
  --surface-2: #f3ece2;
  --ink: #2f3a33;
  --muted: #76807a;
  --line: #ebe2d6;
  --accent: #6f9c7f;
  --accent-ink: #ffffff;
  --accent-soft: #e4efe6;
  --saffron: #d98f5c;
  --saffron-soft: #fbe8db;
  --ok: #5f8f70;
  --warn: #c98a3a;
  --alert: #c9604f;
  --ok-soft: #e4efe6;
  --warn-soft: #fbefd7;
  --alert-soft: #f9e1dc;
  --macro-p: #7fa88b;
  --macro-c: #e3ae62;
  --macro-f: #a995d6;
  --pack-blue: #8fa3cf;
  --font-display: "Barlow", "Cairo", system-ui, -apple-system, sans-serif;
  --font-body: "Barlow", "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-data: "Barlow", "Cairo", system-ui, sans-serif;
  --radius: 22px;
  color-scheme: light;
}
body { font-size: 16px; line-height: 1.5; }
.num, .data { font-variant-numeric: tabular-nums; }
h1, h2, h3 { text-transform: none; letter-spacing: -0.01em; font-weight: 700; }
h1 { font-size: 1.9rem; line-height: 1.12; }
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); box-shadow: 0 6px 24px rgba(80, 60, 30, 0.07); }
.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; box-shadow: 0 4px 14px rgba(111, 156, 127, 0.22); }
.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: #fffaf3; border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(80, 60, 30, 0.05); }
.tabs-track { grid-template-columns: repeat(5, 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.75rem var(--font-body); letter-spacing: 0.02em; padding: 4px 10px; border-radius: 999px; }
.hero-title { font: 700 1.8rem/1.1 var(--font-display); letter-spacing: -0.01em; }
.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.5rem/1.15 var(--font-display); letter-spacing: -0.01em; }
.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); color: var(--ink); border: 0; }
.seasonal .btn.ghost { color: var(--ink); border-color: var(--line); }
.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.55rem/1.1 var(--font-display); letter-spacing: -0.01em; }
.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 var(--line); 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: var(--bg); color: var(--ink); }
#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; }
#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); }

/* Écran de séance persistant : éléments masqués réellement cachés. */
.guided-media [hidden] { display: none !important; }

/* Moment de la journée : photo plein cadre, bandeau clair en bas. */
.day-moment { position: relative; min-height: 340px; border-radius: var(--radius); overflow: hidden; background: var(--surface-2) center / cover no-repeat; display: flex; align-items: flex-end; box-shadow: 0 8px 28px rgba(80, 60, 30, 0.12); }
.dm-txt { margin: 12px; padding: 14px 16px; border-radius: 18px; background: rgba(255, 250, 243, 0.84); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; gap: 6px; width: 100%; }
.dm-title { margin: 0; font: 700 1.25rem/1.2 var(--font-display); color: var(--ink); }
.dm-text { margin: 0; color: var(--muted); font-size: 0.95rem; }
.dm-txt .btn { justify-self: start; margin-top: 4px; }

/* Texture bleu canard et ocre : écrans « vides » (démarrage, verrouillage,
   choix de la langue) et quelques petits rappels. */
#app-lock { background: #24575a url('../media/fond-texture.jpg') center / cover; color: #fbf6ef; }
#app-lock::before, .lang-pick::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(10, 30, 32, 0.45), rgba(10, 30, 32, 0.15) 70%); }
#app-lock > *, .lang-pick > * { position: relative; }
#app-lock .lock-mark { fill: #fbf6ef; }
#app-lock .btn { background: #fbf6ef; color: #24575a; }
.lang-pick { background: #24575a url('../media/fond-texture.jpg') center / cover; }
.lang-pick-card { background: rgba(251, 246, 239, 0.94); border-radius: 26px; padding: 26px 22px; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25); }
.lang-pick-mark { fill: #24575a; }
.tuto-btn { background: #24575a url('../media/fond-texture.jpg') center / cover; color: #fbf6ef; border-color: transparent; }
.tuto-btn span { color: #e6b45a; }
.tuto-btn small { color: #e9e2d6; }
.example-notice { background: #24575a url('../media/fond-texture.jpg') center / cover; color: #fbf6ef; border: 0; }
.example-notice .btn { background: #fbf6ef; color: #24575a; }

/* « Pas envie de cuisiner ? » : proposition partenaire discrète. */
.partner-dish { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: var(--surface-2); }
.partner-dish img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; }
.partner-dish:not(:has(img)) { grid-template-columns: 1fr; }
.pd-txt { display: grid; gap: 3px; min-width: 0; }
.pd-kicker { margin: 0; font-size: 0.82rem; color: var(--muted); display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.pd-label { font-size: 0.68rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.pd-name { margin: 0; font-weight: 700; line-height: 1.25; }
.pd-meta { margin: 0; font-size: 0.85rem; color: var(--muted); }
.partner-dish .btn { justify-self: start; margin-top: 4px; }
.partner-dish [aria-disabled] { opacity: 0.6; }

/* Rappel de la prière */
.prayer-next { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 400 .92rem var(--font-body); text-align: start; cursor: pointer; }
.prayer-next .pn-ico { font-size: 1.4rem; }
.prayer-next .pn-main { display: flex; flex-direction: column; gap: 2px; }
.prayer-next .pn-head b { color: var(--accent); }
.prayer-next .pn-geste, .prayer-next .pn-ram { color: var(--muted); font-size: .85rem; }
.prayer-times { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.prayer-times li { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px; background: var(--surface-2, var(--surface)); border: 1px solid var(--line); font-size: .85rem; }
.prayer-times b { font-size: 1.05rem; }
.pr-offsets { display: grid; gap: 8px; }
.pr-off { display: flex; align-items: center; gap: 8px; }
.pr-off span:first-child { min-width: 70px; }
.pr-off input { width: 76px; }

/* Séance en cours : bandeau au-dessus des onglets Entraînement */
.live-bar { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 10px; padding: 10px 16px; border-radius: 999px; border: 0; background: var(--ink); color: var(--bg); font: 700 .95rem var(--font-body); cursor: pointer; text-align: start; }
.live-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--alert); box-shadow: 0 0 0 3px rgb(255 255 255 / .25); }
.live-bar .go { margin-inline-start: auto; font-weight: 600; opacity: .85; }
/* Les 4 onglets tiennent sur un petit téléphone, sans défilement caché. */
.training .seg { overflow: visible; }
.training .seg-btn { flex: 1 1 auto; min-width: 0; padding: 8px 6px; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; }

/* Plats végétariens et vegan (repérés pour les omnivores) */
.veg-badge { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 9px; border-radius: 999px; background: #e3efe5; color: #3f6b4c; font: 600 .78rem var(--font-body); }
.veg-badge.treat { background: #fbe8db; color: #9a5a2b; }
.recipe-steps { margin-top: 10px; }
.recipe-steps summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.recipe-steps ol { margin: 8px 0 0; padding-inline-start: 20px; display: grid; gap: 6px; line-height: 1.4; }
.h-sub { font: 700 1.1rem var(--font-body); margin: 22px 0 10px; color: var(--ink); }
.sponsor-card { margin: 10px 0; }
.ingredient-sponsor { margin: 4px 0 0; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ingredient-sponsor .pd-label { margin: 0; }
.ingredient-sponsor { display: block; }
.ingredient-sponsor .pd-label { display: inline-block; margin-inline-end: 6px; }
.forme .eyebrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.forme-offer { font-weight: 700; color: var(--accent); }
.ingredient-sponsor { margin-top: 6px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.ingredient-sponsor p { margin: 0 0 4px; font-weight: 600; color: var(--ink); }
.ingredient-sponsor ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

/* =====================================================================
   Redesign v2 : une couleur par univers, tableau de bord sur l'Accueil,
   Sport en mode sombre.
   ===================================================================== */
:root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
  --bg: #f6f4f0;
  --ink: #1c2420;
  --muted: #69726d;
  --line: #e7e2da;
  --surface-2: #efebe4;
  --c-sport: #ff5a36; --c-sport-soft: #ffe3dc;
  --c-repas: #20b46a; --c-repas-soft: #d8f3e5;
  --c-eau: #2f8cff;   --c-eau-soft: #dcebff;
  --c-moi: #7a5cff;   --c-moi-soft: #ece6ff;
  --c-defi: #f5a623;  --c-defi-soft: #fdeed3;
}
body { background: var(--bg); }
body[data-univers="aujourdhui"] { --accent: var(--c-sport); --accent-soft: var(--c-sport-soft); --accent-ink: #fff; }
body[data-univers="alimentation"] { --accent: var(--c-repas); --accent-soft: var(--c-repas-soft); --accent-ink: #fff; }
body[data-univers="moi"] { --accent: var(--c-moi); --accent-soft: var(--c-moi-soft); --accent-ink: #fff; }
body[data-page="defis"] { --accent: var(--c-defi); --accent-soft: var(--c-defi-soft); --accent-ink: #fff; }
body[data-page="pourmoi"] { --accent: var(--c-moi); }
.btn { box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 28%, transparent); }
.subnav-btn[aria-current="page"], .seg-btn[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Sport : accent corail, dans le thème choisi (clair ou sombre) */
body[data-univers="entrainement"] { --accent: var(--c-sport); --accent-soft: var(--c-sport-soft); --accent-ink: #fff; }
body[data-univers="entrainement"] .btn:not(.ghost) { background: linear-gradient(120deg, var(--c-sport), #ff8a3d); }
body[data-univers="entrainement"] .day-cell.done { border-color: var(--ok); }

/* Thème sombre : le même sur toutes les pages (Moi › Réglages › Général › Thème) */
:root[data-theme="dark"] body {
  --bg: #0f1214; --surface: #1a1f22; --surface-2: #232a2e; --ink: #f2f5f3; --muted: #97a39d; --line: #2b3236;
  --ok: #22c07a; --ok-soft: #173a2a; --warn: #f5a623; --warn-soft: #3a2c12; --alert: #ff7a6b; --alert-soft: #3d1f1c;
  --saffron: #ff8a3d; --saffron-soft: #3a2616;
  --c-sport-soft: #3a2018; --c-repas-soft: #173a2a; --c-eau-soft: #16283f; --c-moi-soft: #2a2245; --c-defi-soft: #3a2c12; --c-home-soft: #12332f;
  color-scheme: dark; background: var(--bg); color: var(--ink);
}
:root[data-theme="dark"] .panel { box-shadow: none; }
:root[data-theme="dark"] .app-header, :root[data-theme="dark"] .tabs, :root[data-theme="dark"] nav.tabs { background: var(--bg); }
:root[data-theme="dark"] img, :root[data-theme="dark"] video { filter: none; }
:root[data-theme="dark"] .nav-btn[aria-current="page"] .nav-ico { background: color-mix(in srgb, var(--nav-c) 22%, transparent); }

/* Réglages : 4 groupes repliés */
.set-group { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; margin: 0 0 12px; overflow: hidden; }
.set-group > summary { list-style: none; cursor: pointer; display: grid; gap: 2px; padding: 16px 44px 16px 18px; position: relative; }
.set-group > summary::-webkit-details-marker { display: none; }
.set-group > summary::after { content: "›"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--muted); transition: transform .2s; }
.set-group[open] > summary::after { transform: translateY(-50%) rotate(90deg); }
.set-title { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; color: var(--ink); }
.set-group > summary small { color: var(--muted); font-size: 0.85rem; }
.set-body > .panel { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }

/* Accueil : anneaux */
.dash-rings { display: flex; justify-content: space-between; gap: 6px; padding: 14px 10px; }
.dash-ring { flex: 1; display: grid; justify-items: center; background: none; border: 0; padding: 0; color: var(--ink); font: inherit; cursor: pointer; position: relative; }
.dash-ring svg { width: 92px; height: 92px; }
.dash-ring b { position: absolute; top: 33px; font-size: 1.1rem; font-weight: 700; }
.dash-ring .lbl { font-weight: 700; font-size: 0.9rem; margin-top: 6px; }
.dash-ring span:last-child { font-size: 0.78rem; color: var(--muted); }

/* Accueil : série 🔥 */
.streak-hero.v2 { display: flex; gap: 16px; align-items: center; padding: 16px 18px; border-radius: 22px; color: #fff; background: linear-gradient(120deg, #ff7a2f, #ff4d4d); border: 0; }
.streak-hero.v2 .sh-n { font-size: 2.4rem; font-weight: 700; line-height: 1; white-space: nowrap; }
.streak-hero.v2 .streak-title { margin: 0; font-weight: 700; font-size: 1.05rem; color: #fff; }
.streak-hero.v2 .sh-days { display: flex; gap: 6px; margin: 6px 0; }
.streak-hero.v2 .sh-days i { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.32); display: block; }
.streak-hero.v2 .sh-days i.on { background: #fff; }
.streak-hero.v2 .sh-days i.today { box-shadow: 0 0 0 2px #fff; }
.streak-hero.v2 .coach-says { background: rgba(255,255,255,.16); color: #fff; }
.streak-hero.v2 .coach-says b, .streak-hero.v2 .streak-msg { color: #fff; }
.streak-hero.v2.ok { background: linear-gradient(120deg, #20b46a, #12a08a); }

/* Accueil : séance du jour */
.hero .tag { background: var(--c-sport); color: #fff; }
.hero .play { background: var(--c-sport); }

/* Accueil : repas du jour en carrousel */
.meal-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.meal-row::-webkit-scrollbar { display: none; }
.meal-card.v2 { flex: 0 0 160px; display: block; padding: 0; min-height: 0; border: 0; border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: 0 6px 20px rgba(30,40,35,.07); text-align: start; color: var(--ink); cursor: pointer; }
.meal-card.v2 img { width: 100%; height: 100px; object-fit: cover; display: block; }
.meal-card.v2 .mc-noimg { display: grid; place-items: center; height: 100px; background: var(--c-repas-soft); font-size: 2rem; }
.meal-card.v2 .mc-txt { display: grid; gap: 2px; padding: 8px 10px 10px; }
.meal-card.v2 small { font-weight: 700; font-size: 0.7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--c-repas); }
.meal-card.v2 b { font-size: 0.92rem; line-height: 1.25; }
.meal-card.v2 em { font-style: normal; font-size: 0.78rem; color: var(--muted); }

/* Accueil : poids */
.weight-card { display: block; width: 100%; border: 0; text-align: start; color: var(--ink); font: inherit; cursor: pointer; }
.weight-card .wc-head { display: flex; justify-content: space-between; align-items: flex-end; }
.weight-card .tag-moi { background: var(--c-moi-soft); color: var(--c-moi); }
.weight-card .wc-v { display: block; font-size: 1.7rem; color: var(--c-moi); }
.weight-card .wc-d { font-weight: 700; }
.weight-card .wc-d.down { color: var(--c-repas); }
.weight-card .wc-d.up { color: var(--c-sport); }
.weight-card svg { width: 100%; height: auto; margin-top: 6px; }

/* Sport : chiffres de la semaine */
.sport-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.sport-stats div { background: var(--surface); border-radius: 18px; padding: 12px 6px; text-align: center; }
.sport-stats b { display: block; font-size: 1.4rem; }
.sport-stats span { font-size: 0.78rem; color: var(--muted); }
.sport-stats .hot b { color: var(--c-sport); }
.streak-hero.v2 .coach-says { background: none; padding: 0; margin: 0; box-shadow: none; }
.streak-hero.v2 .coach-says img, .streak-hero.v2 .coach-says .face { display: none; }
.streak-hero.v2 .coach-says span { color: #fff; font-size: .9rem; line-height: 1.35; background: none; padding: 0; }
.streak-hero.v2 .coach-says b { display: none; }
.streak-hero.v2 .streak-msg { margin: 4px 0 0; font-size: .8rem; opacity: .85; }
.meal-card.v2 { position: static; height: auto; aspect-ratio: auto; }
.meal-card.v2::after { content: none; }
.meal-card.v2 span.mc-txt { position: static; }
.meal-card.v2 small { color: var(--c-repas); }
/* Intro : « Ne plus montrer » et « Passer » en haut à droite */
.intro-top { position: absolute; top: calc(12px + var(--sat)); right: 12px; display: flex; gap: 8px; }
.intro-top .intro-skip { position: static; }
.intro-never { padding: 8px 14px; border: 0; border-radius: 999px; background: rgba(0,0,0,.35); color: #fff; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
/* Accueil : sa propre couleur (turquoise), distincte du corail du Sport */
:root { --c-home: #0e9f95; --c-home-soft: #d3f1ee; }
body[data-univers="aujourdhui"] { --accent: var(--c-home); --accent-soft: var(--c-home-soft); --accent-ink: #fff; }
.intro-sound { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); padding: 10px 20px; border: 0; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
/* Barre du bas : chaque icône garde la couleur de son univers */
.nav-btn[data-nav="aujourdhui"] { --nav-c: var(--c-home); --nav-soft: var(--c-home-soft); }
.nav-btn[data-nav="entrainement"] { --nav-c: var(--c-sport); --nav-soft: var(--c-sport-soft); }
.nav-btn[data-nav="alimentation"] { --nav-c: var(--c-repas); --nav-soft: var(--c-repas-soft); }
.nav-btn[data-nav="defis"] { --nav-c: var(--c-defi); --nav-soft: var(--c-defi-soft); }
.nav-btn[data-nav="moi"] { --nav-c: var(--c-moi); --nav-soft: var(--c-moi-soft); }
.nav-btn .nav-ico { color: var(--nav-c); }
.nav-btn[aria-current="page"] { color: var(--nav-c); }
.nav-btn[aria-current="page"] .nav-ico { background: var(--nav-soft); }
/* Coach : voix, dictée, « écrit… » */
.voice-toggle, .voice-change { margin-top: 6px; }
.voice-change.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.voice-panel { margin: 12px 0; padding: 14px; }
.voice-panel h2 { font-size: 1.05rem; margin: 0 0 8px; }
.voice-panel .chips { margin: 6px 0 10px; }
.voice-panel .row { gap: 8px; flex-wrap: wrap; }
.voice-toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.mic-btn { flex: none; padding: 10px 14px; background: var(--surface-2); color: var(--ink); box-shadow: none; }
.mic-btn.on { background: #ff4d4d; color: #fff; animation: mic-pulse 1s infinite; }
@keyframes mic-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,77,77,.5); } 50% { box-shadow: 0 0 0 8px rgba(255,77,77,0); } }
.bubble.typing .dots { display: flex; gap: 5px; align-items: center; min-height: 22px; }
.bubble.typing .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: dot 1.1s infinite; }
.bubble.typing .dots i:nth-child(2) { animation-delay: .15s; }
.bubble.typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

/* Deux séances le même jour (musculation + cardio) */
.day-cell .m.plus { color: var(--accent); font-weight: 700; }
.block.second { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* Mon programme (créé par l'utilisateur) */
.custom-switch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; background: var(--surface-2, rgba(255,255,255,.06)); padding: 4px; border-radius: 14px; margin: 4px 0 10px; }
.custom-switch .seg-btn { border-radius: 10px; }
.custom-note { margin: 0 0 10px; }
.custom-edit .field input { width: 100%; }
.custom-list { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 10px; }
.custom-ex { border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.custom-ex-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.custom-ex-tools { display: flex; gap: 4px; flex: none; }
.icon-btn { font: inherit; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; }
.icon-btn:disabled { opacity: .35; }
.custom-ex-rx { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; margin-top: 8px; }
.custom-ex-rx label { display: grid; gap: 4px; font-size: .78rem; color: var(--muted); }
.custom-ex-rx select, .custom-ex-rx input { font: inherit; font-size: .9rem; padding: 7px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-width: 0; }
.custom-picker { border-top: 1px dashed var(--line); padding-top: 10px; }
.custom-pick-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; max-height: 360px; overflow-y: auto; }
.custom-pick-item { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; text-align: start; font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.custom-pick-item small { display: block; color: var(--muted); font-size: .76rem; }
.custom-pick-item:disabled { opacity: .5; }

.custom-zones { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.custom-zones .seg-btn { white-space: normal; line-height: 1.2; }
.custom-zones .seg-btn { font-size: .8rem; padding: 8px 4px; }
.custom-pick-muscle { margin: 12px 0 4px; font-size: .95rem; }
.custom-equip-t { margin: 8px 0 0; }
.custom-equip .chip-btn { font-size: .85rem; padding: 5px 12px; }
.custom-pick-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 40px; gap: 10px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.custom-pick-thumb { position: relative; width: 56px; height: 56px; border-radius: 9px; overflow: hidden; border: 0; padding: 0; background: var(--surface-2, #222); cursor: pointer; }
.custom-pick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.custom-pick-thumb span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: .9rem; background: rgba(0,0,0,.25); }
.custom-pick-thumb.cardio { display: grid; place-items: center; font-size: 1.7rem; cursor: default; }
.custom-pick-thumb.ill-thumb { background: var(--surface-2, #222); display: grid; place-items: center; }
.custom-pick-thumb.ill-thumb svg { width: 100%; height: 100%; }
.custom-pick-t small { display: block; color: var(--muted); font-size: .76rem; }
.custom-pick-add { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--accent); background: transparent; color: var(--accent); font: inherit; font-size: 1.2rem; font-weight: 700; cursor: pointer; }
.custom-pick-add.on { background: var(--accent); color: var(--accent-ink, #fff); }
.custom-pick-list { max-height: none; }
.custom-picker, .custom-edit { min-width: 0; max-width: 100%; }
.custom-picker .lib-chips { flex-wrap: wrap; }
.custom-pick-t strong { overflow-wrap: anywhere; }

/* Sport : manger autour de la séance */
.fuel summary { cursor: pointer; list-style: none; display: grid; gap: 2px; }
.fuel summary::-webkit-details-marker { display: none; }
.fuel summary h2 { margin: 0; }
.fuel summary h2::after { content: " ▾"; color: var(--muted); font-size: .8em; }
.fuel[open] summary h2::after { content: " ▴"; }
.fuel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.fuel-col { display: grid; gap: 8px; align-content: start; min-width: 0; }
.fuel-col h3 { margin: 0; }
.fuel-when { margin: 6px 0 0; font-weight: 700; color: var(--accent); font-size: .9rem; }
.fuel-ideas { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.fuel-now { border: 1px solid var(--accent); }
.fuel-now h2 { margin: 0; font-size: 1.1rem; }
.fuel-now p { margin: 0; }
.fuel-now.after { display: grid; gap: 8px; border: 0; padding: 0; }
.fuel-now.after h3 { margin: 8px 0 0; font-size: 1rem; }

/* Journal : scanneur de code-barres */
.journal-add-btns { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.scan-panel { border: 1px solid var(--accent); }
.scan-code { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.scan-product { display: grid; gap: 8px; }
.scan-name { margin: 0; }
.scan-name small { display: block; color: var(--muted); }
.scan-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.nutri { display: inline-block; font-weight: 700; font-size: .8rem; color: #fff; border-radius: 6px; padding: 2px 8px; }
.nutri-a { background: #038141; } .nutri-b { background: #5f9e2f; } .nutri-c { background: #c9a400; } .nutri-d { background: #e07b00; } .nutri-e { background: #d93a1c; }
.scan-offer { margin: 0; font-weight: 600; }
.scan-qty input { max-width: 160px; }
.scan-credit { font-size: .78rem; }

/* Repas : le scanneur en vedette */
.scan-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; margin: 0 0 18px; padding: 16px 18px; border: 0; border-radius: 18px; cursor: pointer; text-align: left; font: inherit; color: #fff; background: linear-gradient(135deg, #ff5a36, #e0408a); box-shadow: 0 10px 28px rgba(224, 64, 90, .28); }
.scan-hero:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; }
.scan-hero-icon { display: grid; place-items: center; width: 64px; height: 52px; border-radius: 12px; background: #fff; color: #111; }
.scan-hero-txt { display: grid; gap: 2px; min-width: 0; }
.scan-hero-txt strong { font-size: 1.15rem; line-height: 1.2; }
.scan-hero-txt small { opacity: .92; font-size: .85rem; }
.scan-hero-go { font-size: 1.6rem; }
[dir="rtl"] .scan-hero { text-align: right; }

/* FitVie Scan : scanner mon repas */
.meal-cta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; margin: 0 0 14px; padding: 14px 16px; border: 2px solid var(--accent); border-radius: 16px; background: var(--surface); color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.meal-cta > span:first-child { font-size: 1.8rem; }
.meal-cta strong { display: block; font-size: 1.05rem; }
.meal-cta small { display: block; color: var(--muted); }
[dir="rtl"] .meal-cta { text-align: right; }
.meal-panel { border: 1px solid var(--accent); }
.meal-photo-btns { gap: 8px; flex-wrap: wrap; }
.meal-photo-btns label { cursor: pointer; }
.meal-quick .row { gap: 6px; flex-wrap: wrap; }
.meal-shot { width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; display: block; }
.meal-lines li { grid-template-columns: minmax(0, 1fr) auto auto; }
.meal-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.meal-pick { width: 100%; text-align: left; display: grid; gap: 2px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; }
.meal-pick small { color: var(--muted); }
[dir="rtl"] .meal-pick { text-align: right; }
.meal-privacy { font-size: .8rem; }
.meal-busy { font-weight: 600; }
.meal-ai progress { width: 100%; height: 10px; }

/* Repas : code-barres et photo du repas côte à côte */
.scan-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 6px; }
.scan-tile { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 132px; padding: 14px 10px; border: 0; border-radius: 18px; cursor: pointer; text-align: center; font: inherit; color: #fff; }
.scan-tile:focus-visible, .scan-tile:focus-within { outline: 3px solid var(--fg); outline-offset: 3px; }
.scan-tile-code { background: linear-gradient(135deg, #ff5a36, #e0408a); box-shadow: 0 10px 24px rgba(224, 64, 90, .26); }
.scan-tile-photo { background: linear-gradient(135deg, #1d8a5c, #136b8a); box-shadow: 0 10px 24px rgba(19, 107, 138, .26); }
.scan-tile-icon { display: grid; place-items: center; width: 60px; height: 48px; border-radius: 12px; background: #fff; color: #111; font-size: 1.7rem; }
.scan-tile strong { font-size: 1.05rem; line-height: 1.2; }
.scan-tile small { opacity: .92; font-size: .8rem; line-height: 1.3; }
.scan-duo-more { margin: 0 0 16px; text-align: center; }

/* Kit Marathon */
.mara h2 { margin: 0; }
.mara h3 { margin: 10px 0 0; font-size: 1rem; }
.mara-in { gap: 10px; flex-wrap: wrap; }
.mara-in .field { flex: 1 1 140px; min-width: 0; }
.mara-in select, .mara-in input, .mara-grid input { width: 100%; min-width: 0; box-sizing: border-box; }
.mara .field { min-width: 0; }
.mara-big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mara-big > div { padding: 10px 12px; border-radius: 14px; background: var(--surface-2); display: grid; gap: 2px; }
.mara-big strong { font-size: 1.4rem; }
.mara-band { border: 2px solid var(--fg); border-radius: 14px; overflow: hidden; }
.mara-band-head { padding: 6px 12px; background: var(--fg); color: var(--bg); font-weight: 800; font-size: .85rem; letter-spacing: .3px; }
.mara-band ol { list-style: none; margin: 0; padding: 4px 12px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.mara-band li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.mara-band li:last-child { font-weight: 800; }
.mara-list, .mara-foods { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mara-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.mara-foods li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.mara-foods small { color: var(--muted); }
.mara-meal { margin: 6px 0 0; font-weight: 700; }
.mara-w { max-width: 200px; }
.mara-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.mara-note { margin-top: 4px; }
.training { min-width: 0; max-width: 100%; }
.training > * { min-width: 0; }
/* Sport : 5 onglets sur 2 lignes plutôt que des noms coupés */
.training .seg { flex-wrap: nowrap; border-radius: 999px; overflow: visible; }
.training .seg-btn { flex: 1 1 0; min-width: 0; padding: 8px 4px; overflow: visible; text-overflow: clip; }
.mara-band-head { background: #c6f36b; color: #0a1813; }

/* Accueil : raccourci Kit Marathon */
.mara-cta { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; margin: 0 0 14px; padding: 14px 16px; border: 0; border-radius: 18px; cursor: pointer; text-align: left; font: inherit; color: #0a1813; background: linear-gradient(135deg, #c6f36b, #7fd6a1); box-shadow: 0 8px 22px rgba(29, 138, 92, .22); }
.mara-cta-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: #0a1813; font-size: 1.6rem; }
.mara-cta strong { display: block; font-size: 1.1rem; }
.mara-cta small { display: block; font-size: .85rem; opacity: .85; }
.mara-cta .go { font-size: 1.1rem; }
[dir="rtl"] .mara-cta { text-align: right; }
/* Mode course */
.run-start, .run-live { border: 2px solid #7fd6a1; }
.run-start .beta { font-size: .7rem; vertical-align: middle; padding: 2px 8px; border-radius: 999px; background: #c6f36b; color: #0a1813; }
.run-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.run-head h2 { margin: 0; }
.run-gps { font-size: .8rem; color: var(--muted); }
.run-chrono { font-size: 3.2rem; font-weight: 800; text-align: center; letter-spacing: 1px; }
.run-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.run-grid > div { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.run-grid strong { font-size: 1.05rem; }
.mara-best { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.mara-list li small { display: block; color: var(--muted); }

/* Espace « Réserver » (padel, foot à 5, paddle, cours) */
.res-cta { background: linear-gradient(135deg, #ffd6a6, #ffb38a); }
.res-sports, .res-days, .res-times { display: flex; flex-wrap: wrap; gap: 6px; }
.res-days { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.res-days::-webkit-scrollbar { display: none; }
.res-days .chip-btn { flex: 0 0 auto; }
.res-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.res-card { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.res-card.premium { border-color: var(--accent); box-shadow: 0 4px 14px rgb(29 138 92 / .14); }
.res-card-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.res-card-top small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.res-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); font-size: 1.4rem; }
.res-tag { display: inline-block; margin-inline-start: 4px; padding: 1px 8px; border-radius: 999px; background: #1f7a4d; color: #fff; font: 700 .72rem var(--font-body); vertical-align: middle; }
.res-tag.premium { background: #c6f36b; color: #0a1813; }
.res-perk { margin: 0; font-size: .9rem; }
.res-players { align-items: center; gap: 14px; }
.res-players b { min-width: 2ch; text-align: center; font-size: 1.2rem; }
.res-back { justify-self: start; }
.res-mine { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.res-mine li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.res-mine small { display: block; color: var(--muted); font-size: .85rem; }
.res-mine .res-status { color: var(--accent); }
.res-msg { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font: .85rem/1.45 var(--font-body); white-space: pre-wrap; }
.res-full { text-decoration: line-through; opacity: .45; }
.res-login { padding: 12px; border-radius: 14px; background: var(--surface-2); }
.res-done .res-code-big { margin: 0; font-size: 1.1rem; }
.res-done .res-code-big b { font-size: 1.8rem; letter-spacing: 2px; color: var(--accent); }
.res-account a.danger { color: #e5484d; font-weight: 700; }

/* Épuration, étape 2 : « Plus d'outils », lien Défis, gestes repliés */
.tools-block { margin: 22px 0 8px; }
.tools-block h2 { font-size: 1.1rem; margin: 0 0 10px; }
.tools-grid { display: grid; gap: 10px; }
.tool-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.tool-card > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.tool-card strong { font-size: 1rem; }
.tool-card small { color: var(--muted); font-size: 0.85rem; }
.tool-ico { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); font-size: 1.3rem; }
.tool-card .go { color: var(--muted); font-size: 1.5rem; }
.defi-link { margin: 12px 0; }
.defi-link .tool-ico { background: var(--c-defi-soft); }
.habits-fold { margin-top: 12px; }
.habits-fold > summary { list-style: none; cursor: pointer; position: relative; padding-right: 28px; }
.habits-fold > summary::-webkit-details-marker { display: none; }
.habits-fold > summary .block-head { margin: 0; }
.habits-fold > summary::after { content: "›"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--muted); transition: transform .2s; }
.habits-fold[open] > summary::after { transform: translateY(-50%) rotate(90deg); }
.habits-fold[open] > summary { margin-bottom: 8px; }

/* Progrès : 5e rubrique (poids, historique, défis, bilan), couleur ambre des défis */
body[data-univers="progres"] { --accent: var(--c-defi); --accent-soft: var(--c-defi-soft); --accent-ink: #fff; }
.nav-btn[data-nav="progres"] { --nav-c: var(--c-defi); --nav-soft: var(--c-defi-soft); }
/* Repas › Commander : photo du plat à gauche, texte puis bouton à droite de la photo */
.healthy-spot .dish { grid-template-columns: 72px minmax(0, 1fr); align-items: start; }
.healthy-spot .dish.no-img { grid-template-columns: minmax(0, 1fr); }
.healthy-spot .dish img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; grid-row: span 2; }
.healthy-spot .dish .btn { grid-column: auto; justify-self: start; }
.healthy-spot .dish .chip { margin-top: 4px; }
.cmd-head { font-size: 1.15rem; margin: 22px 0 10px; }



/* Sous-onglets (Repas, Progrès, Moi) : partagent la largeur, sur une ligne */
.subnav { gap: 6px; }
.subnav-btn { flex: 1 1 auto; min-width: 0; padding: 8px 10px; white-space: nowrap; }
/* Aujourd'hui : 4 onglets « du jour » */
.today-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin: 6px 0 12px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 6px 0; }
.today-tab { display: grid; gap: 1px; justify-items: center; padding: 8px 2px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--muted); font: inherit; cursor: pointer; }
.today-tab b { font-size: 0.82rem; color: var(--ink); text-align: center; line-height: 1.15; }
.today-tab small { font-size: 0.72rem; }
.today-tab[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.today-tab[aria-current="page"] b { color: var(--accent-ink); }
.today-total { margin: 4px 0 10px; }
.today-meal { display: grid; gap: 10px; padding: 0; overflow: hidden; margin-bottom: 12px; }
.today-meal .tm-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.today-meal .tm-txt { padding: 4px 16px 0; display: grid; gap: 4px; }
.today-meal .tm-txt h3 { margin: 0; font-size: 1.1rem; }
.today-meal .partner-dish { margin: 0 12px 12px; }
.today-meal .tm-txt:last-child { padding-bottom: 14px; }
.daily-challenge { border: 2px solid var(--c-defi); }

/* « Dis-le à FitVie » : bouton micro sur toutes les pages et bandeau d'actions */
.voice-fab { position: fixed; right: 16px; bottom: calc(92px + var(--sab)); z-index: 60; width: 58px; height: 58px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--c-home); color: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.25); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.voice-fab[hidden] { display: none; }
.voice-fab .vf-ico { font-size: 1.6rem; line-height: 1; }
.voice-fab .vf-time { position: absolute; bottom: -18px; font-size: .75rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.voice-fab.rec { background: #ff4d4d; animation: vf-pulse 1.1s infinite; }
.voice-fab.busy { background: var(--muted); }
@keyframes vf-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,77,77,.55); } 50% { box-shadow: 0 0 0 14px rgba(255,77,77,0); } }
.voice-toast { position: fixed; left: 12px; right: 12px; bottom: calc(92px + var(--sab)); z-index: 61; max-width: 520px; margin: 0 auto; padding: 12px 14px; border-radius: 18px; background: var(--ink); color: var(--bg); box-shadow: 0 10px 30px rgba(0,0,0,.3); display: grid; gap: 8px; }
.voice-toast[hidden] { display: none; }
.voice-toast .vt-lines { display: flex; flex-wrap: wrap; gap: 6px 12px; font-weight: 700; }
.voice-toast .vt-said { margin: 0; font-size: .85rem; opacity: .75; }
.voice-toast .vt-btns { display: flex; gap: 8px; justify-content: flex-end; }
.voice-toast .btn.ghost { color: var(--bg); border-color: rgba(255,255,255,.35); }
.voice-toast .link { color: var(--bg); text-decoration: underline; background: none; border: 0; font: inherit; justify-self: start; padding: 0; }
