/* ═══════════════════════════════════════════════════════════════════
   BLOCKX — BOT PREMIUM
   Refonte complète de l'outil « Bot de Trading », sous DA.md.
   Chargée APRÈS blockx.css et scanner-premium.css : ce fichier gagne.

   Le parti pris, propre à cet outil (DA §3 : une palette par outil) :

     LE POSTE DE PILOTAGE EST IMPRIMÉ À L'ENVERS DE LA PAGE.
     Le bloc qui porte l'argent — solde, PnL, cap du jour — est une
     surface claire, encre noire, dans une page sombre. En thème clair
     il s'inverse à son tour. C'est la seule grande surface colorée de
     l'écran ; tout le reste est neutre, et l'accent cuivre ne sert
     qu'aux éléments qu'on manipule.

   Aucun nouveau namespace de tokens : tout vit dans --sx-*, déjà scopé
   sur #bot-section. Aucune couleur en dur hors de ce fichier.

   Gestes : le bot s'arme en MAINTENANT le bouton (nb-armbtn). Ce geste
   n'existe nulle part ailleurs dans le produit — le glisser est pris
   par l'Academy, le curseur magnétique par le scanner.
   ═══════════════════════════════════════════════════════════════════ */

/* ═══ 0. PALETTE — sombre (défaut) ══════════════════════════════════ */

#bot-section{
  /* Surfaces — le monde VERT CANDLE (25/08) : le Bot exécute les
     stratégies du Rug Sniping, les deux outils parlent la même langue.
     Le cuivre ne dialoguait avec rien. */
  --sx-bg:#0a0e18;
  --sx-bg2:#0e1322;
  --sx-card:#151a28;
  --sx-card2:#1d2334;
  --sx-border:rgba(148,163,205,.13);
  --sx-border2:rgba(148,163,205,.24);
  /* Encre */
  --sx-text:#edf1fa;
  --sx-text2:#c6cde0;
  --sx-muted:#9aa3bd;
  --sx-faint:#7d86a3;
  /* Accent — le vert candle. Il ne colore QUE ce qui se manipule. */
  --sx-acc:#0e9e64;
  --sx-acc2:#17c975;
  --sx-acc-soft:rgba(23,201,117,.12);
  --sx-acc-line:rgba(23,201,117,.36);
  /* Données */
  --sx-good:#17c975;
  --sx-warn:#f0b429;
  --sx-bad:#ff4060;
  /* Le poste de pilotage : le BOARD NAVY de la maison (rg2/#rsx) —
     constant sur les deux thèmes, jamais une inversion papier/encre. */
  --sx-paper:#0c1122;
  --sx-paper2:#111731;
  --sx-ink:#edf3ff;
  --sx-ink2:#9fb0d0;
  --sx-ink3:#7285a8;
  --sx-paper-line:rgba(255,255,255,.09);
  --sx-paper-good:#3fe39a;
  --sx-paper-bad:#ff7288;
  /* Ombres — noires, jamais colorées */
  --sx-shadow:0 1px 2px rgba(0,0,0,.4);
  --sx-shadow-lg:0 24px 60px -28px rgba(0,0,0,.85);
  /* Une seule courbe pour tout l'écran */
  --sx-ease:cubic-bezier(.22,1,.36,1);

  background:var(--sx-bg);
  padding:calc(68px + 1.6rem) 2rem 4.5rem;
  font-variant-numeric:tabular-nums;
}

/* Thème clair : la page passe sur blanc, le poste de pilotage bascule
   en encre. Le cuivre s'assombrit pour tenir 4.5:1 sur blanc. */
body.bx-light #bot-section{
  --sx-bg:#f6f8fb;
  --sx-bg2:#ffffff;
  --sx-card:#ffffff;
  --sx-card2:#f2f5fa;
  --sx-border:rgba(10,21,38,.12);
  --sx-border2:rgba(10,21,38,.22);
  --sx-text:#0c1526;
  --sx-text2:#3a4258;
  --sx-muted:#5b6478;
  --sx-faint:#8a93a8;
  --sx-acc:#0e9e64;
  --sx-acc2:#0a7f50;
  --sx-acc-soft:rgba(14,158,100,.09);
  --sx-acc-line:rgba(14,158,100,.34);
  --sx-good:#0e9e64;
  --sx-warn:#b45309;
  --sx-bad:#c22844;
  /* Le poste RESTE navy sur page claire : l'objet porte la couleur,
     le fond la met en scène (grammaire landing). */
  --sx-paper:#0c1122;
  --sx-paper2:#111731;
  --sx-ink:#edf3ff;
  --sx-ink2:#9fb0d0;
  --sx-ink3:#7285a8;
  --sx-paper-line:rgba(255,255,255,.09);
  --sx-paper-good:#3fe39a;
  --sx-paper-bad:#ff7288;
  --sx-shadow:0 1px 2px rgba(19,19,24,.06);
  --sx-shadow-lg:0 24px 60px -28px rgba(19,19,24,.22);
  background:var(--sx-bg)!important;
  color:var(--sx-text);
}
/* L'ancienne feuille imposait une pastille noire en clair — neutralisé :
   la vue active se lit à la surface et à la graisse, pas à la couleur. */
body.bx-light #bot-section .nb-seg button.on{background:var(--sx-card);color:var(--sx-text);box-shadow:0 1px 2px rgba(19,19,24,.08)}
body.bx-light #bot-section .nb-bsub{color:var(--sx-muted)}

@media(max-width:720px){
  #bot-section{padding:calc(60px + 1.1rem) 1rem 3.5rem;}
}

#bot-section .bt2-wrap,
#bot-section .nb{max-width:1180px;margin:0 auto;}

#bot-section *{font-variant-numeric:inherit;}
#bot-section .nb-mono,
#bot-section .nb-waddr{font-family:var(--font-mono);letter-spacing:-.01em;}
#bot-section .pos{color:var(--sx-good)}
#bot-section .neg{color:var(--sx-bad)}
#bot-section .nb-hide{display:none!important}
/* Utilitaires de composition — évitent le style inline dans le JS. */
#bot-section .nb-right{margin-left:auto}
#bot-section .nb-mb1{margin-bottom:1rem}
#bot-section .nb-mt1{margin-top:1.1rem}
#bot-section .nb-faint{color:var(--sx-faint)}
#bot-section .nb-btnrow{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:.75rem}
#bot-section .nb-fields{display:grid;gap:.75rem;margin-bottom:.85rem}

/* Logo SOL inline — sans halo. */
#bot-section .nb-sol{width:.82em;height:.82em;vertical-align:-.1em;display:inline-block;
  margin:0 .05em 0 .16em;object-fit:contain;filter:none;opacity:.9}

/* ═══ 1. RAIL DE COMMANDE ═══════════════════════════════════════════
   Une seule ligne de chrome : le wallet, les vues, l'armement. Pas de
   titre, pas de sous-titre : l'outil commence tout de suite. */

#bot-section .nb-rail{
  display:flex;align-items:center;gap:1rem;flex-wrap:wrap;
  padding:.5rem .6rem .5rem .55rem;
  margin-bottom:1.1rem;
  background:var(--sx-card);
  border:1px solid var(--sx-border);
  border-radius:16px;
}

