/* =========================================================
   ISMAIL COACHING — Design system (inspiré du DESIGN.md)
   Thèmes : [data-theme="dark"] / [data-theme="light"]
   ========================================================= */

:root {
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;

  --blue: #b3122a;          /* rouge carmin de marque (nom de variable conservé) */
  --brand-soft: #c94a5c;
  --blue-hover: #c81a35;
  --orange: #f56900;
  --violet: #8668ff;
  --teal: #00a1b3;
  --green: #30d158;
  --red: #e0364b;
  --yellow: #ffd60a;

  --r-sm: 10px;
  --r-md: 28px;
  --r-lg: 32px;
  --r-btn: 36px;
  --r-pill: 980px;

  --ease: cubic-bezier(.25, .1, .25, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-2: #0a0a0a;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --surface-3: #3a3a3c;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --border: #38383a;
  --border-soft: #242426;
  --link: #ec5a6c;
  --nav-bg: rgba(22, 22, 23, .8);
  --overlay: rgba(0, 0, 0, .6);
  --input-bg: #111111;
  --tint-blue: rgba(179, 18, 42, .22);
  --tint-green: rgba(48, 209, 88, .14);
  --tint-orange: rgba(245, 105, 0, .16);
  --tint-red: rgba(179, 18, 42, .22);
  --tint-violet: rgba(134, 104, 255, .16);
  --tint-teal: rgba(0, 161, 179, .16);
  --tint-yellow: rgba(255, 214, 10, .14);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --surface: #f5f5f7;
  --surface-2: #e8e8ed;
  --surface-3: #d2d2d7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --border: #d2d2d7;
  --border-soft: #e8e8ed;
  --link: #b3122a;
  --nav-bg: rgba(255, 255, 255, .72);
  --overlay: rgba(0, 0, 0, .35);
  --input-bg: #ffffff;
  --tint-blue: rgba(179, 18, 42, .08);
  --tint-green: rgba(36, 168, 70, .12);
  --tint-orange: rgba(245, 105, 0, .10);
  --tint-red: rgba(179, 18, 42, .10);
  --tint-violet: rgba(134, 104, 255, .12);
  --tint-teal: rgba(0, 161, 179, .12);
  --tint-yellow: rgba(255, 204, 0, .16);
  --green: #24a846;
  --red: #c41a33;
  --brand-soft: #9e1a2e;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" 0;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0; font-family: var(--font-display); font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
::selection { background: var(--tint-blue); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- Typo ---------- */
.h-hero { font-size: clamp(48px, 8vw, 96px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 700; }
.h-display { font-size: clamp(36px, 5.4vw, 64px); line-height: 1.06; letter-spacing: -0.03em; font-weight: 700; }
.h-lg { font-size: clamp(26px, 3.2vw, 32px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; }
.h-md { font-size: 24px; line-height: 1.17; letter-spacing: -0.015em; font-weight: 700; }
.accent { color: var(--blue); }
.dim { color: var(--text-3); }
.h-sm { font-size: 19px; line-height: 1.21; letter-spacing: -0.015em; font-weight: 600; }
.lead { font-size: clamp(19px, 2vw, 21px); line-height: 1.38; color: var(--text-2); font-weight: 400; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 14px; line-height: 1.43; letter-spacing: -0.016em; }
.tiny { font-size: 12px; line-height: 1.33; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.strong { font-weight: 600; }
.eyebrow { color: var(--link); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.eyebrow.violet { color: var(--violet); }
.eyebrow.teal { color: var(--teal); }
.eyebrow.blue { color: var(--link); }
.eyebrow-sm { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.link-arrow { display: inline-flex; align-items: center; gap: 4px; color: var(--link); font-weight: 400; }
.link-arrow svg { width: 16px; height: 16px; }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-orange { color: var(--orange); }
.text-blue { color: var(--link); } .text-violet { color: var(--violet); } .text-teal { color: var(--teal); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 22px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.start { align-items: flex-start; }
.row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .container { padding: 0 16px; } }
@media (max-width: 420px) { .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; } }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.hide-mobile { } @media (max-width: 760px) { .hide-mobile { display: none !important; } }
.show-mobile { display: none !important; } @media (max-width: 760px) { .show-mobile { display: initial !important; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 10px 20px; border-radius: var(--r-btn);
  font-size: 15px; font-weight: 600; letter-spacing: -0.016em; line-height: 1.1;
  white-space: nowrap; transition: background-color .2s var(--ease), opacity .2s, transform .1s, border-color .2s;
  text-decoration: none !important; user-select: none;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost { color: var(--link); padding-left: 12px; padding-right: 12px; }
.btn-ghost:hover { background: var(--tint-blue); }
.btn-outline { border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--text-3); }
.btn-contrast { background: var(--text); color: var(--bg); }
.btn-contrast:hover { opacity: .88; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--tint-red); }
.btn-sm { min-height: 32px; padding: 6px 14px; font-size: 13px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { min-height: 50px; padding: 14px 28px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; }
.btn-icon.btn-sm { width: 32px; height: 32px; min-height: 32px; }
.btn[disabled], .btn.disabled { opacity: .4; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--text); transition: background .2s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: -0.01em; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 16px; color: var(--text); transition: border-color .2s, background .2s;
}
.input.sm, .select.sm { min-height: 34px; padding: 6px 10px; font-size: 14px; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--link); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-group { position: relative; }
.input-group > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.input-group > .input { padding-left: 38px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
input[type="range"] { width: 100%; accent-color: var(--blue); }
input[type="checkbox"].switch { appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .2s; flex: none; }
input[type="checkbox"].switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
input[type="checkbox"].switch:checked { background: var(--green); }
input[type="checkbox"].switch:checked::after { transform: translateX(18px); }

/* Choice tiles (radio/checkbox cards) */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; transition: border-color .2s, background .2s; background: var(--input-bg); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--text-3); }
.choice.on, .choice:has(input:checked) { border-color: var(--link); background: var(--tint-blue); }
.choice .t { font-weight: 600; font-size: 15px; }
.choice .d { font-size: 13px; color: var(--text-2); line-height: 1.35; }
.choice svg { width: 22px; height: 22px; color: var(--link); margin-bottom: 4px; }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--r-pill); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { padding: 7px 16px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: background .2s, color .2s; }
.seg button.active { background: var(--bg); color: var(--text); }
[data-theme="dark"] .seg button.active { background: var(--surface-3); }
.seg.block { display: flex; width: 100%; }
.seg.block button { flex: 1; }

/* Chips (filters) */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: var(--r-pill); border: 1px solid var(--border); font-size: 14px; font-weight: 500; color: var(--text-2); white-space: nowrap; transition: all .2s; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- Cards / surfaces ---------- */
.card { background: var(--surface); border-radius: var(--r-md); padding: 24px; min-width: 0; }
.card.pad-sm { padding: 18px; }
.card.flat { background: transparent; border: 1px solid var(--border); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.tile { background: var(--bg); border-radius: var(--r-sm); padding: 14px; }
[data-theme="light"] .card .tile { background: #fff; }
.list > * + * { border-top: 1px solid var(--border-soft); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-width: 0; }
.list-item.click { cursor: pointer; border-radius: var(--r-sm); }
.list-item.click:hover { background: var(--surface-2); margin: 0 -10px; padding-left: 10px; padding-right: 10px; }

/* Stat */
.stat .v { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 13px; color: var(--text-2); font-weight: 500; }
.stat .d { font-size: 13px; font-weight: 600; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; background: var(--surface-2); color: var(--text-2); line-height: 1.5; }
.badge svg { width: 12px; height: 12px; }
.badge.green { background: var(--tint-green); color: var(--green); }
.badge.red { background: var(--tint-red); color: var(--red); }
.badge.orange { background: var(--tint-orange); color: var(--orange); }
.badge.blue { background: var(--tint-blue); color: var(--link); }
.badge.violet { background: var(--tint-violet); color: var(--violet); }
.badge.teal { background: var(--tint-teal); color: var(--teal); }
.badge.yellow { background: var(--tint-yellow); color: #b38f00; }
[data-theme="dark"] .badge.yellow { color: var(--yellow); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--text-3); }
.dot.green { background: var(--green); } .dot.red { background: var(--red); } .dot.orange { background: var(--orange); }
.dot.blue { background: var(--link); } .dot.violet { background: var(--violet); } .dot.teal { background: var(--teal); } .dot.yellow { background: var(--yellow); }

/* ---------- Progress ---------- */
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .5s var(--ease); }
.bar.green > span { background: var(--green); } .bar.orange > span { background: var(--orange); }
.bar.violet > span { background: var(--violet); } .bar.teal > span { background: var(--teal); } .bar.red > span { background: var(--red); }
.bar.thick { height: 10px; }

/* Round check */
.check { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface-3); color: transparent; transition: all .2s var(--ease); }
.check svg { width: 17px; height: 17px; stroke-width: 3; }
.check:hover { border-color: var(--green); }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }
.check.sm { width: 24px; height: 24px; } .check.sm svg { width: 14px; height: 14px; }
.check.lg { width: 38px; height: 38px; } .check.lg svg { width: 22px; height: 22px; }

/* ---------- Avatar ---------- */
.avatar { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 600; font-size: 15px; color: #fff; background: var(--surface-3); overflow: hidden; letter-spacing: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.xl { width: 88px; height: 88px; font-size: 30px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { padding: 12px 0; font-size: 15px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs a.active, .tabs button.active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--surface-2); }
.table th:first-child, .table td:first-child { padding-left: 0; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: var(--overlay); display: grid; place-items: center; padding: 20px; animation: fade .2s var(--ease); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--bg); border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: 28px; animation: pop .25s var(--ease); }
[data-theme="dark"] .modal { background: var(--surface); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-head h3 { font-size: 24px; letter-spacing: -0.01em; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { border-radius: var(--r-md) var(--r-md) 0 0; max-height: 92vh; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); animation: sheet .3s var(--ease); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(8px); } }
@keyframes sheet { from { transform: translateY(100%); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--r-pill); background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; animation: rise .3s var(--ease); }
.toast svg { width: 18px; height: 18px; }
.toast.out { opacity: 0; transform: translateY(10px); transition: all .3s; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .ico { width: 56px; height: 56px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--text-2); margin-bottom: 14px; }
.empty .ico svg { width: 26px; height: 26px; }
.empty h4 { color: var(--text); font-size: 19px; font-weight: 600; margin-bottom: 6px; }

/* Photo placeholder / gallery */
.photo { position: relative; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); aspect-ratio: 3 / 4; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .cap { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: var(--r-pill); background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 600; }

/* Compare slider */
.compare { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); user-select: none; touch-action: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .after { clip-path: inset(0 0 0 50%); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; transform: translateX(-1px); pointer-events: none; }
.compare .handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; font-size: 18px; font-weight: 700; }
.compare .lbl { position: absolute; top: 12px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 600; }
.compare .lbl.l { left: 12px; } .compare .lbl.r { right: 12px; }

/* Theme toggle */
.theme-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--text); transition: background .2s; }
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 18px; height: 18px; }

