/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
   « CROISER DEUX LEVIERS » (18/11/2026, lot 6) : Shared/CroiserLeviers.razor, maquette docs/maquettes/carte-de-chaleur-leviers.html.
   Un modal rendu au top-level de FecLoader (au-dessus de Simuler, z 6200). Couleurs de zone OPAQUES, mêlées au fond (--cx-fond) par une
   intensité par case (--p, posée par le composant) ; transition sur la couleur : une case change de teinte, elle n'est jamais redessinée.
   La frontière de rupture : deux traits par case (.cx-fd bord droit, .cx-fb bord bas), allumés quand la voisine change de côté ; ils se
   rejoignent au milieu de l'espace entre les cases et forment UN trait continu, sans mesure du DOM.
   Thème sombre par défaut, clair sous html[data-theme="light"]. Bouton d'ouverture dans Simuler : .sp-croiser (en bas de feuille).
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
.cx-ov { position: fixed; inset: 0; z-index: 6400; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: color-mix(in srgb, var(--surf-app, #071d28) 62%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cx-pop {
  --cx-fond: var(--surf-1b, #091f2b); --cx-sure: #2fcfa6; --cx-tens: #e9a23b; --cx-rupt: #e8604f; --cx-front: #ff8f7c; --cx-k: 1;
  --cx-up: var(--st-green, #34d399); --cx-down: #f0a595; --cx-amb: var(--st-amber, #fbbf24); --cx-txc: #f1f7f8;
  /* Palette DIVERGENTE de l'écart à aujourd'hui (couleur par défaut) : neutre autour de 0, teal quand c'est mieux, corail quand c'est pire */
  --dv-up: #3dd7b0; --dv-down: #ff8a73; --dv-neutre: color-mix(in srgb, var(--mut1) 13%, var(--cx-fond)); --e1: 22%; --e2: 40%; --e3: 60%; --cx-rupt-tx: #ffb8aa;
  position: relative; width: min(1180px, 100%); height: min(800px, calc(100dvh - 40px)); display: flex; flex-direction: column;
  border-radius: 16px; border: 1px solid var(--o8, rgba(255,255,255,.08)); overflow: hidden; color: var(--tx1);
  background: linear-gradient(170deg, var(--surf-2, #102733), var(--surf-1b, #091f2b) 42%);
  box-shadow: 0 30px 80px rgba(var(--shadow-col, 0,0,0), calc(.55 * var(--shadow-mul, 1)));
  font-size: 13px; line-height: 1.45; }
html[data-theme="light"] .cx-pop {
  --cx-fond: var(--surf-1, #ffffff); --cx-sure: #16a37f; --cx-tens: #e39a2c; --cx-rupt: #df4f3b; --cx-front: #d6452f; --cx-k: .7;
  --cx-up: var(--st-green, #047857); --cx-down: #c2412f; --cx-amb: var(--st-amber, #b45309); --cx-txc: var(--tx1);
  --dv-up: #16a37f; --dv-down: #d9534f; --dv-neutre: color-mix(in srgb, var(--mut1) 10%, var(--cx-fond)); --e1: 15%; --e2: 29%; --e3: 46%; --cx-rupt-tx: #a61b12;
  border-color: var(--color-border-strong, rgba(0,0,0,.12)); background: linear-gradient(170deg, var(--surf-1b, #f6f9fb), var(--surf-1, #fff) 42%); }

/* ── En-tête ── */
.cx-tete { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--o8, rgba(127,127,127,.15)); }
.cx-ico { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--brand);
  background: color-mix(in srgb, var(--brand) 14%, transparent); }
.cx-ico .iku-ico { width: 17px; height: 17px; }
.cx-tt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cx-tt h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.005em; }
.cx-tt span { font-size: 12px; color: var(--mut1); }
.cx-cout { font-size: 12px; color: var(--mut1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-x { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--mut1); cursor: pointer; }
.cx-x:hover { color: var(--tx1); background: var(--o5, rgba(127,127,127,.08)); }
.cx-x:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ── Réglages ── */
.cx-reglages { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; padding: 11px 16px; border-bottom: 1px solid var(--o8, rgba(127,127,127,.15)); }
.cx-reg { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.cx-reg > span { font-size: 12px; color: var(--mut1); white-space: nowrap; }
.cx-reg .custom-dropdown { min-width: 0; }
.cx-reg .custom-dropdown-trigger { height: 30px; min-width: 168px; padding: 0 8px 0 10px; border-radius: 9px; font-size: 12.5px; font-weight: 650; }
.cx-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; border: 1px solid var(--o12, rgba(127,127,127,.25)); background: var(--o5, rgba(127,127,127,.05)); }
.cx-seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--mut1); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s; }
.cx-seg button:hover:not(:disabled) { color: var(--tx1); }
.cx-seg button.on { background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--tx1); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 60%, transparent); }
.cx-seg button:disabled { opacity: .4; cursor: default; }
.cx-seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ── Corps : la carte à gauche, le détail et la lecture à droite ── */
.cx-corps { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.cx-carte { min-width: 0; padding: 14px 16px 14px; border-right: 1px solid var(--o8, rgba(127,127,127,.15)); display: flex; flex-direction: column; }
.cx-carte-t { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cx-k { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mut1); }
.cx-prog { font-size: 12px; color: var(--mut1); font-variant-numeric: tabular-nums; }
.cx-prog b { color: var(--tx1); }

.cx-heat { --g: 4px; --ty: 22px; --ay: 64px; display: grid; gap: var(--g); align-items: stretch; position: relative; }
/* Les rangées prennent la hauteur du modal (cases presque carrées en 5 × 5) ; jamais sous la hauteur minimale d'une case */
.cx-heat { flex: 1 1 auto; max-height: 640px; }
.cx-heat.cx-n5 { grid-template-columns: var(--ty) var(--ay) repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(58px, 1fr)) auto auto; }
.cx-heat.cx-n7 { grid-template-columns: var(--ty) var(--ay) repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(7, minmax(52px, 1fr)) auto auto; }
.cx-ay { display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; font-size: 11.5px; color: var(--mut1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-ax { text-align: center; font-size: 11.5px; color: var(--mut1); font-variant-numeric: tabular-nums; padding-top: 3px; white-space: nowrap; }
.cx-ay.zero, .cx-ax.zero { color: var(--tx1); font-weight: 700; }
.cx-tx { grid-column: 3 / -1; text-align: center; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mut1); }
.cx-ty { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; align-self: center; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mut1); white-space: nowrap; }

/* Une case : un bouton ; sa teinte = la couleur de sa zone mêlée au fond, à l'intensité --p (0..1) */
.cx-c { --p: 0; --z: var(--o5, rgba(127,127,127,.06)); position: relative; min-height: 58px; padding: 4px 2px; border: 0; border-radius: 9px; font: inherit; color: var(--cx-txc);
  background-color: var(--o4, rgba(127,127,127,.05)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer;
  transition: background-color .5s ease, box-shadow .2s, transform .15s; }
.cx-c.z-s { background-color: color-mix(in srgb, var(--cx-sure) calc(var(--p) * var(--cx-k) * 100%), var(--cx-fond)); }
.cx-c.z-t { background-color: color-mix(in srgb, var(--cx-tens) calc(var(--p) * var(--cx-k) * 100%), var(--cx-fond)); }
.cx-c.z-r { background-color: color-mix(in srgb, var(--cx-rupt) calc(var(--p) * var(--cx-k) * 100%), var(--cx-fond)); }
/* Couleur « écart » (défaut) : sept paliers nets, les isolignes se lisent ; la case « aujourd'hui » est neutre */
.cx-c.e0 { background-color: var(--dv-neutre); }
.cx-c.ep1 { background-color: color-mix(in srgb, var(--dv-up) var(--e1), var(--cx-fond)); }
.cx-c.ep2 { background-color: color-mix(in srgb, var(--dv-up) var(--e2), var(--cx-fond)); }
.cx-c.ep3 { background-color: color-mix(in srgb, var(--dv-up) var(--e3), var(--cx-fond)); }
.cx-c.em1 { background-color: color-mix(in srgb, var(--dv-down) var(--e1), var(--cx-fond)); }
.cx-c.em2 { background-color: color-mix(in srgb, var(--dv-down) var(--e2), var(--cx-fond)); }
.cx-c.em3 { background-color: color-mix(in srgb, var(--dv-down) var(--e3), var(--cx-fond)); }
/* Les zones en surimpression : hachures fines et valeur corail (rupture), liseré ambre intérieur (tension) */
.cx-c.pret::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--dv-down) 42%, transparent) 0 1px, transparent 1px 7px); }
.cx-c.zr::after { opacity: 1; }
.cx-c.zr b { color: var(--cx-rupt-tx); }
.cx-c.zt { box-shadow: inset 0 0 0 2px var(--cx-amb); }
.cx-c.zt.sel { box-shadow: inset 0 0 0 2px var(--cx-amb), 0 0 0 2px var(--tx1), 0 8px 20px rgba(var(--shadow-col, 0,0,0), calc(.3 * var(--shadow-mul, 1))) !important; }
.cx-c b, .cx-c small { position: relative; z-index: 1; }
.cx-c.na { background-color: var(--o5, rgba(127,127,127,.06)); color: var(--mut1); }
.cx-c b { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; opacity: 0; transform: translateY(3px); transition: opacity .35s, transform .35s; }
.cx-c small { font-size: 10.5px; opacity: 0; transition: opacity .35s; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--cx-txc) 74%, transparent); white-space: nowrap; }
.cx-c.pret b, .cx-c.pret small { opacity: 1; transform: none; }
html:not([data-theme="light"]) .cx-c.pret b { text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.cx-c:disabled { cursor: default; }
.cx-c:not(.pret)::after { content: ""; position: absolute; inset: 0; border-radius: 9px; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, var(--o6, rgba(127,127,127,.08)) 50%, transparent 70%); background-size: 220% 100%; animation: cx-lueur 1.3s linear infinite; }
@keyframes cx-lueur { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.cx-c.pret:hover { transform: translateY(-1px); }
.cx-c.sel { box-shadow: 0 0 0 2px var(--tx1), 0 8px 20px rgba(var(--shadow-col, 0,0,0), calc(.3 * var(--shadow-mul, 1))); z-index: 2; }
.cx-c:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; z-index: 2; }
.cx-c.ici::before { content: ""; position: absolute; inset: 4px; border-radius: 6px; border: 1.5px dashed color-mix(in srgb, var(--cx-txc) 70%, transparent); pointer-events: none; }
.cx-c.ici small { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 9.5px; color: var(--cx-txc); }
/* La frontière : un trait au milieu de l'espace entre deux cases, qui déborde de la moitié de l'espace pour rejoindre le suivant */
.cx-fd, .cx-fb { position: absolute; z-index: 3; pointer-events: none; opacity: 0; border-radius: 2px; background: var(--cx-front);
  box-shadow: 0 0 5px color-mix(in srgb, var(--cx-front) 60%, transparent); transition: opacity .35s; }
