/* ===== Live console (js/console.js): a live Runner as one full-screen trading desk =====
   Token strip · chart | live trades | right rail (trade, automations, actions) · tabs under the chart.
   Every section sits in one of four docks (chart area, beside the chart, bottom tabs, right rail) and can be moved,
   hidden or resized (Layout menu, Customize mode, splitters). Colours come from look 9: .seg, .btn.pri, .st, up / dn.
   One frosted surface per zone, no hard borders crossing, 32px rows, 12–13px text, 8 / 12px gaps.
   ≥1101px it fills the screen above the status bar (zones scroll inside); below that it stacks. */
.cx { --cx-g: 8px; --cx-r: 14px; --cx-row: 32px;
  --cx-fz: var(--fz-top, linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0) 42%)), var(--fz, rgba(18,22,29,.62));
  --cx-blur: var(--fz-blur, blur(28px) saturate(1.15));
  --cx-edge: inset 0 1px 0 rgba(255,255,255,.09), inset 0 0 0 1px rgba(255,255,255,.045);
  --cx-ice: var(--ac-ice, #f0f7ff); --cx-steel: var(--ac, #c9dcf2);
  --cx-fill: rgba(255,255,255,.04); --cx-fill2: rgba(255,255,255,.07);
  font-size: 12.5px; color: var(--tx); box-sizing: border-box; }
.cx *, .cx *::before, .cx *::after { box-sizing: border-box; }
.cx .sp { flex: 1; }
.cx .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cx kbd { font: 500 10.5px var(--fm); padding: 1px 5px; border-radius: 5px; background: var(--cx-fill2); color: var(--tx2); }

/* ---------- shell around the console ---------- */
body.cx-mode .app.side > .main::before { display: none !important; }
@media (min-width: 1101px) {
  body.cx-mode .app.side .main > .topbar { display: none !important; }
  body.cx-mode:not(.cx-sb) .app.side { grid-template-columns: minmax(0, 1fr) !important; --fr-sbw: 0px !important; }
  body.cx-mode:not(.cx-sb) .app.side > .sb { display: none !important; }
  body.cx-mode .app.side .main { min-height: 0; height: 100vh; height: 100dvh; padding-bottom: var(--cx-stb, 26px); overflow: hidden; }
  body.cx-mode #view { min-height: 0; min-width: 0; }
  html:has(body.cx-mode) { overflow: hidden; }
  body.cx-mode #run-bg::before { opacity: .22 !important; }
  .cx { height: calc(100vh - var(--cx-stb, 26px)); height: calc(100dvh - var(--cx-stb, 26px)); display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); gap: var(--cx-g); padding: var(--cx-g) 12px var(--cx-g); }
  .cx-body { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); gap: var(--cx-g); min-height: 0; min-width: 0; }
  .cx-grid { min-width: 0; }
  .cx-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--cx-g) var(--cx-rail, 340px); min-height: 0; }
  .cx-left { display: grid; grid-template-rows: var(--cx-top, 60%) var(--cx-g) minmax(0, 1fr); min-height: 0; min-width: 0; }
  .cx-top { display: grid; grid-template-columns: minmax(0, 1fr) var(--cx-g) var(--cx-tapew, 340px); min-height: 0; min-width: 0; }
  .cx-rail { display: flex; flex-direction: column; gap: var(--cx-g); min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-radius: var(--cx-r); }
  /* a dock hidden (all its sections hidden or moved): its neighbours take the room */
  .cx-grid.one, .cx-top.one { grid-template-columns: minmax(0, 1fr); }
  .cx-left.one { grid-template-rows: minmax(0, 1fr); }
  .cx-body.has-cz { grid-template-rows: auto minmax(0, 1fr) !important; }
}

/* ---------- zones: one frosted surface each (blur on a layer behind, so pop-ups inside are not trapped) ---------- */
.cx-z, .cx-strip, .cx-seq, .cx-drawer { position: relative; isolation: isolate; border-radius: var(--cx-r); background: var(--cx-fz); box-shadow: var(--cx-edge), var(--fz-sh, 0 18px 40px -26px rgba(0,0,0,.7)); }
.cx-z::before, .cx-strip::before, .cx-seq::before, .cx-drawer::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; -webkit-backdrop-filter: var(--cx-blur); backdrop-filter: var(--cx-blur); }
.cx-z { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.cx-zh { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; font-size: 12.5px; flex: none; }
.cx-zh b { font-weight: 600; color: var(--tx); }
.cx-zh .muted { font-size: 11.5px; }

/* segmented pills (timeframes, units, filters) */
.cx .seg.cx-seg { flex: none; flex-wrap: nowrap; padding: 2px; }
.cx .seg.sm.cx-seg button { height: 24px; padding: 0 8px; font-size: 12px; cursor: pointer; }
.cx-zh .seg.sm.cx-seg button, .cx-tabbar .seg.sm.cx-seg button { height: 22px; padding: 0 7px; font-size: 11.5px; }
.cx-ib { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border: 0; border-radius: 9px; background: var(--cx-fill); color: var(--tx2); cursor: pointer; transition: background .15s, color .15s; }
.cx-ib:hover, .cx-ib[aria-pressed="true"] { background: var(--cx-fill2); color: var(--tx); }
.cx :is(button, a):focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(223,233,245,.55) !important; }

/* ---------- token strip ---------- */
.cx-strip { z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 10px 0 8px; }
.cx-home { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; }
/* the sidebar's mini mark: the ice gl14 flame at rest, the living red flame only on hover / keyboard focus (never :focus,
   so a click that leaves focus on the link does not keep it red) */
.cx-home.mini-mark .mm { width: 28px; height: 28px; opacity: 1; }
.cx-home.mini-mark .mm-live { width: 34px; height: 34px; margin: -17px 0 0 -17px; opacity: 0; }
.cx-home.mini-mark:is(:hover, :focus-visible) .mm-live { opacity: 1; }
.cx-home.mini-mark:is(:hover, :focus-visible) .mm { opacity: 0; filter: none !important; }
.cx-home.mini-mark:focus:not(:focus-visible) .mm-live { opacity: 0; }
.cx-who { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; flex: none; }
.cx-pfp { display: grid; flex: none; }
.cx-pfp > * { border-radius: 9px; }
.cx-id { display: grid; gap: 1px; min-width: 0; }
.cx-name { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 2px; margin-left: -2px; height: 22px; border: 0; border-radius: 7px; background: none; color: var(--tx); cursor: pointer; font: inherit; }
.cx-name:hover, .cx-name[aria-expanded="true"] { background: var(--cx-fill2); }
.cx-name b { font: 600 14px var(--f); }
.cx-name span { color: var(--tx2); font-size: 12.5px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-name .i { color: var(--tx3); }
.cx-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--tx3); white-space: nowrap; }
.cx-st { display: inline-flex; align-items: center; gap: 5px; color: var(--tx2); }
.cx-st.live { color: var(--up); }
.cx-st.live i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: cxPulse 1.8s ease-out infinite; }
@keyframes cxPulse { 70% { box-shadow: 0 0 0 5px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.cx-l1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cx-ven { color: var(--tx3); font-size: 11.5px; white-space: nowrap; }
.cx-ca { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--tx2); font-size: 11.5px; cursor: pointer; }
.cx-ca:hover { color: var(--tx); }
.cx-demo { padding: 1px 6px; border-radius: 6px; font-size: 10.5px; color: var(--cx-steel); background: rgba(201,220,242,.08); box-shadow: inset 0 0 0 1px rgba(201,220,242,.14); }
.cx-pills { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent); }
.cx-pills::-webkit-scrollbar { display: none; }
.cx-pill { display: grid; gap: 1px; flex: none; padding: 3px 9px; border-radius: 10px; background: var(--cx-fill); line-height: 1.25; }
.cx-pill small, .cx-chg small { font-size: 10.5px; color: var(--tx3); white-space: nowrap; }
.cx-pill b { font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.cx-pill.big b { font-size: 13px; color: var(--cx-ice); }
.cx-chg { display: flex; gap: 9px; }
.cx-chg > span { display: grid; gap: 1px; }
.cx-acts { display: flex; gap: 6px; flex: none; }
.cx-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 9px; background: var(--cx-fill); color: var(--tx); font: 500 12.5px var(--f); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s; }
.cx-btn:hover { background: var(--cx-fill2); }
.cx-btn.btn.pri { height: 30px; padding: 0 12px; }                 /* the app's primary button (look 9 .btn.pri) */
.cx-btn.on { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac) 55%, transparent); color: var(--ac-ice, var(--tx)); }

