/* HyperTrade Web — la coquille (barre du haut, menu de gauche, page) et le tableau de bord (v0.02).
   N'écrire que des var(--ht-…) : tout doit marcher en clair ET en sombre (sauf l'infobulle, sombre partout). */

/* La palette catégorielle des comptes (thème TrackMyFund) : toujours dans cet ordre, le nom toujours écrit à côté. */
:root {
  --acct-1: #2a78d6; --acct-2: #eb6834; --acct-3: #1baf7a; --acct-4: #eda100;
  --acct-5: #e87ba4; --acct-6: #008300; --acct-7: #4a3aa7; --acct-8: #e34948;
  --ht-top-h: 3.6rem;
  --ht-side-w: 15.5rem;
  --ht-long: var(--ht-success);
  --ht-short: var(--ht-danger);
  /* v2.84 : le fond d'une carte, aussi hors des cartes — un menu ou une fenêtre posé ailleurs (le ⋯ de la page Pine) était
     transparent ; dans une carte, la sienne (.card) passe toujours devant */
  --ht-card-bg: var(--ht-emphasis-bg);
}
[data-bs-theme=dark] {
  --acct-1: #3987e5; --acct-2: #d95926; --acct-3: #199e70; --acct-4: #c98500;
  --acct-5: #d55181; --acct-6: #008300; --acct-7: #9085e9; --acct-8: #e66767;
}

body { background: var(--ht-body-bg); }
.ht-shell { display: grid; grid-template-columns: var(--ht-side-w) minmax(0, 1fr); grid-template-rows: var(--ht-top-h) 1fr; min-height: 100vh; }

/* ── barre du haut ─────────────────────────────────────────────────────────────────────────── */
.ht-top { grid-column: 1 / -1; position: sticky; top: 0; z-index: 1020; height: var(--ht-top-h);
  padding: 0 1.25rem; border-bottom: 1px solid var(--ht-border-color); }
.ht-top .ht-brandlink { width: calc(var(--ht-side-w) - 1.25rem); }
.ht-clock { font-family: var(--ht-font-monospace); font-variant-numeric: tabular-nums; font-size: .75rem; color: var(--ht-gray-600); font-weight: 500; }

/* ── menu de gauche (repris du menu de TrackMyFund) ─────────────────────────────────────────── */
.ht-side { position: sticky; top: var(--ht-top-h); height: calc(100vh - var(--ht-top-h)); overflow-y: auto;
  padding: .9rem .5rem 1.5rem; border-right: 1px solid var(--ht-border-color); }
.htn { --nv-ink: var(--ht-gray-900); --nv-muted: var(--ht-gray-600); --nv-faint: var(--ht-gray-500);
  --nv-hover: rgba(var(--ht-primary-rgb), .06); --nv-active: rgba(var(--ht-primary-rgb), .11);
  display: flex; flex-direction: column; gap: .15rem; font-size: .8125rem; color: var(--nv-ink); }
.htn-worth { margin: 0 .25rem .7rem; padding: .75rem .85rem; border-radius: .8rem;
  background: linear-gradient(135deg, rgba(var(--ht-primary-rgb), .10), rgba(var(--ht-info-rgb), .06));
  border: 1px solid rgba(var(--ht-primary-rgb), .15); }
.htn-worth .lbl { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ht-primary); font-weight: 700; }
.htn-worth .val { font-size: 1.15rem; font-weight: 700; font-family: var(--ht-font-monospace); font-variant-numeric: tabular-nums;
  margin: .1rem 0 .45rem; color: var(--ht-heading-color); }
.htn-worth .bar { height: .35rem; border-radius: 1rem; background: var(--ht-gray-200); display: flex; overflow: hidden; gap: 2px; }
.htn-worth .bar i { display: block; height: 100%; }
.htn-worth .legend { display: flex; justify-content: space-between; font-size: .7rem; color: var(--nv-muted); margin-top: .35rem; }
.htn-worth .legend b { font-family: var(--ht-font-monospace); font-weight: 600; }
.htn-sec { padding: .8rem .6rem .2rem; font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--ht-primary); }
.htn-link { position: relative; display: flex; align-items: center; gap: .55rem; padding: .3rem .6rem; margin: 0 .25rem; border-radius: .6rem;
  color: var(--nv-ink); text-decoration: none; font-weight: 500; transition: background .12s; }
.htn-link:hover { background: var(--nv-hover); color: var(--nv-ink); }
.htn-link:focus-visible { outline: 2px solid var(--ht-primary); outline-offset: -2px; }
.htn-link .ic { width: 1.35rem; height: 1.35rem; border-radius: .4rem; display: grid; place-items: center; flex-shrink: 0;
  background: var(--ht-gray-100); color: var(--nv-muted); font-size: .72rem; transition: all .12s; }
