/* HedgeBot Simulator — тёмная тема в стиле терминала Bybit */
:root {
  --bg: #0b0b0f;          /* фон между панелями */
  --panel: #17181e;       /* панели (правая, шапка) */
  --panel2: #101014;      /* график, таблицы */
  --input: #25282c;       /* поля ввода */
  --hover: #2b2f36;
  --line: #25272d;        /* разделители */
  --border: #2e3036;
  --text: #ffffff;
  --text2: #adb1b8;
  --muted: #71757a;
  --green: #20b26c;
  --red: #ef454a;
  --orange: #f7a600;
  --liq: #f0703c;
  --blue: #2962ff;
  --yellow: #ffd600;
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 12px/1.45 Inter, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button, select, input { font: inherit; color: var(--text); }
button { cursor: pointer; border: none; background: none; }
button:disabled { opacity: .4; cursor: default; }
input, select {
  background: var(--input); border: 1px solid transparent; border-radius: 6px; padding: 5px 8px; outline: none;
}
input:focus, select:focus { border-color: var(--orange); }
input[type=range]:focus { border-color: transparent; }   /* бегунки — без оранжевой рамки, пока их тянут */
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
select option { background: var(--panel); }

.btn-primary { background: var(--orange); color: #000; font-weight: 600; border-radius: var(--radius); padding: 7px 14px; }
.btn-primary:hover:not(:disabled) { background: #ffb31a; }
.btn-gray { background: var(--hover); border-radius: var(--radius); padding: 6px 12px; font-weight: 500; }
.btn-gray:hover:not(:disabled) { background: #363a42; }
.btn-ghost { color: var(--text2); padding: 6px 10px; border-radius: var(--radius); }
.btn-ghost:hover { color: var(--text); background: var(--hover); }
.btn-gray.icon { padding: 5px 10px; }
.wide { width: 100%; margin-top: 8px; }
.up { color: var(--green) !important; }
.down { color: var(--red) !important; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 11px; margin: 10px 0 0; }

/* ---------- Шапка ---------- */
/* Слева — инструмент и сессия, по центру — логотип, справа — кнопки сессий */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; height: 52px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--bg); }
.topbar .ticker { justify-self: start; }
.topbar .brand { justify-self: center; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
/* Фьючерсный: информация о монете слева, сразу за ней «Сессии», название симулятора — у правого края */
.topbar.topbar-fut { display: flex; }
.topbar-fut .ticker { flex: 0 1 auto; }
.topbar-fut .top-actions { flex-shrink: 0; margin-left: 6px; }
.topbar-fut .brand { flex-shrink: 0; margin-left: auto; }
.brand { font-weight: 700; font-size: 16px; color: var(--orange); white-space: nowrap; }
/* ---------- Бот HedgeBots (та же страница фьючерсов, класс hb-bot): без плеера, сессий, списков, уведомлений ---------- */
.hb-bot #btnPlay, .hb-bot #btnBack, .hb-bot #btnStep, .hb-bot #btnStartDate, .hb-bot #btnDownload, .hb-bot .top-actions,
.hb-bot .toolbar .tb-check:not(#lblBottom), .hb-bot .toolbar label:has(#selSpeed), .hb-bot #rbar [data-rpanel="watch"],
.hb-bot #rbar [data-rpanel="news"], .hb-bot #wlPanel, .hb-bot #viewNote, .hb-bot #pauseHint,
.hb-bot #playerBar, .hb-bot #btnSim, .hb-bot #btnSessions { display: none !important; }
/* Пополнить / вывести — только на сайте биржи */
.hb-bot .acc-btns, .hb-bot #trPop { display: none !important; }
/* Монета и режим уже есть в шапке (слева — монета, справа — биржа и режим): «Сессия» и «Биржа» у бота не нужны */
.hb-bot .tk-item:has(#tkSession), .hb-bot .tk-item:has(#tkExchange) { display: none; }
/* Логотип биржи в шапке справа (симулятор — img/logos, бот — HedgeBots/engine/static/logos) */
.hb-logo { display: block; height: 18px; width: auto; }
/* Binance: буквы — 5,6…17,8 из 23 по высоте, ромб — во всю высоту: буквы той же высоты, что логотип Bybit */
.hb-logo-binance { height: 25.2px; }
/* Bybit: «I» в логотипе приподнята — при честном центрировании логотип кажется ниже соседей, поднят на 4px */
.hb-logo-bybit { position: relative; top: -4px; }
.hb-sep { width: 1px; height: 20px; margin: 0 14px; background: #3b3d4a; }
.sim-mode { font-style: normal; padding: 2px 8px; border-radius: 4px; font-size: 12px; line-height: 16px; font-weight: 600; }
.sim-mode { background: var(--orange); color: var(--panel); }
/* Справа в шапке, одинаково у фьючерсного симулятора и ботов: статус, плашка режима (ПРОСМОТР / ЖИВАЯ / ТРЕНИРОВКА;
   у бота DEMO / PAPER / REAL), «Simulator» или «HedgeBot», линия, логотип биржи */
.sim-brand { display: flex; align-items: center; font-size: 14.7px; }
.sim-brand .sim-mode { margin: 0 10px 0 0; }
.sim-brand .sim-name { color: var(--text); font-weight: 400; }
.topbar-fut #status ~ .brand.sim-brand { margin-left: -6px; }   /* с отступом шапки (gap 18px) — 12px от статуса */
/* Сессий и просмотра нет (пустой экран) — только «Simulator» */
body:has(#emptyState:not([hidden])) .sim-brand :is(.sim-mode, .hb-sep, .hb-logo) { display: none !important; }
body:has(#emptyState:not([hidden])) .topbar-fut .tk-item:has(#tkSession) { display: none; }
/* Слева «Биржа» не нужна (биржа — логотипом справа, таймфрейм — над графиком); «Сессия» — только у сессии */
.topbar-fut .tk-item:has(#tkExchange), .view-mode .topbar-fut .tk-item:has(#tkSession) { display: none; }
/* Плашка связи бота с биржей (app.js): поток биржи — зелёная, только сверка по REST — серая, нет связи — оранжевая */
.badge.live.hb-badge-ok { background: rgba(32, 178, 108, .14); color: var(--green); }
.badge.live.hb-badge-rest { background: var(--hover); color: var(--text2); }
.brand span { color: var(--text); font-weight: 500; }
.ticker { display: flex; align-items: center; gap: 22px; min-width: 0; overflow: hidden; }
.tk-sym { display: flex; flex-direction: column; line-height: 1.2; }
.tk-sym b { font-size: 16px; }
.tk-sym span { color: var(--muted); font-size: 11px; }
.tk-price { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tk-item { display: flex; flex-direction: column; line-height: 1.3; white-space: nowrap; }
.tk-item span { color: var(--muted); font-size: 11px; }
.tk-item b { font-weight: 500; }
.spacer { flex: 1; }

/* ---------- Плеер ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 6px 16px; background: var(--panel); border-bottom: 1px solid var(--bg); }
.toolbar label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.toolbar .sep { width: 1px; height: 20px; background: var(--border); }
.toolbar .play { width: 40px; height: 28px; border-radius: var(--radius); background: var(--orange); color: #000; font-size: 14px; font-weight: 700; }
.toolbar .play.running { background: var(--hover); color: var(--text); }
.clock { font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; }
.clock { position: relative; display: flex; align-items: center; gap: 8px; }
.tz-btn { color: var(--text2); font-size: 12px; font-weight: 500; padding: 3px 6px; border-radius: 6px; }
.tz-btn:hover { color: #fff; background: var(--hover); }
.tz-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 250px; max-height: 360px; overflow-y: auto;
  padding: 6px 0; background: #25282c; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  font-size: 13px; font-weight: 400;
}
.tz-menu div { display: flex; gap: 8px; padding: 7px 14px; cursor: pointer; }
.tz-menu div:hover { background: rgba(255, 255, 255, .06); }
.tz-menu .ck { width: 14px; color: var(--orange); }
.badge { padding: 2px 10px; border-radius: 10px; background: var(--hover); color: var(--text2); font-size: 11px; }
.badge.running { color: var(--green); background: rgba(32, 178, 108, .12); }
.badge.loading { color: var(--orange); background: rgba(247, 166, 0, .12); }
.badge.liquidated { color: #fff; background: var(--red); }
/* Уведомление: плавающая плашка поверх графика (место задаёт placeMsg), экран не сдвигается */
.msg { position: fixed; z-index: 60; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 8px; background: #2a2416; border: 1px solid rgba(247, 166, 0, .45);
  color: var(--orange); font-weight: 500; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); animation: msg-in .2s ease-out; }
.msg.err { background: #2c1719; border-color: rgba(239, 69, 74, .5); color: #ff6b70; }
.msg.out { opacity: 0; transition: opacity .2s; }
.msg .x { color: inherit; opacity: .7; padding: 0 2px; font-size: 12px; }
.msg .x:hover { opacity: 1; }
@keyframes msg-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Раскладка ---------- */
.workspace { flex: 1; display: flex; gap: 1px; min-height: 0; }
.left { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.chart-area { flex: 1; display: flex; flex-direction: row; background: var(--panel2); min-height: 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chart-wrap { flex: 1; position: relative; min-height: 220px; }
#chart { position: absolute; inset: 0; }
#equityChart { height: 110px; border-top: 1px solid var(--line); }
.empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--panel2); text-align: center; z-index: 20; }
.empty[hidden] { display: none; }
.empty h2 { margin: 0 0 6px; font-size: 18px; }
.empty p { color: var(--muted); margin: 0 0 14px; }

/* ---------- Плашки ордеров / позиций на графике ---------- */
.overlay, .markers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.markers { z-index: 4; }
/* Фьючерсный симулятор: плашки и линии ордеров и позиций — над рисунками (слой рисунков — z-index 6) */
.overlay.ov-top { z-index: 7; }
.ov-line { position: absolute; left: 0; height: 0; pointer-events: none; }
/* Фьючерсный: позиции поверх ордеров, как бы ни появились (новые ордера добавляются на страницу позже позиций):
   линии ордеров < линии позиций < плашки ордеров < плашки позиций < перетаскиваемая плашка */
.ov-top .ov-line.ov-pos { z-index: 1; }
.ov-top .plate { z-index: 2; }
.ov-top .plate.pos { z-index: 3; }
.ov-top .plate.dragging { z-index: 4; }
/* Фьючерсный: цвета плашек ордеров и позиций — как у Bybit (#01944e / #cd3939; линии — app.js PLATE_C) */
.ov-top .plate.buy { border-color: rgba(1, 148, 78, .6); }
.ov-top .plate.buy .qty { background: #01944e; }
.ov-top .plate.sell { border-color: rgba(205, 57, 57, .6); }
.ov-top .plate.sell .qty { background: #cd3939; }
.ov-top .plate.pos.long { border-color: #01944e; }
.ov-top .plate.pos.long .qty { background: #01944e; }
.ov-top .plate.pos.short { border-color: #cd3939; }
.ov-top .plate.pos.short .qty { background: #cd3939; }
.plate {
  position: absolute; display: flex; align-items: stretch; height: 18px; transform: translateY(-50%);
  background: #101014; border: 1px solid; border-radius: 2px; font-size: 11px; font-weight: 600;
  white-space: nowrap; pointer-events: auto; line-height: 16px; user-select: none;
}
.plate .txt { padding: 0 6px 0 8px; color: #fff; }
.plate .qty { padding: 0 6px; color: #fff; }
.plate .x { width: 18px; color: var(--text2); border-left: 1px solid; border-color: inherit; font-size: 11px; line-height: 16px; padding: 0; }
.plate .x:hover:not(:disabled) { color: #fff; background: rgba(255, 255, 255, .08); }
.plate.buy { border-color: rgba(32, 178, 108, .55); }
.plate.buy .qty { background: #1a7a4c; }
.plate.sell { border-color: rgba(239, 69, 74, .55); }
.plate.sell .qty { background: #b23338; }
.plate.pos.long { border-color: var(--green); }
.plate.pos.long .qty { background: var(--green); }
.plate.pos.short { border-color: var(--red); }
.plate.pos.short .qty { background: var(--red); }
.plate.liq { border-color: var(--liq); color: var(--liq); }
.plate.liq .txt { color: var(--liq); }
.plate.be { border-color: #8c8f96; }
.plate.be .txt { color: #c9ccd1; }
.plate.frozen { border-color: var(--blue); }
.plate.frozen .txt { color: #8ea8ff; }
.plate.center { border-color: var(--yellow); }
.plate.center .txt { color: var(--yellow); }

.mk {
  position: absolute; transform: translate(-50%, -50%); min-width: 13px; height: 13px; padding: 0 2px;
  border-radius: 3px; font-size: 9px; font-weight: 700; line-height: 13px; text-align: center; color: #fff;
}
.mk.b { background: var(--green); }
.mk.s { background: var(--red); }

/* ---------- Меню настроек графика ---------- */
.chart-gear {
  position: absolute; left: 8px; top: 8px; z-index: 10; width: 28px; height: 28px; border-radius: 6px;
  color: var(--text2); background: rgba(23, 24, 30, .85); display: flex; align-items: center; justify-content: center;
}
.chart-gear:hover { color: #fff; background: var(--hover); }
.chart-menu {
  position: absolute; left: 8px; top: 40px; z-index: 30; width: 290px; padding: 8px 0;
  background: #25282c; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.cm-section { color: var(--muted); padding: 6px 14px 4px; font-size: 12px; }
.cm-row { display: flex; align-items: center; gap: 10px; padding: 7px 14px; cursor: pointer; position: relative; font-size: 13px; }
.cm-row:hover, .cm-row.open { background: rgba(255, 255, 255, .05); }
.cm-row .chev { margin-left: auto; color: var(--muted); }
.chk-box { width: 16px; height: 16px; border-radius: 3px; border: 1.5px solid #6a6e75; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chk-box.on { background: var(--orange); border-color: var(--orange); }
.chk-box.on::after { content: ""; width: 4px; height: 8px; border: solid #000; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.cm-sub {
  position: absolute; left: 100%; top: -8px; margin-left: 6px; width: 300px; padding: 10px 14px;
  background: #25282c; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); cursor: default;
}
.cm-sub h4 { margin: 4px 0 8px; font-size: 13px; font-weight: 500; }
.radios { display: flex; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.radio { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.radio i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #6a6e75; display: inline-flex; align-items: center; justify-content: center; }
.radio.on i { border-color: var(--orange); }
.radio.on i::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.radio .ln { display: inline-block; width: 12px; background: currentColor; vertical-align: middle; }

/* ---------- Нижняя панель ---------- */
.bottom { height: 240px; display: flex; flex-direction: column; background: var(--panel2); }
body.view-mode .bottom { display: none; }   /* фьючерсный: просмотр графика — без нижней панели (app.js) */
body.no-bottom .bottom { display: none; }   /* фьючерсный: снята галочка «Панель позиций и ордеров» (app.js) */
.tabs { display: flex; gap: 22px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; flex-shrink: 0; }
.tabs button { padding: 10px 0 9px; font-size: 14px; color: var(--text2); position: relative; white-space: nowrap; }
.tabs button:hover { color: #fff; }
.tabs button.active { color: #fff; font-weight: 600; }
.tabs button.active::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 24px; height: 3px; margin-left: -12px; background: var(--orange); border-radius: 2px; }
.tab-body { flex: 1; overflow: auto; }
.bb-tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.bb-tbl th { position: sticky; top: 0; z-index: 1; background: var(--panel2); color: var(--muted); font-weight: 400; text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bb-tbl td { padding: 8px 12px; border-bottom: 1px solid #1b1d22; white-space: nowrap; vertical-align: middle; }
.bb-tbl td div { margin-top: 2px; }
.bb-tbl .liq { color: var(--liq); }
.bb-tbl .dim { color: var(--muted); }
.bb-tbl td.sym { position: relative; padding-left: 18px; }
.bb-tbl td.sym .bar { position: absolute; left: 6px; top: 7px; bottom: 7px; width: 3px; border-radius: 1px; }
.bb-tbl td.sym .bar.up { background: var(--green); }
.bb-tbl td.sym .bar.down { background: var(--red); }
.bb-tbl .sym-name { font-weight: 600; margin: 0 !important; }
.bb-tbl .tags { display: flex; gap: 4px; }
.bb-tbl .tags span { background: var(--input); color: var(--text2); font-size: 10px; padding: 0 4px; border-radius: 2px; }
.bb-tbl .empty-row { text-align: center; color: var(--muted); padding: 34px; }
.bb-tbl .x-btn { color: var(--text2); padding: 2px 8px; border-radius: 4px; background: var(--hover); }
.bb-tbl .x-btn:hover:not(:disabled) { color: #fff; }
.ev-WARNING { color: var(--orange); }
.ev-ERROR { color: var(--red); }
.ev-GRID { color: #64b5f6; }
.ev-ORDER { color: var(--text2); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; padding: 12px 16px; }
.st-card { background: var(--panel); border-radius: var(--radius); padding: 10px 14px; }
.st-card h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.st-card .r { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.st-card .r span { color: var(--muted); }
.st-card .r b { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Правая панель ---------- */
.right { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--panel); overflow-y: auto; }
.rp-head { display: flex; gap: 18px; padding: 0 16px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.rp-head button { padding: 12px 0 10px; font-size: 14px; font-weight: 600; color: var(--text2); position: relative; }
.rp-head button.active { color: #fff; }
.rp-head button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--orange); }
.rp-body { padding: 12px 16px; position: relative; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.select-like, .lev-btn { background: var(--input); border-radius: 6px; padding: 7px 10px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lev-btn { color: var(--orange); text-align: left; }
.lev-btn:hover:not(:disabled) { background: var(--hover); }
.lev-pop { position: absolute; left: 16px; right: 16px; top: 52px; z-index: 15; background: #25282c; border-radius: var(--radius); padding: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.lev-title { font-weight: 600; margin-bottom: 10px; }
.lev-input { display: flex; align-items: center; background: var(--panel); border-radius: 6px; margin-bottom: 10px; }
.lev-input button { width: 34px; height: 32px; font-size: 16px; color: var(--text2); }
.lev-input input { flex: 1; text-align: center; background: none; font-size: 14px; font-weight: 600; }
.lev-input span { color: var(--text2); margin-right: 6px; }
.lev-marks { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin: 2px 0 6px; }
input[type=range] { width: 100%; accent-color: var(--orange); background: none; padding: 0; }

.oc-tabs, .um-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 14px 0 10px; border-bottom: 1px solid var(--line); }
.oc-tabs button, .um-tabs button { padding: 8px 0; font-size: 15px; font-weight: 600; color: var(--text2); position: relative; }
.oc-tabs button.active, .um-tabs button.active { color: #fff; }
.oc-tabs button.active::after, .um-tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--orange); }
.type-tabs { display: flex; gap: 16px; margin-bottom: 10px; }
.type-tabs button { font-size: 13px; font-weight: 500; color: var(--text2); padding: 2px 0; }
.type-tabs button.active { color: var(--orange); }
/* «Стоп-лосс позиции»: выбранная сторона — Long зелёным, Short красным */
#psSide [data-ps-side="LONG"].active { color: var(--green); }
#psSide [data-ps-side="SHORT"].active { color: var(--red); }

.field { position: relative; display: flex; align-items: center; background: var(--input); border-radius: 6px; margin-bottom: 8px; min-height: 40px; padding: 0 10px; border: 1px solid transparent; }
.field:focus-within { border-color: var(--orange); }
.field label { color: var(--muted); font-size: 11px; position: absolute; left: 10px; top: 3px; }
.field input { flex: 1; min-width: 0; background: none; border: none; padding: 16px 0 4px; font-size: 14px; font-weight: 500; }
.field input:focus { border: none; }
.field .field-link { color: var(--orange); font-weight: 500; white-space: nowrap; }
.field .sfx { color: var(--text2); white-space: nowrap; padding-top: 12px; }
.field .unit { background: none; border: none; font-weight: 600; padding: 4px 0; }
.field.disabled { justify-content: center; }
.slider { position: relative; margin: 6px 0 8px; }
.slider-dots { display: none; }
/* Подписи под бегунком: «0» слева, «100%» справа, текущий процент — ровно по центру (под средней точкой): боковые
   колонки равные, поэтому центр не съезжает из-за разной ширины «0» и «100%» */
.slider-labels { display: grid; grid-template-columns: 1fr auto 1fr; color: var(--muted); font-size: 11px; }
.slider-labels > :first-child { justify-self: start; }
.slider-labels > :nth-child(2) { justify-self: center; text-align: center; color: var(--text2); }
.slider-labels > :last-child { justify-self: end; }
.slider-labels .over, .slider-labels #qtyPct.over { color: var(--red); }   /* ввели больше доступного */
.slider-labels #qtyPct { color: var(--text2); }
.info-box { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; }
.info-box div { display: flex; justify-content: space-between; padding: 2px 0; }
.info-box span { color: var(--muted); }
.info-box em { font-style: normal; }
/* Фьючерсный «Трейдинг»: высота блока не меняется, когда числа длинные и прыгают (живая цена) — кнопки под ним
   не скачут. Количество — второй строкой под подписью; значения — в одну строку, цифры одной ширины */
.info-box.ib-fixed div > b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  margin-left: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.info-box.ib-fixed div > span { flex-shrink: 0; }
.info-box.ib-fixed div.ib-2l { flex-direction: column; }
.info-box.ib-fixed div.ib-2l > b { margin: 2px 0 0; }
.trade-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-long, .btn-short { padding: 11px 0; border-radius: var(--radius); font-size: 14px; font-weight: 600; color: #fff; }
.btn-long { background: var(--green); }
.btn-short { background: var(--red); }
.btn-long:hover:not(:disabled) { background: #25c47a; }
.btn-short:hover:not(:disabled) { background: #f45c61; }
.pause-hint { color: var(--orange); text-align: center; margin: 10px 0 0; font-size: 11px; }
.close-card { background: var(--panel2); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.close-card .cc-head { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 6px; }
.close-card .r { display: flex; justify-content: space-between; padding: 1px 0; }
.close-card .r span { color: var(--muted); }
.close-card button { width: 100%; margin-top: 8px; }

.bot-status { padding: 7px 10px; border-radius: 6px; margin-bottom: 12px; font-weight: 600; text-align: center; background: rgba(239, 69, 74, .1); color: var(--red); }
.bot-status.on { background: rgba(32, 178, 108, .12); color: var(--green); }
.st-group { margin-bottom: 10px; }
.st-title { font-weight: 600; margin-bottom: 6px; color: var(--text2); }
details.st-group summary { cursor: pointer; list-style: revert; }
#formStrategy .field label, #formUser .field label, .tg-form .field label { position: static; flex: 1; font-size: 12px; color: var(--text2); }
#formStrategy .field input, #formUser .field input, .tg-form .field input { flex: 0 0 90px; text-align: right; padding: 8px 6px; font-size: 13px; }
#formStrategy .field .sfx, #formUser .field .sfx, .tg-form .field .sfx { padding-top: 0; min-width: 34px; color: var(--muted); }

.account { margin-top: auto; padding: 14px 16px; border-top: 6px solid var(--bg); }
.acc-head { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.acc-row { display: flex; justify-content: space-between; padding: 4px 0; }
.acc-row span, .acc-bar span { color: var(--muted); }
.acc-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.acc-bar { display: grid; grid-template-columns: 1fr 70px 52px; align-items: center; gap: 8px; padding: 4px 0; }
.acc-bar b { text-align: right; color: var(--green); font-weight: 600; }
.acc-bar .bar { height: 6px; background: var(--hover); border-radius: 3px; overflow: hidden; }
.acc-bar .bar i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 3px; }

.account { position: relative; }
.acc-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.pill { background: var(--hover); border-radius: 999px; padding: 7px 10px; font-weight: 600; }
.pill:hover:not(:disabled) { background: #363a42; }
.tr-pop {
  position: absolute; left: 16px; right: 16px; bottom: calc(100% - 8px); z-index: 15;
  background: #25282c; border-radius: var(--radius); padding: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.tr-pop .field { background: var(--panel); }
.tr-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tr-quick .pill { padding: 5px 0; font-weight: 500; }
.tr-note { color: var(--muted); font-size: 11px; margin-top: 8px; }

/* ---------- Диалоги ---------- */
dialog { background: var(--panel); color: var(--text); border: none; border-radius: 12px; padding: 0; max-width: 820px; width: calc(100% - 32px); max-height: calc(100% - 40px); box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }
dialog.narrow { max-width: 700px; }
dialog::backdrop { background: rgba(0, 0, 0, .65); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.dlg-head h3 { margin: 0; font-size: 16px; }
.dlg-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 18px; }
.x { font-size: 15px; color: var(--text2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 18px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin: 0; }
legend { color: var(--text2); padding: 0 4px; font-weight: 600; }
fieldset label { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 8px; margin: 6px 0; color: var(--text2); }
fieldset label.chk { display: flex; gap: 8px; color: var(--text); }
fieldset label.chk input { width: auto; accent-color: var(--orange); }
fieldset label input, fieldset label select { width: 100%; }
.form-msg { flex: 1; color: var(--orange); }
dialog.small { max-width: 560px; }
.dlg-body { padding: 0 18px 4px; }
.dl-field { display: grid; grid-template-columns: 1fr 200px; align-items: center; gap: 10px; margin: 12px 0; color: var(--text2); }
.warn { margin: 6px 0 4px; padding: 10px 12px; border-radius: var(--radius); background: rgba(247, 166, 0, .08); color: var(--orange); line-height: 1.5; }
.warn.ok { background: rgba(32, 178, 108, .08); color: var(--green); }
.start-btn { display: flex; align-items: center; gap: 6px; color: var(--text2); }
.start-btn:hover:not(:disabled) { color: #fff; }
.sess-list { max-height: 60vh; overflow-y: auto; border-top: 1px solid var(--line); }
.sess-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.sess-row.active { background: rgba(247, 166, 0, .06); }
.sess-row .meta { color: var(--muted); font-size: 11px; margin-top: 2px; }
.sess-row .acts { display: flex; gap: 6px; align-items: center; }
.sess-row .acts .danger { color: var(--red); }
.sess-empty { padding: 24px 18px; color: var(--muted); }
/* Выбор нескольких сессий (фьючерсы): галочка в начале строки */
.sess-list.selecting .sess-row { grid-template-columns: auto 1fr auto; cursor: pointer; }
.sess-row .sess-chk { display: flex; align-items: center; padding-right: 4px; }
.sess-row .sess-chk input { width: 16px; height: 16px; accent-color: var(--orange); cursor: pointer; }
.sess-row.picked { background: rgba(239, 69, 74, .08); }
.dlg-foot .danger { color: var(--red); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #3a3d44; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 900px) {
  body { overflow: auto; }
  .workspace { flex-direction: column; }
  .chart-wrap { min-height: 380px; }
  .right { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Инструменты рисования (левая панель, как в TradingView) ---------- */
.drawbar { width: 46px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; background: var(--panel); border-right: 1px solid var(--bg); position: relative; z-index: 25; }
.db-btn { position: relative; width: 36px; height: 34px; border-radius: 6px; display: flex; align-items: center;
  justify-content: center; color: #b2b5be; cursor: pointer; }
.db-btn:hover { background: var(--hover); color: #fff; }
.db-btn.active { color: var(--orange); background: rgba(247, 166, 0, .1); }
.db-more { position: absolute; right: 1px; bottom: 2px; width: 9px; height: 9px; cursor: pointer; }
.db-more::after { content: ""; position: absolute; right: 2px; bottom: 2px; border: 3px solid transparent;
  border-right-color: #6a6e75; border-bottom-color: #6a6e75; }
.db-sep { width: 26px; height: 1px; background: var(--border); margin: 6px 0; }
.db-fly { position: absolute; left: 44px; z-index: 40; min-width: 250px; width: max-content; padding: 6px 0; background: #25282c;
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.db-fly-row { display: flex; align-items: center; gap: 10px; padding: 6px 14px; cursor: pointer; color: #d1d4dc; font-size: 13px; white-space: nowrap; }
.db-fly-row span { margin-right: 16px; }
.db-fly-row:hover { background: rgba(255, 255, 255, .06); }
.db-fly-row.active { color: var(--orange); }

.draw-layer { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.draw-layer.drawing { pointer-events: all; cursor: crosshair; }
.draw-layer .hit { stroke: transparent; stroke-width: 12; pointer-events: stroke; cursor: pointer; }
.draw-layer .hit-fill { fill: transparent; pointer-events: all; cursor: pointer; }
.draw-layer.drawing .hit, .draw-layer.drawing .hit-fill { pointer-events: none; }
.draw-layer .handle { fill: #101014; stroke: var(--orange); stroke-width: 2; pointer-events: all; cursor: move; }
.draw-layer .dr-lbl { font: 600 11px Inter, Arial, sans-serif; pointer-events: none; }
.draw-layer .dr-txt { font: 11px Inter, Arial, sans-serif; pointer-events: none; }
.draw-layer .dr-text { font: 500 14px Inter, Arial, sans-serif; pointer-events: none; }
.draw-layer .dr-item.sel line:not(.hit) { filter: drop-shadow(0 0 2px rgba(247, 166, 0, .7)); }
.bb-tbl .dash { border-bottom: 1px dashed currentColor; padding-bottom: 1px; cursor: help; }

/* Вкладка «Закрыть»: частичное закрытие */
.cc-pct { display: grid; grid-template-columns: 1fr 74px; align-items: center; gap: 10px; margin: 10px 0 6px; }
.cc-pct-in { display: flex; align-items: center; gap: 4px; background: var(--input); border-radius: 6px; padding: 0 8px; }
.cc-pct-in input { width: 100%; background: none; border: none; padding: 5px 0; text-align: right; font-weight: 600; }
.cc-pct-in span { color: var(--muted); }
.cc-quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 8px; }
.cc-quick .pill { padding: 4px 0; font-size: 11px; font-weight: 500; }
.cc-quick .pill.on { background: rgba(247, 166, 0, .15); color: var(--orange); }

/* Контекстное меню графика (правая кнопка мыши) */
.ctx-menu { position: absolute; z-index: 50; min-width: 300px; padding: 6px 0; background: #25282c;
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .55); font-size: 13px; }
.ctx-row { display: flex; align-items: center; gap: 12px; padding: 9px 16px; cursor: pointer; color: #eaecef; }
.ctx-row:hover { background: rgba(255, 255, 255, .06); }
.ctx-row.off { opacity: .4; cursor: default; }
.ctx-row svg { color: #b2b5be; flex-shrink: 0; }
.ctx-row kbd { margin-left: auto; color: var(--muted); font: inherit; font-size: 12px; }
.ctx-sep { height: 1px; background: #33363d; margin: 6px 0; }
/* Пункт меню с галочкой (шкала цен: «Обратный отсчёт до закрытия бара») */
.ctx-row .ctx-box { width: 18px; height: 18px; flex-shrink: 0; border: 1.5px solid #b2b5be; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; color: #131722; }
.ctx-row .ctx-box.on { background: #eaecef; border-color: #eaecef; }

/* Ставка финансирования в шапке */
.tk-item .dash-lbl { border-bottom: 1px dashed var(--muted); align-self: flex-start; cursor: help; }
/* Ставка финансирования (обе биржи) — оранжевая, как у Bybit, без подчёркивания; наведение — окно ставки */
.fund-rate { font-style: normal; color: var(--orange); }
#tkFundLeft { color: var(--text); font-size: inherit; } /* отсчёт до финансирования — белый, размер как у ставки (Bybit) */
.fund-tip { position: fixed; z-index: 1000; width: 360px; padding: 12px 14px; background: #1e2026; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); font-size: 12px; color: var(--text); pointer-events: none; }
.fund-tip .ft-note { color: var(--muted); line-height: 1.45; margin-bottom: 10px; }
.fund-tip .ft-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.fund-tip .ft-row > span { color: var(--muted); }
.fund-tip .ft-row > b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.fund-tip .ft-l { color: var(--green); font-weight: 500; }
.fund-tip .ft-s { color: var(--red); font-weight: 500; }
.fund-tip .ft-sep { border-top: 1px solid var(--line); margin: 8px 0; }
.fund-tip .ft-foot { color: var(--muted); font-size: 11px; }

/* Перетаскивание ордеров на графике */
.plate.drag { cursor: ns-resize; }
.plate.drag .x { cursor: pointer; }
.plate.dragging { box-shadow: 0 0 0 1px var(--orange); z-index: 2; }

/* Цена лимитного ордера на закрытие в карточке */
.close-card .cc-price { margin: 8px 0 2px; background: var(--input); }
.close-card .cc-price .field-link { width: auto; margin-top: 0; flex-shrink: 0; }
.close-card .cc-price input { min-width: 60px; }

/* Подсказка «Реализованный P&L» (как на Bybit) */
.pnl-tip { position: fixed; z-index: 100; width: 300px; padding: 12px 14px; background: #3a3d44; color: #fff;
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); font-size: 13px; }
.pnl-tip::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px;
  border: 6px solid transparent; border-bottom: 0; border-top-color: #3a3d44; }
.tip-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.tip-row span { color: #eaecef; }
.tip-row b { font-weight: 600; white-space: nowrap; }
.tip-sep { height: 8px; }
.tip-link { display: inline-block; margin-top: 6px; color: var(--orange); cursor: pointer; text-decoration: none; }
.tip-link:hover { text-decoration: underline; }

/* Плавающая панель выделенной фигуры (как в TradingView) */
.dr-tb { position: absolute; z-index: 32; display: flex; align-items: center; gap: 2px; padding: 4px 6px;
  background: #1e2026; border: 1px solid #2e3036; border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.dr-tb .tb-grip { color: #6a6e75; cursor: grab; padding: 0 6px 0 2px; display: flex; }
.dr-tb button { position: relative; height: 32px; min-width: 32px; padding: 0 6px; border-radius: 6px; color: #d1d4dc;
  display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 600; }
.dr-tb button:hover { background: var(--hover); }
.dr-tb button.on { color: var(--orange); }
.dr-tb .tb-bar { position: absolute; left: 7px; right: 7px; bottom: 3px; height: 3px; border-radius: 2px; }
.tb-wline { display: inline-block; width: 16px; background: currentColor; border-radius: 1px; }
.tb-menu { position: absolute; z-index: 33; min-width: 170px; padding: 6px 0; background: #25282c; border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.tb-menu .tb-item { display: flex; align-items: center; gap: 10px; padding: 7px 14px; cursor: pointer; color: #eaecef; font-size: 13px; }
.tb-menu .tb-item:hover { background: rgba(255, 255, 255, .06); }
.tb-menu .tb-item.on { color: var(--orange); }
.tb-menu.tb-pal { padding: 10px; min-width: 0; }
.pal-row { display: flex; gap: 4px; margin-bottom: 4px; }
.sw { width: 20px; height: 20px; border-radius: 4px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
/* Палитра как в TradingView: тёмный фон, квадратики без рамки (цвет ярче), разрыв, свои цвета и «+» */
.pal-gap { height: 6px; }
.pal-sep { height: 1px; background: #2f3238; margin: 8px 0; }
.pal-custom { flex-wrap: wrap; max-width: 236px; }
.sw-add { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1;
  color: #d1d4dc; cursor: pointer; border-radius: 4px; }
.sw-add:hover { background: #2a2e39; color: #fff; }
.tb-menu.tb-pal, .fib-pal { background: #1e1f23; }
.tb-pal .sw, .fib-pal .sw, .cm-tvpal .sw { box-shadow: none; border: 0; }
.tb-pal .sw[data-sw="#131722"], .tb-pal .sw[data-sw="#000000"], .fib-pal .sw[data-c="#131722"], .fib-pal .sw[data-c="#000000"],
  .cm-tvpal .sw[data-v="#131722"], .cm-tvpal .sw[data-v="#000000"] { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.cm-tvpal { margin-bottom: 12px; }
.cm-tvpal .sw { width: 18px; height: 18px; }
.cm-tvpal .pal-row { gap: 4px; }
.cm-tvpal .sw-add { width: 18px; height: 18px; }
/* Выбор любого цвета («+») */
.tvpick { position: fixed; z-index: 1100; width: 236px; padding: 10px; background: #1e1f23; border: 1px solid #33363d;
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .6); }
.tvpick-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tvpick-prev { width: 26px; height: 26px; border-radius: 4px; flex-shrink: 0; }
.tvpick-hex { width: 84px; padding: 4px 6px; background: #131417; border: 1px solid #3a3d44; border-radius: 4px; color: #fff; font: 12px Inter, Arial, sans-serif; }
.tvpick-add { margin-left: auto; padding: 5px 10px; border-radius: 6px; background: #e8e9eb; color: #000; font-weight: 600; font-size: 12px; }
.tvpick-add:hover { background: #fff; }
.tvpick-body { display: flex; gap: 10px; }
.tvpick-sv { position: relative; flex: 1; height: 170px; border-radius: 4px; cursor: crosshair; }
.tvpick-sv i { position: absolute; width: 10px; height: 10px; margin: -6px 0 0 -6px; border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 0 2px rgba(0, 0, 0, .8); pointer-events: none; }
.tvpick-hue { position: relative; width: 14px; height: 170px; border-radius: 4px; cursor: ns-resize;
  background: linear-gradient(to bottom, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); }
.tvpick-hue i { position: absolute; left: -2px; right: -2px; height: 6px; margin-top: -3px; border: 2px solid #fff; border-radius: 3px;
  box-shadow: 0 0 2px rgba(0, 0, 0, .8); pointer-events: none; }
.sw:hover, .sw.on { outline: 2px solid var(--orange); outline-offset: 1px; }
.pal-op { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; color: var(--text2); font-size: 12px; }
/* «Прозрачность», как в TradingView: ползунок + поле в % (opInput в ui.js). Дорожка — шахматка (прозрачность)
   под градиентом от прозрачного к цвету элемента (--opc) */
.op-field { display: inline-flex; align-items: center; gap: 6px; }
.op-field i { font-style: normal; color: var(--muted); font-size: 12px; }
.op-field input[type=range].op-rng { -webkit-appearance: none; appearance: none; width: 92px; height: 8px; margin: 0; padding: 0;
  border-radius: 4px; border: 1px solid var(--border); cursor: pointer; accent-color: auto;
  background: linear-gradient(to right, transparent, var(--opc)), repeating-conic-gradient(#3a3d44 0% 25%, #1c1e22 0% 50%) 0 0 / 8px 8px; }
.op-field input[type=range].op-rng::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid #131722; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.op-field input[type=range].op-rng::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #131722; }
.op-field input[type=number].op-inp { width: 50px; height: 26px; padding: 0 6px; background: var(--panel2); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); font: inherit; font-size: 12px; text-align: right; }
.op-field input[type=number].op-inp:focus { outline: none; border-color: var(--orange); }
.fib-op-lbl { color: var(--text2); font-size: 12px; }
.set-row.set-head { margin: 0 0 -2px; }
.set-head .set-grid i { font-style: normal; font-size: 11px; color: var(--muted); }

/* Магнит: подсветка при зажатом Ctrl и точка притяжения у курсора */
.db-btn.hold { box-shadow: inset 0 0 0 1px var(--orange); }
.draw-layer .snap { fill: none; stroke: #9598a1; stroke-width: 1.5; pointer-events: none; }
/* Подсветка выделенного диапазона цены на шкале цен (как в TradingView) */
.dr-axis-layer { position: absolute; top: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.dr-axis-layer text { font: 11px Inter, Arial, sans-serif; fill: #fff; dominant-baseline: central; }
#drSetStat .dr-stat-row, #drSetStyle .dr-stat-row { padding: 6px 0; }
#drSetStyle .dr-set-h { margin: 2px 0 4px; color: var(--text2); font-size: 12px; }
.drawbar.db-top { z-index: 65; }   /* меню «Линии на уровнях сетки» — над всплывающими сообщениями (.msg — 60) */
.draw-layer .dr-box { fill: rgba(41, 98, 255, .1); stroke: #2962ff; stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
.draw-layer .snap.on { stroke: var(--orange); fill: rgba(247, 166, 0, .25); }

/* ---------- Индикаторы ---------- */
.ind-btn i { font-style: italic; font-weight: 700; color: var(--orange); margin-right: 2px; }
.ind-legend { position: absolute; left: 44px; top: 8px; z-index: 7; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.rsi-pane .ind-legend { left: 8px; top: 4px; }
.rp-set-on .ind-legend.main { left: 10px; }   /* фьючерсный: кнопки ⚙ в углу графика нет — легенда индикаторов в угол */
.ind-row { display: flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: 4px; font-size: 12px; color: #d1d4dc;
  pointer-events: auto; background: rgba(16, 16, 20, .6); }
.ind-row.off .ind-name { color: var(--muted); }
.ind-row .ind-val { font-variant-numeric: tabular-nums; font-weight: 500; }
.ind-row button { display: none; color: #b2b5be; padding: 1px 2px; border-radius: 3px; }
.ind-row:hover button { display: inline-flex; }
.ind-row button:hover { color: #fff; background: var(--hover); }
.rsi-pane { position: relative; height: 150px; border-top: 1px solid var(--line); flex-shrink: 0; }
.rsi-pane.rsi-axis { height: var(--rsi-h, 176px); }
/* Граница график / RSI — тянуть мышью (фьючерсный, indicators.js: rsiResizer) */
.rsi-resizer { position: absolute; left: 0; right: 0; top: -4px; height: 8px; z-index: 8; cursor: ns-resize; }
.rsi-resizer:hover, body.rsi-resizing .rsi-resizer { background: linear-gradient(to bottom, transparent 3px, #2962ff 3px 5px, transparent 5px); }
body.rsi-resizing, body.rsi-resizing * { cursor: ns-resize !important; user-select: none; }
/* Двойной клик (фьючерсный, indicators.js: paneDbl): график или RSI на всю высоту */
.chart-col.max-main .rsi-pane { display: none; }
.chart-col.max-rsi .chart-wrap { display: none; }
.chart-col.max-rsi .rsi-pane { flex: 1; height: auto; }   /* шкала времени под RSI (фьючерсный, indicators.js: rsiAxisSync) */
#rsiChart { position: absolute; inset: 0; }
.rsi-layer { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; }
/* Вертикаль перекрестия основного графика на панели RSI (фьючерсный) — как у графика: пунктир */
/* Вертикаль перекрестия на соседней панели — пунктир как у LargeDashed перекрестия графика: 6 px штрих, 6 px пробел */
.rsi-xh { position: absolute; top: 0; bottom: 0; width: 1px; background: repeating-linear-gradient(to bottom, #5d6068 0 6px, transparent 6px 12px); pointer-events: none; z-index: 4; }
.main-xh { bottom: auto; }
.dr-time-lbl { background: #2962ff !important; color: #fff !important; z-index: 5 !important; }   /* дата начала выделенного луча */
.main-xh-lbl { position: absolute; transform: translateX(-50%); margin-top: 1px; padding: 3px 6px; border-radius: 2px; background: #2b2f36; color: #d1d4dc; font: 11px Inter, Arial, sans-serif; white-space: nowrap; pointer-events: none; z-index: 4; }
.rsi-layer .ind-tag { fill: #fff; font: 600 10px Inter, Arial, sans-serif; }
.ind-li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.set-tabs { display: flex; gap: 18px; padding: 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.set-tabs button { padding: 8px 0; color: var(--text2); font-weight: 600; position: relative; }
.set-tabs button.active { color: #fff; }
.set-tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--orange); }
.set-body { max-height: 60vh; overflow-y: auto; }
.set-row { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 12px; margin: 8px 0; color: var(--text2); }
.set-row input[type=number], .set-row select { width: 100%; }
.set-chk { display: flex; align-items: center; gap: 8px; color: var(--text); grid-column: 1 / 2; }
.set-chk input { accent-color: var(--orange); }
/* Галочка в окнах настроек (индикаторы, Фибоначчи) переключается только кликом по самому квадратику:
   подпись и пустое место строки клик не ловят */
.set-chk { pointer-events: none; }
.set-chk input { pointer-events: auto; cursor: pointer; }
.set-style { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.set-style input[type=color] { width: 34px; height: 28px; padding: 2px; border-radius: 4px; background: var(--input); border: none; }
.set-style select { width: 70px; }
.dlg-foot .spacer { flex: 1; }
.db-fly-row[data-hide] span { padding: 2px 0; }
/* Вкладка «Стиль» RSI: строки с цветом, непрозрачностью, толщиной, линией и значением */
#dlgInd { width: 740px; max-width: 96vw; }
.set-row.set-wide { grid-template-columns: 1fr auto; }
.set-row.set-sub { margin-top: -2px; }
.set-row.set-sub .set-chk { padding-left: 24px; color: var(--text2); }
.set-grid { display: grid; grid-template-columns: 34px 166px 62px 112px 58px; gap: 6px; align-items: center; }
.set-grid select, .set-grid input[type=number] { width: 100%; }
.set-grid input[type=color] { width: 34px; height: 28px; padding: 2px; border-radius: 4px; background: var(--input); border: none; }
.set-sec { margin: 16px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
/* Окно «Координаты» горизонтальной линии / луча */
dialog.mini { max-width: 380px; }
dialog.mini .set-row { grid-template-columns: 1fr 170px; }
/* Окно «Скачать историю на диск» */
.dl-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.dl-pair label { display: flex; flex-direction: column; gap: 4px; color: var(--text2); }
.dl-pair input, .dl-pair select { width: 100%; }
.dl-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.dl-presets button { padding: 4px 10px; font-size: 12px; }
.dl-info { margin: 10px 0; padding: 10px 12px; border-radius: var(--radius); background: var(--panel2); color: var(--text2); line-height: 1.6; }
.dl-info b { color: var(--text); font-weight: 600; }
.dl-info .bad { color: var(--red); }
.dl-jobs:empty { display: none; }
.dl-job { padding: 8px 0; border-top: 1px solid var(--line); }
.dl-job-head { display: flex; align-items: center; gap: 8px; }
.dl-job-head .t { flex: 1; color: var(--text); }
.dl-job-head .s { color: var(--muted); font-size: 12px; }
.dl-job-head .s.ok { color: var(--green); }
.dl-job-head .s.err { color: var(--red); }
.dl-job-head button { padding: 2px 8px; font-size: 12px; }
.dl-bar { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--line); overflow: hidden; }
.dl-bar i { display: block; height: 100%; background: var(--orange); transition: width .3s; }
#btnDownload.busy { color: var(--orange); }
/* «Только лимитные ордера» — контурная кнопка */
.btn-outline { border: 1px solid var(--orange); color: var(--orange); border-radius: var(--radius); padding: 6px 14px; font-weight: 600; }
.btn-outline:hover:not(:disabled) { background: rgba(247, 166, 0, .1); }
/* Бегунок как на Bybit: линия с точками 0 / 25 / 50 / 75 / 100 % */
.bb-slider { position: relative; height: 22px; margin: 10px 0 2px; }
.bb-track { position: absolute; left: 7px; right: 7px; top: 10px; height: 2px; background: #3a3d44; pointer-events: none; }
.bb-track b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--orange); }
.bb-track i { position: absolute; top: -4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--panel); border: 2px solid #5d606b; box-sizing: border-box; }
.bb-track i:nth-of-type(1) { left: 0; } .bb-track i:nth-of-type(2) { left: 25%; } .bb-track i:nth-of-type(3) { left: 50%; }
.bb-track i:nth-of-type(4) { left: 75%; } .bb-track i:nth-of-type(5) { left: 100%; }
.bb-track i.on { border-color: var(--orange); }
.bb-slider input[type=range] { -webkit-appearance: none; appearance: none; position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 22px; margin: 0; background: transparent; z-index: 2; cursor: pointer; }
.bb-slider input[type=range]::-webkit-slider-runnable-track { height: 22px; background: transparent; }
.bb-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; background: var(--panel); border: 3px solid var(--orange); box-sizing: border-box; }
.bb-slider input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--panel); border: 3px solid var(--orange); box-sizing: border-box; }
.bb-slider input[type=range]:disabled { cursor: default; }
.slider-labels { margin-bottom: 10px; }
.info-box .dotted, .close-info span[title] { border-bottom: 1px dashed var(--muted); cursor: help; }
/* «Закрыть»: строка К-во и стоимость закрытия */
.c-qty { display: flex; justify-content: space-between; align-items: center; min-height: 38px; padding: 0 10px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 6px; }
.c-qty span { color: var(--muted); }
.c-qty em, .close-info em { font-style: normal; }
.c-qty em.warn-txt { color: var(--orange); }
.close-info { margin-bottom: 14px; }
.close-info div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 3px 0; }
.close-info span { color: var(--muted); }
.close-info b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* «Закрыть»: пресеты 10–90 % под бегунком */
.c-presets { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; margin: -4px 0 12px; }
.c-presets button { padding: 4px 0; border-radius: 4px; background: var(--hover); color: var(--text2); font-size: 11px; font-weight: 500; }
.c-presets button:hover:not(:disabled) { background: #363a42; color: var(--text); }
.c-presets button.on { background: rgba(247, 166, 0, .15); color: var(--orange); }
/* Галочка «Автопауза в зоне прибыли» в панели плеера */
.toolbar label.tb-check { cursor: pointer; white-space: nowrap; color: var(--text2); }
.tb-check input { accent-color: var(--orange); margin: 0; cursor: pointer; }
/* Галочка автопаузы «P&L» рядом с кнопками плеера */
.toolbar label.tb-check { gap: 5px; }
.tb-check .pnl-lbl { color: var(--green); font-weight: 600; }
/* Подсказка на пустом графике (нет истории до даты старта) */
.no-hist { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 5; pointer-events: none;
  display: flex; flex-direction: column; gap: 6px; max-width: 460px; padding: 14px 18px; border-radius: 10px;
  background: rgba(23, 24, 30, .92); border: 1px solid var(--line); text-align: center; color: var(--text2); line-height: 1.45; }
.no-hist b { color: var(--text); font-size: 14px; }
/* Подсказка клавиши в меню глаза */
.db-fly-row kbd { margin-left: auto; padding: 0 6px; border: 1px solid #3a3d44; border-radius: 4px; color: var(--muted); font: 600 11px Inter, Arial, sans-serif; line-height: 18px; }
/* «Изм. за сутки» в тикере */
#tkDayVal { font-variant-numeric: tabular-nums; }
#tkDayVal.up { color: var(--green); }
#tkDayVal.down { color: var(--red); }
/* Информация в правом верхнем углу графика (левее шкалы цен; right задаёт renderChartInfo): каждый пункт — 2 строки */
.chart-info { position: absolute; top: 6px; z-index: 8; pointer-events: none; display: flex; align-items: flex-start; gap: 22px;
  text-shadow: 0 0 4px #0b0b0f, 0 0 2px #0b0b0f; }   /* просто текст на графике, без подложки */
.chart-info.with-bg { padding: 5px 12px 6px; border-radius: 6px; }
.chart-info.empty { display: none; }
.ci-item { display: flex; flex-direction: column; align-items: center; gap: 1px; white-space: nowrap; }
.ci-item[hidden] { display: none; }
.ci-lbl { color: var(--muted); font-size: 12px; }
.ci-val { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); }
.ci-val.up { color: var(--green); }
.ci-val.down { color: var(--red); }
.ci-timer { display: grid; grid-template-columns: repeat(3, auto); column-gap: 12px; justify-items: center; }
.ci-timer[hidden] { display: none; }
/* Разделители суток на графике */
.day-lines { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; overflow: hidden; }
/* Сделки на графике (фьючерсный, tradelines.js): вход → выход пунктиром, у выхода — итог в $ */
.trade-lines { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.trade-lines line { stroke-width: 1.5; stroke-dasharray: 5 4; }
.trade-lines line.tl-win { stroke: #20b26c; }
.trade-lines line.tl-loss { stroke: #ef454a; }
.trade-lines g rect { fill-opacity: 0.88; }
.trade-lines g.tl-win rect { fill: #20b26c; }
.trade-lines g.tl-loss rect { fill: #ef454a; }
.trade-lines g text { fill: #fff; font: 600 11px Inter, Arial, sans-serif; text-anchor: middle; }
/* цвет, толщина и вид разделителей суток задаются из меню ⚙ (inline style у линий) */
/* Меню правой кнопки живёт в body: позиция от окна (и над графиком, и над таблицей позиций) */
.ctx-menu.ctx-fixed { position: fixed; z-index: 70; }
td.ctx-price { cursor: context-menu; }
/* Переключатель единиц в заголовке «Размер» */
.th-toggle { cursor: pointer; user-select: none; border-bottom: 1px dashed var(--muted); }
.th-toggle:hover { color: var(--text); }
.th-toggle i { font-style: normal; color: var(--orange); margin-left: 2px; }
/* Колонка «Дисбаланс» */
td.imb { cursor: context-menu; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Без рамки фокуса браузера у кнопок, вкладок, списков, галочек и бегунков: после клика мышью
   любая клавиша (H, пробел, →) иначе обводит последнюю нажатую кнопку. У полей ввода — своя оранжевая подсветка. */
button:focus, button:focus-visible, select:focus-visible, [tabindex]:focus-visible,
input[type=checkbox]:focus-visible, input[type=range]:focus-visible, summary:focus-visible { outline: none; }
/* «До ликв. осталось» в шапке */
#tkLiqVal { font-variant-numeric: tabular-nums; }
#tkLiqVal.liq-mid { color: var(--orange); }
#tkLiqVal.liq-near { color: var(--red); font-weight: 600; }
/* Цена и символ в шапке не переносятся на две строки, когда блоков много */
.tk-price, .tk-sym { white-space: nowrap; flex-shrink: 0; }
/* Подсказка «Биржа не приняла ордера усреднения» в «Настройках сетки» */
.min-warn { margin: -4px 0 12px; font-size: 12px; line-height: 1.45; }
.min-warn p { margin: 4px 0; }
.min-warn ul { margin: 4px 0; padding-left: 16px; }
.min-warn li { margin: 2px 0; color: var(--text2); }
.min-warn li b { color: var(--text); }
.min-warn li b.up { color: var(--green); }
.min-warn li b.down { color: var(--red); }
/* Пресеты шага сетки под полем */
.c-presets.step-presets { grid-template-columns: repeat(6, 1fr); margin: -2px 0 10px; }
/* Связь границ сетки: поля слева, значок-цепочка справа во всю высоту пары */
.link-pair { display: flex; gap: 6px; align-items: stretch; }
.link-fields { flex: 1; min-width: 0; }
.link-btn { width: 28px; margin-bottom: 8px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); background: var(--input); border: 1px solid transparent; }
.link-btn:hover { color: var(--text); }
.link-btn.on { color: var(--orange); border-color: rgba(247, 166, 0, .5); background: rgba(247, 166, 0, .1); }
/* «Настройки сетки»: подписи полей в одну строку (поле числа уже — под 5–6 цифр) */
#formStrategy .field label, #formUser .field label, .tg-form .field label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#formStrategy .field input, #formUser .field input, .tg-form .field input { flex: 0 0 62px; min-width: 0; }
#formStrategy .field .sfx, #formUser .field .sfx, .tg-form .field .sfx { white-space: nowrap; }
/* «Ручная сетка»: подблоки LONG / SHORT с заголовками как у основных блоков */
details.st-group .st-sub { margin-top: 10px; }
details.st-group .st-sub .st-title { margin-bottom: 6px; }
/* Без синего цвета браузера: галочки, бегунки, календарь и выделение текста — в оранжевой гамме интерфейса */
:root { accent-color: var(--orange); color-scheme: dark; }
::selection { background: rgba(247, 166, 0, .35); color: #fff; }
/* Свой выпадающий список (вместо системного с синей подсветкой) */
.ns-menu { position: fixed; z-index: 1000; max-height: 320px; overflow-y: auto; padding: 4px 0; background: #25282c;
  border: 1px solid #33363d; border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .55); font-size: 13px; }
.ns-item { padding: 6px 12px; white-space: nowrap; cursor: pointer; color: #eaecef; }
.ns-item:has(kbd) { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.ns-item kbd { color: var(--muted); font: 500 11px Inter, sans-serif; padding: 0 5px; border: 1px solid #3a3d44; border-radius: 3px; }
.ns-item:hover { background: rgba(247, 166, 0, .12); color: var(--orange); }
.ns-item.on { color: var(--orange); font-weight: 600; }
.ns-item.off { opacity: .4; cursor: default; }
.ns-menu::-webkit-scrollbar { width: 6px; }
.ns-menu::-webkit-scrollbar-thumb { background: #3a3d44; border-radius: 3px; }
/* Кнопки шкалы цен «A» (авто) и «Л» (логарифм) — в правом нижнем углу, над шкалой времени */
/* Отступ справа у плашек на шкале цен (фьючерсный, tradelines.js: scaleGap) — под кнопками «A / Л» */
.scale-gap { position: absolute; right: 0; top: 0; bottom: 0; width: 12px; z-index: 8; pointer-events: none; }
.scale-btns { position: absolute; right: 0; bottom: 0; z-index: 9; display: flex; align-items: center; justify-content: center; gap: 4px; pointer-events: none; }
.scale-btns button { pointer-events: auto; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 4px;
  font-size: 11px; font-weight: 600; color: var(--text2); background: #2a2e39; border: 1px solid #363a45; }
.scale-btns button:hover { color: #fff; }
.scale-btns button.on { color: #000; background: var(--orange); border-color: var(--orange); }
/* Меню ⚙: палитра цвета и образцы вида линии для сетки и разделителей суток */
.cm-pal { display: grid; grid-template-columns: repeat(7, 22px); gap: 6px; margin-bottom: 12px; }
.radio.sw-dot { width: 22px; height: 22px; border-radius: 4px; border: 1px solid #3a3d44; gap: 0; }
.radio.sw-dot.on { outline: 2px solid var(--orange); outline-offset: 1px; }
.radio .lst { display: inline-block; width: 34px; border-top: 2px solid currentColor; vertical-align: middle; }
/* Поля даты: вместо значка браузера — свой значок; календарь браузера не открывается */
input[type=date], input[type=datetime-local] { cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16' fill='none' stroke='%23b2b5be' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; padding-right: 30px; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator { display: none; }
/* Свой календарь в стиле интерфейса */
.dp { position: fixed; z-index: 1000; padding: 10px; background: #25282c; border: 1px solid #33363d; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .55); color: #eaecef; font-size: 13px; user-select: none; }
.dp-head { display: flex; align-items: center; gap: 2px; margin-bottom: 8px; }
.dp-head button { width: 26px; height: 26px; border-radius: 4px; color: var(--text2); font-size: 15px; }
.dp-head button:hover { background: rgba(247, 166, 0, .12); color: var(--orange); }
.dp-title { flex: 1; text-align: center; font-weight: 600; }
.dp-body { display: flex; gap: 8px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 32px); gap: 2px; }
.dp-wd span { text-align: center; color: var(--muted); font-size: 11px; padding: 2px 0 4px; }
.dp-day { height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 4px; cursor: pointer; }
.dp-day:hover { background: rgba(247, 166, 0, .12); color: var(--orange); }
.dp-day.other { color: #5d606b; }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--orange); }
.dp-day.on { background: var(--orange); color: #000; font-weight: 700; }
.dp-day.off { color: #3a3d44; cursor: default; background: none; }
.dp-time { width: 44px; height: 226px; overflow-y: auto; border-left: 1px solid #33363d; padding-left: 4px; }
.dp-time span { display: block; height: 28px; line-height: 28px; text-align: center; border-radius: 4px; cursor: pointer; }
.dp-time span:hover { background: rgba(247, 166, 0, .12); color: var(--orange); }
.dp-time span.on { background: var(--orange); color: #000; font-weight: 700; }
.dp-time::-webkit-scrollbar { width: 4px; }
.dp-time::-webkit-scrollbar-thumb { background: #3a3d44; border-radius: 2px; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid #33363d; }
.dp-foot button { padding: 4px 10px; border-radius: 4px; color: var(--orange); font-weight: 600; }
.dp-foot button:hover { background: rgba(247, 166, 0, .12); }
.dp-foot .dp-done { background: var(--orange); color: #000; }
.dp-foot .dp-done:hover { background: #ffb31a; }
/* Окно «Коррекция Фибоначчи → Стиль» */
dialog.fib-dlg { max-width: 460px; }
.fib-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; color: var(--text2); min-height: 30px; }
.fib-row .set-chk { color: var(--text); }
.fib-ctl { display: flex; align-items: center; gap: 8px; }
.fib-ctl select { width: 110px; }
.fib-ctl select[data-num] { width: 70px; }
.fib-ctl input[type=range] { width: 120px; }
.fib-op { width: 36px; text-align: right; font-weight: 500; }
.fib-levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 12px 0; }
.fib-lv { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* Поле значения — узкое (как в TradingView): колонки не шире окна, квадратик цвета не обрезается */
.fib-lv input[type=number] { flex: 0 0 96px; width: 96px; min-width: 0; padding: 6px 8px; }
.fib-lv.off input[type=number], .fib-lv.off .fib-sw { opacity: .4; }
.fib-sw { width: 26px; height: 26px; border-radius: 4px; border: 1px solid #3a3d44; cursor: pointer; flex-shrink: 0; }
/* «Параллельный канал»: строки уровней — галочка, доля, цвет, стиль линии */
.chan-levels { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 12px; }
.chan-lv { display: grid; grid-template-columns: 18px 96px 26px 120px; align-items: center; gap: 8px; }
.chan-lv input[type=number] { width: 100%; padding: 6px 8px; }
.chan-lv.off input[type=number], .chan-lv.off .fib-sw, .chan-lv.off .ns-wrap, .chan-lv.off select { opacity: .4; }
.chan-fix { display: block; width: 16px; }
.fib-sw:hover { border-color: var(--orange); }
.fib-pal { position: fixed; z-index: 1001; padding: 8px; background: #25282c; border: 1px solid #33363d; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .55); }
.fib-pal .pal-row, .fib-pal-more { display: flex; gap: 4px; margin-bottom: 4px; }
.fib-pal .sw { width: 20px; height: 20px; border-radius: 3px; cursor: pointer; border: 1px solid transparent; }
.fib-pal .sw:hover, .fib-pal .sw.on { outline: 2px solid var(--orange); outline-offset: 1px; }
dialog.fib-dlg .set-body { overflow-x: hidden; }
/* Меню правой кнопки: заголовок группы «В ручную сетку» */
.ctx-title { padding: 4px 16px 2px; color: var(--muted); font-size: 11px; }
.ctx-row b.up, .ctx-row b.down { font-weight: 600; }
/* Короткая подсветка поля, куда вставили цену */
@keyframes field-flash { 0% { box-shadow: 0 0 0 2px var(--orange); } 100% { box-shadow: 0 0 0 2px transparent; } }
.field.flash { animation: field-flash 1.4s ease-out; }
/* Поля «Ручной сетки» шире: цены вроде 96 000,50 не обрезаются (у них нет подписи «%») */
#formStrategy details .field input, #formUser details .field input,
.tg-form input[name="high"], .tg-form input[name="low"], .tg-form input[name="levels"] { flex: 0 0 110px; }
/* «Сетка User»: строка-счётчик ордеров (нейтральная, не «бот остановлен») */
.bot-status.user-status { background: rgba(255, 255, 255, .05); color: var(--text2); }
.bot-status.user-status.on { background: rgba(247, 166, 0, .1); color: var(--orange); }
/* Ручная сетка: неверная пара цен (верхняя не выше нижней) */
.field.invalid { border-color: var(--red) !important; background: rgba(239, 69, 74, .08); }
.field.invalid input { color: var(--red); }
.field-err { margin: -4px 0 8px; padding: 0 4px; color: var(--red); font-size: 11px; line-height: 1.4; }
/* «Сбросить» справа в заголовке блока сетки */
.st-group > div.st-title, .st-sub > .st-title { display: flex; align-items: center; justify-content: space-between; }
.st-reset { color: var(--muted); font-size: 11px; font-weight: 500; padding: 1px 4px; border-radius: 3px; }
.st-reset:hover { color: var(--orange); background: rgba(247, 166, 0, .1); }
/* Меню глаза: иконка слева — серый глаз (видно) или зачёркнутый оранжевый (скрыто) */
.db-fly-row .hide-eye { display: inline-flex; color: #787b86; font-style: normal; }
.db-fly-row .hide-eye svg { width: 18px; height: 18px; }
.db-fly-row.is-hidden .hide-eye { color: var(--orange); }
/* «Сетка User»: удалить ордера только Long / только Short — две кнопки в строку под основной */
.cancel-sides { display: flex; gap: 6px; margin-top: 8px; }
.cancel-sides .btn-gray { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 6px; font-size: 11.5px; font-weight: 400; white-space: nowrap; overflow: hidden; }
.cancel-sides .btn-gray i { display: inline-flex; font-style: normal; }
.cancel-sides .btn-gray b { font-weight: 600; margin-left: -1px; }
.cancel-sides svg { flex: none; width: 13px; height: 13px; }
/* Корзина вместо слова «Удалить» */
.btn-trash { display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-trash svg { flex: none; }
/* Сетка User / Метод 2: режим маржи стороны — «Для каждого ордера» / «Распределение» (включён один) */
.mm-modes { display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.mm-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; white-space: nowrap; color: var(--text2); cursor: pointer; user-select: none; }
.mm-chk input { margin: 0; accent-color: var(--orange); cursor: pointer; }
.mm-chk:has(input:checked) { color: var(--text); }
/* «Сброс маржи» (фьючерсы): включённые Лонг — зелёный, Шорт — красный */
.mm-chk input[data-mr="LONG.on"] { accent-color: var(--green); }
.mm-chk input[data-mr="SHORT.on"] { accent-color: var(--red); }
.mm-chk:has(input[data-mr="LONG.on"]:checked) { color: var(--green); }
.mm-chk:has(input[data-mr="SHORT.on"]:checked) { color: var(--red); }
/* на красном браузер рисует белую галочку — своя, как родная на зелёном (та же форма, тёмно-серая #333) */
.mm-chk input[data-mr="SHORT.on"]:checked { appearance: none; box-sizing: border-box; width: 13px; height: 13px;
  padding: 0; border: 0; border-radius: 2px; flex-shrink: 0;
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13'%3E%3Cpath d='M2.6 6.5l2.6 2.6 5.2-6.5' fill='none' stroke='%23333' stroke-width='2.08'/%3E%3C/svg%3E") center / 13px no-repeat; }
.follow-chk { display: flex; margin: 2px 0 10px; }   /* Сетка Bot: «Восстанавливать уровни за ценой» */
/* «Сетка User» → «Только в зоне убытка» и подсказка с зоной под ней */
.lz-chk { margin: 0 0 6px; font-size: 12.5px; }
.lz-hint { margin: 0 0 10px; font-size: 12px; color: var(--text2); line-height: 1.4; }
.lz-hint b { color: var(--text); font-weight: 600; }
.lz-hint .bad { color: var(--orange); }
.lz-hint .dn, .lz-hint .up { font-weight: 600; margin-left: 4px; }
.lz-hint .dn { color: var(--red); }
.lz-hint .up { color: var(--green); }
.mm-hint { margin: -4px 0 8px; padding: 0 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
/* «Трейдинг»: режим «Вручную / Сетка» над «Открыть / Закрыть» */
.tr-modes { justify-content: flex-start; gap: 24px; margin: 14px 0 0; }
.tr-modes .mm-chk { font-size: 13px; }
.tg-form { margin-top: 2px; }
.tg-form .mm-modes { margin-top: 2px; }
/* «Дерево объектов»: индикаторы и рисунки графика списком (кнопка со слоями на левой панели) */
.obj-tree { position: absolute; left: 8px; top: 8px; z-index: 30; width: 310px; max-height: calc(100% - 16px); display: flex;
  flex-direction: column; background: #1e2125; border: 1px solid #2b2f36; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.obj-tree[hidden] { display: none; }
.ot-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; font-weight: 600;
  border-bottom: 1px solid #2b2f36; }
.ot-head button { color: var(--muted); font-size: 14px; padding: 0 4px; }
.ot-head button:hover { color: #fff; }
.ot-body { overflow-y: auto; flex: 1; padding: 2px 0 6px; min-height: 60px; }
.ot-sec { padding: 10px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.ot-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; cursor: pointer; color: #d1d4dc; font-size: 13px; }
.ot-row:hover { background: rgba(255, 255, 255, .05); }
.ot-row.sel { background: rgba(247, 166, 0, .1); }
.ot-row.off { color: #6a6e75; }
.ot-ic { display: inline-flex; flex: none; font-style: normal; }
.ot-ic svg { width: 18px; height: 18px; }
.ot-row.off .ot-ic { opacity: .5; }
.ot-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ot-name small { margin-left: 6px; font-size: 11px; color: var(--muted); }
.ot-btn { flex: none; width: 26px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px; color: #8a8e96; opacity: 0; }
.ot-btn svg { width: 16px; height: 16px; }
.ot-row:hover .ot-btn, .ot-row.off .ot-btn[data-eye] { opacity: 1; }
.ot-row.off .ot-btn[data-eye] { color: var(--orange); }
.ot-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.ot-empty { padding: 4px 12px; color: var(--muted); font-size: 12px; }
.ot-note { margin: 8px 12px 0; padding: 6px 8px; border-radius: 6px; background: rgba(247, 166, 0, .1); color: var(--orange); font-size: 12px; }
.ot-note button { margin-left: 6px; color: var(--orange); text-decoration: underline; }
.ot-foot { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid #2b2f36; }
.ot-foot button { flex: 1; padding: 6px 8px; font-size: 12px; }
/* EMA / SMA Ribbon: настройки линий в одной вкладке — галочка, период, цвет, толщина */
.set-style input[type=number] { width: 80px; }
.set-ma-head { margin-bottom: 0; font-size: 11px; color: var(--muted); }
.set-ma-head .set-style i { font-style: normal; text-align: center; }
.set-ma-head .set-style i:nth-child(1) { width: 80px; }
.set-ma-head .set-style i:nth-child(2) { width: 34px; }
.set-ma-head .set-style i:nth-child(3) { width: 70px; }
/* Фибоначчи: «Шаблон ▾» — сохранить как, по умолчанию (TradingView), сохранённые шаблоны */
.fib-tpl { position: relative; }
.fib-tpl-menu { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 5; min-width: 230px; max-height: 340px;
  overflow-y: auto; padding: 6px 0; background: #1e2125; border: 1px solid #2b2f36; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .55); }
.fib-tpl-menu[hidden] { display: none; }
.ftm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 14px;
  cursor: pointer; color: #d1d4dc; font-size: 13px; white-space: nowrap; }
.ftm-row:hover { background: rgba(255, 255, 255, .06); }
.ftm-row button { color: var(--muted); opacity: 0; padding: 0 4px; }
.ftm-row:hover button { opacity: 1; }
.ftm-row button:hover { color: #fff; }
.ftm-sep { height: 1px; margin: 6px 0; background: #2b2f36; }
.ftm-empty { padding: 6px 14px; color: var(--muted); font-size: 12px; }
/* Только линия на графике, без плашки (например, «Линия старта позиции») */
.plate.ov-noplate { display: none !important; }
/* Ползунок в меню ⚙ графика (непрозрачность подложки информационной панели) */
.cm-range { width: 100%; accent-color: var(--orange); cursor: pointer; margin: 0 0 6px; }
.cm-range-val { color: var(--orange); font-weight: 600; margin-left: 4px; }
/* Цвет подложки в меню ⚙: «Свой цвет» и пипетка */
.cm-color-row { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; }
.cm-color-pick { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text2); font-size: 12px; }
.cm-color-pick input[type="color"] { width: 26px; height: 22px; padding: 0; border: 1px solid #3a3d44; border-radius: 4px; background: none; cursor: pointer; }
.cm-eyedrop { display: flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid #3a3d44; border-radius: 4px; color: var(--text2); font-size: 12px; }
.cm-eyedrop:hover { color: #fff; border-color: var(--orange); }
.cm-color-hex { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 11px; font-variant-numeric: tabular-nums; }
/* Фибоначчи: настройки процентов между уровнями */
.fib-sub { margin-left: 24px; }
.fib-pct-lbl { font-weight: 600; }
.fib-pct-lbl.up { color: #089981; }
.fib-pct-lbl.dn { color: #f23645; }
.fib-op.fib-px { width: 48px; }
/* Окно настроек «Длинная / Короткая позиция» */
dialog.pos-dlg { max-width: 470px; }
/* Калькулятор процентов (фьючерсный, calc.js): подписи и поля четырёх расчётов — в одних колонках */
dialog.calc-dlg { max-width: 820px; }
.calc-body { display: grid; grid-template-columns: max-content minmax(90px, 170px) max-content minmax(90px, 170px) auto auto; gap: 8px 10px; align-items: center; padding: 0 18px 18px; font-size: 13px; }
.calc-row { display: contents; }
.calc-row label { color: var(--text2); white-space: nowrap; }
.calc-row input { width: 100%; }
.calc-res { grid-column: 1 / -1; margin-bottom: 12px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calc-row:last-child .calc-res { margin-bottom: 0; }
.calc-res.calc-ok { color: var(--orange); }
.calc-res.calc-err { color: var(--red); font-weight: 500; }
.pos-dlg .pos-inp { width: 120px; }
.pos-dlg .fib-ctl select { width: 96px; }
.pos-dlg .fib-ctl select[data-num] { width: 76px; }
.pos-unit { color: var(--muted); font-style: normal; font-size: 12px; width: 40px; }
.pos-h { margin: 14px 0 2px; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pos-calc { margin: 10px 0 6px; padding: 8px 10px; border-radius: 6px; background: rgba(255, 255, 255, .04); color: var(--text2); font-size: 12px; line-height: 1.6; }
.pos-calc b { color: var(--text); font-weight: 600; }
.pos-orders { margin-top: 10px; }
.pos-orders .set-chk.off { opacity: .5; }
.pos-hint { color: var(--muted); font-size: 11.5px; line-height: 1.45; margin: -2px 0 6px 24px; }
.pos-dlg .fib-ctl select[data-pk="qtyPrec"] { width: 130px; }
/* Перетаскивание точки-ручки рисунка — курсор ручки (↕ / ↔ / ✥) на всё время, даже если мышь ушла с точки */
body.dr-dragging, body.dr-dragging * { cursor: var(--dr-cursor, move) !important; }
/* «История» в окне новой сессии */
.new-hist { display: flex; align-items: center; gap: 10px; padding: 0 18px 10px; }
.new-hist label { display: flex; align-items: center; gap: 12px; flex: 1; color: var(--text2); }
.new-hist select { flex: 1; min-width: 0; }
.pos-dlg .pos-inp.pos-op { width: 70px; }
/* Журнал сделок */
dialog.journal-dlg { width: min(1100px, 96vw); max-width: none; }
.jr-sum { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 4px 18px 12px; border-bottom: 1px solid var(--line); }
.jr-c { display: flex; flex-direction: column; gap: 2px; min-width: 110px; }
.jr-c span { color: var(--muted); font-size: 11.5px; }
.jr-c b { font-size: 15px; font-weight: 600; }
.jr-c i { font-style: normal; }
.jr-body { max-height: 66vh; overflow: auto; padding-top: 6px; }
.jr-tbl td, .jr-tbl th { white-space: nowrap; }
.journal-dlg .pos { color: var(--green, #089981); }
.journal-dlg .neg { color: var(--red, #f23645); }
.journal-dlg .dim { color: var(--muted); font-style: normal; }
.jr-tbl tr.jr-open td { background: rgba(255, 152, 0, .06); }
.jr-empty { color: var(--muted); padding: 20px 4px; }
/* TP/SL к ордерам на открытие (вкладка «Трейдинг») */
.tpsl { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.tpsl-chk { font-size: 13px; }
.tpsl-fields { margin-top: 8px; }
.tpsl-fields .field select.unit { width: auto; min-width: 64px; }
.tpsl-hint { color: var(--muted); font-size: 11.5px; line-height: 1.45; margin-top: 4px; }
/* «Сброс маржи» (фьючерсы): строки лонга и шорта */
.mr .mr-side { margin-top: 8px; }
.mr .mr-side + .mr-side { padding-top: 8px; border-top: 1px dashed var(--line); }
.mr .mr-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 6px; }
.mr .mr-grid .field { margin: 0; }
/* «Тики» — точный режим на панели плеера */
.tb-check .tick-lbl { color: var(--orange); font-weight: 600; }
/* Живой режим сессии (фьючерсы): метка LIVE вместо «Идёт» */
.badge.live { background: rgba(242, 54, 69, .16); color: var(--red); font-weight: 700; letter-spacing: .04em; }
.badge.live.paused { background: var(--hover); color: var(--text2); }
.badge.live.err { background: rgba(247, 166, 0, .16); color: var(--orange); }
.tb-check .train-lbl { color: #42a5f5; font-weight: 600; }
.tb-check:has(input:disabled) { opacity: .45; cursor: default; }

/* ---------- Списки котировок (фьючерсный симулятор, watchlist.js) ---------- */
.rbar { width: 46px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; background: var(--panel); }
.rbar button { width: 36px; height: 36px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text2); }
.rbar button:hover { background: var(--hover); color: #fff; }
.rbar button.active { color: var(--orange); background: rgba(247, 166, 0, .1); }
/* Перетаскивание иконок правой полосы (порядок запоминается) */
.rbar button.rb-drag { background: var(--hover); color: #fff; box-shadow: 0 0 0 1px var(--orange); }
body.rb-dragging, body.rb-dragging * { cursor: grabbing !important; user-select: none; }
.right.wl-on { width: var(--wl-w, 360px); overflow: hidden; }   /* ширина — по колонкам (wlLayout в watchlist.js) */
.right.wl-on > :not(#wlPanel) { display: none !important; }
.wl { display: flex; flex-direction: column; flex: 1; min-height: 0; position: relative; }
.wl-head { display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 10px 0 14px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.wl-name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; padding: 4px 6px; margin-left: -6px; border-radius: 6px; }
.wl-name:hover { background: var(--hover); }
.wl-ico { width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text2); }
.wl-ico:hover { background: var(--hover); color: #fff; }
.wl-menu { position: absolute; left: 8px; top: 42px; z-index: 20; min-width: 190px; padding: 4px; background: #25282c; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.wl-menu button { display: flex; justify-content: space-between; width: 100%; padding: 7px 10px; border-radius: 6px; text-align: left; }
.wl-menu button:hover { background: var(--hover); }
.wl-menu button.active span { color: var(--orange); }
.wl-menu i { font-style: normal; color: var(--muted); }
/* Глаз в меню списков — показывать ли список в «Общем» */
.wl-menu button .wl-eye { display: flex; align-items: center; justify-content: center; width: 22px; height: 20px; margin: 0 6px 0 -4px; border-radius: 4px; color: var(--text2); flex-shrink: 0; }
.wl-menu button .wl-eye:hover { color: #fff; background: #3a3f48; }
.wl-menu button .wl-eye.none { pointer-events: none; }
.wl-menu button > span { flex: 1; }
.wl-menu button.wl-hid > span, .wl-menu button.wl-hid > i, .wl-menu button .wl-eye.off { opacity: .45; }
.wl-cols, .wl-row { display: grid; grid-template-columns: var(--wl-cols, minmax(0, 1fr) 92px 64px 62px); align-items: center; column-gap: 16px; padding: 0 10px 0 14px; }
.wl-cols { height: 30px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.wl-cols button { padding: 0; color: var(--muted); font-size: 11.5px; text-align: right; white-space: nowrap; }
.wl-cols button:first-child { text-align: left; }
.wl-cols button:hover, .wl-cols button.sorted { color: var(--text); }
.wl-cols em { font-style: normal; font-size: 9px; margin-left: 3px; color: var(--orange); }
.wl-list { flex: 1; min-height: 0; overflow-y: auto; }
.wl-row { position: relative; height: 36px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.wl-row:hover { background: rgba(255, 255, 255, .03); }
.wl-row.sel { background: rgba(41, 98, 255, .16); }
/* Фьючерсный: монета на графике — жёлтая рамка (как в TradingView) вместо синей заливки выбранной и полоски слева;
   нажали другую — рамка сразу на ней, пока график её открывает */
.wl-fut .wl-row.sel { background: none; }
.wl-fut .wl-row.cur::before { display: none; }
.wl-fut .wl-list:not(.opening-any) .wl-row.cur, .wl-fut .wl-row.opening { box-shadow: inset 0 0 0 1px var(--orange); border-radius: 6px; }
/* Флажки монет (watchlist.js: wlFlagHtml) — у левого края строки; без флажка — серый при наведении */
.wl-fut .wl-flags .wl-row, .wl-fut .wl-flags .wl-cols { padding-left: 22px; }   /* место под флажок (13 px) и отступ до «Инструмента» */
.wl-flag { position: absolute; left: 2px; top: 50%; transform: translateY(-50%); width: 13px; height: 15px; display: none;
  fill: #5d606b; cursor: pointer; z-index: 1; }
.wl-flag svg { display: block; }
.wl-flag.on { display: block; fill: var(--fc); }
.wl-row:hover .wl-flag { display: block; }
.wl-flag:hover { filter: brightness(1.25); }
.wl-list.selecting .wl-flag { display: none; }
/* Новые листинги в окне «Добавить инструмент» (фьючерсный, watchlist.js: wlRenderNew) */
.wls-new { margin: 0 16px 8px; padding: 8px 10px; border: 1px solid rgba(247, 166, 0, .35); border-radius: 8px;
  background: rgba(247, 166, 0, .06); font-size: 12px; max-height: 150px; overflow-y: auto; flex-shrink: 0; }
.wls-new-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--orange);
  font-weight: 600; margin-bottom: 4px; }
.wls-new-h button { padding: 2px 8px; border-radius: 4px; color: var(--text2); font-size: 11px; background: rgba(255, 255, 255, .06); }
.wls-new-h button:hover { color: var(--text); }
.wls-new-row { padding: 2px 0; line-height: 1.6; }
.wls-new-row .wl-exb { margin-right: 6px; }
.wls-new-day { color: var(--muted); margin-right: 6px; }
.wls-new-row a { color: var(--text); cursor: pointer; text-decoration: underline dotted rgba(255, 255, 255, .35); }
.wls-new-row a:hover { color: var(--orange); }
.wls-new-more { color: var(--muted); font-size: 11px; }
.wl-new-b { font-style: normal; margin-left: 6px; padding: 0 4px; border-radius: 3px; font-size: 9px; font-weight: 700;
  color: #000; background: var(--orange); vertical-align: 1px; }
.wl-flag-menu { position: fixed; z-index: 1000; display: flex; gap: 6px; padding: 6px 8px; background: #1e2026;
  border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.wl-flag-menu button { width: 18px; height: 18px; border-radius: 50%; background: var(--fc); border: 0; padding: 0; cursor: pointer; }
.wl-flag-menu button:hover { transform: scale(1.15); }
.wl-flag-menu button.on { box-shadow: 0 0 0 2px #1e2026, 0 0 0 3.5px var(--fc); }
.wl-cols { position: relative; }
.wl-cols .wl-flag-sort { position: absolute; left: 2px; top: 50%; transform: translateY(-50%); display: flex; align-items: center;
  fill: #5d606b; padding: 0; }
.wl-cols .wl-flag-sort:hover, .wl-cols .wl-flag-sort.sorted { fill: var(--text); }
.wl-cols .wl-flag-sort em { position: absolute; left: 15px; margin: 0; }
.wl-row.cur::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 2px 2px 0; background: var(--orange); }
.wl-sym { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wl-sym b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-px, .wl-chg, .wl-pct { text-align: right; white-space: nowrap; font-size: 12.5px; }
.wl-px em { font-style: normal; }
.wl-coin { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; }
.wl-del { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 4px; display: none; font-size: 11px; color: var(--text2); background: #2b2f36; }
.wl-row:hover .wl-del { display: block; }
.wl-del:hover { color: #fff; background: #3a3f48; }
.wl-empty { padding: 30px 16px; color: var(--muted); text-align: center; line-height: 1.6; }
/* Окно «Добавить инструмент» */
dialog.wl-dlg { max-width: 760px; height: min(720px, calc(100% - 40px)); }
dialog.wl-dlg[open] { display: flex; flex-direction: column; }
.wl-search { display: flex; align-items: center; gap: 10px; margin: 0 18px; padding: 0 4px; border-bottom: 1px solid var(--border); }
.wl-search svg { flex-shrink: 0; color: var(--text2); }
.wl-search input { flex: 1; padding: 10px 0; font-size: 16px; background: none; border: none; }
.wl-chips { display: flex; gap: 8px; padding: 12px 18px; flex-shrink: 0; }
.wl-kinds { display: flex; gap: 18px; padding: 10px 18px 0; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.wl-kinds button { padding: 6px 0 8px; color: var(--text2); font-weight: 600; position: relative; }
.wl-kinds button.active { color: #fff; }
.wl-kinds button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--orange); }
.wl-chip { display: flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 16px; background: var(--hover); font-weight: 600; cursor: pointer; user-select: none; }
.wl-chip input { width: 14px; height: 14px; margin: 0; accent-color: var(--orange); cursor: pointer; }
.wl-chip:has(input:checked) { background: #e8e9eb; color: #000; }
.wl-results { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; }
.wl-res { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 6px; }
.wl-res:hover { background: var(--hover); }
.wl-res .wl-coin { width: 30px; height: 30px; font-size: 14px; }
.wl-res-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.wl-res-name b { font-size: 13.5px; }
.wl-res-name small { color: var(--muted); font-size: 11px; }
.wl-exb { padding: 2px 8px; border-radius: 10px; font-size: 10.5px; font-weight: 600; }
.wl-exb.binance { color: #f0b90b; background: rgba(240, 185, 11, .12); }
.wl-exb.bybit { color: #e8e9eb; background: #2b2f36; }
.wl-add { width: 30px; height: 30px; border-radius: 6px; font-size: 19px; }
.wl-add:hover { background: #363a42; }
.wl-add.has { color: var(--text2); font-size: 15px; }
@media (max-width: 900px) {
  .rbar { width: 100%; flex-direction: row; justify-content: center; }
  .right.wl-on { width: 100%; height: 480px; }
}
/* Просмотр графика монеты (сессии нет), окно «Сессии» по монете */
.view-note { margin: 10px 12px 0; padding: 8px 10px; border-radius: 6px; background: rgba(247, 166, 0, .1); color: var(--orange); font-size: 11.5px; line-height: 1.45; }
#dlgSessions .dlg-head { gap: 14px; }
.sess-all { display: flex; align-items: center; gap: 6px; color: var(--text2); cursor: pointer; user-select: none; }
.sess-all input { width: 14px; height: 14px; margin: 0; accent-color: var(--orange); cursor: pointer; }
.sess-all i { font-style: normal; }
.sess-kind { margin-left: 4px; padding: 1px 6px; border-radius: 3px; font-size: 10px; background: var(--input); color: var(--text2); }
.sess-kind.live { color: var(--green); background: rgba(32, 178, 108, .12); }
.sess-kind.train { color: #64b5f6; background: rgba(100, 181, 246, .12); }
/* Списки котировок: режим «Выбрать» (в списке и в окне «Добавить инструмент») */
.wl-chk { width: 14px; height: 14px; margin: 0; flex-shrink: 0; accent-color: var(--orange); cursor: pointer; }
.wl-list:not(.selecting) .wl-chk { display: none; }
.wl-list.selecting .wl-del { display: none !important; }
.wl-list.selecting .wl-coin { display: none; }        /* галочка — на месте иконки монеты */
.wl-list.selecting .wl-row { cursor: pointer; }
.wl-row.picked { background: rgba(239, 69, 74, .08); }
.wl-ico.active { color: var(--orange); background: rgba(247, 166, 0, .1); }
.wl-selbar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.wl-selbar button { padding: 4px 10px; font-size: 11.5px; }
.wl-selbar .danger, .wl-foot .danger { color: var(--red); }
.wl-res .wl-chk { width: 16px; height: 16px; }
.wl-res.pickable { cursor: pointer; }
.wl-res.picked { background: rgba(247, 166, 0, .09); }
.wl-foot { border-top: 1px solid var(--line); flex-shrink: 0; }
.wl-foot-info { color: var(--green); }
/* Замер ширины текста колонок списка котировок (скрыто) */
.wl-measure { position: absolute; left: -9999px; top: 0; visibility: hidden; pointer-events: none; }
.wl-measure .wl-row, .wl-measure .wl-cols { display: block; height: 0; border: none; padding: 0; }
.wl-measure [data-m] { position: absolute; width: max-content; white-space: nowrap; overflow: visible; }
/* Списки котировок: меню «⋯» (настройка столбцов) и компактный вид (без режима таблицы) */
.wl-opts { position: absolute; right: 8px; top: 42px; z-index: 20; min-width: 230px; padding: 6px 0; background: #1e2025; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.wlo-row { display: flex; align-items: center; gap: 10px; padding: 7px 14px; font-size: 13px; cursor: pointer; user-select: none; }
.wlo-row:hover { background: var(--hover); }
.wlo-row input[type=checkbox], .wlo-row input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: #e8e9eb; cursor: pointer; }
.wlo-switch-row { justify-content: space-between; font-weight: 600; }
.wlo-row input.wlo-switch { appearance: none; -webkit-appearance: none; width: 34px; height: 18px; border-radius: 9px; padding: 0; border: none; background: #4a4d55; position: relative; transition: background .15s; }
.wlo-switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.wlo-row input.wlo-switch:checked { background: var(--orange); }
.wlo-switch:checked::after { left: 18px; }
.wlo-sep { height: 1px; margin: 6px 0; background: var(--line); }
.wlo-title { padding: 4px 14px; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.wl-compact .wl-cols { display: flex; gap: 10px; }
.wl-compact .wl-cols button:first-child { flex: 1; }
.wl-compact .wl-row { height: 44px; column-gap: 8px; grid-template-areas: "s p p" "s c q"; grid-template-rows: auto auto; align-content: center; row-gap: 1px; }
.wl-compact .wl-sym { grid-area: s; }
.wl-compact .wl-px { grid-area: p; }
.wl-compact .wl-chg { grid-area: c; font-size: 11.5px; }
.wl-compact .wl-pct { grid-area: q; font-size: 11.5px; }
/* Списки котировок: разделы (сворачиваются, переименовываются, удаляются, перетаскиваются мышкой) */
.wl-sec { position: relative; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 14px; border-bottom: 1px solid var(--line); color: var(--text2); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; user-select: none; }
.wl-sec:hover { background: rgba(255, 255, 255, .03); }
.wl-sec-arr { width: 12px; font-style: normal; font-size: 15px; line-height: 1; text-align: center; color: var(--muted); transition: transform .12s; }
.wl-sec.open .wl-sec-arr { transform: rotate(90deg); }
.wl-sec-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-sec-n { font-style: normal; font-weight: 500; color: var(--muted); }
.wl-sec.open .wl-sec-n { display: none; }
.wl-sec-del { display: none; align-items: center; justify-content: center; width: 24px; height: 22px; border-radius: 4px; color: var(--text2); background: #2b2f36; }
.wl-sec:hover .wl-sec-del { display: inline-flex; }
.wl-sec-del:hover { color: #fff; background: #3a3f48; }
.wl-list .dragging { opacity: .45; }
.wl-list .drop-before { box-shadow: inset 0 2px 0 var(--orange); }
.wl-list .drop-after { box-shadow: inset 0 -2px 0 var(--orange); }
.wl-list .drop-into { background: rgba(247, 166, 0, .14) !important; }
.wl-list.drop-end { box-shadow: inset 0 -2px 0 var(--orange); }
.wl-menu.wl-ctx { position: fixed; z-index: 60; }
.wl-menu .wlo-sep { margin: 4px 0; }
.wlo-act { width: 100%; text-align: left; font-weight: 600; color: var(--text); }
.wl-selbar { flex-wrap: wrap; }
dialog.wl-ask { max-width: 460px; }
.wl-ask p { margin: 0; padding: 0 18px 6px; color: var(--text2); line-height: 1.55; }
.wl-ask .danger { color: var(--red); }
.wl-sec.wl-free { cursor: default; color: var(--muted); padding-left: 34px; }
.wl-sec.wl-free .wl-sec-n { display: inline; }
/* Списки котировок: логотип биржи вместо иконки монеты (Binance — жёлтый, Bybit — оранжевый) */
/* Логотип монеты (фьючерсный, app.js: coinLogo): буква в кружке, поверх — картинка */
.coin-logo { position: relative; overflow: hidden; background: #2a2e39; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0; color: #d1d4dc; font-weight: 700; font-style: normal; }
.coin-logo::before { content: attr(data-l); font-size: 10px; }
.coin-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.tk-logo-box { display: inline-flex; align-items: center; margin-right: -12px; }   /* тикер ближе к логотипу (gap шапки 22) */
.coin-logo.tk-logo { width: 28px; height: 28px; }
.coin-logo.tk-logo::before { font-size: 13px; }
.wl-coin.wl-ex-binance { background: url(/common/static/img/binance.svg) center / 100% no-repeat; }
.wl-coin.wl-ex-bybit { background: url(/common/static/img/bybit.svg) center / 100% no-repeat; }
.wl-coin.wl-ex-tradfi { background: url(/common/static/img/binance.svg) center / 100% no-repeat; }   /* TradFi — контракты Binance */
/* Списки котировок: поиск в списке (лупа в шапке) */
.wl-find { display: flex; align-items: center; gap: 8px; margin: 8px 10px; padding: 0 8px; border-radius: 6px; background: var(--input); color: var(--text2); flex-shrink: 0; }
.wl-find input { flex: 1; min-width: 0; padding: 6px 0; background: none; border: none; font-size: 13px; }
.wl-find .x { font-size: 12px; padding: 2px 4px; }
/* Списки котировок: меню правой кнопки по монете (в раздел) */
.wl-menu.wl-ctx { max-height: calc(100vh - 16px); overflow-y: auto; min-width: 210px; }
.wl-ctx-title { padding: 6px 10px 4px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.wl-menu button.on span { color: var(--orange); }
.wl-menu button i { font-style: normal; color: var(--orange); }
/* Списки котировок: «Загрузка котировок N%» (открытие суток после перезапуска сервера) */
.wl-load { display: flex; flex-direction: column; gap: 4px; padding: 6px 14px 7px; border-bottom: 1px solid var(--line); color: var(--orange); font-size: 11.5px; flex-shrink: 0; }
.wl-load i { display: block; height: 3px; border-radius: 2px; background: var(--input); overflow: hidden; }
.wl-load b { display: block; height: 100%; width: 0; background: var(--orange); transition: width .3s; }
/* «Дерево объектов» в правой панели (фьючерсы, watchlist.js): кнопка на левой панели скрыта */
.rp-tree-on .drawbar [data-act="tree"] { display: none; }
/* ---------- Оповещения (фьючерсный, alerts.js) ---------- */
.right.al-on { width: 340px; overflow: hidden; }
.right.al-on > :not(#alPanel) { display: none !important; }
.al-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--panel); position: relative; }
.al-tabs { display: flex; gap: 4px; margin: 10px 12px 6px; padding: 3px; background: #1b1d22; border-radius: 8px; }
.al-tabs button { flex: 1; padding: 6px 0; border-radius: 6px; color: var(--text2); font-weight: 600; }
.al-tabs button.on { background: #2e3138; color: #fff; }
.al-tools { display: flex; align-items: center; padding: 0 8px 6px; border-bottom: 1px solid var(--line); }
.al-tbtn { width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text2); }
.al-tbtn:hover { background: var(--hover); color: #fff; }
.al-list { flex: 1; min-height: 0; overflow-y: auto; }
.al-row { position: relative; padding: 9px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.al-row:hover { background: rgba(255, 255, 255, .04); }
.al-row.al-flash { animation: alFlash 1.2s ease-in-out 4; }
@keyframes alFlash { 50% { background: rgba(247, 166, 0, .22); } }
.al-msg { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 70px; }
.al-sub { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--muted); font-size: 12px; }
.al-sub .wl-coin { width: 16px; height: 16px; }
.al-st.on { color: var(--green); font-weight: 500; }
.al-st.hit { color: var(--orange); font-weight: 600; }
.al-st.off { color: var(--muted); font-weight: 500; }
.al-ci { display: inline-flex; color: var(--text2); }
.al-acts { position: absolute; right: 8px; top: 8px; display: none; gap: 2px; }
.al-row:hover .al-acts { display: flex; }
.al-acts button { width: 24px; height: 24px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--text2); }
.al-acts button:hover { background: #3a3f48; color: #fff; }
.al-logrow { cursor: default; }
.al-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 80px 24px 0; text-align: center; color: #d1d4dc; }
.al-empty p { margin: 0; color: var(--text2); line-height: 1.55; }
.al-create { padding: 8px 16px; border-radius: 8px; background: #e8e9eb; color: #000; font-weight: 600; }
.al-create:hover { background: #fff; }
.al-pair { display: flex; gap: 8px; }
.al-pair > * { flex: 1; min-width: 0; }
.al-pair select, .al-pair input { padding: 7px 10px; }
.al-menu { position: absolute; right: 8px; top: 84px; z-index: 30; width: 270px; padding: 6px 0; background: #1e1f23; border: 1px solid #33363d;
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .55); }
.al-menu > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 14px; text-align: left; color: var(--text); }
.al-menu > button:hover { background: var(--hover); }
.al-menu > button.off { opacity: .4; pointer-events: none; }
.al-menu > button em { margin-left: auto; font-style: normal; color: var(--muted); }
.al-mh { margin: 6px 0 2px; padding: 6px 14px 2px; border-top: 1px solid #2f3238; color: var(--muted); font-size: 11px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; }
.al-radio { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #6a6e75; display: inline-flex; flex-shrink: 0; }
.al-radio.on { border: 4px solid var(--orange); }
.al-vol { display: flex; align-items: center; gap: 4px; padding: 5px 14px; }
.al-vol span { flex: 1; color: var(--text2); }
.al-vol button { padding: 3px 8px; border-radius: 5px; background: #2a2d33; color: var(--text2); font-size: 12px; }
.al-vol button.on { background: #e8e9eb; color: #000; }
.rbar button { position: relative; }
/* ---------- Уведомления: листинги и делистинги (фьючерсный, news.js) ---------- */
.right.nw-on { width: 340px; overflow: hidden; }
.right.nw-on > :not(#nwPanel) { display: none !important; }
.nw-head { padding: 12px 14px 2px; font-weight: 600; font-size: 14px; }
.nw-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.nw-tools { gap: 2px; }
.nw-exs { display: flex; gap: 4px; padding-left: 4px; }
.nw-exs button { padding: 3px 8px; border-radius: 5px; background: #2a2d33; color: var(--text2); font-size: 12px; }
.nw-exs button.on { background: #e8e9eb; color: #000; }
.nw-row { padding: 9px 14px 9px 22px; }
.nw-sub { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; padding-right: 70px; }
.nw-dot { position: absolute; left: 9px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.nw-row.unread .nw-dot { background: #2962ff; }
.nw-k { font-weight: 600; }
.nw-k-list { color: var(--green); }
.nw-k-del { color: var(--red); }
.nw-minor { padding: 0 4px; border-radius: 3px; background: #2a2d33; font-size: 10px; }
.nw-title { margin-top: 5px; color: var(--text2); font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.nw-row.unread .nw-title { color: var(--text); font-weight: 600; }
.nw-syms { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.nw-sym { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 3px; border-radius: 10px; background: #2a2d33;
  color: var(--text); font-size: 11.5px; font-weight: 600; }
.nw-sym:hover { background: #3a3f48; }
.nw-sym .wl-coin { width: 15px; height: 15px; }
.nw-sym.off { opacity: .45; }
.nw-foot { display: flex; justify-content: space-between; gap: 8px; padding: 6px 14px; border-top: 1px solid var(--line); color: var(--muted);
  font-size: 11px; flex-shrink: 0; }
.nw-err { color: var(--red); }
.nw-empty { color: var(--muted); }
.nw-mnote { padding: 0 14px 6px 38px; color: var(--muted); font-size: 11px; line-height: 1.4; }
#nwMenu { top: 128px; }
.al-badge { position: absolute; right: 2px; top: 2px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--red);
  color: #fff; font: 600 10px/15px Inter, Arial, sans-serif; font-style: normal; }
/* Окно «Создать оповещение» */
dialog.al-dlg { width: 460px; max-width: calc(100% - 24px); }
.al-sym { display: flex; align-items: center; gap: 6px; padding: 0 18px 10px; font-size: 14px; border-bottom: 1px solid var(--line); }
.al-sym .wl-coin { width: 18px; height: 18px; }
.al-body { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }
.al-body .al-row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: start; padding: 0; border: 0; cursor: auto; }
.al-body .al-row:hover { background: none; }
.al-lbl { color: var(--text2); padding-top: 7px; }
.al-ctl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.al-ctl select, .al-ctl input[type=text], .al-ctl input[type=number], .al-ctl input[type=datetime-local] { width: 100%; padding: 7px 10px; }
.al-fixed, .al-target { padding: 7px 10px; border: 1px solid #3a3d44; border-radius: 6px; color: var(--text); }
.al-target { color: var(--text2); }
.al-price { display: flex; align-items: center; gap: 8px; }
.al-price span { color: var(--text2); }
.al-exp { flex-direction: row; align-items: center; }
.al-exp .set-chk { white-space: nowrap; }
.al-sep { height: 1px; background: var(--line); margin: 2px 0; }
.al-ask p { padding: 0 18px; color: var(--text2); line-height: 1.5; }
.al-ask .btn-red { padding: 7px 16px; border-radius: 6px; background: var(--red); color: #fff; font-weight: 600; }
/* Всплывающие окна срабатывания */
.al-toasts { position: fixed; right: 64px; bottom: 20px; z-index: 1200; display: flex; flex-direction: column; gap: 8px; }
.al-toast { display: flex; gap: 10px; align-items: flex-start; width: 320px; padding: 12px 12px 12px 14px; background: #1e1f23;
  border: 1px solid #3a3d44; border-left: 3px solid var(--orange); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .6); }
.al-toast .al-tico { color: var(--orange); flex-shrink: 0; margin-top: 1px; }
.al-toast div { flex: 1; min-width: 0; }
.al-toast p { margin: 3px 0; color: var(--text); }
.al-toast small { color: var(--muted); }
.al-toast .x { color: var(--text2); }
/* Оповещение индикатора на графике (alerts.js): будильник у левого края на линии значения */
.al-ibell { position: absolute; left: 8px; width: 18px; height: 18px; pointer-events: none; z-index: 4; }
.al-ibell circle { fill: #f7c600; }
.al-ibell path { fill: none; stroke: #101014; stroke-width: 1.5; stroke-linecap: round; }
/* Значок будильника у фигуры с оповещением */
.draw-layer .dr-bell { pointer-events: none; }
.draw-layer .dr-bell circle { fill: #f7c600; }
.draw-layer .dr-bell path { fill: none; stroke: #101014; stroke-width: 1.5; stroke-linecap: round; }
.draw-layer .dr-bell.hit circle { fill: var(--orange); }
.draw-layer .dr-bell.off circle { fill: #787b86; }
#drTb button.on { color: var(--orange); }
/* Панель «Настройки» справа (фьючерсный): меню ⚙ графика — здесь, по категориям; подменю раскрываются под пунктом */
.rp-set-on .chart-gear { display: none; }
.right.set-on { width: 320px; overflow: hidden; }
.right.set-on > :not(#rpSet) { display: none !important; }
.rp-set { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--panel); }
.rp-set-head { height: 46px; flex-shrink: 0; display: flex; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 600; }
.rp-set .chart-menu { position: static; width: auto; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0 16px;
  background: transparent; border-radius: 0; box-shadow: none; }
.rp-set .cm-section { padding: 14px 14px 6px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.rp-set .cm-row { flex-wrap: wrap; }
.rp-set .cm-row .chev { transition: transform .15s; }
.rp-set .cm-row.open .chev { transform: rotate(90deg); }
.rp-set .cm-sub { position: static; flex-basis: 100%; width: auto; margin: 8px 0 2px 26px; padding: 10px 12px;
  background: rgba(255, 255, 255, .03); box-shadow: none; }
.right.tree-on { width: 320px; overflow: hidden; }
.right.tree-on > :not(#rpTree) { display: none !important; }
.rp-tree { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.rp-tree .obj-tree { position: static; width: auto; max-height: none; flex: 1; min-height: 0; border: none; border-radius: 0; box-shadow: none; background: var(--panel); }
.rp-tree .ot-head { height: 46px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
/* Списки котировок: монета вне разделов сразу после раздела — с разрывом (не кажется монетой раздела) */
.wl-row.wl-gap { border-top: 6px solid var(--bg); }
/* «Стоп-лосс позиции» (вкладка «Трейдинг»): стоп-лосс / трейлинг-стоп к открытой позиции */
.ps .ps-tabs { margin: 8px 0 6px; }
.ps-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.ps-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; background: var(--input); font-size: 11.5px; }
.ps-row span { flex: 1; min-width: 0; color: var(--text2); }
.ps-row .x-btn { color: var(--text2); padding: 1px 6px; border-radius: 4px; background: var(--hover); }
.ps-row .x-btn:hover:not(:disabled) { color: #fff; }

/* ---------- «Горячие клавиши» (фьючерсный, hotkeys.js): окно как в TradingView ---------- */
dialog.hk-dlg { max-width: 780px; height: calc(100% - 80px); }
dialog.hk-dlg[open] { display: flex; flex-direction: column; }
.hk-dlg .dlg-head { padding: 18px 24px 6px; }
.hk-dlg .dlg-head h3 { font-size: 20px; font-weight: 600; }
.hk-intro { margin: 0 24px 14px; color: var(--text2); font-size: 13px; line-height: 1.5; }
.hk-find { position: relative; margin: 0 24px 10px; display: flex; align-items: center; }
.hk-find svg { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.hk-find input { width: 100%; height: 34px; padding: 0 32px 0 34px; border: 1px solid var(--border); background: transparent; }
.hk-find input:focus { border-color: var(--orange); }
.hk-find .x { position: absolute; right: 6px; color: var(--muted); }
.hk-body { flex: 1; overflow-y: auto; padding: 0 12px 8px; }
.hk-sec { border-bottom: 1px solid var(--line); }
.hk-sec-head { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: 6px; text-align: left; }
.hk-sec-head:hover, .hk-sec.open .hk-sec-head { background: var(--hover); }
.hk-sec-head b { flex: 1; font-size: 15px; font-weight: 600; }
.hk-ico { width: 30px; height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--text2); border-radius: 7px; color: var(--text); }
.hk-chev { color: var(--text2); transition: transform .15s; }
.hk-sec.open .hk-chev { transform: rotate(180deg); }
.hk-rows { padding: 6px 0 10px; }
.hk-note { padding: 2px 12px 6px 56px; color: var(--muted); font-size: 12px; }
.hk-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 12px 7px 56px; font-size: 13.5px; }
.hk-row:hover { background: rgba(255, 255, 255, .03); }
.hk-keys { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 0; flex-shrink: 0; max-width: 58%; }
.hk-keys kbd { min-width: 30px; height: 30px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #45484f; border-bottom-width: 2px; border-radius: 6px; background: #1d1f25; font: 600 12.5px Inter, sans-serif; }
.hk-word { color: var(--text2); font-size: 13px; }
.hk-plus { margin: 0 7px; color: var(--muted); font-style: normal; font-size: 12px; }
.hk-or { margin: 0 10px; color: var(--muted); font-size: 12px; }
.hk-empty { padding: 30px; text-align: center; color: var(--muted); }
.hk-foot { margin: 0; padding: 10px 24px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.hb-bot .hk-sim { display: none; }
.hk-sp { width: 8px; }

/* ---------- Раскладка вокруг графика (фьючерсный и бот, layout.js): над графиком — как на Bybit, под ним — плеер
   как «Симулятор рынка» в TradingView и полоса времени; кнопки раскрыть график / нижнюю панель ---------- */
.topbar-fut #status { margin-left: auto; flex-shrink: 0; }
.topbar-fut #status ~ .brand { margin-left: 14px; }
.chart-top { display: flex; align-items: center; gap: 2px; height: 38px; padding: 0 8px; background: var(--panel2); flex-shrink: 0; min-width: 0; overflow: hidden; }
.chart-top > * { flex-shrink: 0; }
.chart-top > .ct-tfs { display: flex; align-items: center; gap: 2px; flex-shrink: 1; min-width: 0; overflow: hidden; }
.ct-tfs button { height: 28px; padding: 0 8px; border-radius: 4px; color: var(--text2); font-size: 13px; font-weight: 500; }
.ct-tfs button:hover { color: #fff; background: var(--hover); }
.ct-tfs button.on { color: var(--orange); font-weight: 600; }
.ct-sep { width: 1px; height: 18px; background: var(--border); margin: 0 8px; flex-shrink: 0; }
.ct-btn { width: 32px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--text2); flex-shrink: 0; }
.ct-btn:hover { color: #fff; background: var(--hover); }
.ct-max:hover, .ct-max.on { color: var(--orange); background: transparent; }
.chart-top > .ct-sim { flex-shrink: 1; min-width: 34px; }
.ct-sim span { overflow: hidden; text-overflow: ellipsis; }
.ct-sim { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 6px; color: var(--text2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.ct-sim:hover { color: #fff; background: var(--hover); }
.ct-sim.on { color: #000; background: var(--orange); }
.ct-sim.on:hover { color: #000; background: #ffb829; }
.ct-state { display: none !important; }
.pbar { display: flex; align-items: center; height: 46px; padding: 0 8px; border-top: 1px solid var(--line); background: var(--panel2); flex-shrink: 0; }
.pb-side { flex: 1 1 0; display: flex; align-items: center; min-width: 0; overflow: hidden; }
.pb-right { justify-content: flex-end; flex-shrink: 0; min-width: 40px; }
.pb-mid { display: flex; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0; }
.pb-btn { height: 32px; display: flex; flex-shrink: 0; align-items: center; gap: 6px; padding: 0 10px; border-radius: 6px; color: var(--text2); font-size: 13px; white-space: nowrap; }
.pb-btn:hover:not(:disabled) { color: #fff; background: var(--hover); }
.pb-start { background: #1e2026; min-width: 0; flex-shrink: 1; }
.pb-start span { overflow: hidden; text-overflow: ellipsis; }
.pb-mid > *:not(.pb-start) { flex-shrink: 0; }
.pb-ico { width: 34px; justify-content: center; padding: 0; font-size: 14px; }
.pbar .play { width: 40px; height: 30px; border-radius: var(--radius); background: var(--orange); color: #000; font-size: 14px; font-weight: 700; }
.pbar .play.running { background: var(--hover); color: var(--text); }
.pbar button:disabled { opacity: .35; cursor: default; }
.pb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 8px; }
.pb-speed { display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.pbar label.tb-check { display: flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; color: var(--text2); margin: 0 4px; }
.pb-live { overflow: hidden; text-overflow: ellipsis; padding-left: 8px; color: var(--red); font-size: 12px; font-weight: 600; cursor: help; white-space: nowrap; }
.pb-x { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text2); }
.pb-x:hover { color: #fff; background: var(--hover); }
body.view-mode #playerBar { display: none; }
/* Фьючерсный: до первого состояния с сервера плеер и нижняя панель не показываются — иначе при запуске на
   полсекунды мелькал интерфейс сессии, а потом открывался просмотр (app.js снимает booting) */
body.booting #playerBar, body.booting .bottom { display: none; }
body.view-mode #tkLiq, body.view-mode #rbar [data-rpanel="trade"] { display: none; }          /* просмотр: счёта нет — «До ликв. осталось» не нужно */
.chart-foot { display: flex; align-items: center; height: 30px; padding: 0 10px; border-top: 1px solid var(--line); background: var(--panel2); flex-shrink: 0; }
.chart-foot .clock { gap: 2px; font-size: 12.5px; font-weight: 500; }
.chart-foot #simTime { cursor: pointer; }
.chart-foot .tz-btn { font-size: 12.5px; padding: 2px 4px; color: var(--text); }
.chart-foot .tz-menu { top: auto; bottom: calc(100% + 6px); }
.tabs-row { display: flex; align-items: center; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.tabs-row .tabs { flex: 1; min-width: 0; border-bottom: none; }
.tabs-max { width: 32px; height: 30px; margin: 0 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--text2); }
.tabs-max:hover, .tabs-max.on { color: var(--orange); }
body.view-mode #btnMaxChart { display: none; }
body.bottom-max:not(.view-mode) .chart-area { display: none; }
body.bottom-max .bottom { flex: 1; height: auto; min-height: 0; }   /* min-height — иначе панель растёт по списку и нет прокрутки */
/* Правая полоса: группы иконок — панели и под линией окна (сессии, журнал, история, горячие клавиши) */
.rb-grp { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rb-grp + .rb-grp { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border); }
.rbar #btnDownload.busy { color: var(--orange); }
.rbar #btnDownload.busy::after { content: ""; position: absolute; right: 5px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
/* Полноэкранный режим (layout.js): только график или только панель позиций и ордеров, как в TradingView */
.tabs-max + .tabs-max { margin-left: -6px; }
body.fs-chart .topbar, body.fs-chart aside.right, body.fs-chart .rbar, body.fs-chart .bottom, body.fs-chart .drawbar,
body.fs-bottom .topbar, body.fs-bottom aside.right, body.fs-bottom .rbar, body.fs-bottom .chart-area { display: none !important; }
body.fs-chart .chart-area { display: flex !important; }
body.fs-bottom .bottom { display: flex !important; flex: 1; height: auto; min-height: 0; }
body.fs-chart #btnMaxChart, body.fs-bottom #btnMaxBottom { display: none; }
#btnFsChart.on, #btnFsBottom.on { color: var(--orange); }
/* «Расположение графиков» (chart2.js): меню как в TradingView и второй график — слева / справа или сверху / снизу */
.ct-layout { position: relative; flex-shrink: 0; }
#btnLayout.on { color: #fff; background: var(--hover); }
.cl-menu { position: fixed; z-index: 60; min-width: 170px; padding: 4px 14px;
  background: #1e2026; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.cl-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.cl-row + .cl-row { border-top: 1px solid var(--border); }
.cl-row i { width: 16px; color: var(--muted); font-style: normal; font-size: 12px; }
.cl-row button { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text2); }
.cl-row button:hover { color: #fff; background: var(--hover); }
.cl-row button.on { color: #000; background: #fff; }
.chart2 { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel2); }
.chart2[hidden] { display: none; }
.chart-col.cl-2h > .chart2 { flex: 1; min-height: 160px; border-top: 1px solid var(--border); }
.chart-col.cl-2v { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto auto auto; }
.chart-col.cl-2v > .chart-top { grid-column: 1 / -1; grid-row: 1; }
.chart-col.cl-2v > .chart-wrap { grid-column: 1; grid-row: 2; }
.chart-col.cl-2v > .rsi-pane { grid-column: 1; grid-row: 3; }
.chart-col.cl-2v > .chart2 { grid-column: 2; grid-row: 2 / 4; border-left: 1px solid var(--border); }
.chart-col.cl-2v > #equityChart { grid-column: 1 / -1; grid-row: 4; }
.chart-col.cl-2v > .pbar { grid-column: 1 / -1; grid-row: 5; }
.chart-col.cl-2v > .chart-foot { grid-column: 1 / -1; grid-row: 6; }
.c2-bar { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; flex-shrink: 0; overflow: hidden; }
.c2-bar b { font-size: 12px; font-weight: 600; color: var(--text2); white-space: nowrap; }
.c2-tfs { display: flex; gap: 1px; min-width: 0; overflow: hidden; }
.c2-tfs button { height: 24px; padding: 0 6px; border-radius: 4px; color: var(--text2); font-size: 12px; font-weight: 500; flex-shrink: 0; }
.c2-tfs button:hover { color: #fff; background: var(--hover); }
.c2-tfs button.on { color: var(--orange); font-weight: 600; }
.c2-note { color: var(--orange); font-size: 12px; white-space: nowrap; }
.c2-chart { flex: 1; min-height: 0; position: relative; }
/* Плашка цены перекрестия (фьючерсный, tradelines.js: xhLabel) — поверх плашек ордеров, позиций и линий на шкале */
.xh-lbl { position: absolute; z-index: 8; height: 18px; padding-left: 7px; border-radius: 2px; background: #2b2f36; color: #fff;
  font: 11px/18px Inter, Arial, sans-serif; pointer-events: none; white-space: nowrap; overflow: hidden; }
.xh-lbl[hidden] { display: none; }
/* Сведения о монете (фьючерсный, coininfo.js): окно по клику на логотип / тикер в шапке */
.ci-click { cursor: pointer; }
#tkSymbol.ci-click:hover { color: var(--orange); }
dialog.ci-dlg { max-width: 720px; max-height: calc(100% - 80px); }
dialog.ci-dlg[open] { display: flex; flex-direction: column; }
.ci-head { display: flex; align-items: center; gap: 12px; }
.ci-head h3 { margin: 0; font-size: 18px; }
.ci-head span { color: var(--muted); font-size: 12px; }
.coin-logo.ci-logo { width: 36px; height: 36px; }
.ci-body { flex: 1; overflow-y: auto; padding: 0 20px 6px; }
.ci-empty { padding: 30px 0; text-align: center; color: var(--muted); }
.ci-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ci-tags i { padding: 3px 8px; border-radius: 4px; background: var(--hover); color: var(--text2); font-size: 11.5px; font-style: normal; }
.ci-sec { padding: 12px 0; border-top: 1px solid var(--line); }
.ci-sec:first-child, .ci-tags + .ci-sec { border-top: none; padding-top: 0; }
.ci-sec h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.ci-sec h4 em { margin-left: 6px; color: var(--muted); font-size: 11.5px; font-weight: 400; font-style: normal; }
.ci-sec p { margin: 0 0 8px; color: var(--text2); font-size: 13px; line-height: 1.55; }
.ci-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 28px; }
.ci-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.ci-row span { color: var(--muted); }
.ci-row b { font-weight: 500; text-align: right; white-space: nowrap; }
.ci-more { padding: 0; color: var(--orange); font-size: 12.5px; }
.ci-more:hover { text-decoration: underline; }
.ci-links { display: flex; flex-wrap: wrap; gap: 8px; }
.ci-links a { padding: 5px 10px; border-radius: 6px; background: var(--hover); color: var(--text); font-size: 12.5px; text-decoration: none; }
.ci-links a:hover { color: var(--orange); }
.ci-foot { margin: 0; padding: 8px 20px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
@media (max-width: 640px) { .ci-grid { grid-template-columns: 1fr; } }
