/* Suivi sport — ambiance « Soleil méditerranéen » : sable, soleil, mer, pins. Thème « Nuit » en option. */
:root {
  color-scheme: light;
  --bg: #fff8ef; --s1: #ffffff; --s2: #fdf0e0; --bd: #f3e3cf;      /* sable et calcaire */
  --tx: #2a1c10; --mu: #8a7460;
  --ac: #ff7a1a; --ac-t: #d9480f; --ac-ink: #ffffff;                /* soleil */
  --run: #0891b2;                                                    /* mer */
  --ok: #2f9e6b; --bad: #dc2626;                                     /* pin */
  --glow: #ffe6c7;
  --hero: linear-gradient(165deg, #ffb648 0%, #ff8a3d 42%, #ff5f6d 100%); --hero-shadow: rgba(255, 110, 70, .55);
  --ring1: #ffffff; --ring2: #fff0a8;
  --r: 20px; --shadow: 0 2px 10px rgba(180, 110, 40, .08);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1823; --s1: #172230; --s2: #20303f; --bd: #2b3d50;      /* nuit sur la mer */
  --tx: #f6efe6; --mu: #9aabba;
  --ac: #ff9a3c; --ac-t: #ffb46b; --ac-ink: #1f1503;
  --run: #3cc8dc; --ok: #46d39a; --bad: #ff7a7a;
  --glow: #1a2a3a; --hero-shadow: rgba(255, 110, 70, .35); --shadow: none;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font: 16px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
body { min-height: 100dvh; background: linear-gradient(180deg, var(--glow) 0, var(--bg) 280px) no-repeat, var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
main { max-width: 640px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px 120px; }
.num { font-variant-numeric: tabular-nums; }

/* Titres */
.top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.top h1 { font-size: 28px; line-height: 1.15; margin: 0; font-weight: 800; letter-spacing: -.02em; }
.top .sub { color: var(--mu); font-size: 14px; margin-top: 4px; }
.top .grow { flex: 1; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--ac) 16%, transparent); color: var(--ac-t); font-weight: 700; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; }
.sec { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mu); margin: 26px 4px 10px; }
.mu { color: var(--mu); } .small { font-size: 13.5px; }

/* Cartes */
.card { background: var(--s1); border: 1px solid var(--bd); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 > * { min-width: 0; margin: 0 !important; }
.kpi .l { color: var(--mu); font-size: 13px; }
.kpi .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.kpi .v small { font-size: 15px; font-weight: 600; color: var(--mu); }
.kpi .d { font-size: 13px; color: var(--mu); }
a.card, button.card { display: block; width: 100%; text-align: left; text-decoration: none; color: inherit; }

/* Anneaux de la semaine */
.rings { display: flex; align-items: center; gap: 8px; }
.ring { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ring svg { width: 104px; height: 104px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring .rg { stroke: var(--s2); }
.ring .rv { transition: stroke-dasharray .5s ease; }
.ring .rc { position: absolute; top: 0; left: 0; right: 0; height: 104px; display: grid; place-content: center; text-align: center; }
.ring .rc b { font-size: 30px; font-weight: 800; line-height: 1; }
.ring .rc span { font-size: 12px; color: var(--mu); }
.ring .rl { font-weight: 700; font-size: 14px; }
.stats { display: flex; border-top: 1px solid var(--bd); margin: 16px -16px -16px; }
.stats div { flex: 1; padding: 12px 8px; text-align: center; border-right: 1px solid var(--bd); }
.stats div:last-child { border: 0; }
.stats b { display: block; font-size: 18px; font-weight: 800; }
.stats span { font-size: 12px; color: var(--mu); }

/* Programme */
.todo { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--bd); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.todo:last-child { border-bottom: 0; padding-bottom: 0; } .todo:first-child { padding-top: 0; }
.todo .ck { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--bd); display: grid; place-items: center; }
.todo.done .ck { background: var(--ok); border-color: var(--ok); color: #06240f; }
.todo .ck svg { width: 16px; height: 16px; }
.todo .t { font-weight: 700; } .todo.done .t { color: var(--mu); }
.todo .day { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.todo .d { font-size: 13.5px; color: var(--mu); }
.todo .go { color: var(--mu); margin-left: auto; flex: none; } .todo .go svg { width: 18px; height: 18px; }
.note { background: color-mix(in srgb, var(--ac) 12%, transparent); color: var(--ac-t); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-top: 12px; }

/* Tableau des semaines */
.weeks { width: 100%; border-collapse: collapse; font-size: 14px; }
.weeks th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--mu); font-weight: 700; padding: 0 4px 8px; text-align: center; }
.weeks td { padding: 9px 4px; border-top: 1px solid var(--bd); text-align: center; }
.weeks th:first-child, .weeks td:first-child { text-align: left; }
.weeks tr.cur td:first-child { font-weight: 800; }
.dots { display: inline-flex; gap: 5px; vertical-align: middle; }
.dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bd); }
.dots.renfo i.on { background: var(--ac); border-color: var(--ac); }
.dots.run i.on { background: var(--run); border-color: var(--run); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding-top: 20px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bars .b i { display: block; width: 100%; border-radius: 6px; background: var(--s2); min-height: 3px; }
.bars .b.cur i { background: var(--run); }
.bars .b b { font-size: 11.5px; font-weight: 700; } .bars .b span { font-size: 11px; color: var(--mu); }

/* Boutons et champs */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; border-radius: 14px; padding: 14px 16px; font-weight: 800; font-size: 16px; background: var(--ac); color: var(--ac-ink); }
.btn.sec2 { background: var(--s2); color: var(--tx); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); }
.btn:disabled { opacity: .4; } .btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(.98); }
.icon { background: var(--s1); border: 1px solid var(--bd); border-radius: 12px; width: 42px; height: 42px; display: grid; place-items: center; flex: none; }
.icon svg { width: 20px; height: 20px; }
.x { background: none; border: 0; color: var(--mu); padding: 8px; border-radius: 10px; } .x svg { width: 18px; height: 18px; display: block; }
label.f { display: block; font-size: 13px; color: var(--mu); margin-bottom: 12px; }
label.f > input, label.f > select, label.f > textarea { margin-top: 5px; }
input, select, textarea { width: 100%; background: var(--s2); border: 1px solid var(--bd); border-radius: 12px; padding: 12px; font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ac); outline-offset: 1px; }
textarea { resize: vertical; min-height: 70px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--bd); background: var(--s2); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 600; }
.chips button.on { background: var(--ac); border-color: var(--ac); color: var(--ac-ink); }

