/* ── Tokens identité dashboard ───────────────────────────── */
:root {
  --blue:      #018ffa;
  --blue-dk:   #0075d1;
  --blue-50:   #e8f4ff;
  --blue-100:  #bfdfff;
  --gold:      #feb019;
  --teal:      #14b8a6;   /* accent secondaire (2026-07-17) : liserés, points, remplissages */
  --teal-dk:   #0f766e;   /* aplats à texte blanc (badges, boutons), textes teal */
  --teal-50:   #e6f6f4;   /* fonds doux */
  --teal-100:  #9fd9d1;   /* bordures douces */
  --navy:      #0f172a;
  --text:      #0f172a;
  --text-2:    #374151;
  --text-3:    #64748b;
  --text-4:    #94a3b8;
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --border:    var(--border);
  --border-lt: #f1f5f9;
  --r:         12px;
  --r-sm:      8px;
  --sh-sm:     0 2px 6px rgba(0,0,0,.07);
  --sh:        0 4px 12px rgba(0,0,0,.09);
  --tr:        .18s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── Conteneur principal ─────────────────────────────────── */
.full-container {
  display: flex;
  flex-direction: column;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto 0 0;
  gap: 20px;
}

/* ── Top container → Hero banner ─────────────────────────── */
/* ════════════════════════════════════════════════════════════
   EN-TÊTE (ex-« pavé bleu »)
   Le dégradé marine pleine largeur écrasait tout : 230 px d'aplat saturé, des
   tuiles translucides toutes de même poids, et un contenu - le résultat d'une
   simulation - qui n'a pas besoin de crier. Même parti que l'en-tête de /ticker
   (refonte 2026-08-09) : carte claire, UNE valeur mise en avant, le reste en
   repères réguliers, aucun aplat de couleur. La hiérarchie est portée par la
   taille et la graisse, pas par la peinture.
════════════════════════════════════════════════════════════ */
.top-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  padding: 12px 20px 14px;
  color: var(--text);
}

.ac-tete {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
/* Titre et sous-titre sur UNE ligne (séparés d'un point médian) : l'en-tête est
   une légende, ce sont les chiffres qui portent la page. Deux lignes de titre
   coûtaient 24 px pour rien. */
.ac-tete-txt {
  min-width: 0;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.ac-titre {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
}
.ac-sous {
  margin: 0;
  font-size: .8rem;
  color: var(--text-3);
}
.ac-sous::before { content: '· '; }

/* ── Repères chiffrés ────────────────────────────────────── */
/* Grille et non plus tuiles : des séparateurs fins remplacent les cadres, les
   valeurs s'alignent sur une même ligne de base. Seule la première (le montant
   obtenu) est mise en avant - c'est la réponse à la question que pose la page. */
.cells-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.cell {
  padding: 0 20px;
  min-width: 0;                 /* sans quoi un libellé long élargit la grille */
  border-left: 1px solid var(--border);
}
.cell:first-child { padding-left: 0; border-left: none; }

.cell-title {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 3px;
}
.cell-content {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;          /* « 23 468 $ » ne doit pas se couper en deux */
}
.cell-vedette .cell-content {
  font-size: 2.2rem;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: var(--blue);
}

/* ── Zone centrale gauche / droite ───────────────────────── */
.detail-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
}

/* ── Panneau gauche ──────────────────────────────────────── */
.left-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  padding: 20px;
  flex: 0 0 auto;
  min-width: 290px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Liste des supports ──────────────────────────────────── */
.list_supports { display: flex; flex-direction: column; }
.ls-name  { flex: 1; min-width: 0; }
.ls-ratio { color: var(--text-2); font-weight: 600; font-size: .82rem;
            font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }

/* ── Sélecteur de portefeuille (banner) ──────────────────── */
.banner-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.banner-switcher-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  white-space: nowrap;
}
/* Contrôle SEGMENTÉ : les trois choix dans une même pilule, le choix courant en
   bleu plein. Les deux autres restent des <form> POST (aucun JS ici), le
   courant est un <span> - il n'y a rien à soumettre pour rester où l'on est. */
.ac-segments {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  position: relative;           /* repère du curseur glissant */
}
/* Curseur : un seul aplat bleu posé DERRIÈRE les libellés et déplacé en
   transform (donc composité par le GPU, sans réagencement). Créé par
   accueil_segments.js - sans JS, la classe .actif garde son propre fond et le
   sélecteur reste parfaitement utilisable. */
.ac-thumb {
  position: absolute;
  top: 0; left: 0;
  border-radius: 999px;
  background: var(--blue);
  transition: transform .22s cubic-bezier(.4, 0, .2, 1), width .22s cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
  z-index: 0;
}
.ac-segments .supports-buttons-form,
.ac-segments .supports-button { position: relative; z-index: 1; }
/* Une fois le curseur en place, l'option active n'a plus à peindre son fond :
   c'est lui qui le fait, et lui seul peut glisser. */
