/* CopyFlow — couche d'intégration V4.2 de /app (écrite à la main ; v42.css est généré depuis le design master).
   1. Pont de jetons : les variables historiques de app.html et des modules du journal (--bg0..3, --txt, --muted,
      --accent, --green…) pointent vers les jetons V4.2 calculés par ui/theme.js. Redéclaré dans la portée « coque »
      (.sidebar, .topbar, .mnav) pour qu'en mode mixte la coque reste sombre et l'espace de travail clair.
   2. Habillage V4.2 des composants historiques (.card, .btn, .pill, tableaux, champs, interrupteurs, bannières,
      modales, onglets du journal…) SANS changer leur sémantique (un .btn sans modificateur reste l'action principale).
   3. Détails d'intégration propres à /app (pastilles LIVE / EXEC de l'en-tête, pied Rithmic, onglets du journal pilotés
      par la barre latérale…). Aucune couleur littérale, sauf --logo-chip : fond blanc IMPOSÉ des logos de conformance
      Rithmic / OMNE (exigence de la conformance, indépendante du thème). */
:root { --logo-chip: #FFFFFF; }

/* ============================================================ 1. pont de jetons */
:root, .sidebar, .topbar, .mnav {
  --bg0: var(--ws-2); --bg1: var(--pnl-bot); --bg2: var(--pnl2-bot); --bg3: var(--inset);
  --border: var(--line-2); --border2: var(--line);
  --txt: var(--text); --muted: var(--text-2); --faint: var(--text-3);
  --accent: var(--ac-text); --accent-d: var(--ac-2); --accent-glow: var(--ac-soft);
  --green: var(--pos); --green-bg: var(--pos-soft); --red: var(--neg); --red-bg: var(--neg-soft);
  --amber: var(--warn); --amber-bg: var(--warn-soft); --crown: var(--warn);
  --shadow: var(--sh-pop); --btn-txt: var(--ac-text-on);
  --ch-grid: var(--chart-grid); --ch-mut: var(--chart-axis); --ch-green-f: var(--pos-soft); --ch-red-f: var(--neg-soft);
  --ch-accent-f: var(--ac-soft); --ch-red-soft: var(--neg-soft);
}
html { color-scheme: dark; } html[data-theme="light"], html[data-theme="mixed"] { color-scheme: light; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-body); line-height: 1.45; color: var(--text); background: var(--bg);
  background-image: radial-gradient(1100px 700px at 100% -10%, var(--glow-1), transparent 60%), radial-gradient(900px 600px at -10% 110%, var(--glow-2), transparent 60%);
  background-attachment: fixed; -webkit-font-smoothing: antialiased; overflow-x: hidden; font-feature-settings: "tnum" 1, "cv11" 1; }
::selection { background: var(--ac-soft); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
*::-webkit-scrollbar { width: 10px; height: 10px; } *::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); border: 3px solid transparent; background-clip: padding-box; }

/* ============================================================ 2. coque /app (compléments au gabarit V4.2) */
/* coque fixe (desktop / tablette) : la page ne défile pas, seul l'espace de travail (#content.ws) défile — règle V4.2 */
@media (min-width: 721px) { html, body { height: 100dvh; overflow: hidden; } }
.shell > .sidebar, .shell > .frame { position: relative; z-index: 1; }
.sb-sig { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; color: var(--text-3); background: var(--card-2); }
.sb-sig.armed { color: var(--ac-on); background: linear-gradient(160deg, var(--ac-1), var(--ac-2)); box-shadow: var(--sh-btn); }
.sb-sig.err { color: var(--neg); background: var(--neg-soft); }
.shell.collapsed .sb-state .st-txt { display: none; }
.topbar .market { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta); font-weight: 650; color: var(--text-2); white-space: nowrap; }
.topbar .market .dot { width: 7px; height: 7px; border-radius: 50%; }
.statuspill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 0; background: var(--card);
  color: var(--text-3); font: 700 var(--fs-xs) var(--mono); letter-spacing: .06em; cursor: pointer; user-select: none; white-space: nowrap; }
