/* Skin 3 "vega" — trading terminal (site/market-detail.ejs). Written from scratch on Cwallet's
   futures skeleton: separate rounded cards on a near-black page — pair card + chart on the left,
   a full-height order book, a full-height order column, positions underneath. Classes are the
   nova terminal's (nova-terminal.js / nova-futures.js / trade-chart.js generate and read them);
   nothing from nova-terminal.css is loaded on this page. */

/* ---------- palette (the JS paints a few inline SVGs with these vars) ---------- */
body.vega .kx-term {
  --vt-page: #0b0c0d;
  --vt-card: #151618;
  --vt-card-2: #1c1d20;
  --vt-line: rgba(255, 255, 255, .06);
  --vt-line-2: rgba(255, 255, 255, .1);
  --vt-chip: #222327;
  --vt-chip-2: #2c2d32;
  --vt-text: #ffffff;
  --vt-t2: #9ea0a8;
  --vt-t3: #6f727c;
  --vt-up: var(--v-up);
  --vt-down: var(--v-down);
  --vt-up-bg: rgba(171, 225, 39, .12);
  --vt-down-bg: rgba(250, 70, 91, .12);
  --kx-bg: var(--vt-page);
  --kx-panel: var(--vt-card);
  --kx-line: var(--vt-line);
  --kx-text: var(--vt-text);
  --kx-faint: var(--vt-t2);
  --kx-dim: var(--vt-t3);
  --kx-green: var(--vt-up);
  --kx-red: var(--vt-down);
  --kx-green-bg: var(--vt-up-bg);
  --kx-red-bg: var(--vt-down-bg);
  --kx-chip: var(--vt-chip);
  --kx-chip-2: var(--vt-chip-2);
  --kx-gold: var(--v-gold);
  color: var(--vt-text);
  font: 400 12px/1.4 var(--v-font);
  font-variant-numeric: tabular-nums;
}
body.vega .kx-term *, body.vega .kx-term *::before, body.vega .kx-term *::after { box-sizing: border-box; }
body.vega .kx-term button { font-family: inherit; cursor: pointer; }
body.vega .kx-term input { font-family: inherit; }
body.vega .kx-term [hidden] { display: none !important; }