/* ── Sélecteur de wallet ── */
#bot-section .nb-wslot{position:relative}
#bot-section .nb-wsel{
  display:flex;align-items:center;gap:.7rem;cursor:pointer;
  padding:.4rem .6rem .4rem .4rem;border-radius:12px;
  border:1px solid transparent;
  transition:background .18s var(--sx-ease),border-color .18s var(--sx-ease);
}
#bot-section .nb-wsel:hover{background:var(--sx-card2);border-color:var(--sx-border)}
#bot-section .nb-wava{
  width:36px;height:36px;border-radius:11px;flex-shrink:0;
  display:grid;place-items:center;
  background:var(--sx-card2);border:1px solid var(--sx-border2);
  font-weight:700;font-size:.78rem;color:var(--sx-text2);letter-spacing:.02em;
}
#bot-section .nb-wtxt{display:flex;flex-direction:column;gap:.1rem;min-width:0}
#bot-section .nb-wname{
  display:flex;align-items:center;gap:.4rem;
  font-size:.875rem;font-weight:650;color:var(--sx-text);line-height:1.2;
}
#bot-section .nb-waddr{font-size:.75rem;color:var(--sx-faint);line-height:1.2}
#bot-section .nb-chev{display:inline-flex;color:var(--sx-faint);transition:transform .22s var(--sx-ease)}
#bot-section .nb-wsel.open .nb-chev{transform:rotate(180deg)}

#bot-section .nb-dd{
  position:absolute;top:calc(100% + .5rem);left:0;z-index:60;
  width:330px;max-width:80vw;padding:.35rem;
  background:var(--sx-card2);border:1px solid var(--sx-border2);
  border-radius:14px;box-shadow:var(--sx-shadow-lg);
  display:none;
}
#bot-section .nb-dd.show{display:block;animation:nbDrop .18s var(--sx-ease)}
@keyframes nbDrop{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
#bot-section .nb-ddi{
  display:flex;align-items:center;gap:.65rem;padding:.55rem;border-radius:10px;cursor:pointer;
  border:1px solid transparent;transition:background .15s var(--sx-ease);
}
#bot-section .nb-ddi:hover{background:var(--sx-card)}
#bot-section .nb-ddi.active{background:var(--sx-acc-soft);border-color:var(--sx-acc-line)}
#bot-section .nb-ddi .nb-wava{width:30px;height:30px;border-radius:9px;font-size:.75rem}
#bot-section .nb-ddbal{margin-left:auto;font-family:var(--font-mono);font-size:.8rem;color:var(--sx-text2)}
#bot-section .nb-ddnew{
  display:flex;align-items:center;justify-content:center;gap:.5rem;
  margin-top:.3rem;padding:.7rem;border-top:1px solid var(--sx-border);
  color:var(--sx-acc);font-weight:650;font-size:.82rem;cursor:pointer;border-radius:10px;
}
#bot-section .nb-ddnew:hover{background:var(--sx-acc-soft)}

/* ── Vues ── */
#bot-section .nb-seg{
  display:inline-flex;gap:2px;padding:3px;margin-left:auto;
  background:var(--sx-bg2);border:1px solid var(--sx-border);border-radius:12px;
}
#bot-section .nb-seg button{
  display:inline-flex;align-items:center;gap:.45rem;
  font-family:var(--font);font-size:.82rem;font-weight:600;
  color:var(--sx-muted);background:none;border:0;
  padding:.5rem .95rem;border-radius:9px;cursor:pointer;
  transition:color .15s var(--sx-ease),background .15s var(--sx-ease);
}
#bot-section .nb-seg button svg{width:14px;height:14px;stroke-width:1.9}
#bot-section .nb-seg button:hover{color:var(--sx-text)}
#bot-section .nb-seg button.on{background:var(--sx-card2);color:var(--sx-text);box-shadow:none}

/* ── Armement : le geste de l'écran ──
   On maintient le disque enfoncé ~700 ms ; l'anneau se remplit, le
   noyau se contracte, puis l'état bascule. Un clic seul ne fait rien :
   c'est de l'argent réel. */
#bot-section .nb-arm{display:flex;align-items:center;gap:.7rem}
#bot-section .nb-arm-txt{display:flex;flex-direction:column;gap:.1rem;text-align:right}
#bot-section .nb-arm-txt b{font-size:.82rem;font-weight:650;color:var(--sx-muted);line-height:1.2}
#bot-section .nb-arm-txt i{font-style:normal;font-size:.75rem;color:var(--sx-faint);line-height:1.2}
#bot-section .nb-arm.on .nb-arm-txt b{color:var(--sx-good)}

#bot-section .nb-armbtn{
  position:relative;width:46px;height:46px;flex-shrink:0;
  background:var(--sx-bg2);border:1px solid var(--sx-border2);border-radius:50%;
  cursor:pointer;display:grid;place-items:center;padding:0;
  touch-action:none;-webkit-tap-highlight-color:transparent;
  transition:border-color .2s var(--sx-ease),background .2s var(--sx-ease);
}
#bot-section .nb-armbtn:hover{border-color:var(--sx-acc-line)}
#bot-section .nb-armbtn:focus-visible{outline:2px solid var(--sx-acc);outline-offset:3px}
#bot-section .nb-armring{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg)}
#bot-section .nb-armring circle{fill:none;stroke-width:2.5;stroke-linecap:round}
#bot-section .nb-armtrack{stroke:var(--sx-border2)}
#bot-section .nb-armfill{
  stroke:var(--sx-acc);
  stroke-dasharray:126;
  stroke-dashoffset:calc(126 - 126 * var(--p,0));
  transition:stroke-dashoffset .12s linear;
}
#bot-section .nb-armbtn.reset .nb-armfill{transition:stroke-dashoffset .3s var(--sx-ease)}
#bot-section .nb-armcore{
  width:15px;height:15px;border-radius:5px;background:var(--sx-faint);
  transition:width .25s var(--sx-ease),height .25s var(--sx-ease),
             border-radius .25s var(--sx-ease),background .25s var(--sx-ease);
}
#bot-section .nb-armbtn.holding .nb-armcore{width:11px;height:11px;border-radius:50%;background:var(--sx-acc)}
#bot-section .nb-arm.on .nb-armcore{width:13px;height:13px;border-radius:50%;background:var(--sx-good)}
#bot-section .nb-arm.on .nb-armtrack{stroke:color-mix(in srgb,var(--sx-good) 45%,transparent)}
#bot-section .nb-armbtn.done{animation:nbArmed .45s var(--sx-ease)}
@keyframes nbArmed{
  0%{transform:scale(1)}
  40%{transform:scale(.9)}
  100%{transform:scale(1)}
}
#bot-section .nb-armbtn:disabled{opacity:.45;cursor:progress}

/* ═══ 2. POSTE DE PILOTAGE — la surface papier ══════════════════════ */

