/* Marty — design system (Apple HIG iOS/macOS). Mobile-first, clair + sombre. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Segoe UI", Roboto, system-ui, sans-serif;

  /* Palette claire (défaut) */
  --bg: #f2f2f7;              /* systemGroupedBackground */
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --card-2: #f7f7fb;
  --separator: rgba(60,60,67,0.16);
  --text: #1c1c1e;
  --text-2: #3c3c43;
  --text-3: rgba(60,60,67,0.6);   /* secondary label */
  --text-4: rgba(60,60,67,0.3);
  --accent: #0a84ff;
  --accent-ink: #ffffff;
  --green: #34c759;
  --orange: #ff9500;
  --yellow: #e6a700;
  --red: #ff3b30;
  --fill: rgba(120,120,128,0.12);
  --fill-strong: rgba(120,120,128,0.20);
  --shadow: 0 1px 2px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.05);
  --nav-bg: rgba(255,255,255,0.8);
  --radius: 16px;
  --radius-sm: 10px;
  --tap: 44px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  /* lot 10 : chevron Lucide (chevron-right) pour les marqueurs « déplier » (via mask ->
     prend currentColor, pivote avec transform comme avant). */
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --card: #1c1c1e;
    --card-2: #2c2c2e;
    --separator: rgba(84,84,88,0.6);
    --text: #ffffff;
    --text-2: #ebebf5;
    --text-3: rgba(235,235,245,0.6);
    --text-4: rgba(235,235,245,0.3);
    --accent: #0a84ff;
    --green: #30d158;
    --orange: #ff9f0a;
    --yellow: #ffd60a;
    --red: #ff453a;
    --fill: rgba(120,120,128,0.24);
    --fill-strong: rgba(120,120,128,0.36);
    --shadow: none;
    --nav-bg: rgba(28,28,30,0.8);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 17px; line-height: 1.4; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--safe-b); /* lot 14 : plus de tab bar */
}
a { color: var(--accent); text-decoration: none; }
h1,h2,h3 { letter-spacing: -0.022em; }

/* ------------------------------------------------------------------ layout */
.app { min-height: 100vh; }

/* Sidebar desktop (masquée en mobile) */
.sidebar { display: none; }

/* En-tête compact mobile */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-t)) 16px 8px;
  border-bottom: 0.5px solid var(--separator);
  /* iOS WebKit : le backdrop-filter est porté par un pseudo-élément DERRIÈRE le contenu
     (cf. .topbar::before) et NON par ce conteneur. Sinon Safari/PWA iOS rasterise toute
     la couche de compositing (texte + logo) en basse résolution -> en-tête flou/baveux.
     isolation:isolate borne le z-index:-1 du pseudo au stacking context de l'en-tête. */
  isolation: isolate;
}
/* Fond translucide + flou de l'en-tête, isolé du texte/logo (net sur iOS). */
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.topbar .brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 6px; }
.topbar .grow { flex: 1; }
.topbar .live { position: relative; display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 13px; }
/* lot 2 (F/G) : pastille d'état cliquable + horloge live + popovers (état / fuseau). */
.live .live-dot-btn { background: none; border: 0; padding: 5px; margin: -5px 0; display: inline-flex; align-items: center; cursor: pointer; }
.live .live-clock { background: none; border: 0; color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; padding: 4px 4px; border-radius: 6px; -webkit-tap-highlight-color: transparent; }
.live .live-clock:hover { color: var(--text-2); }
.live .live-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; background: var(--card-2); color: var(--text-2); border: 0.5px solid var(--separator); border-radius: 10px; padding: 8px 11px; font-size: 12px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,0.18); max-width: calc(100vw - 20px); overflow: hidden; text-overflow: ellipsis; }
.live .live-tz-menu { display: flex; flex-direction: column; padding: 4px; min-width: 150px; }
/* lot 3 (a) : l'attribut `hidden` DOIT masquer le popover/menu. Sans cette règle, le
   `display: flex` ci-dessus l'emportait sur le `display:none` implicite de [hidden] -> le
   menu de fuseau ne se fermait jamais (bug iOS/PWA signalé). Spécificité > .live .live-tz-menu. */
.live .live-pop[hidden] { display: none; }
.live .tz-opt { background: none; border: 0; text-align: left; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-size: 14px; }
.live .tz-opt.on { color: var(--accent); font-weight: 600; }
.live .tz-opt:hover, .live .tz-opt:active { background: var(--fill); }

.content { padding: 16px; max-width: 900px; margin: 0 auto; }
.page-title { font-size: 28px; font-weight: 700; margin: 8px 2px 2px; }
.page-sub { color: var(--text-3); font-size: 15px; margin: 0 2px 16px; }

/* ------------------------------------------------------------ tab bar mobile */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around; align-items: stretch;
  padding-bottom: var(--safe-b);
  background: var(--nav-bg); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 8px 4px; min-height: 52px;
  color: var(--text-3); font-size: 10px; font-weight: 500;
}
.tabbar a.active { color: var(--accent); }
.tabbar a .ic { width: 26px; height: 26px; }

/* --------------------------------------------------------------------- cards */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px;
}
.card + .card { margin-top: 0; }

/* Carte compte — accueil */
.acct-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.acct-name { font-size: 20px; font-weight: 700; }
.status-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 15px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-4); flex: none; }
.dot.ok { background: var(--green); } .dot.warn { background: var(--orange); }
.dot.bad { background: var(--red); } .dot.neutral { background: var(--text-4); }
.status-text.ok { color: var(--text); } .status-text.warn { color: var(--orange); }
.status-text.bad { color: var(--red); } .status-text.neutral { color: var(--text-3); }

.equity-block { display: flex; align-items: flex-end; justify-content: space-between; margin: 18px 0 4px; }
.equity { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.equity .cur { font-size: 22px; color: var(--text-3); font-weight: 600; margin-left: 4px; }
.pnl-day { text-align: right; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pnl-day .lbl { display: block; font-size: 12px; color: var(--text-3); font-weight: 500; }
.pos { color: var(--green); } .neg { color: var(--red); } .flat { color: var(--text-3); }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 10px 0 4px; }
.metric .k { font-size: 12px; color: var(--text-3); }
.metric .v { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

.spark { width: 100%; height: 56px; display: block; margin-top: 8px; }

/* liste de positions */
.poslist { margin-top: 10px; }
.pos-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 0.5px solid var(--separator); }
.pos-row .side { font-weight: 600; }
.pos-row .badge-side { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--fill); }
.pos-row .grow { flex: 1; }
.pos-row .pnl { font-weight: 600; font-variant-numeric: tabular-nums; }
.pos-meta { color: var(--text-3); font-size: 13px; }

/* section repliable détails */
details.tech { margin-top: 12px; border-top: 0.5px solid var(--separator); padding-top: 8px; }
details.tech summary { color: var(--accent); font-size: 15px; cursor: pointer; list-style: none; }
details.tech summary::-webkit-details-marker { display: none; }
details.tech .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin-top: 10px; font-size: 14px; }
details.tech .kv .k { color: var(--text-3); } details.tech .kv .v { text-align: right; font-variant-numeric: tabular-nums; }

