:root {
  --bg: #fff; --fg: #111; --mu: #6b6b6b; --ln: #ececec; --cd: #f6f6f6;
  --or: #FF6A00; --ot: #C2410C; --ob: #FFF1E8; --g: #bdbdbd;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0b0b0b; --fg: #f5f5f5; --mu: #9a9a9a; --ln: #222; --cd: #161616; --ot: #FF8A3D; --ob: #2a1608; --g: #555; }
}
:root[data-theme="dark"] { --bg: #0b0b0b; --fg: #f5f5f5; --mu: #9a9a9a; --ln: #222; --cd: #161616; --ot: #FF8A3D; --ob: #2a1608; --g: #555; color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
/* Badge « Powered by Netlify » injecté par l'hébergeur : il masquait la barre de navigation */
#nl-badge-frame { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.4 Outfit, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
main { padding: max(16px, env(safe-area-inset-top)) 16px 96px; max-width: 760px; margin: 0 auto; }

.muted { color: var(--mu); font-size: 12px; }
.or { color: var(--ot); }
.pad { padding: 16px; }
.h1 { font-size: 28px; font-weight: 300; }
.h1 b { color: var(--or); font-weight: 300; }
.h { font-size: 14px; font-weight: 500; }
.big { font-size: 30px; font-weight: 300; line-height: 1.1; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; margin-bottom: 12px; }

.card { background: var(--cd); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.grid2 .card { margin: 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--ln); }
.row:first-child { border-top: none; }

.btn { height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--ln); background: var(--bg); cursor: pointer; }
.btn.pr { background: var(--or); border-color: var(--or); color: #fff; }
.btn.full { width: 100%; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { height: 34px; min-width: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--ln); background: var(--bg); cursor: pointer; }
.chip.on { background: var(--or); border-color: var(--or); color: #fff; }
.seg { display: flex; background: var(--cd); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; border: none; background: none; color: var(--mu); height: 32px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--bg); color: var(--fg); font-weight: 500; }
input.in, select.in, textarea.in { height: 36px; border-radius: 10px; border: 1px solid var(--ln); background: var(--bg); padding: 0 8px; width: 100%; min-width: 0; font-size: 16px; }
/* iOS donne au champ date une largeur minimale propre : il débordait sur la colonne voisine */
input.in[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; }
input.in[type="date"]::-webkit-date-and-time-value { text-align: left; }
textarea.in { height: auto; min-height: 60px; padding: 8px; resize: vertical; font-size: 14px; }
textarea.code { font-family: ui-monospace, monospace; font-size: 12px; min-height: 180px; }
label.f { display: block; }
label.f .muted { display: block; margin-bottom: 2px; }

/* Séance */
.wu { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 10px; padding: 5px 9px; margin: 0 6px 6px 0; font-size: 13px; }
.wu button { border: none; background: none; color: var(--mu); cursor: pointer; padding: 0; }
.wuadd { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-bottom: 8px; }
.set { display: grid; grid-template-columns: 58px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 40px; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--ln); }
.set.hd { border: none; padding: 2px 0; }
.set .pv { line-height: 1.2; }
.set .pv b { color: var(--fg); font-weight: 500; }
.ck { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--mu); background: none; color: #fff; cursor: pointer; padding: 0; }
.ck.on { background: var(--or); border-color: var(--or); }
.fat { display: flex; gap: 6px; }
.fat .chip { flex: 1; }
#timer { position: fixed; left: 16px; right: 16px; bottom: 84px; max-width: 728px; margin: 0 auto; background: var(--ob); color: var(--ot); border-radius: 14px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
#timer[hidden] { display: none; }
#timer b { font-size: 24px; font-weight: 300; }

/* Graphiques */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; margin-top: 12px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.grp { display: flex; align-items: flex-end; gap: 2px; height: 100%; width: 100%; justify-content: center; }
.grp i { display: block; width: 100%; max-width: 14px; border-radius: 4px 4px 0 0; min-height: 2px; }
.grp i.wide { max-width: 36px; }
.dim { opacity: .45; }
.bar { cursor: pointer; }
.bar.sel > span:last-child { color: var(--fg); font-weight: 500; }

/* Exercice repliable (page Séance) et retour vers « Plus » */
details.ex > summary { list-style: none; cursor: pointer; }
details.ex > summary::-webkit-details-marker { display: none; }
details.ex:not([open]) > summary > p { margin-bottom: 0 !important; }
.back { display: inline-block; text-decoration: none; margin-bottom: 4px; }
@media (min-width: 900px) { .back { display: none; } }
.lg { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; }
.lg i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* Navigation : barre du bas sur mobile, latérale sur ordinateur */
nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; background: var(--bg); border-top: 1px solid var(--ln); padding: 8px 0 max(10px, env(safe-area-inset-bottom)); z-index: 10; }
nav a { text-decoration: none; color: var(--mu); font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
nav a.on { color: var(--or); }
nav .ic { font-size: 20px; line-height: 1; }
nav .logo, nav .desk { display: none; }
/* Téléphone : texte plus grand et cibles tactiles d'au moins 44 px */
@media (max-width: 899px) {
  body { font-size: 17px; }
  main { padding-bottom: 120px; }
  .muted { font-size: 14px; }
  .h { font-size: 16px; }
  .h1 { font-size: 32px; }
  .big { font-size: 34px; }
  .btn { height: 46px; font-size: 16px; padding: 0 16px; }
  .chip { height: 44px; min-width: 52px; font-size: 16px; }
  .seg button { height: 40px; font-size: 15px; }
  input.in, select.in { height: 44px; font-size: 17px; }
  textarea.in { font-size: 16px; }
  .wu { font-size: 15px; padding: 7px 11px; }
  .ck { width: 38px; height: 38px; font-size: 16px; }
  .row { padding: 10px 0; }
  nav { padding: 8px 0 max(12px, env(safe-area-inset-bottom)); }
  nav a { font-size: 12px; gap: 3px; min-width: 56px; }
  nav .ic { font-size: 24px; }
  #timer { bottom: calc(76px + env(safe-area-inset-bottom)); }
  #timer b { font-size: 28px; }
}
@media (min-width: 900px) {
  nav { top: 0; right: auto; width: 180px; flex-direction: column; justify-content: flex-start; gap: 2px; border-top: none; border-right: 1px solid var(--ln); padding: 20px 10px; }
  nav .logo { display: block; font-size: 20px; font-weight: 500; padding: 0 10px 16px; }
  nav .logo span { color: var(--or); }
  nav .desk { display: flex; }
  nav .mob { display: none; }
  nav a { flex-direction: row; gap: 10px; font-size: 14px; padding: 8px 10px; border-radius: 8px; }
  nav a.on { background: var(--cd); }
  nav .ic { font-size: 16px; width: 18px; text-align: center; }
  main { margin-left: 180px; max-width: 980px; padding: 28px 32px 40px; }
  #timer { left: 212px; bottom: 20px; }
}