.statuspill .led { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.statuspill.on { color: var(--pos); background: var(--pos-soft); } .statuspill.on .led { background: var(--pos); box-shadow: 0 0 7px var(--pos-glow); }
.statuspill.hot.on { color: var(--ac-text); background: var(--ac-soft); } .statuspill.hot.on .led { background: var(--ac-2); box-shadow: 0 0 7px var(--ac-glow); }
.topbar .rbtn svg.i { width: 17px; height: 17px; }
.topbar .profile .p-txt span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.frame > .rithmic-attr { flex: none; }
.rithmic-attr { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 6px 10px; font-size: 10.5px; color: var(--text-3); border-radius: var(--r-md); }
.rithmic-attr[hidden] { display: none; }
.rithmic-attr img.omne-art, .rithmic-attr img.rithmic-art { height: 20px; display: block; }
.attr-logos { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.attr-logos img { background: var(--logo-chip); border-radius: 6px; padding: 2px 6px; }
.rithmic-attr .notices { line-height: 1.45; min-width: 0; max-width: 900px; }
@media (max-width: 720px) {
  body { background-color: var(--m-page); }
  .topbar { background: var(--m-topbar); }
  [data-theme="mixed"] .topbar { border-radius: 0 0 18px 18px; margin-bottom: 6px; }
  .topbar .market { display: none; }
  .statuspill { height: 30px; padding: 0 9px; }
  .ws { padding: 6px 0 12px; }
  .rithmic-attr { margin: 0 0 80px; }
}

/* ============================================================ 3. habillage V4.2 des composants historiques */
.ws { color: var(--text); }
.ws > :not(.v42) { animation: fadein 180ms var(--ease); }
.card { background: linear-gradient(180deg, var(--pnl-top), var(--pnl-mid) 55%, var(--pnl-bot)); border: 0; border-radius: var(--r-xl); box-shadow: var(--sh-pnl); }
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 15px; border: 0; border-radius: var(--r-pill); cursor: pointer; font: 650 var(--fs-sm) var(--font);
  color: var(--ac-on); background: linear-gradient(180deg, var(--ac-1), var(--ac-2)); box-shadow: var(--sh-btn); transition: filter var(--t), box-shadow var(--t), background var(--t); white-space: nowrap; }
.btn:hover { filter: brightness(1.05); background: linear-gradient(180deg, var(--ac-1), var(--ac-hover)); box-shadow: var(--sh-btn); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: var(--card); color: var(--text); box-shadow: none; font-weight: 600; border: 0; }
.btn.ghost:hover { background: var(--card-2); color: var(--text); }
.btn.red { background: var(--neg); color: var(--text-inv); box-shadow: none; } .btn.red:hover { filter: brightness(1.06); background: var(--neg); }
.btn.sm { height: 30px; padding: 0 12px; font-size: var(--fs-meta); }
.btn.xs { height: 26px; padding: 0 10px; font-size: var(--fs-xs); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; text-align: left; padding: 9px 12px; background: transparent; border-bottom: 1px solid var(--line); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover td { background: var(--card); }
input, select, textarea { background: var(--inset); border: 0; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); border-radius: var(--r-sm); font-family: var(--font); }
input, select { padding: 8px 10px; font-size: var(--fs-sm); }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 1px var(--ac-border), 0 0 0 3px var(--ac-focus); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
select option { background: var(--pnl-bot); color: var(--text); }
label { color: var(--text-2); }
.hint { color: var(--text-3); }
.pill { border-radius: var(--r-pill); font-weight: 650; }
.pill.gray { background: var(--card-2); color: var(--text-2); }
.pill.blue { background: var(--ac-soft); color: var(--ac-text); }
.sw { background: var(--card-hi); } .sw::after { background: var(--text-3); box-shadow: 0 1px 2px var(--scrim); }
.sw.on { background: linear-gradient(160deg, var(--ac-1), var(--ac-2)); } .sw.on::after { background: var(--ac-on); }
.overlay { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal { background: linear-gradient(180deg, var(--pnl-top), var(--pnl-bot)); border: 0; border-radius: var(--r-xl); box-shadow: var(--sh-pop); color: var(--text); }
.toast { background: linear-gradient(180deg, var(--pnl-top), var(--pnl-bot)); border: 0; border-left: 3px solid var(--ac-2); border-radius: var(--r-md); box-shadow: var(--sh-pop); color: var(--text); }
.toast.err { border-left-color: var(--neg); } .toast.ok { border-left-color: var(--pos); } .toast.warn { border-left-color: var(--warn); }
[data-tip]::after { background: var(--tip-bg); color: var(--tip-text); border: 0; box-shadow: var(--sh-pop); }
.alink { color: var(--ac-text); }
.step { border-color: var(--line); }
.kpi h4 { color: var(--text-2); letter-spacing: .02em; text-transform: none; font-size: var(--fs-meta); }

/* ============================================================ 4. écrans V4.2 de /app (compléments) */
.v42 .linkish { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; font: inherit; }
.v42 .ctab-v { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--card); color: var(--text-2);
  font: 650 var(--fs-xs) var(--mono); cursor: pointer; }
.v42 .ctab-v.on { background: var(--ac-soft); color: var(--ac-text); }
.v42 .ctab-v .x { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.v42 .ctab-v .x:hover { color: var(--neg); }
.v42 .flow-svg .pulse.once { animation-iteration-count: 2; }
.v42 .check-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: var(--fs-sm); }
#cf-modal .scrim { z-index: 120; } #cf-modal .modal { z-index: 121; }
#cf-sheet .scrim { z-index: 80; }

/* en-têtes de page V4.2 au-dessus des onglets du journal et des vues historiques ; les actions du journal
   (« + Nouveau trade »…) se placent sur la ligne d'en-tête, comme les actions de page de la V4.2 */
.cf-ph { margin-bottom: var(--gap); }
.cf-ph .ph { margin: 0; }
@media (min-width: 721px) {
  #tj-ph .ph { padding-right: 240px; }
}

/* ============================================================ 5. composants V4.2 de l'application complète (refonte intégrale)
   Briques communes aux écrans reconstruits (journal, réglages, imports, réconciliation, qualité, connexions) : formulaires
   en grille, document « fiche », modale / tiroir / visionneuse autonomes, états vides. Uniquement des jetons du thème. */
.v42 .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.v42 .fgrid { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 12px 14px; }
.v42 .fgrid > .field { margin-top: 0; }
.v42 .fgrid > .field.wide, .v42 .fgrid > .wide { grid-column: 1 / -1; }
.v42 .field .ctl, .v42 .ctl { box-sizing: border-box; width: 100%; height: 38px; padding: 0 12px; border: 0; border-radius: var(--r-md); background: var(--inset); color: var(--text); outline: 0; font: inherit; font-size: var(--fs-sm); box-shadow: inset 0 0 0 1px var(--line); }
.v42 textarea.ctl { height: auto; min-height: 76px; padding: 9px 12px; line-height: 1.5; resize: vertical; }
.v42 select.ctl { appearance: none; padding-right: 32px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.v42 .ctl:focus { box-shadow: inset 0 0 0 1px var(--ac-border), 0 0 0 3px var(--ac-focus); }
.v42 .ctl:disabled { opacity: .6; }
.v42 input[type="file"].ctl { height: auto; padding: 8px 12px; }
.v42 .field label { font-size: var(--fs-meta); color: var(--text-2); font-weight: 600; }
.v42 .field .hint { font-size: var(--fs-xs); color: var(--text-3); }
.v42 .req { color: var(--warn); }
.v42 .num-in.ctl { width: 110px; height: 30px; }
.v42 .sel.wide-sel { min-width: 260px; max-width: 100%; }
.v42 input[type="checkbox"]:not(.sr-only) { accent-color: var(--ac-2); width: 15px; height: 15px; }
.v42 .cf-check { margin-top: 0; }
.v42 .cf-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.v42 .cf-check .check-box { width: 18px; height: 18px; border-radius: 6px; flex: none; display: grid; place-items: center; background: var(--inset); box-shadow: inset 0 0 0 1px var(--line-2); color: transparent; }
.v42 .cf-check .check-box svg { width: 12px; height: 12px; stroke-width: 2.6; }
.v42 .cf-check input:checked + .check-box { background: linear-gradient(180deg, var(--ac-1), var(--ac-2)); color: var(--ac-on); box-shadow: none; }
.v42 .cf-check input:focus-visible + .check-box { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.v42 .prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.v42 .ac-t { color: var(--ac-text); }
.v42 .pill.xs { height: 18px; padding: 0 6px; font-size: 10.5px; }
.v42 .pill.click { cursor: pointer; }
.v42 .pill.prov { margin-left: 6px; vertical-align: middle; cursor: help; }
.v42 .ibtn.xs { width: 22px; height: 22px; }
.v42 .chip.fchip { gap: 4px; padding-right: 4px; }
.v42 .chip.fchip b { font-weight: 700; }
.v42 .rating { color: var(--warn); letter-spacing: 1px; }
.v42 .chart-empty { padding: 26px 0; text-align: center; }
/* tables V4.2 : tri, sélection, lignes atténuées, en-tête collant dans les tables défilantes */
.v42 table.t th.sortable { cursor: pointer; user-select: none; }
.v42 table.t th.sortable:hover, .v42 table.t th.sorted { color: var(--text); }
.v42 table.t tr.dim td { opacity: .55; }
.v42 table.t tr.selrow td { background: var(--ac-soft); }
/* trades archivés (Journal -> Trades « Archivés » / « Tous ») : case de sélection pour la restauration groupée, ligne atténuée */
.v42 table.t th.sel, .v42 table.t td.sel { width: 34px; padding-right: 0; cursor: default; }
.v42 table.t input[type=checkbox], .v42 .mrow input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--ac); cursor: pointer; vertical-align: middle; }
.v42 table.t tr.is-arch td, .v42 table.t tr.is-arch td b.mono, .v42 .mrow.is-arch .mono { color: var(--text-2); }
.v42 table.t tr.is-arch td:first-child { box-shadow: inset 3px 0 0 var(--neg-soft); }
.v42 table.t .selcol { width: 30px; text-align: center; }
.v42 .tbl-wrap[data-keepscroll] { max-height: 70vh; }
.v42 .tbl-wrap[data-keepscroll] thead th { position: sticky; top: 0; z-index: 1; background: var(--pnl-mid); }
.v42 .bulkbar { padding: 10px 12px; border-radius: var(--r-md); background: var(--ac-soft); }
.v42 .bulkbar .ctl, .v42 .bulkval .ctl { height: 30px; width: auto; min-width: 140px; }
.v42 .mrow.click { cursor: pointer; }
/* document « fiche » (Trade, dossier, événement, préparation) */
.v42 .tr-title { margin: 4px 0 8px; font-size: var(--fs-h1); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.v42 .tr-r { font-size: 38px; font-weight: 700; letter-spacing: -.03em; line-height: 1; white-space: nowrap; }
.v42 .trade-grid { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
.v42 .sub-blk + .sub-blk { margin-top: 16px; padding-top: 16px; box-shadow: inset 0 1px 0 var(--line); }
.v42 .sub-blk .hd { margin-bottom: 10px; }
.v42 .sub-blk.empty-sec .hd { margin-bottom: 0; }
.v42 .sub-blk.empty-sec .hd h2 { color: var(--text-2); }
.v42 .sub-blk.editing { padding: 14px; border-radius: var(--r-md); background: var(--card); }
.v42 .long-f { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--card); }
.v42 .long-f .lf-l { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; margin-bottom: 3px; }
.v42 .long-f .prose { margin: 0; font-size: var(--fs-sm); }
.v42 .ro { padding: 8px 0; }
.v42 .shot img { display: block; width: 100%; max-height: 520px; object-fit: contain; background: var(--shot-bg); }
.v42 .shot img.broken, .v42 .thumbs img.broken { opacity: .3; }
.v42 .thumbs { flex-wrap: wrap; }
.v42 .thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v42 .thumbs label.add { width: 80px; height: 50px; border-radius: var(--r-sm); cursor: pointer; }
.v42 .dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 16px; border-radius: var(--r-lg); background: var(--card); color: var(--text-3); text-align: center; font-size: var(--fs-sm); box-shadow: inset 0 0 0 1px var(--line-2); }
.v42 [data-media-drop].tj-over, .v42 .tj-over .dropzone { box-shadow: inset 0 0 0 2px var(--ac-border); background: var(--ac-soft); color: var(--ac-text); }
.v42 .tagcat { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.v42 .tagcat-l { min-width: 140px; padding-top: 5px; font-size: var(--fs-meta); color: var(--text-2); font-weight: 600; }
.v42 .chip.pick { cursor: pointer; }
.v42 .newtag.ctl { width: 120px; height: 28px; border-radius: var(--r-pill); font-size: var(--fs-meta); }
/* superpositions autonomes (CFUI.openModal / openDrawer / lightbox) : la classe .overlay suspend le re-rendu du sondage */
.overlay.cf-ov, .overlay.cf-dr, .overlay.cf-lb { position: fixed; inset: 0; z-index: 100; display: block; padding: 0; background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadein var(--t); }
.overlay.cf-dr { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.overlay.cf-lb { background: none; }
.v42.cf-ov .modal { z-index: 101; width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto; }
.v42.cf-ov .modal.wide { width: min(760px, calc(100vw - 24px)); }
.v42.cf-ov .modal.xl { width: min(1160px, calc(100vw - 24px)); }
.v42 .modal .m-head { display: flex; align-items: flex-start; gap: 10px; }
.v42 .modal .m-head h2 { flex: 1; margin: 0 0 4px; }
.v42 .modal .m-sub { margin: 0 0 14px; color: var(--text-3); font-size: var(--fs-sm); line-height: 1.5; }
.v42 .modal .m-body { min-width: 0; }
.v42 .modal .m-actions { flex-wrap: wrap; position: sticky; bottom: -22px; margin: 18px -22px -22px; padding: 14px 22px 18px; background: linear-gradient(180deg, transparent, var(--pnl-bot) 30%); }
.v42 .drawer { z-index: 101; }
.v42.cf-dr .scrim { z-index: 100; }
.v42 .lightbox figure { margin: 0; }
.v42 .lightbox .frame-img { display: flex; flex-direction: column; background: var(--shot-bg); }
.v42 .lightbox .frame-img img { max-width: 100%; max-height: calc(100dvh - 140px); object-fit: contain; display: block; margin: 0 auto; }
.v42 .lightbox figcaption { padding: 10px 14px; font-size: var(--fs-sm); color: var(--text-2); background: var(--pnl-bot); }
.v42 .lightbox .lb-prev, .v42 .lightbox .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.v42 .lightbox .lb-prev { left: 16px; } .v42 .lightbox .lb-next { right: 16px; }
/* onglets d'assistant (étapes) */
.v42 .tabs.steps button { cursor: default; }
.v42 .tabs.steps button.done { color: var(--text); }
/* choix de plateforme (modale Connecter un broker) */
.v42 .pchoice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.v42 .pchoice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: var(--r-md); background: var(--card); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.v42 .pchoice > span { display: flex; flex-direction: column; min-width: 0; }
.v42 .pchoice.on { background: var(--ac-soft); box-shadow: inset 0 0 0 1px var(--ac-border); }
.v42 .pchoice .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--card-2); color: var(--text-2); flex: none; }
.v42 .pchoice .ic.ac { background: var(--ac-soft); color: var(--ac-text); }
.v42 .pnl-canvas { margin-bottom: 12px; }
.v42 .pnl-canvas canvas { display: block; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line-2); }
.v42 .pnl-canvas canvas.land { width: 100%; height: auto; }
.v42 .pnl-canvas canvas.port { height: min(64vh, 780px); width: auto; margin: 0 auto; }
/* aide contextuelle (contenu historique : définitions, étapes) */
.v42 .help-body .help-defs { display: flex; flex-direction: column; gap: 6px; }
.v42 .help-body .help-defs .d { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); background: var(--card); font-size: var(--fs-sm); }
.v42 .help-body .help-defs .d span { color: var(--text-2); }
.v42 .help-body .steps { display: grid; gap: 8px; }
.v42 .help-body .step { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--card); font-size: var(--fs-sm); }
.v42 .help-body .step .n { font: 700 var(--fs-xs) var(--mono); color: var(--ac-text); }
.v42 .help-body .hint, .v42 .help-body .sub { color: var(--text-3); font-size: var(--fs-sm); }
.v42 .help-body .alink { color: var(--ac-text); }
/* popovers de l'en-tête */
.v42 .popover .pi .k, .popover .pi .k { margin-left: auto; padding-left: 10px; font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; white-space: nowrap; }
.popover .pi .pi-t { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.popover .pi .pi-t .k { margin: 2px 0 0; padding: 0; white-space: normal; }
.popover .pi.neg { color: var(--neg); }
.v42 .popover .pi.on { color: var(--ac-text); }
.topbar .search { flex: 0 1 300px; }
@media (max-width: 1100px) { .v42 .trade-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .v42 .fgrid { grid-template-columns: minmax(0, 1fr) !important; }
  .v42 .tr-r { font-size: 30px; }
  .v42 .tagcat { flex-direction: column; gap: 6px; }
  .v42 .pchoice-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar .search { display: none; }
  .v42.cf-ov .modal { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; max-height: 92dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; }
}

/* ===================================================================================== 6. Séances (journal_sessions.js) */
.v42 [hidden], .v42[hidden] { display: none !important; }
.v42 .ss-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.v42 label.chip.pick { position: relative; display: inline-flex; align-items: center; }
.v42 label.chip.pick input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.v42 label.chip.pick:focus-within { box-shadow: 0 0 0 3px var(--ac-focus); }
.v42 .chip.dim { opacity: .55; }
.v42 .chip .chip-x { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 2px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); cursor: pointer; }
.v42 .chip .chip-x:hover { background: var(--card-2); color: var(--text); }
.v42 .chip:has(.chip-x) { padding-right: 4px; display: inline-flex; align-items: center; cursor: default; }
.v42 .ss-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
.v42 .ss-conf { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; align-items: center; margin-bottom: 8px; }
.v42 .ss-scenario { box-shadow: inset 3px 0 0 var(--ac); }
.v42 .ss-scenario.notrade { box-shadow: inset 3px 0 0 var(--warn); background: var(--warn-soft); }
.v42 .ss-scenario.archived { opacity: .55; }
.v42 .ss-sc-h { display: grid; grid-template-columns: minmax(0, 1fr) 180px auto; gap: 8px; align-items: center; margin-bottom: 12px; }
.v42 .ss-sc-h input { font-weight: 700; }
.v42 .ss-sc-after { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; box-shadow: inset 0 1px 0 var(--line); }
.v42 .ss-sc-after .ctl { width: auto; min-width: 170px; }
.v42 .ss-mini { padding: 10px 12px; }
.v42 .ss-mini.notrade { background: var(--warn-soft); }
.v42 .ss-amend-new { display: flex; gap: 8px; margin-bottom: 12px; }
.v42 .ss-amend { margin-bottom: 8px; }
.v42 .ss-change { font-size: var(--fs-sm); padding: 4px 0; }
.v42 .ss-before { color: var(--text-3); text-decoration: line-through; }
.v42 .ss-after { color: var(--ac-text); }
.v42 .ss-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.v42 .ss-shot { margin: 0; min-width: 0; }
.v42 .ss-shot .shot img { max-height: 180px; object-fit: cover; }
.v42 .ss-shot figcaption { margin-top: 6px; }
.v42 .ss-trade-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; box-shadow: inset 0 -1px 0 var(--line); align-items: start; }
.v42 .ss-trade-row:last-child { box-shadow: none; }
.v42 .ss-trade-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.v42 .ss-linkrow { cursor: pointer; }
.v42 .ss-linkrow input { accent-color: var(--ac); }
@media (max-width: 1024px) { .v42 .ss-land { grid-template-columns: minmax(0, 1fr) !important; } }
@media (max-width: 720px) {
  .v42 .ss-sc-h, .v42 .ss-conf, .v42 .ss-trade-row { grid-template-columns: minmax(0, 1fr); }
  .v42 .ss-item { grid-template-columns: minmax(0, 1fr) 34px; } .v42 .ss-item > input:nth-child(2) { grid-column: 1; }
  .v42 .ss-amend-new { flex-direction: column; }
  .v42 .ss-trade-act { justify-content: flex-start; }
}
.v42 .rp-type input, .v42 .ss-linkrow input { accent-color: var(--ac); flex: none; }
.v42 .tabs.steps button:disabled { opacity: .45; cursor: not-allowed; }