/* Charts */
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font-text); }
.chart .grid-line { stroke: var(--border-soft); stroke-width: 1; }

/* Utility */
.divider { height: 1px; background: var(--border); }
.scroll-x { overflow-x: auto; scrollbar-width: none; } .scroll-x::-webkit-scrollbar { display: none; }
.kbd { font-size: 12px; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); }
.fade-in { animation: rise .45s var(--ease) both; }
.skeleton { background: var(--surface-2); border-radius: var(--r-sm); }
.demo-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); border: 1px dashed var(--orange); color: var(--orange); font-size: 12px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
svg.inl { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; }
svg.faint { color: var(--text-3); width: 18px; height: 18px; flex: none; }
/* Marque rouge : tous les sur-titres en rouge */
.eyebrow.violet, .eyebrow.teal, .eyebrow.blue { color: var(--blue); }

/* Illustrations d'exercices */
[data-theme="dark"] { --fig-bg: #141416; --fig-bg-2: #232327; --fig-shadow: rgba(0,0,0,.5); --fig-floor: #2c2c30; --fig-skin: #e4e4e9; --fig-far: #8a8a91; --fig-outfit: #4a4a50; --fig-outfit-2: #3d3d43; --fig-far-out: #2e2e33; --fig-shoe: #f5f5f7; --fig-hair: #3a3a3f; --fig-hl: #e0364b; --fig-eq: #a8a8ae; --fig-plate: #3a3a40; --fig-pad: #2c2c31; --fig-cable: #8e8e93; --fig-ghost: #e4e4e9; --fig-arrow: #e0364b; }
[data-theme="light"] { --fig-bg: #eeeef1; --fig-bg-2: #ffffff; --fig-shadow: rgba(0,0,0,.08); --fig-floor: #dcdce1; --fig-skin: #2e2e33; --fig-far: #a9a9b0; --fig-outfit: #8e8e95; --fig-outfit-2: #7c7c83; --fig-far-out: #c7c7cd; --fig-shoe: #1d1d1f; --fig-hair: #111113; --fig-hl: #c41a33; --fig-eq: #8e8e93; --fig-plate: #48484d; --fig-pad: #d1d1d6; --fig-cable: #8e8e93; --fig-ghost: #2e2e33; --fig-arrow: #b3122a; }
svg.fig { display: block; width: 100%; height: auto; border-radius: 14px; }
img.fig-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: var(--fig-bg); }

/* Zone d'import d'image (reçu, étiquette, photos) */
.upload-slot { position: relative; display: grid; place-items: center; aspect-ratio: 3/4; border-radius: 16px; border: 1.5px dashed var(--surface-3); background: var(--surface); color: var(--text-3); font-size: 13px; text-align: center; overflow: hidden; cursor: pointer; }
.upload-slot svg { width: 22px; height: 22px; margin-bottom: 4px; }
.upload-slot img { width: 100%; height: 100%; object-fit: cover; }
.upload-slot input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Carte des muscles */
.mmap { display: block; width: 100%; height: auto; }
.mmap .mm-body { fill: var(--fig-far); }
.mmap .mm-off { fill: var(--fig-far); opacity: .55; stroke: var(--fig-bg); stroke-width: .6; }
.mmap .mm-sec { fill: #e58a96; stroke: var(--fig-bg); stroke-width: .6; }
.mmap .mm-on { fill: var(--red); stroke: var(--fig-bg); stroke-width: .6; }
.mmap .mm-t { font: 600 7px -apple-system, Inter, sans-serif; fill: var(--text-3); text-anchor: middle; }

/* Variantes de la carte des muscles */
.mmap .mm-fibers { pointer-events: none; }
.mmap .mm-fib { stroke: #fff; stroke-width: .35; opacity: .35; }
.mmap .mm-glow { fill: #e0364b; opacity: .55; }
/* mono : silhouette grise façon Apple Fitness */
.mm-mono .mm-body { fill: var(--surface-2); }
.mm-mono .mm-off { fill: var(--surface-3); opacity: .7; stroke: var(--surface); stroke-width: .8; }
.mm-mono .mm-sec { fill: #ffb3ad; stroke: var(--surface); stroke-width: .8; }
.mm-mono .mm-on { fill: var(--hl); stroke: var(--surface); stroke-width: .8; }
/* line : contours fins, seuls les muscles travaillés sont remplis */
.mm-line .mm-body { fill: none; stroke: var(--text-3); stroke-width: .7; }
.mm-line .mm-off { fill: none; stroke: var(--text-3); stroke-width: .45; opacity: .6; }
.mm-line .mm-sec { fill: #ff9f97; fill-opacity: .55; stroke: #ff6b61; stroke-width: .5; }
.mm-line .mm-on { fill: var(--hl); stroke: #c81e12; stroke-width: .5; }
/* anat : style planche d'anatomie, fibres visibles */
.mm-anat .mm-body { fill: #ececef; }
.mm-anat .mm-off { fill: #d9d9de; stroke: #fff; stroke-width: .9; }
.mm-anat .mm-sec { fill: #f3a49d; stroke: #fff; stroke-width: .9; }
.mm-anat .mm-on { fill: var(--hl); stroke: #fff; stroke-width: .9; }
.mm-anat .mm-fib { stroke: #fff; opacity: .4; }
/* dark : fond sombre, muscles rouges lumineux */
.mm-dark { background: #1c1c1e; border-radius: 14px; }
.mm-dark .mm-body { fill: #2c2c2e; }
.mm-dark .mm-off { fill: #3a3a3c; stroke: #1c1c1e; stroke-width: .9; }
.mm-dark .mm-sec { fill: #7a2a25; stroke: #1c1c1e; stroke-width: .9; }
.mm-dark .mm-on { fill: var(--hl); stroke: #1c1c1e; stroke-width: .9; }
.mm-dark .mm-fib { stroke: #000; opacity: .25; }
.mm-dark .mm-t { fill: #8e8e93; }

/* Contour du corps et détails (toutes variantes) */
.mmap .mm-outline { fill: none; stroke: var(--fig-skin); stroke-width: .8; stroke-linejoin: round; stroke-linecap: round; }
.mmap .mm-detail { fill: none; stroke: var(--fig-skin); stroke-width: .4; opacity: .6; stroke-linecap: round; }
/* Variante retenue : trait fin, proche du réel */
.mm-line .mm-body { fill: var(--fig-bg); stroke: none; }
.mm-line .mm-outline { stroke: var(--text-2); stroke-width: .75; }
.mm-line .mm-detail { stroke: var(--text-3); stroke-width: .4; opacity: .7; }
.mm-line .mm-off { fill: none; stroke: var(--text-3); stroke-width: .42; opacity: .75; }
.mm-line .mm-sec { fill: #ff9f97; fill-opacity: .5; stroke: #ff6b61; stroke-width: .45; }
.mm-line .mm-on { fill: var(--hl); stroke: #c81e12; stroke-width: .45; }
