/* HyperTrade Web — les pages de gestion (v0.05 et suivantes) : comptes, positions, groupes, historique, MT5, ratios,
   symboles, serveurs. Mêmes règles : que des var(--ht-…), clair et sombre. */

/* ── liste à gauche + fiche à droite ───────────────────────────────────────────────────────── */
.ht-split { display: grid; grid-template-columns: 22rem minmax(0, 1fr); gap: .9rem; align-items: start; }
.ht-acclist { display: flex; flex-direction: column; gap: .5rem; position: sticky; top: calc(var(--ht-top-h) + 1rem); z-index: 5; }   /* v3.02 : son menu « ＋ Ajouter un compte » passe devant la carte Sécurité */
.ht-accrow { display: flex; align-items: center; gap: .65rem; width: 100%; text-align: left; padding: .7rem .85rem; border-radius: var(--ht-border-radius-lg);
  border: 1px solid transparent; border-left: 1px solid var(--ht-border-color); background: var(--ht-card-bg); box-shadow: var(--ht-box-shadow-sm);
  color: var(--ht-gray-900); transition: border-color .12s, box-shadow .12s; }
.ht-accrow:hover { box-shadow: var(--ht-box-shadow); }
.ht-accrow:focus-visible { outline: 2px solid var(--ht-primary); }
.ht-accrow.active { border-color: rgba(var(--ht-primary-rgb), .45); border-left-color: var(--c, var(--ht-primary)); background: color-mix(in srgb, var(--ht-primary) 5%, var(--ht-card-bg)); }
.ht-accrow .mid { flex: 1; min-width: 0; }
.ht-accrow .mid b { font-size: .86rem; color: var(--ht-heading-color); }
.ht-accrow .mid small { display: block; font-size: .68rem; color: var(--ht-gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-accrow .r { text-align: right; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.ht-accrow .r small { display: block; font-size: .64rem; font-weight: 600; }
.ht-accrow.add { border-style: dashed; border-color: var(--ht-gray-300); border-left-width: 1px; box-shadow: none; background: transparent; }
.ht-accrow.add.active { border-color: var(--ht-primary); }
.ht-accrow .plus { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--ht-primary-rgb), .12);
  color: var(--ht-primary); font-weight: 700; flex: none; }

/* ── formulaire en sections numérotées ─────────────────────────────────────────────────────── */
.ht-accform { padding: 1.1rem 1.3rem; }
.ht-fsec { padding: .9rem 0; border-top: 1px solid var(--ht-border-color); }
.ht-fsec-h { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .86rem; color: var(--ht-heading-color); margin-bottom: .6rem; }
.ht-fsec-h .n { width: 1.35rem; height: 1.35rem; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 800;
  background: rgba(var(--ht-primary-rgb), .12); color: var(--ht-primary); }
.ht-frow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.ht-frow.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ht-explain { margin-top: .6rem; font-size: .76rem; color: var(--ht-gray-700); background: var(--ht-gray-100); border-radius: .5rem; padding: .45rem .7rem; }   /* v2.74 : sans barre à gauche */
.ht-ovr { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }
.ht-formfoot { display: flex; align-items: center; gap: .5rem; padding-top: .9rem; border-top: 1px solid var(--ht-border-color); }
.ht-accform .form-control, .ht-accform .form-select { font-size: .8rem; }
input.mono { font-family: var(--ht-font-monospace); }

/* ── barre de filtres au-dessus d'une table ────────────────────────────────────────────────── */
.ht-filters { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: .75rem; }
.ht-filters .ht-find { width: 13rem; }
.ht-filters .sep { width: 1px; height: 1.4rem; background: var(--ht-border-color); }
.ht-table tfoot td { font-weight: 700; color: var(--ht-heading-color); border-top: 1px solid var(--ht-gray-300); border-bottom: 0; font-size: .8rem; }
.ht-table tr.sub-h > td { background: var(--ht-gray-100); font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ht-gray-700); }
.ht-table td.sel, .ht-table th.sel { width: 1.6rem; }
.ht-table input[type=checkbox] { accent-color: var(--ht-primary); }
.ht-table tr.picked > td { background: rgba(var(--ht-primary-rgb), .06); }
.ht-bulk { display: flex; align-items: center; gap: .6rem; padding: .45rem .75rem; margin-bottom: .6rem; border-radius: .55rem;
  background: rgba(var(--ht-primary-rgb), .1); color: var(--ht-primary); font-size: .8rem; font-weight: 600; }
