/* ============================================================
   MieuxGrimper — design system (v4)
   Sombre + vert montagne, repris du logo.
   ============================================================ */

:root {
  /* Fonds */
  --bg: #080c09;
  --bg-soft: #0d130f;
  --surface: #131b16;
  --surface-2: #18211a;
  --surface-3: #1e2a21;
  --line: #253026;
  --line-soft: #1c2620;
  --line-strong: #33452f;

  /* Marque */
  --green: #6fbf44;
  --green-bright: #96e864;
  --green-deep: #4d9130;
  --green-soft: rgba(111, 191, 68, .13);
  --green-glow: rgba(111, 191, 68, .28);
  --gold: #e5b95a;
  --gold-soft: rgba(229, 185, 90, .13);
  --danger: #e56a6a;
  --danger-soft: rgba(229, 106, 106, .13);
  --blue: #6aa8e5;

  /* Texte */
  --text: #eef4ec;
  --text-2: #b9c9bd;
  --muted: #7f9686;

  /* Formes */
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  --shadow: 0 8px 24px rgba(0, 0, 0, .38);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, .045);

  --font-head: "Archivo Black", "Arial Black", sans-serif;
  --font: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --nav-h: 66px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 460px at 82% -8%, rgba(111, 191, 68, .09), transparent 62%),
    radial-gradient(700px 380px at 8% 12%, rgba(111, 191, 68, .04), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}
body.modal-open { overflow: hidden; }

/* Confort tactile : pas de surbrillance grise, pas de sélection accidentelle
   sur les éléments qu'on tape en rafale pendant une séance. */
button, .chip, .pdot, .exo-row, .pick-btn, .grade-btn, .nav-item, .seg {
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}

#app {
  max-width: 660px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
  animation: rise .2s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Typo ---------- */

h1, h2, h3 { line-height: 1.18; letter-spacing: -.01em; }
h4 { font-size: 15px; margin-bottom: 8px; letter-spacing: -.01em; }

.page-title {
  font-family: var(--font-head);
  font-size: 25px;
  margin: 4px 0 16px;
  letter-spacing: .2px;
}
.page-title.tight { margin-bottom: 10px; }

.kicker {
  display: block;
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--green); margin-bottom: 5px;
}

.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; line-height: 1.45; }
.center { text-align: center; }

.count {
  font-size: 12px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 8px; border-radius: 99px; margin-left: 6px;
  vertical-align: middle;
}

.link {
  background: none; border: none; color: var(--green);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; padding: 4px 0;
}
.link.danger { color: var(--danger); }

a { color: var(--green); }

/* ---------- Topbar ---------- */

#topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(180deg, rgba(8, 12, 9, .96), rgba(8, 12, 9, .82));
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 660px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 16px;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--text); font-family: var(--font-head); font-size: 15px;
  letter-spacing: .4px;
}
.brand img {
  width: 32px; height: 32px; border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line), 0 0 16px rgba(111, 191, 68, .18);
}
.brand b { color: var(--green); font-weight: inherit; }
.topbar-right { display: flex; align-items: center; gap: 7px; }

.pill {
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 4px 11px; border-radius: 99px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
  box-shadow: var(--inset-hi);
}
.pill-lvl { color: var(--green); border-color: rgba(111, 191, 68, .3); }
.pill-coach {
  color: var(--green); background: var(--green-soft);
  border-color: rgba(111, 191, 68, .35);
  letter-spacing: 1px; font-size: 11px;
}

.avatar-btn { background: none; border: none; cursor: pointer; padding: 0; line-height: 0; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--av, var(--green)); font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), var(--inset-hi);
}
.avatar.lg { width: 62px; height: 62px; font-size: 30px; }

/* ---------- Bottom nav ---------- */

#bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: center; gap: 4px;
  background: linear-gradient(0deg, rgba(8, 12, 9, .99), rgba(8, 12, 9, .9));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-soft);
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
}
.nav-item {
  flex: 1; max-width: 130px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-family: inherit;
  padding: 0; border-radius: var(--r);
  transition: color .18s;
}
.nav-ico {
  display: flex; align-items: center; justify-content: center;
  width: 54px; height: 30px; border-radius: 99px;
  transition: background .18s, box-shadow .18s;
}
.nav-item svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.nav-label { font-size: 10.5px; font-weight: 600; letter-spacing: .1px; }
.nav-item.active { color: var(--green); }
.nav-item.active .nav-ico {
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px rgba(111, 191, 68, .28);
}
body.login-mode #bottomnav, body.login-mode #topbar { display: none; }

/* ---------- Cartes ---------- */

.card {
  background: linear-gradient(168deg, var(--surface-2), var(--surface) 62%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--inset-hi), var(--shadow-sm);
}
.card-cta {
  border-color: rgba(111, 191, 68, .42);
  background:
    radial-gradient(340px 130px at 100% 0%, rgba(111, 191, 68, .12), transparent 70%),
    linear-gradient(168deg, var(--surface-3), var(--surface) 65%);
  box-shadow: var(--inset-hi), 0 10px 30px rgba(111, 191, 68, .08);
}
.card-cta h3 { font-size: 19px; margin-bottom: 4px; }
.card-cta .btn { margin-top: 13px; }

.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 22px 0 10px;
}
.section-head h3 { font-size: 16.5px; font-weight: 700; }

.empty {
  text-align: center; padding: 30px 18px;
  background: linear-gradient(168deg, var(--surface-2), var(--surface) 62%);
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
  margin-bottom: 12px;
}
.empty-ico { font-size: 30px; display: block; margin-bottom: 8px; opacity: .85; }
.empty b { display: block; margin-bottom: 3px; }

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  border-radius: var(--r); border: 1px solid transparent;
  padding: 12px 18px; cursor: pointer;
  transition: transform .07s ease, filter .16s, border-color .16s, background .16s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .32; cursor: default; }

