/* =============================================================================
   Bracket terminal layout: the desk strip, the rail, the right-hand pane, the gate card.
   Colours, radii and type are decided in ui.css, which loads after this file.
   (DESIGN.md describes the look.)
   ========================================================================== */


/* ---------------------------------------------------------------- base */
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 13px; -webkit-font-smoothing: antialiased; }
::selection { background: color-mix(in srgb, var(--buy) 32%, transparent); color: var(--ink); }
:focus-visible { outline: 1px solid var(--buy); outline-offset: 1px; }
* { scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 6px; border: 2px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }
a { color: var(--buy); }

/* numbers everywhere: monospace and tabular, so columns never drift */
.num, .tk-p, .tk-c, .px, .chg, .r, .lv-row b, .dk-r .v, .dk-r .d,
.dp-p, .dp-q, .dp-o, .dp-m-row b, #ch-ltp, #ch-chg, .tq-px b, .tq-px span,
.tl, .v, .pnl, .qty, .ltp, .avg, .stat b, .metric b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* ---------------------------------------------------------------- ticker */
#tickbar {
  background: var(--shell);
  border-bottom: 1px solid var(--rule);
}
#tickbar .tk { padding: 0 14px; gap: 7px; border-right: 1px solid var(--rule); }
#tickbar .tk-s { font-size: 9px; letter-spacing: .14em; color: var(--faint); }
#tickbar .tk-p { font-size: 11.5px; font-weight: 600; color: var(--ink); }
#tickbar .tk-c { font-size: 9.5px; }
#tickbar .tk-c.up { color: var(--up); }
#tickbar .tk-c.dn { color: var(--dn); }
#tickbar .tk-clock { font-family: var(--mono); font-size: 9.5px; color: var(--faint); border-left: 1px solid var(--rule); }
#tickbar #top-right { gap: 6px; padding-right: 8px; }
#tickbar #top-right .iconbtn { color: var(--slate); }
#tickbar #top-right .iconbtn:hover { color: var(--ink); background: var(--field); }
#feed { font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); gap: 5px; }
#feed-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dn); }
#feed.on #feed-dot, #feed[data-on="1"] #feed-dot { background: var(--up); }
#feed-txt { color: var(--faint); }
.avatar-i { width: 22px; height: 22px; background: var(--field); color: var(--ink); border: 1px solid var(--rule-strong); font-size: 9px; font-weight: 600; }

/* ---------------------------------------------------------------- rail */
#tabs { background: var(--shell); border-right: 1px solid var(--rule); }
#tabs .rail-brand { border-bottom: 1px solid var(--rule); }
#tabs button {
  color: var(--faint); font-family: var(--sans); font-size: 8.5px; letter-spacing: .12em;
  border: 0; border-radius: 0; position: relative; transition: background .12s ease-out, color .12s ease-out;
}
#tabs button svg { stroke-width: 1.6; }
#tabs button:hover { background: var(--hover); color: var(--ink); }
#tabs button.on { background: var(--buy-wash); color: var(--ink); box-shadow: none; border-left: 0; }
#tabs button.on::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px;
  background: var(--buy); border-radius: 0 2px 2px 0;
}

/* ---------------------------------------------------------------- page chrome */
#top { background: var(--shell); border-bottom: 1px solid var(--rule); }
#top-title { font-size: 11px; letter-spacing: .18em; color: var(--faint); font-weight: 600; }
#top-quote .tq-id b { font-size: 13px; letter-spacing: -.01em; }
#top-quote .tq-id span { font-size: 9.5px; color: var(--faint); }
#top-quote .tq-px b { font-size: 14px; }
#top-quote .tq-px span { font-size: 10px; }

.view { background: var(--paper); }
.view h1, .view .h1 { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--slate); }

