/* ============================================================
   Athlete Charge — feuille de style unique
   Identité « programme olympique » : aplats de couleurs systématiques,
   une couleur par catégorie (charge, bien-être, douleur, cycle, Oslo, capteurs),
   la même de la saisie aux graphiques du coach. Titres en Oswald (capitales, style tableau de score), texte et données en Inter.
   Thème clair et sombre pilotés par les réglages du téléphone (le sombre est
   le plus utilisé : saisie le soir, à l'intérieur).
   ============================================================ */
:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --ink: #0e1626;
  --ink-2: #44516a;
  --muted: #687690;
  --line: #dfe4ee;
  --line-strong: #c3ccdb;
  --accent: #1b55bd;
  --accent-soft: #e6eefc;
  --shell: #1b55bd;          /* bandeau du haut, aplat bleu */
  --on-shell: #ffffff;
  --on-shell-2: #d4e1fa;

  /* couleurs des catégories (ordre validé : daltonisme, contraste, clarté) */
  --c-load: #2f6fe0;
  --c-well: #1f9a6c;
  --c-cyc: #9b5bd4;
  --c-pain: #e0702a;
  --c-oslo: #0e93c4;
  --c-ext: #0f8a86;
  --c-event: #44516a;

  --s-load: var(--c-load);
  --s-well: var(--c-well);
  --s-pain: var(--c-pain);
  --s-cyc: var(--c-cyc);
  --s-oslo: var(--c-oslo);

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

  --f-display: "Oswald", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --f-data: "Inter", "Helvetica Neue", Arial, sans-serif;

  --r: 14px;
  --shadow: 0 1px 2px rgba(14, 22, 38, .05), 0 8px 24px -16px rgba(14, 22, 38, .22);

  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: #0f1524; --surface: #182033; --surface-2: #1f293f;
    --ink: #eef2fa; --ink-2: #b3bfd3; --muted: #8e9bb3;
    --line: #29344b; --line-strong: #3b4863;
    --accent: #6b9cf5; --accent-soft: #1d2b4a;
    --shell: #173d8c; --on-shell: #ffffff; --on-shell-2: #c4d5f7;
    --c-load: #5a8ff2; --c-well: #2fb583; --c-cyc: #b07ae6; --c-pain: #e67c38; --c-oslo: #1fa3d4; --c-ext: #26a8a2; --c-event: #8e9bb3;
    --ok-bg: #12261a; --warn-bg: #2d240b; --high-bg: #301619; --on-warn: #f7e6b8;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px -16px rgba(0,0,0,.75);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1524; --surface: #182033; --surface-2: #1f293f;
  --ink: #eef2fa; --ink-2: #b3bfd3; --muted: #8e9bb3;
  --line: #29344b; --line-strong: #3b4863;
  --accent: #6b9cf5; --accent-soft: #1d2b4a;
  --shell: #173d8c; --on-shell: #ffffff; --on-shell-2: #c4d5f7;
  --c-load: #5a8ff2; --c-well: #2fb583; --c-cyc: #b07ae6; --c-pain: #e67c38; --c-oslo: #1fa3d4; --c-ext: #26a8a2; --c-event: #8e9bb3;
  --ok-bg: #12261a; --warn-bg: #2d240b; --high-bg: #301619; --on-warn: #f7e6b8;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px -16px rgba(0,0,0,.75);
  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 .8125rem/1.3 var(--f-body); color: var(--ink-2); }