.btn-primary {
  background: linear-gradient(180deg, var(--green-bright), var(--green) 55%, var(--green-deep));
  color: #08130a;
  box-shadow: 0 6px 18px rgba(111, 191, 68, .22), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn-primary:hover { filter: brightness(1.06); }

.btn-ghost {
  background: var(--surface-2); color: var(--text);
  border-color: var(--line-strong);
  box-shadow: var(--inset-hi);
}
.btn-ghost:hover { border-color: var(--green); }

.btn-quiet { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-quiet:hover { color: var(--text); border-color: var(--line-strong); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: rgba(229, 106, 106, .35); }

.btn-add {
  width: 100%; margin-top: 4px;
  background: transparent; color: var(--green);
  border: 1px dashed rgba(111, 191, 68, .45);
  font-weight: 700;
}
.btn-add:hover { background: var(--green-soft); }

.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: var(--r-sm); }
.btn-big { width: 100%; padding: 15px; font-size: 16px; margin: 8px 0; }
.btn-block { width: 100%; margin-bottom: 8px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; }
.btn-row-main { margin: 8px 0 14px; }
.btn-row-main .btn { flex: 1; }

/* ---------- Badges, chips, barres ---------- */

.badge {
  font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px;
  align-self: flex-start; white-space: nowrap; letter-spacing: .1px;
}
.badge.ok { background: var(--green-soft); color: var(--green); box-shadow: inset 0 0 0 1px rgba(111, 191, 68, .28); }
.badge.warn { background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(229, 185, 90, .28); }
.badge.danger { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(229, 106, 106, .28); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 4px 11px; border-radius: 99px;
  font-family: inherit;
}
.chips-select .chip { cursor: pointer; transition: all .14s; }
.chip.on {
  background: var(--green-soft); color: var(--green);
  border-color: rgba(111, 191, 68, .5);
}
.chip.locked { opacity: .5; cursor: default; }
.tag {
  font-size: 11px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2);
  border-radius: 99px; padding: 2px 8px;
}

.title-tag {
  display: inline-block;
  background: var(--gold-soft); color: var(--gold);
  border: 1px solid rgba(229, 185, 90, .32);
  font-size: 11.5px; font-weight: 700;
  padding: 3px 11px; border-radius: 99px;
}

.grade-pill {
  display: inline-block;
  background: var(--green-soft); color: var(--green);
  border: 1px solid rgba(111, 191, 68, .3);
  font-size: 12px; font-weight: 800;
  padding: 1px 9px; border-radius: 99px;
}

