/* Wikibot — thème sombre, aligné sur les graphiques du bot */
:root {
  --bg: #121317; --bg2: #191b20; --bg3: #20232a; --line: #2c2f37; --line2: #383c46;
  --text: #e8eaee; --muted: #8d94a1; --dim: #6a707c;
  --gold: #f5c542; --green: #3ecf8e; --red: #f2555a; --blue: #5b8def; --violet: #a78bfa; --orange: #fb923c; --cyan: #38d6c9;
  --radius: 12px; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
code { background: var(--bg3); padding: 1px 6px; border-radius: 6px; font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; }
small, .small { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.pos { color: var(--green); } .neg { color: var(--red); } .gold { color: var(--gold); }
.num { font-variant-numeric: tabular-nums; }
.boot, .center { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.narrow { max-width: 460px; width: calc(100% - 32px); padding: 28px; }
.narrow h1 { margin-bottom: 12px; } .narrow p { color: var(--muted); }

/* Mise en page */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 700; font-size: 16px; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--gold); display: grid; place-items: center; color: #15161a; font-weight: 800; }
.nav-group { margin: 12px 8px 4px; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted); font-weight: 550; }
.nav a:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.nav a.on { background: rgba(245, 197, 66, .12); color: var(--gold); }
.nav a .ic { width: 20px; text-align: center; }
.side .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--line); margin-top: 10px; }
.me img { width: 34px; height: 34px; border-radius: 50%; }
.me .who { min-width: 0; flex: 1; } .me .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(18, 19, 23, .88); backdrop-filter: blur(10px); z-index: 20; }
.top .title { flex: 1; min-width: 0; } .top .title small { display: block; }
.top .bal { text-align: right; } .top .bal b { font-size: 16px; }
.burger { display: none; }
.content { padding: 22px 24px 60px; max-width: 1500px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card > h2, .card > h3 { margin-bottom: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.stat .v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* Boutons, champs */
.btn, button.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg3); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.success { background: var(--green); border-color: var(--green); color: #0d1f17; }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #15161a; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 9px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.on { border-color: var(--gold); color: var(--gold); background: rgba(245, 197, 66, .1); }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line2); border-radius: 9px; padding: 8px 10px; font: inherit; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 5px; font-weight: 600; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 5px 10px; border-radius: 7px; font: inherit; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--bg3); color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg3); color: var(--muted); }
.pill.g { background: rgba(62, 207, 142, .13); color: var(--green); } .pill.r { background: rgba(242, 85, 90, .13); color: var(--red); }
.pill.y { background: rgba(245, 197, 66, .13); color: var(--gold); } .pill.b { background: rgba(91, 141, 239, .15); color: var(--blue); }

/* Tableaux, listes */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--bg3); }
.tbl .r, .tbl th.r { text-align: right; }
.scroll { overflow-x: auto; }
.feed { display: flex; flex-direction: column; }
.feed .it { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.feed .it:last-child { border-bottom: 0; }
.feed .it .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--muted); }
.feed .it .b { flex: 1; min-width: 0; } .feed .it .t { color: var(--dim); font-size: 12px; white-space: nowrap; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.bar { height: 8px; border-radius: 999px; background: var(--bg3); overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.alert { border: 1px solid rgba(251, 146, 60, .45); background: rgba(251, 146, 60, .08); color: #ffd3ac; border-radius: var(--radius); padding: 12px 14px; }
.alert.red { border-color: rgba(242, 85, 90, .5); background: rgba(242, 85, 90, .08); color: #ffc2c4; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--gold); border-color: var(--gold); }
.chart { width: 100%; height: 300px; position: relative; }
.chart.tall { height: 520px; } .chart.short { height: 160px; }
.heat { display: grid; grid-template-columns: 36px repeat(24, 1fr); gap: 2px; font-size: 10px; color: var(--dim); }
.heat .c { aspect-ratio: 1; border-radius: 3px; background: var(--bg3); }

/* Graphique façon terminal de trading */
.tv { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tv-bar { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tv-bar .sep { width: 1px; height: 20px; background: var(--line); }
.tv-body { display: grid; grid-template-columns: 42px 1fr; }
.tv-tools { display: flex; flex-direction: column; gap: 4px; padding: 8px 5px; border-right: 1px solid var(--line); }
.tv-tools button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; display: grid; place-items: center; }
.tv-tools button:hover { background: var(--bg3); color: var(--text); } .tv-tools button.on { background: rgba(245, 197, 66, .14); color: var(--gold); border-color: rgba(245, 197, 66, .4); }
.tv-stage { position: relative; min-width: 0; }
.tv-stage canvas.draw { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.tv-stage canvas.draw.active { pointer-events: auto; cursor: crosshair; }
.tv-legend { position: absolute; left: 10px; top: 8px; z-index: 6; font-size: 12px; color: var(--muted); pointer-events: none; display: flex; gap: 10px; flex-wrap: wrap; max-width: calc(100% - 90px); }
.tv-legend b { color: var(--text); font-weight: 600; }
.tv-sub { border-top: 1px solid var(--line); position: relative; }
.menu { position: relative; }
.menu-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; background: var(--bg3); border: 1px solid var(--line2); border-radius: 10px; padding: 6px; min-width: 230px; box-shadow: var(--shadow); display: none; }
.menu.open .menu-pop { display: block; }
.menu-pop label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; margin: 0; color: var(--text); font-weight: 500; cursor: pointer; }
.menu-pop label:hover { background: var(--bg2); } .menu-pop input { width: auto; }

/* Tiroir des actions du bot */
.drawer-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 50; display: none; }
.drawer-bg.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 100vw); background: var(--bg2); border-left: 1px solid var(--line); z-index: 51; transform: translateX(100%); transition: transform .18s ease; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { flex: 1; }
.drawer-body { padding: 16px; overflow-y: auto; flex: 1; }
.embed { border-left: 4px solid var(--gold); background: var(--bg); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.embed h4 { margin: 0 0 6px; font-size: 15px; } .embed .desc { white-space: pre-wrap; word-wrap: break-word; }
.embed .fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; margin-top: 10px; }
.embed .fields .f { min-width: 0; white-space: pre-wrap; word-wrap: break-word; } .embed .fields .f.wide { grid-column: 1 / -1; }
.embed .fields .f > .fn { font-weight: 650; font-size: 12.5px; margin-bottom: 2px; }
.embed img.big { max-width: 100%; border-radius: 8px; margin-top: 10px; display: block; }
.embed .foot { margin-top: 8px; font-size: 12px; color: var(--dim); }
.md-small { font-size: 12px; color: var(--muted); } .md-quote { border-left: 3px solid var(--line2); padding-left: 8px; color: var(--muted); display: block; }
.mention { background: rgba(91, 141, 239, .18); color: #a9c3ff; padding: 0 4px; border-radius: 4px; font-weight: 600; }
.comp-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.comp-row select { flex: 1; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--bg3); border: 1px solid var(--line2); padding: 10px 16px; border-radius: 10px; z-index: 80; box-shadow: var(--shadow); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line2); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: -4px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 500px at 50% -10%, rgba(245, 197, 66, .09), transparent), var(--bg); }
.login .box { max-width: 440px; width: 100%; text-align: center; padding: 34px 28px; }
.login .logo { width: 56px; height: 56px; border-radius: 16px; background: var(--gold); margin: 0 auto 16px; display: grid; place-items: center; color: #15161a; font-size: 26px; font-weight: 800; }
.login p { color: var(--muted); } .login .btn { width: 100%; justify-content: center; padding: 11px; font-size: 15px; margin-top: 8px; }
.login ol { text-align: left; color: var(--muted); padding-left: 20px; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: minmax(0, 1fr); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* ───────────── Socle visuel v2 : icônes SVG, widgets, graphiques ───────────── */
:root { --bg: #0e0f13; --bg2: #15171c; --bg3: #1d2027; --line: #262a33; --line2: #343944; --text: #eceef2; --muted: #8b93a1; --dim: #626977; --radius: 14px; --ring: 0 0 0 3px rgba(245, 197, 66, .18); }
body { font-size: 14px; letter-spacing: -.003em; }
svg.ic { flex: none; vertical-align: -3px; }
h1 { font-size: 20px; letter-spacing: -.02em; } h2 { font-size: 15px; letter-spacing: -.01em; }
.card { border-radius: var(--radius); background: linear-gradient(180deg, #171a20, var(--bg2)); border-color: var(--line); box-shadow: 0 1px 0 rgba(255, 255, 255, .02) inset; }
.card.link { display: block; color: inherit; transition: border-color .15s, transform .15s; } .card.link:hover { border-color: var(--line2); text-decoration: none; transform: translateY(-1px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card.flush > .card-head { padding: 14px 16px 0; margin-bottom: 10px; }
.card-title { display: flex; align-items: center; gap: 10px; min-width: 0; } .card-title > svg { color: var(--muted); } .card-title small { display: block; margin-top: 1px; }
.side { background: #101216; padding: 14px 10px; }
.brand .logo { box-shadow: 0 6px 18px rgba(245, 197, 66, .25); }
.nav a { gap: 11px; padding: 8px 10px; font-weight: 550; font-size: 13.5px; border: 1px solid transparent; } .nav a svg { color: var(--dim); }
.nav a:hover svg { color: var(--text); } .nav a.on { background: rgba(245, 197, 66, .09); border-color: rgba(245, 197, 66, .16); } .nav a.on svg { color: var(--gold); }
.nav-group { margin: 16px 10px 6px; font-size: 10.5px; }
.top { background: rgba(14, 15, 19, .82); border-bottom-color: var(--line); }
.top .bal { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--bg2); border: 1px solid var(--line); padding: 6px 12px; border-radius: 11px; } .top .bal svg { color: var(--gold); } .top .bal small { display: block; line-height: 1.1; } .top .bal b { font-size: 14.5px; }
.btn { gap: 7px; border-radius: 10px; font-weight: 600; font-size: 13.5px; transition: background .12s, border-color .12s, transform .06s; } .btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: #4a7de6; border-color: #4a7de6; } .btn.primary:hover { background: #5b8def; }
.btn.success { background: #35c383; border-color: #35c383; } .btn.gold:hover, .btn.success:hover { filter: brightness(1.06); }
.btn.icon { padding: 7px; } .btn.ghost { border-color: transparent; } .btn.ghost:hover { background: var(--bg3); }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; } .actions .btn { justify-content: flex-start; padding: 11px 12px; }
.seg { border-radius: 11px; background: #0f1115; } .seg button { border-radius: 8px; font-size: 13px; } .seg button.on { background: var(--bg3); box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset; }
.pill { gap: 4px; padding: 2px 8px; font-size: 11.5px; } .pill svg { vertical-align: -2px; }
.tbl th { position: sticky; top: 0; background: var(--bg2); z-index: 1; font-size: 11px; padding: 10px 14px; } .tbl td { padding: 10px 14px; } .tbl tbody tr:hover td { background: rgba(255, 255, 255, .018); }
.tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; }
.alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-radius: 12px; } .alert-b { display: flex; gap: 10px; align-items: flex-start; min-width: 0; flex: 1; } .alert-b svg { margin-top: 1px; flex: none; }
.alert.info { border-color: rgba(91, 141, 239, .4); background: rgba(91, 141, 239, .08); color: #c9d9ff; }

/* Indicateurs clés */
.kpi { position: relative; overflow: hidden; padding: 14px 16px 12px; min-height: 104px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-l { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kpi-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--bg3); color: var(--muted); }
.kpi-ic.gold { background: rgba(245, 197, 66, .13); color: var(--gold); } .kpi-ic.green { background: rgba(62, 207, 142, .13); color: var(--green); } .kpi-ic.red { background: rgba(242, 85, 90, .13); color: var(--red); }
.kpi-ic.blue { background: rgba(91, 141, 239, .15); color: var(--blue); } .kpi-ic.violet { background: rgba(167, 139, 250, .15); color: var(--violet); }
.kpi-v { font-size: 24px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; line-height: 1.15; }
.kpi-b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; position: relative; z-index: 1; } .kpi-s { color: var(--muted); font-size: 12px; }
.kpi:has(.kpi-spark) { padding-bottom: 40px; }
.kpi-spark { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; opacity: .6; pointer-events: none; } .kpi-spark svg { width: 100%; height: 100%; display: block; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 650; padding: 1px 6px; border-radius: 6px; background: var(--bg3); color: var(--muted); font-variant-numeric: tabular-nums; }
.delta.up { background: rgba(62, 207, 142, .13); color: var(--green); } .delta.down { background: rgba(242, 85, 90, .13); color: var(--red); } .delta i { font-style: normal; font-weight: 500; opacity: .8; }
.spark { display: block; }

/* Anneau, barres, progression */
.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; position: relative; }
.donut-r { position: relative; flex: none; }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; } .donut-c b { font-size: 19px; letter-spacing: -.02em; } .donut-c span { font-size: 11px; color: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 7px; }
.legend li { display: grid; grid-template-columns: 10px 1fr auto 38px; align-items: center; gap: 8px; font-size: 13px; } .legend i { width: 10px; height: 10px; border-radius: 3px; } .legend em { font-style: normal; color: var(--dim); font-size: 12px; text-align: right; } .legend span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hb { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; } .hb-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-t { height: 8px; background: var(--bg3); border-radius: 999px; overflow: hidden; } .hb-t i { display: block; height: 100%; border-radius: 999px; } .hb-v { text-align: right; font-weight: 600; white-space: nowrap; } .hb-v small { display: block; font-weight: 400; }
.prog .bar { height: 8px; } .prog-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 5px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 18px; text-align: center; color: var(--muted); } .empty-state svg { color: var(--dim); margin-bottom: 4px; } .empty-state b { color: var(--text); font-size: 14px; } .empty-state .btn { margin-top: 8px; }
.skel { background: linear-gradient(100deg, var(--bg2) 30%, #1c1f26 50%, var(--bg2) 70%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-color: transparent; }
@keyframes shimmer { to { background-position: -200% 0; } }
.feed .it .av { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--bg3); color: var(--muted); flex: none; } .feed .it .av.g { background: rgba(62, 207, 142, .13); color: var(--green); } .feed .it .av.r { background: rgba(242, 85, 90, .13); color: var(--red); } .feed .it .av.y { background: rgba(245, 197, 66, .13); color: var(--gold); } .feed .it .av.b { background: rgba(91, 141, 239, .15); color: var(--blue); }

/* Graphiques : cadre, légende, infobulle */
.cw { position: relative; }
.cw-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -4px 0 8px; font-size: 12.5px; color: var(--muted); } .cw-legend span { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; } .cw-legend span.off { opacity: .38; } .cw-legend i { width: 9px; height: 9px; border-radius: 3px; } .cw-legend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.tip { position: absolute; z-index: 15; pointer-events: none; background: rgba(22, 24, 30, .96); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; box-shadow: var(--shadow); min-width: 150px; backdrop-filter: blur(6px); opacity: 0; transition: opacity .08s; }
.tip.show { opacity: 1; } .tip .tt { color: var(--muted); font-size: 11.5px; margin-bottom: 5px; white-space: nowrap; }
.tip .tr { display: flex; align-items: center; justify-content: space-between; gap: 14px; line-height: 1.55; white-space: nowrap; } .tip .tr span { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; } .tip .tr i { width: 8px; height: 8px; border-radius: 2px; } .tip .tr b { font-variant-numeric: tabular-nums; font-weight: 600; }
.tip hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.ranges { display: inline-flex; gap: 2px; } .ranges button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; cursor: pointer; } .ranges button.on, .ranges button:hover { background: var(--bg3); color: var(--text); }

/* Terminal de trading v2 */
.tv { border-radius: var(--radius); background: #12141a; } .tv:fullscreen { border-radius: 0; display: flex; flex-direction: column; } .tv:fullscreen .tv-body { flex: 1; min-height: 0; } .tv:fullscreen .tv-stage { display: flex; flex-direction: column; } .tv:fullscreen .tv-main { flex: 1; height: auto; }
.tv-bar { gap: 6px; padding: 7px 8px; } .tv-bar .grow { flex: 1; }
.tv-bar .btn.sm { padding: 5px 8px; } .tv-tools button svg { pointer-events: none; }
.tv-head { position: absolute; left: 12px; top: 8px; z-index: 6; pointer-events: none; display: flex; flex-direction: column; gap: 3px; max-width: calc(100% - 96px); }
.tv-ohlc { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; } .tv-ohlc b { color: var(--text); font-weight: 600; margin-left: 3px; }
.tv-inds { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; font-variant-numeric: tabular-nums; } .tv-inds span { display: inline-flex; gap: 5px; align-items: center; }
.tv-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 7; background: rgba(22, 24, 30, .95); border: 1px solid var(--line2); border-radius: 999px; padding: 5px 12px; font-size: 12px; color: var(--muted); pointer-events: none; white-space: nowrap; }
.menu-pop label svg { color: var(--muted); } .menu-pop .mh { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); padding: 6px 8px 2px; }
.depth-row { display: grid; grid-template-columns: 54px 1fr 1fr; gap: 8px; align-items: center; font-size: 12.5px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.depth-row .cell { position: relative; padding: 3px 8px; border-radius: 6px; overflow: hidden; text-align: right; } .depth-row .cell i { position: absolute; inset: 0 auto 0 0; opacity: .16; } .depth-row .cell.b i { background: var(--green); } .depth-row .cell.s i { background: var(--red); left: auto; right: 0; } .depth-row .cell span { position: relative; }

/* Tiroir du bot */
.drawer { background: #121419; } .drawer-head h2 { display: flex; align-items: center; gap: 9px; } .embed { border-radius: 10px; background: #0f1115; border-left-width: 3px; }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.login .logo { box-shadow: 0 10px 30px rgba(245, 197, 66, .3); }
.tabbar a svg, .tabbar button svg { margin-bottom: 1px; }

/* Barre de navigation du bas (mobile) */
.tabbar { display: none; }
.side-bg { display: none; }

@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 45; width: min(290px, 86vw); transform: translateX(-100%); transition: transform .18s; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .side-bg.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 44; }
  .nav a { padding: 11px 10px; font-size: 15px; }
  .burger { display: inline-flex; }
  .top { padding: 10px 12px; gap: 8px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .top h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top .title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top .bal small { display: none; } .top .bal b { font-size: 14px; }
  #refresh { display: none; }
  .content { padding: 12px 10px calc(84px + env(safe-area-inset-bottom)); }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .grid { gap: 10px; } .stack { gap: 10px; }
  .card { padding: 12px; border-radius: 10px; }
  .stat .v { font-size: 18px; } .stat .l { font-size: 10.5px; }
  .stat .s { font-size: 11.5px; }
  /* Zones tactiles confortables ; 16 px dans les champs pour éviter le zoom automatique d'iOS */
  .btn { padding: 10px 13px; } .btn.sm { padding: 8px 10px; }
  input, select, textarea { font-size: 16px; padding: 10px; }
  .seg { display: flex; overflow-x: auto; flex-wrap: nowrap; max-width: 100%; scrollbar-width: none; } .seg button { padding: 8px 11px; white-space: nowrap; flex: none; }
  .tabs { margin-left: -10px; margin-right: -10px; padding: 0 10px; scrollbar-width: none; }
  .tbl th, .tbl td { padding: 9px 9px; font-size: 13px; }
  .tbl td { white-space: nowrap; } .tbl td small { white-space: normal; }
  .scroll { -webkit-overflow-scrolling: touch; }
  .card.flush > .row.between, .card.flush > div:first-child { flex-wrap: wrap; }
  .kv { gap: 6px 10px; }
  .chart { height: 240px; } .chart.tall { height: 56vh; min-height: 320px; } .chart.short { height: 120px; }
  /* Terminal de trading : outils de tracé en bandeau horizontal défilant */
  .tv-body { grid-template-columns: 1fr; }
  .tv-tools { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; scrollbar-width: none; }
  .tv-tools button { width: 40px; height: 38px; flex: none; font-size: 17px; }
  .tv-bar { padding: 6px; gap: 6px; } .tv-bar .sep { display: none; }
  .tv-legend { font-size: 11px; gap: 6px; top: 4px; left: 6px; }
  .menu-pop { position: fixed; left: 10px; right: 10px; top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); max-height: 60vh; overflow-y: auto; }
  .menu-pop label { padding: 11px 8px; font-size: 15px; }
  /* Tiroir du bot : plein écran, boutons larges */
  .drawer { width: 100vw; border-left: 0; height: 100dvh; }
  .drawer-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  .drawer-body { padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }
  .embed .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comp-row .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; white-space: normal; text-align: center; }
  .comp-row select { min-height: 46px; }
  .feed .it { padding: 10px; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); width: max-content; max-width: 92vw; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(25, 27, 32, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; color: var(--muted); font-size: 10.5px; font-weight: 600; background: none; border: 0; font-family: inherit; cursor: pointer; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .ic { font-size: 20px; line-height: 1; }
  .tabbar a.on { color: var(--gold); }
  .login .box { padding: 26px 18px; }
  .kpi { min-height: 92px; padding: 12px 12px 10px; } .kpi-v { font-size: 19px; } .kpi-ic { width: 26px; height: 26px; }
  .donut { justify-content: center; } .legend { min-width: 100%; }
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tip { font-size: 12px; min-width: 130px; }
  .top .bal { padding: 5px 9px; } .top .bal small { display: none; }
  .tv-head { max-width: calc(100% - 76px); left: 8px; } .tv-ohlc { gap: 6px; font-size: 11px; }
  .hb { grid-template-columns: minmax(70px, 38%) 1fr auto; }
}
@media (max-width: 330px) { .g4 { grid-template-columns: minmax(0, 1fr); } }

/* ───────────── Fenêtres d'action natives ───────────── */
.dlg-bg { position: fixed; inset: 0; background: rgba(5, 6, 9, .66); backdrop-filter: blur(3px); z-index: 60; animation: fade .12s ease; }
.dlg { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(470px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: #14161c; border: 1px solid var(--line2); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); animation: pop .14s ease; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 12px; }
.dlg-title { display: flex; align-items: center; gap: 11px; min-width: 0; } .dlg-title h2 { font-size: 16.5px; }
.dlg-body { padding: 2px 18px 18px; overflow-y: auto; }
.dlg-intro { color: var(--muted); margin-bottom: 14px; font-size: 13.5px; } .dlg-intro b { color: var(--text); }
.dlg-form { display: flex; flex-direction: column; gap: 14px; }
.dlg-field label { font-size: 12.5px; } .dlg-field label i { color: var(--gold); font-style: normal; } .dlg-field small { display: block; margin-top: 5px; }
.inp { position: relative; } .inp input { font-size: 16px; padding: 11px 12px; font-variant-numeric: tabular-nums; font-weight: 600; } .inp .suf { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; } .inp:has(.suf) input { padding-right: 58px; }
.seg.wide { display: flex; width: 100%; } .seg.wide button { flex: 1; padding: 9px 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; } .chips button { background: var(--bg3); border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; cursor: pointer; } .chips button:hover { color: var(--text); border-color: var(--line2); }
.dlg-rows { margin: 0; background: #0f1115; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; } .dlg-rows > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); } .dlg-rows > div:last-child { border-bottom: 0; }
.dlg-rows dt { color: var(--muted); } .dlg-rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; } .dlg-rows .big dd { font-size: 17px; } .dlg-rows .big dt { color: var(--text); font-weight: 600; }
.dlg-note, .dlg-error { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; font-size: 13px; margin-top: 10px; background: rgba(91, 141, 239, .09); border: 1px solid rgba(91, 141, 239, .3); color: #c9d9ff; }
.dlg-note.bad, .dlg-error { background: rgba(242, 85, 90, .09); border-color: rgba(242, 85, 90, .38); color: #ffc7c9; margin-top: 10px; } .dlg-note svg, .dlg-error svg { flex: none; margin-top: 1px; }
.dlg-info { background: #0f1115; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 13px; color: var(--muted); } .dlg-info b { color: var(--text); }
.choices { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; } .choices > button, .dlg-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: #0f1115; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--text); font: inherit; cursor: pointer; transition: border-color .12s, background .12s; }
.choices > button:hover, .dlg-item:hover { border-color: var(--line2); background: #12151a; } .choices > button.on { border-color: var(--gold); background: rgba(245, 197, 66, .07); }
.ch-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line2); } .choices > button.on .ch-dot { border-color: var(--gold); background: radial-gradient(circle, var(--gold) 0 45%, transparent 50%); }
.ch-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; } .ch-main b { font-weight: 600; font-size: 13.5px; } .ch-main small { color: var(--muted); font-size: 12px; margin: 0; }
.dlg-menu { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; } .dlg-item > svg:last-child { color: var(--dim); flex: none; } .dlg-heading { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); margin: 8px 2px 0; }
.dlg-item.static { cursor: default; } .dlg-item.static:hover { border-color: var(--line); background: #0f1115; }
.dlg-badge { flex: none; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--muted); }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; padding-top: 4px; } .dlg-actions .btn { min-width: 110px; justify-content: center; padding: 10px 14px; }
.dlg-done { text-align: center; padding: 14px 4px 6px; } .dlg-check { width: 54px; height: 54px; border-radius: 50%; display: inline-grid; place-items: center; background: rgba(62, 207, 142, .14); color: var(--green); margin-bottom: 12px; } .dlg-done h3 { font-size: 17px; color: var(--text); text-transform: none; letter-spacing: -.01em; margin-bottom: 8px; }
.dlg-text { color: var(--muted); white-space: pre-wrap; text-align: left; background: #0f1115; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13.5px; } .dlg-text b { color: var(--text); }
.dlg-confirm { color: var(--muted); white-space: pre-wrap; margin-bottom: 14px; } .dlg-confirm b { color: var(--text); }
@media (max-width: 760px) {
  .dlg { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100vw; max-height: 92dvh; border-radius: 20px 20px 0 0; border-bottom: 0; animation: sheet .18s ease; }
  @keyframes sheet { from { transform: translateY(24px); opacity: 0; } }
  .dlg-body { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .dlg-actions { flex-direction: column-reverse; } .dlg-actions .btn { width: 100%; min-height: 46px; }
}

/* Logo image */
img.logo { object-fit: cover; object-position: 50% 25%; background: #1a0508; display: block; } .brand img.logo { box-shadow: 0 6px 18px rgba(200, 30, 50, .28); } .login img.logo { width: 64px; height: 64px; border-radius: 18px; box-shadow: 0 10px 30px rgba(200, 30, 50, .35); }

/* ── Listes défilantes : une liste ne pousse plus la page, on défile dedans ── */
.card .scroll { max-height: 432px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.card .feed, .card .hbars { max-height: 432px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.card .hbars { padding-right: 4px; }
.card .scroll::-webkit-scrollbar, .card .feed::-webkit-scrollbar, .card .hbars::-webkit-scrollbar { width: 8px; height: 8px; } .card .scroll::-webkit-scrollbar-thumb, .card .feed::-webkit-scrollbar-thumb, .card .hbars::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.card .scroll .tbl th { background: #171a20; box-shadow: 0 1px 0 var(--line); }
/* ── Pseudos cliquables ── */
a.ulink { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(255, 255, 255, .28); cursor: pointer; transition: color .12s, border-color .12s; } a.ulink:hover { color: var(--gold); border-bottom-color: var(--gold); text-decoration: none; }
/* ── Recherche de membres ── */
.usearch { position: relative; flex: none; } .usearch .usearch-btn { display: none; }
.usearch-box { display: flex; align-items: center; gap: 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; padding: 0 10px; height: 40px; width: 250px; color: var(--dim); transition: border-color .12s, box-shadow .12s; } .usearch-box:focus-within { border-color: var(--gold); box-shadow: var(--ring); }
.usearch-box input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; padding: 0; height: 100%; box-shadow: none; } .usearch-box input::-webkit-search-cancel-button { display: none; }
.usearch-box kbd { font: 600 11px/1 system-ui; color: var(--dim); border: 1px solid var(--line2); border-radius: 5px; padding: 3px 6px; } .usearch-box:focus-within kbd { display: none; }
.usearch-pop { position: absolute; top: calc(100% + 6px); right: 0; width: 100%; min-width: 250px; background: #14161c; border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow); padding: 5px; z-index: 30; display: flex; flex-direction: column; gap: 2px; } .usearch-pop[hidden] { display: none; }
.usearch-pop button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--text); font: inherit; text-align: left; padding: 7px 8px; border-radius: 8px; cursor: pointer; } .usearch-pop button span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .usearch-pop button svg { color: var(--dim); }
.usearch-pop button.on, .usearch-pop button:hover { background: var(--bg3); } .usearch-pop .av { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(245, 197, 66, .13); color: var(--gold); font-weight: 700; font-size: 12.5px; flex: none; }
.usearch-empty { padding: 10px; color: var(--muted); font-size: 13px; }
@media (max-width: 1250px) { .usearch-box { width: 190px; } }
@media (max-width: 900px) {
  .usearch .usearch-btn { display: inline-flex; } .usearch-box { display: none; }
  .usearch.open { position: absolute; left: 10px; right: 10px; top: calc(8px + env(safe-area-inset-top)); z-index: 25; } .usearch.open .usearch-btn { display: none; } .usearch.open .usearch-box { display: flex; width: 100%; height: 44px; background: #14161c; border-color: var(--gold); } .usearch.open .usearch-box kbd { display: none; }
  .usearch-box input { font-size: 16px; }
  .card .scroll, .card .feed, .card .hbars { max-height: 380px; }
}
