/* Mercy: the trading screen.
   Desktop grid (1440): 8px gutter all round. Columns fluid + 296 + 336: 776 + 8 + 296 + 8 + 336 = 1424 = 1440 - 16.
   Rows: market bar 56, chart and book (fluid, about 475 at 900 tall), account and Mercy 280.
   The ticket runs from the market bar's top to the chart's foot, so it gets the height it needs. */

.menu-btn, .phone-menu, .phone-tabs, .pull-summary, .phone-bar, .scrim, .sheet-grip { display: none; }

.term {
  display: grid; gap: var(--gap); padding: var(--gap);
  grid-template-columns: minmax(0, 1fr) 296px 336px;
  grid-template-rows: 56px minmax(420px, 1fr) 300px;
  grid-template-areas: "market market ticket" "chart book ticket" "pos pos pull";
  height: calc(100dvh - 48px); min-height: 820px;
}
.market { grid-area: market; }
.chart-panel { grid-area: chart; }
.book-panel { grid-area: book; }
.ticket { grid-area: ticket; }
.positions { grid-area: pos; }
.pull { grid-area: pull; }

/* ---------- market bar ---------- */
.market { display: flex; align-items: center; gap: 24px; padding: 0 var(--card-pad); }
.market-pick { position: relative; display: flex; align-items: baseline; gap: 10px; flex: none; }
.market-pick h1 { font-size: var(--fs-title); font-weight: 700; letter-spacing: -0.01em; line-height: 1; }
#marketBtn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 6px 8px; margin: -6px -8px; border-radius: 8px; font-weight: 700; }
#marketBtn:hover { background: var(--hover); }
#marketBtn svg { color: var(--faint); transition: transform .15s ease-out; }
#marketBtn[aria-expanded="true"] svg { transform: rotate(180deg); }
.mk-name { color: var(--faint); }
.ticker { display: flex; gap: 22px; min-width: 0; overflow: hidden; }
.ticker div { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.ticker dt { font-size: var(--fs-small); color: var(--faint); }
.ticker dd { font-size: 14px; font-weight: 500; }
.ticker .tk-mark dd { font-weight: 700; }
@media (max-width: 1520px) { .ticker > div:last-child { display: none; } }

.market-menu { position: absolute; z-index: 30; top: calc(100% + 18px); left: -16px; width: 420px; background: var(--raised); border-radius: 14px; padding: 12px 0 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); } /* taste-skill-ignore: a menu floats */
.market-menu .seg { margin: 0 12px 8px; background: var(--surface); }
.market-menu td { border-top-color: #2B342E; height: 40px; cursor: pointer; }
.market-menu th:first-child, .market-menu td:first-child { padding-left: 16px; }
.market-menu tr[aria-selected="true"] td { background: #2C352F; }
.market-menu tbody tr:hover td { background: #2A332D; }
.market-menu .sym { font-weight: 700; margin-right: 8px; }
.market-menu .nm { color: var(--muted); }
.menu-note { margin: 8px 16px 0; font-size: var(--fs-small); color: var(--muted); }

/* ---------- chart ---------- */
.chart-panel { display: flex; flex-direction: column; overflow: hidden; }
.chart-head { display: flex; align-items: center; gap: 16px; height: 44px; padding: 0 12px; flex: none; }
.chart-head .seg { background: var(--ground); }
.ohlc { color: var(--faint); font-size: var(--fs-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ohlc b { color: var(--muted); font-weight: 500; margin-right: 10px; }
.ohlc b.up { color: var(--positive); }
.ohlc b.down { color: var(--negative); }
.chart-wrap { position: relative; flex: 1; min-height: 0; cursor: crosshair; }
.chart-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.chart-x { pointer-events: none; }
#chart text, .chart-x text { font: 400 12px var(--font); font-variant-numeric: tabular-nums; fill: var(--axis-ink); }
#chart .tag text { font-weight: 700; font-size: 12px; }
#chart .note { fill: var(--text); font-weight: 500; }
.chart-panel.snapping .chart-wrap { cursor: progress; }

/* ---------- order book and trades ---------- */
.book-panel { display: flex; flex-direction: column; overflow: hidden; }
.book-head { min-height: 44px; }
.book-head .tabs button { height: 44px; }
.book, .tape { display: flex; flex-direction: column; flex: 1; min-height: 0; padding-bottom: 8px; }
.book-cols, .asks li, .bids li, .tape li { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; padding: 0 var(--card-pad); }
.book-cols { height: 24px; color: var(--faint); font-size: var(--fs-small); flex: none; }
.book-cols span + span { text-align: right; }
.asks, .bids { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.asks { justify-content: flex-end; }
.tape li { height: 22px; }
.asks li, .bids li { flex: 1 0 22px; max-height: 27px; }
.asks li, .bids li, .tape li { position: relative; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.asks li span, .bids li span, .tape li span { position: relative; }
.asks li span + span, .bids li span + span, .tape li span + span { text-align: right; }
.asks li span:first-child { color: var(--negative); }
.bids li span:first-child { color: var(--positive); }
.asks li i, .bids li i { position: absolute; top: 1px; bottom: 1px; right: 0; }
.asks li i { background: rgba(255, 90, 78, .14); }
.bids li i { background: rgba(59, 232, 155, .14); }
.asks li:hover, .bids li:hover, .tape li:hover { background: var(--hover); }
.asks li.flash span:nth-child(3), .bids li.flash span:nth-child(3) { color: var(--text); }
.asks li span:nth-child(3), .bids li span:nth-child(3) { color: var(--muted); }
.spread { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 var(--card-pad); margin: 2px 0; background: var(--hover); flex: none; }
.spread b { font-size: 15px; font-weight: 700; }
.tape ol { flex: 1; overflow: hidden; }
.tape li span:nth-child(3) { color: var(--faint); }
.tape li .b { color: var(--positive); }
.tape li .s { color: var(--negative); }
.tape li.new { animation: tapeIn .4s ease-out; }
@keyframes tapeIn { from { background: var(--raised); } to { background: transparent; } }

/* ---------- order ticket ---------- */
.ticket { padding: 12px 0 0; overflow: hidden; display: flex; flex-direction: column; }
#orderForm { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.t-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 0 var(--card-pad) 4px; scrollbar-width: thin; }
.t-foot { flex: none; padding: 4px var(--card-pad) 12px; background: var(--surface); }
.t-foot .back-note { margin: 0 0 10px; }
.foot-back .back { margin-top: 0; }
.mode-row { display: flex; align-items: center; gap: 6px; }
.mode-row .avail { margin-left: auto; font-size: var(--fs-small); }
.mode-row .avail b { color: var(--muted); font-weight: 500; }
.side-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: var(--ground); border-radius: var(--radius-control); padding: 3px; }
.side-seg label { position: relative; }
.side-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.side-seg span { display: flex; align-items: center; justify-content: center; height: 30px; border-radius: 7px; color: var(--faint); font-weight: 700; transition: background-color .15s ease-out, color .15s ease-out; }
.side-seg label:hover span { color: var(--muted); }
.side-seg input[value="long"]:checked + span { background: var(--positive); color: var(--on-mint); }
.side-seg input[value="short"]:checked + span { background: var(--negative); color: #1A0503; }
.side-seg input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 1px; }
.order-type { height: 28px; gap: 16px; align-items: stretch; border-bottom: 1px solid var(--rule); }
.field { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: var(--fs-small); color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; }
.lbl b { color: var(--text); font-weight: 700; font-size: 13px; }
.input { display: flex; align-items: center; height: 40px; background: var(--ground); border-radius: var(--radius-nested); padding: 0 12px; gap: 8px; border: 1px solid transparent; transition: border-color .15s ease-out; }
.input:focus-within { border-color: var(--control); }
.input input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.input .max { font-size: 12px; padding: 4px 0 4px 8px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: none; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--raised); border-radius: 2px; }
input[type="range"]::-moz-range-track { height: 4px; background: var(--raised); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--text); border: 0; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 0; }
.lev-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin-top: -6px; }
.readout { display: flex; flex-direction: column; gap: 0; margin-top: 2px; }
.readout div { display: flex; justify-content: space-between; align-items: center; height: 21px; gap: 12px; }
.readout .fee-row dt { color: var(--text); }
.chip-off { opacity: .45; cursor: not-allowed; }
.tab-note { padding: 10px var(--card-pad); color: var(--faint); font-size: var(--fs-small); line-height: 1.45; border-top: 1px solid var(--rule); }
.tab-note b { color: var(--muted); font-weight: 500; }
.pos-body > .tab-note:first-child { border-top: 0; border-bottom: 1px solid var(--rule); }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; display: flex; align-items: center; gap: 14px; max-width: min(560px, calc(100vw - 32px)); padding: 10px 12px 10px 16px; background: var(--raised); color: var(--text); border: 1px solid var(--border); border-radius: 12px; font-size: 13px; line-height: 1.4; transition: opacity .2s ease-out, transform .2s ease-out; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast .btn-text { flex: none; color: var(--positive); font-weight: 700; min-height: 32px; }
.readout dt { color: var(--muted); white-space: nowrap; }
.readout dd { font-weight: 500; white-space: nowrap; }
.readout .liq { color: var(--loss); }
.readout .liq-row dt { color: var(--text); font-weight: 500; }
.readout .liq-row dd { font-weight: 700; }
.readout .back { height: 36px; margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--rule); }
.readout .back dt { color: var(--text); font-weight: 500; }
.readout .back dd { color: var(--positive); font-size: 18px; font-weight: 700; display: inline-flex; align-items: baseline; gap: 4px; letter-spacing: -0.01em; }
.back-note { margin-top: -8px; color: var(--faint); font-size: var(--fs-small); text-align: right; }
.place { width: 100%; height: 40px; }

/* ---------- account panel ---------- */
.positions { display: flex; flex-direction: column; overflow: hidden; }
.pos-head { gap: 20px; border-bottom: 1px solid var(--rule); }
.pos-head .tabs button { height: 44px; }
.tab-short { display: none; }
.finding { margin-left: auto; color: var(--muted); font-size: var(--fs-small); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.finding b { color: var(--text); font-weight: 500; }
.finding .up { color: var(--positive); font-weight: 500; }
.pos-body { flex: 1; min-height: 0; overflow: auto; }
.pos-body thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.pos-body tbody tr:first-child td { border-top-color: transparent; }
.mk { font-weight: 700; margin-right: 8px; }
.side-l { color: var(--positive); }
.side-s { color: var(--negative); }
.lev-t { color: var(--faint); }
td.back { color: var(--positive); font-weight: 500; }
td.liqp { color: var(--loss); }
td .sub { display: block; font-size: 12px; color: var(--faint); line-height: 1.2; }
td.act { width: 72px; text-align: right; }
.pos-body td { height: 46px; }
td.act .btn-sm { height: 26px; }
tr.gone td { color: var(--faint); }
tr.gone td .mk { color: var(--muted); }
tr.gone td.back { color: var(--positive); }
tr.snap td { animation: snapRow 1.2s ease-out; }
@keyframes snapRow { 0% { background: #3A1715; } 100% { background: transparent; } }
tr.arrive td { animation: arriveRow 1.6s ease-out; }
@keyframes arriveRow { 0% { background: #12291C; } 100% { background: transparent; } }
.m-sub, .m-act { display: none; }
.finding.flashed { color: var(--text); }
.acct-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--rule); flex: none; }
.acct-strip div { padding: 8px var(--card-pad) 10px; }
.acct-strip div + div { border-left: 1px solid var(--rule); }
.acct-strip dt { font-size: var(--fs-small); color: var(--faint); white-space: nowrap; }
.acct-strip dd { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-strip dd.pos-g { color: var(--positive); }
.acct-strip dd.changed { animation: arriveRow 1.6s ease-out; border-radius: 4px; }

/* ---------- Mercy panel: the screen's one field of brand colour, where the rebate lives ---------- */
.pull { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px var(--card-pad) var(--card-pad); background: var(--mint); color: var(--on-mint); overflow: hidden; }
.pull-head { display: flex; align-items: baseline; justify-content: space-between; }
.pull-head h2 { font-size: var(--fs-section); font-weight: 900; letter-spacing: -0.01em; }
.pull-head .meta { color: var(--on-mint-2); font-size: var(--fs-small); font-weight: 500; }
.pull-tier { position: relative; display: flex; align-items: flex-end; gap: 8px; min-height: 64px; }
.pull-words { flex: 1; min-width: 0; }
.pull-art { flex: none; width: 104px; height: 84px; margin: -30px -8px -6px 0; }
.pull-art img, .sum-art img, .rc-animal img { width: 100%; height: 100%; object-fit: contain; }
.tier-name { font-size: 30px; font-weight: 900; line-height: 1; letter-spacing: -0.03em; }
.tier-back { font-size: 15px; font-weight: 700; color: var(--on-mint); letter-spacing: 0; margin-left: 2px; }
.tier-note { font-size: var(--fs-small); color: var(--on-mint-2); margin-top: 6px; line-height: 1.35; }
.low { height: 62px; }
.low svg { width: 100%; height: 100%; display: block; overflow: visible; }
.low text { font: 500 12px var(--font); fill: var(--on-mint-2); font-variant-numeric: tabular-nums; }
.low text.min { fill: var(--on-mint); font-weight: 700; }
.cap { display: flex; flex-direction: column; gap: 6px; }
.cap-row { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-small); white-space: nowrap; color: var(--on-mint-2); }
.cap-row:first-child span { color: var(--on-mint); font-weight: 500; }
.cap-row b { font-weight: 700; color: var(--on-mint); }
.cap-track { height: 6px; border-radius: 3px; background: rgba(4, 20, 12, .16); overflow: hidden; }
.cap-track span { display: block; height: 100%; background: #fff; border-radius: 3px; transform-origin: left center; transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.pull-actions { display: flex; align-items: center; gap: 14px; margin-top: auto; }
.pull-actions .btn { flex: 1; }
.btn-ink { background: var(--on-mint); border-color: var(--on-mint); color: var(--mint); }
.btn-ink:hover { background: #12301F; border-color: #12301F; }
.pull .btn-ink[disabled], .pull-summary .btn-ink[disabled] { background: rgba(4, 20, 12, .14); border-color: transparent; color: var(--on-mint-2); }
.pull .btn-text { color: var(--on-mint); }
.pull .btn-text:hover { color: var(--on-mint-2); }
.pull :focus-visible, .pull-summary :focus-visible { outline-color: var(--on-mint); }

/* ---------- the liquidation receipt: the break, then the rebate landing on a mint field ---------- */
.receipt { width: 480px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); padding: 22px 24px 20px; border: 0; border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: auto; } /* taste-skill-ignore: a dialog floats */
.receipt::backdrop { background: rgba(2, 4, 3, .76); }
.receipt[open] { animation: rcIn .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes rcIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.rc-top { display: flex; justify-content: space-between; align-items: center; }
.rc-head { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 8px; align-items: end; }
.rc-break { width: 132px; height: auto; margin: 0 -12px 2px 0; }
.receipt h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; margin: 12px 0 10px; }
.receipt h2:focus { outline: none; }
.rc-rows div { display: flex; justify-content: space-between; align-items: center; height: 30px; border-top: 1px solid var(--rule); gap: 12px; }
.rc-rows dt { color: var(--muted); }
.rc-rows dd { font-weight: 500; white-space: nowrap; }
.rc-back { position: relative; margin: 16px 0 6px; padding: 16px 18px 14px; border-radius: 16px; background: var(--mint); color: var(--on-mint); }
.rc-back-lbl { font-weight: 700; padding-right: 120px; }
.rc-amt { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; font-size: 60px; font-weight: 900; letter-spacing: -0.04em; line-height: 1.05; }
.rc-amt .unit { font-size: 18px; font-weight: 700; letter-spacing: 0; color: var(--on-mint-2); }
.rc-coin { position: absolute; top: -26px; right: -14px; width: 132px; height: auto; transform: rotate(-8deg); transition: transform .5s cubic-bezier(.3, 1.6, .5, 1), opacity .3s ease-out; }
.rc-tier { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.rc-animal { flex: none; width: 52px; height: 46px; }
.rc-tier p { color: var(--on-mint-2); font-weight: 500; }
.rc-back.is-pending .rc-amt { opacity: .4; }
.rc-back.is-pending .rc-coin { opacity: .5; transform: rotate(-8deg) scale(.82); }
.rc-back.is-landed .rc-coin { animation: coinPop .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes coinPop { 0% { transform: rotate(-8deg) scale(.82); } 45% { transform: rotate(4deg) scale(1.12); } 100% { transform: rotate(-8deg) scale(1); } }
.rc-detail { margin-top: 10px; }
.rc-note { font-size: var(--fs-small); margin-top: 10px; }
.rc-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
/* the coins burst over the whole screen, above the dialog; shown only while they fly */
.burst-gl { position: fixed; inset: 0; z-index: 5; width: 100vw; height: 100dvh; pointer-events: none; display: block; }

/* ---------- tablet: the ticket keeps its column, the book narrows ---------- */
@media (max-width: 1240px) {
  .term { grid-template-columns: minmax(0, 1fr) 260px 312px; }
  .ticker .tk-opt { display: none; }
  .acct-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .acct-strip div:nth-child(4) { border-left: 0; }
  .acct-strip div:nth-child(n+4) { border-top: 1px solid var(--rule); }
  .term { grid-template-rows: 56px minmax(420px, 1fr) 330px; }
  .finding { display: none; }
}
@media (max-width: 1040px) {
  .topnav { display: none; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .term {
    height: auto; min-height: 0;
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-rows: 56px 440px 560px auto auto;
    grid-template-areas: "market market" "chart chart" "book ticket" "pos pos" "pull pull";
  }
  .pos-body { max-height: 320px; }
  .pull { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; row-gap: 12px; }
  .pull-head { grid-column: 1 / -1; }
  .pull-tier { grid-column: 1; grid-row: 2; }
  .low { grid-column: 1; grid-row: 3; }
  .cap { grid-column: 2; grid-row: 2; align-self: center; }
  .pull-actions { grid-column: 2; grid-row: 3; align-self: end; }
}

/* ---------- phone: tabs for chart, book and trades; the ticket is a bottom sheet ---------- */
@media (max-width: 760px) {
  body.trade { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .tab-long { display: none; }
  .tab-short { display: inline; }

  .term { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .market { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
  .market-pick { justify-content: space-between; }
  .ticker { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
  .ticker .tk-opt { display: none; }
  .ticker dt { font-size: 13px; }
  .ticker dd { font-size: 16px; }
  .market-menu { left: 0; right: 0; width: auto; position: fixed; top: 120px; margin: 0 8px; }
  .phone-tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); }
  .phone-tabs button { height: 44px; font-size: 14px; }
  .chart-head .seg button { height: 44px; min-width: 44px; font-size: 13px; }
  .chart-head { height: 56px; }
  .seg button, .btn-text { position: relative; }
  #resetBtn::before { inset: -6px 0; }
  .seg button::before, .btn-sm::before, .tabs button::before, .btn-text::before { content: ""; position: absolute; inset: -6px -2px; }
  .btn-sm { position: relative; height: 44px; padding: 0 16px; font-size: 13px; }
  td.act .btn-sm, .pos-body .btn-sm { height: 44px; }
  .tabs button { min-height: 44px; }
  .order-type { height: 44px; }
  .input { height: 48px; }
  .input input { font-size: 16px; }
  .input .max { position: relative; font-size: 13px; padding: 10px 2px 10px 10px; }
  input[type="range"] { height: 44px; }
  input[type="range"]::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -12px; }
  input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; }
  #marketBtn { min-height: 44px; }
  .chip { height: 36px; padding: 0 14px; font-size: 13px; }
  .check { min-height: 44px; font-size: 13px; }
  .check input { width: 20px; height: 20px; }
  .pos-head { -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent); padding-right: 40px; } /* taste-skill-ignore: a scroll-edge mask on a sideways row, not a fill */
  .chart-panel, .book-panel { height: 380px; flex: none; }
  .term[data-pane="chart"] .book-panel, .term[data-pane="book"] .chart-panel, .term[data-pane="trades"] .chart-panel { display: none; }
  .book-head { display: none; }
  .chart-head { padding: 0 8px; }
  .chart-head .ohlc { display: none; }

  .pull-summary { display: flex; align-items: center; gap: 8px; background: var(--mint); color: var(--on-mint); border-radius: var(--radius-card); padding: 8px 10px 8px 6px; }
  .sum-art { flex: none; width: 52px; height: 46px; }
  .pull-summary p { flex: 1; font-size: 13.5px; color: var(--on-mint-2); line-height: 1.35; }
  .pull-summary p b { color: var(--on-mint); font-weight: 700; }
  .pull-summary .btn { flex: none; height: 44px; }
  .pull-actions .btn { height: 44px; }

  .positions { overflow: visible; }
  .pos-head { overflow-x: auto; scrollbar-width: none; }
  .pos-head .tabs { gap: 16px; }
  .pos-body { overflow: visible; }
  .pos-body thead { display: none; }
  .pos-body tr { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 10px var(--card-pad); border-top: 1px solid var(--rule); column-gap: 12px; row-gap: 3px; }
  .pos-body tbody tr:first-child { border-top: 0; }
  .pos-body td { display: none; height: auto; padding: 0; border: 0; }
  .pos-body td.m-show { display: block; }
  .pos-body td.m-r { text-align: right; }
  .pos-body td.m-sub { display: block; grid-column: 1; color: var(--faint); font-size: 13px; white-space: normal; line-height: 1.45; }
  .pos-body td.m-sub b { color: var(--muted); font-weight: 500; }
  .pos-body td.m-sub .g { color: var(--positive); }
  .pos-body td.m-act { display: flex; grid-column: 2; justify-content: flex-end; align-self: end; }
  .pos-body td.m-sub:last-child { grid-column: 1 / -1; }
  .pos-body tbody tr:hover td { background: none; }
  .acct-strip { grid-template-columns: 1fr 1fr; }
  .acct-strip div { border-left: 0 !important; border-top: 1px solid var(--rule); }
  .acct-strip div:nth-child(even) { border-left: 1px solid var(--rule) !important; }

  .pull { padding-bottom: var(--card-pad); }
  .pull-actions { margin-top: 4px; }

  .ticket {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 90dvh; border-radius: 20px 20px 0 0;
    padding: 8px var(--card-pad) calc(16px + env(safe-area-inset-bottom)); background: var(--surface);
    transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -20px 60px rgba(0, 0, 0, .6); /* taste-skill-ignore: a bottom sheet floats */
    visibility: hidden;
  }
  .ticket.open { transform: none; visibility: visible; }
  .sheet-grip { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--control); margin: 0 auto 12px; }
  #orderForm { height: auto; }
  .t-scroll { overflow: visible; padding: 0; }
  .t-foot { padding: 10px 0 0; }
  .ticket { padding: 8px var(--card-pad) calc(16px + env(safe-area-inset-bottom)); overflow: auto; display: block; }
  .place { margin-top: 4px; height: 44px; }
  .scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(2, 4, 3, .6); }
  .phone-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--ground); border-top: 1px solid var(--border); }
  .phone-bar .btn { height: 48px; font-size: 16px; font-weight: 700; }
  .phone-bar .btn-long { background: var(--positive); border-color: var(--positive); color: var(--on-mint); }
  .phone-bar .btn-short { background: var(--negative); border-color: var(--negative); color: #1A0503; }
  body.trade { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); width: calc(100vw - 32px); }
  .toast .btn-text { min-height: 44px; }

  .receipt { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow-x: hidden; }
  .rc-head { grid-template-columns: minmax(0, 1fr) 96px; }
  .rc-break { width: 96px; }
  .receipt h2 { font-size: 19px; }
  .rc-amt { font-size: 50px; }
  .rc-coin { width: 112px; top: -26px; right: -8px; }
  .rc-back-lbl { padding-right: 96px; }
  .rc-actions .btn { flex: 1; height: 44px; }
}

/* ---------- demo states (?state=loading, ?state=error) ---------- */
.is-loading .num, .is-loading #ohlc { color: transparent !important; background: var(--raised); border-radius: 4px; }
.is-loading .num * { visibility: hidden; }
.chart-error { position: absolute; left: 16px; right: 16px; top: 16px; margin: 0; }
