:root {
  color-scheme: dark;
  --bg: #0a0c0b;
  --panel: #101312;
  --raised: #171b19;
  --hover: #202523;
  --line: #262c2a;
  --text: #e7eae8;
  --muted: #a0a9a6;
  --dim: #79837e;
  --mint: #b8e63c;
  --buy: #22c38a;
  --buy-bg: #22c38a1c;
  --sell: #f0556b;
  --sell-bg: #f0556b1c;
  --warn: #d6a94f;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration: none; }
dl, dd, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--mint); outline-offset: 1px; }
.num, td, dd, .book-row, .trade-row { font-variant-numeric: tabular-nums; }
.up { color: var(--buy) !important; }
.down { color: var(--sell) !important; }
.muted { color: var(--muted); }

/* top bar */
.top {
  height: 48px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.wordmark { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; letter-spacing: -.2px; color: var(--text); }
.brand-mark { display: block; border-radius: 6px; }
nav { display: flex; gap: 2px; }
nav a, nav button { padding: 6px 10px; border: 0; border-radius: 5px; background: none; color: var(--muted); }
nav a:hover, nav button:hover { color: var(--text); }
nav .active { color: var(--text); font-weight: 600; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.engine, .chain { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.engine i { width: 6px; height: 6px; border-radius: 50%; background: var(--buy); }
.engine.waiting i { background: var(--warn); animation: blink 1.2s ease-in-out infinite; }
.engine.offline i { background: var(--dim); }
@keyframes blink { 50% { opacity: .3; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border: 1px solid transparent; border-radius: 6px; font-weight: 600; white-space: nowrap; transition: filter 120ms, background-color 120ms; }
.btn:hover:enabled { filter: brightness(1.08); }
.btn-mint { background: var(--mint); color: #0d1108; }
.btn-buy { background: var(--buy); color: #04170f; }
.btn-sell { background: var(--sell); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--hover); color: var(--text); }
.btn-ghost:hover:enabled { background: var(--raised); filter: none; }
.btn-xs { height: 26px; padding: 0 10px; font-size: 12px; font-weight: 500; border-radius: 4px; }
.full { width: 100%; height: 40px; }
.change-badge, .mobile-tabs, .market-actions, .mobile-trades-title { display: none; }

/* market bar */
.market-bar { flex: none; display: flex; align-items: center; gap: 24px; height: 54px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.picker { position: relative; }
.pair { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 6px; border: 0; border-radius: 6px; background: none; font-size: 16px; font-weight: 600; }
.pair:hover, .pair[aria-expanded="true"] { background: var(--raised); }
.chev { width: 13px; height: 13px; color: var(--muted); }
.coin-icon { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(145deg, var(--c1, #4aa3ff), var(--c2, #1a5fb4)); color: #fff; font-size: 11px; font-weight: 700; }
.coin-icon.has-icon { background: none; overflow: hidden; }
.coin-icon img { width: 100%; height: 100%; object-fit: cover; }
.coin-icon[data-key="fLGNS"] { --c1: #3fd08a; --c2: #11804f; }
.coin-icon[data-key="aiLGNS"] { --c1: #a98bff; --c2: #5b3fd1; }
.coin-icon[data-key="nft"] { --c1: #ff8fb5; --c2: #c2386b; border-radius: 6px; }
.coin-icon[data-key="other"] { --c1: #8a8a8a; --c2: #4a4a4a; }
.market-menu { position: absolute; z-index: 40; top: 40px; left: 0; width: 360px; padding: 4px; border: 1px solid var(--hover); border-radius: 8px; background: var(--panel); box-shadow: 0 16px 40px #000c; }
.menu-head, .menu-row { display: grid; grid-template-columns: 1fr 110px 80px; align-items: center; gap: 8px; padding: 7px 10px; }
.menu-head { font-size: 11px; color: var(--dim); }
.menu-head span:not(:first-child), .menu-row span:not(:first-child) { text-align: right; }
.menu-row { width: 100%; border: 0; border-radius: 5px; background: none; text-align: left; }
.menu-row:hover, .menu-row.active { background: var(--raised); }
.menu-row strong { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.menu-row strong small { padding: 1px 5px; border-radius: 3px; background: var(--hover); font-size: 10px; font-weight: 500; color: var(--muted); }
.menu-row span { font-size: 12px; }
.ticker { display: flex; align-items: center; gap: 32px; overflow-x: auto; scrollbar-width: none; }
.ticker div { display: flex; flex-direction: column; white-space: nowrap; }
.ticker dt { font-size: 12px; color: var(--muted); }
.ticker dd { font-size: 13px; }
.ticker-main dd { font-size: 22px; font-weight: 600; line-height: 1.25; }

/* grid */
.trade-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px 320px;
  grid-template-rows: minmax(420px, 1fr) auto 260px;
  gap: 1px;
  background: var(--line);
}
.panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--panel); overflow: hidden; }
.chart-panel { grid-column: 1; grid-row: 1 / span 2; }
.book-panel { grid-column: 2; grid-row: 1 / span 2; }
.right-column { grid-column: 3; grid-row: 1 / span 3; min-width: 0; min-height: 0; overflow-y: auto; background: var(--panel); }
.form-panel { overflow: visible; padding: 14px; gap: 10px; }
.account-panel { padding: 14px; border-top: 1px solid var(--line); }
.bottom-panel { grid-column: 1 / span 2; grid-row: 3; }
.panel-tabs { flex: none; display: flex; align-items: center; gap: 20px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.tab { position: relative; height: 100%; padding: 0; border: 0; background: none; color: var(--muted); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); font-weight: 600; }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--mint); }
.count { margin-left: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }

/* chart */
.intervals { display: flex; gap: 2px; height: 100%; }
.intervals button { position: relative; height: 100%; padding: 0 8px; border: 0; background: none; color: var(--muted); font-size: 12px; }
.intervals button:hover { color: var(--text); }
.intervals button.active { color: var(--text); }
.intervals button.active::after { content: ""; position: absolute; bottom: 0; left: 8px; right: 8px; height: 2px; background: var(--mint); }
.chart-legend { position: absolute; top: 8px; left: 12px; z-index: 2; font-size: 11px; line-height: 1.7; color: var(--muted); pointer-events: none; }
.chart-legend b { font-weight: 500; color: var(--text); margin: 0 6px 0 2px; }
.chart-wrap { position: relative; flex: 1; min-height: 0; }
.chart-panel > small { flex: none; padding: 2px 12px 4px; text-align: right; font-size: 10px; color: var(--dim); }
#chart { position: absolute; inset: 0; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 13px; pointer-events: none; }

/* order book */
.book, .trades { flex: 1; min-height: 0; display: flex; flex-direction: column; font-size: 13px; }
.book-head { flex: none; display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 8px 14px 6px; font-size: 12px; color: var(--muted); }
.book-head span:not(:first-child), .book-row span:not(:first-child), .trade-row span:not(:first-child) { text-align: right; }
.book-columns { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.book-column { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.asks-column { order: 1; }
.spread { order: 2; }
.bids-column { order: 3; }
.book-column h4, .mobile-book-head, .mobile-book-title { display: none; }
.book-side { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.asks { flex-direction: column-reverse; }
.book-row { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; height: 22px; align-items: center; padding: 0 14px; cursor: pointer; flex: none; }
.book-row:hover { background: var(--raised); }
.book-row::before { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: var(--depth, 0%); transition: width 200ms; }
.asks .book-row::before { background: var(--sell-bg); }
.bids .book-row::before { background: var(--buy-bg); }
.book-row span { position: relative; }
.asks .book-row span:first-child { color: var(--sell); }
.bids .book-row span:first-child { color: var(--buy); }
.book-row.mine span:first-child::after { content: ""; display: inline-block; width: 4px; height: 4px; margin-left: 5px; border-radius: 50%; background: var(--mint); vertical-align: middle; }
.spread { flex: none; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px; border-block: 1px solid var(--line); }
.spread strong { font-size: 15px; font-weight: 600; }
.spread span { margin-left: auto; font-size: 11px; color: var(--muted); }
.spread.crossed span { color: var(--warn); }
.trades #tradeList { flex: 1; overflow-y: auto; }
.trade-row { display: grid; grid-template-columns: 1fr 1fr 1fr; height: 22px; align-items: center; padding: 0 14px; }
.trade-row span:last-child { color: var(--muted); }
.book-empty { padding: 18px 12px; color: var(--dim); text-align: center; }

/* order form */
.side-toggle { display: grid; grid-template-columns: 1fr 1fr; padding: 2px; border-radius: 6px; background: var(--raised); }
.side-toggle button { height: 32px; border: 0; border-radius: 4px; background: none; color: var(--muted); font-size: 13px; font-weight: 600; }
#sideBuy.active { background: var(--buy); color: #04170f; }
#sideSell.active { background: var(--sell); color: #fff; }
#orderForm { display: flex; flex-direction: column; gap: 8px; }
.guide-deviation { margin-left: 6px; font-style: normal; font-size: 11px; }
.price-chips:empty { display: none; }

.order-notes { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.nft-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 3px; }
.nft-chip { flex: none; padding: 5px 9px; border: 1px solid var(--hover); border-radius: 4px; background: none; font-size: 12px; }
.nft-chip.active { border-color: var(--mint); color: var(--text); }
.nft-chip small { margin-left: 4px; color: var(--muted); font-size: 10px; }
.token-input { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.token-input span { flex: none; white-space: nowrap; }
.token-input input { min-width: 0; width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font-size: 16px; }
.form-error { padding: 7px 10px; border-radius: 4px; background: var(--sell-bg); color: var(--sell); font-size: 12px; }
.assets-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.assets-heading h3, #nftAssets h3 { font-size: 13px; font-weight: 600; }
.assets-heading span { color: var(--muted); font-size: 11px; }
.asset-disconnected { display: grid; place-items: center; min-height: 96px; }
.credit-notice { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 4px; padding: 9px 10px; border: 1px solid var(--hover); border-radius: 6px; color: var(--text); font-size: 11px; }
.asset-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.asset-row .coin-icon { width: 26px; height: 26px; }
.asset-name { flex: 1; min-width: 0; }
.asset-name strong, .asset-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-name small, .asset-balance small { color: var(--muted); font-size: 11px; }
.asset-balance { text-align: right; overflow-wrap: anywhere; }
.asset-balance small { display: block; }
#nftAssets { padding-top: 16px; }
.nft-collection { padding: 12px 0; border-bottom: 1px solid var(--line); }
.nft-collection-head { display: flex; justify-content: space-between; gap: 8px; }
.nft-collection-head span { color: var(--muted); font-size: 11px; }
.nft-hint { margin-top: 6px; color: var(--muted); font-size: 11px; }

.available, .compact-label { color: var(--muted); font-size: 12px; }
.compact-field { display: flex; align-items: center; gap: 12px; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--hover); border-radius: 6px; background: var(--bg); transition: border-color 120ms; }
.compact-field:hover { border-color: var(--dim); }
.compact-field:focus-within { border-color: var(--mint); }
.compact-field > span { flex: none; color: var(--muted); font-size: 12px; white-space: nowrap; }
.compact-field input { flex: 1; width: 0; min-width: 0; padding: 0; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 500; text-align: right; }
.compact-field input::placeholder { color: var(--dim); font-weight: 400; }
.ticks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 2px; border-radius: 5px; background: var(--raised); }
.ticks button { height: 28px; padding: 0; border: 0; border-radius: 3px; background: none; color: var(--muted); font-size: 12px; }
.ticks button:hover, .ticks button.active { background: var(--hover); color: var(--text); }
.price-chips { display: flex; justify-content: space-between; gap: 12px; }
.price-chips button { display: flex; align-items: center; gap: 5px; min-height: 28px; white-space: nowrap; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; }
.price-chips button strong { color: var(--text); font-weight: 500; }
.price-chips button:hover strong { text-decoration: underline; }
#useFast:not(.applied) span { color: var(--mint); }
.result-block { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
#resultRows { display: contents; }
#resultRows:empty { display: none; }
.result-detail { color: var(--muted); font-size: 11px; line-height: 1.5; }
.result-line { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.result-line span:last-child { color: var(--text); }
.result-line .partial { color: var(--warn) !important; }
.result-line strong { color: var(--text); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
#submitOrder { height: 44px; margin-top: 2px; font-size: 14px; }
.sell-hint { color: var(--muted); font-size: 11px; line-height: 1.5; }
.trade-notes { padding: 11px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.trade-notes summary { display: flex; justify-content: space-between; cursor: pointer; list-style: none; color: var(--muted); font-size: 12px; }
.trade-notes summary::-webkit-details-marker { display: none; }
.trade-notes summary::after { content: "+"; color: var(--dim); }
.trade-notes[open] summary::after { content: "−"; }
.trade-notes summary:hover { color: var(--text); }

/* bottom table */
.only-market { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.only-market input { accent-color: var(--mint); }
.table-wrap { flex: 1; min-height: 0; overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 0 12px; text-align: right; }
th { position: sticky; top: 0; z-index: 1; height: 30px; background: var(--panel); font-size: 11px; font-weight: 400; color: var(--muted); }
td { height: 38px; border-top: 1px solid var(--line); font-size: 12px; }
th:first-child, td:first-child { padding-left: 16px; text-align: left; }
td:nth-child(2) { font-size: 13px; font-weight: 600; }
td:nth-child(3) { font-size: 13px; }
td a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
td a:hover { color: var(--text); }
tbody tr:hover { background: var(--raised); }
.record-market { display: flex; align-items: baseline; gap: 10px; }
.record-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.record-title strong { font-size: 13px; font-weight: 600; }
.record-market small, .record-quote { color: var(--muted); font-size: 11px; font-weight: 400; }
.record-buy, .record-sell { align-self: center; padding: 1px 5px; margin-right: 3px; border-radius: 3px; font-size: 11px; line-height: 1.35; font-weight: 600; }
.record-buy { color: var(--buy); background: var(--buy-bg); }
.record-sell { color: var(--sell); background: var(--sell-bg); }
.record-market small { line-height: 1.4; }
.bottom-empty { display: grid; place-items: center; height: calc(100% - 30px); min-height: 90px; color: var(--dim); font-size: 12px; }

#notice { position: fixed; z-index: 50; right: 16px; bottom: 16px; max-width: min(400px, calc(100% - 32px)); padding: 11px 14px; border: 1px solid var(--hover); border-radius: 6px; background: var(--raised); box-shadow: 0 12px 32px #000c; overflow-wrap: anywhere; animation: rise 160ms ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.row-actions { display: inline-flex; gap: 6px; }
.sheet-dialog { width: min(360px, calc(100% - 32px)); padding: 18px 16px 16px; border: 1px solid var(--hover); border-radius: 8px; background: var(--panel); color: var(--text); }
.sheet-dialog::backdrop { background: #000a; }
.sheet-dialog form { display: flex; flex-direction: column; gap: 12px; }
#repriceTitle { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; }
#repriceNote { margin-top: -4px; }
.sheet-dialog input { font-size: 16px; }
.reprice-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.reprice-slip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dialog-actions .btn { height: 38px; }
/* nft market */
.nft-panel { display: none; grid-column: 2; grid-row: 1 / span 2; overflow-y: auto; }
body.nft-market .nft-panel { display: flex; }
body.nft-market .book-panel, body.nft-market .form-panel, body.nft-market .trade-notes { display: none !important; }
body.nft-market .account-panel { border-top: 0; }
.nft-more { align-self: center; margin: 0 0 14px; }
.nft-fee { margin-left: auto; color: var(--muted); font-size: 11px; }
.nft-filters { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 2px; }
.nft-filter { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nft-filter-label { flex: none; margin-right: 8px; color: var(--dim); font-size: 11px; }
.nft-filter button { flex: none; height: 26px; padding: 0 9px; border: 0; border-radius: 4px; background: none; color: var(--muted); font-size: 12px; }
.nft-filter button:hover { color: var(--text); }
.nft-filter button.active { background: var(--hover); color: var(--text); font-weight: 600; }
.nft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 12px 14px; }
.nft-grid-small { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); padding: 8px 0 4px; }
.nft-card { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); text-align: left; overflow: hidden; transition: border-color 120ms; }
.nft-card:hover:enabled { border-color: var(--dim); }
.nft-card:disabled { opacity: .7; }
.nft-card.selected, .nft-card.selected:hover:enabled { border-color: var(--mint); }
.nft-art { position: relative; aspect-ratio: 1; display: grid; place-items: center; margin-bottom: 7px; background: #0d100f; color: var(--dim); }
.nft-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.nft-check { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: var(--mint); color: #0d1108; font-style: normal; font-size: 11px; font-weight: 700; }
.nft-card strong, .nft-card small, .nft-card b, .nft-card em { padding: 0 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nft-card strong { font-size: 12px; font-weight: 600; }
.nft-card small { min-height: 15px; color: var(--muted); font-size: 11px; }
.nft-card b { margin-top: 4px; font-size: 13px; font-weight: 600; }
.nft-card em { color: var(--muted); font-style: normal; font-size: 10px; white-space: normal; }
.nft-sheet { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; gap: 9px; margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--hover); background: var(--panel); }
.nft-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nft-sheet-head button { width: 26px; height: 26px; border: 0; border-radius: 4px; background: none; color: var(--muted); font-size: 16px; }
.nft-buy-bar { flex-direction: row; align-items: center; justify-content: space-between; }
.nft-buy-bar div { display: flex; flex-direction: column; }
.nft-buy-bar span { color: var(--muted); font-size: 12px; }
.nft-buy-bar .btn { min-width: 120px; height: 38px; }
@media (min-width: 761px) {
  body.nft-market .trade-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr) 320px; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .trade-grid { grid-template-columns: minmax(0, 1fr) 240px 270px; }
  .top { gap: 12px; }
  .ticker { gap: 18px; }
}
@media (max-width: 760px) {
  html, body { height: auto; min-height: 100%; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .top { position: sticky; top: 0; z-index: 30; gap: 6px; padding: 0 12px; }
  .wordmark span, nav, .chain, #engineText { display: none; }
  .pair { height: 40px; padding: 0; gap: 4px; font-size: 16px; }
  .picker { position: static; }
  .change-badge { display: block; padding: 3px 5px; border-radius: 4px; background: var(--raised); font-size: 10px; white-space: nowrap; }
  .top-right { gap: 9px; }
  .engine { height: auto; padding: 0; border: 0; }
  #connect { height: 30px; padding: 0 9px; font-size: 11px; }
  .market-menu { position: fixed; top: 48px; left: 0; width: 100%; border-radius: 0 0 8px 8px; }
  .market-bar { display: none; height: auto; padding: 14px 14px 12px; border-bottom: 0; }
  body[data-view="market"] .market-bar { display: block; }
  .ticker { display: grid; width: 100%; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: repeat(2, auto); gap: 10px 8px; overflow: visible; }
  .ticker > div { min-width: 0; }
  .ticker-main { grid-column: 1; grid-row: 1; }
  .ticker-main dt { display: none; }
  .ticker .ticker-main dd { font-size: 22px; }
  .ticker > div:nth-child(2) { grid-column: 1; grid-row: 2; }
  .ticker > div:nth-child(2) dt { display: none; }
  .ticker > div:nth-child(3) { grid-column: 2; grid-row: 1; }
  .ticker > div:nth-child(4) { grid-column: 3; grid-row: 1; }
  .ticker > div:nth-child(5) { grid-column: 2; grid-row: 2; }
  .ticker > div:nth-child(6) { grid-column: 3; grid-row: 2; }
  .ticker > div:nth-child(7) { display: none; }
  .ticker dd { font-size: 13px; }
  .trade-grid { display: grid; flex: none; min-width: 0; gap: 0; background: var(--bg); grid-template-columns: minmax(0, 57fr) minmax(0, 43fr); grid-template-rows: auto; }
  .right-column { display: contents; }
  .account-panel, .trade-notes { border-top: 0; }
  .compact-field { height: 40px; padding: 0 10px; gap: 8px; }
  .form-panel .compact-field input::placeholder { font-size: 14px; }
  .side-toggle button, .ticks button { min-height: 40px; }
  .price-chips button { min-height: 32px; }
  body[data-view="account"]:has(#assetDisconnected:not([hidden])) #connect { display: none; }
  .chart-panel, .book-panel, .form-panel, .account-panel, .bottom-panel { display: none; grid-column: auto; grid-row: auto; }
  body[data-view="market"] .chart-panel { display: flex; grid-column: 1 / -1; height: max(320px, 52vh); }
  body[data-view="market"] .book-panel { display: flex; grid-column: 1 / -1; margin-top: 6px; padding-bottom: 70px; }
  body[data-view="market"] .book-panel > .panel-tabs, body[data-view="market"] #bookView { display: none !important; }
  body[data-view="market"] #tradesView { display: flex !important; }
  .mobile-trades-title { display: block; padding: 12px; font-size: 14px; font-weight: 600; }
  body[data-view="trade"] .form-panel { display: flex; grid-column: 1; grid-row: 1; overflow: visible; padding: 12px 8px 14px 12px; gap: 8px; }
  body[data-view="trade"] .book-panel { display: flex; grid-column: 2; grid-row: 1; padding: 12px 8px 0 4px; }
  body[data-view="trade"] .book-panel > .panel-tabs, body[data-view="trade"] #tradesView { display: none !important; }
  body[data-view="trade"] #bookView { display: flex !important; flex: none; }
  body[data-view="trade"] .book-columns { display: flex; flex: none; flex-direction: column; }
  body[data-view="trade"] .book-column { flex: none; min-width: 0; }
  body[data-view="trade"] .book-head, body[data-view="trade"] .book-row { grid-template-columns: 1fr 1fr; padding-left: 4px; padding-right: 4px; font-size: 12px; }
  body[data-view="trade"] .book-row { font-size: 13px; }
  body[data-view="trade"] .book-head span:last-child, body[data-view="trade"] .book-row span:last-child { display: none; }
  body[data-view="trade"] .asks .book-row:nth-child(n+8), body[data-view="trade"] .bids .book-row:nth-child(n+8) { display: none; }
  body[data-view="trade"] .book-side { flex: none; min-height: 147px; }
  body[data-view="trade"] .spread { display: flex; height: auto; min-height: 42px; padding: 4px; flex-direction: column; align-items: flex-start; gap: 0; }
  body[data-view="trade"] .spread span { margin: 0; font-size: 11px; }
  body.nft-market[data-view="trade"] .nft-panel { display: flex; grid-column: 1 / -1; grid-row: 1; min-height: 50vh; overflow: visible; }
  body.nft-market:not([data-view="trade"]) .nft-panel { display: none; }
  .nft-grid, .nft-grid-small { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .nft-grid { padding: 10px 8px; }
  .nft-card { padding-bottom: 6px; border-radius: 8px; }
  .nft-art { margin-bottom: 4px; }
  .nft-card strong, .nft-card small, .nft-card b, .nft-card em { padding: 0 5px; }
  .nft-card strong { font-size: 10px; }
  .nft-card small, .nft-card em { font-size: 9px; }
  .nft-card small { min-height: 12px; }
  .nft-card b { margin-top: 1px; font-size: 11px; }
  .nft-check { top: 4px; right: 4px; width: 16px; height: 16px; font-size: 10px; }
  .nft-sheet { position: fixed; z-index: 34; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); }
  .nft-sheet input { font-size: 16px; }
  body.nft-market[data-view="trade"] .nft-grid { padding-bottom: 96px; }
  body[data-view="trade"] .trade-notes { display: block; grid-column: 1 / -1; grid-row: 2; margin-top: 6px; background: var(--panel); }
  body:not([data-view="trade"]) .trade-notes { display: none; }
  body[data-view="trade"] .bottom-panel { display: flex; grid-column: 1 / -1; grid-row: 3; margin-top: 6px; min-height: 180px; }
  body[data-view="account"] .account-panel { display: flex; grid-column: 1 / -1; padding: 18px 16px; }
  .intervals { width: 100%; justify-content: space-between; }
  .intervals button { white-space: nowrap; padding: 0 6px; }
  .only-market { font-size: 12px; white-space: nowrap; }
  .bottom-panel .panel-tabs { gap: 14px; height: 46px; }
  .bottom-panel .tab { font-size: 14px; }
  .table-wrap { overflow: visible; }
  #bottomTable, #bottomBody { display: block; width: 100%; white-space: normal; }
  #bottomHead { display: none; }
  #bottomBody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 6px 10px; margin: 0 14px; padding: 10px 0; }
  #bottomBody tr + tr { border-top: 1px solid #353d39; }
  #bottomBody td { min-width: 0; height: auto; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere; }
  #bottomBody td:first-child { grid-column: 1 / -1; }
  #bottomBody td:last-child { grid-column: 2 / -1; }
  #bottomBody td:nth-child(3) { text-align: center; }
  #bottomBody td:nth-child(4), #bottomBody td:last-child { text-align: right; }
  #bottomBody td::before { content: attr(data-label); display: block; margin-bottom: 1px; color: var(--muted); font-size: 11px; font-weight: 400; }
  #bottomBody td:first-child::before, #bottomBody td:has(.row-actions)::before, #bottomBody td:empty::before { display: none; }
  .record-market { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
  .record-title strong { font-size: 14px; }
  #bottomBody td { font-size: 13px; }
  #bottomBody td:nth-child(2) { font-size: 14px; }
  .row-actions .btn { min-height: 30px; padding: 0 14px; border: 0; background: var(--raised); }
  #bottomBody td:has(a) { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; }
  #bottomBody td:has(a)::before { margin: 0; }
  #bottomBody td a { font-size: 12px; }
  .mobile-tabs { position: fixed; z-index: 35; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(3, 1fr); height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: var(--bg); }
  .mobile-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; color: var(--muted); font-size: 10px; }
  .mobile-tabs button.active { color: var(--mint); }
  .mobile-tabs svg { width: 20px; height: 20px; }
  body[data-view="market"] .market-actions { position: fixed; z-index: 34; bottom: calc(58px + env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; gap: 8px; padding: 8px 12px; background: var(--panel); }
  .market-actions button { width: 50%; height: 40px; border: 0; border-radius: 6px; color: #04170f; font-weight: 600; background: var(--buy); }
  .market-actions button:last-child { background: var(--sell); color: #fff; }
  #notice { left: 50%; right: auto; bottom: calc(68px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); transform: translateX(-50%); animation: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