/* Runner switcher */
.cx-swp { position: absolute; top: calc(100% + 10px); left: 0; z-index: 50; width: 380px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02) 40%), rgba(20,24,31,.86); -webkit-backdrop-filter: blur(30px) saturate(1.2); backdrop-filter: blur(30px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 0 0 1px rgba(255,255,255,.07), 0 30px 70px -24px rgba(0,0,0,.9);
  opacity: 0; transform: translateY(-4px); visibility: hidden; transition: opacity .16s ease, transform .16s ease, visibility 0s .16s; }
.cx-swp.on { opacity: 1; transform: none; visibility: visible; transition: opacity .16s ease, transform .16s ease; }
.cx-swq { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; color: var(--tx3); box-shadow: inset 0 -1px 0 rgba(255,255,255,.05); }
.cx-swq input { flex: 1; min-width: 0; border: 0; background: none; color: var(--tx); font: 13px var(--f); outline: none; }
.cx-swl { max-height: 320px; overflow-y: auto; padding: 4px; }
.cx-swr { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px; border-radius: 9px; color: var(--tx); text-decoration: none; }
.cx-swr[hidden] { display: none; }
.cx-swr:hover, .cx-swr.act { background: var(--cx-fill2); }
.cx-swr.cur { box-shadow: inset 0 0 0 1px rgba(223,233,245,.14); }
.cx-swt { display: grid; min-width: 0; } .cx-swt b { font-weight: 600; font-size: 13px; } .cx-swt small { font-size: 11.5px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-swr .st { font-size: 10.5px; }
.cx-swp footer { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; font-size: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.cx-swp footer a { display: inline-flex; align-items: center; gap: 5px; color: var(--tx2); text-decoration: none; } .cx-swp footer a:hover { color: var(--tx); }

/* ---------- docks and sections ---------- */
.cx-dock > .cx-pane { flex: 1; min-height: 0; }
.cx-pane.p-chart { display: grid; padding: 0; overflow: hidden; animation: none; }
.cx-pane.p-trades { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.cx-pane:is(.p-trade, .p-autos, .p-actions, .p-mmp, .p-ssp, .p-ttp) { padding: 0; }
.cx-dock .cx-pane.p-autos { padding-top: 6px; } .cx-dock .cx-pane.p-actions { padding-top: 6px; }
.cx-pane:is(.p-mmp, .p-ssp, .p-ttp) > .trade { padding: 4px 12px 12px; }
.cx-dock.is-empty, .cx-rail.is-empty > .cx-z { display: grid; place-items: center; }
.cx .dock-empty.cx-dz { margin: 10px; padding: 18px 14px !important; }
.cx .dock-empty.cx-dz b { font-weight: 600; color: var(--tx); }
/* sections stacked in the right rail: small ones take their height, tall ones get a fixed box that scrolls inside */
.cx-rs:not(.tall) > .cx-pane { overflow: visible; animation: none; }
.cx-rail > .cx-rs.tall { flex: none; height: 340px; overflow: hidden; }
.cx-rail > .cx-rs.tall > .cx-pane { flex: 1; min-height: 0; overflow: auto; }
.cx-rail > .cx-rs.s-chart { height: 320px; }
.cx-rail .cx-rs.tall .p-trades { overflow: hidden; }
/* Customize mode: grips, hide ×, move buttons, drop targets (the old dock's grip / drop marker) */
.cx .grip { width: 6px; height: 12px; flex: none; opacity: .4; cursor: grab; background-image: radial-gradient(circle, currentColor 1.1px, transparent 1.3px); background-size: 3px 4px; transition: opacity .15s; }
.cx :is([data-cx-drag]:hover) .grip, .cx [data-cx-drag]:hover > .grip { opacity: .9; }
.cx [data-cx-drag] { cursor: grab; } .cx [data-cx-drag]:active { cursor: grabbing; }
.cx-eh { gap: 7px; box-shadow: inset 0 -1px 0 rgba(255,255,255,.05); }
.cx-eh > .i { color: var(--ac); }
.cx-hx, .cx-mv { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--tx3); cursor: pointer; }
.cx-hx:hover, .cx-mv:hover:not(:disabled) { color: var(--tx); background: var(--cx-fill2); }
.cx-mv:disabled { opacity: .3; cursor: default; }
.cx-tabbar .cx-hx { width: 16px; height: 16px; margin-right: -4px; }
.cx.cz .cx-dock, .cx.cz .cx-rs { box-shadow: var(--cx-edge), inset 0 0 0 1px color-mix(in srgb, var(--ac) 22%, transparent); }
.cx .dragging { opacity: .35; }
body.dock-dragging .cx [data-cx-dock] { outline: 1px dashed color-mix(in srgb, var(--ac) 40%, transparent); outline-offset: -3px; }
body.dock-dragging .cx [data-cx-dock].drop-on { outline: 2px solid color-mix(in srgb, var(--ac) 70%, transparent); background-color: color-mix(in srgb, var(--ac) 6%, transparent); }
.cx .dock-mark.h { width: auto; height: 3px; align-self: stretch; margin: 0 12px; }
.cx-cz { padding: 6px 8px 6px 12px; font-size: 12.5px; }
.cx-cz .btn { height: 28px; }

/* ---------- Layout menu (token strip) ---------- */
.cx-layw { position: relative; display: flex; }
.cx-lay { position: absolute; top: calc(100% + 12px); right: 0; z-index: 50; width: 430px; max-width: calc(100vw - 24px); max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); display: flex; flex-direction: column; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02) 40%), rgba(20,24,31,.9); -webkit-backdrop-filter: blur(30px) saturate(1.2); backdrop-filter: blur(30px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 0 0 1px rgba(255,255,255,.07), 0 30px 70px -24px rgba(0,0,0,.9);
  opacity: 0; transform: translateY(-4px); visibility: hidden; transition: opacity .16s ease, transform .16s ease, visibility 0s .16s; }