/* ---------- page shell ---------- */
body.vega.kx-page, :root:has(body.vega.kx-page) { background: #0b0c0d; }
body.vega.kx-page .lk-app, body.vega.kx-page .lk-app__main { background: #0b0c0d; }
body.vega.kx-page .lk-app__body { max-width: none; width: 100%; margin: 0; padding: 0; }
body.vega.kx-page .lk-app__body main { display: block; }
body.vega.kx-page .vh { background: #0b0c0d; }

/* ---------- grid ---------- */
.vt { padding: 0 6px 6px; }
.vt-grid { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr) 300px 320px; grid-template-rows: auto minmax(560px, calc(calc(100vh / var(--vz, 1)) - var(--v-head-h) - 74px - 48px - 12px)) auto; grid-template-areas: "head book side" "chart book side" "blot blot side"; }
.vt-card { min-width: 0; border-radius: 10px; background: var(--vt-card); }
.vt-head { grid-area: head; }
.vt-chart { grid-area: chart; }
.vt-book { grid-area: book; }
.vt-side { grid-area: side; }
.vt-blot { grid-area: blot; }
.vt-panes { display: none; }

/* ---------- pair card ---------- */
.vt-head { display: flex; align-items: center; gap: 24px; min-height: 64px; padding: 10px 16px; overflow: visible; }
.kx-head__sym { position: relative; display: flex; align-items: center; gap: 10px; flex: none; }
.kx-head__sym > .asset-ico { width: 30px; height: 30px; }
.kx-head__sym-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 0 0 8px; border: 0; border-radius: 8px; background: none; color: var(--vt-text); }
.kx-head__sym-name { font: 700 18px/1 var(--v-font); letter-spacing: -.01em; }
.kx-head__sym-name small { margin-right: 1px; color: var(--vt-t2); font-size: 14px; font-weight: 600; }
.kx-head__sym-caret { display: grid; place-items: center; width: 18px; height: 18px; color: var(--vt-text); transition: transform .2s var(--v-ease); }
.kx-head__sym-btn[aria-expanded="true"] .kx-head__sym-caret { transform: rotate(-180deg); }
.kx-head__price { flex: none; min-width: 120px; }
.kx-head__last { font: 700 20px/1.1 var(--v-font); letter-spacing: -.02em; }
.kx-head__last-abs { margin-top: 3px; font-size: 12px; font-weight: 500; }
.kx-head__last.pos, .kx-head__last-abs.pos { color: var(--vt-up); }
.kx-head__last.neg, .kx-head__last-abs.neg { color: var(--vt-down); }
/* Metrics: one row, no scroll. Whatever doesn't fit moves into the "More" panel (vega-terminal.js). */
.vt-metrics { position: relative; display: flex; align-items: center; gap: 16px; flex: 1 1 0; min-width: 0; }
.kx-head__metrics { display: flex; align-items: center; gap: 24px; flex: 1 1 0; min-width: 0; overflow: hidden; }
/* Narrow head (desktop): pair over price on the left, metrics as a two-row grid filling the rest. */
.vt-head.is-stacked { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 28px; row-gap: 6px; padding: 12px 16px; }
.vt-head.is-stacked > .kx-head__sym { grid-column: 1; grid-row: 1; }
.vt-head.is-stacked > .kx-head__price { grid-column: 1; grid-row: 2; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.vt-head.is-stacked > .kx-head__price .kx-head__last-abs { margin-top: 0; }
.vt-head.is-stacked > .vt-metrics { grid-column: 2; grid-row: 1 / 3; align-self: stretch; }
.vt-head.is-stacked .kx-head__metrics { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); align-content: center; justify-content: space-between; gap: 12px 24px; height: 100%; }
.vt-metrics__more { display: inline-flex; align-items: center; gap: 4px; flex: none; height: 30px; margin-right: auto; padding: 0 12px 0 10px; border: 0; border-radius: 99px; background: var(--vt-chip); color: var(--vt-text); font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.vt-metrics__more[hidden] { display: none; }
.vt-metrics__more:hover { background: var(--vt-chip-2, rgba(255,255,255,.12)); }
.vt-metrics__more svg { transition: transform .2s var(--v-ease); }
.vt-metrics__more[aria-expanded="true"] svg { transform: rotate(-180deg); }
.vt-metrics__pop { position: absolute; top: calc(100% + 18px); left: -6px; z-index: 70; display: flex; flex-direction: column; min-width: 280px; padding: 6px; border-radius: 14px; background: var(--v-pop); box-shadow: 0 0 0 1px var(--v-pop-line); }
.vt-metrics__pop[hidden] { display: none; }
.vt-metrics__pop .kx-head__m { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; height: 38px; padding: 0 10px; border-radius: 8px; }
.vt-metrics__pop .kx-head__m:hover { background: rgba(255,255,255,.04); }
.kx-head__m { display: flex; flex-direction: column; gap: 4px; flex: none; }
.kx-head__m-label { color: var(--vt-t2); font-size: 12px; white-space: nowrap; }
.kx-head__m-val { color: var(--vt-text); font-size: 12px; font-weight: 500; white-space: nowrap; }

/* symbol picker */
.kx-head__sym-menu { position: absolute; top: calc(100% + 10px); right: -6px; z-index: 80; width: 460px; max-height: 480px; overflow-y: auto; padding: 10px; border-radius: 14px; background: var(--vt-card-2); box-shadow: 0 0 0 1px var(--vt-line-2); }
.kx-head__sym-search { display: flex; align-items: center; gap: 10px; height: 42px; margin-bottom: 10px; padding: 0 14px; border: 1px solid transparent; border-radius: 12px; background: var(--vt-chip); color: var(--vt-t3); transition: border-color .15s var(--v-ease); }
.kx-head__sym-search:focus-within { border-color: var(--v-focus); }
.kx-head__sym-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0 !important; outline: 0; background: none !important; box-shadow: none !important; color: var(--vt-text); font: 500 14px var(--v-font); }
.kx-head__sym-search input::placeholder { color: var(--vt-t3); font-weight: 400; }
.kx-head__sym-search input::-webkit-search-cancel-button { filter: invert(.6); }
.kx-head__sym-tabs { display: flex; gap: 6px; margin: 0 0 12px; }
.kx-head__sym-tab { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: 99px; background: none; color: var(--vt-t2); font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .15s var(--v-ease), color .15s var(--v-ease); }
.kx-head__sym-tab:hover { color: var(--vt-text); }
.kx-head__sym-tab.is-active { background: var(--vt-chip-2); color: var(--vt-text); }
.kx-head__sym-cols, .kx-head__sym-row { display: grid; grid-template-columns: 22px 1fr 88px 76px 64px; align-items: center; gap: 10px; }
.kx-head__sym-cols { padding: 0 8px 6px; color: var(--vt-t3); font-size: 11px; }
.kx-head__sym-cols span { display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.kx-head__sym-cols span:nth-child(n+3) { justify-content: flex-end; }
.kx-head__sym-cols span:hover { color: var(--vt-text); }
.kx-head__sym-cols span.is-sorted { color: var(--vt-text); }
.kx-head__sym-cols span.is-sorted.is-desc::after { content: "↓"; color: var(--v-brand); }
.kx-head__sym-cols span.is-sorted.is-asc::after { content: "↑"; color: var(--v-brand); }
.kx-head__sym-list { display: flex; flex-direction: column; }
.kx-head__sym-row { position: relative; height: 44px; padding: 0 8px; border-radius: 8px; color: inherit; }
.kx-head__sym-row:hover { background: var(--vt-chip); }
.kx-head__sym-row.is-active { background: var(--vt-chip); }
@keyframes kx-flash-up { from { background: rgba(171, 225, 39, .2); } to { background: transparent; } }
@keyframes kx-flash-down { from { background: rgba(250, 70, 91, .2); } to { background: transparent; } }
.kx-head__sym-star { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; background: none; color: var(--vt-t3); }
.kx-head__sym-star:hover { color: var(--vt-text); }
.kx-head__sym-star.is-fav { color: var(--v-gold); }
.kx-head__sym-star.is-fav svg { fill: currentColor; }
.kx-head__sym-pair { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kx-head__sym-pair .asset-ico { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; overflow: hidden; }
.kx-head__sym-pair .asset-ico :is(img, svg) { display: block; width: 22px; height: 22px; object-fit: contain; }
.kx-head__sym-pair strong { font-size: 13px; font-weight: 600; }
.kx-head__sym-pair small { margin-right: -6px; color: var(--vt-t3); font-size: 12px; }
.kx-head__sym-px, .kx-head__sym-chg, .kx-head__sym-vol { font-size: 12px; font-weight: 600; text-align: left; }
.kx-head__sym-px.pos, .kx-head__sym-chg.pos { color: var(--vt-up); }
.kx-head__sym-px.neg, .kx-head__sym-chg.neg { color: var(--vt-down); }
.kx-head__sym-vol { color: var(--vt-t2); font-weight: 500; }
.kx-head__sym-empty { padding: 28px 8px; color: var(--vt-t2); text-align: center; }
.kx-m-symclose { display: none; }

/* ---------- chart card ---------- */
.vt-chart { display: flex; flex-direction: column; overflow: hidden; }
.kx-chart-stage { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.kx-term .trade-chart { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; margin: 0; padding: 0; border: 0; overflow: hidden; }
.kx-term .trade-chart__bar { display: flex; align-items: center; flex: none; min-height: 44px; padding: 0 12px; }
.kx-term .trade-chart__tools { display: flex; align-items: center; gap: 2px; width: 100%; }
.kx-term .trade-chart__split { flex: none; width: 1px; height: 16px; margin: 0 8px; background: var(--vt-line-2); }
.kx-term .trade-chart__tf { display: flex; align-items: center; gap: 2px; }
.kx-term .trade-chart__tf-btn, .kx-term .trade-chart__tf-more { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 9px; border: 0; border-radius: 6px; background: none; color: var(--vt-t2); font: 500 13px/1 var(--v-font); }
.kx-term .trade-chart__tf-btn:hover, .kx-term .trade-chart__tf-more:hover { color: var(--vt-text); }
.kx-term .trade-chart__tf-btn.is-active, .kx-term .trade-chart__tf-more.is-active { background: var(--vt-chip-2); color: var(--vt-text); }
.kx-term .trade-chart__iconbtn { display: inline-grid; place-items: center; width: 30px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--vt-t2); }
.kx-term .trade-chart__iconbtn:hover, .kx-term .trade-chart__iconbtn[aria-expanded="true"] { color: var(--vt-text); }
.kx-term .trade-chart__iconbtn svg { display: block; }
.kx-term .trade-chart__menu { position: relative; }
.kx-term .trade-chart__pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; display: flex; flex-direction: column; gap: 2px; min-width: 160px; padding: 6px; border-radius: 12px; background: var(--vt-card-2); box-shadow: 0 0 0 1px var(--vt-line-2); }
.kx-term .trade-chart__pop--set { right: auto; left: 0; }
.kx-term .trade-chart__pop--tf { min-width: 270px; gap: 10px; padding: 12px; }
.kx-term .trade-chart__pop-group { padding: 0 2px; color: var(--vt-t3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kx-term .trade-chart__pop-row { display: flex; flex-wrap: wrap; gap: 4px; }
.kx-term .trade-chart__pop-row .trade-chart__tf-btn.is-active { background: var(--v-brand); color: var(--v-brand-ink); }
.kx-term .trade-chart__choice, .kx-term .trade-chart__toggle { padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--vt-t2); font: 500 13px var(--v-font); text-align: right; }
.kx-term .trade-chart__choice:hover, .kx-term .trade-chart__toggle:hover { color: var(--vt-text); background: var(--vt-chip); }
.kx-term .trade-chart__choice.is-active { color: var(--v-brand); }
.kx-term .trade-chart__toggle { display: flex; justify-content: space-between; gap: 16px; width: 100%; }
.kx-term .trade-chart__toggle b { color: var(--vt-text); font-weight: 600; }
.kx-term .trade-chart__stage { position: relative; flex: 1; min-height: 0; min-width: 0; }
.kx-term .trade-chart__canvas { position: relative; width: 100%; height: 100%; min-height: 240px; }
.kx-term .trade-chart__empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--vt-t2); }
.kx-term .trade-chart__legend { position: absolute; top: 10px; right: 12px; z-index: 4; display: flex; flex-direction: column; gap: 5px; max-width: calc(100% - 80px); pointer-events: none; }
.kx-term .trade-chart__legend-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; color: var(--vt-t2); font-size: 13px; }
.kx-term .trade-chart__legend-pair, .kx-term .trade-chart__legend-tf { color: var(--vt-text); font-weight: 600; }
.kx-term .trade-chart__legend-ohlc { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--vt-t2); font-size: 13px; }
.kx-term .trade-chart__legend-ohlc b, .kx-term .trade-chart__legend-row--metrics b { color: var(--vt-text); font-weight: 600; }
.kx-term .trade-chart__legend-ohlc.pos b, .kx-term .trade-chart__legend-row--metrics .pos { color: var(--vt-up); }
.kx-term .trade-chart__legend-ohlc.neg b, .kx-term .trade-chart__legend-row--metrics .neg { color: var(--vt-down); }
#kx-chart { flex: 1; min-height: 0; }
.kx-osc-pane { position: relative; flex: 0 0 130px; border-top: 1px solid var(--vt-line); }
.kx-osc-pane__label { position: absolute; top: 6px; right: 12px; z-index: 2; color: var(--vt-t2); font-size: 12px; font-weight: 600; pointer-events: none; }
.kx-osc-pane__canvas { width: 100%; height: 100%; }
.kx-indicator-bar { flex: none; padding: 0 8px; border-top: 1px solid var(--vt-line); }
.kx-indicator-bar__scroll { display: flex; align-items: center; gap: 2px; padding: 6px 0; overflow-x: auto; scrollbar-width: none; }
.kx-indicator-bar__scroll::-webkit-scrollbar { display: none; }
.kx-indicator-bar__sep { flex: none; width: 1px; height: 14px; margin: 0 6px; background: var(--vt-line-2); }
.kx-ind { flex: none; height: 26px; padding: 0 9px; border: 0; border-radius: 6px; background: none; color: var(--vt-t2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.kx-ind:hover { color: var(--vt-text); }
.kx-ind.is-active { background: var(--vt-chip-2); color: var(--vt-text); }

/* ---------- order book card ---------- */
.vt-book { position: relative; display: flex; flex-direction: column; overflow: hidden; }
.kx-book-tabs { display: flex; align-items: center; gap: 20px; flex: none; height: 44px; padding: 0 14px; border-bottom: 1px solid var(--vt-line); }
.kx-book-tabs button { position: relative; height: 44px; padding: 0; border: 0; background: none; color: var(--vt-t2); font-size: 14px; font-weight: 500; }
.kx-book-tabs button:hover { color: var(--vt-text); }
.kx-book-tabs button.is-active { color: var(--vt-text); font-weight: 600; }
.kx-book-tabs button.is-active::after { content: ""; position: absolute; right: 0; left: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--v-brand); }
.vt-book > [data-kx-book-panel]:not([hidden]) { position: absolute; right: 0; left: 0; top: 44px; bottom: 0; display: flex; flex-direction: column; overflow: hidden; }
/* fold / unfold (desktop ≥1280 only, see the media block below) */
.vt-fold, .vt-rail { display: none; }
.kx-book-col, .kx-book-col * { overflow-anchor: none; }
.kx-book-tools { display: flex; align-items: center; justify-content: space-between; flex: none; padding: 8px 14px 6px; }
.kx-book-modes { display: flex; gap: 4px; }
.kx-book-modes button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none; opacity: .4; transition: opacity .15s; }
.kx-book-modes button:hover { opacity: .75; }
.kx-book-modes button.is-active { opacity: 1; }
.kx-book-modes svg { width: 18px; height: 18px; }
.kx-book-tick { display: flex; align-items: center; gap: 2px; height: 26px; padding: 0 4px; border: 1px solid var(--vt-line-2); border-radius: 6px; }
.kx-book-tick button { width: 18px; height: 18px; padding: 0; border: 0; background: none; color: var(--vt-t2); font-size: 13px; line-height: 1; }
.kx-book-tick button:hover { color: var(--vt-text); }
.kx-book-tick span { min-width: 38px; color: var(--vt-text); font-size: 12px; text-align: center; }
.kx-book-head, .kx-tape-head { display: flex; flex: none; padding: 0 14px 6px; color: var(--vt-t3); font-size: 11px; white-space: nowrap; }
.kx-book-head span, .kx-tape-head span { white-space: nowrap; }
.kx-book-head span:first-child, .kx-tape-head span:first-child { flex: 1; }
.kx-book-head span:nth-child(n+2) { width: 84px; text-align: left; }
.kx-tape-head span:nth-child(2) { width: 84px; text-align: left; }
.kx-tape-head span:nth-child(3) { width: 64px; text-align: left; }
.kx-book-rows { display: flex; flex-direction: column; }
.kx-book-row { position: relative; display: flex; align-items: center; width: 100%; height: 20px; padding: 0 14px; border: 0; background: none; color: var(--vt-text); font-size: 12px; text-align: right; }
.kx-book-row:hover { background: rgba(255, 255, 255, .04); }
.kx-book-row__depth { position: absolute; top: 1px; bottom: 1px; right: 0; z-index: 0; transition: width .3s ease-out; }
.kx-book-row--ask .kx-book-row__depth { background: rgba(250, 70, 91, .16); }
.kx-book-row--bid .kx-book-row__depth { background: rgba(171, 225, 39, .14); }
.kx-book-row__flash { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.kx-book-row__px { position: relative; z-index: 2; flex: 1; font-weight: 500; }
.kx-book-row--ask .kx-book-row__px { color: var(--vt-down); }
.kx-book-row--bid .kx-book-row__px { color: var(--vt-up); }
.kx-book-row__qty, .kx-book-row__tot { position: relative; z-index: 2; width: 84px; color: var(--vt-text); text-align: left; }
.kx-book-row__tot { color: var(--vt-t2); }
@media (prefers-reduced-motion: reduce) { .kx-book-row__depth { transition: none; } }
.kx-book-mid { display: flex; align-items: center; gap: 6px; flex: none; height: 40px; margin: 4px 0; padding: 0 14px; border-block: 1px solid var(--vt-line); }
.kx-book-mid__px { font: 700 18px/1 var(--v-font); letter-spacing: -.02em; }
.kx-book-mid__px.pos, .kx-book-mid__arrow.pos { color: var(--vt-up); }
.kx-book-mid__px.neg, .kx-book-mid__arrow.neg { color: var(--vt-down); }
.kx-book-mid__arrow { display: flex; }
.kx-book-mid__usd { margin-right: auto; color: var(--vt-t2); font-size: 12px; }
.kx-book-ratio { display: flex; align-items: center; gap: 8px; flex: none; min-height: 36px; margin-top: auto; padding: 8px 14px 12px; font-size: 12px; font-weight: 600; }
.kx-book-ratio .pos { color: var(--vt-up); }
.kx-book-ratio .neg { color: var(--vt-down); }
.kx-book-ratio__track { flex: 1; height: 6px; overflow: hidden; border-radius: 99px; background: var(--vt-down); }
.kx-book-ratio__track i { display: block; height: 100%; border-left: 2px solid var(--vt-card); background: var(--vt-up); }
.kx-book-empty { padding: 16px; color: var(--vt-t2); text-align: center; }
[data-kx-book-panel="trades"] #kx-trades { display: flex; flex-direction: column; flex: 1; min-height: 0; }
[data-kx-book-panel="trades"] #kx-trades .kx-book-empty { flex: 1; display: flex; align-items: center; justify-content: center; }
.kx-tape-row { display: flex; align-items: center; flex: 1; min-height: 20px; padding: 0 14px; font-size: 12px; }
.kx-tape-row span:first-child { flex: 1; font-weight: 500; }
.kx-tape-row span:nth-child(2) { width: 84px; text-align: left; }
.kx-tape-row span:nth-child(3) { width: 64px; color: var(--vt-t2); text-align: left; }
.kx-tape-row .pos { color: var(--vt-up); }
.kx-tape-row .neg { color: var(--vt-down); }

/* ---------- order column ---------- */
.vt-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vt-side > .kx-form-tabs { order: -1; }
.vt-sheethead { display: none; }
.vt-side .kx-form-tabs, .vt-side > .kx-form-body { border-radius: 10px; background: var(--vt-card); }
.kx-form-tabs { padding: 8px; }
.kx-form-tabs__inner { display: flex; gap: 4px; padding: 3px; border-radius: 99px; background: var(--vt-page); }
.kx-form-tabs__inner button { flex: 1; height: 32px; border: 0; border-radius: 99px; background: none; color: var(--vt-t2); font-size: 14px; font-weight: 600; transition: background-color .15s, color .15s; }
.kx-form-tabs__inner button:hover { color: var(--vt-text); }
.kx-form-tabs__inner button.is-active { background: var(--vt-chip-2); color: var(--vt-text) !important; }
.kx-form-body { padding: 14px 14px 16px; }
.kf { padding: 14px 14px 16px; }
.kf [hidden] { display: none !important; }

/* buy/sell or open/close */
.kf-oc { display: flex; gap: 4px; padding: 3px; border-radius: 99px; background: var(--vt-page); }
.kf-oc button { flex: 1; height: 32px; border: 0; border-radius: 99px; background: none; color: var(--vt-t2); font-size: 14px; font-weight: 600; transition: background-color .15s, color .15s; }
.kf-oc button:hover { color: var(--vt-text); }
.kf-oc button.is-on { background: var(--vt-up); color: var(--v-brand-ink) !important; }
.kf-oc button.is-on[data-kx-side-tab="sell"], .kf-oc.is-close button.is-on { background: var(--vt-down); color: #fff !important; }
.kf--spot .kf-oc { margin-bottom: 14px; }

/* margin mode + leverage pills (Cwallet "Cross | 1x") */
.kf-lev { display: flex; gap: 8px; padding: 12px 0 14px; }
.kf-lev__chip { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1 1 0; min-width: 0; height: 32px; padding: 0; border: 0; border-radius: 99px; background: var(--vt-chip); color: var(--vt-text); font-size: 13px; font-weight: 600; }
.kf-lev__chip:hover { background: var(--vt-chip-2); }
.kf-lev__chip--static, .kf-lev__chip--static:hover { background: var(--vt-chip); color: var(--vt-t2); cursor: default; }
.kf-lev__chip svg path { fill: currentColor; }

/* order type tabs (underline, lime) */
.kf-tabs { display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--vt-line); }
.kf-tabs button { position: relative; height: 34px; padding: 0; border: 0; background: none; color: var(--vt-t2); font-size: 14px; font-weight: 500; }
.kf-tabs button:hover { color: var(--vt-text); }
.kf-tabs button.is-on { color: var(--vt-text); font-weight: 600; }
.kf-tabs button.is-on::after { content: ""; position: absolute; right: 0; left: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--v-brand); }
/* form messages: plain coloured text, no plate (user, 2026-11-23) */
.kf-flash { margin: 10px 0 0; padding: 0; border-radius: 0; background: none; color: var(--vt-t2); font-size: 12px; line-height: 1.4; }
.kf-flash.is-bad { background: none; color: #ff8a98; }
.kf-flash.is-ok { background: none; color: var(--vt-up); }

/* fields (outlined, Cwallet) */
.kf-inputs { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.kf-field__label { display: flex; align-items: center; justify-content: space-between; min-height: 16px; margin-bottom: 6px; color: var(--vt-t2); font-size: 12px; }
.kf-field__row { display: flex; gap: 6px; }
.kf-field__box { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--vt-line-2); border-radius: 8px; background: transparent; transition: border-color .15s; }
.kf-field__box:hover { border-color: rgba(255, 255, 255, .18); }
.kf-field__box:focus-within { border-color: var(--v-focus); }
.kf-field__box.is-static { background: var(--vt-page); border-color: transparent; }
.kf-field__box input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; color: var(--vt-text); font-size: 15px; font-weight: 500; }
.kf-field__box input:focus-visible { outline: none; }
.kf-field__box input::placeholder { color: var(--vt-t3); font-weight: 400; }
.kf-field__static { flex: 1; color: var(--vt-t2); font-size: 14px; }
.kf-field__unit { flex: none; color: var(--vt-t2); font-size: 13px; font-weight: 500; }
.kf-latest { flex: none; margin-right: 10px; padding: 0; border: 0; background: none; color: var(--v-brand); font-size: 12px; font-weight: 600; }
.kf-latest:hover { color: var(--v-brand-hover); }
.kf-bbo { flex: none; height: 44px; padding: 0 14px; border: 1px solid var(--vt-line-2); border-radius: 8px; background: none; color: var(--vt-text); }
.kf-bbo.is-on { border-color: var(--v-brand); color: var(--v-brand); }
.kf-extra .kf-field__box + .kf-field__label { margin-top: 12px; }

