/* What lives in the plates (from the mock-up v5): book, account gauge, ticket, tables, markets, price ladder. */
/* ---- order book ---- */
.book { flex: 1; min-height: 0; display: flex; flex-direction: column; font-size: var(--fs-s); }
.bk-head, .bk-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); column-gap: 4px; align-items: center; padding: 0 8px; }
.bk-head { min-height: 24px; color: var(--dim); font-size: var(--fs-xs); flex: none; }
.bk-head span { min-width: 0; line-height: 1.15; }   /* a long head goes to a second line, never cut */
.bk-head span:nth-child(n + 2), .bk-row span:nth-child(n + 3) { text-align: right; }
.bk-side { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.bk-side[data-side="a"] { justify-content: flex-end; }
.bk-row { position: relative; height: var(--bk-row, 20px); flex: none; width: 100%; border: 0; background: none; color: var(--mute); text-align: left; cursor: pointer; }
.bk-row .bk-bar { position: absolute; inset: 1px 0; transform-origin: right center; pointer-events: none; }
.bk-row[data-side="a"] .bk-bar { background: var(--down-soft); }
.bk-row[data-side="b"] .bk-bar { background: var(--up-soft); }
.bk-row span { position: relative; }
.bk-row[data-side="a"] .px { color: var(--down); }
.bk-row[data-side="b"] .px { color: var(--up); }
.bk-row[data-deep="true"] { opacity: 0.55; }              /* a level of the 20-level snapshot (up to 25 s old): not live */
.bk-mid { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 10px; min-height: 30px; padding: 5px 10px; border-block: 1px solid var(--hair); flex: none; }
.bk-mid b { font-size: var(--fs-l); font-weight: 600; }
.bk-mid > span { color: var(--dim); font-size: var(--fs-xs); }
.tr-list { flex: 1; min-height: 0; overflow: hidden; }
.tr-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); column-gap: 4px; height: 20px; align-items: center; padding: 0 8px; color: var(--mute); }
.tr-row span:nth-child(n + 2) { text-align: right; }
.tr-row span:last-child { color: var(--dim); }
.empty { margin: auto; padding: 20px 16px; max-width: 34ch; text-align: center; color: var(--mute); font-size: 13px; line-height: 1.5; }
.empty-keys { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
@media (hover: hover) { .bk-row:hover { background: var(--surface-2); color: var(--text); } }

/* ---- account gauge: the limit line, the account, the line to reach ---- */
.gaugep { padding: 14px 14px 12px; gap: 10px; }
.g-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.g-goal { font-size: 15px; font-weight: 700; letter-spacing: -0.005em; }
.g-goal b { font-weight: 600; font-size: 14px; color: var(--up); }
.g-prog { color: var(--dim); font-size: 11px; font-weight: 600; white-space: nowrap; }
.g-eq { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.g-eqv { font-size: 21px; font-weight: 600; }
.g-day { font-size: 11.5px; color: var(--mute); }
.g-track { position: relative; height: 30px; }
.g-rail { position: absolute; left: 0; right: 0; top: 14px; height: 4px; margin-top: -1px; border-radius: 2px;
  background: linear-gradient(to right, var(--down-rail) 0 var(--start, 50%), var(--up-rail) var(--start, 50%) 100%); }   /* the loss side red, the gain side green */
.g-fill { position: absolute; top: 14px; left: var(--from, 0%); width: var(--len, 0%); height: 4px; margin-top: -1px; border-radius: 2px; background: var(--text); }
.g-track[data-tone="up"] .g-fill { background: var(--up); }
.g-track[data-tone="down"] .g-fill { background: var(--down); }
.g-track[data-tone="up"] .g-mark { box-shadow: inset 0 0 0 3px var(--up), 0 0 0 3px var(--surface); }
.g-track[data-tone="down"] .g-mark { box-shadow: inset 0 0 0 3px var(--down), 0 0 0 3px var(--surface); }
.g-limit, .g-goalline { position: absolute; top: 2px; width: 3px; height: 26px; border-radius: 1px; }
.g-limit { left: 0; background: var(--down); }
.g-goalline { right: 0; background: var(--up); box-shadow: 0 0 12px var(--up); }
.g-start { position: absolute; left: var(--at, 0%); top: 9px; width: 1px; height: 12px; background: var(--tick); }
.g-mark { position: absolute; left: var(--at, 0%); top: 8px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--text), 0 0 0 3px var(--surface); transition: left var(--t) var(--ease); }
.g-scale { position: relative; height: 28px; font-size: 10.5px; color: var(--dim); }
.g-scale span { position: absolute; top: 0; display: grid; gap: 1px; white-space: nowrap; }
.g-scale span b { font-weight: 400; color: var(--mute); }
.g-scale .s-r { right: 0; text-align: right; }
.g-scale span:first-child b { color: var(--down); }               /* the limit's figure red, the target's green: the words stay */
.g-scale .s-r b { color: var(--up); }
.g-scale .s-m { left: var(--at, 50%); transform: translateX(-50%); text-align: center; }
.g-rows { margin: 0; display: grid; gap: 7px; padding-top: 10px; border-top: 1px solid var(--hair); }
.g-rows div { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 10px; }
.g-rows dt { color: var(--mute); font-size: 12px; }
.g-rows dd { margin: 0; font-size: 12px; }
.g-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--hair-2); overflow: hidden; }
.g-bar .g-bar-in { display: block; height: 100%; background: var(--silver); transform-origin: left center; transition: transform var(--t) var(--ease); }
.g-bar[data-tone="up"] .g-bar-in { background: var(--up); }
.g-bar[data-tone="down"] .g-bar-in { background: var(--down); }   /* tight: under 30 % left (gauge-lib TIGHT); its figure says how much */

