/* Торговля (7.3, 8). 04.10 owner «Доделай за агентами что они не доедали»: written by hand. Tokens only. */
#t-chart { grid-column: 1 / -1; order: -1; }
.seg-mk { height: 44px; }
.seg-mk .seg-i { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 16px; }
.seg-mk .seg-s { font-size: 11px; opacity: .8; }
.t-tools { display: flex; gap: 8px; margin-top: 8px; }
.t-tools .seg { flex: 0 1 260px; height: 32px; }
.t-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 8px; }
.tv-host { position: relative; height: 300px; }
.tv-wrap, .tv-box { position: absolute; inset: 0; }
.tv-msg { position: absolute; left: 0; right: 0; top: 45%; text-align: center; font-size: var(--fs-small); pointer-events: none; }
.tv-msg:empty { display: none; }
/* the book */
.ob { display: flex; flex-direction: column; font-size: var(--fs-small); line-height: 20px; }
.ob-h { display: flex; justify-content: space-between; font-size: 11px; height: 20px; }
.ob-side { display: flex; flex-direction: column; }
.ob-r { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; height: 20px; align-items: center; padding: 0 4px; }
.ob-bar { position: absolute; top: 1px; bottom: 1px; right: 0; border-radius: 2px; opacity: .16; }
.ob-r[data-side="ask"] .ob-bar { background: var(--down); }
.ob-r[data-side="bid"] .ob-bar { background: var(--up); }
.ob-r[data-side="ask"] .ob-px { color: var(--down); }
.ob-r[data-side="bid"] .ob-px { color: var(--up); }
.ob-px, .ob-q, .ob-s { position: relative; white-space: nowrap; }
/* 05.10: a level holding our order */
.ob-r[data-ours="1"] { box-shadow: inset 3px 0 0 var(--info); background: color-mix(in srgb, var(--info) 10%, transparent); }
.ob-r[data-ours="1"] .ob-px { font-weight: 700; }
.oo-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-top: 10px; }
.oo-l { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.oo-r { display: grid; grid-template-columns: 30px auto minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: var(--fs-small); line-height: var(--lh-small); }
.oo-s { font-weight: 700; }
.oo-s[data-side="sell"] { color: var(--down); }
.oo-s[data-side="buy"] { color: var(--up); }
.oo-q { white-space: nowrap; }
.oo-w { font-size: var(--fs-micro); text-align: right; }
/* 15.10 owner «live feed продаж покупок qtc на safetrade»: the market's tape under the book */
.mt-r { grid-template-columns: 62px auto minmax(0, 1fr); }
.mt-r[data-fresh="1"] { background: color-mix(in srgb, var(--info) 14%, transparent); border-radius: 4px; transition: background .6s; }
.ob-q, .ob-s { text-align: right; }
.ob-mid { height: 24px; display: flex; align-items: center; justify-content: center; font-size: 11px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 2px 0; }
.ob-age { font-size: 11px; margin-top: 4px; }
/* 06.10 owner «Что бы я тут всю актуальную информацию видел»: crumbs the spread bot does not count (under its $15), and its state in words */
.ob-r[data-dust="1"] { opacity: .45; }
.ob-bot { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; font-size: var(--fs-small); line-height: var(--lh-small); min-width: 0; overflow-wrap: anywhere; }
.ob-bot > div:first-child { font-weight: 600; }
@media (min-width: 900px) {
  .t-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .tv-host { height: 470px; }
}
/* 07.10 owner «… бокс с текущими qtc … кнопку продать все по маркету», «тумблер сколько хочу продать типо %»: «Наши QTC» under the chart */
.pos-big { font-size: var(--fs-big); line-height: var(--lh-big); font-weight: 700; }
.pos-l { margin-top: 4px; font-size: var(--fs-small); line-height: var(--lh-small); overflow-wrap: anywhere; }
.pos-l:empty { display: none; }
.pos-l[data-t="up"] { color: var(--up); }
.pos-l[data-t="down"] { color: var(--down); }
.seg-pct { margin: 12px 0 2px; height: 36px; }
.seg-pct[hidden] { display: none; }
.pos-btn { margin-top: 10px; }
.nb-ask[data-t="warn"] { outline: 1px solid var(--down); }
/* 10.10: the settings card */
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.st-l { flex: 1; min-width: 0; }
.st-in { width: 7.5em; text-align: right; }
.st-seg { margin-top: 8px; }
.st-go { margin-top: 12px; }
.st-msg[hidden] { display: none; }
/* (10.10 owner «сделай плиз как то компактно и удобное меню для всего») every bot's settings in the gear's sheet (views/botset.js) */
.bs { display: flex; flex-direction: column; gap: 10px; }
.seg-bs { height: 48px; }
.seg-bs .seg-i { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 16px; padding: 0 2px; }
.seg-bs .seg-l { font-size: 12px; }
.seg-bs .seg-s { font-size: 11px; opacity: .8; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.bs-fields { display: flex; flex-direction: column; }
.bs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); }
.bs-row[hidden] { display: none; }
.bs-row[data-dirty] .bs-l { color: var(--info); }
.bs-row-b .seg { flex: 0 0 13em; height: 34px; }
.bs-l { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: var(--fs-small); line-height: var(--lh-small); }
.bs-rng { font-size: 11px; line-height: 14px; }
.bs-in { width: 6.5em; text-align: right; }
.bs-note { font-size: var(--fs-micro); line-height: var(--lh-micro); }
.bs-act { display: flex; gap: 8px; align-items: stretch; }
.bs-act[hidden], .bs-pin[hidden], .bs-go[hidden] { display: none; }
.bs-pin { width: 6.5em; }
.bs-go { flex: 1; width: auto; }
.bs-msg[hidden] { display: none; }
/* (10.10) the NOCK card */
.pos-big[data-t="up"] { color: var(--up); }
.pos-big[data-t="down"] { color: var(--down); }
.nk-r { display: flex; gap: 10px; align-items: baseline; }
.nk-k { flex: 0 0 3.2em; font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.nk-v { flex: 1; min-width: 0; white-space: pre-wrap; }
.nk-f[hidden] { display: none; }
.nk-w .nk-k { flex-basis: 4.8em; }   /* (13.10) the layer's and the dump card's longer words: «заявки», «кто может» */
/* (10.10 owner «настраивать всех ботов сам … красиво и удобно») a switch, the «Боты» page (views/ctl.js) */
.sw { position: relative; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--surface-3); transition: background .15s; cursor: pointer; }
.sw-k { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px var(--line-2); transition: transform .15s; }
.sw[aria-checked="true"] { background: var(--acc); }
.sw[aria-checked="true"] .sw-k { transform: translateX(18px); }
.ct-top { font-size: var(--fs-small); line-height: var(--lh-small); }
.ct-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
@media (min-width: 760px) { .ct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.card[hidden] { display: none; }
.ct-pill { margin-right: 4px; }
.ct-pill[hidden], .ct-line[hidden], .ct-sub[hidden], .ct-row[hidden] { display: none; }
.card[data-off="1"] .ct-fields, .card[data-off="1"] .ct-line, .card[data-off="1"] .ct-sub { opacity: .55; }
.ct-line { font-size: var(--fs-small); line-height: var(--lh-small); overflow-wrap: anywhere; }
.ct-sub { font-size: var(--fs-micro); line-height: var(--lh-micro); color: var(--ink-3); margin-top: 2px; }
.ct-fields { display: flex; flex-direction: column; margin-top: 8px; }
.ct-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-top: 1px solid var(--line); }
.ct-row[data-dirty="1"] .ct-l > span:first-child { color: var(--info); font-weight: 600; }
.ct-row[data-dirty="1"] .ct-in { border-color: var(--info); }
.ct-l { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: var(--fs-small); line-height: var(--lh-small); }
.ct-rng { font-size: 11px; line-height: 14px; }
.ct-v { display: flex; align-items: center; gap: 6px; flex: none; }
.ct-u { font-size: var(--fs-small); }
.ct-in { width: 6.5em; text-align: right; }
.ct-other .ct-in { width: 5.5em; }
.ct-note { font-size: var(--fs-micro); line-height: var(--lh-micro); margin-top: 8px; }
.ct-bar { position: sticky; bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 8px); z-index: 20; display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-pop); }
@media (min-width: 760px) { .ct-bar { bottom: 16px; } }
.ct-bar[hidden], .ct-ask[hidden], .ct-msg[hidden], .ct-btn[hidden], .ct-save[hidden], .ct-pin[hidden] { display: none; }
.ct-bar-r { display: flex; align-items: center; gap: 10px; }
.ct-bt { flex: 1; min-width: 0; font-weight: 600; font-size: var(--fs-small); }
.ct-btn { height: 42px; padding: 0 14px; border-radius: 12px; background: var(--surface-2); color: var(--ink); font-weight: 600; }
.ct-save { width: auto; flex: none; padding: 10px 20px; }
.ct-ask { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); font-size: var(--fs-small); line-height: var(--lh-small); }
.ct-ab { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ct-pin { width: 7em; }
.ct-msg { font-size: var(--fs-small); line-height: var(--lh-small); overflow-wrap: anywhere; }
.ct-msg[data-t="up"] { color: var(--up); }
.ct-msg[data-t="down"] { color: var(--down); }
/* (10.10 owner «покупать тоже по маркету, там по лимиту») the order ticket on «Торговля» */
.tk-segs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tk-row { margin-top: 10px; }
.tk-row[hidden], .tk-warn[hidden], .tk-pin[hidden] { display: none; }
.tk-in { width: 9em; text-align: right; }
.tk-pxw { display: flex; align-items: center; gap: 6px; }
.tk-pxw .tk-in { width: 7.5em; }
.tk-chip { height: 34px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.tk-warn { color: var(--warn); }
.tk-go { margin-top: 10px; }
.tk-go[data-side="sell"]:not(:disabled) { background: var(--down-bg); color: var(--down); }
.tk-pin { width: 6.5em; }
.tk-or { grid-template-columns: 30px auto minmax(0, 1fr) 32px; align-items: center; }
.tk-x { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 18px; line-height: 1; }
.card-r { display: inline-flex; align-items: center; gap: 8px; }   /* (10.10) a pill and a switch in a card's head, centred */
.ct-last { margin-top: -4px; }
.ct-last[hidden] { display: none; }
.ct-last[data-t="up"] { color: var(--up); }
.ct-last[data-t="down"] { color: var(--down); }
