.px-page { background: #050f11; }
.px-page .nav-links a[aria-current] { color: var(--ink); background: rgba(239, 247, 244, .07); }
.up { color: var(--accent) !important; }
.down { color: #ff8a7a !important; }

.w-pill { display: inline-flex; align-items: center; gap: 9px; padding: 4px 4px 4px 12px; border: 1px solid rgba(239, 247, 244, .12); border-radius: 999px; background: linear-gradient(180deg, rgba(239, 247, 244, .08), rgba(239, 247, 244, .02)); font: 400 13px var(--mono); color: var(--ink); }
.w-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.w-pill button { padding: 6px 12px; border: 0; border-radius: 999px; background: linear-gradient(180deg, #f6fffc, #cfeee6); color: #05191b; font: 500 13px var(--sans); box-shadow: inset 0 1px 0 #fff; }

.term { flex: 1; display: grid; gap: 8px; padding: 8px; min-height: 0;
  grid-template-columns: minmax(0, 1fr) 280px 320px;
  grid-template-rows: auto minmax(420px, 1fr) minmax(200px, auto);
  grid-template-areas: "bar bar bar" "chart book order" "pos pos order"; }
.panel-t { min-width: 0; background: linear-gradient(rgba(14, 33, 37, .55), rgba(8, 22, 25, .7)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.p-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.p-head b { font-weight: 500; }
.p-head.sub { border-top: 1px solid var(--line); }

.mkt-bar { grid-area: bar; position: relative; display: flex; align-items: center; gap: 26px; padding: 10px 14px; background: linear-gradient(rgba(14, 33, 37, .55), rgba(8, 22, 25, .7)); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.pick { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(239, 247, 244, .12); border-radius: 10px; background: linear-gradient(180deg, rgba(239, 247, 244, .1), rgba(239, 247, 244, .03)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }
.pick b { font: 600 16px var(--sans); }
.pick i, .m-list i { padding: 1px 6px; border-radius: 6px; background: rgba(151, 252, 228, .12); color: var(--accent); font: 500 11px var(--mono); font-style: normal; }
.stat { display: grid; gap: 1px; white-space: nowrap; }
.stat small { color: var(--faint); font-size: 11px; }
.stat b { font: 500 13px var(--mono); }
.stat.big b { font: 500 22px var(--mono); letter-spacing: -.02em; }
.shield { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(151, 252, 228, .08); border: 1px solid rgba(151, 252, 228, .22); color: var(--accent); font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.markets { position: fixed; z-index: 30; top: 130px; left: 16px; width: 360px; max-height: 60vh; display: flex; flex-direction: column; padding: 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.m-head, .m-list button { display: grid; grid-template-columns: 1.3fr 1fr .8fr; gap: 8px; align-items: center; }
.m-head { padding: 10px 8px 6px; color: var(--faint); font-size: 11px; }
.m-head span:not(:first-child), .m-list span, .m-list em { text-align: right; }
.m-list { overflow-y: auto; }
.m-list button { width: 100%; padding: 8px; background: none; border: 0; border-radius: 8px; text-align: left; }
.m-list button:hover, .m-list button.on { background: var(--raised); }
.m-list b { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; font-size: 13px; }
.m-list span, .m-list em { font: 400 12px var(--mono); font-style: normal; }

.chart-p { grid-area: chart; display: flex; flex-direction: column; }
.chart-el { flex: 1; min-height: 360px; }
.seg-t { display: inline-flex; gap: 2px; padding: 3px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 10px; }
.seg-t button { padding: 5px 10px; background: none; border: 1px solid transparent; border-radius: 7px; color: var(--muted); font: 500 12px var(--sans); }
.seg-t button:hover { color: var(--ink); }
.seg-t button[aria-selected="true"] { color: var(--ink); border-color: rgba(239, 247, 244, .12); background: linear-gradient(180deg, rgba(239, 247, 244, .1), rgba(239, 247, 244, .03)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }
.seg-t i { font-style: normal; color: var(--accent); }
.seg-t.full { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-bottom: 8px; }
.seg-t.full button { padding: 8px; font-size: 13px; }
.seg-t.side button[data-side="long"][aria-selected="true"] { background: linear-gradient(180deg, #c8fff1, #6fe6cb); color: #032022; border-color: transparent; }
.seg-t.side button[data-side="short"][aria-selected="true"] { background: linear-gradient(180deg, #ffc2b8, #ff8a7a); color: #2a0703; border-color: transparent; }

.book-p { grid-area: book; display: flex; flex-direction: column; }
.lv-head, .lv, .tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 0 12px; font: 400 11.5px/1.9 var(--mono); }
.lv-head { padding-top: 6px; color: var(--faint); font-family: var(--sans); font-size: 11px; }
.lv span:not(:first-child), .lv-head span:not(:first-child), .tr span:not(:first-child) { text-align: right; }
.lv { position: relative; cursor: pointer; }
.lv i { position: absolute; top: 1px; bottom: 1px; right: 0; opacity: .14; }
.lv.ask i { background: #ff8a7a; } .lv.bid i { background: var(--accent); }
.lv.ask span:first-child { color: #ff8a7a; } .lv.bid span:first-child { color: var(--accent); }
.lv:hover { background: rgba(239, 247, 244, .04); }
.spread { display: flex; justify-content: space-between; align-items: center; margin: 4px 0; padding: 6px 12px; border-block: 1px solid var(--line); }
.spread b { font: 500 14px var(--mono); }
.spread span { color: var(--faint); font-size: 11px; }
.trades { flex: 1; min-height: 120px; max-height: 260px; overflow: hidden; padding: 4px 0; }
.tr span:first-child { color: inherit; }
.tr span:not(:first-child) { color: var(--muted); }

.order-p { grid-area: order; padding: 12px; overflow-y: auto; }
.f-label { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; color: var(--muted); font-size: 12px; }
div.f-label { flex-direction: row; justify-content: space-between; }
div.f-label b { color: var(--ink); font: 500 12px var(--mono); }
.f-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: rgba(2, 9, 11, .55); border: 1px solid var(--line); border-radius: 10px; transition: border-color .2s; }
.f-box:focus-within { border-color: var(--accent); }
.f-box input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font: 400 15px var(--mono); }
.f-box em { color: var(--faint); font: 500 12px var(--sans); font-style: normal; }
.pcts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.pcts button, .mini { padding: 5px 8px; border: 1px solid rgba(239, 247, 244, .12); border-radius: 8px; background: linear-gradient(180deg, rgba(239, 247, 244, .08), rgba(239, 247, 244, .02)); color: var(--ink); font: 500 11px var(--sans); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.pcts button:hover, .mini:hover { border-color: rgba(151, 252, 228, .45); }
.mini.danger { color: #ff8a7a; }
.lev { width: 100%; margin: 8px 0 2px; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.check input { accent-color: var(--accent); }
.o-rows { margin: 12px 0 0; font-size: 12px; }
.o-rows div { display: flex; justify-content: space-between; padding: 3px 0; }
.o-rows dt { color: var(--muted); }
.o-rows dd { margin: 0; font: 400 12px var(--mono); }
.cta-trade { width: 100%; margin-top: 12px; padding: 13px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 12px; font: 600 15px var(--sans); transition: filter .2s, transform .15s; }
.cta-trade.long { background: linear-gradient(180deg, #c8fff1, #6fe6cb); color: #032022; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 10px 26px -10px rgba(151, 252, 228, .6); }
.cta-trade.short { background: linear-gradient(180deg, #ffc2b8, #ff8a7a); color: #2a0703; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 10px 26px -10px rgba(255, 138, 122, .55); }
.cta-trade:hover:not(:disabled) { filter: brightness(1.06); }
.cta-trade:active:not(:disabled) { transform: scale(.985); }
.cta-trade:disabled { opacity: .6; }
.acct { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.acct-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.acct-head b { font-weight: 500; }
.fund-link { display: block; margin-top: 12px; color: var(--accent); font-size: 12px; text-decoration: none; }
.fund-link:hover { text-decoration: underline; }

.pos-p { grid-area: pos; overflow-x: auto; }
.ptbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.ptbl th { padding: 8px 12px; color: var(--faint); font-weight: 500; font-size: 11px; text-align: right; white-space: nowrap; }
.ptbl td { padding: 9px 12px; border-top: 1px solid var(--line); font: 400 12px var(--mono); text-align: right; white-space: nowrap; }
.ptbl th:first-child, .ptbl td:first-child { text-align: left; }
.ptbl td b { font: 500 12px var(--sans); }
.ptbl td small { color: var(--muted); font-family: var(--sans); }
.ptbl .empty { padding: 28px; color: var(--faint); text-align: center; font-family: var(--sans); }

#wallet-dialog, #fund-dialog { width: min(440px, calc(100% - 32px)); }
#wallet-dialog p, #fund-dialog p { margin-bottom: 10px; }
#fund-dialog a { color: var(--accent); }
.link-cta { display: block; text-align: center; text-decoration: none; }
.w-full code { font: 400 12px var(--mono); color: var(--accent); word-break: break-all; }
.w-actions { display: flex; gap: 6px; }
.w-secret { display: block; margin-top: 10px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 10px; font: 400 11px var(--mono); color: var(--accent); word-break: break-all; }
.mv-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 6px 0 4px; }
.mv-tabs button { padding: 7px 4px; border: 1px solid var(--line); border-radius: 9px; background: none; color: var(--muted); font: 500 12px var(--sans); }
.mv-tabs button[aria-selected="true"] { color: var(--ink); border-color: rgba(151, 252, 228, .4); background: rgba(151, 252, 228, .08); }
.mv-help { min-height: 36px; color: var(--muted); font-size: 12px; }
.mv-max { margin-top: 6px; padding: 0; background: none; border: 0; color: var(--accent); font: 400 12px var(--mono); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; max-width: min(520px, calc(100% - 32px)); padding: 11px 16px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--surface); border: 1px solid rgba(151, 252, 228, .35); border-radius: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, .55); font-size: 13px; transition: opacity .2s, transform .25s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(255, 138, 122, .5); color: #ffc2b8; }

@media (max-width: 1100px) {
  .term { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "bar bar" "chart order" "book order" "pos pos"; grid-template-rows: auto minmax(380px, 1fr) auto auto; }
}
@media (max-width: 760px) {
  .term { grid-template-columns: 1fr; grid-template-areas: "bar" "chart" "order" "book" "pos"; }
  .markets { left: 8px; right: 8px; width: auto; }
  .w-pill #w-addr { display: none; }
}

/* Coin logos */
.coin-ic { display: inline-block; flex: none; width: 18px; height: 18px; border-radius: 50%; vertical-align: -4px; object-fit: cover; background: rgba(239, 247, 244, .06); }
.pick .coin-ic { width: 22px; height: 22px; }
.coin-ic.fb { display: inline-grid; place-items: center; background: linear-gradient(160deg, rgba(151, 252, 228, .35), rgba(151, 252, 228, .08)); color: var(--ink); font: 600 10px/1 var(--sans); }
.pick .coin-ic.fb { font-size: 12px; }
#h-logo { display: inline-flex; }
.ptbl td .coin-ic { width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; }
.m-list b { gap: 8px; }

/* Wallet button: plain, no status dot */
.px-page .btn.connected::before { display: none; }
.px-page #w-open { font-family: var(--sans); }
.px-page #w-open.connected { font: 400 13px var(--mono); }

/* Scrollbars */
.m-list, .order-p, .pos-p, .markets { scrollbar-width: thin; scrollbar-color: rgba(151, 252, 228, .28) transparent; }
.m-list::-webkit-scrollbar, .order-p::-webkit-scrollbar, .pos-p::-webkit-scrollbar { width: 8px; height: 8px; }
.m-list::-webkit-scrollbar-track, .order-p::-webkit-scrollbar-track, .pos-p::-webkit-scrollbar-track { background: transparent; }
.m-list::-webkit-scrollbar-thumb, .order-p::-webkit-scrollbar-thumb, .pos-p::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 99px; background: rgba(151, 252, 228, .22) padding-box; }
.m-list::-webkit-scrollbar-thumb:hover { background: rgba(151, 252, 228, .45) padding-box; }
.m-list { margin-right: -4px; padding-right: 4px; mask: linear-gradient(transparent, #000 10px, #000 calc(100% - 14px), transparent); -webkit-mask: linear-gradient(transparent, #000 10px, #000 calc(100% - 14px), transparent); }
.markets #m-search { margin-bottom: 2px; }

/* Checkbox */
.check { cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.check .box { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid rgba(239, 247, 244, .2); border-radius: 6px; background: linear-gradient(180deg, rgba(239, 247, 244, .08), rgba(239, 247, 244, .02)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); color: transparent; transition: background .18s, border-color .18s, color .18s, box-shadow .18s; }
.check .box svg { transform: scale(.6); opacity: 0; transition: transform .2s var(--ease), opacity .15s; }
.check:hover .box { border-color: rgba(151, 252, 228, .5); }
.check input:checked + .box { background: linear-gradient(180deg, #c8fff1, #6fe6cb); border-color: transparent; color: #032022; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 12px -2px rgba(151, 252, 228, .55); }
.check input:checked + .box svg { transform: none; opacity: 1; }
.check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
img.coin-ic { background: #eef5f3; box-shadow: 0 0 0 1px rgba(239, 247, 244, .12); }
.m-list .px { font: 400 12px var(--mono); text-align: right; }

.venue-t button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.venue-t button[data-venue="dark"][aria-selected="true"] { color: var(--accent); border-color: rgba(151, 252, 228, .28); background: linear-gradient(180deg, rgba(151, 252, 228, .14), rgba(151, 252, 228, .04)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 18px -6px rgba(151, 252, 228, .45); }
.dark-note { margin: 0 0 10px; padding: 8px 10px; border: 1px solid rgba(151, 252, 228, .16); border-radius: 9px; background: rgba(151, 252, 228, .05); color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.dark-note a { color: var(--accent); }
.px-page.dark .hl-only { display: none; }
.px-page.dark .cta-trade { box-shadow: 0 0 0 1px rgba(151, 252, 228, .35), 0 8px 24px -10px rgba(151, 252, 228, .5); }
.tag-dark { margin-left: 4px; padding: 1px 5px; border-radius: 5px; background: rgba(151, 252, 228, .12); color: var(--accent); font: 500 10px var(--sans); }