.ac-segments-anime .supports-button.actif { background: transparent; }
.ac-segments-anime .supports-button.actif,
.ac-segments-anime .supports-button.actif:hover { color: #fff; }
.supports-buttons-form { display: flex; }
.supports-button {
  display: inline-block;
  background: transparent;
  border: none;
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background var(--tr), color var(--tr);
}
.supports-button:hover { background: var(--blue-50, #eff6ff); color: var(--blue); }
.supports-button.actif { background: var(--blue); color: #fff; cursor: default; }

/* ── Panneau droit (graphique) ───────────────────────────── */
.right-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  padding: 20px;
  position: relative;
}

#chart {
  width: 100%;
  flex: 1;
  min-height: 320px;
  max-height: 500px;
}
#chart .u-title {
  font-size: 14px;
  text-align: left;
  color: var(--text);
}

/* ── Tooltip ─────────────────────────────────────────────── */
.tt {
  position: absolute;
  pointer-events: none;
  font: 600 12px/1.5 system-ui, sans-serif;
  color: #fff;
  /* Bulle toujours SOMBRE (texte blanc) dans les deux thèmes : --navy bascule
     en clair en mode sombre, ce qui rendait le texte blanc illisible. */
  background: #0f172a;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  box-shadow: var(--sh);
  display: none;
  z-index: 100;
  min-width: 120px;
}
.tt-color {
  --couleur: var(--blue);
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--couleur);
}
.tt-title { margin-bottom: 4px; white-space: nowrap; color: rgba(255,255,255,.65); font-size: .72rem; }
.tt-line  { display: flex; align-items: center; gap: 6px; }
.tt-label { font-weight: 400; white-space: nowrap; }
.tt-value { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Bottom container ────────────────────────────────────── */
.bottom-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  padding: 28px;
  text-align: center;
}
.bottom-container h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}
.bottom-container ul {
  list-style: none;
  padding: 0;
  margin: 0 auto 24px;
  width: fit-content;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bottom-container ul li {
  font-size: .9rem;
  color: var(--text-2);
  padding-left: 22px;
  position: relative;
}
.bottom-container ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 700;
}
.bottom-container .inscription {
  padding: 11px 28px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--tr), transform var(--tr);
}
.bottom-container .inscription:hover { background: var(--blue-dk); transform: translateY(-1px); }
.bottom-container .inscription:active { transform: scale(0.98); }

/* ════════════════════════════════════════════════════════════════
   MODULE DE CONTRIBUTION
════════════════════════════════════════════════════════════════ */
.contrib-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  padding: 20px 24px;
}

.contrib-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  margin-bottom: 14px;
}
.contrib-title svg { opacity: 0.6; }

.contrib-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.72rem;
  color: var(--text-3);
  flex-wrap: wrap;
}
.contrib-legend-item { display: flex; align-items: center; gap: 5px; }
.contrib-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.contrib-dot-weight { background: #94a3b8; }
.contrib-dot-perf   { background: var(--blue); }
.contrib-dot-pp     { background: var(--teal); }

.contrib-list { display: flex; flex-direction: column; gap: 2px; }

.contrib-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 4px;
  border-radius: var(--r-sm);
  transition: background var(--tr);
}
.contrib-row:hover { background: var(--border-lt); }

/* capsule-ticker utilisée dans les modules contrib et liste */
.capsule-ticker {
  display: inline-flex;
  justify-content: center; /* centre le texte si min-width forcé par JS */
  font-weight: 700;
  font-size: 0.68rem;
  background: var(--teal-dk);
  padding: 3px 7px;
  color: #fff;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;   /* quand utilisé comme <a> */
}
a.capsule-ticker:hover { color: var(--blue); opacity: 1; }

a.contrib-name {
  text-decoration: none;
  color: var(--text-2);
}
a.contrib-name:hover { color: var(--blue); text-decoration: none; }


.contrib-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.contrib-name {
  font-size: 0.82rem;
  color: var(--text-2);
}

.contrib-mid { flex: 1 1 0; min-width: 0; }
.contrib-bar-group { display: flex; flex-direction: column; gap: 5px; }
.contrib-bar-track {
  width: 100%;
  height: 6px;
  background: var(--border-lt);
  border-radius: 99px;
  /* pas d'overflow:hidden - permet l'affichage du tooltip */
  position: relative;
  cursor: default;
}

/* Tooltip au survol des barres */
.contrib-bar-track[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: system-ui, sans-serif;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
}
.contrib-bar-track[data-tip]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--text);
  z-index: 200;
  pointer-events: none;
}

