/* Терминал: самостоятельная рабочая страница, без каркаса кабинета.
   Панели непрозрачные, фон ровный: это рабочий инструмент, не витрина.
   Зелёный и красный — только для сделок: купить/продать, рост/падение, плюс/минус. */
*, *::before, *::after { box-sizing: border-box; }
html { background: #080B15; }
body.tm {
  --cx-bg: #0D121F; --cx-bg2: #13192A; --cx-bg0: #0A0D18; --cx-line: rgba(255, 255, 255, 0.1);
  --cx-up: #3DB88A; --cx-down: #D9606B; --cx-txt: #F4F4F6; --cx-dim: #9A9AA6;
  --tm-top: 64px;
  margin: 0; height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column;
  background: var(--cx-bg0); color: var(--cx-txt);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
.tm a { color: inherit; text-decoration: none; }
.tm :where(button, input) { font-family: inherit; color: inherit; }
.tm :where(button) { cursor: pointer; text-align: center; }
.tmDrop--pairs input::-webkit-search-cancel-button { display: none; }
.tm button:focus-visible, .tm a:focus-visible, .tm input:focus-visible { outline: 2px solid var(--brand, #FFCB2E); outline-offset: 2px; }
.tm [hidden] { display: none !important; }
.tm ::-webkit-scrollbar { width: 8px; height: 8px; }
.tm ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 4px; }

/* ── верхняя панель ── */
.tmTop {
  flex: none; height: var(--tm-top); display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: var(--cx-bg); border-bottom: 1px solid var(--cx-line); position: relative; z-index: 30;
}
.tmGrow { flex: 1 1 0; min-width: 0; }
.tmLogo { flex: none; display: flex; align-items: center; margin-right: 4px; }
.tmLogo .side__markName { font-size: 19px; line-height: 1; white-space: nowrap; }

.tmSwitch {
  flex: none; display: inline-flex; background: var(--cx-bg2); border: 1px solid var(--cx-line);
  border-radius: 12px; padding: 3px; gap: 2px;
}
.tmSwitch a {
  padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--cx-dim); white-space: nowrap;
}
.tmSwitch a:hover { color: var(--cx-txt); }
.tmSwitch a.is-on { background: var(--brand, #FFCB2E); color: var(--brand-ink, #1A1400); }

/* выпадающие меню */
.tmDd { position: relative; flex: none; }
.tmDrop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; min-width: 190px;
  background: var(--cx-bg2); border: 1px solid var(--cx-line); border-radius: 14px; padding: 6px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
}
.tmDrop button, .tmDrop > a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 10px 12px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--cx-txt);
}
.tmDrop button:hover, .tmDrop > a:hover { background: rgba(255, 255, 255, 0.07); }
.tmDrop button.is-on { color: var(--brand-text, #FFD95C); }
.tmDrop i { font-style: normal; font-family: 'JetBrains Mono', monospace; color: var(--cx-dim); font-size: 12px; }
.tmDrop--bal, .tmDrop--user, .tmDrop--more { left: auto; right: 0; }
.tmDrop__who { padding: 8px 12px 10px; font-size: 12px; color: var(--cx-dim); border-bottom: 1px solid var(--cx-line); margin-bottom: 4px; word-break: break-all; }

.tmChev { width: 11px; height: 8px; color: var(--cx-dim); flex: none; }
.tmPairBtn, .tmTfBtn, .tmIndBtn, .tmUserBtn {
  display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 13px;
  background: var(--cx-bg2); border: 1px solid var(--cx-line); border-radius: 12px; font-weight: 800; font-size: 14px;
}
.tmPairBtn:hover, .tmTfBtn:hover, .tmIndBtn:hover, .tmUserBtn:hover, .tmBalBtn:hover { border-color: rgba(255, 203, 46, 0.5); }
.tmPairBtn__name { white-space: nowrap; }
.tmPairBtn__pct { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--cx-up); font-weight: 700; }
.tmTfBtn { font-family: 'JetBrains Mono', monospace; }

.tmArrows { flex: none; display: flex; gap: 4px; }
.tmArrows button {
  width: 32px; height: 42px; border: 1px solid var(--cx-line); background: var(--cx-bg2); border-radius: 10px;
  display: grid; place-items: center; color: var(--cx-dim);
}
.tmArrows button:hover { color: var(--cx-txt); border-color: rgba(255, 255, 255, 0.25); }
.tmArrows svg { width: 16px; height: 16px; }

.tmDrop--pairs { width: 340px; padding: 10px; }
.tmDrop--pairs input {
  width: 100%; background: var(--cx-bg0); border: 1px solid var(--cx-line); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-weight: 600; margin-bottom: 6px;
}
.tmPairList { max-height: min(420px, 62vh); overflow-y: auto; }
.tmPairList h4 {
  margin: 8px 6px 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet, #9B87FF);
}
.tmPairList b { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--cx-dim); font-weight: 700; }
.tmPairList .cxEmpty { padding: 14px 6px; }
.tmPairTabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 8px; }
.tmDrop .tmPairTabs button { flex: 0 0 auto; width: auto; gap: 4px; justify-content: center; padding: 6px 11px; font-size: 12.5px; font-weight: 700; color: var(--cx-dim); background: transparent; border: 1px solid var(--cx-line); border-radius: 999px; transition: background .15s, color .15s, border-color .15s; }
.tmDrop .tmPairTabs button:hover { color: var(--cx-txt); border-color: rgba(255, 255, 255, 0.22); }
.tmDrop .tmPairTabs button.is-on { background: rgba(255, 203, 46, 0.14); border-color: rgba(255, 203, 46, 0.55); color: var(--brand, #FFCB2E); }
.tmRow { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 4px; margin-bottom: 2px; border-radius: 10px; border-left: 3px solid transparent; cursor: pointer; font-weight: 700; font-size: 13.5px; transition: background .12s; }
.tmRow__n small { display: block; margin-top: 1px; font-size: 11px; font-weight: 600; color: var(--cx-dim); }
.tmRow__n span { overflow: hidden; text-overflow: ellipsis; }
.tmPairList .tmRow__p { flex: 0 0 auto; min-width: 46px; text-align: center; padding: 3px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); }
.tmPairList .tmRow__p.is-hi { background: rgba(46, 204, 113, 0.14); color: #4ADE80; }
.tmRow:hover { background: rgba(255, 255, 255, 0.07); }
.tmRow.is-on { color: var(--brand-text, #FFD95C); background: rgba(255, 203, 46, 0.08); border-left-color: var(--brand, #FFCB2E); }
.tmRow__n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmDrop .tmRow .tmStar, .tmStar {
  flex: none; width: 28px; height: 30px; padding: 0; border: 0; background: transparent; color: rgba(255, 255, 255, 0.22);
  font-size: 15px; display: grid; place-items: center; justify-content: center; border-radius: 8px;
}
.tmDrop .tmRow .tmStar:hover { background: rgba(255, 255, 255, 0.08); color: var(--cx-txt); }
.tmDrop .tmRow .tmStar.is-on, .tmStar.is-on { color: var(--brand, #FFCB2E); }
.tmDrop--tf { min-width: 220px; }

.cxTf { display: flex; gap: 2px; background: var(--cx-bg2); border: 1px solid var(--cx-line); border-radius: 12px; padding: 3px; flex: none; }
.cxTf button {
  border: 0; background: transparent; color: var(--cx-dim); font-weight: 700; font-size: 12.5px;
  font-family: 'JetBrains Mono', monospace; padding: 7px 9px; border-radius: 9px;
}
.cxTf button:hover { color: var(--cx-txt); }
.cxTf button.is-on { background: rgba(255, 203, 46, 0.16); color: var(--brand-text, #FFD95C); }

.tmClock { flex: none; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 15px; color: var(--cx-dim); padding: 0 6px; letter-spacing: 0.02em; }

.tmBalBtn {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px; text-align: right;
  height: 42px; padding: 0 14px; border: 1px solid rgba(255, 203, 46, 0.4); background: var(--cx-bg2); border-radius: 12px;
}
.tmBalBtn__lbl { font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-text, #FFD95C); font-weight: 800; line-height: 1; }
.tmBalBtn__val { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 14.5px; line-height: 1.1; white-space: nowrap; }
.tmDrop--bal { min-width: 270px; }
.tmDrop--bal button { color: var(--cx-txt); }
.tmBalBtn.is-real { border-color: var(--brand, #FFCB2E); box-shadow: 0 0 0 1px rgba(255, 203, 46, 0.35); }
.tmDrop .tmAcc { justify-content: flex-start; gap: 12px; padding: 11px 12px; }
.tmAcc__chk { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--cx-line); display: grid; place-items: center; font-size: 12px; color: #1A1400; }
.tmAcc.is-on .tmAcc__chk { background: var(--brand, #FFCB2E); border-color: var(--brand, #FFCB2E); }
.tmAcc__t { display: flex; flex-direction: column; gap: 2px; }
.tmAcc__t b { font-size: 14px; }
.tmAcc__t small { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--cx-dim); font-weight: 600; }
.tmDrop .tmAcc__dep {
  justify-content: center; margin-top: 6px; height: 44px; border-radius: 12px; font-weight: 800; font-size: 14.5px;
  background: var(--brand-btn, #FFCB2E); color: var(--brand-ink, #1A1400);
}
.tmDrop .tmAcc__dep:hover { filter: brightness(1.06); background: var(--brand-btn, #FFCB2E); }
.tmDrop [data-reset] { color: var(--cx-dim); font-size: 13px; margin-top: 2px; }

.tmIndBtn svg { width: 18px; height: 18px; color: var(--brand, #FFCB2E); }
.cxBadge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center;
  background: var(--violet, #9B87FF); color: #120E2A; font-size: 12px; font-weight: 800;
}
.tmUserBtn { padding: 0 11px 0 5px; }
.tmUserBtn__ava {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, #FFCB2E, #F5BC14); color: var(--brand-ink, #1A1400); font-weight: 800; font-size: 14px;
}
.tmUserBtn__name { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmMore { display: none; }
.tmMoreBtn { width: 42px; height: 42px; border: 1px solid var(--cx-line); background: var(--cx-bg2); border-radius: 12px; display: grid; place-items: center; }
.tmMoreBtn svg { width: 22px; height: 22px; }
.tmSwitch--wide { display: flex; margin: 2px 2px 6px; }
.tmSwitch--wide a { flex: 1; text-align: center; padding: 9px; }
.tmDrop--more > a, .tmDrop--more > button { justify-content: flex-start; }

/* ── рабочая область ── */
.tmBody { flex: 1 1 auto; min-height: 0; display: flex; gap: 8px; padding: 8px; }

.tmTools, .tmRail, .cxSide, .tmPanel, .cxChartBox { background: var(--cx-bg); border: 1px solid var(--cx-line); border-radius: 16px; }

.tmTools { flex: none; width: 48px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; }
.tmTools button, .tmRail button { position: relative; }
.tmTools button {
  width: 36px; height: 36px; border: 0; background: transparent; color: var(--cx-dim); border-radius: 10px; display: grid; place-items: center;
}
.tmTools button svg { width: 20px; height: 20px; }
.tmTools button:hover { background: rgba(255, 255, 255, 0.07); color: var(--cx-txt); }
.tmTools button.is-on { background: rgba(255, 203, 46, 0.16); color: var(--brand, #FFCB2E); }
.tmTools__sep { width: 24px; height: 1px; background: var(--cx-line); margin: 4px 0; }
.tmTools button.has-fly { width: 40px; padding-right: 4px; }
.tmTools__car { position: absolute; right: 0; top: 0; bottom: 0; width: 12px; display: block; border-radius: 0 10px 10px 0; }
.tmTools__car::after { content: ''; position: absolute; right: 2px; bottom: 5px; border: 3px solid transparent; border-right-color: currentColor; border-bottom-color: currentColor; opacity: 0.7; }
.tmTools__car:hover { background: rgba(255, 255, 255, 0.1); }
.tmMag__dot { position: absolute; right: 5px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: transparent; border: 1.5px solid var(--cx-dim); }
.tmMag[data-mag="weak"] .tmMag__dot { background: var(--violet, #9B87FF); border-color: var(--violet, #9B87FF); }
.tmMag[data-mag="strong"] .tmMag__dot { background: var(--brand, #FFCB2E); border-color: var(--brand, #FFCB2E); }
.cxChart.is-draw canvas { cursor: crosshair !important; }
/* В режиме рисования палец рисует, а не листает страницу. */
.cxChart.is-draw, .cxChart.is-draw * { touch-action: none; }
.cxChart.is-hit canvas { cursor: pointer !important; }

/* редактор выбранного рисунка */
.tmDrEd {
  position: absolute; z-index: 8; display: flex; align-items: center; gap: 5px; padding: 6px 8px;
  background: #0D121F; border: 1px solid var(--cx-line); border-radius: 14px; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
}
.tmDrEd__c { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; background: var(--c); padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); }
.tmDrEd__c.is-on { border-color: #0D121F; outline: 2px solid var(--c); }
.tmDrEd__sep { width: 1px; height: 20px; background: var(--cx-line); margin: 0 3px; }
.tmDrEd__w { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; display: grid; place-items: center; padding: 0; }
.tmDrEd__w i { display: block; width: 16px; background: var(--cx-dim); border-radius: 2px; }
.tmDrEd__w:hover { background: rgba(255, 255, 255, 0.08); }
.tmDrEd__w.is-on { background: rgba(255, 203, 46, 0.16); }
.tmDrEd__w.is-on i { background: var(--brand, #FFCB2E); }
.tmDrEd__t { border: 0; background: var(--cx-bg2); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.tmDrEd__t:hover { background: rgba(255, 255, 255, 0.12); }
.tmDrEd__t--del { color: var(--cx-down); }

/* всплывающие окна: время, сумма, ластик, меню инструментов */
.tmPop {
  position: fixed; z-index: 120; background: #0D121F; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7); padding: 12px; color: var(--cx-txt);
}
.tmPop--time { width: 290px; }
.tmPop--amt { width: 270px; }
.tmPop button { border: 1px solid var(--cx-line); background: var(--cx-bg2); border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--cx-txt); }
.tmPop button:hover { border-color: rgba(255, 255, 255, 0.3); }
.tmPop button.is-on { background: var(--brand, #FFCB2E); color: var(--brand-ink, #1A1400); border-color: transparent; }
.tmPop__info { margin: 10px 2px 0; font-size: 12px; color: var(--cx-dim); font-weight: 600; }
.tmPop__info.is-bad { color: var(--cx-down); }
.tmPop__ok { width: 100%; height: 42px; margin-top: 10px; background: var(--brand-btn, #FFCB2E) !important; color: var(--brand-ink, #1A1400) !important; border-color: transparent !important; font-weight: 800 !important; }
.tmSeg { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: var(--cx-bg2); border-radius: 11px; padding: 3px; margin-bottom: 12px; }
.tmPop .tmSeg button { border: 0; background: transparent; padding: 8px 4px; font-size: 12.5px; color: var(--cx-dim); }
.tmPop .tmSeg button.is-on { background: var(--brand, #FFCB2E); color: var(--brand-ink, #1A1400); }
.tmHms { display: flex; align-items: center; justify-content: center; gap: 6px; }
.tmHms__c { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.tmHms__c button { width: 64px; height: 32px; font-size: 18px; line-height: 1; padding: 0; }
.tmHms__c b { font-family: 'JetBrains Mono', monospace; font-size: 26px; font-weight: 700; line-height: 1.2; }
.tmHms__c small { font-size: 10.5px; color: var(--cx-dim); font-weight: 600; }
.tmHms__sep { font-family: 'JetBrains Mono', monospace; font-size: 24px; color: var(--cx-dim); margin-top: -18px; }
.tmChips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 12px; }
.tmChips button { padding: 8px 0; font-size: 12.5px; }
.tmChips--ops { grid-template-columns: repeat(4, 1fr); margin-top: 0; }
.tmChips--sums { grid-template-columns: repeat(5, 1fr); }
.tmCalc__disp { display: flex; align-items: baseline; gap: 6px; padding: 8px 12px 10px; margin-bottom: 8px; background: var(--cx-bg0); border: 1px solid var(--cx-line); border-radius: 11px; }
.tmCalc__disp span { color: var(--brand-text, #FFD95C); font-weight: 800; font-size: 18px; }
.tmCalc__disp b { font-family: 'JetBrains Mono', monospace; font-size: 26px; font-weight: 700; }
.tmKeys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 8px; }
.tmKeys button { height: 42px; font-size: 18px; font-family: 'JetBrains Mono', monospace; }

.tmFly { padding: 6px; min-width: 220px; }
.tmFly__t { padding: 6px 10px 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet, #9B87FF); }
.tmPop.tmFly button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: transparent; font-size: 13.5px; }
.tmPop.tmFly button:hover { background: rgba(255, 255, 255, 0.07); }
.tmPop.tmFly button.is-on { background: rgba(255, 203, 46, 0.16); color: var(--brand-text, #FFD95C); }
.tmFly svg { width: 20px; height: 20px; flex: none; }
.tmErase { width: 280px; }
.tmErase p { margin: 2px 2px 12px; font-size: 14px; font-weight: 700; line-height: 1.4; }
.tmErase__b { display: flex; gap: 8px; }
.tmErase__b .tmBtn { height: 40px; font-size: 13.5px; }
.tmPop .tmErase__all { width: 100%; margin-top: 8px; border: 0; background: transparent; color: var(--cx-down); font-size: 12.5px; padding: 8px; }

/* таймер свечи, значок закрытия, тост */
/* Таймер свечи: серая метка ТФ над линией цены, отсчёт — под ней. Без плашки. */
.cxTimer {
  position: absolute; z-index: 5; pointer-events: none; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1;
  font-family: 'JetBrains Mono', monospace; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  /* Без transition: место считается в кадре отрисовки графика — метка стоит у свечи, а не догоняет её. */
}
.cxTimer i { font-style: normal; font-size: 10px; font-weight: 700; color: #8E8E99; letter-spacing: 0.02em; }
.cxTimer b { font-size: 13px; font-weight: 700; color: #F4F4F6; font-variant-numeric: tabular-nums; }
body[data-chart-light="1"] .cxTimer { text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8); }
body[data-chart-light="1"] .cxTimer i { color: #6A6A74; }
body[data-chart-light="1"] .cxTimer b { color: #111626; }
.cxCloseBadge {
  position: absolute; z-index: 5; right: 84px; top: 52px; pointer-events: none;
  background: rgba(13, 18, 31, 0.94); border: 1px solid var(--brand-line, rgba(255, 203, 46, 0.42)); border-radius: 10px;
  padding: 6px 12px; font-size: 12px; font-weight: 700; color: var(--cx-dim);
}
.cxCloseBadge b { font-family: 'JetBrains Mono', monospace; color: var(--brand-text, #FFD95C); margin-left: 4px; }
.tmToast {
  position: absolute; z-index: 9; left: 50%; top: 14px; transform: translateX(-50%); max-width: min(520px, 90%);
  background: #161D30; border: 1px solid var(--cx-line); border-left: 3px solid var(--violet, #9B87FF); border-radius: 12px;
  padding: 11px 16px; font-size: 13.5px; font-weight: 700; line-height: 1.4; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
}
.tmToast--err { border-left-color: var(--cx-down); }
.tmToast--warn { border-left-color: var(--brand, #FFCB2E); }
/* подсказки у кнопок рельсов */
[data-tip]::after {
  content: attr(data-tip); position: absolute; z-index: 70; top: 50%; transform: translateY(-50%); white-space: nowrap;
  background: #1D263E; color: var(--cx-txt); border: 1px solid var(--cx-line); border-radius: 8px; padding: 6px 10px;
  font-size: 12px; font-weight: 700; pointer-events: none; opacity: 0; transition: opacity 0.12s;
}
.tmTools [data-tip]::after { left: calc(100% + 10px); }
.tmRail [data-tip]::after { right: calc(100% + 10px); }
[data-tip]:hover::after { opacity: 1; transition-delay: 0.35s; }

.tmChartCol { flex: 1 1 0; min-width: 0; display: flex; }
.cxChartBox { position: relative; overflow: hidden; padding: 0; min-width: 0; flex: 1; }
.cxChart { position: absolute; inset: 0; transition: opacity 0.2s ease, filter 0.2s ease; }
/* своё фото фона: слой под холстами графика */
.cxBg { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; }
.cxBg.is-on { opacity: 1; }
.cxBg::after { content: ''; position: absolute; inset: 0; background: rgba(6, 8, 17, var(--cx-bg-dim, 0.45)); }
/* смена пары/ТФ: старый график приглушаем, яркость возвращает transition у .cxChart */
.cxChartBox.is-switching .cxChart { opacity: 0.55; filter: saturate(0.6); }
/* поток встал: график приглушён и подписан, чтобы застывшее не выглядело живым */
.cxChartBox.is-stale .cxChart { filter: saturate(0.35); opacity: 0.8; }
.cxChartBox.is-stale .cxTimer { opacity: 0.4; }
.cxStale {
  position: absolute; left: 50%; top: 38px; transform: translateX(-50%); z-index: 6; pointer-events: none;
  background: #1D263E; border: 1px solid rgba(244, 117, 111, 0.55); color: var(--cx-txt, #fff); padding: 6px 12px; border-radius: 9px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis;
}
.cxStale[hidden] { display: none; }
.mcCell.is-stale .mcCell__chart { filter: saturate(0.35); opacity: 0.8; }
.cxChartBox.is-slow::after {
  content: ''; position: absolute; z-index: 6; right: 74px; top: 12px; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 203, 46, 0.25); border-top-color: #FFCB2E; animation: tmSpin 0.8s linear infinite;
}
body[data-chart-light="1"] .cxLegend { color: #55555F; }
body[data-chart-light="1"] .cxLegend b { color: #111626; }
.cxOverlay { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; }
.cxLegend {
  position: absolute; left: 14px; top: 10px; z-index: 4; pointer-events: none;
  font-size: 12px; font-weight: 700; color: var(--cx-dim); display: flex; gap: 10px; flex-wrap: wrap; max-width: calc(100% - 90px);
}
.cxLegend b { color: var(--cx-txt); }
.cxLegend i { font-style: normal; font-family: 'JetBrains Mono', monospace; }
.cxState {
  position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; text-align: center;
  background: var(--cx-bg); color: var(--cx-dim); font-weight: 600; padding: 20px;
}
.tmHint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 7; pointer-events: none;
  background: #1D263E; border: 1px solid var(--brand-line, rgba(255, 203, 46, 0.42)); color: var(--cx-txt);
  padding: 7px 14px; border-radius: 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
}

/* ── выезжающая панель ── */
.tmPanel { flex: none; width: 320px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.tmPanel__head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.tmPanel__title { margin: 0; font-family: var(--f-display, 'Unbounded', sans-serif); font-size: 14px; font-weight: 600; }
.tmPanel__x { border: 0; background: var(--cx-bg2); width: 30px; height: 30px; border-radius: 9px; font-size: 20px; line-height: 1; color: var(--cx-dim); }
.tmPanel__x:hover { color: var(--cx-txt); }
.tmPanel__mtabs { display: none; }
.tmPane { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 12px 12px; }

.cxTabs { display: flex; gap: 6px; margin-bottom: 10px; }
.cxTabs button {
  border: 0; background: var(--cx-bg2); color: var(--cx-dim); font-weight: 700; font-size: 13px;
  padding: 7px 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px;
}
.cxTabs button.is-on { background: var(--brand, #FFCB2E); color: var(--brand-ink, #1A1400); }
.cxTabs b { font-size: 11.5px; background: rgba(0, 0, 0, 0.25); border-radius: 8px; padding: 1px 7px; }

.cxList { display: flex; flex-direction: column; gap: 6px; }
.cxEmpty { color: var(--cx-dim); font-size: 13.5px; padding: 18px 6px; text-align: center; }
.cxRow {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  background: var(--cx-bg2); border-radius: 12px; padding: 9px 10px; font-size: 13px;
}
.cxRow__dir { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.cxRow__dir svg { width: 15px; height: 15px; }
.cxRow__dir--buy { background: rgba(85, 223, 160, 0.16); color: var(--cx-up); }
.cxRow__dir--sell { background: rgba(244, 117, 111, 0.16); color: var(--cx-down); }
.cxRow__pair { font-weight: 700; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cxRow small { color: var(--cx-dim); font-weight: 600; font-size: 11.5px; }
.cxRow__pair span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cxRow__r { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-family: 'JetBrains Mono', monospace; }
.cxRow__pl { font-weight: 800; }
.cxRow__time { font-weight: 700; color: var(--brand-text, #FFD95C); font-size: 12px; }
.cxUp { color: var(--cx-up); }
.cxDown { color: var(--cx-down); }

/* календарь */
.tmCal__day { margin: 10px 2px 6px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--violet, #9B87FF); }
.tmCal__day:first-child { margin-top: 2px; }
.tmEv { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--cx-bg2); border-radius: 12px; padding: 9px 10px; margin-bottom: 5px; }
.tmEv.is-past { opacity: 0.5; }
.tmEv__t { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 12.5px; color: var(--cx-txt); }
.tmEv__main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tmEv__ttl { font-weight: 700; font-size: 13px; line-height: 1.25; }
.tmEv__sub { font-size: 11.5px; color: var(--cx-dim); font-weight: 600; }
.tmEv__cur { color: var(--brand-text, #FFD95C); font-weight: 800; }
.tmImp { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.tmImp i { width: 4px; border-radius: 1px; background: rgba(255, 255, 255, 0.16); }
.tmImp i:nth-child(1) { height: 5px; } .tmImp i:nth-child(2) { height: 9px; } .tmImp i:nth-child(3) { height: 14px; }
.tmImp[data-n="1"] i:nth-child(-n+1), .tmImp[data-n="2"] i:nth-child(-n+2), .tmImp[data-n="3"] i { background: var(--brand, #FFCB2E); }

.tmCta { display: flex; flex-direction: column; gap: 14px; padding: 6px 2px; }
.tmCta p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--cx-dim); }
.tmCta__btn {
  display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 13px; font-weight: 800; font-size: 15px;
  background: var(--brand-btn, #FFCB2E); color: var(--brand-ink, #1A1400);
}

/* ── правая панель сделки ── */
.cxSide { flex: none; width: 300px; padding: 16px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.cxField { display: flex; flex-direction: column; gap: 7px; }
.cxField__lbl { font-size: 12px; font-weight: 700; color: var(--cx-dim); }
.cxNoSess {
  background: rgba(255, 203, 46, 0.1); border: 1px solid var(--brand-line, rgba(255, 203, 46, 0.42)); border-radius: 12px;
  padding: 11px 12px; display: flex; flex-direction: column; gap: 9px;
}
.cxNoSess p { margin: 0; font-size: 12.5px; font-weight: 700; line-height: 1.4; color: var(--brand-text, #FFD95C); }
.cxNoSess button { height: 36px; border: 0; border-radius: 10px; background: var(--brand-btn, #FFCB2E); color: var(--brand-ink, #1A1400); font-weight: 800; font-size: 13px; }
.cxTime {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 50px; padding: 0 14px;
  background: var(--cx-bg2); border: 1px solid var(--cx-line); border-radius: 12px; font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 20px;
}
.cxTime:hover, .cxAmt:hover { border-color: rgba(255, 255, 255, 0.28); }
.cxTime svg { width: 20px; height: 20px; color: var(--brand, #FFCB2E); flex: none; }
.cxTime__tag { margin-left: auto; font-style: normal; font-family: 'Manrope', sans-serif; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--violet, #9B87FF); }
.cxAmt { display: flex; align-items: center; background: var(--cx-bg2); border: 1px solid var(--cx-line); border-radius: 12px; padding: 0 4px; }
.cxAmt__val {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 48px; border: 0; background: transparent;
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 20px; padding: 0 6px; text-align: left;
}
.cxAmt__cur { color: var(--brand-text, #FFD95C); font-weight: 800; font-size: 18px; }
.cxAmt__step { flex: none; width: 36px; height: 36px; border: 0; border-radius: 9px; background: rgba(255, 255, 255, 0.06); font-size: 20px; font-weight: 700; line-height: 1; color: var(--cx-txt); }
.cxAmt__step:hover { background: rgba(255, 255, 255, 0.12); }
.cxErr { color: var(--cx-down); font-size: 12.5px; font-weight: 600; }
.cxPay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cxPay div { background: var(--cx-bg2); border-radius: 12px; padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; }
.cxPay span { font-size: 11.5px; color: var(--cx-dim); font-weight: 700; }
.cxPay b { font-family: 'JetBrains Mono', monospace; font-size: 17px; }
.cxBtns { display: flex; flex-direction: column; gap: 10px; }
.cxTrade {
  display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; width: 100%;
  font-weight: 800; font-size: 17px; padding: 17px 12px; border-radius: 14px; color: #07140E; position: relative;
  transition: transform 0.12s, filter 0.12s;
}
.cxTrade svg { width: 22px; height: 22px; }
.cxTrade:hover { filter: brightness(1.08); }
.cxTrade:active { transform: scale(0.98); }
.cxTrade:disabled { opacity: 0.45; cursor: not-allowed; filter: none; transform: none; }
.cxTrade--buy { background: #3DB88A; }
.cxTrade--sell { background: #D9606B; color: #1A0706; }
.cxNote { margin: auto 0 0; font-size: 11.5px; line-height: 1.5; color: var(--cx-dim); }
.cxNote--real { color: var(--brand-text, #FFD95C); }
.cxTrade.is-busy { opacity: 0.6; cursor: progress; }

/* ── правый рельс ── */
.tmRail { flex: none; width: 56px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; }
.tmRail button {
  width: 46px; padding: 7px 0 5px; border: 0; background: transparent; color: var(--cx-dim); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tmRail button svg { width: 21px; height: 21px; }
.tmRail button span { font-size: 9.5px; font-weight: 700; letter-spacing: 0; }
.tmRail button:hover { background: rgba(255, 255, 255, 0.07); color: var(--cx-txt); }
.tmRail button.is-on { background: rgba(255, 203, 46, 0.16); color: var(--brand, #FFCB2E); }
.tmRail__n {
  position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--violet, #9B87FF); color: #120E2A; font-size: 10px; font-weight: 800; display: grid; place-items: center;
}
.tmRail [data-tip]::after { display: none; }

/* ── окна ── */
.cxModal { position: fixed; inset: 0; z-index: 140; display: grid; place-items: center; padding: 16px; }
.cxModal__back { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); }
.cxModal__card {
  position: relative; width: min(460px, 100%); max-height: min(640px, 90vh); display: flex; flex-direction: column;
  background: #0D121F; border: 1px solid var(--cx-line); border-radius: 20px; padding: 20px 20px 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8); color: var(--cx-txt);
}
.cxModal__card--sm { width: min(380px, 100%); padding-bottom: 20px; }
.cxModal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cxModal__head h2 { margin: 0; font-family: var(--f-display, 'Unbounded', sans-serif); font-size: 17px; font-weight: 600; }
.cxModal__x { border: 0; background: #13192A; color: var(--cx-txt); width: 34px; height: 34px; border-radius: 10px; font-size: 22px; line-height: 1; }
.cxModal__body { overflow-y: auto; padding-right: 2px; }
.cxGroup { margin: 12px 0 6px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet, #9B87FF); }
.cxInd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  background: #13192A; border: 1px solid transparent; border-radius: 14px; padding: 12px 14px; margin-bottom: 6px;
  color: var(--cx-txt); text-align: left;
}
.cxInd:hover { border-color: rgba(255, 255, 255, 0.18); }
.cxInd__name { font-weight: 700; font-size: 14.5px; display: flex; flex-direction: column; gap: 2px; }
.cxInd__name small { color: var(--cx-dim); font-weight: 600; font-size: 12px; }
.cxSw { flex: none; width: 42px; height: 24px; border-radius: 12px; background: #3A3A42; position: relative; transition: background 0.15s; }
.cxSw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.cxInd[aria-pressed="true"] .cxSw { background: var(--brand, #FFCB2E); }
.cxInd[aria-pressed="true"] .cxSw::after { transform: translateX(18px); background: #1A1400; }
.tmConfirm__txt { margin: 0 0 18px; color: var(--cx-dim); font-size: 14px; line-height: 1.55; }
.tmConfirm__btns { display: flex; gap: 10px; }
.tmBtn { flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--cx-line); background: var(--cx-bg2); font-weight: 800; font-size: 14px; }
.tmBtn:hover { border-color: rgba(255, 255, 255, 0.3); }
.tmBtn--danger { background: var(--brand, #FFCB2E); color: var(--brand-ink, #1A1400); border-color: transparent; }

/* ── средние экраны ── */
@media (max-width: 1199px) {
  .tmTfQuick { display: none; }
}
@media (max-width: 1499px) {
  .tmClock { display: none; }
}
@media (max-width: 1299px) {
  .tmIndBtn__t { display: none; }
  .tmIndBtn { padding: 0 11px; }
}
@media (max-width: 1099px) {
  .tmArrows, .tmUserBtn__name, .tmUserBtn .tmChev { display: none; }
  .tmUserBtn { padding: 0 5px; }
  .tmSwitch a { padding: 7px 10px; }
  .cxSide { width: 264px; padding: 12px; }
}

/* ── мобильная вёрстка ── */
@media (max-width: 899px) {
  body.tm { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
  html { overflow-x: hidden; }
  .tmTop { position: sticky; top: 0; height: 56px; padding: 0 10px; gap: 6px; }
  .tmLogo { margin-right: 0; }
  .tmLogo .side__markName { font-size: 14px; }
  .tmSwitch:not(.tmSwitch--wide), .tmArrows, .tmClock, .tmIndBtn, .tmUser, .tmTfQuick, .tmGrow { display: none; }
  .tmMore { display: block; }
  .tmPairBtn, .tmTfBtn { height: 40px; min-width: 40px; padding: 0 9px; gap: 6px; font-size: 13px; }
  .tmPairBtn__pct, .tmPairBtn .tmChev, .tmTfBtn .tmChev, .tmCur { display: none; }
  .tmPair { flex: 1 1 auto; min-width: 0; }
  .tmPairBtn { max-width: 100%; }
  .tmPairBtn__name { overflow: hidden; text-overflow: ellipsis; }
  .tmGrow { display: none !important; }
  .tmBal, .tmTf, .tmMore { flex: none; }
  .tmBalBtn { height: 40px; padding: 0 9px; }
  .tmBalBtn__lbl { font-size: 8.5px; }
  .tmBalBtn__val { font-size: 12.5px; }
  .tmMoreBtn { width: 40px; height: 40px; }
  .tmDrop--pairs { position: fixed; left: 10px; right: 10px; top: 64px; width: auto; }
  .tmDrop--tf { position: fixed; left: auto; right: 10px; top: 64px; max-height: calc(100vh - 80px); overflow-y: auto; }
  .tmPair { position: static; }
  .tmDrop--bal { right: -8px; }

  .tmBody { display: flex; flex-direction: column; padding: 8px 8px 0; gap: 8px; min-height: calc(100vh - 56px); min-height: calc(100dvh - 56px); }
  .tmTools, .tmRail { display: none; }
  .tmChartCol { flex: 1 1 auto; min-height: 330px; max-height: 70dvh; }

  .cxSide {
    position: sticky; bottom: 0; z-index: 20; width: auto; margin: 0 -8px; border-radius: 16px 16px 0 0; border-bottom: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); gap: 8px; overflow: visible;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.55);
  }
  .cxField--exp { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 10px; }
  .cxField--exp .cxField__lbl { flex: none; }
  .cxField--exp .cxTime { flex: 1; height: 42px; font-size: 17px; }
  .cxField--amt { grid-column: 1; }
  .cxField--amt > .cxField__lbl { display: none; }
  .cxAmt__val { font-size: 17px; height: 40px; }
  .cxNoSess { grid-column: 1 / -1; }
  .cxCloseBadge { right: 70px; top: 36px; }
  .tmPop--time, .tmPop--amt { width: min(310px, calc(100vw - 16px)); }
  .cxPay { grid-column: 2; grid-template-columns: 1fr 1fr; gap: 6px; align-self: stretch; }
  .cxPay div { padding: 6px 8px; justify-content: center; }
  .cxPay b { font-size: 13.5px; }
  .cxBtns { grid-column: 1 / -1; flex-direction: row; gap: 8px; }
  .cxTrade { padding: 13px 8px; font-size: 16px; }
  .cxAmt__step { min-width: 40px; min-height: 40px; }
  #cxLogin { min-height: 40px; }
  .tmLogo { min-height: 40px; display: inline-flex; align-items: center; }
  .cxNote { display: none; }
  .cxErr { grid-column: 1 / -1; }
  .cxLegend i { display: none; }
  .tmHint { white-space: normal; text-align: center; width: max-content; max-width: 90%; }
}

/* Плашка о работах на телефоне — сверху: внизу закреплены «Купить» / «Продать». */
@media (max-width: 899px) {
  body .pbNotice { top: max(10px, env(safe-area-inset-top, 0px)); bottom: auto; }
}
.cxRow--go { cursor: pointer; }