.cx-fd { top: calc(var(--g) / -2 - 1px); bottom: calc(var(--g) / -2 - 1px); right: calc(var(--g) / -2 - 1.5px); width: 3px; }
.cx-fb { left: calc(var(--g) / -2 - 1px); right: calc(var(--g) / -2 - 1px); bottom: calc(var(--g) / -2 - 1.5px); height: 3px; }
.cx-fd.on, .cx-fb.on { opacity: 1; }

.cx-leg { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 11.5px; color: var(--mut1); }
.cx-leg span { display: inline-flex; align-items: center; gap: 6px; }
.cx-leg i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
.cx-leg i.z-s { background: color-mix(in srgb, var(--cx-sure) calc(50% * var(--cx-k)), var(--cx-fond)); }
.cx-leg i.z-t { background: color-mix(in srgb, var(--cx-tens) calc(48% * var(--cx-k)), var(--cx-fond)); }
.cx-leg i.z-r { background: color-mix(in srgb, var(--cx-rupt) calc(70% * var(--cx-k)), var(--cx-fond)); }
.cx-leg i.mk-t { background: var(--dv-neutre); box-shadow: inset 0 0 0 2px var(--cx-amb); }
.cx-leg i.mk-r { background: var(--dv-neutre) repeating-linear-gradient(135deg, color-mix(in srgb, var(--dv-down) 70%, transparent) 0 1.5px, transparent 1.5px 5px); }
.cx-barre { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.cx-barre small { font-size: 11px; font-weight: 700; }
.cx-barre small.dn { color: var(--cx-down); } .cx-barre small.up { color: var(--cx-up); }
.cx-pal { display: inline-flex; gap: 2px; }
.cx-leg .cx-pal i { width: 16px; height: 10px; border-radius: 0; }
.cx-leg .cx-pal i:first-child { border-radius: 3px 0 0 3px; } .cx-leg .cx-pal i:last-child { border-radius: 0 3px 3px 0; }
.cx-pal i.e0 { background: var(--dv-neutre); box-shadow: inset 0 0 0 1px var(--o12, rgba(127,127,127,.25)); }
.cx-pal i.ep1 { background: color-mix(in srgb, var(--dv-up) var(--e1), var(--cx-fond)); } .cx-pal i.ep2 { background: color-mix(in srgb, var(--dv-up) var(--e2), var(--cx-fond)); } .cx-pal i.ep3 { background: color-mix(in srgb, var(--dv-up) var(--e3), var(--cx-fond)); }
.cx-pal i.em1 { background: color-mix(in srgb, var(--dv-down) var(--e1), var(--cx-fond)); } .cx-pal i.em2 { background: color-mix(in srgb, var(--dv-down) var(--e2), var(--cx-fond)); } .cx-pal i.em3 { background: color-mix(in srgb, var(--dv-down) var(--e3), var(--cx-fond)); }
.cx-sens { color: var(--mut1); font-size: 11px; }
/* Le sélecteur « Couleur : écart | zone », en tête de la légende */
.cx-reg-couleur { margin-right: 6px; }
.cx-reg-couleur > span { font-size: 11.5px; }
.cx-reg-couleur .cx-seg button { height: 22px; padding: 0 8px; font-size: 11.5px; }
.cx-leg-note { flex: 1 0 100%; margin: 2px 0 0; font-size: 11.5px; color: var(--tx2, var(--mut1)); }
.cx-leg i.fr { width: 18px; height: 3px; border-radius: 2px; background: var(--cx-front); box-shadow: 0 0 4px color-mix(in srgb, var(--cx-front) 60%, transparent); }

/* ── Détail et lecture ── */
.cx-cote { min-width: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.cx-det, .cx-lect { padding: 12px 14px; border-radius: 13px; border: 1px solid var(--o8, rgba(127,127,127,.15)); background: var(--o3, rgba(127,127,127,.03)); }
.cx-lect { background: radial-gradient(90% 160% at 0% 0%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 62%), var(--o3, rgba(127,127,127,.03)); color: var(--tx2, var(--mut1)); font-size: 12.5px; }
.cx-lect p { margin: 6px 0 0; }
.cx-lect b { color: var(--tx1); }
.cx-det h3 { margin: 4px 0 2px; font-size: 14px; font-weight: 700; }
.cx-k2 { margin-top: 8px; }
.cx-v { font-size: 22px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.cx-d { display: flex; gap: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.cx-d .up { color: var(--cx-up); } .cx-d .down { color: var(--cx-down); } .cx-d .eq { color: var(--mut1); }
.cx-d .zt-s { color: var(--cx-up); } .cx-d .zt-t { color: var(--cx-amb); } .cx-d .zt-r { color: var(--cx-down); }
.cx-attente { margin: 6px 0 0; font-size: 12.5px; color: var(--mut1); }
.cx-mini { margin-top: 6px; }
.cx-m-svg { display: block; width: 100%; height: auto; overflow: visible; }
.cx-m-svg text { font-family: inherit; }
.cx-m-sous { fill: color-mix(in srgb, var(--cx-down) 9%, transparent); }
.cx-m-seuil { stroke: var(--cx-down); stroke-dasharray: 4 4; stroke-opacity: .75; }
.cx-m-base { fill: none; stroke: var(--mut1); stroke-width: 1.5; stroke-dasharray: 4 3; }
.cx-m-case { fill: none; stroke: var(--brand); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.cx-m-pb { fill: var(--brand); stroke: var(--surf-1b, #091f2b); stroke-width: 2; }
.cx-m-ax { font-size: 10.5px; fill: var(--mut1); }
.cx-m-st { font-size: 10.5px; fill: var(--cx-down); }
.cx-poser { width: 100%; margin-top: 12px; height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px;
  border: 1px solid var(--brand); background: var(--brand); color: var(--brand-contrast, #04211f); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: filter .15s; }
.cx-poser:hover { filter: brightness(1.08); }
.cx-poser:focus-visible { outline: 2px solid var(--tx1); outline-offset: 2px; }

/* ── Tablette : le détail passe sous la carte ── */
@media (max-width: 980px) {
  .cx-ov { align-items: flex-start; }   /* le haut reste en place quand le détail change de hauteur */
  .cx-pop { height: auto; max-height: calc(100dvh - 40px); }
  .cx-corps { grid-template-columns: minmax(0, 1fr); }
  .cx-carte { border-right: 0; border-bottom: 1px solid var(--o8, rgba(127,127,127,.15)); }
  .cx-cote { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .cx-c { min-height: 52px; }
}
@media (max-width: 760px) {
  .cx-cote { grid-template-columns: minmax(0, 1fr); }
  .cx-cout { display: none; }
}
/* ── Téléphone : plein écran, grille compacte, l'écart des cases tu (la valeur suffit), réglages en deux colonnes ── */
@media (max-width: 599px) {
  .cx-ov { padding: 0; align-items: stretch; }
  .cx-pop { width: 100%; max-height: none; height: 100dvh; border-radius: 0; border: 0; }
  .cx-tt span { display: none; }
  .cx-reglages { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; padding: 10px 12px; }
  .cx-reg { flex-direction: column; align-items: stretch; gap: 3px; }
  .cx-reg > span { font-size: 11px; }
  .cx-reg .custom-dropdown-trigger { min-width: 0; width: 100%; }
  .cx-reg:nth-child(3) { grid-column: 1 / -1; }
  .cx-leg .cx-reg { flex-direction: row; align-items: center; gap: 8px; flex: 1 0 100%; }
  .cx-seg { display: flex; }
  .cx-seg button { flex: 1 1 0; padding: 0 6px; }
  .cx-carte { padding: 12px 10px; }
  .cx-heat { --g: 3px; --ty: 14px; --ay: 40px; }
  .cx-c { min-height: 42px; border-radius: 7px; }
  .cx-c b { font-size: 11px; }
  .cx-c small { display: none; }
  .cx-heat.cx-n7 .cx-c b { font-size: 9.5px; letter-spacing: -.02em; }
  .cx-ay, .cx-ax { font-size: 10px; }
  .cx-ty, .cx-tx { font-size: 9.5px; }
  .cx-cote { padding: 12px 10px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .cx-c, .cx-c b, .cx-c small, .cx-fd, .cx-fb, .cx-c.pret::after { transition: none; }
  .cx-c:not(.pret)::after { animation: none; }
}

/* ── Le bouton d'ouverture dans Simuler (onglet Chocs, sous le sélecteur « Ventes et marge | Délais ») ── */
.sp-croiser { flex: 0 0 auto; align-self: flex-end; display: inline-flex; align-items: center; gap: 6px; height: 24px; margin: -4px 0 -2px; padding: 0 8px; border-radius: 7px;
  border: 0; background: none; color: var(--mut1); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.sp-croiser .iku-ico { width: 13px; height: 13px; color: var(--brand); }
.sp-croiser:hover { color: var(--tx1); background: var(--o5, rgba(127,127,127,.08)); }
.sp-croiser:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.sp-tiroir .sp-croiser { align-self: flex-start; margin: 2px 0 0; }
