/* ============================================================
   BYKE COACH — Dark editorial system
   Réf. : Experimental Jetset, Hassan Rahim/12:01, Bureau Borsche,
   DIA Studio, David Rudnick, OK-RM, Peter Saville.
   Monochrome os-sur-noir + 1 couleur signal. Filets, angles nets,
   grotesque + mono, chiffres tabulaires en objets éditoriaux.
   ============================================================ */
:root {
  --bg: #0a0a0b;
  --bg-2: #101012;
  --panel: #0d0d0f;
  --line: #232327;
  --line-2: #33333a;
  --txt: #ECEAE3;      /* blanc os */
  --muted: #77777e;
  --muted-2: #4a4a50;
  --accent: #FF3B1E;   /* signal vermillon — change juste cette variable pour reskinner */
  --accent-ink: #0a0a0b;
  --ok: #C6F24E;

  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --r: 0px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--txt); }
body {
  font-family: var(--sans);
  padding-bottom: 92px;
  max-width: 620px;
  margin: 0 auto;
  min-height: 100vh;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

/* micro-label mono en capitales espacées — la signature du système */
.kicker, .card h2, nav.tabs button, .btn, label, .pill, .tiny.mono {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ---------- Header ---------- */
header.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
header.top h1 {
  font-size: 19px; margin: 0; font-weight: 800;
  letter-spacing: -0.02em; text-transform: uppercase;
}
header.top h1 span { color: var(--accent); }
.icon-btn {
  background: transparent; border: 1px solid var(--line-2); color: var(--txt);
  width: 40px; height: 40px; border-radius: var(--r); font-size: 15px; cursor: pointer;
  font-family: var(--mono); transition: border-color .15s, color .15s;
  filter: grayscale(1) brightness(1.6); /* neutralise la couleur native de l'emoji ⚙️ */
}
.icon-btn:hover { border-color: var(--txt); }

main { padding: 0; }
.view { display: none; }
.view.active { display: block; animation: rise .3s cubic-bezier(.2,.7,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 22px 20px;
  position: relative;
}
.card h2 {
  margin: 0 0 16px; font-size: 10.5px; font-weight: 500; color: var(--muted);
}
.card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Hero streak : chiffre éditorial ---------- */
.hero { background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 20px 26px; }
.hero .flame { display: none; }
.hero .streak-num {
  font-size: clamp(76px, 24vw, 136px); /* assez monumental, sans repousser le CTA sous la ligne de flottaison */
  font-weight: 800; line-height: .82; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums; margin: 6px 0 0 -5px;
}
.hero .streak-lbl {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 11px; color: var(--muted); margin-top: 14px; max-width: 34ch;
  border-top: 1px solid var(--line); padding-top: 12px;
}

/* ---------- Stats : grille filetée ---------- */
.row { display: flex; }
.row.stats-row { border-bottom: 1px solid var(--line); }
.stat {
  flex: 1; background: var(--bg); padding: 18px 16px 16px; text-align: left;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: none; }
.stat .v { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.stat .l {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 9.5px; color: var(--muted); margin-top: 8px;
}
/* variante pour la grille bouffe (2 gros compteurs) */
.row.big .stat .v { font-size: 40px; }
.row.big .stat .v small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }

/* ---------- Forms ---------- */
label { display: block; font-size: 10px; color: var(--muted); margin: 14px 0 7px; font-weight: 500; }
input, textarea, select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--txt);
  border-radius: var(--r); padding: 13px 14px; font-size: 15px; font-family: var(--sans);
  transition: border-color .15s;
}
input[type=number], .stat .v, input#coachMsg { font-variant-numeric: tabular-nums; }
textarea { resize: vertical; min-height: 64px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Buttons ---------- */
.btn {
  background: var(--txt); color: var(--accent-ink); border: 1px solid var(--txt);
  border-radius: var(--r); padding: 14px 16px; font-size: 11px; font-weight: 700;
  cursor: pointer; width: 100%; transition: opacity .15s, background .15s, color .15s;
}
.btn:hover { opacity: .82; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--txt); border: 1px solid var(--line-2); }
.btn.ghost:hover { border-color: var(--txt); opacity: 1; }
.btn.sm { padding: 9px 13px; width: auto; font-size: 10px; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.big { font-size: 14px; padding: 20px 16px; letter-spacing: 0.18em; }

/* ---------- Hero meta (streaks secondaires) ---------- */
.hero-meta {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 9.5px; color: var(--muted-2); margin-top: 10px;
}
.hero-meta b { color: var(--txt); font-weight: 700; }

/* ---------- Prescription du jour ---------- */
.rx-head {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 11px; color: var(--txt); border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 4px;
}
.rx-head .focus { color: var(--accent); }
.rx-item { border-bottom: 1px solid var(--line); padding: 12px 0; }
.rx-item:last-child { border-bottom: none; }
.rx-item .nm { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.rx-item .target {
  font-family: var(--mono); font-size: 11px; color: var(--txt); margin-top: 4px; letter-spacing: 0.06em;
}
.rx-item .target b { color: var(--accent); font-weight: 700; }
.rx-item .why { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.rx-gap {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent); border: 1px solid var(--accent); padding: 7px 10px; margin: 10px 0 4px; display: inline-block;
}

/* ---------- Rest timer ---------- */
.rest-row { display: flex; align-items: center; gap: 10px; }
.rest-display {
  margin-left: auto; font-family: var(--mono); font-size: 22px; font-weight: 700;
  font-variant-numeric: tabular-nums; min-width: 74px; text-align: right;
}
.rest-display.hot { color: var(--accent); }

/* ---------- Revue / tendance : lignes de données mono ---------- */
.data-line {
  display: flex; justify-content: space-between; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.data-line:last-of-type { border-bottom: none; }
.data-line .k { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 9.5px; color: var(--muted); padding-top: 3px; white-space: nowrap; }
.data-line .v { text-align: right; line-height: 1.4; }
.data-line .v.hi { color: var(--accent); font-weight: 700; }

/* ---------- Sliders ---------- */
.slider-row { display: flex; align-items: center; gap: 14px; margin: 8px 0; }
.slider-row span.emoji { display: none; }
.slider-row output {
  min-width: 34px; text-align: right; font-weight: 800; font-size: 18px;
  font-variant-numeric: tabular-nums; font-family: var(--mono);
}
input[type=range] { -webkit-appearance: none; appearance: none; height: 2px; background: var(--line-2); border-radius: 0; padding: 0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 3px solid var(--bg); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 3px solid var(--bg); }

/* ---------- Bits ---------- */
.pill { display: inline-block; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 11px; font-size: 10px; color: var(--muted); margin: 2px; }
.pill.ok { color: var(--ok); border-color: var(--ok); }

.list-item {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.list-item .sub { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 5px; letter-spacing: 0.06em; }
.del { background: none; border: none; color: var(--muted); font-size: 15px; cursor: pointer; font-family: var(--mono); }
.del:hover { color: var(--accent); }

.exercise { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.set-line { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.set-line input { text-align: center; }
.set-line .x { color: var(--muted); font-size: 13px; font-family: var(--mono); }

svg.chart { width: 100%; height: 150px; display: block; }

.photos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos-grid .ph { position: relative; aspect-ratio: 3/4; border-radius: var(--r); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.photos-grid .ph img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.2) contrast(1.02); }
.photos-grid .ph .d { position: absolute; bottom: 0; left: 0; font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; background: var(--bg); color: var(--txt); padding: 3px 6px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.photos-grid .ph .del { position: absolute; top: 4px; right: 6px; color: #fff; text-shadow: 0 1px 3px #000; }

.coach-bubble {
  background: var(--bg); border: 1px solid var(--line); border-left: 2px solid var(--accent);
  border-radius: var(--r); padding: 15px 40px 15px 16px; white-space: pre-wrap; line-height: 1.55; font-size: 14.5px;
  position: relative;
}
.coach-bubble.me { border-left-color: var(--line-2); color: var(--muted); }
.coach-bubble strong { font-weight: 700; }
.coach-bubble em { font-style: normal; color: var(--accent); }
.coach-del {
  position: absolute; top: 8px; right: 10px; font-size: 14px; line-height: 1;
  opacity: .5; padding: 4px;
}
.coach-del:hover { opacity: 1; }
.tiny { font-size: 12px; color: var(--muted); line-height: 1.5; }
.tiny code { font-family: var(--mono); color: var(--txt); background: var(--bg-2); padding: 1px 5px; border: 1px solid var(--line); }
.center { text-align: center; }
.mt { margin-top: 14px; }
hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
details summary { color: var(--muted); }

/* ---------- Bottom nav : index éditorial ---------- */
nav.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; max-width: 620px; margin: 0 auto;
  background: var(--bg); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs button {
  background: none; border: none; border-right: 1px solid var(--line);
  color: var(--muted); font-size: 9.5px; font-weight: 500;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  cursor: pointer; padding: 12px 10px 14px; flex: 1; position: relative; transition: color .15s;
}
nav.tabs button:last-child { border-right: none; }
nav.tabs button .i { font-family: var(--mono); font-size: 10px; color: var(--muted-2); letter-spacing: 0.05em; font-style: normal; }
nav.tabs button.active { color: var(--txt); }
nav.tabs button.active .i { color: var(--accent); }
nav.tabs button.active::after { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 2px; background: var(--accent); }

/* ---------- Modal (bottom sheet) ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 50; display: none; align-items: flex-end; }
.modal-back.show { display: flex; }
.modal {
  background: var(--panel); width: 100%; max-width: 620px; margin: 0 auto;
  border-radius: 0; border-top: 1px solid var(--line-2); padding: 24px 20px;
  max-height: 90vh; overflow-y: auto;
}
.modal h2 { margin-top: 0; font-size: 20px; letter-spacing: -0.02em; text-transform: uppercase; font-weight: 800; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 104px; left: 50%; transform: translateX(-50%);
  background: var(--txt); color: var(--accent-ink); padding: 11px 18px; border-radius: 0;
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; font-size: 11px;
  z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; border: 1px solid var(--txt);
}
.toast.show { opacity: 1; }
.toast.accent { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Timer de repos flottant : visible pendant qu'on log ses séries */
.rest-float {
  position: fixed; bottom: calc(70px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 40; background: var(--txt); color: var(--accent-ink);
  font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums; padding: 9px 18px; display: none;
}
.rest-float.show { display: block; }
.rest-float.hot { background: var(--accent); color: #fff; }

@media (max-width: 400px) {
  .hero .streak-num { margin-left: -4px; }
}
