/* qyper terminal: one dim storm sky behind glass panels. Same ids as the engine (trade.js). */
body.term { min-height: 100vh; overflow-x: hidden; background: transparent; }
.tsky { position: fixed; inset: 0; z-index: -1; background: #020a08 url(../img/sky/jade-w1.webp) center 62% / cover no-repeat; }
.tsky::before { content: ''; position: absolute; inset: 0; z-index: -1; background: url("data:image/webp;base64,UklGRrwAAABXRUJQVlA4ILAAAABwBgCdASowABsAPu1oqk6ppiOiKqwBMB2JQBi5As3RMB7B7JYPy7fp3O/fVpMycbAb96PWP8VGm4ifYUgA/u6ObBtcmqO++PumGS7ZhO5k+MKMmYEjX3uWivS2QNkAHWzDIJPY8sOP82RcF9TgAdUPqAmNyuLt+VUYn3eqDnJYAj3M/n1BlSm6DuxNkUukE+2fVuVyZZPPVW/YHaSSQ4gtc2H8NtrIyp+qVXV8PAAAAA==") center 62% / cover; filter: blur(14px); transform: scale(1.06); }
.tsky i { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 10%, rgba(2, 10, 8, 0), rgba(2, 10, 8, .5) 75%), linear-gradient(rgba(2, 10, 8, .12), rgba(2, 10, 8, .38)); }