/* dropdowns */
.kf-dd { position: relative; display: inline-flex; }
.kf-dd__btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--vt-t2); font-size: 12px; }
.kf-dd__btn:hover { color: var(--vt-text); }
.kf-dd__btn svg { width: 8px; height: 8px; }
.kf-dd__btn--suffix { color: var(--vt-text); font-size: 13px; font-weight: 500; }
.kf-dd__menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 240px; padding: 4px; border-radius: 12px; background: var(--vt-card-2); box-shadow: 0 0 0 1px var(--vt-line-2); animation: vt-pop .14s ease-out; }
.kf-field__box .kf-dd__menu { right: auto; left: -12px; }
@keyframes vt-pop { from { opacity: 0; transform: translateY(-4px); } }
.kf-dd__menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--vt-text); text-align: right; }
.kf-dd__menu button:hover { background: var(--vt-chip); }
.kf-dd__opt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kf-dd__opt strong { font-size: 14px; font-weight: 600; }
.kf-dd__opt small { color: var(--vt-t2); font-size: 12px; }
.kf-dd__menu button svg { flex: none; width: 14px; height: 14px; color: var(--v-brand); opacity: 0; }
.kf-dd__menu button.is-on svg { opacity: 1; }

/* percentage slider: dots on a line (Cwallet) */
.kf-slider { margin: 2px 0 6px; padding: 0 7px; }
.kf-slider__track { position: relative; height: 14px; margin-top: 8px; cursor: pointer; touch-action: none; }
.kf-slider__rail, .kf-slider__fill { position: absolute; right: 0; top: 6px; height: 2px; border-radius: 2px; }
.kf-slider__rail { left: 0; background: var(--vt-chip-2); }
.kf-slider__fill { width: 0; background: var(--vt-text); }
.kf-slider__dot { position: absolute; top: 2px; width: 10px; height: 10px; margin-right: -5px; padding: 0; border: 2px solid var(--vt-chip-2); border-radius: 50%; background: var(--vt-card); }
.kf-slider__dot.is-on { border-color: var(--vt-text); background: var(--vt-text); }
.kf-slider__handle { position: absolute; top: 0; right: 0; width: 14px; height: 14px; margin-right: -7px; border: 3px solid var(--vt-text); border-radius: 50%; background: var(--vt-card); pointer-events: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .08); }
.kf-slider__tip { position: absolute; bottom: calc(100% + 8px); right: 50%; padding: 2px 6px; border-radius: 4px; background: #fff; color: #101113; font-size: 11px; font-weight: 600; white-space: nowrap; transform: translateX(50%); opacity: 0; transition: opacity .12s; }
.kf-slider.is-drag .kf-slider__tip, .kf-slider__track:hover .kf-slider__tip { opacity: 1; }
.kf-slider.is-disabled { opacity: .4; }
.kf-slider__marks { position: relative; height: 18px; margin-top: 4px; }
.kf-slider__marks span { position: absolute; color: var(--vt-t3); font-size: 11px; line-height: 18px; transform: translateX(50%); cursor: pointer; }
.kf-slider__marks span:hover { color: var(--vt-text); }
.kf-slider__marks span:first-child { margin-right: -7px; transform: none; }
.kf-slider__marks span:last-child { margin-right: 7px; transform: translateX(100%); }
.kf-field--total { margin-top: 0; }

/* summary rows */
.kf-sum { color: var(--vt-t2); font-size: 12px; line-height: 1.6; }
.kf-sum strong { color: var(--vt-text); font-weight: 500; }
.kf-sum--spot { margin: 10px 0 14px; }
.kf-sum__line, .kf-sum__avail { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.kf-sum__avail { margin-top: 10px; }
.kf-sum__avail strong { margin-right: auto; }
.kf-sum__row { display: flex; justify-content: space-between; gap: 10px; margin-top: 2px; }
.kf-sum__row > div { display: flex; gap: 4px; white-space: nowrap; }
.kf-sum__row--max { flex-wrap: wrap; margin-bottom: 10px; }
.kf-sum__row--max > div + div { margin-right: auto; }
.kx-m-dep { display: none; }
.kf-tip { position: relative; text-decoration: underline dotted rgba(255, 255, 255, .3); text-underline-offset: 3px; cursor: help; outline: 0; }
.kf-tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 50; width: 220px; padding: 8px 10px; border-radius: 8px; background: #2c2d32; color: var(--vt-text); font-size: 12px; line-height: 1.45; white-space: normal; text-align: right; box-shadow: none; opacity: 0; pointer-events: none; transform: translateY(2px); transition: opacity .12s, transform .12s; }
.kf-tip--end::after { right: auto; left: 0; }
.kf-tip:hover::after, .kf-tip:focus-visible::after { opacity: 1; transform: none; }

/* checkboxes */
.kf-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 4px 0 12px; }
.kf-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.kf-check input { position: absolute; opacity: 0; pointer-events: none; }
.kf-check__box { display: grid; place-items: center; width: 16px; height: 16px; border: 1.5px solid var(--vt-t3); border-radius: 4px; transition: background-color .12s, border-color .12s; }
.kf-check input:checked + .kf-check__box { border-color: var(--v-brand); background: var(--v-brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23101113' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center no-repeat; }
.kf-check input:focus-visible + .kf-check__box { outline: 2px solid var(--v-brand); outline-offset: 2px; }
.kf-check__text { color: var(--vt-text); font-size: 13px; }
.kf-extra { margin: 0 0 12px; }

/* action buttons: big pills */
.kf-btns { display: flex; gap: 8px; }
.kf-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; height: 48px; padding: 0 12px; border: 0; border-radius: 99px; color: #fff; font-size: 15px; font-weight: 700; transition: filter .15s, transform .1s; }
.kf-btn:hover:not(:disabled) { filter: brightness(1.07); }
.kf-btn:active:not(:disabled) { transform: translateY(1px); }
.kf-btn:disabled { opacity: .45; cursor: not-allowed; }
.kf-btn--long { background: var(--vt-up); color: var(--v-brand-ink) !important; }
.kf-btn--short { background: var(--vt-down); }
.kf-btn small { font-size: 11px; font-weight: 500; }
.kx-guest-cta { display: flex; align-items: center; justify-content: center; flex: 1; height: 48px; border-radius: 99px; background: #fff; color: #101113; font-size: 15px; font-weight: 700; transition: background-color .15s; }
.kx-guest-cta:hover { background: #e6e7e9; }
.kf-margins { display: flex; gap: 10px; }
.kf-margins > div { display: flex; justify-content: space-between; flex: 1; gap: 4px; margin-top: 12px; color: var(--vt-t2); font-size: 12px; }
.kf-margins strong { color: var(--vt-text); font-weight: 500; }
.kf-fees { display: flex; justify-content: space-between; margin-top: 14px; color: var(--vt-t2); font-size: 12px; }
.kf-fees__v { color: var(--vt-text); }
.kf-fees__v span { color: inherit; }
.kf-divide { display: none; }

/* wallet blocks (the form column's lower card) */
.kx-wallet, .kf-wallet { margin: 16px -14px -16px; padding: 14px; border-top: 6px solid var(--vt-page); }
.kx-wallet__title, .kf-wallet__title { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 10px; color: var(--vt-text); font-size: 14px; font-weight: 600; }
.kx-wallet__title span { display: inline-flex; align-items: center; gap: 6px; }
.kf-wallet__title a { display: inline-flex; color: var(--vt-t2); font-size: 16px; }
.kf-wallet__title a:hover { color: var(--vt-text); }
.kx-wallet__row, .kf-wallet__rows > div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--vt-t2); font-size: 12px; }
.kx-wallet__row strong, .kf-wallet__rows strong { color: var(--vt-text); font-weight: 500; }
.kf-wallet__tip { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--vt-page); color: var(--vt-t2); font-size: 12px; line-height: 1.5; }
.kf-wallet__tip-ico { display: flex; margin-top: 2px; font-size: 14px; color: var(--vt-t2); }
.kx-wallet__actions { display: flex; gap: 8px; margin-top: 12px; }
.kx-wallet__actions a, .kf-wallet__deposit { display: flex; align-items: center; justify-content: center; flex: 1; height: 36px; margin-top: 12px; border-radius: 99px; background: var(--vt-chip); color: var(--vt-text); font-size: 13px; font-weight: 600; }
.kx-wallet__actions a { margin-top: 0; }
.kx-wallet__actions a:hover, .kf-wallet__deposit:hover { background: var(--vt-chip-2); }

/* ---------- modals (leverage / close / TP-SL) ---------- */
.kf-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.kf-modal__backdrop { position: absolute; inset: 0; background: var(--v-mask); animation: v-fade .18s ease; }
.kf-modal__panel { position: relative; width: min(420px, calc(100vw - 32px)); padding: 22px 24px 24px; border-radius: 16px; background: var(--vt-card-2); box-shadow: 0 0 0 1px var(--vt-line-2); animation: vt-pop .18s ease-out; }
.kf-modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.kf-modal__head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.kf-modal__x { display: grid; place-items: center; width: 32px; height: 32px; margin-left: -6px; padding: 0; border: 0; background: none; color: var(--vt-t2); font-size: 22px; line-height: 1; }
.kf-modal__x:hover { color: var(--vt-text); }
.kf-levpick { display: flex; align-items: center; height: 52px; padding: 0 6px; border: 1px solid var(--vt-line-2); border-radius: 10px; }
.kf-levpick:focus-within { border-color: var(--v-focus); }
.kf-levpick input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--vt-text); font-size: 20px; font-weight: 700; text-align: left; }
.kf-levpick__x { flex: 1; padding-right: 2px; color: var(--vt-text); font-size: 20px; font-weight: 700; }
.kf-levpick__step { width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: var(--vt-text); font-size: 22px; }
.kf-levpick__step:hover { color: var(--v-brand); }
.kf-levrange { --p: 15.3%; width: 100%; height: 4px; margin: 22px 0 10px; border-radius: 4px; background: linear-gradient(to left, var(--v-brand) var(--p), var(--vt-chip-2) var(--p)); outline: 0; appearance: none; -webkit-appearance: none; }
.kf-levrange::-webkit-slider-thumb { width: 18px; height: 18px; border: 3px solid var(--v-brand); border-radius: 50%; background: var(--vt-card-2); cursor: pointer; -webkit-appearance: none; }
.kf-levrange::-moz-range-thumb { width: 14px; height: 14px; border: 3px solid var(--v-brand); border-radius: 50%; background: var(--vt-card-2); cursor: pointer; }
.kf-levmarks { display: flex; justify-content: space-between; gap: 4px; }
.kf-levmarks button { flex: 1; height: 30px; border: 0; border-radius: 99px; background: var(--vt-chip); color: var(--vt-t2); font-size: 12px; font-weight: 600; }
.kf-levmarks button:hover { color: var(--vt-text); }
.kf-levmarks button.is-on { background: var(--v-brand); color: var(--v-brand-ink); }
.kf-modal__note { margin: 16px 0 20px; color: var(--vt-t2); font-size: 12px; line-height: 1.55; }
.kf-modal__note strong { color: var(--vt-text); font-weight: 600; }
.kf-modal__ok { width: 100%; height: 48px; border: 0; border-radius: 99px; background: #fff; color: #101113; font-size: 15px; font-weight: 700; }
.kf-modal__ok:hover { background: #e6e7e9; }
.kx-tpsl-info { margin: -10px 0 16px; color: var(--vt-t2); font-size: 12px; }
.kx-tpsl-field { display: block; margin-bottom: 12px; }
.kx-tpsl-field > span:first-child { display: block; margin-bottom: 6px; color: var(--vt-t2); font-size: 12px; }
.kx-field__row { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--vt-line-2); border-radius: 8px; }
.kx-field__row:focus-within { border-color: var(--v-focus); }
.kx-field__row.is-bad { border-color: var(--vt-down); }
.kx-field__row input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: none; color: var(--vt-text); font-size: 15px; font-weight: 500; }
.kx-field__row input:focus-visible { outline: none; }
.kx-field__suffix { flex: none; color: var(--vt-t2); font-size: 13px; }
.kx-seg { display: flex; gap: 4px; margin-bottom: 16px; padding: 3px; border-radius: 99px; background: var(--vt-page); }
.kx-seg button { flex: 1; height: 32px; border: 0; border-radius: 99px; background: none; color: var(--vt-t2); font-size: 14px; font-weight: 600; }
.kx-seg button.is-on { background: var(--vt-chip-2); color: var(--vt-text); }
.kx-pcts { display: flex; gap: 6px; margin: 0 0 20px; }
.kx-pcts button { flex: 1; height: 30px; border: 0; border-radius: 99px; background: var(--vt-chip); color: var(--vt-t2); font-size: 12px; font-weight: 600; }
.kx-pcts button:hover, .kx-pcts button.is-on { background: var(--vt-chip-2); color: var(--vt-text); }