.ht-bulk.d-none { display: none !important; }
.ht-rowbtn { border: 1px solid var(--ht-border-color); background: var(--ht-card-bg); color: var(--ht-gray-700); border-radius: .4rem; font-size: .68rem; font-weight: 600;
  padding: .1rem .45rem; white-space: nowrap; }
.ht-rowbtn:hover { color: var(--ht-primary); border-color: rgba(var(--ht-primary-rgb), .4); }
.ht-rowbtn:focus-visible { outline: 2px solid var(--ht-primary); }
.ht-rowbtn.danger { color: var(--ht-danger); border-color: rgba(var(--ht-danger-rgb), .45); }
.ht-rowbtn.danger:hover { background: rgba(var(--ht-danger-rgb), .1); color: var(--ht-danger); border-color: var(--ht-danger); }

/* ── v1.75 : les groupes de trades (◆) — des positions choisies à la main, fermées d'un coup ── */
.ht-tgcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(25rem, 1fr)); gap: .8rem; margin-bottom: .9rem; }
.ht-tgcard { padding: .65rem .85rem .6rem; border-top: 3px solid var(--gc); }
.ht-tgcard-h { display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; }
.ht-tgcard-h .nm { font-weight: 800; color: var(--gc); font-size: .9rem; }
.ht-tgcard-h .pnl { font-weight: 800; font-family: var(--ht-font-monospace); font-size: .9rem; }
.ht-tgrows { margin: .4rem 0 .45rem; }
.ht-tgrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto 4.5rem 6rem auto; align-items: center; gap: .45rem; padding: .2rem 0;
  border-top: 1px solid var(--ht-border-color); font-size: .78rem; }
.ht-tgrow:first-child { border-top: 0; }
.ht-tgrow .an { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ht-gray-700); }
.ht-tgrow .mono { font-family: var(--ht-font-monospace); text-align: right; }
.ht-tgrow .num { text-align: right; font-family: var(--ht-font-monospace); font-weight: 700; }
.ht-tgrow.off { opacity: .55; }
.ht-tgrow .x { border: 0; background: none; color: var(--ht-gray-500); padding: 0 .2rem; font-size: .72rem; line-height: 1; }
.ht-tgrow .x:hover { color: var(--ht-danger); }
.ht-tgcard-f { display: flex; gap: .35rem; align-items: center; }
.ht-tghint { font-size: .74rem; color: var(--ht-gray-600); margin: 0 0 .8rem; padding: .45rem .7rem; border: 1px dashed var(--ht-border-color); border-radius: .5rem; }
.ht-pickbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .5rem .7rem; margin-bottom: .7rem; border-radius: .5rem;
  border: 1px dashed rgba(var(--ht-primary-rgb), .55); background: rgba(var(--ht-primary-rgb), .06); }
.ht-pickbar .form-control { width: 14rem; }
.ht-pick { margin: 0 .4rem 0 0; vertical-align: -.15em; cursor: pointer; }
tr.ht-picked > td { background: rgba(var(--ht-primary-rgb), .06); }

/* ── petites tuiles en rangée (utilisées par plusieurs pages) ──────────────────────────────── */
.ht-minikpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .9rem; margin-bottom: .9rem; }

