/* ============================================================
   Athlete Charge — feuille de style unique
   Mise en page : une colonne de cartes, barre d'onglets collée en haut.
   Thème clair et sombre pilotés par les réglages du téléphone.
   ============================================================ */
:root {
  --bg: #f1f4f9;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --ink: #101620;
  --ink-2: #4b5666;
  --muted: #78859a;
  --line: #e1e7f0;
  --line-strong: #c9d2e0;
  --accent: #1b55bd;
  --accent-soft: #e8effc;

  /* séries des graphiques (bande de clarté, chroma, séparation daltonisme et contraste vérifiés) */
  --s-load: #2a78d6;
  --s-well: #1baf7a;
  --s-pain: #eb6834;

  /* états : jamais portés par la couleur seule, toujours avec icône et texte */
  --ok: #0ca30c;
  --warn: #fab219;
  --high: #d03b3b;
  --ok-bg: #e8f7e8;
  --warn-bg: #fdf3dc;
  --high-bg: #fbe9e9;
  --on-warn: #10160a;

  --f-display: "Chivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --f-data: "Chivo Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r: 12px;
  --shadow: 0 1px 2px rgba(16, 22, 32, .06), 0 6px 20px -12px rgba(16, 22, 32, .18);

  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1116; --surface: #161a21; --surface-2: #1c222b;
    --ink: #eef2f8; --ink-2: #aeb9c9; --muted: #8593a6;
    --line: #262d38; --line-strong: #3a4553;
    --accent: #78a8f8; --accent-soft: #1b2535;
    --s-load: #3987e5; --s-well: #199e70; --s-pain: #d95926;
    --ok-bg: #12240f; --warn-bg: #2b2208; --high-bg: #2d1414;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -14px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1116; --surface: #161a21; --surface-2: #1c222b;
  --ink: #eef2f8; --ink-2: #aeb9c9; --muted: #8593a6;
  --line: #262d38; --line-strong: #3a4553;
  --accent: #78a8f8; --accent-soft: #1b2535;
  --s-load: #3987e5; --s-well: #199e70; --s-pain: #d95926;
  --ok-bg: #12240f; --warn-bg: #2b2208; --high-bg: #2d1414;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -14px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--f-body);
  -webkit-text-size-adjust: 100%;
  padding-bottom: 3rem;
  overscroll-behavior-y: none;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface);
}
img { max-width: 100%; }
[hidden] { display: none !important; }

