:root {
  --bg0: #0b0e11; --bg1: #181a20; --bg2: #1e2329; --bg3: #2b3139; --bg4: #363c45;
  --text: #eaecef; --muted: #848e9c; --dim: #5e6673;
  --green: #0ecb81; --red: #f6465d; --yellow: #fcd535; --yellow2: #f0b90b; --blue: #3b82f6;
  --green-bg: rgba(14,203,129,.12); --red-bg: rgba(246,70,93,.12);
  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --border: 1px solid #2b3139;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg0); color: var(--text); font-family: var(--font); font-size: 12px; line-height: 1.4; overflow: hidden; }
button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font-family: inherit; font-size: inherit; color: var(--text); background: var(--bg3); border: 1px solid var(--bg3); border-radius: 4px; outline: none; }
input:focus { border-color: var(--yellow); }
a { color: var(--yellow); text-decoration: none; }
.muted { color: var(--muted); } .small { font-size: 11px; } .mono { font-family: var(--mono); }
.up { color: var(--green) !important; } .down { color: var(--red) !important; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }

/* ---- nav */
.nav { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--bg1); border-bottom: var(--border); }
.nav-left { display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 18px; letter-spacing: .5px; }
.logo-mark { width: 26px; height: 26px; border-radius: 6px; background: var(--yellow); color: var(--bg0); display: grid; place-items: center; font-weight: 700; }
.logo-sub { color: var(--muted); font-weight: 400; font-size: 13px; }
.nav-tabs { display: flex; gap: 4px; }
.nav-tab { padding: 8px 12px; font-size: 14px; font-weight: 500; color: var(--muted); border-radius: 4px; }
.nav-tab:hover { color: var(--text); } .nav-tab.active { color: var(--text); }
.nav-tab.active::after { content: ''; display: block; height: 2px; background: var(--yellow); margin: 6px -12px -8px; }
.badge-perp { font-size: 10px; background: var(--bg3); color: var(--yellow); border-radius: 3px; padding: 1px 4px; margin-left: 4px; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.feed-status { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); display: inline-block; margin-left: 8px; }
.dot.on { background: var(--green); } .dot.off { background: var(--red); }
.acct-equity { font-size: 13px; } .acct-equity b { font-family: var(--mono); font-weight: 500; }
.pnl { font-family: var(--mono); font-size: 12px; margin-left: 4px; }
.select { padding: 5px 8px; border-radius: 4px; background: var(--bg3); } .select-sm { padding: 1px 4px; font-size: 11px; background: var(--bg2); border-color: var(--bg3); }
.btn-ghost { padding: 6px 12px; border-radius: 4px; background: var(--bg3); color: var(--text); font-weight: 500; }
.btn-ghost:hover { background: var(--bg4); } .btn-ghost.sm { padding: 3px 8px; font-size: 11px; }