.htn-link.active { background: var(--nv-active); color: var(--ht-primary); font-weight: 600; }
.htn-link.active::before { content: ""; position: absolute; left: -.25rem; top: .25rem; bottom: .25rem; width: 3px; border-radius: 3px; background: var(--ht-primary); }
.htn-link.active .ic { background: var(--ht-primary); color: #fff; box-shadow: 0 .25rem .6rem rgba(var(--ht-primary-rgb), .35); }
.htn-link .pill { margin-left: auto; font-size: .65rem; font-weight: 700; padding: .05rem .45rem; border-radius: 1rem;
  background: rgba(var(--ht-primary-rgb), .12); color: var(--ht-primary); }
.htn-link .pill:empty { display: none; }
.htn-link .dot { margin-left: auto; width: .5rem; height: .5rem; border-radius: 50%; }
.htn-link .dot.ok { background: var(--ht-success); box-shadow: 0 0 0 3px rgba(var(--ht-success-rgb), .18); }
.htn-acct { display: flex; align-items: center; gap: .55rem; padding: .25rem .6rem; margin: 0 .25rem; border-radius: .6rem; color: var(--nv-ink); text-decoration: none; }
.htn-acct:hover { background: var(--nv-hover); color: var(--nv-ink); }
.htn-acct .acct-dot { margin: 0; align-self: flex-start; margin-top: .3rem; }
.htn-acct .mid { min-width: 0; flex: 1; }
.htn-acct .nm { display: block; font-size: .78rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.htn-acct .sub { display: block; font-size: .64rem; color: var(--nv-faint); line-height: 1.25; }
.htn-acct .sub.warn { color: var(--ht-warning); }
.htn-acct .amt { font-family: var(--ht-font-monospace); font-variant-numeric: tabular-nums; font-size: .72rem; font-weight: 600;
  text-align: right; white-space: nowrap; line-height: 1.2; }
.htn-acct .amt small { display: block; font-size: .64rem; font-weight: 500; }

/* ── la page ───────────────────────────────────────────────────────────────────────────────── */
.ht-main { padding: 1.4rem 1.6rem 3rem; min-width: 0; }
.ht-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.ht-h1 { font-size: 1.35rem; margin: 0; }
.ht-sub { font-size: .78rem; color: var(--ht-gray-600); margin-top: .15rem; }
/* le « ? » de l'aide (util.js helpMark) — un petit rond discret à côté d'un titre ou d'un réglage, vers le passage de
   l'aide qui l'explique : en retrait (gris, sans fond), la couleur principale au survol, un anneau net au clavier */
.ht-h1row { display: flex; align-items: center; gap: .5rem; }
.ht-helpmark { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1rem; height: 1rem; padding: 0;
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: 50%; background: transparent; color: var(--ht-gray-500);
  font: 700 .62rem/1 var(--ht-body-font-family); letter-spacing: 0; text-transform: none; text-decoration: none; vertical-align: middle;
  transition: color .12s, border-color .12s, background-color .12s; }
.ht-helpmark:hover, .ht-helpmark:focus-visible { color: var(--ht-primary); border-color: rgba(var(--ht-primary-rgb), .6); background: rgba(var(--ht-primary-rgb), .1); }
.ht-helpmark:focus-visible { outline: 2px solid var(--ht-primary); outline-offset: 2px; }
/* dans une ligne de texte (libellé, titre de colonne) : un peu d'air, sans grandir la ligne */
.ht-lbl .ht-helpmark, th .ht-helpmark { margin: -.2rem 0 -.2rem .3rem; }
.ht-card-h > .ht-helpmark { margin-left: -.35rem; }                       /* tout près du titre de la carte */
.ht-tk-h > .ht-helpmark { margin: 0 auto 0 .45rem; }                      /* le ticket : après son titre, le verrou reste à droite */
.ht-mcbar > .ht-helpmark { margin-left: -.15rem; }                        /* Trading : au bout de la barre des onglets */
.ht-cbal .ht-helpmark { pointer-events: auto; width: .9rem; height: .9rem; font-size: .56rem; }   /* le solde sur le graphique */

/* Chiffres : chasse fixe, largeur constante. Vert / rouge réservés au sens (gain / perte). */
.mono, .num, .ht-kpi .val, .ht-acct .eq, .ht-eq-sum .v { font-family: var(--ht-font-monospace); font-variant-numeric: tabular-nums; }
.pos { color: var(--ht-success) !important; }
.neg { color: var(--ht-danger) !important; }
.acct-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; flex: none; }

/* ── indicateurs ───────────────────────────────────────────────────────────────────────────── */
.ht-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .9rem; margin-bottom: .9rem; }
.ht-kpi { padding: .85rem 1rem; }
.ht-kpi .lbl { font-size: .625rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; color: var(--ht-gray-600); }
.ht-kpi .val { font-size: 1.3rem; font-weight: 700; color: var(--ht-heading-color); margin: .2rem 0 .15rem; white-space: nowrap; }
.ht-kpi .sub { font-size: .72rem; color: var(--ht-gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-kpi .ht-bar { margin: .15rem 0 .35rem; }

/* Mini-barre : 6 px, la couleur dit le niveau. */
.ht-bar { height: 6px; border-radius: 3px; background: var(--ht-gray-200); overflow: hidden; }
.ht-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--ht-primary); transition: width .35s ease; }
.ht-bar > span.mid { background: var(--ht-warning); }
.ht-bar > span.hi { background: var(--ht-danger); }
.ht-bar > span.long { background: var(--ht-long); }
.ht-bar > span.short { background: var(--ht-short); }
.ht-bar.lg { height: 8px; }

/* ── cartes de comptes ─────────────────────────────────────────────────────────────────────── */
.ht-accts { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .9rem; margin-bottom: .9rem; }
.ht-acct { padding: .9rem 1rem .75rem; border-top: 1px solid var(--ht-border-color); }
.ht-acct.is-off { background: linear-gradient(0deg, rgba(var(--ht-warning-rgb), .06), rgba(var(--ht-warning-rgb), .06)), var(--ht-card-bg); }
.ht-acct .top { display: flex; align-items: center; gap: .4rem; margin-bottom: .55rem; }
.ht-acct .nm { color: var(--ht-heading-color); font-size: .9rem; }
.ht-acct .eq { font-size: 1.2rem; font-weight: 700; color: var(--ht-heading-color); line-height: 1.2; }
.ht-acct .spark { width: 45%; height: 34px; }
.ht-spark { width: 100%; height: 100%; display: block; }
.ht-acct .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; margin: .7rem 0 .6rem; }
.ht-acct .stats dt { font-size: .6rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; color: var(--ht-gray-500); }
.ht-acct .stats dd { margin: 0; font-family: var(--ht-font-monospace); font-size: .82rem; font-weight: 600; color: var(--ht-gray-900); }
.ht-acct .foot { display: flex; align-items: center; gap: .4rem; padding-top: .55rem; border-top: 1px solid var(--ht-border-color); }
.ht-chip { font-size: .64rem; font-weight: 600; padding: .1rem .45rem; border-radius: 1rem; background: var(--ht-gray-100); color: var(--ht-gray-700);
  border: 1px solid var(--ht-border-color); white-space: nowrap; }
.ht-chip.acc { background: rgba(var(--ht-primary-rgb), .1); color: var(--ht-primary); border-color: rgba(var(--ht-primary-rgb), .2); }
.ht-chip.off { opacity: .6; }
/* v2.79 : un compte qui copie un maître (« copie ×0,5 · PAPIER 2 ») : coupé (…) quand la place manque, le détail au survol */
.ht-chip.ht-cpy { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.ht-status { font-size: .68rem; font-weight: 600; white-space: nowrap; }
.ht-status.ok { color: var(--ht-success); }
.ht-status.bad { color: var(--ht-warning); }
.ht-icon-btn { border: 0; background: none; color: var(--ht-gray-500); border-radius: .4rem; padding: 0 .35rem; line-height: 1.3; font-weight: 700; }
.ht-icon-btn:hover { background: var(--ht-gray-100); color: var(--ht-gray-900); }
.ht-icon-btn:focus-visible { outline: 2px solid var(--ht-primary); }

/* ── grille du bas : 2/3 + 1/3 ─────────────────────────────────────────────────────────────── */
.ht-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: .9rem; align-items: start; }
.ht-card { padding: 1rem 1.1rem; }
.ht-card-h { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.ht-card-h h2 { font-size: .95rem; margin: 0; }
.ht-count { font-size: .7rem; font-weight: 700; padding: .05rem .45rem; border-radius: 1rem; background: rgba(var(--ht-primary-rgb), .12);
  color: var(--ht-primary); vertical-align: middle; font-family: var(--ht-body-font-family); }

/* Segmented control : plateau gris, choix actif = pastille en relief. */
.ht-seg { background: var(--ht-gray-200); border-radius: .45rem; padding: 2px; display: inline-flex; }
.ht-seg .btn { background: transparent; border: 1px solid transparent; box-shadow: none; color: var(--ht-gray-700); font-weight: 500;
  border-radius: .35rem !important; padding: .15rem .6rem; font-size: .74rem; }
.ht-seg .btn:hover { color: var(--ht-gray-900); }
.ht-seg .btn:focus-visible { outline: 2px solid var(--ht-primary); outline-offset: -1px; }
.ht-seg .btn.active { background: var(--ht-card-bg); border-color: var(--ht-border-color); color: var(--ht-gray-900); font-weight: 600;
  box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .1); }