/* top bar */
.tbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 22px; height: 66px; padding: 0 18px; background: linear-gradient(rgba(2, 10, 8, .5), rgba(2, 10, 8, .22)); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line2); }
.tbar .lock { font-size: 20px; }
.mkt-wrap { position: relative; }
.mkt { display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 14px 0 9px; border-radius: 999px; background: rgba(233, 255, 248, .06); box-shadow: inset 0 0 0 1px var(--line2); transition: background .2s; }
.mkt:hover, .mkt[aria-expanded="true"] { background: rgba(233, 255, 248, .1); }
.mkt img { width: 26px; height: 26px; border-radius: 50%; }
.mkt b { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.mkt-u { color: var(--faint); font-size: 13px; }
.chev { width: 8px; height: 8px; border-right: 1.6px solid var(--mute); border-bottom: 1.6px solid var(--mute); transform: translateY(-2px) rotate(45deg); margin-left: 2px; }
img.inv { filter: invert(1) hue-rotate(180deg); }

.picker { position: absolute; top: 50px; left: 0; width: 470px; max-width: calc(100vw - 24px); padding: 10px; background: rgba(3, 18, 15, .92); z-index: 40; animation: pin .25s var(--ease); }
@keyframes pin { from { opacity: 0; transform: translateY(-6px); } }
.pq { position: relative; margin-bottom: 6px; }
.pq input { width: 100%; height: 42px; padding: 0 44px 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(233, 255, 248, .05); outline: none; }
.pq input:focus { border-color: rgba(151, 252, 228, .35); }
.pq kbd { position: absolute; right: 10px; top: 10px; padding: 1px 7px; border-radius: 6px; font: 500 12px var(--mono); color: var(--faint); border: 1px solid var(--line2); }
.phead, .prow { display: grid; grid-template-columns: 1.45fr 1fr .8fr .9fr; align-items: center; gap: 8px; padding: 0 10px; }
.phead { height: 30px; font-size: 12px; color: var(--faint); }
.phead span:not(:first-child), .prow > span:not(.pm) { text-align: right; }
.plist { max-height: min(60vh, 520px); overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(151, 252, 228, .2) transparent; }
.prow { width: 100%; height: 42px; border-radius: 10px; font-size: 14px; text-align: left; }
.prow:hover, .prow:focus-visible, .prow.on { background: rgba(151, 252, 228, .07); outline: none; }
.pm { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.pm img { width: 22px; height: 22px; border-radius: 50%; }
.pm i { font: normal 500 11px var(--mono); color: var(--faint); padding: 1px 6px; border-radius: 6px; background: rgba(233, 255, 248, .06); }
.pp, .pc, .pv { font-family: var(--mono); font-size: 13px; }
.pv { color: var(--mute); }
.pnone { padding: 18px 10px; color: var(--mute); }

.stats { display: flex; gap: 26px; min-width: 0; overflow: hidden; }
.stats div { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.stats span { font-size: 12px; color: var(--faint); }
.stats b { font-weight: 500; font-size: 14px; }
.stats b.px { font-size: 15px; font-weight: 600; transition: color .3s; }
.stats em { font: normal 11px var(--mono); color: var(--faint); }
.px.fu { color: var(--up); } .px.fd { color: var(--dn); }
.tbar-r { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
.qchip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; font: 500 12px var(--mono); color: var(--mint); background: rgba(151, 252, 228, .07); box-shadow: inset 0 0 0 1px rgba(151, 252, 228, .18); }
.qchip i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.wbtn.on { font-family: var(--mono); font-size: 13px; }
.wmenu { position: absolute; right: 0; top: 46px; padding: 6px; display: grid; min-width: 170px; background: rgba(3, 18, 15, .94); }
.wmenu button { height: 38px; padding: 0 12px; border-radius: 10px; text-align: left; font-size: 14px; }
.wmenu button:hover { background: rgba(233, 255, 248, .07); }

/* grid */
.tgrid { display: grid; grid-template-columns: minmax(0, 1fr) 290px 340px; grid-template-rows: minmax(470px, calc(100vh - 66px - 300px)) auto; gap: 12px; padding: 12px; }
.panel { min-width: 0; overflow: hidden; }
.chart-p { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; }
.book-p { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; }
.ticket { grid-column: 3; grid-row: 1; padding: 16px; display: flex; flex-direction: column; gap: 14px; overflow: visible; }
.acct { grid-column: 3; grid-row: 2; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.lower { grid-column: 1 / 3; grid-row: 2; min-height: 280px; display: flex; flex-direction: column; }

.ivals { display: flex; align-items: center; gap: 2px; padding: 10px 12px 4px; }
.ivals button { height: 30px; padding: 0 11px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--faint); }
.ivals button.on { color: var(--pearl); background: rgba(233, 255, 248, .08); }
.ohlc { margin-left: auto; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; }
.ohlc b { font-weight: 500; color: var(--mute); margin: 0 10px 0 4px; }
.ohlc b.up { color: var(--up); } .ohlc b.dn { color: var(--dn); }
#chart { flex: 1; width: 100%; min-height: 0; display: block; }

.ptabs { display: flex; gap: 4px; padding: 10px 10px 0; }
.ptabs button { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--faint); }
.ptabs button.on { color: var(--pearl); background: rgba(233, 255, 248, .08); }
.ptabs i { font: normal 500 11px var(--mono); color: var(--mint); margin-left: 3px; }
.bhd, .lv, .spr, .tr { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 0 14px; }
.bhd { text-transform: lowercase; height: 30px; align-items: center; font-size: 12px; color: var(--faint); margin-top: 4px; }
.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: 12.5px; }
.lv { position: relative; height: 21px; align-items: center; cursor: pointer; }
.lv::before { content: ''; position: absolute; top: 1px; bottom: 1px; right: 0; width: var(--w); opacity: .16; }
.lv.a::before { background: var(--dn); } .lv.b::before { background: var(--up); }
.lv.a span:first-child { color: var(--dn); } .lv.b span:first-child { color: var(--up); }
.lv:hover { background: rgba(233, 255, 248, .05); }
.lv span { position: relative; }
.spr { height: 30px; align-items: center; margin: 3px 0; background: rgba(233, 255, 248, .045); color: var(--mute); font-size: 12px; }
.spr span:first-child { color: var(--pearl); font-weight: 600; font-size: 13px; }
.tr { height: 21px; align-items: center; }
.tr.b span:first-child { color: var(--up); } .tr.a span:first-child { color: var(--dn); }
.tr span:last-child { color: var(--faint); }
.tr.new { animation: tnew .8s var(--ease); }
@keyframes tnew { from { background: rgba(151, 252, 228, .12); } }

/* ticket */
.otype { display: flex; align-items: center; gap: 4px; }
.otype button { height: 30px; padding: 0 12px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--faint); }
.otype button.on { color: var(--pearl); background: rgba(233, 255, 248, .08); }
.mmode { margin-left: auto; font: 500 12px var(--mono); color: var(--faint); text-transform: lowercase; }
.fld { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border-radius: 14px; background: rgba(233, 255, 248, .05); border: 1px solid var(--line2); transition: border-color .2s; }
.fld:focus-within { border-color: rgba(151, 252, 228, .4); }
.fld span { font-size: 13px; color: var(--faint); width: 54px; flex: none; }
.fld input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; text-align: right; font-size: 17px; }
.fld em { font: normal 13px var(--mono); color: var(--faint); }
.mini { height: 26px; padding: 0 9px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--mint); background: rgba(151, 252, 228, .08); }
.pcts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pcts button { height: 30px; border-radius: 9px; font: 500 12.5px var(--mono); color: var(--mute); background: rgba(233, 255, 248, .05); }
.pcts button:hover { background: rgba(233, 255, 248, .1); color: var(--pearl); }
.lev-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.lev-h span { font-size: 13px; color: var(--faint); }
.lev-h b { font-size: 16px; font-weight: 600; }
.lev-s { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); }
.sum { display: grid; gap: 7px; padding: 12px 0 2px; border-top: 1px solid var(--line2); }
.sum div { display: flex; justify-content: space-between; font-size: 13px; }
.sum dt { color: var(--faint); text-transform: lowercase; } .sum dd { color: var(--pearl); }
.btn.go { height: 52px; font-size: 16px; width: 100%; margin-top: auto; }
.btn.go.long { background: var(--mint); color: var(--ink); box-shadow: 0 14px 34px -14px rgba(151, 252, 228, .6); }
.btn.go.short { background: var(--dn); color: var(--ink); box-shadow: 0 14px 34px -14px rgba(237, 112, 136, .55); }
.tnote { font-size: 12.5px; color: var(--faint); text-align: center; margin-top: -4px; }

