:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --wash: rgba(11, 11, 11, 0.04);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --neutral: #898781;
  --delta-up: #006300;
  --link: #b3192a;
  /* Charte WattsUWant : rouge */
  --accent: #d0202f;
  --accent-strong: #c41d2b;
  --accent-wash: rgba(208, 32, 47, 0.10);
  --on-accent: #ffffff;
  --good-wash: rgba(12, 163, 12, 0.12);
  --shadow: 0 1px 2px rgba(40, 10, 12, 0.06), 0 4px 14px rgba(40, 10, 12, 0.07);
  --shadow-strong: 0 2px 4px rgba(40, 10, 12, 0.08), 0 8px 24px rgba(40, 10, 12, 0.10);
  --ring-effort: #e89a0c;
  --ring-sleep: #8b6ce0;
  --ring-hrv: #1aa58a;
  --ring-form: #d0202f;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --wash: rgba(255, 255, 255, 0.05);
    --series-1: #3987e5;
    --series-2: #d95926;
  --series-3: #199e70;
    --series-3: #199e70;
    --delta-up: #0ca30c;
    --link: #ff8f98;
    --accent: #f2545f;
    --accent-strong: #d33240;
    --accent-wash: rgba(242, 84, 95, 0.16);
    --good-wash: rgba(12, 163, 12, 0.18);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-strong: 0 2px 4px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.45);
    --ring-effort: #f5b335;
    --ring-sleep: #a48bf0;
    --ring-hrv: #45d0a8;
    --ring-form: #f2545f;
  }
}
:root[data-theme="dark"] {
  --accent: #f2545f;
  --accent-strong: #d33240;
  --accent-wash: rgba(242, 84, 95, 0.16);
  --good-wash: rgba(12, 163, 12, 0.18);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-strong: 0 2px 4px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.45);
  --ring-effort: #f5b335;
  --ring-sleep: #a48bf0;
  --ring-hrv: #45d0a8;
  --ring-form: #f2545f;

  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --text-primary: #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --wash: rgba(255, 255, 255, 0.05);
  --series-1: #3987e5;
  --series-2: #d95926;
  --delta-up: #0ca30c;
  --link: #ff8f98;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--link); }
main { min-width: 0; padding: 24px 16px 48px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); }
main > header, main > section { max-width: 1120px; }

/* Barre latérale */
.sidebar { border-bottom: 1px solid var(--border); background: var(--surface); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.athlete { display: flex; gap: 10px; align-items: center; }
.athlete img { border-radius: 50%; object-fit: cover; }
.athlete-name { font-weight: 600; }
.athlete-meta { font-size: 12px; color: var(--text-muted); }
.athlete-meta b { color: var(--text-secondary); font-weight: 600; }
.side-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text-secondary); font-size: 14px; }
.side-nav a:hover { background: var(--wash); color: var(--text-primary); }
.side-nav a[aria-current="page"] { background: var(--accent-wash); color: var(--accent); font-weight: 600; }
.side-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 900px) {
  .layout { grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 41px); }
  .sidebar { flex-direction: column; align-items: stretch; flex-wrap: nowrap; border-bottom: none; border-right: 1px solid var(--border); padding: 16px 12px; }
  .athlete { padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--page); box-shadow: var(--shadow); }
  .side-nav { flex-direction: column; }
  main { padding: 24px 28px 48px; }
}

