/* trade.css: the Hush terminal. Dense and numeric; blue for actions, green for longs, raspberry for shorts. */
body.term {
  /* the landing palette, a step lighter: blue-black panels over a low blue glow; blue for actions, green and raspberry for the two sides */
  --ink: #04060B; --bg: #080C16; --panel: rgba(11, 16, 28, 0.8); --panel-solid: #0C1220;
  --surface: #0F1626; --surface-2: #141D31; --surface-3: #1C2840;
  --line: rgba(150, 180, 255, 0.10); --line-2: rgba(150, 180, 255, 0.17); --line-3: rgba(150, 180, 255, 0.32);
  --text: #E9EEFF; --text-2: #A8B2CE; --text-3: #707A96;
  --accent-wash: rgba(77, 134, 255, 0.10); --chart-dot: rgba(150, 180, 255, 0.15);
  --page-bg: radial-gradient(90% 70% at 70% 0%, #13254F 0%, #0C1328 40%, #090D18 75%, #070A12 100%);
  background: var(--bg); background-image: var(--page-bg); background-attachment: fixed; font-size: var(--fs-sm);
}

/* top bar */
.tbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--sp-20); height: 56px; padding: 0 var(--sp-16); border-bottom: 1px solid var(--line); background: rgba(9, 13, 24, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tbar .lock { flex: none; }
.tbar .lock img { width: 22px; }
.tbar .lock span { font-size: .9375rem; }
.mkt-wrap { position: relative; }
.mkt { display: flex; align-items: center; gap: var(--sp-8); height: 38px; padding: 0 var(--sp-12) 0 var(--sp-8); border: 1px solid var(--line-2); border-radius: var(--r-md); transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.mkt:hover, .mkt[aria-expanded="true"] { border-color: var(--line-3); background: var(--surface-2); }
.mkt b { font-weight: 600; font-size: var(--fs-md); }
.mkt-u { color: var(--text-3); font-size: var(--fs-xs); }
.chev { color: var(--text-2); margin-left: var(--sp-2); transition: transform var(--t-fast) var(--ease); }
.mkt[aria-expanded="true"] .chev { transform: rotate(180deg); }
.picker { position: absolute; top: calc(100% + 6px); left: 0; width: min(560px, calc(100vw - 2rem)); background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-pop); z-index: 50; overflow: hidden; }
.pq { display: flex; align-items: center; gap: var(--sp-8); padding: var(--sp-12); border-bottom: 1px solid var(--line); }
.pq input { flex: 1; min-width: 0; height: 36px; padding: 0 var(--sp-12); border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); outline: 0; }
.pq input:focus { border-color: var(--accent); }
kbd { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-6); }
.pf { padding: 0 var(--sp-12); }
.phead, .prow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, .9fr); gap: var(--sp-12); align-items: center; padding: var(--sp-8) var(--sp-12); }
.phead { color: var(--text-3); font-size: var(--fs-xs); border-bottom: 1px solid var(--line); }
.phead span:not(:first-child), .prow > span:not(:first-child) { text-align: right; }
.plist { max-height: min(60vh, 460px); overflow-y: auto; }
.prow { width: 100%; text-align: left; font-family: var(--font-mono); font-size: var(--fs-xs); border-bottom: 1px solid var(--line); transition: background-color var(--t-fast) var(--ease); }
.prow:hover, .prow:focus-visible, .prow.on { background: var(--accent-wash); }
.pm { display: flex; align-items: center; gap: var(--sp-8); font-family: var(--font); font-size: var(--fs-sm); min-width: 0; }
.pm b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm i:not(.mono) { font-style: normal; font-family: var(--font-mono); color: var(--text-3); font-size: .6875rem; }
.pm .tag { padding: var(--sp-4) var(--sp-6); font-size: .6875rem; }
.pnone { padding: var(--sp-24) var(--sp-12); color: var(--text-2); }