/* ---------------------------------------------------------------- lists */
#watch .row, #results .row, .list .row {
  min-height: 42px; padding: 6px 6px; border-bottom: 1px solid var(--rule);
  border-radius: 0; background: transparent; transition: background .12s ease-out;
}
#watch .row:hover, #results .row:hover, .list .row:hover { background: var(--field); }
#watch .row.open { background: var(--field); }
#watch .row .nm-t { font-size: 13px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); }
#watch .row .kind, #watch .row .role {
  font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint);
  border: 1px solid var(--rule); border-radius: 2px; padding: 0 4px;
}
#watch .row .sub { font-size: 10px; color: var(--faint); margin-top: 1px; }
#watch .row .px, #results .row .px { font-size: 13px; font-weight: 500; }
#watch .row .chg, #results .row .chg { font-size: 10px; }
#watch .row .chg.up, .r.up { color: var(--up); }
#watch .row .chg.dn, .r.dn { color: var(--dn); }

#watch .group-h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
  padding: 14px 4px 7px; border: 0; border-bottom: 1px solid var(--rule-strong); background: transparent;
}
#watch .group-h .sub { font-size: 9.5px; letter-spacing: .02em; text-transform: none; color: var(--faint); }
#watch .row-actions { padding: 6px 4px 10px; gap: 6px; background: var(--field); border-bottom: 1px solid var(--rule); }

/* ---------------------------------------------------------------- controls */
.btn {
  height: 28px; padding: 0 12px; border-radius: 2px; border: 1px solid var(--rule-strong);
  background: var(--field); color: var(--ink); font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--panel-2, var(--shell)); border-color: var(--slate); }
.btn.buy { background: var(--buy); border-color: var(--buy); color: #fff; }
.btn.buy:hover { filter: brightness(1.08); }
.btn.sell { background: var(--sell); border-color: var(--sell); color: #16120a; }
.btn.sell:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--slate); }
.btn.ghost:hover { color: var(--ink); border-color: var(--slate); }
.iconbtn { color: var(--slate); border-radius: 2px; }
.iconbtn:hover { color: var(--ink); background: var(--field); }

.seg { background: var(--shell); border: 1px solid var(--rule); border-radius: 2px; padding: 2px; gap: 1px; }
.seg button {
  border: 0; border-radius: 1px; background: transparent; color: var(--slate);
  font-size: 10.5px; font-weight: 500; letter-spacing: .02em; padding: 4px 9px; transition: background .12s, color .12s;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--field); color: var(--ink); box-shadow: inset 0 -1px 0 var(--buy); }