/* ── groupes : une carte par groupe ────────────────────────────────────────────────────────── */
.ht-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(30rem, 1fr)); gap: .9rem; }
.ht-grp { padding: 1rem 1.1rem; border-top: 1px solid var(--ht-border-color); }
.ht-grp.is-orphan { --sc: var(--ht-warning); }
.ht-grp-h { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ht-grp-h .id { font-family: var(--ht-font-monospace); font-size: .78rem; color: var(--ht-gray-600); }
.ht-grp-h .coin { font-size: 1.05rem; font-weight: 700; color: var(--ht-heading-color); }
.ht-grp-h .pnl { margin-left: auto; text-align: right; font-family: var(--ht-font-monospace); font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.ht-grp-h .pnl small { display: block; font-size: .68rem; font-weight: 600; }
.ht-grp-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .72rem; color: var(--ht-gray-600); margin: .3rem 0 .8rem; }
.ht-grp-meta b { color: var(--ht-gray-900); font-weight: 600; }
/* l'échelle SL → entrée → TP, avec le prix actuel */
.ht-ladder { position: relative; height: 3.1rem; margin: .2rem .4rem .9rem; }
.ht-ladder .rail { position: absolute; left: 0; right: 0; top: 1.3rem; height: 6px; border-radius: 3px; background: var(--ht-gray-200); }
.ht-ladder .seg { position: absolute; top: 1.3rem; height: 6px; }
.ht-ladder .seg.loss { background: rgba(var(--ht-danger-rgb), .35); border-radius: 3px 0 0 3px; }
.ht-ladder .seg.gain { background: rgba(var(--ht-success-rgb), .35); border-radius: 0 3px 3px 0; }
.ht-ladder .mk { position: absolute; top: .95rem; width: 2px; height: 14px; transform: translateX(-1px); }
.ht-ladder .mk span { position: absolute; transform: translateX(-50%); white-space: nowrap; font-size: .6rem; font-weight: 700; font-family: var(--ht-font-monospace); }
.ht-ladder .mk.up span { bottom: 17px; } .ht-ladder .mk.dn span { top: 17px; }
.ht-ladder .mk.sl { background: var(--ht-danger); } .ht-ladder .mk.sl span { color: var(--ht-danger); }
.ht-ladder .mk.tp { background: var(--ht-success); } .ht-ladder .mk.tp span { color: var(--ht-success); }
.ht-ladder .mk.en { background: var(--ht-primary); } .ht-ladder .mk.en span { color: var(--ht-primary); }
.ht-ladder .now { position: absolute; top: .9rem; width: 12px; height: 12px; border-radius: 50%; transform: translate(-6px, 2px); background: var(--ht-heading-color);
  box-shadow: 0 0 0 3px var(--ht-card-bg); }
.ht-ladder .now span { position: absolute; left: 50%; bottom: 15px; transform: translateX(-50%); font-size: .6rem; font-weight: 800; color: var(--ht-heading-color);
  font-family: var(--ht-font-monospace); white-space: nowrap; background: var(--ht-card-bg); padding: 0 .2rem; border-radius: .2rem; }
.ht-grp .table-responsive { margin: 0 -.2rem; }
.ht-grp .ht-legs-scroll { max-height: 15.5rem; overflow-y: auto; }   /* plus de 6 comptes : la table défile (v3.32) */
.ht-grp .ht-legs-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--ht-card-bg); }
.ht-grp .ht-table > :not(caption) > * > * { padding-left: .4rem; padding-right: .4rem; }
.ht-grp-foot { display: flex; flex-wrap: wrap; gap: .4rem; padding-top: .6rem; border-top: 1px solid var(--ht-border-color); }
.ht-legst { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .05rem .35rem; border-radius: .3rem; }
.ht-legst.ok { background: rgba(var(--ht-success-rgb), .14); color: var(--ht-success); }
.ht-legst.warn { background: rgba(var(--ht-warning-rgb), .16); color: var(--ht-warning); }
.ht-legst.err { background: rgba(var(--ht-danger-rgb), .13); color: var(--ht-danger); }
.ht-sech { display: flex; align-items: center; gap: .6rem; margin: 1.4rem 0 .7rem; }
.ht-sech h2 { font-size: .95rem; margin: 0; }

