/* =========================================================
   FORJA — direction artistique « atelier de forge »
   Suie chaude, braise, métal. Les chiffres (kg, reps, kcal)
   sont le héros : typo large, lourde, chiffres tabulaires.
   ========================================================= */
:root {
  /* Suie — fonds et surfaces (noirs teintés chauds, jamais neutres) */
  --bg-deep: #0b0a10;
  --bg: #121019;
  --surface: #1a1722;
  --surface-2: #231f2d;
  --surface-3: #2d2839;
  --line: #2a2535;
  --line-2: #3b3449;

  /* Os — textes */
  --text: #efebf7;
  --text-2: #bfb7d0;
  --muted: #958ca8;

  /* Braise — l'accent, réservé à l'action et à la progression */
  --ember: #a78bfa;
  --ember-2: #c4b5fd;
  --spark: #ddd3ff;
  --ember-ink: #1b1230;
  --ember-soft: rgba(167, 139, 250, .12);
  --ember-line: rgba(180, 160, 255, .32);

  /* États */
  --ok: #8fd6a4;
  --danger: #ff6a5c;
  --danger-soft: rgba(255, 106, 92, .12);
  --warn: #ddd3ff;

  /* Planche musculaire */
  --m-base: #2c2521; --m-off: #3c332d; --m-line: #121019; --m-prim: #a78bfa; --m-sec: #d4c6ff;

  --radius: 14px;
  --radius-s: 10px;
  --font-display: 'Archivo', 'Instrument Sans', system-ui, sans-serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 66px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { scrollbar-color: var(--line-2) var(--bg); }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-deep);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--ember);
}
::selection { background: var(--ember); color: var(--ember-ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid var(--bg); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 6px; }

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  overflow-x: clip;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
u { text-decoration-color: var(--ember); text-underline-offset: 3px; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Typo display : Archivo élargi, lourd, comme une plaque estampée */
.top h1, .card h2, .card h3, .section-title, .btn, .stat .v, .num-badge, .role-card .t,
.workout-bar .clock, .timer .tv, .set-grid .n, .scanner-box h3, .wordmark {
  font-family: var(--font-display);
  font-stretch: 118%;
}

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(18, 16, 25, .9);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  display: flex; align-items: center; gap: 12px;
}
.top h1 {
  font-weight: 800; text-transform: uppercase;
  font-size: 18px; letter-spacing: -.01em; line-height: 1.1; margin: 0;
}
.top .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.top .sub::first-letter { text-transform: uppercase; }
.top .grow { flex: 1; min-width: 0; }

/* Accueil : la forge — lueur de braise qui monte du coin */
.top.hero {
  position: relative;
  background: var(--bg);
  border-bottom: 0;
  padding-top: calc(env(safe-area-inset-top) + 22px);
  padding-bottom: 26px;
  align-items: flex-start;
  isolation: isolate;
}
.top.hero::before {
  content: ''; position: absolute; inset: 0 0 -60px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(167, 139, 250, .30), transparent 62%),
    radial-gradient(45% 60% at 92% 0%, rgba(221, 211, 255, .16), transparent 70%);
}
.top.hero h1 { font-size: clamp(30px, 9vw, 40px); font-weight: 900; line-height: .95; letter-spacing: -.02em; white-space: normal; }
.top.hero .sub { font-size: 14px; color: var(--text-2); margin-top: 8px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2); cursor: pointer;
  background: var(--surface); color: var(--text); display: grid; place-items: center; flex: none;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { border-color: var(--ember-line); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-family: var(--font-display); font-stretch: 118%; font-weight: 800; font-size: 13px; color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(236, 232, 255, .14);
}
.avatar.sm { width: 34px; height: 34px; font-size: 11.5px; }