/* ── tableaux denses ───────────────────────────────────────────────────────────────────────── */
.ht-table { --bs-table-bg: transparent; color: var(--ht-body-color); }
.ht-table > :not(caption) > * > * { padding: .4rem .5rem; border-bottom-color: var(--ht-border-color); background: transparent; vertical-align: middle; }
.ht-table thead th { font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; color: var(--ht-gray-600);
  font-weight: 700; border-bottom-width: 1px; }
.ht-table tbody td { font-size: .8rem; white-space: nowrap; }
.ht-table .num { text-align: right; }
.ht-table td b { color: var(--ht-heading-color); }
.ht-more { font-size: .62rem; font-weight: 700; margin-left: .3rem; padding: 0 .3rem; border-radius: .3rem; background: var(--ht-gray-200); color: var(--ht-gray-700); }
.ht-table td.act { width: 2rem; text-align: right; }
.ht-dir { font-size: .66rem; font-weight: 700; letter-spacing: .04em; padding: .1rem .4rem; border-radius: .3rem; }
.ht-dir.long { background: rgba(var(--ht-success-rgb), .14); color: var(--ht-success); }
.ht-dir.short { background: rgba(var(--ht-danger-rgb), .13); color: var(--ht-danger); }
.ht-dir.neutral { background: var(--ht-gray-200); color: var(--ht-gray-700); }
.ht-flag { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .05rem .35rem; border-radius: .3rem; margin-left: .35rem; }
.ht-flag.warn { background: rgba(var(--ht-warning-rgb), .16); color: var(--ht-warning); }
.ht-flag.info { background: rgba(var(--ht-info-rgb), .14); color: var(--ht-info); }
.ht-pos > :not(caption) > * > * { padding-left: .35rem; padding-right: .35rem; }
.ht-pos tr.grp { cursor: pointer; }
.ht-pos tr.grp:hover > td { background: rgba(var(--ht-primary-rgb), .04); }
.ht-pos tr.grp.is-orphan > td { background: rgba(var(--ht-warning-rgb), .07); }
.ht-pos tr.leg > td { background: var(--ht-gray-100); font-size: .76rem; padding-top: .28rem; padding-bottom: .28rem; }
.ht-pos .chev { display: inline-block; width: .45rem; height: .45rem; border-right: 1.5px solid var(--ht-gray-500); border-bottom: 1.5px solid var(--ht-gray-500);
  transform: rotate(-45deg); transition: transform .15s; margin-left: .2rem; }
.ht-pos tr.grp.open .chev { transform: rotate(45deg); }
.ht-pos td .acct-dot { margin-right: .2rem; }
.ht-close { border: 1px solid var(--ht-border-color); background: var(--ht-card-bg); color: var(--ht-gray-600); border-radius: .4rem;
  width: 1.6rem; height: 1.6rem; line-height: 1; font-size: .72rem; padding: 0; }
.ht-close.sm { width: 1.35rem; height: 1.35rem; font-size: .62rem; }
.ht-close:hover { background: rgba(var(--ht-danger-rgb), .1); color: var(--ht-danger); border-color: rgba(var(--ht-danger-rgb), .35); }
.ht-close:focus-visible { outline: 2px solid var(--ht-danger); }

/* ── equity ────────────────────────────────────────────────────────────────────────────────── */
.ht-eq-sum { display: flex; align-items: baseline; gap: .6rem; font-size: .8rem; margin-bottom: .3rem; }
.ht-eq-sum .v { font-size: 1.25rem; font-weight: 700; color: var(--ht-heading-color); }
.ht-chart { position: relative; height: 190px; }
.ht-chart svg { display: block; }
.ht-chart .grid { stroke: var(--ht-gray-200); stroke-dasharray: 3 4; }
.ht-chart .tick { fill: var(--ht-gray-500); font-size: 10px; }
.ht-chart .cross { stroke: var(--ht-gray-400); stroke-dasharray: 2 3; }
.ht-chart .pt { fill: var(--ht-primary); stroke: var(--ht-card-bg); stroke-width: 2; }
/* Infobulle : aux couleurs du thème (fond de carte, texte du corps ; gains verts, pertes rouges). */
.ht-tip { position: absolute; pointer-events: none; min-width: 7.5rem; padding: .4rem .6rem; border-radius: .45rem; font-size: .72rem;
  background: var(--ht-card-bg); border: 1px solid var(--ht-border-color); color: var(--ht-body-color); box-shadow: var(--ht-box-shadow); }
.ht-tip .k { color: var(--ht-gray-600); }
.ht-tip .v { font-family: var(--ht-font-monospace); font-weight: 700; }