/* ---- order ticket ---- */
.ticketp { padding: 12px 14px 14px; gap: 10px; overflow: hidden; }
.tk-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; margin: 0 -6px; padding: 2px 6px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--hair-3) transparent; }
.tk-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tk-lev { flex: none; margin-left: auto; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair-2); color: var(--silver); }
.tk-lev:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tk-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tk-sides .key { min-height: 38px; background: none; box-shadow: inset 0 0 0 1px var(--hair-2); color: var(--mute); }
.tk-sides .key[aria-pressed="true"][data-side="1"] { background: var(--up-soft); box-shadow: inset 0 0 0 1px var(--up); color: var(--up); }
.tk-sides .key[aria-pressed="true"][data-side="-1"] { background: var(--down-soft); box-shadow: inset 0 0 0 1px var(--down); color: var(--down); }
.tk-l { color: var(--mute); font-size: 12px; font-weight: 600; }
.tk-hint { color: var(--dim); font-size: 11px; }
.tk-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.tk-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.tk-two > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; min-width: 0; }
.tk-two[data-one="1"] { grid-template-columns: minmax(0, 1fr); }
.tk-two .tk-row { min-height: 22px; }
.chip.tk-tog { min-height: 22px; padding: 0 8px; font-size: 11px; }
.chip[aria-pressed="true"] { background: var(--surface-4); box-shadow: inset 0 0 0 1px var(--hair-3); color: var(--text); }
.chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.chips { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.chip { min-height: 28px; border: 0; border-radius: var(--r-sm); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); color: var(--mute); font-size: 11.5px; font-weight: 600; cursor: pointer; transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.chip:active { background: var(--surface-4); }
.tk-check { flex: none; display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); font-size: 12.5px; line-height: 1.45; color: var(--mute); }
.tk-check b { color: var(--text); font-weight: 600; }
.tk-check[data-state="warn"] { background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn); color: var(--text); }
.tk-check[data-state="block"] { box-shadow: inset 0 0 0 1px var(--hair-3); color: var(--text); }
.tk-check .tk-ic { display: flex; gap: 8px; align-items: flex-start; }
.tk-check .i { margin-top: 1px; color: var(--dim); }
.tk-check[data-state="warn"] .i { color: var(--warn); }
.tk-check .key { justify-self: start; }
/* one row a fact: a long figure on one row takes no room from the label of another (a label wraps only on its own row) */
.tk-what { display: grid; gap: 3px; font-size: 11.5px; }
.tk-what > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tk-what dt { min-width: 0; color: var(--dim); }
.tk-what dd { flex: none; margin: 0; text-align: end; color: var(--mute); }
.tk-what .tk-words { font-variant-numeric: tabular-nums; }   /* a sentence is set as text: the number face is for figures alone */
.tk-sum { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 11.5px; }
.tk-sum dt { color: var(--dim); }
.tk-sum dd { margin: 0; color: var(--mute); text-align: right; }
.tk-go { flex: none; min-height: 46px; font-size: 13.5px; margin-top: auto; white-space: normal; line-height: 1.2; padding: 6px 10px; text-align: center; }
.tk-go:disabled { background: var(--surface-3); color: var(--dim); opacity: 1; }
.tk-close { display: none; }
@media (hover: hover) { .chip:hover { color: var(--text); background: var(--surface-3); } }