.cx-lay.on { opacity: 1; transform: none; visibility: visible; transition: opacity .16s ease, transform .16s ease; }
.cx-lh { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px 6px; } .cx-lh b { font: 600 13.5px var(--f); } .cx-lh .muted { font-size: 11.5px; }
.cx-ll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 6px 6px; }
.cx-lg { padding: 4px 0; } .cx-lg + .cx-lg { box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.cx-lg > small { display: block; padding: 6px 8px 2px; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--tx3); }
.cx-lg > p { margin: 0; padding: 4px 8px; font-size: 12px; }
.cx-lr { display: grid; grid-template-columns: 16px minmax(0, 1fr) 132px 20px 20px 32px; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 8px; border-radius: 8px; font-size: 12.5px; }
.cx-lr:hover { background: var(--cx-fill); }
.cx-lr > .i { color: var(--tx2); } .cx-lr.off > .i, .cx-lr.off .cx-lt { color: var(--tx3); }
.cx-lt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-lw { height: 24px; min-width: 0; padding: 0 6px; border: 0; border-radius: 7px; background: var(--cx-fill); color: var(--tx2); font: 12px var(--f); cursor: pointer; }
.cx-lr.off .cx-lw { color: var(--tx3); }
.cx-lw option { background: #161a21; color: #e8edf3; }
.cx-sw { position: relative; width: 30px; height: 18px; padding: 0; border: 0; border-radius: 999px; background: var(--bg3, rgba(255,255,255,.1)); cursor: pointer; transition: background .15s; }
.cx-sw i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--tx2); transition: transform .15s, background .15s; }
.cx-sw[aria-checked="true"] { background: var(--ac); } .cx-sw[aria-checked="true"] i { transform: translateX(12px); background: #fff; }
.cx-lay footer { display: flex; align-items: center; gap: 8px; padding: 8px 10px; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }

/* ---------- launch sequence (not shown in the console any more) ---------- */
.cx-seq { border-radius: 12px; }
.cx-seqh { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 12px; border: 0; background: none; color: var(--tx2); font: 12px var(--f); cursor: pointer; text-align: left; }
.cx-seqh b { font-weight: 600; color: var(--tx); }
.cx-seqh > .i:first-child { color: var(--cx-ice); }
.cx-seqh > .i:last-child { color: var(--tx3); transition: transform .2s ease; }
.cx-seq.open .cx-seqh > .i:last-child { transform: rotate(180deg); }
.cx-seqb { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease; }
.cx-seq.open .cx-seqb { grid-template-rows: 1fr; }
.cx-seqb > ol { min-height: 0; overflow: hidden; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0 12px; list-style: none; font-size: 12px; color: var(--tx2); }
.cx-seq.open .cx-seqb > ol { padding-bottom: 8px; }
.cx-seqb li { display: inline-flex; align-items: center; gap: 6px; }
.cx-seqb li i { display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: rgba(223,233,245,.14); color: var(--cx-ice); }

/* ---------- splitters ---------- */
.cx-split { position: relative; z-index: 2; touch-action: none; outline: none; }
.cx-split.v { cursor: col-resize; }
.cx-split.h { cursor: row-resize; }
.cx-split::after { content: ""; position: absolute; border-radius: 2px; background: rgba(201,220,242,0); transition: background .15s; }
.cx-split.v::after { top: 30%; bottom: 30%; left: 3px; width: 2px; }
.cx-split.h::after { left: 40%; right: 40%; top: 3px; height: 2px; }
.cx-split:hover::after, .cx-split.on::after, .cx-split:focus-visible::after { background: rgba(201,220,242,.45); }
body.cx-drag { user-select: none; } body.cx-drag-v, body.cx-drag-v * { cursor: col-resize !important; } body.cx-drag-h, body.cx-drag-h * { cursor: row-resize !important; }

/* ---------- chart ---------- */
.cx-chart { container-type: inline-size; }
.cx-chart .c-chart-in { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; padding: 0 4px 0 8px; }
.cx-ct { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 4px; min-width: 0; }
.cx-ohlc { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cx-chart .c-tog { background: var(--cx-fill) !important; border: 0 !important; flex: none; }
.cx-chart .c-tog button { height: 22px; font-size: 11.5px; }
.cx .cx-chart .chart-box { min-height: 0 !important; height: 100%; }
.cx-chart .c-foot { min-height: 28px; font-size: 11px; }

/* ---------- live trades ---------- */
.cx-tape { flex: 1; min-height: 0; overflow-y: auto; padding: 0 6px 6px; font-size: 12px; }
.cx .cx-tape .tp-r { grid-template-columns: 28px 28px 50px minmax(92px, 1.1fr) minmax(64px, 1fr) 18px; gap: 6px; padding: 0 4px; min-height: 28px; align-items: center; white-space: nowrap; }
.cx .cx-tape .tp-r > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cx .cx-tape .tp-amt-h { display: flex; align-items: center; gap: 4px; overflow: visible; }
.cx .cx-tape .tp-amt-h .ccy button { height: 18px; padding: 0 4px; font-size: 10px; }
.cx .cx-tape .who .tg-info { display: none; }
.cx .cx-tape .who { justify-content: flex-start; text-align: left; }
.cx-tapez { container-type: inline-size; }
@container (max-width: 330px) { .cx .cx-tape .tp-r { grid-template-columns: 26px 28px minmax(78px, 1.1fr) minmax(56px, 1fr) 18px; gap: 5px; } .cx .cx-tape .tp-r > :nth-child(3) { display: none; } }
.cx .cx-tape .tp-r .trk-b { width: 18px; height: 18px; padding: 0; }
.cx .cx-tape .tp-r > :nth-child(4) { display: none; }
.cx .cx-tape .tp-h { position: sticky; top: 0; z-index: 1; background: rgba(20,24,31,.92); font-size: 11px; color: var(--tx3); }
.cx .cx-tape .tg-leg { display: none; }
.cx .cx-tape .who { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cx-tape[data-f="others"] .tp-r:not(.tp-h):not(.cx-oth) { display: none; }
.cx-tape[data-f="dev"] .tp-r:not(.tp-h):not(.cx-dev) { display: none; }
.cx-tape[data-f="trk"] .tp-r:not(.tp-h):not(.cx-trk) { display: none; }
.cx-trk-hint { margin: 0; padding: 8px 12px; font-size: 12px; color: var(--tx3); } .cx-trk-hint:empty { display: none; }

/* ---------- bottom tabs ---------- */
.cx-tabbar { display: flex; align-items: center; gap: 2px; min-height: 40px; padding: 0 8px; flex: none; overflow-x: auto; scrollbar-width: none; }
.cx-tabbar [role="tab"] { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--tx3); font: 500 12.5px var(--f); white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.cx-tabbar [role="tab"]:hover { color: var(--tx); background: var(--cx-fill); }
.cx-tabbar [role="tab"].on { color: #fff; background: var(--cx-fill2); }
.cx-tabbar [role="tab"].on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -5px; height: 2px; border-radius: 2px; background: var(--cx-ice); box-shadow: 0 0 8px rgba(223,233,245,.6); }
.cx-tabbar em { font-style: normal; font-size: 10.5px; color: var(--tx3); }
.cx-tabbar em:empty { display: none; }
.cx-pane { flex: 1; min-height: 0; overflow: auto; padding: 4px 10px 10px; animation: cxIn .2s ease; }
@keyframes cxIn { from { opacity: 0; transform: translateY(4px); } }
.cx-empty { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; text-align: center; color: var(--tx3); }
.cx-empty b { color: var(--tx); font-weight: 600; } .cx-empty span { max-width: 380px; font-size: 12px; }
.cx-oh { display: flex; align-items: center; gap: 8px; height: 32px; font-size: 12px; color: var(--tx3); }
.cx-ot tr:not(.open) td { color: var(--tx3); }

/* density inside the console and its drawers: 32px rows, 12–13px text */
.cx :is(.tbl th, .tbl td) { height: var(--cx-row); padding-top: 0; padding-bottom: 0; font-size: 12.5px; }
.cx .tbl th { font-size: 11px; position: sticky; top: 0; z-index: 1; background: rgba(20,24,31,.92); }
.cx .tbl-wrap, .cx .tw-con { border: 0; background: none; }
.cx .wc .pc button { height: 22px; min-width: 0; padding: 0 5px; font-size: 11px; }
.cx .hotkeys { font-size: 11.5px; padding: 8px 2px 0; }
.cx-pane :is(.card, .stat) { box-shadow: none !important; background: rgba(255,255,255,.025) !important; }
.cx-pane :is(.card, .stat)::after { content: none !important; }
.cx-pane .split { gap: 12px; }
.cx-pane .g5.stats { gap: 8px; }
.cx-pane .bmap { max-height: 340px; }
.cx-swarm > .card { margin-bottom: 8px; }

/* ---------- right rail ---------- */
.cx-rail > .cx-z { overflow: visible; flex: none; }
.cx-trade .trade { padding: 10px 12px 12px; display: grid; gap: 8px; }
.cx-dock .cx-trade { overflow: auto; }
.cx-trade .field { margin: 0; }
.cx-trade :is(.inp, .sel) { min-height: 34px; }
.cx-trade .presets button { height: 28px; }
.cx-trade .bs button { height: 34px; }
.cx-trade .kv > div { min-height: 26px; font-size: 12px; }
.cx-trade .buyb { height: 36px; }
/* Automations rows and the Actions list: see cx-actions.css (rail round) */

/* ---------- drawers: the full pages and editors, from the right ---------- */
.cx-scrim { position: absolute; inset: 0; z-index: 39; border-radius: var(--cx-r); background: rgba(6,8,12,.38); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.cx-scrim.on { opacity: 1; pointer-events: auto; }
.cx-drawer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 40; width: min(900px, calc(100% - 96px)); display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02) 40%), rgba(18,22,29,.84);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 0 0 1px rgba(255,255,255,.07), -30px 0 80px -30px rgba(0,0,0,.85);
  transform: translateX(calc(100% + 24px)); visibility: hidden; transition: transform .2s ease, visibility 0s .2s; }
.cx-drawer.on { transform: none; visibility: visible; transition: transform .2s ease; }
.cx-dh { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 16px; flex: none; box-shadow: inset 0 -1px 0 rgba(255,255,255,.05); }
.cx-dh b { font: 600 14px var(--f); } .cx-dh > .i { color: var(--cx-ice); }
.cx-db { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 20px; overscroll-behavior: contain; }
.cx-db .tstrip { display: none !important; }
.cx-db > .page, .cx-db .page { padding: 0 !important; margin: 0 !important; max-width: none !important; min-height: 0 !important; display: grid; gap: 12px; }
.cx-db .ph { margin: 0; padding: 0; } .cx-db .ph h1 { font-size: 22px; } .cx-db .ph p { font-size: 12.5px; }
.cx-db :is(.card, .stat, .engine-strip) { box-shadow: none !important; background: rgba(255,255,255,.03) !important; }
.cx-db :is(.card, .stat, .engine-strip)::after { content: none !important; }
.cx-db .split, .cx-db .g3, .cx-db .g2 { gap: 12px; }
.cx :is(.cx-db, .cx-pane) .g5.stats, .cx-db .g4.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  .cx-drawer, .cx-scrim, .cx-swp, .cx-seqb, .cx-split::after, .cx-seqh > .i:last-child { transition: none !important; }
  .cx-pane, .cx-st.live i { animation: none !important; }
}

