/* /trade on top of ui.css: the coin on the paper band, a tape of the smallest markets, chart and
   ticket side by side, then every market in one table. Green is long, red is short. */

/* ---- the coin, on paper */
.pair { --band-pos: 12% 56%; padding-bottom: 40px; }
.pair-in { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; max-width: 1448px; margin: 0 auto; }
.pair-main { min-width: 0; flex: 1; }
.ident { display: flex; align-items: center; gap: 18px; min-width: 0; }
.ident img { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--glass-2); box-shadow: 0 0 0 1px var(--line), 0 10px 24px rgba(0, 0, 0, .12); }
.ident img:not([src]) { display: none; }
.ident .display { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(56px, 9vw, 136px); }
.pname { margin: 10px 0 0; font-size: clamp(18px, 2vw, 26px); line-height: 1.2; letter-spacing: -.02em; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { max-width: 640px; color: var(--soft); }
.stats b { margin-left: 6px; font-weight: 400; color: var(--ink); }
.kicker .link { font: inherit; letter-spacing: inherit; text-transform: none; }
.pair-price { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; width: min(420px, 40%); }
.pair-price .kicker { margin-bottom: 8px; }
.big { font-size: clamp(32px, 3.6vw, 52px); line-height: 1; letter-spacing: -.04em; font-weight: 500; transition: color .6s; }
.big.flash-up { color: var(--long); transition: none; }
.big.flash-down { color: var(--short); transition: none; }
.chg { margin-top: 8px; font-size: 14px; }
.search { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; margin-top: 26px; padding: 0 12px 0 14px; border-radius: 12px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line-2), 0 10px 30px -10px rgba(0, 0, 0, .18); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: box-shadow .2s, background .2s; text-align: left; }
.search:focus-within { background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink), 0 14px 36px -10px rgba(0, 0, 0, .22); }
.search svg { flex: none; width: 16px; height: 16px; color: var(--faint); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 14px; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line-2); font: 400 11px/1 var(--mono); color: var(--faint); }
.results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 15; max-height: 360px; overflow-y: auto; animation: line-in .2s ease both; }
.results button { cursor: pointer; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.results button:hover, .results button.on { background: var(--well); }
.results img, .results i { width: 26px; height: 26px; border-radius: 50%; background: var(--chip); object-fit: cover; }
.results b { display: block; font-weight: 500; }
.results small { display: block; color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .r { font: 400 12px/1.4 var(--mono); text-align: right; color: var(--soft); }
.results p { margin: 0; padding: 14px; color: var(--soft); }

/* ---- the tape: the smallest markets running past */
.tape { position: relative; overflow: hidden; border-block: 1px solid var(--line); background: var(--glass-2); -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.tape-in { display: flex; width: max-content; animation: tape 80s linear infinite; }
.tape:hover .tape-in { animation-play-state: paused; }
@keyframes tape { to { transform: translateX(-50%); } }
.tape button { cursor: pointer; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 22px; border: 0; border-right: 1px solid var(--line); background: none; white-space: nowrap; transition: background .15s; }
.tape button:hover { background: var(--paper); }
.tape img, .tape i { width: 22px; height: 22px; border-radius: 50%; background: var(--chip); object-fit: cover; }
.tape b { font-weight: 500; }
.tape .mono { font-size: 12px; color: var(--soft); }
.tape svg { width: 54px; height: 18px; }

/* ---- chart + ticket */
.desk { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 16px; max-width: 1448px; margin: 24px auto 0; padding: 0 24px; align-items: start; }
.left { display: grid; gap: 16px; min-width: 0; }
.chart .frame { position: relative; height: min(620px, 64vh); min-height: 420px; background: var(--paper); }
.chart iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.frame-load { position: absolute; inset: 0; display: grid; place-items: center; background: var(--paper); transition: opacity .4s; pointer-events: none; }
.frame-load.done { opacity: 0; }
.frame-load span { width: 160px; height: 1px; background: linear-gradient(90deg, transparent, var(--ink), transparent) 0 0 / 50% 100% no-repeat, var(--line-2); animation: scan 1.1s ease-in-out infinite; }
@keyframes scan { from { background-position: -100% 0, 0 0; } to { background-position: 200% 0, 0 0; } }
.pos-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; padding: 24px; text-align: center; }
.pos-empty b { font: 400 28px/1 var(--display); text-transform: uppercase; color: var(--ghost); letter-spacing: .01em; }
.pos-empty small { color: var(--faint); font-size: 13px; }
.pos-rows { font: 400 12px/1.4 var(--mono); }
.pos-rows > div { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr) 64px; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); animation: line-in .35s ease both; }
.pos-rows > div:last-child { border-bottom: 0; }
.pos-rows .h { padding: 9px 14px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); animation: none; }
.pos-rows b { font-weight: 500; }