.bar {
  height: 9px; border-radius: 99px; background: var(--bg-soft);
  border: 1px solid var(--line); overflow: hidden; margin: 9px 0;
}
.bar-thin { height: 6px; }
.bar-lg { height: 11px; }
.bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--green-deep), var(--green) 40%, var(--green-bright));
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}
.bar-fill.warn { background: linear-gradient(90deg, var(--gold), #f0d08a); }

/* ---------- Segmented control ---------- */

.segmented {
  display: flex; gap: 3px; padding: 3px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 99px; margin-bottom: 14px;
}
.seg {
  flex: 1; font-family: inherit; font-size: 13.5px; font-weight: 700;
  background: transparent; color: var(--muted);
  border: none; border-radius: 99px;
  padding: 8px 12px; cursor: pointer; white-space: nowrap;
  transition: background .18s, color .18s;
}
.seg.active {
  background: linear-gradient(180deg, var(--green-bright), var(--green));
  color: #08130a;
  box-shadow: 0 2px 8px rgba(111, 191, 68, .25);
}
.seg-scroll { overflow-x: auto; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-scroll .seg { flex: 0 0 auto; }

/* ---------- Login ---------- */

.login-wrap { padding-top: 26px; max-width: 460px; margin: 0 auto; }
.login-hero { text-align: center; margin-bottom: 24px; position: relative; }
.login-glow {
  position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, var(--green-glow), transparent 65%);
  filter: blur(30px); pointer-events: none;
}
.login-logo {
  position: relative;
  width: 122px; height: 122px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(111, 191, 68, .25), 0 14px 44px rgba(0, 0, 0, .5);
}
.login-hero h1 {
  font-family: var(--font-head); font-size: 33px;
  margin-top: 16px; letter-spacing: .5px; position: relative;
}
.login-hero h1 span { color: var(--green); }
.tagline { color: var(--muted); margin-top: 5px; font-size: 14.5px; position: relative; }
.auth-card { padding: 18px; }
.auth-card form { display: flex; flex-direction: column; }
.auth-card .btn-big { margin-top: 6px; }
.login-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

.account-card { padding: 13px 16px; }
.account-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.account-row + .account-row { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.photo-gauge { flex: 1; min-width: 90px; margin: 0; }

/* ---------- Accueil ---------- */

.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, #1a2c1e, #0c1510 78%);
  border: 1px solid var(--line-strong); border-radius: var(--r-xl);
  padding: 20px 18px 22px; margin-bottom: 13px;
  box-shadow: var(--inset-hi), var(--shadow);
}
.hero-mountains { position: absolute; inset: auto 0 0 0; height: 84px; opacity: .5; pointer-events: none; }
.hero-mountains svg { width: 100%; height: 100%; display: block; }
.mtn-back { fill: #1f3325; }
.mtn-front { fill: #27462e; }
.hero-inner { position: relative; }
.hero-row { display: flex; align-items: center; gap: 14px; }
.hero-txt { flex: 1; min-width: 0; }
.hello { display: block; color: var(--text-2); font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.hero h2 {
  font-family: var(--font-head); font-size: 23px; line-height: 1.14;
  margin-bottom: 8px; text-wrap: balance;
}
.hero h2 em { font-style: normal; color: var(--green-bright); }
.hero-ring {
  background: none; border: none; padding: 0; cursor: pointer;
  width: 84px; flex-shrink: 0; line-height: 0;
}
.hero-ring .ring { width: 84px; height: 84px; }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 12.5px; color: var(--muted);
}
.hero-stats b { color: var(--text); font-weight: 800; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 13px; }
.stat-row-4 { grid-template-columns: repeat(4, 1fr); }
.stat {
  background: linear-gradient(168deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 6px; text-align: center;
  box-shadow: var(--inset-hi);
}
.stat b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.stat span { font-size: 11px; color: var(--muted); font-weight: 500; }
.stat[data-action] { cursor: pointer; }
.stat-warn { border-color: rgba(229, 185, 90, .45); background: linear-gradient(168deg, rgba(229, 185, 90, .08), var(--surface)); }
.stat-warn b { color: var(--gold); }

.recap-row { display: flex; gap: 8px; margin-top: 10px; }
.recap-row > div {
  flex: 1; text-align: center;
  background: var(--bg-soft); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 9px 4px;
}
.recap-row b { display: block; font-size: 16px; font-weight: 800; color: var(--green); }
.recap-row span { font-size: 10.5px; color: var(--muted); }
.small-recap { margin: 4px 0 12px; }

.best-row { display: flex; gap: 8px; margin-top: 10px; }
.best {
  flex: 1; background: var(--green-soft); border: 1px solid rgba(111, 191, 68, .25);
  border-radius: var(--r-sm); padding: 9px 12px;
}
.best b { display: block; font-family: var(--font-head); font-size: 20px; color: var(--green-bright); }

.badge-flash { display: flex; align-items: center; gap: 14px; }
.badge-flash-ico {
  font-size: 30px; width: 52px; height: 52px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); border: 1px solid rgba(229, 185, 90, .3);
  border-radius: 50%;
}

.card-insta { display: flex; align-items: center; gap: 13px; text-decoration: none; color: var(--text); margin-top: 16px; }
.card-insta .insta-ico { font-size: 25px; }
.insta-txt { display: flex; flex-direction: column; }
.card-insta .arrow { margin-left: auto; color: var(--green); font-size: 19px; }

/* ---------- Quêtes ---------- */

.quest-card { padding: 6px 15px; }
.quest { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.quest:last-of-type { border-bottom: none; }
.quest-ico { font-size: 19px; width: 24px; text-align: center; flex-shrink: 0; }
.quest-mid { flex: 1; min-width: 0; }
.quest-name { font-size: 13.5px; font-weight: 600; display: block; }
.quest.done .quest-name { color: var(--green); }
.quest-mid .bar { margin: 6px 0 0; }
.quest-xp {
  font-size: 12.5px; font-weight: 800; color: var(--gold);
  white-space: nowrap; flex-shrink: 0;
  background: var(--gold-soft); padding: 3px 9px; border-radius: 99px;
}
.quest-xp.claimed { color: var(--green); background: var(--green-soft); }
.quest-note { padding: 10px 0 8px; border-top: 1px solid var(--line-soft); margin-top: 2px; }

/* ---------- Progression ---------- */

.level-card { display: flex; align-items: center; gap: 18px; }
.ring { width: 104px; height: 104px; flex-shrink: 0; }
.ring-bg { fill: none; stroke: var(--bg-soft); stroke-width: 9; }
.ring-fill {
  fill: none; stroke: var(--green); stroke-width: 9; stroke-linecap: round;
  transition: stroke-dashoffset .6s cubic-bezier(.4, 0, .2, 1);
  filter: drop-shadow(0 0 6px rgba(111, 191, 68, .45));
}
.ring-lvl { fill: var(--text); font-family: var(--font-head); font-size: 29px; text-anchor: middle; }
.ring-sub { fill: var(--muted); font-size: 8.5px; letter-spacing: 2.2px; text-anchor: middle; font-weight: 700; }
.level-info { flex: 1; min-width: 0; }
.level-info .bar { margin: 9px 0 4px; }

.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.badge-card {
  background: linear-gradient(168deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 8px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: var(--inset-hi);
}
.badge-card b { font-size: 12px; line-height: 1.25; }
.badge-card .badge-ico { font-size: 26px; }
.badge-card.won {
  border-color: rgba(229, 185, 90, .38);
  background: linear-gradient(168deg, rgba(229, 185, 90, .07), var(--surface) 70%);
}
.badge-card.locked { opacity: .45; }

.title-chip.on { background: var(--gold-soft); color: var(--gold); border-color: rgba(229, 185, 90, .5); }

.avatar-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.avatar-pick {
  width: 50px; height: 50px; border-radius: 50%;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface-2); border: 2px solid var(--line);
  font-size: 23px; cursor: pointer; font-family: inherit;
  transition: border-color .16s, background .16s, transform .07s;
}
.avatar-pick:active { transform: scale(.94); }
.avatar-pick.on { border-color: var(--green); background: var(--green-soft); }
.avatar-pick.locked { cursor: default; font-size: 14px; opacity: .45; }
.avatar-pick.locked i { font-style: normal; font-size: 8.5px; color: var(--muted); }

/* ---------- Entraînement ---------- */

.week-card .bar { margin: 11px 0 5px; }
.seance-card.done { opacity: .72; }
.seance-top { display: flex; gap: 12px; margin-bottom: 11px; }
.seance-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: var(--green-soft); color: var(--green);
  font-weight: 800; font-size: 19px;
  box-shadow: inset 0 0 0 1px rgba(111, 191, 68, .18);
}
.seance-ico.small { width: 28px; height: 28px; font-size: 13px; border-radius: 9px; }
.seance-info { flex: 1; min-width: 0; }
.seance-info h3 { font-size: 15.5px; margin-bottom: 2px; }

/* ---------- Séance en direct : mode focus ---------- */

.session-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.session-chrono {
  font-family: var(--font-head); font-size: 21px; color: var(--green);
  font-variant-numeric: tabular-nums; letter-spacing: .5px;
}

.session-progress {
  position: sticky; top: 54px; z-index: 30;
  background: linear-gradient(180deg, rgba(8, 12, 9, .98) 70%, rgba(8, 12, 9, .82));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 8px 0 10px; margin-bottom: 12px;
}
.pdots { display: flex; gap: 5px; align-items: center; }
.pdot {
  flex: 1; height: 7px; min-width: 7px; padding: 0;
  border: none; border-radius: 99px; cursor: pointer;
  background: var(--surface-3);
  transition: background .25s, transform .2s, box-shadow .25s;
}
.pdot.done { background: var(--green-deep); }
.pdot.cur {
  background: linear-gradient(90deg, var(--green), var(--green-bright));
  transform: scaleY(1.7);
  box-shadow: 0 0 10px rgba(111, 191, 68, .5);
}
.pdot.end { flex: 0 0 auto; height: auto; font-size: 11px; background: none; line-height: 1; opacity: .5; }
.pdot.end.cur { opacity: 1; transform: none; box-shadow: none; }
.pmeta { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.plist {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  padding: 5px 12px; border-radius: 99px; cursor: pointer;
}
.pmeta .xp-live { color: var(--gold); font-weight: 800; font-size: 12.5px; }

/* Carte focus */
.focus-wrap { will-change: transform, opacity; }
.focus-wrap.slide-l { animation: slideL .3s cubic-bezier(.22, .8, .3, 1); }
.focus-wrap.slide-r { animation: slideR .3s cubic-bezier(.22, .8, .3, 1); }
@keyframes slideL { from { opacity: 0; transform: translateX(26px); } }
@keyframes slideR { from { opacity: 0; transform: translateX(-26px); } }

.focus {
  background:
    radial-gradient(420px 180px at 50% 0%, rgba(111, 191, 68, .07), transparent 70%),
    linear-gradient(168deg, var(--surface-2), var(--surface) 60%);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  padding: 20px 18px 18px;
  box-shadow: var(--inset-hi), var(--shadow);
}
.focus.is-done { border-color: rgba(111, 191, 68, .45); }
.focus.just-done { animation: pulseOk .32s ease-out; }
@keyframes pulseOk {
  50% { transform: scale(1.012); box-shadow: 0 0 0 3px rgba(111, 191, 68, .22), var(--shadow); }
}

.focus-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.focus-block {
  font-size: 11px; font-weight: 800; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--green);
}
.focus-step {
  font-size: 12px; font-weight: 700; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--line);
  padding: 3px 11px; border-radius: 99px;
}
.focus-title {
  font-family: var(--font-head);
  font-size: 24px; line-height: 1.18; letter-spacing: -.2px;
  margin-bottom: 10px;
}
.focus-done-tag { display: inline-block; margin-bottom: 10px; }
.focus-desc {
  font-size: 16.5px; line-height: 1.62; color: var(--text-2);
  white-space: pre-line;
}
.focus .exo-target { margin-top: 14px; font-size: 13px; padding: 11px 13px; }
.focus .chips { margin-top: 12px; }

/* Objectif de l'exo (verrou) */
.gate {
  margin-top: 16px; padding: 13px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-sm);
}
.gate.ok { border-left-color: var(--green); }
.gate.skipped { border-left-color: var(--muted); }
.gate-head { font-size: 14px; font-weight: 800; margin-bottom: 5px; }
.gate.ok .gate-head { color: var(--green); }
.gate-list { list-style: none; margin: 10px 0 6px; }
.gate-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; font-size: 13px;
  border-top: 1px solid var(--line-soft);
}
.gate-list li > span:first-child { color: var(--muted); width: 12px; }
.gate-list li.ok > span:first-child { color: var(--green); }
.gate-list li b { font-weight: 700; }
.gate-list li .muted { margin-left: auto; }
.gate.shake { animation: shake .38s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}
.gate-hint { margin-top: 9px; }
.center-block { display: block; width: 100%; text-align: center; margin-top: 12px; }

.btn-locked {
  background: var(--surface-3); color: var(--muted);
  border: 1px dashed var(--line-strong);
  box-shadow: none;
}
.btn-locked:hover { color: var(--text-2); border-color: var(--gold); }

/* Feuille imprévu */
.reason-list { display: flex; flex-direction: column; gap: 7px; }
.reason-btn {
  display: flex; align-items: center; gap: 11px;
  background: var(--bg-soft); color: var(--text);
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 13px; font-family: inherit; font-size: 14.5px; font-weight: 600;
  cursor: pointer; text-align: left; transition: all .14s;
}
.reason-ico { font-size: 19px; }
.reason-btn.on { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.trouble-actions { margin-top: 16px; }
.trouble-actions .btn { justify-content: flex-start; }

/* Incidents dans l'historique / côté coach */
.incidents { margin: 10px 0; }
.incident {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--gold-soft); border: 1px solid rgba(229, 185, 90, .28);
  border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 7px;
}
.incident.early { background: var(--danger-soft); border-color: rgba(229, 106, 106, .28); }
.incident-ico { font-size: 17px; line-height: 1.3; }
.incident b { font-size: 13.5px; }

.focus-actions { margin-top: 18px; }
.focus-actions .btn-big { margin: 0 0 10px; }
.focus-nav { display: flex; gap: 6px; }
.focus-nav .btn { flex: 1; padding: 9px 6px; font-size: 12.5px; }

.focus-end .recap-row { margin: 4px 0 14px; }
.warn-left {
  border-left: 2px solid var(--gold); padding-left: 10px; margin-bottom: 12px;
}

.video-link {
  display: inline-block; margin-top: 12px; color: var(--green);
  font-weight: 700; font-size: 15px; text-decoration: none;
}
.video-link.big {
  background: var(--green-soft); border: 1px solid rgba(111, 191, 68, .3);
  padding: 10px 16px; border-radius: var(--r-sm);
}

/* Liste de tous les exos */
.exo-list { margin: 6px 0 4px; }
.list-block {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.3px;
  color: var(--muted); margin: 14px 0 6px;
}
.exo-row {
  width: 100%; display: flex; align-items: center; gap: 11px;
  background: var(--bg-soft); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 11px 12px; margin-bottom: 6px;
  font-family: inherit; color: var(--text); text-align: left; cursor: pointer;
  transition: border-color .16s, background .16s;
}
.exo-row.cur { border-color: var(--green); background: var(--green-soft); }
.exo-row.done .exo-row-state { background: var(--green-soft); color: var(--green); }
.exo-row-state {
  width: 26px; height: 26px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--muted);
  border-radius: 8px; font-size: 12px; font-weight: 800;
}
.exo-row-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.exo-row-mid b { font-size: 14px; }
.exo-row-cur { font-size: 10.5px; font-weight: 800; color: var(--green); text-transform: uppercase; letter-spacing: .6px; }

