/* ==========================================================================
   PhysioRun App — feuille de style
   Charte PhysioRun Lab (posts Instagram / PhysioRun Connect) :
   marine #0F172B, jaune #FFC106, titres en Anton, texte en Inter.
   - Écrans de réglage : fond clair, cartes blanches (comme l'espace patient Connect).
   - En-têtes : bandeau marine à stries diagonales (comme les visuels Instagram).
   - Écrans d'exercice (chronos, stimuli) : plein écran marine, chiffres géants.
   ========================================================================== */

@font-face {
	font-family: 'Anton';
	src: url(../fonts/anton-latin-400-normal.woff2) format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Inter';
	src: url(../fonts/inter-latin-wght-normal.woff2) format('woff2');
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

:root {
	--navy: #0F172B;
	--navy-2: #16254F;
	--navy-3: #0A1020;
	--y: #FFC106;
	--y-hi: #FFD23F;
	--y-soft: #FFF8DB;
	--y-tint: #FFF1C2;
	--gold: #B7860B;
	--ink: #0F172A;
	--text: #334155;
	--muted: #64748B;
	--faint: #94A3B8;
	--line: #E2E8F0;
	--line-2: #F1F5F9;
	--bg: #F8FAFC;
	--ok: #16A34A;
	--danger: #DC2626;
	--sky: #38BDF8;
	--shadow-sm: 0 1px 3px rgba(15, 23, 42, .06);
	--shadow-md: 0 10px 28px rgba(15, 23, 42, .14);
	--font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--display: 'Anton', Impact, 'Arial Narrow', sans-serif;
	--tabbar-h: 66px;
	--safe-b: env(safe-area-inset-bottom, 0px);
	--safe-t: env(safe-area-inset-top, 0px);
	--pad-x: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--ink);
	background: var(--bg);
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	overflow-x: hidden;
}
body.lock-scroll { overflow: hidden; position: fixed; inset: 0; width: 100%; height: 100dvh; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
:focus-visible { outline: 3px solid rgba(255, 193, 6, .85); outline-offset: 2px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-sm { width: 18px; height: 18px; }
.ico-fill { fill: currentColor; stroke: none; }

/* ---------- Typographie de marque ---------- */
.display { margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .005em; line-height: 1.02; color: #fff; }
.display em { font-style: normal; color: var(--y); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--y); color: var(--navy); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; line-height: 1.2; white-space: nowrap; }
.section-title { margin: 30px 0 12px; padding-left: 12px; border-left: 5px solid var(--y); font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.1; letter-spacing: .01em; text-transform: uppercase; color: var(--ink); }

/* Fond marine à stries diagonales (visuels Instagram). */
.stripes {
	color: #E2E8F0;
	background:
		repeating-linear-gradient(120deg, transparent 0 66px, rgba(255, 255, 255, .045) 66px 68px),
		radial-gradient(120% 120% at 100% 0%, #1C2C60 0%, rgba(22, 37, 79, .55) 38%, transparent 72%),
		var(--navy);
}
/* Carte « halo » (cartes à dégradé de PhysioRun Connect). */
.halo {
	color: #fff;
	background:
		radial-gradient(120% 140% at 0% 0%, rgba(56, 128, 160, .55) 0%, rgba(30, 58, 90, .25) 38%, transparent 62%),
		radial-gradient(70% 90% at 100% 100%, rgba(255, 193, 6, .14) 0%, transparent 60%),
		linear-gradient(115deg, #1B2B44 0%, #0F172B 70%);
	box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
}
.halo.is-teal {
	background:
		radial-gradient(120% 140% at 0% 0%, rgba(13, 148, 136, .5) 0%, rgba(17, 74, 80, .25) 38%, transparent 62%),
		radial-gradient(70% 90% at 100% 100%, rgba(255, 193, 6, .14) 0%, transparent 60%),
		linear-gradient(115deg, #15303A 0%, #0F172B 70%);
}

/* ---------- Vues (une par écran, affichées par le routeur) ---------- */
.view { display: none; min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.view.is-on { display: block; animation: viewIn .22s ease-out; }
.view.has-cta { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 104px); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page { max-width: 760px; margin: 0 auto; padding: 0 var(--pad-x); }
.page.is-wide { max-width: 1080px; }

/* Barre du haut des sous-écrans : retour + titre. */
.viewbar {
	position: sticky; top: 0; z-index: 50;
	display: flex; align-items: center; gap: 8px;
	padding: calc(8px + var(--safe-t)) clamp(10px, 3vw, 28px) 8px;
	background: rgba(248, 250, 252, .9);
	-webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line);
}
.viewbar b { flex: 1; text-align: center; font-size: 16px; font-weight: 700; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
	flex: none; width: 42px; height: 42px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	border: 0; background: transparent; color: var(--navy); text-decoration: none;
	transition: background .15s;
}
.icon-btn:hover { background: var(--line-2); }
.icon-btn.is-ghost { visibility: hidden; }
.icon-btn.on-dark { color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.icon-btn.on-dark:hover { background: rgba(255, 255, 255, .16); }

/* ---------- Accueil ---------- */
.home-hero { padding: calc(18px + var(--safe-t)) 0 26px; border-radius: 0 0 28px 28px; }
.home-top { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand-mark {
	flex: none; width: 50px; height: 50px; border-radius: 13px;
	display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
	background: var(--navy-3); border: 1px solid rgba(255, 255, 255, .1);
	font-family: var(--display); color: var(--y); line-height: 1; text-transform: none;
}
.brand-mark b { font-weight: 400; font-size: 11.5px; letter-spacing: .01em; }
.brand-mark i { font-style: normal; font-size: 11px; margin-top: 3px; }
.home-top { align-items: flex-start; margin-bottom: 0; }
.home-hero .display.home-title { flex: 1; min-width: 0; font-size: clamp(28px, 9.5vw, 64px); line-height: 1; white-space: nowrap; text-align: center; }
.lead { max-width: 36ch; margin: 14px 0 0; font-size: 17px; line-height: 1.5; color: #CBD5E1; }
.lead b { color: #fff; }
.home-hero .lead { margin-left: auto; margin-right: auto; text-align: center; }

/* Carte blanche à liseré jaune (cartes des posts Instagram). */
.resume-card {
	display: flex; align-items: center; gap: 14px;
	margin-top: 22px; padding: 14px 14px 14px 16px;
	border-radius: 18px; border-left: 6px solid var(--y);
	background: #fff; color: var(--ink); text-decoration: none;
	box-shadow: var(--shadow-md);
	transition: transform .15s;
}
.resume-card:hover { transform: translateY(-2px); }
.resume-card > span:first-child { flex: 1; min-width: 0; }
.resume-card small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.resume-card b { display: block; font-size: 17px; line-height: 1.3; }
.resume-card .sub { display: block; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-btn { flex: none; width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--y); color: var(--navy); }
.play-btn .ico { width: 20px; height: 20px; margin-left: 2px; }

.feature-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
.feature-card {
	position: relative; overflow: hidden; isolation: isolate;
	display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
	min-height: 168px; padding: 18px 20px; border-radius: 20px;
	text-decoration: none; transition: transform .15s;
}
.feature-card:hover { transform: translateY(-2px); }
.feature-card .ghost { position: absolute; z-index: -1; right: -18px; bottom: -26px; width: 150px; height: 150px; color: rgba(255, 255, 255, .06); stroke-width: 1.6; }
.feature-ico { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 193, 6, .16); color: var(--y); }
.feature-card h3 { margin: 6px 0 0; font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1; text-transform: uppercase; color: var(--y); }
.feature-card p { margin: 0; max-width: 32ch; font-size: 14px; color: #CBD5E1; }
.feature-card .chips-dark { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.chip-dark { padding: 3px 10px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; font-size: 12px; color: #E2E8F0; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
	position: relative; min-width: 0;
	display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
	padding: 14px; border-radius: 18px; border: 1px solid var(--line);
	background: #fff; color: var(--ink); text-decoration: none;
	box-shadow: var(--shadow-sm); transition: transform .15s, border-color .15s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--y); }
.tile b { margin-top: 8px; font-size: 15px; }
.tile small { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.tile .ext { position: absolute; top: 12px; right: 12px; color: var(--faint); }
.tile-ico { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--y-soft); color: var(--navy); }
.tile-ico.is-green { background: #DCFCE7; color: #15803D; }
.tile-ico.is-blue { background: #E0F2FE; color: #0369A1; }
.tile-ico.is-purple { background: #EDE9FE; color: #6D28D9; }

.tool-list { display: flex; flex-direction: column; gap: 10px; }
.tool-row {
	display: flex; align-items: center; gap: 14px;
	padding: 14px; border-radius: 18px; border: 1px solid var(--line);
	background: #fff; color: var(--ink); text-decoration: none;
	box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s;
}
.tool-row:hover { border-color: var(--y); transform: translateY(-1px); }
.tool-row > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tool-row b { font-size: 16px; }
.tool-row small { font-size: 13px; color: var(--muted); }
.tool-row > .ico { color: var(--faint); }

.info-card { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); border-left: 4px solid var(--y); background: #fff; }
.info-card > span:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.info-card b { font-size: 15px; }
.info-card small { font-size: 13px; color: var(--muted); line-height: 1.45; }

.home-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 34px 0 8px; text-align: center; font-size: 13px; color: var(--muted); }
.home-foot .insta { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #EC4899 !important; text-decoration: none; }
.home-foot .insta:hover { color: #F472B6 !important; }

/* ---------- En-tête d'outil (bandeau marine) ---------- */
.tool-head { margin: 14px 0 14px; padding: 20px; border-radius: 20px; }
.tool-head .display { margin-top: 12px; font-size: clamp(36px, 10vw, 52px); }
.tool-head p { max-width: 54ch; margin: 8px 0 0; font-size: 14.5px; color: #CBD5E1; }
.tool-head p b { color: #fff; }

/* ---------- Cartes de réglage ---------- */
.card { margin-bottom: 12px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head:last-child { margin-bottom: 0; }
.card-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 700; color: var(--navy); }
.step-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--y); color: var(--navy); font-family: var(--display); font-size: 14px; line-height: 1; }
.hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.card .hint + .hint { margin-top: 6px; }
.sub-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.row-actions { display: flex; gap: 6px; }

/* Sélecteur de mode (Kiné Flash). */
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 620px) { .mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Une couleur par mode, comme l'ancienne version : icône teintée, titre coloré,
   bordure et fond légèrement teinté quand le mode est choisi. */
.mode-btn {
	--mc: var(--navy); --mt: var(--line-2); --ms: var(--y-soft);
	display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
	padding: 12px; border-radius: 14px; border: 2px solid var(--line);
	background: #fff; text-align: left; transition: border-color .15s, background .15s, box-shadow .15s;
}
.mode-btn[data-mode="standard"] { --mc: #2563EB; --mt: #DBEAFE; --ms: #EFF6FF; }
.mode-btn[data-mode="stroop"] { --mc: #DC2626; --mt: #FEE2E2; --ms: #FEF2F2; }
.mode-btn[data-mode="memorisation"] { --mc: #0284C7; --mt: #E0F2FE; --ms: #F0F9FF; }
.mode-btn[data-mode="gonogo"] { --mc: #16A34A; --mt: #DCFCE7; --ms: #F0FDF4; }
.mode-btn[data-mode="math"] { --mc: #DB2777; --mt: #FCE7F3; --ms: #FDF2F8; }
.mode-btn[data-mode="sound"] { --mc: #D97706; --mt: #FEF3C7; --ms: #FFFBEB; }
.mode-btn[data-mode="reaction"] { --mc: #7C3AED; --mt: #EDE9FE; --ms: #F5F3FF; }
.mode-btn:hover { border-color: var(--mt); }
.mode-btn .mode-ico { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--mt); color: var(--mc); transition: background .15s, color .15s; }
.mode-btn .mode-ico .ico { width: 21px; height: 21px; }
.mode-btn b { font-size: 13.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--mc); }
.mode-btn small { font-size: 12px; line-height: 1.35; color: var(--muted); }
.mode-btn[aria-pressed="true"] { border-color: var(--mc); background: var(--ms); box-shadow: 0 8px 18px -12px var(--mc); }
.mode-btn[aria-pressed="true"] .mode-ico { background: var(--mc); color: #fff; }
.mode-btn.is-wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 12px; }
.mode-btn.is-wide .mode-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mode-tag { flex: none; padding: 3px 9px; border-radius: 999px; background: var(--mc); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

/* Interrupteur (piste marine + pastille jaune quand activé). */
.switch { position: relative; flex: none; display: inline-flex; width: 50px; height: 30px; }
.switch input { position: absolute; inset: 0; z-index: 1; margin: 0; opacity: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #CBD5E1; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s, background .2s; }
.switch input:checked + span { background: var(--navy); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--y); }
.switch input:focus-visible + span { outline: 3px solid rgba(255, 193, 6, .85); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--text); }
.switch-row + .switch-row { margin-top: 12px; }

/* Pastilles à cocher (couleurs, flèches, chiffres). */
.pick-grid { display: grid; gap: 8px; }
.pick-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pick-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pick-grid.compass { grid-template-columns: repeat(3, 64px); justify-content: center; }
@media (min-width: 620px) { .pick-grid.cols-3.is-colors { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.pick {
	position: relative; min-height: 54px;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
	padding: 10px 6px; border-radius: 12px; border: 2px solid var(--line);
	background: #fff; color: var(--muted);
	font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
	cursor: pointer; user-select: none; -webkit-user-select: none;
	transition: border-color .15s, background .15s, color .15s;
}
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick:hover { border-color: #CBD5E1; }
.pick:has(input:checked) { border-color: var(--navy); background: var(--navy); color: #fff; }
.pick:has(input:focus-visible) { outline: 3px solid rgba(255, 193, 6, .85); outline-offset: 2px; }
.pick .dot { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .15); }
.pick:has(input:checked) .dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
.pick svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pick .digit { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1; }
.pick-grid.compass .pick { aspect-ratio: 1; min-height: 0; padding: 0; }
.pick-center { display: flex; align-items: center; justify-content: center; }
.pick-center::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }

.mini-btn { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 12px; font-weight: 700; color: var(--text); }
.mini-btn:hover { border-color: var(--navy); }

/* Champ valeur + curseur. */
.field + .field { margin-top: 16px; }
.field-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.field-label { font-size: 14px; font-weight: 700; color: var(--text); }
.field-help { font-size: 12.5px; font-weight: 700; color: var(--gold); }
.num { display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); transition: border-color .15s, box-shadow .15s; }
.num:focus-within { border-color: var(--y); box-shadow: 0 0 0 3px rgba(255, 193, 6, .25); }
.num input { width: 70px; padding: 0; border: 0; outline: none; background: transparent; text-align: right; font-family: var(--display); font-size: 24px; line-height: 1.2; color: var(--navy); }
.num span { font-size: 14px; font-weight: 700; color: var(--muted); }
.num.is-big input { width: 100%; text-align: left; font-size: 34px; }
.num.is-big { display: flex; width: 100%; padding: 6px 12px; }
.value-out { font-family: var(--display); font-size: 22px; color: var(--navy); }

input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

input[type="range"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 30px; margin: 0; background: transparent; cursor: pointer; --fill: 0%; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(var(--navy), var(--navy)) 0 / var(--fill) 100% no-repeat, var(--line); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; border: 3px solid #fff; background: var(--y); box-shadow: 0 1px 5px rgba(15, 23, 42, .35); transition: transform .1s; }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--navy); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #fff; background: var(--y); box-shadow: 0 1px 5px rgba(15, 23, 42, .35); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(255, 193, 6, .45); }

.text-input { width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 16px; color: var(--ink); outline: none; }
.text-input:focus { border-color: var(--y); box-shadow: 0 0 0 3px rgba(255, 193, 6, .25); }
select.text-input { appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F172B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px; padding-right: 40px; font-weight: 600; }

/* Puces de choix (durée, préréglages). */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 700; color: var(--text); transition: border-color .15s, background .15s, color .15s; }
.chip:hover { border-color: var(--navy); }
.chip[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.chips.is-even .chip { flex: 1 1 0; text-align: center; padding-left: 6px; padding-right: 6px; }
.chips.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.chips.is-grid .chip { text-align: center; padding-left: 6px; padding-right: 6px; }

/* Choix segmenté (côté testé, unité). */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--line-2); }
.seg button { padding: 8px 16px; border: 0; border-radius: 999px; background: transparent; font-size: 14px; font-weight: 700; color: var(--muted); transition: background .15s, color .15s; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(15, 23, 42, .15); }
.seg.is-block { display: flex; }
.seg.is-block button { flex: 1; }
.seg.is-small button { padding: 5px 12px; font-size: 12.5px; }

/* Stepper −/+ (Smart Wod). */
.stepper { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); }
.stepper input { flex: 1; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; text-align: center; font-family: var(--display); font-size: 30px; line-height: 1.2; color: var(--navy); }
.stepper:focus-within { border-color: var(--y); box-shadow: 0 0 0 3px rgba(255, 193, 6, .25); }
.step-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--navy); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); transition: transform .12s, background .12s; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.step-btn .ico { width: 18px; height: 18px; stroke-width: 2.6; pointer-events: none; }
.step-btn { -webkit-touch-callout: none; }
.step-btn:active { transform: scale(.9); background: var(--y-soft); }
.step-field + .step-field { margin-top: 12px; }
.step-field > label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--text); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-2 + .step-field, .step-field + .grid-2, .grid-2 + .grid-2 { margin-top: 12px; }
.grid-2 > .step-field { margin-top: 0; }

/* Ligne « durée totale ». */
.total-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 12px; font-size: 14px; color: var(--muted); }
.total-line b { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--navy); }

/* ---------- Boutons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 50px; padding: 0 22px; border: 0; border-radius: 999px;
	font-size: 15px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; text-decoration: none; line-height: 1.1;
	transition: transform .12s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--y); color: var(--navy); box-shadow: 0 8px 20px -8px rgba(255, 193, 6, .7); }
.btn-primary:hover:not(:disabled) { background: var(--y-hi); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-ghost { background: #fff; color: var(--navy); border: 1px solid #CBD5E1; }
.btn-ghost:hover { border-color: var(--navy); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost-dark { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .16); }
.btn-ghost-dark.is-resume { background: var(--y); color: var(--navy); border-color: var(--y); }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 58px; font-size: 16.5px; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 12.5px; }
.btn .ico { width: 20px; height: 20px; }

/* Bouton d'action principal, toujours accessible au-dessus de la barre d'onglets. */
.cta-dock {
	position: fixed; left: 0; right: 0; z-index: 60;
	bottom: calc(var(--tabbar-h) + var(--safe-b));
	padding: 18px var(--pad-x) 12px;
	background: linear-gradient(to top, var(--bg) 62%, rgba(248, 250, 252, 0));
	pointer-events: none;
}
.cta-dock > * { pointer-events: auto; max-width: 696px; margin: 0 auto; }

/* ---------- Barre d'onglets (comme l'espace patient Connect) ---------- */
.tabbar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
	padding: 6px 6px calc(6px + var(--safe-b));
	background: rgba(255, 255, 255, .95);
	-webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
	border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(15, 23, 42, .06);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 6px 2px; border-radius: 14px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tab:hover, .tab.is-on { color: var(--navy); }
.tab-ico { width: 50px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; transition: background .15s; }
.tab-ico .ico { width: 22px; height: 22px; }
.tab.is-on .tab-ico { background: var(--y-tint); }
.tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) {
	:root { --tabbar-h: 86px; }
	.tabbar { left: 50%; right: auto; bottom: 14px; width: 500px; transform: translateX(-50%); padding: 6px; border: 1px solid var(--line); border-radius: 22px; }
	.cta-dock { bottom: 0; padding-bottom: calc(var(--tabbar-h) + 10px); }
}

/* ---------- Écrans d'exercice plein écran ---------- */
.run { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; height: 100dvh; overflow: hidden; background: var(--navy-3); color: #fff; }
.fs-btn { position: absolute; z-index: 6; top: calc(12px + var(--safe-t)); right: 12px; opacity: .8; }
.fs-btn.on-dark { background: rgba(10, 16, 32, .55); border-color: rgba(255, 255, 255, .25); }

/* Kiné Flash */
.kf-display { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--navy); transition: background-color .2s; }
.kf-text { z-index: 1; display: none; align-items: center; justify-content: center; padding: 0 16px; font-family: var(--display); font-weight: 400; font-size: clamp(72px, 22vw, 240px); line-height: 1; text-align: center; text-transform: uppercase; text-shadow: none; user-select: none; -webkit-user-select: none; }
#kf-arrow { z-index: 1; display: none; width: min(72vw, 62vh); height: min(72vw, 62vh); fill: none; stroke: currentColor; stroke-width: 3; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .3)); transition: color .1s; }
.kf-math { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.kf-math small { font-family: var(--font); font-size: clamp(14px, 2.6vw, 26px); font-weight: 800; letter-spacing: .24em; color: var(--y); }
.kf-math b { font-family: var(--display); font-weight: 400; font-size: clamp(60px, 15vw, 160px); line-height: 1; color: #fff; }
.kf-math b.is-answer { color: #4ADE80; animation: pop .15s ease-out; }
.kf-sound { width: min(46vw, 40vh); height: min(46vw, 40vh); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kf-sound.is-wait { color: rgba(255, 255, 255, .14); animation: pulseOp 1.6s ease-in-out infinite; }
.kf-sound.is-beep { width: min(60vw, 52vh); height: min(60vw, 52vh); color: var(--navy); }
.kf-correction { display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 16px; }
.kf-correction > b { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 6vw, 64px); letter-spacing: .04em; color: var(--y); }
.kf-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(12px, 3vw, 32px); max-width: 1100px; }
.kf-tile-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.kf-tile-wrap > span { font-family: var(--display); font-size: clamp(22px, 3.4vw, 36px); color: #CBD5E1; }
.kf-tile { width: clamp(108px, 22vw, 210px); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 10px; overflow: hidden; border-radius: 24px; border: 4px solid rgba(255, 255, 255, .22); }
.kf-tile svg { width: 64%; height: 64%; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.kf-tile .big { font-family: var(--display); font-size: clamp(60px, 11vw, 110px); line-height: 1; }
.kf-tile .name { font-family: var(--display); font-size: clamp(20px, 3.6vw, 38px); line-height: 1.05; text-align: center; }

/* Test de réaction : messages pendant le test */
.kf-fb { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 20px; text-align: center; }
.kf-fb b { font-family: var(--display); font-weight: 400; font-size: clamp(96px, 28vw, 230px); line-height: .95; color: #fff; }
.kf-fb b span { margin-left: .08em; font-family: var(--font); font-size: .22em; font-weight: 800; letter-spacing: .04em; text-transform: none; color: var(--faint); }
.kf-fb b.msg { font-size: clamp(48px, 13vw, 120px); line-height: 1.05; }
.kf-fb small { font-family: var(--font); font-size: clamp(13px, 2.4vw, 18px); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.kf-fb em { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; font-family: var(--font); font-style: normal; font-size: clamp(14px, 2.6vw, 20px); font-weight: 600; text-transform: none; color: #CBD5E1; }
.kf-fb em i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-left: 6px; }
.kf-fb.is-wait small { font-size: clamp(16px, 3.4vw, 26px); color: #E2E8F0; }
.kf-fb.is-warn b { color: #FBBF24; }
.kf-fb.is-error b { color: #F87171; }
.kf-fb.is-ok b { color: #4ADE80; }

/* Test de réaction : résultats */
.kf-results { position: absolute; inset: 0; z-index: 4; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; justify-content: center; padding: calc(64px + var(--safe-t)) 16px 24px; background: var(--navy); text-transform: none; }
.rt-res { width: min(560px, 100%); display: flex; flex-direction: column; gap: 16px; color: #E2E8F0; font-family: var(--font); }
.rt-head { text-align: center; }
.rt-head .pill { background: #7C3AED; color: #fff; }
.rt-main { text-align: center; }
.rt-main b { font-family: var(--display); font-weight: 400; font-size: clamp(84px, 24vw, 128px); line-height: 1; color: #fff; }
.rt-main b span { margin-left: 6px; font-family: var(--font); font-size: .24em; font-weight: 800; color: var(--faint); }
.rt-main small { display: block; margin-top: 4px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.rt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 520px) { .rt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rt-tile { padding: 10px 8px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); text-align: center; }
.rt-tile small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.rt-tile b { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.15; color: #fff; }
.rt-tile b span { font-family: var(--font); font-size: 13px; font-weight: 700; color: var(--faint); }
.rt-chart-wrap { padding: 12px 12px 8px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.rt-chart { position: relative; height: 130px; display: flex; align-items: flex-end; gap: 2px; padding-top: 16px; border-bottom: 1px solid rgba(255, 255, 255, .25); }
.rt-col { position: relative; flex: 1; min-width: 4px; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.rt-bar { display: block; width: 100%; max-width: 26px; border-radius: 4px 4px 0 0; background: #A78BFA; }
.rt-col:hover .rt-bar { background: #C4B5FD; }
.rt-mark { font-style: normal; font-size: 14px; font-weight: 800; line-height: 1; padding-bottom: 3px; color: var(--faint); }
.rt-mark.is-err { color: #F87171; }
.rt-mean { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed rgba(255, 255, 255, .55); pointer-events: none; }
.rt-mean span { position: absolute; right: 0; bottom: 3px; padding: 1px 6px; border-radius: 6px; background: var(--navy); font-size: 11px; font-weight: 700; color: #E2E8F0; }
.rt-ymax { position: absolute; top: -2px; left: 0; font-size: 10.5px; font-weight: 700; color: var(--faint); }
.rt-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--faint); }
.rt-counts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.rt-note { margin: 0; font-size: 12.5px; line-height: 1.45; text-align: center; color: var(--faint); }
.rt-actions { display: flex; justify-content: center; }

.countdown { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--navy); }
.countdown small { font-size: 14px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: var(--faint); }
.countdown b { font-family: var(--display); font-weight: 400; font-size: clamp(140px, 42vw, 340px); line-height: 1; color: var(--y); animation: pop .25s ease-out; }

.run-bar { position: relative; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 16px clamp(16px, 4vw, 40px) calc(16px + var(--safe-b)); background: var(--navy-3); border-top: 1px solid rgba(255, 255, 255, .06); }
.run-progress { position: absolute; top: 0; left: 0; right: 0; height: 5px; background: rgba(255, 255, 255, .08); }
.run-progress > div { width: 0; height: 100%; background: var(--y); }
/* Compteur gros et centré ; chrono (ou moyenne du test de réaction) à gauche. */
.run-count { text-align: center; }
.run-count b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(64px, 18vw, 104px); line-height: .95; color: #fff; }
.run-count b small { font-size: .38em; color: var(--faint); }
.run-clock { justify-self: start; font-family: var(--display); font-size: 26px; line-height: 1; color: #CBD5E1; text-align: left; }
.run-clock small { display: block; margin-top: 4px; font-family: var(--font); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.run-bar .btn { justify-self: end; min-width: 110px; }
@media (max-width: 380px) { .run-bar .btn { min-width: 92px; padding: 0 14px; } .run-clock { font-size: 22px; } }
.btn-run { min-height: 62px; border-radius: 20px; font-size: 17px; }

/* Smart Wod */
.sw-track { flex: none; height: 6px; background: rgba(255, 255, 255, .06); }
#sw-progress { width: 100%; height: 100%; background: var(--y); transition: width 1s linear; }
.sw-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: calc(14px + var(--safe-t)) clamp(16px, 4vw, 40px) 10px; }
.sw-head-l { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sw-block-label { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; }
.sw-stats { display: flex; align-items: flex-start; gap: 8px; }
.stat { min-width: 70px; padding: 6px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); text-align: center; }
.stat > small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.stat b { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.15; }
.stat b small { font-size: 15px; color: var(--faint); }
.sw-center { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 6px 16px; }
.sw-ring-wrap { position: relative; container-type: inline-size; width: min(86vw, max(170px, calc(100dvh - 330px))); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.sw-ring-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.sw-ring-inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.sw-status { font-size: clamp(13px, 5cqw, 26px); font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: var(--faint); }
.sw-status[data-tone="work"] { color: var(--y); }
.sw-status[data-tone="rest"] { color: var(--sky); }
.sw-status[data-tone="reps"] { color: var(--y); animation: pulseOp 1.2s ease-in-out infinite; }
.sw-status[data-tone="ready"] { color: #CBD5E1; animation: pulseOp 1s ease-in-out infinite; }
.sw-status[data-tone="done"] { color: #fff; font-size: clamp(18px, 7cqw, 34px); letter-spacing: .16em; }
.sw-time { font-family: var(--display); font-weight: 400; font-size: 62px; font-size: 27cqw; line-height: 1; color: #fff; user-select: none; -webkit-user-select: none; }
.dg { display: inline-block; width: .56em; text-align: center; }
.sep { display: inline-block; width: .3em; text-align: center; }
.sw-next { max-width: 76cqw; margin-top: 6px; font-size: clamp(12px, 4cqw, 17px); color: #CBD5E1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-next b { color: #fff; }
.sw-extra { min-height: 62px; display: flex; gap: 10px; }
.sw-actions { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 760px; margin: 0 auto; padding: 10px clamp(16px, 4vw, 40px) calc(16px + var(--safe-b)); }
@media (orientation: landscape) and (max-height: 600px) {
	.sw-head { padding-top: calc(8px + var(--safe-t)); padding-bottom: 4px; }
	.sw-center { flex-direction: row; gap: 28px; }
	.sw-ring-wrap { width: max(150px, calc(100dvh - 190px)); }
	.sw-extra { flex-direction: column; }
	.sw-actions { padding-top: 6px; padding-bottom: calc(8px + var(--safe-b)); }
	.btn-run { min-height: 52px; }
	.run-bar { padding-top: 10px; padding-bottom: calc(10px + var(--safe-b)); }
}

/* Heel Raise */
.hr-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 0 6px; }
.hr-ring { position: relative; width: min(66vw, 250px); aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; }
.hr-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hr-reps { position: relative; font-family: var(--display); font-size: 92px; line-height: 1; color: var(--navy); }
.hr-ring small { position: relative; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hr-status { min-height: 30px; font-size: 19px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: center; }
.hr-status[data-tone="up"] { color: #A16207; }
.hr-status[data-tone="down"] { color: var(--navy); }
.hr-status[data-tone="done"] { color: var(--ok); }
.hr-results { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 8px; }
.hr-res { padding: 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); text-align: center; }
.hr-res small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hr-res b { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.15; color: var(--navy); }
.hr-res.is-ratio { background: var(--y-soft); border-color: var(--y-tint); }

/* Résultat des calculateurs. */
.result-card { position: relative; overflow: hidden; isolation: isolate; margin-bottom: 12px; padding: 18px 20px; border-radius: 20px; text-align: center; }
.result-card small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #CBD5E1; }
.result-card .value { margin: 4px 0 2px; font-family: var(--display); font-weight: 400; font-size: clamp(48px, 13vw, 66px); line-height: 1; color: #fff; }
.result-card .value span { font-size: .42em; color: var(--y); margin-left: 4px; }
.result-card .sub { font-size: 14.5px; font-weight: 600; color: #E2E8F0; }
.result-card .unit { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--y); }
.tri { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin: 4px 0 2px; }
.tri > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tri .num input { width: 56px; text-align: center; font-size: 28px; }
.tri .num { padding: 4px 6px; }
.tri label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tri .colon { padding-bottom: 26px; font-family: var(--display); font-size: 24px; color: var(--faint); }
.table-wrap { overflow: hidden; border-radius: 14px; border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 8px 12px; background: var(--bg); text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.table td { padding: 10px 12px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; color: var(--text); }
.table th:last-child, .table td:last-child { text-align: right; }
.table td:last-child { font-weight: 700; color: var(--ink); }
.table tr.is-final td { background: var(--y-soft); font-weight: 800; color: var(--navy); }
.link-card { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-weight: 700; text-decoration: none; }
.link-card:hover { border-color: var(--y); }
.link-card > span:nth-child(2) { flex: 1; }
.link-card small { display: block; font-weight: 500; color: var(--muted); }

/* Programme MIX */
.block-list { display: flex; flex-direction: column; gap: 8px; }
.block-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 12px; border-radius: 14px; border: 1px solid var(--line); border-left: 5px solid var(--y); background: #fff; }
.block-row .idx { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: var(--y); font-family: var(--display); font-size: 13px; }
.block-row > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.block-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.block-row small { font-size: 12.5px; color: var(--muted); }
.type-tag { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 6px; background: var(--line-2); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: var(--text); vertical-align: 1px; }
.block-row { gap: 6px; }
.block-row > span:nth-child(2) { margin-left: 4px; }
.block-row .icon-btn { width: 34px; height: 34px; color: var(--muted); }
@media (max-width: 400px) { .block-row .icon-btn { width: 30px; height: 30px; } }
.block-row .icon-btn:hover { color: var(--navy); }
.block-row .icon-btn.is-del:hover { color: var(--danger); background: #FEF2F2; }
.block-row .icon-btn:disabled { opacity: .3; cursor: default; background: transparent; }
.block-row .icon-btn .ico { width: 18px; height: 18px; }
.empty { padding: 26px 16px; border: 2px dashed var(--line); border-radius: 16px; text-align: center; font-size: 14px; color: var(--muted); }
.save-row { display: flex; gap: 8px; }
.save-row .text-input { flex: 1; min-width: 0; }

/* SW : cartes de mode */
.wod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wod-card { position: relative; overflow: hidden; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 14px 14px 18px; border-radius: 18px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .15s, border-color .15s; }
.wod-card::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 5px; background: var(--y); }
.wod-card:hover { transform: translateY(-2px); border-color: var(--y); }
.wod-card h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.05; text-transform: uppercase; color: var(--navy); }
.wod-card p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.wod-card .last { margin-top: auto; padding: 3px 10px; border-radius: 999px; background: var(--line-2); font-size: 12px; font-weight: 700; color: var(--text); }
.wod-card p + .last { margin-top: 10px; }
/* Une couleur par mode (comme l'ancienne version) : liseré, titre et bouton Démarrer. */
/* --mc : couleur du mode ; --mcd : version foncée (texte sur fond clair) ;
   --mb : version claire (fond des boutons, texte marine lisible). */
[data-mode="AMRAP"] { --mc: #10B981; --mcd: #047857; --mb: #34D399; }
[data-mode="FORTIME"] { --mc: #3B82F6; --mcd: #1D4ED8; --mb: #60A5FA; }
[data-mode="EMOM"] { --mc: #A855F7; --mcd: #7E22CE; --mb: #C084FC; }
[data-mode="TABATA"] { --mc: #F97316; --mcd: #C2410C; --mb: #FB923C; }
[data-mode="MIX"] { --mc: #EC4899; --mcd: #BE185D; --mb: #F472B6; }
.wod-card[data-mode]::before { background: var(--mc); }
.wod-card[data-mode] h3 { color: var(--mcd); }
.wod-card[data-mode]:hover { border-color: var(--mc); }
.view[data-view="sw-setup"][data-mode] .tool-head .pill { background: var(--mb); }
.view[data-view="sw-setup"][data-mode] #sw-setup-title { color: var(--mb); }
.view[data-view="sw-setup"][data-mode] #sw-start-btn { background: var(--mb); box-shadow: 0 8px 20px -8px var(--mc); }
.view[data-view="sw-setup"][data-mode] #sw-start-btn:hover:not(:disabled) { filter: brightness(1.07); }
.view[data-view="sw-setup"][data-mode] .step-num { background: var(--mc); }
.block-row[data-type="AMRAP"] { border-left-color: #10B981; }
.block-row[data-type="FORTIME"] { border-left-color: #3B82F6; }
.block-row[data-type="EMOM"] { border-left-color: #A855F7; }
.block-row[data-type="TABATA"] { border-left-color: #F97316; }
.block-row[data-type="INTERVAL"] { border-left-color: #EC4899; }
.block-row.is-rt { border-left-color: #8B5CF6; }
.halo.is-pink {
	background:
		radial-gradient(120% 140% at 0% 0%, rgba(236, 72, 153, .42) 0%, rgba(120, 30, 80, .22) 38%, transparent 62%),
		radial-gradient(70% 90% at 100% 100%, rgba(255, 193, 6, .12) 0%, transparent 60%),
		linear-gradient(115deg, #2A1838 0%, #0F172B 70%);
}
.wod-card.is-wide[data-mode] h3 { color: #F472B6; }

/* Une couleur par outil, reprise dans sa page : Heel Raise jaune, Pacing bleu,
   Vitesse ascensionnelle violet (Vitesse critique, externe, en vert).
   --tc : couleur de l'outil ; --tct : version pour du texte ; --tbg : fond teinté. */
.view[data-tool="hr"] { --tc: #FFC106; --tct: #B7860B; --tbg: #FFF8DB; }
.view[data-tool="pc"] { --tc: #38BDF8; --tct: #0369A1; --tbg: #E0F2FE; }
.view[data-tool="va"] { --tc: #A78BFA; --tct: #6D28D9; --tbg: #EDE9FE; }
.view[data-tool] .tool-head .pill { background: var(--tc); }
.view[data-tool] .tool-head .display em { color: var(--tc); }
.view[data-tool] .result-card .value span,
.view[data-tool] .result-card .unit { color: var(--tc); }
.view[data-tool] .field-help { color: var(--tct); }
.view[data-tool] input[type="range"]::-webkit-slider-thumb { background: var(--tc); }
.view[data-tool] input[type="range"]::-moz-range-thumb { background: var(--tc); }
.view[data-tool] .table tr.is-final td { background: var(--tbg); color: var(--tct); }
.view[data-tool] .chip:hover { border-color: var(--tc); }

/* Volume des sons (accueil) */
.sound-card { flex-wrap: wrap; }
.sound-card > span:first-child { flex: 1 1 200px; }
.sound-ctrls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.wod-card.is-wide { grid-column: 1 / -1; border: 0; }
.wod-card.is-wide::before { display: none; }
.wod-card.is-wide h3 { color: var(--y); font-size: 32px; }
.wod-card.is-wide p { color: #CBD5E1; }
.wod-card.is-wide .last { background: rgba(255, 255, 255, .1); color: #E2E8F0; }

/* Notifications */
.toasts { position: fixed; left: 50%; z-index: 300; bottom: calc(var(--tabbar-h) + var(--safe-b) + 90px); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; border-radius: 14px; border-left: 5px solid var(--y); background: var(--navy); color: #fff; font-size: 14px; font-weight: 600; line-height: 1.4; box-shadow: var(--shadow-md); pointer-events: auto; opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .25s; }
.toast.is-in { opacity: 1; transform: none; }
.toast.is-error { border-left-color: #F87171; }
.toast.is-ok { border-left-color: #4ADE80; }
.toast span { flex: 1; }
.toast button { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--faint); font-size: 20px; line-height: 1; }

@keyframes pop { from { transform: scale(.85); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes pulseOp { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.pulse { animation: pulseScale .15s ease-out; }
@keyframes pulseScale { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   THÈME SOMBRE (par défaut)
   Fond bleu nuit, cartes marine éclaircies, jaune PhysioRun pour tout ce qui
   est sélectionné. Les couleurs des modes passent d'un cran plus clair pour
   rester lisibles sur fond sombre.
   ========================================================================== */
html[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0A1020;
	--surface: #121B33;
	--surface-2: #1A2645;
	--line: rgba(148, 163, 184, .16);
	--line-2: rgba(148, 163, 184, .10);
	--ink: #F1F5F9;
	--text: #CBD5E1;
	--muted: #94A3B8;
	--y-soft: rgba(255, 193, 6, .12);
	--y-tint: rgba(255, 193, 6, .18);
	--gold: #FCD34D;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
	--shadow-md: 0 14px 32px rgba(0, 0, 0, .5);
}
[data-theme="dark"] .viewbar { background: rgba(10, 16, 32, .88); }
[data-theme="dark"] .viewbar b,
[data-theme="dark"] .card-title,
[data-theme="dark"] .home-foot .insta,
[data-theme="dark"] .num input,
[data-theme="dark"] .value-out,
[data-theme="dark"] .stepper input,
[data-theme="dark"] .total-line b,
[data-theme="dark"] .hr-reps,
[data-theme="dark"] .hr-res b,
[data-theme="dark"] .link-card,
[data-theme="dark"] .tab:hover,
[data-theme="dark"] .tab.is-on { color: #fff; }
[data-theme="dark"] .icon-btn { color: #E2E8F0; }
[data-theme="dark"] .icon-btn:hover { background: rgba(255, 255, 255, .07); }

/* Surfaces */
[data-theme="dark"] .card,
[data-theme="dark"] .tile,
[data-theme="dark"] .tool-row,
[data-theme="dark"] .info-card,
[data-theme="dark"] .wod-card,
[data-theme="dark"] .link-card,
[data-theme="dark"] .block-row,
[data-theme="dark"] .mode-btn,
[data-theme="dark"] .pick,
[data-theme="dark"] .chip,
[data-theme="dark"] .mini-btn,
[data-theme="dark"] .text-input,
[data-theme="dark"] .step-btn { background-color: var(--surface); }
[data-theme="dark"] .card,
[data-theme="dark"] .tile,
[data-theme="dark"] .tool-row,
[data-theme="dark"] .wod-card { box-shadow: none; }
[data-theme="dark"] .tool-head,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .result-card { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
[data-theme="dark"] .home-hero { box-shadow: 0 1px 0 rgba(255, 255, 255, .06); }

/* La carte « Reprendre » reste blanche, comme les cartes des posts Instagram. */
[data-theme="dark"] .resume-card { color: #0F172A; }
[data-theme="dark"] .resume-card small { color: #B7860B; }
[data-theme="dark"] .resume-card .sub { color: #64748B; }

/* Pastilles d'icônes */
[data-theme="dark"] .tile-ico { color: var(--y); }
[data-theme="dark"] .tile-ico.is-green { background: rgba(34, 197, 94, .15); color: #4ADE80; }
[data-theme="dark"] .tile-ico.is-blue { background: rgba(56, 189, 248, .15); color: #7DD3FC; }
[data-theme="dark"] .tile-ico.is-purple { background: rgba(139, 92, 246, .2); color: #C4B5FD; }

/* Modes Kiné Flash : couleurs éclaircies */
[data-theme="dark"] .mode-btn[data-mode="standard"] { --mc: #60A5FA; --mt: rgba(59, 130, 246, .18); --ms: rgba(59, 130, 246, .10); }
[data-theme="dark"] .mode-btn[data-mode="stroop"] { --mc: #F87171; --mt: rgba(239, 68, 68, .18); --ms: rgba(239, 68, 68, .10); }
[data-theme="dark"] .mode-btn[data-mode="memorisation"] { --mc: #38BDF8; --mt: rgba(14, 165, 233, .18); --ms: rgba(14, 165, 233, .10); }
[data-theme="dark"] .mode-btn[data-mode="gonogo"] { --mc: #4ADE80; --mt: rgba(34, 197, 94, .18); --ms: rgba(34, 197, 94, .10); }
[data-theme="dark"] .mode-btn[data-mode="math"] { --mc: #F472B6; --mt: rgba(236, 72, 153, .18); --ms: rgba(236, 72, 153, .10); }
[data-theme="dark"] .mode-btn[data-mode="sound"] { --mc: #FBBF24; --mt: rgba(245, 158, 11, .18); --ms: rgba(245, 158, 11, .10); }
[data-theme="dark"] .mode-btn[data-mode="reaction"] { --mc: #A78BFA; --mt: rgba(139, 92, 246, .22); --ms: rgba(139, 92, 246, .12); }
[data-theme="dark"] .step-btn:active { background-color: var(--y-tint); }
[data-theme="dark"] .mode-btn[aria-pressed="true"] { background-color: var(--ms); box-shadow: 0 0 0 1px var(--mc), 0 10px 24px -14px var(--mc); }
[data-theme="dark"] .mode-btn[aria-pressed="true"] .mode-ico,
[data-theme="dark"] .mode-tag { color: #0F172B; }

/* Smart Wod : titres dans la version claire de la couleur du mode */
[data-theme="dark"] .wod-card[data-mode] h3 { color: var(--mb); }
[data-theme="dark"] .wod-card.is-wide[data-mode] h3 { color: #F472B6; }

/* Contrôles : la sélection passe au jaune */
[data-theme="dark"] .switch span { background: #334155; }
[data-theme="dark"] .switch input:checked + span { background: var(--y); }
[data-theme="dark"] .switch input:checked + span::after { background: #0F172B; }
[data-theme="dark"] .pick:hover { border-color: #475569; }
[data-theme="dark"] .pick:has(input:checked) { border-color: var(--y); background: rgba(255, 193, 6, .14); color: #fff; }
[data-theme="dark"] .chip:hover,
[data-theme="dark"] .mini-btn:hover { border-color: rgba(255, 255, 255, .45); }
[data-theme="dark"] .chip[aria-pressed="true"] { border-color: var(--y); background: var(--y); color: #0F172B; }
[data-theme="dark"] .seg { background: rgba(0, 0, 0, .3); }
[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--surface-2); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 193, 6, .55); }
[data-theme="dark"] .num,
[data-theme="dark"] .stepper { background: rgba(0, 0, 0, .28); }
[data-theme="dark"] input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(var(--y), var(--y)) 0 / var(--fill) 100% no-repeat, #2A3757; }
[data-theme="dark"] input[type="range"]::-webkit-slider-thumb { border-color: #0A1020; }
[data-theme="dark"] input[type="range"]::-moz-range-track { background: #2A3757; }
[data-theme="dark"] input[type="range"]::-moz-range-progress { background: var(--y); }
[data-theme="dark"] input[type="range"]::-moz-range-thumb { border-color: #0A1020; }
[data-theme="dark"] select.text-input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E2E8F0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
[data-theme="dark"] .step-btn { color: #fff; }

/* Boutons */
[data-theme="dark"] .btn-dark { background: var(--surface-2); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
[data-theme="dark"] .btn-dark:hover { background: #22305A; }
[data-theme="dark"] .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .25); }
[data-theme="dark"] .btn-ghost:hover { border-color: #fff; }
[data-theme="dark"] .cta-dock { background: linear-gradient(to top, var(--bg) 62%, rgba(10, 16, 32, 0)); }

/* Barre d'onglets */
[data-theme="dark"] .tabbar { background: rgba(15, 23, 43, .94); box-shadow: 0 -6px 24px rgba(0, 0, 0, .35); }
[data-theme="dark"] .tab.is-on .tab-ico { color: var(--y); }

/* Listes, tableaux, Heel Raise */
[data-theme="dark"] .block-row .idx { background: #0A1020; }
[data-theme="dark"] .block-row .icon-btn.is-del:hover { background: rgba(239, 68, 68, .15); }
[data-theme="dark"] .table tr.is-final td { color: var(--y); }
[data-theme="dark"] .hr-ring svg circle:first-child { fill: var(--surface-2); stroke: rgba(255, 255, 255, .1); }
[data-theme="dark"] .hr-status[data-tone="up"] { color: var(--y); }
[data-theme="dark"] .hr-status[data-tone="down"] { color: #E2E8F0; }
[data-theme="dark"] .hr-status[data-tone="done"] { color: #4ADE80; }
[data-theme="dark"] .hr-res,
[data-theme="dark"] .table th { background: rgba(0, 0, 0, .25); }
/* Outils : couleur de l'outil aussi sur la piste des curseurs et les textes d'aide */
[data-theme="dark"] .view[data-tool="hr"] { --tct: #FFC106; --tbg: rgba(255, 193, 6, .14); }
[data-theme="dark"] .view[data-tool="pc"] { --tct: #7DD3FC; --tbg: rgba(56, 189, 248, .14); }
[data-theme="dark"] .view[data-tool="va"] { --tct: #C4B5FD; --tbg: rgba(167, 139, 250, .16); }
[data-theme="dark"] .view[data-tool] input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(var(--tc), var(--tc)) 0 / var(--fill) 100% no-repeat, #2A3757; }
[data-theme="dark"] .view[data-tool] input[type="range"]::-moz-range-progress { background: var(--tc); }
[data-theme="dark"] .view[data-tool] .table tr.is-final td { color: var(--tct); }
[data-theme="dark"] .view[data-tool] .seg button[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--tc); }
[data-theme="dark"] .toast { background: var(--surface-2); box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 255, 255, .1); }
