/* ============================================================
   Runly — thème « Split » : panneau d'instrument athlétique
   Fond bleu-nuit · accent orange flamme · typo scoreboard
   ============================================================ */

:root {
  --bg:        #0A0E17;
  --surface:   #131A28;
  --surface-2: #1C2536;
  --elevated:  #222E43;
  --line:      #273349;
  --line-soft: #1E2739;
  --ink:       #EAF0FA;
  --ink-dim:   #B7C2D6;
  --muted:     #7E8DA8;
  --accent:    #FF5A2C;
  --accent-2:  #FF7A4D;
  --accent-ink:#120A06;
  --cyan:      #35D6E5;
  --good:      #34D399;
  --warn:      #FBBF24;
  --bad:       #F0603D;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 10px 30px -12px rgba(0,0,0,.6);
  --glow:      0 0 0 1px rgba(255,90,44,.35), 0 8px 24px -8px rgba(255,90,44,.35);
  --f-display: "Barlow Condensed", system-ui, sans-serif;
  --f-body:    "Barlow", system-ui, sans-serif;
  --f-mono:    "Roboto Mono", ui-monospace, monospace;
  --sidebar-w: 244px;
}

* { box-sizing: border-box; }
/* l'attribut [hidden] doit toujours l'emporter (sinon .modal{display:grid} l'écrase
   et affiche les pop-ups au chargement) */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1,h2,h3,h4 { font-family: var(--f-display); font-weight: 700; margin: 0; letter-spacing: .01em; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
canvas { max-width: 100%; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, #0D131F, #0A0E17);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; padding: 22px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 26px; }
.brand__mark { width: 30px; height: 30px; color: var(--accent); filter: drop-shadow(0 0 8px rgba(255,90,44,.5)); }
.brand__name { font-family: var(--f-display); font-weight: 800; font-size: 26px; letter-spacing: .02em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--ink-dim); font-weight: 500; font-size: 15px;
  position: relative; transition: background .15s, color .15s;
}
.nav__ic { width: 20px; text-align: center; font-size: 15px; opacity: .8; }
.nav__item:hover { background: var(--surface); color: var(--ink); }
.nav__item.is-active { background: var(--surface-2); color: var(--ink); }
.nav__item.is-active::before {
  content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px;
  background: var(--accent); border-radius: 0 3px 3px 0; box-shadow: 0 0 10px var(--accent);
}
.sidebar__foot { margin-top: auto; padding-top: 16px; }

/* ---------- Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 28px; background: rgba(10,14,23,.82);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft);
}
.topbar__menu { display: none; }
.topbar__title { font-size: 24px; font-weight: 700; flex: 1; }
.topbar__actions { display: flex; gap: 10px; }

.content { padding: 26px 28px 60px; max-width: 1180px; width: 100%; }
.view { animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none; } }

/* ---------- Buttons / chips ---------- */
.btn {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 14px;
  transition: transform .1s, background .15s, border-color .15s;
}
.btn:hover { background: var(--elevated); }
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--accent-2); }
.btn--ghost { background: transparent; }
.btn--lg { padding: 13px 22px; font-size: 15px; }
.icon-btn { background: transparent; border: none; color: var(--ink-dim); font-size: 18px; padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.chip--muted { background: var(--surface-2); color: var(--muted); }
.chip--ok { background: rgba(52,211,153,.15); color: var(--good); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid--dash { grid-template-columns: repeat(3, 1fr); }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.card--span2 { grid-column: span 2; }
.card--flush { padding: 0; overflow: hidden; }
.card--form { padding: 22px 24px; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card__head h3 { font-size: 18px; text-transform: uppercase; letter-spacing: .04em; }
.card__hint { color: var(--muted); font-size: 12.5px; font-family: var(--f-mono); }

.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 11.5px; font-weight: 600; color: var(--accent); font-family: var(--f-body); }

/* ---------- Hero (dashboard) ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: radial-gradient(120% 140% at 100% 0%, rgba(255,90,44,.16), transparent 55%), var(--surface);
  border: 1px solid var(--line-soft); padding: 30px 30px 28px; margin-bottom: 18px; box-shadow: var(--shadow);
}
/* signature : lignes de couloir de piste */
.hero__lanes {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(115deg, transparent 0 46px, rgba(255,255,255,.035) 46px 47px);
  mask-image: linear-gradient(90deg, transparent, #000 40%);
}
.hero__grid { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.hero__readout { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 2px; }
.hero__num { font-family: var(--f-display); font-weight: 800; font-size: clamp(56px, 9vw, 96px); line-height: .9; letter-spacing: -.01em; }
.hero__unit { font-family: var(--f-display); font-weight: 600; font-size: 26px; color: var(--muted); }
.hero__sub { color: var(--ink-dim); font-family: var(--f-mono); font-size: 13px; }
.hero__stats { display: grid; grid-template-columns: repeat(2, auto); gap: 14px 30px; }
.hero__stat { }
.hero__stat b { display: block; font-family: var(--f-display); font-weight: 700; font-size: 28px; line-height: 1; }
.hero__stat span { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hero__stat.mono b { font-family: var(--f-mono); font-weight: 700; font-size: 24px; }

/* ---------- Charts ---------- */
.chart-wrap { position: relative; height: 240px; }
.chart-wrap--sm { height: 190px; }

/* ---------- ACWR gauge ---------- */
.gauge { text-align: center; padding: 6px 0; }
.gauge__val { font-family: var(--f-display); font-weight: 800; font-size: 52px; line-height: 1; }
.gauge__bar { position: relative; height: 10px; border-radius: 6px; margin: 16px 0 8px;
  background: linear-gradient(90deg, #3B4A66 0 22%, var(--good) 22% 46%, var(--warn) 46% 66%, var(--bad) 66% 100%); }
.gauge__cursor { position: absolute; top: -4px; width: 3px; height: 18px; background: #fff; border-radius: 3px; transform: translateX(-50%); box-shadow: 0 0 8px rgba(255,255,255,.8); }
.gauge__msg { font-size: 13.5px; color: var(--ink-dim); margin-top: 6px; }
.gauge__scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); font-family: var(--f-mono); }

/* ---------- Predictions ---------- */
.pred-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pred { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px; position: relative; overflow: hidden; }
.pred__label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pred__time { font-family: var(--f-mono); font-weight: 700; font-size: 24px; margin-top: 4px; }
.pred__pace { font-size: 12.5px; color: var(--accent); font-family: var(--f-mono); }

/* ---------- Mini list ---------- */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.mini-list li:last-child { border-bottom: none; }
.mini-list__ic { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); flex-shrink: 0; overflow: hidden; }
.route-thumb { width: 34px; height: 34px; display: block; color: var(--accent); }
.mini-list__main { flex: 1; min-width: 0; }
.mini-list__t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list__d { font-size: 12px; color: var(--muted); font-family: var(--f-mono); }
.mini-list__km { font-family: var(--f-display); font-weight: 700; font-size: 20px; }

/* ---------- Toolbar / segmented ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.seg__btn { border: none; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; }
.seg__btn.is-active { background: var(--accent); color: var(--accent-ink); }

/* ---------- Table ---------- */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th { text-align: left; padding: 13px 16px; font-family: var(--f-body); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .mono { font-family: var(--f-mono); }
.table__badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; background: var(--surface-2); color: var(--ink-dim); margin-right: 8px; }

/* ---- Historique ergonomique ---- */
.hist-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.hist-toolbar .seg { flex-wrap: wrap; }
@media (max-width: 680px) {
  .hist-toolbar { gap: 8px; }
  .hist-toolbar .seg, .hist-search { width: 100%; }
  .hist-toolbar .seg__btn { flex: 1 1 auto; text-align: center; }
}
.hist-search { flex: 1; min-width: 170px; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 9px 12px; color: var(--ink); font-family: var(--f-body); font-size: 14px; }
.hist-search:focus { border-color: var(--accent); outline: none; }
.hist-filters { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.hist-field { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.hist-field input { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 7px 9px; color: var(--ink); font-family: var(--f-body); font-size: 13.5px; }
.hist-field input:focus { border-color: var(--accent); outline: none; }
.hist-field input[type="date"] { color-scheme: dark; }
.hist-num { width: 66px; }
.hist-field__sep { color: var(--muted); }
@media (max-width: 680px) {
  .hist-filters { gap: 10px; }
  .hist-field { flex: 1 1 auto; }
  .hist-field input[type="date"] { flex: 1; min-width: 0; }
}
.hist-summary { display: flex; gap: 20px; margin-bottom: 12px; padding: 0 4px; flex-wrap: wrap; }
.hist-summary span { font-size: 13px; color: var(--muted); }
.hist-summary b { font-family: var(--f-display); font-weight: 700; font-size: 18px; color: var(--ink); margin-right: 4px; }
.table--hist thead th.is-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table--hist thead th.is-sortable:hover { color: var(--ink-dim); }
.table--hist thead th.is-sorted { color: var(--accent); }
.table--hist thead th.is-sorted::after { content: '▾'; margin-left: 4px; font-size: 9px; }
.table--hist thead th.is-sorted[data-dir="asc"]::after { content: '▴'; }

@media (max-width: 640px) {
  .table--hist thead { display: none; }
  .table--hist, .table--hist tbody, .table--hist tr, .table--hist td { display: block; width: 100%; }
  .table--hist tbody tr { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
  .table--hist tbody td { border: none; padding: 3px 0; white-space: normal;
    display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; }
  .table--hist tbody td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; }
  .table--hist tbody td[data-label="Séance"] { font-size: 15.5px; font-weight: 600; margin-bottom: 5px; }
  .table--hist tbody td[data-label="Séance"]::before { display: none; }
}

/* ---------- Records tiles ---------- */
.rec { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.rec__v { font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: 1; }
.rec__v small { font-size: 16px; color: var(--muted); font-weight: 600; }
.rec__l { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-top: 6px; }
.rec--mono .rec__v { font-family: var(--f-mono); font-size: 28px; }

/* ---------- Zone legend ---------- */
.zone-legend { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.zone-legend__row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.zone-legend__dot { width: 10px; height: 10px; border-radius: 3px; }
.zone-legend__lbl { flex: 1; color: var(--ink-dim); }
.zone-legend__pct { font-family: var(--f-mono); font-weight: 600; }

/* ---------- Coaching ---------- */
.coach-hero { display: flex; align-items: center; gap: 26px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 24px 26px; margin-bottom: 20px; box-shadow: var(--shadow); flex-wrap: wrap; }
.score { --p: 0; width: 118px; height: 118px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0);
  display: grid; place-items: center; position: relative; }
.score::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.score__n { position: relative; font-family: var(--f-display); font-weight: 800; font-size: 42px; }
.coach-hero__txt { flex: 1; min-width: 200px; }
.coach-hero__txt h2 { font-size: 28px; text-transform: uppercase; letter-spacing: .02em; }
.coach-hero__meters { display: flex; gap: 22px; }
.meter { text-align: center; }
.meter b { display: block; font-family: var(--f-display); font-size: 26px; font-weight: 700; }
.meter span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.tips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tip { background: var(--surface); border: 1px solid var(--line-soft); border-left: 3px solid var(--muted); border-radius: 12px; padding: 16px 18px; }
.tip--danger  { border-left-color: var(--bad); }
.tip--warning { border-left-color: var(--warn); }
.tip--info    { border-left-color: var(--cyan); }
.tip--success { border-left-color: var(--good); }
.tip__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.tip__cat { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-left: auto; }
.tip__title { font-family: var(--f-display); font-weight: 700; font-size: 18px; }
.tip__dot { width: 9px; height: 9px; border-radius: 50%; }
.tip--danger .tip__dot{background:var(--bad)} .tip--warning .tip__dot{background:var(--warn)}
.tip--info .tip__dot{background:var(--cyan)} .tip--success .tip__dot{background:var(--good)}
.tip__text { font-size: 14px; color: var(--ink-dim); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.form input, .form select {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  padding: 11px 13px; border-radius: 10px; font-size: 15px; font-family: var(--f-body);
}
.form input:focus, .form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,90,44,.18); }
.form__note { font-size: 12.5px; }

/* ---------- Plan ---------- */
.plan-summary { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.plan-summary h2 { font-size: 26px; text-transform: uppercase; }
.plan-summary__stat b { font-family: var(--f-display); font-size: 24px; }
.plan-summary__stat span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pace-key { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 20px; }
.pace-key__item { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.pace-key__item b { font-family: var(--f-mono); color: var(--accent); }
.week { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.week__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; }
.week__no { font-family: var(--f-display); font-weight: 800; font-size: 22px; width: 42px; }
.week__no small { display: block; font-size: 10px; color: var(--muted); letter-spacing: .1em; }
.week__phase { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.phase-Base { background: rgba(53,214,229,.15); color: var(--cyan); }
.phase-Développement { background: rgba(52,211,153,.15); color: var(--good); }
.phase-Spécifique { background: rgba(251,191,36,.15); color: var(--warn); }
.phase-Affûtage { background: rgba(255,90,44,.15); color: var(--accent); }
.week__km { margin-left: auto; font-family: var(--f-display); font-weight: 700; font-size: 20px; }
.week__km small { font-size: 12px; color: var(--muted); }
.week__body { padding: 0 18px 12px; display: none; }
.week.is-open .week__body { display: block; }
.sess { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.sess__day { width: 92px; flex-shrink: 0; font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); }
.sess__main { flex: 1; }
.sess__label { font-weight: 600; }
.sess__label .kk { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11px; margin-left: 8px; background: var(--surface-2); color: var(--ink-dim); font-family: var(--f-mono); }
.sess__detail { font-size: 13px; color: var(--muted); margin-top: 2px; }
.sess--long .sess__label, .sess--race .sess__label { color: var(--accent); }
.sess--rest .sess__label { color: var(--muted); }
.sess--rest .sess__day, .sess--rest .sess__detail { opacity: .8; }
.sess__ai { margin-top: 6px; font-size: 12.5px; color: var(--cyan);
  background: rgba(53,214,229,.08); border-left: 2px solid var(--cyan);
  padding: 5px 10px; border-radius: 0 6px 6px 0; }

/* ---------- Plan : intro, en-tête, actions ---------- */
.plan-intro__lead { margin: 2px 0 16px; max-width: 62ch; line-height: 1.5; }
.plan-summary__head { min-width: 220px; }
.plan-sub { font-family: var(--f-mono); font-size: 13px; margin-top: 4px; }
.plan-summary__stats { display: flex; gap: 22px; }
.plan-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.phase-Récupération { background: rgba(126,141,168,.16); color: var(--ink-dim); }
.week--deload { border-style: dashed; }
.week--deload .week__no { color: var(--muted); }
.week__date { font-family: var(--f-mono); font-size: 12px; }
.btn.is-loading { opacity: .8; cursor: progress; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Plan : panneau d'analyse IA ---------- */
.ai-panel { background: linear-gradient(180deg, rgba(53,214,229,.06), rgba(19,26,40,.4));
  border: 1px solid rgba(53,214,229,.28); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 18px; box-shadow: var(--shadow); }
.ai-panel__head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.ai-badge { font-family: var(--f-display); font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; font-size: 14px; color: var(--cyan);
  background: rgba(53,214,229,.14); padding: 3px 12px; border-radius: 999px; }
.ai-summary { margin: 4px 0 10px; line-height: 1.55; }
.ai-focus { margin: 0 0 12px; font-size: 14px; }
.ai-focus b { color: var(--accent); }
.ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
.ai-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ai-list li { font-size: 13.5px; line-height: 1.4; display: flex; gap: 8px; }
.ai-list li span { flex-shrink: 0; font-weight: 700; }
.ai-list--good li span { color: var(--good); }
.ai-list--warn li span { color: var(--warn); }
@media (max-width: 640px) {
  .ai-cols { grid-template-columns: 1fr; }
  .plan-actions { margin-left: 0; width: 100%; }
}

/* ---------- Modal / drop / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(5,8,14,.7); backdrop-filter: blur(4px); }
.modal__box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.modal__box--wide { width: min(760px, 100%); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--surface); }
.modal__head h3 { font-size: 20px; }
.drop { display: block; margin: 22px; border: 2px dashed var(--line); border-radius: var(--radius); padding: 40px 20px; text-align: center; transition: border-color .15s, background .15s; }
.drop.is-over { border-color: var(--accent); background: rgba(255,90,44,.06); }
.drop__ic { font-size: 34px; color: var(--accent); }
.drop__title { font-family: var(--f-display); font-weight: 700; font-size: 20px; margin-top: 8px; }
.import-result { padding: 0 22px 20px; }
.import-result__ok { color: var(--good); font-weight: 600; }
.import-result__err { color: var(--bad); font-size: 13px; margin-top: 8px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: var(--elevated); border: 1px solid var(--line); color: var(--ink);
  padding: 12px 20px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); animation: fade .25s; }
.toast--ok { border-color: var(--good); } .toast--err { border-color: var(--bad); }

.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty__ic { font-size: 40px; opacity: .5; }

.detail-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px,1fr)); gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line-soft); }
.detail-strip b { display: block; font-family: var(--f-display); font-weight: 700; font-size: 24px; }
.detail-strip .mono b { font-family: var(--f-mono); font-size: 20px; }
.detail-strip span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.detail-section { padding: 18px 22px; }
.splits { display: grid; gap: 4px; }
.split { display: grid; grid-template-columns: 40px 1fr 70px 60px; align-items: center; gap: 10px; font-size: 13px; }
.split__bar { height: 8px; background: var(--accent); border-radius: 4px; opacity: .85; }
.split__km { font-family: var(--f-display); font-weight: 700; }
.split__pace, .split__hr { font-family: var(--f-mono); text-align: right; }

.bottomnav { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid--dash, .grid--stats { grid-template-columns: 1fr; }
  .card--span2 { grid-column: auto; }
  .pred-row { grid-template-columns: repeat(2, 1fr); }
  .tips { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 14px 16px; }
  .topbar__title { font-size: 20px; }
  /* boutons compacts (icône seule) pour tenir dans la barre du haut */
  .topbar__actions .btn { padding: 9px 12px; font-size: 16px; }
  .btn__txt { display: none; }
  .content { padding: 18px 16px 96px; }
  .hero { padding: 22px 20px; }
  .hero__grid { flex-direction: column; align-items: flex-start; }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: rgba(13,19,31,.95); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line-soft); padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .bottomnav__item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 9.5px; color: var(--muted); font-weight: 600; padding: 3px 1px; white-space: nowrap; letter-spacing: -.01em; }
  .bottomnav__item span { font-size: 17px; }
  .bottomnav__item.is-active { color: var(--accent); }
  .coach-hero { justify-content: center; text-align: center; }
  .detail-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============ Carte GPS (Leaflet) ============ */
.detail-map {
  height: 300px; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-2);
}
.detail-map .leaflet-container { background: var(--surface-2); font-family: var(--f-body); }
.detail-map .leaflet-tooltip { font-family: var(--f-body); font-size: 12px; }
@media (max-width: 640px) { .detail-map { height: 220px; } }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.detail-head h4 { margin: 0; }
.seg--sm .seg__btn { padding: 5px 11px; font-size: 12.5px; }
.map-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.map-legend__bar { flex: 1; min-width: 90px; height: 7px; border-radius: 4px;
  background: linear-gradient(90deg, hsl(140,68%,50%), hsl(70,68%,50%), hsl(0,68%,50%)); }
.map-legend__range { font-family: var(--f-mono); color: var(--ink-dim); width: 100%; }

/* ============ Multisport (chips board + répartition stats) ============ */
.sport-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.sport-chips:empty { display: none; }
.sport-chips__lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.sport-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-dim); }
.sport-chip__ic { font-size: 14px; }
.sport-chip b { font-family: var(--f-display); font-weight: 700; color: var(--ink); }
.sport-break { display: flex; flex-direction: column; gap: 11px; }
.sport-break__row { display: grid; grid-template-columns: 26px 74px 1fr auto; align-items: center; gap: 10px; }
.sport-break__ic { font-size: 17px; text-align: center; }
.sport-break__lbl { font-weight: 600; font-size: 14px; color: var(--ink); }
.sport-break__bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.sport-break__bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.sport-break__v { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) {
  .sport-break__row { grid-template-columns: 24px 1fr auto; }
  .sport-break__bar { display: none; }
}

/* ============ Coach IA (Conseils) ============ */
.coach-ai:empty { display: none; }
.coach-ai { margin-bottom: 18px; }
.coach-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.coach-cta__txt { display: flex; flex-direction: column; gap: 3px; }
.coach-cta__txt b { font-size: 15px; color: var(--ink); }
.coach-cta__txt span { font-size: 13px; }
.sess-today { border-radius: var(--radius-sm); padding: 14px 16px; margin: 14px 0;
  background: var(--surface-2); border: 1px solid var(--line-soft); border-left: 3px solid var(--accent); }
.sess-today__tag { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.sess-today__title { font-family: var(--f-display); font-weight: 700; font-size: 19px; margin-top: 3px; color: var(--ink); }
.sess-today__detail { font-size: 14px; color: var(--ink-dim); margin-top: 5px; line-height: 1.4; }
.sess-today--intense { border-left-color: var(--bad); }
.sess-today--modéré { border-left-color: var(--warn); }
.sess-today--facile { border-left-color: var(--good); }
.sess-today--repos  { border-left-color: var(--muted); }

/* ============ Apple Santé (Raccourci) ============ */
.apple-help { margin-top: 12px; }
.apple-help summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; }
.apple-steps { margin: 10px 0 4px; padding-left: 20px; font-size: 13px; color: var(--ink-dim);
  line-height: 1.5; display: flex; flex-direction: column; gap: 7px; }
.apple-help code { font-family: var(--f-mono); font-size: 11.5px; background: var(--surface-2);
  padding: 1px 5px; border-radius: 5px; }

/* ============ Invite installation PWA ============ */
.install-banner {
  position: fixed; z-index: 150; left: 16px; right: 16px; bottom: 16px;
  display: flex; align-items: center; gap: 13px;
  background: var(--elevated); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px;
  animation: installUp .3s ease;
}
@keyframes installUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.install-banner__ic { width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0; }
.install-banner__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.install-banner__txt b { font-size: 14.5px; color: var(--ink); }
.install-banner__txt span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.install-banner__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
@media (min-width: 720px) { .install-banner { left: auto; right: 24px; bottom: 24px; max-width: 380px; } }
@media (max-width: 719px) { .install-banner { bottom: calc(var(--bottomnav-h, 62px) + 12px); } }

/* ============ Forme du jour (readiness) ============ */
.readiness__body { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.readiness__score {
  width: 118px; height: 118px; border-radius: 50%; flex-shrink: 0; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0);
}
.readiness__score::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.readiness__num { position: relative; font-family: var(--f-display); font-weight: 800; font-size: 38px; line-height: 1; color: var(--ink); }
.readiness__lbl { position: relative; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-top: 3px; }
.readiness__main { flex: 1; min-width: 220px; }
.readiness__advice { margin: 0 0 14px; font-size: 15px; color: var(--ink-dim); line-height: 1.45; }
.readiness__factors { display: flex; flex-direction: column; gap: 11px; }
.rfac__top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 4px; gap: 10px; }
.rfac__l { font-weight: 600; color: var(--ink); }
.rfac__d { color: var(--muted); font-family: var(--f-mono); font-size: 12px; }
.rfac__bar { height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.rfac__bar i { display: block; height: 100%; border-radius: 4px; transition: width .5s ease; }

/* ============ Authentification ============ */
.auth {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255,90,44,.14), transparent 60%),
    var(--bg);
}
.auth__card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 30px 28px;
}
.auth__brand { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.auth__brand .brand__name { font-family: var(--f-display); font-weight: 800; font-size: 26px;
  letter-spacing: -.01em; color: var(--ink); }
.auth__brand .brand__mark { width: 30px; height: 30px; }
.auth__tagline { margin: 10px 0 20px; font-size: 14px; line-height: 1.4; }
.auth__tabs { display: flex; gap: 4px; background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 20px; }
.auth__tab { flex: 1; padding: 9px; border: none; border-radius: 7px; cursor: pointer;
  background: transparent; color: var(--muted); font-family: var(--f-body); font-weight: 600; font-size: 14px; }
.auth__tab.is-active { background: var(--elevated); color: var(--ink); }
.auth__form { display: flex; flex-direction: column; gap: 14px; }
.auth__form label { display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; color: var(--ink-dim); font-weight: 600; }
.auth__form input { background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 12px; color: var(--ink);
  font-family: var(--f-body); font-size: 15px; }
.auth__form input:focus { border-color: var(--accent); outline: none; }
.auth__form .btn { margin-top: 4px; justify-content: center; }
.auth__err { color: var(--bad); font-size: 13px; margin: 0; text-align: center; }
.auth__foot { font-size: 12px; text-align: center; margin: 18px 0 0; line-height: 1.4; }

/* Bloc utilisateur (barre latérale) + petit bouton */
.userbox { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.userbox__name { font-size: 12.5px; color: var(--ink-dim); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn--sm { padding: 6px 10px; font-size: 12px; }