.stats { display: flex; gap: var(--sp-24); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.stats::-webkit-scrollbar { display: none; }
.stats > div { display: grid; gap: 0; white-space: nowrap; }
.stats span { font-size: .6875rem; color: var(--text-3); }
.stats b { font-weight: 500; font-size: var(--fs-sm); }
.stats em { font-style: normal; font-size: .6875rem; color: var(--text-3); }
.stats .px { font-size: var(--fs-md); }
.px.fu { color: var(--up); } .px.fd { color: var(--down); }
.tbar-r { margin-left: auto; position: relative; flex: none; display: flex; align-items: center; gap: var(--sp-8); }
.tlink { display: inline-flex; align-items: center; height: 34px; padding: 0 var(--sp-12); border-radius: var(--r-pill); font-size: var(--fs-xs); color: var(--text-2); transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.tlink:hover { color: var(--text); background: var(--accent-wash); }
.tlink:active { opacity: .8; }
@media (max-width: 760px) { .tlink { display: none; } }
.wbtn.on { border-color: var(--accent); }
.wmenu { position: absolute; right: 0; top: calc(100% + 6px); display: grid; min-width: 160px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: var(--sp-4); z-index: 50; }
.wmenu button { text-align: left; padding: var(--sp-8) var(--sp-10); border-radius: var(--r-sm); }
.wmenu button:hover { background: var(--accent-wash); }

/* grid */
.tgrid { display: grid; gap: 1px; min-height: calc(100dvh - 56px);
  grid-template-columns: minmax(0, 1fr) 290px 320px; grid-template-rows: minmax(480px, 1fr) minmax(220px, 27vh);
  grid-template-areas: "chart book ticket" "lower lower acct"; }
.panel { background: var(--panel); outline: 1px solid var(--line); min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.chart-p { position: relative; z-index: 1; }
.chart-p::before, .chart-p::after { content: ""; position: absolute; right: -7px; width: 13px; height: 13px; pointer-events: none; z-index: 3;
  background: linear-gradient(var(--line-3), var(--line-3)) center / 1px 100% no-repeat, linear-gradient(var(--line-3), var(--line-3)) center / 100% 1px no-repeat; }
.chart-p::before { top: -7px; } .chart-p::after { bottom: -7px; }
.chart-p { grid-area: chart; } .book-p { grid-area: book; } .ticket { grid-area: ticket; } .acct { grid-area: acct; } .lower { grid-area: lower; }
@media (max-width: 1180px) {
  .tgrid { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: minmax(420px, 56vh) auto auto auto; grid-template-areas: "chart ticket" "book ticket" "lower lower" "acct acct"; }
  .book-p { min-height: 320px; }
}
@media (max-width: 760px) {
  .tgrid { grid-template-columns: minmax(0, 1fr); grid-template-rows: 380px auto 360px auto auto; grid-template-areas: "chart" "ticket" "book" "lower" "acct"; }
  .stats { display: none; }
  .mkt-u { display: none; }
  .tbar { gap: var(--sp-12); } .tbar .lock span { display: none; }
}

/* tabs */
.ptabs { display: flex; gap: var(--sp-16); padding: 0 var(--sp-14); border-bottom: 1px solid var(--line); flex: none; }
.ptabs button { height: 40px; color: var(--text-3); font-size: var(--fs-sm); border-bottom: 1.5px solid transparent; margin-bottom: -1px; transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.ptabs button:hover { color: var(--text-2); }
.ptabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.ptabs i { font-style: normal; font-family: var(--font-mono); font-size: .6875rem; color: var(--text-2); }

/* chart */
.ivals { display: flex; align-items: center; gap: var(--sp-2); height: 38px; padding: 0 var(--sp-8); border-bottom: 1px solid var(--line); flex: none; position: relative; z-index: 5; }
.ivfav { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; overflow-x: auto; scrollbar-width: none; contain: paint; }
.ivfav::-webkit-scrollbar { display: none; }
.ivfav button { height: 26px; padding: 0 var(--sp-8); border-radius: var(--r-sm); color: var(--text-3); font: 500 var(--fs-xs)/1 var(--font-mono); transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.ivfav button:hover { color: var(--text); }
.ivfav button.on { background: var(--accent-wash); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line-2); }
.ivmore-w { position: relative; flex: none; }
.ivmore { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-sm); color: var(--text-3); }
.ivmore:hover, .ivmore[aria-expanded="true"] { background: var(--surface-2); }
.ivmore .chev { margin: 0; }
.ivmore[aria-expanded="true"] .chev { transform: rotate(180deg); }
.ivmenu { position: absolute; top: calc(100% + 6px); left: 0; width: 210px; max-height: min(70vh, 560px); overflow-y: auto; padding: var(--sp-4) 0; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-pop); z-index: 60; }
.ivh { padding: var(--sp-10) var(--sp-14) var(--sp-6); font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); border-top: 1px solid var(--line); }
.ivh:first-child { border-top: 0; }
.ivr { display: flex; align-items: center; }
.ivr:hover { background: var(--accent-wash); }
.ivr.on { background: var(--chrome); }
.ivr.on .ivp { color: var(--ink); }
.ivp { flex: 1; text-align: left; padding: var(--sp-8) var(--sp-14); color: var(--text); font-size: var(--fs-sm); }
.ivs { display: grid; place-items: center; width: 34px; height: 30px; color: var(--text-3); }

.ivs.on { color: #F5B83D; } .ivs.on .ic { fill: currentColor; }
.ivr.on .ivs:not(.on) { color: var(--surface-3); }
.ivs:hover { color: #F5B83D; }
.ohlc { margin-left: auto; padding-left: var(--sp-12); display: flex; gap: var(--sp-6); font-size: .6875rem; color: var(--text-3); white-space: nowrap; overflow: hidden; }
.ohlc b { font-weight: 400; color: var(--text-2); margin-right: var(--sp-6); }
.ohlc .up { color: var(--up); } .ohlc .dn { color: var(--down); }
#chart { flex: 1; width: 100%; min-height: 0; cursor: crosshair; touch-action: pan-y; user-select: none; -webkit-user-select: none; }

/* book + trades */
.bhd, .lv, .spr, .tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 var(--sp-14); }
.bhd { color: var(--text-3); font-size: .6875rem; padding-top: var(--sp-8); padding-bottom: var(--sp-6); flex: none; }
.bhd span:not(:first-child), .lv span:not(:first-child), .spr span:not(:first-child), .tr span:not(:first-child) { text-align: right; }
.book, .trades { flex: 1; overflow: hidden; font-size: var(--fs-xs); }
.trades { overflow-y: auto; }
.lv { position: relative; height: 21px; align-items: center; cursor: pointer; }
.lv::before { content: ""; position: absolute; inset: 1px 0 1px auto; width: var(--w); opacity: .16; pointer-events: none; }
.lv.a::before { background: var(--down); } .lv.b::before { background: var(--up); }
.lv.a span:first-child { color: var(--down); } .lv.b span:first-child { color: var(--up); }
.lv:hover { background: var(--surface-2); }
.spr { height: 30px; align-items: center; border-block: 1px solid var(--line); color: var(--text-2); margin: 2px 0; }
.spr span:first-child { color: var(--text); font-weight: 500; }
.tr { height: 21px; align-items: center; }
.tr.b span:first-child { color: var(--up); } .tr.a span:first-child { color: var(--down); }
.tr.new { animation: flash .6s var(--ease); }
@keyframes flash { from { background: var(--accent-wash); } }

/* ticket */
.ticket { padding: var(--sp-14); gap: var(--sp-14); overflow-y: auto; }
.side { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); }
.side button { height: 36px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.side button[data-s="long"].on { background: var(--up); color: var(--ink); }
.side button[data-s="short"].on { background: var(--down); color: var(--ink); }
.otype { display: flex; align-items: center; gap: var(--sp-16); }
.otype button { color: var(--text-3); padding: var(--sp-4) 0; border-bottom: 1.5px solid transparent; }
.otype button.on { color: var(--text); border-bottom-color: var(--accent); }
.mmode { margin-left: auto; font-size: var(--fs-xs); color: var(--text-3); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: var(--sp-2) var(--sp-8); }
.fld { display: flex; align-items: center; gap: var(--sp-8); height: 44px; padding: 0 var(--sp-12); border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface); transition: border-color var(--t-fast) var(--ease); }
.fld:focus-within { border-color: var(--accent); }
.fld > span { color: var(--text-3); font-size: var(--fs-xs); width: 3.75rem; flex: none; }
.fld input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; text-align: right; font-size: var(--fs-md); }
.fld em { font-style: normal; color: var(--text-3); font-size: var(--fs-xs); }
.pcts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }
.pcts button { height: 28px; border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--text-2); font-size: var(--fs-xs); transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.pcts button:hover { border-color: var(--line-3); color: var(--text); }
.lev { display: grid; gap: var(--sp-4); }
.lev-h { display: flex; justify-content: space-between; color: var(--text-3); font-size: var(--fs-xs); }
.lev-h b { color: var(--text); font-weight: 500; }
.lev-s { display: flex; justify-content: space-between; color: var(--text-3); font-size: .6875rem; }
.sum { margin: 0; display: grid; gap: var(--sp-6); padding: var(--sp-12) 0; border-block: 1px solid var(--line); }
.sum div { display: flex; justify-content: space-between; }
.sum dt { color: var(--text-3); font-size: var(--fs-xs); }
.sum dd { margin: 0; font-size: var(--fs-xs); }
.go { --h: 46px; width: 100%; font-size: var(--fs-sm); }
.go.long { background: var(--up); color: var(--ink); border-color: transparent; box-shadow: 0 8px 28px -12px rgba(61, 220, 151, .45); }
.go.short { background: var(--down); color: var(--ink); border-color: transparent; }
.go.long:hover, .go.short:hover { filter: brightness(1.08); }
.tnote { font-size: var(--fs-xs); color: var(--text-3); text-align: center; }