/* ---- tape */
.tape { height: 28px; background: var(--bg1); border-bottom: var(--border); overflow: hidden; position: relative; }
.tape-track { display: flex; gap: 32px; white-space: nowrap; padding: 6px 0; animation: tape 60s linear infinite; width: max-content; }
.tape-track:hover { animation-play-state: paused; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tape-item { display: inline-flex; gap: 6px; font-size: 11px; cursor: pointer; } .tape-item b { color: var(--text); font-weight: 500; }

/* ---- layout */
.layout { height: calc(100vh - 80px); display: grid; grid-template-columns: 300px 1fr 330px; grid-template-rows: 60px minmax(300px, 1fr) 280px;
  grid-template-areas: "symhead symhead right" "book chart right" "book bottom right"; gap: 4px; padding: 4px; background: var(--bg0); }
body.ai-expanded .layout { grid-template-rows: 60px minmax(160px, 1fr) 500px; }
.panel { background: var(--bg1); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: var(--border); }
.panel-title { font-weight: 500; font-size: 13px; }

/* ---- symbol header */
.symhead { grid-area: symhead; background: var(--bg1); border-radius: 4px; display: flex; align-items: center; gap: 28px; padding: 0 16px; overflow-x: auto; }
.star { font-size: 16px; color: var(--muted); } .star.on { color: var(--yellow); }
.sym-name { min-width: 120px; border-right: var(--border); padding-right: 20px; }
.sym-id { font-size: 18px; font-weight: 600; } .sym-full { color: var(--muted); font-size: 11px; }
.sym-price .big { font-family: var(--mono); font-size: 20px; font-weight: 500; }
.sym-price .usd { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.stat .k { color: var(--muted); font-size: 11px; white-space: nowrap; } .stat .v { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.pill { padding: 1px 6px; border-radius: 3px; font-size: 10px; font-family: var(--font); font-weight: 600; background: var(--bg3); color: var(--muted); }
.pill.OPEN, .pill.REGULAR { background: var(--green-bg); color: var(--green); }
.pill.PRE, .pill.AFTER, .pill.BREAK { background: rgba(252,213,53,.12); color: var(--yellow); }
.pill.CLOSED { background: var(--red-bg); color: var(--red); }
.fut-only { display: none; } body.futures .fut-only { display: flex; } body.futures .stat.fut-only { display: block; }

/* ---- order book */
.book { grid-area: book; }
.book-tools { display: flex; align-items: center; gap: 4px; }
.ico { width: 22px; height: 20px; border-radius: 3px; color: var(--muted); font-size: 11px; } .ico.active { background: var(--bg3); color: var(--text); }
.book-cols { display: grid; grid-template-columns: 1.2fr 1fr 1fr; padding: 4px 12px; color: var(--muted); font-size: 11px; }
.book-cols span:not(:first-child) { text-align: right; }
.book-body { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.book-asks, .book-bids { flex: 1; display: flex; flex-direction: column; overflow: hidden; } .book-asks { justify-content: flex-end; }
.row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 6px; padding: 1px 12px; font-family: var(--mono); font-size: 11.5px; position: relative; height: 18px; line-height: 16px; cursor: pointer; }
.row span { overflow: hidden; text-overflow: ellipsis; }
.row span:not(:first-child) { text-align: right; } .row:hover { background: var(--bg3); }
.row .depth { position: absolute; top: 0; bottom: 0; right: 0; opacity: .18; pointer-events: none; }
.row.ask .p { color: var(--red); } .row.ask .depth { background: var(--red); }
.row.bid .p { color: var(--green); } .row.bid .depth { background: var(--green); }
.row.flash-ask { animation: fa .5s; } .row.flash-bid { animation: fb .5s; }
@keyframes fa { from { background: var(--red-bg); } } @keyframes fb { from { background: var(--green-bg); } }
.book-mid { display: flex; align-items: baseline; gap: 8px; padding: 6px 12px; border-top: var(--border); border-bottom: var(--border); }
.mid-price { font-family: var(--mono); font-size: 16px; font-weight: 500; } .mid-arrow { font-size: 13px; }
.mid-usd { color: var(--muted); font-family: var(--mono); font-size: 11px; } .mid-spread { margin-left: auto; color: var(--muted); font-size: 10px; }
.book-ratio { display: flex; align-items: center; gap: 8px; padding: 4px 12px; font-size: 11px; border-top: var(--border); }
.book-ratio .b { color: var(--green); } .book-ratio .s { color: var(--red); }
.ratio-bar { flex: 1; height: 4px; background: var(--red); border-radius: 2px; overflow: hidden; } #ratio-fill { height: 100%; background: var(--green); width: 50%; }
.trades-head { border-top: var(--border); }
.trades-body { height: 32%; overflow: hidden; }
.trades-body .row { cursor: default; }

/* ---- chart */
.chart { grid-area: chart; }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px; border-bottom: var(--border); height: 32px; }
.tf { display: flex; gap: 2px; align-items: center; } .tf .muted { margin-right: 6px; }
.tf button { padding: 2px 7px; border-radius: 3px; color: var(--muted); font-size: 11px; } .tf button.active { color: var(--yellow); background: var(--bg3); }
.chart-right { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 11px; }
.chk { display: flex; align-items: center; gap: 4px; cursor: pointer; } .chk input { accent-color: var(--yellow); margin: 0; }
.legend { font-family: var(--mono); font-size: 11px; } .legend b { color: var(--text); font-weight: 500; margin-right: 6px; }
#chart { flex: 1; min-height: 0; position: relative; }

/* ---- bottom */
.bottom { grid-area: bottom; }
.tabs { display: flex; align-items: center; gap: 2px; padding: 0 8px; border-bottom: var(--border); height: 36px; }
.tab { padding: 8px 10px; color: var(--muted); font-weight: 500; position: relative; } .tab.active { color: var(--text); }
.tab.active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--yellow); }
.cnt { background: var(--bg3); color: var(--muted); font-size: 10px; padding: 0 5px; border-radius: 8px; margin-left: 2px; } .cnt-ai { background: rgba(59,130,246,.2); color: #8ab4ff; }
.spacer { flex: 1; }
.tab-body { flex: 1; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 400; font-size: 11px; padding: 6px 10px; position: sticky; top: 0; background: var(--bg1); white-space: nowrap; }
td { padding: 5px 10px; border-top: 1px solid rgba(43,49,57,.6); font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
td.f { font-family: var(--font); }
.empty { color: var(--dim); text-align: center; padding: 40px; font-size: 12px; }
.tbtn { padding: 2px 8px; border-radius: 3px; background: var(--bg3); font-family: var(--font); font-size: 11px; } .tbtn:hover { background: var(--bg4); }
.tbtn.warn { color: var(--red); }
.side-b { color: var(--green); } .side-s { color: var(--red); }
.assets-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px; }
.assets-box { background: var(--bg2); border-radius: 4px; padding: 10px; } .assets-box h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.kv { display: flex; justify-content: space-between; padding: 3px 0; font-family: var(--mono); } .kv span:first-child { color: var(--muted); font-family: var(--font); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px; }
.stat-tile { background: var(--bg2); border-radius: 4px; padding: 8px 10px; } .stat-tile .k { color: var(--muted); font-size: 11px; } .stat-tile .v { font-family: var(--mono); font-size: 15px; margin-top: 2px; }
.feed { padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
.feed-item { display: grid; grid-template-columns: 62px 56px 70px 1fr; gap: 8px; padding: 6px 8px; background: var(--bg2); border-radius: 4px; align-items: baseline; }
.feed-item .t { color: var(--dim); font-family: var(--mono); font-size: 10.5px; } .feed-item .a { color: var(--muted); font-size: 10.5px; text-transform: uppercase; }
.feed-item .k { font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 3px; background: var(--bg3); text-align: center; }
.feed-item .k.decision, .feed-item .k.fill { background: rgba(14,203,129,.15); color: var(--green); } .feed-item .k.warning, .feed-item .k.liquidation { background: var(--red-bg); color: var(--red); }
.feed-item .k.plan, .feed-item .k.analysis { background: rgba(59,130,246,.18); color: #8ab4ff; } .feed-item .k.order { background: rgba(252,213,53,.15); color: var(--yellow); }
.feed-item .m { white-space: pre-wrap; word-break: break-word; }

/* ---- right column */
.right { grid-area: right; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.markets { flex: 1; min-height: 160px; }
.search { position: relative; padding: 8px 10px 4px; } .search input { width: 100%; padding: 5px 8px 5px 26px; background: var(--bg2); }
.search-ico { position: absolute; left: 18px; top: 13px; color: var(--muted); }
.mk-tabs { display: flex; gap: 2px; padding: 4px 8px; overflow-x: auto; }
.mk-tabs button { padding: 3px 7px; border-radius: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; } .mk-tabs button.active { color: var(--text); background: var(--bg3); }
.mk-cols { display: grid; grid-template-columns: 1.4fr 1fr .8fr; padding: 4px 10px; color: var(--muted); font-size: 11px; cursor: pointer; }
.mk-cols span:not(:first-child) { text-align: right; } .mk-cols .sorted { color: var(--text); }
.mk-list { flex: 1; overflow-y: auto; }
.mk-row { display: grid; grid-template-columns: 1.4fr 1fr .8fr; padding: 4px 10px; cursor: pointer; align-items: center; }
.mk-row:hover, .mk-row.active { background: var(--bg3); }
.mk-row .s { display: flex; align-items: center; gap: 5px; } .mk-row .s b { font-weight: 500; } .mk-row .s small { color: var(--muted); }
.mk-row .st { color: var(--dim); font-size: 12px; } .mk-row .st.on { color: var(--yellow); }
.mk-row .num { text-align: right; font-size: 11.5px; }
.mk-row .tag { font-size: 8px; padding: 0 3px; border-radius: 2px; background: var(--bg3); color: var(--muted); text-transform: uppercase; }

/* ---- order form */
.orderform { padding: 10px 12px; gap: 8px; flex: 0 0 auto; }
.fut-bar { gap: 6px; align-items: center; }
.pillbtn { background: var(--bg3); padding: 3px 10px; border-radius: 3px; font-weight: 500; } .pillbtn:hover { background: var(--bg4); }
.side-toggle { display: flex; background: var(--bg3); border-radius: 4px; padding: 2px; }
.side-toggle button { flex: 1; padding: 6px; border-radius: 3px; color: var(--muted); font-weight: 600; }
.side-toggle .buy.active { background: var(--green); color: #fff; } .side-toggle .sell.active { background: var(--red); color: #fff; }
.otype { display: flex; gap: 10px; } .otype button { color: var(--muted); font-weight: 500; padding: 2px 0; } .otype button.active { color: var(--yellow); }
.of-avail { display: flex; justify-content: space-between; font-size: 11px; } .of-avail b { font-family: var(--mono); font-weight: 500; }
.field { display: flex; align-items: center; background: var(--bg3); border-radius: 4px; border: 1px solid var(--bg3); height: 34px; padding: 0 8px; }
.field:focus-within { border-color: var(--yellow); }
.field .fl { color: var(--muted); width: 72px; } .field .fr { color: var(--muted); width: 44px; text-align: right; }
.field input { flex: 1; background: none; border: 0; text-align: right; font-family: var(--mono); font-size: 13px; padding: 0 6px; }
.field.disabled { opacity: .5; }
.slider input[type=range] { width: 100%; accent-color: var(--yellow); margin: 4px 0 0; }
.ticks { display: flex; justify-content: space-between; color: var(--dim); font-size: 9px; }
.tpsl { gap: 14px; } .tpsl-fields { display: flex; flex-direction: column; gap: 6px; } #tpsl-fields { flex-direction: column; gap: 6px; }
.of-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-family: var(--mono); min-height: 14px; }
.submit { width: 100%; padding: 9px; border-radius: 4px; font-weight: 600; font-size: 13px; color: #fff; }
.submit.buy { background: var(--green); } .submit.sell { background: var(--red); } .submit.yellow { background: var(--yellow); color: var(--bg0); }
.submit:hover { filter: brightness(1.08); } .submit:disabled { opacity: .5; cursor: not-allowed; }
.of-msg { min-height: 14px; font-size: 11px; } .of-msg.err { color: var(--red); } .of-msg.ok { color: var(--green); }

/* ---- modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; }
.modal[hidden] { display: none; }
.modal-box { width: 380px; background: var(--bg2); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.modal-box.wide { width: 640px; max-height: 80vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; font-size: 15px; font-weight: 600; } .x { font-size: 18px; color: var(--muted); }
.lev-val { display: flex; background: var(--bg3); border-radius: 4px; align-items: center; } .lev-val button { padding: 8px 14px; font-size: 16px; color: var(--muted); }
.lev-val input { flex: 1; text-align: center; background: none; border: 0; font-family: var(--mono); font-size: 16px; }
.lev-marks { display: flex; justify-content: space-between; color: var(--dim); font-size: 10px; }
.modal-warn { background: rgba(252,213,53,.08); color: var(--yellow); padding: 8px; border-radius: 4px; font-size: 11px; }
.transfer-dir { display: flex; gap: 8px; align-items: center; } .transfer-dir select { flex: 1; }
.api-info { font-size: 12px; line-height: 1.6; } .api-info pre { background: var(--bg0); padding: 8px 10px; border-radius: 4px; overflow: auto; font-family: var(--mono); font-size: 11px; margin: 4px 0 10px; }
.api-info h4 { margin: 10px 0 4px; font-size: 12px; color: var(--yellow); }

/* ---- AI pulse (nav) */
.ai-pulse { display: flex; align-items: center; gap: 7px; background: var(--bg2); border: 1px solid var(--bg3); border-radius: 20px; padding: 4px 12px 4px 8px; max-width: 320px; }
.ai-pulse:hover { border-color: var(--blue); }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: 0 0 auto; }
.ai-dot.live { background: var(--blue); box-shadow: 0 0 0 0 rgba(59,130,246,.7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(59,130,246,0); } 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); } }
.ai-face { font-weight: 700; font-size: 10px; color: #8ab4ff; letter-spacing: .5px; }
.ai-act { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.ai-act.act { color: var(--yellow); font-weight: 600; }
.ai-pnl { font-size: 11px; }

/* ---- AI dashboard */
.ai-dash { display: grid; grid-template-columns: 1fr 300px; gap: 8px; padding: 8px; height: 100%; }
.ai-stream { display: flex; flex-direction: column; min-height: 0; background: var(--bg2); border-radius: 4px; }
.ai-head { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-bottom: var(--border); font-size: 12px; }
.ai-rows { flex: 1; overflow-y: auto; padding: 2px 0; }
.ai-row { display: grid; grid-template-columns: 58px 16px 110px 90px 1fr; gap: 6px; padding: 3px 10px; font-size: 11.5px; align-items: baseline; border-left: 2px solid transparent; }
.ai-row:hover { background: var(--bg3); }
.ai-row .t { color: var(--dim); font-family: var(--mono); font-size: 10.5px; }
.ai-row .ic { color: var(--muted); text-align: center; }
.ai-row .lbl { color: var(--muted); }
.ai-row .sym b { color: var(--text); cursor: pointer; } .ai-row .sym b:hover { color: var(--yellow); }
.ai-row .det { color: var(--dim); font-family: var(--mono); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.ai-row.action { border-left-color: var(--yellow); background: rgba(252,213,53,.05); } .ai-row.action .lbl { color: var(--yellow); font-weight: 600; } .ai-row.action .ic { color: var(--yellow); }
.ai-row.fill.buy { border-left-color: var(--green); } .ai-row.fill.buy .ic, .ai-row.fill.buy .lbl { color: var(--green); }
.ai-row.fill.sell { border-left-color: var(--red); } .ai-row.fill.sell .ic, .ai-row.fill.sell .lbl { color: var(--red); }
.ai-row.err { border-left-color: var(--red); }
.ai-row.note { grid-template-columns: 58px 16px 110px 1fr; border-left-color: #8ab4ff; background: rgba(59,130,246,.06); align-items: start; }
.ai-row.note .lbl { color: #8ab4ff; font-weight: 600; }
.note-text { color: var(--text); white-space: pre-wrap; word-break: break-word; font-size: 11.5px; line-height: 1.5; }
.ai-side { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.ai-card { background: var(--bg2); border-radius: 4px; padding: 9px 11px; }
.ai-card h5 { margin: 0 0 6px; font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }
.ai-eq { display: flex; flex-direction: column; gap: 1px; } .ai-eq b { font-family: var(--mono); font-size: 18px; } .ai-eq span:last-child { font-family: var(--mono); font-size: 11px; }
.spark { width: 100%; height: 46px; margin: 6px 0; display: block; }
.ai-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.ai-mini div { display: flex; justify-content: space-between; font-size: 11px; } .ai-mini span { color: var(--muted); } .ai-mini b { font-family: var(--mono); font-weight: 500; }
.ai-pos { display: grid; grid-template-columns: 1.4fr .7fr 1fr; gap: 6px; padding: 3px 0; font-size: 11px; cursor: pointer; align-items: baseline; }
.ai-pos:hover { background: var(--bg3); } .ai-pos .num { text-align: right; font-size: 11px; }
.ai-thesis { font-size: 11.5px; line-height: 1.5; color: var(--text); max-height: 140px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.mk-row.ai-held { box-shadow: inset 2px 0 0 var(--blue); } .mk-row.ai-watch { box-shadow: inset 2px 0 0 rgba(59,130,246,.35); }

/* ---- scoreboard */
.board { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.board-row { display: grid; grid-template-columns: 34px 150px 150px 1fr 110px 150px 120px 150px; gap: 10px; align-items: center;
  background: var(--bg2); border-radius: 5px; padding: 8px 12px; border-left: 3px solid transparent; }
.board-row.lead { border-left-color: var(--yellow); background: linear-gradient(90deg, rgba(252,213,53,.07), var(--bg2) 40%); }
.board-row.me { outline: 1px solid var(--bg4); }
.board-row .rank { font-size: 16px; text-align: center; color: var(--muted); }
.board-row .who { display: flex; flex-direction: column; } .board-row .who b { font-size: 14px; }
.board-row .money { display: flex; flex-direction: column; font-family: var(--mono); } .board-row .money b { font-size: 16px; }
.board-row .barwrap { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.board-row .bar { height: 100%; border-radius: 4px; } .board-row .bar.up { background: var(--green); } .board-row .bar.down { background: var(--red); }
.board-row .eq, .board-row .split, .board-row .rec { display: grid; grid-template-columns: auto auto; gap: 1px 8px; font-family: var(--mono); align-items: baseline; }
.board-row .eq b, .board-row .split b, .board-row .rec b { font-weight: 500; text-align: right; }
.board-row .spark { height: 34px; margin: 0; }

/* ---- on-chart trade badges */
.chart-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.ctag { position: absolute; left: 0; top: 0; white-space: nowrap; }
.ctag-line { position: absolute; left: 0; top: 50%; height: 1px; background: currentColor; opacity: .55; transform-origin: 0 50%; }
.ctag.flip .ctag-line { left: 100%; }
.ctag-dot { position: absolute; left: -3px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: currentColor; }
.ctag.flip .ctag-dot { left: auto; right: -3px; }
.ctag-box { display: inline-flex; flex-direction: column; gap: 1px; background: #11151c; border: 1px solid currentColor; border-left-width: 3px; border-radius: 4px; padding: 3px 7px; box-shadow: 0 2px 10px rgba(0,0,0,.55); }
.ctag-t { font-size: 10px; font-weight: 700; letter-spacing: .3px; color: currentColor; }
.ctag-t em { font-style: normal; font-family: var(--mono); font-weight: 400; color: var(--text); margin-left: 5px; letter-spacing: 0; }
.ctag-pnl { font-family: var(--mono); font-size: 11px; font-weight: 600; }
.ctag-pnl i { font-style: normal; font-weight: 400; opacity: .75; font-size: 10px; }
.ctag-pnl.good { color: var(--green); } .ctag-pnl.bad { color: var(--red); }
/* a running trade is green/red by its live P&L; a finished one is neutral grey */
.ctag.win { color: var(--green); } .ctag.loss { color: var(--red); }
.ctag.exit, .ctag.flat { color: var(--muted); } .ctag.liq { color: var(--red); }
.ctag.win .ctag-box { background: linear-gradient(180deg, rgba(14,203,129,.16), rgba(17,21,28,.96)); }
.ctag.loss .ctag-box { background: linear-gradient(180deg, rgba(246,70,93,.16), rgba(17,21,28,.96)); }
.ctag.liq .ctag-box { background: linear-gradient(180deg, rgba(246,70,93,.22), rgba(17,21,28,.96)); }
.ctag.exit .ctag-box, .ctag.flat .ctag-box { background: rgba(17,21,28,.94); }
.ctag.exit .ctag-line, .ctag.flat .ctag-line { opacity: .35; }

/* ---- bet direction + live result badges */
.bet-dir { display: inline-block; font-family: var(--font); font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; letter-spacing: .3px; white-space: nowrap; }
.bet-dir.up { background: var(--green-bg); color: var(--green); }
.bet-dir.down { background: var(--red-bg); color: var(--red); }
.bet-dir.exit { background: var(--bg3); color: var(--muted); }
.bet-res { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 500; white-space: nowrap; }
.bet-res b { font-weight: 600; }
.bet-res.good { color: var(--green); } .bet-res.bad { color: var(--red); }
.ai-pos2 { padding: 4px 0; border-bottom: 1px solid rgba(43,49,57,.5); cursor: pointer; }
.ai-pos2:last-child { border-bottom: 0; }
.ai-pos2:hover { background: var(--bg3); }
.ai-pos2 .l1 { display: flex; align-items: center; gap: 5px; font-size: 11.5px; }
.ai-pos2 .l1 .num { margin-left: auto; font-family: var(--mono); }
.ai-pos2 .l2 { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 1px; color: var(--muted); font-family: var(--mono); font-size: 10.5px; }

/* ---- toasts */
.toasts { position: fixed; right: 16px; top: 60px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--bg2); border-left: 3px solid var(--yellow); padding: 10px 14px; border-radius: 4px; min-width: 260px; box-shadow: 0 4px 16px rgba(0,0,0,.4); animation: tin .2s; }
.toast.ok { border-color: var(--green); } .toast.err { border-color: var(--red); } .toast.info { border-color: var(--blue); }
.toast b { display: block; margin-bottom: 2px; } .toast .num { color: var(--muted); }
@keyframes tin { from { transform: translateX(20px); opacity: 0; } }

@media (max-width: 1200px) { .layout { grid-template-columns: 260px 1fr 300px; } }