.exo-target {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 11px; padding: 9px 11px;
  background: var(--bg-soft); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; color: var(--text-2);
}

.field-area {
  width: 100%; min-height: 58px; margin-top: 10px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 11px; font-family: inherit; font-size: 14px; resize: vertical;
  transition: border-color .16s, box-shadow .16s;
}
.field-area.big { min-height: 88px; font-size: 15.5px; padding: 13px 14px; margin-top: 16px; }
.field-area:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* ---------- Voies & essais ---------- */

.voies-panel { margin-top: 12px; }

.voie {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px;
  margin-bottom: 10px;
}
.voie.sent { border-color: rgba(111, 191, 68, .4); background: linear-gradient(168deg, rgba(111, 191, 68, .06), var(--bg-soft)); }
.voie.closed { opacity: .9; }

.voie-head { display: flex; align-items: center; gap: 10px; }
.voie-photo {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 10px; overflow: hidden; padding: 0;
  border: 1px solid var(--line); background: var(--surface-2);
  cursor: pointer; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.voie-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.voie-photo.empty { border-style: dashed; color: var(--muted); }
.voie-id { flex: 1; min-width: 0; }
.voie-id b { font-size: 14.5px; }
.voie-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.voie-meta { display: flex; align-items: center; gap: 7px; margin-top: 3px; flex-wrap: wrap; }
.essai-count {
  font-size: 12px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 3px 9px; border-radius: 99px;
}
.essai-count.ok { color: var(--green); border-color: rgba(111, 191, 68, .35); }
.voie-menu {
  background: none; border: none; color: var(--muted);
  font-size: 19px; cursor: pointer; padding: 2px 6px; line-height: 1;
}

.essais { list-style: none; margin: 10px 0 0; }
.essai {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 0; border-top: 1px solid var(--line-soft);
  font-size: 13px;
}
.essai-n {
  width: 20px; height: 20px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--muted);
  border-radius: 6px; font-size: 11px; font-weight: 800;
}
.essai.is-send .essai-n { background: var(--green-soft); color: var(--green); }
.essai-res b { font-weight: 700; }
.essai-palier { color: var(--text-2); font-weight: 600; }
.essai-trend.up { color: var(--green); }
.essai-trend.down { color: var(--danger); }
.essai-trend.same { color: var(--muted); }
.essai-rest { color: var(--muted); font-size: 11.5px; }
.essai-rest.short { color: var(--gold); }
.essai-del {
  margin-left: auto; background: none; border: none;
  color: var(--muted); opacity: .5; cursor: pointer; font-size: 13px; padding: 2px 4px;
}
.essai-del:hover { opacity: 1; color: var(--danger); }
.essai-more { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding-left: 28px; }
.essai-note { font-style: italic; color: var(--text-2); font-size: 12.5px; }