.wrap {
  max-width: 740px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap.lg { max-width: 980px; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 800; margin: 0; text-wrap: balance; letter-spacing: -.015em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.0625rem; }
h3 { font-size: .9375rem; font-weight: 600; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:where(button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
.num { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.hint { color: var(--muted); font-size: .8125rem; }
.eyebrow { font: 600 .6875rem/1 var(--f-body); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------------------------------------------------------- démarrage */
.boot { display: grid; place-items: center; gap: .75rem; min-height: 70vh; color: var(--muted); text-align: center; padding: 1rem; }
.boot-mark { color: var(--line-strong); }

/* ------------------------------------------------------------ en-tête */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: .625rem; padding-block: .625rem; max-width: 980px; }
.brand { font-family: var(--f-display); font-weight: 800; font-size: 1rem; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.chip-player {
  display: inline-flex; align-items: center; gap: .4rem; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 99px; padding: .3rem .625rem .3rem .4rem;
  font-weight: 600; font-size: .875rem; max-width: 50vw;
}
.chip-player .av { width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; background: var(--accent); color: #fff; font: 600 .6875rem var(--f-body); flex: none; }
.chip-player .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; color: var(--on-warn); background: var(--warn-bg); border-radius: 99px; padding: .2rem .5rem; }

.tabs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 45px); z-index: 19; border-bottom: 1px solid var(--line); background: var(--surface); }
.tabs .wrap { display: flex; gap: .25rem; padding-block: 0; max-width: 980px; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: .625rem .125rem; margin-right: 1.25rem; font-weight: 600; font-size: .9375rem; color: var(--muted); white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

/* -------------------------------------------------------------- cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; margin-top: .875rem; }
.card-hd { display: flex; align-items: baseline; gap: .625rem; margin-bottom: .875rem; }

/* ------------------------------------------------------------ connexion */
.auth { max-width: 420px; margin: 0 auto; padding-top: 2rem; }
.auth-mark { display: grid; place-items: center; margin-bottom: 1rem; }
.auth-mark i { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.auth h1 { text-align: center; }
.auth .lead { text-align: center; color: var(--ink-2); font-size: .9375rem; margin: .5rem 0 1.5rem; }
.field { display: grid; gap: .3rem; margin-bottom: .75rem; }
.field label { font-weight: 600; font-size: .8125rem; }
.field input, .field select {
  height: 46px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); padding: 0 .75rem; font: inherit; font-size: .9375rem; width: 100%;
}
.seg { display: flex; gap: .375rem; }
.seg button {
  flex: 1; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px;
  padding: .625rem .5rem; font-weight: 600; font-size: .875rem; color: var(--ink-2); text-align: center;
}
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.seg .sub { display: block; font-weight: 400; font-size: .75rem; color: var(--muted); margin-top: .125rem; }
.seg button[aria-pressed="true"] .sub { color: inherit; opacity: .85; }
.auth-err { background: var(--high-bg); color: var(--high); border-radius: 10px; padding: .625rem .75rem; font-size: .8125rem; margin-bottom: .75rem; display: flex; gap: .5rem; align-items: flex-start; }
.auth-switch { text-align: center; margin-top: 1rem; font-size: .875rem; color: var(--ink-2); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* -------------------------------------------------------------- saisie */
.datebar { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; }
.datebar .d-main { flex: 1; min-width: 0; }
.datebar .d-day { font-family: var(--f-display); font-weight: 800; font-size: 1.375rem; letter-spacing: -.02em; }
.datebar .d-sub { color: var(--muted); font-size: .8125rem; }
.icon-btn { width: 36px; height: 36px; flex: none; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; }
.icon-btn:disabled { opacity: .35; cursor: default; }

.row-lbl { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .375rem; }
.row-lbl .nm { font-weight: 600; font-size: .875rem; }
.row-lbl .ex { color: var(--muted); font-size: .75rem; margin-left: auto; text-align: right; }

.scale { display: flex; gap: .3rem; }
.scale button { flex: 1; min-width: 0; height: 42px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); font-family: var(--f-data); font-size: .9375rem; color: var(--ink-2); }
.scale button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }

/* Questionnaire bien-être : de rouge (1) à vert (5), pour que 5 se lise comme positif */
.scale.well button.s1 { --c: #d64545; }
.scale.well button.s2 { --c: #e6843a; }
.scale.well button.s3 { --c: #c9a227; }
.scale.well button.s4 { --c: #7fb34a; }
.scale.well button.s5 { --c: #2f9e5b; }
.scale.well button { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); background: color-mix(in srgb, var(--c) 12%, var(--surface-2)); color: var(--ink); }
.scale.well button[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.scale-ends { display: flex; justify-content: space-between; font-size: .6875rem; color: var(--muted); margin-top: .3rem; }
.pain-ends { display: flex; justify-content: space-between; font-size: .6875rem; color: var(--muted); margin-top: .3rem; }
.consent { display: flex; gap: .5rem; align-items: flex-start; font-size: .8125rem; color: var(--ink-2); margin: .5rem 0; line-height: 1.4; }
.consent input { margin-top: .2rem; flex: 0 0 auto; }
.danger-zone { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .875rem; }
.scale.tight button { height: 36px; font-size: .8125rem; }

.wq { display: grid; gap: .75rem; }
.wq .item + .item { border-top: 1px solid var(--line); padding-top: .75rem; }

.sess { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; background: var(--surface-2); }
.sess + .sess { margin-top: .5rem; }
.sess-hd { display: flex; align-items: center; gap: .5rem; margin-bottom: .625rem; }
.sess-hd .n { font-weight: 600; font-size: .8125rem; color: var(--muted); }
.sess-hd .load { margin-left: auto; font-family: var(--f-data); font-size: .8125rem; color: var(--ink-2); }
.types { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .625rem; }
.types button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: .3rem .625rem; font-size: .8125rem; }
.types button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.mins { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.mins input { width: 72px; height: 36px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 .5rem; font-family: var(--f-data); font-size: .9375rem; }
.mins .preset { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: .25rem .5rem; font-family: var(--f-data); font-size: .8125rem; color: var(--ink-2); }
.rpe-legend { margin-top: .375rem; font-size: .8125rem; color: var(--ink-2); min-height: 1.25em; }
.del { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: .8125rem; padding: .25rem; }

.btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: .5rem .875rem; font-weight: 600; font-size: .875rem; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { border-color: var(--high); color: var(--high); }
.btn.wide { width: 100%; display: block; }
.btn.lg { height: 48px; font-size: .9375rem; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.rest { display: flex; align-items: center; justify-content: center; gap: .5rem; height: 46px; }
.btn.rest[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }

.total { display: flex; align-items: baseline; gap: .5rem; margin-top: .875rem; padding-top: .875rem; border-top: 1px solid var(--line); }
.total .v { font-family: var(--f-display); font-weight: 800; font-size: 1.75rem; letter-spacing: -.03em; }
.total .u { color: var(--muted); font-size: .8125rem; }
.saveline { display: flex; align-items: center; gap: .5rem; margin-top: .875rem; font-size: .8125rem; color: var(--muted); min-height: 1.5rem; }
textarea.note { width: 100%; min-height: 54px; resize: vertical; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: .5rem .625rem; font: inherit; font-size: .875rem; }

/* --------------------------------------------------------- indicateur */
.pill { display: inline-flex; align-items: center; gap: .375rem; border-radius: 99px; padding: .25rem .625rem; font-weight: 600; font-size: .8125rem; white-space: nowrap; }
.pill svg { flex: none; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--on-warn); }
.pill.high { background: var(--high-bg); color: var(--high); }
.pill.info { background: var(--surface-2); color: var(--ink-2); }

.hero { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; align-items: flex-end; }
.hero .big { font-family: var(--f-display); font-weight: 800; font-size: 2.75rem; line-height: .95; letter-spacing: -.04em; }
.hero .side { display: grid; gap: .5rem; }
.delta { display: inline-flex; align-items: center; gap: .3rem; font-family: var(--f-data); font-size: .9375rem; }

.gauge { margin-top: 1.125rem; }
.gauge-wrap { position: relative; }
.gauge-val { position: absolute; top: 15px; transform: translateX(-50%); font-size: .6875rem; font-weight: 500; color: var(--ink); background: var(--surface); padding: 0 .25rem; }
.gauge-track { position: relative; height: 10px; border-radius: 99px; overflow: hidden; display: flex; }
.gauge-track i { display: block; height: 100%; }
.gauge-marks { position: relative; height: 2.5rem; margin-top: .25rem; }
.gauge-marks b { position: absolute; top: 1.75rem; transform: translateX(-50%); font-family: var(--f-data); font-size: .6875rem; color: var(--muted); font-weight: 400; }
.gauge-cursor { position: absolute; top: -3px; width: 4px; height: 16px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); transform: translateX(-2px); z-index: 2; }
.gauge-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .5rem; font-size: .75rem; color: var(--muted); }
.gauge-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.gauge-legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }

.alerts { display: grid; gap: .5rem; }
.alert { display: flex; gap: .625rem; padding: .75rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.alert.l-high { background: var(--high-bg); border-color: color-mix(in oklab, var(--high) 35%, transparent); }
.alert.l-warn { background: var(--warn-bg); border-color: color-mix(in oklab, var(--warn) 45%, transparent); }
/* v27 : niveau info (ex. jours à remplir) : fond teinté et icône visibles, sur clair comme sur sombre */
.alert.l-info { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 40%, transparent); color: var(--ink); }
.alert.l-info .ic { color: var(--accent); }
.alert.l-high .ic { color: var(--high); }
.alert.l-warn .ic { color: var(--warn); }
.alert .t, .alert .b { color: var(--ink); }
.alert .b { color: var(--ink-2); }
.alert .ic { flex: none; margin-top: .125rem; }
.alert .t { font-weight: 600; font-size: .875rem; }
.alert .b { font-size: .8125rem; color: var(--ink-2); margin-top: .125rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; }
.kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .625rem .75rem; }
.kpi .k { font: 600 .6875rem/1.2 var(--f-body); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kpi .v { font-size: 1.1875rem; font-weight: 600; margin-top: .25rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .s { font-size: .75rem; color: var(--muted); }

/* -------------------------------------------------------- graphiques */
.range { display: flex; gap: .25rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.range button { border: 0; background: none; border-radius: 7px; padding: .3rem .625rem; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.range button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: .25rem .875rem; margin-bottom: .5rem; font-size: .75rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .375rem; }
.legend i { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.legend i.bar { width: 9px; height: 9px; border-radius: 2px; }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--ink-2) 0 4px, transparent 4px 7px); }
.sub-h { margin: 1.125rem 0 .5rem; color: var(--ink-2); font-size: .8125rem; font-weight: 600; }
.card > .sub-h:first-of-type { margin-top: .25rem; }
.tip { position: absolute; pointer-events: none; z-index: 5; min-width: 110px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; box-shadow: var(--shadow); padding: .5rem .625rem; font-size: .75rem; transform: translate(-50%, -100%); }
.tip .d { color: var(--muted); margin-bottom: .25rem; }
.tip .r { display: flex; align-items: center; gap: .375rem; white-space: nowrap; }
.tip .r b { font-family: var(--f-data); font-weight: 500; margin-left: auto; }
.tip i { width: 8px; height: 8px; border-radius: 2px; flex: none; }

table.tbl { width: 100%; border-collapse: collapse; font-size: .8125rem; }
table.tbl th { text-align: left; font: 600 .6875rem/1.2 var(--f-body); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: .5rem .5rem .5rem 0; border-bottom: 1px solid var(--line); }
table.tbl td { padding: .625rem .5rem .625rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl td.n { font-variant-numeric: tabular-nums; }  /* police de texte : la chasse fixe donne une case pleine au séparateur de milliers */
.scroll-x { overflow-x: auto; }
.cellbtn { border: 0; background: none; padding: 0; font-weight: 600; text-align: left; }

/* ------------------------------------------------------- coach / liens */
.plist { display: grid; gap: .5rem; }
.prow { display: flex; align-items: center; gap: .625rem; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: .625rem .75rem; }
.prow .av { width: 32px; height: 32px; border-radius: 99px; display: grid; place-items: center; background: var(--accent); color: #fff; font: 600 .8125rem var(--f-body); flex: none; }
.prow .who { min-width: 0; flex: 1; }
.prow .who .nm { font-weight: 600; font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .who .sb { font-size: .75rem; color: var(--muted); }
.code-box { display: flex; align-items: center; gap: .75rem; background: var(--accent-soft); border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent); border-radius: 10px; padding: .875rem 1rem; }
.code-box .code { font-family: var(--f-data); font-size: 1.5rem; font-weight: 500; letter-spacing: .14em; color: var(--accent); }
.add { display: flex; gap: .5rem; }
.add input { flex: 1; min-width: 0; height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 .75rem; font: inherit; font-size: .9375rem; }
.add input.code-in { font-family: var(--f-data); letter-spacing: .12em; text-transform: uppercase; }

.empty { text-align: center; padding: 2rem 1rem; }
.empty .ill { color: var(--line-strong); margin-bottom: .75rem; }
.empty h2 { margin-bottom: .375rem; }
.empty p { color: var(--ink-2); font-size: .875rem; max-width: 38ch; margin: 0 auto 1rem; }

.banner { display: flex; gap: .625rem; align-items: flex-start; margin-top: .875rem; padding: .625rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: .8125rem; color: var(--ink-2); }
.banner.warn { background: var(--warn-bg); border-color: color-mix(in oklab, var(--warn) 45%, transparent); color: var(--on-warn); }
.banner .ic { flex: none; margin-top: .125rem; }

.backlink { display: inline-flex; align-items: center; gap: .375rem; background: none; border: 0; padding: .5rem 0; color: var(--accent); font-weight: 600; font-size: .875rem; }

/* ------------------------------------------------------------- divers */
.sheet-bd { position: fixed; inset: 0; background: rgba(8,12,18,.5); z-index: 40; }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0;
  background: var(--surface); border-radius: 14px 14px 0 0; border-top: 1px solid var(--line);
  box-shadow: var(--shadow); max-height: 82vh; overflow-y: auto;
  padding: 1rem max(16px, env(safe-area-inset-right,0px)) calc(1rem + env(safe-area-inset-bottom,0px)) max(16px, env(safe-area-inset-left,0px));
}
@media (min-width: 620px) { .sheet { left: 50%; right: auto; bottom: auto; top: 12vh; transform: translateX(-50%); width: 440px; border-radius: 14px; } }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 50;
  background: var(--ink); color: var(--bg); border-radius: 99px;
  padding: .5rem 1rem; font-size: .8125rem; font-weight: 600; box-shadow: var(--shadow); max-width: 90vw; text-align: center;
}
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: rise .22s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
}
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 99px; }
@media (prefers-reduced-motion: no-preference) { .spin { animation: sp .7s linear infinite; } @keyframes sp { to { transform: rotate(360deg); } } }

/* Fatigue du trajet : de vert (1) à rouge (5 = maximale) */
.scale.fat button.f1 { --c: #2f9e5b; }
.scale.fat button.f2 { --c: #7fb34a; }
.scale.fat button.f3 { --c: #c9a227; }
.scale.fat button.f4 { --c: #e6843a; }
.scale.fat button.f5 { --c: #d64545; }
.scale.fat button { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); background: color-mix(in srgb, var(--c) 12%, var(--surface-2)); color: var(--ink); }
.scale.fat button[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }

/* Phases du suivi : une case par jour, couleur selon la phase, trait rouge si blessure */
.phase-strip { display: flex; gap: 1px; height: 22px; border-radius: 6px; overflow: hidden; margin: .625rem 0 .25rem; }
.phase-strip .ph { flex: 1 1 0; min-width: 1px; background: transparent; }
.phase-strip .ph-none { background: var(--surface-2); }
.phase-strip .ph-comp { background: #e0662b; }
.phase-strip .ph-train { background: #2f6fd6; }
.phase-strip .ph-reed { background: #1f9e8a; }
.phase-strip .ph-low { background: #b8c0cc; }
.phase-strip .ph.inj { box-shadow: inset 0 -5px 0 #d64545; }
.ph-mk { display: flex; gap: 1px; font-size: 11px; line-height: 1.3; margin-bottom: .625rem; }
.ph-mk .mk { flex: 1 1 0; min-width: 0; text-align: center; overflow: hidden; white-space: nowrap; }
.ph-legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .8125rem; color: var(--ink-2); margin: .5rem 0 .25rem; }
.ph-legend .lg { display: inline-flex; align-items: center; gap: .35rem; }
.ph-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.ph-comp { background: #e0662b; }
.sw.ph-train { background: #2f6fd6; }
.sw.ph-reed { background: #1f9e8a; }
.sw.ph-low { background: #b8c0cc; }
.sw.inj { background: #d64545; }
.ph-events { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .875rem; }
.ph-events li { display: flex; gap: .625rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.ph-events .d { font-family: var(--f-data); color: var(--muted); min-width: 3.2rem; }

/* survol d'une semaine dans le suivi : invite au clic (coach) */
.wk-hit { cursor: pointer; }
.wk-hit:hover { fill: color-mix(in oklab, var(--accent) 10%, transparent); }

/* choix de la langue */
.lang-pick { display: inline-flex; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--muted); margin: .25rem 0 .75rem; }
.lang-sel { height: 34px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 .5rem; font: inherit; }

/* ---------------------------------------------------- périodes : curseurs */
.per { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }
.per-units { display: flex; gap: .25rem; background: var(--surface-2); padding: .25rem; border-radius: 10px; }
.per-unit { flex: 1 1 auto; min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: .8125rem; font-weight: 600; padding: .25rem .4rem; cursor: pointer; white-space: nowrap; }
.per-unit[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.per-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: .25rem; }
.per-lbl { font-size: .875rem; color: var(--muted); }
.per-val { font-family: var(--f-data); font-size: 1.0625rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.per-slider { width: 100%; height: 40px; margin: 0; accent-color: var(--accent); touch-action: pan-y; }
.per-ticks { display: flex; justify-content: space-between; font-family: var(--f-data); font-size: .75rem; color: var(--muted); margin-top: -.5rem; }
.per-dates { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; margin-top: .4rem; }
.per-date { display: flex; flex-direction: column; gap: .25rem; font-size: .8125rem; color: var(--muted); }
.per-date input { height: 38px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 .5rem; font-family: var(--f-data); }

/* onglets : les trois tiennent sur un téléphone, sans rogner le dernier libellé */
.tabs .wrap { justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
.tabs .wrap::-webkit-scrollbar { display: none; }
.tab { margin-right: 0; flex: none; }
@media (max-width: 420px) { .tab { font-size: .875rem; padding-inline: .125rem; } }

/* ---------------------------------------------------- alertes visibles dans la liste coach */
.achip { display: block; font-size: .75rem; line-height: 1.35; padding: .2rem .45rem; border-radius: 6px; margin: .15rem 0; border-left: 3px solid var(--warn); background: var(--warn-bg); color: var(--ink); max-width: 340px; }
.achip.l-high { border-left-color: var(--high); background: var(--high-bg); }
.achip.l-info { border-left-color: var(--line-strong); background: var(--surface-2); }
.achip b { font-weight: 600; }
.alert-cell { min-width: 180px; }
.wk-hit { cursor: pointer; }

/* barre d'enregistrement : reste visible en bas tant que la journée n'est pas enregistrée */
.saveline { flex-wrap: wrap; }
.saveline.dirty { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: .625rem 0 calc(.625rem + env(safe-area-inset-bottom, 0px)); z-index: 5; }

/* v22 : tableaux « Mes joueurs » sans retour à la ligne ; alertes et bannières lisibles sur téléphone */
table.tbl td { white-space: nowrap; }
table.tbl td.alert-cell { white-space: normal; }
.alert > div, .banner > div { min-width: 0; overflow-wrap: anywhere; }
.alert .t { font-size: .9375rem; line-height: 1.3; }
.alert .b { font-size: .875rem; }

/* Puces : filtres d'affichage, autorisations du coach */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips-ev { margin-bottom: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 36px; padding: .3rem .75rem; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font: inherit; font-size: .875rem; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.chip-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.chip:disabled { opacity: .5; cursor: not-allowed; }
/* Autorisations du coach : liste d’interrupteurs regroupés */
.share-list { display: flex; flex-direction: column; gap: .75rem; margin: .5rem 0 .75rem; }
.sl-group { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.sl-t { padding: .45rem .875rem; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sl-group .switch-row { padding: .5rem .875rem; min-height: 48px; }
.sl-group .switch-row + .switch-row { border-top: 1px solid var(--line); }
.sl-group .switch-row .t { font-weight: 500; }

/* Interrupteur on/off */
.switch-row { display: flex; align-items: center; gap: .875rem; padding: .5rem 0; }
.switch-row .sr-text { flex: 1; min-width: 0; }
.switch-row .t { font-weight: 600; font-size: .9375rem; }
.switch-row .b { font-size: .8125rem; color: var(--muted); margin-top: .15rem; }
.switch { position: relative; flex: none; width: 52px; height: 32px; border: 0; border-radius: 99px; background: var(--line-strong); cursor: pointer; transition: background .15s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.switch:focus-visible, .chip:focus-visible, .per-unit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Réglages : suivi du cycle menstruel */
.cyc-consent { margin: 0 0 .75rem; }
.cyc-switch { padding: .125rem 0 .25rem; }
.cyc-profile { margin-top: .75rem; padding: .875rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.cp-hd { display: flex; align-items: center; gap: .5rem; }
.cp-hd h3 { margin: 0; font-size: .9375rem; font-weight: 600; }
.badge-private { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 99px; padding: .05rem .45rem; }
.cyc-profile > .hint { margin: .25rem 0 .75rem; }
.cp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 .75rem; }
.cp-dis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .35rem .75rem; margin: .25rem 0 .875rem; }

/* Suivi : jours de règles (une case par jour, rouge = règles) */
.cyc-days { display: flex; flex-wrap: wrap; gap: 3px; margin-top: .25rem; }
.cyc-days span { width: 11px; height: 11px; border-radius: 3px; background: var(--line); }
.cyc-days span.m { background: var(--high); }
.cyc-legend { display: flex; gap: 1rem; margin: .5rem 0 0; font-size: .8rem; color: var(--ink-2); }
.cyc-legend > span { display: inline-flex; align-items: center; gap: .35rem; }
.cyc-legend i { width: 11px; height: 11px; border-radius: 3px; background: var(--line); display: inline-block; }
.cyc-legend i.m { background: var(--high); }

/* Analyse (coach) : un graphique par joueur, comme son suivi */
.pl-chart + .pl-chart { margin-top: 1rem; padding-top: .875rem; border-top: 1px solid var(--line); }
.pl-chart-hd { display: flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .9375rem; margin-bottom: .35rem; }
.pl-chart-hd i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