/* ---------- Main ---------- */
.view { padding: 16px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
.top.hero + .view { padding-top: 0; position: relative; z-index: 1; }
.view.no-nav { padding-bottom: 120px; }
.stack > * + * { margin-top: 10px; }
.section-title {
  font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
  font-size: 13px; color: var(--text); margin: 30px 2px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.section-title:first-child { margin-top: 4px; }
.section-title a, .section-title button {
  font-family: var(--font-body); font-stretch: 100%; text-transform: none; letter-spacing: 0; font-weight: 600;
  color: var(--ember-2); background: none; border: 0; cursor: pointer; font-size: 13px; padding: 0;
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
a.card { transition: border-color .15s, transform .15s var(--ease); }
a.card:active { transform: scale(.99); }

/* Carte « chaude » : la pièce sortie du feu (séance du jour, calories) */
.card.dark {
  position: relative; overflow: hidden; isolation: isolate;
  background: #1d1828;
  border-color: var(--ember-line);
}
.card.dark::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(167, 139, 250, .34), transparent 58%),
    linear-gradient(180deg, rgba(221, 211, 255, .06), transparent 40%);
}
/* Carte braise pleine : appel à l'action (bilan) */
.card.teal { background: var(--ember); border-color: var(--ember); color: var(--ember-ink); }
.card.mint { background: var(--surface-2); border-color: transparent; }

.card h2, .card h3 { margin: 0; font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; text-wrap: balance; }
.card h2 { font-size: 22px; line-height: 1.02; font-weight: 900; }
.card h3 { font-size: 15px; line-height: 1.15; }
.card.dark h2 { font-size: 26px; }
.card .meta { color: var(--muted); font-size: 13px; }
.card.dark .meta { color: var(--text-2); }
.card.teal .meta { color: rgba(27, 18, 48, .78); }

.label {
  display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted);
}
.card.dark .label { color: var(--spark); }
.card.teal .label { color: rgba(27, 18, 48, .72); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { padding: 14px; }
.stat .v {
  font-weight: 900; font-size: 30px; line-height: 1; margin-top: 8px; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat .v small { font-family: var(--font-body); font-stretch: 100%; font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat .d { font-size: 12px; font-weight: 600; margin-top: 6px; color: var(--muted); }
.stat .d.up { color: var(--spark); }
.grid3 .stat .v { font-size: 24px; }

.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 12px; }
.mt-s { margin-top: 6px; }
.center { text-align: center; }
b, strong { font-weight: 650; }

/* ---------- Listes ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list .item {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line); width: 100%;
  background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; cursor: pointer; color: var(--text);
  transition: background .15s;
}
.list a.item:hover, .list button.item:hover { background: var(--surface-2); }
.list .item:first-child { border-top: 0; }
.list .item .t { font-weight: 600; line-height: 1.3; }
.list .item .s { font-size: 13px; color: var(--muted); }
.list .item > b { font-family: var(--font-display); font-stretch: 118%; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--spark); white-space: nowrap; }
.list .item .chev { color: var(--line-2); }
.list .item:hover .chev { color: var(--ember-2); }
.num-badge {
  width: 38px; height: 38px; border-radius: var(--radius-s); background: var(--surface-3); color: var(--text-2); flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.num-badge svg.i { width: 19px; height: 19px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 14px 18px; cursor: pointer; min-height: 48px;
  font-weight: 800; text-transform: uppercase; letter-spacing: .02em; font-size: 13.5px;
  background: var(--ember); color: var(--ember-ink);
  box-shadow: 0 6px 18px -8px rgba(167, 139, 250, .7);
  transition: transform .12s var(--ease), background .15s, box-shadow .15s;
}
.btn:hover { background: var(--ember-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.white { background: var(--text); color: var(--ember-ink); box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .8); }
.btn.white:hover { background: #fbf9ff; }
.btn.dark { background: var(--bg); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px rgba(255, 106, 92, .35); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 8px 12px; min-height: 36px; font-size: 11.5px; border-radius: 9px; box-shadow: none; }
.btn.ghost.sm { box-shadow: inset 0 0 0 1px var(--line-2); }
.btn svg.i { width: 18px; height: 18px; }
.card.teal .btn, .card.dark .btn.white { box-shadow: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 7px 14px; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--muted); color: var(--text); }
.chip.on { background: var(--text); color: var(--ember-ink); border-color: var(--text); }
.tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-2); vertical-align: 1px;
}
.tag svg.i { width: 13px; height: 13px; stroke-width: 2.6; }
.tag.warn { background: rgba(221, 211, 255, .14); color: var(--spark); }
.tag.dark { background: var(--ember-soft); color: var(--ember-2); }

/* ---------- Formulaires ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line-2); background: var(--bg); color: var(--text);
  border-radius: 11px; padding: 12px 14px; outline: none; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #71697f; }
.input:focus { border-color: var(--ember); box-shadow: 0 0 0 3px var(--ember-soft); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%); background-position: right 18px center, right 13px center; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea.input { resize: vertical; min-height: 84px; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] { flex: 1; accent-color: var(--ember); }
.range-row b { width: 44px; text-align: right; font-family: var(--font-display); font-stretch: 118%; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--spark); }

/* ---------- Barre d'onglets ---------- */
.tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 30;
  width: 100%; max-width: 520px;
  background: rgba(13, 11, 19, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; color: var(--muted); position: relative; transition: color .15s;
}
.tabs a:hover { color: var(--text-2); }
.tabs a.on { color: var(--text); }
.tabs a.on svg.i { color: var(--ember); }
.tabs a.on::before {
  content: ''; position: absolute; top: -1px; left: 32%; right: 32%; height: 2px; border-radius: 0 0 2px 2px;
  background: var(--ember); box-shadow: 0 2px 10px rgba(167, 139, 250, .7);
}
.tabs .dot {
  position: absolute; top: 9px; left: calc(50% + 8px); min-width: 17px; height: 17px; border-radius: 9px;
  background: var(--ember); color: var(--ember-ink); font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 4px;
  box-shadow: 0 0 0 2px var(--bg-deep);
}

/* ---------- Jauges ---------- */
.bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--ember), var(--ember-2) 70%, var(--spark));
}
.bar.over > i { background: var(--danger); }
.card.dark .bar { background: rgba(236, 232, 255, .1) !important; }
.macro + .macro { margin-top: 14px; }
.macro .between { font-size: 13px; margin-bottom: 7px; }
.macro .between .muted { font-variant-numeric: tabular-nums; }