.voie-empty { padding: 8px 0 2px; }
.voie-actions { display: flex; gap: 8px; margin-top: 11px; }
.voie-actions .btn { flex: 1; }

.voie-bilan {
  margin-top: 10px; padding: 9px 11px;
  background: var(--surface-2); border-radius: var(--r-sm);
  border-left: 2px solid var(--green);
}
.voie-bilan p { font-size: 13px; font-style: italic; color: var(--text-2); }

/* ---------- Barre de repos ---------- */

#restbar { display: none; }
#restbar.restbar-show {
  display: block;
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  z-index: 45;
  animation: slideup .25s ease-out;
}
@keyframes slideup { from { transform: translateY(100%); } }
.restbar-inner {
  max-width: 660px; margin: 0 auto;
  background: linear-gradient(180deg, var(--surface-3), var(--surface));
  border: 1px solid var(--line-strong);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.restbar-bar { height: 3px; background: var(--bg-soft); }
.restbar-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--green-deep), var(--green-bright));
  transition: width 1s linear;
}
.restbar-row { display: flex; align-items: center; gap: 11px; padding: 10px 14px; }
.restbar-ico { font-size: 19px; }
.restbar-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.restbar-txt b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
#restbar.ready .restbar-inner {
  border-color: var(--green);
  background: linear-gradient(180deg, rgba(111, 191, 68, .16), var(--surface));
}
#restbar.ready .restbar-txt b { color: var(--green); }

/* ---------- Feuilles (modales) : sélecteurs rapides ---------- */

.sheet-head { margin-bottom: 14px; }
.sheet-head h3 { margin-bottom: 2px; }

.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick-row { display: flex; gap: 6px; }
.pick-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: var(--surface-2); color: var(--text);
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 6px; font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .14s; text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.pick-btn span { font-size: 20px; line-height: 1; }
.pick-btn:active { transform: scale(.96); }
.pick-btn.on {
  border-color: var(--green); background: var(--green-soft); color: var(--green);
  box-shadow: 0 0 0 3px rgba(111, 191, 68, .12);
}
.pick-btn.slim { padding: 11px 3px; font-size: 12px; }
.pick-btn.face { font-size: 21px; padding: 9px 3px; }