/* ===================================================================================== 7. Calendrier, journée, revue hebdo */
.v42 .cal button.d { border: 0; font: inherit; text-align: left; width: 100%; cursor: pointer; }
.v42 .cal button.d:not(.has) { cursor: pointer; opacity: .75; }
.v42 .cal button.d:hover { box-shadow: inset 0 0 0 1px var(--line-2, var(--line)); }
.v42 .cal button.d:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--ac-focus); }
.v42 .cal .d.today { box-shadow: inset 0 0 0 1px var(--ac-border); }
.v42 .cal .cal-dot { display: inline-grid; place-items: center; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--card-2); color: var(--text-3); font-size: 9.5px; font-style: normal; font-weight: 800; }
.v42 .cal .cal-dot.neg { background: var(--neg-soft); color: var(--neg); } .v42 .cal .cal-dot.ac { background: var(--ac-soft); color: var(--ac-text); }
.v42 .wk-facts { margin: 8px 0 6px 18px; padding: 0; font-size: var(--fs-sm); color: var(--text-2); } .v42 .wk-facts li { margin: 3px 0; }
.v42 .wk-sugg { padding: 12px 14px; }
.v42 .wk-act { padding: 4px 0; } .v42 .wk-act + .wk-act { box-shadow: inset 0 1px 0 var(--line); }
.v42 button.check { border: 0; padding: 0; cursor: pointer; color: inherit; }
.v42 button.check:focus-visible { box-shadow: 0 0 0 3px var(--ac-focus); }
.v42 .pb-card { padding: 16px; }
@media (max-width: 1024px) { .v42 .cal-grid { grid-template-columns: minmax(0, 1fr) !important; } }
@media (max-width: 720px) { .v42 .cal .d { min-height: 52px; padding: 5px; } .v42 .cal .d .rv { font-size: var(--fs-xs); } }
.v42 .list.wrap .li .title, .v42 .list.wrap .li .meta { white-space: normal; }
.v42 .list.wrap .li { align-items: flex-start; }