/* account */
.acct { padding: var(--sp-14); gap: var(--sp-12); overflow-y: auto; }
.ac-rows { display: grid; gap: var(--sp-6); }
.ac-rows div { display: flex; justify-content: space-between; }
.ac-rows span { color: var(--text-3); font-size: var(--fs-xs); }
.ac-rows b { font-weight: 500; font-size: var(--fs-xs); }
.ac-key { display: flex; gap: var(--sp-10); align-items: flex-start; padding: var(--sp-10) var(--sp-12); border: 1px solid var(--line); border-radius: var(--r-md); }
.ak-ic { color: var(--text-3); margin-top: var(--sp-2); transition: color var(--t-fast) var(--ease); }
.ac-key.on .ak-ic { color: var(--accent); }
.ac-key b { display: block; font-weight: 500; font-size: var(--fs-xs); }
.ac-key span { font-size: .6875rem; color: var(--text-3); font-family: var(--font-mono); word-break: break-all; }
.ac-empty { font-size: var(--fs-xs); color: var(--text-2); }
.ac-empty a { color: var(--accent); }
.acct .truth { font-size: .6875rem; }

/* lower */
.lpane { flex: 1; overflow: auto; }
.empty { padding: var(--sp-20) var(--sp-14); color: var(--text-3); }
.lower .tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
.lower .tbl th { text-align: left; font-weight: 400; color: var(--text-3); padding: var(--sp-8) var(--sp-14); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel-solid); white-space: nowrap; }
.lower .tbl td { padding: var(--sp-8) var(--sp-14); border-bottom: 1px solid var(--line); font-family: var(--font-mono); white-space: nowrap; }
.lower .tbl td b { font-family: var(--font); font-weight: 500; }
.lower .tbl td em { font-style: normal; color: var(--text-3); margin-left: var(--sp-8); font-family: var(--font); }