.seg.lv-idx { border: 0; background: transparent; padding: 0; }
.seg.lv-idx button { border: 1px solid var(--rule); border-radius: 2px; padding: 5px 12px; letter-spacing: .06em; }
.seg.lv-idx button.on { background: var(--buy); border-color: var(--buy); color: #fff; box-shadow: none; }

input[type="search"], input[type="text"], input[type="number"], textarea, select {
  background: var(--shell); border: 1px solid var(--rule); border-radius: 2px; color: var(--ink);
  font-family: var(--mono); font-size: 12px; padding: 7px 9px;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus { border-color: var(--buy); outline: 0; }
.search { background: var(--shell); border: 1px solid var(--rule); border-radius: 2px; }
.search:focus-within { border-color: var(--buy); }
.search input { border: 0; background: transparent; }

/* ---------------------------------------------------------------- desk strip */
#ch-desk { background: var(--shell); border-bottom: 1px solid var(--rule); }
#ch-desk .dk { border-right: 1px solid var(--rule); padding: 6px 12px 8px; }
#ch-desk .dk-h { font-size: 8.5px; letter-spacing: .16em; color: var(--faint); padding-bottom: 5px; }
#ch-desk .dk-h span:last-child { color: var(--slate); }
#ch-desk .dk-r { font-size: 10.5px; line-height: 1.6; }
#ch-desk .dk-r .k { color: var(--faint); }
#ch-desk .dk-r .v { color: var(--ink); font-weight: 500; }
#ch-desk .dk-r .d { color: var(--faint); }
#ch-desk .dk-r .d.up { color: var(--up); } #ch-desk .dk-r .d.dn { color: var(--dn); }

/* ---------------------------------------------------------------- levels */
.lv-sec {
  background: var(--shell); border: 1px solid var(--rule); border-radius: 3px;
  padding: 11px 13px 12px; margin: 0 0 10px;
}
.lv-h, .lv-sec .lv-h {
  font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
  padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}
.lv-row { min-height: 30px; border-top: 1px solid var(--rule); font-size: 11.5px; }
.lv-row:first-of-type { border-top: 0; }
.lv-row .k, .lv-row span:first-child { color: var(--slate); }
.lv-m { color: var(--faint); font-size: 11px; }
.lv-tabs button { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.lv-tabs button.on { color: var(--ink); box-shadow: inset 0 -1px 0 var(--buy); }

/* ---------------------------------------------------------------- chart chrome */
#ch-head { background: var(--shell); border-bottom: 1px solid var(--rule); }
#ch-sym { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
#ch-sub { font-size: 9.5px; color: var(--faint); letter-spacing: .02em; }
#ch-ltp { font-size: 17px; font-weight: 600; }
#ch-chg { font-size: 10.5px; }
#ch-tools { background: var(--shell); border-bottom: 1px solid var(--rule); }
#ch-legend { font-family: var(--mono); font-size: 9.5px; color: var(--faint); background: var(--shell); border-bottom: 1px solid var(--rule); }
#ch-legend b { color: var(--ink); font-weight: 500; }
.su-btn { border: 1px solid var(--rule); border-radius: 2px; background: transparent; color: var(--slate); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }
.su-btn:hover { color: var(--ink); border-color: var(--rule-strong); }

/* ---------------------------------------------------------------- depth + flow */
#ch-depth { background: var(--shell); border: 1px solid var(--rule-strong); border-radius: 3px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .65); }
#ch-depth .dp-h { border-bottom: 1px solid var(--rule); font-size: 8.5px; letter-spacing: .18em; }
#ch-depth .dp-r { height: 19px; font-size: 10.5px; }
#ch-depth .dp-r .dp-q { font-family: var(--mono); }
#ch-depth .dp-spread { border-color: var(--rule); font-family: var(--mono); }
#ch-depth .dp-an { border-top: 1px solid var(--rule); }
#ch-depth .dp-m-row { font-size: 10px; line-height: 1.75; }
#ch-flow { background: var(--shell); border: 1px solid var(--rule); border-radius: 2px; font-family: var(--mono); font-size: 9.5px; }
#ch-flow .fl-k { letter-spacing: .16em; }
#ch-flow button { border: 1px solid var(--rule); color: var(--faint); background: transparent; }
#ch-flow button:hover { color: var(--ink); border-color: var(--buy); }

/* ---------------------------------------------------------------- misc surfaces */
.empty, .lv-m, .muted { color: var(--faint); }
.note, .card, .panel { background: var(--shell); border: 1px solid var(--rule); border-radius: 3px; }
table { border-collapse: collapse; }
th { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 500; text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--rule-strong); }
td { font-size: 11.5px; padding: 7px 8px; border-bottom: 1px solid var(--rule); color: var(--slate); }
td.num { color: var(--ink); }
.badge { font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--rule-strong); border-radius: 2px; padding: 1px 5px; color: var(--faint); }
.badge.on { color: var(--up); border-color: var(--up); }

/* ---------------------------------------------------------------- phone */
@media (max-width: 899px) {
  #tickbar .tk { padding: 0 11px; gap: 6px; }
  #tickbar .tk-s { font-size: 8.5px; }
  #tickbar .tk-p { font-size: 11px; }
  #tabs { background: var(--shell); }
  #tabs button { font-size: 8px; letter-spacing: .04em; }
  #tabs button.on::before { top: 8px; bottom: 8px; }
  #watch .row { min-height: 46px; }
  .btn { height: 30px; }
}

/* ---------------------------------------------------------------- polish pass */
/* the search is a field, not a band */
.searchbar { max-width: 620px; }
.searchbar .search { height: 36px; }
.searchbar input { font-size: 12px; }

/* the index switch belongs on the tab row, not floating above it */
@media (min-width: 900px) {
  #lv { position: relative; }
  #lv > .lv-idx { position: absolute; right: 18px; top: 4px; width: auto; z-index: 3; margin: 0; padding: 0; border: 0; background: transparent; }
  #lv > .lv-idx button { padding: 4px 10px; font-size: 9.5px; }
}

/* verdict blocks: tinted, never a bright island */
.lv-verdict {
  background: var(--field); border: 1px solid var(--rule); border-radius: 2px;
  color: var(--ink); padding: 10px 12px; font-size: 12px; line-height: 1.5;
}
.lv-verdict b, .lv-verdict strong { color: var(--up); font-weight: 600; }
.lv-verdict .dn, .lv-verdict.dn b { color: var(--dn); }
.lv-verdict small, .lv-verdict .sub { color: var(--faint); }

/* the level row that is "you are here" reads as selection, not a button */
.lv-row.sel, .lv-row.on { background: var(--wash); }

/* tighter desk strip so the four cards never fight */
#ch-desk .dk { padding: 6px 12px 7px; }
#ch-desk .dk-r { line-height: 1.55; }

/* chart axis + crosshair belong to the palette */
#chart { background: var(--paper); }
/* the index switch: compact, in flow, above the tabs */
#lv .lv-idx, #lv > .lv-idx {
  position: static; float: none; width: auto; display: inline-flex; margin: 0 0 10px; padding: 0;
  background: transparent; border: 0; z-index: auto;
}
#lv .lv-idx button { padding: 4px 10px; font-size: 9.5px; letter-spacing: .06em; }