#bot-section .nb-hero{
  background:var(--sx-paper);color:var(--sx-ink);
  border-radius:20px;padding:1.6rem 1.75rem 1.4rem;
  margin-bottom:1rem;
  display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);
  gap:1.75rem;align-items:start;
}
/* Les colonnes de grille ne débordent pas : min-width:0 partout. */
#bot-section .nb-hero>*{min-width:0}
@media(max-width:820px){#bot-section .nb-hero{grid-template-columns:1fr;gap:1.25rem}}
@media(max-width:720px){
  #bot-section .nb-hero{padding:1.25rem 1.1rem 1.1rem}
  #bot-section .nb-seg{width:100%;justify-content:space-between}
  #bot-section .nb-arm{width:100%;justify-content:flex-end}
}

#bot-section .nb-hlbl{
  font-size:.75rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;
  color:var(--sx-ink3);margin-bottom:.5rem;
}
#bot-section .nb-balmain{
  display:flex;align-items:baseline;gap:.2rem;
  font-family:var(--font-head);font-weight:700;
  font-size:clamp(2.4rem,6vw,3.4rem);line-height:.95;letter-spacing:-.035em;
  color:var(--sx-ink);
}
#bot-section .nb-balmain .nb-sol{opacity:1}
#bot-section .nb-balunit{font-size:.32em;font-weight:600;letter-spacing:0;color:var(--sx-ink3);margin-left:.35rem}

/* Les trois chiffres du bloc — posés en ligne, séparés par un filet,
   pas empilés dans un cadre. */
#bot-section .nb-hstats{
  display:flex;flex-wrap:wrap;gap:1.5rem;margin-top:1.35rem;
  padding-top:1.1rem;border-top:1px solid var(--sx-paper-line);
}
#bot-section .nb-hstat{display:flex;flex-direction:column;gap:.25rem;min-width:88px}
#bot-section .nb-hstat span{font-size:.75rem;color:var(--sx-ink3);font-weight:600}
#bot-section .nb-hstat b{font-family:var(--font-head);font-size:1.2rem;font-weight:700;color:var(--sx-ink);letter-spacing:-.02em}
#bot-section .nb-hstat b.pos{color:var(--sx-paper-good)}
#bot-section .nb-hstat b.neg{color:var(--sx-paper-bad)}
/* L'animation au gain : le chiffre se soulève quand il monte. */
#bot-section .nb-gain{animation:nbGain .7s var(--sx-ease)}
@keyframes nbGain{
  0%{transform:translateY(.25em);opacity:.35}
  55%{transform:translateY(-.06em);opacity:1}
  100%{transform:none}
}

/* ── Colonne droite : jauges ── */
#bot-section .nb-hside{display:flex;flex-direction:column;gap:1.1rem}
#bot-section .nb-gauge-h{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;margin-bottom:.5rem}
#bot-section .nb-gauge-h span{font-size:.75rem;font-weight:600;color:var(--sx-ink3)}
#bot-section .nb-gauge-h b{font-family:var(--font-head);font-size:.9rem;font-weight:700;color:var(--sx-ink)}
#bot-section .nb-gauge{height:8px;border-radius:99px;background:color-mix(in srgb,var(--sx-ink) 10%,transparent);overflow:hidden}
/* La géométrie vient de la donnée (--f, en %), le style reste ici. */
#bot-section .nb-gauge i{
  display:block;height:100%;border-radius:99px;background:var(--sx-ink);
  width:calc(var(--f,0) * 1%);transition:width .6s var(--sx-ease);
}
#bot-section .nb-gauge.risk i{background:var(--sx-paper-bad)}

/* Paliers de positions : des plots, pas une phrase. */
#bot-section .nb-pips{display:flex;gap:.35rem;margin-top:.5rem}
#bot-section .nb-pip{
  flex:1;height:8px;border-radius:3px;
  background:color-mix(in srgb,var(--sx-ink) 10%,transparent);
  transition:background .35s var(--sx-ease),transform .35s var(--sx-ease);
}
#bot-section .nb-pip.on{background:var(--sx-ink);transform:scaleY(1.25)}

/* ── Adresse de dépôt ── */
#bot-section .nb-dep{
  grid-column:1/-1;display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;
  margin-top:.35rem;padding-top:1.1rem;border-top:1px solid var(--sx-paper-line);
}
#bot-section .nb-dep-lbl{font-size:.75rem;font-weight:600;color:var(--sx-ink3);letter-spacing:.05em;text-transform:uppercase}
#bot-section .nb-dep-addr{
  flex:1 1 12rem;min-width:0;font-family:var(--font-mono);font-size:.82rem;color:var(--sx-ink);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
#bot-section .nb-dep-btn{
  display:inline-flex;align-items:center;gap:.4rem;
  font-family:var(--font);font-size:.8rem;font-weight:650;color:var(--sx-ink);
  background:none;border:1px solid var(--sx-paper-line);border-radius:9px;
  padding:.42rem .8rem;cursor:pointer;
  transition:background .15s var(--sx-ease),border-color .15s var(--sx-ease);
}
#bot-section .nb-dep-btn:hover{background:color-mix(in srgb,var(--sx-ink) 7%,transparent)}
#bot-section .nb-dep-btn.done{border-color:var(--sx-paper-good);color:var(--sx-paper-good)}
#bot-section .nb-dep-warn{width:100%;font-size:.78rem;color:var(--sx-paper-bad);font-weight:600}

/* ═══ 3. CARTES ET SECTIONS ═════════════════════════════════════════ */

#bot-section .nb-grid{display:grid;gap:1rem}
#bot-section .nb-g2{grid-template-columns:1.1fr .9fr}
#bot-section .nb-g4{grid-template-columns:repeat(4,1fr)}
@media(max-width:900px){#bot-section .nb-g2{grid-template-columns:1fr}}
@media(max-width:820px){#bot-section .nb-g4{grid-template-columns:repeat(2,1fr)}}
@media(max-width:520px){#bot-section .nb-g4{grid-template-columns:1fr}}

#bot-section .nb-card{
  background:var(--sx-card);border:1px solid var(--sx-border);
  border-radius:16px;padding:1.15rem 1.25rem;box-shadow:none;
}
#bot-section .nb-ch{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:1rem}
#bot-section .nb-ct{
  font-size:.75rem;font-weight:650;letter-spacing:.07em;text-transform:uppercase;color:var(--sx-muted);
}
#bot-section .nb-balsub,
#bot-section .nb-balrows,
#bot-section .nb-brow{font-size:.85rem}
#bot-section .nb-brow{display:flex;justify-content:space-between;align-items:center;gap:.75rem}
#bot-section .nb-brow .k{color:var(--sx-muted)}
#bot-section .nb-brow .v{font-family:var(--font-head);font-weight:650;color:var(--sx-text)}

/* Bandeau de stratégie active — une ligne, pas une carte de plus. */
#bot-section .nb-stratbar{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;
  margin-bottom:1rem;
}
#bot-section .nb-stratbar>div{min-width:0}
#bot-section .nb-strat{display:flex;flex-direction:column;height:100%}
#bot-section .nb-sbadge{
  display:inline-flex;align-self:flex-start;align-items:center;gap:.4rem;
  font-size:.75rem;font-weight:650;color:var(--sx-acc);
  background:var(--sx-acc-soft);border:1px solid var(--sx-acc-line);
  padding:.28rem .65rem;border-radius:8px;
}
#bot-section .nb-sname{
  font-family:var(--font-head);font-weight:700;font-size:1.3rem;letter-spacing:-.02em;
  color:var(--sx-text);margin:.7rem 0 0;
}
#bot-section .nb-sdesc{font-size:.82rem;color:var(--sx-muted);line-height:1.5}
#bot-section .nb-tags{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.85rem}
#bot-section .nb-tag{
  font-size:.75rem;font-weight:600;padding:.3rem .6rem;border-radius:8px;
  background:var(--sx-card2);border:1px solid var(--sx-border);color:var(--sx-text2);
}
#bot-section .nb-tag.a{color:var(--sx-acc);border-color:var(--sx-acc-line);background:var(--sx-acc-soft)}
#bot-section .nb-tag.g{color:var(--sx-good);border-color:color-mix(in srgb,var(--sx-good) 32%,transparent);background:color-mix(in srgb,var(--sx-good) 9%,transparent)}
#bot-section .nb-mt{margin-top:auto;padding-top:1rem}
#bot-section .nb-chip{
  display:inline-flex;align-items:center;font-size:.75rem;font-family:var(--font-mono);
  background:var(--sx-card2);border:1px solid var(--sx-border);border-radius:6px;
  padding:.05rem .35rem;color:var(--sx-muted);
}