.card-actions { display: flex; gap: 10px; margin-top: 14px; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 11px 18px; border-radius: 12px; border: none;
  font-family: var(--font); font-size: 16px; font-weight: 600; cursor: pointer;
  background: var(--fill); color: var(--text); transition: opacity .15s, transform .05s;
}
.btn:active { transform: scale(0.98); opacity: 0.85; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.tinted { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.btn.destructive { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 7px 14px; font-size: 15px; }
.btn:disabled { opacity: 0.4; }

/* ------------------------------------------------------ listes groupées iOS */
.grouped { margin-bottom: 22px; }
.grouped > .sect-title { font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.02em; color: var(--text-3); margin: 0 16px 7px; }
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; min-height: var(--tap);
  padding: 10px 16px; border-top: 0.5px solid var(--separator); }
.row:first-child { border-top: none; }
.row .row-label { flex: 1; font-size: 16px; }
.row .row-label small { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; }
.row .row-value { color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; }
.row.link .row-value::after { content: "›"; margin-left: 8px; color: var(--text-4); font-size: 20px; }
.row.tap { cursor: pointer; } .row.tap:active { background: var(--fill); }

/* champ dans une row */
.field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline input[type=text], .field-inline input[type=number], .field-inline input[type=time],
.field-inline select {
  border: none; background: transparent; color: var(--text); font: inherit; text-align: right;
  max-width: 160px; padding: 6px 0; font-variant-numeric: tabular-nums;
}
.field-inline .unit { color: var(--text-3); font-size: 14px; }
.field-inline select { text-align: right; }
/* MODES MANUEL / AUTO : lecture seule des valeurs calculées (calc_auto), lisible et sans
   débordement (empilé à droite, se replie sur mobile 390 px). */
.field-inline.calc-auto { flex-direction: column; align-items: flex-end; gap: 2px; max-width: none; }
.calc-auto .calc-line { font-size: 13px; color: var(--text-2); white-space: normal; text-align: right; }
.calc-auto .calc-line b { color: var(--text); font-weight: 600; }
[data-amp-equiv] { color: var(--text-3); font-variant-numeric: tabular-nums; }
/* Valeur LECTURE SEULE alignée comme un champ : même alignement à droite + chiffres tabulaires
   que les <input>, pour que les lignes calculées ne soient plus « collées au bord » (valeur dans
   la colonne du champ, unité dans la colonne d'unité à droite). */
.field-inline .ro-value { color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
/* TP auto RR : lignes lecture seule (RR / gain / distance / positions / montée), empilées à
   droite comme le bloc calc-auto, lisibles et repliables sur mobile (390 px). */
.calc-auto .ro-row { text-align: right; margin: 1px 0; }
.calc-auto .ro-head { font-size: 13px; color: var(--text-2); white-space: normal; }
.calc-auto .ro-head b { color: var(--text); font-weight: 600; }
.calc-auto .ro-sub { font-size: 12px; color: var(--text-3); white-space: normal; }
.calc-auto .ro-sub b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Erreur de saisie INLINE sous un champ (autosave) : le texte tapé reste, le message explique. */
.row .field-error { flex-basis: 100%; color: var(--red); font-size: 12px; margin-top: 4px; text-align: right; }

/* switch iOS */
/* display:inline-block indispensable : sur un <label> inline, width:51px serait
   ignoré et la piste (absolute) déborderait puis serait rognée (bug interrupteurs). */
.switch { position: relative; display: inline-block; width: 51px; height: 31px; flex: none; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--fill-strong); border-radius: 999px; transition: background .2s; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; background: #fff;
  border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.25); transition: transform .2s; }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track .thumb { transform: translateX(20px); }

/* champs plein largeur (login/setup) */
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 13px; color: var(--text-3); margin: 0 0 6px 4px; }
.input {
  width: 100%; min-height: var(--tap); padding: 12px 14px; font: inherit;
  background: var(--card); color: var(--text); border: 0.5px solid var(--separator);
  border-radius: 12px; -webkit-appearance: none; appearance: none;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0 4px; color: var(--red); font-size: 13px; }
.help { color: var(--text-3); font-size: 13px; }