/* Accueil */
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 12px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.pill.link { background: var(--surface); box-shadow: var(--shadow); }
.pill.link:hover { border-color: var(--accent); color: var(--accent); }
.pill.link:hover { background: var(--wash); color: var(--text-primary); }
.home-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 20px; max-width: none; }
@media (min-width: 1200px) { .home-head { grid-template-columns: auto 1fr auto; } }
.day-title h1 { font-size: 30px; letter-spacing: -.01em; }
.day-title .sub { margin: 0; }
.week-strip { display: flex; align-items: stretch; gap: 4px; justify-content: center; }
.week-strip a { text-decoration: none; color: var(--text-secondary); }
.week-strip .arrow { flex: none; display: flex; align-items: center; padding: 0 6px; font-size: 22px; color: var(--text-muted); border-radius: 8px; }
.week-strip .arrow:hover { background: var(--wash); }
.week-strip .day { flex: 1; max-width: 96px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; }
.week-strip .day:hover { background: var(--wash); }
.week-strip .dow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.week-strip .num { font-size: 20px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.week-strip .today .num { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.week-strip .selected { background: var(--accent-wash); outline: 1.5px solid var(--accent); }
.week-strip .selected:hover { background: var(--accent-wash); }
.bars { display: flex; gap: 2px; align-items: flex-end; height: 12px; }
.bars i { width: 3px; border-radius: 1px; background: transparent; }
.bars.done i.on { background: var(--accent); }
.bars.plan i.on { background: var(--text-muted); }
.objective { padding: 14px 18px; min-width: 260px; }
.objective .eyebrow { margin-bottom: 6px; }
.objective-name { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.objective-meta { font-size: 12px; color: var(--text-muted); }
.objective-meta .pill { font-weight: 700; color: var(--text-primary); }

.home-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 1400px) { .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.home-grid .col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.home-grid .card { padding: 20px; border-radius: 14px; }

.rings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 8px; }
@media (min-width: 480px) { .rings { grid-template-columns: repeat(4, 1fr); } }
.ring { position: relative; text-align: center; }
.ring svg { width: 84px; height: 84px; display: block; margin: 0 auto 6px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring .track { stroke: var(--grid); }
.ring .fill { stroke-linecap: round; }
.ring-effort .fill { stroke: var(--ring-effort); }
.ring-sleep .fill { stroke: var(--ring-sleep); }
.ring-hrv .fill { stroke: var(--ring-hrv); }
.ring-form .fill { stroke: var(--ring-form); }
.ring-value { position: absolute; top: 0; left: 0; right: 0; height: 84px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-value small { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 2px; }
.ring-label { font-weight: 600; font-size: 14px; }
.ring-detail { font-size: 12px; color: var(--text-muted); }
.ring-detail .status { font-size: 12px; }

.planned details { font-size: 13px; }
.planned summary { cursor: pointer; color: var(--text-muted); }
.planned-name, .session-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.workout { white-space: pre-wrap; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-secondary); background: var(--page); border-radius: 8px; padding: 10px 12px; margin: 8px 0 0; max-height: 260px; overflow: auto; }
.session-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.session-head .eyebrow { margin: 0 auto 0 0; }
.session-analyse .analyse-panel td { min-width: 90px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; padding: 12px 0 16px; border-bottom: 1px solid var(--grid); margin-bottom: 14px; }
.metrics b { display: block; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.metrics b small { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.metrics span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.session-analyse .analyse-panel { margin-top: 10px; }

.trend { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--grid); }
.trend:last-child { border-bottom: none; }
.trend-label { font-size: 13px; font-weight: 600; }
.trend-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.trend-value small { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.trend-avg { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 6px; letter-spacing: .04em; }
.trend-delta { font-size: 12px; color: var(--text-muted); }
.delta.good { color: var(--delta-up); }
.delta.warning { color: var(--ring-effort); }
.spark { width: 120px; height: 36px; flex: none; overflow: visible; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark circle { fill: var(--accent); }
header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 20px; }
h1 { font-size: 22px; margin: 0; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 2px; font-weight: 600; }
.sub { color: var(--text-secondary); font-size: 13px; margin: 0 0 12px; }
.muted { color: var(--text-muted); }

.periods { display: flex; gap: 4px; flex-wrap: wrap; }
.periods a {
  padding: 4px 10px; border-radius: 6px; text-decoration: none;
  color: var(--text-secondary); font-size: 13px; border: 1px solid transparent;
}
.periods a:hover { background: var(--wash); }
.periods a[aria-current="true"] { color: var(--text-primary); font-weight: 600; border-color: var(--border); background: var(--surface); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 12px; }
.tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 12px; }
.tile .label { font-size: 13px; color: var(--text-secondary); }
.tile .value { font-size: 26px; font-weight: 600; line-height: 1.2; margin: 2px 0; }
.tile .value small { font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.tile .detail { font-size: 12px; color: var(--text-muted); }
.up { color: var(--delta-up); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); }
.status.good::before { background: var(--good); }
.status.warning::before { background: var(--warning); }
.status.critical::before { background: var(--critical); }

.charts { grid-template-columns: 1fr; margin-bottom: 12px; }
@media (min-width: 860px) { .charts.two { grid-template-columns: 1fr 1fr; } }
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-size: 11px; fill: var(--text-muted); font-variant-numeric: tabular-nums; }
.chart .end-label { fill: var(--text-secondary); font-size: 12px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; flex-wrap: wrap; }
.legend .key { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; border-radius: 1px; }
.legend .key.rect { height: 10px; width: 10px; border-radius: 2px; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 2; display: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.12); white-space: nowrap;
}
.tooltip .t-date { color: var(--text-muted); margin-bottom: 4px; }
.tooltip .t-row { display: flex; align-items: center; gap: 6px; }
.tooltip .t-row b { font-variant-numeric: tabular-nums; min-width: 28px; }
.tooltip .t-row span:last-child { color: var(--text-secondary); }
.tooltip .key { width: 12px; height: 2px; border-radius: 1px; }

details.data { margin-top: 8px; font-size: 13px; }
details.data summary { cursor: pointer; color: var(--text-secondary); }
details.data .scroll { max-height: 240px; overflow: auto; margin-top: 6px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th { color: var(--text-secondary); font-weight: 500; position: sticky; top: 0; background: var(--surface); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.name { white-space: normal; min-width: 160px; }
tr:last-child td { border-bottom: none; }

.plan { list-style: none; margin: 0; padding: 0; }
.plan li { border-bottom: 1px solid var(--grid); padding: 10px 0; }
.plan li:last-child { border-bottom: none; }
.plan .row { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.plan .when { min-width: 110px; color: var(--text-secondary); font-size: 13px; }
.plan .when.today { color: var(--text-primary); font-weight: 600; }
.plan .what { flex: 1; min-width: 180px; font-weight: 500; }
.plan .meta { color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.plan .done { font-size: 12px; color: var(--delta-up); }
.plan details { margin-top: 4px; font-size: 13px; color: var(--text-secondary); }
.plan details summary { cursor: pointer; color: var(--text-muted); }
.plan pre { white-space: pre-wrap; font: inherit; margin: 6px 0 0; }
.error { max-width: 560px; margin: 80px auto; }

/* Analyse des séances */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.analyse-btn {
  font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
}
.analyse-btn:hover { background: var(--wash); color: var(--text-primary); }
.analyse-btn[aria-expanded="true"] { color: var(--text-primary); font-weight: 600; }
.analyse-btn:disabled { cursor: progress; opacity: .6; }
.analyse-row > td { padding: 0 0 10px; white-space: normal; }
.analyse-panel {
  margin-top: 8px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--page); font-size: 13px; white-space: normal; color: var(--text-primary);
}
.analyse-panel h3 { font-size: 14px; margin: 6px 0 6px; }
.analyse-panel h4 { font-size: 13px; margin: 12px 0 4px; color: var(--text-secondary); font-weight: 600; }
.analyse-panel p { margin: 0 0 6px; }
.analyse-panel ul { margin: 0; padding-left: 18px; }
.analyse-panel li { margin: 2px 0; }
.analyse-panel table { margin-top: 4px; }
.analyse-panel td { white-space: normal; vertical-align: top; }
.analyse-panel .foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--text-muted); font-size: 12px; }
.analyse-panel .foot button { font: inherit; background: none; border: none; color: var(--link); cursor: pointer; padding: 0; }
.analyse-panel .loading { color: var(--text-secondary); }
.analyse-panel .err { color: var(--critical); }

/* Onglets Production / Test */
.instances { border-bottom: 1px solid var(--border); background: var(--surface); }
.instances-inner { padding: 0 16px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.instances a {
  padding: 10px 14px 9px; text-decoration: none; color: var(--text-secondary); font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.instances a:hover { color: var(--text-primary); background: var(--wash); }
.instances a[aria-current="page"] { color: var(--text-primary); font-weight: 600; border-bottom-color: var(--text-primary); }
.instances .version { margin-left: auto; font-size: 12px; color: var(--text-muted); padding: 8px 0; font-variant-numeric: tabular-nums; }
/* Instance de test : bandeau coloré pour ne pas la confondre avec la production */
.instance-test .instances { background: repeating-linear-gradient(135deg, var(--surface) 0 12px, var(--wash) 12px 24px); border-top: 3px solid var(--warning); }
.instance-test .instances a[aria-current="page"] { border-bottom-color: var(--warning); }
/* Instance de test : bandeau rouge fin en haut de page */
.dev-strip {
  background: #d03b3b; color: #fff; text-align: center; font-size: 12px; line-height: 1.3;
  padding: 4px 16px; letter-spacing: .02em;
}
.dev-strip b { text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 599px) { .dev-strip span { display: none; } }

/* Bandeau : le dernier passage du worker d'analyse a échoué */
.worker-alert {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--critical);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.45;
}
.worker-alert code { font-size: 0.85em; }
.worker-alert details { margin-top: 6px; }
.worker-alert summary { cursor: pointer; color: var(--text-secondary); }
.worker-alert pre {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Calendrier */
.cal-head { align-items: center; margin-bottom: 12px; max-width: none; }
.cal-title { font-size: 26px; letter-spacing: -.01em; }
.cal-head .sub { margin: 4px 0 0; }
.cal-head .sub b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cal-refresh { margin: 0; }
.cal-refresh button { font: inherit; font-size: 12px; background: none; cursor: pointer; }
/* Mois affiché entre deux flèches rouges */
.cal-month { display: flex; align-items: center; gap: 10px; }
.cal-month .cal-title { margin: 0; min-width: 0; }
.cal-arrow { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--accent-strong); color: var(--on-accent); box-shadow: var(--shadow); text-decoration: none; }
.cal-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.cal-arrow:hover { filter: brightness(.9); }
.cal-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .cal-arrow { width: 30px; height: 30px; } .cal-month { gap: 8px; } }
.cal-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; padding: 0; font-size: 12px; color: var(--text-secondary); }
.cal-legend li { display: flex; align-items: center; gap: 6px; }
.cal-legend .k { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Couleurs des éléments (légende et cases) */
.k.done, .cal-item.done { background: var(--good-wash); border-left: 3px solid var(--good); }
.k.planned, .cal-item.planned { background: var(--surface); border: 1px dashed var(--axis); border-left: 3px solid var(--series-1); }
.k.missed, .cal-item.missed { background: var(--wash); border: 1px dashed var(--axis); border-left: 3px solid var(--critical); }
.k.race, .cal-item.race { background: rgba(250, 178, 25, .18); border-left: 3px solid var(--warning); }
.cal-item.note { background: var(--wash); border-left: 3px solid var(--neutral); }

.cal { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.cal-row { display: grid; grid-template-columns: minmax(0, 1fr); }
.cal-dows { display: none; }
.cal-day { padding: 8px 12px; border-top: 1px solid var(--grid); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.out { display: none; }
.cal-day.empty:not(.today) .cal-date { color: var(--text-muted); }
.cal-date { display: flex; align-items: baseline; gap: 6px; text-decoration: none; color: var(--text-secondary); font-size: 13px; }
.cal-date:hover .num { text-decoration: underline; }
.cal-date .num { font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.cal-day.empty .cal-date .num { color: var(--text-muted); font-weight: 500; }
.cal-date .today-tag { font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.cal-day.today { background: var(--accent-wash); }
.cal-item { display: block; padding: 5px 8px; border-radius: 6px; text-decoration: none; color: var(--text-primary); font-size: 13px; line-height: 1.3; }
.cal-item:hover { filter: brightness(.97); }
.cal-item .name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.cal-item .meta { display: block; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.cal-item.missed .name { color: var(--text-secondary); text-decoration: line-through; text-decoration-color: var(--critical); }
.cal-item .analysed { color: var(--delta-up); }
.cal-week { padding: 8px 12px 12px; align-items: flex-start; border-top: 1px solid var(--grid); background: var(--page); font-size: 12px; color: var(--text-secondary); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-variant-numeric: tabular-nums; }
.cal-week .wk { font-weight: 700; color: var(--text-muted); letter-spacing: .06em; }
.wk-sum, .cal-sum { border-collapse: collapse; width: auto; font-variant-numeric: tabular-nums; }
.wk-sum th, .wk-sum td, .cal-sum th, .cal-sum td { position: static; background: none; border: none; white-space: nowrap; }
.wk-sum th, .wk-sum td { padding: 1px 8px 1px 0; font-size: 12px; }
.wk-sum thead th { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 500; }
.wk-sum tbody th { color: var(--text-muted); font-weight: 500; }
.wk-sum td { text-align: right; color: var(--text-muted); }
.wk-sum td.done { color: var(--text-primary); font-weight: 600; }
.wk-pct { flex-basis: 100%; font-size: 11px; color: var(--text-muted); }
.wk-bar { height: 4px; border-radius: 2px; background: var(--grid); overflow: hidden; margin: 4px 0 2px; }
.wk-bar i { display: block; height: 100%; background: var(--accent); }
.cal-sum { margin: 6px 0 0; }
.cal-sum th, .cal-sum td { padding: 2px 16px 2px 0; font-size: 13px; }
.cal-sum thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 500; text-align: right; }
.cal-sum thead th:first-child { text-align: left; }
.cal-sum tbody th { text-align: left; font-weight: 500; color: var(--text-secondary); }
.cal-sum td { text-align: right; color: var(--text-secondary); }
.cal-sum tr.done td { color: var(--text-primary); font-weight: 700; }
.cal-sum abbr, .wk-sum abbr { text-decoration: none; cursor: help; }
/* Téléphone : chaque semaine forme un bloc, bilan en tête */
@media (max-width: 899px) {
  .cal-row { border-top: 6px solid var(--page); }
  .cal-row:first-of-type { border-top: none; }
  .cal-week { order: -1; border-top: none; }
  .cal-day.empty:not(.today) { flex-direction: row; padding-top: 5px; padding-bottom: 5px; }
}
/* Grand écran : grille 7 jours + bilan de la semaine */
@media (min-width: 900px) {
  .cal-row { grid-template-columns: repeat(7, minmax(0, 1fr)) 168px; }
  .cal-dows { display: grid; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
  .cal-dows div { padding: 8px 10px; }
  .cal-day { min-height: 112px; padding: 6px 6px 8px; border-left: 1px solid var(--grid); }
  .cal-day:first-child { border-left: none; }
  .cal-day.out { display: flex; background: var(--page); }
  .cal-day.out .cal-date, .cal-day.out .cal-item { opacity: .55; }
  .cal-date .dow { display: none; }
  .cal-date .today-tag { display: none; }
  .cal-day.today .cal-date .num { background: var(--accent); color: var(--surface); border-radius: 999px; padding: 0 7px; }
  .cal-item { padding: 4px 6px; font-size: 12px; }
  .cal-item .name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .cal-item .meta { font-size: 11px; }
  .cal-week { flex-direction: column; flex-wrap: nowrap; gap: 4px; border-left: 1px solid var(--grid); padding: 8px 10px; }
  .cal-week .wk-pct { flex-basis: auto; }
  .cal-row.current .cal-week { background: var(--accent-wash); }
}
.cal-sum tr.total th, .cal-sum tr.total td { border-top: 1px solid var(--grid); padding-top: 4px; font-weight: 600; color: var(--text-primary); }
.cal-sum tbody th { white-space: normal; min-width: 7.5em; }
.cal-sum th, .cal-sum td { padding-right: 12px; }
@media (min-width: 600px) { .cal-sum tbody th { white-space: nowrap; } .cal-sum th, .cal-sum td { padding-right: 16px; } }
@media (max-width: 599px) { .cal-sum .long { display: none; } }

/* Calendrier : ajout d'une séance sur un jour */
.cal-day { position: relative; }
.cal-add { position: absolute; top: 4px; right: 6px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; text-decoration: none; color: var(--text-muted); font-size: 18px; line-height: 1; }
.cal-add:hover, .cal-add:focus-visible { background: var(--wash); color: var(--link); }
@media (min-width: 900px) and (hover: hover) {
  .cal-add { opacity: 0; }
  .cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
}

/* Éditeur de séance */
.wk-head { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.wk-head h1 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.wk-form { max-width: 1000px; display: flex; flex-direction: column; gap: 20px; }
.wk-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.wk-form input, .wk-form select, .wk-form textarea { font: inherit; font-size: 14px; color: var(--text-primary); background: var(--surface); border: 1px solid var(--axis); border-radius: 6px; padding: 6px 8px; min-width: 0; }
.wk-form textarea { width: 100%; resize: vertical; }
.wk-form input:focus-visible, .wk-form select:focus-visible, .wk-form textarea:focus-visible { outline: 2px solid var(--link); outline-offset: -1px; }
.wk-form input.invalid { border-color: var(--critical); }
.wk-form button { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); cursor: pointer; }
.wk-form button:hover:not(:disabled) { background: var(--wash); }
.wk-form button:disabled { opacity: .45; cursor: default; }
.wk-form button.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); font-weight: 600; }
.wk-form button.primary:hover:not(:disabled) { filter: brightness(.93); background: var(--accent-strong); }
.wk-form button.danger { color: var(--critical); }
.wk-form button.link { border: none; background: none; color: var(--link); padding: 4px 0; }
.wk-fields { display: flex; flex-wrap: wrap; gap: 12px; }
.wk-fields .grow { flex: 1 1 240px; }
.wk-note { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--wash); font-size: 13px; max-width: 1000px; }
.wk-note.warn { background: rgba(250, 178, 25, .16); border-left: 3px solid var(--warning); }
.wk-sec-head h2 { margin: 0; font-size: 17px; }
.wk-sec-head p { margin: 2px 0 10px; font-size: 13px; }
.wk-preview { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.wk-preview svg { display: block; width: 100%; height: 120px; }
.wk-preview .ftp { stroke: var(--axis); stroke-dasharray: 6 5; stroke-width: 1; vector-effect: non-scaling-stroke; }
.wk-preview polygon { stroke: var(--surface); stroke-width: 1; vector-effect: non-scaling-stroke; }
.wk-stats { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.wk-stats .stat { display: flex; flex-direction: column; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.wk-stats .stat b { font-size: 18px; letter-spacing: 0; text-transform: none; color: var(--text-primary); }
.wk-stats .err, .wk-msg.err { color: var(--critical); }
.wk-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wk-step, .wk-section, .wk-repeat { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.wk-step { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding: 8px 10px; border-left: 3px solid var(--series-1); }
.wk-step .f > span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.wk-step .dur input { width: 6.5em; }
.wk-step .rpm input { width: 5.5em; }
.wk-step .label { flex: 1 1 140px; }
.wk-unit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wk-target { display: inline-flex; align-items: center; gap: 4px; }
.wk-target input { width: 5em; }
.wk-target .dash { color: var(--text-muted); }
.wk-form .wk-check { flex-direction: row; align-items: center; gap: 4px; font-size: 13px; }
.wk-ctl { display: inline-flex; gap: 2px; margin-left: auto; }
.wk-form .wk-ctl button { padding: 4px 8px; font-size: 13px; border-color: transparent; background: none; color: var(--text-muted); }
.wk-form .wk-ctl button.del:hover:not(:disabled) { color: var(--critical); }
.wk-section { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--wash); margin-top: 6px; }
.wk-section input { flex: 1; font-weight: 600; background: transparent; border-color: transparent; }
.wk-section input:hover { border-color: var(--axis); }
.wk-repeat { padding: 8px 10px; border-left: 3px solid var(--series-2); background: var(--page); display: flex; flex-direction: column; gap: 8px; }
.wk-rep-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.wk-rep-head > input { flex: 1 1 140px; }
.wk-form .wk-rep-count { flex-direction: row; align-items: center; gap: 6px; font-weight: 600; color: var(--text-primary); }
.wk-rep-count input { width: 4em; }
.wk-items.inner { padding-left: 12px; }
.wk-form .wk-add-inner { align-self: flex-start; font-size: 13px; padding: 4px 10px; }
.wk-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wk-text { margin-top: 12px; font-size: 13px; }
.wk-text summary { cursor: pointer; color: var(--text-secondary); }
.wk-text pre, .wk-form #wk-raw { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.wk-text pre { margin: 8px 0 4px; padding: 8px 10px; background: var(--wash); border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.wk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.wk-actions a { font-size: 14px; }
.wk-msg { margin: 0; min-height: 1.2em; font-size: 14px; }
.wk-form .small { font-size: 12px; margin: 0; }
[hidden] { display: none !important; }

/* Brouillons (pas encore envoyés vers intervals.icu) */
.k.draft, .cal-item.draft { background: repeating-linear-gradient(135deg, var(--surface) 0 6px, var(--wash) 6px 12px); border: 1px dashed var(--ring-sleep); border-left: 3px solid var(--ring-sleep); }
.cal-item.draft .name { font-style: italic; }
.cal-drafts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; margin: 0 0 12px; border: 1px dashed var(--ring-sleep); border-radius: 10px; background: var(--surface); font-size: 14px; }
.cal-drafts span { flex: 1 1 260px; }
.cal-drafts form { margin: 0; }
.cal-drafts button { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); cursor: pointer; }
.cal-drafts button.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); font-weight: 600; }
.cal-drafts button.danger { color: var(--critical); }
.cal-notice { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--accent-wash); font-size: 14px; }
.cal-notice.warn { background: rgba(250, 178, 25, .16); }

/* Plans proposés par Claude */
.plan-form { max-width: 820px; }
.plan-form h2, .plan-body h2, .plan-actions h2, .plan-list h2 { margin: 0 0 6px; font-size: 17px; }
.plan-form section p { margin: 0; font-size: 14px; }
.plan-form fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 12px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.plan-form legend { font-size: 13px; font-weight: 600; color: var(--text-secondary); padding: 0 4px; }
.plan-kind { flex-direction: row !important; flex-wrap: wrap; gap: 8px 20px !important; }
.plan-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.plan-status { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--wash); color: var(--text-secondary); white-space: nowrap; }
.plan-status.pret { background: rgba(139, 108, 224, .16); color: var(--text-primary); }
.plan-status.envoye { background: var(--good-wash); color: var(--text-primary); }
.plan-status.erreur { background: rgba(208, 59, 59, .14); color: var(--critical); }
.plan-status.en_attente { background: rgba(250, 178, 25, .18); color: var(--text-primary); }
.plan-list { margin-top: 32px; max-width: 820px; }
.plan-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.plan-wait { max-width: 820px; padding: 12px 14px; border: 1px dashed var(--ring-sleep); border-radius: 10px; background: var(--surface); }
.plan-wait p { margin: 0 0 4px; }
.plan-body { max-width: 900px; }
.plan-synth { font-size: 15px; white-space: pre-line; }
.plan-body h2 { margin-top: 20px; }
.plan-period td.num, .plan-period th.num { text-align: right; font-variant-numeric: tabular-nums; }
.plan-week h3 { font-size: 14px; margin: 14px 0 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.plan-week h3 .muted { font-weight: 400; font-variant-numeric: tabular-nums; }
.plan-sessions { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.plan-actions { max-width: 900px; margin-top: 24px; display: flex; flex-direction: column; gap: 20px; }
.plan-send { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.plan-send .wk-check { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; display: flex; }
.plan-send button, .plan-actions > form > button { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); cursor: pointer; }
.plan-send button.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); font-weight: 600; }
.plan-actions > form > button.link { border: none; background: none; padding: 0; color: var(--critical); }
.plan-form .wk-check, .plan-kind .wk-check { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--text-primary); }

/* Principes d'entraînement */
.principles-form { max-width: 1000px; }
.principles-form textarea { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-height: 60vh; }

/* Ajout depuis le « + » : séance, repos, course, note */
.add-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.add-tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--axis); color: var(--text-secondary); text-decoration: none; font-size: 14px; }
.add-tabs a[aria-current="page"] { background: var(--wash); color: var(--text-primary); border-color: var(--text-secondary); font-weight: 600; }
.cal-item.note.rest { background: transparent; border-left-style: dashed; color: var(--text-secondary); }