/* ---- bottom panel ---- */
.bot-body { flex: 1; min-height: 0; overflow: auto; }
/* more rows under the foot: the last line fades out, the sign that the list goes on (B4); none at its end */
.bot-body[data-more="1"] { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-m); }
.tbl th { position: sticky; top: 0; z-index: 1; height: 26px; padding: 0 10px; background: var(--surface); color: var(--dim); font-size: var(--fs-s); font-weight: 600; text-align: right; white-space: nowrap; }
.tbl td { height: 32px; padding: 0 10px; border-top: 1px solid var(--hair); text-align: right; white-space: nowrap; color: var(--mute); }
.tbl th:first-child, .tbl td:first-child { text-align: left; padding-left: 12px; }
.tbl td:first-child { color: var(--text); font-weight: 600; }
.tbl td.acts { padding-right: 10px; }
.tbl .acts > div { display: inline-flex; gap: 6px; }
.tbl .side-l { color: var(--up); font-weight: 600; }
.tbl .side-s { color: var(--down); font-weight: 600; }
.tbl .mini { width: 92px; min-height: 28px; padding: 0 8px; }
.tbl .mini input { height: 26px; font-size: 12px; text-align: right; }
/* a stop loss that can trail: its field and its switch side by side, the row keeps its height */
.tbl td.leg[data-trail] { white-space: nowrap; }
.tbl td.leg[data-trail] .mini { display: inline-flex; vertical-align: middle; }
.tbl td.leg[data-trail] .tag-demo { margin-inline-start: 6px; vertical-align: middle; }
.tag-key[data-trail] { min-width: 16ch; text-align: center; }   /* its live distance never moves the row */
.tag-demo { margin-left: 8px; padding: 2px 6px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--hair-2); color: var(--dim); font-size: 10px; font-weight: 600; }
.tag-key { min-height: 22px; border: 0; background: none; font-family: inherit; cursor: pointer; }
/* switched on: the pressed look of the chips (in a row or in the ticket, red says "refused"; the chart's SL tag stays red) */
.tag-key[aria-pressed="true"] { background: var(--surface-4); box-shadow: inset 0 0 0 1px var(--hair-3); color: var(--text); }
/* a switch says its state by a mark, a ring when off and a full dot when on: under the pointer its two looks were one */
.tag-key[data-trail]::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 5px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; }
.tag-key[data-trail][aria-pressed="true"]::before { background: var(--acc); box-shadow: none; }
.tag-key:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
@media (hover: hover) { .tag-key:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--hair-3); } }
.log { margin: 0; padding: 6px 14px; list-style: none; font-size: 12px; }
.log li { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 6px 0; border-top: 1px solid var(--hair); color: var(--mute); }
.log li:first-child { border-top: 0; }
.log time { color: var(--dim); }
@media (hover: hover) { .tbl tbody tr:hover td { background: var(--surface-2); } }