/* ═══ 4. BOUTONS ════════════════════════════════════════════════════ */

#bot-section .nb-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  font-family:var(--font);font-size:.85rem;font-weight:650;
  border:1px solid var(--sx-border2);border-radius:11px;
  padding:.65rem 1.05rem;cursor:pointer;width:100%;
  background:var(--sx-card2);color:var(--sx-text);
  transition:background .16s var(--sx-ease),border-color .16s var(--sx-ease),
             color .16s var(--sx-ease),transform .1s var(--sx-ease);
}
#bot-section .nb-btn:active{transform:translateY(1px)}
#bot-section .nb-btn svg{width:15px;height:15px;stroke-width:1.9}
#bot-section .nb-btn.pri{background:var(--sx-acc);border-color:var(--sx-acc);color:#160d05;box-shadow:none}
#bot-section .nb-btn.pri:hover{background:var(--sx-acc2);border-color:var(--sx-acc2);transform:none}
#bot-section .nb-btn.ghost{background:var(--sx-card2);border-color:var(--sx-border2);color:var(--sx-text)}
#bot-section .nb-btn.ghost:hover{border-color:var(--sx-acc-line);color:var(--sx-acc)}
#bot-section .nb-btn.danger{background:none;border-color:color-mix(in srgb,var(--sx-bad) 38%,transparent);color:var(--sx-bad)}
#bot-section .nb-btn.danger:hover{background:color-mix(in srgb,var(--sx-bad) 10%,transparent)}
#bot-section .nb-btn.sm{width:auto;padding:.45rem .8rem;font-size:.8rem}
#bot-section .nb-btn:disabled{opacity:.5;cursor:not-allowed}
body.bx-light #bot-section .nb-btn.pri{color:var(--sx-paper)}

/* ═══ 5. TUILES DE STATS (portfolio) ════════════════════════════════ */

#bot-section .nb-stat{
  background:var(--sx-card);border:1px solid var(--sx-border);border-radius:14px;
  padding:1rem 1.1rem;position:relative;overflow:hidden;
}
#bot-section .nb-stat::before{content:'';position:absolute;inset:0 auto 0 0;width:2px;background:var(--sx-border2)}
#bot-section .nb-stat.g::before{background:var(--sx-good)}
#bot-section .nb-stat.gold::before{background:var(--sx-acc)}
#bot-section .nb-stat.b::before{background:var(--sx-text2)}
#bot-section .nb-stat .k{font-size:.75rem;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--sx-muted)}
#bot-section .nb-stat .v{font-family:var(--font-head);font-weight:700;font-size:1.5rem;letter-spacing:-.02em;margin-top:.35rem;color:var(--sx-text)}
#bot-section .nb-stat .d{font-size:.75rem;color:var(--sx-faint);margin-top:.2rem}

/* ═══ 6. POSITIONS ══════════════════════════════════════════════════ */

#bot-section .nb-tabs{
  display:flex;align-items:center;gap:1.25rem;flex-wrap:wrap;
  border-bottom:1px solid var(--sx-border);margin-bottom:.35rem;
}
#bot-section .nb-tabs button{
  background:none;border:0;border-bottom:2px solid transparent;margin-bottom:-1px;
  font-family:var(--font);font-weight:600;font-size:.85rem;color:var(--sx-muted);
  padding:.65rem .1rem;cursor:pointer;transition:color .15s var(--sx-ease);
}
#bot-section .nb-tabs button:hover{color:var(--sx-text)}
#bot-section .nb-tabs button.on{color:var(--sx-text);border-color:var(--sx-acc)}
#bot-section .nb-tabs button.nb-static{color:var(--sx-text);border-color:var(--sx-acc);cursor:default}
#bot-section .nb-tabs .nb-btn{border-bottom-width:1px;margin-bottom:0}

#bot-section .nb-pos2{
  border:1px solid var(--sx-border);border-radius:14px;background:var(--sx-card2);
  margin-bottom:.5rem;overflow:hidden;
  transition:border-color .2s var(--sx-ease);
}
#bot-section .nb-pos2:hover{border-color:var(--sx-border2)}
#bot-section .nb-pos2.open{border-color:var(--sx-acc-line)}
#bot-section .nb-pos2-hd{
  display:grid;grid-template-columns:1.7fr 1fr .85fr 22px;align-items:center;gap:.75rem;
  padding:.8rem .9rem;cursor:pointer;transition:background .15s var(--sx-ease);
}
#bot-section .nb-pos2-hd:hover{background:var(--sx-card)}
@media(max-width:640px){
  #bot-section .nb-pos2-hd{grid-template-columns:1.4fr .9fr 20px}
  #bot-section .nb-pos2-hd .nb-mcaps{display:none}
}
#bot-section .nb-caret{justify-self:end;color:var(--sx-faint);display:inline-flex;transition:transform .28s var(--sx-ease)}
#bot-section .nb-pos2.open .nb-caret{transform:rotate(180deg)}
#bot-section .nb-pos2-panel{max-height:0;overflow:hidden;transition:max-height .34s var(--sx-ease)}
#bot-section .nb-pos2.open .nb-pos2-panel{max-height:560px}
#bot-section .nb-pos2-inner{padding:1rem .9rem;border-top:1px solid var(--sx-border);position:relative}

#bot-section .nb-ptok{display:flex;align-items:center;gap:.65rem;min-width:0}
#bot-section .nb-pava{
  width:32px;height:32px;border-radius:10px;flex-shrink:0;display:grid;place-items:center;
  background:var(--sx-bg2);border:1px solid var(--sx-border);
  font-weight:700;font-size:.75rem;color:var(--sx-muted);
}
#bot-section .nb-pname{min-width:0}
#bot-section .nb-pname b{font-size:.9rem;font-weight:650;color:var(--sx-text)}
#bot-section .nb-pname small{display:block;font-size:.75rem;color:var(--sx-faint);font-family:var(--font-mono)}
#bot-section .nb-mcaps{font-size:.82rem;color:var(--sx-muted);white-space:nowrap}
#bot-section .nb-mcaps b{color:var(--sx-text2);font-weight:650}
#bot-section .nb-mcaps .nb-arr{color:var(--sx-faint);margin:0 .3rem}
#bot-section .nb-px{font-family:var(--font-head);font-weight:700;font-size:1rem;color:var(--sx-text)}
#bot-section .nb-px small{display:block;font-size:.75rem;font-weight:600;opacity:.8;margin-top:.05rem}
#bot-section .nb-px.nb-nopx{font-size:.8rem;font-weight:600;color:var(--sx-faint);font-family:var(--font-mono)}
/* Le signe porte la couleur — il doit gagner sur la couleur de base. */
#bot-section .nb-px.pos,#bot-section .nb-brow .v.pos,#bot-section .nb-mono.pos{color:var(--sx-good)}
#bot-section .nb-px.neg,#bot-section .nb-brow .v.neg,#bot-section .nb-mono.neg{color:var(--sx-bad)}

