/* Starman, piste « Plateaux » (phase 10, décision D15).
   Couleurs des disques de compétition : le bleu du 20 kg pour les actions, le jaune du 15 kg
   pour « en cours » (et le focus en thème sombre ; en clair, il n'atteint pas 3:1) ; les autres couleurs ne servent qu'à la barre chargée.
   Polices du système uniquement (W7) ; aucune couleur de jugement sur le poids (T4). */
:root {
  --mat: #e6e9ec;
  --panel: #f8f9fa;
  --ink: #14181c;
  --muted: #545e68;
  --line: #c9d0d6;
  --action: #1646c8;
  --action-ink: #ffffff;
  --link: #1646c8;
  --ok-bg: #dff1e6;
  --ok-ink: #14532d;
  --alert-bg: #fbe3e1;
  --alert-ink: #7a1712;
  --p25: #d22630;
  --p20: #1646c8;
  --p15: #f2b400;
  --p10: #1b8a4b;
  --p5: #f4f4ef;
  --metal: #a9b0b6;
  --focus: #14181c;
  --action-hover: #1239a8;
  --action-active: #0e2e88;
  --display: "DIN Condensed", "Bahnschrift SemiCondensed", "Bahnschrift", "Roboto Condensed",
    "Arial Narrow", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tabs-height: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --mat: #0f1215;
    --panel: #171b1f;
    --ink: #eef1f3;
    --muted: #9ba5ae;
    --line: #2d343a;
    --action: #2f5fe0;
    --link: #8fb0ff;
    --ok-bg: #16311f;
    --ok-ink: #b9e8c8;
    --alert-bg: #3a1614;
    --alert-ink: #f6c7c2;
    --focus: #f2b400;
    --action-hover: #4a74ea;
    --action-active: #2450c4;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
  scroll-padding-bottom: calc(var(--tabs-height) + 16px); }
body {
  margin: 0;
  background: var(--mat);
  color: var(--ink);
  font: 16px/1.5 var(--body);
}
body.has-tabs { padding-bottom: calc(var(--tabs-height) + env(safe-area-inset-bottom, 0px)); }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: 16px; top: -48px; padding: 10px 14px; background: var(--panel);
  color: var(--ink); border-radius: 8px; z-index: 10; }
.skip:focus { top: 8px; }

header.top { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  max-width: 1100px; margin: 0 auto; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top, 0px)); }
.brand { font: 700 26px/1 var(--display); font-stretch: condensed; color: var(--ink); text-decoration: none; }
form.logout { margin: 0; }
form.logout button { font: inherit; font-size: 15px; min-height: 44px; padding: 0 4px; background: none;
  border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; }

main { max-width: 640px; margin: 0 auto; padding: 4px 16px 24px; display: grid; gap: 24px; }
main.wide { max-width: 1100px; }
main > * { min-width: 0; }
footer { max-width: 640px; margin: 0 auto; padding: 8px 16px 24px; color: var(--muted); font-size: 14px; }
footer p { margin: 0 0 6px; }
footer.wide { max-width: 1100px; }

h1 { font: 700 36px/1 var(--display); font-stretch: condensed; margin: 8px 0 0; text-wrap: balance; }
h2 { font: 700 23px/1.1 var(--display); font-stretch: condensed; margin: 0 0 10px; text-wrap: balance; }
h3 { font: 700 19px/1.15 var(--display); font-stretch: condensed; margin: 16px 0 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
section > :last-child, .panel > :last-child { margin-bottom: 0; }
ul, ol { padding-left: 20px; margin: 0 0 10px; }
code { font-size: 90%; }

.notice, .error { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.notice { background: var(--ok-bg); color: var(--ok-ink); }
.error { background: var(--alert-bg); color: var(--alert-ink); }

/* Le seul objet mis en avant d'une page : le panneau d'action. */
.panel { background: var(--panel); border: 2px solid var(--ink); border-radius: 14px; padding: 16px;
  display: grid; gap: 14px; }
.panel.soft { border-width: 1px; border-color: var(--line); }
.panel h2 { margin: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); white-space: nowrap; }
.pill.live { background: var(--p15); border-color: var(--p15); color: #14181c; }
.last { margin: 0; font-size: 15px; color: var(--muted); }
.last strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Formulaires */
form { margin: 0; }
form.grid { display: grid; gap: 12px; }
form.grid label, .field { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pair > * { min-width: 0; }
input, select { font: inherit; width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--mat); color: var(--ink); }
input::placeholder { color: var(--muted); opacity: 1; }
.score { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.score label { font-size: 13px; }
.score input { font: 700 44px/1 var(--display); font-stretch: condensed; font-variant-numeric: tabular-nums;
  text-align: center; padding: 10px 4px; min-width: 0; }

button { font: 600 17px/1.2 var(--body); min-height: 52px; width: 100%; padding: 10px 16px; border-radius: 12px;
  border: 0; background: var(--action); color: var(--action-ink); cursor: pointer; touch-action: manipulation; }
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); min-height: 48px;
  font-size: 16px; font-weight: 500; }
button.quiet { background: none; color: var(--muted); border: 0; min-height: 44px; width: auto; padding: 0;
  font-size: 15px; font-weight: 400; text-decoration: underline; justify-self: start; }
form.choices { display: flex; flex-wrap: wrap; gap: 8px; }
form.choices button { width: auto; min-height: 44px; padding: 8px 14px; border-radius: 999px; font-size: 15px;
  font-weight: 500; background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
form.search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
form.search label { grid-column: 1 / -1; }
form.search button { width: auto; min-height: 48px; }
.button-link { display: grid; place-items: center; min-height: 52px; border-radius: 12px; background: var(--action);
  color: var(--action-ink); font-weight: 600; font-size: 17px; text-decoration: none; }
.button-link.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); min-height: 48px;
  font-weight: 500; font-size: 16px; }
