:root {
  --bg: #12161c;
  --surface: #1a2029;
  --surface-2: #232b36;
  --line: #2c3542;
  --text: #e9edf2;
  --muted: #93a0b0;
  --accent: #e6457a;
  --accent-ink: #ffffff;
  --accent-bg: #c92a5f;
  --ok: #3fbf7f;
  --warn: #f2c14e;
  --bad: #ff5d5d;
  --z1: #8fb3d1; --z2: #3fbf7f; --z3: #f2c14e; --z4: #ff8c42; --z5: #ff4d5e;
  --k-spe: #ff7a2f; --k-ef: #3fbf7f; --k-longue: #5aa9ff; --k-renfo: #b08cff; --k-course: #ff4d5e; --k-libre: #93a0b0;
  --radius: 14px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-bg: rgba(18, 22, 28, 0.94); --hover: rgba(255, 255, 255, 0.08); --backdrop: rgba(6, 8, 12, 0.72);
  --tint-a: #2a1520; --tint-a-line: #4d2333; --course-bg: #2d1b20;
  --ok-bg: #13281d; --ok-line: #1f4a32; --warn-bg: #2b2412; --warn-line: #4a3d18; --bad-bg: #2e1616; --bad-line: #5a2424;
  --t-travail: #2b1019; --t-repos: #0f2219; --t-calme: #121d2b; --t-fin: #1d2a17; --t-cote: #23182e;
  --strava-line: #4a2a1a; --suunto: #2b3a4d; --clip-bg: #12151c; --track: #232934;
  --vg-tag: #9cc4f5; --vg-now: #ff9dbb; --pt-alert: #ffd2d2;
  color-scheme: dark;
}

/* ---------- Apparence claire (Réglages → Apparence) ---------- */
:root[data-theme="light"] {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --line: #dde1e8;
  --text: #19202a;
  --muted: #5b6676;
  --accent: #c42a5d;
  --accent-ink: #ffffff;
  --accent-bg: #c42a5d;
  --ok: #1d8a52;
  --warn: #946200;
  --bad: #d13a3a;
  --k-libre: #8a96a6;
  --nav-bg: rgba(255, 255, 255, 0.94); --hover: rgba(20, 30, 45, 0.07); --backdrop: rgba(20, 26, 36, 0.45);
  --tint-a: #fbe7ef; --tint-a-line: #f0c2d3; --course-bg: #fdecef;
  --ok-bg: #e3f4ea; --ok-line: #bfe3cd; --warn-bg: #fff4d9; --warn-line: #f0dda6; --bad-bg: #fde8e8; --bad-line: #f3c3c3;
  --t-travail: #fbe3ec; --t-repos: #e2f3e9; --t-calme: #e5eef9; --t-fin: #e8f4df; --t-cote: #efe6f9;
  --strava-line: #f6c9b0; --suunto: #dbe5f1; --clip-bg: #e9ecf1; --track: #e6e9ef;
  --vg-tag: #2b6be0; --vg-now: #c42a5d; --pt-alert: #b3261e;
  color-scheme: light;
}
:root[data-theme="light"] .card, :root[data-theme="light"] .session-card { box-shadow: 0 1px 2px rgba(20, 30, 45, 0.05); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.7rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }
p { margin: 0.4em 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
[hidden] { display: none !important; }

/* ---------- Mise en page ---------- */
.view {
  max-width: 980px; margin: 0 auto;
  padding: calc(18px + var(--safe-t)) 16px calc(var(--nav-h) + 28px + var(--safe-b));
}

.nav {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 0.7rem; }
.nav a .ico { font-size: 1.25rem; line-height: 1; }
.nav a.active { color: var(--text); }
.nav a.active .ico { color: var(--accent); }
.nav .nav-cta .ico { background: var(--accent-bg); color: var(--accent-ink) !important; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; }
.nav .brand, .nav .nav-settings { display: none; }
.settings-fab { position: absolute; z-index: 15; top: calc(12px + var(--safe-t)); right: 14px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 1.1rem; }
.settings-fab.active { color: var(--accent); }

@media (min-width: 900px) {
  .nav { top: 0; right: auto; width: 220px; height: auto; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 20px 12px; border-top: 0; border-right: 1px solid var(--line); }
  .nav a { flex: 0; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 0.95rem; }
  .nav a:hover { background: var(--surface); color: var(--text); }
  .nav a.active { background: var(--surface-2); }
  .nav .brand { display: flex; color: var(--text); font-weight: 700; margin-bottom: 14px; }
  .nav .brand img { border-radius: 8px; }
  .nav .nav-settings { display: flex; margin-top: auto; }
  .nav .nav-cta .ico { width: 26px; height: 26px; font-size: 0.95rem; }
  .settings-fab { display: none; }
  .view { margin-left: 220px; margin-right: auto; padding: 32px 40px 48px; max-width: 1100px; }
  body:not(.timer-mode) .view { width: calc(100% - 220px); }
}

/* ---------- En-têtes ---------- */
.page-head { margin: 4px 0 18px; padding-right: 48px; }
.page-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.eyebrow { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 6px; }
.sub { color: var(--muted); margin-top: 6px; }
.back { display: inline-block; color: var(--muted); margin-bottom: 8px; font-size: 0.95rem; }
@media (min-width: 900px) { .page-head { padding-right: 0; } }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.hero { background: linear-gradient(160deg, var(--tint-a) 0%, var(--surface) 55%); border-color: var(--tint-a-line); }
.card-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px; }
.card-title-row { display: flex; justify-content: space-between; align-items: baseline; }
.notice { display: block; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent-bg); color: var(--accent-ink); border: 1px solid var(--accent-bg);
  border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; min-height: 44px;
}
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: 0.9rem; }
.btn.icon { width: 44px; padding: 0; font-size: 1.3rem; }
.btn.danger { color: var(--bad); }
.btn.danger:not(.ghost) { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.file { position: relative; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.actions.sticky { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); background: var(--bg); padding: 10px 0; margin: 0; }
@media (min-width: 900px) { .actions.sticky { bottom: 0; } }

/* ---------- Séances (puces) ---------- */
.chip {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--surface-2); border-radius: 10px; padding: 10px 12px; color: var(--text);
  border-left: 4px solid var(--k-libre);
}
.chip:hover { filter: brightness(1.12); }
.chip-ico { font-size: 1.1rem; }
.chip-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chip-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-meta { color: var(--muted); font-size: 0.82rem; }
.kind-specifique { border-left-color: var(--k-spe); }
.kind-ef { border-left-color: var(--k-ef); }
.kind-longue { border-left-color: var(--k-longue); }
.kind-renfo { border-left-color: var(--k-renfo); }
.kind-course { border-left-color: var(--k-course); background: var(--course-bg); }
.st-faite .chip-title { color: var(--muted); }
.st-manquee { opacity: 0.55; }
.status { font-size: 0.72rem; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.status.done { background: var(--ok-bg); color: var(--ok); }
.status.missed { background: var(--bad-bg); color: var(--bad); }
.status.late { background: var(--warn-bg); color: var(--warn); }

.today-item { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.today-item:last-child { margin-bottom: 0; }
@media (min-width: 600px) { .today-item { flex-direction: row; align-items: center; } .today-item .chip { flex: 1; } }

.week-list { display: flex; flex-direction: column; gap: 6px; }
.week-row { display: flex; align-items: center; gap: 10px; }
.week-row .chip, .today-item .chip, .day-body .chip { min-width: 0; }
.week-row .chip { flex: 1; }
.week-row .wday { width: 38px; color: var(--muted); font-size: 0.85rem; text-transform: capitalize; flex-shrink: 0; }
.week-row.is-today .wday { color: var(--accent); font-weight: 700; }

/* ---------- Courses ---------- */
.races { display: grid; gap: 10px; }
@media (min-width: 700px) { .races { grid-template-columns: repeat(3, 1fr); } }
.race { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; border-top: 3px solid var(--k-longue); }
.race.prio-A { border-top-color: var(--accent); }
.race-j { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.race-name { font-weight: 600; }
.race-meta { color: var(--muted); font-size: 0.82rem; }

/* ---------- Calendrier ---------- */
.cal-nav { display: flex; gap: 8px; align-items: center; }
.week-sum { color: var(--muted); margin: -6px 0 14px; }
.week-sum strong { color: var(--text); }
.week-grid { display: flex; flex-direction: column; gap: 8px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; gap: 12px; }
.day.is-today { border-color: var(--accent); }
.day.is-past { opacity: 0.85; }
.day-head { display: flex; flex-direction: column; align-items: center; width: 40px; flex-shrink: 0; color: var(--muted); font-size: 0.8rem; text-transform: capitalize; }
.day-head strong { font-size: 1.3rem; color: var(--text); }
.day.is-today .day-head strong { color: var(--accent); }
.day-head .add { margin-top: 4px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 1px dashed var(--line); color: var(--muted); }
.day-body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; justify-content: center; }
.rest { color: var(--muted); font-size: 0.9rem; }
@media (min-width: 1000px) {
  .week-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
  .day { flex-direction: column; min-height: 220px; gap: 8px; }
  .day-head { flex-direction: row; width: auto; justify-content: space-between; gap: 6px; }
  .day-head .add { margin: 0; }
  .day-body { justify-content: flex-start; }
  .day .chip { flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px; }
  .day .chip-title { white-space: normal; font-size: 0.88rem; }
  .day .chip-meta { font-size: 0.75rem; }
}

/* ---------- Fiche séance ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); max-width: 820px; gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat span { display: block; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat strong { font-size: 1.35rem; }
.blocks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.block { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.block-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.block-reps, .block-d { color: var(--accent); white-space: nowrap; }
.rep-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; font-size: 0.92rem; }
.rep-line .sep { color: var(--muted); }
.zone { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 8px; border-radius: 99px; font-weight: 700; font-size: 0.82rem; color: #0f1216; }
.zone small { font-weight: 600; opacity: 0.8; }
.zone.z0 { background: var(--muted); }
.zone.z1 { background: var(--z1); } .zone.z2 { background: var(--z2); } .zone.z3 { background: var(--z3); }
.zone.z4 { background: var(--z4); } .zone.z5 { background: var(--z5); }

/* ---------- Formulaires ---------- */
.form label, .form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 0.9rem; color: var(--muted); }
.form label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
label.check { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin: 8px 0; cursor: pointer; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px;
}
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; flex: 0 0 20px; accent-color: var(--accent); }
input[type="range"] { padding: 0; border: 0; background: transparent; accent-color: var(--accent); min-height: 32px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input:disabled { opacity: 0.6; }
textarea { resize: vertical; }
.grid2, .grid3 { display: grid; gap: 0 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid2 > *, .grid3 > * { min-width: 0; }
input, select, textarea { min-width: 0; max-width: 100%; }
/* iPhone : les champs date/heure ont une largeur et une hauteur propres à Safari, on les aligne sur les autres */
input[type="date"], input[type="time"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%;
  height: 46px; line-height: 24px; text-align: left;
}
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8); }
.grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 480px) { .grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .grid3 > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
.range-labels { display: flex; justify-content: space-between; font-size: 0.75rem; }
.scale { display: flex; gap: 8px; }
.scale button { flex: 1; font-size: 1.5rem; padding: 8px 0; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; filter: grayscale(0.8); opacity: 0.7; }
.scale button.on { border-color: var(--accent); filter: none; opacity: 1; background: var(--tint-a); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 8px 12px; cursor: pointer; }
.pill.on { border-color: var(--accent); background: var(--tint-a); }
.pain { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 8px; align-items: center; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pain .pain-int { grid-column: 1 / 3; flex-direction: row; align-items: center; gap: 10px; margin: 0; color: var(--text); }
.pain [data-del] { grid-row: 1; grid-column: 3; }

/* ---------- Récaps ---------- */
.recap-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--text); margin-bottom: 8px; }
.recap-title { font-weight: 700; }
.points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.points li { padding-left: 26px; position: relative; }
.points li::before { position: absolute; left: 0; top: 0; }
.pt-ok::before { content: "✓"; color: var(--ok); font-weight: 800; }
.pt-info::before { content: "•"; color: var(--muted); font-size: 1.4rem; line-height: 1; }
.pt-warn::before { content: "!"; color: var(--warn); font-weight: 900; left: 6px !important; }
.pt-alert { color: var(--pt-alert); }
.pt-alert::before { content: "⚠️"; }
.pt-next::before { content: "→"; color: var(--accent); }
blockquote { margin: 12px 0 0; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--muted); }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.zones-tbl input { width: 76px; padding: 6px 8px; min-height: 36px; }