/* seals */
.seals:not([hidden]) { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.seal-art { padding: var(--sp-14); border-right: 1px solid var(--line); display: grid; gap: var(--sp-10); align-content: start; }
#sealCv { width: 100%; aspect-ratio: 1; }
.seal-cap { font-size: .6875rem; color: var(--text-3); font-family: var(--font-mono); line-height: 1.5; }
.seal-cap b { display: block; color: var(--text); font-family: var(--font); font-size: var(--fs-xs); font-weight: 500; }
.seal-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.seal-top { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-8); padding: var(--sp-10) var(--sp-14); border-bottom: 1px solid var(--line); }
#sRes { font-size: var(--fs-xs); color: var(--text-2); }
#sRes.ok { color: var(--up); } #sRes.bad { color: var(--down); }
.seal-list { overflow-y: auto; flex: 1; }
.srow { display: grid; grid-template-columns: 3.5rem 4.5rem minmax(0, 1fr) auto; gap: var(--sp-12); width: 100%; text-align: left; padding: var(--sp-8) var(--sp-14); border-bottom: 1px solid var(--line); font-size: var(--fs-xs); transition: background-color var(--t-fast) var(--ease); }
.srow:hover, .srow.on { background: var(--accent-wash); }
.srow .si { font-family: var(--font-mono); color: var(--text-2); }
.srow .st { font-family: var(--font-mono); color: var(--text-3); }
.srow .sx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .sr { color: var(--text-2); } .srow .sr.bad { color: var(--down); }
@media (max-width: 760px) { .seals:not([hidden]) { grid-template-columns: minmax(0, 1fr); } .seal-art { grid-template-columns: 120px minmax(0, 1fr); border-right: 0; border-bottom: 1px solid var(--line); } }