/* ── exposition ────────────────────────────────────────────────────────────────────────────── */
.ht-expo { display: flex; flex-direction: column; gap: .6rem; }
.ht-expo .row-e { display: grid; grid-template-columns: 4.8rem minmax(0, 1fr) 5.6rem 2.6rem; align-items: center; gap: .6rem; font-size: .78rem; }
.ht-expo .coin { font-weight: 600; color: var(--ht-gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-expo .num { text-align: right; font-weight: 600; }
.ht-expo .share { text-align: right; color: var(--ht-gray-600); font-size: .72rem; }

/* ── clé / valeur (pont MT5) ───────────────────────────────────────────────────────────────── */
.ht-kv { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1rem; margin: 0; }
.ht-kv dt { font-size: .6rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; color: var(--ht-gray-500); }
.ht-kv dd { margin: 0; font-weight: 600; color: var(--ht-gray-900); font-size: .86rem; }

/* ── activité ──────────────────────────────────────────────────────────────────────────────── */
.ht-log { list-style: none; margin: 0; padding: 0; }
.ht-log li { display: grid; grid-template-columns: 1.3rem 5.6rem minmax(0, 1fr); gap: .5rem; align-items: center; padding: .38rem 0;
  border-bottom: 1px solid var(--ht-border-color); font-size: .79rem; }
.ht-log li:last-child { border-bottom: 0; }
.ht-log .ic { width: 1.3rem; height: 1.3rem; border-radius: 50%; display: grid; place-items: center; font-size: .62rem; font-weight: 800; }
.ht-log .t { font-family: var(--ht-font-monospace); color: var(--ht-gray-500); font-size: .72rem; }
.ht-log .m { color: var(--ht-gray-800); }
.ht-log .lv-ok .ic { background: rgba(var(--ht-success-rgb), .15); color: var(--ht-success); }
.ht-log .lv-info .ic { background: rgba(var(--ht-info-rgb), .15); color: var(--ht-info); }
.ht-log .lv-warn .ic { background: rgba(var(--ht-warning-rgb), .18); color: var(--ht-warning); }
.ht-log .lv-err .ic { background: rgba(var(--ht-danger-rgb), .15); color: var(--ht-danger); }

/* ── page à venir ──────────────────────────────────────────────────────────────────────────── */
.ht-empty { padding: 3rem 1rem; text-align: center; color: var(--ht-gray-600); }
.ht-empty .big { font-size: 2rem; margin-bottom: .4rem; }
.ht-empty b { color: var(--ht-heading-color); font-size: 1rem; }
.ht-empty p { margin: .4rem auto 0; max-width: 32rem; font-size: .85rem; }

/* ── message bref ──────────────────────────────────────────────────────────────────────────── */
.ht-toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1rem); opacity: 0; pointer-events: none; z-index: 4000;
  background: #1b2436; color: #eef1f6; border: 1px solid #2d3a52; padding: .55rem 1rem; border-radius: .6rem; font-size: .8rem;
  box-shadow: 0 .6rem 1.6rem rgba(0, 0, 0, .25); transition: all .2s ease; }
.ht-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Un écran d'ordinateur plus étroit : les indicateurs sur deux rangées de trois, la grille du bas sur une colonne. */
@media (max-width: 1399.98px) { .ht-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1199.98px) { .ht-grid { grid-template-columns: minmax(0, 1fr); } }

/* ── la fenêtre des thèmes de couleur (🎨, reprise de TrackMyFund) ─────────────────────────── */
.htt-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin-bottom: .45rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ht-gray-600); }
.htt-calw { font-size: .72rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.htt-calw summary { cursor: pointer; color: var(--ht-primary); }
.htt-cal { display: grid; grid-template-columns: repeat(4, max-content); gap: .1rem 1rem; margin-top: .3rem; color: var(--ht-gray-700); }
.htt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .4rem; }
.htt-grid.auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
/* une carte d'une ligne : liseré et reflet à la couleur du thème (--tp), l'emoji, le nom, ses deux couleurs */
.htt-card { display: flex; align-items: center; gap: .5rem; min-width: 0; padding: .4rem .55rem .4rem .6rem; border-radius: .55rem; text-align: left; cursor: pointer;
  border: 1px solid var(--ht-gray-200); border-left: 3px solid var(--tp); color: var(--ht-gray-900);
  background: linear-gradient(90deg, color-mix(in srgb, var(--tp) 10%, var(--ht-emphasis-bg, var(--ht-body-bg))), var(--ht-emphasis-bg, var(--ht-body-bg)) 70%);
  transition: border-color .12s, box-shadow .12s, transform .12s; }