/* ---------- blotter ---------- */
.vt-blot { min-height: 280px; }
.kx-blotter__tabs { display: flex; align-items: center; gap: 24px; padding: 0 16px; overflow-x: auto; border-bottom: 1px solid var(--vt-line); scrollbar-width: none; }
.kx-blotter__tabs::-webkit-scrollbar { display: none; }
.kx-blotter__tabs button { position: relative; flex: none; height: 46px; padding: 0; border: 0; background: none; color: var(--vt-t2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.kx-blotter__tabs button:hover { color: var(--vt-text); }
.kx-blotter__tabs button.is-active { color: var(--vt-text); font-weight: 600; }
.kx-blotter__tabs button.is-active::after { content: ""; position: absolute; right: 0; left: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--v-brand); }
.kx-blotter__panel { min-height: 220px; }
/* Desktop: the blotter has one fixed height. Long lists scroll inside it (header row pinned), so neither
   the page nor the wallet card next to it ever grows with the number of rows. */
@media (min-width: 768px) {
  .vt-blot { display: flex; flex-direction: column; height: 340px; min-height: 0; }
  .vt-blot > .kx-blotter__tabs { flex: none; }
  .vt-blot > .kx-blotter__panel { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3a3d42 transparent; }
  .vt-blot > .kx-blotter__panel[hidden] { display: none; }
  .vt-blot > .kx-blotter__panel::-webkit-scrollbar { width: 4px; height: 4px; }
  .vt-blot > .kx-blotter__panel::-webkit-scrollbar-thumb { border-radius: 2px; background: #3a3d42; }
  .vt-blot .kx-table thead th { position: sticky; top: 0; z-index: 1; background: var(--vt-card); }
  .vt-blot .kx-blotter__empty { min-height: 100%; }
}
.kx-blotter__empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 220px; color: var(--vt-t2); font-size: 13px; }
.kx-blotter__empty::before { content: ""; width: 64px; height: 64px; background: url("/public/img/vega/art/empty.webp") center / contain no-repeat; opacity: .9; }
.kx-blotter__empty a { color: var(--v-brand); }
.kx-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.kx-table th { padding: 12px 10px 8px; color: var(--vt-t3); font-size: 12px; font-weight: 400; text-align: right; white-space: nowrap; }
.kx-table td { padding: 12px 10px; border-top: 1px solid var(--vt-line); white-space: nowrap; vertical-align: middle; }
.kx-table th:first-child, .kx-table td:first-child { padding-right: 16px; }
.kx-table th:last-child, .kx-table td:last-child { padding-left: 16px; }
.kx-table tbody:first-of-type tr:first-child td, .kx-table tbody:empty + tbody tr:first-child td { border-top-color: transparent; }
@media (hover: hover) { .kx-table tbody tr:hover td { background: rgba(255, 255, 255, .02); } }
.kx-table .pos, .kx-2l.pos { color: var(--vt-up); }
.kx-table .neg, .kx-2l.neg { color: var(--vt-down); }
.kx-table .kx-act { text-align: left; }
.kx-dim { color: var(--vt-t2); }
.kx-asset { font-weight: 600; }
.kx-2l span, .kx-2l small, .kx-t span, .kx-t small { display: block; }
.kx-2l small, .kx-t small { margin-top: 2px; color: var(--vt-t2); font-size: 11px; }
.kx-2l.pos small, .kx-2l.neg small { color: inherit; opacity: .8; }
.kx-sym { position: relative; padding-right: 10px; }
.kx-sym::before { content: ""; position: absolute; right: 0; top: 1px; bottom: 1px; width: 3px; border-radius: 3px; background: var(--vt-chip-2); }
.kx-sym--long::before { background: var(--vt-up); }
.kx-sym--short::before { background: var(--vt-down); }
.kx-sym b { color: var(--vt-text); font-weight: 600; }
.kx-sym__sub { margin-right: 6px; color: var(--vt-t2); }
.kx-tags { display: flex; gap: 4px; margin-top: 4px; }
.kx-tag { height: 18px; padding: 0 6px; border-radius: 4px; background: var(--vt-chip); color: var(--vt-t2); font-size: 11px; font-weight: 600; line-height: 18px; }
.kx-tag--long { background: var(--vt-up-bg); color: var(--vt-up); }
.kx-tag--short { background: var(--vt-down-bg); color: var(--vt-down); }
.kx-liq { color: var(--v-gold); }
.kx-slash { margin: 0 4px; color: var(--vt-t3); }
.kx-tpsl-cell { display: flex; align-items: center; gap: 6px; }
.kx-btn { height: 28px; padding: 0 12px; border: 0; border-radius: 99px; background: var(--vt-chip); color: var(--vt-text); font-size: 12px; font-weight: 600; white-space: nowrap; }
.kx-btn:hover { background: var(--vt-chip-2); }
.kx-icon-btn { display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: none; color: var(--vt-t2); }
.kx-icon-btn:hover { color: var(--vt-text); }
.kx-close { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.kx-status { color: var(--vt-t2); text-transform: capitalize; }
.kx-status--ok { color: var(--vt-up); }
.kx-status--part { color: var(--v-gold); }
.kx-status--bad { color: var(--vt-down); }
.kx-table__cancel { color: var(--vt-down); }
/* card mode (nova-terminal.js fitBlotter adds .is-cards when a table doesn't fit) */
.kx-table.is-cards, .kx-table.is-cards tbody { display: block; }
.kx-table.is-cards thead { display: none; }
.kx-table.is-cards tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px 16px; margin: 8px 12px; padding: 14px; border-radius: 10px; background: var(--vt-card-2); }
.kx-table.is-cards td { display: block; min-width: 0; padding: 0 !important; border: 0; white-space: normal; }
.kx-table.is-cards td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--vt-t3); font-size: 11px; white-space: nowrap; }
.kx-table.is-cards td.kx-headcell { grid-column: 1 / -1; order: -1; }
.kx-table.is-cards td.kx-act { grid-column: 1 / -1; text-align: right; }
.kx-table.is-cards td:has(.kx-tpsl-cell) { grid-column: span 2; }
.kx-table.is-cards td.kx-headcell::before, .kx-table.is-cards td.kx-act::before { content: none; }
.kx-table.is-cards .kx-act .kx-close { justify-content: stretch; }
.kx-table.is-cards .kx-act .kx-close .kx-btn, .kx-table.is-cards .kx-act form .kx-btn { flex: 1; width: 100%; height: 34px; }
@media (hover: hover) { .kx-table.is-cards tbody tr:hover td { background: none; } }