/* Courses : niveau d'objectif et profil du parcours */
.ev-priorities { display: grid; gap: 6px; }
.wk-form .ev-priority { flex-direction: row; gap: 8px; align-items: baseline; font-size: 14px; color: var(--text-primary); }
.ev-route input[type=file] { border: 0; padding: 4px 0; }
.ev-profile { margin-top: 24px; max-width: 1000px; }
.ev-svg { width: 100%; height: 220px; display: block; margin: 8px 0 12px; }
.ev-svg .area { fill: var(--wash); }
.ev-svg .line { fill: none; stroke: var(--text-secondary); stroke-width: 1.5; }
.ev-svg .climb { fill: rgba(250, 178, 25, .22); }
.ev-ticks { position: relative; height: 16px; margin: -8px 0 12px; font-size: 11px; color: var(--text-secondary); }
.ev-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ev-ticks span:first-child { transform: none; }

/* Pacing */
.ev-pacing { margin-top: 28px; max-width: 1100px; }
.ev-svg .power { fill: none; stroke: var(--link); stroke-width: 1.5; }
.ev-svg .ftp { stroke: var(--link); stroke-dasharray: 4 4; stroke-width: 1; opacity: .6; }
.ev-legend { margin-left: 12px; font-size: 12px; white-space: nowrap; }
.ev-legend .sw { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--link); vertical-align: middle; margin: 0 2px 0 8px; }
.ev-legend .sw.ftp { border-top-style: dashed; opacity: .6; }
.ev-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.ev-stats div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--wash); border-radius: 8px; font-size: 13px; }
.ev-stats b { font-size: 17px; }
.ev-sections tr.climb td { background: rgba(250, 178, 25, .10); }
.ev-sections td.consigne { min-width: 260px; font-size: 13px; }
.ev-claude { margin-top: 20px; }
.ev-claude h4 { margin: 14px 0 4px; font-size: 14px; }

