/* Terminal layout, shared by /app and /testnet. Loads after ui.css.
   Same grammar as the landing page: hairlines instead of boxes, mono labels in small caps, large mono
   numbers, text tabs, one accent, off-white for the primary action. Three columns: market rail, chart and
   tabs, order ticket. */
html, body { height: 100%; }
body { font-size: 13px; line-height: 1.45; overflow: hidden; }

/* ---------- top bar ---------- */
.top { height: 56px; display: flex; align-items: center; gap: 28px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 5; }
.top .brand { font-size: 15px; }
.top .env { font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); margin-left: -18px; }
.top .env.testnet { color: var(--acc); }
.searchbtn { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0; min-width: 0; border: 0; background: transparent; color: var(--mute); font-size: 13px; }
.searchbtn:hover { color: var(--fg); }
.searchbtn svg { flex: none; }
.searchbtn kbd { margin-left: 4px; }
.nav { display: flex; gap: 22px; margin-left: 4px; }
.nav a, .nav button, .nav .on { display: inline-flex; align-items: center; height: 56px; padding: 0; color: var(--mute); font-weight: 500; font-size: 13.5px; border-bottom: 1px solid transparent; margin-bottom: -1px; }
.nav a:hover, .nav button:hover { color: var(--fg); }
.nav .on { color: var(--fg); background: none; border-bottom-color: var(--fg); }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.feed { display: flex; align-items: center; gap: 8px; color: var(--mute); font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.acctchip { display: flex; align-items: stretch; gap: 28px; }
.acctchip > div, .acctchip > button { display: flex; flex-direction: column; justify-content: center; padding: 0; text-align: left; }
.acctchip .k { color: var(--faint); font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .14em; line-height: 1; margin-bottom: 5px; display: block; }
.acctchip .v { font: 500 13px var(--mono); line-height: 1; }
.acctchip button.addr:hover .v { color: var(--acc); }
.top .btn.primary { height: 34px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 304px minmax(0, 1fr) 344px; height: calc(100vh - 56px); }

/* text tabs replace the boxed segmented control everywhere in the terminal */
.seg { display: inline-flex; background: transparent; border: 0; border-radius: 0; padding: 0; gap: 16px; }
.seg button { height: 28px; padding: 0; border-radius: 0; color: var(--mute); font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; border-bottom: 1px solid transparent; }
.seg button:hover { color: var(--fg); }
.seg button.on { background: none; color: var(--fg); border-bottom-color: var(--fg); }

/* ---------- rail ---------- */
.rail { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.railhead { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.railhead input { width: 100%; height: 44px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-size: 13px; }
.railhead input:focus { border-bottom-color: var(--line3); }
.railfilters { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 40px; }
.railfilters .seg { flex: 1; gap: 16px; }
.railfilters .seg button { flex: none; }
.sort { height: 28px; padding: 0 18px 0 0; border: 0; border-radius: 0; background-color: transparent; background-position: right 0 center; color: var(--mute); font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; text-align: right; direction: rtl; }
.sort option { direction: ltr; text-transform: none; letter-spacing: 0; }
.sort:hover { color: var(--fg); }
.railcols { display: grid; grid-template-columns: 1fr 84px 56px; padding: 9px 16px 9px 56px; color: var(--faint); font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .14em; border-bottom: 1px solid var(--line); }
.railcols span:not(:first-child) { text-align: right; }
.mlist { overflow: auto; flex: 1; min-height: 0; }
.mrow { display: grid; grid-template-columns: 28px 1fr 84px 56px; gap: 12px; align-items: center; height: 54px; padding: 0 16px 0 14px; cursor: pointer; border-left: 2px solid transparent; border-bottom: 1px solid var(--line); transition: background .1s; }
.mrow:hover { background: var(--bg2); }
.mrow.sel { background: var(--panel); border-left-color: var(--acc); }
.mrow .avatar.sm { width: 28px; height: 28px; }
.mrow .nm { min-width: 0; }
.mrow .nm b { display: block; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .nm small { display: flex; gap: 6px; align-items: center; color: var(--faint); font: 400 11px var(--mono); white-space: nowrap; overflow: hidden; margin-top: 2px; }
.mrow .nm small .pill { display: none; }
.mrow.fomo .avatar { box-shadow: 0 0 0 1px rgba(255,90,31,.55); }
.mrow.pump .avatar { box-shadow: 0 0 0 1px rgba(143,227,178,.4); }
.mrow .px { text-align: right; }
.mrow .px b { display: block; font-weight: 500; font-size: 13px; }
.mrow .px small { font-size: 11px; }
.mrow svg { width: 56px; height: 22px; justify-self: end; }
.mrow.off .nm b, .mrow.off .px { opacity: .45; }
.modepill { display: inline-flex; align-items: center; height: 14px; padding: 0 4px; border-radius: 2px; font: 600 9px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.modepill.halted { background: var(--dnbg); color: var(--dn); } .modepill.reduce-only { background: var(--accbg); color: var(--acc); }
#showOff { margin: 0; height: 36px; width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; color: var(--mute); font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
#showOff:hover { background: var(--bg2); color: var(--fg); }

/* ---------- center ---------- */
.center { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.mhead { display: flex; align-items: center; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--line); height: 88px; flex: none; }
.mhead .ident { display: flex; align-items: center; gap: 14px; min-width: 220px; max-width: 42%; flex: 0 1 auto; }
.mhead .ident > div { min-width: 0; }
.mhead .avatar.lg { width: 44px; height: 44px; }
.mhead h1 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mhead .sub { display: block; color: var(--mute); font: 400 11.5px var(--mono); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mhead .sub > * { margin-right: 10px; vertical-align: middle; }
.mhead .sub .pill { height: auto; padding: 0; border: 0; font-size: 10px; letter-spacing: .12em; }
.mhead .sub .pill .dot { width: 5px; height: 5px; }
.mhead .price { display: flex; flex-direction: column; padding-left: 24px; border-left: 1px solid var(--line); min-width: 0; flex: 0 .15 auto; }
.mhead .price > div:first-child { display: flex; align-items: baseline; gap: 12px; }
.mhead .price b { font: 500 28px/1 var(--mono); letter-spacing: -.03em; }
.mhead .price span { font: 500 12.5px var(--mono); }
.markline { display: flex; align-items: center; gap: 8px; margin-top: 7px; font: 400 11.5px var(--mono); color: var(--mute); white-space: nowrap; overflow: hidden; min-width: 0; }
.markline > span { overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.markline > span:first-child { flex: none; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; color: var(--faint); }
.markline > button, .markline > a { flex: none; }
.markline button, .markline a { color: var(--acc); font-weight: 500; }
.markline button:hover, .markline a:hover { text-decoration: underline; }
.stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; min-height: 38px; padding: 8px 24px; border-bottom: 1px solid var(--line); flex: none; }
.stats:empty { display: none; }
.stat { display: flex; align-items: baseline; gap: 10px; padding: 0 18px; border-left: 1px solid var(--line); flex: none; }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat .k { color: var(--faint); font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .14em; white-space: nowrap; }
.stat .v { font: 500 12.5px var(--mono); white-space: nowrap; }
.chartwrap { position: relative; flex: 1 1 320px; min-height: 240px; border-bottom: 1px solid var(--line); }
#chart { position: absolute; inset: 0; }
.charttools { position: absolute; top: 12px; left: 24px; z-index: 2; display: flex; gap: 24px; align-items: center; }
.chartnote { color: var(--faint); font: 400 10.5px var(--mono); white-space: nowrap; }
@media (max-width: 1180px) { .chartnote { display: none; } }
.chartempty { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: var(--faint); font-size: 12.5px; }
.tabs { display: flex; align-items: center; gap: 20px; padding: 0 24px; border-bottom: 1px solid var(--line); height: 42px; flex: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { height: 42px; padding: 0; color: var(--mute); font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; border-bottom: 1px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--fg); }
.tabs button.on { color: var(--fg); border-bottom-color: var(--fg); }
.tabs button .mute { font-family: var(--mono); font-size: 10.5px; margin-left: 4px; letter-spacing: 0; }
.tabs .grow { flex: 1 0 8px; }
.tabs .meta { color: var(--faint); font: 400 11px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabbody { flex: 1 1 200px; min-height: 160px; overflow: auto; }
.tabbody table.t th { padding: 10px 24px; }
.tabbody table.t td { padding: 10px 24px; }
.tabbody .empty { padding: 36px 24px; }
.bottom { border-top: 1px solid var(--line); flex: 0 0 232px; display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.bottom .tabbody { flex: 1; }
.closebtns { display: inline-flex; gap: 12px; }
.closebtns button { height: 22px; padding: 0; border: 0; border-bottom: 1px solid var(--line3); border-radius: 0; color: var(--fg2); font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; background: transparent; }
.closebtns button:hover { border-color: var(--dn); color: var(--dn); }
.why-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.why-row p { margin: 4px 0 0; color: var(--fg2); font-size: 12.5px; line-height: 1.5; }
.why-row .nums { text-align: right; white-space: nowrap; }
.why-row .nums small { display: block; color: var(--faint); }
.flagform { grid-column: 2 / -1; display: flex; gap: 8px; margin-top: 8px; }
.flagform input { flex: 1; height: 30px; }
.moves td.why { text-align: left; white-space: normal; }

/* ---------- ticket ---------- */
.ticket { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; overflow: auto; overflow-x: hidden; background: var(--bg); }
.card { padding: 18px 22px 20px; border-bottom: 1px solid var(--line); }
.card h3 { margin: 0 0 14px; font: 500 10.5px var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: .14em; display: flex; align-items: center; gap: 8px; min-height: 28px; }
.card h3 .grow { flex: 1; }
.card h3 .pill { height: auto; padding: 0; border: 0; letter-spacing: .12em; color: var(--faint); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sides button { height: 40px; border-radius: var(--r); font-size: 13.5px; font-weight: 500; color: var(--mute); border: 1px solid var(--line2); background: transparent; transition: background .12s, color .12s, border-color .12s; }
.sides button.long { color: var(--up); border-color: rgba(61,220,132,.35); }
.sides button.short { color: var(--dn); border-color: rgba(255,77,94,.35); }
.sides button:hover { border-color: currentColor; }
.sides button.long.on { background: var(--up); color: #06110b; border-color: var(--up); }
.sides button.short.on { background: var(--dn); color: #1a0509; border-color: var(--dn); }
.field { margin-top: 16px; }
.field label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--faint); font: 500 9.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 4px; }
.field label b { color: var(--mute); font: 400 11px var(--mono); letter-spacing: 0; text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.amt { display: flex; align-items: center; background: transparent; border: 0; border-bottom: 1px solid var(--line2); border-radius: 0; padding: 0; height: 48px; transition: border-color .12s; }
.amt:focus-within { border-bottom-color: var(--fg); }
.amt .cur { color: var(--faint); font: 500 18px var(--mono); margin-right: 4px; }
.amt input { flex: 1; min-width: 0; background: transparent; border: 0; padding: 0; font: 500 26px var(--mono); letter-spacing: -.03em; }
.amt .unit { color: var(--faint); font: 500 10.5px var(--mono); letter-spacing: .12em; }
.amt.sm { height: 38px; } .amt.sm input { font-size: 16px; } .amt.sm .cur { font-size: 14px; }
.pcts { display: flex; gap: 18px; margin-top: 10px; }
.pcts button { height: 22px; padding: 0; border: 0; border-bottom: 1px solid transparent; border-radius: 0; color: var(--mute); font: 500 10.5px var(--mono); letter-spacing: .1em; background: transparent; }
.pcts button:hover { color: var(--fg); border-bottom-color: var(--fg); }
.levrow { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.levrow input[type=range] { flex: 1; -webkit-appearance: none; appearance: none; height: 1px; background: linear-gradient(90deg, var(--fg) var(--p, 20%), var(--line2) var(--p, 20%)); border-radius: 0; border: 0; padding: 0; }
.levrow input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--fg); border: 0; cursor: pointer; }
.levrow input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--fg); border: 0; cursor: pointer; }
.levval { font: 500 15px var(--mono); min-width: 44px; text-align: right; letter-spacing: -.02em; }
.levticks { display: flex; justify-content: space-between; color: var(--faint); font: 400 10px var(--mono); margin-top: 8px; padding: 0 1px; }
.levticks span.off { opacity: .3; cursor: help; }
.levhint button { color: var(--acc); font-weight: 500; margin-left: 6px; }
.levhint button:hover { text-decoration: underline; }
.summary { margin-top: 14px; display: grid; grid-template-columns: 1fr auto; row-gap: 0; font-size: 12px; }
.summary .pair { display: contents; }
.summary .k { color: var(--mute); padding: 7px 0; border-top: 1px solid var(--line); } .summary .v { text-align: right; padding: 7px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.summary .pair:first-child .k, .summary .pair:first-child .v, .summary > .k:nth-child(1), .summary > .v:nth-child(2) { border-top: 0; }
.submit { margin-top: 14px; width: 100%; height: 46px; border-radius: var(--r); font-size: 14px; font-weight: 500; letter-spacing: -.01em; color: #06110b; transition: filter .12s, transform .06s; }
.submit.long { background: var(--up); }
.submit.short { background: var(--dn); color: #1a0509; }
.submit.confirm { background: var(--fg); color: var(--bg); }
.submit:hover { filter: brightness(1.05); } .submit:active { transform: translateY(1px); }
.submit:disabled { filter: grayscale(.7); opacity: .4; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--mute); font-size: 12px; cursor: pointer; user-select: none; }
.check input { width: 14px; height: 14px; padding: 0; accent-color: var(--fg); margin: 0; }
.ticket .notice { margin-top: 14px; padding: 12px 0 0; border-top: 1px solid var(--line2); font-size: 12px; line-height: 1.5; color: var(--fg2); background: transparent; border-radius: 0; }
.ticket .notice.halted { border-top-color: var(--dn); } .ticket .notice.reduce-only, .ticket .notice.wallet { border-top-color: var(--acc); }
.posmini { display: grid; grid-template-columns: 1fr auto; font-size: 12.5px; }
.posmini .k { color: var(--mute); padding: 7px 0; border-top: 1px solid var(--line); } .posmini .v { text-align: right; padding: 7px 0; border-top: 1px solid var(--line); }
.posmini .k:nth-child(1), .posmini .v:nth-child(2) { border-top: 0; }
.acctgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.acctgrid .k { color: var(--faint); font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .14em; }
.acctgrid .v { font: 500 16px var(--mono); letter-spacing: -.02em; margin-top: 6px; }
.acctrow { display: flex; gap: 8px; margin-top: 18px; min-width: 0; }
.acctrow .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; }
.acctrow .amt { flex: 1.3 1 0; min-width: 0; padding: 0; }
.ticket .fine { margin-top: 12px; font-size: 11.5px; line-height: 1.55; color: var(--mute); }
.ticket .empty { text-align: left; padding: 4px 0; }
.ticket .connectcta .btn { width: 100%; height: 40px; margin: 12px 0 8px; }

/* ---------- overlays ---------- */
.sheet { position: fixed; inset: 56px 0 0 0; background: var(--bg); z-index: 20; display: none; overflow: auto; }
.sheet.open { display: block; }
.sheet .inner { max-width: 1160px; margin: 0 auto; padding: 48px 32px 96px; }
.sheet h2 { margin: 0; font-size: 34px; font-weight: 500; letter-spacing: -.03em; line-height: 1.05; }
.sheet .lead { color: var(--mute); margin: 10px 0 32px; font-size: 14px; max-width: 640px; }
.sheet .close { position: absolute; top: 18px; right: 24px; }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.disc { border: 0; border-top: 1px solid var(--line2); border-radius: 0; overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.disc h4 { margin: 0; padding: 12px 0; font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--mute); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.disc h4 .grow { flex: 1; }
.disc h4 .pill { height: auto; padding: 0; border: 0; }
.disc .rows { overflow: auto; }
.drow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.drow .nm { flex: 1; min-width: 0; }
.drow .nm b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drow .nm small { color: var(--faint); font: 400 11px var(--mono); }
.drow .val { text-align: right; font: 500 12.5px var(--mono); }
.lb { width: 100%; }
.palette { position: fixed; inset: 0; z-index: 30; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; background: rgba(11,11,10,.86); }
.palette.open { display: flex; }
.palbox { width: 640px; max-width: calc(100vw - 32px); background: var(--bg); border: 1px solid var(--line3); border-radius: var(--r); box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; }
.palbox input { width: 100%; height: 56px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-size: 15px; padding: 0 20px; }
.palbox .res { max-height: 420px; overflow: auto; padding: 8px; }
.pres { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r2); cursor: pointer; }
.pres:hover, .pres.on { background: var(--panel); }
.pres .nm { flex: 1; min-width: 0; }
.pres .nm b { font-weight: 500; font-size: 13px; }
.pres .nm small { color: var(--faint); margin-left: 8px; font-family: var(--mono); font-size: 11px; }
.pres .act { color: var(--acc); font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.dialogwrap { position: fixed; inset: 0; z-index: 35; display: none; align-items: center; justify-content: center; background: rgba(11,11,10,.8); padding: 16px; }
.dialogwrap.open { display: flex; }
.dialog { width: 480px; max-width: 100%; background: var(--bg); border: 1px solid var(--line3); border-radius: var(--r); padding: 26px 26px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: tin .18s ease-out; }
.dialog h2 { margin: 0 0 14px; font-size: 24px; line-height: 1.1; font-weight: 500; letter-spacing: -.03em; }
.dialog h2 em { font-style: normal; color: var(--acc); }
.dialog p { margin: 0 0 10px; color: var(--fg2); font-size: 13px; line-height: 1.55; }
.dialog p b { color: var(--fg); font-weight: 500; }
.dialog .share { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; font: 500 11px var(--mono); color: var(--mute); }
.dialog .share i { flex: 1; height: 4px; background: var(--panel2); position: relative; overflow: hidden; border-radius: 2px; }
.dialog .share i b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--acc); }
.dialog .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }

/* ---------- responsive ---------- */
.railtoggle { display: none; }
@media (max-width: 1180px) {
  .shell { grid-template-columns: minmax(0, 1fr) 320px; }
  .rail { position: fixed; left: 0; top: 56px; bottom: 0; width: 304px; z-index: 15; transform: translateX(-100%); transition: transform .18s; box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  .rail.open { transform: none; }
  .railtoggle { display: inline-flex; }
  .top { gap: 20px; padding: 0 16px; }
  .top .right { gap: 20px; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  .shell { grid-template-columns: 1fr; height: auto; }
  .ticket { border-left: 0; border-top: 1px solid var(--line); }
  .chartwrap { min-height: 300px; }
  .searchbtn span, .searchbtn kbd, .nav, .feed, .acctchip > div:not(:first-child) { display: none; }
  .top { gap: 12px; padding: 0 12px; }
  .top .env { margin-left: -4px; }
  .mhead { flex-wrap: wrap; gap: 12px; height: auto; padding: 14px 16px; }
  .mhead .ident { max-width: none; }
  .mhead .price { padding-left: 0; border-left: 0; width: 100%; }
  .markline { flex-wrap: wrap; white-space: normal; }
  .tabs { padding: 0 16px; gap: 16px; }
  .stats { padding: 8px 16px; }
  .tabs .meta { display: none; }
  .tabbody table.t th, .tabbody table.t td { padding: 10px 16px; }
  .card { padding: 18px 16px; }
  .charttools { left: 16px; }
  .cards3 { grid-template-columns: 1fr; }
}
/* ---------- trading lines on the chart (chart-lines.js) ---------- */
.chartlines { position: absolute; left: 0; top: 0; bottom: 0; width: 0; z-index: 3; pointer-events: none; }
.cl { position: absolute; left: 0; right: 0; top: 0; height: 0; color: var(--mute); will-change: transform; }
.cl .rule { position: absolute; left: 0; right: 0; top: 0; border-top: 1px dashed currentColor; opacity: .75; }
.cl.rule-solid .rule { border-top-style: solid; opacity: .9; }
.cl.rule-dotted .rule { border-top-style: dotted; }
.cl[data-edge="up"] .rule, .cl[data-edge="down"] .rule { display: none; }
.cl .tag { position: absolute; left: 56px; top: 0; transform: translateY(-50%); display: inline-flex; align-items: stretch; height: 22px; max-width: calc(100% - 80px); background: var(--bg); border: 1px solid currentColor; border-radius: var(--r2); font: 500 10.5px var(--mono); letter-spacing: .02em; white-space: nowrap; overflow: hidden; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.cl.high .tag { left: auto; right: 12px; }
.cl[data-edge="up"] .tag::before, .cl[data-edge="down"] .tag::before { display: inline-flex; align-items: center; padding: 0 0 0 7px; color: currentColor; font-size: 8px; }
.cl[data-edge="up"] .tag::before { content: "\25B2"; }
.cl[data-edge="down"] .tag::before { content: "\25BC"; }
.cl .tag > span { display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; color: var(--fg2); border-left: 1px solid var(--line2); }
.cl .tag > span:first-of-type { border-left: 0; }
.cl .tag > span.k { color: currentColor; text-transform: uppercase; letter-spacing: .1em; }
.cl .tag > span.up { color: var(--up); }
.cl .tag > span.dn { color: var(--dn); }
.cl .tag > span.mute { color: var(--mute); }
.cl .tag small { font: inherit; opacity: .75; }
.cl .tag button { display: inline-flex; align-items: center; padding: 0 9px; border-left: 1px solid var(--line2); color: var(--fg); font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.cl .tag button:hover { background: var(--panel2); }
.cl .tag button.x { font-size: 14px; letter-spacing: 0; color: var(--mute); padding: 0 8px; }
.cl .tag button.x:hover { color: var(--dn); }
.cl .tag button.confirm { background: var(--dn); color: #1a0509; }
.cl.draggable .tag { cursor: ns-resize; }
.cl.drag .tag { cursor: grabbing; box-shadow: 0 0 0 1px currentColor, 0 6px 20px rgba(0,0,0,.55); }
.cl.draft .tag { border-style: dashed; }
.cl.busy .tag { opacity: .55; }
.cl.long, .cl.tp { color: var(--up); }
.cl.short, .cl.sl, .cl.liq { color: var(--dn); }
.cl.limit { color: var(--blue); }
.cl.bad { color: var(--mute); }
.cl.bad .tag { border-style: dashed; }
@media (max-width: 860px) {
  .cl .tag { left: 44px; max-width: calc(100% - 52px); }
  .cl.high .tag { right: 8px; }
  .cl .tag > span.opt { display: none; }
}

/* ---------- 14 September 2026: navigation on phones, first-run note, alignment and mobile fixes ---------- */
/* the rail's column headers line up with the rows (the rows have a 12px gap the headers lacked) */
.railcols { grid-template-columns: 1fr 84px 56px; gap: 12px; padding-left: 54px; }
/* pages reachable from the rail drawer on phones, where the top navigation is hidden */
.railnav { display: none; padding: 12px 16px 16px; border-top: 1px solid var(--line); gap: 14px; flex-wrap: wrap; font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.railnav a { color: var(--mute); } .railnav a:hover { color: var(--fg); }
/* one-line orientation for a first visit, dismissed once */
.firstrun { display: flex; gap: 12px; align-items: center; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: var(--r); color: var(--fg2); font-size: 12.5px; line-height: 1.45; }
.firstrun span { flex: 1; }
/* the tab strip fades at its right edge when more tabs sit off screen */
.tabs { mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
/* chart provenance stays readable on laptops; it only hides on phones */
@media (max-width: 1180px) { .chartnote { display: block; } }
@media (max-width: 860px) {
  .railnav { display: flex; }
  .chartnote { display: none; }
  /* the free balance stays in the header on a phone; the unrealised figure is the one that goes */
  .acctchip > div:not(:first-child) { display: flex; }
  .acctchip > div:nth-child(2) { display: none; }
  /* the page is the only scroll container on a phone (the shell has no fixed height), so the tab body only scrolls sideways for wide tables */
  .tabbody { overflow: auto; min-height: 0; }
  .bottom { flex: none; }
  .bottom .tabbody { min-height: 0; }
  /* the stats row scrolls sideways instead of stacking three rows above the chart */
  .stats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .stats::-webkit-scrollbar { display: none; }
}
/* the top bar never wraps: on a narrow laptop the search label gives way first, then the navigation gap tightens */
.searchbtn span, .nav a, .nav button, .nav .on { white-space: nowrap; }
@media (max-width: 1240px) { .searchbtn span, .searchbtn kbd { display: none; } .nav { gap: 16px; } }
@media (max-width: 480px) {
  /* the phone top bar keeps the free balance, the figure that sizes an order; equity lives in the account tab */
  .acctchip > div:first-child { display: none; }
}
/* a book capped at 1x locks the slider; it reads as locked rather than broken */
.levrow input[type=range]:disabled { opacity: .35; cursor: not-allowed; }
.levrow input[type=range]:disabled::-webkit-slider-thumb { cursor: not-allowed; }
/* on a small laptop the top bar drops the unrealised chip and tightens its gaps so the free balance is never clipped */
@media (max-width: 1100px) {
  .top, .top .right, .acctchip { gap: 18px; }
  .acctchip > div:nth-child(2) { display: none; }
}

/* ---------- 14 September 2026: one terminal, two modes ---------- */
/* the mode switch sits next to the logo: practice (paper) or testnet (on chain) */
.modeseg { margin-left: -6px; gap: 10px; }
.modeseg button { height: 26px; font-size: 10.5px; }
.modeseg button.on[data-mode="testnet"] { color: var(--acc); border-bottom-color: var(--acc); }
/* books that are listed on chain carry a small badge in the rail; in testnet mode the others read as practice-only */
.chainpill { display: inline-block; margin-left: 6px; padding: 0 4px; height: 13px; line-height: 13px; border: 1px solid var(--line3); border-radius: 2px; font: 600 8.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc); vertical-align: 1px; }
.modepill.practice { background: var(--bg2); color: var(--mute); }
body.testnet .mrow.off .chainpill { opacity: .5; }
/* the wallet card, its steps and the wallet picker (formerly the venue page's own styles) */
.connectcta { padding: 2px 0 2px; color: var(--fg2); font-size: 12.5px; line-height: 1.55; }
.connectcta .btn { width: 100%; height: 40px; margin: 12px 0 8px; font-size: 13px; }
.connectcta a, .fine a, .notice a { color: var(--acc); }
.steps { display: flex; flex-direction: column; margin-top: 14px; border-top: 1px solid var(--line); }
.step { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--fg2); }
.step .n { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line3); display: grid; place-items: center; font: 500 10px var(--mono); color: var(--mute); flex: none; }
.step .grow { flex: 1; }
.step a { color: var(--acc); }
.step.done .n { background: var(--up); color: #06110b; border-color: var(--up); }
.step.done { color: var(--faint); }
.how { padding: 16px 18px; max-width: 760px; line-height: 1.6; color: var(--fg2); }
.how p { margin: 0 0 10px; }
.how b { color: var(--fg); font-weight: 500; }
.how a { color: var(--acc); }
.how table.t { max-width: 560px; }
.wopt { display: flex; align-items: center; gap: 12px; width: 100%; height: 48px; padding: 0 12px; margin-top: 8px; border: 1px solid var(--line2); border-radius: var(--r2); background: transparent; color: var(--fg); font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer; }
.wopt:hover { border-color: var(--fg2); }
.wopt img, .wopt .ph { width: 24px; height: 24px; border-radius: 6px; flex: none; }
.wopt .ph { background: var(--panel2); display: inline-block; }
.wopt small { margin-left: auto; color: var(--mute); font: 400 11px var(--mono); }
#walletCard.flash { animation: cardflash 1.6s ease-out; }
@keyframes cardflash { 0% { box-shadow: inset 0 0 0 2px var(--acc); } 100% { box-shadow: inset 0 0 0 2px transparent; } }
.ticket .notice .row { display: flex; }
@media (max-width: 860px) {
  /* on a phone the brand keeps its square and drops the word, so the mode switch and the balances fit */
  .top .brand { font-size: 0; gap: 0; }
  .top .brand i { width: 12px; height: 12px; }
  .modeseg { margin-left: 0; }
}
