@font-face { font-family: Plex; src: url(/fonts/plex.woff2) format('woff2'); font-weight: 100 700; font-display: swap; }
:root {
  --bg: #03131a; --panel: #05181f; --raise: #082129; --line: rgba(181, 244, 239, 0.09); --line2: rgba(181, 244, 239, 0.16);
  --fg: #e7f1ef; --mid: #a9c1bf; --dim: #6b8986; --accent: #b5f4ef; --ink: #071b20;
  --long: #9eeedd; --short: #ff8f7e; --long-bg: rgba(158, 238, 221, 0.1); --short-bg: rgba(255, 143, 126, 0.1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--fg); font: 400 13px/1.4 Plex, 'IBM Plex Sans', system-ui, sans-serif; font-feature-settings: 'tnum' 1; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; background: radial-gradient(120% 80% at 50% -10%, #0a2a33 0%, var(--bg) 55%) fixed; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
.muted { color: var(--mid); }
img { display: block; }

/* top bar */
.top { height: 58px; display: flex; align-items: center; gap: 22px; padding: 0 18px; border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.brand { color: var(--fg); text-decoration: none; font-weight: 500; font-size: 17px; letter-spacing: 0.02em; display: flex; align-items: center; }
.brand .dot { width: 4px; height: 4px; background: var(--accent); margin-left: 4px; margin-top: 8px; }
.market { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line2); border-radius: 6px; }
.market:hover { background: var(--raise); }
.market img { width: 20px; height: 20px; border-radius: 50%; }
.m-name { font-weight: 600; font-size: 15px; } .m-quote { color: var(--dim); } .chev { width: 12px; height: 12px; color: var(--mid); }
.stats { display: flex; gap: 26px; flex: 1; min-width: 0; overflow: hidden; }
.stats div { white-space: nowrap; } .stats dt { color: var(--dim); font-size: 11px; } .stats dd { font-size: 13px; }
.who { display: flex; align-items: center; gap: 10px; }
.who .addr { color: var(--mid); } .who .val { font-weight: 500; }

/* market picker */
.picker { position: absolute; top: 62px; left: 150px; width: 520px; max-height: 70vh; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; z-index: 20; display: flex; flex-direction: column; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5); }
.picker[hidden] { display: none; }
.picker input { margin: 12px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line2); border-radius: 6px; outline: none; }
.pick-head, .pick-row { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr 1fr; gap: 8px; padding: 8px 16px; align-items: center; }
.pick-head { color: var(--dim); font-size: 11px; } .pick-head span:not(:first-child), .pick-row span:not(:first-child) { text-align: right; }
.pick-list { overflow: auto; }
.pick-row { cursor: pointer; } .pick-row:hover, .pick-row.on { background: var(--raise); }
.pick-row .nm { display: flex; align-items: center; gap: 8px; } .pick-row img { width: 18px; height: 18px; border-radius: 50%; } .pick-row small { color: var(--dim); }

/* layout */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px 320px; grid-template-rows: minmax(420px, calc(100vh - 58px - 270px)) 270px; gap: 1px; background: var(--line); }
.panel { background: var(--bg); min-width: 0; min-height: 0; position: relative; }
.chart-panel { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; }
.book-panel { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; }
.ticket { grid-column: 3; grid-row: 1 / span 1; padding: 14px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.bottom { grid-column: 1 / span 2; grid-row: 2; display: flex; flex-direction: column; }
.account { grid-column: 3; grid-row: 2; padding: 14px; overflow: auto; }
.bar { height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; }
#chart { flex: 1; min-height: 0; }
.hint { color: var(--dim); font-size: 12px; margin-left: auto; margin-right: 14px; }
.credit { color: var(--dim); font-size: 11px; text-decoration: none; } .credit:hover { color: var(--mid); }

/* segmented controls and tabs */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.seg button { padding: 7px 0; border-radius: 4px; color: var(--mid); }
.seg button.on { background: var(--raise); color: var(--fg); }
.seg.small { grid-auto-columns: auto; } .seg.small button { padding: 4px 10px; font-size: 12px; }
.tabs { display: flex; gap: 18px; height: 100%; }
.tabs button { color: var(--dim); height: 100%; border-bottom: 1px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--fg); border-color: var(--accent); }
.tabs i { font-style: normal; color: var(--dim); }