#bot-section .nb-panel-tools{position:absolute;top:.85rem;right:.85rem;display:flex;gap:.4rem}
#bot-section .nb-tool{
  width:30px;height:30px;border-radius:9px;display:grid;place-items:center;cursor:pointer;
  background:var(--sx-bg2);border:1px solid var(--sx-border);color:var(--sx-muted);
  transition:color .15s var(--sx-ease),border-color .15s var(--sx-ease);
}
#bot-section .nb-tool:hover{color:var(--sx-acc);border-color:var(--sx-acc-line)}
#bot-section .nb-tool.danger:hover{color:var(--sx-bad);border-color:color-mix(in srgb,var(--sx-bad) 40%,transparent)}
#bot-section .nb-tool.nb-pub-on{color:var(--sx-good);border-color:color-mix(in srgb,var(--sx-good) 40%,transparent)}

#bot-section .nb-plbl{
  font-size:.75rem;font-weight:650;letter-spacing:.06em;text-transform:uppercase;
  color:var(--sx-muted);margin-bottom:.55rem;
}
#bot-section .nb-actgrid,
#bot-section .nb-buyrow{display:grid;grid-template-columns:repeat(4,1fr);gap:.45rem}
#bot-section .nb-sbtn,
#bot-section .nb-bbtn{
  font-family:var(--font);font-weight:650;font-size:.82rem;white-space:nowrap;
  border:1px solid var(--sx-border2);background:var(--sx-bg2);color:var(--sx-text);
  border-radius:10px;padding:.6rem .3rem;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;gap:.2rem;
  transition:color .15s var(--sx-ease),border-color .15s var(--sx-ease),background .15s var(--sx-ease);
}
#bot-section .nb-sbtn:hover{color:var(--sx-bad);border-color:color-mix(in srgb,var(--sx-bad) 45%,transparent);background:color-mix(in srgb,var(--sx-bad) 8%,transparent)}
#bot-section .nb-sbtn.wide{grid-column:1/-1;color:var(--sx-text2)}
#bot-section .nb-sbtn.wide:hover{color:var(--sx-acc);border-color:var(--sx-acc-line);background:var(--sx-acc-soft)}
#bot-section .nb-buyrow .nb-bbtn:hover{color:var(--sx-good);border-color:color-mix(in srgb,var(--sx-good) 45%,transparent);background:color-mix(in srgb,var(--sx-good) 8%,transparent)}
#bot-section .nb-bbtn.save{background:var(--sx-acc);border-color:var(--sx-acc);color:#160d05}
#bot-section .nb-wide{grid-column:1/-1}
body.bx-light #bot-section .nb-bbtn.save{color:var(--sx-paper)}
#bot-section .nb-pinp{
  background:var(--sx-bg2);border:1px solid var(--sx-border2);border-radius:10px;
  color:var(--sx-text);font-family:var(--font-mono);font-size:.82rem;
  padding:.55rem .3rem;width:100%;box-sizing:border-box;text-align:center;outline:0;
}
#bot-section .nb-pinp:focus{border-color:var(--sx-acc)}
#bot-section .nb-msg{font-size:.8rem;margin-top:.5rem;min-height:1em}

#bot-section .nb-warn{
  background:color-mix(in srgb,var(--sx-bad) 9%,transparent);
  border:1px solid color-mix(in srgb,var(--sx-bad) 32%,transparent);
  color:var(--sx-bad);border-radius:10px;padding:.65rem .8rem;
  font-size:.8rem;line-height:1.45;margin-bottom:.85rem;
}

/* Calls écartés */
#bot-section .nb-skip{
  display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.65rem;
  padding:.6rem .25rem;border-bottom:1px solid var(--sx-border);font-size:.82rem;
}
#bot-section .nb-skip:last-child{border-bottom:0}
#bot-section .nb-skip b{color:var(--sx-text2);font-weight:650}
#bot-section .nb-skip span{color:var(--sx-muted)}
#bot-section .nb-skip i{font-style:normal;font-family:var(--font-mono);font-size:.75rem;color:var(--sx-faint);white-space:nowrap}

/* Tables (historique / top) */
#bot-section .nb-colh{
  display:grid;grid-template-columns:2fr 1fr 1fr 1fr 60px;gap:.65rem;
  padding:0 .25rem .6rem;font-size:.75rem;font-weight:600;letter-spacing:.05em;
  text-transform:uppercase;color:var(--sx-faint);
}
#bot-section .nb-prow{
  display:grid;grid-template-columns:2fr 1fr 1fr 1fr 60px;align-items:center;gap:.65rem;
  padding:.7rem .25rem;border-bottom:1px solid var(--sx-border);font-size:.85rem;color:var(--sx-text2);
}
#bot-section .nb-prow:last-child{border-bottom:0}
#bot-section .nb-rank{width:20px;text-align:center;font-family:var(--font-head);font-weight:700;color:var(--sx-faint)}
#bot-section .nb-empty{padding:1.6rem .25rem;text-align:center;color:var(--sx-faint);font-size:.85rem}
@media(max-width:720px){
  #bot-section .nb-colh{display:none}
  #bot-section .nb-prow{grid-template-columns:1.6fr 1fr;grid-auto-rows:min-content}
  #bot-section .nb-prow>*:nth-child(n+3){display:none}
}

/* Répartition */
#bot-section .nb-drow{display:flex;align-items:center;gap:.75rem;margin-bottom:.6rem}
#bot-section .nb-dlbl{width:96px;font-size:.78rem;color:var(--sx-muted);display:flex;align-items:center;gap:.45rem}
#bot-section .nb-ddot{width:8px;height:8px;border-radius:2px;flex-shrink:0}
#bot-section .nb-dbar{flex:1;height:8px;border-radius:99px;background:var(--sx-bg2);overflow:hidden}
#bot-section .nb-dbar i{display:block;height:100%;border-radius:99px;width:calc(var(--f,0) * 1%);transition:width .6s var(--sx-ease)}
/* Cinq tranches de rendement : deux teintes, cinq intensités. */
#bot-section .b1{background:var(--sx-good)}
#bot-section .b2{background:color-mix(in srgb,var(--sx-good) 72%,var(--sx-card2))}
#bot-section .b3{background:color-mix(in srgb,var(--sx-good) 42%,var(--sx-card2))}
#bot-section .b4{background:color-mix(in srgb,var(--sx-bad) 60%,var(--sx-card2))}
#bot-section .b5{background:var(--sx-bad)}
#bot-section .nb-dval{width:34px;text-align:right;font-family:var(--font-mono);font-size:.8rem;font-weight:700;color:var(--sx-text2)}

/* Courbe : la teinte est portée par le conteneur, le SVG lit currentColor. */
#bot-section .nb-curve.pos{color:var(--sx-good)}
#bot-section .nb-curve.neg{color:var(--sx-bad)}
#bot-section .nb-spark{width:100%;height:180px;display:block}
#bot-section .nb-curve-foot{
  display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;margin-top:.5rem;
}
#bot-section .nb-curve-foot span{font-size:.75rem;font-weight:600;color:var(--sx-faint)}
#bot-section .nb-curve-foot b{font-family:var(--font-head);font-size:.95rem;font-weight:700;color:currentColor}