/* ---------- Renfo ---------- */
.renfo-list { display: grid; gap: 14px; }
@media (min-width: 900px) { .renfo-list { grid-template-columns: repeat(3, 1fr); } }
.renfo-card { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.renfo-card h2 { font-size: 1.2rem; }
.renfo-card .btn { margin-top: auto; }
details { margin: 6px 0 10px; }
summary { cursor: pointer; color: var(--accent); }
details ul { margin: 4px 0 8px; padding-left: 18px; }

/* ---------- Minuteur ---------- */
body.timer-mode .nav, body.timer-mode .settings-fab { display: none; }
body.timer-mode .view { margin: 0; padding: 0; max-width: none; width: 100%; }
.timer {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: calc(14px + var(--safe-t)) 20px calc(20px + var(--safe-b));
  background: var(--bg); transition: background 0.4s;
}
.timer[data-type="travail"] { background: var(--t-travail); }
.timer[data-type="repos"] { background: var(--t-repos); }
.timer[data-type="echauffement"], .timer[data-type="calme"] { background: var(--t-calme); }
.timer[data-type="fin"] { background: var(--t-fin); }
.timer-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.back.light { margin: 0; }
.timer-title { color: var(--muted); font-size: 0.9rem; }
.timer-progress { height: 6px; background: var(--hover); border-radius: 99px; margin: 14px 0; overflow: hidden; }
.timer-progress div { height: 100%; background: var(--accent); width: 0; transition: width 0.25s linear; }
.timer-main { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 8px; }
.timer-phase { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.85rem; color: var(--muted); }
.timer[data-type="travail"] .timer-phase { color: var(--accent); }
.timer[data-type="repos"] .timer-phase { color: var(--ok); }
.timer-ex { font-size: clamp(1.7rem, 6vw, 3rem); max-width: 20ch; }
.timer-cue { color: var(--muted); max-width: 40ch; min-height: 3em; }
.timer-clock { font-size: clamp(5rem, 26vw, 11rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; line-height: 1; }
.timer-next { color: var(--muted); min-height: 1.5em; }
.timer-ctrl { display: flex; justify-content: center; align-items: center; gap: 28px; margin: 10px 0; }
.tbtn { width: 64px; height: 64px; border-radius: 50%; background: var(--hover); border: 0; color: var(--text); font-size: 1.4rem; cursor: pointer; }
.tbtn.big { width: 88px; height: 88px; background: var(--accent-bg); color: var(--accent-ink); font-size: 2rem; }
.timer-foot { text-align: center; color: var(--muted); font-size: 0.85rem; }

/* ---------- Réglages ---------- */
.race-row { display: grid; grid-template-columns: 1fr 44px 44px; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.race-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 50; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-weight: 600; font-size: 0.92rem;
  transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 24px; left: calc(50% + 110px); } }

/* ---------- Synchronisation ---------- */
.sync-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--muted); vertical-align: middle; }
.sync-dot.s-ok { background: var(--ok); }
.sync-dot.s-sync { background: var(--warn); }
.sync-dot.s-erreur { background: var(--bad); }
.kind-strava { border-left-color: #fc5200; }
.tag-strava { display: inline-block; background: #fc5200; color: #fff; font-weight: 700; font-size: 0.72rem; padding: 2px 8px; border-radius: 99px; margin-right: 6px; }
.btn.strava-btn { background: #fc5200; border-color: #fc5200; color: #fff; }
.strava-card { border-color: var(--strava-line); }

/* ---------- Coach : verdict et adaptations ---------- */
.verdict { display: flex; flex-direction: column; gap: 2px; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--line); }
.verdict strong { font-size: 1.15rem; }
.verdict.v-ok { background: var(--ok-bg); border-color: var(--ok-line); } .verdict.v-ok strong { color: var(--ok); }
.verdict.v-vigilance { background: var(--warn-bg); border-color: var(--warn-line); } .verdict.v-vigilance strong { color: var(--warn); }
.verdict.v-alerte { background: var(--bad-bg); border-color: var(--bad-line); } .verdict.v-alerte strong { color: var(--bad); }
.verdict-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.verdict-dot.v-ok { background: var(--ok); } .verdict-dot.v-vigilance { background: var(--warn); } .verdict-dot.v-alerte { background: var(--bad); }
.adapt { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; border-left: 4px solid var(--accent); }
.adapt.pending { border-left-color: var(--warn); }
.adapt.is-undone { opacity: 0.55; border-left-color: var(--muted); }
.adapt-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.adapt-ops { margin: 6px 0 10px; padding-left: 18px; font-size: 0.9rem; }
.adapt-ops a { color: var(--text); }
.adapt-date { margin: 12px 0 4px; }
.adapt-card { border-color: var(--tint-a-line); }
.tag-adapt { display: inline-block; font-size: 0.68rem; font-weight: 700; color: var(--accent); border: 1px solid var(--accent); border-radius: 99px; padding: 0 6px; margin-left: 4px; vertical-align: middle; }
.adapt-notice { color: var(--accent); border-color: var(--tint-a-line); background: var(--tint-a); }
.next-line { margin-top: 10px; }
.move-form .pills { margin-bottom: 8px; }
select { height: 46px; }

/* ---------- Import montre et zones ---------- */
.import-box { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.import-box .btn, .import-card .btn { margin: 6px 0; }
.tag-suunto { background: var(--suunto); }
.points li.pt-zones { padding-left: 0; }
.zbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; margin: 4px 0 10px; background: var(--surface-2); }
.zseg.z1 { background: var(--z1); } .zseg.z2 { background: var(--z2); } .zseg.z3 { background: var(--z3); } .zseg.z4 { background: var(--z4); } .zseg.z5 { background: var(--z5); }
.zlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.85rem; color: var(--muted); }
.add-circle { position: relative; display: inline-block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--accent); margin-top: -8px; font-size: 0; flex-shrink: 0; }
.add-circle::before, .add-circle::after { content: ""; position: absolute; left: 50%; top: 50%; background: var(--accent); border-radius: 2px; transform: translate(-50%, -50%); }
.add-circle::before { width: 14px; height: 2.5px; }
.add-circle::after { width: 2.5px; height: 14px; }
.add-circle:hover { background: var(--accent-bg); }
.add-circle:hover::before, .add-circle:hover::after { background: var(--accent-ink); }

