/* ============================================================
   DESIGN SYSTEM
   ============================================================ */
:root {
  --bg:        #080b12;
  --surface:   #0e1220;
  --surface2:  #141928;
  --surface3:  #1c2236;
  --border:    #232b42;
  --border2:   #2d3855;

  --accent:    #4f8ef7;
  --accent2:   #00d4c8;
  --green:     #00d68f;
  --red:       #ff4d6d;
  --orange:    #ff8c42;
  --yellow:    #ffc947;
  --purple:    #b57bee;
  --teal:      #34d399;

  --text:      #e8eeff;
  --text2:     #8896b3;
  --text3:     #7582a0;  /* 4,5:1 sur fond et surfaces (WCAG AA) ; était 2,3:1 */

  --radius:    10px;
  --shadow:    0 4px 20px rgba(0,0,0,.5);
  --glow-blue: 0 0 16px rgba(79,142,247,.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100vh;
  overflow: hidden;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15.6px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   MODE DÉMO
   ============================================================ */
.demo-banner {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--text);
  text-align: center;
  padding: 8px 16px;
  font-size: .82rem;
  border-bottom: 1px solid var(--border);
}
.demo-banner .btn-link { font-size: .82rem; font-weight: 600; }
.demo-banner.hidden { display: none; }

.tab-locked { opacity: .45; cursor: not-allowed; }
.tab-locked::after { content: "🔒"; margin-left: auto; font-size: .7rem; }

/* ============================================================
   HEADER  (fixe, 48px)
   ============================================================ */
.header {
  height: 60px;
  margin-left: 76px;
  background: rgba(8,11,18,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 100;
}
.header-inner {
  height: 100%;
  display: flex; align-items: center;
  justify-content: flex-end;
  padding: 0 24px; gap: 14px;
  position: relative;
}

.next-race-countdown {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 99px; padding: 6px 16px;
  color: var(--text); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; max-width: 60%;
  transition: border-color .15s;
}
.next-race-countdown:hover { border-color: var(--accent); }
.next-race-countdown.hidden { display: none; }
.next-race-countdown .nrc-icon { flex-shrink: 0; }
.next-race-countdown .nrc-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px;
  color: #fff; font-weight: 600;
}
.next-race-countdown .nrc-time {
  color: var(--orange); font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0;
}
@media (max-width: 900px) {
  .next-race-countdown .nrc-name { max-width: 100px; }
}
@media (max-width: 640px) {
  .next-race-countdown {
    left: 8px; transform: translateY(-50%);
    font-size: 0.72rem;
    padding: 3px 8px;
    gap: 5px;
    max-width: 45%;
  }
  .next-race-countdown .nrc-name { max-width: 80px; font-size: 0.7rem; }
  .next-race-countdown .nrc-time { font-size: 0.7rem; }
  .next-race-countdown .nrc-icon { display: none; }
}
.header-collapse-btn {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
}
body:has(.tabs.flyout-open) .sidebar-collapse-btn.header-collapse-btn,
body:has(.tabs:hover) .sidebar-collapse-btn.header-collapse-btn { transform: translateY(-50%) rotate(180deg); }


/* Layout : sidebar gauche + contenu */
.layout {
  display: flex;
  height: calc(100vh - 60px);
  position: relative;
}
.main { margin-left: 60px; }

/* Tabs (sidebar verticale) — rail étroit par défaut, toujours plein écran
   en hauteur (par-dessus le header), style Garmin Connect */
.tabs {
  display: flex; flex-direction: column; gap: 2px;
  position: fixed; top: 0; left: 0; height: 100vh;
  width: 76px; flex-shrink: 0;
  background: var(--surface2);
  border-right: 1px solid var(--border);
  padding: 2px 6px 0 14px;
  overflow-y: auto; overflow-x: hidden;
  /* Ascenseur masqué, défilement conservé : le rail fait 76 px de large, une
     barre y prend une place visible pour rien. `overflow: hidden` aurait
     supprimé la barre en emportant l'accès aux dernières entrées sur un
     écran court. */
  scrollbar-width: none;
  z-index: 250;
  transition: width .18s ease, box-shadow .18s ease;
}
.tabs::-webkit-scrollbar { width: 0; display: none; }
.tabs .tab-group-label,
.tabs .tab-soon,
.tabs .sidebar-logo-text,
.tabs .sidebar-collapse-btn { display: none; }
.tabs .tab { justify-content: center; font-size: 0; gap: 0; }

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  height: 76px; flex-shrink: 0;
  padding: 0; margin: 0 0 4px -10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon { height: 56px; width: auto; max-width: 70px; flex-shrink: 0; object-fit: contain; }
.sidebar-logo-text {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em;
  color: var(--text); white-space: nowrap;
}

/* Flyout : le rail s'élargit par-dessus le contenu et le header, ouvert au
   clic (.flyout-open) OU au survol du rail, comme Garmin Connect. */
.tabs.flyout-open,
.tabs:hover {
  width: 220px; z-index: 300;
  box-shadow: var(--shadow);
}
.tabs.flyout-open .tab-group-label,
.tabs.flyout-open .tab-soon,
.tabs.flyout-open .sidebar-logo-text,
.tabs:hover .tab-group-label,
.tabs:hover .tab-soon,
.tabs:hover .sidebar-logo-text { display: block; }
.tabs.flyout-open .sidebar-collapse-btn,
.tabs:hover .sidebar-collapse-btn { display: flex; margin-left: auto; }
.tabs.flyout-open .tab,
.tabs:hover .tab { justify-content: flex-start; font-size: 0.9rem; gap: 10px; }

.sidebar-collapse-btn {
  width: 26px; height: 26px; flex-shrink: 0;
  background: transparent; color: var(--text2);
  border: 1px solid var(--border2); border-radius: 50%;
  font-size: 0.9rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s, transform .18s ease;
}
.sidebar-collapse-btn:hover { color: var(--text); border-color: var(--accent); }
body:has(.tabs.flyout-open) .sidebar-collapse-btn,
body:has(.tabs:hover) .sidebar-collapse-btn { transform: rotate(180deg); }

.tab {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text2);
  border: none; border-radius: 7px;
  padding: 9px 10px;
  font-size: 0.9rem; font-weight: 500;
  cursor: pointer;
  transition: color .15s, background .15s;
  white-space: nowrap;
  text-align: left;
}
.tab:hover  { color: var(--text); background: var(--surface3); }
/* Sous-entrées d'un onglet qui en propose plusieurs (Entraînements). Décalées
   et un cran plus discrètes : elles mènent au même écran que l'entrée
   au-dessus, les mettre sur le même plan laisserait croire à trois onglets. */
.tab-sub {
  margin-left: 14px; padding-left: 8px; font-size: .84rem;
  border-left: 1px solid var(--border);
  border-radius: 0 7px 7px 0;
}
.tab-sub .tab-icon { font-size: .9em; }
.tab.active {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff; font-weight: 600;
  box-shadow: var(--glow-blue);
}
.tab.active::before {
  content: "";
  position: absolute; left: -10px; top: 5px; bottom: 5px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), var(--purple));
}
.tab-icon { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
.tab-group-label {
  font-size: 0.68rem; font-weight: 700;
  color: var(--text3); text-transform: uppercase; letter-spacing: .12em;
  padding: 12px 10px 4px;
}
.tab-group-label:first-child { padding-top: 2px; }
.tab-soon {
  margin-left: auto;
  font-size: 0.55rem; font-weight: 700;
  color: var(--text3); background: var(--surface3);
  border-radius: 99px; padding: 1px 6px;
  text-transform: uppercase; letter-spacing: .05em;
}
.tab.active .tab-soon { color: #fff; background: rgba(255,255,255,.18); }

.header-user-wrap {
  position: relative;
  padding-left: 8px; margin-left: 4px;
  border-left: 1px solid var(--border);
}
.header-user {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: none; cursor: pointer;
  padding: 4px; border-radius: 8px;
  transition: background .15s;
}
.header-user:hover { background: var(--surface2); }
.header-user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 160px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 10px; padding: 6px;
  box-shadow: var(--shadow);
  z-index: 400;
}
.header-user-menu.hidden { display: none; }
.header-user-menu-item {
  display: block; width: 100%; text-align: left;
  background: transparent; color: var(--text); border: none;
  border-radius: 6px; padding: 9px 11px;
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  transition: background .15s;
}
.header-user-menu-item:hover { background: var(--surface3); }
.header-user-menu-tag {
  padding: 6px 10px 10px; font-size: 0.8rem; font-weight: 600;
  color: var(--text3); border-bottom: 1px solid var(--border);
  margin-bottom: 4px; word-break: break-all;
}
.sidebar-avatar {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--purple));
  color: #fff; font-size: 0.95rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-user-block {
  display: flex; flex-direction: column; flex: 1; min-width: 0;
}
.sidebar-user-name {
  font-size: 0.88rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 140px;
}
.sidebar-user-role {
  font-size: 0.74rem; color: var(--text2);
}

.header-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

/* LED liaison Garmin + horodatage sync */
.garmin-status {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 99px; padding: 6px 12px;
}
.led {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.led-green { background: var(--green); box-shadow: 0 0 6px rgba(0,214,143,.7); }
.led-red   { background: var(--red);   box-shadow: 0 0 6px rgba(255,77,109,.7); }
.led-pulse { animation: ledPulse 1s ease-in-out infinite; }
@keyframes ledPulse { 50% { opacity: .3; } }
.sync-time { font-size: 0.76rem; color: var(--text2); white-space: nowrap; }

.btn-sync {
  height: 36px; padding: 0 14px;
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  transition: color .15s, border-color .15s; flex-shrink: 0;
  white-space: nowrap;
}
.btn-sync:hover    { color: var(--accent2); border-color: var(--accent2); }
.btn-sync:disabled { opacity: .4; cursor: not-allowed; }
.btn-refresh, .btn-logout {
  width: 36px; height: 36px;
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 1.15rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s; flex-shrink: 0;
}
.btn-refresh:hover  { color: var(--text); border-color: var(--accent); }
.btn-refresh:disabled { opacity: .4; cursor: not-allowed; }
.btn-logout:hover   { color: var(--red); border-color: var(--red); }

.notif-wrap { position: relative; }
.notif-dot {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px;
  background: var(--red); border: 2px solid var(--surface2); color: #fff;
  font-size: 0.65rem; font-weight: 700; line-height: 12px; text-align: center;
}
.notif-dot.hidden { display: none; }
.notif-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 280px; max-width: 320px; max-height: 360px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 10px; padding: 10px;
  box-shadow: var(--shadow);
  z-index: 400;
}
.notif-menu.hidden { display: none; }
.notif-menu-title {
  font-size: 0.78rem; font-weight: 700; margin-bottom: 8px;
}
.notif-list { display: flex; flex-direction: column; gap: 4px; }
.notif-item {
  font-size: 0.8rem; padding: 8px; border-radius: 8px;
  background: var(--surface2);
}
.notif-item-unread { background: rgba(90,124,255,.12); }
.notif-item-actions { display: flex; gap: 6px; margin-top: 6px; }

/* ============================================================
   LOGIN OVERLAY
   ============================================================ */
.login-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow: hidden;
}
.login-overlay.hidden { display: none; }
.login-overlay::before {
  content: ""; position: absolute; inset: -30px;
  background-image: var(--login-bg-image);
  background-size: cover; background-position: center;
  filter: blur(40px); transform: scale(1.1);
}
.login-overlay::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(8,11,18,.65);
}

.login-stage {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  --box-h: min(88vh, 720px);
}

.login-hero {
  width: auto;
  height: min(60vh, 480px);
  object-fit: cover;
  display: none;
  position: relative; left: 25px;
  border-radius: 18px;
}
@media (min-width: 760px) {
  .login-hero { display: block; }
}

.login-card {
  position: relative; z-index: 1;
  margin-left: -5px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 40px 36px;
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  scrollbar-gutter: stable;
}
@media (min-width: 760px) {
  .login-card { width: 380px; height: var(--box-h); overflow-y: auto; }
}

/* ============================================================
   MAINTENANCE OVERLAY
   ============================================================ */
.maint-card {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 40px;
  max-width: 480px; width: 100%;
  text-align: center;
}
.maint-icon-wrap {
  width: 72px; height: 72px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 32px; font-size: 2rem;
}
.maint-gear { display: inline-block; animation: maint-spin 6s linear infinite; }
@keyframes maint-spin { to { transform: rotate(360deg); } }
.maint-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 12px; letter-spacing: -.01em; }
.maint-subtitle { font-size: .95rem; color: var(--text2); line-height: 1.7; margin-bottom: 32px; }
.maint-progress-wrap {
  background: var(--bg); border: 1px solid var(--border); border-radius: 99px;
  height: 4px; overflow: hidden; margin-bottom: 32px;
}
.maint-progress-bar {
  height: 100%; background: var(--accent); border-radius: 99px; width: 0%;
  animation: maint-progress 8s ease-in-out infinite;
}
@keyframes maint-progress {
  0%   { width: 0%;   opacity: 1; }
  70%  { width: 85%;  opacity: 1; }
  90%  { width: 92%;  opacity: 1; }
  100% { width: 100%; opacity: 0; }
}
.maint-status-bar {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px 20px; display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; text-align: left;
}
.maint-status-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  flex-shrink: 0; box-shadow: 0 0 8px var(--accent);
  animation: maint-pulse 2s ease-in-out infinite;
}
@keyframes maint-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.maint-status-text { font-size: .82rem; color: var(--text2); }
.maint-status-text strong { color: var(--accent); font-weight: 600; }
.maint-divider { border: none; border-top: 1px solid var(--border); margin: 0 0 24px; }
.maint-footer-text { font-size: .78rem; color: var(--text2); }

.login-logo {
  width: 140px; height: 140px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.login-logo-img {
  width: 100%; height: 100%; object-fit: contain; border-radius: 12px;
}

.brand-hunter { color: var(--orange); }

.login-title {
  font-size: 1.25rem; font-weight: 800;
  letter-spacing: -.03em; text-align: center;
}
.login-subtitle {
  font-size: 0.78rem; color: var(--text2);
  text-align: center; line-height: 1.5;
  margin-top: -10px;
}

#providerChoiceStep .login-subtitle { margin-top: 8px; }

.login-form {
  width: 100%;
  display: flex; flex-direction: column; gap: 12px;
}
.login-field {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.login-field label {
  font-size: 0.72rem; font-weight: 600;
  color: var(--text2); text-transform: uppercase; letter-spacing: .07em;
  text-align: center; width: 100%;
}
.login-field input {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 14px; font-size: 0.88rem;
  outline: none; width: 100%;
  transition: border-color .15s;
}

.pw-requirements {
  list-style: none; display: flex; flex-wrap: wrap; gap: 4px 10px;
  margin: 2px 0 0; padding: 0;
}
.pw-requirements li {
  font-size: 0.7rem; color: var(--text2);
}
.pw-requirements li::before { content: "○ "; }
.pw-requirements li.ok { color: var(--green); }
.pw-requirements li.ok::before { content: "✓ "; }
.login-field input:focus  { border-color: var(--accent); }
.login-field input::placeholder { color: var(--text3); }

.btn-login {
  width: 100%; padding: 11px;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #fff; border: none; border-radius: 9px;
  font-size: 0.9rem; font-weight: 700; cursor: pointer;
  transition: opacity .15s, transform .1s;
  margin-top: 4px;
}
.btn-login-danger {
  background: var(--red); margin-top: 8px;
}
.btn-login:hover    { opacity: .92; }
.btn-login:active   { transform: scale(.98); }
.btn-login:disabled { opacity: .5; cursor: not-allowed; }

.login-error {
  width: 100%; padding: 10px 14px;
  background: rgba(255,77,109,.1); border: 1px solid rgba(255,77,109,.35);
  border-radius: 8px; color: var(--red);
  font-size: 0.78rem; text-align: center;
}

/* Garmin connect overlay reuses login-card styles */
#garminOverlay.hidden { display: none; }
.garmin-consent-box {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin: 12px 0 18px;
  text-align: left;
}
.garmin-consent-box p {
  font-size: 0.82rem; color: var(--text2); margin: 0 0 8px;
  line-height: 1.5;
}
.garmin-consent-box p:last-child { margin-bottom: 0; }
.btn-link {
  background: none; border: none; color: var(--text2);
  font-size: 0.82rem; cursor: pointer; margin-top: 8px;
  text-decoration: underline;
}
.btn-link:hover { color: var(--text); }
.btn-link-forgot { font-size: 0.74rem; margin-top: 2px; }
.btn-link-demo {
  display: block; margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Dashboard wrapper */
#dashboard { height: 100vh; display: flex; flex-direction: column; }
#dashboard.hidden { display: none; }

/* ============================================================
   MAIN  (remplit exactement l'espace restant)
   ============================================================ */
.main {
  flex: 1; min-width: 0;
  height: 100%;
  padding: 12px 16px;
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* Chaque onglet remplit le conteneur */
.tab-content {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 8px;
  overflow: hidden;
  position: relative;
}
.tab-content.hidden { display: none; }

#tab-today, #tab-stats, #tab-workouts, #tab-records, #tab-gear, #tab-friends {
  max-width: 1200px; width: 100%; margin: 0 auto;
}

#adminSectionAccounts {
  max-width: 1150px; margin: 0 auto; width: 100%;
}
#adminSectionIntegration, #adminSectionModeration,
#adminSectionDashboard, #adminSectionAudit, #adminSectionSettings {
  max-width: 1000px; margin: 0 auto; width: 100%;
}

/* ============================================================
   PERIOD NAV
   ============================================================ */
.period-nav {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.btn-nav {
  width: 28px; height: 28px;
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border); border-radius: 7px;
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.btn-nav:hover { color: var(--text); border-color: var(--accent); }
.period-label { font-size: 0.88rem; font-weight: 600; }

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-title {
  font-size: 0.65rem; font-weight: 600;
  color: var(--text3); text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 0; flex-shrink: 0;
}

/* ============================================================
   TODAY
   ============================================================ */
#tab-today { overflow-y: auto; }
#tab-today::-webkit-scrollbar { width: 4px; }
.today-hero-img {
  display: none;
  width: 100%; height: 180px; object-fit: cover; object-position: center 30%;
  border-radius: var(--radius); margin-bottom: 12px; flex-shrink: 0;
}
#tab-today::-webkit-scrollbar-track { background: transparent; }
#tab-today::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.today-date {
  font-size: 0.72rem; color: var(--text3);
  text-transform: capitalize; letter-spacing: .03em; flex-shrink: 0;
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  flex-shrink: 0;
}

.d-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 5px;
  transition: border-color .2s;
}
.d-card:hover { border-color: var(--border2); }
.d-card-wide { grid-column: span 2; }