/* Lignes de wallets : quatre colonnes, la dernière au contenu. */
#bot-section .nb-wrow{grid-template-columns:2fr 1fr 1fr auto}
#bot-section .nb-wrow .nb-pname small{cursor:pointer}
#bot-section .nb-wrow .nb-pname small:hover{color:var(--sx-acc)}
#bot-section .nb-wrow .nb-tag{padding:.2rem .5rem}
@media(max-width:720px){#bot-section .nb-wrow{grid-template-columns:1.6fr 1fr}}

/* ═══ 7. FORMULAIRES ════════════════════════════════════════════════ */

#bot-section .nb-field{margin-bottom:0}
#bot-section .nb-field label{display:block;font-size:.8rem;font-weight:600;color:var(--sx-text2);margin-bottom:.4rem}
#bot-section .nb-field .hint{font-weight:400;font-size:.75rem;color:var(--sx-faint)}
#bot-section .nb-iw{
  display:flex;align-items:center;gap:.4rem;
  background:var(--sx-bg2);border:1px solid var(--sx-border);border-radius:11px;padding:0 .8rem;
  transition:border-color .15s var(--sx-ease);
}
#bot-section .nb-iw:focus-within{border-color:var(--sx-acc)}
#bot-section .nb-iw input,
#bot-section .nb-iw select{
  flex:1;width:100%;background:none;border:0;outline:0;
  color:var(--sx-text);font-family:var(--font-mono);font-size:.88rem;padding:.65rem 0;
}
#bot-section .nb-iw select{font-family:var(--font)}
#bot-section .nb-iw select option{background:var(--sx-card);color:var(--sx-text)}
#bot-section .nb-iw .u{font-size:.8rem;font-weight:600;color:var(--sx-faint);white-space:nowrap}
#bot-section .nb-iw .u.pos{color:var(--sx-good)}
#bot-section .nb-iw .u.neg{color:var(--sx-bad)}
#bot-section .nb-two{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}
@media(max-width:520px){#bot-section .nb-two{grid-template-columns:1fr}}

/* ═══ 8. MODAL DE STRATÉGIE ═════════════════════════════════════════ */

#bot-section .nb-ov{
  position:fixed;inset:0;z-index:1000;display:none;
  align-items:flex-start;justify-content:center;padding:2.5rem 1rem;overflow-y:auto;
  background:color-mix(in srgb,var(--sx-bg) 78%,transparent);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
}
#bot-section .nb-ov.show{display:flex;animation:nbFade .2s var(--sx-ease)}
@keyframes nbFade{from{opacity:0}to{opacity:1}}
#bot-section .nb-modal{
  width:100%;max-width:660px;background:var(--sx-card);
  border:1px solid var(--sx-border2);border-radius:20px;box-shadow:var(--sx-shadow-lg);
  animation:nbRise .28s var(--sx-ease);
}
@keyframes nbRise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
#bot-section .nb-mh{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:1.1rem 1.35rem;border-bottom:1px solid var(--sx-border)}
#bot-section .nb-mt2{display:flex;align-items:center;gap:.65rem;font-family:var(--font-head);font-weight:700;font-size:1.1rem;color:var(--sx-text)}
#bot-section .nb-mic{
  width:30px;height:30px;border-radius:9px;display:grid;place-items:center;
  background:var(--sx-acc-soft);border:1px solid var(--sx-acc-line);color:var(--sx-acc);
}
#bot-section .nb-close{
  width:32px;height:32px;border-radius:9px;display:grid;place-items:center;cursor:pointer;
  background:var(--sx-card2);border:1px solid var(--sx-border);color:var(--sx-muted);
  transition:color .15s var(--sx-ease),border-color .15s var(--sx-ease);
}
#bot-section .nb-close:hover{color:var(--sx-text);border-color:var(--sx-border2)}
#bot-section .nb-mb{padding:1.35rem}
#bot-section .nb-mfoot{display:flex;align-items:center;gap:.75rem;padding:1.1rem 1.35rem;border-top:1px solid var(--sx-border)}
#bot-section .nb-mfoot .nb-btn{width:auto;flex:1}

#bot-section .nb-chips{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1.35rem}
#bot-section .nb-wchip{
  display:flex;align-items:center;gap:.5rem;padding:.45rem .75rem;border-radius:11px;cursor:pointer;
  background:var(--sx-card2);border:1px solid var(--sx-border);color:var(--sx-text2);
  font-size:.85rem;font-weight:600;transition:border-color .15s var(--sx-ease),color .15s var(--sx-ease);
}
#bot-section .nb-wchip:hover{border-color:var(--sx-border2);color:var(--sx-text)}
#bot-section .nb-wchip.on{border-color:var(--sx-acc-line);background:var(--sx-acc-soft);color:var(--sx-acc)}
#bot-section .nb-wchip .nb-wava{width:26px;height:26px;border-radius:8px;font-size:.75rem}

#bot-section .nb-presets{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}
@media(max-width:560px){#bot-section .nb-presets{grid-template-columns:1fr}}
#bot-section .nb-preset{
  position:relative;border:1px solid var(--sx-border);border-radius:14px;padding:1rem;
  background:var(--sx-card2);cursor:pointer;
  transition:border-color .18s var(--sx-ease),transform .18s var(--sx-ease);
}
#bot-section .nb-preset:hover{border-color:var(--sx-acc-line);transform:translateY(-2px)}
#bot-section .nb-preset .rar{
  position:absolute;top:0;right:0;padding:.25rem .55rem;border-radius:0 14px 0 10px;
  font-size:.75rem;font-weight:700;letter-spacing:.04em;
  background:var(--sx-card)!important;color:var(--sx-muted)!important;
}
#bot-section .nb-pn{
  display:flex;align-items:center;gap:.5rem;
  font-family:var(--font-head);font-weight:700;font-size:1rem;color:var(--sx-text);margin-bottom:.4rem;
}
#bot-section .nb-pn svg{width:17px;height:17px;color:var(--sx-acc);flex-shrink:0}
#bot-section .nb-pd{font-size:.8rem;color:var(--sx-muted);line-height:1.45}
#bot-section .nb-ps{display:flex;flex-wrap:wrap;gap:.85rem;margin-top:.7rem;font-size:.75rem;color:var(--sx-faint)}
#bot-section .nb-ps b{color:var(--sx-text2);font-family:var(--font-mono)}
#bot-section .nb-preset.new{
  border-style:dashed;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:.4rem;text-align:center;color:var(--sx-acc);min-height:120px;
}
#bot-section .nb-preset.new:hover{background:var(--sx-acc-soft)}
#bot-section .nb-plus{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;background:var(--sx-acc-soft)}