/* book */
.book[hidden], .trades[hidden] { display: none; }
.book, .trades { flex: 1; overflow: hidden; display: flex; flex-direction: column; font-size: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 2.5px 12px; position: relative; cursor: default; }
.row span { position: relative; z-index: 1; } .row span:not(:first-child) { text-align: right; }
.row.head { color: var(--dim); font-size: 11px; padding: 8px 12px 6px; }
.row .depth { position: absolute; top: 0; bottom: 0; right: 0; z-index: 0; }
.ask .p { color: var(--short); } .bid .p { color: var(--long); }
.ask .depth { background: var(--short-bg); } .bid .depth { background: var(--long-bg); }
.ask, .bid { cursor: pointer; } .ask:hover, .bid:hover { background: var(--raise); }
#asks, #bids { flex: 1; display: flex; flex-direction: column; overflow: hidden; } #asks { justify-content: flex-end; }
.spread { padding: 6px 12px; color: var(--mid); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.spread b { color: var(--fg); font-weight: 500; font-size: 14px; }
#tradeRows { overflow: hidden; flex: 1; } #tradeRows .b .p { color: var(--long); } #tradeRows .a .p { color: var(--short); } #tradeRows span:last-child { color: var(--dim); }

/* ticket */
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side { padding: 10px 0; border-radius: 6px; background: var(--panel); color: var(--mid); font-weight: 500; border: 1px solid var(--line); }
.side.long.on { background: var(--long-bg); color: var(--long); border-color: rgba(158, 238, 221, 0.35); }
.side.short.on { background: var(--short-bg); color: var(--short); border-color: rgba(255, 143, 126, 0.35); }
.field { display: flex; flex-direction: column; gap: 6px; } .field > span { color: var(--dim); font-size: 12px; }
.field[hidden] { display: none; }
.inp { display: flex; align-items: center; background: var(--panel); border: 1px solid var(--line2); border-radius: 6px; }
.inp:focus-within { border-color: rgba(181, 244, 239, 0.45); }
.inp input { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 10px 12px; font-size: 14px; }
.unit { padding: 0 12px; color: var(--mid); font-size: 12px; height: 100%; border-left: 1px solid var(--line); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .quick button { padding: 5px 0; border: 1px solid var(--line); border-radius: 4px; color: var(--mid); font-size: 12px; }
.quick button:hover { color: var(--fg); border-color: var(--line2); }
.lev { display: flex; flex-direction: column; gap: 8px; } .lev-top { display: flex; justify-content: space-between; color: var(--dim); font-size: 12px; } .lev-top b { color: var(--fg); font-weight: 500; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 2px; background: var(--line2); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--accent); cursor: pointer; }
.check { display: flex; gap: 8px; align-items: center; color: var(--mid); cursor: pointer; }
.check input { accent-color: #b5f4ef; }
.tpsl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .tpsl[hidden] { display: none; }
.sum { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.sum div { display: flex; justify-content: space-between; } .sum dt { color: var(--dim); } .sum dd { color: var(--fg); }
.btn { padding: 9px 14px; border-radius: 6px; border: 1px solid var(--line2); color: var(--fg); white-space: nowrap; }
.btn:hover { background: var(--raise); }
.btn.primary { background: var(--accent); color: var(--ink); border-color: var(--accent); font-weight: 500; } .btn.primary:hover { background: #cdfaf6; }
.btn.ghost { border-color: transparent; color: var(--mid); }
.btn:disabled { opacity: 0.45; cursor: default; }
.submit { padding: 12px 0; font-weight: 600; font-size: 14px; border: 0; }
.submit.long { background: var(--long); color: var(--ink); } .submit.short { background: var(--short); color: #2a0b06; }
.submit.wait { background: var(--raise); color: var(--mid); }
.note { color: var(--dim); font-size: 12px; min-height: 16px; }

/* tables */
.table { flex: 1; overflow: auto; } .table[hidden] { display: none; }
.trow { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr 1fr 1fr 1.2fr 0.7fr; gap: 8px; padding: 8px 14px; align-items: center; border-bottom: 1px solid var(--line); }
.trow.h { color: var(--dim); font-size: 11px; position: sticky; top: 0; background: var(--bg); }
.trow .c { display: flex; align-items: center; gap: 8px; font-weight: 500; } .trow img { width: 16px; height: 16px; border-radius: 50%; }
.up { color: var(--long); } .dn { color: var(--short); }
.trow button { color: var(--mid); text-decoration: underline; text-underline-offset: 3px; justify-self: end; } .trow button:hover { color: var(--fg); }
.empty { padding: 26px 14px; color: var(--dim); }

/* account */
.account h3 { font-weight: 500; font-size: 14px; margin-bottom: 8px; }
.account .muted { font-size: 12px; line-height: 1.5; }
.account .sum { margin-top: 10px; border-top: 0; padding-top: 0; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; } .acts[hidden], .sum[hidden] { display: none; }
.private { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* modal + toast */
.modal { position: fixed; inset: 0; background: rgba(1, 8, 11, 0.72); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.sheet { width: min(480px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 26px; position: relative; }
.sheet .x { position: absolute; top: 12px; right: 14px; font-size: 22px; color: var(--mid); }
.sheet h2 { font-weight: 400; font-size: 24px; letter-spacing: -0.01em; margin-bottom: 10px; }
.sheet p { color: var(--mid); line-height: 1.55; margin-bottom: 14px; }
.sheet .steps { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 16px 0 20px; counter-reset: s; }
.sheet .steps li { padding-left: 30px; position: relative; color: var(--mid); line-height: 1.5; }
.sheet .steps li b { color: var(--fg); font-weight: 500; display: block; }
.sheet .steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line2); color: var(--mid); font-size: 11px; display: grid; place-items: center; }
.sheet .keybox { background: var(--bg); border: 1px solid var(--line2); border-radius: 6px; padding: 12px; word-break: break-all; font-size: 13px; margin-bottom: 14px; filter: blur(5px); cursor: pointer; transition: filter 0.2s; }
.sheet .keybox.shown { filter: none; }
.sheet .row2 { display: flex; gap: 8px; } .sheet .row2 .btn { flex: 1; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--raise); border: 1px solid var(--line2); padding: 11px 16px; border-radius: 8px; z-index: 60; max-width: min(560px, calc(100vw - 32px)); }
.toast.err { border-color: rgba(255, 143, 126, 0.5); }

/* narrower screens: one column, ticket under the chart */
@media (max-width: 1100px) {
  .stats div:nth-child(n+5) { display: none; }
  .grid { grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: 460px auto auto; }
  .chart-panel { grid-column: 1; grid-row: 1; } .book-panel { grid-column: 2; grid-row: 1; }
  .ticket { grid-column: 1; grid-row: 2; } .account { grid-column: 2; grid-row: 2; }
  .bottom { grid-column: 1 / span 2; grid-row: 3; min-height: 260px; }
}
@media (max-width: 720px) {
  .top { gap: 12px; padding: 0 12px; } .stats { display: none; } .brand { font-size: 15px; }
  .picker { left: 12px; right: 12px; width: auto; }
  .grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: 380px auto 360px auto 300px; }
  .chart-panel, .book-panel, .ticket, .account, .bottom { grid-column: 1; }
  .chart-panel { grid-row: 1; } .ticket { grid-row: 2; } .book-panel { grid-row: 3; } .account { grid-row: 4; } .bottom { grid-row: 5; }
  .trow { grid-template-columns: 1.2fr 1fr 1fr 1fr 0.8fr; } .trow > :nth-child(4), .trow > :nth-child(5), .trow > :nth-child(6) { display: none; }
}
/* some Hyperliquid coin icons are drawn without their own disc */
.market img, .pick-row img, .trow img { background: #e9f2f0; }

/* private balance */
.pbal { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 6px; } .pbal b { font-weight: 500; font-size: 20px; } .pbal span { color: var(--mid); }
.small { font-size: 12px; line-height: 1.5; margin-top: 6px; }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.sheet .steps.live li b { color: var(--mid); } .sheet .steps.live li span { display: block; font-size: 12px; color: var(--dim); }
.sheet .steps.live li.on b { color: var(--fg); } .sheet .steps.live li.on::before { border-color: var(--accent); color: var(--accent); }
.sheet .steps.live li.done::before { content: '✓'; background: var(--accent); color: var(--ink); border-color: var(--accent); }
.sheet .steps.live li.bad::before { content: '!'; background: var(--short); color: #2a0b06; border-color: var(--short); }

/* ===== desk layout: command row, market row, watchlist | chart | book | ticket, function tabs ===== */
.top { height: 52px; gap: 18px; }
.sub { height: 50px; display: flex; align-items: center; gap: 22px; padding: 0 18px; border-bottom: 1px solid var(--line); position: relative; z-index: 4; }
.sub .stats { gap: 24px; }
.cmd { flex: 1; max-width: 720px; position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 12px; background: var(--panel); border: 1px solid var(--line2); border-radius: 6px; }
.cmd:focus-within { border-color: rgba(181, 244, 239, 0.45); }
.cmd-ic { width: 14px; height: 14px; color: var(--dim); flex: none; }
.cmd input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 13px; }
.cmd input::placeholder { color: var(--dim); }
.cmd-list { position: absolute; top: 40px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; z-index: 30; padding: 6px 0; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5); max-height: 60vh; overflow: auto; }
.cmd-list[hidden] { display: none; }
.cmd-item { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 8px 14px; cursor: pointer; }
.cmd-item.on, .cmd-item:hover { background: var(--raise); }
.cmd-item img { width: 18px; height: 18px; border-radius: 50%; background: #e9f2f0; }
.cmd-item small { color: var(--dim); }
.cmd-item .k { color: var(--mid); }
.clock { color: var(--mid); white-space: nowrap; }
.picker { top: 108px; }
.grid { grid-template-columns: 236px minmax(0, 1fr) 280px 304px; grid-template-rows: minmax(420px, calc(100vh - 102px - 300px)) 300px; }
.watch { grid-column: 1; grid-row: 1 / span 2; display: flex; flex-direction: column; }
.chart-panel { grid-column: 2; grid-row: 1; } .book-panel { grid-column: 3; grid-row: 1; } .ticket { grid-column: 4; grid-row: 1; }
.bottom { grid-column: 2 / span 2; grid-row: 2; } .account { grid-column: 4; grid-row: 2; }
.ttl { font-weight: 500; }
.wrow { display: grid; grid-template-columns: 1.3fr 1fr 0.7fr; gap: 6px; padding: 5px 12px; align-items: center; font-size: 12px; cursor: pointer; }
.wrow span:not(:first-child) { text-align: right; } .wrow.head { color: var(--dim); font-size: 11px; cursor: default; padding-top: 8px; }
.wrow .nm { display: flex; align-items: center; gap: 7px; font-weight: 500; } .wrow img { width: 16px; height: 16px; border-radius: 50%; background: #e9f2f0; }
.wrow:not(.head):hover { background: var(--raise); } .wrow.on { background: var(--raise); box-shadow: inset 2px 0 0 var(--accent); }
.wlist { flex: 1; overflow: auto; }
.flash-up { animation: fu 0.9s; } .flash-dn { animation: fd 0.9s; }
@keyframes fu { from { color: var(--long); } } @keyframes fd { from { color: var(--short); } }
.tog { color: var(--dim); font-size: 12px; margin-left: 14px; } .tog.on { color: var(--fg); }
.tog.on::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--short); margin-right: 6px; vertical-align: 1px; }
.tabs { overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; } .tabs button { white-space: nowrap; }
.seg#otype button { font-size: 12px; }
.twap[hidden] { display: none; } .twap { display: flex; flex-direction: column; gap: 8px; } .twap .unit { border-left: 1px solid var(--line); }
#scaleField { grid-template-columns: 1fr 1fr 0.7fr; }

/* function tables */
.grid-t { display: grid; gap: 8px; padding: 7px 14px; align-items: center; border-bottom: 1px solid var(--line); font-size: 12px; }
.grid-t.h { color: var(--dim); font-size: 11px; position: sticky; top: 0; background: var(--bg); z-index: 1; }
.grid-t > span:not(:first-child) { text-align: right; }
.grid-t .c { display: flex; align-items: center; gap: 8px; font-weight: 500; } .grid-t img { width: 16px; height: 16px; border-radius: 50%; background: #e9f2f0; }
.t-liq { grid-template-columns: 1fr 1fr 1.6fr 1fr 0.6fr; }
.t-wh { grid-template-columns: 1fr 0.9fr 0.6fr 1fr 1fr 1fr 1fr 0.6fr 1fr; }
.t-fund { grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr; }
.t-pr { grid-template-columns: 0.8fr 0.9fr 0.6fr 1fr 1fr 1fr; }
.t-flow { grid-template-columns: 1fr 1fr 1fr; }
.t-ag { grid-template-columns: 70px 90px 1fr; } .t-ag > span:not(:first-child) { text-align: left; }
.bar-in { position: relative; height: 14px; }
.bar-in i { position: absolute; top: 3px; bottom: 3px; border-radius: 1px; }
.bar-in i.l { right: 50%; background: var(--long); opacity: 0.55; } .bar-in i.s { left: 50%; background: var(--short); opacity: 0.55; }
.split { display: grid; grid-template-columns: 1.4fr 1fr; height: 100%; } .split > div { overflow: auto; } .split > div + div { border-left: 1px solid var(--line); }
.sec { padding: 10px 14px 6px; color: var(--mid); font-size: 12px; }
.hype-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 100%; }
.hype-grid > div { overflow: auto; } .hype-grid > div + div { border-left: 1px solid var(--line); }
.kv { display: flex; justify-content: space-between; padding: 6px 14px; border-bottom: 1px solid var(--line); font-size: 12px; } .kv span:first-child { color: var(--dim); }
.big { font-size: 22px; font-weight: 500; padding: 4px 14px 10px; letter-spacing: -0.01em; }
.ag-head { display: flex; gap: 22px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ag-head label { display: flex; gap: 8px; align-items: center; color: var(--mid); cursor: pointer; font-size: 12px; } .ag-head label b { color: var(--fg); font-weight: 500; }
.guard-on { color: var(--accent) !important; }

@media (max-width: 1360px) { .grid { grid-template-columns: 0 minmax(0, 1fr) 270px 300px; } .watch { display: none; } .sub .stats div:nth-child(n+7) { display: none; } }
@media (max-width: 1100px) {
  .grid { grid-template-columns: minmax(0, 1fr) 290px; grid-template-rows: 460px auto auto; }
  .chart-panel { grid-column: 1; grid-row: 1; } .book-panel { grid-column: 2; grid-row: 1; } .ticket { grid-column: 1; grid-row: 2; } .account { grid-column: 2; grid-row: 2; }
  .bottom { grid-column: 1 / span 2; grid-row: 3; min-height: 340px; } .clock { display: none; }
}
@media (max-width: 720px) {
  .top { gap: 10px; } .cmd { display: none; } .sub { gap: 12px; padding: 0 12px; }
  .grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: 380px auto 360px auto 380px; }
  .chart-panel, .book-panel, .ticket, .account, .bottom { grid-column: 1; }
  .chart-panel { grid-row: 1; } .ticket { grid-row: 2; } .book-panel { grid-row: 3; } .account { grid-row: 4; } .bottom { grid-row: 5; }
  .t-wh { grid-template-columns: 1fr 0.9fr 1fr 1fr; } .t-wh > :nth-child(n+5):not(:last-child) { display: none; }
  .t-fund { grid-template-columns: 1fr 1fr 1fr 1fr; } .t-fund > :nth-child(n+5) { display: none; }
  .hype-grid, .split { grid-template-columns: 1fr; }
}
.acts2 { display: flex; gap: 14px; justify-content: flex-end; }
.hdr-link { color: var(--mid); text-decoration: none; } .hdr-link:hover { color: var(--fg); }
@media (max-width: 720px) { .hdr-link { display: none; } }
@media (max-width: 720px) { .chart-panel .credit, .chart-panel .hint { display: none; } .tog { margin-left: 8px; } .bar { padding: 0 8px; } }
/* same colours as the chart: longs liquidated (below) coral, shorts liquidated (above) mint */
.bar-in i.l { background: var(--short); } .bar-in i.s { background: var(--long); }