.htt-card:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--tp) 55%, transparent); box-shadow: 0 .25rem .7rem -.3rem var(--tp); }
.htt-card:focus-visible { outline: 2px solid var(--tp); outline-offset: 2px; }
.htt-card.on { border-color: var(--tp); box-shadow: 0 0 0 2px var(--tp) inset; }
.htt-card.on .htt-name::after { content: ' ✓'; color: var(--tp); }
.htt-emoji { font-size: 1.05rem; line-height: 1; flex: none; }
.htt-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.htt-name { font-weight: 600; font-size: .8rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htt-sub { font-size: .68rem; color: var(--ht-gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htt-sw { flex: none; width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; border: 1px solid rgba(0, 0, 0, .08); }
.htt-sw + .htt-sw { margin-left: -.25rem; }
.htt-opts { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--ht-gray-200); }
@media (max-width: 575.98px) { .htt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .htt-cal { grid-template-columns: repeat(2, max-content); } }

/* ── le NIP : champ et pavé numérique (aux couleurs du thème) ─────────────────────────────── */
/* le NIP : une petite carte épurée — le nom, des points (jamais les chiffres), le pavé seulement si on le demande */
#ht-lock.pinmode .card { max-width: 20rem; margin: 0 auto; }
#ht-lock.pinmode .card-body { padding: 1.6rem 1.5rem 1.2rem !important; text-align: center; }
#ht-lock.pinmode .card-body > .d-flex:first-child { justify-content: center; }
#ht-lock.pinmode #ht-subtitle { font-size: .9rem !important; font-weight: 700; color: var(--ht-heading-color) !important; margin: .4rem 0 1rem !important; }
.ht-pin-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ht-pin-dots { display: flex; justify-content: center; gap: .7rem; margin: .2rem 0 1.1rem; cursor: text; min-height: 1rem; }
.ht-pin-dots i { width: .8rem; height: .8rem; border-radius: 50%; border: 2px solid var(--ht-border-color); transition: background .12s, border-color .12s, transform .12s; }
.ht-pin-dots i.on { background: var(--ht-primary); border-color: var(--ht-primary); transform: scale(1.08); }
.ht-pin-dots.shake { animation: ht-shake .35s; }
@keyframes ht-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.ht-pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; margin-bottom: .2rem; }
.ht-pinpad button { border: 1px solid var(--ht-border-color); background: var(--ht-card-bg); color: var(--ht-body-color); border-radius: .6rem;
  padding: .55rem 0; font-size: 1rem; font-weight: 700; font-family: var(--ht-font-monospace); }
.ht-pinpad button:hover { background: rgba(var(--ht-primary-rgb), .1); border-color: var(--ht-primary); color: var(--ht-primary); }
.ht-pinpad button.ok { background: rgba(var(--ht-primary-rgb), .16); border-color: var(--ht-primary); color: var(--ht-primary); }
.ht-pin-links { display: flex; justify-content: center; gap: 1rem; margin-top: .6rem; }
.ht-pin-links button { all: unset; cursor: pointer; font-size: .72rem; color: var(--ht-gray-600); }
.ht-pin-links button:hover { color: var(--ht-primary); }
.ht-pin-links button.danger:hover { color: var(--ht-danger); }

/* ── le texte « blanc » du mode sombre prend la teinte du thème (v0.46) : titres, montants en gras, noms… ──────────────
   Le sombre de HT utilise du blanc pur (emphasis) et un blanc bleuté (titres) quel que soit le thème ; on les mêle à la
   couleur principale du thème (crème orangée pour Halloween, rosée pour la Saint-Valentin…), le corps du texte un peu aussi. */
/* v0.51 : plus franc — et les gris clairs (gray-800 → 1100, le texte de presque tout : listes, montants, champs, menus)
   suivent aussi, sinon ils restaient blanc bleuté. */
:root[data-bs-theme=dark] {
  --ht-heading-color: color-mix(in srgb, var(--ht-primary) 55%, #e6e6e6);
  --ht-emphasis-color: color-mix(in srgb, var(--ht-primary) 50%, #e6e6e6);
  --ht-secondary-color: color-mix(in srgb, var(--ht-primary) 40%, #c4c4c4);
  --ht-body-color: color-mix(in srgb, var(--ht-primary) 30%, #a2a2a2);
  --ht-gray-800: color-mix(in srgb, var(--ht-primary) 35%, #b4b4b4);
  --ht-gray-900: color-mix(in srgb, var(--ht-primary) 42%, #d2d2d2);
  --ht-gray-1000: color-mix(in srgb, var(--ht-primary) 48%, #dedede);
  --ht-gray-1100: color-mix(in srgb, var(--ht-primary) 52%, #e6e6e6);
  /* v0.60 : teinte franche (55 % de la couleur du thème sur les titres) : avec le thème bleu par défaut, 30 % restait blanc bleuté.
     v0.52 : les gris moyens aussi (libellés, textes secondaires, en-têtes de tableaux, « text-600 »…) */
  --ht-gray-400: color-mix(in srgb, var(--ht-primary) 22%, #565656);
  --ht-gray-500: color-mix(in srgb, var(--ht-primary) 28%, #6a6a6a);
  --ht-gray-600: color-mix(in srgb, var(--ht-primary) 32%, #838383);
  --ht-gray-700: color-mix(in srgb, var(--ht-primary) 34%, #a0a0a0);
  --ht-secondary-color: color-mix(in srgb, var(--ht-primary) 34%, #a0a0a0);
  --ht-tertiary-color: color-mix(in srgb, var(--ht-primary) 32%, #838383);
  --ht-table-color: var(--ht-body-color);
  --ht-navbar-vertical-default-link-color: var(--ht-gray-700);
  --ht-btn-ht-default-color: var(--ht-gray-900);
  --bs-emphasis-color: var(--ht-emphasis-color);
  --bs-heading-color: var(--ht-heading-color);
  --bs-body-color: var(--ht-body-color);
}
:root[data-bs-theme=dark] h1, :root[data-bs-theme=dark] h2, :root[data-bs-theme=dark] h3, :root[data-bs-theme=dark] h4,
:root[data-bs-theme=dark] h5, :root[data-bs-theme=dark] h6 { color: var(--ht-heading-color); }
:root[data-bs-theme=dark] .form-control, :root[data-bs-theme=dark] .form-select { color: var(--ht-gray-900); }
/* les classes .text-300 … .text-1100 du thème lisent des triplets RVB fixes (gris bleuté) : on les remet sur les gris teintés */
:root[data-bs-theme=dark] .text-400 { color: var(--ht-gray-400) !important; }
:root[data-bs-theme=dark] .text-500 { color: var(--ht-gray-500) !important; }
:root[data-bs-theme=dark] .text-600 { color: var(--ht-gray-600) !important; }
:root[data-bs-theme=dark] .text-700 { color: var(--ht-gray-700) !important; }
:root[data-bs-theme=dark] .text-800 { color: var(--ht-gray-800) !important; }
:root[data-bs-theme=dark] .text-900 { color: var(--ht-gray-900) !important; }
:root[data-bs-theme=dark] .text-1000 { color: var(--ht-gray-1000) !important; }
:root[data-bs-theme=dark] .text-1100 { color: var(--ht-gray-1100) !important; }
:root[data-bs-theme=dark] .text-muted, :root[data-bs-theme=dark] .text-body-secondary { color: var(--ht-secondary-color) !important; }
:root[data-bs-theme=dark] .text-body-tertiary { color: var(--ht-tertiary-color) !important; }
:root[data-bs-theme=dark] .form-text, :root[data-bs-theme=dark] caption { color: var(--ht-gray-700); }
:root[data-bs-theme=dark] .table { --ht-table-color: var(--ht-body-color); --ht-table-striped-color: var(--ht-body-color); }
:root[data-bs-theme=dark] body { color: var(--ht-body-color); }
:root[data-bs-theme=dark] .ht-table td b, :root[data-bs-theme=dark] b, :root[data-bs-theme=dark] strong { color: inherit; }
:root[data-bs-theme=dark] .ht-table td b { color: var(--ht-heading-color); }

/* l'equity : les dépôts / retraits et le résultat hors flux (v0.40) */
.ht-eq-flows { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: .1rem 0 .4rem; }
.ht-eq-flows span { display: flex; flex-direction: column; line-height: 1.2; }
.ht-eq-flows small { font-size: .6rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ht-gray-600); }
.ht-eq-flows b { font-size: .8rem; font-family: var(--ht-font-monospace); color: var(--ht-body-color); }
.ht-chart .fl-in { fill: var(--ht-success); stroke: var(--ht-card-bg); stroke-width: 1; cursor: help; }
.ht-chart .fl-out { fill: var(--ht-danger); stroke: var(--ht-card-bg); stroke-width: 1; cursor: help; }
.ht-chart .fl-ln { stroke: var(--ht-gray-500); stroke-width: 1; stroke-dasharray: 2 3; opacity: .6; pointer-events: none; }

/* ── plus de texte blanc (v0.40) : les boutons « pleins » prennent le style doux du thème — fond teinté, texte de la couleur ── */
.btn-primary { --ht-btn-color: var(--ht-primary); --ht-btn-bg: rgba(var(--ht-primary-rgb), .14); --ht-btn-border-color: rgba(var(--ht-primary-rgb), .45);
  --ht-btn-hover-color: var(--ht-primary); --ht-btn-hover-bg: rgba(var(--ht-primary-rgb), .24); --ht-btn-hover-border-color: var(--ht-primary);
  --ht-btn-active-color: var(--ht-primary); --ht-btn-active-bg: rgba(var(--ht-primary-rgb), .3); --ht-btn-active-border-color: var(--ht-primary);
  --ht-btn-disabled-color: var(--ht-primary); --ht-btn-disabled-bg: rgba(var(--ht-primary-rgb), .08); --ht-btn-disabled-border-color: rgba(var(--ht-primary-rgb), .25);
  color: var(--ht-primary); background: rgba(var(--ht-primary-rgb), .14); border-color: rgba(var(--ht-primary-rgb), .45); box-shadow: none; font-weight: 600; }
.btn-primary:hover, .btn-primary:focus-visible { color: var(--ht-primary); background: rgba(var(--ht-primary-rgb), .24); border-color: var(--ht-primary); }
.btn-primary:active, .btn-primary.active { color: var(--ht-primary) !important; background: rgba(var(--ht-primary-rgb), .3) !important; }
.htn-link.active .ic { background: rgba(var(--ht-primary-rgb), .18); color: var(--ht-primary); box-shadow: inset 0 0 0 1px rgba(var(--ht-primary-rgb), .45); }
/* un montant en gras dans une cellule (ou un bloc) verte / rouge garde la couleur du gain / de la perte
   (la règle « .ht-table td b » lui donnait la couleur des titres : blanc en sombre) */
.pos b, .pos strong, .neg b, .neg strong { color: inherit !important; }

/* l'étiquette « papier » (compte fictif) */
.ht-paper { display: inline-block; font-size: .56rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: .05rem .35rem; border-radius: .3rem;
  color: var(--ht-info); background: rgba(var(--ht-info-rgb), .14); border: 1px solid rgba(var(--ht-info-rgb), .4); vertical-align: middle; }

/* l'étiquette d'un compte IBKR (v0.67) */
.ht-ibkr { display: inline-block; font-size: .55rem; font-weight: 800; letter-spacing: .04em; padding: .05rem .3rem; border-radius: .25rem; vertical-align: middle;
  color: #d9433d; background: rgba(217, 67, 61, .14); }
:root[data-bs-theme=dark] .ht-ibkr { color: #ff7a70; background: rgba(255, 122, 112, .14); }
/* un compte TradeZero (v1.48) : la même étiquette, en bleu-vert */
.ht-ibkr.ht-tz { color: #0f8f8a; background: rgba(15, 143, 138, .14); }
:root[data-bs-theme=dark] .ht-ibkr.ht-tz { color: #4fd1c5; background: rgba(79, 209, 197, .14); }
/* un compte MT5 (v2.94) : la même étiquette, en violet ; sa fiche — l'état de l'EA, le jeton (montré une fois), les étapes d'installation */
.ht-ibkr.ht-mt5 { color: #6b5bd6; background: rgba(107, 91, 214, .13); }
:root[data-bs-theme=dark] .ht-ibkr.ht-mt5 { color: #a99cff; background: rgba(169, 156, 255, .14); }
.ht-mt5st { display: flex; flex-direction: column; gap: .15rem; padding: .55rem .75rem; border-radius: .375rem; background: var(--ht-emphasis-bg, rgba(0, 0, 0, .03)); font-size: .78rem; }
.ht-mt5st.ok > b { color: var(--ht-success, #00d27a); }
.ht-mt5st.bad > b { color: var(--ht-warning, #f5803e); }
.ht-mt5tok { margin: 0 0 .7rem; padding: .6rem .75rem; border-radius: .375rem; border: 1px dashed var(--ht-primary); }
.ht-mt5tok input { font-size: .76rem; }
.ht-mt5steps { margin: .7rem 0 0; padding-left: 1.2rem; font-size: .78rem; line-height: 1.55; }
.ht-mt5steps li + li { margin-top: .25rem; }
.ht-mt5steps code { font-size: .74rem; word-break: break-all; }

/* page Copies : le champ de la valeur de copie */
.ht-cpval { width: 8.5rem; }


/* le mode Papier / Réel (barre du haut) : deux boutons, et la couleur du mode sur le bord de la barre et du menu */
.ht-modesw { display: inline-flex; border-radius: .5rem; padding: 2px; background: var(--ht-gray-200); border: 1px solid var(--ht-border-color); }
.ht-modesw button { border: 0; background: transparent; color: var(--ht-gray-700); font-size: .78rem; font-weight: 700; letter-spacing: .03em;
  padding: .28rem .8rem; border-radius: .4rem; line-height: 1.2; }
.ht-modesw button:hover { color: var(--ht-gray-900); }
.ht-modesw button[data-mode="paper"].on { color: var(--ht-info); background: rgba(var(--ht-info-rgb), .16); box-shadow: inset 0 0 0 1px rgba(var(--ht-info-rgb), .55); }
.ht-modesw button[data-mode="real"].on { color: var(--ht-warning); background: rgba(var(--ht-warning-rgb), .16); box-shadow: inset 0 0 0 1px rgba(var(--ht-warning-rgb), .6); }
body.ht-mode-paper .ht-top { box-shadow: inset 0 -3px 0 rgba(var(--ht-info-rgb), .85), 0 2px 10px rgba(var(--ht-info-rgb), .18); }
body.ht-mode-real .ht-top { box-shadow: inset 0 -3px 0 rgba(var(--ht-warning-rgb), .85), 0 2px 10px rgba(var(--ht-warning-rgb), .15); }
/* le VOYANT du mode (v1.35) : à côté du logo, et une lampe dans le bouton actif */
.ht-modetag { display: none; align-items: center; gap: .45rem; margin-left: 1rem; padding: .22rem .7rem .22rem .55rem; border-radius: 2rem; cursor: pointer;
  font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; border: 1px solid; background: transparent; }
.ht-modetag i { width: .6rem; height: .6rem; border-radius: 50%; flex: none; }
body.ht-mode-paper .ht-modetag, body.ht-mode-real .ht-modetag { display: inline-flex; }
body.ht-mode-paper .ht-modetag { color: var(--ht-info); border-color: rgba(var(--ht-info-rgb), .6); background: rgba(var(--ht-info-rgb), .12); }
body.ht-mode-paper .ht-modetag i { background: var(--ht-info); animation: ht-led 1.6s ease-in-out infinite; }
body.ht-mode-real .ht-modetag { color: var(--ht-warning); border-color: rgba(var(--ht-warning-rgb), .6); background: rgba(var(--ht-warning-rgb), .12); }
body.ht-mode-real .ht-modetag i { background: var(--ht-warning); box-shadow: 0 0 .5rem rgba(var(--ht-warning-rgb), .9); }
body.ht-mode-paper .ht-modetag .r, body.ht-mode-real .ht-modetag .p { display: none; }
@keyframes ht-led { 0%, 100% { box-shadow: 0 0 .15rem rgba(var(--ht-info-rgb), .6); opacity: .75; } 50% { box-shadow: 0 0 .7rem rgba(var(--ht-info-rgb), 1); opacity: 1; } }
.ht-modesw button.on::before { content: ''; display: inline-block; width: .45rem; height: .45rem; border-radius: 50%; margin-right: .35rem; vertical-align: .05rem; background: currentColor; box-shadow: 0 0 .4rem currentColor; }
@media (max-width: 767.98px) { .ht-modetag { margin-left: .4rem; padding: .22rem .45rem; } .ht-modetag span { display: none !important; } }


/* ── le menu en RAIL COMPACT (v1.01) : des tuiles carrées, une icône et un petit nom ; plus de place pour le graphique ── */
:root { --ht-side-w: 4.75rem; }
.ht-top .ht-brandlink { width: auto; margin-right: 1.25rem; }
.ht-side { padding: .55rem .35rem 1rem; scrollbar-width: none; }
.ht-side::-webkit-scrollbar { display: none; }
.htn { gap: .2rem; align-items: stretch; }
.htn-worth { margin: 0 0 .45rem; padding: .45rem .2rem .4rem; text-align: center; border-radius: .75rem; cursor: default; }
.htn-worth .lbl { font-size: .5rem; letter-spacing: .08em; }
.htn-worth .lbl .warn { font-style: normal; color: var(--ht-warning); font-weight: 800; }
.htn-worth .val { font-size: .74rem; line-height: 1.15; margin: .1rem 0 .3rem; white-space: nowrap; }
.htn-worth .bar { height: .22rem; margin: 0 .2rem; }
.htn-worth .up { font-family: var(--ht-font-monospace); font-variant-numeric: tabular-nums; font-size: .6rem; font-weight: 600; margin-top: .25rem; white-space: nowrap; }
.htn-sec { font-size: 0; height: 1px; padding: 0; margin: .35rem .55rem; background: var(--ht-border-color); }
.htn-link { flex-direction: column; justify-content: center; gap: .22rem; padding: .32rem .1rem .3rem; margin: 0; border-radius: .7rem;
  font-size: .64rem; font-weight: 600; letter-spacing: .01em; line-height: 1.05; text-align: center; color: var(--nv-muted); }
.htn-link .lb { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htn-link:hover { background: transparent; color: var(--nv-ink); }
.htn-link .ic { width: 2.3rem; height: 2.3rem; border-radius: .7rem; display: grid; place-items: center;
  background: rgba(var(--ht-primary-rgb), .07); border: 1px solid rgba(var(--ht-primary-rgb), .16); color: var(--ht-primary);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease; }
.htn-link .ic svg { width: 1.12rem; height: 1.12rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.htn-link:hover .ic { transform: translateY(-1px); background: rgba(var(--ht-primary-rgb), .14); border-color: rgba(var(--ht-primary-rgb), .38);
  box-shadow: 0 .35rem .9rem rgba(var(--ht-primary-rgb), .22); }
.htn-link.active { background: transparent; color: var(--ht-primary); }
.htn-link.active::before { display: none; }
.htn-link.active .ic, [data-bs-theme=dark] .htn-link.active .ic { color: var(--ht-body-bg); border-color: transparent;
  background: linear-gradient(135deg, var(--ht-primary), rgba(var(--ht-info-rgb), .95));
  box-shadow: 0 .4rem 1.1rem rgba(var(--ht-primary-rgb), .45), inset 0 1px 0 rgba(255, 255, 255, .25); }
.htn-link .pill { position: absolute; top: .1rem; right: .45rem; margin: 0; min-width: 1.05rem; padding: .02rem .3rem; font-size: .54rem; line-height: 1.2; text-align: center; }


/* ── le journal de trades (v1.02) ─────────────────────────────────────────────────────────────────────────── */
.htj-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; margin: 1rem 0; }
.htj-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.htj-grid { display: grid; grid-template-columns: minmax(0, 1fr) 23rem; gap: 1rem; align-items: start; }
@media (max-width: 1399.98px) { .htj-three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 1199.98px) { .htj-top, .htj-three, .htj-grid { grid-template-columns: minmax(0, 1fr); } }
.htj-curve { width: 100%; height: 170px; display: block; }
.htj-curve .zero { stroke: var(--ht-border-color); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.htj-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(3.6rem, .8fr); gap: .3rem; }
/* v1.41 : un jour cliquable (filtre la liste), le jour choisi, le total de la semaine */
.htj-day.has { cursor: pointer; } .htj-day.has:hover { filter: brightness(1.15); }
.htj-day.sel { box-shadow: inset 0 0 0 2px var(--ht-warning); }
.htj-week { border-radius: .5rem; padding: .2rem .35rem; font-size: .66rem; line-height: 1.15; display: flex; flex-direction: column; justify-content: center;
  background: rgba(var(--ht-primary-rgb), .05); border: 1px dashed var(--ht-border-color); }
.htj-week.empty { background: transparent; }
.htj-week b { font-family: var(--ht-font-monospace); font-size: .72rem; white-space: nowrap; } .htj-week small { color: var(--ht-gray-600); font-size: .58rem; }
.htj-dow { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ht-gray-600); text-align: center; font-weight: 700; }
.htj-day { min-height: 3.3rem; border-radius: .5rem; border: 1px solid var(--ht-border-color); padding: .2rem .35rem; font-size: .66rem; line-height: 1.15; overflow: hidden; }
.htj-day.empty { border-color: transparent; }
.htj-day .d { color: var(--ht-gray-600); font-weight: 600; }
.htj-day b { display: block; font-family: var(--ht-font-monospace); font-variant-numeric: tabular-nums; font-size: .7rem; margin-top: .1rem; white-space: nowrap; }
.htj-day small { color: var(--ht-gray-700); font-size: .58rem; }
.htj-day.today { box-shadow: inset 0 0 0 1.5px var(--ht-primary); }
.htj-row { cursor: pointer; }
.htj-row:hover td { background: rgba(var(--ht-primary-rgb), .05); }
.htj-row.on td { background: rgba(var(--ht-primary-rgb), .12); }
.htj-mini { color: var(--ht-warning); font-size: .66rem; letter-spacing: -.05em; }
.htj-side { position: sticky; top: calc(var(--ht-top-h) + 1rem); }
.htj-facts { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .2rem .6rem; font-size: .76rem; }
.htj-facts span { color: var(--ht-gray-600); }
.htj-stars { display: inline-flex; gap: .1rem; }
.htj-stars button { background: none; border: 0; padding: 0 .1rem; font-size: 1.25rem; line-height: 1; color: var(--ht-gray-400); cursor: pointer; transition: transform .1s; }
.htj-stars button:hover { transform: scale(1.15); }
.htj-stars button.on { color: var(--ht-warning); }
.htj-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.htj-chip { border: 1px solid var(--ht-border-color); background: transparent; color: var(--ht-gray-700); border-radius: 1rem; padding: .1rem .55rem; font-size: .7rem; cursor: pointer; }
.htj-chip:hover { border-color: rgba(var(--ht-warning-rgb), .6); }
.htj-chip.on { background: rgba(var(--ht-warning-rgb), .16); color: var(--ht-warning); border-color: rgba(var(--ht-warning-rgb), .65); font-weight: 600; }


/* l'étiquette d'un groupe copié (⧉ G1) : la couleur du groupe (v1.03) */
.ht-cgrp { display: inline-block; font-size: .62rem; font-weight: 800; letter-spacing: .03em; padding: .05rem .38rem; border-radius: .3rem; vertical-align: middle;
  color: var(--gc); background: color-mix(in srgb, var(--gc) 15%, transparent); border: 1px solid color-mix(in srgb, var(--gc) 55%, transparent); white-space: nowrap; }


/* Comptes → Garde-fous : la jauge de la perte du jour (v1.19) */
.ht-riskbar { height: .45rem; border-radius: 1rem; background: rgba(var(--ht-success-rgb), .15); overflow: hidden; }
.ht-riskbar i { display: block; height: 100%; background: rgba(var(--ht-warning-rgb), .6); border-radius: 1rem; transition: width .4s; }
.ht-riskbar i.warn { background: var(--ht-warning); } .ht-riskbar i.full { background: var(--ht-danger); }
/* le mode challenge « propfirm » (Comptes → compte papier) */
/* le téléchargement de l’agent IBKR (Comptes → compte IBKR) */
.ht-dlagent { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; padding: .6rem .8rem; border: 1px dashed var(--ht-border-color); border-radius: .5rem; }
.ht-dlagent ol { flex: 1 1 20rem; }
.ht-chgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem 1.2rem; }
.ht-chip.pos { background: rgba(var(--ht-success-rgb), .16); color: var(--ht-success); } .ht-chip.neg { background: rgba(var(--ht-danger-rgb), .16); color: var(--ht-danger); }
.ht-chgrid .ht-riskbar { background: rgba(var(--ht-primary-rgb), .14); }
.ht-chgrid .ht-riskbar i { background: var(--ht-primary); }
.ht-chgrid .ht-riskbar i.ok { background: var(--ht-success); }
.ht-chgrid .ht-riskbar i.warn { background: var(--ht-warning); } .ht-chgrid .ht-riskbar i.full { background: var(--ht-danger); }


/* une nouvelle version en ligne (v1.21) ; v2.73 : un fond opaque — --ht-card-bg n'est défini que dans les cartes : hors d'elles, le
   bandeau était transparent, difficile à voir sur la page */
.ht-newver { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 1980; display: flex; align-items: center; gap: .8rem;
  padding: .65rem .75rem .65rem 1.05rem; border-radius: .8rem; background: color-mix(in srgb, var(--ht-primary) 10%, var(--ht-body-bg));
  border: 2px solid var(--ht-primary); box-shadow: 0 .8rem 2.2rem rgba(0, 0, 0, .5), 0 0 0 4px rgba(var(--ht-primary-rgb), .18); font-size: .88rem;
  font-weight: 500; color: var(--ht-body-color); animation: ck-pal-in .2s ease-out; }
.ht-newver b { color: var(--ht-primary); }
.ht-newver #ht-reload { background: var(--ht-primary); border-color: var(--ht-primary); color: var(--ht-body-bg); font-weight: 700; padding: .3rem .9rem; }
.ht-newver #ht-reload:hover, .ht-newver #ht-reload:focus-visible { filter: brightness(1.12); }
.ht-newver .x { border: 0; background: transparent; color: var(--ht-gray-500); font-size: .9rem; }

/* v3.16 : le menu flottant des pages de réglage (bouton « Réglages » du menu de gauche) */
button.htn-link { border: 0; background: none; font-family: inherit; cursor: pointer; width: 100%; }
/* v3.23 : à l'horizontale, les mêmes tuiles que le rail (icône, petit nom dessous) */
.htn-fly { position: fixed; z-index: 1040; display: flex; flex-direction: row; gap: .2rem; padding: .35rem;
  background: var(--ht-card-bg); border: 1px solid var(--ht-border-color); border-radius: .7rem; box-shadow: 0 .6rem 1.6rem rgba(0, 0, 0, .3); }
.htn-fly.d-none { display: none !important; }
.htn-fly .htn-link { width: 4.05rem; }
.htn-fly .htn-link.active::before { display: none; }

/* Etat des comptes accessible depuis toutes les pages, sans requete supplementaire. */
.ht-connections { position: relative; }
.ht-connections > summary { display: flex; align-items: center; gap: .35rem; list-style: none; padding: .3rem .45rem; border: 1px solid var(--ht-border-color); border-radius: .4rem; cursor: pointer; font-size: .7rem; color: var(--ht-body-color); white-space: nowrap; }
.ht-connections > summary::-webkit-details-marker { display: none; }
.ht-connections > summary > i { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }
.ht-connections .online { color: var(--ht-success); }
.ht-connections .offline { color: var(--ht-danger); }
.ht-connections .pending { color: var(--ht-warning); }
.ht-connections .unknown { color: var(--ht-gray-600); }
.ht-connections-panel { position: absolute; top: calc(100% + .5rem); right: 0; width: min(23rem, calc(100vw - 1rem)); max-height: 65vh; overflow-y: auto; padding: .4rem; border: 1px solid var(--ht-border-color); border-radius: .5rem; background: var(--ht-card-bg); box-shadow: var(--ht-box-shadow); z-index: 1050; }
.ht-connections-heading { padding: .35rem .4rem; font-size: .7rem; color: var(--ht-gray-600); }
.ht-connection-row { display: flex; align-items: center; gap: .45rem; padding: .45rem .4rem; color: var(--ht-body-color); text-decoration: none; font-size: .72rem; }
.ht-connection-row:hover { background: var(--ht-gray-100); border-radius: .3rem; }
.ht-connection-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ht-connection-row > span:last-child { flex: none; font-size: .66rem; }
.ht-connection-empty { padding: .4rem; font-size: .72rem; color: var(--ht-gray-600); }
@media (max-width: 650px) { .ht-connections-label { display: none; } }
