/* MARGE 3.0 — MARGE LAB (maquette validée le 2026-11-23, consigne du 2026-11-25).
   Chargée par le Match contrefactuel (api/pronostic.js, classe lab-cf) et par
   les outils du LAB : calculateur de marge, conversion de cotes, value bet et
   TRJ. Tout est sous html.m3 : sans la coquille, chaque page garde sa mise en
   page d'avant. La barre d'outils .m3l-nav vient de /m3/lab.js.

   PALETTE. L'émeraude remplace le citron en thème sombre, comme sur le reste
   de MARGE 3.0 ; le thème clair prend le vert foncé de la coquille. Les pages
   de fond et renderPage nomment leurs couleurs de la même façon (--accent,
   --line…), d'où une seule règle pour les deux familles de pages. */
html.m3:not([data-theme="light"]){
  --bg:#050807; --card:rgba(255,255,255,.035); --line:rgba(52,232,163,.12); --text:#E8F2ED; --text-dim:#93A69D;
  --accent:#34E8A3; --on-accent:#03170E; --panel:#0B1411; --other:#5E7A6E; --btn-line:rgba(52,232,163,.22);
  --well:rgba(255,255,255,.06);
}
html.m3[data-theme="light"]{--accent:#087A51; --on-accent:#FFFFFF}
html.m3:not([data-theme="light"]) .cta, html.m3:not([data-theme="light"]) button.cta{color:#03170E}

/* ---- Barre d'outils du LAB ---- */
.m3l-nav{display:flex; gap:6px; overflow-x:auto; padding:4px; margin:0 0 18px; border-radius:12px; border:1px solid var(--m3-line);
  background:var(--m3-bg-1); scrollbar-width:none; -webkit-overflow-scrolling:touch}
.m3l-nav::-webkit-scrollbar{display:none}
.m3l-nav a{display:flex; align-items:center; gap:8px; flex:0 0 auto; min-height:40px; padding:8px 14px; border-radius:9px;
  font:600 13px var(--m3-sans); color:var(--m3-muted); text-decoration:none !important; white-space:nowrap}
.m3l-nav a:hover{color:var(--m3-text)}
.m3l-nav a span{font:600 11px var(--m3-mono); color:var(--m3-em)}
.m3l-nav a.on{background:var(--m3-panel-3); color:var(--m3-text); box-shadow:inset 0 -2px 0 var(--m3-em)}
.m3l-nav a:focus-visible{outline:2px solid var(--m3-em); outline-offset:1px}
/* Sur les pages de fond, la barre se place au-dessus du titre. */
html.m3 body > .wrap > .m3l-nav{margin:6px 0 20px}

/* ---- Match contrefactuel : en-tête de la maquette ---- */
html.m3 body.lab-cf .cf-hero{background:none; border:0; padding:6px 0 0; margin-bottom:16px; overflow:visible; align-items:end}
html.m3 body.lab-cf .cf-hero h1{font:700 clamp(30px,3.6vw,42px)/1.08 var(--m3-display); letter-spacing:-.02em; margin:8px 0 10px; max-width:18ch}
html.m3 body.lab-cf .cf-lead{color:var(--m3-muted); opacity:1; max-width:62ch}
html.m3 body.lab-cf .cf-etudie{background:linear-gradient(180deg,var(--m3-panel),var(--m3-bg-1)); border-color:var(--m3-line-2)}
html.m3 body.lab-cf .cf .card{border-radius:16px; border-color:var(--m3-line); background:linear-gradient(180deg,var(--m3-panel),var(--m3-bg-1))}
html.m3 body.lab-cf .cf-match{background:radial-gradient(80% 120% at 50% 100%,rgba(52,232,163,.07),transparent 70%),linear-gradient(180deg,var(--m3-panel),var(--m3-bg-1)) !important}
html.m3 body.lab-cf .cf h2{font-family:var(--m3-display) !important; letter-spacing:-.01em}
html.m3 body.lab-cf .cf-cats button.on{color:var(--on-accent)}
html.m3[data-theme="light"] body.lab-cf .cf .card, html.m3[data-theme="light"] body.lab-cf .cf-etudie{background:var(--m3-panel)}
@media (max-width:599px){
  html.m3 body.lab-cf .cf-hero{grid-template-columns:1fr}
}
/* Sur ordinateur, les cinq outils tiennent sur deux lignes au pire : la
   colonne des pages de fond (680 px) est plus étroite que la barre. */
@media (min-width:861px){
  .m3l-nav{flex-wrap:wrap; overflow:visible}
  html.m3 body > .wrap > .m3l-nav{gap:2px}
  html.m3 body > .wrap > .m3l-nav a{padding:8px 9px; font-size:12px; gap:5px}
  html.m3 body > .wrap > .m3l-nav a span{font-size:10px}
}