#bot-section .nb-sec{
  border:1px solid var(--sx-border);border-radius:14px;padding:1.1rem;
  margin-bottom:.75rem;background:var(--sx-card2);
}
#bot-section .nb-sec.req{border-color:var(--sx-acc-line)}
#bot-section .nb-sech{display:flex;align-items:center;gap:.6rem;margin-bottom:.9rem}
#bot-section .nb-snum{
  width:23px;height:23px;border-radius:7px;display:grid;place-items:center;flex-shrink:0;
  background:var(--sx-bg2);border:1px solid var(--sx-border);
  font-family:var(--font-head);font-weight:700;font-size:.75rem;color:var(--sx-muted);
}
#bot-section .nb-st{font-family:var(--font-head);font-weight:700;font-size:.95rem;color:var(--sx-text)}
#bot-section .nb-sreq{
  font-size:.75rem;font-weight:700;letter-spacing:.04em;color:var(--sx-acc);
  background:var(--sx-acc-soft);border:1px solid var(--sx-acc-line);padding:.15rem .45rem;border-radius:6px;
}
#bot-section .nb-sopt{font-size:.75rem;color:var(--sx-faint);margin-left:auto}
#bot-section .nb-sd{font-size:.8rem;color:var(--sx-muted);line-height:1.5;margin-bottom:.85rem}
#bot-section .nb-sd b{color:var(--sx-text2)}
#bot-section .nb-sd.warn{color:var(--sx-warn)}

#bot-section .nb-segm{display:grid;grid-template-columns:repeat(4,1fr);gap:.45rem}
@media(max-width:520px){#bot-section .nb-segm{grid-template-columns:repeat(2,1fr)}}
#bot-section .nb-opt{
  display:flex;flex-direction:column;align-items:center;gap:.35rem;
  padding:.75rem .4rem;border-radius:11px;cursor:pointer;text-align:center;
  background:var(--sx-bg2);border:1px solid var(--sx-border);
  font-size:.82rem;font-weight:600;color:var(--sx-text2);
  transition:border-color .15s var(--sx-ease),color .15s var(--sx-ease),background .15s var(--sx-ease);
}
#bot-section .nb-opt:hover{border-color:var(--sx-border2);color:var(--sx-text)}
#bot-section .nb-opt svg{width:18px;height:18px;stroke-width:1.7}
#bot-section .nb-opt.on{border-color:var(--sx-acc-line);background:var(--sx-acc-soft);color:var(--sx-acc)}

#bot-section .nb-tprow{display:grid;grid-template-columns:1fr 16px 1fr 34px;align-items:center;gap:.5rem;margin-bottom:.5rem}
#bot-section .nb-tarr{text-align:center;color:var(--sx-faint)}
#bot-section .nb-tdel{
  width:34px;height:34px;border-radius:9px;display:grid;place-items:center;cursor:pointer;
  background:var(--sx-bg2);border:1px solid var(--sx-border);color:var(--sx-faint);
  transition:color .15s var(--sx-ease),border-color .15s var(--sx-ease);
}
#bot-section .nb-tdel:hover{color:var(--sx-bad);border-color:color-mix(in srgb,var(--sx-bad) 40%,transparent)}
#bot-section .nb-addtp{
  display:flex;align-items:center;justify-content:center;gap:.45rem;width:100%;
  padding:.6rem;border-radius:10px;border:1px dashed var(--sx-border2);background:none;
  color:var(--sx-text2);font-family:var(--font);font-weight:600;font-size:.82rem;cursor:pointer;
  transition:color .15s var(--sx-ease),border-color .15s var(--sx-ease);
}
#bot-section .nb-addtp:hover{color:var(--sx-acc);border-color:var(--sx-acc-line)}
#bot-section .nb-slipnote{
  font-size:.8rem;line-height:1.5;color:var(--sx-muted);
  background:var(--sx-bg2);border:1px solid var(--sx-border);border-radius:10px;
  padding:.7rem .85rem;margin-bottom:.9rem;
}
#bot-section .nb-slipnote b{color:var(--sx-text2)}

/* ═══ 9. STRATÉGIES ═════════════════════════════════════════════════ */

#bot-section .nb-strat-item{
  display:flex;align-items:center;justify-content:space-between;gap:.85rem;flex-wrap:wrap;
  padding:1rem;border:1px solid var(--sx-border);border-radius:14px;
  background:var(--sx-card2);margin-bottom:.6rem;
  transition:border-color .18s var(--sx-ease);
}
#bot-section .nb-strat-item:hover{border-color:var(--sx-border2)}
#bot-section .nb-strat-item.active{border-color:var(--sx-acc-line);box-shadow:none;background:var(--sx-acc-soft)}
#bot-section .nb-strat-main{flex:1;min-width:180px}
#bot-section .nb-strat-name{display:flex;align-items:center;gap:.5rem;font-family:var(--font-head);font-weight:700;font-size:1rem;color:var(--sx-text)}
#bot-section .nb-strat-live{
  font-size:.75rem;font-weight:700;letter-spacing:.05em;color:var(--sx-acc);
  background:none;border:1px solid var(--sx-acc-line);padding:.1rem .4rem;border-radius:5px;
}
#bot-section .nb-strat-tags{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.6rem}
#bot-section .nb-strat-acts{display:flex;align-items:center;gap:.4rem}
#bot-section .nb-strat-badge2{font-size:.78rem;font-weight:650;color:var(--sx-acc)}

/* ═══ 10. CARTE PNL (overlay) ═══════════════════════════════════════ */

#bot-section .nb-pnlcard{width:300px;max-width:92vw}
#bot-section .nb-pnlov .nb-btn{width:300px;max-width:92vw;margin-top:.75rem}

#bot-section .nb-pnlov{
  position:fixed;inset:0;z-index:1100;display:none;align-items:center;justify-content:center;padding:1.25rem;
  background:color-mix(in srgb,var(--sx-bg) 82%,transparent);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
}
#bot-section .nb-pnlov.show{display:flex;animation:nbFade .2s var(--sx-ease)}

/* ═══ 11. ÉCRANS D'ENTRÉE — verrou, activation, chargement ══════════ */

#bot-section .bt2-lock{
  max-width:560px;margin:6vh auto 0;text-align:left;
  background:var(--sx-card);border:1px solid var(--sx-border);
  border-radius:20px;padding:1.75rem;box-shadow:none;
}
#bot-section .bt2-lock-ico{
  width:44px;height:44px;border-radius:13px;margin:0 0 1.1rem;display:grid;place-items:center;
  background:var(--sx-acc-soft);border:1px solid var(--sx-acc-line);color:var(--sx-acc);
}
#bot-section .bt2-lock h2{
  font-family:var(--font-head);font-size:1.5rem;font-weight:700;letter-spacing:-.02em;
  color:var(--sx-text);margin:0 0 .55rem;
}
#bot-section .bt2-lock p{font-size:.88rem;line-height:1.55;color:var(--sx-text2);margin:0 0 1rem}
#bot-section .bt2-lock p b{color:var(--sx-text)}
#bot-section .bt2-howto{font-size:.85rem;line-height:1.6;color:var(--sx-text2)}
#bot-section .bt2-howto b{color:var(--sx-text)}
#bot-section .bt2-howto ol{margin:.5rem 0 0;padding-left:1.1rem}
#bot-section .bt2-howto li{margin-bottom:.4rem}
#bot-section .bt2-blockers{
  background:color-mix(in srgb,var(--sx-warn) 9%,transparent);
  border:1px solid color-mix(in srgb,var(--sx-warn) 30%,transparent);
  border-radius:12px;padding:.8rem .9rem;font-size:.82rem;line-height:1.5;color:var(--sx-text2);
}
#bot-section .bt2-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  font-family:var(--font);font-size:.88rem;font-weight:650;
  padding:.75rem 1.15rem;border-radius:11px;cursor:pointer;
  background:var(--sx-card2);border:1px solid var(--sx-border2);color:var(--sx-text);
  transition:background .16s var(--sx-ease),border-color .16s var(--sx-ease),color .16s var(--sx-ease);
}
#bot-section .bt2-btn:hover{border-color:var(--sx-acc-line);color:var(--sx-acc)}
#bot-section .bt2-btn.save{background:var(--sx-acc);border-color:var(--sx-acc);color:#160d05}
#bot-section .bt2-btn.save:hover{background:var(--sx-acc2);border-color:var(--sx-acc2);color:#160d05}
#bot-section .bt2-btn:disabled{opacity:.5;cursor:not-allowed}
#bot-section .bt2-lock .nb-btnrow{flex-direction:column;margin-top:1.25rem}
#bot-section .bt2-lock .bt2-btn{width:100%}
body.bx-light #bot-section .bt2-btn.save,
body.bx-light #bot-section .bt2-btn.save:hover{color:var(--sx-paper)}
#bot-section .st2-msg{font-size:.82rem;color:var(--sx-bad);margin-top:.6rem;min-height:1em}