/* ---------- below 1101px: the same zones, stacked; the page scrolls ---------- */
@media (max-width: 1100px) {
  .cx { display: flex; flex-direction: column; gap: var(--cx-g); padding: var(--cx-g) 0; }
  .cx-body, .cx-grid, .cx-left, .cx-top, .cx-rail { display: flex; flex-direction: column; gap: var(--cx-g); position: static; }
  .cx-strip { flex-wrap: wrap; gap: 8px; padding: 8px; }
  .cx-pills { order: 3; flex-basis: 100%; }
  .cx-acts { margin-left: auto; }
  .cx-split { display: none; }
  .cx-d-main { height: 420px; } .cx-d-tape { height: 360px; } .cx-d-bottom { height: 560px; }
  .cx-lay { position: fixed; top: 64px; right: 12px; }
  .cx-scrim { position: fixed; border-radius: 0; z-index: 70; }
  .cx-drawer { position: fixed; top: 0; bottom: 0; right: 0; width: min(780px, 100vw); border-radius: 0; z-index: 71; }
  .cx-swp { position: fixed; top: 64px; left: 12px; }
}
@media (max-width: 1100px) {
  .cx-sbt { display: none; }                                   /* the sidebar is the normal menu here */
  .cx-ct { overflow-x: auto; scrollbar-width: none; }
  body.cx-mode .topbar .crumb { display: none; }              /* the token strip names the Runner */
}
@media (max-width: 760px) { .cx .cx-tape .tp-r > :nth-child(3) { display: block; } }
@media (max-width: 640px) { .cx-acts .cx-btn span { display: none; } .cx-name span { display: none; } .cx-d-main { height: 360px; } }

/* narrower desks (1280–1399px): icon-only secondary buttons, no long name, tighter chart toolbar */
@container (max-width: 760px) { .cx-ohlc { display: none; } }
@container (max-width: 620px) { .cx-chart .c-leg { display: none; } .cx-seg button { padding: 0 6px; } }
@media (min-width: 1101px) and (max-width: 1399px) {
  .cx-acts .cx-btn:not(.pri) span { display: none; }
  .cx-acts .cx-btn:not(.pri) { width: 30px; padding: 0; justify-content: center; }
  .cx-name span { display: none; }
  .cx-strip { gap: 10px; }
}
/* sidebar switched back on: the strip has 264px less, so it goes compact too */
@media (min-width: 1101px) {
  body.cx-sb .cx-acts .cx-btn:not(.pri) span, body.cx-sb .cx-name span { display: none; }
  body.cx-sb .cx-acts .cx-btn:not(.pri) { width: 30px; padding: 0; justify-content: center; }
  body.cx-sb .cx-strip { gap: 10px; }
}
/* launch sequence strip removed from the live console: the grid takes the full height */
@media (min-width: 1101px) { .cx-body { grid-template-rows: minmax(0, 1fr); } }

/* sections placed in a narrow dock (beside the chart, the right rail) get the old right-dock compact layouts */
.cx-pane:not(.p-chart):not(.p-trades) { container-type: inline-size; }
@container (max-width: 560px) {
  .cx .hg-tiles { grid-template-columns: 1fr 1fr; }
  .cx .hg-tile > b { font-size: 20px; }
  .cx .hg-r { grid-template-columns: 22px minmax(0, 1fr) 64px; }
  .cx .hg-r > :nth-child(3), .cx .hg-r > :nth-child(4), .cx .hg-r > :nth-child(5) { display: none; }
}