/* ---------- Séance en cours ---------- */
.ex-card .ex-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.set-grid { display: grid; grid-template-columns: 30px 1fr 1fr 1fr 46px; gap: 8px; align-items: center; }
.set-grid.head { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.set-grid + .set-grid { margin-top: 8px; }
.set-grid .n { font-weight: 900; color: var(--text-2); text-align: center; font-size: 16px; }
.set-grid .prev { font-size: 12.5px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.set-grid input {
  width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 6px; text-align: center;
  font-family: var(--font-display); font-stretch: 112%; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: var(--bg); color: var(--text); outline: none; transition: border-color .15s, background .2s;
}
.set-grid input:focus { border-color: var(--ember); box-shadow: 0 0 0 3px var(--ember-soft); }
.set-grid.done input { background: var(--ember-soft); border-color: var(--ember-line); color: var(--spark); }
.set-grid.done .n { color: var(--ember); }
.check {
  width: 46px; height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer;
  display: grid; place-items: center; color: var(--muted); transition: background .2s, color .2s, border-color .2s;
}
.check:hover { border-color: var(--ember-line); color: var(--text); }
.check svg.i { stroke-width: 2.8; }
.set-grid.done .check { background: var(--ember); border-color: var(--ember); color: var(--ember-ink); box-shadow: 0 4px 14px -4px rgba(167, 139, 250, .8); }
.workout-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 30;
  background: rgba(13, 11, 19, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  color: var(--text); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
}
.workout-bar .clock { font-weight: 900; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.workout-bar .btn.white { background: var(--ember); color: var(--ember-ink); }

/* ---------- Séance en cours : mode focus ---------- */
.ex-steps { display: flex; gap: 5px; margin: 2px 0 18px; }
.ex-step {
  flex: 1; height: 26px; border: 0; padding: 0; background: none; cursor: pointer; position: relative;
}
.ex-step::before {
  content: ''; position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 4px;
  background: var(--surface-3); transition: background .25s, height .25s var(--ease), top .25s var(--ease);
}
.ex-step.part::before { background: linear-gradient(90deg, var(--ember) 50%, var(--surface-3) 50%); }
.ex-step.done::before { background: var(--ember); }
.ex-step.cur::before { top: 9px; height: 8px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ember-2); }
.ex-step.cur:not(.part):not(.done)::before { background: var(--line-2); }

.focus.in-next { animation: focus-next .38s var(--ease) both; }
.focus.in-prev { animation: focus-prev .38s var(--ease) both; }
@keyframes focus-next { from { opacity: 0; transform: translateX(28px); filter: blur(3px); } }
@keyframes focus-prev { from { opacity: 0; transform: translateX(-28px); filter: blur(3px); } }

.focus-ex { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.focus-media .media2 .mm, .focus-media .media2 img { width: 58px; height: 72px; border-radius: 12px; }
.focus-media .media2 .mm { width: 46px; }
.focus-ex h2 {
  margin: 0; font-family: var(--font-display); font-stretch: 112%; font-weight: 900; text-transform: uppercase;
  font-size: 23px; line-height: 1.02; letter-spacing: -.015em; text-wrap: balance;
}
.focus-ex .meta { color: var(--text-2); font-size: 13.5px; margin-top: 6px; }
.focus-links { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.focus-links a, .focus-links button {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 8px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.focus-links a:hover, .focus-links button:hover { border-color: var(--ember-line); }
.focus-links svg.i { width: 14px; height: 14px; color: var(--ember-2); }

.focus-sets { padding: 14px; }
.last-line {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: -2px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.last-line b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.focus-sets .set-grid { grid-template-columns: 54px 1fr 1fr 54px; gap: 8px; }
.focus-sets .set-grid + .set-grid { margin-top: 10px; }
.focus-sets .set-grid .n { display: flex; flex-direction: column; align-items: center; line-height: 1; font-size: 19px; }
.focus-sets .set-grid .n small {
  font-family: var(--font-body); font-stretch: 100%; font-size: 10.5px; font-weight: 600; color: var(--muted);
  margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.focus-sets .set-grid input { height: 52px; font-size: 21px; border-radius: 12px; }
.focus-sets .check { width: 54px; height: 52px; border-radius: 12px; }
.focus-sets .check svg.i { width: 24px; height: 24px; }

.up-next {
  display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; width: 100%; margin-top: 12px; padding: 14px 16px; text-align: left;
  border-radius: var(--radius); border: 1px solid var(--ember-line); background: var(--ember-soft); color: var(--text); cursor: pointer;
  animation: focus-next .4s var(--ease) both;
}
.up-next span { font-size: 12.5px; color: var(--text-2); flex-basis: 100%; }
.up-next b { flex: 1; font-family: var(--font-display); font-stretch: 112%; font-weight: 800; text-transform: uppercase; font-size: 15px; }
.up-next svg.i { color: var(--ember); }
.up-next.end { cursor: default; }
.up-next.end b { font-family: var(--font-body); font-stretch: 100%; text-transform: none; font-weight: 600; font-size: 14px; }

.note-d summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; }
.note-d summary::-webkit-details-marker { display: none; }
.note-d summary::before { content: '+'; display: inline-block; width: 18px; color: var(--ember-2); font-weight: 800; }
.note-d[open] summary::before { content: '–'; }
.link-danger { background: none; border: 0; color: var(--danger); font-weight: 600; font-size: 13.5px; padding: 12px; cursor: pointer; opacity: .85; }
.link-danger:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }

.focus-bar { gap: 10px; }
.focus-bar .clock { font-size: 24px; }
.focus-bar .small { max-width: 100%; margin-top: 3px; }
.nav-btn {
  width: 56px; height: 52px; flex: none; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  display: grid; place-items: center; cursor: pointer; transition: background .2s, border-color .2s, transform .12s var(--ease), box-shadow .3s;
}
.nav-btn svg.i { width: 26px; height: 26px; stroke-width: 2.4; }
.nav-btn:hover:not(:disabled) { border-color: var(--ember-line); }
.nav-btn:active:not(:disabled) { transform: scale(.94); }
.nav-btn:disabled { opacity: .3; cursor: default; }
.nav-btn.ready { background: var(--ember); border-color: var(--ember); color: var(--ember-ink); box-shadow: 0 6px 20px -6px rgba(167, 139, 250, .8); }
.focus-bar .btn { min-height: 52px; }

/* ---------- Historique global d'un client (coach) ---------- */
.wk-bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 14px; align-items: end; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.wk b { font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: 13px; height: 16px; line-height: 16px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.wk-track { width: 100%; max-width: 30px; height: 84px; border-radius: 7px; background: var(--surface-2); display: flex; align-items: flex-end; overflow: hidden; }
.wk-track i { display: block; width: 100%; border-radius: 7px; background: var(--line-2); transition: height .5s var(--ease); }
.wk.full .wk-track i { background: var(--ember); }
.wk.full b { color: var(--spark); }
.wk.now .wk-track { box-shadow: inset 0 0 0 1px var(--ember-line); }
.wk span { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wk.now span { color: var(--text-2); font-weight: 600; }
.kg-now { color: var(--text); font-weight: 650; font-family: inherit; font-stretch: 100%; }
.delta {
  flex: none; font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums;
  padding: 4px 8px; border-radius: 7px; background: var(--surface-3); color: var(--text-2);
}
.delta.up { background: rgba(143, 214, 164, .12); color: var(--ok); }
.delta.down { background: var(--danger-soft); color: var(--danger); }
.month-h {
  display: flex; justify-content: space-between; align-items: baseline; margin: 18px 2px 8px;
  font-size: 13px; font-weight: 700; color: var(--text-2); text-transform: capitalize;
}
.month-h:first-of-type { margin-top: 0; }
.month-h span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none; }
.seg a { flex: 1 0 auto; }

/* ---------- Photos avant / après ---------- */
.ph-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ph-slot {
  position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: var(--bg); border: 1px dashed var(--line-2); display: grid; place-items: center;
  transition: border-color .15s, background .15s;
}
.ph-slot:hover { border-color: var(--ember-line); background: var(--surface-2); }
.ph-slot.has { border-style: solid; border-color: var(--ember-line); }
.ph-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph-lab {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--text-2); text-align: center; line-height: 1.15; padding: 4px;
}
.ph-lab svg.i { width: 20px; height: 20px; color: var(--ember-2); }
.ph-slot.has .ph-lab {
  position: absolute; left: 0; right: 0; bottom: 0; flex-direction: row; justify-content: center; gap: 3px; padding: 18px 4px 5px;
  background: linear-gradient(transparent, rgba(13, 11, 19, .85)); color: var(--text);
}
.ph-slot.has .ph-lab svg.i { width: 13px; height: 13px; stroke-width: 3; }

.ph-cmp {
  position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--bg-deep);
  user-select: none; -webkit-user-select: none; touch-action: pan-y;
}
.ph-cmp .ph-a, .ph-cmp .ph-b { position: absolute; inset: 0; }
.ph-cmp img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ph-cmp .ph-a { clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.ph-handle {
  position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: var(--text);
  box-shadow: 0 0 12px rgba(0, 0, 0, .5); pointer-events: none;
}
.ph-handle::after {
  content: '‹ ›'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 50%; background: var(--text); color: var(--ember-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: 2px;
  box-shadow: 0 6px 18px -4px rgba(0, 0, 0, .6);
}
.ph-tag {
  position: absolute; top: 10px; padding: 4px 9px; border-radius: 7px; font-size: 12px; font-weight: 700;
  background: rgba(13, 11, 19, .72); color: var(--text); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none;
}
.ph-tag.l { left: 10px; } .ph-tag.r { right: 10px; }
.ph-cmp input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.ph-side { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-side figure { margin: 0; }
.ph-side img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; display: block; background: var(--bg-deep); }
.ph-side figcaption { font-size: 12px; font-weight: 600; color: var(--text-2); text-align: center; margin-top: 6px; }
.ph-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.ph-mode { flex: none; }
.seg button {
  flex: 1; text-align: center; padding: 8px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted);
  white-space: nowrap; background: none; border: 0; cursor: pointer; transition: color .15s, background .15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); }
.ph-delta { font-size: 13px; color: var(--muted); }
.ph-delta b { color: var(--text); font-variant-numeric: tabular-nums; }
.ph-delta b.down { color: var(--ok); } .ph-delta b.up { color: var(--spark); }
.ph-day .ph-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.ph-th {
  position: relative; aspect-ratio: 3 / 4; border-radius: 9px; overflow: hidden; padding: 0; border: 0; cursor: pointer;
  background: var(--bg); display: block;
}
.ph-th img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s; }
.ph-th:hover img { opacity: .85; }
.ph-th span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 3px 4px; font-size: 10px; font-weight: 700; text-align: center;
  background: linear-gradient(transparent, rgba(13, 11, 19, .85)); color: var(--text);
}
.ph-th.none { cursor: default; border: 1px dashed var(--line); }
.ph-th.none span { background: none; color: var(--muted); top: 50%; bottom: auto; transform: translateY(-50%); padding: 0; }
.ph-full img { width: 100%; border-radius: 12px; display: block; background: var(--bg-deep); }
.ph-missing::before { content: 'Photo indisponible'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--muted); }

/* ---------- Feuille du bas (historique) ---------- */
.sheet { position: fixed; inset: 0; z-index: 70; background: rgba(8, 7, 13, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: fade-in .25s ease-out both; }
.sheet-box {
  width: 100%; max-width: 520px; max-height: 86dvh; display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 20px 20px 0 0;
  animation: sheet-up .4s var(--ease) both;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { margin: 0; font-family: var(--font-display); font-stretch: 112%; font-weight: 900; text-transform: uppercase; font-size: 16px; line-height: 1.1; }
.sheet-body { overflow-y: auto; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- Minuteur de repos : la pièce qui refroidit ---------- */
.timer {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 50;
  width: calc(100% - 32px); max-width: 488px;
  background: #211c2e; color: var(--text); border: 1px solid var(--ember-line); border-radius: 18px; padding: 14px 16px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .8), 0 8px 30px -10px rgba(167, 139, 250, .45);
  display: flex; align-items: center; gap: 14px;
  animation: timer-in .5s var(--ease) both;
}
.timer[hidden] { display: none; }
@keyframes timer-in { from { opacity: 0; transform: translate(-50%, 18px); filter: blur(4px); } }
.timer .tv { font-weight: 900; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; min-width: 92px; color: var(--spark); letter-spacing: -.02em; }
.timer .tb { flex: 1; min-width: 40px; height: 6px; background: rgba(236, 232, 255, .16); border-radius: 9px; overflow: hidden; }
.timer .tb i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--spark)); transition: width 1s linear; }
.timer button { background: var(--surface-3); color: var(--text); border: 0; border-radius: 10px; padding: 9px 11px; font-weight: 700; cursor: pointer; font-size: 13px; }
.timer button:hover { background: var(--line-2); }

/* ---------- Messagerie ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 18px; background: var(--surface-2); white-space: pre-wrap; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--ember); color: var(--ember-ink); border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble time { display: block; font-size: 10.5px; opacity: .65; margin-top: 4px; }
.composer {
  position: fixed; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 25;
  display: flex; gap: 8px; padding: 10px 16px; background: rgba(18, 16, 25, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.composer .input { border-radius: 999px; }
.composer .btn { border-radius: 999px; width: 48px; padding: 0; flex: none; }

/* ---------- Connexion ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); position: relative; isolation: isolate; overflow: hidden; }
.login::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(75% 40% at 50% 26%, rgba(167, 139, 250, .30), transparent 70%),
    radial-gradient(40% 22% at 50% 24%, rgba(221, 211, 255, .14), transparent 70%);
}
/* Le logo occupe tout le haut de l'écran */
.login .cover {
  flex: 1; min-height: 46dvh; display: grid; place-items: center;
  padding: calc(env(safe-area-inset-top) + 40px) 24px 24px;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.brand svg { width: clamp(96px, 30vw, 140px); height: auto; filter: drop-shadow(0 12px 32px rgba(167, 139, 250, .35)); }
.wordmark { font-weight: 900; font-size: clamp(30px, 9vw, 42px); letter-spacing: .18em; margin-right: -.18em; line-height: 1; }
.login .body { padding: 8px 24px calc(32px + env(safe-area-inset-bottom)); }
.role-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text); border-radius: var(--radius); padding: 16px;
  transition: border-color .15s, background .15s, transform .12s var(--ease);
}
.role-card:hover { border-color: var(--ember-line); background: #201c2a; }
.role-card:active { transform: scale(.99); }
.role-card + .role-card { margin-top: 10px; }
.role-card .num-badge { background: var(--ember-soft); color: var(--ember-2); }
.role-card .t { font-weight: 800; text-transform: uppercase; font-size: 16px; }
.role-card .s { font-size: 13px; color: var(--muted); }
.role-card > svg.i { color: var(--line-2); }
.role-card:hover > svg.i { color: var(--ember-2); }
.login .label { margin: 26px 0 12px; }
.login .back { display: inline-block; color: var(--text-2); font-size: 14px; font-weight: 600; padding: 8px; }
.login .back:hover { color: var(--text); }

/* ---------- Continuer avec Google ---------- */
.gsi { position: relative; min-height: 48px; display: flex; justify-content: center; }
.gsi-slot { display: flex; justify-content: center; width: 100%; min-height: 44px; }
.gsi iframe { color-scheme: normal; }  /* sans ça, le thème sombre ajoute un fond blanc autour du bouton Google */
.gsi.ready .btn-google { display: none; }
.gsi.busy { opacity: .5; pointer-events: none; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-family: var(--font-body); font-weight: 600; font-size: 15px; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-google:hover { background: var(--surface-3); border-color: var(--muted); }
.btn-google svg { width: 20px; height: 20px; flex: none; }
.or-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; font-size: 12.5px; color: var(--muted); }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Divers ---------- */
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty svg.i { width: 34px; height: 34px; color: var(--line-2); margin-bottom: 8px; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; overflow-x: auto; }
.seg a { flex: 1; text-align: center; padding: 9px 8px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: color .15s, background .15s; }
.seg a:hover { color: var(--text); }
.seg a svg.i { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.seg a.on { background: var(--surface-3); color: var(--text); }
.seg a.on svg.i { color: var(--ember); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.toast {
  position: fixed; top: calc(env(safe-area-inset-top) + 14px); left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--text); color: var(--ember-ink); padding: 11px 16px; border-radius: 12px; font-weight: 700; font-size: 14px;
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .7); max-width: calc(100% - 32px);
  animation: toast-in .4s var(--ease) both;
}
.toast[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px); } }
.prog-item { padding: 12px 0; border-top: 1px solid var(--line); }
.prog-item:first-of-type { border-top: 0; }
.prog-item .mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.prog-item .mini label { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.prog-item .mini input { width: 100%; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); border-radius: 8px; padding: 7px 8px; font-size: 15px; margin-top: 2px; outline: none; font-variant-numeric: tabular-nums; }
.prog-item .mini input:focus { border-color: var(--ember); }
.del { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 7px; border-radius: 8px; display: grid; place-items: center; transition: color .15s, background .15s; }
.del:hover { color: var(--danger); background: var(--danger-soft); }
.del svg.i { width: 18px; height: 18px; }
.score { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.score span { font-size: 12.5px; background: var(--surface-3); color: var(--text-2); padding: 5px 9px; border-radius: 7px; font-weight: 600; font-variant-numeric: tabular-nums; }
.reply { margin-top: 10px; padding: 10px 12px; background: var(--ember-soft); border-radius: 10px; font-size: 14px; color: var(--text); }

/* ---------- Bilan hebdo : questionnaire à étoiles ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
fieldset.card { margin-inline: 0; min-width: 0; }
.q h3 { font-size: 15px; }
.q-input { display: flex; align-items: center; gap: 12px; margin: 12px 0 10px; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; margin-left: -4px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.star-input label { cursor: pointer; padding: 3px; border-radius: 9px; display: grid; }
.star-input svg {
  width: 36px; height: 36px; fill: transparent; stroke: var(--line-2); stroke-width: 1.5; stroke-linejoin: round;
  transition: fill .18s, stroke .18s, transform .25s var(--ease);
}
.star-input input:checked ~ label svg { fill: var(--ember); stroke: var(--ember); }
@media (hover: hover) {
  .star-input:hover label svg { fill: transparent; stroke: var(--line-2); }
  .star-input:hover label:hover svg, .star-input:hover label:hover ~ label svg { fill: var(--ember-2); stroke: var(--ember-2); }
}
.star-input label:active svg { transform: scale(.85); }
.star-input input:focus-visible + label { outline: 2px solid var(--ember); outline-offset: 0; }
.star-cap { font-size: 13px; font-weight: 700; color: var(--spark); }
.input-s { padding: 9px 12px; border-radius: 10px; }

/* Lecture d'un bilan (client et coach) */
.ci-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.avg { font-family: var(--font-display); font-stretch: 118%; font-weight: 900; font-size: 24px; line-height: 1; color: var(--spark); font-variant-numeric: tabular-nums; }
.avg small { font-family: var(--font-body); font-stretch: 100%; font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stars { display: inline-flex; gap: 2px; flex: none; }
.stars svg { width: 15px; height: 15px; fill: var(--surface-3); }
.stars svg.on { fill: var(--ember); }
.q-list { margin-top: 12px; border-top: 1px solid var(--line); }
.q-row { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.q-row:last-child { border-bottom: 0; padding-bottom: 0; }
.q-row .between > span:first-child { color: var(--text-2); }
.q-row.low .stars svg.on { fill: var(--danger); }
.q-row.low .between > span:first-child { color: var(--text); font-weight: 600; }
.q-com { margin-top: 5px; padding-left: 10px; border-left: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); }
.q-avg { font-family: var(--font-display); font-stretch: 118%; font-weight: 800; font-size: 13px; min-width: 24px; text-align: right; font-variant-numeric: tabular-nums; }
.q-d { width: 14px; text-align: center; font-weight: 800; color: var(--muted); }
.q-d.up { color: var(--ok); } .q-d.down { color: var(--danger); }
.vigil { display: flex; align-items: flex-start; gap: 8px; padding: 9px 11px; border-radius: 10px; background: var(--danger-soft); color: #ffb1a8; font-size: 13px; font-weight: 600; }
.vigil svg.i { width: 16px; height: 16px; margin-top: 1px; color: var(--danger); }
.ci-note { margin: 12px 0 0; }

/* ---------- Catalogue / fiches exercice ---------- */
.media2 { display: flex; gap: 4px; flex: none; }
.media2 .mm, .media2 img { width: 58px; height: 58px; border-radius: 10px; flex: none; }
.media2 .mm { background: var(--surface-2); display: grid; place-items: center; padding: 3px; width: 66px; }
.media2 img { object-fit: cover; background: #ebe7f2; }
.media2.sm .mm, .media2.sm img { width: 38px; height: 38px; border-radius: 8px; }
.media2.sm .mm { width: 44px; }
.bodymap { width: 100%; height: 100%; display: block; }
.list .item .grow { flex: 1; min-width: 0; }
.exrow { padding: 10px 12px; }
.exrow .t { font-size: 14.5px; line-height: 1.25; }
.info-i {
  width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); color: var(--spark); flex: none;
  display: grid; place-items: center; font: italic 800 13px/1 Georgia, serif;
}
.expair { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); }
.expair.solo { grid-template-columns: 1fr; }
.exmap { padding: 14px 10px 10px; background: var(--surface-2); display: flex; flex-direction: column; justify-content: center; }
.expair.solo .exmap .bodymap { max-height: 260px; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; white-space: nowrap; font-size: 11px; color: var(--muted); margin-top: 8px; font-weight: 600; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.legend i.p { background: var(--m-prim); } .legend i.s { background: var(--m-sec); }
.exmedia { position: relative; aspect-ratio: 1 / 1; background: #ebe7f2; }
.exmedia img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* Alterne position de départ / d'arrivée pour simuler le mouvement */
.exmedia img.f1 { animation: exflip 2.4s steps(1) infinite; }
@keyframes exflip { 0% { opacity: 0; } 50% { opacity: 1; } }
.steps { margin: 0; padding-left: 22px; }
.steps li + li { margin-top: 9px; }
.steps li::marker { color: var(--ember); font-weight: 800; font-family: var(--font-display); }
.picker > summary { list-style: none; display: inline-flex; }
.picker > summary::-webkit-details-marker { display: none; }
.picker[open] > summary { background: var(--text); color: var(--ember-ink); }
.picker .item svg.i { color: var(--ember); }

/* ---------- Suggestions d'aliments ---------- */
.sugg { margin-top: 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); max-height: 300px; overflow-y: auto; box-shadow: 0 16px 30px -14px rgba(0, 0, 0, .8); }
.sugg[hidden] { display: none; }
.sugg-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 12px; cursor: pointer; color: var(--text); }
.sugg-item:first-child { border-top: 0; }
.sugg-item:hover, .sugg-item:focus-visible { background: var(--surface-3); outline: none; }
.sugg-item b { display: block; font-size: 14px; font-weight: 600; line-height: 1.25; }
.sugg-item small { display: block; font-size: 11.5px; color: var(--muted); }
.sugg-macro { text-align: right; font-weight: 700; font-size: 13px; color: var(--spark); white-space: nowrap; font-variant-numeric: tabular-nums; }
#mpicked svg.i { width: 15px; height: 15px; color: var(--ember); vertical-align: -3px; }

/* ---------- Scanner code-barres ---------- */
.scan-btn { color: var(--ember-2); }
.scanner { position: fixed; inset: 0; z-index: 70; background: rgba(8, 7, 13, .78); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; }
.scanner-box { background: var(--surface); border: 1px solid var(--line-2); border-bottom: 0; width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
.scanner-box h3 { margin: 0; font-weight: 800; text-transform: uppercase; font-size: 15px; }
.scan-video { position: relative; margin-top: 12px; border-radius: 14px; overflow: hidden; background: var(--bg-deep); aspect-ratio: 4 / 3; }
.scan-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; left: 12%; right: 12%; top: 32%; bottom: 32%; border: 3px solid var(--ember); border-radius: 12px; box-shadow: 0 0 0 999px rgba(8, 7, 13, .35); }
.scan-msg { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: var(--text); font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }

@media (min-width: 521px) {
  #app { box-shadow: 0 0 0 1px var(--line), 0 30px 80px -20px rgba(0, 0, 0, .9); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .exmedia img.f1 { animation: none; opacity: 0; }
}

/* ---------- Comptes en ligne ---------- */
.login.compact .cover { flex: 0; min-height: 0; padding-bottom: 8px; }
.login.compact .brand { flex-direction: row; gap: 12px; }
.login.compact .brand svg { width: 44px; }
.login.compact .wordmark { font-size: 24px; }
.login h2 { font-weight: 900; text-transform: uppercase; font-stretch: 118%; font-size: 22px; }
.install-card { margin-bottom: 14px; border-color: var(--ember-line); }
.install-card b svg.i { width: 18px; height: 18px; vertical-align: -4px; color: var(--ember); margin-right: 4px; }
details.card summary { cursor: pointer; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: '+'; float: right; color: var(--muted); font-weight: 800; }
details.card[open] summary::after { content: '–'; }
.item[disabled] { opacity: .55; cursor: not-allowed; }
button.back { background: none; border: 0; cursor: pointer; font-family: inherit; }