/* Chargement : une charpente qui respire, pas un mot d'attente. */
#bot-section .nb-skel{display:grid;gap:1rem}
#bot-section .nb-skel-rail{height:62px;border-radius:16px}
#bot-section .nb-skel-hero{height:210px;border-radius:20px}
#bot-section .nb-skel-row{height:104px;border-radius:16px}
#bot-section .nb-skel-rail,
#bot-section .nb-skel-hero,
#bot-section .nb-skel-row{
  background:linear-gradient(100deg,var(--sx-card) 30%,var(--sx-card2) 50%,var(--sx-card) 70%);
  background-size:220% 100%;
  animation:nbSkel 1.4s var(--sx-ease) infinite;
}
#bot-section .nb-skel-2{display:grid;grid-template-columns:1.1fr .9fr;gap:1rem}
/* Le squelette n'est jamais muet : s'il dure, il dit pourquoi. */
#bot-section .nb-loadmsg{
  margin-top:1rem;text-align:center;font-size:.85rem;color:var(--sx-bad);min-height:1em;
}
@media(max-width:900px){#bot-section .nb-skel-2{grid-template-columns:1fr}}
@keyframes nbSkel{from{background-position:180% 0}to{background-position:-20% 0}}

/* ═══ 12. MODALES DE CLÉ (export / import) ══════════════════════════
   Elles sont montées sur <body>, hors de #bot-section : la palette du
   bot est donc redéclarée ici, sur la seule classe de la modale. */

.bx-botmodal{
  --sx-card:#151a28; --sx-card2:#1d2334;
  --sx-border:rgba(148,163,205,.13); --sx-border2:rgba(148,163,205,.24);
  --sx-text:#edf1fa; --sx-text2:#c6cde0; --sx-muted:#9aa3bd; --sx-faint:#7d86a3;
  --sx-acc:#0e9e64; --sx-acc2:#17c975; --sx-acc-soft:rgba(23,201,117,.12);
  --sx-good:#17c975; --sx-bad:#ff4060;
  --sx-ease:cubic-bezier(.22,1,.36,1);
  background:rgba(4,4,7,.72);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  font-variant-numeric:tabular-nums;
}
body.bx-light .bx-botmodal{
  --sx-card:#ffffff; --sx-card2:#f2f5fa;
  --sx-border:rgba(10,21,38,.12); --sx-border2:rgba(10,21,38,.22);
  --sx-text:#0c1526; --sx-text2:#3a4258; --sx-muted:#5b6478; --sx-faint:#8a93a8;
  --sx-acc:#0e9e64; --sx-acc2:#0a7f50; --sx-acc-soft:rgba(14,158,100,.09);
  --sx-good:#0e9e64; --sx-bad:#c22844;
  background:rgba(120,116,110,.35);
}
.bx-botmodal .bt2-modal{
  background:var(--sx-card);border:1px solid var(--sx-border2);border-radius:20px;
  padding:1.5rem;box-shadow:0 24px 60px -28px rgba(0,0,0,.85);
  animation:nbRise .28s var(--sx-ease);
}
.bx-botmodal h3{font-family:var(--font-head);font-size:1.15rem;font-weight:700;letter-spacing:-.02em;color:var(--sx-text);margin:0 0 .5rem}
.bx-botmodal p{font-size:.85rem;line-height:1.55;color:var(--sx-text2);margin:0 0 1rem}
.bx-botmodal p b{color:var(--sx-text)}
.bx-botmodal .bt2-field{display:flex;flex-direction:column;gap:.4rem;margin-bottom:.85rem}
.bx-botmodal .bt2-field label{
  font-size:.78rem;font-weight:600;letter-spacing:0;text-transform:none;color:var(--sx-text2);
}
.bx-botmodal .st2-input{
  background:var(--sx-card2);border:1px solid var(--sx-border);border-radius:11px;
  padding:.65rem .8rem;font-size:.88rem;color:var(--sx-text);box-shadow:none;
  transition:border-color .15s var(--sx-ease);
}
.bx-botmodal .st2-input:focus{border-color:var(--sx-acc);box-shadow:none}
.bx-botmodal .st2-msg{font-size:.8rem;margin-top:.6rem}
.bx-botmodal .bt2-keybox{
  font-family:var(--font-mono);font-size:.8rem;line-height:1.55;word-break:break-all;
  background:var(--sx-card2);border:1px solid var(--sx-acc-line,var(--sx-border2));
  border-radius:11px;padding:.85rem;color:var(--sx-text);margin-bottom:.85rem;
}
.bx-botmodal .bt2-warn{
  background:color-mix(in srgb,var(--sx-bad) 9%,transparent);
  border:1px solid color-mix(in srgb,var(--sx-bad) 30%,transparent);
  border-radius:11px;padding:.75rem .85rem;font-size:.82rem;line-height:1.5;
  color:var(--sx-text2);margin-bottom:1rem;
}
.bx-botmodal .bt2-warn b{color:var(--sx-bad)}
.bx-botmodal .bt2-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  font-family:var(--font);font-size:.85rem;font-weight:650;
  padding:.65rem 1.05rem;border-radius:11px;cursor:pointer;
  background:var(--sx-card2);border:1px solid var(--sx-border2);color:var(--sx-text);
  transition:background .16s var(--sx-ease),border-color .16s var(--sx-ease),color .16s var(--sx-ease);
}
.bx-botmodal .bt2-btn:hover{border-color:var(--sx-acc);color:var(--sx-acc)}
.bx-botmodal .bt2-btn.save{background:var(--sx-acc);border-color:var(--sx-acc);color:#160d05}
.bx-botmodal .bt2-btn.save:hover{background:var(--sx-acc2);border-color:var(--sx-acc2);color:#160d05}
body.bx-light .bx-botmodal .bt2-btn.save,
body.bx-light .bx-botmodal .bt2-btn.save:hover{color:#fff}
.bx-botmodal .nb-btnrow{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:.25rem}

@media (prefers-reduced-motion:reduce){
  #bot-section *,#bot-section *::before,#bot-section *::after{
    animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;
  }
}