/* ---------- ticker strip ---------- */

/* ---------- phone-only chrome (hidden on wider screens) ---------- */
.vt-bar, .vt-scrim { display: none; }

/* ---------- right column on desktop: it sits on the same rows as the book and the blotter (subgrid),
   so the order form ends where the book ends and the wallet card spans exactly the blotter's row ---------- */
@media (min-width: 1280px) {
  .vt-side { display: grid; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .vt { padding-top: 6px; }
  .vt-grid { grid-template-areas: "head head head" "chart book side" "blot blot side"; }
  /* the pair card runs the full width: the metrics spread across it instead of bunching on the left */
  .vt-head:not(.is-stacked) .kx-head__metrics { justify-content: space-between; }
  .vt-side > .kx-form-tabs { position: relative; z-index: 2; grid-column: 1; grid-row: 1; align-self: start; }
  /* the form body spans the tab row too (empty there): let clicks through to the tabs */
  .vt-side > .kx-form-body { pointer-events: none; }
  .vt-side > .kx-form-body > * { pointer-events: auto; }
  .vt-side > .kx-form-body { grid-column: 1; grid-row: 1 / 3; display: grid; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 0; border-radius: 0; background: none; }
  .vt-side > .kx-form-body[hidden] { display: none; }
  /* contain: size — the form's own height never resizes the grid rows (the price header stays put on Spot/Futures) */
  .kx-form-body > .kf-main { contain: size; grid-column: 1; grid-row: 1; min-height: 0; margin-top: 60px; padding: 14px 14px 16px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a3d42 transparent; border-radius: 10px; background: var(--vt-card); }
  .kx-form-body > .kf-main::-webkit-scrollbar { width: 4px; }
  .kx-form-body > .kf-main::-webkit-scrollbar-thumb { border-radius: 2px; background: #3a3d42; }
  .kx-form-body > .kx-wallet, .kx-form-body > .kf-wallet { grid-column: 1; grid-row: 2; margin: 0; padding: 14px; border-top: 0; border-radius: 10px; background: var(--vt-card); }
}

/* ---------- folding order book (desktop ≥1280) ----------
   The book column narrows to a 40px rail and the chart column takes the freed width. The book's
   own content keeps its full width (--vt-book-w) and fades, so nothing re-wraps mid-animation;
   the rail fades in once the column is narrow. The grid only animates after a click
   (.vt-anim, vega-terminal.js) — never on load or on a window resize. */
@media (min-width: 1280px) {
  .vt { --vt-book-w: 300px; --vt-side-w: 320px; --vt-rail-w: 40px; }
  .vt-grid { grid-template-columns: minmax(0, 1fr) var(--vt-book-w) var(--vt-side-w); }
  .vt.is-book-fold .vt-grid { grid-template-columns: minmax(0, 1fr) var(--vt-rail-w) var(--vt-side-w); }
  .vt.vt-anim .vt-grid { transition: grid-template-columns .32s var(--v-ease, cubic-bezier(.2, .8, .2, 1)); }

  .vt-book > .kx-book-tabs { width: var(--vt-book-w); }
  .vt-book > [data-kx-book-panel]:not([hidden]) { left: auto; width: var(--vt-book-w); }
  .vt-book > .kx-book-tabs, .vt-book > [data-kx-book-panel] { transition: opacity .2s ease .1s, visibility 0s linear 0s; }
  .vt.is-book-fold .vt-book > .kx-book-tabs, .vt.is-book-fold .vt-book > [data-kx-book-panel] { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s ease, visibility 0s linear .12s; }

  /* the button is pinned inside the card's top-right corner; the tabs keep clear of it and shrink (ellipsis) in long languages */
  .vt-book > .kx-book-tabs { position: relative; gap: 14px; padding-inline-end: 44px; }
  .kx-book-tabs [data-kx-book-tab] { flex: 0 1 auto; min-width: 0; white-space: nowrap; }
  .kx-book-tabs .vt-fold { position: absolute; top: 8px; inset-inline-end: 8px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--vt-t2); transition: color .15s, background-color .15s; }
  .kx-book-tabs .vt-fold:hover { background: var(--vt-chip); color: var(--vt-text); }
  .vt-fold svg { display: block; }

  .vt-rail { position: absolute; top: 0; right: 0; bottom: 0; z-index: 3; display: flex; flex-direction: column; align-items: stretch; width: var(--vt-rail-w); padding: 0; border: 0; border-radius: inherit; background: none; color: var(--vt-t2); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s ease, visibility 0s linear .12s, background-color .2s; }
  .vt.is-book-fold .vt-rail { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .2s ease .14s, visibility 0s linear 0s, background-color .2s; }
  .vt-rail:hover { background: var(--vt-card-2); }
  .vt-rail:focus-visible, .kx-book-tabs .vt-fold:focus-visible { outline: 1px solid var(--v-brand); outline-offset: -1px; }
  .vt-rail__ico { display: grid; place-items: center; flex: none; height: 44px; border-bottom: 1px solid var(--vt-line); }
  .vt-rail__ico svg { display: block; transition: transform .2s var(--v-ease, ease); }
  .vt-rail:hover .vt-rail__ico svg { transform: scale(1.12); }
  .vt-rail__depth { display: block; flex: 1 1 0; min-height: 0; width: 100%; }
}
@media (min-width: 1280px) and (prefers-reduced-motion: reduce) {
  .vt.vt-anim .vt-grid, .vt-book > *, .vt-rail { transition: none !important; }
}

/* ---------- responsive ---------- */
@media (min-width: 1700px) {
  .vt { --vt-book-w: 320px; --vt-side-w: 340px; }
}
@media (max-width: 1279px) {
  .vt-grid { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto 480px 440px auto; grid-template-areas: "head head" "chart side" "book side" "blot blot"; }
}
@media (max-width: 960px) {
  .vt-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "head" "chart" "book" "side" "blot"; }
  .vt-chart { height: 460px; }
  .vt-book { height: 520px; }
  .vt-head { flex-wrap: wrap; row-gap: 12px; }
  .vt-metrics { flex: 1 1 100%; }
  .vt-side { display: flex; }
}