/* ── barres de P&L par jour (historique) ───────────────────────────────────────────────────── */
.ht-bars { position: relative; height: 360px; }
.ht-bars svg { display: block; }
.ht-bars .b.pos { fill: var(--ht-success); } .ht-bars .b.neg { fill: var(--ht-danger); }
.ht-bars .b:hover { opacity: .75; }
.ht-bars .zero { stroke: var(--ht-gray-400); }
.ht-bars .cum { fill: none; stroke: var(--ht-primary); stroke-width: 2; }
.ht-bars .tick { fill: var(--ht-gray-500); font-size: 10px; }
.ht-bars .grid { stroke: var(--ht-gray-200); stroke-dasharray: 3 4; }
.ht-legend { display: flex; gap: 1rem; font-size: .7rem; color: var(--ht-gray-600); }
.ht-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: .15rem; margin-right: .3rem; vertical-align: -1px; }

/* ── serveurs ──────────────────────────────────────────────────────────────────────────────── */
.ht-servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr)); gap: .9rem; }
.ht-srv { padding: 1rem 1.1rem; }
.ht-srv.is-off { background: linear-gradient(0deg, rgba(var(--ht-warning-rgb), .06), rgba(var(--ht-warning-rgb), .06)), var(--ht-card-bg); }
.ht-srv-h { display: flex; align-items: center; gap: .55rem; }
.ht-srv-h .ic { width: 2.2rem; height: 2.2rem; border-radius: .6rem; display: grid; place-items: center; font-size: 1rem; background: rgba(var(--ht-primary-rgb), .12); color: var(--ht-primary); }
.ht-srv.is-off .ht-srv-h .ic { background: rgba(var(--ht-warning-rgb), .16); color: var(--ht-warning); }
.ht-srv-h b { font-size: .95rem; color: var(--ht-heading-color); }
.ht-srv-h small { display: block; font-size: .7rem; color: var(--ht-gray-500); font-family: var(--ht-font-monospace); }
.ht-gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: .9rem 0 .7rem; }
.ht-gauges .lbl { display: flex; justify-content: space-between; font-size: .66rem; color: var(--ht-gray-600); margin-bottom: .25rem; }
.ht-gauges .lbl b { font-family: var(--ht-font-monospace); color: var(--ht-gray-900); }
.ht-lat { height: 46px; margin: .2rem 0 .6rem; }