/* Profil du coureur */
.pf-estimate { margin: 0 0 20px; max-width: 1100px; }
.pf-estimate > .muted { margin-left: 8px; }
.pf-warnings { margin: 12px 0; padding-left: 18px; font-size: 13px; color: var(--text-primary); }
.pf-warnings li { margin: 4px 0; }
.pf-form { max-width: 1100px; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.pf-field.wide { grid-column: 1 / -1; }
.pf-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.pf-src { font-size: 11px; color: var(--text-secondary); min-height: 14px; overflow-wrap: anywhere; }
.pf-stale { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--critical); color: #fff; font-size: 11px; font-weight: 600; }
.pf-stale-why { color: var(--critical); }
.pf-stale-list { margin: 4px 0 8px; padding-left: 18px; font-size: 13px; color: var(--critical); }
.pf-mode { display: flex; gap: 4px; }
.wk-form .pf-mode label { flex-direction: row; }
.pf-mode input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-mode span { padding: 2px 8px; border: 1px solid var(--axis); border-radius: 999px; font-size: 11px; cursor: pointer; }
.pf-mode input:checked + span { background: var(--accent-wash); border-color: var(--accent); color: var(--text-primary); font-weight: 600; }
.pf-mode input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 1px; }
.wk-form input[readonly] { background: var(--wash); color: var(--text-secondary); }

/* Niveau de course : boutons */
.ev-levels { display: flex; flex-wrap: wrap; gap: 6px; }
.wk-form .ev-level { flex-direction: row; }
.ev-level input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ev-level span { padding: 5px 12px; border: 1px solid var(--axis); border-radius: 999px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.ev-level input:checked + span { background: var(--accent-wash); border-color: var(--accent); color: var(--text-primary); font-weight: 600; }
.ev-level input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 1px; }
.wk-form .pf-field > label { display: block; }
.pf-stale { display: inline-block; }

/* Avatar cliquable */
.avatar { position: relative; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--wash); cursor: pointer; }
.avatar img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; }
.avatar-initials { display: grid; place-items: center; width: 40px; height: 40px; font-weight: 600; color: var(--text-secondary); }
.avatar-edit { position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 1px solid var(--axis); font-size: 10px; line-height: 14px; color: var(--text-secondary); opacity: 0; transition: opacity .15s; }
.avatar:hover .avatar-edit, .avatar:focus-visible .avatar-edit { opacity: 1; }
.avatar:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.avatar.busy { opacity: .5; }
.athlete-text { display: flex; flex-direction: column; text-decoration: none; color: inherit; min-width: 0; }
.athlete-text:hover .athlete-name { text-decoration: underline; }

/* Bouton de thème (barre du haut) */
.theme-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-secondary); font: inherit; font-size: 12px; cursor: pointer; }
.theme-toggle:hover { color: var(--text-primary); background: var(--wash); }
.theme-toggle:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.theme-toggle + .version { margin-left: 12px; }
.theme-icon { font-size: 13px; line-height: 1; }

/* Téléphone : navigation en barre fixe en bas de l'écran, tous les onglets alignés */
@media (max-width: 899px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  /* Sans bloc athlète (pages autres que l'accueil) : bandeau réduit à rien, mais pas masqué,
     sinon la barre de navigation qu'il contient disparaît avec lui */
  /* Carte de l'athlète : sur l'accueil seulement (sur PC, elle est sur toutes les pages) */
  body:not(.page-accueil) .sidebar .athlete { display: none; }
  body:not(.page-accueil) .sidebar { padding: 0; border: 0; }
  .side-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0;
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom));
  }
  .side-nav a { flex-direction: column; justify-content: center; gap: 2px; padding: 6px 0; font-size: 10.5px; line-height: 1.1; text-align: center; border-radius: 8px; min-width: 0; }
  .side-nav svg { width: 22px; height: 22px; }
  .side-nav a[aria-current="page"] { color: var(--accent); background: transparent; }
  .theme-label { display: none; }
}

