:root {
  /* Thème Prisia (suite PrisiaSoft) : bleu nuit, sarcelle, dégradé de marque */
  --brand: #135a80;        /* accent Prisia (boutons, éléments actifs) */
  --brand-h: #1c7aa8;      /* accent au survol */
  --brand-dark: #135a80;   /* liens, textes d'accent */
  --brand-ink: #ffffff;    /* texte posé sur l'accent */
  --brand-soft: #d2e7f5;   /* fond clair d'accent */
  --navy: #0d3b66;         /* bleu du mot « Prisia » */
  --grad: linear-gradient(100deg, #3d7bf0, #4cc3cf 55%, #9be86a);
  --ink: #121a2c;
  --ink-2: #3e4c61;
  --muted: #5f6d82;
  --line: #c9d8e7;
  --bg: #cddbe9;
  --card: #eef4fa;
  --ok: #2b8a3e;
  --ok-bg: #e9f7ec;
  --warn: #b35c00;
  --warn-bg: #fff4e5;
  --err: #c92a2a;
  --err-bg: #fdecec;
  --info-bg: #e7f1fb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 33, 43, .06), 0 2px 8px rgba(20, 33, 43, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--brand-dark); }
h1 { font-size: 1.55rem; margin: 0 0 .25rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 1rem; }
.mb0 { margin-bottom: 0; }

/* ---------- En-tête ---------- */
.topbar { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 10; }
.topbar .inner { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 16px; min-height: 56px; }
.logo { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: .3px; white-space: nowrap; }
.logo span { color: var(--brand); }
.logo img { display: block; height: 44px; width: auto; border-radius: 8px; background: var(--brand); }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #cfd8de; text-decoration: none; padding: 8px 11px; border-radius: 7px; white-space: nowrap; font-size: .93rem; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.active { color: var(--brand-ink); background: var(--brand); font-weight: 600; }
.who { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: #cfd8de; white-space: nowrap; }
.who form { margin: 0; }
.who button { background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-size: .85rem; }
.who button:hover { background: rgba(255,255,255,.1); }

@media (max-width: 760px) {
  .topbar .inner { flex-wrap: wrap; gap: 6px 12px; padding: 8px 16px 0; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 6px; }
  .who { margin-left: auto; }
  .who .name { display: none; }
}

/* ---------- Mise en page ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }

.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; text-decoration: none; color: inherit; display: block; }
.stat .v { font-size: 1.7rem; font-weight: 750; line-height: 1.1; }
.stat .l { color: var(--ink-2); font-size: .88rem; }
.stat.alert .v { color: var(--err); }
.stat.warn .v { color: var(--warn); }

/* ---------- Messages ---------- */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.flash.ok { background: var(--ok-bg); color: #1e5e2b; border-color: #c4e6cc; }
.flash.err { background: var(--err-bg); color: #8f1f1f; border-color: #f4c7c7; }
.flash.info { background: var(--info-bg); color: #184c7a; border-color: #c6dcf2; }
.linkbox { display: flex; gap: 8px; margin-top: 8px; }
.linkbox input { flex: 1; font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }

/* ---------- Boutons ---------- */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 8px; font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #c5cfd5; background: #fafbfb; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-h); border-color: var(--brand-h); }
.btn.danger { color: var(--err); border-color: #f0c2c2; }
.btn.danger:hover { background: var(--err-bg); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.small { padding: 4px 10px; font-size: .84rem; }
.btn.block { width: 100%; }
.inline { display: inline; margin: 0; }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], input[type=tel], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cdd0d3; border-radius: 8px; font: inherit; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(28, 122, 168, .18); }
textarea { min-height: 84px; resize: vertical; }
input[type=color] { width: 48px; height: 38px; padding: 2px; border: 1px solid #cdd0d3; border-radius: 8px; background: #fff; }
.field { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; color: var(--ink); }
.check input { margin-top: 4px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 3px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input, .filters select { width: auto; }
.filters input[type=search] { min-width: 200px; }
.hp { position: absolute; left: -9999px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 4px; margin: 0 0 14px; }
legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 650; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfb; }
td.actions { white-space: nowrap; text-align: right; }
td a.rowlink { color: var(--ink); font-weight: 600; text-decoration: none; }
td a.rowlink:hover { color: var(--brand-dark); text-decoration: underline; }

/* ---------- Pastilles ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 650; background: #eef1f3; color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.info { background: var(--info-bg); color: #1c5d99; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.group-tag { display: inline-flex; align-items: center; font-size: .85rem; white-space: nowrap; }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* ---------- Listes de séances ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: none; }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 650; }
.list .s { color: var(--ink-2); font-size: .88rem; }
.datebox { width: 52px; flex: none; text-align: center; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); padding: 5px 0; line-height: 1.1; }
.datebox .d { font-size: 1.25rem; font-weight: 800; }
.datebox .m { font-size: .72rem; text-transform: uppercase; font-weight: 700; }
.cancelled .t { text-decoration: line-through; color: var(--muted); }
.empty { color: var(--muted); padding: 14px 0; text-align: center; }

/* ---------- Programme : semaines ---------- */
.week { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.week-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; padding: 10px 16px; background: #fbfcfc; border-bottom: 1px solid var(--line); }
.week-head b { font-size: .95rem; }
.week-head .sum { color: var(--ink-2); font-size: .86rem; }
.week.current { outline: 2px solid var(--brand); }
.wo { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.wo:last-child { border-bottom: none; }
.wo .when { width: 78px; flex: none; font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.wo .when.today { color: var(--brand-dark); }
.wo .body { flex: 1; min-width: 0; }
.wo .type, .fuel .type { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #fff; padding: 2px 7px; border-radius: 5px; margin-right: 6px; vertical-align: 1px; }
.wo .title { font-weight: 650; }
.wo .details { white-space: pre-line; color: var(--ink-2); font-size: .9rem; margin-top: 4px; }
.wo .meta { font-size: .84rem; color: var(--muted); margin-top: 3px; }
.wo.done { background: #f6fbf7; }
.wo .side { flex: none; text-align: right; }
.feedback { background: #f4f6f7; border-radius: 8px; padding: 8px 10px; font-size: .88rem; margin-top: 6px; white-space: pre-line; }
details.done-form summary, details.comment-form summary { cursor: pointer; list-style: none; }
details.done-form summary::-webkit-details-marker, details.comment-form summary::-webkit-details-marker { display: none; }
details.done-form[open], details.comment-form[open] { flex-basis: 100%; }
/* Séance : actions (effort, commentaire), effort ressenti, historique des commentaires */
.wo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wo-actions details[open] > summary { margin-bottom: 0; }
.wo-status { margin-top: 6px; font-size: .88rem; font-weight: 650; color: var(--ok); }
.rpe-chip { display: inline-block; margin-left: 4px; padding: 1px 9px; border-radius: 999px; font-size: .8rem; font-weight: 650; color: #fff; vertical-align: 1px; }
.rpe-chip.r-low { background: #2b8a3e; }
.rpe-chip.r-mid { background: #e8a200; color: #fff; }
.rpe-chip.r-high { background: #e8590c; }
.rpe-chip.r-max { background: #c92a2a; }
.rpe-field { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 2px; } /* libellé au-dessus, curseur pleine largeur */
.rpe-range { width: 100%; height: 32px; padding: 0; border: 0; accent-color: #8a9096; cursor: pointer; }
.rpe-range.unset { opacity: .55; }
.rpe-range.r-low { accent-color: #2b8a3e; }
.rpe-range.r-mid { accent-color: #e8a200; }
.rpe-range.r-high { accent-color: #e8590c; }
.rpe-range.r-max { accent-color: #c92a2a; }
.rpe-out { font-weight: 650; font-size: .95rem; }
.rpe-scale { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); margin: 0 0 10px; }
.wo-comments { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.wo-comments li { background: #f4f6f7; border-radius: 8px; padding: 7px 10px; font-size: .88rem; }
.wo-comments li.coach { background: var(--brand-soft); }
.wo-comments .c-head { display: flex; gap: 8px; align-items: baseline; font-size: .8rem; }
.wo-comments .c-body { white-space: pre-line; margin-top: 2px; overflow-wrap: anywhere; }
.wo-comments .c-del-form { margin-left: auto; }
.c-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 4px; }
.c-del:hover { color: var(--err); }
.done-panel { margin-top: 10px; padding: 12px; background: #fbfcfc; border: 1px solid var(--line); border-radius: 8px; text-align: left; }
@media (max-width: 640px) {
  .wo { flex-wrap: wrap; }
  .wo .when { width: 100%; }
  .wo .side { width: 100%; text-align: left; }
}

/* ---------- Pages publiques ---------- */
.auth { max-width: 440px; margin: 6vh auto 0; }
.auth .brand { text-align: center; margin-bottom: 18px; }
.auth .brand .logo { color: var(--ink); font-size: 2rem; }
.auth .brand .logo span { color: var(--brand); }
.brand-logo { display: block; width: 300px; max-width: 86%; height: auto; margin: 0 auto 10px; border-radius: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); background: #fff; padding: 10px 16px; }
.auth .brand p { color: var(--ink-2); margin: 4px 0 0; }
.auth.wide { max-width: 640px; }

footer.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 0 16px 24px; }

.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 12px; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .kv { grid-template-columns: minmax(0, 1fr); } .kv dd { margin-bottom: 6px; } }

.progress { height: 8px; background: #edf0f2; border-radius: 99px; overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: var(--ok); }

/* ---------- Programme : mise en page coach ---------- */
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.plan-layout aside .card + .card { margin-top: 16px; }
.plan-layout .sticky { position: sticky; top: 72px; }
@media (max-width: 960px) {
  .plan-layout { grid-template-columns: minmax(0, 1fr); }
  .plan-layout aside { order: -1; }
  .plan-layout .sticky { position: static; }
}
.details-text { white-space: pre-line; color: var(--ink-2); }
details.card summary { cursor: pointer; }
select[multiple] { padding: 4px; }
.entry-grid { display: grid; grid-template-columns: 150px 110px 130px minmax(0, 1fr) auto; gap: 8px; margin-top: 8px; align-items: end; }
.entry-grid label { font-size: .78rem; margin-bottom: 2px; }
@media (max-width: 700px) {
  .entry-grid { grid-template-columns: 1fr 1fr; }
  .entry-grid .entry-btn { grid-column: 1 / -1; }
}

/* ---------- VMA ---------- */
.vma-badge { display: inline-flex; align-items: baseline; gap: 6px; background: var(--brand); color: var(--brand-ink); border-radius: 10px; padding: 6px 12px; font-weight: 800; font-size: 1.2rem; }
.vma-badge small { color: var(--brand-ink); font-weight: 600; font-size: .78rem; opacity: .75; }
.vma-table td, .vma-table th { padding: 6px 8px; }
.vma-table tr.vma-100 td { background: var(--brand-soft); }

/* ---------- Impression ---------- */
.print-only { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .topbar, .no-print, footer.foot, .flash, .tabs, .linkbox { display: none !important; }
  .print-only { display: block; }
  main { padding: 0; max-width: none; }
  .card, .stat, .week { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  a { color: inherit; text-decoration: none; }
  .badge { border: 1px solid #bbb; }
  .vma-table tr.vma-100 td { background: #eee; }
}
.print-head { margin-bottom: 10px; } .print-head img { vertical-align: middle; border-radius: 10px; margin-right: 8px; }

/* ---------- Profil sportif ---------- */
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.days { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-top: 6px; }
.days .check { margin: 0; }
fieldset.health { border-color: #f0c2c2; background: #fffafa; }
.alerts { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Générateur : graphique de volume ---------- */
.vol-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin: 14px 0 4px; padding: 0 2px; border-bottom: 1px solid var(--line); }
.vol-bar { flex: 1; min-width: 6px; border-radius: 4px 4px 0 0; position: relative; background: #8fb8de; }
.vol-bar span { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: .68rem; color: var(--muted); }
.vol-bar.foncier, .legend.foncier { background: #2e7d32; }
.vol-bar.developpement, .legend.developpement { background: #ef6c00; }
.vol-bar.specifique, .legend.specifique { background: #c62828; }
.vol-bar.affutage, .legend.affutage { background: #1565c0; }
.vol-bar.rec, .legend.rec { background: #b0b7bd; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 3px 0 8px; vertical-align: middle; }
@media (max-width: 640px) { .vol-bar span { display: none; } }

.intensity-note { font-size: .9rem; color: var(--ink-2); }
.intensity-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.intensity-switch .check { margin: 0; }

.mode-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0; }
@media (max-width: 700px) { .mode-compare { grid-template-columns: 1fr; } }
.mode-col { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.mode-col h4 { margin: 0 0 4px; font-size: 1rem; }
.mode-col ul { margin: 6px 0; padding-left: 0; list-style: none; font-size: .9rem; }
.mode-col li { padding-left: 22px; position: relative; margin-bottom: 4px; }
.mode-col .pros li::before { content: "+"; position: absolute; left: 4px; color: var(--ok); font-weight: 800; }
.mode-col .cons li::before { content: "–"; position: absolute; left: 5px; color: var(--err); font-weight: 800; }
details.mode-help summary { cursor: pointer; color: var(--brand-dark); font-weight: 600; margin: 4px 0 8px; }
input[readonly] { background: #f2f3f4; color: var(--ink-2); }

/* ---------- Assistant pas à pas (générateur) ---------- */
.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: s; }
.stepper li { flex: 1; min-width: 0; }
.stepper .step { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--card); box-shadow: var(--shadow); color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.stepper li { display: flex; }
.stepper .step { flex: 1; min-width: 0; }
.stepper .num { width: 24px; height: 24px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #e6e8ea; color: var(--ink-2); font-size: .8rem; }
.stepper li.current .step { color: var(--ink); outline: 2px solid var(--brand); }
.stepper li.current .num { background: var(--brand); color: var(--brand-ink); }
.stepper li.done .step { color: var(--ink-2); }
.stepper li.done .num { background: var(--ok); color: #fff; }
.stepper .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .stepper li:not(.current) .lbl { display: none; }
  .stepper li:not(.current) { flex: none; }
}
.wizard { max-width: 760px; }
.wizard-search { margin-bottom: 10px; }
.pick-list { display: grid; gap: 8px; }
.pick { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; }
.pick:hover { border-color: #c9ced2; background: #fcfcfc; }
.pick-t { font-weight: 650; flex: 1 1 60%; }
.pick-s { color: var(--ink-2); font-size: .88rem; flex-basis: 100%; }
.pick.radio { padding-left: 42px; position: relative; }
.pick.radio input[type=radio] { position: absolute; left: 14px; top: 15px; width: 18px; height: 18px; accent-color: #b39b00; }
.pick.radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.pick select { width: auto; margin-top: 6px; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.wizard-nav .btn.primary { min-width: 180px; }
@media (max-width: 640px) { .wizard-nav .btn { flex: 1; } }
details.week-fold > summary { cursor: pointer; list-style: none; }
details.week-fold > summary::-webkit-details-marker { display: none; }
details.week-fold > summary b::before { content: "▸ "; color: var(--muted); }
details.week-fold[open] > summary b::before { content: "▾ "; }
.fit-link { margin-right: 4px; }
.garmin-card .card-head { flex-wrap: wrap; }

/* App installable (PWA) */
.install-app { border-left: 4px solid var(--brand); }
.install-row { display: flex; gap: 12px; align-items: center; }
.install-row img { border-radius: 12px; flex: none; }
.install-steps { margin: 12px 0 10px; padding-left: 20px; }
[hidden] { display: none !important; }
@media (display-mode: standalone) { .install-app { display: none !important; } }

/* Messagerie */
.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: 9px; background: var(--err); color: #fff; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; }
.chat { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.bubble { max-width: 82%; padding: 9px 12px; border-radius: 14px; background: #eef0f2; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.bubble.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble .meta { display: block; margin-top: 4px; font-size: .74rem; opacity: .7; white-space: normal; }
.chat-day { align-self: center; font-size: .78rem; color: var(--muted); margin: 6px 0 2px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 0; background: var(--card); padding-top: 8px; }
.chat-form textarea { flex: 1; min-height: 44px; max-height: 40vh; resize: vertical; }
.conv { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.conv:last-child { border-bottom: 0; }
.conv:hover { background: #fafafa; }
.conv .avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.conv .txt { flex: 1; min-width: 0; }
.conv .txt .preview { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.unread .txt b { color: var(--ink); }
.annonce { border-left: 4px solid var(--brand); padding: 8px 12px; margin-bottom: 10px; background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.annonce.new { box-shadow: 0 0 0 2px var(--brand) inset; }
.annonce .body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.notif-status { font-weight: 600; }
.conv .txt b, .conv .txt .preview { display: block; }
.conv > .right { flex: none; font-size: .8rem; }
.thread-card { max-width: 760px; }

.chat-btn { position: relative; display: inline-flex; align-items: center; gap: 2px; text-decoration: none; font-size: 1.15rem; padding: 3px 8px; border-radius: 7px; border: 1px solid rgba(255,255,255,.25); }
.chat-btn.on, .chat-btn:hover { background: rgba(255,255,255,.12); }
.chat-btn .nav-badge { position: absolute; top: -6px; right: -8px; }
.coach-cta { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
/* Demandes de programme */
.req-list li { align-items: flex-start; }
.req-list li.closed { opacity: .7; }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.req-actions details[open] { flex-basis: 100%; }
details.inline-form summary { cursor: pointer; list-style: none; }
details.inline-form summary::-webkit-details-marker { display: none; }
.req-answers { margin-top: 8px; }
.plan-request h3 { margin: 18px 0 8px; font-size: 1rem; }
.plan-request > summary { cursor: pointer; }
.coach-note { background: var(--brand-soft); margin-bottom: 10px; }
/* Fil du club */
.feed-wrap { max-width: 680px; margin: 0 auto; }
.composer-row { display: flex; gap: 10px; align-items: flex-start; }
.composer-row textarea { flex: 1; min-height: 52px; resize: vertical; }
.composer-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 6px; }
.composer-actions select { width: auto; flex: 0 1 200px; }
.composer-actions [type=submit] { margin-left: auto; }
.photo-btn { cursor: pointer; }
.composer-photo { position: relative; margin-top: 10px; display: inline-block; max-width: 100%; }
.composer-photo img { max-width: 100%; max-height: 260px; border-radius: 10px; display: block; }
.photo-remove { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 1.15rem; line-height: 1; cursor: pointer; }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: .85rem; letter-spacing: .3px; }
.avatar.coach { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand); }
.annonce-ico { background: var(--brand-soft); font-size: 1.15rem; }
.post { padding: 14px 16px 4px; overflow: hidden; }
.post-head { display: flex; gap: 10px; align-items: center; }
.post-head .grow { flex: 1; min-width: 0; }
.small { font-size: .82rem; }
.icon-btn { border: 0; background: none; cursor: pointer; font-size: 1rem; opacity: .5; padding: 4px 6px; border-radius: 6px; }
.icon-btn:hover { opacity: 1; background: #f4f6f7; }
.post-title { margin: 12px 0 0; font-size: 1.05rem; }
.post-body { margin-top: 10px; white-space: pre-line; overflow-wrap: anywhere; }
.post-photo { display: block; margin: 12px -16px 0; background: #f1f3f5; }
.post-photo img { display: block; width: 100%; height: auto; max-height: 600px; object-fit: contain; }
.post-stats { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; font-size: .86rem; margin-top: 10px; color: var(--ink-2); }
.post-actions { display: flex; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 8px; }
.post-actions form, .post-actions > label { flex: 1; margin: 0; }
.post-actions .act { width: 100%; display: flex; justify-content: center; align-items: center; gap: 6px; padding: 9px 6px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink-2); cursor: pointer; border-radius: 6px; margin: 0; }
.post-actions .act:hover { background: #f4f6f7; }
.post-actions .act.on { color: #1c7ed6; }
.post-comments { padding: 6px 0 8px; }
.fc { display: flex; gap: 8px; margin: 6px 0; }
.fc .avatar, .comment-new .avatar { width: 32px; height: 32px; font-size: .72rem; }
.fc-bubble { background: #f1f3f5; border-radius: 14px; padding: 6px 12px; min-width: 0; }
.fc-head { display: flex; gap: 8px; align-items: baseline; font-size: .84rem; }
.fc-body { white-space: pre-line; overflow-wrap: anywhere; font-size: .93rem; }
.fc-del-form { margin-left: auto; }
details.older summary { cursor: pointer; font-size: .86rem; color: var(--ink-2); margin: 4px 0 4px 40px; }
.comment-new { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.comment-new textarea { flex: 1; min-height: 38px; border-radius: 19px; padding: 8px 14px; resize: none; }
.feed-more { text-align: center; margin: 16px 0; }
.annonce-post { border-left: 4px solid var(--brand); }
.post-foot { font-size: .88rem; padding: 10px 0; }
.err-text { color: var(--err); }
@media (max-width: 640px) { .post { padding: 12px 12px 4px; } .post-photo { margin: 12px -12px 0; } .avatar { width: 36px; height: 36px; } }
/* Membres : app installée / notifications */
.app-flags { white-space: nowrap; font-size: 1.05rem; letter-spacing: 2px; }
.app-flags .off { opacity: .25; filter: grayscale(1); }
/* Aide Garmin */
.help-page { max-width: 760px; margin: 0 auto; }
.help-page h3 { margin: 16px 0 6px; font-size: 1rem; }
.help-page ol, .help-list { padding-left: 20px; margin: 6px 0 10px; }
.help-page li { margin: 4px 0; }
.garmin-links { margin: 10px 0 0; font-weight: 600; }
.week-rule { background: var(--brand-soft); border-radius: 8px; padding: 8px 12px; font-size: .9rem; margin: 10px 0; }
/* Avatars */
img.avatar { object-fit: cover; background: #e9ecef; }
.avatar.emoji { background: #f1f3f5; }
.avatar-edit { display: flex; gap: 16px; align-items: center; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.emoji-btn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1; padding: 0; }
.emoji-btn:hover { border-color: #c9ced2; }
.emoji-btn.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.who-me { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.who-me .avatar { box-shadow: none; }
.h1-avatar { display: flex; align-items: center; gap: 12px; }
.name-cell { display: inline-flex; align-items: center; gap: 8px; }
.lien, .lien-danger { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-decoration: underline; color: var(--brand-dark); }
.lien-danger { color: var(--err); font-size: .85rem; }
@media (max-width: 640px) { .who .name { display: none; } }

/* ---------- Programme : bascule liste / calendrier ---------- */
.view-toggle { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin: 0 0 12px; box-shadow: var(--shadow); }
.view-toggle a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.view-toggle a.active { background: var(--brand); color: var(--brand-ink); }

/* ---------- Calendrier du programme ---------- */
.cal { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; margin-bottom: 16px; }
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-month select { font-weight: 700; font-size: 1rem; }
.cal-nav { min-width: 36px; font-size: 1.15rem; line-height: 1.1; }
.cal-nav.disabled { opacity: .35; pointer-events: none; }
.cal-sum { margin-left: auto; color: var(--ink-2); font-size: .86rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dow { padding: 4px 6px; font-size: .76rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .3px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fbfcfc; }
.cal-dow.club::after, .cal-club-dot { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-dark); margin-left: 4px; vertical-align: 2px; }
.cal-club-dot { margin: 0 2px 0 6px; }
.cal-day { min-height: 96px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.other { background: #fafbfb; }
.cal-day.other .cal-dnum { color: var(--muted); }
.cal-day.out { background: repeating-linear-gradient(135deg, #f7f8f9 0 6px, #eff1f2 6px 12px); }
.cal-day.today { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.cal-dnum { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; font-weight: 700; color: var(--ink-2); min-height: 20px; }
.cal-day.today .cal-dnum span { background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 0 6px; }
.cal-add { visibility: hidden; text-decoration: none; font-weight: 700; color: var(--ink-2); border-radius: 6px; padding: 0 6px; line-height: 1.4; }
.cal-day:hover .cal-add, .cal-add:focus { visibility: visible; background: var(--bg); }
.cal-race { font-size: .72rem; font-weight: 700; background: #111; color: #fff; border-radius: 5px; padding: 1px 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-wo { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--c, #455a64); border-radius: 6px; padding: 3px 5px; font-size: .76rem; line-height: 1.25; min-width: 0;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.cal-wo:hover { border-color: var(--c); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.cal-wo[data-move] { cursor: grab; }
.cal-wo-type { display: block; font-weight: 750; color: var(--c); font-size: .68rem; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-wo-t { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; overflow-wrap: anywhere; }
.cal-wo-m { display: block; color: var(--muted); font-size: .7rem; }
.cal-wo-type .sm { display: none; }
.cal-wo.done { background: var(--ok-bg); }
.cal-ok { color: var(--ok); }
.cal-wo.rest { opacity: .7; border-left-style: dashed; }
.cal-wo.active { outline: 2px solid var(--brand-dark); outline-offset: 1px; }
/* glisser-déposer */
.cal-wo.dragging { opacity: .3; }
.cal-wo.saving { opacity: .55; pointer-events: none; }
.cal-ghost { position: fixed; z-index: 1000; pointer-events: none; width: 130px; margin: 0; transform: translate(-50%, -70%) rotate(-2deg); box-shadow: 0 8px 20px rgba(0, 0, 0, .25); }
.cal-day.drop-ok { background: #d2f0ee; box-shadow: inset 0 0 0 2px var(--brand-dark); }
body.cal-dragging, body.cal-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.cal-msg { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; font-size: .9rem; }
.cal-msg.ok { background: var(--ok-bg); color: var(--ok); }
.cal-msg.err { background: var(--err-bg); color: var(--err); }
.cal-help { margin: 10px 0 0; }
.cal-legend { white-space: nowrap; }
@media (max-width: 640px) {
  .cal { padding: 8px 6px; }
  .cal-day { min-height: 64px; padding: 2px; gap: 2px; }
  .cal-dow { padding: 3px 2px; font-size: .66rem; text-align: center; letter-spacing: 0; }
  .cal-dow.club::after { display: block; margin: 2px auto 0; }
  .cal-dnum { font-size: .72rem; min-height: 16px; }
  .cal-wo { padding: 2px 2px; border: none; background: var(--c); color: #fff; text-align: center; }
  .cal-wo.done { background: var(--c); box-shadow: inset 0 0 0 2px var(--ok-bg); }
  .cal-wo.rest { background: #eceff1; color: var(--ink-2); border: none; }
  .cal-wo-type { color: inherit; font-size: .64rem; letter-spacing: 0; text-transform: none; text-overflow: clip; }
  .cal-wo-type .lg { display: none; }
  .cal-wo-type .sm { display: inline; }
  .cal-ok { color: inherit; }
  .cal-wo-t, .cal-wo-m { display: none; }
  .cal-race { font-size: .6rem; padding: 0 3px; }
  .cal-sum { flex-basis: 100%; margin-left: 0; }
  .cal-add { visibility: visible; padding: 0 3px; }
  .cal-ghost { width: 90px; }
}

/* ---------- Détail d'une séance, agenda ---------- */
.side.stack { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.wo-detail .wo { border-bottom: none; }
.link-btn { background: none; border: none; padding: 0; color: var(--brand-dark); text-decoration: underline; cursor: pointer; font: inherit; }
.agenda-steps { padding-left: 18px; margin: 10px 0; }
.agenda-steps li { margin-bottom: 4px; }
@media print { .view-toggle, .cal-help, .cal-add, .cal-nav { display: none !important; } }

/* ---------- Écoles d'entraînement (générateur) ---------- */
.school-list .pick-t { flex-basis: 100%; }
.school-suits { color: var(--muted); font-size: .84rem; }
.school-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 10px; padding: 10px 12px; background: var(--brand-soft); border-radius: 8px; }
.school-switch label { font-weight: 700; }
.school-switch select { width: auto; max-width: 100%; font-weight: 600; }
.school-switch .hint { flex-basis: 100%; margin: 0; }
.school-help ul { margin: 8px 0; padding-left: 20px; }
.school-help li { margin-bottom: 4px; }
.school-badge { font-weight: 600; }

/* ---------- Questionnaire « Mon profil de coureur » ---------- */
.questionnaire { display: grid; gap: 10px; margin: 8px 0 12px; }
.q-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; margin: 0; background: #fff; }
.q-item legend { font-weight: 650; padding: 0 4px; }
.q-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.q-opt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .92rem; background: #fff; }
.q-opt input { margin: 0; accent-color: #b39b00; }
.q-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
@media (max-width: 640px) { .q-opt { flex: 1 1 100%; border-radius: 8px; } }

/* ---------- École conseillée (questionnaire du membre) ---------- */
.school-reco { border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 8px; padding: 10px 12px; margin: 10px 0; background: #fff; }
.reco-best { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.reco-label { font-weight: 700; }
.reco-name { font-size: .9rem; text-decoration: none; }
.reco-why { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.reco-why li { font-size: .82rem; padding: 2px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.reco-why li::before { content: '+ '; font-weight: 700; }
.reco-why li.con { background: var(--warn-bg); color: var(--warn); }
.reco-why li.con::before { content: '− '; }
.reco-out ul, .q-answers dl { margin: 6px 0 0; }
.reco-out summary, .q-answers summary { cursor: pointer; color: var(--ink-2); }
.q-answers { margin-bottom: 8px; font-size: .9rem; }
.pick .reco-tag { font-size: .74rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.reco-tag.top { background: var(--ok); color: #fff; }
.reco-tag.ok { background: var(--ok-bg); color: var(--ok); }
.reco-tag.out { background: var(--bg); color: var(--muted); }
.pick.reco-out-pick { opacity: .75; }
.runner-card.todo { border-left: 4px solid var(--brand); }
.runner-card > summary { cursor: pointer; }

/* Champ « fichier » masqué visuellement (le bouton-étiquette l'ouvre) : pas display:none, que certains navigateurs mobiles refusent d'ouvrir */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
.photo-btn { position: relative; }
.my-photo { margin-top: 8px; }
.my-photo > summary { list-style: none; }
.my-photo > summary::-webkit-details-marker { display: none; }
.my-photo .card { max-width: 520px; }

/* ---------- Intervals.icu ---------- */
.intervals-card ol { padding-left: 20px; margin: 8px 0; }
.form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-inline input[type=date] { width: auto; }
.intervals-line { font-size: .9rem; margin: 8px 0 0; }
.intervals-line.ok { color: var(--ok); }

/* ---------- Plan club ---------- */
.form-actions-inline { display: flex; align-items: flex-end; }
.club-me { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.club-vma-missing { border-left: 4px solid var(--warn); }
.club-day-card.today { outline: 2px solid var(--brand); }
.club-event { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; background: #f6f8f9; border-radius: 8px; padding: 6px 10px; margin-bottom: 10px; font-size: .9rem; }
.club-seance + .club-seance { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.club-seance h3 { margin: 0 0 4px; }
.club-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.club-remark { background: var(--brand-soft); border-radius: 8px; padding: 6px 10px; margin: 8px 0; font-weight: 600; }
.club-steps { margin: 8px 0 0; padding-left: 22px; }
.club-steps li { margin-bottom: 5px; }
.club-steps li.step-effort { font-weight: 650; }
.club-steps li.step-echauf, .club-steps li.step-gammes, .club-steps li.step-retour { color: var(--ink-2); }
.club-seance.cancelled h3 .t { text-decoration: line-through; color: var(--muted); }
.pc-phases { list-style: none; padding: 0; margin: 4px 0 10px; display: flex; flex-direction: column; gap: 6px; }
.pc-phases li.current { font-weight: 600; }
.pc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
@media (min-width: 641px) {
  .pc-chip.st-brouillon { background: #f4f6f7; border-style: dashed; border-left-style: solid; }
  .pc-chip.st-publiee .cal-wo-type .lg::before { content: "✓ "; }
}
.pc-chip.st-annulee { opacity: .6; }
.pc-chip.st-annulee .cal-wo-t { text-decoration: line-through; }
.pc-key { display: inline-block; font-size: .72rem; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line); margin-left: 6px; }
.pc-key.st-brouillon { background: #f4f6f7; border-style: dashed; }
.pc-key.st-annulee { text-decoration: line-through; opacity: .7; }
@media (max-width: 640px) {
  /* téléphone : publiée = pastille pleine (couleur de la phase), brouillon = contour, annulée = grisée */
  .pc-chip.st-brouillon { background: #fff; color: var(--c); box-shadow: inset 0 0 0 2px var(--c); }
  .pc-chip.st-annulee { background: #eceff1; color: var(--muted); text-decoration: line-through; opacity: 1; }
}

/* =====================================================================
   Thème Prisia (depuis la 2.0.0 ; PrisiaCoach depuis la 2.1.0) : barre bleu nuit avec halo sarcelle,
   menus et boutons en pastilles, mot-symbole « Prisia » + « Coach » en dégradé.
   ===================================================================== */
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
.topbar {
  background: radial-gradient(520px 120px at 88% -30%, rgba(76, 195, 207, .40), transparent 70%), linear-gradient(90deg, #060c1d, #0d2850);
  color: #e8eefc; border-bottom: 1px solid rgba(255, 255, 255, .07); box-shadow: 0 6px 18px -12px rgba(6, 12, 29, .9);
}
.logo { display: flex; align-items: center; gap: 9px; }
.logo img { display: block; height: 40px; width: 40px; border-radius: 0; background: none; }
.logo .logo-txt { font-size: 1.2rem; font-weight: 750; letter-spacing: -.2px; color: #fff; }
.logo .logo-txt b { font-weight: 750; background: linear-gradient(100deg, #5aa9f0, #3fb3c2 50%, #6cc84a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav a { color: #c9d6ec; border-radius: 999px; padding: 7px 13px; }
.nav a:hover { color: #fff; background: #173563; }
.nav a.active { color: #fff; background: linear-gradient(135deg, #1c7aa8, #0d3b66); box-shadow: 0 8px 18px -10px rgba(28, 122, 168, .9); font-weight: 600; }
.who { color: #aebcd6; }
.who button { background: #0d1934; border-color: #22365e; color: #e8eefc; border-radius: 999px; padding: 5px 12px; }
.who button:hover { background: #173563; }
.chat-btn { border-radius: 999px !important; }

/* boutons et champs en pastilles */
.btn, button.btn { border-radius: 999px; padding: 8px 16px; background: #fff; border-color: var(--line); }
.btn:hover { border-color: var(--brand); color: var(--brand); background: #fff; }
.btn.primary:hover { color: #fff; }
.btn.ok:hover { color: #fff; background: #23793a; }
.btn.danger:hover { color: var(--err); }
.btn.small { padding: 4px 12px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], input[type=tel], input[type=search], input[type=url], select, textarea { border-color: var(--line); border-radius: 12px; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--brand); }

/* cartes, onglets, tableaux */
.card, .stat { border-radius: 18px; box-shadow: 0 1px 2px rgba(13, 40, 80, .06), 0 6px 18px -10px rgba(13, 40, 80, .25); }
.stat .v { color: var(--navy); }
.stat.alert .v { color: var(--err); }
.stat.warn .v { color: var(--warn); }
h1 { color: var(--navy); }
.card-head h2, .card > h2 { color: var(--navy); }
.tabs { border-bottom-color: var(--line); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
th { color: var(--muted); }
tbody tr:hover { background: #e2ebf4; }
.badge { background: #dae6f1; }
.flash { border-radius: 14px; }
.flash.info { background: var(--brand-soft); color: #0d3b66; border-color: #b3cfe6; }
.done-panel { background: #f7fafd; border-radius: 14px; }
.conv .avatar { color: #8fe0dc; }
.datebox { border-radius: 12px; }

/* pages publiques (connexion, adhésion, installation, hors connexion) : écran Prisia */
body.public:has(.auth) {
  min-height: 100vh;
  background: radial-gradient(700px 500px at 80% 12%, rgba(28, 122, 168, .45), transparent 70%), radial-gradient(520px 420px at 10% 95%, rgba(46, 199, 107, .16), transparent 70%), #060c1d;
  background-attachment: fixed;
}
body.public:has(.auth) main { padding-top: 0; }
body.public:has(.auth) .auth .card { border-radius: 26px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); }
body.public:has(.auth) .auth .brand p { color: #aebcd6; }
body.public:has(.auth) .auth > p, body.public:has(.auth) .auth > .center { color: #c9d6ec; }
body.public:has(.auth) .auth > p a, body.public:has(.auth) .auth > .center a { color: #8fe0dc; }
body.public:has(.auth) footer.foot { color: #8193b3; }
body.public:has(.auth) footer.foot .foot-marque { color: #e8eefc; }
body.public:has(.auth) .card a { color: var(--brand); }

/* pied de page */
.foot-marque { font-weight: 700; color: var(--navy); }
.foot-marque b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* sur un écran moyen, le menu du coach a besoin de toute la largeur : le logo seul suffit */
@media (min-width: 761px) and (max-width: 1360px) { .logo .logo-txt { display: none; } }
@media (max-width: 760px) {
  .logo .logo-txt { font-size: 1.05rem; }
  .logo img { height: 34px; width: 34px; }
}
@media print {
  body.public, body.app { background: #fff; }
}

/* =====================================================================
   3.0 multisport : fiche (blocs par sport), nutrition, menus
   ===================================================================== */
.sport-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 10px 0; background: rgba(255, 255, 255, .35); }
.sport-block > summary { cursor: pointer; padding: 4px 0; }
.sport-block[open] > summary { margin-bottom: 8px; }
.nutri-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 10px; }
.nutri-stats .stat { box-shadow: none; background: var(--info-bg); }
.fuel { padding: 10px 0; border-top: 1px solid var(--line); }
.fuel:first-of-type { border-top: 0; padding-top: 0; }
.fuel .kv { margin-top: 6px; grid-template-columns: 80px minmax(0, 1fr); }
.fuel-card .kv { grid-template-columns: 80px minmax(0, 1fr); }
.meals { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 10px; }
.meal { background: rgba(255, 255, 255, .5); border-radius: var(--radius); padding: 12px 14px; }
.meal h3 small { font-weight: 400; display: block; }
.meal ul { margin: 0; padding-left: 18px; }
.sport-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sport-pick .btn.on { background: var(--brand); color: var(--brand-ink); }
.sport-pick .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.vid-link { font-size: .82rem; font-weight: 600; white-space: nowrap; text-decoration: none; margin-left: 4px; }
.vid-link:hover { text-decoration: underline; }
.video-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 14px; }
.video-list .field label { display: flex; justify-content: space-between; gap: 8px; }

/* 3.1 : pastille 📅 « Mon programme » à côté des messages — sur téléphone, la barre reste sur une ligne */
@media (max-width: 480px) {
  .who { gap: 5px; }
  .chat-btn { padding: 2px 6px; font-size: 1.05rem; }
  .who button { padding: 4px 7px; font-size: .78rem; }
  .topbar .inner { gap: 6px 8px; }
}
@media (max-width: 385px) { .logo .logo-txt { display: none; } }

/* Calendrier pleine page (pastille 📅) : toute la largeur, le mois entier à l'écran */
main:has(.cal-page) { max-width: none; padding: 10px 14px 32px; }
.cal-page-head { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin: 0 0 10px; }
.cal-page-head h1 { margin: 0; font-size: 1.35rem; }
.cal-page-head .btn { margin-left: auto; }
.cal-page .cal { margin-bottom: 8px; }
.cal-page .cal-day { min-height: max(96px, calc((100vh - 250px) / 6)); }
@media (max-width: 640px) {
  main:has(.cal-page) { padding: 6px 4px 24px; }
  .cal-page .cal { padding: 6px 4px; border-radius: 10px; }
  .cal-page-head { padding: 0 6px; }
  .cal-page .cal-day { min-height: 74px; padding: 2px; }
}

/* ======================================================================
 * 3.1.1 — Zones d'intensité et portail adhérent plus vivant
 * Les couleurs des zones sont la signature visuelle : histogramme des séances, pastilles de zone.
 * ====================================================================== */
:root { --z1: #94a3b8; --z2: #2f8fe0; --z3: #22b573; --z4: #f5a524; --z5: #ef4444; --z6: #a855f7; }
.z1 { --zc: var(--z1); } .z2 { --zc: var(--z2); } .z3 { --zc: var(--z3); } .z4 { --zc: var(--z4); } .z5 { --zc: var(--z5); } .z6 { --zc: var(--z6); }

/* histogramme de la séance */
.wp-chart { margin: 4px 0 14px; }
.wp-chart svg { display: block; width: 100%; height: 112px; }
.wp-chart rect { fill: var(--zc); }
.wp-chart.mini svg { height: 64px; }
.wp-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: .78rem; color: var(--ink-2); }
.wp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.wp-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--zc); }

/* échauffement · corps de séance · retour au calme */
.wp-blocks { display: grid; gap: 10px; }
.wp-block { border-radius: 12px; padding: 10px 12px 10px 14px; background: #fff; border: 1px solid var(--line); position: relative; }
.wp-block::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; }
.wp-echauffement::before { background: linear-gradient(var(--z1), var(--z2)); }
.wp-corps::before { background: linear-gradient(var(--z3), var(--z4), var(--z5)); }
.wp-retour::before { background: linear-gradient(var(--z2), var(--z1)); }
.wp-block h3 { margin: 0 0 6px; font-size: .95rem; color: var(--navy); }
.wp-step { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 2px 10px; padding: 5px 0; }
.wp-step + .wp-step { border-top: 1px dashed #dbe5ef; }
.wp-step.soft { opacity: .72; }
.wp-z { align-self: center; display: inline-grid; place-items: center; min-width: 30px; height: 22px; border-radius: 6px; background: var(--zc); color: #fff; font-weight: 800; font-size: .74rem; }
.wp-z.z1 { color: #1f2a37; }
.wp-d { font-weight: 800; font-variant-numeric: tabular-nums; }
.wp-n { color: var(--ink-2); }
.wp-t { grid-column: 3; color: var(--muted); font-size: .84rem; }
.wp-rep { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; background: #f3f7fb; border-radius: 10px; padding: 6px 10px; margin: 4px 0; }
.wp-x { font-size: 1.25rem; font-weight: 850; color: var(--navy); font-variant-numeric: tabular-nums; }
.wp-card .card-head h2 { margin: 0; }

/* accueil : compte à rebours */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.race-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; text-decoration: none; color: #fff; background: linear-gradient(120deg, #ff8a3d, #ef4444); border-radius: 999px; padding: 5px 14px 5px 6px; box-shadow: 0 3px 10px rgba(239, 68, 68, .25); }
.race-chip .rc-j { background: rgba(255, 255, 255, .22); border-radius: 999px; padding: 2px 9px; font-weight: 850; font-variant-numeric: tabular-nums; }
.race-chip .rc-n { font-weight: 650; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* accueil : la séance du jour */
.today-hero { position: relative; overflow: hidden; color: #fff; border-radius: 18px; padding: 16px 18px 18px; margin: 0 0 12px;
  background: radial-gradient(120% 140% at 100% 0%, rgba(76, 195, 207, .35), transparent 55%), linear-gradient(140deg, #0b2347 0%, #123a6e 70%, #0f4c5c 100%);
  box-shadow: 0 8px 24px rgba(11, 35, 71, .28); }
.today-hero .th-when { color: #8fe3ec; font-weight: 700; font-size: .92rem; }
.today-hero .th-done { display: inline-block; margin-left: 6px; color: #b7f5c8; }
.today-hero .th-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: 4px 0 2px; color: #fff; text-decoration: none; font-size: 1.45rem; font-weight: 800; line-height: 1.2; }
.today-hero .th-title .type { font-size: .72rem; font-weight: 800; color: #fff; padding: 3px 8px; border-radius: 6px; }
.today-hero .th-meta { color: rgba(255, 255, 255, .78); font-size: .9rem; }
.today-hero .wp-chart { margin: 12px 0 14px; }
.today-hero .wp-chart rect { animation: wp-rise .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 22ms); transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes wp-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .today-hero .wp-chart rect { animation: none; } }
.today-hero .th-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.today-hero .btn.primary { background: #4cc3cf; border-color: #4cc3cf; color: #082036; font-weight: 750; }
.today-hero .btn.primary:hover { background: #6fd3dc; border-color: #6fd3dc; }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.today-hero.done { background: radial-gradient(120% 140% at 100% 0%, rgba(34, 181, 115, .35), transparent 55%), linear-gradient(140deg, #0b2347 0%, #123a6e 70%, #14513f 100%); }

/* accueil : la semaine en pastilles */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 0 0 16px; }
.ws-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 8px; border-radius: 12px; background: var(--card); text-decoration: none; color: var(--ink); border: 2px solid transparent; position: relative; }
.ws-day:hover { border-color: var(--line); }
.ws-day.today { border-color: #4cc3cf; background: #fff; }
.ws-day.past { opacity: .62; }
.ws-day.all-done::after { content: '✓'; position: absolute; top: 2px; right: 5px; font-size: .7rem; font-weight: 800; color: var(--ok); }
.ws-dow { font-size: .72rem; color: var(--muted); }
.ws-num { font-size: 1.12rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ws-dots { display: flex; gap: 3px; min-height: 9px; }
.ws-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.ws-dots i.done { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--ok); }

/* accueil : liste de la semaine */
.wk-list { list-style: none; margin: 0; padding: 0; }
.wk-list li + li { border-top: 1px solid #dbe5ef; }
.wk-list a { display: grid; grid-template-columns: 4.6em auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 4px; color: var(--ink); text-decoration: none; }
.wk-list a:hover { background: #fff; border-radius: 8px; }
.wk-list .type { font-size: .68rem; font-weight: 800; color: #fff; padding: 2px 7px; border-radius: 5px; }
.wk-d { color: var(--muted); font-size: .86rem; }
.wk-t { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-s { color: var(--muted); font-weight: 800; }
.wk-list li.done .wk-s { color: var(--ok); }
.wk-list li.done .wk-t { color: var(--ink-2); }
.wk-list li.today a { box-shadow: inset 3px 0 0 #4cc3cf; }
/* liste du programme : mini-histogramme de chaque séance structurée */
.wo-mini { display: block; max-width: 420px; }
.wo-mini .wp-chart { margin: 6px 0 4px; }
.wo-mini .wp-chart.mini svg { height: 30px; }