/* ------------------------------------------------------------------- tables */
/* lot 8 : min-width:0 -> le tableau (colonnes nowrap) SCROLLE à l'intérieur (overflow-x:auto)
   au lieu de forcer la largeur de son conteneur (carte) et de déborder l'écran. */
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow-x: auto; min-width: 0; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 11px 14px; border-top: 0.5px solid var(--separator); white-space: nowrap; }
thead th { border-top: none; color: var(--text-3); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.02em; position: sticky; top: 0; background: var(--card); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--fill); color: var(--text-2); }
.badge.ok { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.badge.warn { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.badge.bad { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.badge.neutral { background: var(--fill); color: var(--text-3); }

/* état vide */
.empty { text-align: center; color: var(--text-3); padding: 28px 16px; }
/* garde-fou : chargement initial qui tarde (>10 s) -> « Connexion… nouvelle tentative » (anim douce). */
.empty.retrying { color: var(--text-2); animation: emptyPulse 1.6s ease-in-out infinite; }
@keyframes emptyPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.empty .big { font-size: 34px; }

/* segmented / filtres */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .form-field { margin: 0; }
.filters .input { min-width: 130px; }

/* ------------------------------------------------------------- action sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); z-index: 101;
  transform: translateY(120%); transition: transform .28s cubic-bezier(.22,1,.36,1);
  display: flex; flex-direction: column; gap: 8px;
}
.sheet.open { transform: translateY(0); }
.sheet .group { background: var(--bg-elevated); border-radius: 14px; overflow: hidden; }
.sheet .title { padding: 16px; text-align: center; color: var(--text-3); font-size: 13px; border-bottom: 0.5px solid var(--separator); }
.sheet .act { display: block; width: 100%; background: transparent; border: none; border-top: 0.5px solid var(--separator);
  padding: 16px; font: inherit; font-size: 19px; color: var(--accent); cursor: pointer; text-align: center; }
.sheet .act:first-child { border-top: none; }
.sheet .act.destructive { color: var(--red); }
.sheet .act.cancel { color: var(--accent); font-weight: 700; }
.sheet .group.cancel { margin-top: 0; }

/* ------------------------------------------------------------------- toasts */
.toasts { position: fixed; left: 0; right: 0; top: calc(10px + var(--safe-t)); z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--bg-elevated); color: var(--text); padding: 12px 18px; border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25); font-size: 15px; font-weight: 500;
  border: 0.5px solid var(--separator); max-width: 90vw; animation: toastIn .25s ease; }
.toast.ok { border-color: var(--green); } .toast.bad { border-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }

/* messages Django -> rendus en toasts via JS, mais fallback visuel */
.messages { list-style: none; padding: 0; margin: 0 0 14px; }
.messages li { padding: 12px 16px; border-radius: 12px; margin-bottom: 8px; font-size: 15px; }
.messages .success { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.messages .error { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.messages .info, .messages .warning { background: var(--fill); }

/* diff */
.diff-list .row .old { color: var(--red); text-decoration: line-through; margin-right: 8px; }
.diff-list .row .new { color: var(--green); font-weight: 600; }

.muted { color: var(--text-3); } .small { font-size: 13px; }
.center { text-align: center; }

/* auth pages centrées */
.auth { max-width: 380px; margin: 8vh auto 0; padding: 0 8px; }
.auth .logo { text-align: center; font-size: 44px; margin-bottom: 8px; }
.auth h1 { text-align: center; font-size: 24px; margin: 0 0 4px; }
.auth .page-sub { text-align: center; }
.qr { display: block; margin: 12px auto; width: 220px; height: 220px; border-radius: 12px; background: #fff; padding: 10px; }

/* ------------------------------------------------------------- pastilles */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 2px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 999px; font-size: 12.5px; background: var(--fill); color: var(--text-2); }
.chip b { font-weight: 600; color: var(--text); }
.chip.ok { background: color-mix(in srgb, var(--green) 15%, transparent); }
.chip.ok b { color: var(--green); }
.chip.warn { background: color-mix(in srgb, var(--orange) 15%, transparent); }
.chip.warn b { color: var(--orange); }
.chip.bad { background: color-mix(in srgb, var(--red) 15%, transparent); }
.chip.bad b { color: var(--red); }
.chip.neutral { background: var(--fill); }
.chip.pending { outline: 1px dashed var(--text-4); opacity: 0.9; }
.chev { color: var(--text-4); font-weight: 400; }
a.acct-name { color: var(--text); }

.algo-alert { display: block; margin: 12px 0 4px; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red);
  font-weight: 600; border: 1px solid var(--red); }

/* ----------------------------------------------- fiche bot : entête + contrôles */
.bot-header-card { margin-bottom: 14px; }
.bot-head { display: flex; align-items: center; gap: 10px; }
.bot-head .dot { width: 12px; height: 12px; }
.bot-head .bot-name { flex: 1; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.info-pop { position: relative; flex: none; }
.info-pop > summary { list-style: none; cursor: pointer; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--separator); display: inline-flex; align-items: center; justify-content: center;
  font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700; font-size: 15px;
  color: var(--text-3); }
.info-pop > summary::-webkit-details-marker { display: none; }
.info-pop[open] > summary { background: var(--fill); color: var(--text); }
.info-pop-body { position: absolute; right: 0; top: 34px; z-index: 20; min-width: 236px;
  background: var(--bg-elevated); border: 0.5px solid var(--separator); border-radius: 12px;
  box-shadow: var(--shadow); padding: 8px 12px; }
.info-pop-body div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: 13px; }
.info-pop-body span { color: var(--text-3); }
.info-pop-body b { font-variant-numeric: tabular-nums; }

.ctrl-list .ctrl-row { display: flex; align-items: center; gap: 12px; min-height: var(--tap);
  padding: 10px 16px; border-top: 0.5px solid var(--separator); }
.ctrl-list .ctrl-row:first-child { border-top: none; }
.ctrl-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctrl-label { font-size: 16px; font-weight: 500; }
.state { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.state.ok { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.state.warn { color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent); }
.state.bad { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.state.neutral { color: var(--text-3); background: var(--fill); }
/* Bandeau d'avertissement pleine largeur (ex. mode volume auto) */
.banner { font-size: 12.5px; line-height: 1.35; padding: 8px 11px; border-radius: 10px; }
.banner.warn { color: var(--orange); background: color-mix(in srgb, var(--orange) 13%, transparent); }
.pending-tag { font-size: 11px; color: var(--orange); font-style: italic; white-space: nowrap; }
.ctrl-switch { flex: none; margin: 0; }   /* épinglé à droite, ne déborde jamais */

.cmd-collapse { margin-top: 14px; border-top: 0.5px solid var(--separator); }
.cmd-collapse > summary { list-style: none; cursor: pointer; padding: 11px 2px; color: var(--text-2); font-size: 14px; }
.cmd-collapse > summary::-webkit-details-marker { display: none; }
.cmd-collapse > summary::before { content: ""; width: .72em; height: .72em; display: inline-block; vertical-align: -0.06em; background-color: currentColor; -webkit-mask: var(--chev) no-repeat center / contain; mask: var(--chev) no-repeat center / contain; color: var(--text-4); margin-right: 8px;
  display: inline-block; transition: transform .15s; }
.cmd-collapse[open] > summary::before { transform: rotate(90deg); }

/* ============================================ Accueil unique (lot 6) : carte bot dépliable */
/* lot 8 : la grille de cartes est un conteneur -> l'en-tête se réagence selon la LARGEUR DE LA
   CARTE (pas du viewport), ce qui couvre aussi la tablette avec sidebar (contenu étroit à 768). */
.cards-grid { container-type: inline-size; container-name: card; }
/* lot 8 : toute la chaîne de la carte peut rétrécir (sinon un enfant large — tableau, graphe —
   force la carte au-delà de l'écran). */
.bot-card, .bot-card-body, .bot-card-body .sub, .chart-box, .chart-wrap { min-width: 0; }
/* En-tête compact sur 2 lignes dès que la carte est étroite (mobile OU tablette-sidebar). */
@container card (max-width: 520px) {
  .bot-card .head-row { flex-wrap: wrap; row-gap: 2px; }
  .bot-card .gear-btn { margin-left: auto; }                 /* roue+chevron à droite (ligne 1) */
  /* lot 2b : en-tête COMPACT — solde (plus petit) À GAUCHE, les deux P&L empilés À DROITE
     (space-between), alignés à droite, JAMAIS tronqués (nowrap + police réduite au besoin).
     Préfixe `.cards-grid` = spécificité SUPÉRIEURE aux règles desktop `.bot-card .head-fin …`
     (sinon, placées plus bas dans le fichier, elles écrasaient ces overrides mobiles). */
  .cards-grid .bot-card .head-fin { order: 10; flex-basis: 100%; min-width: 0; margin-left: 0; margin-top: 6px;
    display: flex; flex-wrap: nowrap; align-items: flex-start; justify-content: space-between;
    text-align: left; column-gap: 10px; row-gap: 0; gap: 0 10px; }
  .cards-grid .bot-card .head-fin .equity { flex: 0 1 auto; min-width: 0; font-size: clamp(22px, 7vw, 28px);
    font-weight: 700; line-height: 1.05; white-space: nowrap; }
  .cards-grid .bot-card .head-fin .equity .cur { font-size: 12px; }
  /* colonne P&L à droite */
  .cards-grid .bot-card .head-fin .pnl-stack { display: flex; flex-direction: column; align-items: flex-end;
    flex: 0 0 auto; min-width: 0; gap: 1px; text-align: right; }
  .cards-grid .bot-card .head-fin .pnl-day { font-size: clamp(10px, 3.2vw, 12.5px); white-space: nowrap;
    text-align: right; min-width: 0; }
  .cards-grid .bot-card .head-fin .pnl-day .lbl { display: block; font-size: 9px; line-height: 1.1; }
  /* lot 2 (C) : équité + marge libre tiennent sur UNE ligne. */
  .bot-card .acct-live { white-space: nowrap; overflow-wrap: normal; font-size: 11.5px; }
  /* lot 2 (C) : boutons Achats/Ventes/×2 MOINS HAUTS + pastilles Auto-Kill/Tendance compactes. */
  .bot-card .sens-btn, .bot-card .boost-btn { min-height: 44px; }
  .bot-card .sens-btn { font-size: 15px; }
  .bot-card .pill-btn, .bot-card .trend-btn { min-height: 30px; padding: 5px 11px; font-size: 13px; }
  .bot-card .trend-btn { min-height: 30px; }
  /* lot 2 (C) : lignes de positions SANS troncature (le contenu peut passer à la ligne). */
  .bot-card .pos-row { align-items: flex-start; gap: 8px; }
  .bot-card .pos-row .grow { min-width: 0; overflow-wrap: anywhere; }
  .bot-card .pos-row .pnl { flex: none; white-space: nowrap; }
  /* lot 8 pt 7 : quand la carte (donc le graphe) est étroite, lightweight-charts ancre le 1er
     libellé d'heure au bord du canvas (pas de marge gauche native) -> coupé. On masque proprement
     le coin bas-gauche de l'axe du temps (couleur de la carte). Desktop large : pas de masque. */
  .chart-wrap::after { content: ""; position: absolute; left: 0; bottom: 0; width: 30px; height: 20px;
    background: var(--card); pointer-events: none; z-index: 4; }
}
.bot-card { padding: 0; overflow: visible; }
.bot-card > summary { list-style: none; cursor: pointer; padding: 16px 18px; border-radius: var(--radius); }
.bot-card > summary::-webkit-details-marker { display: none; }
.bot-card[open] > summary { border-radius: var(--radius) var(--radius) 0 0; }
.bot-card .head-row { display: flex; align-items: center; gap: 10px; }
.bot-card .dot { width: 11px; height: 11px; flex: none; }
.bot-card .bot-name { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
/* lot 9 pt 4 : solde + P&L jour + P&L latent sur la MÊME ligne, centrés verticalement
   (align-items: center) — le gros montant et les deux blocs libellé+valeur alignés au milieu. */
.bot-card .head-fin { margin-left: auto; display: flex; align-items: center; gap: 14px; text-align: right; }
/* lot 2b : wrapper des deux P&L. Desktop = TRANSPARENT (display:contents) -> disposition
   inchangée (equity + P&L jour + P&L latent sur la même ligne, comme avant). */
.bot-card .head-fin .pnl-stack { display: contents; }
/* lot 6 A : solde en GROS, sans libellé (le reste aligné sur sa ligne de base). */
.bot-card .head-fin .equity { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1;
  white-space: nowrap; }   /* lot 8 : jamais de retour à la ligne dans le montant */
.bot-card .head-fin .equity .cur { font-size: 14px; margin-left: 3px; color: var(--text-3); font-weight: 600; }
.bot-card .head-fin .pnl-day { font-size: 14px; }
.bot-card .head-fin .pnl-day .lbl { font-size: 10.5px; }
.bot-card .pos-mini { font-size: 12.5px; color: var(--text-3); white-space: nowrap;
  padding-left: 12px; border-left: 0.5px solid var(--separator); }
.bot-card .chev { font-size: 22px; color: var(--text-4); transition: transform .15s; flex: none; }
.bot-card[open] > summary .chev { transform: rotate(90deg); }
.bot-card .algo-alert { margin: 10px 0 0; }

/* popover « i » */
.info-wrap { position: relative; flex: none; display: inline-flex; }
.info-btn { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--separator);
  background: transparent; color: var(--text-3); cursor: pointer; font-family: Georgia, serif;
  font-style: italic; font-weight: 700; font-size: 13px; line-height: 1; }
.info-btn:hover { background: var(--fill); color: var(--text); }
.info-pop-panel { position: absolute; left: 0; top: 30px; z-index: 30; width: 280px; cursor: default;
  background: var(--bg-elevated); border: 0.5px solid var(--separator); border-radius: 12px;
  box-shadow: var(--shadow); padding: 12px 14px; text-align: left; white-space: normal; }
.info-pop-panel .ip-status { display: block; font-weight: 600; margin-bottom: 8px; }
.info-pop-panel .ip-status.ok { color: var(--green); } .info-pop-panel .ip-status.warn { color: var(--orange); }
.info-pop-panel .ip-status.bad { color: var(--red); }
.info-pop-panel .ip-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 16px; font-size: 12.5px; }
.info-pop-panel .ip-grid span { color: var(--text-3); }
.info-pop-panel .ip-grid b { text-align: right; font-variant-numeric: tabular-nums; }
.info-pop-panel .ip-reglages { display: block; margin-top: 10px; padding-top: 8px;
  border-top: 0.5px solid var(--separator); font-size: 12.5px; }

/* corps déplié + sous-blocs */
.bot-card-body { padding: 6px 18px 16px; }
/* lot 3 pt 7 : séparation par l'espacement, plus de traits gris */
.bot-card-body .sub { margin-top: 10px; }
.bot-card-body .sub:first-child { margin-top: 0; }
.bot-card-body .sub > summary { list-style: none; cursor: pointer; display: flex; align-items: center;
  gap: 10px; padding: 12px 2px; }
.bot-card-body .sub > summary::-webkit-details-marker { display: none; }
.bot-card-body .sub > summary::before { content: ""; width: .72em; height: .72em; display: inline-block; vertical-align: -0.06em; background-color: currentColor; -webkit-mask: var(--chev) no-repeat center / contain; mask: var(--chev) no-repeat center / contain; color: var(--text-4); flex: none;
  display: inline-block; transition: transform .15s; }
.bot-card-body .sub[open] > summary::before { transform: rotate(90deg); }
.bot-card-body .sub .grp-meta { flex: 1; color: var(--text-3); font-size: 12.5px; }
@media (min-width: 1024px) { .bot-card-body .chart-card-full .chart-wrap { height: 460px; } }

/* ---- lot 7 : contrôles refondus ---- */
.status-line-item { padding: 8px 10px; margin: 6px 0; border-radius: 10px; font-size: 13px; font-weight: 500;
  background: color-mix(in srgb, var(--orange) 12%, transparent); color: var(--orange); }
.status-line-item.neutral { background: var(--fill); color: var(--text-2); }

.sens-buttons { display: flex; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.sens-buttons form { margin: 0; display: flex; }
/* lot 27 (b) : chaque sens = gros bouton Achats/Ventes + bouton BOOST compact à côté. */
.sens-pair { flex: 1 1 200px; display: flex; gap: 6px; }
.sens-pair form:first-child { flex: 1; }
.sens-pair form:last-child { flex: 0 0 auto; }
.sens-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; border-radius: 14px; border: none; cursor: pointer; font-size: 16px; font-weight: 700;
  font-family: inherit; padding: 8px 12px; }
.sens-btn .sb-ico { font-size: 15px; }
.sens-btn.on { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.sens-btn.off { background: var(--fill); color: var(--text-3); }
.sens-btn .pending-tag { font-weight: 500; }
/* lot 27 (b) : bouton BOOST par sens — JAUNE si activé, gris sinon. */
.boost-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 52px; border-radius: 14px; border: none; cursor: pointer; font-size: 14px; font-weight: 700;
  font-family: inherit; padding: 8px 12px; white-space: nowrap; }
.boost-btn .ic { width: 1.05em; height: 1.05em; }
/* niveau 1 = JAUNE, niveau 2 = ORANGE (plus fort), off = gris. Jamais de rouge (demande Manu). */
.boost-btn.on { background: color-mix(in srgb, var(--yellow) 24%, transparent); color: var(--yellow); }
.boost-btn.on.lvl2 { background: color-mix(in srgb, var(--orange) 26%, transparent); color: var(--orange);
  font-weight: 700; }
.boost-btn.off { background: var(--fill); color: var(--text-3); }
/* lot 5 : triangle ⚠ discret (voulu BDD ≠ appliqué bot), coin haut-droit du bouton BOOST. */
.boost-btn { position: relative; }
.boost-warn { position: absolute; top: -5px; right: -5px; display: inline-flex; color: var(--orange);
  background: var(--card); border-radius: 50%; padding: 1px; line-height: 0; }
.boost-warn .ic { width: 13px; height: 13px; }

.ak-block { border-top: 0.5px solid var(--separator); padding: 10px 0 4px; }
.ak-head { display: flex; align-items: center; gap: 10px; }
.ak-head .ctrl-label { font-size: 16px; font-weight: 500; flex: none; }
.ak-head .ctrl-switch { margin-left: auto; }
.ak-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }

.archives-compact { border-top: 0.5px solid var(--separator); padding-top: 6px; }
.arch-line { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 0; }
.arch-line .arch-lbl { flex: 1; font-size: 13px; color: var(--text-2); }
.switch.small { width: 40px; height: 24px; }
.switch.small .thumb { width: 20px; height: 20px; }
.switch.small input:checked + .track .thumb { transform: translateX(16px); }
.switch.small input:checked + .track { background: var(--orange); }

/* ---- lot 7 : boutons d'action par série (façon V1) ---- */
.series-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.series-actions .sa { margin: 0; }
.sa-btn { border: 1px solid var(--separator); background: var(--card); color: var(--text-2); cursor: pointer;
  border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; font-family: inherit; }
.sa-btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--separator)); }
/* Action envoyée (CUT/ARCHIVER/RÉINTÉGRER…) : bouton désactivé le temps du retour SSE. */
.sa-btn[disabled] { opacity: 0.6; cursor: default; }
/* petit état « enregistrement… » d'un toggle (ex. BE) pendant la requête. */
.sa-btn.saving { opacity: 0.6; }
/* BE (break-even) actif : couleur accent + prix BE affiché à côté du libellé. */
.sa-btn.be-btn.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--separator)); }
.sa-btn.toggle.on { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green);
  border-color: color-mix(in srgb, var(--green) 40%, var(--separator)); }

