/* Polices : Space Grotesk + JetBrains Mono sont chargées via <link> dans
   index.html (les seules réellement utilisées). L'ancien @import Manrope /
   Plus Jakarta Sans téléchargeait 2 familles inutilisées → supprimé. */

/* ─────────────────────────────────────────────────────────────────────
   TOKENS PREMIUM
   → Fusionnés dans assets/css/tokens.css (source unique de vérité,
     chargé en premier). Les valeurs de premium ont été retenues comme
     valeurs effectives. Ne plus redéclarer de :root ici.
───────────────────────────────────────────────────────────────────── */

html {
  font-feature-settings: 'cv11' 1, 'ss01' 1, 'ss02' 1;
}

body {
  font-family: var(--font);
  /* background défini plus bas (section V6) ; l'ancien était mort (écrasé). */
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.06) 0.6px, transparent 0.6px),
    radial-gradient(rgba(255, 255, 255, 0.03) 0.7px, transparent 0.7px);
  background-size: 3px 3px, 4px 4px;
  background-position: 0 0, 1px 1px;
  opacity: 0.08;
}

::selection {
  background: rgba(103, 183, 255, 0.3);
  color: #ffffff;
}

/* .card : règle retirée — consolidée dans base.css (source unique). */

.stat {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(160, 197, 255, 0.15);
}

.stat .k {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

.nav button {
  border-radius: 16px;
  border-color: rgba(160, 197, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.nav button.active {
  border-color: rgba(103, 183, 255, 0.45);
  background:
    linear-gradient(180deg, rgba(103, 183, 255, 0.24), rgba(103, 183, 255, 0.09));
  box-shadow:
    0 12px 30px rgba(35, 109, 169, 0.32),
    inset 0 0 0 1px rgba(187, 223, 255, 0.15);
}

.sidebar,
.hub-topbar,
.trade-bar,
.bottom-bar,
.tool-context-bar {
  border-color: rgba(166, 205, 255, 0.16);
  background: rgba(10, 16, 27, 0.78);
  backdrop-filter: blur(16px);
}

/* .pill : règle morte retirée (écrasée par le .pill V6 plus bas). */

button.primary,
button.ghost,
button.success,
button.danger {
  min-height: 46px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

button.primary {
  background: linear-gradient(180deg, rgba(103, 183, 255, 0.34), rgba(80, 148, 220, 0.18));
  border-color: rgba(130, 203, 255, 0.5);
  box-shadow: 0 10px 24px rgba(30, 89, 150, 0.35);
}

button.ghost {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.03));
  border-color: rgba(166, 205, 255, 0.2);
}

button.danger {
  background: linear-gradient(180deg, rgba(255, 116, 125, 0.24), rgba(255, 116, 125, 0.12));
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  box-shadow: 0 0 0 3px rgba(103, 183, 255, 0.24);
}

label {
  color: rgba(212, 227, 248, 0.86);
  font-weight: 600;
  letter-spacing: 0.02em;
}

input,
select,
textarea {
  background: rgba(3, 8, 14, 0.62);
  border-color: rgba(166, 205, 255, 0.2);
  border-radius: 12px;
}

input::placeholder,
textarea::placeholder {
  color: rgba(232, 238, 246, 0.58);   /* AA (≥4.5:1) — règle effective (l'override base.css était mort) */
}

.hub-session-card {
  border: 1px solid rgba(130, 203, 255, 0.35);
  background:
    radial-gradient(130% 95% at 0% 0%, rgba(103, 183, 255, 0.26), transparent 55%),
    radial-gradient(100% 100% at 100% 100%, rgba(109, 255, 217, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(12, 20, 33, 0.94), rgba(10, 16, 27, 0.92));
  box-shadow:
    0 26px 46px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(196, 231, 255, 0.14);
}

.hub-session-title {
  letter-spacing: 0.02em;
}

.hub-quote {
  border-left: 2px solid rgba(130, 203, 255, 0.45);
  padding-left: 12px;
}

/* Home blocks coherence */
.hub-scroll {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.hub-scroll > .hub-card {
  grid-column: span 12;
  margin: 0;
  position: relative;
  overflow: hidden;
  min-height: 0;            /* les cartes prennent la hauteur de leur contenu (la grille égalise les paires) */
  border-radius: 18px;
  border: 1px solid rgba(166, 205, 255, 0.2);
  background:
    linear-gradient(180deg, rgba(14, 22, 35, 0.9), rgba(10, 16, 27, 0.84));
}

.hub-scroll > .hub-card::after {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197, 229, 255, 0.42), transparent);
  pointer-events: none;
}

/* Spécificité relevée pour battre `.hub-scroll > .hub-card` (0,2,0) :
   sans ça, les classes col-6/col-12 étaient inertes (toutes les cartes
   en pleine largeur → hiérarchie plate). */
.hub-scroll > .hub-card.hub-home-hero {
  grid-column: span 12;
}

.hub-scroll > .hub-card.hub-home-col-6 {
  grid-column: span 6;
}

.hub-scroll > .hub-card.hub-home-col-12 {
  grid-column: span 12;
}

.hub-cardHead {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(166, 205, 255, 0.15);
}

.hub-card h3 {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.015em;
}

.hub-card .hint {
  color: rgba(197, 215, 239, 0.78);
}

.hub-card .row {
  gap: 8px;
}

.hub-friends,
.hub-history {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hub-friend,
.hub-historyItem {
  min-height: 42px;
  border-radius: 12px;
  border-color: rgba(166, 205, 255, 0.22) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)) !important;
  color: #dce8fa !important;
  font-weight: 650;
}

.hub-historyItem {
  justify-content: flex-start;
  font-size: 13px;
}

.hub-quote {
  margin-top: 6px !important;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(166, 205, 255, 0.16);
  padding: 12px 14px 12px 14px;
}

.hub-quote .hint {
  margin-top: 10px !important;
}

.hub-home-equity-card {
  min-height: 0 !important;
  padding: 12px 12px 10px !important;
}

.hub-home-equity-card .hub-cardHead {
  margin-bottom: 6px;
  padding-bottom: 8px;
}

.sim-chart.hub-equity-chart {
  min-height: 210px;
  padding: 4px 8px 2px;
}

.sim-chart.hub-equity-chart svg {
  width: 100%;
  height: 210px;
  display: block;
}

.plot-area {
  border-color: rgba(130, 203, 255, 0.22);
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(196, 231, 255, 0.1);
}

.bottom-bar {
  gap: 8px;
}

.tool-menu,
.ctx-menu-panel {
  border-color: rgba(166, 205, 255, 0.24);
  background: rgba(7, 12, 21, 0.96);
}

.tool-menu-item {
  border-color: rgba(166, 205, 255, 0.16);
}

.tool-menu-item.active {
  border-color: rgba(103, 183, 255, 0.5);
  background: rgba(103, 183, 255, 0.2);
}

/* Bloc trade-btn "haut" retiré : mort (réécrit par le bloc V6 plus bas),
   sauf border-radius:18px rapatrié dans le .trade-btn V6. */

.j-card,
.j-reviewItem,
.j-tagX,
.j-chip,
.j-miniTag {
  border-color: rgba(166, 205, 255, 0.2);
}

.j-badge.win { background: rgba(69, 215, 146, 0.18); }
.j-badge.loss { background: rgba(255, 111, 121, 0.18); }
.j-badge.be { background: rgba(242, 198, 111, 0.2); }

/* Bloc tabbar "haut" retiré : 4 règles mortes, intégralement réécrites
   par le bloc V6 plus bas (.tabbar, .tab, #tabTrader.tab-main vert, .2em). */

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: rgba(3, 7, 14, 0.7);
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid rgba(3, 7, 14, 0.7);
  background: linear-gradient(180deg, rgba(103, 183, 255, 0.72), rgba(72, 136, 204, 0.7));
}