/* Espace admin */
.admin-tabs .admin-soon { padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--axis); color: var(--text-muted); font-size: 14px; }
.admin-note { margin-top: 10px; }
.admin-history { margin-top: 24px; max-width: 1000px; }
.admin-history h3 { font-size: 15px; margin: 0 0 8px; }
.admin-history tr.current td { font-weight: 600; }
.admin-links { white-space: nowrap; font-size: 13px; }
.admin-diff-sum { font-size: 13px; }
.admin-diff-sum .add { color: var(--good); font-weight: 600; }
.admin-diff-sum .del { color: var(--critical); font-weight: 600; }
.admin-diff { max-width: 1000px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.admin-diff .row { display: flex; gap: 8px; padding: 1px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-diff .sign { flex: none; width: 1ch; color: var(--text-muted); }
.admin-diff .ajout { background: rgba(12, 163, 12, .14); }
.admin-diff .ajout .sign { color: var(--good); }
.admin-diff .retrait { background: rgba(208, 59, 59, .14); text-decoration: line-through; text-decoration-color: rgba(208, 59, 59, .5); }
.admin-diff .retrait .sign { color: var(--critical); }
.admin-diff .saut { color: var(--text-muted); background: var(--wash); justify-content: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pf-version { margin: 8px 0 12px; }
.pf-version p { margin: 0 0 4px; }
.wk-form .pf-bool { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--text-primary); min-height: 34px; }

/* Météo dans le calendrier */
.cal-wx { margin-left: auto; font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.cal-wx.warn { color: var(--critical); font-weight: 600; }
.cal-item.wx-warn { outline: 1px dashed var(--critical); outline-offset: -1px; }
.wx-badge { display: block; margin-top: 2px; font-size: 11px; color: var(--critical); font-weight: 600; }

.nav-short { display: none; }
@media (max-width: 899px) { .nav-long { display: none; } .nav-short { display: inline; } }

/* Documentation */
.docs { display: grid; gap: 24px; max-width: 1120px; }
.docs-toc { font-size: 14px; }
.docs-toc h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin: 0 0 8px; }
.docs-toc ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.docs-body { max-width: 800px; line-height: 1.6; }
.docs-body section { margin-bottom: 28px; scroll-margin-top: 16px; }
.docs-body h2 { font-size: 19px; margin: 0 0 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.docs-body li { margin: 4px 0; }
.docs-body code { font-size: 13px; background: var(--wash); padding: 1px 4px; border-radius: 4px; }
@media (min-width: 1100px) {
  .docs { grid-template-columns: 220px minmax(0, 1fr); }
  .docs-toc { position: sticky; top: 16px; align-self: start; }
}

/* Export Zwift */
.wk-zwo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.cal-zwo { display: inline-block; margin: -2px 0 4px 8px; font-size: 11px; color: var(--link); text-decoration: none; }
.cal-zwo:hover { text-decoration: underline; }
.cal-day { scroll-margin-top: 12px; }

/* Accueil : anneaux cliquables et historique sur 7 jours */
button.ring { font: inherit; color: inherit; background: none; border: 0; padding: 6px 4px; border-radius: 12px; cursor: pointer; }
button.ring:hover { background: var(--wash); }
button.ring[aria-expanded="true"] { background: var(--wash); box-shadow: inset 0 0 0 1px var(--border); }
button.ring:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.ring-hist { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ring-hist h3 { margin: 0 0 10px; font-size: 14px; }
.hist-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.hist-col { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--text-secondary); padding: 4px 0; border-radius: 8px; min-width: 0; }
.hist-col:hover { background: var(--wash); }
.hist-col.is-day { background: var(--wash); color: var(--text-primary); font-weight: 600; }
.hist-val { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.hist-area { position: relative; width: 60%; max-width: 28px; height: 80px; display: flex; align-items: flex-end; justify-content: center; }
.hist-bar { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 4px 4px 0 0; min-height: 2px; }
.hist-bar.plan { opacity: .25; }
.ring-effort .hist-bar { background: var(--ring-effort); }
.ring-sleep .hist-bar { background: var(--ring-sleep); }
.ring-hrv .hist-bar { background: var(--ring-hrv); }
.ring-form .hist-bar { background: var(--ring-form); }
.diverging .hist-area { flex-direction: column; justify-content: stretch; }
.hist-half { position: relative; flex: 1; width: 100%; }
.hist-half.up { border-bottom: 1px solid var(--axis); }
.hist-half.down .hist-bar { top: 0; bottom: auto; border-radius: 0 0 4px 4px; }
.ring-form .hist-bar.neg { background: var(--ring-effort); }
.hist-day { font-size: 11px; white-space: nowrap; }
.hist-detail { font-size: 10px; color: var(--text-muted); text-align: center; line-height: 1.2; overflow-wrap: anywhere; }

/* Accueil : séance prévue (profil graphique et lien vers la séance) */
.planned-head { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.planned-profile { display: block; width: 100%; height: 90px; margin: 10px 0 2px; background: var(--page); border-radius: 8px; }
.planned-profile .ftp { stroke: var(--text-muted); stroke-dasharray: 4 4; stroke-width: 1; }

/* Accueil : forme du jour */
.readiness-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.readiness-head .eyebrow { margin: 0; }
.readiness-advice { margin: 10px 0 8px; font-weight: 600; }
.readiness-signals { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.readiness-signals li { padding-left: 14px; position: relative; color: var(--text-secondary); }
.readiness-signals li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--neutral); }
.readiness-signals li b { color: var(--text-primary); font-weight: 600; }
.readiness-signals .sig-good::before { background: var(--good); }
.readiness-signals .sig-warn::before { background: var(--warning); }
.readiness-signals .sig-bad::before { background: var(--critical); }
.readiness-trend { margin: 10px 0 4px; font-size: 14px; }
.plan-profile-link { display: block; }
.planned-profile.plan-profile { height: 60px; margin: 6px 0 4px; }

/* Accueil : bouton des paramètres d'entraînement, sous l'avatar */
.athlete { flex-wrap: wrap; }
.athlete-settings {
  flex: 1 1 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0;
  padding: 7px 6px; border-radius: 999px; text-decoration: none; font-size: 12px; font-weight: 600; white-space: nowrap;
  color: var(--accent); background: var(--accent-wash); border: 1px solid var(--accent);
}
.athlete-settings:hover { background: var(--accent); color: #fff; }
.athlete-settings:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.athlete-settings svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Profil de puissance */
.pp-card, .pp-hero { margin-bottom: 16px; max-width: 1120px; }
.pp-card h2 { margin: 0 0 4px; font-size: 16px; }
.pp-hero-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pp-hero h2 { margin: 0; font-size: 24px; }
.pp-hero h2 .muted { font-weight: 400; }
.pp-hero-why { margin: 6px 0 14px; color: var(--text-secondary); max-width: 70ch; }
.pp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pp-tiles div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--wash); border-radius: 10px; }
.pp-tiles span { font-size: 12px; color: var(--text-secondary); }
.pp-tiles b { font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.pp-tiles small { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.pp-tiles em { font-style: normal; font-size: 12px; color: var(--text-muted); min-height: 16px; }
.pp-controls { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 8px 0 10px; }
.pp-seg { display: inline-flex; border: 1px solid var(--axis); border-radius: 999px; padding: 2px; }
.pp-seg button { font: inherit; font-size: 13px; padding: 4px 12px; border: 0; border-radius: 999px; background: none; color: var(--text-secondary); cursor: pointer; }
.pp-seg button[aria-pressed="true"] { background: var(--accent-strong); color: var(--on-accent); font-weight: 600; }
.pp-series { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-toggle { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; padding: 4px 10px; border: 1px solid var(--axis); border-radius: 999px; background: none; color: var(--text-muted); cursor: pointer; }
.pp-toggle[aria-pressed="true"] { color: var(--text-primary); border-color: var(--text-secondary); background: var(--wash); }
.pp-toggle[disabled] { opacity: .45; cursor: default; }
.pp-toggle .key { width: 14px; height: 0; border-top: 2px solid var(--text-muted); }
.pp-toggle[aria-pressed="false"] .key { opacity: .35; }
.pp-seg button:focus-visible, .pp-toggle:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.pp-toggle.s1 .key, .tooltip .key.s1 { border-color: var(--series-1); background: var(--series-1); }
.pp-toggle.s2 .key, .tooltip .key.s2 { border-color: var(--series-2); background: var(--series-2); }
.pp-toggle.s3 .key, .tooltip .key.s3 { border-color: var(--series-3); background: var(--series-3); }
.pp-toggle.model .key { border-top-style: dashed; }
.tooltip .key.model { background: none; border-top: 2px dashed var(--text-muted); height: 0; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.pp-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pp-line.s1 { stroke: var(--series-1); }
.pp-line.s2 { stroke: var(--series-2); }
.pp-line.s3 { stroke: var(--series-3); }
.pp-line.model { stroke: var(--text-muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
.pp-dot { stroke: var(--surface); stroke-width: 2; }
.pp-dot.s1 { fill: var(--series-1); }
.pp-dot.s2 { fill: var(--series-2); }
.pp-dot.s3 { fill: var(--series-3); }
.pp-hair { stroke: var(--axis); stroke-width: 1; }
.chart .end-label { fill: var(--text-primary); font-weight: 600; }
#pp-curve .tooltip, .pp-trends .tooltip { white-space: normal; max-width: 300px; }
#pp-curve .tooltip b, .pp-trends .tooltip b { white-space: nowrap; }
#pp-curve .tooltip .key, .pp-trends .tooltip .key { flex: none; }
@media (max-width: 599px) { #pp-curve .tooltip { padding: 6px 8px; font-size: 11px; max-width: 200px; } }
.pp-insights { margin: 10px 0 0; padding-left: 18px; font-size: 14px; color: var(--text-secondary); }
.pp-records th[scope="row"] { font-weight: 600; }
.pp-when { display: block; font-size: 11px; color: var(--text-muted); }
a.pp-when { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a.pp-when:hover { text-decoration-thickness: 2px; }
.pp-levels { display: grid; gap: 12px; margin-top: 8px; }
.pp-level { display: grid; grid-template-columns: 130px minmax(0, 1fr) 190px; gap: 10px; align-items: center; font-size: 13px; }
.pp-level-track { position: relative; height: 16px; background: var(--wash); border-radius: 0 4px 4px 0; display: flex; align-items: center; }
.pp-level-bar { height: 16px; background: var(--accent); border-radius: 0 4px 4px 0; flex: none; }
.pp-level-val { margin-left: 8px; font-variant-numeric: tabular-nums; color: var(--text-primary); white-space: nowrap; }
.pp-level-cat { color: var(--text-secondary); }
@media (max-width: 640px) {
  .pp-level { grid-template-columns: 1fr; gap: 3px; }
}
.pp-trends { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .pp-trends { grid-template-columns: 1fr 1fr; } }
.pp-trends h3 { font-size: 14px; margin: 0 0 4px; }
.pp-trends h3 .muted { font-weight: 400; }
.pp-method { max-width: 1120px; }
.pp-method ul { padding-left: 18px; }
.pp-method li { margin: 6px 0; }
.pp-records tbody tr:last-child th, .pp-records tbody tr:last-child td { border-bottom: 0; }
.card.session { scroll-margin-top: 16px; }
.worker-alert.pause { background: rgba(250, 178, 25, .14); border-left-color: var(--warning); }

/* Sous-onglets (Profil, Accueil, Analyse, Paramètres) */
.subtabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 16px; max-width: 1120px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { flex: 1 0 auto; font: inherit; font-size: 14px; padding: 8px 14px; border: 0; border-radius: 10px;
  background: none; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.subtabs button:hover { background: var(--wash); color: var(--text-primary); }
.subtabs button[aria-selected="true"] { background: var(--accent-strong); color: var(--on-accent); font-weight: 600;
  box-shadow: 0 2px 8px rgba(196, 29, 43, 0.28); }
.subtabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .subtabs button { font-size: 13px; padding: 8px 10px; } }
.tab-panel > .card + .card, .tab-panel > section + section { margin-top: 16px; }
.tab-panel[hidden] { display: none !important; }

/* Profil : volume mensuel et records */
.pp-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 4px 0 12px; }
.pp-totals div { display: flex; flex-direction: column; padding: 8px 12px; background: var(--wash); border-radius: 10px; }
.pp-totals span { font-size: 12px; color: var(--text-secondary); }
.pp-totals b { font-size: 20px; font-variant-numeric: tabular-nums; }
.pp-totals small { font-size: 12px; font-weight: 400; color: var(--text-secondary); }
.pp-bar { fill: var(--accent); }
.tooltip .key.bar { background: var(--accent); height: 8px; border-radius: 2px; }
.pp-bar.current { fill-opacity: .45; }
.pill.rec { border-color: var(--accent); color: var(--accent); font-weight: 600; font-size: 11px; padding: 0 7px; }

/* Paramètres d'entraînement : rubriques en cartes, bouton secondaire */
.pf-form fieldset { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  padding: 14px 16px 16px; margin: 0 0 16px; min-width: 0; }
.pf-form legend { float: left; width: 100%; padding: 0; margin: 0 0 10px; font-weight: 600; font-size: 16px; }
.pf-form legend + * { clear: both; }
#pf-estimate { font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--surface); color: var(--accent); cursor: pointer; box-shadow: var(--shadow); }
#pf-estimate:hover { background: var(--accent-wash); }

/* Connexion et compte */
.auth-page { min-height: 100vh; }
.auth-wrap { max-width: 420px; margin: 0 auto; padding: 48px 16px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 24px; font-weight: 700; margin-bottom: 20px; color: var(--accent); }
.auth-brand svg { width: 30px; height: 30px; fill: var(--accent); stroke: none; }
.auth-card { padding: 24px; }
.auth-card h1 { font-size: 22px; margin: 0 0 14px; }
.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-form label { font-size: 14px; color: var(--text-secondary); margin-top: 8px; }
.auth-form input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); }
.auth-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.auth-primary { margin-top: 16px; font: inherit; font-weight: 600; padding: 11px; border: 0; border-radius: 10px; background: var(--accent-strong); color: var(--on-accent); cursor: pointer; box-shadow: var(--shadow); }
.auth-primary:hover { filter: brightness(.93); }
.auth-error { background: rgba(208, 59, 59, .10); border-left: 3px solid var(--critical); padding: 8px 12px; border-radius: 8px; }
.auth-info { background: var(--wash); border-left: 3px solid var(--text-muted); padding: 8px 12px; border-radius: 8px; }
.auth-links { display: flex; flex-direction: column; gap: 6px; margin: 18px 0 0; font-size: 14px; }
.session-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); margin: 0; }
.session-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.session-out { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); cursor: pointer; }
.session-out:hover { color: var(--accent); border-color: var(--accent); }
@media (min-width: 900px) { .session-box { margin-top: auto; padding: 10px; border-top: 1px solid var(--border); } }

/* Accueil : déconnexion, sous les paramètres d'entraînement */
.athlete-logout { flex: 1 1 100%; margin: 0; }
.athlete-logout button { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  color: var(--text-secondary); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.athlete-logout button:hover { color: var(--accent); border-color: var(--accent); }
.athlete-logout svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.session-out { text-decoration: none; }
.athlete-logout { display: flex; gap: 6px; }
.athlete-logout .athlete-account { flex: 1; display: inline-flex; align-items: center; justify-content: center; padding: 6px;
  border-radius: 999px; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--text-secondary);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.athlete-logout .athlete-account:hover { color: var(--accent); border-color: var(--accent); }
.athlete-logout button { flex: 1; }

/* Mon compte */
.acct-card { max-width: 720px; }
.acct-card h2 { margin-top: 0; }
.acct-status { padding: 8px 12px; border-radius: 8px; background: var(--wash); }
.acct-status.ok { background: var(--good-wash); }
.acct-form { max-width: 480px; }
.acct-form input { font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); width: 100%; }

/* PC : barre latérale figée, toujours visible au même endroit pendant le défilement */
@media (min-width: 900px) {
  .sidebar { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; }
}
.athlete.minimal .athlete-meta { display: none; }

/* Espace admin : journaux */
.lg-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; margin: 0 0 14px; font-size: 13px; color: var(--text-secondary); }
.lg-filters label { display: flex; flex-direction: column; gap: 4px; }
.lg-filters select, .lg-filters input { font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); }
.lg-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 14px; }
.lg-tiles div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.lg-tiles span { font-size: 12px; color: var(--text-secondary); }
.lg-tiles b { font-size: 22px; font-variant-numeric: tabular-nums; }
.lg-tiles b small { font-size: 12px; font-weight: 400; color: var(--text-secondary); }
.lg-tiles em { font-style: normal; font-size: 12px; color: var(--text-muted); }
.lg-table { width: 100%; font-size: 13px; }
.lg-table td, .lg-table th { white-space: nowrap; }
.lg-ua { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.lg-scroll { max-height: 420px; overflow-y: auto; }
.lg-kind { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--wash); }
.lg-kind.connexion { background: var(--good-wash); color: var(--delta-up); }
.lg-kind.refus { background: rgba(208, 59, 59, .12); color: var(--critical); }
.lg-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 14px; }
.lg-gauges .card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; }
.lg-gauges span { font-size: 12px; color: var(--text-secondary); }
.lg-gauges b { font-size: 24px; font-variant-numeric: tabular-nums; }
.lg-gauges em { font-style: normal; font-size: 12px; color: var(--text-muted); }
.lg-spark { width: 100%; height: 48px; margin-top: 6px; }
.lg-spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.lg-bar { height: 8px; border-radius: 4px; background: var(--grid); overflow: hidden; margin-top: 10px; }
.lg-bar i { display: block; height: 100%; background: var(--accent); }
.lg-services { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 16px; }
.lg-services li { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.tab-panel > .card + .card, .tab-panel > section.card + section.card { margin-top: 16px; }
.lg-msg { white-space: pre-wrap !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-word; }
.lg-msg.err { color: var(--critical); }
.us-card + .us-card { margin-top: 16px; }
.us-table td { vertical-align: top; }
.us-table select { font: inherit; font-size: 13px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); }
.us-actions { display: flex; flex-wrap: wrap; gap: 6px; white-space: normal !important; }
.us-actions .pill { cursor: pointer; font: inherit; font-size: 12px; }
.us-danger { color: var(--critical) !important; }
.us-link { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--accent-wash); }
.us-link input { width: 100%; font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); margin: 4px 0 8px; }
.us-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; align-items: end; }
.us-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.us-form input, .us-form select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); }