.trend-hint { margin-top: 7px; min-height: 17px; font-weight: 700; }
.trend-hint .up { color: var(--green); }
.trend-hint .down { color: var(--danger); }
.trend-hint .same { color: var(--muted); }

.grade-scroll {
  display: flex; gap: 6px; overflow-x: auto; padding: 3px 0 7px;
  scrollbar-width: none;
}
.grade-scroll::-webkit-scrollbar { display: none; }
.grade-btn {
  flex: 0 0 auto;
  background: var(--surface-2); color: var(--text);
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 13px; font-family: inherit; font-size: 14px; font-weight: 800;
  cursor: pointer; transition: all .14s;
}
.grade-btn.on { border-color: var(--green); background: var(--green-soft); color: var(--green); }

.photo-row { margin-bottom: 10px; }
.photo-thumb {
  width: 100%; max-height: 170px; object-fit: cover;
  border-radius: var(--r-sm); margin-top: 8px; display: block;
  border: 1px solid var(--line);
}
.photo-full { width: 100%; border-radius: var(--r); display: block; }

.sheet-actions { position: sticky; bottom: 0; background: var(--surface-2); padding-top: 12px; }
.sheet-actions .btn { flex: 1; }

/* ---------- Historique ---------- */

details.card summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  cursor: pointer; list-style: none;
}
details.card summary::-webkit-details-marker { display: none; }
.hist-sum { min-width: 0; }
.chev { color: var(--muted); transition: transform .22s; flex-shrink: 0; }
details[open] .chev { transform: rotate(180deg); }
.history-body { margin-top: 13px; border-top: 1px solid var(--line-soft); padding-top: 13px; }

.fb { margin-bottom: 11px; }
.fb-exo {
  font-size: 11px; font-weight: 800; color: var(--green);
  text-transform: uppercase; letter-spacing: .6px;
}
.fb p { font-size: 13.5px; color: var(--text-2); font-style: italic; }
.fb.note .fb-exo { color: var(--gold); }

.hv-list { margin: 12px 0; }
.hv {
  background: var(--bg-soft); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 11px; margin-bottom: 9px;
}
.hv.sent { border-color: rgba(111, 191, 68, .3); }
.hv-head { display: flex; align-items: center; gap: 9px; }
.hv-photo {
  width: 36px; height: 36px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); padding: 0; background: none; cursor: pointer; flex-shrink: 0;
}
.hv-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hv-id { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.hv-res { font-size: 13px; font-weight: 700; color: var(--text-2); }
.hv-essais { list-style: none; margin-top: 8px; }
.hv-essais li {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12.5px; padding: 5px 0;
  border-top: 1px solid var(--line-soft);
}

/* ---------- Stats ---------- */

.weeks { display: flex; align-items: flex-end; gap: 6px; height: 156px; padding-top: 8px; }
.wk { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.wk-bar {
  flex: 1; width: 100%; display: flex; align-items: flex-end;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .022));
  border-radius: 6px; overflow: hidden;
}
.wk-bar span {
  width: 100%;
  background: linear-gradient(180deg, var(--green-bright), var(--green-deep));
  border-radius: 5px 5px 3px 3px;
}
.wk.vide .wk-bar { border-bottom: 2px solid var(--line); }
.wk-top { font-size: 10px; font-weight: 800; color: var(--green); height: 13px; }
.wk-lbl { font-size: 9.5px; color: var(--muted); white-space: nowrap; }

