/* App frame v2: one main column and exactly one sidebar. On Trading the sidebar is the order panel; on every other
   page it shows what the person picked in Profile → Layout (position, width, sections, or hidden).
   Denser and quieter than before: smaller paddings, thin lines, no scrollbars. */


body.app2 { font-size: 13px; }
.app2 .top { height: 52px; gap: 22px; padding: 0 14px; }
.app2 .top .logo { font-size: 20px; gap: 8px; }
.app2 .top .logo img { height: 22px; }
.app2 .top nav { gap: 2px; }
.app2 .top nav a { padding: 6px 11px; font-size: 13.5px; border-radius: 8px; }
.app2 .top nav a.on { background: #1A1A1E; }
.app2 .search { max-width: 360px; }
.app2 .search input { height: 34px; border-radius: 9px; padding-left: 34px; font-size: 13px; background: #111114; }
.app2 .search svg { left: 12px; top: 10px; }
.app2 .search kbd { top: 7px; }
.app2 .sres { top: 40px; }
.app2 .modeseg button { height: 26px; }
.app2 .wbtn { height: 34px; border-radius: 9px; padding: 0 12px; }
.app2 #wal .btn { height: 34px; border-radius: 9px; padding: 0 16px; }
.app2 .so-tbtn { width: 34px; height: 34px; }

/* the grid */
.shell { --side-w: 320px; height: calc(100% - 52px - 28px); display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: 6px; padding: 6px; }
.shell.left { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.shell.left > .side { order: -1; }
.shell.noside { grid-template-columns: minmax(0, 1fr); }
.shell.noside > .side { display: none; }
.shell.trade { --side-w: 340px; }
.shell.trade.noside { grid-template-columns: minmax(0, 1fr) var(--side-w); }
.shell.trade.noside > .side { display: flex; }
.shell.trade.left.noside { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.shell > .main { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.shell > .side { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.shell > .side > .pane { flex: none; }
.app2 .pane { border-radius: 10px; background: #0E0E11; border-color: rgba(255, 255, 255, .07); }
.app2 .pane > .hd { padding: 10px 14px; min-height: 44px; }
.app2 .pane > .hd h3 { font-size: 13px; }
.app2 .main > .pane[style*="flex:1"] { min-height: 300px; }

/* drag the sidebar's inner edge to resize it (side.js) */
.shell { position: relative; }
.sgrip { position: absolute; top: 6px; bottom: 6px; right: calc(var(--side-w) + 4px); width: 10px; cursor: col-resize; z-index: 6; touch-action: none; }
.shell.left .sgrip { right: auto; left: calc(var(--side-w) + 4px); }
.sgrip::after { content: ''; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; border-radius: 2px; background: transparent; transition: background .15s; }
.sgrip:hover::after, body.resizing .sgrip::after { background: var(--accent); }
.shell.noside:not(.trade) .sgrip { display: none; }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing .main, body.resizing .side { pointer-events: none; }

/* sidebar sections */
.sbox { padding: 4px 0 6px; }
.sbox .sbh { display: flex; align-items: center; gap: 8px; padding: 10px 14px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.sbox .sbh a { margin-left: auto; color: var(--dim); font-weight: 500; }
.sbox .sbh a:hover { color: var(--text); }
.sbox .lrow { padding: 7px 14px; }
.sbox .lrow .tok .ic { width: 26px; height: 26px; }
.sbox .so-person { padding: 8px 14px; }
.sbox .empty { padding: 14px; font-size: 12px; text-align: left; }
.side .sbedit { display: block; text-align: center; color: var(--dim); font-size: 12px; padding: 6px 8px 10px; }
.side .sbedit:hover { color: var(--text); }

/* status bar */
.status { height: 28px; display: flex; align-items: center; gap: 16px; padding: 0 14px; border-top: 1px solid var(--line); font-size: 11.5px; white-space: nowrap; overflow: hidden; color: var(--muted); }
.status #tk { display: flex; gap: 16px; align-items: center; }
.status .tk { display: flex; gap: 5px; align-items: center; cursor: pointer; }
.status .right { margin-left: auto; display: flex; gap: 14px; }
.status .right a:hover { color: var(--text); }

/* page header inside main (Discover, Leaderboard, Profile) */
.phd { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; flex-wrap: wrap; }
.phd h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.phd .sub { color: var(--muted); font-size: 12.5px; }
.ptabs2 { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.ptabs2 button, .ptabs2 a { border: 0; background: none; padding: 10px 10px 11px; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; position: relative; white-space: nowrap; }
.ptabs2 .on { color: var(--text); }
.ptabs2 .on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.toolbar .grow { flex: 1; }
.select { height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-3); color: var(--text); padding: 0 8px; font: 500 12.5px var(--sans); }

/* sortable table headers */
.t th.sort { cursor: pointer; user-select: none; }
.t th.sort:hover { color: var(--muted); }
.t th.sort.on { color: var(--text); }
.t th.sort.on::after { content: ' ↓'; font-size: 10px; }
.t th.sort.on.asc::after { content: ' ↑'; }

@media (max-width: 1100px) {
  .app2 .top nav { display: none; }
}
@media (max-width: 760px) {
  body.app2 { overflow: auto; }
  .shell, .shell.left, .shell.noside, .shell.trade, .shell.trade.noside { display: flex; flex-direction: column; height: auto; padding: 6px; padding-bottom: 76px; }
  .shell > .main, .shell > .side { overflow: visible; }
  .shell.left > .side { order: 2; }
  .shell.noside > .side { display: none; }
  .shell.trade > .side { display: flex; }
  .status { display: none; }
  .app2 .top { gap: 8px; padding: 0 10px; }
}

/* ---------- Trading ---------- */
.trhd { display: flex; align-items: center; gap: 22px; padding: 10px 14px; border-bottom: 1px solid var(--line); min-height: 58px; overflow-x: auto; }
.trpick { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--text); padding: 4px 8px 4px 2px; margin-left: -2px; border-radius: 9px; cursor: pointer; flex: none; }
.trpick:hover { background: #17171B; }
.trpick .ic, .trpick img { width: 30px; height: 30px; }
.trpick > .svgi { color: var(--muted); }
.trname { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.trname b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.trname span { color: var(--muted); font-size: 11.5px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trpx { display: flex; flex-direction: column; line-height: 1.2; flex: none; }
.trpx b { font: 650 18px var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.trpx span { font: 500 12px var(--mono); font-variant-numeric: tabular-nums; }
.trst { display: flex; flex-direction: column; line-height: 1.3; flex: none; }
.trst span { color: var(--dim); font-size: 11px; }
.trst b { font: 500 12.5px var(--mono); font-variant-numeric: tabular-nums; }
.trtags { margin-left: auto; display: flex; gap: 6px; align-items: center; flex: none; }
.app2 .chartbar { padding: 6px 10px; gap: 6px; }
.app2 .chart { height: auto; min-height: 380px; flex: 1; }
.main > .pane:has(#chart) { flex: 1 0 auto; display: flex; flex-direction: column; min-height: 440px; }
.trbot { min-height: 220px; }
.trbot > .bd { overflow: auto; }
.trside { flex: none; }
.levbar { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.lvhd { display: flex; align-items: baseline; gap: 10px; }
.lvl { color: var(--text); font-size: 12.5px; font-weight: 600; flex: none; }
.lvopts { display: flex; gap: 2px; background: var(--chip); padding: 3px; border-radius: 9px; }
.lvopts button { flex: 1 0 auto; min-width: 0; border: 1px solid transparent; background: none; color: var(--muted); height: 28px; padding: 0 7px; border-radius: 7px; font: 600 12px var(--sans); white-space: nowrap; cursor: pointer; font-variant-numeric: tabular-nums; }
.lvopts button:hover { color: var(--text); }
.lvopts button.on { background: rgba(255, 90, 31, .14); border-color: rgba(255, 90, 31, .45); color: #FF7438; }
.lvnone { margin-left: auto; color: var(--dim); font-size: 11.5px; text-align: right; }
.trside .tp { padding: 12px 14px 14px; }
.trside .presets button { white-space: nowrap; }
.tp .row.mv span, .tp .row.mv b { color: #FF7438; }
.mesplit { font-size: 11.5px; line-height: 1.5; margin: 2px 0 6px; }
#tacct .tp { padding: 12px 14px; }
.flagsum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px 6px; }
.flagsum .dim { flex-basis: 100%; font-size: 12px; }
.checks.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; padding: 0 0 8px; }

/* market picker */
.apick { width: min(520px, calc(100vw - 32px)); }
.segrow { display: flex; margin: 10px 0 6px; }
.aplist { max-height: min(56vh, 520px); overflow: auto; margin: 0 -22px -22px; border-top: 1px solid var(--line); }
.aplist .lrow { padding: 9px 22px; }
.aplist .lrow:hover { background: #151519; }

/* ---------- Discover ---------- */
.dxt { width: 100%; }
.dxt th { position: sticky; top: 0; background: #0E0E11; z-index: 1; white-space: nowrap; }
.dxt td { white-space: nowrap; }
.dxt tbody tr:hover { background: #131317; }
.dxt th.cur { color: var(--text); }
.dxt td.cur { background: rgba(255, 255, 255, .025); }
.dxt .tok b { font-weight: 650; }
.dxt td { padding: 7px 10px; }
.dxt th { padding: 8px 10px; }
.dxt .tok { gap: 9px; }
.dxt .tok .ic { width: 26px; height: 26px; }
.dxt .tok .nm { font-size: 13px; }
.dxt .tok .sub { color: var(--dim); font-size: 11.5px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.dxt .star { width: 22px; height: 22px; }
.dxt td:first-child, .dxt th:first-child { padding-left: 16px; color: var(--dim); width: 28px; }
.toolbar .chips { display: flex; gap: 4px; }
.toolbar .toggle { margin: 0; font-size: 12.5px; }
.pane:has(.dxt) > .bd, .pane:has(#dxt) > .bd { overflow: auto; flex: 1; }

/* ---------- Profile ---------- */
.mehd { padding: 16px 16px 12px; }
.mehd > div:first-of-type { display: flex; flex-direction: column; }
.mehd h1 { display: flex; align-items: center; gap: 6px; }
#mebody { padding: 16px; }
.mecards { margin-bottom: 16px; }
.mecards .card { background: #111114; padding: 12px 14px; }
.mecards .card b { font-size: 19px; }
.mecards .card em { display: block; font-style: normal; color: var(--dim); font-size: 11.5px; margin-top: 4px; }
.mesec { margin-top: 18px; }
.mesec h3 { font-size: 13px; margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.mesec .t { margin: 0 -16px; width: calc(100% + 32px); }
.mesec .t td:first-child, .mesec .t th:first-child { padding-left: 16px; }
.mesec .t td:last-child, .mesec .t th:last-child { padding-right: 16px; }
/* settings-style columns: two side by side when there is room, one otherwise */
.mecols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; max-width: 1040px; }
.mecols.wide { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.mecols:has(> .mecol:empty) { grid-template-columns: minmax(0, 1fr); max-width: 620px; }
.mecol { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mecol:empty { display: none; }
.mebox { background: #111114; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; min-width: 0; }
.mebh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mebh h3 { margin: 0; font-size: 13.5px; font-weight: 650; }
.mebh .muted { font-size: 12px; }
.mebox > p.muted { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.kv:last-of-type { border-bottom: 0; }
.kv > span { color: var(--muted); flex: none; }
.kv > b { font-weight: 500; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.addrbox { display: flex; align-items: center; gap: 8px; background: #0A0A0C; border: 1px solid var(--line); border-radius: 8px; padding: 7px 7px 7px 12px; margin-bottom: 4px; }
.addrbox .mono { flex: 1; min-width: 0; font-size: 12px; line-height: 1.45; word-break: break-all; }
.btnrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.btnrow .btn { height: 32px; font-size: 12.5px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--chip); color: var(--text); }
.badge.gold { background: rgba(245, 184, 61, .12); color: #F5B83D; }
.depo { display: flex; gap: 16px; align-items: flex-start; }
.depo .qr { width: 128px; flex: none; background: #fff; padding: 8px; border-radius: 10px; }
.depo .qr svg { display: block; width: 100%; height: auto; }
.depot { flex: 1; min-width: 0; }
.depot p.muted { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; }
.depot .btn { max-width: 100%; height: auto; min-height: 34px; white-space: normal; }
.depot p.dim { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; }
.melink { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 0 -10px; border-radius: 8px; color: var(--text); font-size: 13px; }
.melink:hover { background: #17171B; }
.melink > span:not(.badge) { flex: 1; }
.melink > .svgi { transform: rotate(-90deg); color: var(--dim); }
/* your social profile, the way others see it */
.meprof { padding: 0 0 16px; overflow: hidden; }
.mepban { aspect-ratio: 3 / 1; background: linear-gradient(120deg, #1C1C21, #121215); }
.mepban img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mepin { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: -40px 16px 0; }
.mepav { flex: none; line-height: 0; }
.mepav .so-av { box-shadow: 0 0 0 4px #111114; }
.mepin .btnrow { margin: 0 0 2px; }
.mepname { display: flex; flex-direction: column; gap: 1px; margin: 10px 16px 0; }
.mepname b { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.mepname .muted { font-size: 13px; }
.mebio { margin: 10px 16px 0; font-size: 13.5px; line-height: 1.5; }
.mecounts { display: flex; gap: 18px; margin: 12px 16px 0; font-size: 13px; color: var(--muted); }
.mecounts b { color: var(--text); font-weight: 650; }
.mecounts a:hover { text-decoration: underline; }

/* layout editor */
.sw { position: relative; display: inline-block; width: 34px; height: 20px; cursor: pointer; }
.sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sw i { position: absolute; inset: 0; border-radius: 20px; background: var(--bg-4); transition: background .15s; pointer-events: none; }
.sw i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #A1A1AA; transition: transform .15s, background .15s; }
.sw input:checked + i { background: var(--accent); }
.sw input:checked + i::after { transform: translateX(14px); background: #fff; }
.lyhint { font-size: 11.5px; margin: 10px 0 0; }
.lysecs { display: flex; flex-direction: column; gap: 4px; }
.lysec { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #0E0E11; }
.lysec label { flex: 1; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.lysec input { accent-color: var(--accent); }
.lysec .iconbtn { width: 26px; height: 26px; font-size: 12px; }
.lysec .iconbtn:disabled { opacity: .3; cursor: default; }


/* ---------- Leaderboard ---------- */
.lbme { display: flex; align-items: center; gap: 16px; margin: 12px 16px 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #111114; }
.lbmet { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.lbmet b { font-size: 13.5px; }
.lbmet span { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.lbme.stats { gap: 0; padding: 0; }
.lbme.stats > div { flex: 1; padding: 11px 14px; border-right: 1px solid var(--line); min-width: 0; }
.lbme.stats > div span { display: block; color: var(--dim); font-size: 11px; }
.lbme.stats > div b { display: block; margin-top: 2px; font: 600 16px var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbme.stats > div b em { font-style: normal; color: var(--dim); font-size: 12px; font-weight: 500; }
.lbme.stats > .btn { margin: 0 12px; flex: none; }
.lbt td.lbrk { color: var(--dim); font: 600 12.5px var(--mono); font-variant-numeric: tabular-nums; padding-left: 16px; }
.lbt td.lbrk.top1 { color: #F5B83D; } .lbt td.lbrk.top2 { color: #D4D4D8; } .lbt td.lbrk.top3 { color: #D08A5B; }
.lbt th:first-child { padding-left: 16px; }
.lbt tr.me td { background: rgba(255, 90, 31, .06); }
.lbt .tok b { font-weight: 600; display: flex; align-items: center; gap: 4px; }
.lbnote { font-size: 11.5px; margin: 0; padding: 12px 16px 16px; }


/* ---------- money: dollar inputs, Add money, balance ---------- */
.amt.usdin .cur { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font: 600 20px var(--mono); pointer-events: none; }
.amt.usdin .input, .tp .amt.usdin .input, .modal .amt.usdin .input { padding-left: 30px; }
.amt.big .input { height: 60px; font-size: 26px; }
.app2 #wal { display: flex; align-items: center; gap: 8px; }
.addm { height: 34px; border-radius: 9px; padding: 0 12px; gap: 6px; display: inline-flex; align-items: center; }
.am-src { margin-top: 14px; }
.modal .presets:has([data-v]), .modal .presets:has([data-p]) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.am-from { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #0E0E11; font-size: 13px; }
.am-from b { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-from .mono { color: var(--muted); font-size: 12px; }
button.link { border: 0; background: none; color: #FF7438; font: 600 12.5px var(--sans); cursor: pointer; padding: 0; }
.am-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 220px; overflow: auto; }
.am-list.hide { display: none; }
.am-a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: none; color: var(--text); cursor: pointer; text-align: left; font: 500 13px var(--sans); }
.am-a.on { border-color: rgba(255, 90, 31, .5); background: rgba(255, 90, 31, .06); }
.am-a:disabled { opacity: .4; cursor: default; }
.am-a .muted { flex: 1; font-size: 12px; }
.am-a .mono { font-size: 12px; }
.am-none { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; }
.am-none span { color: var(--muted); font-size: 12.5px; }
.am-none .btn { align-self: flex-start; margin-top: 6px; }
.am-q { font-size: 12px; margin: 10px 0 12px; min-height: 16px; }
.mebtn2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.mebtn2 .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.wd-av { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12.5px; }
.wd-av span { color: var(--muted); }
.wd-av b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wd-list { max-height: none; margin-top: 0; }
.wd-addr { margin-top: 8px; font-size: 12.5px; }
.wd-netrow { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.wd-netrow .select { flex: 1; height: 34px; }
.wd-left b { color: var(--text) !important; }
.am-get { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; padding: 3px 0; }
.am-get span { color: var(--muted); }
.am-get b { font: 650 15px var(--mono); font-variant-numeric: tabular-nums; }
.am-get + .am-get b { color: var(--up); }
.tp .sides.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tpsl { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.tpnow { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--muted); }
.tpnow b { color: var(--text); font-weight: 600; }
.tpnow .dim { margin-left: auto; font-size: 11px; }
.tpbox { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 10px; background: #0E0E11; }
.tpbox.tp { border-color: rgba(34, 197, 94, .25); } .tpbox.sl { border-color: rgba(239, 68, 68, .25); }
.tphd { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.tphd label { font-size: 12px; font-weight: 600; }
.tpinfo { font: 600 12px var(--mono); font-variant-numeric: tabular-nums; }
.pxin { display: grid; grid-template-columns: 34px 1fr 34px; gap: 4px; }
.pxin .input { height: 38px; text-align: center; font-size: 15px; padding: 0 6px; -moz-appearance: textfield; }
.pxin .input::-webkit-outer-spin-button, .pxin .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pxin button { border: 1px solid var(--line); background: var(--bg-3); color: var(--text); border-radius: 8px; font: 600 16px var(--sans); cursor: pointer; touch-action: none; user-select: none; }
.pxin button:hover { border-color: var(--line-2); }
.tpchips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 6px; }
.tpchips button { height: 26px; border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 7px; font: 600 11.5px var(--mono); cursor: pointer; }
.tpchips button:hover { color: var(--text); }
.psize { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; font-size: 12.5px; }
.psize span { color: var(--muted); }
.psize b { font: 600 14px var(--mono); font-variant-numeric: tabular-nums; }
.psize.low b { color: var(--down); }
.am-ex { margin-top: 14px; font-size: 12.5px; }
.am-ex summary { cursor: pointer; color: var(--muted); }
.am-ex .qr { width: 140px; margin-top: 10px; background: #fff; padding: 6px; border-radius: 8px; }
.am-ex .qr svg { display: block; width: 100%; height: auto; }
.mebal { font: 650 30px var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.03em; margin: 2px 0 2px; }
.mehold td, .mehold th { padding-top: 8px; padding-bottom: 8px; }
.mebox .t { margin: 0 -16px -6px; width: calc(100% + 32px); }
.mebox .t td:first-child, .mebox .t th:first-child { padding-left: 16px; }
.mebox .t td:last-child, .mebox .t th:last-child { padding-right: 16px; }
.mehist { max-width: 1040px; }
.mehist .sm-only { display: none; font-size: 12px; }
.mehint { font-size: 12px; margin: 14px 0 0; }
.pmin { font-size: 11px; margin: 6px 0 2px; line-height: 1.4; }

@media (max-width: 1240px) {
  .mecols, .mecols.wide { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
}
@media (max-width: 1280px) {
  .trhd { gap: 16px; }
  .trst.hm { display: none; }
}
@media (max-width: 760px) {
  .trhd { gap: 14px; padding: 10px 12px; }
  .trtags { display: none; }
  .app2 .chart { min-height: 300px; }
  .main > .pane:has(#chart) { min-height: 360px; }
  .checks.grid { grid-template-columns: 1fr; }
  .mecols, .mecols.wide { grid-template-columns: minmax(0, 1fr); }
  .sgrip { display: none; }
  .mehist .sm-only { display: block; }
  .addm .hm2 { display: none; }
  #mebody { padding: 12px; }
  .mesec .t { margin: 0 -12px; width: calc(100% + 24px); }
  .depo { flex-direction: column; }
  .lbme { margin: 10px 12px 2px; flex-wrap: wrap; }
  /* phones: one thing at a time. Pages keep their content only; on Trade the order panel sits right under the chart */
  .shell:not(.trade) > .side { display: none; }
  .shell.trade > .main { display: contents; }
  .shell.trade > .main > .pbanner { order: 0; }
  .shell.trade > .main > .pane:not(.trbot) { order: 1; }
  .shell.trade > .side { order: 2; }
  .shell.trade > .main > .trbot { order: 3; }
  .dxt .hp, .dxt td:first-child, .dxt th:first-child, .dxt .star { display: none; }
  .dxt td:nth-child(2), .dxt th:nth-child(2) { padding-left: 14px; }
  .dxt td, .dxt th { padding-left: 7px; padding-right: 7px; }
  .dxt .tok .sub { max-width: 116px; }
  .lbme.stats > div { flex: 1 1 33%; border-bottom: 1px solid var(--line); }
  .lbme.stats > .btn { margin: 8px 12px; }
}

/* ---------- customer test fixes ---------- */
.cpy { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px; background: rgba(239, 68, 68, .14); color: #F87171; font: 600 10.5px var(--sans); vertical-align: 1px; white-space: nowrap; }
.sres-note { margin: 4px 6px 6px; padding: 8px 10px; border-radius: 8px; background: rgba(245, 184, 61, .1); color: var(--amber); font-size: 12px; }
.dxhid { font-size: 12px; padding: 10px 16px 14px; margin: 0; }
.mvnote { font-size: 11px; color: var(--dim); line-height: 1.45; margin-top: 6px; }
.tpbox.err { border-color: rgba(239, 68, 68, .8) !important; box-shadow: 0 0 0 2px rgba(239, 68, 68, .15); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.cf-rows { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; }
.cf-rows .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.cf-rows .row span { color: var(--muted); }
button.link.tprac { display: block; margin: 8px auto 0; font-size: 12.5px; }
.so-join { display: flex; align-items: center; gap: 14px; margin: 12px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #111114; }
.so-join > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.so-join b { font-size: 13.5px; } .so-join span { color: var(--muted); font-size: 12.5px; }
.am-a em { font-style: normal; color: var(--dim); font-size: 11px; }
.wd-why { font-size: 11.5px; margin: 2px 0 0; }
.app2 .main > .pane:has(#chart) { min-height: min(440px, 62vh); }
@media (max-width: 760px) {
  .modeseg { display: inline-flex !important; }
  .modeseg button { height: 26px !important; padding: 0 8px; font-size: 11px; }
  .ptabs2 a, .ptabs2 button { padding: 10px 8px 11px; font-size: 12.5px; }
  .so-join { flex-direction: column; align-items: stretch; }
}

/* ---------- 30 Oct: parity ---------- */
/* tablets and small laptops: the bottom tab bar (the top links don't fit), no status bar */
@media (max-width: 1100px) {
  .mnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 62px; background: var(--bg-2); border-top: 1px solid var(--line); z-index: 25; }
  .mnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .mnav a.on { color: var(--text); }
  .app2 .status { display: none; }
  .app2 .shell { padding-bottom: 70px; }
  .helpbtn { bottom: 74px; }
  .drawer { bottom: 126px; }
}
/* Discover on phones: the red-flag badge sits next to the ticker, quick buy is an icon */
.dxt .pflag { display: none; }
@media (max-width: 760px) {
  .dxt .pflag { display: inline-flex; margin-left: 6px; vertical-align: middle; }
  .dxt .pflag .safe { padding: 1px 6px; font-size: 10.5px; }
  .dxt .qbc { padding-right: 10px !important; }
  .dxt .qbc .qb span { display: none; }
  .dxt .qbc .qb { padding: 5px 7px; }
}
/* help */
.helplist { padding: 4px 16px 18px; }
.helplist details { border-bottom: 1px solid var(--line); }
.helplist summary { cursor: pointer; padding: 13px 2px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.helplist summary::-webkit-details-marker { display: none; }
.helplist summary::after { content: '+'; color: var(--dim); font-weight: 400; }
.helplist details[open] summary::after { content: '–'; }
.helplist p { margin: 0 2px 14px; color: var(--muted); line-height: 1.6; max-width: 760px; }
/* profile */
.kvbtns { display: flex; gap: 6px; }
.mpkinds { display: grid; gap: 2px; margin: 4px 0 8px; }
.mpkinds .ack { margin: 0; font-size: 12.5px; }
.mpkinds.dim { opacity: .55; }
.mehtools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.kvt td { padding: 9px 12px; }
.kvt td:first-child { width: 160px; }
/* social: trades in posts, holdings, shared trades, share cards */
.so-trade { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-3); color: var(--text); }
.so-trade:hover { border-color: rgba(255,255,255,.22); }
.so-trtx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.so-trtx b { font-size: 14px; }
.so-trtx .muted { font-size: 12px; }
.so-ver { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--up); white-space: nowrap; }
.so-hold { margin-left: 8px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.so-hold b { font-weight: 600; }
.so-tradepost .so-trade { margin-top: 6px; }
.shcard { margin: 14px 0 6px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.shcard canvas { width: 100%; height: auto; display: block; }
/* send */
.sd-who { min-height: 18px; margin-top: 6px; font-size: 12.5px; }
.sd-person { display: inline-flex; align-items: center; gap: 8px; }
/* the help button: small in the app, so it never covers a row */
.app2 .helpbtn { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 0; display: grid; place-items: center; left: 12px; bottom: 40px; }
.app2 .helpbtn::before { content: '?'; font-size: 15px; font-weight: 700; color: var(--muted); }
@media (max-width: 1100px) { .app2 .helpbtn { bottom: 72px; } }
/* Discover: chains, launchpad tags, bonding progress */
.dxchains { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; margin-bottom: 2px; }
.dxchains .chip { cursor: pointer; border: 0; font: inherit; font-size: 12px; }
.chaintag { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 5px; background: var(--chip); color: var(--muted); font-size: 10.5px; font-weight: 600; line-height: 16px; vertical-align: 1px; }
.bondbar { display: inline-block; width: 46px; height: 5px; border-radius: 3px; background: var(--line-2); vertical-align: middle; margin-right: 6px; overflow: hidden; }
.bondbar i { display: block; height: 100%; background: var(--acc); }
.bondpct { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .dxchains { flex-wrap: nowrap; overflow-x: auto; } .bondbar { display: none; } }

/* ---------- Bots lab: the same frame as the app ---------- */
.bots .top .acct { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.labnav { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--bg); overflow-x: auto; }
.labnav .labname { font-size: 13px; margin-right: 10px; }
.labnav a { padding: 6px 11px; border-radius: 8px; color: var(--muted); font-weight: 550; font-size: 13px; white-space: nowrap; }
.labnav a:hover { color: var(--text); }
.labnav a.on { color: var(--text); background: #1A1A1E; }
.labnav .labnote { margin-left: auto; font-size: 11.5px; color: var(--practice, #F5B83D); white-space: nowrap; }
.bots .layout { height: calc(100% - 52px - 44px - 30px); }
.bots .status { position: static; }
@media (max-width: 1100px) { .bots .topnav { display: none; } .bots .layout { height: auto; padding-bottom: 76px; } }
@media (max-width: 760px) { .labnav .labname, .labnav .labnote { display: none; } .bots .layout { padding: 6px; } }
.bots .wbtn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; font-weight: 600; white-space: nowrap; color: var(--text); }
.bots .wbtn .mono { font-size: 12px; }
.bots .badge.prac { background: rgba(245, 184, 61, .12); color: var(--amber); }
.bots .labnote { color: var(--amber); }

/* Profile → Wallet → Security */
.secrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.secrow b { font-size: 13px; font-weight: 600; }
.secrow p { margin: 3px 0 0; font-size: 12px; line-height: 1.45; }
.secrow > .btn, .secrow > span { flex: none; }