/* ===================================================================================== 8. Intelligence */
.v42 .ti-takeaway { margin: 8px 0 10px; font-size: 19px; line-height: 1.45; font-weight: 700; max-width: 70ch; }
.v42 .ti-matrix td.ti-cell a { color: inherit; display: block; text-decoration: none; }
.v42 .ti-matrix td.ti-cell.hp { background: var(--pos-soft); } .v42 .ti-matrix td.ti-cell.hn { background: var(--neg-soft); }
.v42 .ti-matrix td.ti-cell.hp.strong { box-shadow: inset 0 0 0 1px var(--pos); } .v42 .ti-matrix td.ti-cell.hn.strong { box-shadow: inset 0 0 0 1px var(--neg); }
.v42 .ti-matrix td.ti-cell:not(.num) { min-width: 120px; vertical-align: top; font-size: var(--fs-xs); }
.v42 .ti-pre { max-height: 360px; overflow: auto; font-size: 11px; margin: 10px 0 0; padding: 10px; border-radius: var(--r-md); background: var(--inset); }
.v42.cf-dr.wide .drawer { width: min(860px, calc(100vw - 20px)); }
.v42 .mk-ghost { opacity: .5; }
.v42 .mk-card { padding: 14px; }
.v42 .lb-grp { padding: 14px; }