/* Espace admin : entrées principales, puis sous-onglets du groupe ouvert */
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.admin-nav a { padding: 8px 16px; border-radius: 12px; text-decoration: none; font-size: 15px; font-weight: 600; color: var(--text-secondary);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.admin-nav a:hover { color: var(--accent); border-color: var(--accent); }
.admin-nav a[aria-current="page"] { background: var(--accent-strong); color: var(--on-accent); border-color: var(--accent-strong); }
.admin-nav .admin-soon { padding: 8px 16px; border-radius: 12px; border: 1px dashed var(--axis); color: var(--text-muted); font-size: 14px; }
.admin-nav + .admin-tabs { padding-left: 12px; border-left: 3px solid var(--accent-wash); }

/* Prise de main d'un compte par un admin */
.takeover-strip { position: sticky; top: 0; z-index: 100; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px 16px; margin: 0; padding: 8px 16px; background: #7a3cd6; color: #fff; font-size: 14px; }
.takeover-strip button { font: inherit; font-weight: 600; padding: 4px 14px; border-radius: 999px; border: 0; background: #fff; color: #5a22a8; cursor: pointer; }

/* Première connexion : page « Bienvenue », sans navigation tant qu'intervals.icu n'est pas relié */
.welcome-wrap { max-width: 540px; }
.welcome-steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 14px; font-size: 14px; color: var(--text-muted); }
.welcome-steps li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--wash); }
.welcome-steps span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; font-weight: 700; font-size: 12px; }
.welcome-steps .current { color: var(--accent); font-weight: 600; }
.welcome-steps .current span { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.welcome-steps .done { color: var(--text-secondary); }
.welcome-howto, .welcome-tour { padding-left: 20px; line-height: 1.6; }
.welcome-go { display: block; text-align: center; text-decoration: none; }
.welcome-out { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; }

/* Admin → Utilisateurs : confirmation de Réinitialiser / Supprimer */
.us-dialog { max-width: 520px; width: calc(100% - 32px); border: 1px solid var(--border); border-radius: 14px; padding: 22px; background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow); }
.us-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.us-dialog h2 { margin: 0 0 4px; font-size: 19px; color: var(--critical); }
.us-dlg-who { font-weight: 600; margin: 0 0 10px; }
.us-dlg-check { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-radius: 10px; background: var(--wash); font-size: 14px; }
.us-dlg-warn { border-left: 3px solid var(--critical); padding: 6px 10px; background: rgba(208, 59, 59, .08); border-radius: 6px; }
.us-dlg-confirm { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.us-dlg-confirm input { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); }
.us-dialog .wk-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.us-dialog .wk-actions button { font: inherit; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); cursor: pointer; }
.us-dlg-go { background: var(--critical) !important; color: #fff !important; border-color: var(--critical) !important; font-weight: 600; }
.us-dlg-go:disabled { opacity: .45; cursor: not-allowed; }
/* Une ligne par compte : boutons alignés avec le nom, sans retour à la ligne (le tableau défile s'il manque de place) */
.us-row-actions { flex-wrap: nowrap; }
.us-row-actions .pill { white-space: nowrap; }
/* Sur ordinateur, le tableau des comptes prend toute la largeur disponible (sur mobile, il défile) */
@media (min-width: 900px) {
  main > section.us-accounts { max-width: none; }
  .us-table th, .us-table td { padding-left: 8px; padding-right: 8px; }
}
.tile .ftp-gap { color: var(--text-secondary); text-decoration: underline dotted; }

/* Admin → Roadmap */
.rm-tiles { margin-bottom: 14px; }
.rm-bar { display: block; height: 8px; border-radius: 4px; background: var(--wash); overflow: hidden; min-width: 120px; }
.rm-bar > i { display: block; height: 100%; border-radius: 4px; background: var(--accent-strong); }
.rm-fait .rm-bar > i { background: var(--good); }
.rm-tiles .rm-bar { margin-top: 8px; }
.rm-list { display: flex; flex-direction: column; gap: 12px; max-width: 1120px; }   /* une colonne : priorité de haut en bas */
.rm-epic { margin: 0; }
.rm-epic[hidden] { display: none; }
.rm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rm-head h2 { margin: 0; flex: 1 1 auto; font-size: 17px; }
.rm-status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-secondary); }
.rm-s-fait { border-color: var(--good); }
.rm-s-en_cours { border-color: var(--accent); color: var(--accent); }
.rm-progress { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; font-size: 13px; color: var(--text-secondary); }
.rm-progress .rm-bar { flex: 1; }
.rm-epic details summary { cursor: pointer; font-size: 13px; color: var(--text-secondary); margin-top: 6px; }
.rm-items { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; line-height: 1.45; }
.rm-items li { display: flex; gap: 8px; padding: 4px 0; border-top: 1px solid var(--border); }
.rm-items li > span { flex: 0 0 16px; text-align: center; font-weight: 700; }
.rm-i-fait > span { color: var(--good); }
.rm-i-en_cours > span { color: var(--accent); }
.rm-i-a_faire { color: var(--text-primary); }
.rm-i-a_faire > span { color: var(--text-muted); }
.rm-i-fait { color: var(--text-secondary); }
.rm-rank { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--accent-wash); color: var(--accent); font-weight: 700; font-size: 13px; }
.rm-move { display: inline-flex; gap: 4px; margin-left: 4px; }
.rm-move button { width: 26px; height: 26px; padding: 0; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font: inherit; font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer; }
.rm-move button:hover { color: var(--accent); border-color: var(--accent); }
.rm-move button:disabled { opacity: .5; }

/* Plans : plusieurs objectifs (A / B / C) */
.goal-rows { display: flex; flex-direction: column; gap: 10px; }
.goal-row { align-items: flex-end; padding: 10px; border-radius: 10px; background: var(--wash); }
.goal-row .goal-race { flex: 1 1 300px; }
.goal-remove { width: 34px; height: 34px; padding: 0; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font: inherit; font-size: 18px; cursor: pointer; }
.goal-remove:hover { color: var(--critical); border-color: var(--critical); }
.wk-form button.goal-add { align-self: flex-start; margin-top: 10px; background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); font-weight: 600; }
.wk-form button.goal-add:hover { filter: brightness(.93); }
.plan-goals { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.plan-goals .goal-A { background: var(--accent-strong); color: var(--on-accent); border-color: var(--accent-strong); }
.rm-items li { align-items: flex-start; }
.rm-items li > .rm-text { flex: 1; text-align: left; font-weight: normal; }
.rm-state { flex: 0 0 22px; height: 22px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: none; font: inherit; font-weight: 700; cursor: pointer; color: inherit; }
.rm-i-fait > .rm-state { color: var(--good); }
.rm-i-en_cours > .rm-state { color: var(--accent); }
.rm-i-a_faire > .rm-state { color: var(--text-muted); }
.rm-state:hover { border-color: var(--border); background: var(--wash); }
.rm-del { flex: 0 0 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-muted); font-size: 16px; cursor: pointer; opacity: .55; }
.rm-items li:hover .rm-del, .rm-del:focus-visible { opacity: 1; }
.rm-del:hover { color: var(--critical); background: var(--wash); }
.rm-add { display: flex; gap: 6px; margin-top: 8px; }
.rm-add input { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); }
.rm-add select { font: inherit; font-size: 13px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); }
.rm-add button { width: 32px; border-radius: 8px; border: 0; background: var(--accent-strong); color: var(--on-accent); font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; }

