/* Dark trading workspace: black canvas, thin grey module borders, blue = buy, red = sell. */
:root {
  --bg: #000000;
  --panel: #000000;
  --panel-2: #0c0c0c;
  --head: #161616;
  --border: #2a2a2a;
  --border-strong: #3d3d3d;
  --text: #f2f2f2;
  --text-2: #a6a6a6;
  --text-3: #707070;
  --blue: #4c8dff;
  --buy: #1561e0;
  --buy-hi: #2b78f7;
  --sell: #d42a37;
  --sell-hi: #ea4250;
  --up: #1fb574;
  --down: #f04a55;
  --amber: #f0a020;
  --field: #111111;
  --hover: #171717;
  --select: #0f2444;
  --left-w: 330px;
  --right-w: 340px;
  --ticket-w: 300px;            /* each extra trade ticket column */
  --chart-min: 320px;           /* the chart is never narrower (extra tickets are hidden first, splitters stop) */
  --bottom-h: 250px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font: 12px/1.35 var(--font);
  -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.spacer { flex: 1 1 auto; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--text-2); }
.blue { color: var(--blue); }

#app { display: flex; flex-direction: column; height: 100vh; min-width: 900px; }

/* ---------- top bar ---------- */
#topbar { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 12px; border-bottom: 1px solid var(--border);
  flex: 0 0 auto; }
.brand { font-size: 15px; letter-spacing: .1px; white-space: nowrap; }
.brand b { font-weight: 700; }
.ws-tabs { display: flex; align-self: stretch; margin-left: 10px; }
.ws-tabs button { background: none; border: 0; border-left: 1px solid var(--border); padding: 0 18px; color: var(--text-3);
  font-weight: 600; font-size: 13px; }
.ws-tabs button:last-child { border-right: 1px solid var(--border); }
.ws-tabs button:hover { color: var(--text-2); }
.ws-tabs button.active { color: var(--text); box-shadow: inset 0 2px 0 var(--text); background: var(--panel-2); }
.search { position: relative; display: flex; align-items: center; width: 230px; }
.search svg { position: absolute; left: 8px; width: 13px; height: 13px; fill: none; stroke: var(--text-2); stroke-width: 1.6; }
.search input { width: 100%; height: 26px; padding: 0 8px 0 26px; background: var(--field); border: 1px solid var(--border);
  border-radius: 4px; outline: none; }
.search input:focus { border-color: var(--blue); }
.menu { position: absolute; top: 30px; left: 0; width: 340px; max-height: 420px; overflow: auto; background: #101010;
  border: 1px solid var(--border-strong); border-radius: 4px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.8); }