/* account */
.ac-rows { display: grid; gap: 8px; }
.ac-rows div { display: flex; justify-content: space-between; font-size: 13.5px; }
.ac-rows span { color: var(--faint); }
.ac-key { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: rgba(233, 255, 248, .04); }
.ac-key i { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: rgba(233, 255, 248, .2); flex: none; transition: background .3s, box-shadow .3s; }
.ac-key.live i { background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.ac-key b { display: block; font-size: 13.5px; font-weight: 600; }
.ac-key span { text-transform: lowercase; font-size: 12.5px; color: var(--faint); word-break: break-all; }
.ac-empty { font-size: 13px; color: var(--mint); }
.ac-empty a { text-decoration: underline; text-underline-offset: 2px; }
.truth { font-size: 11.5px; line-height: 1.5; color: var(--faint); }

/* positions / orders / seals */
.lpane { flex: 1; overflow: auto; padding: 6px 4px 8px; }
.empty { text-transform: lowercase; padding: 26px 14px; color: var(--faint); font-size: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-transform: lowercase; height: 32px; padding: 0 12px; text-align: right; font-weight: 500; font-size: 12px; color: var(--faint); white-space: nowrap; }
.tbl td { height: 40px; padding: 0 12px; text-align: right; font-family: var(--mono); font-size: 12.5px; border-top: 1px solid var(--line2); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; font-family: var(--sans); font-weight: 600; font-size: 13.5px; }
.tbl .mini { color: var(--pearl); background: rgba(233, 255, 248, .08); }
.seals { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; padding: 10px 12px 12px; }
.seal-art { position: relative; border-radius: 14px; background: rgba(1, 8, 6, .5); overflow: hidden; min-height: 200px; }
#sealCv { width: 100%; height: 100%; display: block; }
.seal-cap { text-transform: lowercase; position: absolute; left: 12px; bottom: 10px; font: 12px/1.45 var(--mono); color: var(--mute); }
.seal-cap b { display: block; font: 600 14px var(--sans); color: var(--pearl); }
.seal-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
#sRes { font: 12.5px var(--mono); color: var(--mute); }
#sRes.ok { color: var(--up); } #sRes.bad { color: var(--dn); }
.seal-list { display: grid; gap: 4px; max-height: 210px; overflow: auto; }
.srow { display: grid; grid-template-columns: 54px 74px 1fr auto auto; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; font: 12.5px var(--mono); text-align: left; background: rgba(233, 255, 248, .03); }
.srow.on, .srow:hover { background: rgba(151, 252, 228, .07); }
.si { color: var(--mint); } .st { color: var(--faint); } .sx { color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr { font-family: var(--sans); font-size: 12.5px; }
.sr.ok { color: var(--up); } .sr.bad { color: var(--dn); }

@media (max-width: 1280px) {
  .stats div:nth-child(4), .qchip { display: none; }
  .tgrid { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto; }
  .chart-p { grid-column: 1; grid-row: 1; min-height: 480px; }
  .ticket { grid-column: 2; grid-row: 1 / 3; }
  .book-p { grid-column: 1; grid-row: 2; height: 340px; }
  .acct { grid-column: 2; grid-row: 3; }
  .lower { grid-column: 1; grid-row: 3; }
}
@media (max-width: 860px) {
  .tbar { gap: 10px; padding: 0 12px; }
  .tbar .lock { font-size: 0; gap: 0; }
  .stats div:not(:first-child):not(:nth-child(2)) { display: none; }
  .stats { gap: 14px; }
  .tgrid { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .chart-p, .ticket, .book-p, .acct, .lower { grid-column: 1; grid-row: auto; }
  .chart-p { min-height: 360px; }
  .seals { grid-template-columns: 1fr; }
  .picker { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; }
}
@media (max-width: 520px) { .stats div:nth-child(2) { display: none; } .mkt-u { display: none; } }
