/* ================================================================
   CAP ENGAGEMENT / APEX — V29
   Portée stricte : body.ce-apex, jamais le parcours Gendarmerie.
   Identité : graphite froid / bleu électrique / surfaces stratifiées.
   AUCUNE règle modifiant grid-template, flex, taille, position ou ordre.
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800;900&display=swap');

body.ce-apex {
  --apex-bg:#0A1020;
  --apex-bg-deep:#080E1B;
  --apex-surface:#121D35;
  --apex-surface-raised:#172542;
  --apex-field:#0E1A30;
  --apex-line:rgba(128,153,209,.20);
  --apex-line-bright:rgba(135,164,239,.34);
  --apex-title:#F4F7FF;
  --apex-text:#E6EDFD;
  --apex-muted:#9CABCA;
  --apex-muted-dim:#8396BA;
  --apex-accent:#7298FF;
  --apex-accent-light:#A9BFFF;
  --apex-accent-dark:#4F71D3;
  --apex-glow:rgba(76,110,222,.18);
  --apex-gradient:linear-gradient(113deg,#4263C2 0%,#6888E9 53%,#91ABFF 100%);
  /* Override the old default theme's variables, not its layout. */
  --ce-bg:var(--apex-bg);
  --ce-bg-2:var(--apex-bg-deep);
  --ce-surface:rgba(18,29,53,.93);
  --ce-surface-2:rgba(16,27,49,.96);
  --ce-field:var(--apex-field);
  --ce-border:var(--apex-line);
  --ce-border-strong:var(--apex-line-bright);
  --ce-text:var(--apex-title);
  --ce-muted:var(--apex-muted);
  --ce-muted-2:var(--apex-muted-dim);
  --ce-accent:var(--apex-accent);
  --ce-accent-2:var(--apex-accent-dark);
  --ce-accent-soft:rgba(114,152,255,.13);
  --ce-shadow:0 20px 52px rgba(0,4,18,.26);
  color-scheme:dark;
  accent-color:var(--apex-accent);
  color:var(--apex-text)!important;
  background:radial-gradient(ellipse at 10% -6%,rgba(65,94,179,.17),transparent 44%),radial-gradient(ellipse at 100% 92%,rgba(44,67,128,.11),transparent 38%),var(--apex-bg)!important;
  background-attachment:fixed!important;
  font-family:'Inter',system-ui,-apple-system,sans-serif!important;
}
/* Public templates retain their centered login/landing composition. */
body.ce-apex.ce-public-apex {background:radial-gradient(ellipse at 15% 8%,rgba(76,113,230,.22),transparent 40%),radial-gradient(ellipse at 85% 86%,rgba(62,92,171,.14),transparent 40%),#0A1020!important;}
body.ce-apex :is(h1,h2,h3,h4,.title,.page-title,.section-title,.card-title,.block-title,.hero-title,.logo,.level-number,.xp-level-number,.stat-value,.score-number,.value,.record-value,.gp-level-number) {
  font-family:'Space Grotesk','Inter',system-ui,sans-serif!important;
  color:var(--apex-title)!important;
  font-variant-numeric:tabular-nums;
}
body.ce-apex :is(.subtitle,.card-text,.sub,.desc,.description,.section-note,.meta,.unit,.kicker,.top .sub,.form-help,.note,.sport-desc,.record-info) {color:var(--apex-muted)!important;}
body.ce-apex :is(.container,.main,.content,.layout,.grid,.stats-grid) {border-color:var(--apex-line);}

/* Brand, headers, nav — spacing and positions inherited unmodified. */
body.ce-apex :is(.header,.topbar,.studio-header,.gp-header,.mini-topbar) {
  background:rgba(10,16,32,.94)!important;
  border-color:var(--apex-line)!important;
  box-shadow:0 9px 28px rgba(2,7,22,.14)!important;
}
body.ce-apex :is(.logo,.studio-brand,.gp-brand) {color:#F4F7FF!important;}
body.ce-apex :is(.logo span,.studio-brand span,.gp-brand span) {
  color:#8EAAFF!important;
  -webkit-text-fill-color:#8EAAFF!important;
}
body.ce-apex :is(.back,.logout,.header-links a,.quick a,.hero-actions a,.nav-btn,.month-nav button,.category-link,.tab,.tabs a,.pill) {
  border-color:var(--apex-line)!important;
  color:var(--apex-text)!important;
}
body.ce-apex :is(.back,.logout,.quick a,.hero-actions a,.nav-btn,.month-nav button):hover {
  border-color:var(--apex-line-bright)!important;
  background-color:rgba(114,152,255,.10)!important;
}
body.ce-apex :is(.active-tab,.tab.active,.tabs .active,.category-link.active,.nav-btn.active,.filter.active,[aria-selected="true"]) {
  color:#DCE6FF!important;border-color:var(--apex-accent)!important;
  background-color:rgba(114,152,255,.15)!important;
}
/* All old blue/white/red decorative separators become one APEX signal. */
body.ce-apex :is(.flag-line,.recap-line,.flag,.france,.tricolor-line,.tricolore,.tricolor) {
  background:linear-gradient(90deg,#4968C6,#93ADFF 73%,rgba(147,173,255,.10))!important;
  box-shadow:none!important;
  filter:none!important;
}
body.ce-apex :is(.flag,.france,.recap-line) > :is(span,div) {background:transparent!important;}
body.ce-apex :is(.flag-line,.france,.flag,.recap-line) {opacity:.92!important;}
body.ce-apex .header::after {background:linear-gradient(90deg,#4364C3,#91ACFF)!important;}

/* Surfaces — cards remain at their exact original locations and dimensions. */
body.ce-apex :is(.card,.stat,.stat-card,.stats-card,.section,.block,.panel,.record,.record-card,.score-card,.session,.session-card,.history-item,.history-row,.item,.goal-row,.goal-card,.goal-type-card,.category-award,.badge-card,.summary-card,.settings-card,.sport-card,.option-card,.program-week,.program-month,.discipline-card,.compare-card,.intro-card,.xp-panel,.streak-panel,.streak-pill,.dash-module,.metric,.note,.rule,.step,.credits-box,.gp-panel,.gp-machine-card,.gp-big-stat,.gp-small-stats>div,.gp-final-links,.studio-card,.gym-exercise,.gym-set,.gym-history,.result-modal-detail) {
  background-color:var(--apex-surface)!important;
  border-color:var(--apex-line)!important;
  box-shadow:0 15px 40px rgba(2,7,22,.18)!important;
}
body.ce-apex :is(.card,.stat,.stat-card,.section,.block,.panel,.record,.session,.history-item,.goal-row,.settings-card,.option-card,.xp-panel,.streak-panel,.dash-module,.gp-panel,.gp-machine-card) {
  background-image:linear-gradient(139deg,rgba(25,42,75,.95),rgba(13,23,44,.95))!important;
}
body.ce-apex :is(.card,.stat,.section,.record,.session,.goal-row,.settings-card,.option-card,.badge-card,.gp-panel,.gp-machine-card):hover {border-color:rgba(130,159,235,.36)!important;}
body.ce-apex :is(.empty,.notice,.summary,.info,.information,.form-note,.future-note,.tip,.note,.goal-detail,.rule,.mini-card,.dash-module-metric,.xp-today,.streak-pill,.program-week-head,.sport-box,.filter,.recap-item,.gp-group,.gp-card-numbers>div) {
  background-color:rgba(114,152,255,.055)!important;
  border-color:rgba(133,161,225,.16)!important;
}
/* Preserve meaningful states: valid/invalid/status/warning styling. */
body.ce-apex :is(.success,.good,.accepted,.completed,.win,.valid,.active-status) {border-color:rgba(74,222,128,.28)!important;}
body.ce-apex :is(.error,.danger,.bad,.refused,.cancelled,.lose) {border-color:rgba(248,113,113,.28)!important;}
body.ce-apex :is(.stat i,.card-title i,.option-icon,.sport-icon,.hero-icon,.xp-level-orb,.profile-badge-core,.record-icon,.gp-machine-icon,.icon) {
  color:var(--apex-accent-light)!important;
  border-color:var(--apex-line)!important;
}
body.ce-apex :is(.value,.stat strong,.stat-value,.summary-value,.record-value,.xp-level-number,.level-number,.score-number,.dash-module-big) {color:#F5F8FF!important;}
body.ce-apex :is(.badge,.pill,.chip,.status,.tag,.option-tag,.goal-status,.grade-node,.category-level,.profile-badge,.badge-count) {border-color:var(--apex-line)!important;}

/* Performance feedback: progress graphics, records, streak, XP. */
body.ce-apex :is(.xp-bar,.bar,.progress-track,.progress-bar,.goal-track,.streak-progress-track,.track,.progress-bg,.progress,.gp-progress) {
  background-color:rgba(135,156,216,.16)!important;
}
body.ce-apex :is(.xp-bar-fill,.bar>div,.progress-fill,.goal-fill,.streak-progress-fill,.progress-track>span,.progress-bar>span,.gp-progress span,.category-award-fill,.mini-xp-fill) {
  background:linear-gradient(100deg,#4A68C4,#88A8FF)!important;
  box-shadow:0 0 16px rgba(101,141,255,.16);
}
body.ce-apex :is(.streak-title i,.xp-kicker,.level-number,.today b,.reward,.record-best,.trend.positive,.category-award-score) {color:var(--apex-accent-light)!important;}
body.ce-apex :is(.xp-level-orb,.orb,.gp-machine-icon) {
  background:rgba(114,152,255,.10)!important;
  border-color:rgba(114,152,255,.24)!important;
}

/* Forms and custom dropdowns, preserve V26 transparent wrapper fix. */
body.ce-apex :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,.form-control,.select-trigger,.custom-select-trigger,.multi-select>.custom-select-trigger) {
  background-color:var(--apex-field)!important;
  background-image:none;
  color:var(--apex-title)!important;
  border-color:rgba(125,151,204,.30)!important;
  box-shadow:none!important;
  caret-color:#B5C7FF;
}
body.ce-apex :is(input,textarea)::placeholder{color:#8397B7!important;opacity:1;}
body.ce-apex :is(input:not([type="checkbox"]),select,textarea,.form-control,.custom-select-trigger):focus,
body.ce-apex :is(input,select,textarea,.custom-select-trigger):focus-visible {
  outline:2px solid rgba(140,172,255,.45)!important;
  outline-offset:1px!important;
  border-color:#86A7FF!important;
}
body.ce-apex select option {background:#101C33!important;color:#F3F6FF!important;}
body.ce-apex :is(.custom-options,.multi-options,.dropdown-menu,.dropdown-panel,.select-items,.select-options,.autocomplete-list) {
  background-color:#13213B!important;
  border-color:rgba(140,162,215,.27)!important;
  box-shadow:0 18px 45px rgba(0,5,19,.35)!important;
}
body.ce-apex :is(.custom-option,.multi-option,.select-option,.dropdown-item):hover,
body.ce-apex :is(.custom-option.active,.multi-option.active,.select-option.active) {
  background-color:rgba(114,152,255,.16)!important;
  color:#F0F5FF!important;
}
body.ce-apex :is(.custom-select,.multi-select) {
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
body.ce-apex :is(label,.form-label,.field-label) {color:#B4C4E5;}
body.ce-apex input[type="checkbox"],body.ce-apex input[type="radio"] {accent-color:var(--apex-accent);}
/* The Gendarmerie toggle retains its green checked state even on the APEX settings page. */
body.ce-apex .mode-choice.active {background:rgba(34,197,94,.08)!important;border-color:rgba(74,222,128,.4)!important;}
body.ce-apex .mode-choice input[type="checkbox"]:checked {background:#16a34a!important;border-color:#4ade80!important;}
body.ce-apex .mode-choice.active .mode-choice-title {color:#DCFCE7!important;}

/* CTA hierarchy: one decisive electric-blue action per section. */
body.ce-apex :is(.btn,.primary,.primary-btn,.btn-primary,.add-session,.submit-button,.save-button,.submit,.recap-btn.primary,.gp-primary,.studio-primary,.login,.register,.new-session-btn) {
  background:var(--apex-gradient)!important;
  color:#F7FAFF!important;
  border-color:rgba(167,189,255,.40)!important;
  box-shadow:0 10px 28px rgba(52,84,170,.16)!important;
  text-shadow:none!important;
}
body.ce-apex :is(.btn,.primary,.primary-btn,.btn-primary,.add-session,.submit-button,.save-button,.gp-primary,.studio-primary):hover {
  filter:brightness(1.10);
}
body.ce-apex :is(.secondary,.secondary-btn,.btn-secondary,.soft,.advanced-button,.settings-button,.archive-btn,.preview-open,.gp-secondary,.studio-secondary,.back) {
  background-color:rgba(105,137,223,.085)!important;
  border-color:rgba(133,164,236,.26)!important;
  color:#DAE5FF!important;
}
body.ce-apex :is(a,button,input,select,textarea,[tabindex]):focus-visible {outline:2px solid var(--apex-accent-light)!important;outline-offset:2px!important;}
body.ce-apex button:disabled,body.ce-apex .btn:disabled{opacity:.55;cursor:not-allowed;}

/* Dialogs and calendar: same dimensions, focused graphic treatment. */
body.ce-apex :is(.modal-box,.modal-content,.modal-dialog,.recap-box,.popup,.popup-content,.result-modal,.gp-modal,.studio-modal,.popover,.popover-content) {
  background:#14213A!important;
  border-color:rgba(130,156,216,.30)!important;
  box-shadow:0 28px 80px rgba(0,5,18,.42)!important;
}
body.ce-apex :is(.modal-header,.modal-head,.recap-header,.popover-header) {background-color:rgba(114,152,255,.055)!important;border-color:var(--apex-line)!important;}
body.ce-apex :is(.modal-overlay,.recap-overlay,.gp-modal-backdrop,.overlay) {background-color:rgba(3,7,17,.78)!important;}
body.ce-apex :is(.day,.time-cell,.calendar-card,.month-pill,.week-day,.day-cell,.event-chip,.week-content,.upcoming,.calendar-grid) {border-color:var(--apex-line)!important;}
body.ce-apex :is(.today,.day.today,.day.selected,.time-cell.selected,.day.active,.event-chip.active) {border-color:#769BFF!important;}
body.ce-apex :is(.active-day,.calendar-selected,.day.has-session,.day.today) {background-color:rgba(99,137,248,.14)!important;}
body.ce-apex :is(.nav-btn,.filter-btn,.month-nav button,.year-nav button):hover {border-color:var(--apex-accent-light)!important;}

/* Page-by-page components that do not share base class names. */
body.ce-apex.ce-page-dashboard :is(.welcome-grade,.xp-meta,.streak-progress-meta,.streak-level){color:#9FB3D9!important;}
body.ce-apex.ce-page-dashboard :is(.profile-badge,.category-award) {background-color:rgba(82,112,198,.10)!important;}
body.ce-apex.ce-page-dashboard :is(.streak-title i,.xp-main strong,.xp-kicker){color:#A7BDFF!important;}
body.ce-apex.ce-page-xp :is(.grade-node.current,.grade-node.reached) {background-color:rgba(100,135,235,.15)!important;border-color:rgba(134,166,241,.43)!important;}
body.ce-apex.ce-page-xp :is(.level .orb,.today,.rule,.step) {border-color:var(--apex-line)!important;}
body.ce-apex.ce-page-settings :is(.settings-card,.sport-card) {background-color:var(--apex-surface)!important;}
body.ce-apex.ce-page-settings .sport-option input:checked + .sport-card {border-color:#82A3FF!important;background-color:rgba(94,130,228,.18)!important;}
body.ce-apex.ce-page-new-session :is(.gym-exercise,.gym-set,.summary,.serie,.gym-step,.series-chip) {border-color:var(--apex-line)!important;}
body.ce-apex.ce-page-goals :is(.goal-category,.goal-type-card,.goal-row,.goal-detail,.history-item) {border-color:var(--apex-line)!important;}
body.ce-apex.ce-page-programme :is(.program-month,.program-week,.program-week-head,.sport-box,.session-detail-line,.goal-type-card) {border-color:var(--apex-line)!important;}
body.ce-apex.ce-page-challenges :is(.challenge,.participant,.progress-row,.mixte-card,.result-content) {border-color:var(--apex-line)!important;}
body.ce-apex.ce-page-create-challenge :is(.challenge,.form-note,.custom-select-trigger) {border-color:var(--apex-line-bright)!important;}
body.ce-apex.ce-page-friends :is(.friend,.friend-card,.challenge,.stat,.item) {border-color:var(--apex-line)!important;}
body.ce-apex.ce-page-calendrier :is(.calendar-card,.upcoming,.month-pill,.stats,.legend) {background-color:var(--apex-surface)!important;}
body.ce-apex.ce-page-progress :is(.analysis,.filter,.compare-card,.discipline-card,.score-card) {border-color:var(--apex-line)!important;}
body.ce-apex.ce-page-badges :is(.badge-card,.summary-card,.category-award,.category-level) {border-color:var(--apex-line)!important;}
body.ce-apex.ce-page-advanced :is(.intro,.option-card,.option-icon) {border-color:var(--apex-line)!important;}
body.ce-apex.ce-page-muscle-failure :is(.sport-card,.stat-card,.series-chip) {border-color:var(--apex-line)!important;}
body.ce-apex :is(.gp-page,.studio-shell) {color:var(--apex-text);}
body.ce-apex.gp-page :is(.gp-panel,.gp-machine-card,.gp-big-stat,.gp-disclaimer,.gp-final-links) {border-color:var(--apex-line)!important;background-color:var(--apex-surface)!important;}
body.ce-apex.gp-page :is(.gp-primary,.gp-card-actions a,.gp-progress span) {background:var(--apex-gradient)!important;color:#F7FAFF!important;}
body.ce-apex.ce-page-gym-studio :is(.studio-card,.gym-exercise,.gym-set,.gym-card) {border-color:var(--apex-line)!important;}
/* Public entry points: same components, no layout or structure changes. */
body.ce-apex.ce-public-apex :is(.container,.login-box,.register-box,.card) {border-color:var(--apex-line)!important;}
body.ce-apex.ce-public-apex .subtitle {color:var(--apex-muted)!important;}
body.ce-apex.ce-public-apex :is(.btn,.login,.register,button[type="submit"]) {background:var(--apex-gradient)!important;border-color:rgba(154,181,255,.34)!important;color:#fff!important;}
body.ce-apex.ce-public-apex .flag-line {background:linear-gradient(90deg,#4968C6,#93ADFF)!important;}
body.ce-apex.ce-public-apex :is(.logo span,.footer span) {color:#8EAAFF!important;-webkit-text-fill-color:#8EAAFF!important;}
/* Less movement for motion-sensitive users; keep original interactions. */
@media(prefers-reduced-motion:reduce) {
 body.ce-apex :is(.btn,.card,.option-card,.gp-machine-card,.custom-select-trigger){transition:none!important;}
}

/* Additional native V27/V28 carnet widgets and public auth surfaces */
body.ce-apex.ce-page-gym-studio :is(.btn-main,.btn-save,.finish-workout,.finish-btn) {
  background:var(--apex-gradient)!important;color:#F7FAFF!important;
  border-color:rgba(167,189,255,.40)!important;
}
body.ce-apex.ce-page-gym-studio :is(.btn-quiet,.header-nav a,.studio-tabs button,.suggestions button,.workout-mini>div,.routine-item,.insight-row,.history-item,.note-panel) {
  background-color:rgba(104,138,223,.08)!important;
  border-color:var(--apex-line)!important;
}
body.ce-apex.ce-page-gym-studio .studio-tabs button.active {
  background-color:rgba(114,152,255,.18)!important;
  color:#E1EAFF!important;border-color:rgba(114,152,255,.40)!important;
}
body.ce-apex.ce-page-gym-studio :is(.eyebrow,.panel-kicker,.section-heading h2,.workout-mini b) {color:#ABC0FF!important;}
body.ce-apex.gp-page :is(.gp-rank,.gp-status.progress,.gp-group,.gp-card-numbers>div) {
  background-color:rgba(110,146,241,.11)!important;border-color:var(--apex-line)!important;
}
body.ce-apex.gp-page :is(.gp-level-number,.gp-title h1,.gp-big-stat strong) {color:#EAF0FF!important;}
body.ce-apex.gp-page :is(.gp-filters input,.gp-filters select,.gp-form-field input,.gp-form-field select) {
  background-color:var(--apex-field)!important;border-color:var(--apex-line-bright)!important;
}
body.ce-apex.ce-public-apex :is(.container,.login-box,.register-box) {
  background-color:rgba(17,27,49,.92)!important;
  border-color:rgba(121,151,228,.25)!important;
  box-shadow:0 24px 70px rgba(0,5,20,.25)!important;
}
body.ce-apex.ce-public-apex :is(input,textarea) {
  background-color:var(--apex-field)!important;
  border-color:rgba(133,160,221,.28)!important;
  color:#F4F7FF!important;
}
body.ce-apex.ce-public-apex :is(.footer,.links,.back) a {color:#ABC0FF!important;}

/* Sport statistics — same component geometry for every discipline. */
body.ce-apex:is(.ce-page-run-stats,.ce-page-push-up-stats,.ce-page-abs-stats,.ce-page-traction-stats,.ce-page-walk-stats,.ce-page-trail-stats,.ce-page-bike-stats,.ce-page-musculation-stats) :is(.history,.records,.record-grid,.record,.session,.session-list,.analysis-card,.evolution-badge,.exercise,.exercise-card,.block) {
  border-color:var(--apex-line)!important;
}
body.ce-apex:is(.ce-page-run-stats,.ce-page-push-up-stats,.ce-page-abs-stats,.ce-page-traction-stats,.ce-page-walk-stats,.ce-page-trail-stats,.ce-page-bike-stats,.ce-page-musculation-stats) :is(.session,.record,.analysis-card,.exercise,.block) {
  background-color:var(--apex-surface)!important;
}
body.ce-apex:is(.ce-page-run-stats,.ce-page-push-up-stats,.ce-page-abs-stats,.ce-page-traction-stats,.ce-page-walk-stats,.ce-page-trail-stats,.ce-page-bike-stats,.ce-page-musculation-stats) :is(.best-value,.record-value,.modal-value,.session-value) {
  color:#E6EDFF!important;
}
body.ce-apex.ce-page-gendarmerie-test :is(.panel,.score-card,.history-row,.result-grid,.best-grid) {border-color:var(--apex-line)!important;}
body.ce-apex.ce-page-new-session > .container {
  background:linear-gradient(145deg,rgba(20,34,61,.97),rgba(13,24,44,.97))!important;
  border-color:var(--apex-line)!important;
  box-shadow:0 26px 72px rgba(0,5,20,.34)!important;
}
body.ce-apex .logo span::after, body.ce-apex .page-top::after {
  background:linear-gradient(90deg,#4D6DD4,#9DB5FF)!important;
}
body.ce-apex.ce-page-credits-info :is(.hero-grid,.metric,.formula,.note-grid,.table-wrap) {border-color:var(--apex-line)!important;}
body.ce-apex.ce-page-modules :is(.row,.icon,.controls,.hero) {border-color:var(--apex-line)!important;}
body.ce-apex.ce-page-boutique :is(.item,.mini-dashboard,.category-link,.preview-open) {border-color:var(--apex-line)!important;}


/* ================================================================
   V30 — Finition APEX : logo historique, suppression tricolore,
   correction des sous-blocs trop carrés.
   ================================================================ */
/* Garder le même logo visuel que le mode Gendarmerie / historique. */
body.ce-apex :is(.logo span,.studio-brand span,.gp-brand span){
  color:#CBD5E1!important;
  -webkit-text-fill-color:#CBD5E1!important;
}

/* En mode Sport APEX, on retire les drapeaux/traits tricolores décoratifs. */
body.ce-apex :is(.flag-line,.flag,.france,.recap-line,.tricolor-line,.tricolore,.tricolor){
  display:none!important;
}
body.ce-apex .header::after{
  background:linear-gradient(90deg,#4364C3,#91ACFF)!important;
}

/* Remplacer les bandeaux tricolores encore présents sur certaines cartes. */
body.ce-apex :is(.settings-card,.xp-panel,.analysis-card,.best-3km-card)::before{
  background:linear-gradient(90deg,#4667CA 0%,#89A8FF 100%)!important;
}

/* Bloc XP du dashboard : rendre la colonne de droite cohérente et plus douce. */
body.ce-apex .xp-panel{
  align-items:stretch!important;
}
body.ce-apex .xp-today{
  padding:14px 16px!important;
  border-left:1px solid rgba(135,164,239,.20)!important;
  background:linear-gradient(145deg,rgba(16,27,49,.92),rgba(11,20,38,.95))!important;
  border-radius:16px!important;
  min-width:215px;
  box-shadow:inset 0 0 0 1px rgba(135,164,239,.06)!important;
}
body.ce-apex .xp-today-top,
body.ce-apex .xp-today-note,
body.ce-apex .today-title,
body.ce-apex .today-note{
  color:var(--apex-muted)!important;
}
body.ce-apex .xp-today-top b,
body.ce-apex .today-title b{
  color:#F4F7FF!important;
}
body.ce-apex .xp-today-note.ready,
body.ce-apex .today-note.ok{
  color:#7EF0AE!important;
}

/* Carte hero et encarts secondaires plus propres. */
body.ce-apex :is(.today,.xp-today,.sport-box,.metric,.mini-card,.dash-module-metric,.gp-card-numbers>div,.gp-group){
  border-radius:16px!important;
}
body.ce-apex .hero-icon{
  border-radius:26px!important;
  background:linear-gradient(145deg,rgba(70,103,202,.28),rgba(18,34,68,.92))!important;
  border:1px solid rgba(135,164,239,.22)!important;
  box-shadow:0 14px 34px rgba(0,6,22,.22)!important;
  color:#D9E4FF!important;
}

/* Historique / badges comparatifs : éviter les rectangles durs. */
body.ce-apex :is(.goal-score,.goal-percent,.session-badge,.history-chip,.tag,.pill,.badge,.status,.compare-badge,.comparison-badge,.delta-badge,.pace-badge,.session-tag,.record-tag){
  border-radius:999px!important;
}
body.ce-apex :is(.trend,.good,.bad,.reference,.ref,.delta-positive,.delta-negative,.delta-neutral){
  border-radius:999px!important;
}

/* Listes sportives : cartes plus propres, surtout sur les stats course. */
body.ce-apex :is(.analysis-card,.best-3km-card,.history-row,.history-item,.session-row,.session-card,.comparison-card){
  border-radius:18px!important;
  overflow:hidden!important;
}

@media (max-width: 900px){
  body.ce-apex .xp-today{
    min-width:0;
    width:100%;
    border-left:0!important;
  }
}


/* ================================================================
   V31 — Audit visuel APEX : retouches globales complémentaires.
   ================================================================ */
/* Respecter la forme native des liens retour ; l'apparence de la page Gendarmerie est la référence. */
body.ce-apex.ce-page-new-session .container > a.back {
  display:block!important;
  width:100%!important;
  min-width:0!important;
  margin-top:25px!important;
  padding:0!important;
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  font-size:12px!important;
  text-align:center!important;
  text-decoration:none!important;
  color:var(--apex-muted)!important;
}
body.ce-apex.ce-page-new-session .container > a.back:hover {
  background:transparent!important;
  color:#DCE7FF!important;
}
/* Le bouton principal conserve la taille Gendarmerie, avec les couleurs APEX. */
body.ce-apex.ce-page-new-session button[type="submit"] {
  background:var(--apex-gradient)!important;
  color:#F7FAFF!important;
  border-color:rgba(167,189,255,.4)!important;
  box-shadow:0 10px 25px rgba(56,94,198,.13)!important;
}
/* Dashboard : plus d'air entre les badges et les CTA. */
body.ce-apex.ce-page-dashboard .profile-badges{
  margin-bottom:22px!important;
}
body.ce-apex.ce-page-dashboard .profile-badges + .actions{
  margin-top:4px!important;
}
body.ce-apex.ce-page-dashboard .actions{
  row-gap:14px!important;
}
body.ce-apex.ce-page-dashboard .welcome-row{
  margin-bottom:10px!important;
}

/* En-têtes natifs : APEX ne doit pas ajouter un cadre autour des titres. */
body.ce-apex:is(.ce-page-friends,.ce-page-bike-stats,.ce-page-trail-stats,.ce-page-musculation-stats,.ce-page-challenges,.ce-page-create-challenge,.ce-page-programme) .hero {
  padding:0!important;
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  margin-bottom:24px!important;
}
/* Harmonisation complémentaire des sections course / listes. */
body.ce-apex.ce-page-run-stats :is(.run-section,.records,.record,.session,.modal-item){
  border-radius:20px!important;
}
body.ce-apex.ce-page-run-stats .run-section{
  background:linear-gradient(145deg,rgba(20,33,58,.94),rgba(10,18,35,.98))!important;
}
body.ce-apex.ce-page-run-stats .run-stat-card,
body.ce-apex.ce-page-run-stats .run-best-card{
  background:linear-gradient(145deg,rgba(255,255,255,.045),rgba(255,255,255,.025))!important;
  border-radius:18px!important;
}

/* V32 — Statistiques Course (Sport) : des cartes distinctes, sans bordures fusionnées. */
body.ce-apex.ce-page-run-stats .run-section .session {
  margin:0 0 12px!important;
  padding:18px 20px!important;
  border:1px solid rgba(127,157,224,.17)!important;
  border-radius:17px!important;
  background:linear-gradient(132deg,rgba(26,42,72,.76),rgba(15,26,49,.88))!important;
  background-color:var(--apex-surface)!important;
  box-shadow:none!important;
  gap:16px;
}
body.ce-apex.ce-page-run-stats .run-section .session:last-child {
  margin-bottom:0!important;
  border:1px solid rgba(127,157,224,.17)!important;
}
body.ce-apex.ce-page-run-stats .run-section .session:hover {
  padding-left:20px!important;
  border-color:rgba(145,176,246,.40)!important;
  background:linear-gradient(132deg,rgba(31,50,85,.9),rgba(18,33,59,.96))!important;
}
body.ce-apex.ce-page-run-stats .run-section .session .date,
body.ce-apex.ce-page-run-stats .run-section .session .details {
  min-width:0;
}
@media (max-width:900px) {
  body.ce-apex.ce-page-run-stats .run-section .session {
    padding:16px!important;
    gap:12px;
  }
  body.ce-apex.ce-page-run-stats .run-section .session:hover {
    padding-left:16px!important;
  }
}