/* (Couche utilitaire .tw-* supprimée : 27 règles totalement inutilisées,
   soit -27 !important. Aucune occurrence dans index.html / assets/js.) */

@media (max-width: 900px) {
  .hub-topbar {
    padding: 10px 12px;
    border-radius: 16px;
  }

  .tool-context-bar {
    max-width: calc(100vw - 22px);
  }

  .hub-scroll {
    grid-template-columns: 1fr;
  }

  .hub-home-col-6,
  .hub-home-col-12,
  .hub-home-hero {
    grid-column: span 1 !important;
  }

  .hub-friends,
  .hub-history {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hub-home-equity-card {
    padding: 10px 10px 8px !important;
  }

  .sim-chart.hub-equity-chart {
    min-height: 176px;
    padding: 2px 6px 0;
  }

  .sim-chart.hub-equity-chart svg {
    height: 170px;
  }

}

/* ==========================================================================
   V6 ITERATION - VISUAL OVERHAUL (NON-DESTRUCTIVE)
   Keeps DOM ids and JS contracts intact.
   Tokens absorbed into the primary :root block at the top of this file.
   ========================================================================== */

body {
  background:
    radial-gradient(1200px 680px at -10% -20%, rgba(126, 224, 129, 0.17), transparent 65%),
    radial-gradient(1100px 700px at 110% -10%, rgba(124, 183, 255, 0.14), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(255, 206, 110, 0.1), transparent 70%),
    linear-gradient(180deg, #04060b 0%, #070c14 45%, #070d15 100%);
}

.card,
.loading-status,
.boot-inner,
.tool-menu,
.ctx-menu-panel {
  border: 1px solid rgba(165, 202, 244, 0.2);
  background: linear-gradient(180deg, rgba(10, 17, 28, 0.92), rgba(7, 12, 21, 0.88));
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(210, 233, 255, 0.11);
}

.pill {
  border-color: rgba(165, 202, 244, 0.26);
  background: rgba(255, 255, 255, 0.05);
  color: #d7ebff;
}

/* .primary nu = BLEU (action primaire neutre), aligné sur button.primary.
   Le vert est réservé au trading (Buy / bouton TRADING / gains). */
.primary {
  border-color: rgba(103, 183, 255, 0.45);
  background: linear-gradient(180deg, rgba(103, 183, 255, 0.34), rgba(80, 148, 220, 0.18));
  color: #eaf4ff;
  letter-spacing: 0.02em;
}

.ghost {
  border-color: rgba(164, 204, 248, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.danger {
  border-color: rgba(255, 116, 116, 0.4);
  background: linear-gradient(180deg, rgba(255, 116, 116, 0.28), rgba(116, 26, 26, 0.3));
}

.field input,
.field select,
.field textarea,
#jSearch,
.j-addTagRow input {
  border-color: rgba(165, 202, 244, 0.25);
  background: rgba(7, 12, 21, 0.78);
  color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
#jSearch:focus,
.j-addTagRow input:focus {
  outline: none;
  border-color: rgba(103, 183, 255, 0.55);
  box-shadow: var(--ring);
}

/* Anneau de focus clavier unifié pour les éléments interactifs qui n'en
   avaient pas (tabs, pills, chips, liens, boutons SELL/BUY, menus…).
   Outline : n'entre pas en conflit avec les box-shadow décoratives. */
:where(a, [role="button"], [tabindex], .tab, #tabTrader, .trade-btn,
       .pill, .j-chip, .sim-tabBtn, .stats-zoomBtn, .tool-menu-item):focus-visible{
  outline: 2px solid rgba(103, 183, 255, .9);
  outline-offset: 2px;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(8, 14, 23, 0.96), rgba(6, 10, 18, 0.95)),
    radial-gradient(circle at 70% -30%, rgba(126, 224, 129, 0.14), transparent 55%);
  border-right-color: rgba(165, 202, 244, 0.2);
}

.nav button {
  border-radius: 13px;
  border: 1px solid rgba(165, 202, 244, 0.14);
}

.nav button.active {
  border-color: rgba(103, 183, 255, 0.55);
  background: linear-gradient(180deg, rgba(103, 183, 255, 0.26), rgba(80, 148, 220, 0.16));
  color: #eaf4ff;
}

.hub-topbar {
  border-color: rgba(165, 202, 244, 0.22);
  background:
    linear-gradient(180deg, rgba(10, 17, 28, 0.9), rgba(6, 11, 18, 0.86));
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.35);
}

.hub-session-card {
  border: 1px solid rgba(126, 224, 129, 0.35);
  background:
    radial-gradient(120% 95% at 0% 0%, rgba(126, 224, 129, 0.2), transparent 58%),
    radial-gradient(95% 95% at 100% 100%, rgba(124, 183, 255, 0.16), transparent 62%),
    linear-gradient(180deg, rgba(10, 17, 28, 0.94), rgba(6, 11, 19, 0.9));
}

.hub-session-kicker,
.hub-userTag {
  color: rgba(234, 244, 255, 0.7);
}

.hub-session-title {
  font-size: clamp(20px, 2.6vw, 28px);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hub-session-lead,
.hub-session-hint,
.hint {
  color: rgba(220, 236, 255, 0.8);
}

.hub-progress {
  height: 13px;
  background: rgba(4, 8, 14, 0.85);
}

.hub-progressFill {
  background: linear-gradient(90deg, #7ee081 0%, #87d0ff 50%, #ffce6e 100%);
  box-shadow: 0 0 14px rgba(126, 224, 129, 0.35);
}

.hub-friend,
.hub-historyItem {
  border-color: rgba(165, 202, 244, 0.22) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)) !important;
}

.hub-quote {
  border-left: 3px solid rgba(255, 206, 110, 0.65);
  background: rgba(255, 255, 255, 0.03);
}

.trade-bar {
  border: 1px solid rgba(165, 202, 244, 0.24);
  background: linear-gradient(180deg, rgba(9, 15, 24, 0.94), rgba(7, 12, 20, 0.92));
}

.trade-btn {
  border-radius: 18px;
  border-color: rgba(255, 255, 255, 0.15);
  letter-spacing: 0.08em;
}

.trade-btn.sell {
  background: linear-gradient(180deg, rgba(255, 116, 116, 0.33), rgba(88, 17, 17, 0.34));
}

.trade-btn.buy {
  background: linear-gradient(180deg, rgba(126, 224, 129, 0.33), rgba(23, 76, 46, 0.34));
}
.trade-btn.sell.pending-sell {
  background: linear-gradient(180deg, rgba(255, 170, 102, 0.42), rgba(83, 31, 7, 0.41));
  border-color: rgba(255, 190, 133, 0.72);
}
.trade-btn.buy.pending-buy {
  background: linear-gradient(180deg, rgba(123, 185, 255, 0.42), rgba(13, 33, 90, 0.41));
  border-color: rgba(151, 206, 255, 0.72);
}

.plot-area {
  border: 1px solid rgba(165, 202, 244, 0.24);
  background:
    radial-gradient(125% 100% at 100% 0%, rgba(126, 224, 129, 0.1), transparent 60%),
    linear-gradient(180deg, rgba(7, 12, 20, 0.96), rgba(5, 9, 16, 0.95));
}

.hud-overlay .pill {
  background: rgba(8, 14, 22, 0.84);
  border-color: rgba(165, 202, 244, 0.24);
}

.bottom-bar {
  border-color: rgba(165, 202, 244, 0.2);
  background: linear-gradient(180deg, rgba(10, 17, 28, 0.9), rgba(7, 12, 20, 0.92));
}

.j-card,
.j-reviewItem,
.j-tagX,
.j-chip,
.j-miniTag {
  border-color: rgba(165, 202, 244, 0.22);
  background: rgba(255, 255, 255, 0.03);
}

.j-chip.is-on {
  border-color: rgba(103, 183, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(103, 183, 255, 0.13) inset;
}

.j-badge.win {
  background: rgba(101, 227, 154, 0.2);
  color: #a6f2c5;
}

.j-badge.loss {
  background: rgba(255, 116, 116, 0.2);
  color: #ffc0c0;
}

.j-badge.be {
  background: rgba(255, 206, 110, 0.2);
  color: #ffdf9f;
}

.tabbar {
  border-top: 1px solid rgba(165, 202, 244, 0.2);
  background:
    radial-gradient(100% 160% at 50% 0%, rgba(126, 224, 129, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(9, 15, 24, 0.96), rgba(5, 9, 16, 0.97));
}

.tabbar > .tab:not(.tab-main) {
  border-color: rgba(165, 202, 244, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.tabbar > .tab.is-active:not(.tab-main) {
  border-color: rgba(103, 183, 255, 0.5);
  color: #eaf4ff;
}

#tabTrader.tab-main {
  border-color: rgba(126, 224, 129, 0.62);
  background:
    linear-gradient(180deg, rgba(126, 224, 129, 0.48), rgba(58, 158, 96, 0.3));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(230, 255, 236, 0.24);
}

#tabTrader .tab-mainTxt {
  letter-spacing: 0.2em;
}

@media (max-width: 980px) {
  .hub-session-title {
    font-size: clamp(18px, 6vw, 23px);
  }

  .tabbar > .tab:not(.tab-main) .tab-ico {
    font-weight: 800;
  }
}

.tabbar-stats {
  grid-template-rows: 1fr;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-btn-h) + 20px + var(--tabbar-safe) + var(--tabbar-inner-bottom-gap));
  padding: 10px 10px calc(10px + var(--tabbar-safe) + var(--tabbar-inner-bottom-gap));
}

.tabbar-stats > .tab:not(.tab-main) {
  grid-row: 1;
  align-self: center;
}

/* ==========================================================================
   V6 ITERATION - STATS DASHBOARD NARRATIVE
   ========================================================================== */
.stats-pane {
  display: none;
}

.stats-pane.is-active {
  display: block;
}

.stats-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#page-stats,
#page-stats .wrap,
#page-stats .card,
#page-stats .stats-grid,
#page-stats .stats-main,
#page-stats .stats-side,
#page-stats .stats-competencyGrid,
#page-stats .stats-shadowGrid,
#page-stats .stats-edgeGrid,
#page-stats .stats-processGrid {
  min-width: 0;
}

.stats-hero {
  border-color: rgba(126, 224, 129, 0.3);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(126, 224, 129, 0.16), transparent 58%),
    radial-gradient(110% 100% at 100% 0%, rgba(124, 183, 255, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(9, 16, 25, 0.95), rgba(6, 11, 19, 0.92));
}

.stats-filtersRow {
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: 16px;
}

.stats-sessionFusion {
  display: grid;
  gap: 12px;
}

.stats-sessionFusion .stats-runHealth,
.stats-sessionFusion .stats-reliability {
  margin-top: 0 !important;
  padding: 10px;
  border-radius: 12px;
}

.stats-inspectorFold {
  padding: 12px;
}

.stats-inspectorFold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.stats-inspectorFold > summary::-webkit-details-marker {
  display: none;
}

.stats-inspectorFold > summary > span:first-child {
  font-weight: 700;
  color: rgba(238, 247, 255, 0.96);
}

.stats-trend {
  border: 1px solid rgba(165, 202, 244, 0.2);
  border-radius: 14px;
  padding: 10px 12px 12px;
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.stats-trendHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.stats-trendLegend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: rgba(220, 236, 255, 0.82);
  font-size: 12px;
}

.stats-trendLegend .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.stats-trendLegend .dot-win {
  background: #7cb7ff;
}

.stats-trendLegend .dot-mat {
  background: #7ee081;
}

.stats-trendInfoBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(165, 202, 244, 0.28);
  background: rgba(165, 202, 244, 0.06);
  color: var(--muted, #9cb3cf);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 5px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.stats-trendInfoBtn:hover,
.stats-trendInfoBtn:focus-visible {
  background: rgba(103, 183, 255, 0.14);
  border-color: rgba(103, 183, 255, 0.45);
  color: var(--accent, #67b7ff);
  outline: none;
}

.stats-trendInfoBtn.is-active {
  background: rgba(103, 183, 255, 0.16);
  border-color: rgba(103, 183, 255, 0.55);
  color: var(--accent, #67b7ff);
}

#statsBenchmarkHint[hidden] {
  display: none;
}

#statsBenchmarkHint:not([hidden]) {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(103, 183, 255, 0.06);
  border: 1px solid rgba(103, 183, 255, 0.16);
  font-size: 11px;
  color: var(--muted, #9cb3cf);
  line-height: 1.5;
}



.stats-trendChart {
  min-height: 230px;
  border: 1px solid var(--border2, #2d4565);
  border-radius: var(--radius-2, 18px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.00)),
    repeating-linear-gradient(
      to right,
      rgba(165, 202, 244, 0.07) 0,
      rgba(165, 202, 244, 0.07) 1px,
      transparent 1px,
      transparent 24px
    ),
    repeating-linear-gradient(
      to top,
      rgba(165, 202, 244, 0.07) 0,
      rgba(165, 202, 244, 0.07) 1px,
      transparent 1px,
      transparent 24px
    ),
    var(--panel2, #0f1927);
  padding: 6px 10px 10px;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
}

.stats-trendChart svg {
  display: block;
  width: 100%;
  height: 142px;
}

.stats-benchmarkRailWrap {
  position: relative;
  min-height: 206px;
  padding: 6px 12px 40px 28px;
  overflow: visible;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.stats-benchmarkCurveSvg {
  position: absolute;
  left: 28px;
  right: 8px;
  top: 2px;
  bottom: 34px;
  width: auto;
  height: auto;
  overflow: visible;
}

.stats-benchmarkArea {
  fill: url(#wpStatsAreaGradient);
  opacity: 0.55;
}

.stats-benchmarkZero {
  fill: none;
  stroke: rgba(220, 236, 255, 0.32);
  stroke-width: 1;
  stroke-dasharray: 3 6;
  vector-effect: non-scaling-stroke;
}

.stats-benchmarkRail {
  fill: none;
  stroke: url(#wpStatsCurveGradient);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 8px rgba(103, 183, 255, 0.30)) drop-shadow(0 0 3px rgba(255, 255, 255, 0.18));
  transition: opacity 0.35s ease;
}

.stats-benchmarkZeroV {
  stroke: rgba(220, 236, 255, 0.50);
  stroke-width: 1.5;
  stroke-dasharray: 3 5;
  vector-effect: non-scaling-stroke;
}

.stats-benchmarkDot {
  stroke: rgba(11, 18, 30, 0.85);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  transition: opacity 0.35s ease;
}

.stats-benchmarkDropLine {
  stroke: rgba(180, 205, 235, 0.45);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  vector-effect: non-scaling-stroke;
}

.stats-benchmarkUserLine {
  stroke: rgba(101, 227, 154, 0.55);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
  transition: opacity 0.35s ease;
}

.stats-benchmarkUserDot {
  fill: #65e39a;
  stroke: rgba(11, 18, 30, 0.9);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px rgba(101, 227, 154, 0.80));
  transition: opacity 0.35s ease;
}

.stats-benchmarkPoint {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 5px;
  justify-items: center;
  width: 88px;
  transition: left 0.35s ease, top 0.35s ease, opacity 0.35s ease;
}

.stats-benchmarkThumb {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  color: #eef6ff;
  border: 1px solid rgba(165, 202, 244, 0.35);
  background: linear-gradient(180deg, rgba(36, 66, 104, 0.95), rgba(14, 27, 44, 0.95));
}

.stats-benchmarkThumbImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.stats-benchmarkThumbImg.is-thami-shift {
  object-position: 22% center;
}

.stats-benchmarkPoint-profile {
  cursor: pointer;
}

.stats-benchmarkPoint-user .stats-benchmarkThumb {
  border-color: rgba(126, 224, 129, 0.7);
  background: linear-gradient(180deg, rgba(53, 119, 74, 0.95), rgba(19, 52, 32, 0.95));
  box-shadow: 0 0 0 2px rgba(126, 224, 129, 0.2);
  transform: scale(1.15);
  transform-origin: center;
}

.stats-benchmarkMeta {
  display: grid;
  justify-items: center;
  font-size: 10px;
  color: rgba(220, 236, 255, 0.86);
  width: 100%;
  text-align: center;
  white-space: normal;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(8, 14, 24, 0.75);
}

.stats-benchmarkMeta strong {
  display: block;
  max-width: 100%;
  max-height: 2.35em;
  overflow: hidden;
  overflow-wrap: anywhere;
}


.stats-benchmarkTicks {
  position: absolute;
  left: 28px;
  right: 12px;
  bottom: 6px;
  height: 16px;
}

.stats-benchmarkTicks > span {
  position: absolute;
  transform: translateX(-50%);
  color: rgba(220, 236, 255, 0.45);
  font-size: 10px;
  white-space: nowrap;
  line-height: 1;
}

.stats-benchmarkTicks > span::before {
  content: '';
  display: block;
  width: 1px;
  height: 5px;
  background: rgba(165, 202, 244, 0.3);
  margin: 0 auto 3px;
}

.stats-benchmarkYAxis {
  position: absolute;
  left: 2px;
  top: 12px;
  bottom: 12px;
  width: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(224, 236, 252, 0.88);
  font-size: 10px;
  z-index: 2;
}

.stats-benchmarkYAxis i {
  display: block;
  width: 2px;
  flex: 1;
  min-height: 56px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(126, 224, 129, 0.9), rgba(124, 183, 255, 0.5));
  box-shadow: 0 0 0 1px rgba(124, 183, 255, 0.16);
}

.stats-benchmarkYAxisTitle,
.stats-benchmarkYAxisUnit {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.02em;
  font-weight: 700;
}

.stats-benchmarkControls {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  display: grid;
  grid-template-columns: auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 0;
  max-width: 100%;
  min-width: 0;
  pointer-events: none;
}

button.stats-zoomBtn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  max-width: 30px;
  max-height: 30px;
  padding: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(124, 183, 255, 0.36);
  background:
    radial-gradient(120% 120% at 22% 18%, rgba(126, 224, 129, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(23, 42, 66, 0.95), rgba(10, 20, 34, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 6px 14px rgba(3, 10, 18, 0.42),
    0 0 0 1px rgba(124, 183, 255, 0.10);
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.22s ease, opacity 0.22s ease;
  pointer-events: auto;
}

.stats-zoomBtn.is-off {
  border-color: rgba(150, 160, 175, 0.26);
  background: linear-gradient(180deg, rgba(18, 30, 46, 0.86), rgba(11, 20, 31, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 3px 10px rgba(2, 8, 14, 0.30);
  opacity: 0.72;
}

.stats-zoomBtn.is-on {
  border-color: rgba(103, 183, 255, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 16px rgba(3, 10, 18, 0.48),
    0 0 0 1px rgba(103, 183, 255, 0.20),
    0 0 16px rgba(103, 183, 255, 0.24);
}

.stats-zoomBtn:hover {
  transform: translateY(-1px);
  border-color: rgba(165, 218, 255, 0.62);
}

.stats-zoomBtn:active {
  transform: translateY(0);
}

.stats-zoomIcon {
  font-size: 14px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(120, 195, 255, 0.35));
}

.stats-benchmarkPanWrap {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  margin-top: 0;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  z-index: 3;
}

.stats-benchmarkPanNative {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  box-sizing: border-box;
  overscroll-behavior-x: contain;
}

.stats-benchmarkPanNativeInner {
  height: 1px;
  width: 100%;
}

.stats-benchmarkPanWrap:hover,
.stats-benchmarkPanWrap:focus-within {
  opacity: 1;
}

.stats-benchmarkProfileCard {
  margin-top: 8px;
  margin-bottom: 6px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(165, 202, 244, 0.28);
  background: rgba(13, 23, 36, 0.86);
}

.stats-benchmarkProfileHead {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-benchmarkProfileHead > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stats-benchmarkProfileImg {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(165, 202, 244, 0.32);
}

.stats-benchmarkProfileText {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(220, 236, 255, 0.84);
  line-height: 1.5;
}

.stats-benchmarkProfileText p {
  margin: 0 0 8px;
}

.stats-benchmarkProfileText p:last-child {
  margin-bottom: 0;
}

.stats-benchmarkProfileText ul {
  margin: 0 0 8px;
  padding-left: 16px;
}

.stats-benchmarkProfileText li {
  margin: 0 0 4px;
}

.stats-benchmarkProfileText strong {
  color: #eef6ff;
  font-weight: 700;
}

.stats-benchmarkProfileText em {
  color: rgba(255, 214, 130, 0.95);
  font-style: italic;
}

.stats-benchmarkProfileText code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(165, 202, 244, 0.12);
  border: 1px solid rgba(165, 202, 244, 0.24);
  color: rgba(220, 236, 255, 0.95);
}

.stats-main,
.stats-side {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#page-stats .card > h4 {
  line-height: 1.25;
  letter-spacing: 0.01em;
}

#page-stats .card .u-mt10 {
  margin-top: 14px !important;
}

#page-stats .card .u-mt12 {
  margin-top: 18px !important;
}

.stats-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 14px;
}

.stats-timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  bottom: 3px;
  width: 2px;
  background: linear-gradient(180deg, rgba(126, 224, 129, 0.4), rgba(124, 183, 255, 0.3));
  border-radius: 999px;
}

.stats-event {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
}

.stats-eventDot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 10px;
  border: 2px solid rgba(126, 224, 129, 0.7);
  background: rgba(7, 14, 22, 1);
  box-shadow: 0 0 0 3px rgba(126, 224, 129, 0.12);
}

.stats-eventBody {
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid rgba(165, 202, 244, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

.stats-eventTop {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-eventText {
  margin-top: 7px;
  color: rgba(220, 236, 255, 0.8);
  font-size: 13px;
}

.stats-result {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stats-result-win {
  color: #b7ffd2;
  border-color: rgba(101, 227, 154, 0.55);
  background: rgba(101, 227, 154, 0.16);
}

.stats-result-loss {
  color: #ffc8c8;
  border-color: rgba(255, 116, 116, 0.52);
  background: rgba(255, 116, 116, 0.16);
}

.stats-result-be {
  color: #ffe3ad;
  border-color: rgba(255, 206, 110, 0.52);
  background: rgba(255, 206, 110, 0.17);
}

.stats-result-no_trade {
  color: #d2e6ff;
  border-color: rgba(124, 183, 255, 0.48);
  background: rgba(124, 183, 255, 0.15);
}

.stats-objectives {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stats-goal {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid rgba(165, 202, 244, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
}

.stats-goalIdx {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(126, 224, 129, 0.5);
  background: rgba(126, 224, 129, 0.14);
  color: #edfff1;
  font-weight: 700;
}

.stats-goal h5 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.stats-goal p {
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(220, 236, 255, 0.78);
  line-height: 1.35;
}

/* Placeholder d'état vide léger (partagé par ~20 zones) : centré, sobre. */
.stats-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  text-align: center;
  border: 1px dashed var(--stroke-2);
  border-radius: var(--radius-1);
  padding: var(--sp-3);
  color: var(--muted);
  font-size: var(--fs-3);
}

/* Composant d'état vide riche : glyphe + titre + sous-texte + CTA.
   Pour les grandes zones (Amis, journal, stats). Variante .is-error. */
.empty-state{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  text-align: center;
  padding: var(--sp-5) var(--sp-4);
  border: 1px dashed var(--stroke-2);
  border-radius: var(--radius-2);
  color: var(--muted);
}
.empty-state-ico{
  font-size: 32px;
  line-height: 1;
  opacity: .6;
  color: rgba(165, 202, 244, .65);
}
.empty-state-title{
  font-size: var(--fs-5);
  font-weight: var(--fw-semibold);
  color: var(--text);
}
.empty-state-text{ font-size: var(--fs-3); max-width: 44ch; }
.empty-state-cta{ margin-top: var(--sp-2); }
.empty-state.is-error{
  border-color: rgba(255, 116, 116, .35);
  background: rgba(255, 116, 116, .05);
  color: rgba(255, 178, 178, .92);
}
.empty-state.is-error .empty-state-ico{ color: rgba(255, 116, 116, .72); }

.stats-competencyGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stats-skillCard {
  border: 1px solid rgba(165, 202, 244, 0.24);
  border-radius: 14px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    rgba(8, 14, 24, 0.7);
}

.stats-skillCard.tone-context {
  border-color: rgba(124, 183, 255, 0.42);
  box-shadow: inset 0 0 0 1px rgba(124, 183, 255, 0.12);
}

.stats-skillCard.tone-manage {
  border-color: rgba(126, 224, 129, 0.42);
  box-shadow: inset 0 0 0 1px rgba(126, 224, 129, 0.11);
}

.stats-skillCard.tone-psycho {
  border-color: rgba(255, 195, 124, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 195, 124, 0.12);
}

.stats-skillCard.tone-shadow {
  border-color: rgba(210, 150, 255, 0.42);
  box-shadow: inset 0 0 0 1px rgba(210, 150, 255, 0.12);
}

.stats-skillHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.stats-skillHead h5 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.stats-skillScore {
  color: #f0f7ff;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.stats-skillMeter {
  margin-top: 10px;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(165, 202, 244, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.stats-skillMeter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(124, 183, 255, 0.95), rgba(126, 224, 129, 0.95));
}

.stats-skillMetrics {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.stats-skillMetric {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(220, 236, 255, 0.88);
  font-size: 12px;
  min-width: 0;
}

.stats-skillMetric > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-skillMetric > span:last-child {
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.stats-shadowGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stats-shadowCard,
.stats-edgeCard {
  border: 1px solid rgba(165, 202, 244, 0.22);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.stats-shadowCard h5,
.stats-edgeCard h5 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.stats-shadowRows,
.stats-edgeRows {
  margin-top: 9px;
  display: grid;
  gap: 7px;
}

.stats-edgeGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stats-edgeRow {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: rgba(220, 236, 255, 0.85);
  min-width: 0;
}

.stats-edgeRow.is-weak {
  opacity: 0.58;
}

.stats-edgeRow > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-edgeRow > strong {
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.stats-processGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stats-runHealth {
  border: 1px solid rgba(165, 202, 244, 0.26);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.stats-reliability {
  border: 1px solid rgba(165, 202, 244, 0.26);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.stats-reliabilityGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stats-reliabilityItem {
  border: 1px solid rgba(165, 202, 244, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px;
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: rgba(220, 236, 255, 0.88);
}

.stats-reliabilityItem strong {
  font-size: 14px;
}

.stats-healthCard {
  display: grid;
  gap: 10px;
}

.stats-healthCard.tone-ok { border-left: 3px solid rgba(126, 224, 129, 0.92); padding-left: 10px; }
.stats-healthCard.tone-warn { border-left: 3px solid rgba(255, 206, 110, 0.92); padding-left: 10px; }
.stats-healthCard.tone-bad { border-left: 3px solid rgba(255, 116, 116, 0.92); padding-left: 10px; }

.stats-healthHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stats-healthGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stats-healthMetric {
  border: 1px solid rgba(165, 202, 244, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px;
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: rgba(220, 236, 255, 0.88);
}

.stats-healthBar {
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(165, 202, 244, 0.2);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.stats-healthBar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 116, 116, 0.95), rgba(255, 206, 110, 0.95), rgba(126, 224, 129, 0.95));
}

.stats-healthIssues {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.stats-payloadPreview {
  border: 1px solid rgba(165, 202, 244, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
}

.stats-benchmarkProfileText {
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.stats-payloadGrid {
  display: grid;
  gap: 8px;
}

.stats-payloadGrid details {
  border: 1px solid rgba(165, 202, 244, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(9, 15, 24, 0.62);
}

.stats-payloadGrid summary {
  cursor: pointer;
  font-weight: 700;
  color: rgba(238, 247, 255, 0.95);
}

.stats-kv {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.stats-kv > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: rgba(220, 236, 255, 0.84);
  min-width: 0;
}

.stats-kv > div > span,
.stats-kv > div > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-kv > div > strong {
  max-width: 50%;
  text-align: right;
}

.stats-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #eef6ff;
}

.stats-badge.is-ok {
  background: rgba(101, 227, 154, 0.16);
  border-color: rgba(101, 227, 154, 0.5);
  color: #b7ffd2;
}

.stats-badge.is-warn {
  background: rgba(255, 206, 110, 0.16);
  border-color: rgba(255, 206, 110, 0.5);
  color: #ffe3ad;
}

.stats-badge.is-bad {
  background: rgba(255, 116, 116, 0.16);
  border-color: rgba(255, 116, 116, 0.52);
  color: #ffc8c8;
}

.stats-runTimeline {
  display: grid;
  gap: 8px;
}

.stats-runEvent {
  border: 1px solid rgba(165, 202, 244, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 9px 10px;
}

.stats-runEventTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stats-runEventText {
  margin-top: 6px;
  color: rgba(220, 236, 255, 0.84);
  font-size: 12px;
}

/* ==========================================================================
   V6 ITERATION - SIMULATOR
   ========================================================================== */
.sim-shell {
  display: grid;
  gap: 12px;
}

.sim-hero {
  border-color: rgba(124, 183, 255, 0.34);
  background:
    radial-gradient(130% 120% at 0% 0%, rgba(124, 183, 255, 0.2), transparent 58%),
    radial-gradient(120% 110% at 100% 0%, rgba(126, 224, 129, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(9, 16, 25, 0.95), rgba(6, 11, 19, 0.93));
}

.trade-real-card {
  border-color: rgba(126, 224, 129, 0.28);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(126, 224, 129, 0.15), transparent 58%),
    radial-gradient(120% 120% at 100% 100%, rgba(124, 183, 255, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(9, 16, 25, 0.95), rgba(6, 11, 19, 0.93));
}

.sim-reforge {
  border-color: rgba(126, 224, 129, 0.28);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(126, 224, 129, 0.14), transparent 58%),
    radial-gradient(120% 130% at 0% 100%, rgba(124, 183, 255, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(8, 14, 24, 0.93), rgba(6, 11, 19, 0.93));
}

.sim-reforgeGrid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}

.sim-reforgeCard {
  border: 1px solid rgba(165, 202, 244, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
}

.sim-reforgeHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#simDecisionStatus {
  transition: transform 160ms ease, filter 180ms ease, border-color 180ms ease, background 180ms ease;
}

.sim-status-go {
  border-color: rgba(126, 224, 129, 0.62);
  background: linear-gradient(180deg, rgba(126, 224, 129, 0.24), rgba(126, 224, 129, 0.1));
  color: rgba(241, 255, 244, 0.98);
}

.sim-status-iterate {
  border-color: rgba(255, 206, 110, 0.62);
  background: linear-gradient(180deg, rgba(255, 206, 110, 0.22), rgba(255, 206, 110, 0.08));
  color: rgba(255, 248, 231, 0.98);
}

.sim-status-no-go {
  border-color: rgba(255, 120, 120, 0.58);
  background: linear-gradient(180deg, rgba(255, 120, 120, 0.2), rgba(255, 120, 120, 0.08));
  color: rgba(255, 236, 236, 0.98);
}

.sim-status-pulse {
  animation: simStatusPulse 360ms ease;
}

.sim-fade-in {
  animation: simFadeIn 240ms ease;
}

.sim-decisionBullets {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.sim-decisionRow {
  border: 1px solid rgba(165, 202, 244, 0.18);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  padding: 7px 9px;
  color: rgba(220, 236, 255, 0.86);
  font-size: 12px;
}

.sim-decisionRow--enter {
  opacity: 0;
  transform: translateY(3px);
  animation: simDecisionRowEnter 240ms ease forwards;
}

.sim-scenarioGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sim-scenarioCard {
  border: 1px solid rgba(165, 202, 244, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  transition: transform 140ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.sim-scenarioCard:hover {
  transform: translateY(-1px);
}

.sim-scenarioCard.is-top {
  border-color: rgba(126, 224, 129, 0.55);
  box-shadow: 0 0 0 1px rgba(126, 224, 129, 0.22), 0 10px 20px rgba(0, 0, 0, 0.18);
}

.sim-scenarioCard.is-mid {
  border-color: rgba(165, 202, 244, 0.34);
}

.sim-scenarioCard.is-low {
  border-color: rgba(255, 174, 102, 0.38);
}

.sim-scenarioTitle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  color: rgba(230, 242, 255, 0.9);
}

.sim-scenarioMeta {
  display: grid;
  gap: 3px;
  color: rgba(206, 228, 255, 0.8);
  font-size: 12px;
}

.sim-scenarioRank {
  transform: translateY(-1px);
}

@keyframes simStatusPulse {
  0% {
    transform: scale(0.98);
    filter: brightness(0.92);
  }
  60% {
    transform: scale(1.04);
    filter: brightness(1.08);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes simDecisionRowEnter {
  0% {
    opacity: 0;
    transform: translateY(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes simFadeIn {
  0% { opacity: 0.55; }
  100% { opacity: 1; }
}

.sim-shell .card {
  border-color: rgba(159, 198, 244, 0.24);
  box-shadow: inset 0 1px 0 rgba(226, 241, 255, 0.05), 0 8px 24px rgba(0, 0, 0, 0.18);
}

.sim-panel-strategy {
  display: grid;
  gap: 12px;
}

.sim-card-chart {
  order: 1;
}

.sim-card-controls {
  order: 2;
}

.sim-tabBtn.is-active {
  border-color: rgba(103, 183, 255, 0.55);
  color: #eaf4ff;
  background: linear-gradient(180deg, rgba(103, 183, 255, 0.2), rgba(103, 183, 255, 0.08));
}

.sim-tabBtn {
  transition: transform 140ms ease, border-color 180ms ease, background 180ms ease;
}

.sim-tabBtn:hover {
  transform: translateY(-1px);
}

.sim-field,
.sim-shell .field {
  padding: 10px 10px 9px;
  border: 1px solid rgba(165, 202, 244, 0.16);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.sim-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sim-field {
  display: grid;
  gap: 6px;
}

.sim-field input[type="range"] {
  width: 100%;
  accent-color: #7ee081;
}

.sim-field input[type="number"],
.sim-shell .field input,
.sim-shell .field select {
  background: rgba(8, 14, 24, 0.84);
  border-color: rgba(165, 202, 244, 0.26);
}

.sim-field label,
.sim-shell .field label {
  color: rgba(220, 236, 255, 0.88);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.sim-chart {
  border: 1px solid rgba(165, 202, 244, 0.3);
  border-radius: 14px;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(124, 183, 255, 0.11), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    repeating-linear-gradient(
      to right,
      rgba(165, 202, 244, 0.06) 0,
      rgba(165, 202, 244, 0.06) 1px,
      transparent 1px,
      transparent 22px
    ),
    repeating-linear-gradient(
      to top,
      rgba(165, 202, 244, 0.06) 0,
      rgba(165, 202, 244, 0.06) 1px,
      transparent 1px,
      transparent 22px
    );
  padding: 10px;
  min-height: 240px;
  overflow: hidden;
}

.sim-chart svg {
  width: 100%;
  height: 390px;
  display: block;
}

.sim-gridline {
  stroke: rgba(170, 208, 248, 0.52);
  stroke-width: 1.1;
}

.sim-gridline-zero {
  stroke: rgba(255, 206, 110, 0.72);
  stroke-dasharray: 4 4;
}

.sim-gridline-soft {
  stroke: rgba(165, 202, 244, 0.2);
  stroke-width: 1;
}

.sim-axis-line {
  stroke: rgba(204, 230, 255, 0.4);
  stroke-width: 1.2;
}

.sim-axis-label {
  fill: rgba(214, 233, 255, 0.76);
  font-size: 10px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.sim-axis-label-y {
  text-anchor: end;
}

.sim-axis-label-x {
  text-anchor: middle;
}

.sim-axis-title {
  fill: rgba(214, 233, 255, 0.82);
  font-size: 11px;
  letter-spacing: 0.03em;
  font-family: "Space Grotesk", system-ui, sans-serif;
}

.sim-band {
  fill: rgba(124, 183, 255, 0.14);
}

.sim-line {
  fill: none;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sim-line-run {
  stroke: rgba(124, 183, 255, 0.24);
}

.sim-line-prof-base {
  stroke: rgba(124, 183, 255, 0.26);
}

.sim-line-prof-martingale {
  stroke: rgba(255, 174, 102, 0.34);
}

.sim-line-prof-conservative {
  stroke: rgba(170, 255, 188, 0.34);
}

.sim-line-focus {
  stroke-width: 2.1;
}

.sim-line-median {
  stroke: rgba(124, 183, 255, 0.32);
  stroke-width: 2.35;
  filter:
    drop-shadow(0 0 4px rgba(124, 183, 255, 0.42))
    drop-shadow(0 0 10px rgba(124, 183, 255, 0.24));
  animation: simLineMedianGlowPulse 1.8s ease-in-out infinite;
}

.sim-densityBand {
  stroke: none;
}

.sim-densityMedian {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(190, 220, 255, 0.22));
}

.sim-densityLegendItem {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sim-densityLegendItem i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}


.sim-line-example {
  stroke: rgba(126, 224, 129, 1);
  stroke-width: 2.6;
  filter:
    drop-shadow(0 0 4px rgba(126, 224, 129, 0.58))
    drop-shadow(0 0 10px rgba(126, 224, 129, 0.34));
  animation: simLineGlowPulse 1.6s ease-in-out infinite;
}

@keyframes simLineGlowPulse {
  0%, 100% {
    filter:
      drop-shadow(0 0 4px rgba(126, 224, 129, 0.5))
      drop-shadow(0 0 8px rgba(126, 224, 129, 0.28));
    stroke-width: 2.45;
  }
  50% {
    filter:
      drop-shadow(0 0 6px rgba(126, 224, 129, 0.7))
      drop-shadow(0 0 14px rgba(126, 224, 129, 0.42));
    stroke-width: 2.85;
  }
}

@keyframes simLineMedianGlowPulse {
  0%, 100% {
    filter:
      drop-shadow(0 0 3px rgba(124, 183, 255, 0.34))
      drop-shadow(0 0 8px rgba(124, 183, 255, 0.2));
    stroke-width: 2.2;
  }
  50% {
    filter:
      drop-shadow(0 0 5px rgba(124, 183, 255, 0.5))
      drop-shadow(0 0 12px rgba(124, 183, 255, 0.28));
    stroke-width: 2.45;
  }
}

.sim-chartMeta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.sim-shell .stat {
  border-color: rgba(165, 202, 244, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
}

.sim-stageCharts {
  display: grid;
  gap: 12px;
}

.sim-stageCard {
  border: 1px solid rgba(165, 202, 244, 0.24);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  padding: 10px;
}

.sim-stageHead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.sim-stageSvg {
  width: 100%;
  height: 230px;
  display: block;
}

.sim-threshold {
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
}

.sim-threshold-target {
  stroke: rgba(126, 224, 129, 0.88);
}

.sim-threshold-loss {
  stroke: rgba(255, 120, 120, 0.88);
}

.sim-marker {
  stroke-width: 1.6;
  stroke-linecap: round;
}

.sim-marker-target {
  stroke: rgba(126, 224, 129, 0.95);
}

.sim-marker-loss {
  stroke: rgba(255, 120, 120, 0.95);
}

.sim-stageLegend {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 12px;
  color: rgba(220, 236, 255, 0.82);
}

.sim-stageLegend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sim-stageLegend i {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.sim-shell label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sim-helpBtn {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(165, 202, 244, 0.45);
  background: rgba(124, 183, 255, 0.12);
  color: rgba(225, 239, 255, 0.95);
  font-size: 10px;
  line-height: 1;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
}

.sim-helpBtn:hover,
.sim-helpBtn:focus-visible {
  border-color: rgba(126, 224, 129, 0.75);
  outline: none;
}

.sim-helpBtn::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  min-width: 170px;
  max-width: 260px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(165, 202, 244, 0.35);
  background: rgba(9, 18, 34, 0.98);
  color: rgba(225, 239, 255, 0.96);
  font-size: 11px;
  line-height: 1.3;
  white-space: normal;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 20;
}

.sim-helpBtn:hover::after,
.sim-helpBtn:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.sim-legendTarget {
  background: rgba(126, 224, 129, 0.95);
}

.sim-legendLoss {
  background: rgba(255, 120, 120, 0.95);
}

.sim-legendCross {
  width: 12px;
  height: 12px;
  background:
    linear-gradient(45deg, transparent 45%, rgba(230, 242, 255, 0.92) 45%, rgba(230, 242, 255, 0.92) 55%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, rgba(230, 242, 255, 0.92) 45%, rgba(230, 242, 255, 0.92) 55%, transparent 55%);
}

.sim-breakdownBar {
  display: flex;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(165, 202, 244, 0.26);
  background: rgba(255, 255, 255, 0.04);
}

.sim-breakdownBar > span {
  display: block;
  height: 100%;
}

.sim-breakdownList {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.sim-breakdownProfiles {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.sim-breakdownRow {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: rgba(220, 236, 255, 0.86);
}

.sim-profMark {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 6px;
}

.sim-profMark-base {
  background: rgba(124, 183, 255, 0.9);
}

.sim-profMark-martingale {
  background: rgba(255, 174, 102, 0.92);
}

.sim-profMark-conservative {
  background: rgba(170, 255, 188, 0.92);
}

.sim-timeline {
  display: grid;
  gap: 8px;
}

.sim-timelineCard {
  border: 1px solid rgba(165, 202, 244, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
}

.sim-timelineHead {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.tr2-scoreBadge {
  margin-left: 4px;
}

.tr2-score-good {
  background: rgba(70, 192, 120, 0.2);
  border: 1px solid rgba(95, 224, 148, 0.45);
  color: rgba(200, 255, 220, 0.95);
}

.tr2-score-warn {
  background: rgba(224, 170, 60, 0.2);
  border: 1px solid rgba(245, 190, 88, 0.48);
  color: rgba(255, 238, 196, 0.95);
}

.tr2-score-critical {
  background: rgba(206, 86, 86, 0.22);
  border: 1px solid rgba(244, 124, 124, 0.5);
  color: rgba(255, 215, 215, 0.95);
}

.tr2-card-good {
  border-left: 3px solid rgba(98, 222, 147, 0.8);
}

.tr2-card-warn {
  border-left: 3px solid rgba(245, 192, 96, 0.82);
}

.tr2-card-critical {
  border-left: 3px solid rgba(240, 118, 118, 0.84);
}

.tr2-card-na {
  border-left: 3px solid rgba(156, 186, 224, 0.45);
}

@media (max-width: 980px) {
  .stats-benchmarkThumb {
    width: 44px;
    height: 44px;
    font-size: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-competencyGrid,
  .stats-shadowGrid,
  .stats-edgeGrid,
  .stats-processGrid {
    grid-template-columns: 1fr;
  }

  .stats-healthGrid {
    grid-template-columns: 1fr;
  }

  .stats-reliabilityGrid {
    grid-template-columns: 1fr;
  }

  .sim-grid {
    grid-template-columns: 1fr;
  }

  .sim-reforgeGrid,
  .sim-scenarioGrid {
    grid-template-columns: 1fr;
  }

  .sim-chart {
    min-height: 190px;
    padding: 8px;
  }

  .sim-chart svg {
    height: 280px;
  }

  .sim-stageSvg {
    height: 190px;
  }
}

@media (max-width: 640px) {
  #page-stats #statsOverview.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  #page-stats #statsOverview .stat {
    padding: 8px 9px;
    border-radius: 10px;
  }

  #page-stats #statsOverview .stat .k {
    font-size: 9px;
    letter-spacing: 0.03em;
  }

  #page-stats #statsOverview .stat .v {
    margin-top: 3px;
    font-size: 14px;
    line-height: 1.05;
  }

  .stats-benchmarkPoint {
    width: 74px;
    gap: 4px;
  }

  .stats-benchmarkThumb {
    width: 38px;
    height: 38px;
    font-size: 11px;
  }

  .stats-benchmarkMeta {
    font-size: 9px;
    line-height: 1.1;
  }
}

/* =========================================================================
   SIMULATOR — refonte : contrôles à gauche (sticky) / résultats à droite,
   KPIs en grands chiffres, sliders en accent bleu (sélection/contrôle).
   La grille .sim-panel-strategy existe déjà (display:grid) ; on ne fait
   qu'ajouter les colonnes en desktop et placer explicitement les blocs
   (placement explicite => insensible aux 'order' hérités).
========================================================================= */
.sim-results-col{ min-width: 0; }
@media (min-width: 1000px){
  .sim-panel-strategy{
    grid-template-columns: minmax(340px, 380px) minmax(0, 1fr);
    align-items: start;
    gap: var(--sp-4);
  }
  .sim-controls-col{
    grid-column: 1;
    grid-row: 1;
    order: 0;            /* annule l'order:2 hérité (sinon placé en 2e rangée) */
    position: sticky;
    top: var(--sp-4);
  }
  .sim-results-col{ grid-column: 2; grid-row: 1; }
}

/* KPIs en grands chiffres (au lieu de petites lignes noyées) */
.sim-kpis{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: var(--sp-2);
}
.sim-kpis .sim-kpi .k{
  font-size: var(--fs-1);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sim-kpis .sim-kpi .v{
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.05;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* Sliders : accent bleu (cohérent navigation/sélection ; le vert = trading) */
.sim-field input[type="range"]{ accent-color: var(--accent); }