/* Calendrier : corbeille sur une séance (prévue, non réalisée, brouillon) */
.cal-entry { position: relative; }
.cal-entry .cal-item { padding-right: 30px; }
.cal-trash { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; }
.cal-trash svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cal-trash:hover, .cal-trash:focus-visible { color: var(--critical); background: var(--surface); }
@media (hover: hover) {
  .cal-trash { opacity: 0; }
  .cal-entry:hover .cal-trash, .cal-trash:focus-visible { opacity: 1; }
}

/* Calendrier : semaine en écart avec le prévu */
.wk-gap { margin-top: 8px; padding: 8px; border-radius: 8px; background: var(--wash); border-left: 3px solid var(--warning); display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.wk-gap b { font-size: 12px; }
.wk-gap span { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.wk-gap-go { margin-top: 4px; font: inherit; font-size: 12px; font-weight: 600; padding: 6px 10px; border: 0; border-radius: 8px; background: var(--accent-strong); color: var(--on-accent); cursor: pointer; }
.wk-gap-go:hover { filter: brightness(.93); }
.wk-gap-keep { font: inherit; font-size: 12px; background: none; border: 0; padding: 0; color: var(--text-secondary); text-decoration: underline dotted; cursor: pointer; align-self: flex-start; }
.wk-gap-dlg textarea { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); }
.wk-gap-dlg .primary-go { background: var(--accent-strong) !important; color: var(--on-accent) !important; border-color: var(--accent-strong) !important; font-weight: 600; }

/* Admin → Réajustements : seuils de détection */
.seuils-card { margin-top: 20px; max-width: 1000px; }
.seuils-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px 18px; }
.seuils-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.seuils-input { display: flex; align-items: center; gap: 6px; color: var(--text-primary); }
.seuils-input input { width: 90px; font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); }