/* ── pont MT5 : schéma du flux ─────────────────────────────────────────────────────────────── */
.ht-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: .6rem; }
.ht-node { border: 1px solid var(--ht-border-color); border-radius: .7rem; padding: .7rem .8rem; background: var(--ht-gray-100); min-width: 0; }
.ht-node .t { font-size: .6rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; color: var(--ht-gray-500); }
.ht-node b { display: block; font-size: .9rem; color: var(--ht-heading-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-node small { font-size: .7rem; color: var(--ht-gray-600); }
.ht-node.ok { border-color: rgba(var(--ht-success-rgb), .4); }
.ht-arrow { color: var(--ht-gray-500); font-size: 1.1rem; text-align: center; line-height: 1; }
.ht-arrow small { display: block; font-size: .58rem; font-family: var(--ht-font-monospace); }

/* ── ratios : une grille symboles × comptes ────────────────────────────────────────────────── */
.ht-matrix td.cell { text-align: center; }
.ht-mcell { display: inline-flex; align-items: center; justify-content: center; min-width: 5.2rem; padding: .18rem .5rem; border-radius: .4rem; font-family: var(--ht-font-monospace);
  font-size: .76rem; border: 1px dashed transparent; color: var(--ht-gray-500); background: none; }
.ht-mcell:hover { border-color: var(--ht-gray-400); color: var(--ht-gray-900); }
.ht-mcell.ovr { background: rgba(var(--ht-primary-rgb), .12); color: var(--ht-primary); font-weight: 700; border-style: solid; border-color: rgba(var(--ht-primary-rgb), .3); }
.ht-mcell.cut { background: rgba(var(--ht-danger-rgb), .1); color: var(--ht-danger); font-weight: 700; text-decoration: line-through; }
.ht-mcell.off { opacity: .45; }
.ht-mcell:focus-visible { outline: 2px solid var(--ht-primary); }
.ht-matrix th.acc { text-align: center; }
.ht-matrix th.acc small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; font-family: var(--ht-font-monospace); color: var(--ht-gray-500); }
.ht-formula { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; font-size: .78rem; align-items: baseline; }
.ht-formula code { font-family: var(--ht-font-monospace); font-size: .78rem; color: var(--ht-heading-color); background: var(--ht-gray-100); padding: .1rem .4rem; border-radius: .3rem; }
.ht-formula span { color: var(--ht-gray-600); }

/* ── symboles ──────────────────────────────────────────────────────────────────────────────── */
.ht-star { border: 0; background: none; font-size: .95rem; line-height: 1; color: var(--ht-gray-300); padding: 0 .2rem; }
.ht-star.on { color: var(--ht-warning); }
.ht-star:focus-visible { outline: 2px solid var(--ht-primary); }
.ht-tog { width: 1.9rem; height: 1.05rem; border-radius: 1rem; border: 0; background: var(--ht-gray-300); position: relative; padding: 0; vertical-align: middle; }
.ht-tog::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: .75rem; height: .75rem; border-radius: 50%; background: #fff; transition: transform .15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.ht-tog.on { background: var(--ht-primary); }
.ht-tog.on::after { transform: translateX(.85rem); }
.ht-tog:focus-visible { outline: 2px solid var(--ht-primary); outline-offset: 2px; }
.ht-table tr.is-off > td:not(.keep) { opacity: .5; }
.ht-table tr.is-warn > td { background: rgba(var(--ht-warning-rgb), .07); }

@media (max-width: 1299.98px) { .ht-split { grid-template-columns: minmax(0, 1fr); } .ht-acclist { position: static; } }

/* ── journal en chasse fixe (pont MT5, serveurs) ───────────────────────────────────────────── */
.ht-term-log { margin: 0; max-height: 15rem; overflow: auto; padding: .7rem .9rem; border-radius: .55rem; background: #0f1724; color: #c9d4e3;
  font-family: var(--ht-font-monospace); font-size: .72rem; line-height: 1.6; white-space: pre; }
.ht-term-log .t { color: #6f7f97; }
.ht-term-log .l { font-weight: 700; }
.ht-term-log .l.info { color: #6cb6ff; } .ht-term-log .l.ok { color: #5fe0a5; } .ht-term-log .l.warn { color: #f5b25c; } .ht-term-log .l.err { color: #ff8095; }
.ht-cell-ed { padding: .7rem .85rem; border-radius: .6rem; border: 1px solid rgba(var(--ht-primary-rgb), .3); background: rgba(var(--ht-primary-rgb), .05); }
.ht-mcell.sel { outline: 2px solid var(--ht-primary); outline-offset: 1px; }

/* ── le test de connexion d'un compte (v0.15) ──────────────────────────────────────────────── */
.ht-test { border-radius: .55rem; padding: .55rem .75rem; font-size: .78rem; border: 1px solid var(--ht-border-color); background: var(--ht-gray-100); }
.ht-test.ok { border-color: rgba(var(--ht-success-rgb), .4); background: rgba(var(--ht-success-rgb), .07); }
.ht-test.bad { border-color: rgba(var(--ht-danger-rgb), .35); background: rgba(var(--ht-danger-rgb), .06); color: var(--ht-gray-900); }
.ht-test .st { display: grid; grid-template-columns: 1.2rem 13rem minmax(0, 1fr); gap: .4rem; align-items: baseline; padding: .12rem 0; }
.ht-test .st .ic { font-weight: 800; }
.ht-test .st.ok .ic { color: var(--ht-success); }
.ht-test .st.bad .ic { color: var(--ht-danger); }
.ht-test .st b { color: var(--ht-heading-color); font-weight: 600; }
.ht-test .st .d { color: var(--ht-gray-700); word-break: break-word; }
.ht-test .sum { margin-top: .35rem; padding-top: .35rem; border-top: 1px solid var(--ht-border-color); color: var(--ht-gray-700); }
.ht-accrow.is-disabled { opacity: .55; }
/* v1.71 : la liste des comptes, plus légère — groupes par broker, lignes compactes, filtre, un bouton Ajouter */
.ht-acclist { gap: .3rem; }
.ht-accfilter { display: flex; gap: .4rem; align-items: center; margin-bottom: .2rem; }
.ht-accfilter .ht-find { flex: 1; min-width: 0; }
.ht-accgrp { display: flex; align-items: baseline; gap: .5rem; margin: .45rem .2rem .05rem; font-size: .64rem; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ht-primary); border-bottom: 1px solid rgba(var(--ht-primary-rgb), .2); padding-bottom: .15rem; }
.ht-accgrp small { margin-left: auto; color: var(--ht-gray-500); font-weight: 700; letter-spacing: 0; text-transform: none; font-size: .68rem; }
.ht-accrow.c { padding: .38rem .6rem; gap: .5rem; }
.ht-accrow.c .mid { display: flex; align-items: center; gap: .1rem; white-space: nowrap; overflow: hidden; }
.ht-accrow.c .mid b { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.ht-accrow.c .r { display: flex; align-items: baseline; gap: .45rem; font-size: .76rem; }
.ht-accrow.c .r small { display: inline; font-size: .62rem; }
.ht-addmenu .dropdown-item { display: flex; flex-direction: column; align-items: flex-start; white-space: normal; padding: .35rem .8rem; }
.ht-addmenu .dropdown-item small { color: var(--ht-gray-500); font-size: .66rem; }
.ht-acclist > .dropdown > .btn { width: 100%; }
.ht-sortable thead th[data-sort] { cursor: pointer; user-select: none; }
.ht-sortable thead th.sorted { color: var(--ht-primary); }

/* ── une liste de ce qui viendra (pont MT5) ────────────────────────────────────────────────── */
.ht-todo { margin: 0 0 .8rem; padding-left: 1.1rem; font-size: .82rem; color: var(--ht-gray-800); }
.ht-todo li { margin-bottom: .4rem; }

/* ── machines (agents) : pastilles d'état des conteneurs, logs ─────────────────────────────── */
.ht-card-h .ic { width: 2rem; height: 2rem; border-radius: .55rem; display: grid; place-items: center; background: rgba(var(--ht-primary-rgb), .12); color: var(--ht-primary); }
.card.is-off .ht-card-h .ic { background: rgba(var(--ht-warning-rgb), .16); color: var(--ht-warning); }
.ht-svcw { display: inline-flex; align-items: center; gap: .3rem; margin-right: .7rem; font-size: .7rem; color: var(--ht-gray-700); }
.ht-svc { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; background: var(--ht-gray-400); }
.ht-svc.ok { background: var(--ht-success); }
.ht-svc.warn { background: var(--ht-warning); }
.ht-svc.bad { background: var(--ht-danger); }
.ht-logs { max-height: 60vh; overflow: auto; margin: 0; padding: .6rem .75rem; border-radius: .45rem; font-size: .68rem; line-height: 1.45;
  background: var(--ht-gray-100); color: var(--ht-body-color); border: 1px solid var(--ht-border-color); white-space: pre-wrap; word-break: break-all; }
.ht-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .78rem; color: var(--ht-gray-700); }
.ht-steps li { display: flex; align-items: center; gap: .5rem; }
.ht-steps .dot { width: 1.2rem; height: 1.2rem; border-radius: 50%; display: grid; place-items: center; font-size: .65rem; font-weight: 800;
  border: 1px solid var(--ht-border-color); color: var(--ht-gray-500); background: var(--ht-card-bg); }
.ht-steps li.run { color: var(--ht-primary); font-weight: 600; } .ht-steps li.run .dot { border-color: var(--ht-primary); color: var(--ht-primary); }
.ht-steps li.ok { color: var(--ht-body-color); } .ht-steps li.ok .dot { border-color: var(--ht-success); color: var(--ht-success); background: rgba(var(--ht-success-rgb), .12); }
.ht-steps li.err { color: var(--ht-danger); } .ht-steps li.err .dot { border-color: var(--ht-danger); color: var(--ht-danger); background: rgba(var(--ht-danger-rgb), .12); }

/* la section « Envoi d'ordres » d'une fiche de compte : bien visible (c'est la limite de sécurité) */
.ht-fsec-cap { border: 1px solid rgba(var(--ht-warning-rgb), .45); background: rgba(var(--ht-warning-rgb), .06); border-radius: .6rem; padding: .7rem .8rem; }
.ht-fsec-cap .ht-fsec-h .n { background: rgba(var(--ht-warning-rgb), .18); color: var(--ht-warning); }

/* « Ajouter un agent » : le guide d'une machine neuve (v0.54) */
.ht-newvm { border: 1px solid var(--ht-border-color); border-radius: .5rem; padding: .45rem .65rem; background: var(--ht-gray-100); }
.ht-newvm summary { cursor: pointer; font-size: .78rem; font-weight: 700; color: var(--ht-primary); }
.ht-newvm li { margin-bottom: .35rem; color: var(--ht-gray-700); }
.ht-cmd { margin: .25rem 0; padding: .3rem .5rem; border-radius: .35rem; background: var(--ht-card-bg); border: 1px solid var(--ht-border-color);
  font-size: .7rem; color: var(--ht-gray-900); white-space: pre-wrap; word-break: break-all; user-select: all; }

/* page Aide (v0.69) */
.ht-help { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.ht-htoc { position: sticky; top: calc(var(--ht-top-h, 4rem) + .8rem); padding: .6rem; display: flex; flex-direction: column; gap: 2px; }
.ht-htoc a { padding: .35rem .6rem; border-radius: .45rem; font-size: .8rem; font-weight: 600; color: var(--ht-gray-700); text-decoration: none; }
.ht-htoc a:hover { background: rgba(var(--ht-primary-rgb), .1); color: var(--ht-primary); }
.ht-hbody { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.ht-hsec { padding: 1.2rem 1.4rem; scroll-margin-top: calc(var(--ht-top-h, 4rem) + .8rem); }
.ht-hsec h2 { font-size: 1.15rem; margin-bottom: .7rem; }
.ht-hsec h3 { font-size: .9rem; margin: 1.2rem 0 .5rem; color: var(--ht-heading-color); }
.ht-hsec p { font-size: .86rem; line-height: 1.55; color: var(--ht-body-color); max-width: 62rem; }
/* un passage visé par un « ? » des pages (#/aide/copies-modes : son id="aide-…") arrive sous la barre du haut, un peu
   d'air au-dessus, puis il est surligné un instant — un fond doux de la couleur principale qui s'efface (aide.js flash) */
.ht-hsec [id^="aide-"] { scroll-margin-top: calc(var(--ht-top-h, 4rem) + 2rem); }
.ht-hflash { border-radius: .35rem; -webkit-box-decoration-break: clone; box-decoration-break: clone; animation: ht-hflash 1.5s ease-out; }
@keyframes ht-hflash {
  0%, 35% { background-color: rgba(var(--ht-primary-rgb), .16); box-shadow: 0 0 0 .3rem rgba(var(--ht-primary-rgb), .16); }
  100% { background-color: rgba(var(--ht-primary-rgb), 0); box-shadow: 0 0 0 .3rem rgba(var(--ht-primary-rgb), 0); }
}
.ht-hfig { margin: .8rem 0 1rem; }
.ht-hfig img { max-width: 100%; border-radius: .6rem; border: 1px solid var(--ht-border-color); cursor: zoom-in; box-shadow: 0 .4rem 1rem rgba(0, 0, 0, .18); }
.ht-hfig figcaption { font-size: .74rem; color: var(--ht-gray-600); margin-top: .35rem; }
.ht-hkv { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); gap: .45rem 1rem; margin: .6rem 0 1rem; font-size: .84rem; }
.ht-hkv dt { font-weight: 700; color: var(--ht-heading-color); }
.ht-hkv dd { margin: 0; color: var(--ht-body-color); line-height: 1.5; }
.ht-htip, .ht-hwarn { font-size: .82rem; line-height: 1.5; padding: .6rem .8rem; border-radius: .5rem; margin: .6rem 0; }
.ht-htip { background: rgba(var(--ht-info-rgb), .1); border: 1px solid rgba(var(--ht-info-rgb), .3); color: var(--ht-body-color); }
.ht-hwarn { background: rgba(var(--ht-warning-rgb), .1); border: 1px solid rgba(var(--ht-warning-rgb), .35); color: var(--ht-body-color); }
.ht-hzoom { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, .82); display: flex; align-items: center; justify-content: center; padding: 1.5rem; cursor: zoom-out; }
.ht-hzoom img { max-width: 100%; max-height: 100%; border-radius: .5rem; }
/* les calculs de l'aide (v1.95) : une formule par ligne — son nom, le calcul en police fixe, une précision */
.ht-hfx { width: 100%; max-width: 64rem; border-collapse: collapse; margin: .4rem 0 1rem; font-size: .84rem; }
.ht-hfx th { width: 13rem; text-align: left; vertical-align: top; padding: .45rem .7rem .45rem 0; color: var(--ht-heading-color); font-weight: 700; border-bottom: 1px solid var(--ht-border-color); }
.ht-hfx td { padding: .45rem 0; border-bottom: 1px solid var(--ht-border-color); color: var(--ht-body-color); }
.ht-hfx code { font-family: var(--ht-font-monospace); font-size: .8rem; color: var(--ht-primary); background: rgba(var(--ht-primary-rgb), .08); border-radius: .3rem; padding: .1rem .4rem; white-space: normal; }
.ht-hfx small { display: block; color: var(--ht-gray-600); font-size: .76rem; margin-top: .2rem; line-height: 1.45; }
@media (max-width: 767.98px) { .ht-help { grid-template-columns: 1fr; } .ht-htoc { position: static; flex-direction: row; flex-wrap: wrap; } .ht-hkv { grid-template-columns: 1fr; } .ht-hfx th { width: 8rem; } }
@media (max-width: 991.98px) { .ht-help { grid-template-columns: 1fr; } .ht-htoc { position: static; flex-direction: row; flex-wrap: wrap; } .ht-hkv { grid-template-columns: 1fr; } }

/* les détails techniques repliés (v0.75) */
.ht-tech summary { cursor: pointer; font-size: .78rem; font-weight: 700; color: var(--ht-gray-600); }
.ht-tech summary:hover { color: var(--ht-primary); }

/* v3.17 : la page Comptes refaite — ses onglets (Comptes, Sécurité, Publication, Sauvegardes) et l'en-tête du compte ouvert */
.ht-ptabs { border-bottom: 1px solid var(--ht-border-color); }
.ht-ptab > .card + .card { margin-top: 1rem; }
.ht-acchead { margin-bottom: 1rem; padding-bottom: 0; }
.ht-acchead .top { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .6rem; margin-bottom: .6rem; }
.ht-acchead h2 { margin: 0; font-size: 1.05rem; }
.ht-acchead .nums { margin-left: auto; display: flex; gap: 1.4rem; flex-wrap: wrap; }
.ht-acchead .kv { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.ht-acchead .kv small { font-size: .62rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ht-gray-600); }
.ht-acchead .kv b { font-size: .9rem; }
.ht-acchead .ht-tabs { border-top: 1px solid var(--ht-border-color); margin: 0 -1.1rem; padding: 0 1.1rem; }
/* la fiche d'un compte enregistré : son nom est dans l'en-tête juste au-dessus */
.ht-acchead + .ht-accform > .ht-card-h { display: none; }
