/* Polices de la DA des reels (libres, licence OFL, dans le dossier fonts) */
@font-face { font-family: "Anton"; src: url(fonts/Anton-Regular.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "Bebas Neue"; src: url(fonts/BebasNeue-Regular.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "Sora"; src: url(fonts/Sora.ttf) format("truetype"); font-weight: 100 800; font-display: swap; }
/* HERO BUILD — noir, or, blanc */
:root {
  /* Couleurs relevées sur le logo Build de Héros */
  --gold: #caa567;
  --gold-hi: #f9e1aa;
  --gold-lo: #96713d;
  --gold-text: #d9b878;
  --gold-grad: linear-gradient(135deg, #f9e1aa, #caa567 45%, #96713d);
  /* Thème « Graphite » (par défaut) : noir chaud, plus doux que le noir pur */
  --bg: #1e1c1a;
  --bg2: #282522;
  --card: #2b2825;
  --line: #3c3732;
  --track: #3a3530;
  --text: #f5efe4;
  --muted: #b0a696;
  --on-gold: #1a1510;
  --glass: rgba(30, 28, 26, .9);
  --tint: #332b20;
  --glow: rgba(202, 165, 103, .12);
  --shadow: 0 6px 24px rgba(0, 0, 0, .25);
  --ok: #8fcf93;
  --warn: #e8ad5a;
  --r: 16px;
  --serif: "Cormorant Garamond", "Didot", "Bodoni 72", Georgia, "Times New Roman", serif;
  --sans: "Sora", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --display: "Anton", "Impact", "Arial Narrow Bold", sans-serif;
  --caption: "Bebas Neue", "Anton", "Arial Narrow", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
/* Thème « Clair » : ivoire, or et noir */
[data-theme="clair"] {
  --gold: #b48a4a;
  --gold-text: #94692c;
  --gold-lo: #b48a4a;
  --bg: #f5f1e9;
  --bg2: #ede6da;
  --card: #fffdf9;
  --line: #e2d8c7;
  --track: #e8dfcf;
  --text: #1c1915;
  --muted: #786e60;
  --on-gold: #1c1915;
  --glass: rgba(245, 241, 233, .92);
  --tint: #f7ecd6;
  --glow: rgba(202, 165, 103, .18);
  --shadow: 0 6px 24px rgba(60, 45, 20, .08);
  --ok: #2f8a3a;
  --warn: #b86e10;
}
[data-theme="clair"] .brand img, [data-theme="clair"] .logo-img { filter: brightness(.78) saturate(1.25) contrast(1.1); }
[data-theme="clair"] .card, [data-theme="clair"] .stat, [data-theme="clair"] .item, [data-theme="clair"] .exblock, [data-theme="clair"] .meal, [data-theme="clair"] .hab { box-shadow: var(--shadow); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.45; }
body { min-height: 100vh; background: radial-gradient(900px 520px at 50% -120px, var(--glow), transparent 70%), var(--bg); background-attachment: fixed; }
body::before { content: ""; position: fixed; width: 760px; height: 760px; right: -380px; top: -260px; border-radius: 50%; border: 1px solid var(--gold); opacity: .18; pointer-events: none; z-index: 0; }
#app { position: relative; z-index: 1; }
.gold, .pr { color: var(--gold-text) !important; }
#app { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(96px + var(--safe-b)); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-family: var(--serif); font-size: 30px; font-weight: 700; }
h2 { font-size: 18px; margin: 26px 0 10px; }
h3 { font-size: 15px; }
p { margin: 6px 0; }
a { color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.gold { color: var(--gold); }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.upper { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 600; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stack > * + * { margin-top: 10px; }

/* En-tête */
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand b { font-family: var(--serif); font-size: 19px; letter-spacing: .02em; }
.iconbtn { background: var(--card); border: 1px solid var(--line); color: var(--text); width: 38px; height: 38px; border-radius: 12px; font-size: 16px; cursor: pointer; }
.back { background: none; border: 0; color: var(--gold); font-size: 15px; padding: 0; cursor: pointer; margin-bottom: 12px; }

/* Cartes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card + .card { margin-top: 10px; }
.card.gold-border { border-color: var(--gold-lo); background: linear-gradient(180deg, var(--tint), var(--card)); }
.card.tap { cursor: pointer; transition: border-color .15s; }
.card.tap:hover { border-color: var(--gold-lo); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 500; }

/* Boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 16px; font: 600 15px var(--sans); cursor: pointer; background: var(--gold-grad); color: var(--on-gold); text-decoration: none; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost.goldline { border-color: var(--gold-lo); color: var(--gold); }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn.danger { background: transparent; border: 1px solid #c96b6b; color: #e07a7a; }
.btn:disabled { opacity: .45; cursor: default; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input, select, textarea { width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 11px 12px; font: 15px var(--sans); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
textarea { min-height: 84px; resize: vertical; }
input[type=range] { padding: 0; accent-color: var(--gold); background: none; border: 0; }

/* Onglets */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 4px -16px 14px; padding: 0 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; background: var(--card); border: 1px solid var(--line); color: var(--muted); padding: 8px 14px; border-radius: 999px; font: 600 13px var(--sans); cursor: pointer; }
.tab.on { background: var(--gold-grad); color: var(--on-gold); border-color: transparent; }

/* Navigation du bas */
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + var(--safe-b)); z-index: 20; }
.nav .in { display: flex; width: 100%; max-width: 560px; }
.nav button { flex: 1; background: none; border: 0; color: var(--muted); font: 600 10.5px var(--sans); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; cursor: pointer; position: relative; }
.nav button .i { font-size: 20px; line-height: 1; filter: grayscale(1); opacity: .75; }
.nav button.on { color: var(--gold); }
.nav button.on .i { filter: none; opacity: 1; }
.badge { position: absolute; top: 0; right: calc(50% - 20px); background: var(--gold); color: var(--on-gold); font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }

/* Listes */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.item.tap { cursor: pointer; }
.item.tap:hover { border-color: var(--gold-lo); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--gold-grad); color: var(--on-gold); display: grid; place-items: center; font-weight: 700; flex: none; }
.pill { display: inline-block; white-space: nowrap; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line); color: var(--muted); }
.pill.gold { border-color: var(--gold-lo); color: var(--gold); }
.pill.ok { border-color: var(--ok); color: var(--ok); }
.pill.warn { border-color: var(--gold-lo); color: var(--warn); }
.chev { color: var(--muted); }

/* Habitudes */
.habit { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); cursor: pointer; user-select: none; }
.habit .box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 14px; flex: none; }
.habit.done { border-color: var(--gold-lo); }
.habit.done .box { background: var(--gold-grad); border-color: transparent; color: var(--on-gold); }
.habit.done .t { color: var(--muted); text-decoration: line-through; }