.menu .item { display: flex; gap: 10px; padding: 6px 10px; cursor: pointer; align-items: baseline; }
.menu .item:hover, .menu .item.active { background: var(--select); }
.menu .item b { min-width: 72px; }
.menu .item span { color: var(--text-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu .item em { color: var(--text-3); font-style: normal; font-size: 11px; }
.switch { display: flex; align-items: center; gap: 7px; color: var(--text-2); cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { display: none; }
.switch .track { width: 28px; height: 15px; border-radius: 8px; background: #333; position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%;
  background: #bbb; transition: left .15s, background .15s; }
.switch input:checked + .track { background: var(--buy); }
.switch input:checked + .track::after { left: 15px; background: #fff; }
.badge { padding: 3px 9px; border-radius: 3px; font-weight: 700; font-size: 11px; letter-spacing: .4px; white-space: nowrap;
  border: 1px solid var(--border-strong); color: var(--text-2); }
.badge.demo { color: #111; background: var(--amber); border-color: var(--amber); }
.badge.live { color: #04130c; background: var(--up); border-color: var(--up); }
.badge.down { color: #fff; background: var(--sell); border-color: var(--sell); }
#clock { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
#conn { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
#conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--down); }
#conn.ok i { background: var(--up); }

#notice { flex: 0 0 auto; padding: 5px 12px; background: #3a2408; color: #ffd9a0; border-bottom: 1px solid #5a3a10;
  text-align: center; font-size: 12px; }
#notice.error { background: #3d0f14; color: #ffc7cc; border-color: #6b1c24; }

/* ---------- workspaces and modules ---------- */
.workspace { flex: 1 1 auto; min-height: 0; display: flex; padding: 4px; gap: 0; }
#col-left { flex: 0 0 var(--left-w); width: var(--left-w); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#col-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
#row-top { flex: 1 1 auto; display: flex; min-height: 0;
  overflow-x: auto; overflow-y: hidden; }   /* scrolls only in a window too narrow for the chart's minimum and the right column */
#col-right { flex: 0 0 var(--right-w); width: var(--right-w); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#mod-blotter { flex: 0 0 var(--bottom-h); height: var(--bottom-h); }
.module { display: flex; flex-direction: column; border: 1px solid var(--border); background: var(--panel); min-width: 0; min-height: 0;
  border-radius: 2px; }
.module.grow { flex: 1 1 0; }
#mod-account, #mod-ticket { flex: 0 0 auto; }
.mod-head { display: flex; align-items: center; gap: 10px; min-height: 28px; padding: 0 8px; background: var(--head);
  border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.mod-title { font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.mod-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.mod-body { flex: 1 1 auto; min-height: 0; position: relative; }
.mod-body.scroll { overflow: auto; }
.tag { font-size: 10.5px; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--border-strong); color: var(--text-2);
  letter-spacing: .3px; }
.splitter { flex: 0 0 4px; background: transparent; z-index: 5; }
.splitter.v { cursor: col-resize; }
.splitter.h { cursor: row-resize; }
.splitter:hover, .splitter.drag { background: #2f4f86; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2c2c2c; border-radius: 5px; border: 2px solid #000; }
::-webkit-scrollbar-thumb:hover { background: #444; }
::-webkit-scrollbar-corner { background: #000; }

/* ---------- small controls ---------- */
input.mini { height: 22px; width: 110px; padding: 0 7px; background: var(--field); border: 1px solid var(--border); border-radius: 3px;
  outline: none; }
input.mini:focus { border-color: var(--blue); }
.btn { height: 24px; padding: 0 10px; background: #1b1b1b; border: 1px solid var(--border-strong); border-radius: 3px; color: var(--text);
  white-space: nowrap; }
.btn:hover { background: #262626; border-color: #5a5a5a; }
.btn.small { height: 20px; padding: 0 7px; font-size: 11px; }
.btn.primary { background: var(--buy); border-color: var(--buy); font-weight: 600; }
.btn.primary:hover { background: var(--buy-hi); }
.btn.danger { background: var(--sell); border-color: var(--sell); font-weight: 600; }
.btn.danger:hover { background: var(--sell-hi); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 4px; overflow: hidden; margin-left: auto; }
.seg button { background: transparent; border: 0; padding: 2px 9px; color: var(--text-2); font-size: 11.5px; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button:hover { color: var(--text); }
.seg button.active { background: #2a2a2a; color: var(--text); font-weight: 600; }
.chips { display: flex; gap: 4px; padding: 5px 8px; flex-wrap: wrap; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.chips.inline { border: 0; padding: 0; margin-left: 14px; }
.chips button { background: transparent; border: 1px solid var(--border); color: var(--text-2); border-radius: 11px; padding: 1px 7px;
  font-size: 10.5px; }
#wl-classes { gap: 3px; }
.chips button:hover { color: var(--text); border-color: var(--border-strong); }
.chips button.active { background: var(--text); color: #000; border-color: var(--text); font-weight: 600; }
.tabs { display: flex; align-self: stretch; margin-left: -8px; }
.tabs button { background: transparent; border: 0; border-right: 1px solid var(--border); padding: 0 14px; color: var(--text-3);
  font-weight: 700; font-size: 12.5px; }
.tabs button:hover { color: var(--text-2); }
.tabs button.active { color: var(--text); background: var(--panel); box-shadow: inset 0 2px 0 var(--text); }
.count { color: var(--text-2); font-weight: 600; }

/* ---------- account summary ---------- */
#account-body { padding: 2px 0; }
.kv { display: flex; justify-content: space-between; padding: 4px 10px; border-bottom: 1px solid #141414; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--text-2); }
.kv span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.kv.strong span:last-child { color: var(--blue); }
.bar { height: 3px; background: #1d1d1d; margin: 2px 10px 6px; border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); width: 0; }
.bar.warn i { background: var(--amber); }
.bar.bad i { background: var(--down); }

/* ---------- tables ---------- */
table.grid { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.grid th { position: sticky; top: 0; background: #0b0b0b; color: var(--text-2); font-weight: 600; text-align: right;
  padding: 5px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 2; font-size: 11.5px; }
table.grid td { padding: 4px 8px; text-align: right; border-bottom: 1px solid #131313; white-space: nowrap; }
table.grid th.l, table.grid td.l { text-align: left; }
table.grid th.c, table.grid td.c { text-align: center; }
table.grid tbody tr:hover { background: var(--hover); }
table.grid tbody tr.selected { background: var(--select); }
table.grid td.sym { font-weight: 700; }
table.grid td.sym small { display: block; color: var(--text-3); font-weight: 400; font-size: 10.5px; max-width: 110px; overflow: hidden;
  text-overflow: ellipsis; }
.empty { padding: 26px 12px; text-align: center; color: var(--text-3); }
.pill { display: inline-block; min-width: 38px; text-align: center; padding: 0 6px; border-radius: 3px; font-weight: 700; font-size: 11px; }
.pill.buy, .pill.long { background: rgba(21,97,224,.22); color: #7fb0ff; }
.pill.sell, .pill.short { background: rgba(212,42,55,.22); color: #ff8b94; }
.pill.grey { background: #222; color: var(--text-2); }

/* watchlist */
#watchlist-body table.grid td { padding: 3px 6px; }
#watchlist-body td.px { cursor: pointer; font-weight: 600; border-radius: 2px; transition: color .5s; }
#watchlist-body td.px.bid:hover { background: rgba(212,42,55,.3); }
#watchlist-body td.px.ask:hover { background: rgba(21,97,224,.35); }
td.px.tick-up, .tile .p.tick-up, .tk-price.tick-up { color: var(--up); transition: none; }
td.px.tick-down, .tile .p.tick-down, .tk-price.tick-down { color: var(--down); transition: none; }
tr.stale td.px { color: var(--text-3); }
.dly { font-style: normal; font-weight: 400; font-size: 9.5px; color: var(--text-3); margin-left: 5px; }
.tag.dly-tag { color: var(--amber); border-color: rgba(240, 160, 32, .45); margin-left: 6px; }
#watchlist-body tr { cursor: default; }
#watchlist-body .sp { color: var(--text-2); }

/* ---------- chart ---------- */
#mod-chart { min-width: var(--chart-min); container-type: inline-size; }   /* a container: narrow-chart rules below */
#mod-chart > .mod-head { align-items: flex-start; }
#chart-title { line-height: 26px; }      /* level with the first toolbar line when the toolbar wraps */
#chart-body { overflow: hidden; }
/* a narrow chart (trade tickets beside it) wraps its toolbar instead of cutting controls off; the hint gives way first */
.chart-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; margin-left: 6px; flex: 1 1 auto; min-width: 0;
  padding: 3px 0; }
.chart-tools > * { flex-shrink: 0; }
.tf { display: inline-flex; flex-wrap: wrap; gap: 1px; }
.chart-tools > .tf { flex-shrink: 1; }   /* wraps its own buttons only when it does not fit on a line by itself */
.tf button { background: transparent; border: 1px solid transparent; color: var(--text-2); padding: 1px 7px; border-radius: 3px;
  font-size: 11.5px; min-width: 30px; }
.tf button:hover { color: var(--text); border-color: var(--border-strong); }
.tf button.active { background: #2a2a2a; color: var(--text); font-weight: 700; }
.chart-tools label { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); white-space: nowrap; cursor: pointer; }
.chart-tools label:hover { color: var(--text); }
.chart-tools input[type=checkbox] { accent-color: var(--blue); margin: 0; }
.chart-tools > .chart-hint { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: right;
  color: var(--text-3); white-space: nowrap; font-size: 11.5px; }
.chart-wrap { position: absolute; inset: 0; }
.chart-wrap canvas { position: absolute; left: 0; top: 0; }
/* the read-out stops before the price axis (72px wide) */
.chart-legend { position: absolute; left: 12px; right: 76px; top: 8px; pointer-events: none; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; font-size: 12.5px; font-variant-numeric: tabular-nums; text-shadow: 0 0 4px #000, 0 0 4px #000; }
.chart-legend .i { white-space: nowrap; }
@container (max-width: 700px) {
  .chart-tools { column-gap: 8px; }
  .chart-tools > .chart-hint { display: none; }
  .tf button { min-width: 0; padding: 1px 4px; }
}
@container (max-width: 540px) {
  .chart-legend { white-space: normal; }
  .chart-legend .ro { display: block; }     /* O H L C on the lines under the instrument name */
}
.chart-legend .s { font-size: 15px; font-weight: 700; pointer-events: auto; cursor: pointer; }
.chart-legend .s:hover, .sym-pick:hover { text-decoration: underline dotted; text-underline-offset: 3px; }
.sym-pick { cursor: pointer; }
.sym-pick::after { content: " ▾"; font-size: 0.75em; color: var(--text-3); font-weight: 400; }
.sym-picker { position: fixed; z-index: 120; width: 240px; }
.sym-picker input { width: 100%; height: 28px; padding: 0 8px; background: var(--field); border: 1px solid var(--blue); border-radius: 3px;
  outline: none; color: var(--text); font-weight: 700; letter-spacing: .3px; }
.sym-picker .menu { top: 31px; }
.chart-legend .m { color: var(--text-2); }
.chart-vol-label { position: absolute; left: 12px; pointer-events: none; color: var(--text-2); font-size: 11.5px;
  text-shadow: 0 0 4px #000, 0 0 4px #000; }
.chart-live { position: absolute; right: 84px; bottom: 34px; }
.chart-menu { top: 0; width: 250px; max-height: none; }
.chart-menu .item b { min-width: 0; }
.chart-menu .item.muted span { font-size: 11px; white-space: normal; }
.chart-msg { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); color: var(--text-3); pointer-events: none; }

/* ---------- trade ticket ---------- */
.ticket-body { padding: 8px 10px 10px; }
/* extra tickets (web/js/tickets.js): full-height columns of a fixed width to the right of the main one; when the
   row has no room for all of them the right-most are hidden (with a "2 more" tag), never squeezed */
.ticket-col { flex: 0 0 var(--ticket-w); width: var(--ticket-w); min-width: var(--ticket-w); margin-left: 4px; display: flex;
  flex-direction: column; min-height: 0; }
.ticket-col > .module { flex: 1 1 auto; }
.ticket-col .ticket-body { overflow-y: auto; }
.ticket-col .tk-place { position: sticky; bottom: 0; box-shadow: 0 10px 0 2px var(--panel); }   /* in view in a short column */
.ticket-wait { padding: 12px 10px; color: var(--text-2); line-height: 1.5; }
.ticket-wait b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
#mod-ticket .mod-head { gap: 8px; }
.mod-btn { flex: 0 0 auto; width: 20px; height: 20px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border-strong); border-radius: 3px; color: var(--text-2); font-size: 15px; line-height: 1; }
.mod-btn:hover { color: var(--text); background: #262626; border-color: #5a5a5a; }
.mod-btn[aria-disabled="true"], .mod-btn[aria-disabled="true"]:hover { opacity: .35; cursor: default; color: var(--text-2);
  background: transparent; border-color: var(--border-strong); }
.more-tag { flex: 0 0 auto; background: transparent; color: var(--amber); border-color: rgba(240, 160, 32, .45); white-space: nowrap;
  cursor: pointer; }
.tk-name { display: flex; align-items: baseline; margin-bottom: 7px; }
.tk-name b { flex: 0 0 auto; font-size: 15px; white-space: nowrap; }
.tk-name span { flex: 1 1 auto; min-width: 0; text-align: right; color: var(--text-2); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; margin-left: 8px; }
.tk-link { display: none; }        /* main ticket, while extra tickets are open: it follows the watchlist and chart */
#row-top.multi .tk-link { display: inline-flex; flex: 0 0 auto; align-self: center; margin-right: 5px; color: var(--blue); }
.tk-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.tk-types { display: flex; border: 1px solid var(--border-strong); border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.tk-types button { flex: 1; background: transparent; border: 0; padding: 4px 0; color: var(--text-2); }
.tk-types button + button { border-left: 1px solid var(--border-strong); }
.tk-types button.active { background: #2a2a2a; color: var(--text); font-weight: 700; }
.tk-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; position: relative; }
.tk-side { border: 0; border-radius: 4px; padding: 6px 8px 8px; text-align: left; color: #fff; position: relative; }
.tk-side.sell { background: var(--sell); }
.tk-side.sell:hover { background: var(--sell-hi); }
.tk-side.buy { background: var(--buy); text-align: right; }
.tk-side.buy:hover { background: var(--buy-hi); }
.tk-side.dim { opacity: .38; }
.tk-side *, .tile-px button * { pointer-events: none; }   /* prices re-render constantly; the button itself takes the click */
.tk-side .lbl { font-size: 11px; font-weight: 600; opacity: .9; text-transform: uppercase; letter-spacing: .4px; }
.tk-price { font-variant-numeric: tabular-nums; font-size: 14px; line-height: 1.1; white-space: nowrap; color: #fff; }
.tk-price .big { font-size: 26px; font-weight: 700; }
.tk-price .tail { font-size: 13px; vertical-align: top; position: relative; top: 2px; }
.tk-side .tk-price.tick-up, .tk-side .tk-price.tick-down { color: #fff; }
.tk-spread { position: absolute; left: 50%; bottom: -1px; transform: translate(-50%, 0); background: #000; border: 1px solid var(--border-strong);
  border-radius: 3px 3px 0 0; padding: 0 6px; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.tk-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tk-row > label { flex: 0 0 82px; color: var(--text-2); }
.tk-row input[type=text], .tk-row select { flex: 1; min-width: 0; height: 26px; background: var(--field); border: 1px solid var(--border-strong);
  border-radius: 3px; padding: 0 8px; outline: none; text-align: right; font-variant-numeric: tabular-nums; }
.tk-row select { text-align: left; }
.tk-row input:focus, .tk-row select:focus { border-color: var(--blue); }
.tk-row input:disabled { opacity: .4; }
.tk-row .step { flex: 0 0 24px; height: 26px; padding: 0; background: #1b1b1b; border: 1px solid var(--border-strong); border-radius: 3px; }
.tk-row .step:hover { background: #2a2a2a; }
.tk-row input[type=checkbox] { accent-color: var(--blue); margin: 0; }
.tk-types button { white-space: nowrap; font-size: 11.5px; }
.tk-trail-unit { flex: 0 0 auto; font-size: 11.5px; }
.tk-row.tk-bracket > label { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.tk-row.tk-bracket input[type=text] { padding: 0 6px; }
.tk-row.tk-bracket input[type=text]::placeholder { color: var(--text-3); text-align: left; }
.tk-quick { display: flex; gap: 4px; margin: 5px 0 0 90px; }
.tk-quick button { flex: 1; background: transparent; border: 1px solid var(--border); color: var(--text-2); border-radius: 3px; padding: 1px 0;
  font-size: 11px; }
.tk-quick button:hover { color: var(--text); border-color: var(--border-strong); }
.tk-info { display: flex; justify-content: space-between; margin-top: 8px; color: var(--text-2); font-size: 11.5px;
  font-variant-numeric: tabular-nums; }
.tk-place { width: 100%; height: 32px; margin-top: 9px; font-size: 13px; }
.tk-closed { margin-top: 8px; color: var(--amber); font-size: 11.5px; }

/* ---------- order book ---------- */
#dom-body { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.dom-scroll { flex: 1 1 auto; overflow: auto; min-height: 0; }
.dom-foot { flex: 0 0 auto; display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; border-top: 1px solid var(--border);
  color: var(--text-2); font-size: 11px; }
.dom-foot .sim { color: var(--amber); }
.dom-head, .dom-row { display: grid; align-items: center; }
.dom-head { position: sticky; top: 0; background: #0b0b0b; color: var(--text-2); font-weight: 600; font-size: 11.5px; z-index: 2;
  border-bottom: 1px solid var(--border); }
.dom-head > div, .dom-row > div { padding: 3px 8px; position: relative; white-space: nowrap; }
.dom-std .dom-head, .dom-std .dom-row { grid-template-columns: 1fr 1fr; }
.dom-std .half { display: flex; justify-content: space-between; align-items: baseline; padding: 0; }
.dom-std .half > span { padding: 3px 8px; }
.dom-std .half.bid, .dom-std .dom-head .half:first-child { border-right: 1px solid var(--border); }
.dom-row { border-bottom: 1px solid #101010; }
.dom-row .bidp { color: #ff8b94; font-weight: 600; cursor: pointer; }
.dom-row .askp { color: #7fb0ff; font-weight: 600; cursor: pointer; }
.dom-row .bidp:hover { background: rgba(212,42,55,.35); color: #fff; }
.dom-row .askp:hover { background: rgba(21,97,224,.4); color: #fff; }
.dom-row .vol { color: var(--text); }
.dom-row .lp { color: var(--text-3); font-size: 10.5px; margin-left: 5px; }
.dom-row.best .bidp, .dom-row.best .askp { font-size: 13.5px; }
.dom-price .dom-head, .dom-price .dom-row { grid-template-columns: 1fr 1fr 1.25fr 1fr 1fr; }
.dom-price .dom-row > div, .dom-price .dom-head > div { text-align: center; }
.dom-price .dom-row .pr { font-weight: 600; color: var(--text-2); background: #0a0a0a; border-left: 1px solid var(--border);
  border-right: 1px solid var(--border); }
.dom-price .dom-row.atbid .pr { color: #ff8b94; }
.dom-price .dom-row.atask .pr { color: #7fb0ff; }
.dom-price .dom-row.inside .pr { color: var(--text-3); }
.dom-price .dom-row > div, .dom-price .dom-head > div { padding: 2px 6px; }
.dom-price .cellb, .dom-price .cells { cursor: pointer; min-height: 19px; }
.dom-note .seg button { padding: 1px 7px; }
.dom-price .cellb:hover { background: rgba(21,97,224,.4); }
.dom-price .cells:hover { background: rgba(212,42,55,.35); }
.dom-price .mine { color: var(--amber); font-weight: 700; }
.dom-vwap .dom-head, .dom-vwap .dom-row { grid-template-columns: 1.2fr 1fr 1.2fr; }
.dom-vwap .dom-row > div, .dom-vwap .dom-head > div { text-align: center; }
.dom-vwap .vsize { color: var(--text-2); font-weight: 600; }
.dom-note { padding: 5px 8px; color: var(--text-3); font-size: 11px; border-bottom: 1px solid var(--border); }

/* ---------- blotter ---------- */
#blotter-body td .btn { margin-left: 4px; }
#blotter-body td.act { width: 1%; }
.log-row { display: flex; gap: 12px; padding: 3px 10px; border-bottom: 1px solid #111; font-variant-numeric: tabular-nums; }
.log-row time { color: var(--text-3); flex: 0 0 auto; }
.log-row.warn span { color: var(--amber); }
.log-row.fill span { color: var(--text); font-weight: 600; }
.log-row span { color: var(--text-2); }

/* ---------- boards ---------- */
#boards-body { padding: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 6px; }
.tile { border: 1px solid var(--border); border-radius: 3px; background: var(--panel-2); padding: 6px 7px 7px; }
.tile.selected { border-color: var(--blue); }
.tile.stale { opacity: .5; }
.tile-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; cursor: pointer; }
.tile-head b { font-size: 13px; }
.tile-head span { font-variant-numeric: tabular-nums; font-size: 11.5px; }
.tile-px { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; position: relative; }
.tile-px button { border: 0; border-radius: 3px; padding: 4px 7px 5px; color: #fff; text-align: left; background: #5f1d24; }
.tile-px button:hover { background: var(--sell); }
.tile-px button.b { text-align: right; background: #173a7a; }
.tile-px button.b:hover { background: var(--buy); }
.tile-px .lbl { font-size: 10px; opacity: .8; text-transform: uppercase; letter-spacing: .4px; }
.tile .p { font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; color: #fff; }
.tile .p .big { font-size: 21px; font-weight: 700; }
.tile .p .tail { font-size: 11px; vertical-align: top; position: relative; top: 2px; }
.tile-px button .p.tick-up, .tile-px button .p.tick-down { color: #fff; }
.tile-sp { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); background: #000; border: 1px solid var(--border-strong);
  border-bottom: 0; border-radius: 3px 3px 0 0; padding: 0 5px; font-size: 10.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tile-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; color: var(--text-3); font-size: 11px;
  font-variant-numeric: tabular-nums; }
.tile-foot input { width: 92px; height: 20px; background: var(--field); border: 1px solid var(--border); border-radius: 3px; padding: 0 6px;
  text-align: right; outline: none; }
.tile-foot input:focus { border-color: var(--blue); }
.class-title { margin: 12px 2px 6px; color: var(--text-2); font-weight: 700; font-size: 12px; letter-spacing: .3px; }
.class-title:first-child { margin-top: 0; }

/* ---------- account page ---------- */
#account-page { padding: 14px 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 16px; }
.card { border: 1px solid var(--border); border-radius: 3px; padding: 9px 12px; background: var(--panel-2); }
.card small { color: var(--text-2); display: block; margin-bottom: 3px; }
.card b { font-size: 18px; font-variant-numeric: tabular-nums; }
.section-title { font-weight: 700; margin: 14px 0 6px; color: var(--text-2); }
.note { color: var(--text-2); max-width: 900px; line-height: 1.5; }

/* ---------- status bar, toasts, modal ---------- */
#statusbar { flex: 0 0 auto; display: flex; height: 22px; align-items: center; padding: 0 12px; color: var(--text-3); font-size: 11px;
  border-top: 1px solid var(--border); gap: 12px; letter-spacing: .3px; }
#toasts { position: fixed; right: 14px; bottom: 34px; display: flex; flex-direction: column; gap: 6px; z-index: 200; align-items: flex-end; }
.toast { background: #151515; border: 1px solid var(--border-strong); border-left: 3px solid var(--blue); padding: 8px 12px; border-radius: 3px;
  max-width: 420px; box-shadow: 0 6px 22px rgba(0,0,0,.8); animation: toast-in .16s ease-out; }
.toast.good { border-left-color: var(--up); }
.toast.bad { border-left-color: var(--down); }
.toast b { display: block; margin-bottom: 1px; }
.toast span { color: var(--text-2); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
#user-box { display: flex; align-items: center; gap: 8px; color: var(--text-2); white-space: nowrap; }
#user-box b { color: var(--text); }
#modal-root.opaque { background: #000; }
.modal.login { width: 340px; }
.modal.login h3 { text-align: center; padding: 16px 14px; font-size: 18px; font-weight: 400; }
.modal.login .body { padding: 16px 18px 4px; }
.modal.login .body .field { display: block; margin: 0 0 10px; }
.modal.login .body .field label { display: block; margin-bottom: 4px; }
.modal.login .body .field input { width: 100%; height: 30px; text-align: left; }
.modal.login .foot { border-top: 0; padding: 4px 18px 18px; }
.modal.login .foot .btn { width: 100%; height: 32px; }
.login-error { color: var(--down) !important; min-height: 17px; margin: 0 !important; }
.admin-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.admin-form input, .admin-form select { height: 26px; background: var(--field); border: 1px solid var(--border-strong); border-radius: 3px;
  padding: 0 8px; outline: none; }
.admin-form input:focus, .admin-form select:focus { border-color: var(--blue); }
#modal-root:empty { display: none; }
#modal-root { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 300; display: flex; align-items: center; justify-content: center; }
.modal { width: 370px; background: #0d0d0d; border: 1px solid var(--border-strong); border-radius: 4px; box-shadow: 0 20px 60px #000; }
.modal h3 { margin: 0; padding: 10px 14px; font-size: 13.5px; border-bottom: 1px solid var(--border); background: var(--head); }
.modal .body { padding: 10px 14px; }
.modal .body .kv { padding: 4px 0; }
.modal .body p { margin: 6px 0 2px; color: var(--text-2); }
.modal .body .field { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.modal .body .field label { flex: 0 0 90px; color: var(--text-2); }
.modal .body .field input { flex: 1; height: 26px; background: var(--field); border: 1px solid var(--border-strong); border-radius: 3px;
  padding: 0 8px; text-align: right; outline: none; font-variant-numeric: tabular-nums; }
.modal .body .field input:focus { border-color: var(--blue); }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.modal .foot .btn { height: 28px; min-width: 86px; }

/* Rhodium logo (web/img): top bar and login screen */
.brand-logo { display: block; height: 28px; width: auto; }
.login-logo { display: inline-block; height: 44px; width: auto; vertical-align: middle; }
