/* Menko : vue "Valeur de la collection"
   Tout est préfixé .mv- pour ne pas entrer en conflit avec les styles existants. */
.mv {
  --mv-fond: #ECECEC;
  --mv-surface: #FFFFFF;
  --mv-encre: #16181D;
  --mv-encre-2: #5B606B;
  --mv-trait: #DCDDE1;
  --mv-bleu: #2457E6;
  --mv-bleu-pale: #E6EDFD;
  --mv-rouge: #D73D3D;
  --mv-rouge-pale: #FBE9E9;
  --mv-investi: #2C3140;
  --mv-titre: 'Clash Display', 'DM Sans', system-ui, sans-serif;
  --mv-texte: 'DM Sans', system-ui, sans-serif;
  font-family: var(--mv-texte);
  color: var(--mv-encre);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  font-variant-numeric: tabular-nums;
}
.mv *, .mv *::before, .mv *::after { box-sizing: border-box; }
.mv h2, .mv h3 { font-family: var(--mv-titre); margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.mv h3 { font-size: 17px; }

.mv-bloc {
  background: var(--mv-surface);
  border: 1px solid var(--mv-trait);
  border-radius: 14px;
  padding: 22px 24px;
}
.mv-grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.mv-grille-chart { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.mv-bloc { min-width: 0; }
@media (max-width: 960px) { .mv-grille-2, .mv-grille-chart { grid-template-columns: minmax(0, 1fr); } }

/* En-tête : le chiffre et la barre de comparaison */
.mv-hero { padding: 28px 28px 24px; }
.mv-hero-haut { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.mv-hero-label { font-size: 14px; color: var(--mv-encre-2); margin: 0 0 6px; }
.mv-hero-valeur { font-family: var(--mv-titre); font-size: clamp(40px, 5vw, 60px); font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.mv-hero-sous { margin: 10px 0 0; font-size: 15px; color: var(--mv-encre-2); }
.mv-hero-sous strong { color: var(--mv-encre); font-weight: 600; }
.mv-gain { text-align: right; }
.mv-gain-montant { font-family: var(--mv-titre); font-size: 30px; font-weight: 600; line-height: 1.1; }
.mv-gain-pct { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.mv-hausse { color: var(--mv-bleu); }
.mv-baisse { color: var(--mv-rouge); }
.mv-gain-pct.mv-hausse { background: var(--mv-bleu-pale); }
.mv-gain-pct.mv-baisse { background: var(--mv-rouge-pale); }

.mv-barre { margin-top: 26px; }
.mv-barre-piste { position: relative; height: 18px; border-radius: 6px; background: var(--mv-fond); overflow: hidden; display: flex; }
.mv-barre-investi { background: var(--mv-investi); height: 100%; transition: width .5s ease; }
.mv-barre-gain { background: var(--mv-bleu); height: 100%; transition: width .5s ease; }
.mv-barre-perte { height: 100%; transition: width .5s ease;
  background: repeating-linear-gradient(135deg, var(--mv-rouge) 0 6px, #E86A6A 6px 12px); }
.mv-legende { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--mv-encre-2); }
.mv-legende span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

.mv-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 24px; border-top: 1px solid var(--mv-trait); }
.mv-stat { padding: 16px 16px 0 0; }
.mv-stat + .mv-stat { padding-left: 16px; border-left: 1px solid var(--mv-trait); }
.mv-stat-lien { font: inherit; text-align: left; color: inherit; background: none; border: 0; border-radius: 0; cursor: pointer; }
.mv-stat-lien:hover .mv-stat-l { color: var(--mv-bleu); text-decoration: underline; text-underline-offset: 3px; }
.mv-stat-n { font-family: var(--mv-titre); font-size: 22px; font-weight: 600; }
.mv-stat-l { font-size: 13px; color: var(--mv-encre-2); margin-top: 2px; }
@media (max-width: 720px) { .mv-stats { grid-template-columns: 1fr 1fr; } .mv-stat:nth-child(3) { border-left: 0; padding-left: 0; } }

/* Graphique */
.mv-entete { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.mv-onglets { display: inline-flex; background: var(--mv-fond); border-radius: 8px; padding: 3px; }
.mv-onglets button { border: 0; background: none; font: inherit; font-size: 13px; padding: 5px 11px; border-radius: 6px; color: var(--mv-encre-2); cursor: pointer; }
.mv-onglets button[aria-pressed="true"] { background: var(--mv-surface); color: var(--mv-encre); font-weight: 600; box-shadow: 0 1px 2px rgba(22,24,29,.12); }
.mv-onglets button:focus-visible, .mv button:focus-visible, .mv .mv-stat-lien:focus-visible, .mv input:focus-visible, .mv select:focus-visible { outline: 2px solid var(--mv-bleu); outline-offset: 2px; }
.mv-chart-zone { position: relative; min-height: 120px; }
.mv-chart svg { display: block; max-width: 100%; touch-action: pan-y; }
.mv-grille { stroke: var(--mv-trait); stroke-width: 1; }
.mv-curseur line { stroke: var(--mv-encre-2); stroke-width: 1; stroke-dasharray: 2 3; }
.mv-curseur circle { fill: var(--mv-surface); stroke: var(--mv-bleu); stroke-width: 2.5; }
.mv-bulle { position: absolute; top: 0; left: 0; pointer-events: none; background: var(--mv-encre); color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; display: grid; white-space: nowrap; box-shadow: 0 4px 14px rgba(22,24,29,.18); }
.mv-bulle b { font-weight: 600; }
.mv-bulle .mv-hausse { color: #8FAEFF; }
.mv-bulle .mv-baisse { color: #FF9C9C; }
.mv-delta { margin: 3px 0 0; font-size: 13px; color: var(--mv-encre-2); }
.mv-delta span { font-weight: 600; }
.mv-chart .axe { font-size: 11px; fill: var(--mv-encre-2); font-family: var(--mv-texte); }
.mv-vide { color: var(--mv-encre-2); font-size: 14px; padding: 30px 0; text-align: center; line-height: 1.5; }

/* Bilan ventes */
.mv-lignes { display: grid; gap: 0; margin: 4px 0 0; }
.mv-lignes div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--mv-trait); font-size: 14px; }
.mv-lignes div:last-child { border-bottom: 0; }
.mv-lignes dt { color: var(--mv-encre-2); }
.mv-lignes dd { margin: 0; font-weight: 600; }
.mv-lignes .mv-total { padding-top: 14px; }
.mv-lignes .mv-total dt { color: var(--mv-encre); font-weight: 600; }
.mv-lignes .mv-total dd { font-family: var(--mv-titre); font-size: 20px; }

/* Listes hausses / baisses */
.mv-liste { list-style: none; margin: 0; padding: 0; }
.mv-liste li { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--mv-trait); }
.mv-liste li:last-child { border-bottom: 0; }
.mv-vignette { display: block; width: 40px; height: 56px; border-radius: 4px; background: var(--mv-fond); border: 1px solid var(--mv-trait); object-fit: cover; }
.mv-titre-liste { margin-bottom: 8px; }
.mv-nom { font-weight: 600; font-size: 14px; line-height: 1.25; }
.mv-meta { font-size: 12px; color: var(--mv-encre-2); margin-top: 2px; }
.mv-montant { text-align: right; font-weight: 600; font-size: 14px; }
.mv-montant small { display: block; font-weight: 500; font-size: 12px; }

/* Tableaux */
.mv-table-wrap { overflow-x: auto; }
.mv table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mv th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--mv-encre-2); padding: 8px 10px; border-bottom: 1px solid var(--mv-trait); white-space: nowrap; }
.mv td { padding: 10px; border-bottom: 1px solid var(--mv-trait); vertical-align: middle; }
.mv tr:last-child td { border-bottom: 0; }
.mv .num { text-align: right; white-space: nowrap; }
.mv-part { position: relative; height: 6px; background: var(--mv-fond); border-radius: 3px; min-width: 80px; }
.mv-part i { position: absolute; inset: 0 auto 0 0; background: var(--mv-bleu); border-radius: 3px; }

.mv-outils { display: flex; gap: 10px; flex-wrap: wrap; }
.mv-recherche { font: inherit; font-size: 14px; padding: 7px 12px; border: 1px solid var(--mv-trait); border-radius: 8px; min-width: 220px; background: var(--mv-surface); color: var(--mv-encre); }
.mv-champ { display: inline-flex; align-items: center; gap: 6px; color: var(--mv-encre-2); }
.mv-saisie { font: inherit; font-size: 14px; width: 96px; padding: 6px 8px; text-align: right; border: 1px solid var(--mv-trait); border-radius: 6px; background: var(--mv-surface); color: var(--mv-encre); }
.mv-saisie:placeholder-shown { background: var(--mv-fond); }
.mv-saisie.mv-ok { border-color: #A9BEF5; }
.mv-saisie:focus { border-color: var(--mv-bleu); background: var(--mv-surface); }
.mv-saisie[aria-invalid="true"] { border-color: var(--mv-rouge); background: var(--mv-rouge-pale); }
.mv-pv small { display: block; font-size: 12px; font-weight: 500; }
.mv-table-cartes tbody tr:hover { background: #F7F7F8; }
.mv-tri { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mv-encre-2); }
.mv-tri select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--mv-trait); border-radius: 8px; background: var(--mv-surface); color: var(--mv-encre); }
.mv-astuce { margin: -4px 0 10px; padding: 9px 12px; border-radius: 8px; background: var(--mv-bleu-pale); color: #1B3F9E; font-size: 13.5px; }
.mv-astuce[hidden], .mv-vide[hidden], .mv-bulle[hidden], .mv-curseur[hidden] { display: none; }
.mv-part-n { display: none; }
.mv-reste { margin: 10px 0 0; }
.mv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mv-badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 5px; margin-left: 6px; vertical-align: 1px; }
.mv-badge-revoir { background: #FFF2D6; color: #8A5A00; }
.mv-badge-sans { background: var(--mv-fond); color: var(--mv-encre-2); }
.mv-plus { margin-top: 12px; text-align: center; }
.mv-plus button { font: inherit; font-size: 14px; border: 1px solid var(--mv-trait); background: var(--mv-surface); padding: 8px 16px; border-radius: 8px; cursor: pointer; color: var(--mv-encre); }

@media (prefers-reduced-motion: reduce) { .mv * { transition: none !important; } }

/* Fenêtre étroite (à placer en dernier) */
@media (max-width: 560px) { .mv-bloc { padding: 18px 16px; } .mv-hero { padding: 22px 18px 18px; } .mv-gain { text-align: left; } .mv-recherche { min-width: 0; width: 100%; } .mv-outils { width: 100%; } }