/* ---- Chart full screen (vega-terminal.js): native :fullscreen or the fixed full-page layer ---- */
.kx-term .vt-fs { margin-right: 2px; }
.kx-term .vt-fs[aria-pressed="true"] { color: var(--v-brand); }
.vt.is-chart-fs .vt-chart {
  position: fixed; inset: 0; z-index: 600; display: flex !important; width: 100vw; height: calc(100vh / var(--vz, 1)); height: calc(100dvh / var(--vz, 1)) !important;
  max-height: none; margin: 0 !important; border: 0 !important; border-radius: 0; background: var(--vt-page);
}
.vt-chart:fullscreen { width: 100vw; height: calc(100vh / var(--vz, 1)); background: var(--vt-page); }
html.v-chart-fs, html.v-chart-fs body { overflow: hidden; }
.vt-fs-close { display: none; }
.vt.is-chart-fs .vt-fs-close {
  position: absolute; top: 46px; left: 74px; z-index: 30; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--vt-line); border-radius: 50%; background: rgba(23, 24, 27, .92); color: var(--vt-text); cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background-color .15s, transform .12s;
}
.vt.is-chart-fs .vt-fs-close:active { background: #2a2c31; transform: scale(.92); }
.kx-term .vt-fs { touch-action: manipulation; }
/* phones held upright without a real landscape lock (iPhone Safari): the layer is drawn turned sideways */
@media (max-width: 767px) and (orientation: portrait) {
  .vt.is-chart-fs .vt-chart:not(:fullscreen) {
    inset: auto; top: 0; right: 100vw; width: calc(100dvh / var(--vz, 1)); height: 100vw !important;
    transform: rotate(-90deg); transform-origin: 100% 0;
  }
}

/* Phone-only pieces stay out of the desktop layout */
.vt-mchg, .vt-mmode, .vt-mchart, .vt-ph, .vt-back, .vt-tochart { display: none; }

/* =====================================================================
   Phones (≤767px) — two screens, as in the Binance / OKX apps (user-approved 2026-11-23).
   [data-v-screen="chart"] (default): pair + big price + 24h stats, a large chart, full-width
     order book / trades, fixed Buy / Sell bar.
   [data-v-screen="trade"] (Buy / Sell, #trade): back arrow + pair, Spot / Futures, order form
     beside a compact book, positions / orders underneath.
   Same nodes in both: the screens only re-place them, every script hook stays put.
   ===================================================================== */
@media (max-width: 767px) {
  body.vega.kx-page { padding-bottom: 0 !important; }
  .vt { padding: 0 0 calc(76px + env(safe-area-inset-bottom)); background: var(--vt-page); }
  .vt-card { border-radius: 0; background: none; }
  .vt-panes, .vt-scrim, .vt-sheethead, .vt-mchart { display: none !important; }
  .vt-grid { gap: 0; padding: 0 16px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }

  /* ---- pair picker: full screen (both screens) ---- */
  .kx-head__sym .asset-ico { width: 24px; height: 24px; }
  .kx-head__sym-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
  /* pair picker: a full-screen market list as in the exchange apps — search + Close on one row,
     Favorites / All tabs, pair over its volume · last price · 24h change badge, rows as separate plates */
  .kx-head__sym-menu {
    position: fixed; inset: 0; z-index: 400; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto minmax(0, 1fr);
    grid-template-areas: "search close" "tabs tabs" "cols cols" "list list"; column-gap: 12px;
    width: auto; max-height: none; margin: 0; padding: calc(12px + env(safe-area-inset-top)) 16px 0; border-radius: 0; background: var(--vt-page); box-shadow: none;
  }
  .kx-head__sym-menu[hidden] { display: none !important; }
  .kx-head__sym-search { grid-area: search; height: 44px; margin: 0; border-radius: 12px; }
  .kx-head__sym-search input { font-size: 16px; }
  .kx-m-symclose { grid-area: close; display: block; align-self: center; height: 44px; margin: 0; padding: 0 2px; border: 0; background: none; color: var(--vt-text); font: 600 16px/1 var(--v-font); }
  .kx-head__sym-tabs { grid-area: tabs; gap: 24px; margin: 14px 0 6px; }
  .kx-head__sym-tab { position: relative; height: 38px; padding: 0; border-radius: 0; background: none !important; color: var(--vt-t3); font-size: 16px; font-weight: 700; }
  .kx-head__sym-tab.is-active { color: var(--vt-text); }
  .kx-head__sym-tab.is-active::after { content: ""; position: absolute; right: 0; left: 0; bottom: 0; height: 3px; border-radius: 2px; background: var(--v-brand); }
  .kx-head__sym-cols { grid-area: cols; grid-template-columns: minmax(0, 1fr) 96px 84px; padding: 8px 12px; font-size: 12px; }
  .kx-head__sym-cols span:first-child, .kx-head__sym-cols span:nth-child(5) { display: none; }
  .kx-head__sym-list { grid-area: list; gap: 4px; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(16px + env(safe-area-inset-bottom)); scrollbar-width: none; }
  .kx-head__sym-list::-webkit-scrollbar { display: none; }
  /* row: the coin icon is centred on both lines; ticker + /USDT on the first, volume under them */
  .kx-head__sym-row {
    flex: none; grid-template-columns: 22px 30px auto minmax(0, 1fr) 96px 84px; grid-template-rows: auto auto;
    grid-template-areas: "star icon base quote px chg" "star icon vol vol px chg";
    align-content: center; column-gap: 0; row-gap: 3px; height: 64px; padding: 0 8px 0 12px; border-radius: 14px;
  }
  .kx-head__sym-row:hover { background: none; }
  .kx-head__sym-row.is-active, .kx-head__sym-row:active { background: var(--vt-card); }
  .kx-head__sym-star { grid-area: star; align-self: center; }
  .kx-head__sym-pair { display: contents; }
  .kx-head__sym-pair .asset-ico { grid-area: icon; align-self: center; justify-self: start; margin-right: 4px; }
  .kx-head__sym-pair .asset-ico, .kx-head__sym-pair .asset-ico :is(img, svg) { width: 24px; height: 24px; }
  .kx-head__sym-pair strong { grid-area: base; align-self: end; padding-right: 6px; font-size: 16px; font-weight: 700; line-height: 1.15; white-space: nowrap; }
  .kx-head__sym-pair small { grid-area: quote; align-self: end; min-width: 0; margin: 0; padding-right: 2px; overflow: hidden; font-size: 13px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
  .kx-head__sym-row .kx-head__sym-vol { grid-area: vol; display: block; align-self: start; min-width: 0; padding-right: 6px; overflow: hidden; color: var(--vt-t3); font-size: 12px; font-weight: 500; line-height: 1.2; text-align: right; white-space: nowrap; }
  .kx-head__sym-px, .kx-head__sym-chg { align-self: center; }
  .kx-head__sym-px { padding-left: 10px; }
  .kx-head__sym-px { grid-area: px; color: var(--vt-text) !important; font-size: 15px; font-variant-numeric: tabular-nums; }
  .kx-head__sym-chg { grid-area: chg; justify-self: end; display: grid; place-items: center; width: 80px; height: 34px; border-radius: 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
  .kx-head__sym-chg.pos { background: var(--vt-up); color: var(--v-brand-ink); }
  .kx-head__sym-chg.neg { background: var(--vt-down); color: #fff; }
  .kx-head__sym-chg:not(.pos):not(.neg) { background: var(--vt-chip); color: var(--vt-t2); }
  .kx-head__sym-empty { grid-area: list; align-self: start; margin-top: 40px; color: var(--vt-t3); font-size: 15px; text-align: center; }
}
@media (max-width: 380px) {
  .kx-head__sym-cols { grid-template-columns: minmax(0, 1fr) 84px 72px; }
  .kx-head__sym-row { grid-template-columns: 20px 28px auto minmax(0, 1fr) 84px 72px; }
  .kx-head__sym-px { font-size: 14px; }
  .kx-head__sym-chg { width: 70px; font-size: 13px; }
  .kx-head__sym-pair small { display: none; }
}
@media (max-width: 767px) {
  html.m-lock-sym, html.m-lock-sym body { overflow: hidden; }
  /* the change is plain coloured text, no plate (user, 2026-11-24) */
  .vt-mchg { display: inline-flex; align-items: center; height: 24px; font: 600 14px/1 var(--v-font); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .vt-mchg, .vt-head .kx-head__last-abs, .vt-head .kx-head__m-val { unicode-bidi: plaintext; } /* Arabic / Hebrew: "-1,437.91" keeps its minus in front */
  .vt-mchg.pos { color: var(--vt-up); }
  .vt-mchg.neg { color: var(--vt-down); }

  /* =================== CHART screen =================== */
  .vt[data-v-screen="chart"] .vt-grid { grid-template-areas: "head" "chart" "book"; }
  .vt[data-v-screen="chart"] .vt-side, .vt[data-v-screen="chart"] .vt-blot, .vt[data-v-screen="chart"] .vt-mmode { display: none; }

  /* header: pair · big price (+ change) on the left, the 24h stats stacked on the right */
  .vt[data-v-screen="chart"] .vt-head {
    display: grid; grid-template-columns: auto auto auto minmax(0, 1fr); align-items: center; gap: 0 8px;
    /* the third column takes the price's spare width, so the change % stays right beside the sum */
    grid-template-areas: "sym sym sym sym" "last last last stats" "abs chg . stats";
    min-height: 0; padding: 12px 0 14px;
  }
  .vt[data-v-screen="chart"] .kx-head__sym { grid-area: sym; margin-bottom: 10px; }
  .vt[data-v-screen="chart"] .kx-head__price { display: contents; }
  .vt[data-v-screen="chart"] .kx-head__last { grid-area: last; white-space: nowrap; align-self: end; font: 700 clamp(26px, 8.2vw, 32px)/1.1 var(--v-font); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
  .vt[data-v-screen="chart"] .kx-head__last-abs { grid-area: abs; white-space: nowrap; align-self: start; margin-top: 6px; font-size: 14px; font-weight: 600; }
  .vt[data-v-screen="chart"] .vt-mchg { grid-area: chg; justify-self: start; align-self: start; height: auto; margin-top: 6px; line-height: inherit; }
  /* the price always gets its full width; the stats live in what is left of the row and wrap there */
  .vt[data-v-screen="chart"] .vt-metrics { grid-area: stats; align-self: center; justify-self: end; min-width: 0; max-width: 100%; margin: 0; }
  .vt[data-v-screen="chart"] .vt-metrics__more, .vt[data-v-screen="chart"] .vt-metrics__pop { display: none !important; }
  .vt[data-v-screen="chart"] .kx-head__metrics { display: grid; grid-template-columns: auto auto; gap: 7px 14px; }
  .vt[data-v-screen="chart"] .kx-head__m { display: contents; }
  .vt[data-v-screen="chart"] .kx-head__m-label { color: var(--vt-t3); font-size: 12px; white-space: nowrap; }
  .vt[data-v-screen="chart"] .kx-head__m-val { color: var(--vt-text); font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
  /* spot: 24h high / low / turnover · futures: mark / funding / turnover */
  .vt[data-v-screen="chart"] .kx-head__m:is(:nth-child(1), :nth-child(2), :nth-child(3), :nth-child(7), :nth-child(8)) { display: none; }
  .vt[data-v-screen="chart"]:has(.vt-mmode [data-kx-mode-tab="futures"].is-active) .kx-head__m:is(:nth-child(2), :nth-child(3)) { display: contents; }
  .vt[data-v-screen="chart"]:has(.vt-mmode [data-kx-mode-tab="futures"].is-active) .kx-head__m:is(:nth-child(4), :nth-child(5)) { display: none; }
  /* a long label ("24h turnover (USDT)") wraps onto a second line instead of being cut */
  .vt[data-v-screen="chart"] .kx-head__m-label { max-width: 96px; line-height: 1.25; white-space: normal; }
  /* narrow phones: the values keep their own column ("0.0100% / 00:16:45" breaks at the slash), the labels wrap */
  @media (max-width: 429px) {
    .vt[data-v-screen="chart"] .vt-metrics { justify-self: stretch; }
    .vt[data-v-screen="chart"] .kx-head__metrics { grid-template-columns: minmax(0, 96px) minmax(min-content, 66px); justify-content: end; column-gap: 10px; }
    .vt[data-v-screen="chart"] .kx-head__m-val { line-height: 1.25; white-space: normal; }
    .vt[data-v-screen="chart"] .kx-head__m-label { overflow-wrap: break-word; hyphens: auto; }
  }
  @media (max-width: 339px) {
    .vt[data-v-screen="chart"] .kx-head__last { font-size: 22px; }
    .vt[data-v-screen="chart"] .kx-head__metrics { column-gap: 8px; }
  }

  /* the chart: full bleed, more than half the screen */
  .vt[data-v-screen="chart"] .vt-chart { display: flex; height: clamp(380px, calc(58vh / var(--vz, 1)), 560px); margin: 0 -16px; border-block: 1px solid var(--vt-line); background: var(--vt-page); }
  .kx-term .trade-chart__bar { padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
  .kx-term .trade-chart__bar::-webkit-scrollbar { display: none; }
  /* chart menus (timeframes · chart type · settings) open as bottom sheets over a dimmed page:
     as dropdowns they were clipped by the scrolling toolbar and fell behind the chart */
  .kx-term .trade-chart__pop:not([hidden]) {
    position: fixed; inset: auto 0 0 0; z-index: 410; min-width: 0; max-height: calc(80dvh / var(--vz, 1)); overflow-y: auto; overscroll-behavior: contain;
    gap: 4px; padding: 26px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0;
    background: var(--vt-card-2); box-shadow: 0 0 0 1px var(--vt-line); animation: m-sheet-up .25s ease;
  }
  .kx-term .trade-chart__pop:not([hidden])::before { content: ""; position: absolute; top: 9px; right: 50%; width: 36px; height: 4px; margin-right: -18px; border-radius: 99px; background: var(--vt-chip-2); }
  html:has(.kx-term .trade-chart__pop:not([hidden])) body::after { content: ""; position: fixed; inset: 0; z-index: 405; background: rgba(5, 6, 7, .72); }
  .kx-term .trade-chart__pop--tf:not([hidden]) { gap: 14px; }
  .kx-term .trade-chart__pop-group { font-size: 12px; }
  .kx-term .trade-chart__pop-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .kx-term .trade-chart__pop-row .trade-chart__tf-btn { display: grid; place-items: center; height: 44px; padding: 0; border-radius: 12px; background: var(--vt-chip); font-size: 15px; text-align: center; }
  .kx-term :is(.trade-chart__choice, .trade-chart__toggle) { min-height: 50px; padding: 0 14px; border-radius: 12px; font-size: 16px; }
  .kx-term .trade-chart__choice.is-active { background: var(--vt-chip); }
  /* candle legend: one compact block (timeframe · O H L C · change) so it never covers the candles */
  .kx-term .trade-chart__legend { top: 6px; right: 10px; gap: 2px; max-width: calc(100% - 72px); }
  .kx-term .trade-chart__legend-row, .kx-term .trade-chart__legend-ohlc { gap: 2px 8px; font-size: 11px; }
  .kx-term .trade-chart__legend-pair, .kx-term .trade-chart__legend-when { display: none; }
  .kx-term .trade-chart__legend-row--metrics > span:nth-child(n+2) { display: none; }

  /* full-width order book / trades under the chart */
  .vt[data-v-screen="chart"] .vt-book { height: 600px; margin: 0 -16px; overflow: hidden; }
  .vt[data-v-screen="chart"] .vt-book .kx-book-tabs { gap: 24px; height: 48px; padding: 0 16px; border-bottom: 1px solid var(--vt-line); }
  .vt[data-v-screen="chart"] .vt-book .kx-book-tabs button { height: 48px; font-size: 15px; }
  .vt[data-v-screen="chart"] .vt-book .kx-book-tools { padding: 10px 16px 8px; }
  .vt[data-v-screen="chart"] .vt-book :is(.kx-book-head, .kx-tape-head) { padding: 0 16px 8px; font-size: 12px; }
  .vt[data-v-screen="chart"] .vt-book .kx-tape-head { padding-top: 14px; }
  .vt[data-v-screen="chart"] .vt-book :is(.kx-book-head, .kx-tape-head) span:nth-child(n+2) { width: 110px; }
  .vt[data-v-screen="chart"] .vt-book .kx-book-row { height: 24px; padding: 0 16px; font-size: 14px; }
  .vt[data-v-screen="chart"] .vt-book :is(.kx-book-row__qty, .kx-book-row__tot) { width: 110px; }
  .vt[data-v-screen="chart"] .vt-book .kx-book-mid { height: 48px; padding: 0 16px; }
  .vt[data-v-screen="chart"] .vt-book .kx-book-mid__px { font-size: 20px; }
  .vt[data-v-screen="chart"] .vt-book .kx-book-mid__usd { font-size: 13px; }
  .vt[data-v-screen="chart"] .vt-book .kx-tape-row { height: 24px; min-height: 24px; flex: none; padding: 0 16px; font-size: 14px; }
  .vt[data-v-screen="chart"] .vt-book .kx-tape-row span:nth-child(n+2) { width: 110px; }
  .vt-book .vt-fold, .vt-book .vt-rail { display: none !important; }

  /* fixed Buy / Sell bar (chart screen only) */
  .vt-bar { position: fixed; right: 0; left: 0; bottom: 0; z-index: 300; display: flex; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(11, 12, 13, .94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: none; }
  .vt[data-v-screen="trade"] .vt-bar { display: none; }
  .vt-bar button { flex: 1; height: 50px; border: 0; border-radius: 99px; font-size: 17px; font-weight: 700; }
  .vt-bar__buy { background: var(--vt-up); color: var(--v-brand-ink); }
  .vt-bar__sell { background: var(--vt-down); color: #fff; }

  /* =================== TRADE screen =================== */
  .vt[data-v-screen="trade"] .vt-grid {
    gap: 0 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
    grid-template-areas: "head head" "mode mode" "side book" "blot blot";
  }
  .vt[data-v-screen="trade"] .vt-chart { display: none; }
  /* top row: ‹ back · BTC/USDT ▾ · +1.95% … chart */
  .vt[data-v-screen="trade"] .vt-head { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; min-height: 0; padding: 8px 0 4px; }
  .vt[data-v-screen="trade"] .vt-head :is(.kx-head__price, .vt-metrics) { display: none; }
  .vt[data-v-screen="trade"] .vt-back { display: grid; place-items: center; flex: none; width: 36px; height: 40px; margin-right: -8px; padding: 0; border: 0; background: none; color: var(--vt-text); }
  .vt[data-v-screen="trade"] .vt-tochart { display: grid; place-items: center; flex: none; width: 40px; height: 40px; margin: 0 auto 0 -8px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--vt-t2); }
  .vt[data-v-screen="trade"] .vt-tochart:active { background: var(--vt-chip); }
  /* Spot / Futures: the app's top switch */
  .vt[data-v-screen="trade"] .vt-mmode { grid-area: mode; display: flex; gap: 24px; padding: 4px 0 12px; }
  .vt-mmode button { position: relative; height: 40px; padding: 0; border: 0; background: none; color: var(--vt-t3); font: 700 18px/1 var(--v-font); letter-spacing: -.01em; cursor: pointer; transition: color .15s; -webkit-tap-highlight-color: transparent; }
  .vt-mmode button.is-active { color: var(--vt-text); }
  .vt-mmode button.is-active::after { content: ""; position: absolute; right: 0; left: 0; bottom: 2px; height: 3px; border-radius: 2px; background: var(--v-brand); }

  /* ---- order form (left column) ---- */
  .vt[data-v-screen="chart"] .vt-side { display: none; }
  .vt[data-v-screen="trade"] .vt-side { position: static; display: block; min-width: 0; max-height: none; overflow: visible; padding: 0; border-radius: 0; background: none; transform: none; visibility: visible; transition: none; }
  .vt-side .kx-form-tabs, .vt-side .kx-wallet, .vt-side .kf-wallet, .vt-side .kf-divide, .vt-side .kf-fees { display: none !important; }
  .vt-side .kf, .vt-side .kx-form-body { padding: 0; border-radius: 0; background: none; }
  .vt-side .kf-main { padding: 0; }
  .vt-side .kf-oc { padding: 3px; background: var(--vt-card); }
  .vt-side .kf-oc button { height: 40px; font-size: 15px; }
  .vt-side .kf--spot .kf-oc { margin-bottom: 12px; }
  .vt-side .kf-lev { gap: 8px; padding: 10px 0 12px; }
  .vt-side .kf-lev__chip { height: 36px; font-size: 14px; }
  .vt-side .kf-tabs { gap: 16px; }
  .vt-side .kf-tabs button { height: 38px; font-size: 14px; }
  .vt-side .kf-inputs { gap: 12px; margin-top: 12px; }
  .vt-side .kf-field__label { margin-bottom: 6px; font-size: 13px; }
  .vt-side .kf-field__box { height: 48px; padding: 0 12px; border-radius: 12px; }
  .vt-side .kf-field__box input { font-size: 16px; }
  .vt-side .kf-field__unit, .vt-side .kf-latest { font-size: 13px; }
  .vt-side .kf-latest { margin-right: 6px; }
  .vt-side .kf-slider__marks span { font-size: 11px; }
  .vt-side .kf-sum { margin-top: 12px; }
  .vt-side :is(.kf-sum__line, .kf-sum__avail) { flex-wrap: wrap; row-gap: 2px; font-size: 13px; }
  .vt-side .kf-sum__row { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
  .vt-side .kf-sum__row > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; font-size: 13px; }
  .vt-side .kf-sum__row > div strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .vt-side .kf-sum__row--max { margin-bottom: 6px; }
  .vt-side .kf-sum__row--max > div + div { margin-right: 0; }
  /* every label sits at the column's left edge: its tip opens rightwards and never leaves the screen */
  .vt-side .kf-tip::after, .vt-side .kf-tip--end::after { right: 0; left: auto; width: min(220px, calc(100vw - 40px)); }
  .vt-side .kf-checks { gap: 14px; margin-top: 10px; font-size: 14px; }
  .vt-side .kf-btns { flex-direction: column; gap: 10px; margin-top: 14px; }
  .vt-side .kf-btn { flex: none; width: 100%; height: 48px; font-size: 16px; }
  .vt-side .kf-margins { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
  .vt-side .kf-margins > div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
  .vt-side .kx-guest-cta { height: 48px; font-size: 15px; }
  .kf-field__box input { font-size: 16px; }
  .kf-dd__menu { width: min(260px, calc(100vw - 48px)); }

  /* ---- compact book (right column): price + qty, as tall as the form ---- */
  .vt[data-v-screen="trade"] .vt-book { align-self: stretch; min-height: 420px; height: auto; overflow: hidden; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-tabs { gap: 14px; height: 40px; padding: 0; border-bottom: 0; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-tabs button { height: 40px; font-size: 14px; }
  .vt[data-v-screen="trade"] .vt-book .vt-dsk { display: none; }
  .vt[data-v-screen="trade"] .vt-book .vt-ph { display: inline; }
  .vt[data-v-screen="trade"] .vt-book > [data-kx-book-panel] { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .vt[data-v-screen="trade"] .vt-book > [data-kx-book-panel][hidden] { display: none; }
  /* view switch + price step under the ladder, each on its own row */
  .vt[data-v-screen="trade"] .vt-book .kx-book-tools { order: 9; flex-direction: column; align-items: stretch; gap: 8px; margin-top: auto; padding: 10px 0 0; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-modes { justify-content: space-between; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-modes button { width: 34px; height: 30px; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-tick { justify-content: space-between; width: 100%; height: 34px; font-size: 13px; }
  .vt[data-v-screen="trade"] .vt-book :is(.kx-book-head, .kx-tape-head) { padding: 2px 0 8px; font-size: 12px; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-head span:nth-child(3) { display: none; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-head span:nth-child(2) { width: auto; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-row { height: 22px; padding: 0; font-size: 13px; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-row__tot { display: none; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-row__qty { width: auto; padding-right: 6px; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-mid { flex-wrap: wrap; height: auto; gap: 0 4px; margin: 4px 0; padding: 8px 0; border: 0; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-mid__px { font-size: 19px; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-mid__usd { width: 100%; margin: 2px 0 0; font-size: 12px; }
  .vt[data-v-screen="trade"] .vt-book .kx-book-ratio { display: none; }
  /* market trades: price · amount (no room for the time) */
  .vt[data-v-screen="trade"] .vt-book :is(.kx-tape-head, .kx-tape-row) span:nth-child(3) { display: none; }
  .vt[data-v-screen="trade"] .vt-book :is(.kx-tape-head, .kx-tape-row) span:nth-child(2) { width: auto; padding-right: 6px; text-align: left; }
  .vt[data-v-screen="trade"] .vt-book .kx-tape-row { flex: none; height: 22px; min-height: 22px; padding: 0; font-size: 13px; }

  /* ---- positions / orders (trade screen) ---- */
  /* no band above the tabs (user, 2026-11-23: "что за разрыв") — the list just follows the form */
  .vt[data-v-screen="trade"] .vt-blot { min-height: 240px; margin: 28px -16px 0; border-top: 0; background: none; }
}
.kx-head__sym-search input:focus-visible { outline: none; }

/* i18n: book tabs and header stats stay on one line in every language */
[data-kx-book-tab] { white-space: nowrap; }

/* % chips: hovered ≠ selected */
.kx-pcts button:hover:not(.is-on) { background: rgba(255, 255, 255, .06); }
.kx-pcts button.is-on, .kx-pcts button.is-on:hover { background: var(--vt-chip-2); color: var(--vt-text); font-weight: 600; }


/* =====================================================================
   Terminal dialogs on phones (leverage / close position / TP-SL), user 2026-11-23: "not skin 3".
   Same as skin 3's account dialogs (.vq): a bottom sheet with a grab bar (vega-mobile.js), big title,
   the position as plain words (no dots, vega-terminal.js), filled fields, pill switches, no lines.
   ===================================================================== */
.kx-tpsl-info .vt-pi { display: inline; }
.kx-tpsl-info .vt-pi + .vt-pi { margin-right: 10px; }
@media (max-width: 767px) {
  body.vega .kf-modal { align-items: flex-end; }
  body.vega .kf-modal__panel {
    width: 100%; max-height: calc(92dvh / var(--vz, 1)); overflow: auto; padding: 24px 18px calc(20px + env(safe-area-inset-bottom));
    border: 0; border-radius: 24px 24px 0 0; background: #0d0e10; box-shadow: none; overscroll-behavior: contain;
    animation: vt-kf-up .26s cubic-bezier(.2, .8, .2, 1);
  }
  body.vega .kf-modal__panel > .m-grab { position: sticky; top: -24px; z-index: 5; margin: -16px 0 4px; padding: 10px 0 6px; background: transparent; }
  body.vega .kf-modal__head { margin-bottom: 6px; }
  body.vega .kf-modal__head h3 { color: var(--v-t1); font-size: 22px; letter-spacing: -.02em; }
  body.vega .kx-tpsl-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 22px; color: var(--v-t2); font-size: 14px; }
  body.vega .kx-tpsl-info .vt-pi { margin: 0; }
  body.vega .kx-tpsl-info .vt-pi--pair { color: var(--v-t1); font-weight: 600; }
  body.vega .kx-tpsl-info .vt-pi--long { color: var(--vt-up); font-weight: 600; }
  body.vega .kx-tpsl-info .vt-pi--short { color: var(--vt-down); font-weight: 600; }
  /* Limit / Market */
  body.vega .kf-modal .kx-seg { gap: 2px; margin-bottom: 18px; padding: 3px; border-radius: 99px; background: var(--v-surface); }
  body.vega .kf-modal .kx-seg button { height: 40px; font-size: 15px; color: var(--v-t2); }
  body.vega .kf-modal .kx-seg button.is-on { background: var(--v-t1); color: var(--v-bg); }
  /* fields */
  body.vega .kf-modal .kx-tpsl-field { margin-bottom: 14px; }
  body.vega .kf-modal .kx-tpsl-field > span:first-child { margin-bottom: 8px; color: var(--v-t2); font-size: 13px; font-weight: 500; }
  body.vega .kf-modal .kx-field__row { height: 52px; padding: 0 16px; border: 1px solid transparent; border-radius: 14px; background: var(--v-surface); }
  body.vega .kf-modal .kx-field__row:focus-within { border-color: var(--v-focus); }
  body.vega .kf-modal .kx-field__row.is-bad { border-color: var(--vt-down); }
  body.vega .kf-modal .kx-field__row input { font-size: 17px; }
  body.vega .kf-modal .kx-field__suffix { color: var(--v-t3); font-size: 14px; font-weight: 500; }
  body.vega .kf-modal .kx-pcts { gap: 8px; margin: 4px 0 22px; }
  body.vega .kf-modal .kx-pcts button { height: 38px; border-radius: 99px; background: var(--v-surface); color: var(--v-t2); font-size: 14px; }
  body.vega .kf-modal .kx-pcts button.is-on, body.vega .kf-modal .kx-pcts button.is-on:hover { background: var(--v-t1); color: var(--v-bg); }
  /* leverage */
  body.vega .kf-modal .kf-levpick { height: 60px; margin-top: 14px; padding: 0 6px; border: 1px solid transparent; border-radius: 16px; background: var(--v-surface); }
  body.vega .kf-modal .kf-levpick:focus-within { border-color: var(--v-focus); }
  body.vega .kf-modal .kf-levpick__step { width: 48px; height: 48px; border-radius: 12px; font-size: 24px; }
  body.vega .kf-modal .kf-levpick__step:active { background: rgba(255, 255, 255, .08); }
  body.vega .kf-modal .kf-levpick input { font-size: 22px; }
  body.vega .kf-modal .kf-levpick__x { font-size: 22px; }
  body.vega .kf-modal .kf-levmarks { flex-wrap: wrap; gap: 8px; }
  body.vega .kf-modal .kf-levmarks button { flex: 1 1 calc(25% - 8px); height: 38px; background: var(--v-surface); font-size: 14px; }
  body.vega .kf-modal .kf-levmarks button.is-on { background: var(--v-brand); color: var(--v-brand-ink); }
  body.vega .kf-modal .kf-modal__note { margin: 18px 0 22px; color: var(--v-t2); font-size: 13px; }
  body.vega .kf-modal .kf-modal__ok { height: 54px; font-size: 16px; }
}
@keyframes vt-kf-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body.vega .kf-modal__panel { animation: none; } }
/* blotter cards on phones: long labels (some languages) and values wrap inside their cell, never past the screen */
@media (max-width: 767px) {
  body.vega .kx-table.is-cards td { overflow-wrap: anywhere; }
  body.vega .kx-table.is-cards td::before { white-space: normal; line-height: 1.3; overflow-wrap: anywhere; }
}

/* ---------- desktop order form: no inner scroll (user, 2026-11-23) ----------
   The form sits in a fixed-height column; when its content would not fit, vega-terminal.js steps it to a denser
   level (kf-d1 → kf-d2 → kf-d3) until it does: tighter gaps and lower fields first, then the fee line and the
   0–100% captions go (the slider dots stay), last the type steps down and the margin-estimate line goes. */
@media (min-width: 1280px) {
  .kx-form-body > .kf-main.kf-d1 .kf-inputs { gap: 8px; margin-top: 10px; }
  .kx-form-body > .kf-main.kf-d1 .kf-field__label { margin-bottom: 4px; }
  .kx-form-body > .kf-main.kf-d1 .kf-field__box { height: 40px; }
  .kx-form-body > .kf-main.kf-d1 .kf-lev { padding: 8px 0 10px; }
  .kx-form-body > .kf-main.kf-d1 .kf-slider { margin: 0 0 2px; }
  .kx-form-body > .kf-main.kf-d1 .kf-slider__marks { margin-top: 2px; }
  .kx-form-body > .kf-main.kf-d1 .kf-sum__avail { margin-top: 6px; }
  .kx-form-body > .kf-main.kf-d1 .kf-sum__row--max { margin-bottom: 6px; }
  .kx-form-body > .kf-main.kf-d1 .kf-checks { padding: 2px 0 8px; }
  .kx-form-body > .kf-main.kf-d1 .kf-btn { height: 42px; }
  .kx-form-body > .kf-main.kf-d1 .kf-fees { margin-top: 8px; }
  .kx-form-body > .kf-main.kf-d1 .kf-margins > div { margin-top: 8px; }

  .kx-form-body > .kf-main.kf-d2 .kf-inputs { gap: 6px; margin-top: 8px; }
  .kx-form-body > .kf-main.kf-d2 .kf-field__box { height: 36px; }
  .kx-form-body > .kf-main.kf-d2 .kf-tabs button { height: 30px; }
  .kx-form-body > .kf-main.kf-d2 .kf-oc button { height: 28px; }
  .kx-form-body > .kf-main.kf-d2 .kf-lev { padding: 6px 0 8px; }
  .kx-form-body > .kf-main.kf-d2 .kf-slider__marks { display: none; }
  .kx-form-body > .kf-main.kf-d2 .kf-btn { height: 38px; font-size: 14px; }
  .kx-form-body > .kf-main.kf-d2 .kf-fees { display: none; }

  .kx-form-body > .kf-main.kf-d3 .kf-field__label { margin-bottom: 2px; font-size: 11px; }
  .kx-form-body > .kf-main.kf-d3 .kf-field__box input { font-size: 14px; }
  .kx-form-body > .kf-main.kf-d3 .kf-sum { font-size: 12px; }
  .kx-form-body > .kf-main.kf-d3 .kf-margins { display: none; }
  .kx-form-body > .kf-main.kf-d3 .kf-inputs { gap: 4px; }
  .kx-form-body > .kf-main.kf-d3 .kf-field__box { height: 34px; }
  .kx-form-body > .kf-main.kf-d3 .kf-oc button { height: 26px; }
  .kx-form-body > .kf-main.kf-d3 .kf-lev { padding: 4px 0 6px; }
  .kx-form-body > .kf-main.kf-d3 .kf-tabs button { height: 28px; }
  .kx-form-body > .kf-main.kf-d3 .kf-checks { padding: 0 0 6px; }
  .kx-form-body > .kf-main.kf-d3 .kf-sum__row--max { margin-bottom: 4px; }
  .kx-form-body > .kf-main.kf-d3 .kf-btn { height: 36px; }
}