/* Survol et appui : un retour visible, sans animation. */
button:hover, .button-link:hover { background: var(--action-hover); }
button:active, .button-link:active { background: var(--action-active); }
button.secondary:hover, .button-link.secondary:hover, form.choices button:hover { background: var(--panel);
  border-color: var(--ink); }
button.quiet:hover, form.logout button:hover { background: none; color: var(--ink); }
nav.tabs a:hover { color: var(--ink); }

/* Barre chargée (docs/algorithmes/barre-chargee.md) : un côté, du manchon vers le centre. */
.bar { display: flex; align-items: center; gap: 2px; height: 64px; }
.bar .sleeve { width: 22px; height: 10px; background: var(--metal); border-radius: 2px; }
.bar .collar { width: 6px; height: 22px; background: var(--muted); border-radius: 2px; margin-right: 2px; }
.bar .rest { flex: 1; height: 10px; background: var(--metal); }
.plate { width: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .25); flex: none; }
.plate.k25 { height: 64px; background: var(--p25); }
.plate.k20 { height: 64px; background: var(--p20); }
.plate.k15 { height: 56px; background: var(--p15); }
.plate.k10 { height: 48px; background: var(--p10); }
.plate.k5 { height: 36px; width: 10px; background: var(--p5); border-color: var(--line); }
.plate.k2_5 { height: 28px; width: 8px; background: var(--p25); }
.plate.k1_25 { height: 22px; width: 7px; background: var(--metal); }
.barnote { margin: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Listes de séries et de séances */
ol.log { list-style: none; margin: 0 0 8px; padding: 0; }
ol.log li { display: grid; grid-template-columns: 2.5ch minmax(0, 1fr); gap: 10px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
ol.log .n { color: var(--muted); font-size: 14px; }
ol.log .v { font: 700 21px/1.1 var(--display); font-stretch: condensed; }
details { border-top: 1px solid var(--line); padding-top: 10px; }
summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }

/* Grands chiffres : seulement là où le chiffre est le sujet de la page. */
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.figure { display: grid; gap: 2px; min-width: 0; }
.figure .label { font-size: 14px; color: var(--muted); }
.figure .big { font: 700 clamp(40px, 12vw, 60px)/0.95 var(--display); font-stretch: condensed; font-variant-numeric: tabular-nums; }
.figure .unit { font-size: clamp(18px, 5vw, 26px); margin-left: 4px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; font-weight: 600; color: var(--muted); }
.num { text-align: right; }

img { max-width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--line); }

/* Vue d'ensemble du coach : une ligne par membre, mêmes colonnes pour tous (W6, sans rang). */
.members { display: grid; }
.member { display: grid; grid-template-columns: minmax(140px, 1.1fr) repeat(3, minmax(0, 1fr)); gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line); align-items: start; }
.member h2 { margin: 0 0 2px; font-size: 25px; }
.member h2 a { color: var(--ink); }
.member .cell { display: grid; gap: 2px; font-size: 14px; min-width: 0; }
.member .lbl { color: var(--muted); font-size: 13px; }
.member .val { font: 700 22px/1.05 var(--display); font-stretch: condensed; font-variant-numeric: tabular-nums; }
.member ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
@media (max-width: 760px) {
  .member { grid-template-columns: 1fr 1fr; }
  .member .who { grid-column: 1 / -1; }
}

/* Onglets : en bas, à portée de pouce, sur téléphone ; sous l'en-tête sur grand écran. */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-auto-flow: column;
  grid-auto-columns: 1fr; background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px); }
nav.tabs a { display: grid; place-items: center; min-height: var(--tabs-height); padding: 0 4px; font-size: 13px;
  font-weight: 600; text-align: center; color: var(--muted); text-decoration: none; border-top: 3px solid transparent; }
nav.tabs a[aria-current="page"] { color: var(--ink); border-top-color: var(--action); }
@media (min-width: 900px) {
  body.has-tabs { padding-bottom: 0; }
  nav.tabs { position: static; max-width: 1100px; margin: 0 auto 8px; padding: 0 16px; background: none;
    border: 0; grid-auto-columns: max-content; gap: 24px; }
  nav.tabs a { min-height: 44px; font-size: 15px; border-top: 0; border-bottom: 3px solid transparent; }
  nav.tabs a[aria-current="page"] { border-bottom-color: var(--action); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