/* ---------- Automations: rows and drawer header read the launch setup (console.js autoInfo) ---------- */
.cx-at { display: grid; gap: 1px; min-width: 0; }
.cx-at b { font-weight: 600; font-size: 13px; }
.cx-asum { font-size: 11px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cx-apl { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 74px; height: 22px; padding: 0 10px; border-radius: 999px; font: 600 11px/1 var(--f); letter-spacing: .005em; font-style: normal; white-space: nowrap;
  color: var(--tx3); background: var(--cx-fill); box-shadow: inset 0 0 0 1px transparent; transition: color .2s ease, background-color .2s ease, box-shadow .2s ease; }
.cx-apl i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; opacity: .5; transition: opacity .2s ease; }
.cx-apl.on { color: var(--up); background: color-mix(in srgb, var(--up) 13%, transparent); }
.cx-apl.on i { opacity: 1; animation: cxPulse 1.8s ease-out infinite; }
.cx-apl.set { color: var(--tx2); background: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.cx-apl.set i { display: none; }
.cx-adh { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-radius: 12px; background: var(--cx-fill); }
.cx-adt { display: grid; gap: 4px; flex: 1; min-width: 0; }
.cx-adr { display: flex; align-items: center; gap: 10px; } .cx-adr b { font: 600 14px var(--f); }
.cx-adh .cx-asum { font-size: 12px; }
.cx-sw.lg { width: 40px; height: 22px; } .cx-sw.lg i { width: 18px; height: 18px; } .cx-sw.lg[aria-checked="true"] i { transform: translateX(18px); }
.cx-sw { transition: background-color .2s ease; }
.cx-adn { margin: 0; font-size: 12.5px; }
.cx-ads { display: grid; gap: 8px; margin-bottom: 14px; }
.cx-ads > header { display: flex; align-items: baseline; gap: 8px; padding: 0 2px; } .cx-ads > header b { font: 600 13px var(--f); } .cx-ads > header small { font-size: 11.5px; color: var(--tx3); }
.cx-ads [data-sec] .lr-sum, .cx-ads [data-sec] .lr-grp h4 { display: none; }
.cx-ads [data-sec] .lr-grp { border-top: 0; padding-top: 0; margin-top: 0; }
.cx-ads > .trade, .cx-ads > .tt-form, .cx-ads > .lr-body { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.025); }
@media (prefers-reduced-motion: reduce) { .cx-apl, .cx-apl i, .cx-sw, .cx-sw i { transition: none !important; } .cx-apl.on i { animation: none !important; } }

/* ---------- Split: two bottom tab bars side by side (the old Live page's Split), resizable ---------- */
@media (min-width: 1101px) {
  .cx-bot2 { display: grid; grid-template-columns: minmax(0, calc(var(--cx-bsplit, 50%) - var(--cx-g) / 2)) var(--cx-g) minmax(0, 1fr); min-height: 0; min-width: 0; }
}
@media (max-width: 1100px) { .cx-bot2 { display: flex; flex-direction: column; gap: var(--cx-g); } .cx-d-bottom2 { height: 480px; } }
.cx-splitb { width: 26px; height: 26px; margin-left: 6px; }
.cx-splitb[aria-pressed="true"] { color: var(--ac-ice, var(--tx)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac) 45%, transparent); }

/* ---------- chart overlay switches, now in the token strip ---------- */
.cx .c-tog.cx-ctog { flex: none; gap: 2px; padding: 2px; border: 0; border-radius: 9px; background: var(--cx-fill); align-self: center; }
.cx .c-tog.cx-ctog button { height: 26px; padding: 0 8px; gap: 6px; font-size: 12px; }
.cx .c-tog.cx-ctog button i { width: 20px; height: 11px; } .cx .c-tog.cx-ctog button i::after { width: 7px; height: 7px; } .cx .c-tog.cx-ctog button.on i::after { left: 11px; }
@media (min-width: 1101px) and (max-width: 1399px) { .cx .c-tog.cx-ctog button { padding: 0 6px; } }

/* ---------- One UI language with the setup pages (Token & Venue, How, Review & launch) ----------
   Inter for text and numbers with tabular figures; mono only for addresses and hashes. Inside the console the app's mono
   token (--fm) points at Inter, so every number painted by the shared helpers follows; addresses are set back to mono. */