.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; position: relative;
}
/* zone tactile de 44 px sans agrandir l'en-tête (les onglets sont collés juste dessous) */
.chip-player::after { content: ""; position: absolute; inset: -5px 0; }
.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; min-height: 44px; 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: 44px; height: 44px; 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: 48px; 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; }
/* Mot de la note choisie, à droite du titre (questionnaires bien-être et cycle) */
.qword { font-size: .8125rem; font-weight: 600; padding: .05rem .5rem; border-radius: 99px; color: #fff; background: var(--c, var(--accent)); }
.qword.s1, .qword.f5 { --c: #d64545; }
.qword.s2, .qword.f4 { --c: #e6843a; }
.qword.s3, .qword.f3 { --c: #b08d1a; }
.qword.s4, .qword.f2 { --c: #6a9a3b; }
.qword.s5, .qword.f1 { --c: #2f9e5b; }
.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; min-height: 1em; 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; min-height: 44px; padding: .3rem .875rem; font-size: .875rem; }
.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: 60px; height: 44px; 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: 9px; min-width: 44px; min-height: 44px; padding: .25rem .4rem; font-family: var(--f-data); font-size: .8125rem; color: var(--ink-2); }
/* Échelle de 0 à 10 (effort, douleur, indicateurs personnels) : deux rangées de grandes cibles */
.ten-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .35rem; }
.ten-grid button { height: 44px; font-size: .9375rem; }
.sess-rpe { margin-top: .875rem; }
@media (min-width: 640px) {
  .ten-grid { grid-template-columns: repeat(11, 1fr); }
  #save-line.dirty > .btn.primary { flex: none; }
  #save-line.dirty > .sl-status { flex: 1 1 auto; }
}
.tword { font-size: .8125rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: .05rem .5rem; white-space: nowrap; }
/* Résumé de la journée sous la date */
.daysum { margin: .35rem 0 0; font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* Autre chose aujourd'hui ? (blessure, résultat, voyage, questionnaire de la semaine) */
.events .ev-adds { display: grid; gap: .5rem; }
.events .ev-adds .btn { min-height: 44px; justify-content: flex-start; padding-inline: .875rem; }
.events .ev-open { padding-bottom: .875rem; margin-bottom: .875rem; border-bottom: 1px solid var(--line); display: grid; gap: .5rem; }
.events .ev-hd { display: flex; align-items: center; gap: .5rem; }
.events .ev-hd .sub-h { margin: 0; }
.events .ev-del { min-height: 44px; font-size: .8125rem; color: var(--muted); }
.events .ev-in { width: 100%; height: 44px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 .75rem; font-size: 1rem; }
.events .ev-row { display: flex; align-items: center; gap: .75rem; margin-top: .875rem; padding-top: .875rem; border-top: 1px solid var(--line); }
.events .ev-row .who { flex: 1; min-width: 0; }
.events .ev-row .nm { font-weight: 600; font-size: .9rem; }
.events .ev-row .btn { min-height: 44px; }
.del { margin-left: .25rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font-size: .8125rem; min-height: 44px; padding: 0 .75rem; }

.btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; min-height: 44px; 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, .sq-hd .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; }
/* Indicateurs personnalisés */
.ind-item + .ind-item { border-top: 1px solid var(--line); margin-top: .75rem; padding-top: .75rem; }
.ind-row, .imp-row { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.ind-row .who, .imp-row .who { flex: 1; min-width: 0; }
.ind-row .nm, .imp-row .nm { font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; overflow-wrap: anywhere; }
.ind-row:last-of-type { border-bottom: 0; }
.ind-row.off .nm, .ind-row.off .ind-name { opacity: .55; }
.ind-row .ind-del { height: 34px; padding: 0 .7rem; font-size: .8125rem; }
.ind-name { width: 100%; height: 36px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink); font-weight: 600; font-size: .9rem; padding: 0 .45rem; margin-left: -.45rem; }
.ind-name:hover, .ind-name:focus { border-color: var(--line-strong); background: var(--surface); }
.card-hd .count { font-size: .75rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: .1rem .5rem; }
.ind-detail { width: 100%; margin-top: .5rem; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 .6rem; font-size: .875rem; }
.ind-row .rec { font-size: .6875rem; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-radius: 99px; padding: .05rem .45rem; }
.ind-add { margin-top: .5rem; flex-wrap: wrap; }
.ind-add input { flex: 1; min-width: 8rem; height: 40px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 .6rem; }
.ind-add input.unit { flex: 0 0 6rem; min-width: 5rem; }
.ind-sel { height: 40px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 .5rem; max-width: 100%; }
.ind-add .ind-sel { flex: 1; min-width: 12rem; }
.imp-row .ind-sel { flex: 0 1 15rem; min-width: 0; }
/* Capteurs : choix du capteur */
.sensor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: .75rem; }
.sensor { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .9rem .5rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: center; }
.sensor.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.sensor .logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 800 1.1rem var(--f-display); background: var(--ink); color: var(--surface); }
.sensor .nm { font-weight: 700; }
.sensor .st { font-size: .7rem; color: var(--muted); }
.sensor .st.ok { color: var(--ok); font-weight: 600; }
.file-btn { display: inline-flex; align-items: center; margin-top: .6rem; position: relative; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Mes joueurs : tableau sur grand écran, fiches sur téléphone */
.squad-cards { display: none; }
@media (max-width: 640px) {
  .squad-tbl { display: none; }
  .squad-cards { display: grid; gap: .625rem; }
}
.sq-card { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: .75rem; }
.sq-card:active { background: var(--surface-2); }
.sq-hd { display: flex; align-items: center; gap: .6rem; }
.sq-who { flex: 1; min-width: 0; }
.sq-who .nm { font-weight: 700; font-size: .9375rem; color: var(--accent); overflow-wrap: anywhere; }
.sq-who .hint { font-size: .75rem; }
.sq-alerts { margin-top: .5rem; }
.sq-alerts .achip { max-width: none; }
.sq-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .6rem; }
.sq-stat { background: var(--surface-2); border-radius: 8px; padding: .35rem .5rem; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.sq-stat .k { font-size: .6875rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-stat b { font-size: .875rem; font-weight: 600; }
.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; }
/* barre fixe : le statut sur sa ligne, Annuler et Enregistrer côte à côte dessous */
.saveline.dirty > .sl-status { flex-basis: 100%; }
.saveline.dirty > .spacer { display: none; }
.saveline.dirty > .btn.primary { flex: 1; }
.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; }

/* Partie dépliable dans une carte (autorisations d'un coach, profil cycle, réglage de chaque notification) */
.fold { border-top: 1px solid var(--line); margin-top: .5rem; }
.fold > summary { cursor: pointer; padding: .65rem 0; font-weight: 600; font-size: .9375rem; color: var(--accent); list-style-position: inside; }
.fold > .fold-body { padding-bottom: .5rem; }
.plist .fold { margin: 0 0 .5rem; border-top: 0; }
.plist .fold > summary { padding: .25rem 0 .5rem; font-size: .875rem; }
/* Notifications : un interrupteur et son heure */
.notif-item + .notif-item { border-top: 1px solid var(--line); }
.alert-items { margin: 0 0 .75rem; padding: .6rem .875rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.alert-grp + .alert-grp { border-top: 1px solid var(--line); }
.alert-grp > .switch-row .t { font-size: .875rem; }
.alert-sub { padding-left: 1rem; border-left: 2px solid var(--line); margin: 0 0 .5rem .25rem; }
.alert-sub .switch-row { padding: .25rem 0; }
.alert-sub .switch-row .t { font-weight: 500; font-size: .8125rem; }
.notif-hm { display: flex; align-items: center; gap: .5rem; padding: 0 0 .6rem; font-size: .8125rem; color: var(--muted); }
.hm-in { height: 34px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 .4rem; font-family: var(--f-data); }

/* 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 croisée : jours M et impact moyen par joueur */
.mdays-row + .mdays-row { border-top: 1px solid var(--line); margin-top: .75rem; padding-top: .75rem; }
.mdays-hd { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.mdays-hd i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.mdays-hd .hint { margin-left: auto; }
.mdays-imp { margin-top: .6rem; display: grid; gap: .3rem; max-width: 460px; }
.mdays-bar { display: grid; grid-template-columns: 6.5rem 1fr 3.2rem; align-items: center; gap: .5rem; font-size: .8125rem; }
.mdays-bar .track { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.mdays-bar .track i { display: block; height: 100%; border-radius: 99px; }
.mdays-bar i.m { background: var(--high); }
.mdays-bar i.h { background: var(--line-strong); }
.mdays-bar b { text-align: right; }

/* 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; }

/* ------------------------------------------------ couleurs des catégories */
.cat-load { --cat: var(--c-load); }
.cat-well { --cat: var(--c-well); }
.cat-pain { --cat: var(--c-pain); }
.cat-cyc { --cat: var(--c-cyc); }
.cat-oslo { --cat: var(--c-oslo); }
.cat-ext { --cat: var(--c-ext); }
.cat-event { --cat: var(--c-event); }

/* ------------------------------------------------ identité : bandeau, cartes, catégories */
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
html { accent-color: var(--accent); caret-color: var(--accent); }
body { font-feature-settings: "tnum" 0; }
h1, h2, h3 { letter-spacing: -.02em; }
.num, .total .v, .daysum, .ten-grid button, .scale button, .mins input { font-variant-numeric: tabular-nums; }

/* le bandeau du haut est un aplat bleu : la couleur de la marque porte l'en-tête */
body::before { background: var(--shell); }
.topbar { background: var(--shell); color: var(--on-shell); border-bottom: 0; }
.brand { color: var(--on-shell); font-size: 1.0625rem; letter-spacing: -.025em; }
.brand span { color: var(--on-shell-2); }
.chip-player { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .22); color: var(--on-shell); }
.chip-player .av { background: #fff; color: var(--shell); }
.tabs { box-shadow: 0 1px 0 var(--line); border-bottom: 0; }
.tab { border-bottom-width: 3px; }
.tab[aria-selected="true"] { color: var(--accent); }

.card { border-radius: var(--r); box-shadow: var(--shadow); }
:root:not([data-theme="dark"]) .card { border-color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card { border-color: var(--line); box-shadow: none; } }
:root[data-theme="dark"] .card { border-color: var(--line); box-shadow: none; }

/* chaque catégorie : sa couleur pour la sélection et les badges */
[class*="cat-"] { --cat-soft: color-mix(in srgb, var(--cat) 15%, var(--surface)); --cat-ink: color-mix(in srgb, var(--cat) 72%, var(--ink)); }
.card[class*="cat-"] > .card-hd, details.card[class*="cat-"] > summary { align-items: center; }
.card[class*="cat-"] .card-hd .hint { margin-left: auto; }
.card[class*="cat-"] .types button[aria-pressed="true"],
.card[class*="cat-"] .seg button[aria-pressed="true"] { background: var(--cat-soft); border-color: var(--cat); color: var(--cat-ink); }
.card[class*="cat-"] .scale:not(.well):not(.fat) button[aria-pressed="true"] { background: var(--cat); border-color: var(--cat); color: #fff; font-weight: 600; }
.card[class*="cat-"] .tword { background: var(--cat-soft); color: var(--cat-ink); }
.card[class*="cat-"] .card-hd .count { background: var(--cat-soft); color: var(--cat-ink); }

/* hiérarchie des chiffres */
.total .v { font-weight: 800; letter-spacing: -.035em; }
.datebar .d-day { font-weight: 800; letter-spacing: -.03em; }
.daysum { color: var(--ink-2); font-weight: 500; }
.btn.primary { box-shadow: 0 1px 0 rgba(255,255,255,.12) inset; }

/* ------------------------------------------------ typographie : Oswald pour les titres, Inter pour le reste */
h1, h2, .datebar .d-day, .brand { font-family: var(--f-display); font-weight: 600; letter-spacing: .01em; }
h2 { text-transform: uppercase; font-size: 1.125rem; letter-spacing: .03em; }
h3 { font-family: var(--f-body); font-weight: 600; letter-spacing: -.01em; }
.datebar .d-day { font-size: 1.625rem; text-transform: uppercase; letter-spacing: .02em; }
.brand { font-size: 1.25rem; text-transform: uppercase; letter-spacing: .04em; }
/* grands chiffres : Oswald à chasse fixe, les colonnes ne dansent pas */
.total .v, .hero .big { font-family: var(--f-display); font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums lining-nums; }
.total .v { font-size: 2.125rem; }
/* Oswald jamais sous 14 px : les petits libellés restent en Inter */
.eyebrow, .hint, .count, .scale-ends, th { font-family: var(--f-body); }
body, input, textarea, select, button { font-feature-settings: "cv11", "ss01"; }
.num, td, .ten-grid button, .scale button, svg text { font-variant-numeric: tabular-nums; }

/* alertes jaunes : texte lisible en sombre comme en clair, fond plus franc */
.banner.warn { border-color: color-mix(in oklab, var(--warn) 55%, transparent); font-weight: 500; }
.banner.warn .hint { color: color-mix(in srgb, var(--on-warn) 78%, transparent); font-weight: 400; }
.banner.warn .btn { background: var(--surface); }
/* cycle : la légende tient dans une quatrième boîte, à côté des chiffres */
.kpi-legend .cyc-legend { margin: .35rem 0 .3rem; gap: .2rem .75rem; flex-wrap: wrap; font-size: .8125rem; }