/* Exercices */
.prog { height: 8px; background: var(--s2); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.prog i { display: block; height: 100%; background: var(--ac); border-radius: 99px; transition: width .3s; }
.ex { background: var(--s1); border: 1px solid var(--bd); border-radius: var(--r); padding: 12px; margin-top: 10px; display: grid; grid-template-columns: 96px 1fr; gap: 4px 14px; align-items: center; transition: border-color .2s; }
.ex.done { border-color: var(--ok); }
.ex .fig { background: var(--s2); border: 0; border-radius: 14px; padding: 4px; grid-row: span 2; align-self: stretch; display: grid; place-items: center; }
.ex .fig svg { width: 100%; height: 72px; display: block; }
.ex .n { font-weight: 800; font-size: 16px; line-height: 1.25; }
.ex .dose { color: var(--ac-t); font-weight: 700; font-size: 14.5px; }
.ex .extra { color: var(--mu); font-weight: 500; font-size: 13px; }
.ex .ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.set { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--bd); background: transparent; font-weight: 800; color: var(--mu); display: grid; place-items: center; padding: 0; }
.set.on { background: var(--ac); border-color: var(--ac); color: var(--ac-ink); } .set svg { width: 18px; height: 18px; }
.tm { margin-left: auto; border: 0; background: var(--s2); border-radius: 999px; padding: 9px 13px; font-weight: 700; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.tm svg { width: 13px; height: 13px; } .tm.run { background: var(--run); color: #04111f; min-width: 78px; justify-content: center; }
.ex .more { grid-column: 1 / -1; border-top: 1px solid var(--bd); margin-top: 8px; padding-top: 10px; }
.ex .more svg { width: 100%; height: 190px; background: var(--s2); border-radius: 14px; }
.ex .more ul { margin: 10px 0 0; padding-left: 20px; color: var(--mu); font-size: 14.5px; }
.sticky { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); padding: 10px 16px; background: linear-gradient(transparent, var(--bg) 35%); z-index: 4; }
.sticky > * { max-width: 608px; margin: 0 auto; }

/* Schémas */
.p { stroke: var(--tx); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.h { fill: var(--tx); } .gr { stroke: var(--mu); stroke-width: 4; opacity: .55; } .wl { fill: var(--bd); }
.a { stroke: var(--ac-t); stroke-width: 4; fill: none; marker-end: url(#arrow); } .t { fill: var(--ac-t); font-size: 16px; font-weight: 700; }
.dash { stroke: var(--ac-t); stroke-width: 2.5; } .sep { stroke: var(--mu); stroke-width: 2; opacity: .5; }
#arrow path { fill: var(--ac-t); }

/* Listes */
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--bd); }
.item:last-child { border: 0; padding-bottom: 0; } .item:first-child { padding-top: 0; }
.item .grow { flex: 1; min-width: 0; } .item b { font-weight: 700; }
.empty { text-align: center; color: var(--mu); padding: 22px 12px; font-size: 14.5px; }

/* Sorties */
.runc { display: block; width: 100%; text-align: left; margin-top: 10px; }
.runc .h1 { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--mu); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.badge { color: color-mix(in srgb, var(--c) 58%, #000); }
:root[data-theme="dark"] .badge { color: var(--c); }
.runc .h2 { display: flex; align-items: baseline; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.runc .km { font-size: 26px; font-weight: 800; letter-spacing: -.02em; } .runc .km small { font-size: 14px; color: var(--mu); font-weight: 600; }
.runc .m { font-size: 14.5px; font-weight: 700; } .runc .m span { color: var(--mu); font-weight: 500; font-size: 12.5px; margin-left: 3px; }
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.mgrid div { background: var(--s2); border-radius: 14px; padding: 10px 12px; }
.mgrid b { display: block; font-size: 19px; font-weight: 800; } .mgrid span { font-size: 12px; color: var(--mu); }
.zbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--s2); }
.zleg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 10px; font-size: 13px; }
.zleg i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.zleg span { color: var(--mu); float: right; }
.split { display: grid; grid-template-columns: 52px 1fr 46px 36px; gap: 8px; align-items: center; font-size: 13.5px; padding: 3px 0; }
.split .bar { height: 14px; border-radius: 5px; background: var(--run); min-width: 4px; }
.split .k { color: var(--mu); white-space: nowrap; } .split .hr { color: var(--mu); text-align: right; font-size: 12.5px; }

/* Fenêtre du bas */
dialog { border: 0; padding: 0; background: var(--s1); color: var(--tx); width: 100%; max-width: 640px; margin: auto auto 0; border-radius: 24px 24px 0 0; max-height: 92dvh; overflow: auto; }
dialog::backdrop { background: rgba(3, 8, 18, .6); backdrop-filter: blur(3px); }
dialog[open] { animation: up .22s ease; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet:focus { outline: none; }
.sheet { padding: 8px 18px calc(22px + env(safe-area-inset-bottom)); }
.sheet .grab { width: 40px; height: 4px; border-radius: 9px; background: var(--bd); margin: 4px auto 10px; }
.sheet .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sheet h2 { margin: 0; font-size: 21px; font-weight: 800; flex: 1; letter-spacing: -.01em; }
.sheet h3 { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mu); margin: 20px 0 10px; }
@media (min-width: 700px) { dialog { margin: auto; border-radius: 24px; } }

/* Barre du bas */
nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--bd); padding-bottom: env(safe-area-inset-bottom); }
nav > div { display: flex; max-width: 640px; margin: 0 auto; }
nav button { flex: 1; background: none; border: 0; color: var(--mu); padding: 9px 0 10px; font-weight: 600; font-size: 11.5px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
nav button svg { width: 24px; height: 24px; }
nav button span { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; transition: background .2s; }
nav button.on { color: var(--tx); } nav button.on span { background: color-mix(in srgb, var(--ac) 22%, transparent); color: var(--ac-t); }
.toast { position: fixed; left: 50%; bottom: calc(140px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--tx); color: var(--bg); font-weight: 700; font-size: 14.5px; padding: 11px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 30; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
svg.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Petits boutons de texte */
.chipbtn { border: 1px solid var(--bd); background: var(--s1); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; flex: none; }
.chipbtn:disabled { opacity: .5; }
button.link { background: none; border: 0; padding: 0; color: var(--ac-t); font-weight: 700; text-decoration: underline; }
details summary { cursor: pointer; padding: 6px 0; }

/* Écran de connexion */
.login { min-height: 70dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; max-width: 340px; margin: 0 auto; }
.login h1 { margin: 6px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.login p { margin: 0 0 8px; }

/* ===== Accueil : carte vedette (soleil, calanques, mer), tuiles colorées ===== */
.hero { position: relative; background: var(--hero); color: #fff; border-radius: 26px; padding: 20px 16px 0; box-shadow: 0 18px 34px -18px var(--hero-shadow); overflow: hidden; }
.hero > * { position: relative; z-index: 1; }
.hero .sun { position: absolute; z-index: 0; top: -34px; right: -28px; width: 132px; height: 132px; border-radius: 50%;
  background: radial-gradient(circle, #fff7c9 0 36%, rgba(255, 244, 180, .5) 37% 56%, rgba(255, 244, 180, .22) 57% 74%, transparent 75%); }
.hero .scene { position: absolute; z-index: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 170px; display: block; }
.hero .msg { margin: 0 86px 16px 4px; }
.hero .msg b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; text-shadow: 0 1px 8px rgba(190, 60, 20, .25); }
.hero .msg span { font-size: 14px; opacity: .95; }
.hero .rings { margin-bottom: 46px; }
.hero .ring .rg { stroke: rgba(255, 255, 255, .28); }
.hero .ring .rc span { color: rgba(255, 255, 255, .9); }
.hero .stats { border-top: 0; margin: 0 -16px; }
.hero .stats div { border-right-color: rgba(255, 255, 255, .25); padding: 14px 8px; }
.hero .stats span { color: rgba(255, 255, 255, .9); }
.sec { font-size: 18px; font-weight: 800; letter-spacing: -.01em; text-transform: none; color: var(--tx); margin: 28px 4px 12px; }
.todo .ck { width: 44px; height: 44px; border: 0; border-radius: 14px; font-size: 21px; background: color-mix(in srgb, var(--ac) 18%, transparent); }
.todo.run .ck { background: color-mix(in srgb, var(--run) 18%, transparent); }
.todo.done .ck { background: var(--ok); color: #fff; } .todo.done .ck svg { width: 20px; height: 20px; }
.todo .day { color: var(--ac-t); } .todo.run .day { color: var(--run); }
.tile-a { background: color-mix(in srgb, var(--ok) 12%, var(--s1)); border-color: color-mix(in srgb, var(--ok) 26%, var(--s1)); }
.tile-b { background: color-mix(in srgb, var(--run) 12%, var(--s1)); border-color: color-mix(in srgb, var(--run) 26%, var(--s1)); }
.tile-b .prog { background: color-mix(in srgb, var(--run) 22%, transparent); height: 6px; } .tile-b .prog i { background: var(--run); }
.kpi .l { font-weight: 600; }
.chip { background: color-mix(in srgb, var(--ac) 16%, var(--s1)); }
.set.on, .chips button.on { color: #fff; }
.tm.run { color: #fff; }
.bars .b.cur i { background: var(--ac); }
.login svg { border-radius: 22px; box-shadow: 0 14px 28px -12px var(--hero-shadow); }
.runc .h2 { gap: 6px 12px; } .runc .km { font-size: 24px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .grid3 > * { min-width: 0; }
details > summary.mu { font-size: 14px; }

/* ===== Mot du coach, forme, objectifs ===== */
.coach { border-radius: 16px; padding: 12px 14px; background: color-mix(in srgb, var(--c, var(--run)) 11%, var(--s1)); border: 1px solid color-mix(in srgb, var(--c, var(--run)) 26%, var(--s1)); }
.coach.good { --c: var(--ok); } .coach.warn { --c: var(--ac); } .coach.info { --c: var(--run); }
.coach b { display: block; font-weight: 800; } .coach p { margin: 4px 0 0; font-size: 14.5px; color: var(--tx); opacity: .9; }
.coach-line { margin-top: 8px; font-size: 13.5px; font-weight: 700; }
.coach-line.good { color: var(--ok); } .coach-line.warn { color: var(--ac-t); } .coach-line.info { color: var(--mu); }
.grid2.wrap .prog { height: 6px; margin-top: 8px; } .grid2.wrap .prog i { background: var(--ok); }
.goal { position: relative; display: block; width: 100%; text-align: left; border: 0; border-radius: 22px; padding: 16px 18px; margin-top: 12px; color: #fff; background: var(--hero); box-shadow: 0 14px 28px -16px var(--hero-shadow); }
.goal b { display: block; font-size: 19px; font-weight: 800; padding-right: 92px; line-height: 1.25; }
.goal .tg { display: block; margin-top: 6px; font-weight: 700; } .goal .dt { display: block; font-size: 13.5px; opacity: .9; margin-top: 2px; }
.goal .cd { position: absolute; top: 14px; right: 16px; background: rgba(255, 255, 255, .24); border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: 15px; }
button.todo:disabled { opacity: 1; cursor: default; }
nav button { font-size: 11px; } nav button span { width: 50px; }

/* ===== Agenda ===== */
.cal { padding: 12px 10px 12px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-h b { font-size: 17px; font-weight: 800; }
.cal-h .x:first-child svg { transform: rotate(180deg); }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-g em { font-style: normal; text-align: center; font-size: 12px; font-weight: 700; color: var(--mu); padding: 4px 0; }
.cal-d { border: 0; background: none; border-radius: 12px; padding: 5px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 46px; color: var(--tx); }
.cal-d span { font-size: 15px; font-weight: 600; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal-d.out span { color: var(--mu); opacity: .45; }
.cal-d.today span { box-shadow: inset 0 0 0 2px var(--ac); font-weight: 800; }
.cal-d.sel { background: var(--s2); } .cal-d.sel span { background: var(--ac); color: #fff; box-shadow: none; font-weight: 800; }
.cal-d i { display: flex; gap: 3px; height: 9px; align-items: center; font-style: normal; }
.cal-d i b, .cal-l b { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
b.r { background: var(--run); } b.f { background: var(--ac); }
b.r.p { background: none; box-shadow: inset 0 0 0 2px var(--run); } b.f.p { background: none; box-shadow: inset 0 0 0 2px var(--ac); }
.cal-d i b.s { width: auto; height: auto; font-size: 10px; line-height: 1; background: none; }
.cal-l { display: flex; align-items: center; gap: 14px; margin: 10px 6px 0; font-size: 12.5px; color: var(--mu); min-height: 30px; }
.cal-l span { display: inline-flex; align-items: center; gap: 5px; } .cal-l .grow { flex: 1; }
.cal-s { margin: 6px 6px 0; }
.todo.done.renfo .day { color: var(--ac-t); }
.grid3 > * { margin: 0 !important; }
.forme .kpi { padding: 12px; } .forme .kpi .l { font-size: 12px; } .forme .kpi .v { font-size: 20px; } .forme .kpi .v small { font-size: 12px; } .forme .kpi .d { font-size: 11.5px; line-height: 1.3; }
.forme .prog { height: 5px; margin-top: 6px; } .forme .prog i { background: var(--ok); }

/* Séance guidée : plein écran, une étape à la fois */
.launch .btn { margin-bottom: 8px; } .launch .row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.launch .chips button { padding: 5px 11px; font-size: 13px; }
html.guiding { overflow: hidden; }
.guide { --c: var(--ac); position: fixed; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; padding: calc(10px + env(safe-area-inset-top)) 16px calc(14px + env(safe-area-inset-bottom)); }
.guide[data-phase="rest"], .guide[data-phase="switch"] { --c: var(--run); } .guide[data-phase="prep"] { --c: var(--ok); }
.guide::before { content: ""; position: absolute; inset: 0 0 auto; height: 240px; background: linear-gradient(color-mix(in srgb, var(--c) 26%, transparent), transparent); pointer-events: none; }
.guide > * { position: relative; width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
.g-top { display: flex; align-items: center; gap: 10px; }
.g-ic { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--s1); color: var(--tx); font-size: 18px; box-shadow: var(--shadow); }
.g-meta { flex: 1; text-align: center; line-height: 1.25; } .g-meta b { display: block; font-size: 15px; } .g-meta span { color: var(--mu); font-size: 13px; }
.g-bar { height: 6px; background: var(--s2); border-radius: 99px; overflow: hidden; margin-top: 10px; } .g-bar i { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.g-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 14px; }
.g-phase { background: var(--c); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; padding: 5px 14px; border-radius: 999px; }
.guide h2 { margin: 10px 0 2px; font-size: 26px; line-height: 1.15; } .guide h2 small { display: block; font-size: 13px; font-weight: 700; color: var(--mu); text-transform: uppercase; letter-spacing: .06em; }
.g-sub { color: var(--ac-t); font-weight: 700; font-size: 16px; }
.g-fig { width: 100%; max-width: 330px; background: var(--s1); border: 1px solid var(--bd); border-radius: 18px; margin-top: 12px; padding: 4px; flex: none; }
.g-fig svg { display: block; width: 100%; height: clamp(96px, 20vh, 170px); }
.g-clock { position: relative; width: clamp(140px, 26vh, 200px); aspect-ratio: 1; margin-top: 12px; flex: none; display: grid; place-items: center; }
.g-clock svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.g-clock circle { fill: none; stroke-width: 9; } .g-clock .bg { stroke: var(--s2); } .g-clock .fg { stroke: var(--c); stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.g-clock span { font-size: clamp(46px, 9vh, 68px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.g-clock em { position: absolute; bottom: 20%; font-style: normal; font-weight: 700; font-size: 13px; color: var(--mu); }
.g-tips { margin: 12px 0 0; padding: 0 6px 0 22px; text-align: left; color: var(--mu); font-size: 14px; align-self: stretch; }
.g-ctl { display: grid; grid-template-columns: 52px 1fr 1.5fr 1fr; gap: 8px; padding-top: 10px; }
.g-ctl button, .g-end button { border: 0; border-radius: 14px; padding: 15px 6px; font-weight: 800; font-size: 15px; background: var(--s2); color: var(--tx); }
.g-ctl .g-main, .g-end .g-main { background: var(--c); color: #fff; } .g-ctl .g-next { background: var(--s1); border: 1px solid var(--bd); }
.g-end { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 10px; } .g-end p { margin: 0; color: var(--mu); }
.g-end .g-party { font-size: 72px; } .g-end .g-save { color: var(--ok); font-weight: 700; margin-bottom: 10px; } .g-end .g-ghost { background: transparent; color: var(--mu); }

/* Carte vedette compacte */
.hero { padding: 14px 14px 0; border-radius: 22px; }
.hero .sun { top: -30px; right: -24px; width: 104px; height: 104px; }
.hero .scene { height: 124px; }
.hero .msg { margin: 0 70px 10px 2px; } .hero .msg b { font-size: 18px; } .hero .msg span { font-size: 13px; }
.hero .rings { justify-content: center; gap: 36px; margin-bottom: 22px; }
.hero .ring { flex: none; gap: 3px; } .hero .ring svg { width: 68px; height: 68px; } .hero .ring .rc { height: 68px; }
.hero .ring .rc b { font-size: 21px; } .hero .ring .rc span { font-size: 10px; } .hero .ring .rl { font-size: 13px; }
.hero .stats { margin: 0 -14px; } .hero .stats div { padding: 8px 6px 10px; } .hero .stats b { font-size: 16px; } .hero .stats span { font-size: 11.5px; }
.launch .btn { margin-bottom: 0; }

/* Agenda : séance prévue avec bouton « déplacer » */
.todo-b { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; }
.todo.skipped { opacity: .6; } .todo .x svg { width: 22px; height: 22px; }
/* Chaussures */
.todo.shoe .prog { margin-top: 7px; height: 6px; } .todo.shoe.old { opacity: .55; } .todo.shoe b { flex: none; }
.prog.warn i { background: #f5a524; } .prog.bad i { background: var(--bad); }
/* Tracé d'une sortie */
.trk { display: block; width: 100%; background: var(--s2); border-radius: 16px; margin-top: 14px; }
.trk polyline { fill: none; stroke: var(--run); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.trk .a { fill: var(--ok); stroke: var(--s1); stroke-width: 2; } .trk .b { fill: var(--ac); stroke: var(--s1); stroke-width: 2; }
.ele { display: block; width: 100%; height: 64px; margin-top: 8px; } .ele polygon { fill: color-mix(in srgb, var(--run) 18%, transparent); } .ele polyline { fill: none; stroke: var(--run); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ele-l { display: flex; justify-content: space-between; }

/* Carte du parcours : fond OpenStreetMap */
.trk { position: relative; overflow: hidden; padding: 0; } .trk svg { display: block; width: 100%; }
.trk polyline.c { stroke: #fff; stroke-width: 6; opacity: .85; } .trk polyline { stroke: #0b6fb8; stroke-width: 3.2; }
.trk a { position: absolute; right: 6px; bottom: 4px; font-size: 10px; color: #333; background: rgba(255, 255, 255, .75); padding: 1px 5px; border-radius: 6px; text-decoration: none; }
:root[data-theme="dark"] .trk image { filter: brightness(.8) saturate(.85); }

/* ===== Mobile d'abord (écran de référence : Pixel 8, 412 px de large) ===== */
html { -webkit-text-size-adjust: 100%; }
button, a, label.btn, summary { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
main { padding: calc(14px + env(safe-area-inset-top)) 14px calc(96px + env(safe-area-inset-bottom)); }
.top { margin-bottom: 12px; align-items: center; } .top h1 { font-size: 26px; }
.sec { margin: 22px 4px 10px; font-size: 17px; }
/* zones de toucher : 44 px au moins */
.icon, .g-ic { width: 44px; height: 44px; }
.x { min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; } .x svg { width: 20px; height: 20px; }
.chips button { padding: 10px 15px; min-height: 42px; } .launch .chips button { padding: 8px 13px; min-height: 38px; }
.chipbtn { padding: 9px 14px; min-height: 40px; }
.set { width: 44px; height: 44px; } .tm { padding: 11px 14px; min-height: 44px; }
.todo { min-height: 60px; } .todo .x { margin-right: -8px; }
button:active:not(:disabled), .cal-d:active span { opacity: .72; }
/* agenda : cases larges, faciles à toucher */
.cal { padding: 8px 6px 12px; } .cal-g { gap: 2px; }
.cal-d { min-height: 52px; padding: 6px 0 5px; } .cal-d span { width: 32px; height: 32px; font-size: 15.5px; }
.cal-d.today span { background: var(--ac); color: #fff; box-shadow: none; }
.cal-l { margin: 8px 8px 0; } .cal-s { margin: 4px 8px 0; }
/* fenêtre du bas : titre toujours visible, défilement qui ne tire pas la page */
dialog { max-height: 88dvh; overscroll-behavior: contain; transition: transform .15s; }
.sheet .grab { margin: 2px auto 0; width: 44px; height: 5px; }
.sheet .hd { position: sticky; top: 0; z-index: 2; background: var(--s1); padding: 10px 0 8px; margin: 0 0 6px; }
.sheet .hd h2 { font-size: 20px; }
.sheet { padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); }
/* barre du bas */
nav button { padding: 8px 0 9px; min-height: 58px; }
.sticky { bottom: calc(60px + env(safe-area-inset-bottom)); padding: 10px 14px; }
.toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
/* sorties, mesures */
.runc { padding: 14px; } .mgrid { gap: 8px; } .mgrid div { padding: 10px; } .mgrid b { font-size: 18px; }
.zleg { grid-template-columns: 1fr; } .split { padding: 5px 0; font-size: 14px; }
.ex { grid-template-columns: 88px 1fr; gap: 6px 12px; }
@media (min-width: 700px) { main { padding-left: 16px; padding-right: 16px; } .zleg { grid-template-columns: 1fr 1fr; } }
button.link { min-height: 40px; padding: 8px 2px; } .launch .chips button { min-height: 40px; }

/* Chiffres de la carte d'accueil : centrés dans la mer, sans traits */
.hero .rings { margin-bottom: 16px; }
.hero .stats { align-items: flex-end; height: 62px; padding-bottom: 9px; }
.hero .stats div { border: 0; padding: 0 6px; } .hero .stats b { line-height: 1.15; font-size: 17px; text-shadow: 0 1px 4px rgba(0, 60, 90, .35); } .hero .stats span { display: block; line-height: 1.25; }
/* Chaussures : une ligne discrète dans l'onglet Course */
.shoeline { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 0 14px; min-height: 46px; background: none; border: 1px solid var(--bd); border-radius: 14px; text-align: left; font-size: 14px; color: var(--mu); }
.shoeline .grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .shoeline b { color: var(--tx); font-weight: 700; } .shoeline svg { width: 16px; height: 16px; flex: none; }
/* Fenêtres : de l'air entre une rangée de champs et ce qui suit */
.sheet .grid2 + .btn, .sheet .grid2 + .chips, .sheet .chips + .btn { margin-top: 16px; }
.sheet .grid2 { row-gap: 14px; }

/* Progression en endurance, projection du poids, ressenti du renfo */
.trend .row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; } .trend b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; } .trend b small { font-size: 14px; color: var(--mu); font-weight: 600; }
.trend .row span { font-size: 13.5px; font-weight: 700; color: var(--mu); } .trend .good { color: var(--ok); } .trend .warn { color: var(--ac-t); }
.trend svg { display: block; width: 100%; height: 64px; margin-top: 6px; } .trend polyline { fill: none; stroke: var(--run); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; } .trend circle { fill: var(--run); }
.proj { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bd); font-size: 14.5px; font-weight: 600; } .proj b { font-weight: 800; }
.g-feel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .g-end .g-q { color: var(--tx); font-weight: 700; margin-top: 6px; } .g-end .g-felt { color: var(--tx); font-weight: 700; }
.g-end { width: 100%; max-width: 420px; }

/* ===== Moins d'orange : fond clair et frais, boutons couleur mer. L'orange reste pour le soleil de l'accueil et le renfo. ===== */
:root { --pri: #0b7fa3; --pri-t: #0a6a88; --pri-ink: #ffffff; --bg: #f6f9fa; --s2: #edf2f4; --bd: #e0e7ea; --tx: #1b2630; --mu: #677581; --glow: #dff0f4; --shadow: 0 2px 10px rgba(30, 70, 90, .07); }
:root[data-theme="dark"] { --pri: #3cc8dc; --pri-t: #7adbe8; --pri-ink: #06222a; --bg: #0f1823; --s2: #20303f; --bd: #2b3d50; --tx: #f1f4f6; --mu: #9aabba; --glow: #1a2a3a; --shadow: none; }
.btn { background: var(--pri); color: var(--pri-ink); } .btn.sec2 { background: var(--s2); color: var(--tx); } .btn.danger { background: transparent; color: var(--bad); }
.chips button.on { background: var(--pri); border-color: var(--pri); color: var(--pri-ink); }
nav button.on span { background: color-mix(in srgb, var(--pri) 16%, transparent); color: var(--pri-t); }
.cal-d.today span { background: var(--pri); color: var(--pri-ink); }
.chip { background: color-mix(in srgb, var(--pri) 12%, var(--s1)); color: var(--pri-t); }
input:focus, select:focus, textarea:focus { outline-color: var(--pri); }
.bars .b.cur i { background: var(--pri); }
button.link { color: var(--pri-t); } .sheet a { color: var(--pri-t) !important; }
.note { background: color-mix(in srgb, var(--pri) 9%, var(--s1)); color: var(--tx); }
.ex .dose, .g-sub { color: var(--pri-t); }
.goal { background: linear-gradient(160deg, #2ab7c4 0%, #0b7fb3 100%); box-shadow: 0 14px 28px -16px rgba(11, 127, 179, .6); }
.g-end .g-main { background: var(--pri); }
.sheet .trend svg { height: 110px; }

/* Miniature du tracé dans la carte d'une sortie */
.runc.map { position: relative; padding-right: 116px; min-height: 104px; }
.rc-map { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 96px; height: 68px; background: var(--s2); border-radius: 12px; }
.rc-map polyline { fill: none; stroke: var(--run); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }

/* ===================== v6 : un seul style partout ===================== */
/* Deux couleurs (bleu = course et actions, orange = renfo), un modèle de carte, un modèle de ligne, des icônes au trait. */
.card { box-shadow: none; border-radius: 18px; padding: 16px; }
.card.list { padding: 2px 14px; }
.top { margin-bottom: 14px; } .top h1 { font-size: 26px; font-weight: 800; } .top .sub { font-size: 14px; margin-top: 2px; }
.sec { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; margin: 20px 4px 6px; font-size: 16px; font-weight: 700; letter-spacing: 0; color: var(--tx); }
.sec small { font-size: 13px; font-weight: 500; color: var(--mu); }
.sec .chipbtn { background: none; border-color: var(--bd); color: var(--pri-t); font-weight: 600; }
.icon { border-radius: 14px; box-shadow: none; }
.btn { font-weight: 700; border-radius: 14px; min-height: 52px; } .chipbtn { font-weight: 600; }
.chips button { font-weight: 500; background: var(--s1); } .chips button.on { font-weight: 600; }
.note { margin: 12px 0 0; border-radius: 12px; font-size: 14px; background: var(--s2); color: var(--tx); }
.empty { padding: 18px 8px; font-size: 14.5px; }
.stack { display: grid; gap: 10px; }

/* Lignes */
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 9px 0; background: none; border: 0; border-bottom: 1px solid var(--bd); text-align: left; color: inherit; }
.row:last-child { border-bottom: 0; } .row:disabled { opacity: 1; cursor: default; }
.row-b { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 42px; background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; }
.row .ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--pri) 11%, var(--s1)); color: var(--pri-t); }
.row .ic svg { width: 21px; height: 21px; }
.row.renfo .ic { background: color-mix(in srgb, var(--ac) 14%, var(--s1)); color: var(--ac-t); }
.row.done .ic { background: color-mix(in srgb, var(--ok) 14%, var(--s1)); color: var(--ok); }
.row.skipped { opacity: .55; }
.row .tx { flex: 1; min-width: 0; } .row .tx b { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.3; } .row .tx > span { display: block; font-size: 13.5px; color: var(--mu); line-height: 1.35; }
.row .end { flex: none; color: var(--mu); font-size: 14px; display: grid; place-items: center; } .row .end svg { width: 18px; height: 18px; } .row .end b { color: var(--tx); font-weight: 700; }
.row .x { margin-right: -10px; }
.row.ex-row .ic { width: 62px; height: 46px; background: var(--s2); border-radius: 10px; } .row.ex-row .ic svg { width: 100%; height: 40px; }
.sheet > .row:first-of-type { border-top: 0; }

/* Accueil */
.hero { border-radius: 20px; box-shadow: none; }
.hero .msg b { font-weight: 700; }
.cal { padding: 6px 6px 10px; } .cal-h b { font-size: 16px; font-weight: 700; }
.cal-d span { font-weight: 500; } .cal-d.today span { font-weight: 700; }
.cal-l { justify-content: flex-end; margin: 4px 8px 0; min-height: 0; }
b.s { background: var(--mu); border-radius: 2px !important; transform: rotate(45deg); }

/* Renfo */
.restrow { display: flex; align-items: center; gap: 12px; margin: 10px 4px 0; } .restrow .chips button { padding: 6px 14px; min-height: 40px; }
.ex { border-radius: 16px; margin-top: 8px; } .ex:first-of-type { margin-top: 0; } .ex .n { font-weight: 600; } .ex .dose { font-weight: 500; color: var(--mu); }
.set.on { background: var(--ac); border-color: var(--ac); }
.exfig svg { display: block; width: 100%; height: 200px; background: var(--s2); border-radius: 16px; }
.tips { margin: 14px 0 0; padding-left: 20px; color: var(--tx); line-height: 1.6; }

/* Course : les sorties d'un mois dans une seule carte */
.runc, .runc.map { display: block; position: relative; width: 100%; min-height: 66px; margin: 0; padding: 11px 0; background: none; border: 0; border-bottom: 1px solid var(--bd); border-radius: 0; text-align: left; color: inherit; }
.runc:last-child { border-bottom: 0; } .runc.map { padding-right: 98px; }
.runc .when { display: block; font-size: 13.5px; color: var(--mu); }
.runc .nums { display: flex; align-items: baseline; gap: 14px; margin-top: 2px; font-size: 14.5px; white-space: nowrap; } .runc .nums b { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.rc-map { right: 0; width: 84px; height: 46px; border-radius: 10px; }
.rc-map polyline { stroke: var(--pri); stroke-width: 2.4; }

/* Progrès */
.lines { display: grid; gap: 8px; } .lines .shoeline { margin-top: 0; }
.shoeline { border-radius: 14px; background: var(--s1); min-height: 52px; font-size: 14.5px; }
.shoeline .ic { display: grid; place-items: center; color: var(--pri-t); } .shoeline .ic svg { width: 20px; height: 20px; }
.wrow { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; } .wrow b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; } .wrow b small { font-size: 15px; font-weight: 600; color: var(--mu); } .wrow span { font-size: 14px; color: var(--mu); }
.kpi .v { font-size: 22px; font-weight: 700; } .kpi .l { font-weight: 500; }
.bars .b.cur i { background: var(--pri); } .bars .b b { font-weight: 600; }
.proj { font-weight: 500; }
.coach { background: var(--s1); border: 1px solid var(--bd); border-left: 3px solid var(--c, var(--pri)); border-radius: 12px; padding: 12px 14px; }
.coach.good { --c: var(--ok); } .coach.warn { --c: var(--ac); } .coach.info { --c: var(--pri); } .coach b { font-weight: 700; }

/* Fiches : sections repliables */
.sheet .hd h2 { font-size: 20px; font-weight: 700; } .sheet .hd h2 small { display: block; margin-top: 2px; font-size: 13.5px; font-weight: 400; color: var(--mu); letter-spacing: 0; }
.sheet h3 { font-size: 13.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--mu); margin: 18px 0 8px; }
.mgrid { margin: 14px 0 12px; } .mgrid div { border-radius: 12px; } .mgrid b { font-weight: 700; }
.dets { margin-top: 14px; border-bottom: 1px solid var(--bd); }
details { border-top: 1px solid var(--bd); }
details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 0 2px; font-weight: 600; font-size: 15.5px; list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ""; width: 8px; height: 8px; margin-right: 6px; border-right: 2px solid var(--mu); border-bottom: 2px solid var(--mu); transform: rotate(45deg); transition: transform .15s; }
details[open] > summary::after { transform: rotate(-135deg); }
.det { padding: 2px 0 16px; } .det > h3:first-child { margin-top: 4px; }
.chips.rpe { display: grid; grid-template-columns: repeat(5, 1fr); } .chips.rpe button { padding: 0; }
.trk { margin-top: 4px; border-radius: 14px; }

/* Fin de séance guidée */
.g-end .g-party { width: 84px; height: 84px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; font-size: 44px; font-weight: 700; }
.guide h2 { font-weight: 700; }
nav button { font-weight: 500; } nav button.on { font-weight: 600; }

/* v6.1 */
/* Agenda : les jours passés s'effacent, aujourd'hui et la suite ressortent */
.cal-d.past span { color: var(--mu); opacity: .55; } .cal-d.past i { opacity: .6; }
/* Renfo : le bouton de lancement, plus gros */
#app > .btn[data-act="guide"] { min-height: 72px; font-size: 19px; border-radius: 18px; } #app > .btn[data-act="guide"] svg { width: 24px; height: 24px; }
/* Course : une couleur discrète par type de sortie (trait à gauche, nom du type teinté) */
.card.list .runc, .card.list .runc.map { padding-left: 14px; }
.runc::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 4px; border-radius: 4px; background: var(--k, var(--bd)); }
.runc .when i { font-style: normal; font-weight: 600; color: color-mix(in srgb, var(--k, var(--mu)) 62%, var(--tx)); }
/* Progrès : une catégorie à la fois */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--s2); border-radius: 14px; }
.seg button { min-height: 42px; padding: 0 2px; border: 0; border-radius: 10px; background: none; font-size: 14.5px; font-weight: 500; color: var(--mu); }
.seg button.on { background: var(--s1); color: var(--tx); font-weight: 600; box-shadow: 0 1px 3px rgba(20, 50, 70, .12); }
.seg + .card, .seg + .lines { margin-top: 0; }

/* v6.2 — Progrès : quatre tuiles, le détail dans une fenêtre */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 148px; padding: 16px; text-align: left; background: var(--s1); border: 1px solid var(--bd); border-radius: 18px; color: inherit; }
.tile .lab { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: var(--pri-t); } .tile .lab svg { width: 20px; height: 20px; }
.tile b { margin-top: auto; font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; } .tile b small { font-size: 15px; font-weight: 600; color: var(--mu); }
.tile .subl { font-size: 13.5px; color: var(--mu); line-height: 1.3; }
.progbody .card { border: 0; padding: 0; border-radius: 0; background: none; } .progbody .card + .card, .progbody .lines + .card { margin-top: 16px !important; }
.progbody .grid2 .card, .progbody .grid3 .card { border: 1px solid var(--bd); padding: 12px; border-radius: 14px; background: var(--s1); }
.progbody > .row:last-of-type { border-bottom: 0; }

/* v6.3 — Progrès : le poids en grand */
.wcard { padding: 18px 16px 16px; }
.whead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.whead .lab { display: block; font-size: 13.5px; font-weight: 600; color: var(--mu); }
.whead b { display: block; font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; } .whead b small { font-size: 18px; font-weight: 600; color: var(--mu); letter-spacing: 0; }
.whead .goal2 { text-align: right; } .whead .goal2 b { font-size: 24px; color: var(--ok); } .whead .goal2 b small { font-size: 14px; } .whead .goal2 .mu { font-size: 13.5px; }
.wchart { display: block; width: 100%; height: auto; margin-top: 10px; }
.wcard .proj { margin-top: 6px; padding-top: 12px; font-size: 15px; }
.card .foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--bd); font-size: 13.5px; color: var(--mu); }

/* v6.4 — Forme : pas et sommeil sur 7 jours */
.fcard { display: block; width: 100%; text-align: left; color: inherit; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.fcol { display: flex; flex-direction: column; min-width: 0; }
.fcol .lab { font-size: 13.5px; font-weight: 600; color: var(--mu); } .fcol b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; } .fcol .mu { font-size: 13px; }
.mbars { position: relative; display: flex; align-items: flex-end; gap: 5px; height: 56px; margin-top: 10px; }
.mbars::after { content: ""; position: absolute; left: 0; right: 0; bottom: var(--goal); border-top: 1.5px dashed var(--ok); opacity: .7; }
.mbars i { flex: 1; min-height: 0; border-radius: 4px; background: color-mix(in srgb, var(--pri) 35%, var(--s2)); } .mbars i.ok { background: var(--pri); } .mbars i.now { opacity: .45; }
.mdays { display: flex; gap: 5px; margin-top: 4px; } .mdays i { flex: 1; text-align: center; font-style: normal; font-size: 11px; color: var(--mu); }
.fcard .foot { display: block; } .fcard .foot b { font-weight: 700; color: var(--tx); } .fcard .foot b.good { color: var(--ok); } .fcard .foot b.warn { color: var(--ac-t); }

/* ===================== v7 — ambiance « Calanques » ===================== */
/* Le ciel lagon en haut, le sable en bas ; des cartes en relief ; turquoise pour agir, orange soleil en touche chaude. */
/* Une couleur par rubrique sur les gros chiffres : vert = poids, violet = forme, turquoise = course, orange = renfo. */
:root { --bg: #f8f6f0; --glow: #bfe9ee; --s2: #eaf4f5; --bd: #dcebee; --pri: #0e9aa7; --pri-t: #0b7785; --ink: #0b5560;
  --wt: #10a37f; --wt-t: #0b7a5c; --fm: #7c3aed; --fm-s: #e4dbfb; --sun: linear-gradient(135deg, #ffb648, #ff6b5a); --sea: linear-gradient(120deg, #14b8a6, #0891b2);
  --lift: 0 10px 26px -14px rgba(11, 85, 96, .35); }
:root[data-theme="dark"] { --ink: var(--tx); --wt: #46d39a; --wt-t: #46d39a; --fm: #b79bff; --fm-s: #2e2a4a; --lift: none; }
body { background: linear-gradient(180deg, #bfe9ee 0, #e9f7f6 240px, #f8f6f0 720px) no-repeat, var(--bg); }
:root[data-theme="dark"] body { background: var(--bg); }
.top h1, .sec { color: var(--ink); } .sec { font-size: 18px; }

/* cartes et lignes en relief */
.card, .shoeline, .tile { border: 0; border-radius: 22px; box-shadow: var(--lift); }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .shoeline { border: 1px solid var(--bd); }
.shoeline { border-radius: 18px; }
.icon { border: 0; box-shadow: var(--lift); }
.progbody .card, .sheet .card { box-shadow: none; }
.coach { border-radius: 14px; box-shadow: var(--lift); border-top: 0; border-right: 0; border-bottom: 0; }

/* boutons */
.btn { background: var(--sea); border-radius: 999px; box-shadow: 0 10px 20px -10px #0891b2; }
.btn.sec2 { background: var(--s1); color: var(--tx); box-shadow: var(--lift); }
.btn.danger { background: transparent; box-shadow: none; }
.btn:disabled { box-shadow: none; }
.chips button.on { background: var(--sea); border-color: transparent; }
#app > .btn[data-act="guide"] { border-radius: 24px; background: var(--sun); box-shadow: 0 14px 24px -12px #ff6b5a; }
.sec .chipbtn { background: var(--s1); border: 0; box-shadow: var(--lift); }

/* pastilles des lignes */
.row .ic { border-radius: 14px; background: linear-gradient(135deg, #5eead4, #0ea5b7); color: #fff; }
.row.renfo .ic { background: var(--sun); } .row.done .ic { background: linear-gradient(135deg, #6ee7b7, #10b981); color: #fff; }
.row.ex-row .ic { background: var(--s2); color: inherit; }
.shoeline .ic { color: var(--pri); }

/* accueil */
.hero { border-radius: 26px; box-shadow: 0 20px 34px -18px rgba(255, 110, 70, .75); }
.hero .ring .rv { animation: ringfill .9s ease-out both; }
@keyframes ringfill { from { stroke-dasharray: 0 264; } }
.cal-d.today span { background: var(--sun); color: #fff; }
nav { background: color-mix(in srgb, var(--s1) 92%, transparent); border-top: 0; box-shadow: 0 -8px 24px -18px rgba(11, 85, 96, .5); }
nav button.on span { background: linear-gradient(120deg, #a7f3d0, #99e6ee); color: var(--ink); }
:root[data-theme="dark"] nav button.on span { background: color-mix(in srgb, var(--pri) 22%, transparent); color: var(--pri-t); }

/* poids : vert */
.wcard { background: linear-gradient(170deg, var(--s1) 45%, color-mix(in srgb, var(--wt) 12%, var(--s1)) 100%); }
.whead > div:first-child b { color: var(--wt-t); } .whead .goal2 b { color: var(--wt); }
.wchart polyline, .wchart line[stroke-dasharray="3 9"] { stroke: var(--wt); } .wchart circle[r="8"] { fill: var(--wt); } #wfill stop { stop-color: var(--wt); }
.wcard .btn { background: linear-gradient(120deg, #34d399, #10a37f); box-shadow: 0 10px 20px -10px #10a37f; }
/* forme : violet */
.fcard { background: linear-gradient(170deg, var(--s1) 45%, color-mix(in srgb, var(--fm) 9%, var(--s1)) 100%); }
.fcol b { color: var(--fm); } .mbars i { background: var(--fm-s); } .mbars i.ok { background: var(--fm); }
.mbars::after { border-top-color: var(--fm); }
/* course : turquoise */
.bars .b i { background: #dff3f4; } .bars .b.cur i { background: var(--sea); }
:root[data-theme="dark"] .bars .b i { background: var(--s2); }
.rc-map { background: var(--s2); } .trend b { color: var(--pri-t); }

/* fenêtres */
dialog { border-radius: 28px 28px 0 0; }
.seg { box-shadow: none; }
.g-ctl .g-main, .g-end .g-main { border-radius: 999px; }

/* Période de la courbe du poids */
.chips.wr { justify-content: center; margin-top: 8px; } .chips.wr button { min-height: 40px; padding: 6px 16px; font-size: 13.5px; } .wcard .chips.wr button.on { background: var(--wt); }
.wchart circle[r="3.5"] { r: 3; }

/* Courbe du poids : le doigt posé dessus montre la pesée */
.wwrap { position: relative; } .wchart { touch-action: pan-y; cursor: crosshair; }
.wtip { position: absolute; top: -4px; transform: translateX(-50%); padding: 5px 11px; border-radius: 10px; background: var(--tx); color: var(--s1); font-size: 13.5px; white-space: nowrap; pointer-events: none; z-index: 1; } .wtip b { font-weight: 700; }
.wcur line { stroke: var(--mu); stroke-width: 1.5; stroke-dasharray: 4 5; } .wcur circle { fill: var(--s1); stroke: var(--wt); stroke-width: 4; }

/* Chaussures : paires en service avec leur usure, paires rangées en liste simple */
.row.shoe .prog { display: block; height: 6px; margin-top: 7px; } .row.shoe .end { font-size: 13px; }
.sheet .row .end b { font-weight: 600; }

/* Récapitulatif par année */
.row.year .prog { display: block; height: 6px; margin-top: 6px; background: var(--s2); } .row.year .prog i { background: var(--sea); }

/* ===== Page « Mes statistiques » ===== */
.shoeline.stat { background: var(--sea); color: #fff; } .shoeline.stat b, .shoeline.stat .ic, .shoeline.stat svg { color: #fff; }
.sbig .sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; } .sbig b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--pri-t); } .sbig span { font-size: 13.5px; color: var(--mu); }
.sbig p { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--bd); font-size: 14px; color: var(--mu); }
.schart { display: block; width: 100%; height: auto; }
.schart .g { stroke: var(--bd); stroke-width: 1; } .schart .ax { fill: var(--mu); font-size: 9.5px; }
.schart .yr { fill: none; stroke: var(--mu); stroke-width: 1.2; opacity: .32; stroke-linejoin: round; }
.schart .yr.best { stroke: var(--pri); stroke-width: 2.2; opacity: 1; } .schart .yr.cur { stroke: #ff7a45; stroke-width: 3.2; opacity: 1; } .schart .yr.proj { stroke: #ff7a45; stroke-width: 2; stroke-dasharray: 2 5; stroke-linecap: round; opacity: .9; }
.schart .dot { fill: #ff7a45; stroke: var(--s1); stroke-width: 2; } .schart .lb { font-size: 10.5px; font-weight: 700; } .schart .lb.best { fill: var(--pri-t); } .schart .lb.cur { fill: #e85d2a; }
.schart .kmb { fill: color-mix(in srgb, var(--pri) 30%, var(--s2)); } .schart .kgl { fill: none; stroke: var(--wt); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; } .schart .kgd { fill: var(--wt); }
.slegend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: var(--mu); } .slegend span { display: inline-flex; align-items: center; gap: 6px; }
.slegend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; } .slegend i.kg { height: 3px; background: var(--wt); } .slegend i.km { background: color-mix(in srgb, var(--pri) 30%, var(--s2)); }
.syear { display: flex; align-items: baseline; justify-content: space-between; margin: 12px 0 4px; font-size: 12.5px; color: var(--mu); } .syear:first-child { margin-top: 0; } .syear b { font-size: 14.5px; font-weight: 700; color: var(--tx); }
.scal { display: block; width: 100%; height: auto; }
.c0 { fill: var(--s2); } .c1 { fill: color-mix(in srgb, var(--pri) 32%, var(--s2)); } .c2 { fill: color-mix(in srgb, var(--pri) 58%, var(--s2)); } .c3 { fill: color-mix(in srgb, var(--pri) 82%, var(--s2)); } .c4 { fill: #0b5560; }
:root[data-theme="dark"] .c4 { fill: #b6f3fb; }
.slegend .grad i { width: 10px; height: 10px; margin-right: -3px; } .slegend .grad i.c1 { background: color-mix(in srgb, var(--pri) 32%, var(--s2)); } .slegend .grad i.c2 { background: color-mix(in srgb, var(--pri) 58%, var(--s2)); } .slegend .grad i.c3 { background: color-mix(in srgb, var(--pri) 82%, var(--s2)); } .slegend .grad i.c4 { background: #0b5560; margin-right: 4px; }
.schart.shoes rect.on { fill: var(--pri); } .schart.shoes rect.old { fill: color-mix(in srgb, var(--pri) 38%, var(--s2)); } .schart.shoes .sl { fill: var(--tx); font-size: 10.5px; font-weight: 600; }
.smapc { padding: 0; overflow: hidden; } .smapc .foot { margin: 0; padding: 10px 14px 12px; border-top: 0; }
.smap { position: relative; background: var(--s2); min-height: 200px; } .smap svg { display: block; width: 100%; height: auto; }
.smap .bg image { filter: grayscale(1) contrast(.85) brightness(1.08); opacity: .8; }
.smap .tr path { fill: none; stroke: #e11d48; stroke-width: 1.5; stroke-opacity: .2; stroke-linejoin: round; stroke-linecap: round; mix-blend-mode: multiply; }
:root[data-theme="dark"] .smap .bg image { filter: grayscale(1) invert(.9) brightness(.9); } :root[data-theme="dark"] .smap .tr path { stroke: #ff8a5c; mix-blend-mode: screen; stroke-opacity: .28; }
.smap a { position: absolute; right: 6px; bottom: 4px; font-size: 10px; color: #333; background: rgba(255, 255, 255, .75); padding: 1px 5px; border-radius: 6px; text-decoration: none; }

/* Statistiques : doigt sur les courbes, boutons d'années, carte en grand */
.schart[data-scrub] { touch-action: pan-y; cursor: crosshair; }
.scur line { stroke: var(--mu); stroke-width: 1; stroke-dasharray: 3 4; } .scur circle { stroke: var(--s1); stroke-width: 2; }
.sychips { gap: 6px; margin-bottom: 14px; } .sychips button { min-height: 40px; padding: 4px 12px; font-size: 13.5px; }
.sy[hidden] { display: none; } .sy:first-of-type .syear { margin-top: 0; }
.smap { cursor: pointer; } .smap .tr path { vector-effect: non-scaling-stroke; }
.bigmap { position: fixed; inset: 0; z-index: 25; overflow: hidden; background: #dfe4e6; touch-action: none; -webkit-user-select: none; user-select: none; }
.bigmap .tl { position: absolute; inset: 0; filter: grayscale(1) contrast(.85) brightness(1.08); opacity: .85; } .bigmap .tl img { position: absolute; max-width: none; }
.bigmap svg.tr { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bigmap svg.tr path { fill: none; stroke: #e11d48; stroke-width: 2.2; stroke-opacity: .22; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; mix-blend-mode: multiply; }
.bigmap button { width: 48px; height: 48px; border: 0; border-radius: 50%; background: #fff; color: #1b2630; font-size: 22px; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); display: grid; place-items: center; }
.bm-x { position: absolute; left: 14px; top: calc(14px + env(safe-area-inset-top)); }
.bm-z { position: absolute; right: 14px; bottom: calc(28px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.bigmap > a { position: absolute; left: 8px; bottom: calc(6px + env(safe-area-inset-bottom)); font-size: 10px; color: #333; background: rgba(255, 255, 255, .8); padding: 1px 5px; border-radius: 6px; text-decoration: none; }

/* Années en course : une couleur par année allumée */
.schart .yr.hl { stroke-width: 2.4; opacity: 1; } .schart .yr.hl.cur { stroke-width: 3.2; }
.sychips button { border-color: var(--bd); } .sychips button.on { background: var(--yc, var(--pri)); border-color: transparent; color: #fff; }

/* Bulles des statistiques : jamais plus larges que le graphique, sur deux lignes si besoin */
.wwrap:has(svg[data-scrub]) .wtip { max-width: 100%; white-space: normal; text-align: center; font-size: 12.5px; line-height: 1.35; width: max-content; } .wtip i { font-style: normal; font-size: 10px; }

/* Régularité : le doigt sur une case */
.sy { position: relative; } .scal { touch-action: pan-y; cursor: crosshair; }
.sy .wtip { top: -6px; max-width: 100%; width: max-content; white-space: normal; text-align: center; font-size: 12.5px; line-height: 1.35; }
.scal rect.hit { stroke: var(--tx); stroke-width: 1.2; }

/* Profil « santé » : choix de la séance */
.seschips { margin: 0 0 12px; } .seschips button { flex: 1; padding-inline: 6px; font-size: 13.5px; }