.cx { --fm: var(--f); --fm-addr: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.cx .mono { font-family: var(--f); }
.cx :is(.cx-ca, .hg-id small, .wn-t small.mono, .tp-r .who .mono, .ts-addr, .addr, code, kbd) { font-family: var(--fm-addr); font-variant-numeric: normal; }
.cx :is(.cx-pill b, .cx-chg b) { font-weight: 600; letter-spacing: -.005em; }
.cx .pc button { font-family: var(--f); font-weight: 600; }

/* wallet table (Per wallet / By folder): label over address, folder chip, clean numeric columns */
.cx .wc { font-size: 12.5px; }
.cx .wc .wn { gap: 8px; min-width: 0; }
.cx .wn-t { display: grid; min-width: 0; line-height: 1.15; } .cx .wn-t b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx .wn-t small { font-size: 10.5px; color: var(--tx3); white-space: nowrap; }
.cx .wn-f { flex: none; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; color: var(--tx3); background: var(--cx-fill); white-space: nowrap; }
.cx .wc .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx .wc th { white-space: nowrap; font-weight: 500; color: var(--tx3); }
.cx .wc .fold-row { background: var(--cx-fill); } .cx .wc .fold-row:hover { background: var(--cx-fill2); }
.cx .wc .fold-row td { border-top: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.cx .wc .fold-row .wn > .i { color: var(--tx2); }
.cx .wc .fold-chev { display: inline-grid; transition: transform .15s ease; } .cx .wc .fold-row.shut .fold-chev { transform: rotate(-90deg); }
.cx .wc tr.fw td:nth-child(2) { padding-left: 26px; }
.cx-pane { container-type: inline-size; }
@container (max-width: 760px) {
  .cx .wc :is(th, td) { padding-left: 6px; padding-right: 6px; }
  .cx .wc .pc button { min-width: 0; padding: 0 4px; } .cx .wc .pc button i { display: none; }
  .cx .wc .wn-f { display: none; }
}
@container (max-width: 560px) { .cx .wc :is(th, td):nth-child(5) { display: none; } }

/* Holders: soft frosted cards, colour only on the legend dot and the value accent, Inter numerals */
.cx .hg { display: grid; gap: 12px; }
.cx .hg-stack { height: 6px; gap: 2px; border-radius: 4px; }
.cx .hg-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@container (max-width: 700px) { .cx .hg-tiles { grid-template-columns: 1fr 1fr; } }
.cx .hg-tile { padding: 12px 14px; gap: 2px; border: 0; border-radius: 12px; background: rgba(255,255,255,.03); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), inset 0 0 0 1px rgba(255,255,255,.035); min-width: 0; }
.cx .hg-tt { font-size: 12px; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cx .hg-tt .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.cx .hg-tile > b { font: 600 22px/1.15 var(--f); letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx .hg-tile > small { font-size: 11px; }
.cx .hg-tile .hg-bar { height: 3px; margin-top: 6px; border-radius: 2px; background: rgba(255,255,255,.06); overflow: hidden; } .cx .hg-tile .hg-bar i { display: block; height: 100%; border-radius: inherit; }
.cx .hg-sec { border: 0; border-radius: 12px; background: rgba(255,255,255,.025); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.cx .hg-h { padding: 0 12px; height: 36px; background: none; border-bottom: 0; box-shadow: inset 0 -1px 0 rgba(255,255,255,.05); font-size: 12.5px; }
.cx .hg-h b { font-weight: 600; } .cx .hg-h small { font-size: 11px; }
.cx .hg-r { min-height: 36px; padding: 4px 12px; gap: 10px; border-bottom: 0; box-shadow: inset 0 -1px 0 rgba(255,255,255,.04); font-size: 12.5px; grid-template-columns: 24px minmax(0, 1.3fr) minmax(0, 70px) minmax(60px, 2fr) minmax(0, 100px) 64px; }
.cx .hg-r > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx .hg-id { display: grid; line-height: 1.15; } .cx .hg-id b { font-weight: 600; } .cx .hg-id small { font-size: 10.5px; color: var(--tx3); }
.cx .hg-r .hg-bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,.05); overflow: hidden; }
@container (max-width: 640px) { .cx .hg-r { grid-template-columns: 22px minmax(0, 1fr) 64px; } .cx .hg-r > :nth-child(3), .cx .hg-r > :nth-child(4), .cx .hg-r > :nth-child(5) { display: none; } }
@container (max-width: 380px) { .cx .hg-tiles { grid-template-columns: 1fr 1fr; } .cx .hg-tile > b { font-size: 18px; } }
html:root[data-theme="light"] .cx .hg-tile { background: rgba(255,255,255,.6); box-shadow: inset 0 0 0 1px rgba(20,40,70,.07); }
html:root[data-theme="light"] .cx .hg-sec { background: rgba(255,255,255,.5); box-shadow: inset 0 0 0 1px rgba(20,40,70,.07); }
html:root[data-theme="light"] .cx :is(.hg-h, .hg-r) { box-shadow: inset 0 -1px 0 rgba(20,40,70,.06); }
html:root[data-theme="light"] .cx :is(.hg-tile .hg-bar, .hg-r .hg-bar) { background: rgba(20,40,70,.07); }
html:root[data-theme="light"] .cx .wc .fold-row td { box-shadow: inset 0 1px 0 rgba(20,40,70,.06); }

/* tables in tabs and drawers (orders, log, results): setup-page type scale */
.cx :is(.cx-pane, .cx-db) .stat b, .cx :is(.cx-pane, .cx-db) .big-n { font-family: var(--f); font-weight: 600; font-variant-numeric: tabular-nums; }
.cx :is(.cx-pane, .cx-db) .stat b { font-size: 20px; letter-spacing: -.01em; }
.cx :is(.cx-pane, .cx-db) .big-n { font-size: 24px; }

/* the strip has less room with the overlay switches: secondary buttons go icon-only earlier */
@media (min-width: 1101px) and (max-width: 1599px) {
  .cx-acts .cx-btn:not(.pri):not([data-cx-lay]) span { display: none; }
  .cx-acts .cx-btn:not(.pri):not([data-cx-lay]) { width: 30px; padding: 0; justify-content: center; }
  .cx-pill { padding: 3px 8px; } .cx-pills { gap: 3px; } .cx-chg { gap: 7px; }
}
@media (min-width: 1101px) and (max-width: 1399px) { .cx [data-cx-lay] span { display: none; } .cx [data-cx-lay] { width: 30px; padding: 0; justify-content: center; } .cx-ven { display: none; } }

/* narrow docks (Split halves, beside the chart, the rail): tabs show icons except the open one, % buttons thin out */
.cx-dock { container-type: inline-size; }
@container (max-width: 640px) {
  .cx-tabbar [role="tab"]:not(.on) > span { display: none; }
  .cx-tabbar [role="tab"] { padding: 0 8px; }
}
@container (max-width: 640px) {
  .cx .wc .pc button:nth-child(1), .cx .wc .pc button:nth-child(5) { display: none; }
  .cx .wc :is(th, td):nth-child(4) { display: none; }
  .cx .wc .pc { gap: 2px; }
}

/* ---------- Live trades: one column grid for header and rows (Age · Type · MC · Total · Trader · track) ---------- */
.cx .cx-tape .tp-r { grid-template-columns: 30px 32px 58px minmax(64px, 1fr) minmax(96px, 116px) 20px; gap: 6px; padding: 0 6px; min-height: 28px; }
.cx .cx-tape .tp-r > :nth-child(4) { display: none; }                         /* token amount: low value here */
.cx .cx-tape .tp-h { min-height: 26px; font-size: 11px; font-weight: 500; color: var(--tx3); }
.cx .cx-tape .tp-h .ccy, .cx .cx-tape .tp-h .tg-info { display: none; }       /* ETH | USD lives in the panel header */
.cx .cx-tape .tp-h > :last-child { font-size: 0; }
.cx .cx-tape .tp-h > :nth-child(3), .cx .cx-tape .tp-r > :nth-child(3) { text-align: right; }
.cx .cx-tape .tp-r .who { display: flex; align-items: center; justify-content: flex-start; gap: 4px; overflow: hidden; }
.cx .cx-tape .tp-r .who .tags { display: inline-flex; flex: none; } .cx .cx-tape .tp-r .who .tags .tg:nth-child(n+2) { display: none; }
.cx .cx-tape .tp-r .who > .mono { font-size: 11.5px; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.cx .cx-tape .tp-r .who .chip.own { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cx .cx-tape .cx-devc { flex: none; padding: 0 5px; border-radius: 5px; font: 700 9.5px/16px var(--f); letter-spacing: .03em; font-style: normal; color: #0b0d10; background: var(--c-amber, #f5b748); }
.cx .cx-tape .trk-b { width: 20px; height: 20px; border-radius: 6px; color: var(--tx3); background: none; transition: color .15s, background .15s; }
.cx .cx-tape .trk-b.on { color: #0b0d10; background: var(--ac-ice, #dfe9f5); }
.cx .cx-tape .tp-r.cx-trk { box-shadow: inset 2px 0 0 var(--ac-ice, #dfe9f5); background-image: linear-gradient(90deg, color-mix(in srgb, var(--ac-ice, #dfe9f5) 9%, transparent), transparent 70%); }
@container (max-width: 330px) { .cx .cx-tape .tp-r { grid-template-columns: 28px 30px minmax(60px, 1fr) minmax(90px, 1fr) 20px; } .cx .cx-tape .tp-r > :nth-child(3) { display: none; } }
.cx-tapez .cx-zh { gap: 6px; }
.cx-tff em, .cx-tabbar .cx-tff em { font-style: normal; margin-left: 4px; font-size: 10.5px; color: var(--tx3); font-variant-numeric: tabular-nums; }
.cx-tff em:empty { display: none; }
.cx .seg.sm.cx-ccy button { padding: 0 6px; font-size: 11px; }
.cx-tape-empty { display: grid; justify-items: center; gap: 4px; padding: 18px 16px; text-align: center; font-size: 12px; color: var(--tx3); }
.cx-tape-empty[hidden] { display: none; } .cx-tape-empty b { color: var(--tx); font-weight: 600; font-size: 12.5px; }
.cx-trkw { position: relative; display: inline-flex; }
.cx-trkb { width: 24px; height: 24px; }
.cx-trkm { position: absolute; top: calc(100% + 8px); right: 0; z-index: 45; width: 300px; display: grid; gap: 6px; padding: 10px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02) 40%), rgba(20,24,31,.92); -webkit-backdrop-filter: blur(30px) saturate(1.2); backdrop-filter: blur(30px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 0 0 1px rgba(255,255,255,.07), 0 24px 60px -20px rgba(0,0,0,.9);
  opacity: 0; transform: translateY(-4px); visibility: hidden; transition: opacity .16s ease, transform .16s ease, visibility 0s .16s; }
.cx-trkm.on { opacity: 1; transform: none; visibility: visible; transition: opacity .16s ease, transform .16s ease; }
.cx-trkm header { display: flex; align-items: baseline; gap: 8px; } .cx-trkm header b { font-weight: 600; font-size: 13px; } .cx-trkm header .muted { font-size: 11.5px; }
.cx-trkl { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; } .cx-trkl p { margin: 4px 0; font-size: 12px; }
.cx-trkr { display: grid; grid-template-columns: 96px minmax(0, 1fr) 20px; align-items: center; gap: 6px; height: 30px; }
.cx-trka { font: 11.5px var(--fm-addr, monospace); color: var(--tx2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-trkn, .cx-trkadd input { min-width: 0; height: 26px; padding: 0 8px; border: 0; border-radius: 7px; background: var(--cx-fill); color: var(--tx); font: 12px var(--f); outline: none; }
.cx-trkn:focus, .cx-trkadd input:focus { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ac) 50%, transparent); }
.cx-trkadd { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin: 0; } .cx-trkadd .btn { height: 26px; }
html:root[data-theme="light"] .cx-trkm { background: var(--pop-bg); box-shadow: var(--pop-sh); }
html:root[data-theme="light"] .cx .cx-tape .trk-b.on { color: #fff; background: var(--ac); }
html:root[data-theme="light"] .cx .cx-tape .tp-r.cx-trk { box-shadow: inset 2px 0 0 var(--ac); background-image: linear-gradient(90deg, color-mix(in srgb, var(--ac) 8%, transparent), transparent 70%); }

/* ---------- Trade panel: compact, one-screen rail (labels inline, a two-column summary) ---------- */
.cx-trade .trade { padding: 8px 10px 10px; gap: 6px; }
.cx-trade .bs button { height: 30px; }
.cx-trade .ord-type button { height: 24px; }
.cx-trade .field { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 8px; }
.cx-trade .field .fl { margin: 0; font-size: 11.5px; color: var(--tx2); line-height: 1.2; }
.cx-trade .field .fh { grid-column: 2; font-size: 10.5px; margin-top: -2px; }
.cx-trade :is(.inp, .sel) { min-height: 30px; height: 30px; }
.cx-trade .presets { gap: 4px; } .cx-trade .presets button { height: 24px; font-size: 11.5px; }
.cx-trade .trade > .kv { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 0; margin: 0; padding: 4px 8px; border-radius: 9px; background: var(--cx-fill); }
.cx-trade .trade > .kv > div { min-height: 22px; font-size: 11.5px; border: 0 !important; padding: 0; gap: 6px; }
.cx-trade .trade > .kv > div:nth-child(3) { grid-column: 1 / -1; }
.cx-trade .trade > .kv dt { color: var(--tx3); } .cx-trade .trade > .kv dd { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-trade .buyb { height: 34px; }
.cx-trade .pos .kv { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; margin: 0; }
.cx-trade .pos .kv > div { min-height: 22px; font-size: 11.5px; border: 0 !important; padding: 0; gap: 6px; }
.cx-trade .pos { padding: 0 2px; }
.cx-trade .g2 { gap: 6px; } .cx-trade .g2 .field { grid-template-columns: 1fr; gap: 3px; }
/* ladder rungs and open orders: the app's frosted surface, hairline rows, tabular numbers; buy cool / sell warm */
.cx .ord-ladder { gap: 0; padding: 2px 0; border: 0; border-radius: 10px; background: var(--cx-fill); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), inset 2px 0 0 color-mix(in srgb, var(--up) 55%, transparent); max-height: 132px; }
.cx .trade:has(.bs .sell.on) .ord-ladder { box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), inset 2px 0 0 color-mix(in srgb, var(--dn) 55%, transparent); }
.cx .ord-ladder span { grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; min-height: 24px; padding: 0 10px; font: 500 12px var(--f); font-variant-numeric: tabular-nums; }
.cx .ord-ladder span + span { box-shadow: inset 0 1px 0 rgba(255,255,255,.045); }
.cx .ord-ladder b { justify-self: start; min-width: 18px; padding: 0 5px; border-radius: 999px; text-align: center; font: 600 10px/16px var(--f); color: var(--tx3); background: var(--cx-fill2); }
.cx .ord-ladder em { text-align: right; color: var(--tx2); }
.cx .oo { padding: 6px 10px; gap: 0; border: 0; border-radius: 10px; background: var(--cx-fill); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.cx .oo-h { min-height: 26px; font-size: 12px; } .cx .oo-r { border-top: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.045); padding: 2px 0; min-height: 26px; }
.cx .oo-s { font-weight: 600; } .cx .oo-r.buy .oo-s { color: var(--up); } .cx .oo-r.sell .oo-s { color: var(--dn); }
html:root[data-theme="light"] .cx :is(.ord-ladder, .oo) { box-shadow: inset 0 0 0 1px rgba(20,40,70,.07); background: rgba(255,255,255,.6); }
html:root[data-theme="light"] .cx .ord-ladder { box-shadow: inset 0 0 0 1px rgba(20,40,70,.07), inset 2px 0 0 color-mix(in srgb, var(--up) 60%, transparent); }
html:root[data-theme="light"] .cx .trade:has(.bs .sell.on) .ord-ladder { box-shadow: inset 0 0 0 1px rgba(20,40,70,.07), inset 2px 0 0 color-mix(in srgb, var(--dn) 60%, transparent); }
html:root[data-theme="light"] .cx :is(.ord-ladder span + span, .oo-r) { box-shadow: inset 0 1px 0 rgba(20,40,70,.06); }


/* ---------- Density: one scale inside the console's tabs and drawers (standalone pages keep theirs) ----------
   body 12.5–13 · labels 11.5 · section titles 13–14 · key values 18–20 (24 max) · controls 28–32 · padding 10–14 · gaps 8–12 */
.cx :is(.cx-db, .cx-pane) { font-size: 12.5px; }
.cx :is(.cx-db, .cx-pane) .ph { gap: 8px 12px; align-items: center; }
.cx :is(.cx-db, .cx-pane) .ph h1 { font: 600 16px/1.3 var(--f); letter-spacing: -.005em; }
.cx :is(.cx-db, .cx-pane) .ph p { font-size: 12px; margin-top: 2px; }
.cx :is(.cx-db, .cx-pane) .ph .btn { height: 28px; padding: 0 10px; font-size: 12px; }
.cx :is(.cx-db, .cx-pane) .card { padding: 12px 14px; border-radius: 12px; gap: 8px; }
.cx :is(.cx-db, .cx-pane) .ch { min-height: 22px; margin-bottom: 4px; } .cx :is(.cx-db, .cx-pane) .ch h3 { font: 600 13px var(--f); }
.cx :is(.cx-db, .cx-pane) :is(.g2, .g3, .g4, .split, .stack) { gap: 10px; }
.cx :is(.cx-db, .cx-pane) .kv > div { padding: 6px 0; font-size: 12.5px; }
.cx :is(.cx-db, .cx-pane) .kv dd { font-family: var(--f); font-variant-numeric: tabular-nums; }
.cx :is(.cx-db, .cx-pane) .fl { font-size: 11.5px; }
.cx :is(.cx-db, .cx-pane) :is(.inp, .sel) { min-height: 30px; }
.cx :is(.cx-db, .cx-pane) .btn:not(.wide) { height: 30px; padding: 0 12px; font-size: 12.5px; }
.cx :is(.cx-db, .cx-pane) .btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.cx :is(.cx-db, .cx-pane) .seg button { height: 26px; font-size: 12px; }
.cx :is(.cx-db, .cx-pane) .big-n { font: 600 22px/1.2 var(--f); letter-spacing: -.01em; }
.cx :is(.cx-db, .cx-pane) .hint, .cx :is(.cx-db, .cx-pane) .muted { font-size: 12px; }
/* stat cards: compact, icon inline with the label, equal widths on an even grid */
.cx :is(.cx-db, .cx-pane) :is(.g5, .g4, .g3).stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cx :is(.cx-db, .cx-pane) .stat { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ic l" "v v" "s s"; align-content: center; column-gap: 6px; row-gap: 2px; min-height: 64px; padding: 10px 12px; border-radius: 12px; }
.cx :is(.cx-db, .cx-pane) .stat::before { content: none; }
.cx :is(.cx-db, .cx-pane) .stat-ic { grid-area: ic; margin: 0; display: inline-grid; place-items: center; color: var(--tx3); } .cx :is(.cx-db, .cx-pane) .stat-ic svg { width: 13px; height: 13px; }
.cx :is(.cx-db, .cx-pane) .stat-l { grid-area: l; font: 500 11.5px var(--f); color: var(--tx2); letter-spacing: 0; text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx :is(.cx-db, .cx-pane) .stat-v { grid-area: v; font: 600 19px/1.2 var(--f); letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx :is(.cx-db, .cx-pane) .stat-s { grid-area: s; font-size: 11.5px; color: var(--tx3); }
/* tables: transparent header, small muted labels, hairline under it, numeric headers aligned with their cells */
.cx :is(.cx-db, .cx-pane) .tbl-wrap { border: 0; background: none; border-radius: 0; }
.cx :is(.cx-db, .cx-pane) .tbl th { height: 30px; background: transparent; font: 500 11px var(--f); letter-spacing: 0; text-transform: none; color: var(--tx3); box-shadow: inset 0 -1px 0 rgba(255,255,255,.07); border: 0; }
.cx :is(.cx-db, .cx-pane) .tbl th.r { text-align: right; }
.cx :is(.cx-db, .cx-pane) .tbl td { height: 34px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cx .cx-db .tbl th { position: static; }
.cx :is(.cx-db, .cx-pane) .wid .idc { display: none; }                         /* the console uses name + address, no gradient avatars */
.cx :is(.cx-db, .cx-pane) .wid > span { display: grid; line-height: 1.15; } .cx :is(.cx-db, .cx-pane) .wid small { font: 10.5px var(--fm-addr); color: var(--tx3); }
html:root[data-theme="light"] .cx :is(.cx-db, .cx-pane) .tbl th { box-shadow: inset 0 -1px 0 rgba(20,40,70,.08); }
/* the live tape header wraps to two rows when its dock is narrow; trade summary keeps one line per value */
@container (max-width: 440px) {
  .cx-dock.s-trades > .cx-zh { flex-wrap: wrap; row-gap: 4px; padding: 6px 10px; }
  .cx-dock.s-trades > .cx-zh .cx-tff { order: 9; flex: 1 1 100%; display: flex; } .cx-dock.s-trades > .cx-zh .cx-tff button { flex: 1; padding: 0 4px; }
}
.cx .cx-tape .tp-r { grid-template-columns: 28px 30px 52px minmax(70px, 1fr) minmax(92px, 108px) 20px; }
.cx .cx-tape .tp-r > :nth-child(5) { min-width: 0; overflow: hidden; }
.cx-trade .pos .kv { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.cx-trade .pos .kv dd, .cx-trade .trade > .kv dd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-trade .pos .kv dd { font-size: 11.5px; }
/* the setup editors embedded in automation drawers: same controls, console density */
.cx .cx-db .tt-risk button, .cx .cx-db .tt-dir { min-height: 0; padding: 8px 10px; gap: 8px; }
.cx .cx-db :is(.tt-risk button, .tt-dir) b { font-size: 12.5px; } .cx .cx-db :is(.tt-risk button, .tt-dir) small { font-size: 11px; }
.cx .cx-db .tt-risk button svg, .cx .cx-db .tt-dir svg { width: 15px; height: 15px; }
.cx .cx-db .mm-b { min-height: 32px; height: 32px; } .cx .cx-db .mm-b input { font-size: 13px; } .cx .cx-db .mm-b > span { font-size: 12px; }
.cx .cx-db .hms { padding: 3px; } .cx .cx-db .hms-b input { height: 26px; font-size: 13px; } .cx .cx-db .hms-b small { font-size: 9.5px; }
.cx .cx-db .tt-time-h b, .cx .cx-db .tt-amt b { font-size: 13px; } .cx .cx-db .tt-time-h small { font-size: 11.5px; }
.cx .cx-db .tt-sum b { font-size: 14px; } .cx .cx-db .tt-sum > div { padding: 8px 10px; }
.cx .cx-db :is(.tt-form, .lr-body) { display: grid; gap: 10px; }
.cx .cx-db .te-sw { font-size: 12.5px; }
.cx .cx-db .lr-rung .inp { min-height: 30px; height: 30px; } .cx .cx-db .lr-from { min-height: 30px; }
.cx .cx-db .mini-eng .rung { padding: 6px 0; } .cx .cx-db .mini-eng .rung b { font-size: 12.5px; } .cx .cx-db .mini-eng .rung span { font-size: 11.5px; }

/* ---------- Extra panels (Add panel): more tab groups under the main grid; only then does the page scroll ---------- */
.cx-xg { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: var(--cx-g); }
.cx-xg > .cx-dock { height: 440px; }
.cx-xdel { width: 24px; height: 24px; margin-left: 6px; }
.cx-xpick { display: grid; align-content: start; gap: 10px; width: 100%; height: 100%; padding: 10px 12px; overflow: auto; }
.cx-dock.cx-xp.is-empty { display: block; }
.cx-xpick header { display: flex; align-items: center; gap: 8px; } .cx-xpick header b { font-weight: 600; } .cx-xpick header .muted { font-size: 11.5px; }
.cx-xpg { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.cx-xpg button { display: grid; grid-template-columns: 18px minmax(0, 1fr); grid-template-areas: "i b" "i s"; align-items: center; column-gap: 8px; height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: var(--cx-fill); color: var(--tx); font: 500 12.5px var(--f); text-align: left; cursor: pointer; }
.cx-xpg button:hover { background: var(--cx-fill2); } .cx-xpg button .i { grid-area: i; color: var(--tx2); } .cx-xpg b { grid-area: b; font-weight: 500; } .cx-xpg small { grid-area: s; font-size: 11px; color: var(--tx3); }
.cx-ladd { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 8px 10px 0 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.cx-ladd small { font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--tx3); } .cx-ladd .btn { height: 26px; }
@media (min-width: 1101px) {
  .cx.has-x { height: auto; grid-template-rows: auto calc(100dvh - var(--cx-stb, 26px) - 76px) auto; }
  body.cx-mode.cx-tall .app.side .main { height: auto; min-height: 100dvh; overflow: visible; }
  html:has(body.cx-mode.cx-tall) { overflow: auto; }
}
html:root[data-theme="light"] .cx-ladd { box-shadow: inset 0 1px 0 rgba(20,40,70,.07); }
.cx .cx-tape .tp-r.cx-trk, .cx .cx-tape .tp-r.cx-trk:hover { box-shadow: inset 2px 0 0 var(--ac-ice, #dfe9f5) !important; }
html:root[data-theme="light"] .cx .cx-tape .tp-r.cx-trk, html:root[data-theme="light"] .cx .cx-tape .tp-r.cx-trk:hover { box-shadow: inset 2px 0 0 var(--ac) !important; }
.cx-trade .trade > .kv > div:nth-child(4) { grid-column: 1 / -1; }