/* ---------------------------------------------------------------- phone fixes */
@media (max-width: 899px) {
  /* the page title bar is redundant: the bottom bar already shows the active tab */
  #top { display: none; }
  /* the chart keeps its own head on a phone: symbol, price, search */
  #ch-head { display: flex; }
  /* the desk cards take the full width so values are not truncated */
  #ch-desk .dk, #ch-desk .dk.wide { flex: 0 0 calc(100vw - 14px); }
  #ch-desk .dk-2 { grid-template-columns: 1fr 1fr; column-gap: 12px; }
  #ch-desk .dk-r { font-size: 9.5px; }
  #ch-desk .dk-r .k { min-width: 28px; }
  #ch-desk .dk-r .d { min-width: 34px; }
  /* the last list row was sitting under the bottom bar */
  #watch, #pos-list, #ord-list { padding-bottom: 18px; }
}
@media (max-width: 899px) {
  #ch-head { display: flex !important; height: 44px; min-height: 44px; align-items: center; padding: 0 10px; }
  #ch-head .ch-search { display: none; }
  #ch-sym { font-size: 14px; }
  #ch-ltp { font-size: 15px; }
}

/* the header band is gone: nothing fixed may keep the old 44px offset */
@media (min-width: 1000px) {
  #tabs { top: var(--tick-h); height: calc(100vh - var(--tick-h)); }
  #ctx { top: var(--tick-h); }
  #tabs .rail-brand { height: 64px; margin-bottom: 2px; border-bottom: 1px solid var(--rule); }
  #tabs .rail-brand .mk { width: 26px; height: 26px; }
}
@media (max-width: 899px) {
  #lv .lv-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #lv .lv-tabs::-webkit-scrollbar { display: none; }
  #lv .lv-tabs button { flex: 0 0 auto; }
}