.contrib-bar { height: 100%; border-radius: 99px; transition: width 0.5s ease; }
/* Barres - perf. individuelle */
.cb-perf-pos { background: var(--blue); }
.cb-perf-neg { background: #f87171; }
/* Barres - contribution (pp) */
.cb-pp-pos   { background: var(--teal); }
.cb-pp-neg   { background: #f87171; }

/* Largeur fixe pour aligner les colonnes de chiffres */
.contrib-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  flex-shrink: 0;
  justify-content: flex-end;
}
/* Colonnes dimensionnées sur le contenu */
.contrib-weight { color: var(--text-4); white-space: nowrap; flex-shrink: 0; text-align: right; }
.contrib-val-pos { color: var(--blue); font-weight: 600; white-space: nowrap; flex-shrink: 0; text-align: right; }
.contrib-val-neg { color: #dc2626;     font-weight: 600; white-space: nowrap; flex-shrink: 0; text-align: right; }
.contrib-pp-pos  { color: var(--teal-dk); font-weight: 700; white-space: nowrap; flex-shrink: 0; text-align: right; }
.contrib-pp-neg  { color: #dc2626;     font-weight: 700; white-space: nowrap; flex-shrink: 0; text-align: right; }

.contrib-note {
  font-size: 0.72rem;
  color: var(--text-4);
  margin-top: 12px;
  font-style: italic;
}

/* ── Détail par support ──────────────────────────────────── */
.dc-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  padding: 20px 24px;
}
.dc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  margin-bottom: 16px;
}
.dc-title svg { opacity: 0.6; }
.dc-carousel {
  position: relative;
}
.dc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-sm);
  color: var(--text-2);
  transition: background var(--tr), border-color var(--tr);
  flex-shrink: 0;
}
.dc-arrow:hover { background: var(--blue-50); border-color: var(--blue); color: var(--blue); }
.dc-arrow-left  { left: -15px; }
.dc-arrow-right { right: -15px; }
.dc-grid {
  display: flex;
  flex-direction: row;
  gap: 14px;
  overflow: hidden;
}
.dc-card {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 240px;
}
.dc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dc-nom {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  text-decoration: none !important;
}
.dc-nom:hover { color: var(--blue); text-decoration: none !important; }
.dc-sector {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: -4px;
}
.dc-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.dc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.79rem;
}
.dc-label { color: var(--text-3); }
.dc-val   { font-weight: 500; color: var(--text); text-align: right; }
.dc-pos   { color: #16a34a; font-weight: 600; }
.dc-neg   { color: #b91c1c; font-weight: 600; }
.dc-reco-buy  { color: #16a34a; font-weight: 700; }
.dc-reco-hold { color: var(--gold); font-weight: 700; }
.dc-reco-sell { color: #b91c1c; font-weight: 700; }
.dc-note { font-size: .68rem; font-weight: 400; color: var(--text-4); margin-left: 3px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 950px) {
  .full-container { padding: 16px; gap: 16px; }
  .ac-titre { font-size: 1rem; }
  .cell-content { font-size: 1.35rem; }
  .cell-vedette .cell-content { font-size: 1.7rem; }
  .detail-container { flex-direction: column-reverse; }
  .left-container { min-width: 0; max-width: 100%; }
}
@media (max-width: 640px) {
  /* En colonne, un filet HORIZONTAL sépare les repères : le filet vertical
     n'a plus de sens quand ils s'empilent. */
  .cells-container { grid-template-columns: 1fr; }
  .cell { padding: 10px 0 0; border-left: none; border-top: 1px solid var(--border); }
  .cell:first-child { padding-top: 0; border-top: none; }
  .contrib-left { flex: 0 0 150px; }
  .contrib-right { gap: 8px; }
  .contrib-weight { display: none; }
}

@media (max-width: 480px) {
  .contrib-left { flex: 0 0 110px; }
  .contrib-name { display: none; }
  .contrib-pp { min-width: 44px; }
}
/* ── Thème SOMBRE : ce fichier redéfinit ses propres tokens :root, il faut donc
   y décliner aussi le sombre (sinon il masque l'override global de base.css). ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue:#4aa6f2; --blue-dk:#2f8ae0; --blue-50:#13293c; --blue-100:#284c66;
    --gold:#e0a94a; --pink:#f472b6;
    --teal:#2dd4bf; --teal-dk:#14b8a6; --teal-50:#0f2b29; --teal-100:#1f4a45;
    --navy:#e8eff5;
    --text:#e8eff5; --text-2:#c3d0db; --text-3:#98a8b6; --text-4:#6f8291;
    --bg:#0c1420; --surface:#131f2b; --border:#26333f; --border-lt:#223039;
    --sh-sm:0 2px 6px rgba(0,0,0,.4); --sh:0 8px 20px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  --blue:#4aa6f2; --blue-dk:#2f8ae0; --blue-50:#13293c; --blue-100:#284c66;
  --gold:#e0a94a; --pink:#f472b6;
  --teal:#2dd4bf; --teal-dk:#14b8a6; --teal-50:#0f2b29; --teal-100:#1f4a45;
  --navy:#e8eff5;
  --text:#e8eff5; --text-2:#c3d0db; --text-3:#98a8b6; --text-4:#6f8291;
  --bg:#0c1420; --surface:#131f2b; --border:#26333f; --border-lt:#223039;
  --sh-sm:0 2px 6px rgba(0,0,0,.4); --sh:0 8px 20px rgba(0,0,0,.55);
}