.d-card-top { display: flex; align-items: center; gap: 6px; }
.d-card-icon {
  font-size: 0.9rem;
  width: 26px; height: 26px;
  background: var(--surface2); border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.d-card-label {
  font-size: 0.63rem; font-weight: 600;
  color: var(--text2); text-transform: uppercase; letter-spacing: .07em;
}
.d-card-value {
  font-size: 1.4rem; font-weight: 800;
  line-height: 1; letter-spacing: -.03em;
}
.d-card-sub { font-size: 0.68rem; color: var(--text2); }

/* Status pills */
.status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.67rem; font-weight: 600;
  padding: 2px 8px; border-radius: 99px;
}
.status-good    { background: rgba(0,214,143,.12); color: var(--green);  border: 1px solid rgba(0,214,143,.22); }
.status-warn    { background: rgba(255,201,71,.12); color: var(--yellow); border: 1px solid rgba(255,201,71,.22); }
.status-bad     { background: rgba(255,77,109,.12); color: var(--red);   border: 1px solid rgba(255,77,109,.22); }
.status-neutral { background: var(--surface2);      color: var(--text2); border: 1px solid var(--border); }

/* Progress bars */
.progress-bar {
  height: 4px; background: var(--surface3);
  border-radius: 99px; overflow: hidden; margin-top: 2px;
}
.progress-fill {
  height: 100%; border-radius: 99px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* Advice box */
.advice-box {
  border-radius: var(--radius); padding: 8px 14px;
  font-size: 0.78rem; line-height: 1.5;
  border: 1px solid; flex-shrink: 0;
}
.advice-box.hidden { display: none !important; }
.advice-box       { background: rgba(79,142,247,.07); border-color: rgba(79,142,247,.3); }
.advice-box.warn  { background: rgba(255,201,71,.07); border-color: rgba(255,201,71,.3); }
.advice-box.alert { background: rgba(255,77,109,.07); border-color: rgba(255,77,109,.3); }

/* Last activity in today tab */
#lastActTitle { flex-shrink: 0; }
/* La carte du jour occupait exactement la place restante, en `overflow:
   hidden` : le tableau de bord tenait ainsi en un ecran. L'equilibre a tenu
   tant que le haut ne grossissait pas — les anneaux l'ont rompu, et la carte
   se faisait rogner. Une page qui ne tient plus doit defiler (`#tab-today`
   le prevoit deja), pas amputer son dernier bloc. */
#lastActivityGrid { flex: 1 0 auto; min-height: 190px; }
#lastActivityGrid .act-card { height: auto; min-height: 100%; }

/* ============================================================
   RUNNER / MONTH METRIC GRID
   ============================================================ */
.runner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px; flex-shrink: 0;
}
.month-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px; flex-shrink: 0;
}
.r-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .2s;
}
.r-card:hover { border-color: var(--border2); }
.r-card-clickable { cursor: pointer; }
.r-card-clickable:hover { border-color: var(--accent); transform: translateY(-1px); }
.r-card-icon  { font-size: 1rem; }
.r-card-value { font-size: 1.25rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.r-card-label { font-size: 0.62rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .07em; }
.r-card-sub   { font-size: 0.68rem; color: var(--text2); }

/* ============================================================
   CHARTS
   ============================================================ */
.charts-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px; flex-shrink: 0;
}
.chart-block { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.chart-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px; height: 160px;
}
.chart-wrapper canvas { height: 100% !important; }

/* Week activities: scrollable remainder */
.week-acts-wrap {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 6px;
  overflow: hidden;
}
#weekActivitiesGrid {
  flex: 1; min-height: 0;
  overflow-y: auto;
}
#weekActivitiesGrid::-webkit-scrollbar { width: 4px; }
#weekActivitiesGrid::-webkit-scrollbar-track { background: transparent; }
#weekActivitiesGrid::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ============================================================
   ACTIVITIES TAB
   ============================================================ */
.acts-toolbar {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.filter-select {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 4px 8px; font-size: 0.76rem; cursor: pointer; outline: none;
  transition: border-color .15s;
}
.filter-select:focus, .filter-select.active { border-color: var(--accent); }
/* La recherche prend la place libre : c'est le filtre le plus utilisé. */
.filter-search { flex: 1 1 220px; min-width: 0; cursor: text; }
.btn-reset {
  background: transparent; color: var(--text2);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 4px 10px; font-size: 0.76rem; cursor: pointer;
  transition: color .15s, border-color .15s; white-space: nowrap;
}
.btn-reset:hover { color: var(--text); border-color: var(--text2); }

.activities-header { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.activities-count {
  font-size: 0.68rem; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 99px;
  padding: 1px 8px; color: var(--text2);
}

/* Scrollable activities area */
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 8px; align-content: start;
}
#activitiesGrid {
  flex: 1; min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 8px; align-content: start;
}
#activitiesGrid::-webkit-scrollbar { width: 4px; }
#activitiesGrid::-webkit-scrollbar-track { background: transparent; }
#activitiesGrid::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.act-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  position: relative;
}
/* L'onglet Activités affiche tout l'historique (~1100 cartes) : les cartes
   hors écran ne coûtent plus de rendu. Limité à cette liste, car le
   confinement de peinture couperait ce qui déborde d'une carte ailleurs. */
#activitiesGrid .act-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 132px;
}
.act-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: var(--radius) 0 0 var(--radius);
  opacity: 0; transition: opacity .2s;
}
.act-card:hover { border-color: var(--border2); box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.act-card:hover::before { opacity: 1; }

/* Header */
.act-header { display: flex; align-items: center; gap: 10px; }
.act-icon {
  font-size: 1.2rem;
  width: 36px; height: 36px;
  background: var(--surface2); border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 1px solid var(--border);
}
.act-title-block { flex: 1; min-width: 0; }
.act-name {
  font-size: 0.85rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.act-date { font-size: 0.68rem; color: var(--text2); margin-top: 2px; }

/* Activity stats line */
.act-stats-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  font-size: 0.82rem; font-weight: 600;
}
.acs-dist  { color: var(--accent2); font-size: 1.15rem; font-weight: 800; line-height: 1; }
.acs-dur   { color: var(--green); }
.acs-pace  { color: var(--orange); }
.acs-extra { color: var(--text2); font-weight: 500; }
.acs-sep   { color: var(--text3); font-size: 0.7rem; }

/* Training effect pill */
.act-te-row { display: flex; }
.act-te-pill {
  font-size: 0.65rem; font-weight: 600;
  padding: 2px 10px; border-radius: 99px;
  background: rgba(181,123,238,.12); color: var(--purple);
  border: 1px solid rgba(181,123,238,.25);
}

.badge {
  font-size: 0.6rem; padding: 2px 6px;
  border-radius: 99px;
  background: var(--accent); color: #fff;
  font-weight: 600; line-height: 1.4;
}
.tab-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tab-new-badge {
  font-size: .55rem; font-weight: 800; letter-spacing: .06em;
  padding: 2px 5px; border-radius: 99px;
  background: #f5c400; color: #1a1000;
  flex-shrink: 0; align-self: center;
}
#progNavBadge { position: absolute; top: -5px; right: 2px; }

/* ============================================================
   COMPARE  (layout 2 colonnes)
   ============================================================ */
.cmp-layout {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 12px;
  overflow: hidden;
}
.cmp-left {
  display: flex; flex-direction: column; gap: 6px;
  overflow: hidden; min-height: 0;
}
.cmp-right {
  display: flex; flex-direction: column; gap: 6px;
  overflow: hidden; min-height: 0;
}
.cmp-right .chart-wrapper {
  flex: 1; height: 0; min-height: 200px; position: relative;
}

/* En-tête colonnes */
.cmp-header {
  display: grid; grid-template-columns: 1fr 90px 1fr;
  gap: 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cmp-col-label {
  font-size: 0.7rem; font-weight: 600; color: var(--text2); text-align: center;
}
.cmp-col-label.current { color: var(--accent2); }

/* Grille de cartes scrollable */
.cmp-grid {
  flex: 1; min-height: 0;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 5px;
}
.cmp-grid::-webkit-scrollbar { width: 4px; }
.cmp-grid::-webkit-scrollbar-track { background: transparent; }
.cmp-grid::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.cmp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  display: grid;
  grid-template-columns: 1fr 90px 1fr;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  transition: border-color .2s;
}
.cmp-card:hover { border-color: var(--border2); }

.cmp-val-block {
  display: flex; flex-direction: column; gap: 4px;
}
.cmp-val-block:last-child { align-items: flex-end; }

.cmp-val {
  font-size: 1rem; font-weight: 800;
  letter-spacing: -.02em; line-height: 1;
}
.cmp-val.current-val { color: var(--accent2); }
.cmp-val.prev-val    { color: var(--text2); }

.cmp-bar-row {
  width: 100%; height: 3px;
  background: var(--surface3); border-radius: 99px; overflow: hidden;
}
.cmp-bar-fill { height: 100%; border-radius: 99px; transition: width .5s ease; }

.cmp-metric-info {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.cmp-metric-icon { font-size: 0.85rem; }
.cmp-metric-name {
  font-size: 0.6rem; font-weight: 600;
  color: var(--text2); text-transform: uppercase;
  letter-spacing: .07em; text-align: center;
}
.delta-pill {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
}
.delta-up   { background: rgba(0,214,143,.13); color: var(--green); }
.delta-down { background: rgba(255,77,109,.13); color: var(--red); }
.delta-eq   { background: var(--surface2); color: var(--text2); }

/* ============================================================
   DRAWER  (panneau latéral détail activité)
   ============================================================ */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }

/* ============================================================
   CENTER MODAL (fenêtre centrée, ex : fiche course Agenda)
   ============================================================ */
.center-modal-overlay {
  position: fixed; inset: 0; z-index: 320;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.center-modal-overlay.hidden { display: none; }
.center-modal-card {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 14px; box-shadow: 0 24px 80px rgba(0,0,0,.6);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  padding: 24px;
}
.center-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.center-modal-close {
  background: transparent; border: none; color: var(--text2);
  font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 4px;
}
.center-modal-close:hover { color: var(--text); }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px; max-width: 95vw; z-index: 301;
  background: var(--surface);
  border-left: 1px solid var(--border2);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  /* Fermé, le tiroir n'existe ni à l'œil ni au clavier : son ombre débordait
     sur le bord droit de toutes les pages, et Tab entrait dedans. La
     visibilité bascule après la glissade, pour qu'elle reste visible. */
  visibility: hidden;
  transition: transform .28s cubic-bezier(.4,0,.2,1), visibility 0s linear .28s;
  box-shadow: -8px 0 40px rgba(0,0,0,.5);
}
.drawer.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .28s cubic-bezier(.4,0,.2,1), visibility 0s;
}

.drawer-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-icon {
  font-size: 1.4rem; width: 42px; height: 42px;
  background: var(--surface2); border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); flex-shrink: 0;
}
.drawer-title-block { flex: 1; min-width: 0; }
.drawer-title { font-size: 0.95rem; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 6px; }
.drawer-date  { font-size: 0.7rem; color: var(--text2); margin-top: 2px; }

.drawer-title-edit, .drawer-title-save, .drawer-title-cancel {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 0.8rem; padding: 2px 4px; line-height: 1; flex-shrink: 0;
  transition: color .15s;
}
.drawer-title-edit:hover, .drawer-title-save:hover { color: var(--accent); }
.drawer-title-cancel:hover { color: var(--red); }

.drawer-title-input {
  font-size: 0.95rem; font-weight: 700; letter-spacing: -.02em;
  background: var(--surface2); color: var(--text); border: 1px solid var(--border2);
  border-radius: 6px; padding: 3px 8px; min-width: 0; flex: 1;
}
.drawer-title-input:focus { outline: none; border-color: var(--accent); }