/* ---------------------------------------------------------------- right rail: levels */
#ctx { background: var(--shell); border-left: 1px solid var(--rule); }
#ctx .ctx-k { font-size: 8.5px; letter-spacing: .2em; }
#ctx .ctx-quote { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 8px; padding: 10px 12px 9px; border-bottom: 1px solid var(--rule); }
#ctx .ctx-quote b { font-size: 11px; letter-spacing: .1em; color: var(--slate); font-weight: 600; }
#ctx .ctx-quote .cv { font-family: var(--mono); font-size: 10px; text-align: right; }
#ctx .ctx-quote .cp { grid-column: 1 / -1; font-family: var(--mono); font-size: 19px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
#ctx .ctx-lv { padding: 6px 0; }
#ctx .ctx-lv-r { display: grid; grid-template-columns: 1fr auto 62px; align-items: center; gap: 8px; height: 27px; padding: 0 12px; border-bottom: 1px solid color-mix(in srgb, var(--rule) 55%, transparent); }
#ctx .ctx-lv-r:last-child { border-bottom: 0; }
#ctx .ctx-lv-r .lk { font-size: 10.5px; color: var(--slate); }
#ctx .ctx-lv-r .lp { font-family: var(--mono); font-size: 12px; color: var(--ink); text-align: right; }
#ctx .ctx-lv-r .ld { font-family: var(--mono); font-size: 9.5px; text-align: right; color: var(--faint); }
#ctx .ctx-lv-r.spot { background: var(--wash); }
#ctx .ctx-lv-r.spot .lk { color: var(--ink); font-weight: 600; letter-spacing: .04em; }
#ctx .ctx-lv-r.spot .lp { color: var(--buy); font-weight: 600; }
#ctx .ctx-lv-r.spot .ld { color: var(--faint); }
#ctx .ctx-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 8px; padding: 7px 12px; border-top: 1px solid var(--rule); font-size: 9px; color: var(--faint); letter-spacing: .04em; }
#ctx .ctx-foot b { font-family: var(--mono); font-weight: 500; }
@media (min-width: 1400px) { #ctx { width: 300px; } }

/* ---- the list views were shrinking to fit inside the grid, not filling it ---- */
.view { width: 100%; }
#v-watch, #v-orders, #v-pos, #v-stats { max-width: none; }

@media (min-width: 2300px) {
  #v-watch { max-width: 2200px; margin-left: auto; margin-right: auto; }
}

/* the fourth card label was wider than its column */
#ch-desk .dk-r { grid-template-columns: 46px minmax(0, 1fr) 42px; }

@media (max-width: 899px) {
  /* touch: nothing under 32px tall */
  #ch-tools button, #ch-tools .su-btn { min-height: 34px; }
  #lv .lv-idx button { min-height: 32px; padding: 5px 12px; }
  #ch-flow button { min-height: 26px; padding: 3px 9px; font-size: 9px; }
  .seg button { min-height: 32px; }
  /* the desk cards snap, so the row reads as a carousel */
  #ch-desk { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  #ch-desk .dk { scroll-snap-align: start; }
  #ch-desk .dk + .dk { border-left: 1px solid var(--rule); }
}
/* the signal card carries a sentence, not a number: let it wrap instead of clipping */
#ch-desk .dk:last-child .dk-r { white-space: normal; align-items: start; }
#ch-desk .dk:last-child .dk-r .v { overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.35; }
@media (max-width: 899px) {
  /* the timeframe row was cut at 30m with 1h, 1D and 1W unreachable */
  #ch-tools { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  #ch-tools::-webkit-scrollbar { display: none; }
  #ch-tools > * { flex: 0 0 auto; }
  #ch-tools .seg { overflow: visible; }
}
@media (max-width: 899px) {
  /* the auto header now carries the future and its basis: stack it instead of squeezing */
  #watch .group-h.auto-h { flex-direction: column; align-items: flex-start; gap: 2px; }
  #watch .group-h.auto-h .sub { white-space: normal; text-align: left; }
}
#ch-depth .dp-ev { border-top: 1px solid var(--rule); padding: 6px 10px 7px; font-size: 9.5px; color: var(--slate);
  font-family: var(--mono); line-height: 1.5; }

/* pre-trade gate card */
#ch-gate { position: absolute; right: 12px; top: 46px; width: 322px; z-index: 40; background: var(--shell);
  border: 1px solid var(--rule-strong); border-radius: 3px; box-shadow: 0 18px 44px -20px rgba(0,0,0,.7); }