/* Plans : suppression (corbeille dans la liste, fenêtre garder / supprimer les séances) */
.plan-trash { position: static; opacity: 1 !important; }
.plan-delete { margin-top: 28px; }
.plan-del-choice { border: 0; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.plan-del-choice legend { font-weight: 600; margin-bottom: 4px; }
.plan-del-choice .wk-check { align-items: flex-start; font-size: 14px; line-height: 1.4; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.plan-list tr.plan-child td { font-size: 13px; color: var(--text-secondary); }
.plan-list tr.plan-child td:nth-child(2) { padding-left: 22px; }
.plan-child-tag { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* Plan saison : blocs de 4 semaines */
.season { margin: 24px 0; padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.season h2 { margin-top: 0; }
.season-blocks { padding-left: 20px; line-height: 1.8; }
.season-next { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.season-next.due { padding: 10px; border-radius: 10px; border-left: 3px solid var(--accent); background: var(--accent-wash); }
.season-next textarea { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); }
.season-next label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.season-next .primary { background: var(--accent-strong); border: 0; color: var(--on-accent); font: inherit; font-weight: 600; padding: 9px 14px; border-radius: 10px; cursor: pointer; }
/* Plans : la liste des plans demandés prend toute la largeur sur ordinateur (sur mobile, elle défile) */
@media (min-width: 900px) { .plan-list { max-width: 1120px; } .plan-list td:nth-child(2) { white-space: normal; min-width: 260px; } }

/* Plan : le plan en bref (phases), détails repliés */
.plan-phases { margin: 0 0 18px; padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.plan-phases h2 { margin-top: 0; }
.plan-phase-table td { white-space: normal; vertical-align: top; line-height: 1.45; font-size: 14px; }
.plan-phase-table td.ph-when { white-space: nowrap; }
.plan-logic { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-wash); border-radius: 6px; }
.plan-logic h3 { margin: 0 0 4px; font-size: 14px; }
.plan-logic p { margin: 0; line-height: 1.55; }
.plan-details { margin: 0 0 16px; }
.plan-details summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 6px 0; }
.plan-details p { line-height: 1.6; margin: 8px 0; max-width: 75ch; }

/* Identité : logo (icône WUW + mot-symbole), page de connexion avec illustration */
.wordmark { font-weight: 900; font-style: italic; letter-spacing: -0.02em; color: var(--text-primary); white-space: nowrap; }
.wordmark > span { color: var(--accent); }
.instances .brand { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 0; margin-right: 8px; border: 0;
  border-right: 1px solid var(--border); border-radius: 0; text-decoration: none; }
.instances .brand:hover { background: none; }
.instances .brand img { display: block; border-radius: 7px; }
.instances .brand .wordmark { font-size: 17px; }
@media (max-width: 599px) { .instances .brand .wordmark { display: none; } }
.auth-brand img { border-radius: 10px; }
.auth-brand .wordmark { font-size: 26px; }

.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-hero { background: #010b17; color: #e9edf3; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 28px 16px 22px; text-align: center; }
.auth-hero img { display: block; width: 100%; max-width: 300px; height: auto; }
.auth-hero-name { margin: 10px 0 0; font-size: 34px; color: #fff; line-height: 1; }
.auth-tagline { margin: 8px 0 0; color: #b8c2cf; font-size: 15px; letter-spacing: .01em; }
.auth-split .auth-wrap { padding-top: 28px; }
.auth-split .auth-brand { display: none; }            /* le nom est dans le panneau */
@media (min-width: 960px) {
  .auth-split { grid-template-columns: minmax(0, 1.1fr) minmax(440px, 1fr); }
  .auth-hero { padding: 48px; }
  .auth-hero img { max-width: 460px; }
  .auth-hero-name { font-size: 54px; margin-top: 18px; }
  .auth-tagline { font-size: 17px; margin-top: 12px; }
  .auth-split .auth-wrap { align-self: center; padding: 48px 32px; }
}
.instances .brand img, .auth-brand img { box-shadow: 0 0 0 1px var(--border); }

/* Police des titres : Saira (libre, OFL), servie par le site */
@font-face { font-family: "Saira"; src: url("fonts/saira-latin-800-italic.woff2") format("woff2"); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Saira"; src: url("fonts/saira-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Saira"; src: url("fonts/saira-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
.wordmark { font-family: "Saira", system-ui, sans-serif; font-weight: 800; font-style: italic; letter-spacing: -0.01em; }
h1, .auth-card h1 { font-family: "Saira", system-ui, sans-serif; font-weight: 700; letter-spacing: -0.005em; }

/* Attente (plans, pacing, analyses) : traits de vitesse animés */
.speed-loader { display: inline-flex; flex-direction: column; gap: 3px; width: 26px; vertical-align: middle; margin-right: 10px; }
.speed-loader i { display: block; height: 3px; border-radius: 2px; background: var(--accent); transform-origin: left;
  animation: speed 1.1s ease-in-out infinite; }
.speed-loader i:nth-child(2) { width: 75%; animation-delay: .15s; opacity: .75; }
.speed-loader i:nth-child(3) { width: 50%; animation-delay: .3s; opacity: .5; }
@keyframes speed { 0% { transform: translateX(-6px) scaleX(.4); opacity: .2; } 50% { transform: translateX(4px) scaleX(1); opacity: 1; } 100% { transform: translateX(14px) scaleX(.3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .speed-loader i { animation: none; } }
.wordmark > span { color: #e1131f; }       /* rouge de la marque (celui de l'icône), dans tous les thèmes */
/* Illustration des athlètes (le nom est dans l'image) */
.auth-hero img.auth-hero-art { max-width: 560px; }
@media (min-width: 960px) { .auth-hero img.auth-hero-art { max-width: 760px; } }
.plan-validate-dlg .primary-go { background: var(--accent-strong); color: var(--on-accent); border-color: var(--accent-strong); font-weight: 600; }
.plan-validate-dlg ul { padding-left: 20px; line-height: 1.6; }

/* Calendrier : glisser-déposer des séances */
.cal-entry[draggable="true"] { cursor: grab; }
.cal-entry.dragging { opacity: .45; }
.cal-day.drop-day { outline: 2px dashed var(--accent); outline-offset: -3px; background: var(--accent-wash); }
.cal-entry.drop-swap { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
.cal-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; display: flex; gap: 14px; align-items: center;
  padding: 10px 16px; border-radius: 10px; background: #0b1426; color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: 14px; }
.cal-toast[hidden] { display: none; }
.cal-toast .link { color: #ff8a92; background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.coach-dlg h2 { color: var(--text-primary) !important; }
.coach-dlg ul { padding-left: 20px; line-height: 1.55; }
.coach-dlg li + li { margin-top: 6px; }
.coach-dlg .primary-go { background: var(--accent-strong); color: var(--on-accent); border-color: var(--accent-strong); font-weight: 600; }
/* Calendrier : avis du coach (IA) sur une semaine */
.wk-advice { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.wk-advice button { font: inherit; font-size: 12px; font-weight: 600; padding: 6px 8px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--surface); color: var(--accent); text-align: left; }
.wk-advice button:hover { background: var(--accent-wash); }
.wk-advice-wait { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; }
.coach-dlg h3 { font-size: 14px; margin: 12px 0 4px; }
.plan-row-actions { white-space: nowrap; }
.plan-row-actions .plan-edit { margin-right: 6px; font-size: 12px; }
/* Plans : « Modifier » et la corbeille sur une seule ligne ; liste sur toute la largeur sur ordinateur */
.plan-row-actions > * { vertical-align: middle; }
.plan-row-actions .plan-trash { display: inline-grid; }
.plan-row-btns { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
@media (min-width: 900px) { main > section.plan-list { max-width: none; } }

/* Nouvelle séance : choisir comment la construire */
.wk-start { margin: 8px 0 16px; }
.wk-start h2 { font-size: 17px; margin: 0 0 10px; }
.wk-start-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.wk-start-choices button { text-align: left; font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-primary); cursor: pointer; display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow); }
.wk-start-choices button span { font-size: 13px; color: var(--text-secondary); }
.wk-start-choices button:hover, .wk-start-choices button[aria-selected="true"] { border-color: var(--accent); background: var(--accent-wash); }
.wk-start-panel { margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.wk-start-panel input[type="range"] { width: 100%; accent-color: var(--accent); }
.wk-start.done .wk-start-choices button { padding: 8px 12px; }
.lib-actions { align-self: flex-end; flex-wrap: wrap; }
.lib-actions label.inline { display: inline-flex; align-items: center; gap: 6px; }
.lib-mine-head { margin-bottom: 6px; }
.lib-tree { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.lib-cat { border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; }
.lib-cat summary { cursor: pointer; padding: 7px 0; font-weight: 600; }
.lib-cat.empty { display: none; }
.lib-tree.dragging .lib-cat.empty { display: block; border-style: dashed; }
.lib-cat.over { border-color: var(--accent); background: var(--accent-wash); }
.lib-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--border); cursor: grab; }
.lib-grip { color: var(--text-secondary); user-select: none; }
.lib-load { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; text-align: left; font: inherit;
  background: none; border: 0; padding: 4px 0; color: var(--text-primary); cursor: pointer; }
.lib-load:hover span:first-child { color: var(--accent); text-decoration: underline; }
.mini-profile { flex: none; width: 120px; height: 24px; border-radius: 3px; background: var(--surface-2, transparent); }
.cal-item .cal-profile { display: block; width: 100%; height: 18px; margin-top: 3px; }
@media (max-width: 520px) { .mini-profile:not(.cal-profile) { width: 72px; height: 20px; } }
.lib-row-cat { max-width: 40%; font-size: 13px; }
@media (pointer: fine) { .lib-row-cat { display: none; } .lib-row:hover .lib-row-cat, .lib-row-cat:focus { display: inline-block; } }
.lib-dialog { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text-primary);
  padding: 16px 18px; max-width: min(420px, calc(100vw - 32px)); }
.lib-dialog::backdrop { background: rgba(0, 0, 0, .4); }
.lib-dialog h3 { margin: 0 0 12px; font-size: 16px; overflow-wrap: anywhere; }
.lib-dialog label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.lib-save { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lib-save select, .lib-actions select { max-width: 100%; }
/* Calendrier : la météo s'arrête avant le « + » d'ajout (en haut à droite des jours à venir) */
.cal-day:not(.past) .cal-date { padding-right: 30px; }

/* Admin → Consommation tokens */
.tk-top { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; max-width: 1120px; }
@media (min-width: 1000px) { .tk-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.tk-donut { width: 210px; height: 210px; display: block; margin: 6px auto 10px; transform: rotate(0deg); }
.tk-donut-big { font-size: 6px; font-weight: 700; fill: var(--text-primary); font-family: "Saira", system-ui, sans-serif; }
.tk-donut-small { font-size: 2.6px; fill: var(--text-secondary); }
.tk-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.tk-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.tk-over { color: var(--critical); }
.tk-table .tk-sub td { font-size: 12px; color: var(--text-secondary); }
.tk-table .tk-total td { border-top: 2px solid var(--border); }
.tk-ref form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; align-items: end; }
.tk-ref label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.tk-ref input { font: inherit; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); }
.subtabs a { flex: 1 0 auto; text-align: center; font-size: 14px; padding: 8px 14px; border-radius: 10px; color: var(--text-secondary); text-decoration: none; }
.subtabs a:hover { background: var(--wash); color: var(--text-primary); }
.subtabs a[aria-current="page"] { background: var(--accent-strong); color: var(--on-accent); font-weight: 600; }
/* Admin → Worker : modèle par action */
.wm-card { max-width: 1000px; margin-bottom: 16px; }
.wm-table select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--text-primary); }
.wm-table td { white-space: normal; vertical-align: middle; }
.wm-models { padding-left: 20px; line-height: 1.6; font-size: 14px; }

/* Paramètres → Préférences d'entraînement : gestion de la bibliothèque de séances */
.lm { margin-top: 20px; }
.lm h2 { font-size: 17px; margin: 0 0 6px; }
.lm h3 { font-size: 15px; margin: 18px 0 8px; }
.lm button, .lm a.button { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--axis);
  background: var(--surface); color: var(--text-primary); cursor: pointer; text-decoration: none; display: inline-block; }
.lm button:hover:not(:disabled), .lm a.button:hover { background: var(--wash); }
.lm button.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); font-weight: 600; }
.lm .lm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.lm .lm-icon { border: 0; background: none; padding: 2px 5px; font-size: 14px; }
.lm .lm-icon:disabled { opacity: .3; cursor: default; }
.lm-cat summary { display: flex; align-items: center; gap: 6px; }
.lm-cat summary .lm-tools { margin-left: auto; display: inline-flex; gap: 2px; }
.lm-row { cursor: grab; }
.lm-row .lm-text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.lm-row .lm-move { max-width: 34%; font-size: 13px; }
.lm-rename { font: inherit; padding: 2px 6px; min-width: 0; flex: 1; }
.lm-empty { margin: 4px 0 8px; }
.lm-tree .lib-cat.empty { display: block; }
.wk-msg.bad, #lm-msg.bad { color: var(--danger, #c0392b); }
@media (max-width: 520px) { .lm-row .lm-move { max-width: 40%; } .lm-row .mini-profile { width: 64px; } }

/* Paramètres : zones cardio et de puissance */
.zn { margin-top: 16px; }
.zn h2 { font-size: 17px; margin: 0 0 6px; }
.zn-table { border-collapse: collapse; width: 100%; max-width: 560px; margin: 8px 0 12px; font-size: 14px; }
.zn-table th, .zn-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.zn-table th { font-weight: 600; color: var(--text-secondary); font-size: 13px; }
.zn-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--axis); }
.zn-mode { display: flex; gap: 16px; margin: 6px 0; }
.zn-inputs { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.zn-inputs input { width: 72px; font: inherit; padding: 4px 6px; }
.zn-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.zn button { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--accent-strong);
  background: var(--accent-strong); color: var(--on-accent); font-weight: 600; cursor: pointer; }
@media (max-width: 520px) { .zn-table th, .zn-table td { padding: 4px 5px; font-size: 13px; } }

/* Nutrition : glucides à prévoir (calendrier, onglet Nutrition) */
.cal-food { display: block; font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nu-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin: 12px 0; }
.nu-day.rest { opacity: .8; }
.nu-day.loading { border-color: var(--accent); }
.nu-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.nu-head h2 { font-size: 15px; margin: 0; text-transform: capitalize; }
.nu-target { font-size: 13px; }
.nu-level { margin: 4px 0 8px; }
.nu-session { border-top: 1px solid var(--border); padding: 6px 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.nu-name { font-weight: 600; }
.nu-chip { background: var(--accent-wash); border-radius: 999px; padding: 1px 8px; font-size: 13px; }
.nu-tip { margin: 2px 0 0; width: 100%; color: var(--text-secondary); }
.nu-around { margin: 8px 0 0; }
.nu-rules { margin-top: 12px; }

/* Admin → Sauvegardes */
.bk-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0 18px; }
.bk-summary .card { display: flex; flex-direction: column; gap: 4px; }
.bk-summary .card span { color: var(--text-secondary); font-size: 13px; }
.bk-summary .card em { font-style: normal; color: var(--text-secondary); font-size: 13px; }
.bk-summary .bk-alerte { border-color: var(--danger, #c0392b); }
.bk-summary .bk-attention { border-color: #e0a100; }
.bk-title { font-size: 17px; margin: 18px 0 8px; }
.bk-missing { color: var(--danger, #c0392b); font-weight: 600; }
.bk-scope li { margin-bottom: 6px; }

/* Double authentification (Paramètres → Mon compte) */
.mfa-dlg { max-width: min(460px, calc(100vw - 32px)); }
.mfa-dlg label { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.mfa-qr svg { display: block; width: 200px; height: 200px; margin: 6px auto; background: #fff; border-radius: 8px; }
.mfa-codes { columns: 2; font-family: ui-monospace, monospace; font-size: 15px; padding-left: 24px; }
.auth-inline { display: inline; }

/* Paramètres → Mon compte : IA de l'utilisateur */
.ia-model { flex-wrap: wrap; align-items: flex-end; }
.ia-model label { display: flex; flex-direction: column; gap: 4px; }
.ia-key-panel { margin: 4px 0 8px 28px; padding-left: 12px; border-left: 3px solid var(--accent-wash, var(--border)); }
.ia-back { margin: 6px 0 4px 28px; }
.ia-choice { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin: 10px 0; }
.ia-choice legend { font-weight: 600; padding: 0 4px; }
.ia-option { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.ia-option.disabled { opacity: .6; }
.ia-quota { margin: 10px 0; }
.ia-quota summary { cursor: pointer; font-weight: 600; }
.ia-quota-table { table-layout: auto; max-width: 100%; }
.ia-quota-table td { padding: 4px 8px; white-space: normal; }
.ia-quota-table td.num { white-space: nowrap; width: 1%; }
.ia-bar { width: 72px; }
.ia-bar span { display: block; height: 8px; border-radius: 4px; background: var(--accent); min-width: 2px; }
.ia-full td { color: var(--danger, #c0392b); font-weight: 600; }
.qt-form input { width: 96px; font: inherit; padding: 3px 6px; }
.qt-form td, .qt-form th { padding: 5px 8px; }

/* Accueil : séance prévue associée à la séance réalisée */
.match-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 10px; font-size: 14px; }
.match-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.match-other { font: inherit; font-size: 13px; max-width: 100%; }
.plan-gap { margin-top: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid #e0a100; background: rgba(224, 161, 0, .08); }
.plan-gap p { margin: 0 0 8px; }
.plan-gap button.primary { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--accent-strong);
  background: var(--accent-strong); color: var(--on-accent); font-weight: 600; cursor: pointer; }

/* Prise de main : réglages de l'utilisateur en lecture seule */
.ro-banner { margin: 6px 0 10px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--danger, #c0392b);
  background: rgba(192, 57, 43, .08); color: var(--danger, #c0392b); font-weight: 600; font-size: 14px; }
.ro-wrap { border: 0; padding: 0; margin: 0; min-width: 0; }
.ro-wrap[disabled] { opacity: .75; }

/* Paramètres : nom du compte */
.nm-card { margin-bottom: 14px; }
.nm-card h2 { font-size: 16px; margin: 0 0 8px; }
.nm-fields { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.nm-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.nm-fields input { font: inherit; padding: 5px 8px; min-width: 0; width: 200px; max-width: 100%; }
.nm-fields button { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--axis); background: var(--surface); cursor: pointer; }