/* ---------- Accueil : sous-blocs, semaine, graphique de charge ---------- */
.sub-block { border-top: 1px solid var(--hover); margin-top: 14px; padding-top: 12px; }
.sub-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px; }
.import-line .btn { width: 100%; }
.week-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.week-kpis div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.week-kpis strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.week-kpis span { color: var(--muted); font-size: 0.75rem; }
@media (max-width: 480px) { .week-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.week-progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.week-progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.cg-legend { display: flex; gap: 16px; font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; }
.cg-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-plan { background: #3987e5; }
.lg-done { background: #d95926; border-radius: 50% !important; }
.cg-wrap { position: relative; }
.cg { display: block; overflow: visible; max-width: 100%; }
.cg-grid { stroke: var(--hover); stroke-width: 1; }
.cg-ax { fill: var(--muted); font-size: 11px; }
.cg-plan { fill: #3987e5; }
.cg-plan.is-past { opacity: 0.45; }
.cg-done { fill: none; stroke: #d95926; stroke-width: 2; stroke-linejoin: round; }
.cg-dot { fill: #d95926; stroke: var(--surface); stroke-width: 2; }
.cg-today { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 3; }
.cg-race { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.cg-label { fill: var(--muted); font-size: 11px; }
.cg-label.strong { fill: var(--text); font-weight: 600; }
.cg-hit { fill: transparent; cursor: pointer; }
.cg-hit.on { fill: var(--hover); }
.cg-tip { position: absolute; top: 0; width: 180px; background: var(--text); color: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 0.8rem; display: flex; flex-direction: column; gap: 2px; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.cg-tip[hidden] { display: none; }
.cg-note { margin-top: 6px; }

/* ---------- Pop-up ---------- */
body.modal-open { overflow: hidden; }
.modal-back { position: fixed; inset: 0; z-index: 60; background: var(--backdrop); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.modal h2 { font-size: 1.25rem; margin-bottom: 10px; }
.modal-body { overflow-y: auto; flex: 1; }
.modal-body .sub-title { margin-top: 12px; }
.modal .actions { margin-bottom: 0; }

/* ---------- Menu déroulant « Sorties Strava » ---------- */
details.drop > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
details.drop > summary::-webkit-details-marker { display: none; }
details.drop > summary .sub-title { margin: 0; display: flex; align-items: center; gap: 8px; }
.drop-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #fc5200; color: #fff; font-size: 0.72rem; letter-spacing: 0; }
.drop-arrow { width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.2s; margin-right: 4px; margin-top: -4px; }
details.drop[open] .drop-arrow { transform: rotate(-135deg); margin-top: 4px; }
.drop-body { margin-top: 10px; }
.export-aide ul { margin: 6px 0 4px; padding-left: 18px; font-size: 0.88rem; color: var(--muted); }
.export-aide li { margin-bottom: 6px; }
.export-aide strong { color: var(--text); }
.pain select.span2 { grid-column: 1 / 3; }

/* ---------- Vidéo de renfo ---------- */
.vid-wrap { max-width: 640px; }
.vid-player { margin: 0 auto 10px; max-width: 360px; background: #000; border-radius: 18px; overflow: hidden; aspect-ratio: 9 / 16; }
.vid-player video { display: block; width: 100%; height: 100%; }
.vid-missing { background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; padding: 14px; color: var(--muted); }
.vid-ctrl { justify-content: center; align-items: center; }
.vid-chapters { list-style: none; margin: 0 0 10px; padding: 0; border-top: 1px solid var(--line); }
.vid-chapters button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; min-height: 50px; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; cursor: pointer; }
.vid-chapters .n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 0.8rem; font-weight: 700; }
.vid-chapters .d { margin-left: auto; color: var(--muted); font-size: 0.85rem; }
.vid-chapters button[aria-current="true"] { background: var(--tint-a); }
.vid-chapters button[aria-current="true"] .n { background: var(--accent-bg); color: var(--accent-ink); }

/* ---------- Minuteur : liens et programme ---------- */
.timer-links { display: flex; justify-content: center; gap: 18px; margin-bottom: 6px; flex-wrap: wrap; }
.timer-links button, .timer-links a { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.9rem; cursor: pointer; padding: 6px 4px; }
.timer-prog { position: fixed; inset: auto 0 0 0; max-height: 75vh; max-height: 75dvh; overflow-y: auto; background: var(--surface); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 14px 16px calc(16px + var(--safe-b)); z-index: 30; box-shadow: 0 -10px 40px rgba(0,0,0,0.5); }
.timer-prog-head { display: flex; justify-content: space-between; align-items: center; }
.timer-prog-head button { background: none; border: 0; color: var(--text); font-size: 1.2rem; cursor: pointer; }
.timer-prog ol { list-style: none; margin: 6px 0 0; padding: 0; }
.timer-prog .prog-head { margin: 12px 0 4px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.timer-prog li button { width: 100%; display: flex; justify-content: space-between; gap: 10px; text-align: left; padding: 10px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.timer-prog li button.on { background: var(--tint-a); color: var(--accent); font-weight: 600; }
.timer-prog li button.past { opacity: 0.5; }
@media (min-width: 700px) { .timer-prog { left: 50%; right: auto; width: 520px; transform: translateX(-50%); } }

/* ---------- Éditeur de renfo ---------- */
.ed-item { background: var(--surface-2); border-radius: 10px; padding: 8px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.ed-line { display: flex; gap: 6px; align-items: center; }
.ed-line .ed-nom { flex: 1; }
.ed-line .ed-sec { width: 70px; flex: 0 0 70px; }
.ed-cue { font-size: 0.9rem !important; min-height: 38px; padding: 6px 10px; }
.ed-btn { flex: 0 0 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1rem; }
.ed-btn:disabled { opacity: 0.3; }
.ed-btn.danger { color: var(--bad); }
.ed-bloc .card-title-row { gap: 8px; margin-bottom: 8px; }
.ed-titre { font-weight: 700; }
.ed-params { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.ed-params label { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; color: var(--muted); }
@media (max-width: 480px) { .ed-params { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ed-item .ed-nom { width: 100%; font-weight: 600; }
.ed-sec-l { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); }
.ed-sp { flex: 1; }
.timer-prog-head { position: sticky; top: -14px; background: var(--surface); padding: 6px 0; z-index: 1; }
svg.cg { touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.cg-tip { transition: left .08s, top .08s; }

/* ---------- Semaine type ---------- */
.fw-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 6px 8px; align-items: center; margin-bottom: 12px; }
.fw-row[hidden] { display: none; }
.fw-row .fw-lab { grid-column: 1 / -1; font-size: 0.92rem; font-weight: 600; }
.fw-row[data-role^="renfo"] select { grid-column: 1 / -1; }
.fw-row .check.fw-lab { margin: 0; font-weight: 600; }
.fw-row input[type=time] { min-width: 0; }
.fw-n { margin-bottom: 4px; }
.fw-warn p { color: var(--warn, #f5b041); font-size: 0.88rem; margin: 6px 0 0; }

/* Bouton d'import : texte centré, icône à la taille du bouton */
.btn.import-btn { display: flex; align-items: center; justify-content: center; gap: 12px; text-align: center; line-height: 1.25; padding-top: 12px; padding-bottom: 12px; }
.btn.import-btn .import-ico { width: 26px; height: 26px; flex: 0 0 26px; color: var(--accent); }
.btn.import-btn span { text-align: center; }
.btn.import-btn span { text-wrap: balance; }

/* ---------- Icônes de navigation (SVG) ---------- */
.nav a .ico { display: grid; place-items: center; }
.nav a .ico .i { width: 24px; height: 24px; display: block; }
.nav .nav-cta .ico .cta-ring { display: none; }
.nav .nav-cta .ico .i { width: 22px; height: 22px; }
.settings-fab .i { width: 22px; height: 22px; display: block; }
@media (min-width: 900px) {
  .nav .nav-cta .ico { background: none; color: var(--accent) !important; width: 24px; height: 24px; }
  .nav .nav-cta .ico .cta-ring { display: inline; }
  .nav .nav-cta .ico .i { width: 24px; height: 24px; }
}

/* ---------- Clips d'exercice dans le minuteur ---------- */
.timer-clip { position: relative; width: min(62vw, 300px); aspect-ratio: 1; margin: 6px auto 4px; border-radius: 18px; overflow: hidden; background: var(--clip-bg); box-shadow: 0 6px 24px rgba(0,0,0,0.35); }
.timer-clip[hidden] { display: none; }
.timer-clip video { width: 100%; height: 100%; display: block; object-fit: cover; }
.timer-clip-tag { display: none; position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 0.75rem; padding: 3px 8px; border-radius: 10px; }
.timer-clip.ahead video { opacity: 0.45; }
.timer-clip.ahead .timer-clip-tag { display: block; }

.ed-clip { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); }
.ed-clip select { flex: 1; min-height: 38px; height: 38px; font-size: 0.9rem; }

/* ---------- Son du minuteur ---------- */
.timer-son { display: flex; justify-content: center; gap: 10px; margin: 2px 0 6px; }
.son-tog { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--hover); color: var(--muted); font: inherit; font-size: 0.88rem; cursor: pointer; }
.son-tog[aria-pressed="true"] { color: var(--text); border-color: var(--accent); background: rgba(230,69,122,0.14); }
.timer-tip { text-align: center; color: var(--muted); font-size: 0.82rem; margin: 0 auto 6px; max-width: 420px; padding: 0 12px; }
.timer-tip[hidden] { display: none; }

/* ---------- Minuteur : tout tient dans l'écran (téléphone comme PC) ---------- */
.timer-main { gap: 6px; }
.timer-clip { width: min(62vw, 300px, 30vh); width: min(62vw, 300px, 30dvh); }
.timer-clock { font-size: clamp(3.4rem, min(26vw, 12vh), 11rem); font-size: clamp(3.4rem, min(26vw, 12dvh), 11rem); }
.timer-ex { font-size: clamp(1.4rem, min(6vw, 4.2vh), 3rem); }
.timer-cue { min-height: 0; }
.timer-top .back { white-space: nowrap; }
.timer-title { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-height: 720px) and (max-width: 899px) {
  .timer-progress { margin: 8px 0; }
  .timer-clip { width: min(52vw, 22vh); width: min(52vw, 22dvh); }
  .timer-ctrl { gap: 18px; margin: 4px 0; }
  .timer-ctrl .tbtn { transform: scale(0.82); }
  .timer-son { margin: 0 0 4px; }
  .son-tog { min-height: 32px; }
}

/* ---------- Icônes dessinées (boutons) ---------- */
.ic { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.2em; flex: none; }
.btn .ic { margin-right: 6px; }
.btn.icon .ic { margin: 0; }
.tbtn { display: inline-grid; place-items: center; }
.tbtn .ic { width: 26px; height: 26px; vertical-align: 0; }
.tbtn.big .ic { width: 34px; height: 34px; }
.tbtn.big .ic-play { transform: translateX(2px); }
.son-tog { display: inline-flex; align-items: center; gap: 6px; }
.son-tog .ic { width: 18px; height: 18px; }
.timer-links button, .timer-links a { display: inline-flex; align-items: center; gap: 6px; }
.timer-links .ic { width: 17px; height: 17px; }
.timer-tip .ic { width: 16px; height: 16px; margin-right: 4px; }
.back .ic { width: 16px; height: 16px; vertical-align: -0.15em; }

/* ---------- Barre : Sortie à gauche, Aujourd'hui au centre dans le rond orange ---------- */
.nav .nav-add .ico .cta-ring { display: inline !important; }
.nav .nav-add .ico { color: inherit; }
.nav .nav-add.active .ico, .nav .nav-add.active { color: var(--accent); }
.nav .nav-cta .ico .i { width: 22px; height: 22px; }
@media (min-width: 900px) {
  .nav a[data-nav="accueil"] { order: 1; } .nav a[data-nav="calendrier"] { order: 2; } .nav a[data-nav="ressenti"] { order: 3; }
  .nav a[data-nav="recaps"] { order: 4; } .nav a[data-nav="renfo"] { order: 5; } .nav a[data-nav="reglages"] { order: 6; }
  .nav .nav-cta .ico { background: none !important; color: inherit !important; width: 24px; height: 24px; }
  .nav .nav-cta.active .ico { color: var(--accent) !important; }
  .nav .nav-add .ico { color: var(--accent); }
}
.timer[data-type="cote"] { background: var(--t-cote); }
.timer[data-type="cote"] .timer-phase { color: #c39bff; }
.timer-clip.mirror video { transform: scaleX(-1); }
.ed-cote { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.ed-cote input { width: 18px; height: 18px; flex: none; }

/* ---------- Graphique : un mois à la fois sur téléphone ---------- */
.cg-month { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 6px; }
.cg-month[hidden] { display: none; }
.cg-mname { font-size: 1rem; }
.cg-arrow { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.cg-arrow .ic { width: 20px; height: 20px; vertical-align: 0; }
.cg-arrow:disabled { opacity: 0.3; cursor: default; }
.cg-val { fill: var(--muted); font-size: 11px; font-weight: 600; }
.pt-bravo::before { content: "★"; color: var(--accent); }
.week-sum-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.week-sum-row .week-sum { margin: 0; }
.watch-steps { padding-left: 20px; margin: 8px 0; display: grid; gap: 6px; font-size: 0.92rem; }
.watch-steps code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ---------- Minuteur : mise en page (téléphone = une colonne qui tient dans l'écran ; PC = une ligne) ---------- */
.timer-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; min-height: 0; }
.timer-main { display: contents; }
.timer-phase { order: 1; } .timer-ex { order: 2; } .timer-clip { order: 3; } .timer-cue { order: 4; } .timer-clock { order: 5; } .timer-next { order: 6; } .timer-pad { order: 7; }
.timer-pad { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.timer-ctrl { margin: 4px 0; }
@media (max-width: 899px) {
  .timer { padding-bottom: calc(8px + var(--safe-b)); }
  .timer-tip { display: none !important; }                 /* pas de texte musique sur téléphone */
  .timer-progress { margin: 10px 0 6px; }
  .timer-cue { min-height: 0; font-size: 0.9rem; max-width: 34ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .timer-ex { font-size: clamp(1.3rem, min(6vw, 3.6vh), 2.2rem); }
  .timer-clip { width: min(56vw, 26vh); width: min(56vw, 26dvh); margin: 2px auto; }
  .timer-clock { font-size: clamp(3rem, min(24vw, 10vh), 8rem); font-size: clamp(3rem, min(24vw, 10dvh), 8rem); }
  .timer-next { min-height: 0; font-size: 0.9rem; }
  .timer-ctrl { gap: 22px; }
  .tbtn { width: 56px; height: 56px; }
  .tbtn.big { width: 76px; height: 76px; }
  .timer-son { margin: 0; }
  .timer-links { margin: 0; gap: 12px; }
  .timer-links button, .timer-links a { padding: 4px; font-size: 0.85rem; }
  .timer-foot { margin: 0; font-size: 0.8rem; }
}
@media (min-width: 900px) {
  .timer-body { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 40px; text-align: left; }
  .timer-main { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
  .timer-main > * { order: 0; }
  .timer-ex { font-size: clamp(1.6rem, 2.6vw, 2.6rem); max-width: 16ch; }
  .timer-clock { font-size: clamp(4.5rem, 8vw, 8.5rem); }
  .timer-cue { min-height: 0; max-width: 34ch; }
  .timer-pad { width: auto; min-width: 280px; }
  .timer-main { order: 1; } .timer-pad { order: 2; } .timer-clip { order: 3; justify-self: end; margin: 0; width: min(30vw, 420px, 56vh); }
}

/* ---------- PC : menu de gauche tout en gris sauf la page affichée ---------- */
@media (min-width: 900px) {
  .nav a[data-nav] , .nav a[data-nav] .ico { color: var(--muted) !important; }
  .nav a[data-nav].active, .nav a[data-nav].active .ico { color: var(--accent) !important; }
  .nav a[data-nav].active { color: var(--text) !important; }
}
/* ---------- Ressenti : bouton d'enregistrement en bas de page, centré (pas fixé) ---------- */
#f .actions.end { position: static; justify-content: center; background: none; box-shadow: none; padding: 8px 0 4px; }
#f .actions.end .btn { min-width: min(100%, 320px); justify-content: center; }
@media (min-width: 900px) {
  .timer-main, .timer-main .timer-ex, .timer-main .timer-cue, .timer-main .timer-next { text-align: left; margin-left: 0; margin-right: 0; }
}
@media (max-width: 899px) and (max-height: 720px) {
  .timer-clip { width: min(50vw, 21vh); width: min(50vw, 21dvh); }
  .timer-clock { font-size: clamp(2.8rem, min(22vw, 9dvh), 6rem); }
  .timer-progress { margin: 6px 0 4px; }
  .tbtn { width: 50px; height: 50px; } .tbtn.big { width: 66px; height: 66px; }
  .timer-ctrl .tbtn { transform: none; }
  .son-tog { min-height: 30px; }
}

/* ---------- Volume du plan : jauges (téléphone) et barres en heures (PC) ---------- */
.lg-doneb { background: #d95926; }
.cg-doneb { fill: #d95926; }
.cg-plan.is-past { opacity: 0.5; }
.vg-list { display: flex; flex-direction: column; gap: 4px; }
.vg { display: block; padding: 10px 10px 8px; border-radius: 12px; color: inherit; text-decoration: none; }
.vg.is-current { background: var(--surface-2); }
.vg-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.92rem; }
.vg-name { font-weight: 600; white-space: nowrap; }
.vg-val { color: var(--muted); font-size: 0.82rem; text-align: right; }
.vg-val strong { color: var(--text); }
.vg-bar { position: relative; height: 12px; background: var(--track); border-radius: 6px; margin: 7px 0 5px; overflow: hidden; }
.vg-bar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 6px; }
.vg-plan { background: #3987e5; opacity: 0.4; }
.vg-done { background: #d95926; }
.vg-st { font-size: 0.78rem; color: var(--muted); }
.vg-now { color: var(--vg-now); font-weight: 600; }
.vg-tag { font-size: 0.7rem; padding: 1px 6px; border-radius: 8px; background: rgba(57,135,229,0.18); color: var(--vg-tag); font-weight: 500; }
.vg-race { color: var(--text); }

/* ---------- Coach (discussion) ---------- */
.coach-card .linkish { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.85rem; cursor: pointer; }
.chat-log { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; padding-right: 2px; }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg .bubble { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 0.93rem; line-height: 1.45; }
.msg.user .bubble { background: var(--accent-bg); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.coach .bubble { background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg.typing .bubble { color: var(--muted); letter-spacing: 0.2em; }
.msg-ops { margin-top: 8px; font-size: 0.85rem; }
.msg-ops summary { cursor: pointer; color: var(--accent); }
.msg-ops ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.msg-undo { margin-top: 8px; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 5px 10px; font: inherit; font-size: 0.82rem; cursor: pointer; }
.chat-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 16px; padding: 5px 11px; font: inherit; font-size: 0.82rem; cursor: pointer; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; min-height: 46px; max-height: 140px; line-height: 1.4; padding: 11px 12px; }
.chat-form .btn.icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; padding: 0; }
.chat-form .btn.icon .ic { width: 20px; height: 20px; margin: 0; vertical-align: 0; }
.chat-chips .chip { width: auto; flex: none; min-height: 32px; }

/* ---------- Calendrier : bouton montre décollé de la grille, mini-calendrier ---------- */
.week-sum-row { margin: -4px 0 18px; }
.cal-nav .btn.icon .ic { width: 20px; height: 20px; margin: 0; vertical-align: 0; }
.modal.picker { max-width: 340px; padding: 16px; }
.pk-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pk-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.pk-dow { text-align: center; font-size: 0.72rem; color: var(--muted); padding-bottom: 2px; }
.pk-day { position: relative; aspect-ratio: 1; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.9rem; cursor: pointer; width: auto; min-height: 0; padding: 0; }
.pk-day.out { opacity: 0.35; }
.pk-day.cur { background: rgba(230,69,122,0.16); }
.pk-day.today { outline: 2px solid var(--accent); }
.pk-day i { position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #3987e5; }
.pk-day i.pk-race { background: var(--accent); width: 7px; height: 7px; margin-left: -3.5px; }
.pk-foot { display: flex; justify-content: space-between; margin-top: 12px; }

/* ---------- Pop-up du coach ---------- */
.modal.coach-modal { max-width: 560px; width: calc(100% - 24px); display: flex; flex-direction: column; max-height: 86vh; max-height: 86dvh; }
.coach-modal .card-title-row h2 { margin: 0; }
.coach-modal .chat-log { flex: 1; max-height: none; min-height: 160px; }
.coach-modal [data-close] .ic { width: 20px; height: 20px; }
.page-head .btn .ic { margin-right: 6px; }

/* ---------- Renfo : durée sous le titre ---------- */
.renfo-dur { color: var(--muted); font-size: 0.9rem; margin: -4px 0 8px; }

/* ---------- Pop-up : écran figé derrière ---------- */
body.modal-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
body.modal-open .settings-fab, body.kb-open .nav { display: none; }
@media (min-width: 900px) { body.modal-open .nav { display: flex; } }
.modal-back { height: 100vh; height: 100dvh; overscroll-behavior: contain; touch-action: none; }
.modal-back .modal { touch-action: auto; overscroll-behavior: contain; }
.modal .chat-log { overscroll-behavior: contain; }

/* ---------- Mini-calendrier : points sortie / renfo / course + légende ---------- */
.pk-dots { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; gap: 3px; }
.pk-day .pk-dots i, .pk-legend i { position: static; display: inline-block; width: 5px; height: 5px; margin: 0; border-radius: 50%; }
.pk-run { background: #8cc0ff; }
.pk-renfo { background: #2b6be0; }
.pk-race { background: var(--accent); }
.pk-legend { display: flex; justify-content: center; gap: 14px; margin-top: 10px; font-size: 0.78rem; color: var(--muted); }
.pk-legend i { width: 8px !important; height: 8px !important; margin-right: 5px !important; vertical-align: 0; }

/* ---------- Renfo : texte principal seulement ---------- */
.renfo-dur { color: var(--text); }
.pk-k-specifique { background: var(--k-spe); } .pk-k-ef { background: var(--k-ef); } .pk-k-longue { background: var(--k-longue); }
.pk-k-libre { background: var(--k-libre); } .pk-k-renfo { background: var(--k-renfo); } .pk-k-course { background: var(--k-course); }
.pk-legend { flex-wrap: wrap; gap: 6px 12px; }
.pk-day .pk-dots i { width: 6px; height: 6px; }
.pk-dots i.pk-k-specifique, .pk-legend i.pk-k-specifique { background: var(--k-spe); }
.pk-dots i.pk-k-ef, .pk-legend i.pk-k-ef { background: var(--k-ef); }
.pk-dots i.pk-k-longue, .pk-legend i.pk-k-longue { background: var(--k-longue); }
.pk-dots i.pk-k-libre, .pk-legend i.pk-k-libre { background: var(--k-libre); }
.pk-dots i.pk-k-renfo, .pk-legend i.pk-k-renfo { background: var(--k-renfo); }
.pk-dots i.pk-k-course, .pk-legend i.pk-k-course { background: var(--k-course); }

/* ---------- Pop-up et clavier : toujours visible en entier ---------- */
.modal-back { bottom: auto; }
.modal-back .modal { max-height: calc(100% - 24px); }
.modal.coach-modal { max-height: calc(100% - 24px); }
.modal-back.kb { padding: 8px; align-items: stretch; }
.modal-back.kb .modal { max-height: 100%; height: 100%; }
.modal-back.kb .coach-modal .chat-chips { display: none; }
.modal-back.kb .coach-modal .chat-log { min-height: 60px; }

/* ---------- Assistant de démarrage ---------- */
body.onboarding-mode .nav, body.onboarding-mode .settings-fab { display: none; }
body.onboarding-mode .view { margin-left: auto; margin-right: auto; }
.wz { max-width: 560px; margin: 0 auto; padding-top: 12px; }
.wz-steps { display: flex; gap: 6px; margin: 4px 0 14px; }
.wz-steps span { flex: 1; text-align: center; font-size: 0.72rem; color: var(--muted); padding-top: 8px; border-top: 3px solid var(--line); }
.wz-steps span.on { color: var(--text); border-color: var(--accent); font-weight: 600; }
.wz-steps span.done { border-color: rgba(230,69,122,0.45); }
.wz-card h2 { margin: 0 0 6px; }
.wz-list { padding-left: 18px; margin: 6px 0 10px; color: var(--muted); font-size: 0.92rem; }
.wz .linkish { display: block; margin: 12px auto 0; background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; font-size: 0.88rem; cursor: pointer; }
.linkish.forgot { display: block; margin: 10px 0 0; background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font: inherit; font-size: 0.88rem; cursor: pointer; }

/* Suppression du compte */
.danger-zone { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line, #262d38); }
.danger-zone .btn { margin-bottom: 6px; }
.del-list { margin: 8px 0 10px; padding-left: 20px; }
.del-list li { margin: 4px 0; }
.del-word { width: 100%; margin: 6px 0 4px; font-size: 1.05rem; letter-spacing: 0.08em; text-transform: uppercase; }
.modal .btn:disabled { opacity: .45; cursor: not-allowed; }

/* Deux boutons côte à côte (création de compte / connexion) */
.actions.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 10px; }
.actions.duo .btn { box-sizing: border-box; width: 100%; max-width: none; min-width: 0; margin: 0; flex: none; display: flex; align-items: center; padding-left: 6px; padding-right: 6px; text-align: center; justify-content: center; white-space: normal; line-height: 1.2; font-size: clamp(0.85rem, 3.7vw, 1rem); }

/* Assistant : objectif et terrain */
.wz-choices { display: grid; gap: 10px; margin: 12px 0; }
.choice { display: block; width: 100%; text-align: left; font: inherit; color: var(--text); background: transparent; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; }
.choice.on { border-color: var(--accent); background: rgba(230,69,122,.08); }
.choice b { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.choice span { color: var(--muted); font-size: .9rem; line-height: 1.4; }
.wz-q { font-size: .92rem; color: var(--muted); margin: 12px 0 6px; }
.seg3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0; }
.seg3 label { display: block; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 6px; text-align: center; font-size: .9rem; cursor: pointer; color: var(--text); }
.seg3 label.on { border-color: var(--accent); background: rgba(230,69,122,.1); }
.seg3 label small { display: block; color: var(--muted); font-size: .72rem; margin-top: 2px; }
.seg3 input { position: absolute; opacity: 0; pointer-events: none; }
.form .seg3 label { display: block; margin: 0; position: relative; color: var(--text); }
:root[data-theme="light"] .timer[data-type="cote"] .timer-phase { color: #7a3fd0; }

/* Bulle « Coach » flottante */
.coach-fab { position: fixed; z-index: 40; right: 16px; bottom: calc(var(--nav-h) + 14px + var(--safe-b)); display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 18px 0 14px; border: 0; border-radius: 26px; background: var(--accent-bg); color: #fff; font: 600 1rem/1 inherit; font-family: inherit; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); cursor: pointer; transition: padding .2s, width .2s; }
.coach-fab .ic { width: 24px; height: 24px; margin: 0; }
.coach-fab.mini { padding: 0 14px; }
.coach-fab.mini span { display: none; }
body.modal-open .coach-fab { display: none; }
@media (min-width: 900px) { .coach-fab { bottom: 24px; right: 24px; } }
.chat-links { display: inline-flex; gap: 14px; align-items: center; }
.ex-link { display: block; margin-top: 8px; font-size: 0.88rem; }
/* « en train d'écrire » */
.msg.typing .bubble { display: inline-flex; gap: 4px; padding: 12px 14px; }
.msg.typing .bubble i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite ease-in-out; }
.msg.typing .bubble i:nth-child(2) { animation-delay: .15s; } .msg.typing .bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
/* Exemples de conversations */
.ex-back { z-index: 70; }
.modal.ex-modal { max-width: 520px; width: calc(100% - 24px); max-height: 86vh; max-height: 86dvh; overflow-y: auto; }
.ex-shots { display: grid; gap: 12px; margin: 10px 0 4px; }
.ex-shot { margin: 0; border: 1px solid var(--line); border-radius: 18px; padding: 12px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.ex-shot figcaption { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ex-shot .bubble { font-size: 0.88rem; }
@media (min-width: 700px) { .ex-shots { grid-template-columns: 1fr 1fr; } .modal.ex-modal { max-width: 760px; } }
.ex-link.linkish { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; padding: 0; }
.ex-modal .card-title-row [data-x] { background: none; border: 0; padding: 4px; color: var(--muted); box-shadow: none; }
/* place sous le dernier élément pour qu'il ne soit jamais caché par la bulle */
body.has-fab .view { padding-bottom: calc(var(--nav-h) + 92px + var(--safe-b)); }
@media (min-width: 900px) { body.has-fab .view { padding-bottom: 96px; } }

/* Fenêtre du coach : entière à l'écran, messages collés en bas (comme une messagerie) */
.modal-back { padding-top: calc(16px + var(--safe-t)); padding-bottom: calc(16px + var(--safe-b)); }
.modal.coach-modal { max-height: min(74vh, 640px); max-height: min(74dvh, 640px); }
.coach-modal .chat-log > :first-child { margin-top: auto; }
.modal-back.kb { padding: calc(6px + var(--safe-t)) 8px 6px; }
.modal-back.kb .coach-modal { max-height: 100%; height: auto; }
.modal-back.kb .coach-modal .chat-log { flex: 1 1 auto; min-height: 0; }

/* Coach : hauteur fixe, seuls les messages défilent, la zone de saisie reste toujours visible */
.coach-back { z-index: 60; }
.modal.coach-modal { height: min(74vh, 620px); height: min(100%, 620px); max-height: 100%; }
.coach-modal .chat-log { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
.coach-modal .chat-form { flex: none; }
.coach-modal .card-title-row { flex: none; }
.modal-back.kb .coach-modal { height: 100%; }
@media (max-width: 899px) { .coach-back:not(.kb) { padding-bottom: 10px; } }
.coach-modal .chat-log { position: relative; }

/* Défaut d'iOS : si l'écran reste « rétréci » après le clavier, la bande du bas (où rien ne s'affiche)
   prend la couleur de la barre du bas, qui perd sa marge du bas : les deux se fondent */
:root { --nav-solid: #151a21; }
:root[data-theme="light"] { --nav-solid: #ffffff; }
html.vp-stuck { background: var(--nav-solid); }
html.vp-stuck .nav { padding-bottom: 0; height: var(--nav-h); background: var(--nav-solid); }
@media (min-width: 900px) { html.vp-stuck { background: var(--bg); } }

/* ================= Refonte v2 : barre du bas + Aujourd'hui ================= */
/* Barre du bas (téléphone) : Réglages remplace Renfo (le renfo passe dans Aujourd'hui) */
@media (max-width: 899px) {
  .nav .nav-settings { display: flex; }
  .nav a[data-nav="renfo"] { display: none; }
  .page-head { padding-right: 0; }
}
/* Courbes de niveau en fond d'en-tête */
.view { position: relative; }
.view > .topo { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 330px; pointer-events: none; z-index: 0; stroke: var(--accent); stroke-opacity: .16; stroke-width: 1.2; }
:root[data-theme="light"] .view > .topo { stroke-opacity: .12; }
.view > .topo ~ * { position: relative; z-index: 1; }
/* Mot du coach */
.coach-hello { display: flex; gap: 10px; align-items: flex-end; margin: -4px 0 18px; }
.coach-hello img { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.coach-hello .bubble { background: var(--surface-2); border-radius: 18px 18px 18px 4px; padding: 12px 14px; font-size: 0.97rem; line-height: 1.42; }
.coach-hello .linkish { background: none; border: 0; font: inherit; cursor: pointer; text-align: left; display: block; margin-top: 6px; padding: 0; color: var(--accent); font-weight: 600; font-size: 0.88rem; }
/* Bande des 7 jours */
.wstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0 0 18px; }
.wstrip a { text-align: center; padding: 8px 0 9px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; text-decoration: none; }
.wstrip b { display: block; font-size: 1.06rem; color: var(--text); margin: 2px 0 6px; }
.wstrip .bars { display: flex; gap: 3px; height: 5px; margin: 0 9px; }
.wstrip .bars i { flex: 1; border-radius: 3px; }
.wstrip a.past b { color: var(--muted); } .wstrip a.past .bars { opacity: .6; }
.wstrip a { position: relative; }
.wstrip a.done::after { content: "✓"; position: absolute; top: 4px; right: 6px; font-size: .68rem; font-weight: 800; color: var(--ok); }
.wstrip a.on { background: var(--accent-bg); border-color: var(--accent-bg); color: #ffd6e3; }
.wstrip a.on b { color: #fff; }
.wstrip a.on.done::after { color: #fff; }
/* Billet de la séance du jour */
.ticket { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; margin: 0 0 16px; overflow: hidden; }
.ticket .tk-part + .tk-part { border-top: 1px solid var(--line); }
.ticket .tk-day { margin: 0; padding: 14px 16px 0; }
.ticket .tk-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 16px 4px; }
.ticket .eyebrow { margin: 0 0 4px; }
.ticket h2 { margin: 0; font-size: 1.42rem; line-height: 1.2; color: var(--text); }
.ticket h2 a { color: inherit; text-decoration: none; }
.ticket .tk-z { flex: none; font-size: 0.75rem; font-weight: 700; padding: 4px 9px; border-radius: 99px; color: var(--zc); background: color-mix(in srgb, var(--zc) 16%, transparent); }
.ticket .tk-meta { margin: 0; padding: 0 16px; color: var(--muted); font-size: 0.9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.ticket .tk-meta b { color: var(--text); }
.ticket .tk-meta a { color: var(--accent); }
.ticket .tk-prof { height: 74px; margin: 14px 16px 0; display: flex; align-items: flex-end; gap: 3px; }
.ticket .tk-prof i { display: block; min-width: 3px; border-radius: 5px 5px 0 0; }
.ticket .tk-act { display: flex; border-top: 1px dashed var(--line); margin-top: 14px; }
.ticket .tk-act > * { flex: 1; text-align: center; padding: 13px 6px; font-weight: 600; font-size: 0.95rem; text-decoration: none; color: var(--accent); }
.ticket .tk-act > * + * { border-left: 1px dashed var(--line); }
.ticket .tk-act .tk-sec { color: var(--text); font-weight: 500; }
.ticket .tk-act .tk-ok { color: var(--ok); }
.ticket.multi::before, .ticket.multi::after { display: none; }
.ticket::before, .ticket::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); bottom: 38px; }
.ticket::before { left: -10px; } .ticket::after { right: -10px; }
.ticket.rest::before, .ticket.rest::after { display: none; }
.ticket.rest { padding-bottom: 16px; }
.ticket.rest .tk-meta { display: block; line-height: 1.45; margin-top: 6px; }
.ticket .tk-part.is-done .tk-prof { opacity: .55; }
.ticket.kind-course { background: var(--course-bg, var(--surface)); }
/* Compte à rebours course */
.countdown { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 14px 16px 16px; margin: 0 0 16px; --pc: var(--k-longue); }
.countdown.prio-A { --pc: var(--accent); }
.countdown .cd-prof { position: absolute; right: 0; top: 44px; width: 52%; height: 54px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%); mask-image: linear-gradient(90deg, transparent, #000 30%); }
.countdown .cd-prof .a { fill: color-mix(in srgb, var(--pc) 18%, transparent); }
.countdown .cd-prof .l { fill: none; stroke: var(--pc); stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.countdown > :not(.cd-prof) { position: relative; }
.countdown .cd-head { display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
.countdown .cd-head .eyebrow { margin: 0; }
.countdown .cd-head .add-circle { margin-left: auto; background: var(--surface); border-radius: 50%; }
.countdown .cd-big { font-size: 2.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-top: 10px; }
.countdown .cd-big small { font-size: 0.95rem; color: var(--muted); font-weight: 600; margin-left: 5px; letter-spacing: 0; }
.countdown .cd-name { font-size: 1.05rem; font-weight: 600; margin-top: 8px; }
.countdown .cd-meta { font-size: 0.84rem; color: var(--muted); }
.countdown .cd-next { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 7px; }
.countdown .cd-next li { display: flex; gap: 10px; align-items: baseline; font-size: 0.9rem; }
.countdown .cd-next li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--k-longue); flex: none; align-self: center; }
.countdown .cd-next li.prio-A::before { background: var(--accent); }
.countdown .cd-next b { min-width: 46px; }
.countdown .cd-next span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.countdown.empty .muted { margin: 8px 0 0; }
/* Anneaux de la semaine */
.rings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.rings-head { grid-column: span 2; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 4px; }
.rings-head .card-title { margin: 0; }
.rings-head span { color: var(--muted); font-size: 0.82rem; }
.ring-c { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px; display: flex; gap: 12px; align-items: center; min-width: 0; }
.ring-c svg { width: 54px; height: 54px; flex: none; }
.ring-c .ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.ring-c b { font-size: 1.15rem; display: block; white-space: nowrap; }
.ring-c span { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
/* Renfo du jour */
.renfo-day { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 14px 16px 0; margin: 0 0 16px; }
.renfo-day .rd-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.renfo-day .eyebrow { margin: 0 0 3px; }
.renfo-day h2 { margin: 0; font-size: 1.12rem; line-height: 1.25; }
.renfo-day h2 a { color: inherit; text-decoration: none; }
.renfo-day .rd-min { flex: none; font-size: 0.75rem; font-weight: 700; padding: 4px 9px; border-radius: 99px; color: var(--k-renfo); background: color-mix(in srgb, var(--k-renfo) 16%, transparent); }
.renfo-day .rd-ex { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.renfo-day .rd-ex span { background: var(--surface-2); border-radius: 10px; padding: 6px 10px; font-size: 0.82rem; }
.renfo-day .rd-act { display: flex; justify-content: space-between; gap: 10px; border-top: 1px dashed var(--line); margin-top: 12px; padding: 12px 0; font-size: 0.93rem; font-weight: 600; }
.renfo-day .rd-act a { text-decoration: none; color: var(--k-renfo); }
.renfo-day .rd-act .tk-sec { color: var(--muted); font-weight: 500; }
.renfo-day .rd-act .tk-ok { color: var(--ok); }
.renfo-link { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; margin: 0 0 16px; color: inherit; text-decoration: none; }
.renfo-link .ri { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--k-renfo); background: color-mix(in srgb, var(--k-renfo) 15%, transparent); flex: none; }
.renfo-link .ri svg { width: 20px; height: 20px; }
.renfo-link b { display: block; font-size: 0.95rem; }
.renfo-link small { color: var(--muted); font-size: 0.8rem; }
.renfo-link .chev { margin-left: auto; color: var(--muted); font-size: 1.2rem; }
:root[data-theme="light"] .renfo-day .rd-act a:not(.tk-sec), :root[data-theme="light"] .renfo-day .rd-min, :root[data-theme="light"] .renfo-link .ri { color: color-mix(in srgb, var(--k-renfo) 65%, #2a1450); }
/* Page Aujourd'hui personnalisable */
.tblocks { -webkit-touch-callout: none; }
.tblock { position: relative; }
.tblock > .card, .tblock > section, .tblock > nav, .tblock > div, .tblock > a { margin-bottom: 16px; }
.view > .tedit-bar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; margin: 0 0 16px; box-shadow: none; }
.view > .tedit-bar b { display: block; } .view > .tedit-bar small { color: var(--muted); font-size: 0.8rem; }
.tblocks.editing { -webkit-user-select: none; user-select: none; }
.tblocks.editing .tblock > :not(.tb-del):not(.tb-grip) { pointer-events: none; }
.tblocks.editing .tblock { animation: tb-wiggle .32s ease-in-out infinite alternate; transform-origin: 50% 50%; }
.tblocks.editing .tblock:nth-child(2n) { animation-delay: -.16s; }
@keyframes tb-wiggle { from { rotate: -0.35deg; } to { rotate: 0.35deg; } }
@media (prefers-reduced-motion: reduce) { .tblocks.editing .tblock { animation: none; } }
.tb-del { position: absolute; z-index: 3; top: -8px; left: -6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: #e5484d; color: #fff; font: 700 20px/26px system-ui; padding: 0; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.tb-grip { position: absolute; z-index: 3; top: -8px; right: -6px; width: 34px; height: 28px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); display: grid; place-items: center; font-size: 18px; touch-action: none; cursor: grab; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.tblock.dragging { animation: none !important; z-index: 10; opacity: .95; filter: drop-shadow(0 12px 22px rgba(0,0,0,.45)); transition: none; }
.tedit-hidden .tb-add { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 8px; color: var(--text); font: inherit; cursor: pointer; }
.tedit-hidden .tb-add span { width: 24px; height: 24px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-weight: 800; }
.tedit-hidden .linkish { background: none; border: 0; padding: 6px 0 0; color: var(--accent); font: inherit; cursor: pointer; }
body.today-edit .coach-fab { display: none; }
/* ================= Plan ================= */
.plan-flag { display: flex; gap: 10px; align-items: center; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent); border-radius: 14px; padding: 10px 12px; font-size: 0.88rem; margin: -4px 0 14px; }
.wk-sel { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; margin: 0 0 14px; }
.wk-ar { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-size: 1.3rem; text-decoration: none; }
.wk-mid { flex: 1; text-align: center; min-width: 0; }
.wk-mid b { display: block; font-size: 1rem; }
.wk-mid span { display: block; font-size: 0.8rem; color: var(--muted); }
.wk-mid .wk-back { font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.wk-mix { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; margin: 0 0 6px; }
.wk-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 0.8rem; margin: 0 0 16px; }
.wk-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
/* Sentier de la semaine */
.wtrail { position: relative; padding-left: 66px; margin: 18px 0 8px; }
.wtrail .tr-path { position: absolute; left: 0; top: 0; width: 66px; height: 100%; overflow: visible; pointer-events: none; }
.wtrail .tr-path path { fill: none; stroke-width: 3.5; stroke-linecap: round; }
.wtrail .tr-path .done { stroke: var(--accent); }
.wtrail .tr-path .todo { stroke: color-mix(in srgb, var(--muted) 70%, transparent); stroke-dasharray: 1 8; }
.tr-day { margin-bottom: 14px; }
.tr-stop { position: relative; margin-bottom: 10px; --kc: var(--k-libre); }
.tr-stop.k-specifique { --kc: var(--k-spe); } .tr-stop.k-ef { --kc: var(--k-ef); } .tr-stop.k-longue { --kc: var(--k-longue); }
.tr-stop.k-renfo { --kc: var(--k-renfo); } .tr-stop.k-course { --kc: var(--k-course); }
.tr-dot { position: absolute; left: -46px; top: 30px; width: 20px; height: 20px; border-radius: 50%; background: var(--kc); border: 3px solid var(--bg); z-index: 1; display: grid; place-items: center; }
.tr-stop.st-faite .tr-dot::after { content: "✓"; color: #0f1217; font-size: 11px; font-weight: 900; line-height: 1; }
.tr-stop.rest .tr-dot { width: 12px; height: 12px; top: 6px; background: var(--surface-2); border-width: 2px; }
.tr-lab { margin: 0 0 5px; font-size: 0.72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tr-rest { margin: -2px 0 0; font-size: 0.85rem; color: var(--muted); }
.tr-stop.rest { display: flex; gap: 10px; align-items: baseline; }
.tr-stop.rest .tr-lab { margin: 0; }
.tr-box { display: block; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--kc); border-radius: 16px; padding: 11px 13px; color: inherit; text-decoration: none; }
.tr-box b { display: block; font-size: 1rem; }
.tr-box span { font-size: 0.82rem; color: var(--muted); }
.tr-stop.st-faite .tr-box { opacity: .62; }
.tr-stop.st-manquee .tr-box b { text-decoration: line-through; text-decoration-color: var(--muted); }
.tr-sub { margin: 6px 0 0 4px; font-size: 0.8rem; color: var(--muted); }
.tr-sub a { color: var(--accent); font-weight: 600; text-decoration: none; }
.tr-day.today .tr-lab { color: var(--accent); }
.tr-day.today .tr-box { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
.tr-next { display: inline-block; margin: 4px 0 0 -6px; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-decoration: none; letter-spacing: .04em; }
/* ================= Réglages en tuiles ================= */
.view:not(.set-only) .set-sections { display: none; }
.view.set-only .set-sections > [data-s]:not(.is-open) { display: none; }
.set-id { display: flex; gap: 14px; align-items: center; margin: 4px 0 16px; }
.set-id .av { width: 62px; height: 62px; flex: none; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.set-id h1 { margin: 0; font-size: 1.6rem; }
.set-id p { margin: 2px 0 0; color: var(--muted); font-size: 0.86rem; }
.set-bilan { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 6px; margin: 0 0 6px; }
.set-bilan div + div { border-left: 1px solid var(--line); }
.set-bilan b { display: block; font-size: 1.35rem; }
.set-bilan span { font-size: 0.75rem; color: var(--muted); }
.set-sec { margin: 20px 4px 8px; font-size: 0.75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.stiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) { .stiles { grid-template-columns: repeat(3, 1fr); } }
.stile { position: relative; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; min-height: 104px; color: inherit; text-decoration: none; min-width: 0; }
.stile .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 10px; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.stile .ic svg { width: 20px; height: 20px; }
.stile b { display: block; font-size: 0.95rem; }
.stile span { display: block; font-size: 0.8rem; color: var(--muted); }
.stile .mini { display: flex; gap: 4px; margin-top: 8px; }
.stile .mini i { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-2); }
.stile.wide { grid-column: 1 / -1; min-height: 0; display: flex; gap: 12px; align-items: center; }
.stile.wide .ic { margin: 0; flex: none; }
.stile.wide > div { flex: 1; min-width: 0; }
.stile.wide span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stile.wide em { font-style: normal; color: var(--muted); font-size: 1.2rem; }
.stile.wide em .on { font-style: normal; color: var(--ok); font-size: 0.9rem; }
.set-say { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 18px; padding: 12px 14px; font-size: 0.9rem; }
.set-say span { width: 100%; color: var(--muted); }
.set-say button { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 7px 12px; font: inherit; font-size: 0.85rem; color: var(--text); cursor: pointer; }
.view.set-only .set-sections > [data-s] > .card-title:first-child { display: none; }
/* Activité du jour : renfo et repos dans le billet */
.ticket .rd-ex { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 16px 0; }
.ticket .rd-ex span { background: var(--surface-2); border-radius: 10px; padding: 6px 10px; font-size: 0.82rem; }
.ticket .tk-act .tk-renfo { color: var(--k-renfo); }
:root[data-theme="light"] .ticket .tk-act .tk-renfo { color: color-mix(in srgb, var(--k-renfo) 65%, #2a1450); }
.ticket.rest .tk-phrase { font-size: 0.95rem; color: var(--text); line-height: 1.45; }
.ticket .tk-next { margin: 10px 16px 0; font-size: 0.85rem; color: var(--muted); }
.ticket .tk-next a { color: var(--accent); }
.ticket .kind-renfo.is-done .rd-ex { opacity: .55; }
.tblocks.editing .rings-head { padding: 0 42px; }
/* Sortie retirée de la barre (synchro Strava automatique) : ajout manuel depuis le + du Plan */
.nav a[data-nav="ressenti"] { display: none !important; }
.plan-tools { display: flex; gap: 8px; }
/* Barre du bas version B : 4 boutons identiques, Aujourd'hui en premier, le bouton actif en framboise */
@media (max-width: 899px) {
  .nav a[data-nav="accueil"] { order: 1; } .nav a[data-nav="calendrier"] { order: 2; }
  .nav a[data-nav="recaps"] { order: 3; } .nav a[data-nav="reglages"] { order: 4; }
  .nav .nav-cta .ico { background: none !important; color: inherit !important; width: auto; height: auto; margin: 0 !important; border: 0 !important; box-shadow: none !important; transform: none !important; }
  .nav .nav-cta .ico .cta-ring { display: inline !important; }
  .nav .nav-cta .ico .i { width: 24px; height: 24px; }
  .nav .nav-cta { transform: none !important; margin-top: 0 !important; }
  .nav a.active, .nav a.active .ico, .nav .nav-cta.active .ico { color: var(--accent) !important; }
}
/* Rappels programmés */
.rappels { margin: 12px 0 4px; }
.rp-title { margin: 0 0 8px; font-weight: 700; }
.rp-row { display: flex !important; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 14px; padding: 12px; margin: 0 0 8px; cursor: pointer; }
.rp-row > input[type=checkbox] { width: 22px; height: 22px; flex: none; accent-color: var(--accent-bg); margin: 0; }
.rp-row > span { flex: 1; min-width: 0; }
.rp-row b { display: block; font-size: 0.95rem; }
.rp-row small { display: block; color: var(--muted); font-size: 0.78rem; line-height: 1.35; }
.rp-row input[type=time] { flex: none; width: auto; min-width: 86px; padding: 8px 10px; border-radius: 10px; font: inherit; font-weight: 600; }
.rp-row input[type=time]:disabled { opacity: .4; }