#ch-gate .gt-h { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
#ch-gate .gt-h > span:first-child { font-size: 8.5px; letter-spacing: .2em; color: var(--faint); }
#ch-gate .gt-sym { font-size: 10px; color: var(--slate); flex: 1; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ch-gate .gt-ov { font-size: 9px; letter-spacing: .12em; padding: 1px 6px; border: 1px solid var(--rule-strong); border-radius: 2px; }
#ch-gate .gt-ov.ok { color: var(--up); border-color: var(--up); }
#ch-gate .gt-ov.warn { color: var(--warn); border-color: var(--warn); }
#ch-gate .gt-ov.block { color: var(--dn); border-color: var(--dn); }
#ch-gate .gt-h button { background: transparent; border: 0; color: var(--faint); cursor: pointer; font-size: 13px; padding: 0 2px; }
#ch-gate .gt-body { padding: 4px 0; }
#ch-gate .gt-row { display: grid; grid-template-columns: 8px 64px 1fr; gap: 8px; align-items: baseline; padding: 6px 10px; border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); }
#ch-gate .gt-row:last-child { border-bottom: 0; }
#ch-gate .gt-row i { width: 7px; height: 7px; border-radius: 50%; transform: translateY(-1px); }
#ch-gate .gt-row b { font-size: 9px; letter-spacing: .1em; color: var(--slate); font-weight: 600; text-transform: uppercase; }
#ch-gate .gt-row span { font-size: 10.5px; color: var(--ink); line-height: 1.35; }
#ch-gate .gt-m { padding: 14px 10px; font-size: 11px; color: var(--faint); }

/* ---------------------------------------------------------------- 320 px pass */
@media (max-width: 899px) {
  /* the flow read sits above the buy and sell bar instead of under it */
  #ch-flow { bottom: 96px; }
  /* the desk cards start on the page gutter, not at x=0 */
  #ch-desk { padding-left: var(--gx); padding-right: var(--gx); }
  #ch-desk .dk, #ch-desk .dk.wide { flex-basis: calc(100vw - 2 * var(--gx)); }
  /* the timeframe row fits instead of being cut at 1W */
  #ch-iv { width: 100%; }
  #ch-iv button { flex: 1 1 0; min-width: 0; padding: 0 2px; font-size: 10px; }
}

@media (max-width: 380px) {
  .grid2 { gap: 8px; }
  /* nav labels get breathing room */
  #tabs button { font-size: 9px; letter-spacing: 0; }
  /* search copy fits the field */
  .search input, .searchbar input { font-size: 12px; }
  /* the chart tools row wraps instead of hiding overlay, depth and gate */
  #ch-tools { flex-wrap: wrap; overflow: visible; row-gap: 4px; }
  #ch-tools > * { flex: 0 0 auto; }
  /* every levels tab fits */
  #lv .lv-tabs { padding-left: 6px; padding-right: 6px; }
  #lv .lv-tabs button { font-size: 9px; letter-spacing: .02em; padding: 0 7px; }
  /* the forward-test table keeps its label column readable */
  .st-t .lvt-r { grid-template-columns: minmax(52px, 1fr) 32px 28px 42px 36px; column-gap: 6px; font-size: 10px; }
  .st-t .lvt-h { font-size: 8.5px; }
  /* two 22 px numbers do not fit side by side */
  .pm-open { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .pm-gift b, .pm-imp b { font-size: 21px; }
  /* the market note tiles: a long OI line was running to six lines */
  .nt-tiles .pm-tile { padding: 8px 9px; }
  .nt-tiles .pm-tile b { font-size: 12px; line-height: 1.35; }
  .nt-tiles .pm-tile small { font-size: 9.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  /* the desk rows drop the distance column so the price stops ellipsising */
  #ch-desk .dk-r { grid-template-columns: 34px minmax(0, 1fr); }
  #ch-desk .dk-r .d { display: none; }
  /* the market pill collapses to its dot, so the ticker keeps a cell and a half */
  #tickbar #feed { font-size: 0; gap: 0; }
}