/* Progrès */
.bar { height: 8px; background: var(--bg2); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold-grad); border-radius: 4px; }
.ring { width: 132px; height: 132px; position: relative; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .c b { font-size: 22px; display: block; }
.chart { width: 100%; height: auto; display: block; }

/* Exercices */
.ex { padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.ex:first-child { border-top: 0; padding-top: 0; }
.ex .n { width: 26px; height: 26px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--gold); flex: none; }
.ex.done .n { background: var(--gold-grad); color: var(--on-gold); border-color: transparent; }
.ex.done .nm { color: var(--muted); text-decoration: line-through; }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos .ph { position: relative; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph span { position: absolute; left: 6px; bottom: 6px; font-size: 10.5px; background: rgba(0,0,0,.7); padding: 2px 6px; border-radius: 6px; }
.compare { position: relative; aspect-ratio: 3/4; border-radius: var(--r); overflow: hidden; background: var(--bg2); border: 1px solid var(--gold-lo); user-select: none; touch-action: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .after { clip-path: inset(0 0 0 50%); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--gold); transform: translateX(-1px); }
.compare .handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: var(--gold-grad); color: var(--on-gold); display: grid; place-items: center; font-weight: 700; }
.compare .lab { position: absolute; top: 10px; font-size: 11px; background: rgba(0,0,0,.72); padding: 3px 8px; border-radius: 6px; }
.compare .lab.l { left: 10px; } .compare .lab.r { right: 10px; }
.side { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side .compare { aspect-ratio: 3/4; }

/* Recettes */
.recipe-img { height: 110px; border-radius: 12px; display: grid; place-items: center; font-size: 46px; background: radial-gradient(circle at 30% 20%, var(--tint), var(--bg2)); border: 1px solid var(--line); margin-bottom: 10px; }
.macros { display: flex; gap: 6px; flex-wrap: wrap; }

/* Messages */
.chat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 76px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; }
.msg.me { align-self: flex-end; background: var(--gold-grad); color: var(--on-gold); border: 0; border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg time { display: block; font-size: 10.5px; opacity: .6; margin-top: 3px; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(62px + var(--safe-b)); padding: 10px 16px; background: var(--glass); border-top: 1px solid var(--line); z-index: 15; }
.composer .in { max-width: 528px; margin: 0 auto; display: flex; gap: 8px; }
.composer input { border-radius: 999px; }
.composer .btn { border-radius: 999px; padding: 0 16px; }

/* Paiement */
.plan { border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: var(--card); }
.plan.on { border-color: var(--gold); background: linear-gradient(180deg, var(--tint), var(--card)); }
.plan .big { font-size: 20px; font-weight: 700; }
.sched { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }

/* Accueil */
.hero { text-align: center; padding: 34px 0 10px; }
.hero img { width: 92px; height: 92px; border-radius: 24px; box-shadow: 0 0 60px rgba(202,165,103,.25); }
.hero h1 { font-size: 40px; margin-top: 18px; }
.hero .line { width: 48px; height: 2px; background: var(--gold-grad); margin: 14px auto; }

/* Fenêtre */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg2); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 20px 18px calc(22px + var(--safe-b)); animation: up .22s ease-out; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: -8px auto 14px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--gold-grad); color: var(--on-gold); font-weight: 600; padding: 10px 16px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.empty { text-align: center; padding: 28px 10px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ── Ajouts v2 (inspirés de Hubfit) ── */
.exblock { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.exblock + .exblock { margin-top: 10px; }
.exblock.complete { border-color: var(--gold-lo); }
.setrow { display: grid; grid-template-columns: 34px 1fr 1fr 40px; gap: 8px; align-items: center; margin-top: 6px; }
.setrow.head { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; margin-top: 10px; }
.setrow input { padding: 8px 10px; text-align: center; }
.setrow .sn { text-align: center; color: var(--gold); font-weight: 700; font-size: 13px; }
.setrow .ck { width: 40px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--muted); font-size: 16px; cursor: pointer; }
.setrow.done .ck { background: var(--gold-grad); color: var(--on-gold); border-color: transparent; }
.setrow.done input { border-color: var(--gold-lo); }
.restbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(74px + var(--safe-b)); z-index: 30; background: var(--tint); border: 1px solid var(--gold); color: var(--text); border-radius: 999px; padding: 8px 8px 8px 16px; display: flex; gap: 12px; align-items: center; font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.restbar b { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--gold-hi); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; padding: 6px 4px; }
.table td { padding: 7px 4px; border-top: 1px solid var(--line); }
.scroll-x { overflow-x: auto; }
.hab { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); cursor: pointer; user-select: none; }
.hab .em { width: 40px; height: 40px; border-radius: 12px; background: var(--bg2); display: grid; place-items: center; font-size: 20px; flex: none; }
.hab.done { border-color: var(--gold-lo); }
.hab.done .em { background: var(--gold-grad); }
.hab .bar { margin-top: 6px; height: 5px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal .h { color: var(--muted); font-size: 11px; font-weight: 600; }
.cal .d { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; border: 2px solid var(--track); color: var(--muted); max-width: 40px; margin: auto; width: 100%; }
.cal .d.full { background: var(--gold-grad); color: var(--on-gold); border-color: transparent; font-weight: 700; }
.cal .d.part { border-color: var(--gold-lo); color: var(--text); }
.cal .d.fut { opacity: .35; }
.cal .d.today { outline: 1px solid var(--gold-hi); outline-offset: 2px; }
.stars { display: flex; gap: 6px; }
.stars button { background: none; border: 0; font-size: 28px; color: var(--track); cursor: pointer; padding: 0; }
.stars button.on { color: var(--gold); }
.thumbs { display: flex; gap: 6px; margin-top: 8px; }
.thumbs img { width: 64px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.slot { flex: 1; aspect-ratio: 3/4; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); cursor: pointer; overflow: hidden; position: relative; background: var(--bg2); }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.week { display: flex; gap: 6px; justify-content: space-between; }
.week .wd { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }
.week .wd i { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 4px; border-radius: 50%; border: 2px dashed var(--track); font-style: normal; font-size: 12px; color: var(--text); }
.week .wd.on i { border: 2px solid var(--gold); background: rgba(202,165,103,.18); }
.week .wd.planned i { border-style: solid; border-color: var(--line); }
.meal { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.meal + .meal { margin-top: 10px; }
.food { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.food:first-of-type { border-top: 0; }
.food input { width: 74px; padding: 6px 8px; text-align: center; }
.mbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.mbar .bar { margin: 6px 0 4px; height: 6px; }
.mbar .c > i { background: linear-gradient(90deg, #7fb6c9, #4f8fa6); }
.mbar .f > i { background: linear-gradient(90deg, #a58bd6, #7a5fb3); }
.feel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.feel button { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 14px; padding: 14px 8px; font: 600 14px var(--sans); cursor: pointer; }
.feel button span { display: block; font-size: 28px; margin-bottom: 4px; }
.pr { color: var(--gold-hi); font-weight: 700; }

/* Scanner de code-barres */
.scanbox { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4/3; margin: 6px 0 8px; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanframe { position: absolute; left: 12%; right: 12%; top: 30%; bottom: 30%; border: 2px solid var(--gold); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.45); }
.scanframe::after { content: ""; position: absolute; left: 6px; right: 6px; height: 2px; background: var(--gold-hi); top: 50%; animation: scan 1.6s ease-in-out infinite alternate; box-shadow: 0 0 12px var(--gold); }
@keyframes scan { from { top: 10%; } to { top: 90%; } }

/* Séance en cours (barre au-dessus du menu) */
.livebar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(70px + var(--safe-b)); width: calc(100% - 24px); max-width: 536px; z-index: 18; display: flex; align-items: center; gap: 12px; background: var(--tint); border: 1px solid var(--gold-lo); border-radius: 16px; padding: 10px 14px; cursor: pointer; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.restbar { padding: 6px 8px 6px 8px; gap: 8px; bottom: calc(132px + var(--safe-b)); }
#app:has(.livebar) { padding-bottom: calc(170px + var(--safe-b)); }

/* Graphiques : suivent le thème */
.chart line, .chart [stroke="#2a2a2a"] { stroke: var(--line); }
.chart text[fill="#9a958a"] { fill: var(--muted); }
.chart circle[fill="#0b0b0b"] { fill: var(--card); }
.chart rect[fill="#222"], svg circle[stroke="#333"], svg circle[stroke="#222"] { fill-opacity: 1; }
.chart rect[fill="#222"] { fill: var(--track); }
svg circle[stroke="#333"], svg circle[stroke="#222"] { stroke: var(--track); }
.cal .d { border-color: var(--track); }
.week .wd i { border-color: var(--track); }
.week .wd.planned i { border-color: var(--line); }
.cal .d.full, .habit.done .box, .hab.done .em { color: var(--on-gold); }
/* Logo */
.brand img { width: 30px; height: 42px; object-fit: contain; border-radius: 0; }
.brand b { font-family: var(--serif); font-weight: 500; font-size: 15px; letter-spacing: .28em; color: var(--gold-text); -webkit-text-fill-color: currentColor; background: none; }
.hero { position: relative; margin: -18px -16px 0; padding: 40px 16px 18px; background: url(img/logo-bg.jpg) center 46% / 900px auto no-repeat; border-radius: 0 0 28px 28px; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, var(--bg)); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero .logo-img { width: 210px; height: auto; display: block; margin: 30px auto 8px; filter: drop-shadow(0 6px 30px rgba(202,165,103,.25)); }
[data-theme="clair"] .hero { background: none; }
.theme-toggle { margin: 22px auto 0; display: flex; justify-content: center; gap: 6px; }
.hero { min-height: 330px; background-size: 760px auto; background-position: center 52%; }
.hero .logo-img { box-shadow: none; border-radius: 0; }
:root:not([data-theme="clair"]) .hero .logo-img { visibility: hidden; }
[data-theme="clair"] .hero { min-height: 0; }
[data-theme="clair"] .chart text[fill="#f9e1aa"] { fill: var(--gold-text); }

/* ── Typo des reels : Anton (titres), Bebas Neue (légendes, boutons), Sora (texte) ── */
html, body { font-size: 14.5px; }
h1 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; font-size: 34px; line-height: 1.02; }
h2 { font-family: var(--caption); font-weight: 400; font-size: 24px; letter-spacing: .05em; line-height: 1.1; }
h3 { font-family: var(--sans); font-weight: 600; }
.upper { font-family: var(--caption); font-weight: 400; font-size: 14.5px; letter-spacing: .12em; }
.stat .v, .ring .c b { font-family: var(--display); font-weight: 400; font-size: 27px; letter-spacing: .01em; }
.stat .v small { font-family: var(--sans); }
.btn { font-family: var(--caption); font-weight: 400; font-size: 18px; letter-spacing: .06em; line-height: 1; padding: 13px 18px 11px; }
.btn.sm { font-size: 15.5px; padding: 9px 12px 7px; }
.tab { font-family: var(--caption); font-weight: 400; font-size: 16px; letter-spacing: .06em; padding: 8px 14px 6px; }
.pill { font-family: var(--caption); font-weight: 400; font-size: 14px; letter-spacing: .06em; padding: 3px 10px 2px; }
.nav button { font-family: var(--caption); font-weight: 400; font-size: 13.5px; letter-spacing: .07em; }
.feel button { font-family: var(--caption); font-weight: 400; font-size: 18px; letter-spacing: .05em; }
.setrow.head, .table th, .cal .h { font-family: var(--caption); font-weight: 400; font-size: 14px; letter-spacing: .1em; }
.setrow .sn, .ex .n, .avatar { font-family: var(--display); font-weight: 400; }
.restbar b, .livebar b.gold, [data-elapsed] { font-family: var(--display); font-weight: 400; letter-spacing: .02em; }
.toast { font-family: var(--caption); font-weight: 400; font-size: 17px; letter-spacing: .05em; }
.item b, .exblock > .row b, .meal > .row b, .hab b { font-weight: 600; }
.chart text { font-family: var(--sans); }
label { font-family: var(--sans); }
h1 .gold, h1 .hl { color: var(--gold-text); }

/* ── « BUILD DE HÉROS » épique : Anton, or métal, gros et gras ── */
:root { --metal: linear-gradient(180deg, #fff6d8 0%, #f9e1aa 22%, #d9b36e 48%, #a97c3c 72%, #e7c98c 88%, #b88a48 100%); }
[data-theme="clair"] { --metal: linear-gradient(180deg, #e9c98a 0%, #c99a52 35%, #8f6428 70%, #b48a4a 100%); }
.epic-hero { position: relative; text-align: center; margin: -18px -16px 6px; padding: 46px 16px 26px; overflow: hidden;
  background: radial-gradient(420px 300px at 50% 38%, rgba(202,165,103,.22), transparent 70%); }
.epic-hero .arc { position: absolute; border-radius: 50%; border: 1.5px solid var(--gold); pointer-events: none; }
.epic-hero .a1 { width: 520px; height: 520px; left: 50%; top: -60px; transform: translateX(-50%); opacity: .35; border-color: transparent var(--gold) transparent var(--gold); }
.epic-hero .a2 { width: 640px; height: 640px; left: 50%; top: -120px; transform: translateX(-50%) rotate(35deg); opacity: .18; border-width: 1px; border-color: var(--gold) transparent transparent transparent; }
.epic-mark { position: relative; width: 74px; height: auto; display: block; margin: 0 auto 12px; filter: drop-shadow(0 6px 22px rgba(202,165,103,.45)); }
.epic { position: relative; font-family: var(--display); font-weight: 400; text-transform: uppercase; margin: 0; line-height: .86; letter-spacing: .005em; }
.epic span { display: block; background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.45)) drop-shadow(0 0 26px rgba(202,165,103,.35)); }
.epic .l1 { font-size: clamp(44px, 13.5vw, 64px); letter-spacing: .06em; }
.epic .l2 { font-size: clamp(86px, 27vw, 128px); letter-spacing: .01em; margin-top: 2px; }
[data-theme="clair"] .epic span { filter: drop-shadow(0 3px 0 rgba(80,55,20,.18)) drop-shadow(0 0 18px rgba(202,165,103,.25)); }
.epic-rule { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px auto 10px; color: var(--gold); font-size: 10px; }
.epic-rule i { width: 64px; height: 1.5px; background: linear-gradient(90deg, transparent, var(--gold)); }
.epic-rule i:last-child { background: linear-gradient(90deg, var(--gold), transparent); }
.epic-sub { font-family: var(--caption); font-size: 17px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0; }
/* En-tête : le nom en or métal, gros et gras */
.brand { gap: 9px; }
.brand img { width: 26px; height: 36px; }
.brand b { font-family: var(--display); font-weight: 400; font-size: 23px; letter-spacing: .03em; line-height: 1; text-transform: uppercase;
  background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
[data-theme="clair"] .brand b { filter: none; }
.brand .muted.small { font-family: var(--caption); font-size: 13.5px; letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; }
.epic span { padding-top: .16em; margin-top: -.16em; }
.epic .l2 { margin-top: calc(2px - .16em); }
.epic-sub { font-size: 15px; letter-spacing: .1em; }
.brand b { padding-top: .14em; margin-top: -.14em; }
[data-theme="clair"] .epic-mark { filter: brightness(.72) saturate(1.35) contrast(1.15) drop-shadow(0 4px 14px rgba(150,113,61,.3)); }
/* Taille réduite (validée) */
.epic .l1 { font-size: clamp(30px, 9vw, 40px); letter-spacing: .07em; }
.epic .l2 { font-size: clamp(56px, 17vw, 76px); }
.epic-mark { width: 58px; margin-bottom: 10px; }
.epic-hero { padding: 34px 16px 20px; }
.brand b { font-size: 20px; }
/* Encore un peu plus petit + place pour l'accent du É */
.epic { line-height: 1; }
.epic .l1 { font-size: clamp(26px, 7.6vw, 34px); }
.epic .l2 { font-size: clamp(46px, 14vw, 62px); margin-top: calc(6px - .16em); }
.epic-mark { width: 50px; }
/* HÉROS : haut du dégradé plus foncé pour que l'accent du É soit bien doré */
.epic .l2 { background-image: linear-gradient(180deg, #b88a48 0%, #caa567 16%, #f3d79c 34%, #d9b36e 55%, #a97c3c 78%, #c99a52 100%); }
[data-theme="clair"] .epic .l2 { background-image: linear-gradient(180deg, #8f6428 0%, #b48a4a 20%, #c99a52 40%, #8f6428 75%, #b48a4a 100%); }

/* Dates sur les photos : toujours lisibles (texte blanc sur étiquette sombre), même en thème clair */
.compare .lab, .photos .ph span { color: #fff; background: rgba(0, 0, 0, .62); font-weight: 600; }
/* Bouton « + » pour ajouter un repas du plan au journal */
.iconbtn.addj { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-grad); color: var(--on-gold); border: 0; font-size: 20px; font-weight: 700; flex: none; margin-left: 4px; }
/* Choix du repas (Petit-déjeuner / Déjeuner / Dîner / Collations) */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.choice label { margin: 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; text-align: center; padding: 14px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-family: var(--sans); font-size: 14.5px; font-weight: 600; }
.choice input:checked + span { border-color: var(--gold); background: var(--tint); color: var(--gold-text); box-shadow: inset 0 0 0 1px var(--gold); }

/* Démarrage volontaire de la séance */
.startbtn { font-size: 20px; padding: 15px; box-shadow: 0 6px 22px rgba(202,165,103,.28); }
.pill.paused { opacity: .6; }

/* Animations des exercices : 2 photos (début / fin) qui alternent */
.anim { position: relative; display: block; overflow: hidden; border-radius: 12px; background: #fff; flex: none; }
.anim img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.anim img + img { animation: animflip 1.6s steps(1) infinite; }
@keyframes animflip { 0% { opacity: 0; } 50% { opacity: 1; } }
.anim.thumb { width: 64px; height: 48px; border-radius: 10px; }
.anim.thumb.sm { width: 52px; height: 40px; }
.anim.big { width: 100%; aspect-ratio: 3 / 2; border-radius: 16px; }
.anim.big img { object-fit: contain; }
.anim.none { display: grid; place-items: center; background: var(--bg2); color: var(--muted); border: 1px dashed var(--line); }
.animbtn { padding: 0; border: 1px solid var(--line); border-radius: 11px; background: none; cursor: pointer; flex: none; margin-right: 10px; }
.ex .animbtn { margin-right: 0; }
.animpick { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.consignes { margin-top: 12px; font-size: 13px; color: var(--muted); }
.consignes summary { cursor: pointer; color: var(--gold-text, var(--gold)); font-weight: 600; }
.consignes ol { padding-left: 18px; margin: 8px 0 0; line-height: 1.5; }
.row.wrap { flex-wrap: wrap; }

/* Photos des recettes */
.recipe-img.photo { padding: 0; overflow: hidden; background: var(--bg2); }
.recipe-img.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.credit { font-size: 10.5px; color: var(--muted); margin: -4px 0 8px; opacity: .8; }
.recphoto { padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); }
.recphoto .credit { margin: 8px 0 0; }
.recgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.recpick { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--bg2); cursor: pointer; }
.recpick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recpick.busy { opacity: .4; }

/* Séances seules */
.tab.addfree { border-style: dashed; color: var(--gold); }

/* Agenda / prise de rendez-vous */
.item.sel { border-color: var(--gold); }
.daystrip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.dchip { flex: none; width: 58px; padding: 8px 0; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; font-family: inherit; }
.dchip b { font-family: var(--display); font-size: 22px; font-weight: 400; line-height: 1.1; }
.dchip small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; }
.dchip.on { background: linear-gradient(135deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); color: #1a1714; border-color: transparent; }
.dchip.on small { color: #3a3128; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tslot { padding: 11px 0; border-radius: 12px; border: 1px solid var(--gold-lo); background: transparent; color: var(--gold-text, var(--gold)); font-weight: 600; font-family: inherit; cursor: pointer; }
.tslot:active { background: var(--gold); color: #1a1714; }
.linkx { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 0 0 4px; font-size: 11px; }

/* Version en ligne */
.linkbtn { background: none; border: 0; padding: 0; color: var(--gold-text, var(--gold)); font: inherit; text-decoration: underline; cursor: pointer; }
body.offline::before { content: "Hors ligne : tes changements seront envoyés dès le retour du réseau"; position: fixed; top: 0; left: 0; right: 0; z-index: 99; background: #8a5a1c; color: #fff; font-size: 12px; text-align: center; padding: 4px 8px; }