/* clean-up pass: icons, skeletons, empty states, copy rows */
.wmenu button { display: flex; align-items: center; gap: var(--sp-8); }
.wmenu button .ic { color: var(--text-3); }
.ac-key .aline { display: flex; align-items: center; gap: var(--sp-4); }
.ac-key .aline span { word-break: normal; }
.chart-p { position: relative; }
.chart-sk { position: absolute; left: 0; right: 74px; top: 38px; bottom: 26px; display: flex; align-items: flex-end; gap: 6px; padding: 12% var(--sp-20) 18%; pointer-events: none; }
.chart-sk[hidden] { display: none; }
.chart-sk .sk { flex: 1; height: auto; border-radius: var(--r-sm); opacity: .7; }
.chart-msg { position: absolute; left: 0; right: 74px; top: 50%; text-align: center; color: var(--text-3); font-size: var(--fs-sm); pointer-events: none; padding: 0 var(--sp-16); }
.lv.skr, .tr.skr { cursor: default; }
.lv.skr .sk, .tr.skr .sk { height: .625rem; justify-self: end; }
.lv.skr span:first-child .sk, .tr.skr span:first-child .sk { justify-self: start; }
.prow.skr { cursor: default; }
.prow.skr .sk { height: .625rem; justify-self: end; }
.stats .sk { height: .875rem; margin-top: var(--sp-4); }
.ac-rows .sk { height: .75rem; width: 4.5rem; }
.tblsk { padding: var(--sp-12) var(--sp-14); display: grid; gap: var(--sp-14); }
.tblsk .sk { height: .75rem; }
.book .empty, .trades .empty { padding: var(--sp-20) var(--sp-14); }
.go .ic { margin-right: var(--sp-2); }
.pcts button:active, .ptabs button:active, .ivfav button:active { transform: translateY(1px); }
.pnone b { color: var(--text); font-weight: 500; }

/* ---------- Hush: terminal ---------- */
.tbar .lock img { width: 24px; height: 24px; }
.tbar .lock span { font-size: .9375rem; }
.ivfav button.on { box-shadow: 0 0 12px rgba(77, 134, 255, .35); }