.drawer-close {
  width: 28px; height: 28px; flex-shrink: 0;
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.85rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.drawer-close:hover { color: var(--text); border-color: var(--accent); }

.drawer-body {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 16px;
}
.drawer-body::-webkit-scrollbar { width: 4px; }
.drawer-body::-webkit-scrollbar-track { background: transparent; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.drawer-section-title {
  font-size: 0.62rem; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 8px;
}

/* Grille de métriques principale (3 colonnes) */
.drawer-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.drawer-metric {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.drawer-metric-val {
  font-size: 1rem; font-weight: 800;
  line-height: 1; letter-spacing: -.02em;
}
.drawer-metric-lbl {
  font-size: 0.58rem; color: var(--text2);
  text-transform: uppercase; letter-spacing: .07em;
}

/* Stats secondaires en ligne */
.drawer-row-stats {
  display: flex; flex-direction: column; gap: 6px;
}
.drawer-stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px;
  background: var(--surface2); border-radius: 8px;
  border: 1px solid var(--border);
}
.drawer-stat-label { font-size: 0.75rem; color: var(--text2); }
.drawer-stat-value { font-size: 0.82rem; font-weight: 700; }

/* ============================================================
   SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--radius); min-height: 60px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ============================================================
   MISC
   ============================================================ */
/* Vues internes onglet Stats (Semaine / Mois) */
.stats-view {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 8px;
  overflow: hidden;
}
.stats-view.hidden { display: none; }
.stats-toggle { margin-right: 8px; }

/* Carte "bientôt" (onglets phase 2/3) */
.soon-card {
  margin: auto;
  max-width: 420px; text-align: center;
  background: var(--surface); border: 1px dashed var(--border2);
  border-radius: 16px; padding: 40px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.soon-icon  { font-size: 2.2rem; }
.soon-title { font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; }
.soon-desc  { font-size: 0.8rem; color: var(--text2); line-height: 1.6; }

.error-banner {
  background: rgba(255,77,109,.08); border: 1px solid rgba(255,77,109,.3);
  color: var(--red); border-radius: var(--radius); padding: 10px 14px; font-size: .8rem;
}
.empty-state {
  text-align: center; padding: 30px 20px;
  color: var(--text3); font-size: 0.82rem; grid-column: 1/-1;
}
.hidden { display: none !important; }

/* ============================================================
   WORKOUTS TAB
   ============================================================ */
.wk-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.btn-new-workout {
  background: var(--accent); color: #fff;
  border: none; border-radius: 8px;
  padding: 6px 14px; font-size: 0.82rem; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
}
.btn-new-workout:hover { opacity: .85; }

.workouts-list {
  flex: 1; min-height: 0;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.workouts-list::-webkit-scrollbar { width: 4px; }
.workouts-list::-webkit-scrollbar-track { background: transparent; }
.workouts-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.wk-bulk-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 14px; margin-bottom: 8px;
  gap: 12px;
}
.wk-bulk-bar.hidden { display: none; }
.wk-select-all-label { display: flex; align-items: center; gap: 8px; font-size: .85rem; cursor: pointer; }
.btn-wk-bulk-delete {
  background: #e53e3e; color: #fff; border: none; border-radius: 6px;
  padding: 6px 14px; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.btn-wk-bulk-delete:hover { background: #c53030; }
.wk-cb { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }

.wk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  transition: border-color .15s;
}
.wk-card:hover { border-color: var(--border2); }
.wk-card-icon {
  font-size: 1.3rem; width: 40px; height: 40px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wk-card-body { flex: 1; min-width: 0; }
.wk-card-name {
  font-size: 0.9rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wk-card-meta {
  font-size: 0.72rem; color: var(--text2); margin-top: 2px;
}
.wk-card-actions {
  display: flex; gap: 6px; flex-shrink: 0;
}
.btn-wk-action {
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 4px 10px; font-size: 0.72rem; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.btn-wk-action:hover { color: var(--text); border-color: var(--text2); }
.btn-wk-action.danger:hover { color: var(--red); border-color: var(--red); }
.btn-wk-action:disabled { opacity: .5; cursor: not-allowed; }

.app-connections { display: flex; flex-direction: column; gap: 10px; }
.app-connection-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.app-connection-disabled { opacity: .55; }
.app-connection-info { display: flex; align-items: center; gap: 12px; }
.app-connection-icon-slot {
  width: 48px; height: 48px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.app-connection-icon {
  width: 32px; height: 32px; object-fit: contain;
  border-radius: 6px;
}
.app-connection-icon-lg { width: 48px; height: 48px; }
.app-connection-name { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.app-connection-status { font-size: 0.76rem; color: var(--text2); }
.app-connection-text-raise { margin-top: -16px; }
.app-connection-info-shift { position: relative; top: 2px; }

.provider-choice-list {
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; margin: 8px 0 16px;
}
.provider-choice-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; font-size: 0.92rem; font-weight: 600;
  cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s;
}
.provider-choice-btn:hover { border-color: var(--accent); background: var(--surface3); }
.provider-choice-btn:disabled { opacity: .5; cursor: not-allowed; }
.provider-choice-btn:disabled:hover { border-color: var(--border); background: var(--surface2); }
.provider-choice-icon { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; border-radius: 6px; }
.provider-choice-btn em { font-style: normal; font-size: 0.72rem; color: var(--text2); font-weight: 500; }

/* Workout panel (wider than activity drawer) */
.wk-panel { width: 460px; }

/* Form elements */
.mobile-only { display: none; }
.profile-back-btn {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 0.95rem; font-weight: 600;
  padding: 6px 0 10px; text-align: left; align-self: flex-start;
}
.profile-back-btn:hover { opacity: 0.75; }
.settings-tab { gap: 16px; overflow-y: auto; align-items: center; }
.settings-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 12px;
}
.settings-card .login-form { gap: 10px; }

.profile-card { flex-direction: row; align-items: center; gap: 14px; }
.profile-avatar { width: 48px; height: 48px; font-size: 1.1rem; }
.profile-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-name { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.profile-email { font-size: 0.8rem; color: var(--text2); }
.profile-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.profile-row:last-child { border-bottom: none; padding-bottom: 0; }
.profile-row-label { font-size: 0.78rem; color: var(--text2); }
.profile-row-value { font-size: 0.82rem; font-weight: 600; color: var(--text); }

.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.avatar-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 10px;
}
.avatar-pick {
  position: relative;
  width: 56px; height: 56px; padding: 0; border-radius: 50%;
  border: 2px solid transparent; background: var(--surface3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: var(--text2);
  transition: border-color .15s;
}
.avatar-pick > img:not(.avatar-zoom) {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.avatar-pick:hover  { border-color: var(--border2); }
.avatar-pick.active { border-color: var(--accent); }
.avatar-pick-none { background: var(--surface2); }

/* Aperçu grand format au survol (l'avatar entier, non recadré) */
.avatar-zoom {
  display: none;
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%);
  width: 160px; height: 160px; object-fit: contain;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 12px; padding: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  pointer-events: none; z-index: 60;
}
.avatar-pick:hover .avatar-zoom { display: block; }

.wk-steps-preview {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 16px;
}
.wk-steps-preview-title {
  font-size: 0.68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text2); margin-bottom: 6px;
}
.wk-steps-line {
  font-size: 0.8rem; color: var(--text); font-variant-numeric: tabular-nums;
  padding: 2px 0; white-space: pre;
}
.wk-steps-line.muted { color: var(--text2); font-style: italic; white-space: normal; }

.wk-field { display: flex; flex-direction: column; gap: 4px; }
.wk-label { font-size: 0.72rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; }
.wk-input {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 0.85rem; outline: none;
  transition: border-color .15s; width: 100%;
}
.wk-input:focus { border-color: var(--accent); }
.wk-select {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 0.85rem; outline: none;
  cursor: pointer; width: 100%;
}
.wk-row { display: flex; gap: 8px; align-items: flex-end; }
.wk-mode-toggle {
  display: flex; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 3px; gap: 3px; flex-shrink: 0;
}
.wk-mode-btn {
  flex: 1; padding: 5px 0; border-radius: 7px;
  border: none; background: transparent; color: var(--text2);
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s;
}
.wk-mode-btn.active { background: var(--accent); color: #fff; }
.wk-section-hdr {
  font-size: 0.72rem; font-weight: 700; color: var(--accent2);
  text-transform: uppercase; letter-spacing: .07em;
  margin: 12px 0 6px;
}
.wk-target-block { display: flex; flex-direction: column; gap: 6px; }
.wk-target-block.hidden { display: none; }
.wk-error {
  background: rgba(255,77,109,.1); border: 1px solid rgba(255,77,109,.3);
  color: var(--red); border-radius: 8px; padding: 8px 12px;
  font-size: 0.8rem;
}
.wk-success {
  background: color-mix(in srgb, var(--green) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--green) 30%, transparent);
  color: var(--green); border-radius: 8px; padding: 8px 12px;
  font-size: 0.8rem;
}
.wk-success.hidden { display: none; }
.wk-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn-wk-save {
  flex: 1; background: var(--accent); color: #fff;
  border: none; border-radius: 8px;
  padding: 10px; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
}
.btn-wk-save:hover { opacity: .85; }
.btn-wk-delete {
  background: rgba(255,77,109,.1); color: var(--red);
  border: 1px solid rgba(255,77,109,.3); border-radius: 8px;
  padding: 10px 16px; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn-wk-delete:hover { background: rgba(255,77,109,.2); }

/* Schedule modal inside panel */
.wk-schedule-row {
  display: flex; gap: 8px; align-items: flex-end;
}

/* skeleton */
.wk-card.skeleton { height: 64px; }

/* Programs schedule form */
.programs-schedule-form {
  display: flex; flex-direction: column; gap: 14px;
  /* max-width appliqué uniquement aux champs de saisie, pas au dist-picker */
}
.programs-schedule-form > *:not(.dist-picker):not(#distPickerView):not(#distProgramsView) {
  max-width: 480px;
}
.days-picker {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.day-btn {
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text2); font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.day-btn.selected {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.prog-info-box {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  font-size: 0.78rem; color: var(--text2); line-height: 1.6;
}
.prog-info-box strong { color: var(--text); }

/* Program tiles grouped by distance */
/* Vues distance */
#distPickerView { width: 100%; }
#distProgramsView { width: 100%; display: flex; flex-direction: column; gap: 14px; }

/* Bouton retour vue programmes → picker */
.btn-dist-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1px solid #e74c3c;
  border-radius: 8px; padding: 6px 14px;
  color: #e74c3c; font-size: .85rem; font-weight: 600;
  cursor: pointer; margin-bottom: 16px;
  transition: background .15s, color .15s;
}
.btn-dist-back:hover { background: #e74c3c; color: #fff; }

/* Distance picker */
.dist-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.dist-card {
  position: relative; overflow: hidden;
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer; padding: 0;
  background: #0d0d12;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.dist-card img {
  display: block; width: 100%; aspect-ratio: 4/3;
  object-fit: contain;
}
.dist-card span {
  display: block; text-align: center;
  font-size: .85rem; font-weight: 700;
  padding: 8px 4px;
  color: var(--text);
}
.dist-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 3px var(--accent), 0 12px 32px rgba(0,0,0,.45);
  border-color: var(--accent);
}
.dist-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent);
}

/* Layout 2 colonnes : tuiles gauche / détail droite */
.prog-layout {
  display: grid;
  grid-template-columns: minmax(220px, 35%) 1fr;
  gap: 16px;
  align-items: start;
  width: 100%;
}
.prog-placeholder { color: var(--text3); font-size: .88rem; padding: 24px 0; }
.prog-layout-left {
  display: flex; flex-direction: column; gap: 0;
  max-height: 70vh; overflow-y: auto;
}
.prog-layout-right {
  display: flex; flex-direction: column; gap: 14px;
  max-height: 70vh; overflow-y: auto;
}

/* Nouvelles tuiles flat (liste verticale) */
.prog-tiles-list { display: flex; flex-direction: column; }
.prog-tile2 {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  cursor: pointer; background: var(--surface2);
  user-select: none; -webkit-user-select: none;
  border: none; border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  padding: 11px 14px; color: var(--text);
  transition: background .12s, border-color .12s;
  width: 100%;
}
.prog-tile2:first-child { border-radius: 8px 8px 0 0; }
.prog-tile2:last-child  { border-radius: 0 0 8px 8px; border-bottom: none; }
.prog-tile2:hover { background: var(--surface3); border-left-color: var(--accent); }
.prog-tile2.selected { background: var(--surface3); border-left-color: var(--accent); }
.prog-tile2.prog-tile2-modifie { border-left-color: var(--accent); }
.prog-tile2-title { font-weight: 600; font-size: .88rem; }
.prog-tile2-meta  { font-size: .73rem; color: var(--text2); }
.prog-admin-relues { font-size: .7rem; color: var(--text2); }
.prog-admin-relues.complet { color: var(--green, #4ade80); font-weight: 600; }

/* Badges niveau */
.prog-niveau {
  display: inline-block; font-size: .65rem; font-weight: 700;
  padding: 2px 7px; border-radius: 99px; margin-top: 4px;
  text-transform: uppercase; letter-spacing: .04em;
  align-self: flex-start;
}
.niveau-expert        { background: #c0392b22; color: #e74c3c; border: 1px solid #e74c3c55; }
.niveau-confirme      { background: #2980b922; color: #3498db; border: 1px solid #3498db55; }
.niveau-intermediaire { background: #d3691e22; color: #e67e22; border: 1px solid #e67e2255; }
.niveau-debutant      { background: #27ae6022; color: #2ecc71; border: 1px solid #2ecc7155; }

.prog-tiles { display: flex; flex-direction: column; gap: 16px; }
.prog-group-sep {
  display: block; width: 100%; font: inherit; font-size: 0.72rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; text-align: left;
  color: var(--text2); padding: 0 0 6px; margin-bottom: 10px; background: none;
  border: none; border-bottom: 2px solid var(--accent); cursor: pointer;
}
.prog-group-drawer {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease;
}
.prog-group.open .prog-group-drawer { grid-template-rows: 1fr; }
.prog-group-drawer > .prog-group-tiles { overflow: hidden; min-height: 0; }
.prog-group-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px;
}
.prog-tile {
  display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; color: var(--text); transition: border-color .15s, transform .1s;
}
.prog-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.prog-tile.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.prog-tile-title { font-weight: 600; font-size: 0.9rem; }
.prog-tile-meta  { font-size: 0.78rem; color: var(--text2); }
.prog-tile-tags  { font-size: 0.7rem; color: var(--text2); letter-spacing: .02em; }

/* Programme Wizard */
.prog-wiz-step { max-width: 600px; margin: 0 auto; padding: 16px 8px; }
.prog-wiz-heading { font-size: 1.15rem; font-weight: 700; color: var(--text1); margin-bottom: 20px; text-align: center; }
.prog-wiz-sub { font-size: .85rem; color: var(--text2); margin-bottom: 16px; text-align: center; margin-top: -12px; }
.prog-wiz-back { background: none; border: none; color: var(--accent); cursor: pointer; font-size: .9rem; padding: 0 0 16px 0; display: block; }
.prog-wiz-back:hover { text-decoration: underline; }
.prog-wiz-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.prog-wiz-tile {
  background: var(--surface2); border: 2px solid var(--border); border-radius: 12px;
  padding: 16px 14px; cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s;
  display: flex; flex-direction: column; gap: 6px;
}
.prog-wiz-tile:hover { border-color: var(--accent); }
.prog-wiz-tile.selected { border-color: var(--accent); background: var(--surface3); }
.prog-wiz-tile-title { font-weight: 600; color: var(--text1); font-size: .92rem; }
.prog-wiz-tile-meta { font-size: .78rem; color: var(--text2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prog-wiz-form { display: flex; flex-direction: column; gap: 14px; }

/* Import overlay */
.prog-import-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--surface1, #141722);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px;
}
.prog-import-circle {
  --prog-pct: 0%;
  width: 96px; height: 96px; border-radius: 50%;
  background: conic-gradient(var(--accent) var(--prog-pct), var(--surface3) var(--prog-pct));
  display: flex; align-items: center; justify-content: center; position: relative;
}
.prog-import-circle::before {
  content: ''; position: absolute;
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--surface1, #141722);
}
.prog-import-pct { position: relative; z-index: 1; font-size: 1rem; font-weight: 700; color: var(--text1); }
.prog-import-label { font-size: .95rem; color: var(--text2); }

/* Program weekly detail */
.prog-detail {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; font-size: 0.8rem; color: var(--text2);
  max-height: 340px; overflow-y: auto;
  user-select: none; -webkit-user-select: none;
}
.prog-detail-head { color: var(--text); margin-bottom: 8px; }
.prog-detail .muted { color: var(--text2); opacity: .8; }
.prog-week { margin-bottom: 6px; }
.prog-week > summary { cursor: pointer; color: var(--text); font-weight: 600; padding: 4px 0; }
.prog-seance { padding: 6px 0 6px 10px; border-left: 2px solid var(--border); margin: 4px 0; }
.prog-seance-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.prog-seance-type { font-weight: 600; color: var(--accent); }
.prog-seance-d { margin-top: 3px; line-height: 1.5; }
.prog-seance-a { margin-top: 2px; font-size: 0.74rem; color: var(--text2); }

/* Programme local — section détail semaines/séances */
.prog-local-detail { margin: 12px 0 8px; }
.local-prog-header { margin-bottom: 10px; }
.local-prog-titre { font-weight: 700; font-size: 1rem; color: var(--text); }
.local-prog-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: .78rem; color: var(--text2); }
.local-prog-meta span::before { content: "·"; margin-right: 8px; }
.local-prog-meta span:first-child::before { content: ""; margin-right: 0; }
.local-prog-week { margin-bottom: 6px; }
.local-prog-week > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.local-prog-week.passe > summary { opacity: .55; }
.local-prog-seance { padding: 6px 0 6px 10px; border-left: 2px solid var(--border); margin: 4px 0; }
.local-prog-seance.passe { opacity: .55; }
.local-prog-seance.aujourdhui { border-left-color: var(--accent); }
.local-prog-seance.futur { border-left-color: var(--border); }
.prog-seance-date { font-size: .75rem; min-width: 80px; }

.prog-progress { display: flex; flex-direction: column; gap: 6px; }
.prog-progress-bar {
  height: 6px; background: var(--surface2); border-radius: 99px; overflow: hidden;
}
.prog-progress-bar div {
  height: 100%; background: var(--accent); border-radius: 99px;
  width: 0%; transition: width .3s;
}
#progProgressLabel { font-size: 0.75rem; color: var(--text2); }

/* View toggle */

/* ============================================================
   FEED — auteur badge
   ============================================================ */
.act-author-badge {
  font-size: 0.72rem; font-weight: 700; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 4px; padding: 2px 6px; margin-bottom: 4px;
  display: inline-block;
}

/* ============================================================
   AMIS
   ============================================================ */
.friends-search-bar { position: relative; margin-bottom: 20px; }
.friends-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 8px;
  box-shadow: var(--shadow); z-index: 300;
  max-height: 320px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.friends-search-results.hidden { display: none; }
.friends-section { margin-bottom: 20px; }
.friends-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.friend-card {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px;
}
.friend-avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}
.friend-name {
  flex: 1 1 auto; min-width: 60px; font-size: 0.85rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.friend-tag { color: var(--text3); font-weight: 500; font-size: 0.78rem; margin-left: 3px; }
.friend-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; width: 100%; justify-content: flex-end; }
.btn-friend-accept {
  background: var(--accent); color: #fff; border: none; border-radius: 6px;
  padding: 6px 10px; font-size: 0.78rem; font-weight: 700; cursor: pointer;
  transition: opacity .15s;
}
.btn-friend-accept:hover { opacity: .85; }
.btn-friend-decline {
  background: rgba(255,77,109,.1); color: var(--red); border: none; border-radius: 6px;
  padding: 6px 10px; font-size: 0.78rem; font-weight: 700; cursor: pointer;
}
.btn-friend-ignore {
  background: var(--surface3, rgba(255,255,255,.06)); color: var(--text2); border: none; border-radius: 6px;
  padding: 6px 10px; font-size: 0.78rem; font-weight: 700; cursor: pointer;
}
.tag-pending {
  font-size: 0.72rem; font-weight: 600; color: var(--text2);
  padding: 6px 10px;
}

/* ============================================================
   ADMIN
   ============================================================ */
.admin-layout { flex-direction: row; gap: 0; }
.admin-subnav {
  width: 180px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px;
  margin-right: 16px; align-self: flex-start;
}
/* `.tab` interdit le retour à la ligne, ce qui convient à la barre latérale
   principale : elle s'élargit au survol. La sous-nav admin garde une largeur
   fixe, donc un libellé long doit passer à la ligne plutôt que de déborder de
   l'encadré. L'icône reste alignée sur la première ligne. */
.admin-subnav .tab {
  white-space: normal;
  align-items: flex-start;
  line-height: 1.3;
}

.admin-main { flex: 1; min-width: 0; overflow-y: auto; }
#adminSectionMaintenance { max-width: 860px; margin: 0 auto; }

.admin-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.btn-admin-new {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.btn-admin-new:hover { opacity: .85; }

.admin-form {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px;
}
.admin-form.hidden { display: none; }
.admin-form-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}

.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-filters #adminSearch { flex: 1; min-width: 180px; }

/* ============================================================
   MAINTENANCE (onglet admin)
   ============================================================ */
.maint-admin-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--yellow) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--yellow) 40%, transparent);
  color: var(--yellow); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 16px; font-size: .85rem; font-weight: 500;
}
.maint-admin-banner.hidden { display: none; }
.maint-banner-close {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 1rem; opacity: .7; padding: 0 4px;
}
.maint-banner-close:hover { opacity: 1; }

.maint-gitea-toggle {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px;
  font-size: .85rem; color: var(--text2); cursor: pointer;
}
.maint-gitea-toggle input { width: auto; flex-shrink: 0; }

.maint-update-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.maint-update-card.hidden { display: none; }
.maint-update-icon { font-size: 1.6rem; flex-shrink: 0; }
.maint-update-text { flex: 1; min-width: 0; }
.maint-update-title { font-weight: 600; font-size: .92rem; margin-bottom: 2px; }
.maint-update-sub { font-size: .78rem; color: var(--text2); }

.maint-status-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.maint-status-pill {
  font-size: .78rem; font-weight: 700; padding: 5px 12px; border-radius: 99px;
  border: 1px solid transparent; white-space: nowrap;
}
.maint-status-pill.on {
  background: color-mix(in srgb, var(--yellow) 15%, transparent);
  border-color: color-mix(in srgb, var(--yellow) 40%, transparent);
  color: var(--yellow);
}
.maint-status-pill.off {
  background: color-mix(in srgb, var(--green) 15%, transparent);
  border-color: color-mix(in srgb, var(--green) 40%, transparent);
  color: var(--green);
}
.maint-status-row .login-subtitle { flex: 1; min-width: 200px; }
.btn-maint-toggle {
  border: none; border-radius: 8px; padding: 8px 16px;
  font-size: .85rem; font-weight: 600; cursor: pointer; color: #fff;
  white-space: nowrap;
}
.btn-maint-toggle.enable  { background: var(--yellow); color: #1a1400; }
.btn-maint-toggle.disable { background: var(--green); }
.btn-maint-toggle:hover { opacity: .88; }

.maint-console-wrap {
  margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: #05070c;
}
.maint-console-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--surface2); border-bottom: 1px solid var(--border);
  font-size: .82rem; font-weight: 600; color: var(--text2);
}
.maint-console-hint { font-size: .72rem; font-weight: 400; color: var(--text3); }
.maint-console {
  height: 420px; overflow-y: auto; padding: 12px 16px;
  font-family: "Cascadia Code", "Consolas", "SF Mono", monospace;
  font-size: .78rem; line-height: 1.6; color: #8fe3a8;
}
.maint-console-line { white-space: pre-wrap; word-break: break-all; }
.maint-console-line .ts { color: var(--text3); }
.maint-console-line.deleted { color: #ff8080; }
.maint-console-empty { color: var(--text3); font-style: italic; }

.backups-list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.backup-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
}
.backup-badge {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  border-radius: 99px; padding: 3px 9px; flex-shrink: 0;
}
.backup-badge.permanent { color: var(--accent2); background: rgba(0,178,255,.12); }
.backup-badge.rotating  { color: var(--text2); background: var(--surface3); }
.backup-badge.drive     { color: var(--green); background: rgba(0,214,143,.12); }
.backup-badge.locked    { color: var(--orange); background: rgba(255,159,0,.12); }
.backup-date { font-size: 0.78rem; color: var(--text); flex: 1; }
.backup-size { font-size: 0.72rem; color: var(--text2); }

.maint-dropzone {
  margin-top: 16px; border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; background: var(--surface2);
  transition: border-color .15s, background .15s;
}
.maint-dropzone.dragover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface2)); }
.maint-dropzone-icon { font-size: 2rem; margin-bottom: 8px; }
.maint-dropzone-text { font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.maint-dropzone-sub { font-size: .76rem; color: var(--text2); max-width: 460px; margin: 0 auto; }

.maint-upload-result {
  margin-top: 12px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; font-size: .82rem;
}
.maint-upload-result.hidden { display: none; }
.maint-upload-line { padding: 2px 0; }
.maint-upload-line.replaced { color: var(--green); }
.maint-upload-line.skipped_not_found, .maint-upload-line.skipped_excluded,
.maint-upload-line.skipped_already_exists, .maint-upload-line.skipped_parent_missing { color: var(--text3); }
.maint-upload-line.created { color: var(--green); }

.maint-upload-tabs { display: flex; gap: 4px; margin-top: 16px; border-bottom: 1px solid var(--border); }
.maint-upload-tab {
  background: none; border: none; color: var(--text2); font-size: .85rem; font-weight: 600;
  padding: 8px 16px; cursor: pointer; border-bottom: 2px solid transparent;
}
.maint-upload-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.maint-upload-tab:hover { color: var(--text); }
.maint-upload-panel.hidden { display: none; }

.maint-create-box {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px;
}
.maint-create-box code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: .78rem; }
#createFileList { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.maint-create-row { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.maint-create-row .maint-create-name { color: var(--text2); min-width: 160px; }
.maint-create-row input { flex: 1; }
.maint-create-remove {
  background: none; border: 1px solid var(--border); color: var(--text2);
  border-radius: 6px; width: 26px; height: 26px; cursor: pointer; flex-shrink: 0;
  font-size: .78rem; line-height: 1;
}
.maint-create-remove:hover { color: var(--red); border-color: var(--red); }

.maint-create-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .maint-create-layout { grid-template-columns: 1fr; } }

.maint-tree-box {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.maint-tree-header {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  background: var(--surface3, var(--surface2)); border-bottom: 1px solid var(--border);
  font-size: .78rem; font-weight: 600; color: var(--text2);
}
.maint-tree-selected { font-size: .74rem; font-weight: 500; color: var(--accent); }
.maint-tree {
  max-height: 360px; overflow-y: auto; padding: 8px; font-size: .8rem;
}
.maint-tree-node { user-select: none; }
.maint-tree-row {
  display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 6px; cursor: pointer;
  white-space: nowrap;
}
.maint-tree-row:hover { background: var(--surface3, var(--bg)); }
.maint-tree-row.selected { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.maint-tree-row.file { cursor: default; opacity: .7; }
.maint-tree-row.file:hover { background: none; }
.maint-tree-children { margin-left: 16px; border-left: 1px dashed var(--border); padding-left: 6px; }
.maint-tree-toggle { width: 14px; display: inline-block; text-align: center; font-size: .68rem; color: var(--text3); }

.gear-retired-drawer { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; }
.gear-retired-toggle {
  background: none; border: none; color: var(--text2); font-size: .85rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 4px 0;
}
.gear-retired-toggle:hover { color: var(--text); }
.gear-retired-toggle.open .maint-tree-toggle { transform: rotate(90deg); }
.gear-retired-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px; margin-top: 12px;
}
.gear-retired-grid.hidden { display: none; }
.gear-card-cat {
  font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-left: 6px;
}
.gear-card-cat.route { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.gear-card-cat.trail { background: color-mix(in srgb, var(--orange) 15%, transparent); color: var(--orange); }
.gear-card-cat.uncategorized { background: var(--surface2); color: var(--text3); }

.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .76rem; table-layout: fixed; }
.admin-table th {
  text-align: left; padding: 7px 16px; color: var(--text3); font-weight: 600;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .03em;
  background: var(--surface2); border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-table td { padding: 8px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow: hidden; }
.admin-table td:last-child { text-align: right; padding-right: 20px; overflow: visible; }

/* Responsive : masquage progressif des colonnes non essentielles */
@media (max-width: 960px) {
  /* Masquer : Application(5), Activité(6), Connex.(8), Créé le(9) */
  .admin-table th:nth-child(5), .admin-table td:nth-child(5),
  .admin-table th:nth-child(6), .admin-table td:nth-child(6),
  .admin-table th:nth-child(8), .admin-table td:nth-child(8),
  .admin-table th:nth-child(9), .admin-table td:nth-child(9) { display: none; }
}
@media (max-width: 640px) {
  /* Masquer en plus : Abonnement(4), Sorties(7) */
  .admin-table th:nth-child(4), .admin-table td:nth-child(4),
  .admin-table th:nth-child(7), .admin-table td:nth-child(7) { display: none; }
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--surface2); }
.admin-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.admin-status-dot.online { background: var(--green); }
.admin-status-dot.offline { background: var(--text3); }

.admin-user-list { display: flex; flex-direction: column; gap: 8px; }
.admin-user-row.clickable { cursor: pointer; }
.admin-user-row.clickable:hover { border-color: var(--border2); }
span.clickable { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; }
span.clickable:hover { color: var(--accent); }

.tpl-accordion {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 10px; overflow: hidden;
}
.tpl-accordion-header {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: transparent; border: none; color: var(--text);
  font-size: 0.92rem; font-weight: 600; padding: 14px 16px; cursor: pointer;
}
.tpl-accordion-header:hover { background: var(--surface3); }
.tpl-accordion-chevron { color: var(--text2); font-size: 0.8rem; }
.tpl-accordion-body { padding: 0 16px 16px; }
.tpl-accordion-body.hidden { display: none; }

.tpl-editor-cols { display: flex; gap: 20px; align-items: flex-start; }
.tpl-editor-form { flex: 1 1 320px; min-width: 280px; }
.tpl-editor-preview { flex: 1 1 380px; min-width: 280px; position: sticky; top: 8px; }
.tpl-preview-frame {
  width: 100%; height: 480px; border: 1px solid var(--border); border-radius: 10px;
  background: #0b0e14;
}
.tpl-variables-hint { margin-top: 10px; font-size: 0.8rem; }
.tpl-variables-hint code {
  display: inline-block; background: var(--surface3); color: var(--accent);
  border-radius: 5px; padding: 2px 6px; margin: 4px 4px 0 0; font-size: 0.76rem;
  cursor: help;
}
@media (max-width: 900px) {
  .tpl-editor-cols { flex-direction: column; }
  .tpl-editor-preview { position: static; }
}
.admin-user-status {
  font-size: .72rem; padding: 2px 8px; border-radius: 4px;
}
.admin-user-status.active { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.admin-user-status.suspended { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.admin-user-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.admin-user-info {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.admin-user-id { color: var(--text3); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-user-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user-email { color: var(--text2); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user-role {
  font-size: .72rem; font-weight: 700; padding: 2px 8px;
  border-radius: 4px; white-space: nowrap; display: inline-block;
}
.admin-user-role.admin {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.admin-user-role.moderator {
  background: color-mix(in srgb, var(--purple) 15%, transparent);
  color: var(--purple);
}
.admin-user-role.editor {
  background: color-mix(in srgb, var(--orange) 15%, transparent);
  color: var(--orange);
}
.admin-user-role.premium {
  background: color-mix(in srgb, var(--yellow) 15%, transparent);
  color: var(--yellow);
}
.admin-user-role.standard, .admin-user-role.user {
  background: var(--surface2); color: var(--text2);
}
.admin-user-sub {
  font-size: .68rem; padding: 1px 6px;
  border-radius: 4px; display: inline-block; white-space: nowrap;
}
.admin-user-sub.premium_lifetime {
  background: color-mix(in srgb, var(--yellow) 15%, transparent);
  color: var(--yellow);
}
.admin-user-sub.basic {
  background: var(--surface2); color: var(--text2);
}
.admin-user-sub.basic_non_linked {
  background: color-mix(in srgb, var(--red, #f87171) 15%, transparent);
  color: var(--red, #f87171);
}
.admin-garmin-badge {
  font-size: .72rem; padding: 2px 8px; border-radius: 4px;
}
.admin-garmin-badge.linked { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.admin-garmin-badge.unlinked { background: var(--surface2); color: var(--text3); }

.admin-user-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-admin-action {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 5px 12px;
  font-size: .78rem; cursor: pointer; white-space: nowrap;
}
.btn-admin-action:hover { border-color: var(--border2); }
.btn-admin-action.danger { color: var(--red); border-color: rgba(255,77,109,.3); }
.btn-admin-action.danger:hover { background: rgba(255,77,109,.08); }

.roles-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 10px; align-items: start;
}
.role-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.role-card-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.role-card-label { font-size: .92rem; font-weight: 700; margin-right: 8px; }
.role-card-name {
  font-size: .68rem; color: var(--text2); font-family: monospace;
  background: var(--surface2); border-radius: 5px; padding: 2px 6px;
}
.role-card-meta { display: flex; align-items: center; gap: 8px; }
.role-card-count { font-size: .72rem; color: var(--text2); }
.role-note { font-size: .82rem; color: var(--text2); font-style: italic; margin: 0; }
.role-perm-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 14px;
}
.role-perm-item {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--text); cursor: pointer;
}
.role-subtabs {
  display: flex; gap: 4px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.role-subtab {
  background: none; border: none; cursor: pointer;
  padding: 6px 10px; margin-bottom: -1px;
  font-size: .76rem; font-weight: 600; color: var(--text2);
  border-bottom: 2px solid transparent;
}
.role-subtab:hover { color: var(--text); }
.role-subtab.active { color: var(--accent); border-bottom-color: var(--accent); }
.role-subtab-panel.hidden { display: none; }


/* ============================================================
   RECORDS / OBJECTIFS / CALENDRIER / PROGRESSION
   ============================================================ */
#tab-records, #tab-goals, #tab-progression, #tab-faceaface { overflow-y: auto; }
/* Défilement conservé — huit semaines de programme dépassent toute hauteur
   d'écran — mais sans barre visible. */
#tab-workouts, #tab-vma { overflow-y: auto; scrollbar-width: none; }
#tab-workouts::-webkit-scrollbar, #tab-vma::-webkit-scrollbar { width: 0; display: none; }
#tab-records::-webkit-scrollbar, #tab-goals::-webkit-scrollbar, #tab-progression::-webkit-scrollbar, #tab-faceaface::-webkit-scrollbar { width: 4px; }
#tab-records::-webkit-scrollbar-thumb, #tab-goals::-webkit-scrollbar-thumb, #tab-progression::-webkit-scrollbar-thumb, #tab-faceaface::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.charts-row-2 { grid-template-columns: 1fr 1fr; }
.charts-row-2 .chart-wrapper { height: 200px; }

.prog-filters { margin-bottom: 16px; }
.prog-filters-row { display: flex; gap: 8px; flex-wrap: wrap; }
.prog-year-dropdown { position: relative; display: inline-block; }
.prog-year-panel {
  position: absolute; top: 100%; left: 0; margin-top: 6px; z-index: 20;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px; display: flex; flex-direction: column; gap: 2px; min-width: 100px;
  box-shadow: var(--shadow);
}
.prog-cascade-item { position: relative; }
.prog-cascade-panel { top: -8px; left: 100%; margin-top: 0; margin-left: 4px; }
.prog-year-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 6px; cursor: pointer;
  font-size: 0.78rem; font-weight: 600; color: var(--text2);
  transition: background .15s, color .15s;
}
.prog-year-opt:hover { background: var(--surface3); }
.prog-year-opt.active { color: var(--text); }

.goals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px; flex-shrink: 0;
}
.goals-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; flex-shrink: 0;
}
.goals-form.hidden { display: none; }

/* Heatmap par mois : une mini grille calendrier par mois */
.cal-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  flex-shrink: 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.cal-month-label {
  font-size: 0.7rem; font-weight: 700; text-transform: capitalize;
  color: var(--text2); margin-bottom: 4px;
}
.cal-month-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 3px; margin-bottom: 3px;
  font-size: 0.55rem; font-weight: 700; color: var(--text3);
  text-align: center;
}
.cal-month-days {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-cell {
  width: 100%; aspect-ratio: 1; border-radius: 2px;
  background: var(--surface3);
}
.cal-empty { background: transparent; }
.cal-l1 { background: #1e4173; cursor: pointer; }
.cal-l2 { background: #2c62ad; cursor: pointer; }
.cal-l3 { background: #6fa4f7; cursor: pointer; }
.cal-l4 { background: #f4f8ff; cursor: pointer; }
.cal-cell[title]:hover { outline: 1px solid var(--text2); }

.cal-legend {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px; font-size: 0.68rem; color: var(--text2);
}
.cal-legend-swatch { width: 11px; height: 11px; border-radius: 2px; }

/* Agenda : vraie grille mensuelle (style Google Agenda) */
.month-cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px; margin-top: 10px;
  font-size: 0.62rem; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: .06em; text-align: center;
}
.month-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px; margin-top: 4px;
}
.month-cal-day {
  min-height: 84px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s;
}
.month-cal-day:hover { border-color: var(--accent); }
.month-cal-day.month-cal-empty { background: transparent; border-color: transparent; cursor: default; }
.month-cal-day.month-cal-today { border-color: var(--accent2); }
.month-cal-daynum { font-size: 0.72rem; font-weight: 700; color: var(--text2); }
.month-cal-race {
  font-size: 0.66rem; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 5px; padding: 2px 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Autocomplétion ville (custom, remplace <datalist> — trop lent sur ~100k options) */
.city-autocomplete {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  margin-top: 2px; max-height: 220px; overflow-y: auto;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 8px; box-shadow: var(--shadow);
}
.city-autocomplete.hidden { display: none; }
.city-autocomplete-item {
  padding: 6px 10px; font-size: 0.78rem; color: var(--text);
  cursor: pointer;
}
.city-autocomplete-item:hover,
.city-autocomplete-item.active { background: var(--surface3); }

/* ============================================================
   SANTÉ / CLASSEMENTS
   ============================================================ */
#tab-health { overflow-y: auto; }
#tab-health::-webkit-scrollbar { width: 4px; }
#tab-health::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
.btn-nav:disabled { opacity: .35; cursor: not-allowed; }

.feed-view {
  flex: 1; min-height: 0; overflow-y: auto;
}
.feed-view::-webkit-scrollbar { width: 4px; }
.feed-view::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
.feed-view.hidden { display: none; }

.board-list {
  display: flex; flex-direction: column; gap: 6px;
  max-width: 640px; margin: 0 auto;
}
.board-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  transition: border-color .15s;
}
.board-row:hover { border-color: var(--border2); }
.board-first { border-color: rgba(255,201,71,.4); background: rgba(255,201,71,.04); }
.board-rank {
  font-size: 1.1rem; font-weight: 800; width: 32px; text-align: center; flex-shrink: 0;
  color: var(--text2);
}
.board-name {
  font-size: 0.9rem; font-weight: 700; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.board-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.board-stat { font-size: 0.78rem; color: var(--text2); white-space: nowrap; }
.board-stat b { color: var(--accent2); font-size: 0.95rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .charts-row { grid-template-columns: 1fr 1fr; }
  .cmp-layout { grid-template-columns: 1fr; }
  .cmp-right  { display: none; }
  .goals-grid { grid-template-columns: repeat(2, 1fr); }
  .roles-list { grid-template-columns: 1fr; }
  .admin-subnav { width: 150px; }
}

@media (max-width: 768px) {
  html, body { height: auto; overflow: auto; }
  .main { height: auto; overflow: auto; margin-left: 0; padding: 10px 12px; }
  .tab-content { height: auto; overflow: visible; }
  #activitiesGrid, #weekActivitiesGrid, .cmp-grid, .workouts-list,
  #tab-records, #tab-goals, #tab-progression, #tab-faceaface, #tab-workouts, #tab-vma,
  #tab-health, .feed-view, .prog-detail {
    overflow: visible; height: auto; max-height: none;
  }
  .today-hero-img { display: block; }
  .daily-grid { grid-template-columns: repeat(2, 1fr); }
  .d-card-wide { grid-column: span 2; }
  .charts-row, .charts-row-2, .goals-grid { grid-template-columns: 1fr; }

  /* Header : plus de rail latéral, sidebar devient une barre en haut */
  .header, .main { margin-left: 0; }
  .header-inner { padding: 0 10px; gap: 6px; }
  .header-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .sync-time, .header-user-menu-tag { display: none; }
  .btn-sync span, .garmin-status .sync-time { display: none; }

  .layout { flex-direction: column; height: auto; }
  .tabs {
    position: static; flex-direction: row; width: auto; height: auto;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 6px 8px; z-index: 60;
  }
  .tabs.flyout-open, .tabs:hover { width: auto; box-shadow: none; }
  .sidebar-logo { display: none; }
  .tab { padding: 6px 10px; font-size: 0.72rem; flex-shrink: 0; }
  .tab-group-label, .tab-soon { display: none; }
  .stats-view { overflow: visible; height: auto; }

  /* Grilles : 1 colonne partout sur mobile */
  .activities-grid, #activitiesGrid,
  .friends-list, .cal-grid, .gear-retired-grid,
  .vma-cards, .prog-group-tiles, .prog-tiles > .prog-group-tiles,
  .runner-grid, .month-grid {
    grid-template-columns: 1fr;
  }
  .month-cal-grid, .month-cal-weekdays { gap: 3px; }
  .month-cal-day { min-height: 56px; padding: 4px; }
  .month-cal-race { width: 7px; height: 7px; border-radius: 50%; padding: 0; font-size: 0; overflow: hidden; flex-shrink: 0; align-self: flex-start; }

  /* Panneaux latéraux (drawer, fiche workout) : pleine largeur */
  .drawer, .wk-panel { width: 100vw; max-width: 100vw; }
  .drawer-metrics { grid-template-columns: repeat(2, 1fr); }

  /* Admin : sous-nav empilée en barre horizontale scrollable */
  .admin-layout { flex-direction: column; gap: 12px; }
  .admin-subnav {
    flex-direction: row; width: auto; margin-right: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  /* Barre horizontale : la largeur n'est plus contrainte, un libellé qui passe
     à la ligne y ferait une colonne étroite au lieu d'un onglet. */
  .admin-subnav .tab { white-space: nowrap; align-items: center; }
  .admin-table-wrap { overflow-x: auto; }
  .admin-table { table-layout: auto; }
  .admin-user-row { flex-direction: column; align-items: flex-start; }
  .admin-user-actions { width: 100%; }
  .roles-list { grid-template-columns: 1fr; }
  .role-perm-grid { grid-template-columns: 1fr; }

  /* Formulaires / cartes de login-style */
  .login-card { padding: 28px 20px; max-width: 100%; }
  .settings-card { max-width: 100%; }
  .vma-head { gap: 12px; }
  .vma-bib { min-width: 0; width: 100%; }
  .vma-bib input { font-size: 1.9rem; }
  .vma-cards { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

  .cmp-header { grid-template-columns: 1fr 60px 1fr; }
  .cmp-card { grid-template-columns: 1fr 60px 1fr; }

  .sync-time, .user-email { display: none; }
}

/* ====== DONNÉE DU COUREUR / VMA ====== */
.vma-head { display:flex; flex-wrap:wrap; gap:20px; align-items:flex-end; justify-content:space-between; margin-bottom:20px; }
.vma-title { margin:0; font-size:1.15rem; color:var(--text); }
.vma-sub { margin:6px 0 0; font-size:0.8rem; color:var(--text2); max-width:52ch; line-height:1.5; }
.vma-bib { background:var(--surface2); border:1px solid var(--border); border-radius:10px; padding:10px 14px; min-width:180px; }
.vma-bib label { display:block; font-size:0.68rem; letter-spacing:.14em; text-transform:uppercase; color:var(--text2); }
.vma-bib-row { display:flex; align-items:baseline; gap:8px; }
.vma-bib input { width:100%; border:0; outline:0; background:transparent; color:var(--text); font-size:2.4rem; font-weight:700; padding:2px 0; }
.vma-bib input:focus-visible { box-shadow:inset 0 -2px 0 var(--accent); }
.vma-unit { color:var(--text2); font-weight:600; }
.vma-hint { margin:4px 0 0; font-size:0.68rem; color:var(--text2); line-height:1.4; }
.vma-hint code { font-family:inherit; font-weight:700; color:var(--text); }
.vma-hint.bad { color:var(--red); }
.vma-bib input.bad { box-shadow:inset 0 -2px 0 var(--red); }
.vma-unit-select {
  background:var(--surface3); color:var(--text2); border:1px solid var(--border);
  border-radius:6px; padding:4px 8px; font-size:0.78rem; font-weight:600; cursor:pointer;
}
.vma-unit-select:hover, .vma-unit-select:focus-visible { border-color:var(--accent); color:var(--text); }
.vma-h { font-size:0.72rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--text2); margin:22px 0 10px; border-bottom:2px solid var(--accent); padding-bottom:6px; }
.vma-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; }
.vma-card { background:var(--surface2); border:1px solid var(--border); border-radius:8px; padding:12px 14px; }
.vma-card .k { font-size:0.68rem; letter-spacing:.1em; text-transform:uppercase; color:var(--text2); }
.vma-card .v { font-size:1.5rem; font-weight:700; margin-top:5px; color:var(--text); font-variant-numeric:tabular-nums; }
.vma-card .n { font-size:0.72rem; color:var(--text2); margin-top:2px; }
.vma-card.key { border-color:var(--accent); }
.vma-card.key .v { color:var(--accent); }
.vma-scroller { overflow-x:auto; border:1px solid var(--border); border-radius:8px; }
.vma-table { border-collapse:collapse; width:100%; font-size:0.78rem; white-space:nowrap; font-variant-numeric:tabular-nums; }
.vma-table th, .vma-table td { padding:6px 10px; text-align:right; border-bottom:1px solid var(--border); }
.vma-table thead th { position:sticky; top:0; background:var(--surface2); color:var(--text2); font-weight:600; z-index:2; }
.vma-table .vma-pct { text-align:left; position:sticky; left:0; background:var(--surface); color:var(--text); font-weight:600; z-index:1; }
.vma-table thead th.vma-pct { z-index:3; background:var(--surface2); }
.vma-table tbody tr:hover td { background:rgba(127,127,127,.08); }
.vma-table .vma-sep { border-left:1px solid var(--border); }
.vma-table tr.vma-row td { background:rgba(79,142,247,.16); font-weight:600; }
.vma-table tr.vma-row .vma-pct { background:var(--accent); color:#fff; }

/* ====== Onglet VMA — habillage « piste / tartan » (scopé à #tab-vma) ====== */
#tab-vma {
  --tk:      #14161a;   /* gris anthracite neutre */
  --tk2:     #1c1f25;
  --tk3:     #262a32;
  --chalk:   #f5f2ec;   /* blanc craie */
  --cinder:  #ff7a1a;   /* orange dossard */
  --lime:    #ff9d4d;   /* orange clair, valeurs mises en avant */
  --tk-mut:  #9aa0ab;
  --tk-line: rgba(245,242,236,.14);
  --tk-mono: "IBM Plex Mono", "Cascadia Mono", Consolas, "SF Mono", ui-monospace, monospace;
  --tk-cond: "Barlow Condensed", "Segoe UI Semibold", "Arial Narrow", Inter, sans-serif;
  background: var(--tk);
  color: var(--chalk);
  gap: 2px;   /* .tab-content impose 8px : trop pour loger les 22 lignes */
}

/* Bandeau récapitulatif en haut à droite, au-dessus du titre */
#tab-vma .vma-topline {
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 1px;
  margin-bottom: 8px; font-family: var(--tk-mono); font-size: 0.76rem;
}
#tab-vma .vma-topline .cell {
  display: flex; align-items: baseline; gap: 8px;
  background: var(--tk2); border: 1px solid var(--tk-line); padding: 4px 10px;
}
#tab-vma .vma-topline .cell .lbl {
  font-family: var(--tk-cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; font-size: 0.72rem; color: var(--tk-mut);
}
#tab-vma .vma-topline .cell .val { font-weight: 600; color: var(--cinder); }
#tab-vma .vma-topline .cell.plain .val { color: var(--chalk); }

#tab-vma .vma-head {
  align-items: flex-end;
  border-bottom: 2px solid var(--cinder);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
#tab-vma .vma-title {
  font-family: var(--tk-cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; line-height: .95; color: var(--chalk);
  font-size: clamp(22px, 3vw, 32px);
}
#tab-vma .vma-title em { font-style: normal; color: var(--cinder); }
#tab-vma .vma-sub { color: var(--tk-mut); max-width: 46ch; }

/* Bouton d'import de la séance test VMA */
#tab-vma .vma-import-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
#tab-vma .vma-import-btn {
  background: var(--cinder); color: #14161a; border: 0; border-radius: 2px;
  font-family: var(--tk-cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; font-size: 0.82rem; padding: 7px 14px; cursor: pointer;
}
#tab-vma .vma-import-btn:hover { filter: brightness(1.1); }
#tab-vma .vma-import-btn:disabled { opacity: .5; cursor: default; filter: none; }
#tab-vma .vma-import-msg { font-size: 0.72rem; color: var(--tk-mut); }
#tab-vma .vma-import-msg.ok { color: var(--cinder); }
#tab-vma .vma-import-msg.bad { color: #ff6b6b; }

/* Le dossard : bloc craie sur fond piste */
#tab-vma .vma-bib {
  background: var(--chalk); color: var(--tk);
  border: 0; border-radius: 2px; padding: 6px 12px 8px; min-width: 200px;
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
}
#tab-vma .vma-bib label {
  font-family: var(--tk-cond); font-weight: 700; letter-spacing: .16em; color: #5c6a6f;
}
#tab-vma .vma-bib input {
  color: var(--tk); font-family: var(--tk-cond); font-weight: 700;
  font-size: clamp(28px, 3.4vw, 40px); line-height: 1;
}
#tab-vma .vma-bib input:focus-visible { box-shadow: inset 0 -3px 0 var(--cinder); }
#tab-vma .vma-hint { color: #6d747f; }
#tab-vma .vma-hint code { color: var(--tk); }
#tab-vma .vma-hint.bad { color: #c0392b; }
#tab-vma .vma-bib input.bad { box-shadow: inset 0 -3px 0 #c0392b; }
#tab-vma .vma-unit-select {
  background: transparent; color: #5c6a6f; border: 1px solid rgba(20,22,26,.25);
  font-family: var(--tk-cond); font-weight: 700; letter-spacing: .06em;
}
#tab-vma .vma-unit-select:hover,
#tab-vma .vma-unit-select:focus-visible { border-color: var(--cinder); color: var(--tk); }
#tab-vma .vma-unit-select option { background: var(--chalk); color: var(--tk); }

/* Badge source VMA + boutons Valider / Réinitialiser */
.vma-source-badge {
  margin: 6px 0 0; font-size: 0.7rem; line-height: 1.4; min-height: 1em;
}
#tab-vma .vma-source-badge { color: #5c6a6f; }
.vma-source-badge.vma-source-manual { color: #27ae60; }
.vma-source-badge.vma-source-auto   { color: #e67e22; }
.vma-source-badge.vma-source-none   { color: #c0392b; }
.vma-bib-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.vma-btn-confirm, .vma-btn-reset {
  font-family: var(--tk-cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; font-size: 0.75rem; padding: 5px 12px;
  border: 0; border-radius: 2px; cursor: pointer;
}
.vma-btn-confirm { background: var(--cinder); color: #14161a; }
.vma-btn-confirm:hover { filter: brightness(1.1); }
.vma-btn-reset   { background: transparent; color: #c0392b; border: 1px solid #c0392b; }
.vma-btn-reset:hover { background: rgba(192,57,43,.1); }

/* Titres de section : tiret cinder plutôt que soulignement */
#tab-vma .vma-h {
  font-family: var(--tk-cond); letter-spacing: .18em; color: var(--tk-mut);
  border-bottom: 0; padding-bottom: 0; margin: 12px 0 8px; font-size: 0.78rem;
}
#tab-vma .vma-h::before {
  content: ""; display: inline-block; width: 22px; height: 2px;
  background: var(--cinder); vertical-align: middle; margin-right: 10px;
}

/* Bandeau continu : cartes jointives séparées par un filet */
#tab-vma .vma-cards {
  gap: 1px; background: var(--tk-line); border: 1px solid var(--tk-line);
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
#tab-vma .vma-card { background: var(--tk2); border: 0; border-radius: 0; padding: 8px 14px 10px; }
#tab-vma .vma-card .k,
#tab-vma .vma-card .n { color: var(--tk-mut); }
#tab-vma .vma-card .v { font-family: var(--tk-mono); font-weight: 600; font-size: 1.25rem; margin-top: 2px; color: var(--chalk); }
#tab-vma .vma-card.key { background: var(--tk3); }
#tab-vma .vma-card.key .v { color: var(--lime); }

/* Grille intermittente */
#tab-vma .vma-scroller { border: 1px solid var(--tk-line); border-radius: 0; }
/* 22 lignes (120 % → 60 %) doivent tenir sans scroll vertical : lignes compactes */
/* height:100% => les lignes se répartissent la hauteur disponible : la dernière
   (60 %) n'est jamais coupée, quelle que soit la hauteur de la fenêtre. */
#tab-vma .vma-table {
  font-family: var(--tk-mono); font-size: clamp(0.62rem, 0.9vh, 0.78rem); height: 100%;
}
#tab-vma .vma-table th,
#tab-vma .vma-table td {
  padding: clamp(0px, 0.2vh, 4px) 9px; line-height: 1.15;
  border-bottom: 1px solid var(--tk-line);
}
#tab-vma .vma-table thead th {
  background: #101216; color: var(--tk-mut);
  font-family: var(--tk-cond); font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  /* la bordure d'une cellule sticky défile avec le tableau : on la simule */
  border-bottom: 0; box-shadow: inset 0 -1px 0 var(--cinder);
}
#tab-vma .vma-table .vma-pct { background: var(--tk); color: var(--chalk); }
#tab-vma .vma-table thead th.vma-pct { background: #101216; }
#tab-vma .vma-table tbody tr:hover td { background: rgba(255,122,26,.07); }
#tab-vma .vma-table tbody tr:hover .vma-pct { background: var(--tk3); }
#tab-vma .vma-table .vma-sep { border-left: 1px solid var(--tk-line); }
#tab-vma .vma-table td.vma-dim { color: var(--tk-mut); }
#tab-vma .vma-table tr.vma-row td { background: rgba(255,122,26,.18); }
#tab-vma .vma-table tr.vma-row .vma-pct { background: var(--cinder); color: #14161a; }
#tab-vma .vma-table tr.vma-row:hover td { background: rgba(255,122,26,.26); }

/* Le tableau est la seule zone qui défile : ses en-têtes (ligne + colonne %)
   restent donc collés et visibles pendant le scroll. Barres masquées. */
#tab-vma { overflow: hidden; }
/* Aucun défilement vertical : les 22 lignes tiennent dans la hauteur restante.
   Seul le défilement horizontal (colonnes de distances) est possible. */
#tab-vma .vma-scroller { flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; }
#tab-vma, #tab-vma .vma-scroller { scrollbar-width: none; -ms-overflow-style: none; }
#tab-vma::-webkit-scrollbar,
#tab-vma .vma-scroller::-webkit-scrollbar { width: 0; height: 0; }
#tab-vma .vma-table thead th { top: 0; }

#tab-vma .vma-notes {
  margin-top: 4px; color: var(--tk-mut); font-size: 0.66rem; line-height: 1.35; max-width: 100ch;
}
#tab-vma .vma-notes code { color: var(--lime); font-family: var(--tk-mono); }

/* ====== Groupe de séances programme (accolade) ====== */
.wk-group {
  border-left: 3px solid var(--accent); border-radius: 8px;
  background: var(--surface2); margin-bottom: 12px; padding: 4px 4px 4px 0;
}
.wk-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 14px; flex-wrap: wrap;
}
.wk-group-title { font-weight: 600; color: var(--text); font-size: 0.9rem; }
.wk-group-count {
  font-size: 0.72rem; color: var(--text2); background: var(--surface3);
  border-radius: 99px; padding: 1px 8px; margin-left: 6px;
}
.wk-group-body { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 8px 14px; }
.wk-group-body .wk-card { background: var(--surface); }

/* Manual drag-and-drop groups */
.wk-groups-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.wk-mgroup {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px; overflow: hidden;
}
.wk-mgroup-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.wk-mgroup-title { font-weight: 600; color: var(--text); font-size: 0.9rem; cursor: text; }
.wk-mgroup-body { display: flex; flex-direction: column; gap: 6px; padding: 8px; min-height: 40px; }
.wk-mgroup-body .wk-card { background: var(--surface); }
.wk-mgroup-empty {
  font-size: 0.78rem; color: var(--text2); text-align: center;
  padding: 10px; border: 1px dashed var(--border); border-radius: 8px;
}
.wk-ungrouped { display: flex; flex-direction: column; gap: 6px; min-height: 20px; }
.wk-card[draggable="true"] { cursor: grab; }
.wk-card.dragging { opacity: 0.4; }
.wk-mgroup.drag-over,
.wk-ungrouped.drag-over { outline: 2px dashed var(--accent); outline-offset: -2px; }

/* Bouton partage Story Instagram */
.btn-story {
  width: 100%; margin-top: 16px; padding: 13px;
  background: linear-gradient(135deg, #f09433, #e6683c 30%, #dc2743 60%, #cc2366 80%, #bc1888);
  color: #fff; border: none; border-radius: 10px;
  font-size: 0.9rem; font-weight: 700; cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn-story:hover  { opacity: .92; }
.btn-story:active { transform: scale(.98); }

/* Dashboard : bascule Jour / Semaine / Mois */
.period-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 20px 0 4px;
}
.period-switch {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px;
}
.period-btn {
  padding: 7px 18px; border: none; background: transparent;
  color: var(--text2); font-size: .84rem; font-weight: 600;
  border-radius: 7px; cursor: pointer; transition: background .15s, color .15s;
}
.period-btn:hover { color: var(--text); }
.period-btn.active { background: var(--accent); color: #fff; }

.period-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.period-picker {
  padding: 7px 12px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: .82rem; font-weight: 600; cursor: pointer;
  max-width: 210px;
}

.btn-story-mini {
  padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer;
  background: linear-gradient(135deg, #f09433, #dc2743 60%, #bc1888);
  color: #fff; font-size: .82rem; font-weight: 700;
  transition: opacity .15s, transform .1s;
}
.btn-story-mini:hover  { opacity: .92; }
.btn-story-mini:active { transform: scale(.98); }
.btn-story-mini:disabled { opacity: .55; cursor: default; transform: none; }

.period-totals {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin: 16px 0 4px;
}
.period-total {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.period-total-val { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.period-total-lbl {
  font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text2);
}

/* Fenêtre de choix du modèle de Story */
.story-picker-card {
  position: relative; z-index: 1;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px 32px;
  max-width: 1040px; width: 100%; text-align: center;
  max-height: 92vh; overflow-y: auto;
}
.story-picker-title { font-size: 1.35rem; font-weight: 700; margin-bottom: 4px; }
.story-picker-subtitle { font-size: .88rem; color: var(--text2); margin-bottom: 22px; }
.story-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; margin-bottom: 18px;
  justify-items: center;
}
.story-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: 14px; padding: 14px; cursor: pointer;
  width: 100%; max-width: 308px;
  transition: border-color .15s, transform .1s;
}
.story-card:hover  { border-color: var(--accent); }
.story-card:active { transform: scale(.98); }
.story-card-preview {
  width: 100%; max-width: 280px; height: auto; display: block;
  border-radius: 10px; background: var(--surface3);
}
.story-card-label { font-size: .95rem; font-weight: 700; color: var(--text); }
.story-card-hint  { font-size: .78rem; color: var(--text2); line-height: 1.35; }

/* Étape 2 du partage : l'image est prête, reste à choisir quoi en faire.
   Le partage natif n'existe pas sur tous les navigateurs — le bouton
   correspondant est masqué plutôt que d'ouvrir sur un échec silencieux. */
.story-export { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.story-export.hidden { display: none; }
.story-export-preview {
  max-height: 52vh; width: auto; max-width: 100%;
  border-radius: 12px; border: 1px solid var(--border);
}
/* `display:none` doit primer sur le `display` implicite de <video>. */
.story-export-preview.hidden { display: none; }
.story-export-actions {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
}
.story-export-actions.hidden { display: none; }
.btn-story-export {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff; border: none; border-radius: 10px;
  padding: 12px 22px; font-size: .92rem; font-weight: 700;
  cursor: pointer; transition: transform .1s, filter .15s;
}
.btn-story-export:hover  { filter: brightness(1.08); }
.btn-story-export:active { transform: scale(.97); }
.btn-story-export.hidden { display: none; }

/* Téléphones : le catalogue compte treize modèles. Sur une seule colonne, les
   derniers — dont les animations — se trouvent à plusieurs écrans de
   défilement, au point de passer pour absents. Deux colonnes divisent la
   hauteur par deux. */
@media (max-width: 620px) {
  .story-picker-card  { padding: 20px 14px; }
  .story-picker-grid  { grid-template-columns: 1fr 1fr; gap: 12px; }
  .story-card         { max-width: none; padding: 10px; gap: 6px; }
  .story-card-preview { max-width: 100%; }
  .story-card-label   { font-size: .82rem; }
  .story-card-hint    { font-size: .68rem; }
}

/* Écrans courts : l'aperçu rétrécit pour que la fenêtre reste sans scroll */
@media (max-height: 820px) {
  .story-card-preview { max-width: 200px; }
}

/* Zones FC (onglet Coureur) */
.hr-zones { margin-top: 14px; }
.hr-zones-title { font-size: 0.72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text2); margin-bottom: 8px; }
.hr-zone-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.hr-zone-name { flex: 0 0 150px; font-size: 0.8rem; font-weight: 600; }
.hr-zone-bar { flex: 1; height: 12px; background: var(--surface3); border-radius: 99px; overflow: hidden; }
.hr-zone-bar > span { display: block; height: 100%; border-radius: 99px; }
.hr-zone-range { flex: 0 0 96px; text-align: right; font-size: 0.76rem; color: var(--text2); font-variant-numeric: tabular-nums; }

/* ============================================================
   FACE À FACE — comparaison de deux sorties
   ============================================================ */
.ff-pickers { margin-bottom: 14px; }
.ff-picker.hidden { display: none; }
.ff-picker { position: relative; }
.ff-picker-label {
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 6px;
}
.ff-search {
  width: 100%; background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: .9rem;
}
.ff-search:focus { outline: none; border-color: var(--accent); }

/* Liste flottante : posée dans le flux, elle repousserait la fiche et le
   tableau à chaque frappe. */
.ff-results {
  position: absolute; z-index: 30; left: 0; right: 0; top: 100%;
  margin-top: 4px; max-height: 320px; overflow-y: auto;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.ff-results.hidden { display: none; }
.ff-result {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: none; cursor: pointer; text-align: left;
  padding: 9px 12px; color: var(--text);
}
.ff-result:hover { background: var(--surface3); }
/* Taille fixe : `.sport-pastille` prend 100 % de son conteneur, et un
   conteneur sans taille la laissait à sa taille naturelle — géante. */
.ff-result-icon {
  font-size: 1.1rem; flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.ff-result-main { display: flex; flex-direction: column; min-width: 0; }
.ff-result-name {
  font-size: .86rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ff-result-meta { font-size: .72rem; color: var(--text2); }

.ff-card {
  margin-top: 10px; background: var(--surface2);
  border: 1px solid var(--border); border-left-width: 4px;
  border-radius: 8px; padding: 10px 12px;
}
.ff-card-top { display: flex; align-items: center; gap: 8px; }
.ff-card-icon {
  font-size: 1.1rem; flex-shrink: 0;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.ff-card-name {
  font-weight: 700; font-size: .9rem; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ff-card-clear {
  background: transparent; border: none; color: var(--text3);
  cursor: pointer; font-size: .9rem; padding: 2px 4px;
}
.ff-card-clear:hover { color: var(--text); }
.ff-card-date { font-size: .74rem; color: var(--text2); margin-top: 2px; }

.ff-ecart {
  display: flex; align-items: baseline; gap: 10px; justify-content: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; margin-bottom: 16px;
}
.ff-ecart.hidden { display: none; }
.ff-ecart-val { font-size: 1.6rem; font-weight: 800; color: var(--accent2); }
.ff-ecart-lbl { font-size: .84rem; color: var(--text2); }

.ff-avertissement {
  background: color-mix(in srgb, var(--orange) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--orange) 40%, transparent);
  color: var(--text); border-radius: 8px;
  padding: 10px 12px; font-size: .82rem; margin-bottom: 16px;
}
.ff-avertissement.hidden { display: none; }

.ff-table-wrap { overflow-x: auto; margin-bottom: 22px; }
.ff-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ff-table th, .ff-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: right;
}
.ff-table thead th {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text3); background: var(--surface2);
}
.ff-table tbody th {
  text-align: left; font-weight: 600; color: var(--text2);
}
.ff-table tbody tr:last-child th, .ff-table tbody tr:last-child td { border-bottom: none; }
/* Vert et rouge portent le sens du progrès, pas celui de la variation :
   une allure qui baisse est un gain. */
.ff-mieux { color: var(--green); font-weight: 700; }
.ff-moins { color: var(--red, #ff5a5a); font-weight: 700; }

@media (max-width: 620px) {
  .ff-ecart-val { font-size: 1.3rem; }
}

/* Filtre de type devant la recherche : sur des années d'historique, réduire
   la discipline d'abord fait plus que n'importe quel mot-clé. */
.ff-champs { display: flex; gap: 8px; }
.ff-champs .ff-search { flex: 1; min-width: 0; }
.ff-type {
  flex: 0 0 auto; max-width: 42%;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 8px; font-size: .82rem; cursor: pointer;
}
.ff-type:focus { outline: none; border-color: var(--accent); }

@media (max-width: 620px) {
  .ff-champs { flex-direction: column; }
  .ff-type { max-width: none; }
}

/* Mention de troncature : une liste coupée sans elle se lit comme un
   historique incomplet. */
.ff-plus {
  padding: 8px 12px; font-size: .72rem; color: var(--text3);
  border-top: 1px solid var(--border); text-align: center;
  position: sticky; bottom: 0; background: var(--surface2);
}

/* Le graphe du comparatif porte quatre courbes sur deux axes : les 160 px du
   format commun les tassent au point de rendre les écarts illisibles, alors
   que c'est précisément ce qu'on vient y lire. */
#ffChartBlock .chart-wrapper { height: 460px; }

@media (max-width: 620px) {
  #ffChartBlock .chart-wrapper { height: 340px; }
}

/* Plus-value : la lecture que l'on vient chercher. Placée avant le tableau,
   elle donne la conclusion sans obliger à la reconstituer depuis les courbes. */
.ff-pv {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 16px;
}
.ff-pv.hidden { display: none; }
.ff-pv-titre {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 10px;
}
.ff-pv-items { display: flex; flex-wrap: wrap; gap: 24px; }
.ff-pv-item { display: flex; flex-direction: column; gap: 2px; }
.ff-pv-mesure { font-size: .72rem; color: var(--text2); }
.ff-pv-val { font-size: 1.15rem; font-weight: 800; color: var(--text); }

/* L'onglet est une colonne flex qui défile : sans cette consigne, les blocs à
   hauteur fixe se laissent comprimer au lieu de déborder, et le défilement
   n'a alors rien à faire défiler. */
#tab-faceaface > * { flex-shrink: 0; }

/* Résumé de la sortie choisie : ce qu'on veut vérifier d'un coup d'œil avant
   de comparer — la bonne sortie, la bonne distance. */
.ff-card-stats {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 6px; font-size: .78rem; font-weight: 600; color: var(--text);
}
.ff-card-stats .ff-sep { color: var(--text3); font-weight: 400; }

/* Résumé dans la liste de résultats : plus discret que sur la fiche choisie,
   la ligne doit rester lisible sans concurrencer le nom de la sortie. */
.ff-result-stats {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin-top: 2px; font-size: .72rem; color: var(--text2); font-weight: 600;
}
.ff-result-stats .ff-sep { color: var(--text3); font-weight: 400; }
.ff-result { align-items: flex-start; }
.ff-result-icon { margin-top: 2px; }

/* En-tête sur deux lignes : le nom, puis la date qui le désambiguïse. */
.ff-table thead th { vertical-align: bottom; }
.ff-th-nom  { display: block; }
.ff-th-date {
  display: block; margin-top: 3px;
  font-size: .68rem; font-weight: 500; text-transform: none;
  letter-spacing: 0; color: var(--text3);
}

/* Colonne de gauche : elle nomme la grandeur comparée. Trop pâle, la ligne
   se lit comme trois nombres sans objet. */
.ff-table tbody th {
  color: var(--text); font-weight: 700;
  white-space: nowrap; width: 1%;
}

/* Température par plages. Le blanc du grand froid est volontairement le plus
   lumineux : sous deux degrés, c'est l'information la plus saillante d'une
   sortie. */
.temp-chaud { color: #ff5a5a; }
.temp-doux  { color: #ff8c42; }
.temp-frais { color: #4ea8ff; }
.temp-froid { color: #ffffff; }

/* ── Face à face : parcours guidé ─────────────────────────────────────────
   Une course, puis l'autre, puis la comparaison. L'en-tête dit toujours où
   l'on en est : un formulaire qui change de contenu sans le dire se lit comme
   un bug. */
.ff-entete {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 0 0 12px;
}
.ff-rang {
  font-size: .7rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 999px; padding: 4px 10px;
}
.ff-consigne { font-size: .9rem; color: var(--text2); }

.ff-actions { display: flex; gap: 10px; margin-bottom: 20px; }
.ff-actions.hidden { display: none; }
.ff-btn {
  border-radius: 9px; padding: 10px 20px; font-size: .85rem; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border2);
  background: var(--surface2); color: var(--text);
}
.ff-btn-valider { background: var(--accent); border-color: var(--accent); color: #06101f; }
/* Un bouton inactif doit se voir inactif : sinon on clique, rien ne se passe,
   et c'est l'application qui semble cassée. */
.ff-btn-valider:disabled {
  opacity: .45; cursor: not-allowed; background: var(--surface2);
  border-color: var(--border2); color: var(--text3);
}
.ff-btn-retour.hidden { display: none; }

/* Rappel des deux sorties au-dessus de la comparaison : le volet des
   résultats ne montre plus les sélecteurs. */
.ff-recap {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 18px;
}
.ff-recap-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ff-recap-icon { font-size: 1.2rem; }
.ff-recap-texte { display: flex; flex-direction: column; min-width: 0; }
.ff-recap-nom {
  font-weight: 600; font-size: .88rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ff-recap-date { font-size: .74rem; color: var(--text3); }
.ff-recap-mod {
  background: transparent; border: 1px solid var(--border2); color: var(--text2);
  border-radius: 7px; padding: 4px 10px; font-size: .72rem; cursor: pointer;
}
.ff-recap-vs {
  font-size: .74rem; font-weight: 700; text-transform: uppercase;
  color: var(--text3); letter-spacing: .06em;
}
.ff-recap-reset { margin-left: auto; padding: 6px 14px; font-size: .78rem; }

@media (max-width: 620px) {
  .ff-recap { flex-direction: column; align-items: stretch; }
  .ff-recap-vs { text-align: center; }
  .ff-recap-reset { margin-left: 0; }
  .ff-actions .ff-btn { flex: 1; }
}

/* ── Programme en cours : agenda horizontal ───────────────────────────────
   Huit semaines font vingt-quatre colonnes : aucune largeur d'écran ne les
   tient, le défilement est donc horizontal et confiné à ce bloc — jamais au
   corps de la page. */
.prog-agenda {
  display: flex; flex-direction: column; gap: 8px;
}
.prog-jour {
  display: flex; align-items: stretch; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-left: 3px solid var(--border2);
  border-radius: 12px; padding: 10px 12px;
}
/* Trois états, trois lectures : ce qui est derrière s'efface, ce qui vient
   se signale. Sans cette distinction l'agenda ne dit pas où l'on en est. */
.prog-jour.passe { opacity: .5; }
.prog-jour.aujourdhui { border-left-color: var(--accent); }
.prog-jour.futur { border-left-color: var(--border2); }
.prog-jour-tete {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 0 0 66px;
  border-right: 1px solid var(--border); padding-right: 12px;
}
.prog-jour-corps { flex: 1; min-width: 0; }
.prog-jour-prochain {
  margin-top: 4px; font-size: .6rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 999px; padding: 2px 6px;
}
.prog-jour-nom  { font-size: .72rem; text-transform: uppercase; color: var(--text3); }
.prog-jour-num  { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.prog-jour-mois { font-size: .72rem; color: var(--text3); }
.prog-jour-seance {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: 8px; cursor: pointer;
  background: var(--surface3); margin-bottom: 6px;
}
.prog-jour-seance:last-child { margin-bottom: 0; }
.prog-jour-seance:hover { background: var(--surface); }
/* Détail d'une séance : replié par défaut, ouvert au clic. Une séance en
   contient jusqu'à une dizaine de lignes — toutes ouvertes, l'agenda ne se
   lirait plus. */
.prog-jour-detail {
  margin: -2px 0 6px 8px; padding: 8px 10px;
  border-left: 2px solid var(--border2);
  font-size: .78rem; color: var(--text2); line-height: 1.45;
}
.prog-jour-detail.hidden { display: none; }
.prog-jour-detail .wk-steps-line { white-space: pre-wrap; }
.prog-jour-titre { font-size: .82rem; line-height: 1.3; }
.prog-agenda-vide {
  padding: 18px; border: 1px dashed var(--border2); border-radius: 12px;
  color: var(--text3); font-size: .86rem;
}
.prog-agenda-vide.hidden { display: none; }

/* Indicateur d'avancement : deux chiffres et une jauge. On veut savoir où
   l'on en est d'un coup d'œil, pas compter les lignes de l'agenda. */
.prog-avancement {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.prog-avancement.hidden { display: none; }
.prog-av-chiffres { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.prog-av-fait  { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.prog-av-sur   { font-size: .82rem; color: var(--text2); }
.prog-av-reste { margin-left: auto; font-size: .78rem; color: var(--text3); }
.prog-av-jauge {
  height: 6px; border-radius: 999px; background: var(--surface3); overflow: hidden;
}
.prog-av-jauge > div { height: 100%; background: var(--accent); border-radius: 999px; }

/* Groupe de programme replié : l'en-tête reste, le corps disparaît. */
.wk-group.replie .wk-group-body { display: none; }
.wk-group-head { cursor: pointer; }
.wk-group-fleche { display: inline-block; width: 12px; color: var(--text3); }

/* Œil : ouvre la transcription Garmin d'une séance, à côté de son titre. */
.prog-oeil {
  background: transparent; border: none; cursor: pointer;
  font-size: .95rem; padding: 0 6px; opacity: .55;
}
.prog-oeil:hover { opacity: 1; }
.prog-apercu {
  margin-top: 6px; padding: 8px 10px;
  border-left: 2px solid var(--accent);
  background: var(--surface3); border-radius: 0 8px 8px 0;
  font-size: .76rem; color: var(--text2); line-height: 1.5;
}
.prog-apercu.hidden { display: none; }

/* Aperçu Garmin : une carte par étape, liseré coloré par nature. Reprendre
   la présentation de la montre permet de comparer les deux sans traduire. */
.apercu-carte {
  background: var(--surface2); border: 1px solid var(--border);
  border-left: 4px solid var(--border2);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 6px;
}
.apercu-carte.warmup   { border-left-color: #e4483a; }
.apercu-carte.interval { border-left-color: #2f6fd0; }
.apercu-carte.rest     { border-left-color: #9aa3b5; }
.apercu-carte.cooldown { border-left-color: #2e9e5b; }
.apercu-titre { font-size: .76rem; color: var(--text2); margin-bottom: 4px; }
.apercu-mesures { display: flex; flex-wrap: wrap; gap: 18px; }
.apercu-mesure { display: flex; flex-direction: column; }
.apercu-valeur { font-size: .92rem; font-weight: 700; color: var(--text); }
.apercu-libelle { font-size: .68rem; color: var(--text3); }
.apercu-note {
  margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border);
  font-size: .7rem; color: var(--text3);
}
/* Bloc répété : ses cartes sont décalées, le nombre reste en tête. */
.apercu-bloc {
  border-left: 2px dashed var(--border2); padding-left: 8px; margin-bottom: 6px;
}
.apercu-bloc-tete {
  font-size: .72rem; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px;
}

/* En-tête du détail d'une séance : quand, puis ce qui est prévu. */
.prog-detail-date {
  font-size: .8rem; font-weight: 600; color: var(--text);
  margin-bottom: 8px;
}
.prog-detail-notes {
  background: var(--surface3); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 10px;
  font-size: .74rem; color: var(--text2); line-height: 1.5;
}
.prog-detail-notes-t {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text3); margin-bottom: 4px;
}


/* ============================================================
   SUPPORT (tickets)
   ============================================================ */
#headerAdminWrap { display: inline-flex; }
/* Le guichet reste en bas du rail : ce n'est pas une rubrique de plus dans la
   liste, c'est le recours quand le reste n'a pas marche. */
#tabGroupAide { margin-top: auto; }
/* Rail replie : l'intitule est masque, sa marge ne pousse donc plus rien —
   le bouton prend le relais. */
.tabs:not(:hover):not(.flyout-open) #tabSupport { margin-top: auto; }
.sup-intro {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 14px;
}
.sup-intro-icon { font-size: 1.4rem; line-height: 1; }
.sup-intro-text { margin: 0; color: var(--text2); font-size: 0.82rem; line-height: 1.5; }
.sup-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.sup-form-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}
.sup-hint { font-size: 0.75rem; color: var(--text3); }
.sup-hint.error { color: var(--red); }
.sup-list { display: flex; flex-direction: column; gap: 12px; }
.sup-ticket {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
}
.sup-ticket-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.sup-ticket-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem; color: var(--text3);
}
.sup-ticket-sujet { font-weight: 600; font-size: 0.9rem; flex: 1; min-width: 160px; }
.sup-ticket-meta { font-size: 0.72rem; color: var(--text3); }
.sup-statut { font-size: 0.68rem; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); }
.sup-statut.open { color: var(--accent); border-color: var(--accent); }
.sup-statut.closed { color: var(--text3); }
.sup-statut.resolved { color: var(--green); border-color: rgba(60,200,120,.4); }
.sup-fil { display: flex; flex-direction: column; gap: 8px; }
.sup-msg {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 10px; max-width: 88%;
}
/* Le message de l'equipe se distingue d'un coup d'oeil : sans cela, un fil de
   six messages devient illisible. */
.sup-msg.equipe { align-self: flex-end; background: var(--surface2); border-color: var(--border2); }
.sup-msg-auteur { font-size: 0.7rem; color: var(--text3); margin-bottom: 3px; }
/* Le corps est du texte brut : les retours a la ligne comptent, le balisage
   non (il est echappe avant d'arriver ici). */
.sup-msg-corps { font-size: 0.82rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.sup-actions { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; }
.sup-actions textarea { flex: 1; min-height: 60px; }

/* Admin > Programmes : catalogue puis editeur de la version courante. */
.prog-admin-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.prog-admin-tuile {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--text); cursor: pointer; position: relative;
}
.prog-admin-tuile:hover { border-color: var(--border2); }
.prog-admin-tuile.retouche { border-color: var(--accent); }
.prog-admin-titre { font-weight: 600; }
.prog-admin-meta { font-size: 0.74rem; color: var(--text2); }
.prog-admin-flag {
  position: absolute; top: 6px; right: 8px; font-size: 0.66rem;
  color: var(--accent); text-transform: uppercase; letter-spacing: .04em;
}
.prog-admin-editor { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.prog-admin-note { font-size: 0.78rem; color: var(--text2); margin-bottom: 10px; }
.prog-admin-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-bottom: 14px; }
.prog-admin-champ { display: flex; flex-direction: column; gap: 3px; }
.prog-admin-seance { padding: 8px 0 8px 10px; border-left: 2px solid var(--border); margin: 8px 0; }
.prog-seance-verifiee { border-left-color: var(--green); opacity: 0.85; }
.prog-seance-verifiee .wk-input, .prog-seance-verifiee .prog-desc-champ { color: var(--text2); cursor: default; }
.prog-seance-coche input:checked ~ * { color: var(--green); font-weight: 600; }
.prog-admin-seance textarea.wk-input { width: 100%; margin-top: 6px; font-family: inherit; }
@media (max-width: 640px) {
  .prog-admin-list { grid-template-columns: 1fr; }
  .prog-admin-champs { grid-template-columns: 1fr; }
}

/* Admin > Programmes : transcription saisie etape par etape. */
.prog-admin-etapes { margin: 6px 0; }
.prog-admin-etape {
  padding: 6px 8px; margin: 4px 0; border: 1px solid var(--border);
  border-radius: 6px; background: var(--card);
}
.prog-admin-bloc {
  padding: 6px 8px; margin: 6px 0; border: 1px solid var(--accent);
  border-radius: 6px;
}
.prog-admin-bloc .prog-admin-etape { margin-left: 12px; }
.etape-valeur { max-width: 90px; }
.etape-borne { max-width: 130px; }

/* Admin > Programmes : une seance tient sur une ligne, ses champs en grille.
   `.wk-input` est en width:100% — dans un conteneur flex, chaque champ prenait
   donc toute la ligne, d'ou la colonne de boites. */
.prog-seance-resume {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 6px 4px; list-style: none;
}
.prog-seance-resume::-webkit-details-marker { display: none; }
.prog-seance-resume::before { content: "\25B8"; color: var(--text2); font-size: 0.8rem; }
details[open] > .prog-seance-resume::before { content: "\25BE"; }
.prog-seance-titre { font-weight: 600; flex: 1; }
.prog-seance-coche {
  display: flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: 0.74rem; color: var(--text2);
}
.prog-seance-marque {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent);
}
.prog-seance-grille {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px; margin: 6px 0;
}
.prog-admin-details > summary {
  cursor: pointer; color: var(--text2); font-size: 0.8rem; padding: 4px 0;
  margin-bottom: 6px;
}
.prog-admin-compteur { font-size: 0.7rem; color: var(--text2); }
.prog-admin-compteur.complet { color: var(--green, #4ade80); }
.vma-unit-fixe { color: var(--text2); font-size: 0.8rem; align-self: center; }
@media (max-width: 640px) {
  .prog-seance-grille { grid-template-columns: 1fr; }
}

/* Code couleur des etapes, repris de Garmin : on lit une seance d'un coup
   d'oeil sans lire les mots. */
.prog-admin-etape, .prog-admin-bloc { border-left: 4px solid var(--border); }
.etape-rouge { border-left-color: #e2483d; }
.etape-bleu  { border-left-color: #2b6cd4; }
.etape-gris  { border-left-color: #8a8f98; }
.etape-vert  { border-left-color: #2f9e57; }

/* Admin > Programmes : groupes par distance, et la transcription en fenetre. */
.prog-admin-groupe {
  cursor: pointer; font-weight: 600; padding: 8px 4px; list-style: none;
}
.prog-admin-groupe::-webkit-details-marker { display: none; }
.prog-admin-groupe::before { content: "\25B8"; color: var(--text2); margin-right: 6px; }
details[open] > .prog-admin-groupe::before { content: "\25BE"; }
.prog-fenetre { align-items: flex-start; overflow-y: auto; padding: 24px 12px; }
/* `.login-overlay` peint un voile (`::after`) et une photo floutee
   (`::before`) par-dessus ses enfants en flux normal. Une boite qui ne se
   souleve pas passe dessous : grisee, et surtout intouchable — le voile
   recoit les clics a sa place, et le gestionnaire de fermeture les prend pour
   des clics sur le fond. `.login-stage` et `.story-picker-card` font de meme
   depuis toujours. */
.prog-fenetre::before { display: none; }
.prog-fenetre-boite {
  position: relative; z-index: 1;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; width: min(900px, 100%); margin: auto;
}
.prog-fenetre-deroule {
  background: var(--surface2); border-radius: 8px; padding: 8px 10px;
  margin-bottom: 12px; line-height: 1.5;
}

/* Fenetre de transcription : la disposition de Garmin — bandeau de blocs,
   cartes en lecture, panneau d'edition sur une seule etape. */
.garmin-bandeau { display: flex; gap: 4px; margin: 10px 0 14px; }
.bandeau-bloc {
  height: 46px; border: none; border-radius: 4px; cursor: pointer;
  background: var(--surface2); border-top: 6px solid var(--border);
}
.bandeau-bloc.etape-rouge { background: rgba(226,72,61,.25); border-top-color: #e2483d; }
.bandeau-bloc.etape-bleu  { background: rgba(43,108,212,.25); border-top-color: #2b6cd4; }
.bandeau-bloc.etape-gris  { background: rgba(138,143,152,.25); border-top-color: #8a8f98; }
.bandeau-bloc.etape-vert  { background: rgba(47,158,87,.25); border-top-color: #2f9e57; }
.bandeau-bloc.actif { transform: translateY(-4px); box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.garmin-fenetre-corps { display: flex; gap: 16px; align-items: flex-start; }
.garmin-liste { flex: 1; min-width: 0; }
.garmin-colonne { width: 210px; display: flex; flex-direction: column; gap: 8px; }
.garmin-carte {
  background: var(--surface2); border-radius: 8px; padding: 10px 12px;
  margin-bottom: 8px; cursor: pointer; border-left: 4px solid var(--border);
  position: relative;
}
.drag-handle {
  float: right; cursor: grab; color: var(--text2); font-size: 1.1rem;
  padding: 0 4px; user-select: none; touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.sortable-ghost { opacity: 0.35; background: var(--accent-dim, var(--border)); }
.garmin-carte:hover { background: var(--card); }
.garmin-carte-titre { font-weight: 600; margin-bottom: 6px; }
.garmin-carte-mesures { display: flex; gap: 28px; flex-wrap: wrap; }
.garmin-mesure { display: flex; flex-direction: column; }
.garmin-mesure-valeur { font-size: 0.95rem; }
.garmin-mesure-libelle { font-size: 0.7rem; color: var(--text2); }
.garmin-carte-note { font-size: 0.72rem; color: var(--text2); margin-top: 4px; }
.garmin-panneau {
  border: 2px solid var(--accent); border-radius: 8px; padding: 12px;
  margin-bottom: 8px; background: var(--card);
}
.garmin-panneau-tete {
  background: var(--surface2); margin: -12px -12px 12px; padding: 8px 12px;
  border-radius: 6px 6px 0 0; color: var(--text2); font-size: 0.78rem;
}
.garmin-section { border-top: 1px solid var(--border); padding: 10px 0; }
.garmin-section:first-of-type { border-top: none; padding-top: 0; }
.garmin-section-titre { font-weight: 600; margin-bottom: 8px; }
.garmin-champ { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.garmin-champ .wk-label { min-width: 96px; }
.garmin-panneau-pied { display: flex; justify-content: flex-end; gap: 8px; }
.garmin-bloc {
  border: 1px solid var(--border); border-left: 4px solid #2f9e57;
  border-radius: 8px; padding: 10px; margin-bottom: 8px;
}
.garmin-bloc-tete { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.garmin-bloc-actions { margin-left: auto; display: flex; gap: 4px; }
@media (max-width: 720px) {
  .garmin-fenetre-corps { flex-direction: column; }
  .garmin-colonne { width: 100%; }
}

/* Admin > Programmes : une barre de filtres, une ligne par programme. */
.prog-admin-filtres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.prog-admin-filtre {
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface2); color: var(--text2); cursor: pointer;
  font-size: 0.76rem;
}
.prog-admin-filtre:hover { border-color: var(--border2); color: var(--text); }
.prog-admin-filtre.actif {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.prog-admin-ligne {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 12px; margin-bottom: 4px; text-align: left; cursor: pointer;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
}
.prog-admin-ligne:hover { border-color: var(--border2); }
.prog-admin-ligne.retouche { border-left: 3px solid var(--accent); }
.prog-admin-ligne .prog-admin-titre { flex: 1; font-weight: 600; }
.prog-admin-ligne .prog-admin-meta { color: var(--text2); font-size: 0.74rem; }
@media (max-width: 640px) {
  .prog-admin-ligne { flex-wrap: wrap; gap: 4px 10px; }
  .prog-admin-ligne .prog-admin-titre { flex: 1 0 100%; }
}

/* Le deroule et les notes forment une seule description : un cadre, deux
   lignes, pas deux boites empilees. */
.prog-seance-description {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface2); padding: 6px 8px; margin: 6px 0;
}
.prog-desc-champ {
  width: 100%; background: transparent; border: none; box-shadow: none;
  outline: none; appearance: none; -webkit-appearance: none;
  color: var(--text); font-family: inherit; font-size: 0.85rem;
  line-height: 1.5; resize: vertical; display: block;
}
.prog-desc-champ + .prog-desc-champ {
  border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px;
  color: var(--text2); font-size: 0.78rem;
}

/* ============================================================
   MOBILE BOTTOM NAV
   ============================================================ */
.mobile-bottom-nav { display: none; }
.mobile-tabs-drawer { display: none; }

@media (max-width: 640px) {
  /* Cacher sidebar, afficher bottom nav */
  .tabs { display: none !important; }
  body { height: auto !important; min-height: 100vh; overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
  #dashboard { height: auto !important; min-height: 100vh; }
  .layout { height: auto !important; min-height: calc(100vh - 60px); }
  .main {
    margin-left: 0 !important;
    padding-bottom: 80px;
    overflow: visible !important;
    height: auto !important;
    flex: none !important;
  }
  .tab-content {
    overflow: visible !important;
    height: auto !important;
    flex: none !important;
  }
  #tab-today, #weekActivitiesGrid, #activitiesGrid {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
    flex: none !important;
  }
  canvas { touch-action: pan-y !important; }
  .layout { padding-left: 0; }

  .mobile-only { display: block !important; }

  /* Header mobile : masquer cloche, bouton admin, collapse, logout séparé */
  #notifBtn, #headerAdminBtn { display: none !important; }
  #headerCollapseBtn, #logoutBtn { display: none !important; }
  .sidebar-user-block { display: none !important; }
  .header-user-wrap { border-left: none; padding-left: 0; }

  .mobile-bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    height: 60px;
    background: var(--surface2);
    border-top: 1px solid var(--border);
    align-items: stretch;
  }
  .mobile-nav-btn {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    background: none; border: none; cursor: pointer;
    color: var(--text2); padding: 6px 0;
    transition: color .15s;
  }
  .mobile-nav-btn.active { color: var(--accent); }
  .mobile-nav-icon { font-size: 1.3rem; line-height: 1; }
  .mobile-nav-label { font-size: .65rem; font-weight: 500; }
  .mobile-prog-badge {
    position: absolute; top: -4px; right: -8px;
    background: var(--accent); color: #fff;
    font-size: .55rem; font-weight: 700; line-height: 1;
    padding: 2px 4px; border-radius: 8px; min-width: 14px; text-align: center;
  }

  #mobileMoreBtn { flex: 1; }

  /* Drawer slide-up */
  .mobile-tabs-drawer {
    display: block;
    position: fixed; inset: 0; z-index: 190;
    background: rgba(0,0,0,.5);
    opacity: 0; pointer-events: none;
    transition: opacity .2s;
  }
  .mobile-tabs-drawer.open {
    opacity: 1; pointer-events: auto;
  }
  .mobile-drawer-sheet {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    padding: 12px 16px 80px;
    transform: translateY(100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
  }
  .mobile-tabs-drawer.open .mobile-drawer-sheet {
    transform: translateY(0);
  }
  .mobile-drawer-handle {
    width: 40px; height: 4px; border-radius: 2px;
    background: var(--border); margin: 0 auto 16px;
  }
  .mobile-drawer-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  }
  .mobile-drawer-btn {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; padding: 12px 8px; border-radius: 10px;
    background: var(--surface2); border: none; cursor: pointer;
    color: var(--text); font-size: .75rem; font-weight: 500;
    text-align: center;
  }
  .mobile-drawer-btn-icon { font-size: 1.4rem; }
  .mobile-drawer-btn.active { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
}

/* ============================================================
   DETAIL MODAL (fenêtre plein-écran détail activité)
   ============================================================ */
.act-detail-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.65); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.act-detail-overlay.open { opacity: 1; pointer-events: all; }

.act-detail-modal {
  position: fixed; top: 50%; left: 50%; z-index: 401;
  transform: translate(-50%, -44%) scale(.96);
  width: min(860px, 96vw); max-height: 90vh;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 18px; display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
  opacity: 0; pointer-events: none;
  transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .25s;
}
.act-detail-modal.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1; pointer-events: all;
}

.act-detail-header {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.act-detail-icon {
  font-size: 1.5rem; width: 46px; height: 46px;
  background: var(--surface3); border-radius: 12px;
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.act-detail-title-block { flex: 1; min-width: 0; }
.act-detail-name {
  font-size: 1rem; font-weight: 800; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.act-detail-date { font-size: 0.72rem; color: var(--text2); margin-top: 3px; }
.act-detail-close {
  width: 30px; height: 30px; flex-shrink: 0;
  background: var(--surface3); color: var(--text2);
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
}
.act-detail-close:hover { color: var(--text); border-color: var(--accent); }

.act-detail-body {
  flex: 1; overflow-y: auto; padding: 22px;
  display: flex; flex-direction: column; gap: 24px;
}
.act-detail-body::-webkit-scrollbar { width: 5px; }
.act-detail-body::-webkit-scrollbar-track { background: transparent; }
.act-detail-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.act-detail-loader { text-align: center; padding: 40px; color: var(--text2); }

/* Section title inside detail modal */
.act-detail-section-title {
  font-size: 0.6rem; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .12em;
  margin-bottom: 10px;
}

/* Metrics grid */
.act-detail-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
@media (max-width: 600px) {
  .act-detail-metrics { grid-template-columns: repeat(2, 1fr); }
}
.act-detail-metric {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 11px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.act-detail-metric-val {
  font-size: 1.05rem; font-weight: 800;
  line-height: 1; letter-spacing: -.02em;
}
.act-detail-metric-lbl {
  font-size: 0.58rem; color: var(--text2);
  text-transform: uppercase; letter-spacing: .07em;
}

/* Training effect block */
.act-detail-te {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.act-detail-te-card {
  flex: 1; min-width: 140px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 11px; padding: 12px 14px;
}
.act-detail-te-score {
  font-size: 1.8rem; font-weight: 900; letter-spacing: -.04em;
  line-height: 1;
}
.act-detail-te-label {
  font-size: 0.68rem; font-weight: 600; margin-top: 2px;
  text-transform: uppercase; letter-spacing: .06em;
}
.act-detail-te-sub {
  font-size: 0.72rem; color: var(--text2); margin-top: 4px;
  line-height: 1.4;
}

/* Charts row */
.act-detail-charts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 640px) {
  .act-detail-charts { grid-template-columns: 1fr; }
}
.act-detail-chart-block {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.act-detail-chart-block canvas { width: 100% !important; max-height: 180px; }

/* Laps table */
.act-detail-laps { overflow-x: auto; }
.act-detail-laps table {
  width: 100%; border-collapse: collapse;
  font-size: 0.78rem; white-space: nowrap;
}
.act-detail-laps th {
  font-size: 0.58rem; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--border);
}
.act-detail-laps th:first-child { text-align: center; }
.act-detail-laps td {
  padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--border);
  color: var(--text2);
}
.act-detail-laps td:first-child { text-align: center; font-weight: 700; color: var(--text3); }
.act-detail-laps tr:last-child td { border-bottom: none; }
.act-detail-laps tr:hover td { background: var(--surface3); }
.act-detail-laps .lap-pace { color: var(--orange); font-weight: 600; }
.act-detail-laps .lap-hr   { color: var(--red); }
.act-detail-laps tfoot tr.lap-recap td {
  border-top: 1px solid var(--border2); border-bottom: none;
  color: var(--text); font-weight: 700; background: var(--surface3);
}
.act-detail-laps tfoot tr.lap-recap .lap-pace { color: var(--orange); }
.act-detail-laps tfoot tr.lap-recap .lap-hr   { color: var(--red); }

/* Cadence zone table */
.cadence-alert {
  background: color-mix(in srgb, var(--yellow) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--yellow) 40%, transparent);
  border-radius: 10px; padding: 10px 14px;
  font-size: 0.82rem; color: var(--text2); line-height: 1.5;
  margin-bottom: 12px;
}
.cadence-alert strong { color: var(--text); }
.cadence-table table { white-space: normal; }
.cadence-table th { text-align: left !important; }
.cadence-table th:nth-child(2) { text-align: center !important; white-space: nowrap; }
.cadence-table td { white-space: normal; line-height: 1.4; text-align: left; }
.cadence-table td:nth-child(2) { text-align: center; white-space: nowrap; font-weight: 600; color: var(--text); }
.cadence-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 7px; flex-shrink: 0; vertical-align: middle;
}
tr.cadence-zone-active td {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text) !important; font-weight: 600;
}

/* Btn détail on activity card */
.act-card-detail-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px;
  padding: 4px 10px; border-radius: 7px;
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text2); font-size: 0.7rem; font-weight: 600;
  cursor: pointer; letter-spacing: .03em;
  transition: color .15s, border-color .15s, background .15s;
}
.act-card-detail-btn:hover {
  color: var(--accent); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* ============================================================
   PAGE D'ACCUEIL PUBLIQUE
   Reprend les tokens du theme : aucune palette nouvelle.
   `html, body` sont en `overflow: hidden` pour l'application ;
   l'accueil est la seule vue qui doit defiler, d'ou son propre
   `overflow-y` plutot qu'un assouplissement global.
   ============================================================ */
/* `html, body` sont figes (`height: 100vh; overflow: hidden`) pour
   l'application, qui gere ses propres zones de defilement. L'accueil est la
   seule vue qui doit defiler comme une page ordinaire : on lui rend le
   defilement du document plutot que de lui donner le sien.

   Un conteneur `position: fixed` avec son propre `overflow-y` defile bien au
   doigt et a la molette, mais prive la page de sa barre de defilement et rend
   le clavier inerte : Espace, Page suivante et les fleches visent `body`, qui
   ne bouge pas. Invisible sur telephone, bloquant sur ordinateur. */
html.landing-actif,
body.landing-actif {
  height: auto;
  overflow-y: auto;
}

.landing {
  position: relative;
  z-index: 1;
  /* `svh` suit la barre d'adresse des navigateurs mobiles, la ou `vh` mesure
     la fenetre sans elle : le bloc depassait d'autant au chargement. */
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(1100px 600px at 50% -10%, rgba(79,142,247,.16), transparent 70%),
    var(--bg);
  padding: 0 24px 56px;
}
.landing.hidden { display: none; }

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 0;
}
.landing-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .2px;
}
.landing-nav-logo { width: 30px; height: 30px; object-fit: contain; }
.landing-nav-actions { display: flex; gap: 10px; }

.landing-btn,
.landing-btn-ghost {
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.landing-btn {
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--glow-blue);
}
.landing-btn:hover { transform: translateY(-1px); box-shadow: 0 0 22px rgba(79,142,247,.38); }
.landing-btn-ghost {
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text);
}
.landing-btn-ghost:hover { background: var(--surface2); }
.landing-btn-lg { padding: 14px 28px; font-size: 1.02rem; }

.landing-hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 0 64px;
  text-align: center;
}
.landing-title {
  font-size: clamp(2rem, 5.2vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -.5px;
  margin-bottom: 22px;
}
.landing-lead {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text2);
  max-width: 640px;
  margin: 0 auto 32px;
}
.landing-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.landing-cta-note { margin-top: 16px; font-size: .86rem; color: var(--text3); }

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto 72px;
}
.landing-feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
}
.landing-feature-icon { color: var(--accent); margin-bottom: 12px; line-height: 0; }

/* Capture du mode démo : le produit, avant les promesses. */
.landing-apercu {
  display: block;
  width: 100%; max-width: 1120px; height: auto;
  margin: 0 auto 64px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}

.landing-bloc { max-width: 1120px; margin: 0 auto 64px; }
.landing-bloc-titre { font-size: 1.4rem; margin-bottom: 20px; text-align: center; }
.landing-etapes, .landing-donnees {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.landing-etapes { counter-reset: etape; }
.landing-etapes li, .landing-donnees li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 6px;
}
.landing-etapes li::before {
  counter-increment: etape;
  content: counter(etape);
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .9rem;
  margin-bottom: 6px;
}
.landing-etapes span, .landing-donnees span { color: var(--text2); font-size: .92rem; line-height: 1.6; }
.landing-donnees-lien { text-align: center; margin-top: 18px; font-size: .9rem; }

/* Installer sur le téléphone : la capture à gauche, les deux tutos à droite ;
   la capture passe au-dessus sous 720 px. */
.landing-installer-intro {
  text-align: center; color: var(--text2); max-width: 560px;
  margin: -8px auto 24px; line-height: 1.6;
}
.landing-installer {
  display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: center;
}
.landing-installer-capture {
  width: 100%; height: auto;
  border: 1px solid var(--border2); border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.landing-installer-cartes {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.landing-installer-carte {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.landing-installer-carte h3 { font-size: 1.05rem; margin-bottom: 12px; }
.landing-installer-carte ol {
  margin: 0; padding-left: 20px;
  color: var(--text2); font-size: .92rem; line-height: 1.7;
}
.landing-installer-carte strong { color: var(--text); }
.landing-installer-picto { vertical-align: -3px; color: var(--accent); }
.landing-installer-bouton { margin-bottom: 14px; }
@media (max-width: 720px) {
  .landing-installer { grid-template-columns: 1fr; }
  .landing-installer-capture { max-width: 220px; margin: 0 auto; }
}
.landing-donnees-lien a { color: var(--accent); }
.landing-feature h2 { font-size: 1.02rem; margin-bottom: 8px; }
.landing-feature p { font-size: .92rem; line-height: 1.6; color: var(--text2); }

.landing-footer {
  max-width: 1120px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding-top: 40px;
}
.landing-footer-cols {
  display: grid;
  /* `auto-fit` replie la grille des qu'une colonne n'a plus sa place. Trois
     colonnes imposees tiennent tant qu'il y a la largeur, et debordent
     sinon — entre 820 et 1100 px notamment. */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
}
.landing-footer-col h3 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text3);
  margin-bottom: 14px;
}
.landing-footer-col a,
.landing-footer-link {
  display: block;
  font: inherit;
  font-size: .92rem;
  color: var(--text2);
  text-decoration: none;
  text-align: left;
  /* Au doigt, un lien de 20 px de haut se rate une fois sur deux. La zone
     cliquable est portee a 44 px, la recommandation courante. */
  padding: 10px 0;
  min-height: 44px;
  margin-bottom: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.landing-footer-col a:hover,
.landing-footer-link:hover { color: var(--accent); }
.landing-footer-note {
  font-size: .84rem;
  line-height: 1.55;
  color: var(--text3);
  margin-top: 10px;
}
.landing-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text3);
}
.landing-footer-disclaim { max-width: 460px; line-height: 1.5; }

/* Tablette et fenetre reduite : le pied de page tenait sur trois colonnes de
   352 px jusqu'a deborder. La grille se replie desormais seule, on resserre
   seulement les marges. */
@media (max-width: 1100px) {
  .landing-hero { padding: 60px 0 52px; }
  .landing-footer-cols { gap: 24px; }
}

@media (max-width: 820px) {
  .landing { padding: 0 16px 40px; }
  .landing-hero { padding: 48px 0 44px; }
  .landing-lead { font-size: 1rem; }
  .landing-footer-cols { grid-template-columns: 1fr; gap: 20px; }
  .landing-footer-bottom { flex-direction: column; gap: 12px; }
  .landing-nav { flex-wrap: wrap; }
  .landing-cta .landing-btn-lg { width: 100%; }
}

/* Telephone : la marque et les deux boutons ne tiennent plus sur une ligne.
   On empile, et les boutons prennent toute la largeur — plus faciles a
   viser au pouce. */
@media (max-width: 520px) {
  .landing { padding: 0 14px 32px; }
  .landing-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px 0 8px;
  }
  .landing-nav-brand { justify-content: center; }
  .landing-nav-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .landing-nav-actions button { width: 100%; }
  .landing-hero { padding: 32px 0 36px; }
  .landing-title { margin-bottom: 16px; }
  .landing-lead { margin-bottom: 24px; }
  .landing-cta { flex-direction: column; }
  .landing-cta .landing-btn-lg { padding: 14px 20px; }
  .landing-features { gap: 14px; margin-bottom: 48px; }
  .landing-feature { padding: 20px 18px; }
  .landing-footer { padding-top: 28px; }
  .landing-footer-disclaim { max-width: none; }
}

/* ============================================================
   ANNEAUX DE REPARTITION
   Loges dans les emplacements libres de la grille des metriques :
   meme carte que leurs voisines, donc meme rangee et meme hauteur.
   ============================================================ */
.anneau-mini {
  gap: 4px;
  /* Deux colonnes : etroites, la legende et la mention se repliaient
     differemment selon la mesure, et la hauteur suivait. Larges, tout tient
     sur une ligne quelle que soit la mesure. */
  grid-column: span 2;
  /* Hauteur fixe, et non un plancher : un plancher empeche de retrecir mais
     laisse grandir, donc la rangee se desalignait encore des qu'une mention
     passait sur deux lignes. */
  height: 186px;
  overflow: hidden;
}

.anneau-mini-select {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: .66rem;
  padding: 2px 5px;
  /* Sur la ligne du titre, calee a droite : elle n'occupe plus une ligne a
     elle seule, et le tableau de bord regagne la place. */
  margin-left: auto;
  max-width: 132px;
}

.anneau-mini-corps {
  display: flex; align-items: center; gap: 14px;
  flex: 1; min-height: 0;
  /* Hauteur de carte fixe : ce qui ne tient pas doit etre contenu, jamais
     remonter par-dessus le selecteur qui precede. */
  overflow: hidden;
}
.anneau-mini-canvas {
  width: 92px; flex: 0 0 92px;
  height: 92px; max-height: 100%;
}
.anneau-mini-legende { flex: 1; min-width: 0; }

.anneau-ligne {
  display: grid;
  grid-template-columns: 40px 88px 1fr 50px;
  align-items: center; gap: 5px;
  font-size: .64rem; color: var(--text2);
  line-height: 1.48;
}
.anneau-pct { text-align: right; color: var(--text); font-weight: 600; }
.anneau-nom {
  color: var(--text2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.anneau-valeur {
  text-align: right; color: var(--text3);
  /* « 43.7 km » coupe en deux lignes faisait grandir la carte et
     desalignait toute la rangee de metriques. */
  white-space: nowrap;
}
/* La barre donne d'un coup d'oeil ce que le pourcentage demande de lire :
   quelle tranche domine. Elle est fine pour tenir dans la carte. */
.anneau-barre {
  height: 6px; border-radius: 99px;
  background: var(--surface3); overflow: hidden;
}
.anneau-barre-pleine { display: block; height: 100%; border-radius: 99px; }

.anneau-mini-note {
  font-size: .58rem; line-height: 1.3; color: var(--text3);
  padding-top: 3px; margin-top: 0;
  /* Une seule ligne, coupee si besoin : la carte ayant une hauteur fixe, un
     retour a la ligne rognerait la legende au lieu d'agrandir la carte. Le
     texte complet reste dans l'infobulle. */
  height: 1.5em;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

.anneau-mini .empty-state { font-size: .64rem; padding: 6px 0; }

@media (max-width: 900px) {
  /* La grille passe a deux colonnes : « span 2 » vaut alors toute la
     largeur, et la carte peut respirer en hauteur. */
  .anneau-mini { height: auto; min-height: 186px; }
  .anneau-mini-corps { gap: 10px; }
}

/* ============================================================
   CHOIX DU RENDU D'UNE STORY
   Deux tuiles, du meme format que les cartes qui suivent : on choisit
   comme on choisit une carte, pas en filtrant une grille.
   ============================================================ */
.story-rendu-tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 8px auto 4px;
  max-width: 520px;
}
.story-rendu-tuiles.hidden { display: none; }

.story-rendu-tuile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px 18px;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, transform .12s, background .15s;
}
.story-rendu-tuile:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.story-rendu-tuile:disabled { opacity: .5; cursor: not-allowed; }

.story-rendu-apercu {
  position: relative;
  display: block;
  width: 135px; height: 240px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.story-rendu-apercu canvas { display: block; width: 100%; height: 100%; }

/* Le parcours bouge, mais une tuile figée une seconde ressemblerait à
   l'autre : le symbole de lecture lève le doute d'emblée. */
.story-rendu-play {
  position: absolute; right: 8px; bottom: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); color: #fff; font-size: .62rem;
  backdrop-filter: blur(2px);
}

.story-rendu-icone { font-size: 1.9rem; line-height: 1; }
.story-rendu-titre { font-size: .98rem; font-weight: 700; color: var(--text); }
.story-rendu-hint {
  font-size: .76rem; color: var(--text2); text-align: center; line-height: 1.45;
}

#storyRetourRendu.hidden { display: none; }

/* ============================================================
   SÉANCES MANQUANTES D'UN PROGRAMME
   ============================================================ */
.prog-manquantes { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.prog-manquantes.hidden { display: none; }

.prog-manquantes-bloc {
  background: color-mix(in srgb, var(--orange) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.prog-manquantes-tete {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.prog-manquantes-tete strong { color: var(--orange); }
.prog-manquantes-tete span { font-size: .82rem; color: var(--text2); }
.prog-manquantes-note {
  font-size: .82rem; line-height: 1.5; color: var(--text2); margin-bottom: 10px;
}
.prog-manquantes-liste { list-style: none; margin: 0 0 12px; padding: 0; }
.prog-manquantes-liste li {
  font-size: .86rem; color: var(--text); padding: 3px 0;
  display: flex; gap: 10px;
}
.prog-manquantes-liste li span { color: var(--text3); min-width: 92px; }

/* Vérification impossible : informatif, pas alarmant — rien n'est cassé,
   c'est seulement qu'on ne peut pas comparer. */
.prog-manquantes-muet {
  background: var(--surface);
  border-color: var(--border);
}
.prog-manquantes-muet .prog-manquantes-tete strong { color: var(--text2); }

/* ============================================================
   SÉANCE DE PROGRAMME RETIRÉE DU CALENDRIER
   ============================================================ */
.wk-deplanifiee {
  display: inline-block;
  font-size: .68rem; font-weight: 600;
  color: var(--orange);
  background: color-mix(in srgb, var(--orange) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent);
  border-radius: 99px; padding: 1px 8px; margin-left: 8px;
  vertical-align: middle;
}
.wk-replanifier {
  font: inherit; font-size: .68rem; font-weight: 600;
  color: var(--accent); background: transparent;
  border: 1px solid var(--border2); border-radius: 99px;
  padding: 2px 10px; margin-left: 6px; cursor: pointer;
  vertical-align: middle;
}
.wk-replanifier:hover { background: var(--surface2); color: var(--text); }

/* ============================================================
   PASTILLE ILLUSTRÉE D'UN SPORT
   Elle remplit son conteneur, quel qu'il soit : la carte d'activité, le
   tiroir et la liste des amis ont des tailles différentes.
   ============================================================ */
.sport-pastille {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* ============================================================
   ACTIONS DU PARTAGE
   Des boutons, pas des liens : au milieu d'un écran de tuiles, un lien
   souligné se lit comme une note de bas de page — et sa zone tactile se
   limite à la hauteur du texte, quelques pixels qu'on rate au doigt.
   ============================================================ */
.story-picker-actions {
  display: flex; justify-content: center; align-items: center;
  gap: 10px; flex-wrap: wrap;
  margin-top: 16px;
}

.btn-story-retour,
.btn-story-annuler {
  font: inherit; font-size: .84rem; font-weight: 600;
  border-radius: 99px;
  padding: 9px 20px;
  cursor: pointer;
  min-height: 40px;
  transition: background .15s, border-color .15s, color .15s;
}

.btn-story-retour {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
}
.btn-story-retour:hover { border-color: var(--accent); }

/* Annuler reste une sortie, pas une proposition : moins appuye que les
   retours, mais present sans condition.
   Premiere version : fond et bordure transparents, visibles au seul survol.
   Discret y etait devenu invisible — et sur telephone, ou le survol n'existe
   pas, le bouton ne s'affichait jamais. Il ne restait qu'un mot pose sur le
   fond. */
.btn-story-annuler {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
}
.btn-story-annuler:hover {
  background: var(--surface2);
  border-color: var(--border2);
  color: var(--text);
}

.btn-story-retour.hidden { display: none; }

/* ============================================================
   LECTURE DE LA SORTIE
   Un constat par bloc, teinté par son ton. La bande de gauche porte
   la couleur : un fond teinté sur toute la surface ferait concurrence
   aux graphiques voisins.
   ============================================================ */
.act-analyse { display: flex; flex-direction: column; gap: 10px; }

.act-analyse-item {
  border-left: 3px solid var(--border2);
  background: var(--surface2);
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
}
.act-analyse-item.attention { border-left-color: var(--orange); }
.act-analyse-item.bon       { border-left-color: var(--green); }

.act-analyse-titre {
  font-size: .88rem; font-weight: 700; color: var(--text);
  margin-bottom: 4px;
}
.act-analyse-texte {
  font-size: .82rem; line-height: 1.5; color: var(--text2);
}

/* Une mesure par ligne : « aérobie 3,4/5 » et « anaérobie 0/5 » collés
   l'un à l'autre se lisent comme une seule phrase confuse. */
.act-analyse-ligne {
  font-size: .82rem; line-height: 1.5; color: var(--text);
  margin-bottom: 2px;
}
.act-analyse-ligne + .act-analyse-texte { margin-top: 6px; }

/* ============================================================
   CHARGEUR D'ENREGISTREMENT  (d'après Nawsome, Uiverse.io)
   Douze à quinze secondes sans rien qui bouge passent pour un écran
   bloqué — c'est déjà arrivé quand le décompte gelait. Le chargeur
   occupe le regard et prouve que quelque chose avance.

   Les couleurs viennent du thème : recopiées telles quelles, elles
   juraient sur le fond sombre de l'application.
   ============================================================ */
.story-anneau {
  --bg: var(--surface2);
  --primary1: var(--accent2);
  --primary2: var(--accent);
  --fg-t: rgba(255, 255, 255, 0.35);
  --trans-dur: .3s;

  display: flex;
  justify-content: center;
  /* Le chargeur mesure 14em : la taille de police le ramène à ~145 px, où
     il tient dans la carte de partage sans la faire défiler. */
  font-size: 10.5px;
  margin: 10px 0 2px;
}
.story-anneau.hidden { display: none; }

.pl {
  box-shadow: 2em 0 2em rgba(0, 0, 0, 0.2) inset, -2em 0 2em rgba(255, 255, 255, 0.1) inset;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: rotateX(30deg) rotateZ(45deg);
  width: 14em;
  height: 14em;
  color: var(--text);
}

.pl, .pl__dot { border-radius: 50%; }

.pl__dot {
  animation-name: shadow724;
  box-shadow: 0.1em 0.1em 0 0.1em black, 0.3em 0 0.3em rgba(0, 0, 0, 0.5);
  top: calc(50% - 0.75em);
  left: calc(50% - 0.75em);
  width: 1.5em;
  height: 1.5em;
}

.pl__dot, .pl__dot:before, .pl__dot:after {
  animation-duration: 2s;
  animation-iteration-count: infinite;
  position: absolute;
}

.pl__dot:before, .pl__dot:after {
  content: "";
  display: block;
  left: 0;
  width: inherit;
  transition: background-color var(--trans-dur);
}

.pl__dot:before {
  animation-name: pushInOut1724;
  background-color: var(--bg);
  border-radius: inherit;
  box-shadow: 0.05em 0 0.1em rgba(255, 255, 255, 0.2) inset;
  height: inherit;
  z-index: 1;
}

.pl__dot:after {
  animation-name: pushInOut2724;
  background-color: var(--primary1);
  border-radius: 0.75em;
  box-shadow: 0.1em 0.3em 0.2em rgba(255, 255, 255, 0.4) inset, 0 -0.4em 0.2em #2e3138 inset, 0 -1em 0.25em rgba(0, 0, 0, 0.3) inset;
  bottom: 0;
  clip-path: polygon(0 75%, 100% 75%, 100% 100%, 0 100%);
  height: 3em;
  transform: rotate(-45deg);
  transform-origin: 50% 2.25em;
}

.pl__dot:nth-child(1) {
  transform: rotate(-0deg) translateX(5em) rotate(0deg);
  z-index: 5;
}

.pl__dot:nth-child(1), .pl__dot:nth-child(1):before, .pl__dot:nth-child(1):after {
  animation-delay: 0.0000s;
}
.pl__dot:nth-child(2) {
  transform: rotate(-30deg) translateX(5em) rotate(30deg);
  z-index: 4;
}

.pl__dot:nth-child(2), .pl__dot:nth-child(2):before, .pl__dot:nth-child(2):after {
  animation-delay: -0.1667s;
}
.pl__dot:nth-child(3) {
  transform: rotate(-60deg) translateX(5em) rotate(60deg);
  z-index: 3;
}

.pl__dot:nth-child(3), .pl__dot:nth-child(3):before, .pl__dot:nth-child(3):after {
  animation-delay: -0.3333s;
}
.pl__dot:nth-child(4) {
  transform: rotate(-90deg) translateX(5em) rotate(90deg);
  z-index: 2;
}

.pl__dot:nth-child(4), .pl__dot:nth-child(4):before, .pl__dot:nth-child(4):after {
  animation-delay: -0.5000s;
}
.pl__dot:nth-child(5) {
  transform: rotate(-120deg) translateX(5em) rotate(120deg);
  z-index: 1;
}

.pl__dot:nth-child(5), .pl__dot:nth-child(5):before, .pl__dot:nth-child(5):after {
  animation-delay: -0.6667s;
}
.pl__dot:nth-child(6) {
  transform: rotate(-150deg) translateX(5em) rotate(150deg);
  z-index: 1;
}

.pl__dot:nth-child(6), .pl__dot:nth-child(6):before, .pl__dot:nth-child(6):after {
  animation-delay: -0.8333s;
}
.pl__dot:nth-child(7) {
  transform: rotate(-180deg) translateX(5em) rotate(180deg);
  z-index: 2;
}

.pl__dot:nth-child(7), .pl__dot:nth-child(7):before, .pl__dot:nth-child(7):after {
  animation-delay: -1.0000s;
}
.pl__dot:nth-child(8) {
  transform: rotate(-210deg) translateX(5em) rotate(210deg);
  z-index: 3;
}

.pl__dot:nth-child(8), .pl__dot:nth-child(8):before, .pl__dot:nth-child(8):after {
  animation-delay: -1.1667s;
}
.pl__dot:nth-child(9) {
  transform: rotate(-240deg) translateX(5em) rotate(240deg);
  z-index: 4;
}

.pl__dot:nth-child(9), .pl__dot:nth-child(9):before, .pl__dot:nth-child(9):after {
  animation-delay: -1.3333s;
}
.pl__dot:nth-child(10) {
  transform: rotate(-270deg) translateX(5em) rotate(270deg);
  z-index: 5;
}

.pl__dot:nth-child(10), .pl__dot:nth-child(10):before, .pl__dot:nth-child(10):after {
  animation-delay: -1.5000s;
}
.pl__dot:nth-child(11) {
  transform: rotate(-300deg) translateX(5em) rotate(300deg);
  z-index: 6;
}

.pl__dot:nth-child(11), .pl__dot:nth-child(11):before, .pl__dot:nth-child(11):after {
  animation-delay: -1.6667s;
}
.pl__dot:nth-child(12) {
  transform: rotate(-330deg) translateX(5em) rotate(330deg);
  z-index: 6;
}

.pl__dot:nth-child(12), .pl__dot:nth-child(12):before, .pl__dot:nth-child(12):after {
  animation-delay: -1.8333s;
}

.pl__text {
  font-size: 0.78em;
  max-width: 6rem;
  position: relative;
  text-align: center;
  text-shadow: 0 0 0.1em var(--fg-t);
  /* Contre-rotation : sans elle, le texte penche avec l'anneau. */
  transform: rotateZ(-45deg);
  font-variant-numeric: tabular-nums;
}

@keyframes shadow724 {
  from {
    animation-timing-function: ease-in;
    box-shadow: 0.1em 0.1em 0 0.1em black, 0.3em 0 0.3em rgba(0, 0, 0, 0.3);
  }
  25% {
    animation-timing-function: ease-out;
    box-shadow: 0.1em 0.1em 0 0.1em black, 0.8em 0 0.8em rgba(0, 0, 0, 0.5);
  }
  50%, to {
    box-shadow: 0.1em 0.1em 0 0.1em black, 0.3em 0 0.3em rgba(0, 0, 0, 0.3);
  }
}

@keyframes pushInOut1724 {
  from {
    animation-timing-function: ease-in;
    background-color: var(--bg);
    transform: translate(0, 0);
  }
  25% {
    animation-timing-function: ease-out;
    background-color: var(--primary2);
    transform: translate(-71%, -71%);
  }
  50%, to {
    background-color: var(--bg);
    transform: translate(0, 0);
  }
}

@keyframes pushInOut2724 {
  from {
    animation-timing-function: ease-in;
    background-color: var(--bg);
    clip-path: polygon(0 75%, 100% 75%, 100% 100%, 0 100%);
  }
  25% {
    animation-timing-function: ease-out;
    background-color: var(--primary1);
    clip-path: polygon(0 25%, 100% 25%, 100% 100%, 0 100%);
  }
  50%, to {
    background-color: var(--bg);
    clip-path: polygon(0 75%, 100% 75%, 100% 100%, 0 100%);
  }
}

/* Les billes tournent par animation continue : les arrêter respecte le
   réglage système de ceux que le mouvement gêne. */
@media (prefers-reduced-motion: reduce) {
  .pl__dot, .pl__dot:before, .pl__dot:after { animation: none; }
}