.ticket { position: sticky; top: 80px; }
.t-body { padding: 4px 18px 20px; }
.sides { position: relative; margin: 0 0 24px; padding-bottom: 12px; font-size: 22px; letter-spacing: -.02em; }
.sides button { color: var(--faint); }
.sides button[data-side="long"][aria-selected="true"] { color: var(--long); }
.sides button[data-side="short"][aria-selected="true"] { color: var(--short); }
.side-ink { position: absolute; left: 0; bottom: 0; z-index: 1; height: 2px; width: 40px; border-radius: 2px; background: var(--long); transition: transform .35s cubic-bezier(.2, .8, .2, 1), width .35s, background .35s; }
.sides::after { opacity: .5; }
.lbl { display: block; font: 400 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .16em; color: var(--soft); }
.field { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 0 14px; border-radius: 10px; background: var(--well); box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .15s, background .15s; }
.field:focus-within { background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.field input { flex: 1; min-width: 0; height: 54px; border: 0; outline: 0; background: none; font-size: 24px; letter-spacing: -.03em; }
.field span { color: var(--soft); font-weight: 500; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.chips button { cursor: pointer; height: 30px; border: 0; border-radius: 8px; background: none; box-shadow: inset 0 0 0 1px var(--line); font: 400 12px/1 var(--mono); color: var(--soft); transition: box-shadow .15s, color .15s; }
.chips button:hover, .chips button.on { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.lev-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 26px 0 8px; }
.lev-head b { font: 400 56px/.85 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ticks { display: flex; justify-content: space-between; margin-top: 2px; font-size: 11px; color: var(--faint); }
.ticks button { cursor: pointer; border: 0; background: none; padding: 2px 0; color: inherit; font: inherit; }
.ticks button:hover { color: var(--ink); }

.meter { margin-top: 26px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; }
.meter-head b { font-size: 13px; font-weight: 500; }
.meter-wire { margin: 34px 4px 10px; }
.meter-wire i { transition: left .4s cubic-bezier(.2, .8, .2, 1); }
.meter-wire .liq { background: var(--short); }
.meter-wire .entry { background: var(--ink); }
.meter-wire .tag { position: absolute; bottom: 10px; transform: translateX(-50%); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); white-space: nowrap; transition: left .4s cubic-bezier(.2, .8, .2, 1); }
.meter-wire .liq-tag { color: var(--short); }
.meter-wire::before { content: ''; position: absolute; top: -1px; height: 3px; left: var(--from, 0); width: var(--span, 0); background: linear-gradient(90deg, var(--short), rgba(229, 72, 77, .15)); border-radius: 2px; transition: left .4s cubic-bezier(.2, .8, .2, 1), width .4s cubic-bezier(.2, .8, .2, 1); }
.meter-wire.short::before { background: linear-gradient(90deg, rgba(229, 72, 77, .15), var(--short)); }

.sum { margin: 22px 0 0; font-size: 12px; }
.sum > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.sum dt { color: var(--soft); font-family: Geist, system-ui, sans-serif; font-size: 13px; }
.sum dd { margin: 0; text-align: right; }
.go { cursor: pointer; position: relative; overflow: hidden; width: 100%; height: 52px; margin-top: 18px; border: 0; border-radius: 12px; color: #fff; font-size: 16px; font-weight: 500; letter-spacing: -.01em; transition: transform .15s, opacity .15s, background .3s; }
.go.long { background: var(--long); }
.go.short { background: var(--short); }
.go:hover { opacity: .92; }
.go:active { transform: scale(.985); }
.go[disabled] { cursor: default; opacity: .4; transform: none; }
.go::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%) -150% 0 / 60% 100% no-repeat; }
.go:not([disabled]):hover::after { animation: sheen .9s ease; }
@keyframes sheen { to { background-position: 250% 0; } }
.ticket .term { border-top: 1px solid var(--line); background: var(--sub); min-height: 128px; }

/* ---- every market */
.markets { max-width: 1448px; margin: 0 auto; padding: 120px 24px 0; }
.m-head { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.m-head h2 { margin: 0; font-size: clamp(34px, 4.4vw, 52px); font-weight: 500; line-height: 1.05; letter-spacing: -.045em; }
.m-head p { margin: 18px auto 0; max-width: 560px; font-size: 17px; line-height: 1.55; color: var(--soft); text-wrap: pretty; }
.m-tabs { justify-content: center; margin-top: 30px; font-size: 15px; }
.m-tabs::after { background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .4) 30%, rgba(0, 0, 0, .4) 70%, transparent); }
.table { font-size: 13px; }
.tr { display: grid; grid-template-columns: minmax(180px, 1.6fr) 1fr .6fr .6fr .7fr .9fr .9fr 100px 56px; gap: 14px; align-items: center; padding: 0 18px; }
.th { height: 40px; border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.th span:not(:first-child), #rows .tr > :not(:first-child) { text-align: right; justify-self: end; }
#rows .tr { cursor: pointer; width: 100%; height: 58px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font: inherit; animation: line-in .4s ease both; transition: background .15s; }
#rows .tr:last-child { border-bottom: 0; }
#rows .tr:hover { background: var(--hover); }
#rows .tr[aria-current] { background: var(--sel); }
#rows .num { font: 400 13px/1 var(--mono); font-variant-numeric: tabular-nums; }
.coin { display: flex; align-items: center; gap: 12px; min-width: 0; }
.coin img, .coin i { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--chip); object-fit: cover; }
.coin span { min-width: 0; }
.coin b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin small { display: block; color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark { width: 92px; height: 28px; }
.maxlev { font: 400 18px/1 var(--display); letter-spacing: .01em; }
.skel { height: 58px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, var(--skel), transparent) 0 0 / 40% 100% no-repeat; animation: scan 1.4s ease-in-out infinite; }
.empty { margin: 0; padding: 28px 18px; text-align: center; color: var(--soft); }