/* ===================================================================================== 9. Imports, Lab, Prop Business */
.v42 .hi-formula { font-family: var(--font-mono, 'JetBrains Mono', monospace); font-size: var(--fs-sm); padding: 10px 12px; border-radius: var(--r-md); background: var(--ac-soft); color: var(--text); margin-bottom: 10px; overflow-wrap: anywhere; }
.v42 .hi-list { margin: 6px 0 0 18px; padding: 0; } .v42 .hi-list li { margin: 3px 0; }
.v42 .hi-pick { accent-color: var(--ac); width: 16px; height: 16px; }
.v42 label.hi-drop { cursor: pointer; }
.v42 label.hi-drop:hover { box-shadow: inset 0 0 0 1px var(--ac-border); }
.v42 .biz-prog .bar { height: 7px; }
@media (max-width: 720px) { .v42 .biz-filters > .ctl, .v42 .biz-filters > .seg { width: 100% !important; } }
/* Mobile : un en-tête de panneau (titre + actions) passe à la ligne au lieu d'élargir la page ; un sélecteur segmenté défile. */
@media (max-width: 560px) {
  .v42 .hd { flex-wrap: wrap; row-gap: 6px; }
  .v42 .hd .aside { white-space: normal; }
  .v42 .hd .right { flex-wrap: wrap; max-width: 100%; }
  .v42 .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .mtitle { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tb-actions { flex: 0 0 auto; gap: 6px; }
  .v42 .grid.keep2 .kpi .v { font-size: 20px; flex-wrap: wrap; }   /* deux KPI par ligne : le montant tient dans sa cellule */
  .v42 .grid.keep2 .kpi .v > * { min-width: 0; overflow-wrap: anywhere; }
}
/* Tablette / petit portable : la barre du haut garde LIVE / EXEC et toutes ses actions visibles (recherche réduite à l'icône). */
@media (min-width: 721px) and (max-width: 1180px) {
  .topbar .search { flex: 0 0 42px; width: 42px; min-width: 0; padding: 0; justify-content: center; }
  .topbar .search span, .topbar .search kbd { display: none; }
  .topbar .market { display: none; }
  .tb-actions { gap: 6px; }
}

/* ===================================================================== 10. Performance Lab · Optimiseur de challenge Prop */
.v42 .eyebrow.pc-eyebrow { color: var(--text); }                    /* titre du résultat : lisible sur le dégradé du panneau principal */
.v42 .eyebrow { font-size: var(--fs-meta); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.v42 .pc-hero { display: flex; gap: 16px; align-items: flex-start; }
.v42 .pc-hero-ic { flex: none; width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--ac-soft); color: var(--ac-text); }
.v42 .pc-hero-act { margin-left: auto; flex: none; }
.v42 .pc-methods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.v42 .pc-method { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 12px 14px; border-radius: var(--r-md); border: 0; cursor: pointer;
  background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); font: inherit; }