@media (max-width: 640px) {
  /* lot 8 : l'en-tête 2 lignes est géré par la CONTAINER QUERY ci-dessus (largeur de carte). */
  .bot-card .pos-mini { display: none; }   /* mobile : trop étroit, résumé positions masqué */
  .info-pop-panel { width: 250px; }
  .series-actions { gap: 5px; }
  .sa-btn { flex: 1; min-width: 60px; padding: 8px 6px; }   /* V1 : boutons sous l'en-tête sur mobile */
}

/* ------------------------------------------------------ segmented control */
.segmented { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 2px; gap: 2px; }
.segmented button { min-height: 34px; padding: 6px 14px; border-radius: 8px; border: none;
  background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.segmented button.on { background: var(--bg-elevated); box-shadow: var(--shadow); }
.segmented button.on.bull { color: var(--green); }
.segmented button.on.bear { color: var(--red); }

/* stepper */
.stepper { display: inline-flex; align-items: center; gap: 0; }
.stepper button { width: 40px; height: 36px; border: none; background: var(--fill); font-size: 20px;
  color: var(--accent); cursor: pointer; }
.stepper button:first-child { border-radius: 10px 0 0 10px; }
.stepper button:last-child { border-radius: 0 10px 10px 0; }
.stepper .val { min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }

/* séries */
.serie { border-top: 0.5px solid var(--separator); padding: 12px 0; }
.serie:first-child { border-top: none; }
.serie .head { display: flex; align-items: baseline; justify-content: space-between; }
.serie .meta { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.pending-note { color: var(--orange); font-size: 12.5px; margin-top: 6px; }

/* --------------------------------------------------------- bandeau session */
.session-banner {
  position: fixed; left: 0; right: 0; top: 0; z-index: 300;
  padding: calc(10px + var(--safe-t)) 16px 10px; text-align: center;
  background: var(--orange); color: #1c1c1e; font-weight: 600; font-size: 15px;
}
.session-banner a { color: #1c1c1e; text-decoration: underline; }

/* ------------------------------------------- carte compte (nouveau layout) */
.acct-top { display: block; }
.acct-right { margin-top: 14px; }
@media (min-width: 900px) {
  .acct-top { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
  .acct-right { margin-top: 0; }
}
.pos-groups { margin-top: 8px; }

/* groupes de positions & news : en-têtes repliables */
/* Conteneurs STABLES (anti-doublon du bloc trades lors du morph SSE) : transparents au
   layout -> les groupes/news se comportent comme des enfants directs de .bot-card-body. */
.pos-groups-wrap, .news-card-wrap { display: contents; }
.pos-group, .news-box { margin-top: 8px; }   /* lot 3 pt 7 : espacement, pas de trait */
.pos-group > summary, .news-box > summary { list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px; padding: 11px 2px; }
.pos-group > summary::-webkit-details-marker, .news-box > summary::-webkit-details-marker { display: none; }
.pos-group > summary::before, .news-box > summary::before { content: ""; width: .72em; height: .72em; display: inline-block; vertical-align: -0.06em; background-color: currentColor; -webkit-mask: var(--chev) no-repeat center / contain; mask: var(--chev) no-repeat center / contain; color: var(--text-4); transition: transform .15s; }
.pos-group[open] > summary::before, .news-box[open] > summary::before { transform: rotate(90deg); }
.grp-head .grp-name { font-weight: 700; }
.grp-head .grp-name.ok { color: var(--green); } .grp-head .grp-name.bad { color: var(--red); }
.grp-head .grp-meta { flex: 1; font-size: 12.5px; }
.grp-head .grp-pnl { font-weight: 600; font-variant-numeric: tabular-nums; }
/* Archives : en-tête de total + séries archivées (légèrement en retrait, teinte neutre) */
.arch-total { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 6px 2px;
  border-top: 1px solid var(--fill); font-size: 12.5px; }
.arch-total .grp-meta { flex: 1; }
.arch-total .grp-pnl { font-weight: 600; font-variant-numeric: tabular-nums; }
.pos-group.archived > summary { opacity: 0.92; }
.pos-group.archived .grp-name { font-weight: 600; }

/* news card */
.news-list .news-row.past { opacity: 0.5; }
.news-list .news-row.next { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 8px; }
.news-list .news-time { font-variant-numeric: tabular-nums; font-weight: 600; margin-right: 6px; }
.news-countdown { color: var(--accent); }

/* --------------------------------------------------- positions repliables */
.positions-box { border-top: 0.5px solid var(--separator); padding-top: 6px; }
.acct-col-b .positions-box { border-top: none; padding-top: 0; }
.positions-box > summary { list-style: none; cursor: pointer; display: flex; align-items: center;
  gap: 12px; padding: 10px 2px; font-size: 15px; }
.positions-box > summary::-webkit-details-marker { display: none; }
.positions-box > summary::before { content: ""; width: .72em; height: .72em; display: inline-block; vertical-align: -0.06em; background-color: currentColor; -webkit-mask: var(--chev) no-repeat center / contain; mask: var(--chev) no-repeat center / contain; color: var(--text-4); transition: transform .15s; }
.positions-box[open] > summary::before { transform: rotate(90deg); }
.pos-summary .ps-title { font-weight: 600; }
.pos-summary .ps-meta { flex: 1; font-size: 13px; }
.pos-summary .ps-pnl { font-weight: 600; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- graphique */
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.chart-title { font-size: 16px; font-weight: 700; }
.chart-tools { display: inline-flex; align-items: center; gap: 8px; }
.tf-select { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; }
.tf-select button { min-height: 30px; padding: 5px 11px; border: none; background: transparent;
  color: var(--text-3); font: inherit; font-size: 13px; font-weight: 600; border-radius: 7px; cursor: pointer; }
.tf-select button.on { background: var(--bg-elevated); color: var(--accent); box-shadow: var(--shadow); }
.ma-toggle.on { background: var(--accent); color: var(--accent-ink); }
.chart-wrap { position: relative; width: 100%; height: 360px; }
.chart-wrap.compact { height: 280px; }
.js-mt5-chart { position: absolute; inset: 0; }
.chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 14px; text-align: center; padding: 20px; pointer-events: none; }
/* lot 23 : aucune bougie disponible (marché fermé / EA non connecté) -> pas de grand cadre vide.
   Le wrap se réduit à la hauteur du message ; contrôles et masque de coin masqués.
   Sélecteur à 3 classes pour l'emporter sur la hauteur desktop (.chart-card-full .chart-wrap). */
.chart-card-full .chart-wrap.is-empty, .chart-wrap.is-empty { height: auto; min-height: 0; }
.chart-wrap.is-empty .js-mt5-chart { display: none; }
.chart-wrap.is-empty .chart-empty { position: static; inset: auto; padding: 26px 16px; }
.chart-wrap.is-empty .chart-gear, .chart-wrap.is-empty .chart-ctrls,
.chart-wrap.is-empty::after { display: none; }
.chart-tooltip { position: absolute; z-index: 5; display: none; pointer-events: none;
  background: var(--bg-elevated); border: 0.5px solid var(--separator); border-radius: 8px;
  box-shadow: var(--shadow); padding: 7px 10px; font-size: 12px; line-height: 1.35; max-width: 200px; }
.chart-tooltip .tip-sep { border: none; border-top: 0.5px solid var(--separator); margin: 5px 0; }
.chart-live-btn { position: absolute; z-index: 6; right: 58px; bottom: 34px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: none; border-radius: 999px;
  padding: 5px 11px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow); }
.chart-live-btn[hidden] { display: none; }
/* lot 4 : compte à rebours sous l'étiquette de prix (façon TradingView). Couleur de fond =
   couleur de l'étiquette (posée par le JS) ; texte blanc, police un peu plus petite ; largeur
   = largeur de l'axe des prix (posée par le JS) ; position Y suit l'étiquette. */
.chart-countdown { position: absolute; right: 0; z-index: 5; box-sizing: border-box; text-align: center;
  color: #fff; font-size: 10px; line-height: 14px; height: 14px; width: 58px; font-variant-numeric: tabular-nums;
  border-radius: 0 0 3px 3px; pointer-events: none; letter-spacing: .02em; }
/* lot 3 (b) : mention discrète du fuseau dans un coin du graphique.
   lot JB : déplacée en HAUT-GAUCHE (hors de la rangée de l'axe du temps) — en bas-droite elle
   chevauchait les étiquettes d'heure (« 16:15 Paris » collés), surtout sur mobile 390 px.
   corr. #204 : la rangée top-gauche (bouton ⚙ repli + barre d'outils) RECOUVRAIT le badge
   (« New York » tronqué en « York »). Sur mobile la barre passe sur 2 lignes et occupe tout le
   haut : AUCUNE position haute n'est sûre. On ancre donc le badge en BAS-GAUCHE, juste au-dessus
   de la rangée de l'axe du temps (hors axe) et loin du bouton « maintenant » (bas-droite) :
   entièrement lisible, zéro chevauchement de bouton, barre dépliée ou repliée, bureau ET mobile. */
.chart-tz { position: absolute; bottom: 26px; left: 6px; z-index: 5; font-size: 10px; line-height: 1;
  color: var(--text-3); background: color-mix(in srgb, var(--card) 70%, transparent);
  padding: 2px 5px; border-radius: 5px; pointer-events: none; letter-spacing: .02em; }
/* lot 25 : badge discret « live en pause » (flux de prix interrompu, reprise auto) */
.chart-stale { position: absolute; z-index: 6; left: 50%; top: 10px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 5px; background: var(--fill); color: var(--text-3);
  border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; pointer-events: none; }
.chart-stale[hidden] { display: none; }
.chart-stale .ic { width: 1em; height: 1em; }
.chart-collapse { border-top: 0.5px solid var(--separator); margin-top: 8px; }
.chart-collapse > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 2px; }
.chart-collapse > summary::-webkit-details-marker { display: none; }
.chart-collapse > summary::before { content: ""; width: .72em; height: .72em; display: inline-block; vertical-align: -0.06em; background-color: currentColor; -webkit-mask: var(--chev) no-repeat center / contain; mask: var(--chev) no-repeat center / contain; color: var(--text-4); transition: transform .15s; }
.chart-collapse[open] > summary::before { transform: rotate(90deg); }
@media (min-width: 1024px) {
  .chart-card-full .chart-wrap { height: 560px; }   /* fiche bot : plus haut sur desktop */
}

/* =================================================================== DESKTOP */
/* Base (mobile-first) : visibilité, notes, tableaux triables */
.only-desktop { display: none; }
.reglages-note { font-size: 12px; color: var(--text-3); }
.col-title { font-size: 15px; font-weight: 700; margin: 14px 0 8px; }
.acct-col-b .col-title:first-child { margin-top: 18px; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort].sorted-asc::after { content: " ↑"; }
th[data-sort].sorted-desc::after { content: " ↓"; }
table.compact th, table.compact td { padding: 8px 10px; }
.dash-aside .grouped .sect-title { margin-top: 0; }

@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .only-desktop { display: block; }
  .only-mobile { display: none; }
  /* lot 8 : minmax(0, 1fr) sur la PISTE + min-width:0 sur l'ITEM (le wrapper contenu) -> la
     colonne contenu peut rétrécir sous la largeur « min-content » de ses enfants (graphe/canvas),
     sinon elle débordait (surtout vers 768 px). (min-width:auto par défaut des items grid.) */
  /* lot 14 : plus de sidebar -> app pleine largeur ; la topbar (avec le menu « ··· »)
     reste visible sur desktop aussi. */
  .app { min-height: 100vh; }
  .content { padding: 20px 40px; max-width: 1000px; }
  .cards-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cards-grid .card { margin-bottom: 0; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dash-layout { display: block; }
}

/* Colonne latérale positions : tableau à hauteur bornée + en-têtes collants */
@media (min-width: 1024px) {
  .acct-col-b { min-width: 0; }
  .acct-col-b .table-wrap { max-height: 540px; overflow: auto; }
  table.compact thead th { position: sticky; top: 0; z-index: 1; }
}

/* Carte compte en 2 colonnes UNIQUEMENT quand la largeur le permet :
   - 1024–1279 : pas d'aside -> 2 colonnes ;
   - >=1600    : aside + 2 colonnes tiennent confortablement.
   Entre 1280 et 1599 (aside présent) : carte pleine largeur, positions dessous. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .acct-card { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: 28px; align-items: start; }
}
@media (min-width: 1600px) {
  .acct-card { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 32px; align-items: start; }
}

/* Layout accueil : contenu principal + colonne latérale (news / événements) */
@media (min-width: 1280px) {
  .content { max-width: 1440px; }
  .dash-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
  .metrics { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1920px) {
  .content { max-width: 1720px; }
  .dash-layout { grid-template-columns: 1fr 400px; }
}

/* Densité pointeur (souris) : cibles un peu plus compactes qu'en tactile */
@media (min-width: 1024px) and (pointer: fine) {
  .btn.small { min-height: 32px; padding: 6px 12px; }
  .row { min-height: 40px; }
  table.compact th, table.compact td { padding: 6px 10px; font-size: 14px; }
}

/* ---- Roue crantée + pastille Auto-Kill (lot UI) ---- */
.gear-btn { background: var(--fill); color: var(--text-2, var(--text-3)); border: 0; border-radius: 999px;
  width: 30px; height: 30px; line-height: 1; font-size: 15px; cursor: pointer; margin-left: 6px; flex: none; }
.gear-btn:active { transform: scale(0.94); }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px;
  padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer; background: var(--fill); color: var(--text-3); }
.pill-btn.on { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.pill-btn.off { background: var(--fill); color: var(--text-3); }
.pill-btn:active { transform: scale(0.98); }
.ak-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.ak-row .ak-trend { margin-left: auto; }
@media (max-width: 640px) { .ak-row .ak-trend { margin-left: 0; width: 100%; } }

/* ---- Overlay RÉGLAGES (modale bureau / feuille mobile) ---- */
body.modal-open { overflow: hidden; }
.settings-overlay[hidden] { display: none; }
.settings-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.settings-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.settings-modal { position: relative; z-index: 1; width: min(720px, 94vw); max-height: 88vh; overflow: auto;
  background: var(--bg-elevated); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.sm-head { position: sticky; top: 0; display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  background: var(--bg-elevated); border-bottom: 0.5px solid var(--separator); z-index: 2; }
.sm-title { font-size: 17px; font-weight: 700; margin: 0; }
.sm-cur { color: var(--accent); }
.sm-close { margin-left: auto; background: var(--fill); border: 0; border-radius: 999px; width: 34px; height: 34px;
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-2, var(--text-3)); }
.sm-body { padding: 14px 16px 24px; }
.sm-section { margin-bottom: 22px; }
.sm-devises { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-content .sect-sub { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); margin: 10px 0 4px; }
.sm-loading { padding: 40px; text-align: center; color: var(--text-3); }
@media (max-width: 700px) {
  .settings-overlay { align-items: flex-end; }
  .settings-modal { width: 100vw; max-height: 92vh; border-radius: 16px 16px 0 0; animation: sm-up .22s ease; }
}
@keyframes sm-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* -------- Bulles d'aide (pt 2) : phrase simple au-dessus du bouton, insensible au morph SSE */
.help-bubble {
  position: fixed; z-index: 1200; max-width: 240px;
  background: #1f2430; color: #f1f3f8; font-size: 12.5px; line-height: 1.35;
  padding: 8px 10px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.35);
  pointer-events: none; animation: help-in .12s ease;
}
@media (prefers-color-scheme: light) { .help-bubble { background: #2a2e39; } }
@keyframes help-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

/* ↺ réinitialiser l'affichage du graphique (pt 4) */
.chart-reset { line-height: 1; }

/* -------- Menu « ··· » de la modale réglages + panneaux Journal (pt 5bis) */
.sm-head { position: relative; }
.sm-menu { position: relative; }
.sm-menu > summary { list-style: none; cursor: pointer; }
.sm-menu > summary::-webkit-details-marker { display: none; }
.sm-menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; font-size: 20px; line-height: 1;
  color: var(--muted, #6b7280); user-select: none;
}
.sm-menu-btn:hover { background: rgba(120,120,128,.12); }
.sm-menu-pop {
  position: absolute; right: 0; top: 36px; z-index: 20; min-width: 180px;
  background: var(--card, #fff); border: 1px solid rgba(120,120,128,.25);
  border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 6px;
}
.sm-menu-item {
  display: block; width: 100%; text-align: left; padding: 9px 12px;
  border-radius: 7px; background: none; border: 0; font-size: 14px; cursor: pointer;
}
.sm-menu-item:hover { background: rgba(120,120,128,.12); }
.sm-back {
  background: none; border: 0; cursor: pointer; font-size: 14px; padding: 4px 8px;
  color: var(--accent, #2563eb); border-radius: 7px;
}
.sm-back:hover { background: rgba(120,120,128,.12); }

.journal-list { list-style: none; margin: 0; padding: 0; }
.journal-row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(120,120,128,.12); font-size: 13px; }
.journal-row:last-child { border-bottom: 0; }
.jr-ts { flex: 0 0 auto; color: var(--muted, #6b7280); font-variant-numeric: tabular-nums; min-width: 72px; }
.jr-main { display: flex; flex-direction: column; min-width: 0; }
.jr-title { font-weight: 500; overflow-wrap: anywhere; }
.jr-meta { color: var(--muted, #6b7280); font-size: 12px; overflow-wrap: anywhere; }

/* ===== Lot 3 : interface épurée ===== */
/* pt 8 : barre de contrôles translucide DANS le graphique (coin haut gauche) */
/* lot 8 pt 4 : petite flèche discrète (coin haut gauche) qui replie/déplie la barre de réglages.
   Fermée = « › », ouverte = pivotée vers le bas (⌄). */
.chart-gear { position: absolute; top: 8px; left: 8px; z-index: 6; width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 7px;
  cursor: pointer; font-size: 17px; line-height: 1; font-weight: 700;
  background: color-mix(in srgb, var(--card) 55%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--text-3); transition: transform .15s ease, color .15s ease; }
.chart-gear.on { color: var(--accent); transform: rotate(90deg); }
.chart-ctrls { position: absolute; top: 8px; left: 46px; z-index: 5; display: inline-flex;
  align-items: center; gap: 6px; padding: 4px; border-radius: 10px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 5px rgba(0,0,0,.12); max-width: calc(100% - 54px); flex-wrap: wrap; }
.chart-ctrls.collapsed { display: none; }
.chart-ctrls .tf-select { background: transparent; padding: 0; }
.chart-ctrls .tf-select button { min-height: 26px; padding: 3px 8px; font-size: 12px; }
.chart-ctrls .ma-toggle, .chart-ctrls .chart-reset, .chart-ctrls .chart-zoom, .ov-select button {
  min-height: 26px; padding: 3px 9px; border: 0; border-radius: 7px; cursor: pointer;
  background: var(--fill); color: var(--text-2, var(--text-3)); font: inherit; font-size: 12px; font-weight: 600; }
.chart-ctrls .ma-toggle.on { background: var(--accent); color: var(--accent-ink); }
.chart-ctrls .chart-reset, .chart-ctrls .chart-zoom { line-height: 1; font-size: 15px; display: inline-flex; align-items: center; }
.chart-ctrls .chart-zoom { padding: 3px 7px; }
/* lot 15 : la zone des bougies laisse la PAGE défiler verticalement au doigt (iPhone).
   Les gestes de zoom/pan tactiles sur les bougies sont désactivés côté lib ; seuls les
   taps (double-tap axe prix = auto) et le glissé sur un AXE restent. */
.chart-wrap, .js-mt5-chart, .js-mt5-chart canvas, .js-mt5-chart table { touch-action: pan-y !important; }
/* lot 7 pt 1 : boutons Old / Trades / Ordres */
.ov-select { display: inline-flex; gap: 2px; }
.ov-select button.on { background: var(--accent); color: var(--accent-ink); }

/* pt 6 : roue crantée en haut à droite — cible tactile >=44px, icône ~20px */
.gear-btn { display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-width: 44px; margin: -10px -8px -10px 2px; padding: 0;
  background: transparent; color: var(--text-3); border: 0; border-radius: 999px; cursor: pointer; }
.gear-btn:hover { background: var(--fill); color: var(--text); }
.gear-btn:active { transform: scale(0.94); }
.gear-btn svg { display: block; }
/* lot 4 : sous-blocs Graphique/Contrôles toujours visibles (plus de repli -> plus de chevron) */

/* pt 9 : bouton « Tendance » unique + menu (fond translucide, couleur pleine icône/texte) */
.trend-wrap { position: relative; display: inline-block; }
.trend-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 13px;
  border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600; font-size: 13px; }
.trend-btn .trend-ico { display: inline-flex; font-size: 15px; line-height: 1; }
.trend-btn.trend-bull { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.trend-btn.trend-bear { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.trend-btn.trend-both { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.trend-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 184px;
  background: var(--card); border: 1px solid rgba(120,120,128,.25); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 6px; }
.trend-menu form { margin: 0; }
.trend-opt { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0;
  background: none; cursor: pointer; padding: 9px 12px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; }
.trend-opt .trend-ico { display: inline-flex; width: 16px; justify-content: center; }
.trend-opt:hover { background: rgba(120,120,128,.14); }
.trend-opt.trend-bull { color: var(--green); } .trend-opt.trend-bear { color: var(--red); } .trend-opt.trend-both { color: var(--accent); }

/* lot 5 pt 1 : indicateur discret d'enregistrement automatique par champ */
.save-status { font-size: 11px; margin-left: 8px; color: var(--text-3); min-width: 14px; display: inline-block; vertical-align: middle; }
.save-status.saving { color: var(--text-3); }
.save-status.ok { color: var(--green); }
.save-status.err { color: var(--red); }

/* lot 6 A : couleurs du P&L latent selon la perte autorisée consommée */
.lat-pos { color: var(--green); font-weight: 600; }
.lat-neg { color: var(--red); font-weight: 600; }
.lat-warn { color: var(--orange); font-weight: 600; }
.lat-neutral { color: var(--text-2); font-weight: 600; }
.head-fin .pnl-day { white-space: nowrap; }
/* lot 6 A / lot 23 : verrou sécurité du jour (locked) — bandeau pleine largeur SOUS les P&L
   (plus dans head-fin) ; wrap autorisé -> tient toujours dans la carte (mobile 390 inclus). */
.sl-locked { margin-top: 6px; display: flex; align-items: center; gap: 6px;
  color: var(--red); font-weight: 700; font-size: 12.5px; line-height: 1.3; }
.sl-locked .ic { flex: none; }
/* lot 7 : statut marché (reprise <jour> HH:MM / jour férié) */
/* lot 29 : ligne compacte solde/équité/marge libre en temps réel (push EA). */
.acct-live { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.acct-live b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.market-status { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.market-status.warn { color: var(--orange); font-weight: 600; }
/* Redémarrage MT5 auto (identifiants) : bannière d'état sur la carte. */
.mt5-restart { margin-top: 6px; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.mt5-restart.warn { color: var(--orange); }
.mt5-restart.ok { color: var(--green); }
.mt5-restart.bad { color: var(--red); }
.mt5-restart .ic { flex: none; width: 1em; height: 1em; vertical-align: -0.12em; }
/* lot 9 : zone tampon (ouvertures suspendues) + sécurités EA */
.zone-tampon { margin-top: 4px; font-size: 12px; color: var(--orange); font-weight: 600; }
.ea-block { margin-top: 6px; font-size: 13px; font-weight: 600; display: flex; align-items: center;
  gap: 10px; flex-wrap: wrap; }
.ea-block.lat-warn { color: var(--orange); }
.ea-block.lat-neg { color: var(--red); }
.ea-unblock-form { margin: 0; }
.ea-unblock-btn { border: 0; border-radius: 7px; padding: 5px 12px; cursor: pointer; font: inherit;
  font-size: 12px; font-weight: 700; background: var(--red); color: #fff; }
.ea-unblock-btn:active { transform: scale(0.96); }

/* ============================================ lot 10 : icônes Lucide (SVG inline) */
/* Taille/alignement par défaut d'une icône inline dans un bouton/texte : suit la police,
   centrée verticalement, jamais de fond ni de carré. */
.ic { width: 1.05em; height: 1.05em; display: inline-block; vertical-align: -0.16em; flex: none; }
/* icônes au sein d'un libellé bouton : léger espace géré par le gap/espace existant */
.sb-ico { display: inline-flex; align-items: center; }
.sb-ico .ic { width: 1.1em; height: 1.1em; vertical-align: middle; }
.sens-btn, .pill-btn, .trend-btn, .trend-opt, .sa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.trend-ico { display: inline-flex; align-items: center; }
.trend-ico .ic { width: 15px; height: 15px; }
/* roue réglages compte : icône ~20px, pas de fond carré */
.gear-btn .ic { width: 20px; height: 20px; }
/* flèche de repli de la barre graphe (chevron) + bouton recentrer */
.chart-gear .ic { width: 18px; height: 18px; vertical-align: middle; }
.chart-reset .ic { width: 15px; height: 15px; vertical-align: middle; }
/* chevron d'en-tête de carte (déplier la carte) */
.bot-card .chev { display: inline-flex; align-items: center; }
.bot-card .chev .ic { width: 20px; height: 20px; }
/* marque (logo) */
.brand .ic { width: 22px; height: 22px; vertical-align: -0.18em; }
.sidebar .brand .ic { width: 26px; height: 26px; }
/* grands logos pages d'auth */
.auth .logo .ic { width: 46px; height: 46px; }
/* icône dans les bandeaux statut (marché, news, alerte, zone tampon, EA) + états */
.market-status .ic, .status-line-item .ic, .algo-alert .ic, .zone-tampon .ic, .ea-block .ic, .sl-locked .ic { width: 1em; height: 1em; vertical-align: -0.12em; }
/* carte vide (gros inbox) */
.empty .big .ic { width: 40px; height: 40px; }
/* indicateur d'enregistrement ✓ */
.save-status .ic { width: 1em; height: 1em; vertical-align: -0.12em; color: var(--green); }

/* lot 11 : alerte sobre de divergence (base source de vérité ≠ appliqué par le bot) */
.sv-diverge { margin-top: 5px; font-size: 12px; color: var(--orange); display: flex; align-items: center; gap: 6px; }
.sv-diverge .ic { width: 1em; height: 1em; vertical-align: -0.12em; flex: none; }

/* lot 11 : récap des divergences en haut de carte (sobre, orange tamisé) */
.sv-recap { margin-top: 6px; font-size: 12px; color: var(--orange); display: flex; align-items: center; gap: 6px; line-height: 1.3; }
.sv-recap .ic { width: 1em; height: 1em; vertical-align: -0.12em; flex: none; }

/* lot 12 : écran de rattachement bots ↔ utilisateurs (épuré) */
.acces-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acces-role { display: inline-flex; align-items: center; gap: 4px; }
.acces-role select, .acces-add select { min-height: 36px; border-radius: 10px; border: 1px solid var(--separator); background: var(--card); color: var(--text); padding: 4px 8px; font-size: 14px; }
.acces-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acces-add select { flex: 1 1 auto; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }

/* lot 13 : panneau historique des trades (dans l'overlay réglages) */
.tr-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tr-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.tr-range label { font-size: 13px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.tr-range input[type=date] { min-height: 34px; border-radius: 10px; border: 1px solid var(--separator); background: var(--card); color: var(--text); padding: 2px 8px; font-size: 14px; }
.tr-total { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-top: 0.5px solid var(--separator); border-bottom: 0.5px solid var(--separator); font-weight: 600; font-variant-numeric: tabular-nums; }
.tr-list { margin-top: 8px; }
.tr-row { display: grid; grid-template-columns: 1.1fr 0.7fr 0.6fr 1.6fr 0.7fr 1fr; gap: 6px; align-items: center; padding: 7px 0; border-top: 0.5px solid var(--separator); font-size: 13px; font-variant-numeric: tabular-nums; }
.tr-row.tr-head { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.02em; border-top: none; }
.tr-row .tr-pnl { text-align: right; font-weight: 600; }
.tr-row .tr-px { color: var(--text-2); }
.tr-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
@media (max-width: 480px) {
  .tr-row { grid-template-columns: 1fr 0.6fr 0.9fr; grid-auto-flow: row; }
  .tr-row > span:nth-child(4), .tr-row.tr-head > span:nth-child(4) { display: none; }  /* prix masqués en très étroit */
  .tr-row > span:nth-child(5), .tr-row.tr-head > span:nth-child(5) { display: none; }  /* durée masquée */
}

/* lot 14 : menu global « ··· » (haut-gauche), remplace sidebar/tabbar/Plus */
.gmenu { position: relative; }
.gmenu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; width: 40px; height: 40px; border-radius: 10px; color: var(--text); }
.gmenu > summary::-webkit-details-marker { display: none; }
.gmenu > summary:hover { background: var(--fill); }
.gmenu > summary .ic { width: 24px; height: 24px; }
.gmenu-pop { position: absolute; left: 8px; top: 48px; z-index: 60; min-width: 240px;
  background: var(--bg-elevated); border: 0.5px solid var(--separator); border-radius: 14px;
  box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.gmenu-head { font-size: 12px; color: var(--text-3); padding: 8px 10px 4px; }
.gmenu-sep { height: 0.5px; background: var(--separator); margin: 6px 4px; }
.gmenu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 10px; border-radius: 10px; font-size: 15px; color: var(--text); background: none;
  border: none; cursor: pointer; font-family: var(--font); min-height: 44px; }
.gmenu-item:hover { background: var(--fill); }
.gmenu-item .ic { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.gmenu-logout { color: var(--red); }
.gmenu-logout .ic { color: var(--red); }
.topbar .brand .ic { width: 22px; height: 22px; }

/* lot 14 : contrôles du bot dans la modale (ex-page Commandes) */
.sm-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-controls form { margin: 0; }
.sm-controls .btn.small { white-space: nowrap; }

/* lot 16 : historique des trades chargé EN LIGNE dans la carte (sous la ligne repliable) */
.tr-embed { padding: 6px 0 2px; }
.news-box .lazy-body { margin-top: 2px; }

/* lot 17 : compte coupé (comptes.actif=false) -> carte grisée + actions désactivées.
   La roue crantée (résumé) reste active pour rallumer via la modale. */
.bot-card.card-off .bot-name,
.bot-card.card-off .head-fin,
.bot-card.card-off .market-status,
.bot-card.card-off .sl-locked,
.bot-card.card-off .bot-card-body { opacity: .5; }
.bot-card.card-off .bot-card-body { pointer-events: none; }
.badge-off { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600;
  color: var(--text-3); background: var(--fill); border-radius: 999px; padding: 2px 8px; margin-left: 6px; }
.badge-off .ic { width: 1em; height: 1em; }

/* lot 18a : News à venir groupées par jour */
.news-day { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-3); padding: 10px 0 2px; }
.news-cur { font-weight: 600; color: var(--text-2); margin-right: 2px; }
.news-row.past { opacity: .45; }

/* lot 18b : bandeau « En attente du courtier » (compte actif, EA pas encore connecté) */
.waiting-banner { display: flex; align-items: center; gap: 6px; margin-top: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--orange); }
.waiting-banner .ic { width: 1em; height: 1em; }