.prof-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.prof-name { font-size: 13px; font-weight: 600; width: 88px; flex-shrink: 0; }
.prof-bar { flex: 1; height: 8px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; border: 1px solid var(--line-soft); }
.prof-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-deep), var(--green)); border-radius: 99px; }
.prof-val { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------- Profil ---------- */

.profile-head { display: flex; align-items: center; gap: 14px; margin: 10px 0 16px; }
.profile-id { flex: 1; min-width: 0; }
.profile-head h2 { font-size: 21px; margin-bottom: 4px; }
.profile-head .btn { flex-shrink: 0; }

.lvl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lvl-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.lvl-grid select, .lvl-grid input {
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px; font-family: inherit; font-size: 15px;
}

.goal { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.goal:last-of-type { border-bottom: none; }
.goal input[type="checkbox"] { width: 21px; height: 21px; accent-color: var(--green); flex-shrink: 0; }
.goal-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.goal.done .goal-txt > span:first-child { text-decoration: line-through; color: var(--muted); }
.goal-add { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.goal-add input[type="text"] { flex: 1 1 150px; }
.goal-add input {
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px; font-family: inherit; font-size: 14px; min-width: 0;
}

.test-head { display: flex; gap: 11px; margin-bottom: 10px; }
.test-ico { font-size: 23px; }
.test-val { display: flex; align-items: baseline; gap: 9px; margin-bottom: 10px; flex-wrap: wrap; }
.test-val b { font-size: 25px; font-family: var(--font-head); }
.delta { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.delta.up { background: var(--green-soft); color: var(--green); }
.delta.down { background: var(--danger-soft); color: var(--danger); }
.spark { width: 110px; height: 34px; margin-left: auto; }
.spark polyline { fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Radar ---------- */

.radar-wrap { display: flex; justify-content: center; }
.radar { width: 100%; max-width: 420px; touch-action: manipulation; }
.radar[data-editable] { cursor: crosshair; }
.radar-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.radar-axis { stroke: var(--line); stroke-width: 1; }
.radar-shape {
  fill: rgba(111, 191, 68, .28); stroke: var(--green);
  stroke-width: 2; stroke-linejoin: round;
}
.radar-dot { fill: var(--green); }
.radar-label { fill: var(--muted); font-size: 10px; font-family: var(--font); font-weight: 600; }
.radar-val { fill: var(--green); font-weight: 800; }

/* ---------- Coach ---------- */

.alert-row, .fb-row-head, .mini-row { display: flex; align-items: center; gap: 11px; }
.alert-row { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.alert-row:last-of-type { border-bottom: none; }
.alert-row > div, .fb-row-head > div { flex: 1; min-width: 0; }
.alert-row .btn { flex-shrink: 0; }

.fb-row {
  background: linear-gradient(168deg, var(--surface-2), var(--surface) 62%);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 14px; margin-bottom: 10px;
  box-shadow: var(--inset-hi);
}
.fb-row .fb { margin: 11px 0 0; }
.fb-row .chips { margin-top: 10px; }

.mini-row { padding: 10px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.mini-row:last-of-type { border-bottom: none; }
.mini-mid { flex: 1; min-width: 0; }

.dots { display: inline-flex; gap: 4px; flex-shrink: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bg-soft); border: 1px solid var(--line); }
.dot.on { background: var(--green); border-color: var(--green); box-shadow: 0 0 6px rgba(111, 191, 68, .4); }
.dot.future { opacity: .3; }

.search {
  width: 100%; margin-bottom: 13px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 15px; font-family: inherit; font-size: 15px;
}
.search:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.athlete-head { display: flex; gap: 12px; align-items: flex-start; }
.athlete-id { flex: 1; min-width: 0; }

.pick-row-list { display: block; }
.pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.pick-row:last-of-type { border-bottom: none; }
.pick-row input { width: 20px; height: 20px; accent-color: var(--green); flex-shrink: 0; }
.pick-row .muted { margin-left: auto; }

/* ---------- Formulaires ---------- */

.fld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.fld input, .fld select, .fld textarea {
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px; font-family: inherit; font-size: 15px;
  width: 100%;
}
.fld textarea { min-height: 78px; resize: vertical; }
.fld input:focus, .fld textarea:focus, .fld select:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft);
}
.fld-label { margin-bottom: 2px; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fld-row-3 { grid-template-columns: repeat(3, 1fr); }

.mode-switch { display: flex; gap: 8px; margin-bottom: 12px; }
.mode-btn {
  flex: 1; display: flex; flex-direction: column; gap: 2px; align-items: center;
  background: var(--bg-soft); color: var(--text-2);
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 6px; font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .14s;
}
.mode-btn.on { border-color: var(--green); background: var(--green-soft); color: var(--green); }

.exo-edit-head { display: flex; align-items: center; gap: 7px; margin-bottom: 13px; flex-wrap: wrap; }
.exo-tools { display: flex; gap: 5px; margin-left: auto; }
.exo-tools .btn { padding: 7px 10px; }
.exo-edit-head select {
  background: var(--bg-soft); color: var(--green); font-weight: 700;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 7px 9px; font-family: inherit; font-size: 12.5px;
}
.spacer { flex: 1; }

/* ---------- Modal ---------- */

#modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: none; align-items: flex-end; justify-content: center;
  padding: 12px;
}
#modal.open { display: flex; animation: fade .16s; }
@keyframes fade { from { opacity: 0; } }
#modal-body {
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2) 40%);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  padding: 20px;
  width: 100%; max-width: 470px;
  max-height: 86vh; overflow-y: auto;
  margin-bottom: 4vh;
  box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.2, .9, .3, 1);
}
@keyframes pop { from { transform: translateY(20px); opacity: 0; } }
#modal-body h3 { margin-bottom: 8px; font-size: 18px; }
#modal-body .btn-row { margin-top: 16px; }
#modal-body .btn-row .btn { flex: 1; }

.summary { text-align: center; }
.summary-emoji { font-size: 44px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.summary-grid div { background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 11px 5px; }
.summary-grid b { display: block; font-size: 17px; color: var(--green); font-weight: 800; }
.summary-grid span { font-size: 10.5px; color: var(--muted); }
.gain { font-size: 13.5px; margin: 5px 0; }
.gain b { color: var(--gold); }
.gain.lvl { font-weight: 800; color: var(--green); }

/* ---------- Toast ---------- */

#toast {
  position: fixed; left: 50%;
  bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(18px);
  background: linear-gradient(180deg, var(--green-bright), var(--green));
  color: #08130a;
  font-weight: 700; font-size: 13.5px;
  padding: 12px 20px; border-radius: 99px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200; max-width: 92vw;
  text-align: center;
  box-shadow: 0 10px 28px rgba(111, 191, 68, .32);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Accessibilité & desktop ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--green); outline-offset: 2px;
}

@media (min-width: 700px) {
  #app { padding-top: 22px; }
  .badge-grid { grid-template-columns: repeat(4, 1fr); }
  #modal { align-items: center; }
  #modal-body { margin-bottom: 0; }
  .pick-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 380px) {
  .stat-row-4 { grid-template-columns: repeat(2, 1fr); }
  .fld-row-3 { grid-template-columns: 1fr 1fr; }
  /* La barre du haut doit rester entière : on garde le logo, on cache le mot-marque */
  .brand span { display: none; }
  .topbar-inner { padding: 9px 12px; }
  .pill { padding: 4px 8px; font-size: 12px; }
  #app { padding-left: 12px; padding-right: 12px; }
  .focus { padding: 18px 15px 16px; }
  .focus-title { font-size: 21px; }
  .focus-desc { font-size: 15.5px; }
  .focus-nav .btn { font-size: 11.5px; padding: 9px 4px; }
  .recap-row > div { padding: 8px 2px; }
  .recap-row b { font-size: 15px; }
}

/* ---------- Cotations, tests, notifications, biblio d'exos ---------- */