.v42 .pc-method:hover:not([disabled]) { box-shadow: inset 0 0 0 1px var(--ac-border); }
.v42 .pc-method.on { box-shadow: inset 0 0 0 2px var(--ac); background: var(--ac-soft); }
.v42 .pc-method[disabled] { opacity: .5; cursor: not-allowed; }
.v42 .pc-sub { margin: 16px 0 8px; font-size: var(--fs-meta); font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.v42 .pc-info { display: inline-flex; vertical-align: middle; color: var(--text-3); cursor: help; }
.v42 .pc-reco { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.v42 .pc-big { font-size: clamp(26px, 3.4vw, 38px); font-weight: 650; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: break-word; }
.v42 .pc-big.pos { color: var(--pos); }
.v42 .pc-why { margin-top: var(--gap); padding: 12px 14px; border-radius: var(--r-md); background: var(--card); font-size: var(--fs-sm); }
.v42 .pc-why ul { margin: 6px 0 0 18px; padding: 0; } .v42 .pc-why li { margin: 4px 0; }
.v42 .pc-alt { margin: 8px 0 4px; font-size: 18px; }
.v42 .pc-heat-wrap { overflow-x: auto; }
.v42 .pc-heat { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: var(--fs-sm); }
.v42 .pc-heat th { font-weight: 600; color: var(--text-2); font-size: var(--fs-meta); padding: 4px 6px; white-space: nowrap; text-align: center; }
.v42 .pc-heat tbody th, .v42 .pc-heat tr th:first-child { text-align: right; }
.v42 .pc-heat td { padding: 0; }
.v42 .pc-cell { width: 100%; min-width: 46px; height: 32px; border: 0; border-radius: 6px; cursor: pointer; font: inherit; font-family: var(--mono);
  font-size: var(--fs-meta); color: var(--text); background: var(--card); }
.v42 .pc-cell:hover { outline: 1px solid var(--ac-border); }
.v42 .pc-cell.zone { box-shadow: inset 0 0 0 1px var(--ac); }
.v42 .pc-cell.best { box-shadow: inset 0 0 0 2px var(--ac); font-weight: 800; }
.v42 .pc-cell { position: relative; }
.v42 .pc-rel { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; }  /* fiabilité des sorties dynamiques */
.v42 .pc-key.pc-rel-HIGH, .v42 .pc-rel.pc-rel-HIGH { background: var(--pos); }
.v42 .pc-rel.pc-rel-MEDIUM { background: var(--warn); }
.v42 .pc-rel.pc-rel-LOW { background: var(--neg); }
.v42 .pc-rel.pc-rel-VERY_LOW { background: var(--neg); box-shadow: 0 0 0 2px color-mix(in oklab, var(--neg) 35%, transparent); }
.v42 .pc-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.v42 .pc-key-best { box-shadow: inset 0 0 0 2px var(--ac); }
.v42 .pc-key-zone { box-shadow: inset 0 0 0 1px var(--ac); }
.v42 .pc-svg { width: 100%; height: auto; display: block; margin-top: 8px; overflow: visible; }
.v42 .pc-ax { font-size: 11px; fill: var(--text-3); font-family: var(--mono); }
.v42 .pc-fail-row { display: grid; grid-template-columns: minmax(110px, 160px) 1fr; gap: 10px; align-items: center; margin: 6px 0; }
.v42 .pc-stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--card); }
.v42 .pc-stack i { display: block; height: 100%; }
.v42 .pc-hist { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin-top: 8px; }
.v42 .pc-hist i { flex: 1; min-width: 4px; background: var(--ac); opacity: .55; border-radius: 3px 3px 0 0; }
.v42 .pc-foot { justify-content: flex-end; }
.v42 .pc-sort { font: inherit; font-weight: 600; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
@media (max-width: 1100px) { .v42 .pc-methods { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .v42 .pc-hero { flex-wrap: wrap; } .v42 .pc-hero-act { margin-left: 0; }
  .v42 .pc-methods { grid-template-columns: minmax(0, 1fr); }
  .v42 .pc-reco { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .v42 .pc-reco > :nth-child(3) { grid-column: 1 / -1; }   /* le taux (ou « Non identifiable » + bornes) : pleine largeur */
  .v42 .pc-big { font-size: 22px; }
  .v42 .pc-fail-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .v42 .pc-foot { justify-content: stretch; } .v42 .pc-foot .btn { flex: 1; }
}

/* ---------------------------------------------------------------- Réglages -> Données -> Normalisation des valeurs (0026) */
.v42 .nv-row { align-items: flex-start; }
.v42 .nv-row.on { box-shadow: inset 0 0 0 1px var(--ac-border); background: var(--ac-soft); }
.v42 .nv-pick { padding-top: 2px; flex: 0 0 auto; }
.v42 .nv-pick input { width: 16px; height: 16px; accent-color: var(--ac); cursor: pointer; }
.v42 .nv-members .nv-member { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; overflow-wrap: anywhere; }
.v42 .nv-member .ibtn.xs { width: 20px; height: 20px; }
.v42 .nv-tabs .tabs { max-width: 100%; overflow-x: auto; }
.v42 .nv-choice { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
@media (max-width: 560px) {
  .v42 .nv-row { flex-wrap: wrap; }
  .v42 .nv-row > .row { width: 100%; justify-content: flex-end; }
  .v42 .nv-tools > * { flex: 1 1 100% !important; }
}
