/* Panneau « Analyse de la liste » (/liste) - aide à la construction de listes. */
#container-analyse { margin-top: 18px; }
.la-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.la-summary { cursor: pointer; padding: 14px 18px; font-weight: 800; font-size: 1.02rem;
  color: var(--text); list-style: none; }
.la-summary::-webkit-details-marker { display: none; }
.la-summary::before { content: '▸'; margin-right: 8px; color: var(--text-3); }
.la-panel[open] .la-summary::before { content: '▾'; }
.la-body { padding: 2px 18px 20px; }
.la-archetypes { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.la-arch { font-family: inherit; font-size: .86rem; font-weight: 600; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-2); cursor: pointer; transition: .12s; }
.la-arch:hover { border-color: var(--blue-100); }
.la-arch.actif { background: var(--blue); border-color: var(--blue); color: #fff; }
.la-desc { margin: 6px 0 16px; font-size: .88rem; color: var(--text-3); max-width: 92ch; }
.la-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; }
@media (max-width: 860px) { .la-grid { grid-template-columns: 1fr; } }
.la-fig { margin: 0 0 18px; }
.la-fig figcaption { font-size: .8rem; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.la-fig-note { font-weight: 400; color: var(--text-3); }
.la-heatmap-vide { font-size: .84rem; color: var(--text-3); margin: 4px 0 0; }
.la-tip { padding: 5px 3px; font-size: .8rem; line-height: 1.45; }
.la-table-wrap { overflow-x: auto; }
.la-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.la-table th { text-align: left; font-size: .66rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-3); font-weight: 700; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.la-table th.n, .la-table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.la-table td { padding: 7px 12px 7px 0; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.la-table tbody tr:hover { background: var(--bg); }
.la-td-nom { color: var(--text-3); font-weight: 400; font-size: .8rem; }
.la-td-sec { color: var(--text-3); }
.la-scorebar { display: inline-block; width: 58px; height: 7px; border-radius: 4px; background: var(--bg);
  vertical-align: middle; overflow: hidden; margin-right: 8px; border: 1px solid var(--border); }
.la-scorebar > span { display: block; height: 100%; }
.la-scoreval { font-variant-numeric: tabular-nums; font-weight: 700; }

/* Onglets de la page /liste : composition / analyse / simulation. */
.liste-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 10px 0 16px;
  border-bottom: 1px solid var(--border); }
.liste-tab { font-family: inherit; font-size: .92rem; font-weight: 600; padding: 10px 18px;
  border: none; background: none; color: var(--text-3); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s; }
.liste-tab:hover { color: var(--text); }
.liste-tab.actif { color: var(--blue); border-bottom-color: var(--blue); }
/* Masquage d'onglet : !important pour primer sur le display inline posé par
   liste.js (_toggleEmptyState / resize). */
.liste-hidden { display: none !important; }

/* Curseur de réflexion pendant tout chargement de données (fetch en cours). */
html.liste-loading, html.liste-loading * { cursor: progress !important; }

/* Pop-up graphiques d'un ticker (clic sur une ligne de composition). */
#list-table-body tr { cursor: pointer; }
.tk-modal { position: fixed; inset: 0; z-index: 1000; }
.tk-modal[hidden] { display: none; }
.tk-modal-overlay { position: absolute; inset: 0; background: rgba(10,20,30,.5); }
.tk-modal-box { position: relative; max-width: 780px; width: calc(100% - 32px);
  max-height: calc(100vh - 48px); overflow-y: auto; margin: 24px auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  padding: 18px 20px 22px; }
.tk-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tk-modal-titre { margin: 0; font-size: 1.35rem; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.tk-modal-nom { margin: 2px 0 0; color: var(--text-3); font-size: .9rem; }
.tk-modal-close { border: none; background: none; font-size: 1.7rem; line-height: 1; color: var(--text-3);
  cursor: pointer; padding: 0 4px; }
.tk-modal-close:hover { color: var(--text); }
.tk-modal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin: 14px 0 4px; }
.tk-duree { display: inline-flex; gap: 3px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px; }
.tk-duree button { font-family: inherit; font-size: .82rem; font-weight: 600; padding: 6px 13px;
  border: none; background: none; color: var(--text-2); cursor: pointer; border-radius: 999px; }
.tk-duree button:hover { color: var(--text); }
.tk-duree button.actif { background: var(--blue); color: #fff; }
.tk-duree button:disabled { cursor: default; opacity: .5; }
.tk-duree button:disabled:hover { color: var(--text-2); }
.tk-page-btn { font-family: inherit; font-size: .86rem; font-weight: 600; text-decoration: none;
  padding: 8px 16px; border-radius: 9px; background: var(--teal-dk, #0f766e); color: #fff;
  border: none; cursor: pointer; }
.tk-page-btn:hover { filter: brightness(1.07); }
/* Aperçu avant import (recherche élargie de /marches) : titre pas encore
   importé, devise à préciser dans le tableau avant de pouvoir le faire. */
.tk-page-btn-desactive { background: var(--text-4, #94a3b8); cursor: not-allowed; }
.tk-page-btn-desactive:hover { filter: none; }
.tk-fig { margin: 10px 0 0; }
.tk-fig figcaption { font-size: .78rem; font-weight: 700; color: var(--text-2); margin-bottom: 2px; }
.tk-loading { padding: 42px 0; text-align: center; color: var(--text-3); font-size: .9rem; }

/* Bandeau des 4 scores de la liste (au-dessus des onglets Composition/Analyse/Simulation). */
.la-scores-resume:empty { display: none; }
.la-scores-resume { margin: 14px 0 4px; }
.la-sr-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 8px; }
.la-sr-titre { font-weight: 800; font-size: 1rem; color: var(--text); }
.la-sr-hint { font-size: .8rem; color: var(--text-3); }
.la-sr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 680px) { .la-sr-grid { grid-template-columns: repeat(2, 1fr); } }
.la-sr-item { text-align: left; font-family: inherit; cursor: pointer; padding: 10px 13px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface); transition: border-color .12s, box-shadow .12s; }
/* Survol à la couleur du DOMAINE « listes » : le bleu appartenait au domaine
   « marchés » et brouillait le repère de partie. */
.la-sr-item:hover { border-color: var(--dom-liste, #0f766e);
  box-shadow: 0 2px 10px rgba(10,20,30,.06); }
.la-sr-item:focus-visible { outline: 2px solid var(--dom-liste, #0f766e); outline-offset: 2px; }
.la-sr-item > * { display: block; }
.la-sr-lbl { font-size: .8rem; font-weight: 700; color: var(--text-2); line-height: 1.2; margin-bottom: 4px; }
.la-sr-score { font-size: 1.32rem; font-weight: 800; color: var(--text); margin-bottom: 7px; }
.la-sr-score small { font-size: .6rem; font-weight: 700; color: var(--text-3); }
.la-sr-bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.la-sr-bar span { display: block; height: 100%; border-radius: 999px; background: var(--text-3); }
/* Score et jauge à la couleur du DOMAINE « listes », quel que soit le niveau.
   Le vert / ambre / rouge d'avant empruntait la sémantique réservée aux GAINS,
   aux avertissements et aux PERTES : un score d'adéquation n'est ni l'un ni
   l'autre, et un « 38/100 » en rouge se lisait comme une alerte alors qu'il dit
   seulement que la liste sert un autre profil. La longueur de la jauge suffit à
   porter le niveau. */
.la-sr-item .la-sr-score { color: var(--dom-liste, #0f766e); }
.la-sr-item .la-sr-bar span { background: var(--dom-liste, #0f766e); }

/* Recommandations d'amélioration par archétype (onglet Analyse). */
.la-reco { margin: 4px 0 18px; padding: 16px 18px; border: 1px solid var(--border);
  border-left: 4px solid var(--blue); border-radius: 12px; background: var(--bg); }
.la-reco-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.la-reco-titre { font-weight: 800; color: var(--text); font-size: 1rem; }
.la-reco-score { font-size: .78rem; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.la-reco-score.ok  { background: rgba(20,160,90,.14); color: #0f8a4d; }
.la-reco-score.moy { background: rgba(254,176,25,.16); color: #b57d05; }
.la-reco-score.bas { background: rgba(220,38,38,.13); color: #c0271f; }
.la-reco-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .la-reco-cols { grid-template-columns: 1fr; } }
.la-reco-h { margin: 0 0 7px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.la-reco-h.pos { color: #0f8a4d; }
.la-reco-h.neg { color: #c0271f; }
.la-reco-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.la-reco-chip { display: inline-flex; align-items: center; gap: 6px; font-family: inherit; font-size: .82rem;
  font-weight: 700; padding: 4px 6px 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.la-reco-chip:hover { border-color: var(--blue); }
.la-reco-chip.pos { border-color: rgba(20,160,90,.4); }
.la-reco-chip.neg { border-color: rgba(220,38,38,.35); }
.la-reco-sc { font-size: .68rem; font-weight: 800; color: #fff; background: var(--text-3);
  border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center; }
.la-reco-chip.pos .la-reco-sc { background: #0f8a4d; }
.la-reco-chip.neg .la-reco-sc { background: #c0271f; }
.la-reco-vide { color: var(--text-3); font-size: .84rem; }
.la-reco-list { margin: 12px 0 0; padding-left: 20px; color: var(--text-2); font-size: .86rem; line-height: 1.55; }
.la-reco-list li { margin: 3px 0; }
.la-reco-list b { color: var(--text); }

/* Modale de confirmation (retrait d'un titre). Réutilise .tk-modal / .tk-modal-overlay. */
.tk-confirm-box { position: relative; max-width: 400px; width: calc(100% - 40px);
  margin: 16vh auto 0; background: var(--surface); border-radius: 16px; padding: 26px 26px 22px;
  box-shadow: 0 24px 60px rgba(10, 20, 30, .28); text-align: center; }
.tk-confirm-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  background: rgba(220, 38, 38, .12); }
.tk-confirm-titre { margin: 0 0 6px; font-size: 1.18rem; font-weight: 800; color: var(--text); }
.tk-confirm-msg { margin: 0 0 20px; color: var(--text-2); font-size: .92rem; line-height: 1.5; }
.tk-confirm-actions { display: flex; gap: 10px; justify-content: center; }
.tk-confirm-btn { font-family: inherit; font-size: .9rem; font-weight: 700; padding: 10px 18px;
  border-radius: 9px; cursor: pointer; border: 1px solid transparent; transition: filter .12s, background .12s; }
.tk-confirm-annuler { background: var(--bg); border-color: var(--border); color: var(--text-2); }
.tk-confirm-annuler:hover { background: var(--border); color: var(--text); }
.tk-confirm-ok { background: #dc2626; color: #fff; }
.tk-confirm-ok:hover { filter: brightness(1.07); }
.tk-confirm-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Curseur synchronisé dessiné par nous : une ligne verticale + une petite pastille
   de suivi sur chaque courbe, à la même date sur les trois graphiques
   (position: fixed = repère viewport, voir liste_ticker_modal.js). */
.tk-cur-line { position: fixed; width: 0; border-left: 1px dashed var(--text-3);
  transform: translateX(-.5px); pointer-events: none; display: none; z-index: 1005; opacity: .5; }
.tk-cur-dot { position: fixed; width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid var(--surface); transform: translate(-50%, -50%); pointer-events: none;
  display: none; z-index: 1006; box-shadow: 0 1px 3px rgba(0,0,0,.25); }

/* Tooltip combiné de la pop-up (une seule fenêtre, les 3 valeurs au même jour).
   COPIE du tooltip des graphiques synchronisés de la page ticker (.tt de
   ticker.css, non chargé ici) : même habillage et même positionnement - il suit
   la souris, 18 px à sa droite et centré verticalement (voir placerTT()).
   D'où `position: fixed` : le placement se fait en coordonnées viewport. */
.tk-tt {
  position: fixed;
  display: none;
  pointer-events: none;
  font: 12px/1.5 system-ui, Arial, sans-serif;
  color: #373d3f;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 5px;
  box-shadow: 2px 2px 6px -4px rgba(0, 0, 0, .5);
  overflow: hidden;
  min-width: 172px;
  z-index: 1007;
}
.tk-tt .tk-tt-title {
  background: #eceff1;
  border-bottom: 1px solid #ddd;
  padding: 6px 10px;
  font-weight: 600;
  white-space: nowrap;
}
.tk-tt .tk-tt-line {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 10px; white-space: nowrap;
}
.tk-tt .tk-tt-line:last-child { padding-bottom: 7px; }
.tk-tt .tk-tt-color {
  --couleur: #018FFA;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--couleur); flex: 0 0 auto;
}
.tk-tt .tk-tt-label { font-weight: 400; }
.tk-tt .tk-tt-value { margin-left: auto; font-weight: 600; padding-left: 12px; }

/* La boîte native d'ApexCharts est remplacée par la nôtre (combinedTip renvoie ''). */
#tickerModal .apexcharts-tooltip { display: none !important; }

/* Tableau de composition : lignes cliquables (ouvrent la pop-up). */
#laCompoTable tbody tr { cursor: pointer; }
/* Capsule ticker à largeur fixe → le nom des sociétés démarre au même x (aligné). */
#laCompoTable .capsule-ticker { min-width: 58px; box-sizing: border-box; }
#laCompoTable .la-td-nom { margin-left: 2px; }
/* En-têtes triables (clic → tri). Pas de soulignement, même avec infobulle. */
.la-table th.la-th-tri { cursor: pointer; white-space: nowrap; user-select: none; }
.la-table th.la-th-tri:hover { color: var(--text); }
.la-table th.la-th-tri.tri-actif { color: var(--blue); }
.la-table .la-tri-fl { font-size: .6rem; }
/* Poids éditable + suppression dans le tableau de composition. */
#laCompoTable td.la-td-poids, #laCompoTable td.la-td-del { padding-top: 4px; padding-bottom: 4px; }
#laCompoTable .input-ponderation { width: 62px; text-align: right; font-family: inherit; font-size: .82rem;
  padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  color: var(--text); font-variant-numeric: tabular-nums; }
#laCompoTable .input-ponderation:focus { outline: none; border-color: var(--blue); }
#laCompoTable .input-ponderation:disabled { background: var(--bg); color: var(--text-3); }
#laCompoTable td.la-td-part { color: var(--text-2); }
#laCompoTable .btn-delete { border: none; background: none; cursor: pointer; font-size: 1rem;
  line-height: 1; padding: 3px; border-radius: 6px; }
#laCompoTable .btn-delete:hover { background: var(--bg); }
/* Ligne survolée : ne pas garder le curseur main sur l'input de poids. */
#laCompoTable .input-ponderation { cursor: text; }

/* Tableau « Score d'adéquation » (onglet Analyse) : lignes cliquables → pop-up,
   comme le tableau de composition. Capsule à largeur fixe pour aligner les noms. */
#laTable tbody tr { cursor: pointer; }
#laTable .capsule-ticker { min-width: 58px; box-sizing: border-box; }

/* Tooltip de la heatmap de corrélation : nomme la PAIRE de titres, pas seulement
   la valeur. Rendu maison (le tooltip natif d'ApexCharts ne montre que la
   série), donc habillé ici avec les jetons du thème - il doit rester lisible en
   clair comme en sombre. */
.la-heat-tip {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 11px; font-size: .82rem; line-height: 1.35;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .18);
}
.la-heat-tip-paire b { font-weight: 700; }
.la-heat-tip-v { color: var(--text-3); font-size: .78rem; font-variant-numeric: tabular-nums; }

/* ── Ajout d'un support (onglet Composition) ─────────────────────────────
   Recherche en temps réel sur market_tickers (même API que le patrimoine),
   résultats en menu déroulant sous le champ. */
.la-ajout { position: relative; }
.la-ajout-champ { position: relative; max-width: 420px; }
.la-ajout-input {
  width: 100%; font-family: inherit; font-size: .92rem;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
}
.la-ajout-input:focus {
  outline: none; border-color: var(--dom-liste); box-shadow: 0 0 0 3px var(--dom-liste-lo);
}
.la-ajout-input:disabled { background: var(--bg); color: var(--text-3); cursor: not-allowed; }
.la-ajout-liste {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  margin: 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  box-shadow: 0 12px 28px -10px rgba(15, 23, 42, .28);
  max-height: 260px; overflow-y: auto;
}
.la-ajout-liste[hidden] { display: none; }
.la-ajout-liste li {
  padding: 8px 12px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; font-size: .86rem;
}
.la-ajout-liste li:hover, .la-ajout-liste li.la-ajout-actif { background: var(--bg); }
.la-ajout-liste .la-aj-ticker { font-weight: 700; color: var(--text); flex: 0 0 auto; }
.la-ajout-liste .la-aj-nom {
  color: var(--text-3); flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.la-ajout-liste .la-aj-devise { color: var(--text-4); font-size: .74rem; flex: 0 0 auto; }
.la-ajout-liste .la-aj-deja {
  flex: 0 0 auto; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; color: var(--dom-liste);
}
.la-ajout-liste li.la-ajout-vide {
  color: var(--text-3); font-style: italic; cursor: default; pointer-events: none;
}
.la-ajout-verrou { margin: 8px 0 0; font-size: .82rem; color: var(--text-3); }

/* Tooltip du graphique « Répartition sectorielle » : liste les tickers du
   secteur survolé, en capsules - même famille visuelle que .la-heat-tip
   (tooltip de la heatmap de corrélation). */
.la-sect-tip {
  display: flex; flex-direction: column; gap: 6px; max-width: 260px;
  padding: 9px 11px; font-size: .82rem; line-height: 1.35;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .18);
}
.la-sect-tip-titre { display: flex; align-items: baseline; gap: 8px; }
.la-sect-tip-n { color: var(--text-3); font-size: .74rem; font-variant-numeric: tabular-nums; }
.la-sect-tip-liste { display: flex; flex-wrap: wrap; gap: 4px; }
.la-sect-tip-puce { cursor: default; }