.grade-scroll.is-couleur .grade-btn {
  padding-left: 30px; position: relative;
}
.grade-scroll.is-couleur .grade-btn::before {
  content: ""; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; border-radius: 4px;
  background: var(--gc, var(--muted));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.sys-hint { margin-top: 9px; }

.test-date {
  padding-top: 8px; margin-bottom: 10px;
  border-top: 1px solid var(--line-soft);
}
.test-cfg-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 8px; }
.test-cfg-head > div { flex: 1; min-width: 0; }
.ico-chip { font-size: 17px; padding: 5px 11px; }

.exo-lib-card .exo-lib-head { display: flex; gap: 11px; align-items: flex-start; }
.exo-lib-desc { margin-top: 9px; }

.install-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.install-row > div { flex: 1; min-width: 0; }
.install-ico { font-size: 22px; }
.notif-block { padding-top: 12px; border-top: 1px solid var(--line-soft); margin-bottom: 10px; }
.notif-opts { margin-bottom: 10px; }
.switch-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
}
.switch-row:last-of-type { border-bottom: none; }
.switch-row input { width: 22px; height: 22px; accent-color: var(--green); flex-shrink: 0; }
.switch-row span { display: flex; flex-direction: column; }
.switch-row b { font-size: 14px; }

.steps { margin: 12px 0 4px 18px; font-size: 14px; color: var(--text-2); }
.steps li { margin-bottom: 7px; }

/* ---------- Tests par grimpeur ---------- */

.info-card {
  border-left: 3px solid var(--green);
  background: linear-gradient(168deg, rgba(111, 191, 68, .06), var(--surface) 60%);
}
.info-card p + p { margin-top: 8px; }

.test-cfg.opt { border-style: dashed; opacity: .92; }
.switch-row.compact { padding: 8px 0; margin: 6px 0; border-top: 1px solid var(--line-soft); border-bottom: none; }

.chip.stale { border-color: rgba(229, 185, 90, .5); color: var(--gold); }

.test-pick { max-height: 46vh; overflow-y: auto; margin: 4px 0 6px; }
.test-pick .exo-row { margin-bottom: 6px; }
.test-pick .exo-row-mid .muted { margin-left: 0; }

/* --- Tests d'un grimpeur : lignes manipulables directement --- */
.tlist { padding: 6px 14px; }
.trow {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft);
}
.trow:last-child { border-bottom: none; }
.trow-ico { font-size: 20px; width: 26px; text-align: center; flex-shrink: 0; }
.trow-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.trow-mid b { font-size: 14.5px; }
.trow-mid .up { color: var(--green); font-weight: 700; }
.trow-mid .down { color: var(--danger); font-weight: 700; }
.trow-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; font-size: 14px;
  color: var(--text-2);
  transition: border-color .15s, background .15s, color .15s;
}
.trow-btn:hover { border-color: var(--green); }
.trow-btn.danger { color: var(--muted); font-size: 15px; }
.trow-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

.trow-edit {
  background: var(--bg-soft); border: 1px solid var(--green);
  border-radius: var(--r); padding: 14px; margin: 10px 0;
  box-shadow: 0 0 0 3px var(--green-soft);
  animation: rise .18s ease-out;
}
.trow-edit .fld:last-of-type { margin-bottom: 6px; }
.fld-row-name { grid-template-columns: 2.2fr 1fr; }
.icons-row { max-height: 76px; overflow-y: auto; margin-top: 0; }
.danger-txt { color: var(--danger); }
.btn.grow { flex: 1; }

/* ---------- Fiche grimpeur : en-tête ---------- */

.ahero {
  background:
    radial-gradient(320px 130px at 100% 0%, rgba(111, 191, 68, .1), transparent 70%),
    linear-gradient(168deg, var(--surface-3), var(--surface) 62%);
  border-color: var(--line-strong);
}
.ahero-top { display: flex; align-items: center; gap: 14px; }
.ahero-id { flex: 1; min-width: 0; }
.ahero-id h2 { font-size: 21px; margin-bottom: 3px; }
.ahero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.ahero-stats > div {
  background: var(--bg-soft); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 9px 4px; text-align: center;
}
.ahero-stats b { display: block; font-size: 14.5px; font-weight: 800; color: var(--green); }
.ahero-stats span { font-size: 10px; color: var(--muted); }
.ahero-stats .warn { border-color: rgba(229, 185, 90, .45); }
.ahero-stats .warn b { color: var(--gold); }

/* ---------- Liste des grimpeurs ---------- */

button.athlete-card {
  display: block; width: 100%; text-align: left;
  font-family: inherit; color: var(--text); cursor: pointer;
}
button.athlete-card:hover { border-color: var(--line-strong); }
button.athlete-card:active { transform: scale(.995); }
.athlete-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.athlete-name b { font-size: 15.5px; }
.athlete-go { color: var(--muted); font-size: 22px; flex-shrink: 0; line-height: 1; }
.athlete-card .bar { margin: 12px 0 0; }

/* ---------- Connexion Google, sync, création de compte ---------- */

.or-sep { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.or-sep span { font-size: 12px; color: var(--muted); font-weight: 600; }
.gbtn-wrap { display: flex; justify-content: center; min-height: 44px; }

#syncbadge { font-size: 11px; font-weight: 700; color: var(--gold); white-space: nowrap; }
#syncbadge.sync-err { padding: 3px 9px; background: var(--gold-soft); border-radius: 99px; }

.ath-top { display: flex; gap: 8px; align-items: stretch; margin-bottom: 13px; }
.ath-top .search { margin-bottom: 0; }
.ath-top .btn { flex-shrink: 0; }

body.booting #app { opacity: 0; }
body.booting::after {
  content: ""; position: fixed; inset: 0;
  background: var(--bg) url("../assets/icon-192.png") center center / 76px no-repeat;
  opacity: .9; z-index: 300;
  animation: pulseLogo 1.1s ease-in-out infinite;
}
@keyframes pulseLogo { 50% { opacity: .55; } }