/* ---- connect sheet */
.sheet { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; background: var(--veil); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: line-in .2s ease both; }
.sheet .card { width: 100%; max-width: 380px; }
.wallets button { cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-weight: 500; font-size: 15px; }
.wallets button:hover { background: var(--well); }
.wallets img { width: 26px; height: 26px; border-radius: 6px; }
.wallets p { margin: 0; padding: 18px 16px; color: var(--soft); line-height: 1.55; }

@media (max-width: 1180px) {
  .tr { grid-template-columns: minmax(160px, 1.6fr) 1fr .6fr .7fr .9fr 92px 48px; }
  .tr > :nth-child(3), .tr > :nth-child(7) { display: none; }
}
@media (max-width: 960px) {
  .pair-in { flex-direction: column; align-items: stretch; gap: 28px; }
  .pair-price { width: 100%; align-items: flex-start; text-align: left; }
  .desk { grid-template-columns: minmax(0, 1fr); }
  .ticket { position: relative; top: 0; order: -1; }
  .left { display: contents; }
  .chart { order: -2; }
  .positions { order: 1; }
  .chart .frame { height: 420px; min-height: 0; }
}
@media (max-width: 720px) {
  .desk { padding: 0 12px; margin-top: 16px; gap: 12px; }
  .ident { gap: 12px; }
  .ident img { width: 44px; height: 44px; }
  .search kbd { display: none; }
  .markets { padding: 80px 12px 0; }
  .tr { grid-template-columns: minmax(0, 1fr) 76px 64px; gap: 10px; padding: 0 12px; }
  .tr > :nth-child(2), .tr > :nth-child(3), .tr > :nth-child(4), .tr > :nth-child(7), .tr > :nth-child(8), .tr > :nth-child(9) { display: none; }
  .pos-rows > div { grid-template-columns: 1.4fr 1fr 1fr 56px; }
  .pos-rows > div > :nth-child(3), .pos-rows > div > :nth-child(4) { display: none; }
}
.meter-wire .entry-tag { bottom: auto; top: 10px; transform: translateX(-100%); }
.meter-wire.short .entry-tag { transform: none; }