/* ---- markets ---- */
.marketsp { position: absolute; top: calc(var(--bar-h) + 6px); left: 12px; z-index: 40; width: 440px; max-height: min(600px, calc(100% - 96px)); box-shadow: var(--shadow-pop); background: var(--surface-2); visibility: hidden; opacity: 0; transform: translateY(-4px); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility 0s linear var(--t-fast); }
.term[data-mk="open"] .marketsp { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.mk-head { display: grid; gap: 8px; padding: 10px; border-bottom: 1px solid var(--hair); flex: none; }
.mk-fams { flex-wrap: wrap; gap: 4px; }   /* every family in sight: a second line rather than a tab cut at the edge (B5) */
.mk-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px; }
.mk-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 68px 44px; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 0 8px 0 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--mute); text-align: left; cursor: pointer; font-size: 12px; }
.mk-row[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.mk-row .sym { color: var(--text); font-weight: 600; font-size: 13px; }
.mk-row .sym small { margin-left: 6px; color: var(--dim); font-size: 10.5px; font-weight: 600; }
.mk-row .r { text-align: right; }
.mk-row .lev { color: var(--dim); font-size: 11px; text-align: right; }
.mk-star { display: grid; place-items: center; width: 32px; height: 36px; color: var(--dim); }
.mk-star svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.mk-star[data-on="1"] { color: var(--acc); }
.mk-star[data-on="1"] svg { fill: currentColor; }
@media (hover: hover) { .mk-row:hover { background: var(--surface-3); } }

/* ---- price ladder (computer): sold · bid · price · ask · bought, one row per price step ---- */
.tgrid[data-ladder] { --book-w: max(var(--book-user, 0px), 320px); }   /* the ladder's six columns */
.ld-head, .ld-row { display: grid; grid-template-columns: 30px 1fr 1fr 78px 1fr 1fr; align-items: center; padding: 0 6px; }
.ld-head { min-height: 26px; color: var(--dim); font-size: 11px; flex: none; }
.ld-head span, .ld-row > span { padding: 0 4px; overflow: hidden; white-space: nowrap; text-align: right; }
.ld-head span:nth-child(4), .ld-row .ld-px { text-align: center; }
.ld-head span:nth-child(n + 5), .ld-row > span:nth-child(n + 5) { text-align: left; }
.ld-rows { flex: 1; min-height: 0; overflow: hidden; }
.ld-row { position: relative; height: 20px; width: 100%; border: 0; background: none; color: var(--mute); font: inherit; cursor: pointer; }
.ld-q { position: relative; align-self: stretch; display: flex; align-items: center; justify-content: flex-end; }
.ld-q[data-side="a"] { justify-content: flex-start; }
.ld-q .ld-bar { position: absolute; inset: 1px 0; pointer-events: none; }
.ld-q[data-side="b"] .ld-bar { background: var(--up-soft); transform-origin: right center; }
.ld-q[data-side="a"] .ld-bar { background: var(--down-soft); transform-origin: left center; }
.ld-q span { position: relative; }
.ld-px { border-radius: 3px; line-height: 18px; }
.ld-row[data-last] .ld-px { background: var(--surface-4); color: var(--text); font-weight: 600; }
.ld-row[data-draft] .ld-px { box-shadow: inset 0 0 0 1px var(--acc); color: var(--text); }
/* Past the book levels the mockup carries: the side it cannot know shows a dash, not an empty book. */
.ld-row[data-out] .ld-px { color: var(--dim); }
.ld-row[data-out="b"] .ld-q[data-side="b"]::after, .ld-row[data-out="a"] .ld-q[data-side="a"]::after { content: "–"; color: var(--dim); }
.ld-row .ld-tag { padding: 0; font-size: 9.5px; font-weight: 700; letter-spacing: 0.02em; text-align: left; }
.ld-row[data-mark="sl"] { box-shadow: inset 2px 0 0 var(--down); }
.ld-row[data-mark="sl"] .ld-tag { color: var(--down); }
.ld-row[data-mark="tp"] { box-shadow: inset 2px 0 0 var(--up); }
.ld-row[data-mark="tp"] .ld-tag { color: var(--up); }
.ld-row[data-mark="entry"] { box-shadow: inset 2px 0 0 var(--text); }
.ld-row[data-mark="entry"] .ld-tag { color: var(--text); }
.ld-row[data-mark="buy"], .ld-row[data-mark="sell"] { box-shadow: inset 2px 0 0 var(--acc); }
.ld-row[data-mark="buy"] .ld-tag, .ld-row[data-mark="sell"] .ld-tag { color: var(--acc); }
.ld-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 10px; border-top: 1px solid var(--hair); flex: none; font-size: 11px; }
.ld-keys { display: flex; gap: 6px; }
.ld-foot .key-sm { min-height: 26px; }
.term[data-form="phone"] #bookTabs [data-bk="ladder"] { display: none; }
@media (hover: hover) { .ld-row:hover { background: var(--surface-2); color: var(--text); } }
