/* mSamex Desktop + Tablet — pro trading terminal (industry-standard density)
 * Reuses design tokens. Hairline separators via 1px grid gaps on --line. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--snow); font-family: var(--font); font-size: 13px; -webkit-font-smoothing: antialiased; font-feature-settings: "ss01","cv02"; overflow: hidden; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.up { color: var(--up); } .down { color: var(--down); } .warn { color: var(--warn); } .muted { color: var(--mute); }
.row { display: flex; align-items: center; } .between { justify-content: space-between; }
a, button, input { font-family: inherit; }
input, textarea, select { background-color: transparent; color: var(--snow); border: none; }
input:focus, textarea:focus, select:focus { outline: none; }
input::placeholder { color: var(--mute); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-radius: 5px; }
[dir="rtl"] .mono { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .term, [dir="rtl"] .ticker, [dir="rtl"] .pair-strip, [dir="rtl"] .chart-stage, [dir="rtl"] .ob-scroll { direction: ltr; }
[dir="rtl"] .nav, [dir="rtl"] .top-right { direction: rtl; }
::selection { background: var(--mint); color: var(--ink); }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 7px; }
::-webkit-scrollbar-track { background: transparent; }

.app { height: 100vh; display: flex; flex-direction: column; }

/* ===== Top bar ===== */
.topbar { display: flex; align-items: center; gap: 22px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--line); flex-shrink: 0; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; padding: 0; }
.brand .wm { font-weight: 700; font-size: 16px; letter-spacing: -0.03em; color: var(--snow); }
.brand .wm-s { color: var(--mint); }
.nav { display: flex; gap: 2px; }
.nav button { background: none; border: none; color: var(--snow-dim); font-size: 13.5px; font-weight: 500; padding: 7px 12px; border-radius: 6px; cursor: pointer; }
.nav button:hover { color: var(--snow); }
.nav button.active { color: var(--mint); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tsearch { position: relative; display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; width: 200px; }
.tsearch svg { width: 15px; height: 15px; color: var(--mute); }
.tsearch input { flex: 1; min-width: 0; background: none; border: none; color: var(--snow); font-size: 13px; }
.tsearch input:focus { outline: none; }
.tsearch:focus-within { border-color: var(--mint); }
.tsearch-results { position: absolute; top: calc(100% + 6px); left: 0; width: 340px; max-width: 80vw; max-height: 380px; overflow-y: auto; background: var(--card, var(--surface)); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 48px rgba(0,0,0,.45); z-index: 220; display: none; }
.tsearch-results.open { display: block; }
.tsearch-row { display: grid; grid-template-columns: 22px 1fr auto auto; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; }
.tsearch-row:hover, .tsearch-row.on { background: var(--elevated); }
.tsearch-row .ts-pair strong { font-size: 13px; display: block; }
.tsearch-row .ts-pair small { font-size: 11px; }
.tsearch-row .ts-px { font-size: 12.5px; }
.tsearch-empty { padding: 20px; text-align: center; color: var(--snow-dim); font-size: 13px; }
.ibtn { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line); background: none; color: var(--snow-dim); display: grid; place-items: center; cursor: pointer; }
.ibtn:hover { color: var(--snow); border-color: var(--mute); }
.ibtn svg { width: 16px; height: 16px; }
.tbtn { border: none; border-radius: 7px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.tbtn.pri { background: var(--mint); color: var(--ink); }
.tbtn.ghost { background: var(--surface); color: var(--snow); border: 1px solid var(--line); }
.av { width: 32px; height: 32px; border-radius: 7px; background: var(--mint); color: var(--ink); border: none; font-weight: 700; font-size: 12px; cursor: pointer; }

/* ===== Ticker strip ===== */
.ticker { display: flex; height: 30px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex-shrink: 0; background: var(--surface); }
.ticker::-webkit-scrollbar { display: none; }
.ticker button { display: flex; align-items: center; gap: 6px; padding: 0 14px; background: none; border: none; border-right: 1px solid var(--line-soft); white-space: nowrap; cursor: pointer; font-size: 12px; color: var(--snow-dim); }
.ticker button:hover { background: var(--elevated); }
.ticker strong { color: var(--snow); font-weight: 600; }

.main { flex: 1; overflow: hidden; }
.view { height: 100%; overflow-y: auto; }
.view.term-view { overflow: hidden; }

/* ===== TERMINAL (4-pane + watchlist) ===== */
.term { display: grid; grid-template-columns: 232px 1fr 248px 296px; grid-template-rows: auto 1fr; height: 100%; gap: 1px; background: var(--line); transition: grid-template-columns .22s ease; }
/* Collapsed watchlist: col 1 shrinks to a thin icon rail; chart/book/form
   reflow to fill the freed width. State persisted in localStorage. */
.term.wl-collapsed { grid-template-columns: 36px 1fr 248px 296px; }
.term > *, .term-center, .book-col { min-width: 0; }
.pane { background: var(--bg); min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.pane-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.ob-grp { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; color: var(--mute); font-size: 11px; font-weight: 600; padding: 2px 6px; cursor: pointer; outline: none; }
.ob-grp:hover { color: var(--snow); }
.pane-head .ph-tabs { display: flex; gap: 12px; }
.pane-head .ph-tabs button { background: none; border: none; color: var(--mute); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.pane-head .ph-tabs button.active { color: var(--snow); }

/* pair header strip (spans center+right+form columns) */
.pair-strip { grid-column: 2 / 5; background: var(--bg); display: flex; align-items: center; gap: 26px; padding: 8px 16px; overflow-x: auto; scrollbar-width: none; }
.pair-strip::-webkit-scrollbar { display: none; }
.pair-id { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.pair-id .pn { font-size: 17px; font-weight: 700; }
.pair-id .perp { font-size: 9px; background: var(--elevated); color: var(--snow-dim); padding: 2px 5px; border-radius: 4px; }
.pair-last { display: flex; flex-direction: column; }
.pair-last .pl { font-size: 18px; font-weight: 700; }
.pair-last .pl-sub { font-size: 10px; color: var(--mute); }
.pstat { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.pstat span { font-size: 9.5px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.05em; }
.pstat strong { font-size: 12.5px; font-weight: 500; }

/* watchlist sidebar (rows 1-2, col 1) */
.wl-pane { grid-column: 1; grid-row: 1 / 3; }
.term-center { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; min-height: 0; gap: 1px; background: var(--line); }
.term-center .chart-pane { flex: 1; min-height: 0; }
.term-center .orders-pane { height: 232px; flex: none; }
.book-col { grid-column: 3; grid-row: 2; display: flex; flex-direction: column; min-height: 0; gap: 1px; background: var(--line); }
.book-col .ob-pane { flex: 1.5; min-height: 0; }
.book-col .trades-pane { flex: 1; min-height: 0; }
.wl-search { display: flex; align-items: center; gap: 7px; margin: 8px 10px; padding: 6px 9px; background: var(--surface); border-radius: 6px; }
.wl-search svg { width: 14px; height: 14px; color: var(--mute); }
.wl-search input { flex: 1; background: none; border: none; color: var(--snow); font-size: 12px; }
.wl-search input:focus { outline: none; }
.wl-tabs { display: flex; gap: 4px; padding: 0 10px 6px; }
.wl-tabs button { background: none; border: none; color: var(--mute); font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 5px; cursor: pointer; }
.wl-tabs button.active { background: var(--surface); color: var(--snow); }
.wl-cols { display: grid; grid-template-columns: 1.3fr 1fr 0.9fr; padding: 4px 12px; font-size: 9.5px; color: var(--mute); }
.wl-cols span:not(:first-child) { text-align: right; }
.wl-list { overflow-y: auto; flex: 1; }
.wl-row { display: grid; grid-template-columns: 1.3fr 1fr 0.9fr; align-items: center; padding: 6px 12px; cursor: pointer; border-left: 2px solid transparent; }
.wl-row:hover { background: var(--surface); }
.wl-row.active { background: var(--surface); border-left-color: var(--mint); }
.wl-row .wp strong { font-size: 12px; font-weight: 600; display: block; }
.wl-row .wp small { font-size: 9.5px; color: var(--mute); }
.wl-row .wpr { text-align: right; font-size: 11.5px; }
.wl-row .wch { text-align: right; font-size: 11px; font-weight: 600; }

/* watchlist collapse/expand (Binance/Bybit pattern) */
.wl-pane { position: relative; }
.wl-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 2px; }
.wl-head .wl-title { font-size: 11px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; }
.wl-toggle { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: none; background: none; color: var(--mute); border-radius: 5px; cursor: pointer; flex-shrink: 0; transition: background .15s, color .15s; }
.wl-toggle:hover { background: var(--surface); color: var(--snow); }
.wl-toggle svg { width: 14px; height: 14px; }
/* collapsed: hide the body, show a vertical "expand" rail */
.term.wl-collapsed .wl-body { display: none; }
.wl-rail { display: none; }
.term.wl-collapsed .wl-rail { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 8px; }
.term.wl-collapsed .wl-rail .wl-toggle { width: 28px; height: 28px; }
.wl-rail-label { writing-mode: vertical-rl; font-size: 10px; font-weight: 600; color: var(--mute); letter-spacing: .12em; text-transform: uppercase; user-select: none; }
.term.wl-collapsed .wl-head { display: none; }

/* chart pane */
.chart-pane { display: flex; flex-direction: column; }
.chart-tools { display: flex; align-items: center; gap: 14px; padding: 7px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.chart-tools .tf { display: flex; gap: 2px; }
.chart-tools .tf button, .chart-tools .ind button { background: none; border: none; color: var(--snow-dim); font-size: 11.5px; font-weight: 500; padding: 4px 8px; border-radius: 5px; cursor: pointer; }
.chart-tools .tf button.active { background: var(--elevated); color: var(--mint); }
.chart-tools .ind { display: flex; gap: 6px; margin-left: auto; }
.chart-tools .ind button:hover { color: var(--snow); }
.chart-tools .ind button.active { color: var(--snow); }
.chart-ma { display: flex; gap: 14px; padding: 5px 12px; font-size: 10.5px; font-family: var(--mono); }
.chart-stage { flex: 1; min-height: 0; padding: 4px 8px 8px; }
.chart-stage > div { width: 100%; height: 100%; }

/* orders pane (bottom of center) */
.otabs { display: flex; gap: 16px; padding: 9px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.otabs button { background: none; border: none; color: var(--mute); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.otabs button.active { color: var(--snow); }
.otable { overflow-y: auto; overflow-x: auto; flex: 1; }
.otable .prow.wide { min-width: 920px; }
.orow { display: grid; grid-template-columns: 1.2fr 1fr 0.8fr 1fr 1fr 0.9fr 0.8fr; align-items: center; padding: 8px 12px; font-size: 12px; border-bottom: 1px solid var(--line-soft); }
.orow.ohead { color: var(--mute); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; position: sticky; top: 0; background: var(--bg); }
.orow .cancel { background: none; border: 1px solid var(--line); border-radius: 5px; color: var(--down); font-size: 11px; padding: 3px 9px; cursor: pointer; justify-self: start; }
.prow { display: grid; grid-template-columns: 1.6fr 0.7fr 0.9fr 0.9fr 1fr 0.9fr 1.5fr 0.7fr; align-items: center; padding: 9px 12px; font-size: 12px; border-bottom: 1px solid var(--line-soft); }
.prow.ohead { color: var(--mute); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.prow span:not(:first-child) { text-align: right; }
.prow strong { font-size: 12.5px; }
.prow .cancel { background: var(--down); color: #fff; border: none; border-radius: 5px; font-size: 11px; padding: 4px 12px; cursor: pointer; justify-self: end; }
/* Wide positions grid: Symbol Size Entry Break-even Mark Liq MarginRatio Margin PnL EstFunding TP/SL Actions */
.prow.wide { grid-template-columns: 1.7fr 0.7fr 0.85fr 0.85fr 0.85fr 0.85fr 0.8fr 0.8fr 1.4fr 0.85fr 1fr 1.6fr; }
.prow .cancel.ghost { background: none; border: 1px solid var(--line); color: var(--txt-2, var(--mute)); }
.pos-sym { cursor: pointer; }
.pos-sym:hover strong { color: var(--mint); }
.pos-tpsl { font-size: 11px; }
.pos-row-acts { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.pos-row-acts .cancel { padding: 3px 8px; font-size: 10.5px; }
.pos-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; border-bottom: 1px solid var(--line-soft); }
.pos-toolbar-acts { display: flex; gap: 6px; }
.tbtn.xs { padding: 3px 10px; font-size: 11px; }
.tbtn.xs.danger { color: var(--down); border-color: var(--down); }
.tpsl-proj { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 10px; font-size: 12px; }
.tpsl-proj .k { color: var(--mute); }
.acct-drow { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.acct-drow:last-child { border-bottom: none; }
.acct-drow strong { font-size: 13.5px; display: block; } .acct-drow small { font-size: 12px; display: block; }
.pos-tag { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; font-size: 9px; font-weight: 700; margin-right: 7px; }
.pos-tag.long { background: var(--up-wash); color: var(--up); } .pos-tag.short { background: var(--down-wash); color: var(--down); }
.opane-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px; color: var(--mute); font-size: 12px; }

/* orderbook + trades (col 3) */
.ob-mode { display: flex; gap: 4px; }
.ob-mode button { width: 22px; height: 18px; border: 1px solid var(--line); background: none; border-radius: 3px; cursor: pointer; padding: 2px; }
.ob-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 4px 12px; font-size: 9.5px; color: var(--mute); }
.ob-cols span:not(:first-child) { text-align: right; }
.ob-scroll { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.ob-side { display: flex; flex-direction: column; flex: 1; justify-content: flex-end; }
.ob-side.bids { justify-content: flex-start; }
.ob-row { display: grid; grid-template-columns: 1fr 1fr 1fr; position: relative; padding: 1.5px 12px; font-size: 11px; font-family: var(--mono); cursor: pointer; transition: background .2s; }
.ob-row:hover { background: var(--surface); }
.ob-row span { position: relative; z-index: 1; }
.ob-row span:not(.px):not(.fill) { text-align: right; color: var(--snow-dim); }
.ob-row.ask .px { color: var(--down); } .ob-row.bid .px { color: var(--up); }
.ob-row .fill { position: absolute; right: 0; top: 0; bottom: 0; z-index: 0; transition: width 400ms ease-out; }
.ob-row.ask .fill { background: var(--down-wash); } .ob-row.bid .fill { background: var(--up-wash); }
/* size-change flash (prev-vs-new) — quick highlight that fades via the .2s bg transition */
.ob-row.flash-up { background: var(--up-wash); }
.ob-row.flash-down { background: var(--down-wash); }
/* HOLD-LAST-GOOD staleness: during an engine/LP restart or WS gap the book keeps
   showing the last-good depth, but dimmed, with a subtle "reconnecting…" tag —
   it NEVER blanks to 0. The tag is hidden until .ob-stale is set on the pane. */
.ob-stale-tag { display: none; font-size: 9.5px; font-weight: 600; color: var(--warn); opacity: .9; letter-spacing: .02em; margin-left: auto; margin-right: 8px; }
.ob-pane.ob-stale .ob-stale-tag { display: inline; animation: ob-pulse 1.6s ease-in-out infinite; }
/* "Updating", not "disabled": a subtle dim with NO greyscale, so prices stay legible
   and coloured (green/red) while the last-good book is held during a brief WS gap. */
.ob-pane.ob-stale .ob-scroll { opacity: .8; transition: opacity .3s ease; }
.ob-pane .ob-scroll { transition: opacity .25s ease, filter .25s ease; }
@keyframes ob-pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.ob-mid { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ob-mid .mp { font-size: 16px; font-weight: 700; font-family: var(--mono); }
.ob-mid .mp-sub { font-size: 10px; color: var(--mute); font-family: var(--mono); }
.trades-list { overflow-y: auto; flex: 1; }
.trade-row { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 2px 12px; font-size: 11px; font-family: var(--mono); }
.trade-row span:not(:first-child) { text-align: right; }

/* order form (col 4) */
.form-pane { grid-column: 4; grid-row: 2; padding: 12px; gap: 10px; overflow-y: auto; }
.bs-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.bs-tabs button { background: var(--surface); border: none; padding: 9px; font-size: 13px; font-weight: 600; color: var(--snow-dim); cursor: pointer; }
.bs-tabs button.buy.active { background: var(--up); color: var(--ink); }
.bs-tabs button.sell.active { background: var(--down); color: #fff; }
.lev-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lev-pill { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-size: 12px; font-weight: 600; color: var(--snow); display: flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; }
.otype { display: flex; gap: 14px; }
.otype button { background: none; border: none; color: var(--snow-dim); font-size: 12px; cursor: pointer; padding: 2px 0 5px; border-bottom: 1.5px solid transparent; }
.otype button.active { color: var(--snow); border-bottom-color: var(--mint); }
.favbl { display: flex; justify-content: space-between; font-size: 11px; }
.finput { display: flex; flex-direction: column; gap: 4px; }
.finput .fl { font-size: 9.5px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.05em; }
.finput .fb { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; }
.finput .fb:focus-within { border-color: var(--mint); }
.finput input { flex: 1; background: none; border: none; color: var(--snow); padding: 9px 0; font-family: var(--mono); font-size: 13px; min-width: 0; }
.finput input:focus { outline: none; }
.finput .sfx { color: var(--mute); font-size: 11px; }
.finput .mx { background: none; border: none; color: var(--mint); font-size: 11px; font-weight: 700; cursor: pointer; }
.fslider { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: var(--surface); border-radius: 4px; }
.fslider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--mint); border: 3px solid var(--bg); cursor: pointer; }
.fpcts { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; }
.fpcts button { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; color: var(--snow-dim); font-family: var(--mono); font-size: 11px; padding: 5px 0; cursor: pointer; }
.fpcts button.active { background: var(--mint); color: var(--ink); border-color: var(--mint); }
.fmeta { display: flex; flex-direction: column; gap: 5px; padding: 8px 0; border-top: 1px solid var(--line); }
.fmeta > div { display: flex; justify-content: space-between; font-size: 11.5px; }
.fmeta span { color: var(--mute); }
.fbig { border: none; border-radius: 7px; padding: 12px; font-size: 14px; font-weight: 700; cursor: pointer; }
.fbig.buy { background: var(--up); color: var(--ink); } .fbig.sell { background: var(--down); color: #fff; }
.fbig:disabled { opacity: 0.45; cursor: not-allowed; }
.facct { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11.5px; }
.facct > div { display: flex; justify-content: space-between; }

/* Dual bottom action buttons (futures): Open Long | Open Short */
.fdual { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fdual .fbig { width: 100%; }

/* Transfer icon next to the Avbl row (spot <-> futures). The icon hugs the value. */
.favbl { align-items: center; }
.favbl .mono { margin-left: auto; }
.favbl-xfer { margin-left: 6px; padding: 0; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; background: none; border: none; color: var(--mint); cursor: pointer; }
.favbl-xfer svg { width: 14px; height: 14px; }
.favbl-xfer:hover { color: var(--mint-deep); }

/* ===== Margin Health panel (futures) — zoned radial gauge + liq proximity ===== */
.mh { display: flex; flex-direction: column; gap: 9px; margin-top: 8px; padding: 11px 12px 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: linear-gradient(180deg, var(--surface), var(--bg)); }
.mh-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 600; letter-spacing: .03em; }
.mh-tag { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: var(--r-full); transition: color var(--d-base) var(--ease-standard), background var(--d-base) var(--ease-standard); }
.mh-tag.up { color: var(--up); background: var(--up-wash); }
.mh-tag.warn { color: var(--warn); background: rgba(240,185,11,0.12); }
.mh-tag.down { color: var(--down); background: var(--down-wash); }

/* radial arc gauge */
.mh-arc { position: relative; display: flex; justify-content: center; padding-top: 2px; }
.mh-gauge { width: 156px; height: 86px; overflow: visible; }
.mh-track { fill: none; stroke: var(--elevated); stroke-width: 9; stroke-linecap: round; }
.mh-zone { fill: none; stroke-width: 9; stroke-linecap: butt; opacity: .26; }
.mh-zone.z-up { stroke: var(--up); }
.mh-zone.z-warn { stroke: var(--warn); }
.mh-zone.z-down { stroke: var(--down); }
.mh-val { fill: none; stroke: var(--up); stroke-width: 9; stroke-linecap: round; filter: drop-shadow(0 0 4px currentColor); transition: stroke-dashoffset var(--d-slow) var(--ease-decel), stroke var(--d-base) var(--ease-standard); }
.mh-mm { stroke: var(--snow); stroke-width: 1.6; opacity: .5; }
.mh-center { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; pointer-events: none; }
.mh-pct { font-size: 21px; font-weight: 700; line-height: 1; transition: color var(--d-base) var(--ease-standard); }
.mh-word { font-size: 10px; font-weight: 600; letter-spacing: .05em; margin-top: 3px; text-transform: uppercase; transition: color var(--d-base) var(--ease-standard); }

/* liquidation proximity strip */
.mh-liq { display: flex; flex-direction: column; gap: 5px; padding: 8px 9px; border-radius: var(--r-md); background: var(--elevated); border: 1px solid transparent; transition: border-color var(--d-base) var(--ease-standard), background var(--d-base) var(--ease-standard); }
.mh-liq.near { border-color: rgba(240,185,11,0.4); }
.mh-liq.danger { border-color: rgba(246,70,93,0.5); background: var(--down-wash); }
.mh-liq-top { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.mh-liq-ico { font-size: 11px; filter: grayscale(.2); }
.mh-liq.danger .mh-liq-ico { animation: mh-pulse 1.1s ease-in-out infinite; }
.mh-liq-label { color: var(--mute); font-weight: 600; }
.mh-liq-away { margin-left: auto; font-weight: 700; transition: color var(--d-base) var(--ease-standard); }
.mh-liq-meter { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.06); overflow: hidden; }
.mh-liq-meter > i { display: block; height: 100%; width: 0%; border-radius: 2px; background: linear-gradient(90deg, var(--warn), var(--down)); transition: width var(--d-slow) var(--ease-decel); }
.mh-liq-price { font-size: 11px; }
@keyframes mh-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* breakdown rows */
.mh-bd { display: flex; flex-direction: column; gap: 4px; }
.mh-bd-row { display: flex; justify-content: space-between; font-size: 11.5px; }
.mh-bd-row span:first-child { font-size: 11px; }

/* ===== Generic page (markets/wallet/home/earn) ===== */
.page { padding: 20px 24px; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.page-head p { margin: 5px 0 0; color: var(--mute); font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.chips { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--snow-dim); padding: 6px 13px; font-size: 12.5px; cursor: pointer; }
.chip.active { background: var(--snow); color: var(--ink); border-color: var(--snow); font-weight: 600; }

/* markets table */
.mtable { overflow: hidden; }
.mrow { display: grid; grid-template-columns: 2.2fr 1.3fr 1.2fr 1.1fr 1.1fr 1.4fr 1fr; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.mrow:hover:not(.mhead) { background: var(--elevated); }
.mhead { color: var(--mute); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--line); }
.mcol { font-size: 13.5px; }
.mcol.num { text-align: right; }
.mhead .mcol { cursor: pointer; }
.mpair { display: flex; align-items: center; gap: 10px; }
.mpair .fav { background: none; border: none; color: var(--line); cursor: pointer; padding: 0; display: grid; }
.mpair .fav svg { width: 14px; height: 14px; } .mpair .fav.on { color: var(--warn); }
.mpair strong { font-size: 13.5px; font-weight: 600; display: block; }
.mpair small { font-size: 10.5px; color: var(--mute); }
.mspark { width: 96px; height: 30px; display: inline-block; vertical-align: middle; }
.cpill { display: inline-block; min-width: 70px; text-align: center; padding: 4px 8px; border-radius: 5px; font-size: 12.5px; font-weight: 600; color: #fff; }
.cpill.up { background: var(--up); } .cpill.down { background: var(--down); }
.tradebtn { background: var(--mint); color: var(--ink); border: none; border-radius: 6px; padding: 5px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; }

/* home dashboard */
.dash { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.right-col { display: flex; flex-direction: column; gap: 16px; }
.left-col { display: flex; flex-direction: column; gap: 16px; }
.gs-card { padding: 16px; }
.gs-head { display: flex; align-items: flex-start; justify-content: space-between; }
.gs-head h3 { margin: 0; font-size: 14px; }
.gs-bar { height: 5px; background: var(--elevated); border-radius: 4px; overflow: hidden; margin: 12px 0 14px; }
.gs-bar i { display: block; height: 100%; background: var(--mint); transition: width var(--d-slow); }
.gs-steps { display: flex; flex-direction: column; gap: 8px; }
.gs-step { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: var(--elevated); border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; cursor: pointer; color: var(--snow); }
.gs-step:hover:not(:disabled) { border-color: var(--mint); }
.gs-step:disabled { cursor: default; opacity: 0.7; }
.gs-step .gs-dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; flex-shrink: 0; color: var(--ink); }
.gs-step.done .gs-dot { background: var(--mint); border-color: var(--mint); }
.gs-step > div { flex: 1; } .gs-step strong { font-size: 13px; display: block; } .gs-step small { font-size: 11.5px; }
.gs-step.done strong { color: var(--mute); text-decoration: line-through; }
.gs-go { font-size: 12px; font-weight: 600; color: var(--mint); white-space: nowrap; }
.pos-body { display: flex; flex-direction: column; }
.pos-hd, .pos-rw { display: grid; grid-template-columns: 1.4fr 0.8fr 1fr 1fr 1fr 1.6fr; align-items: center; padding: 9px 16px; font-size: 12.5px; }
.pos-hd { color: var(--mute); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--line); }
.pos-hd span:not(:first-child), .pos-rw span:not(:first-child) { text-align: right; }
.pos-rw { border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.pos-rw:last-child { border-bottom: none; } .pos-rw:hover { background: var(--elevated); }
.pos-rw strong { font-size: 13px; }
.pos-tag { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; font-size: 9px; font-weight: 700; margin-right: 7px; }
.pos-tag.long { background: var(--up-wash); color: var(--up); } .pos-tag.short { background: var(--down-wash); color: var(--down); }
.dash-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-top: 16px; }
.balcard { padding: 22px; }
.balcard .bn { display: block; font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 2px; }
.balcard .bn .cur { font-size: 14px; color: var(--mute); }
.bbreak { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin: 18px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bbreak > div span { font-size: 10.5px; color: var(--mute); display: block; }
.bbreak > div strong { font-size: 15px; }
.qrow { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.qbtn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; background: var(--elevated); border: 1px solid var(--line); border-radius: 7px; color: var(--snow); cursor: pointer; font-size: 12.5px; font-weight: 500; }
.qbtn:hover { border-color: var(--mint); color: var(--mint); }
.qbtn svg { width: 20px; height: 20px; color: var(--mint); }
.dcard-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dcard-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.dcard-head a { color: var(--mute); font-size: 12px; text-decoration: none; cursor: pointer; }
.dwl { padding: 4px; }
.dwl-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 6px; cursor: pointer; }
.dwl-row:hover { background: var(--elevated); }
.dwl-row .dp { display: flex; align-items: center; gap: 9px; } .dwl-row .dp strong { font-size: 13px; }
.dwl-row .dspark { width: 64px; height: 26px; justify-self: center; }
.dwl-row .dpr { text-align: right; } .dwl-row .dpr .v { font-size: 13px; }

/* wallet */
.wtop { display: flex; align-items: center; justify-content: space-between; padding: 22px; gap: 20px; flex-wrap: wrap; }
.wtop .bn { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.wactions { display: flex; gap: 10px; }
.segbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; margin: 14px 0; }
.seglegend { display: flex; gap: 26px; flex-wrap: wrap; }
.legi { display: flex; align-items: center; gap: 8px; font-size: 13px; } .legi .d { width: 9px; height: 9px; border-radius: 2px; } .legi strong { font-size: 14px; }
.atable { }
.arow { display: grid; grid-template-columns: 2fr 1.2fr 1.2fr 1.2fr 1.2fr 1.6fr; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.arow.ahead { color: var(--mute); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; }
.arow > span:not(:first-child) { text-align: right; }
.aasset { display: flex; align-items: center; gap: 10px; } .aasset strong { font-size: 13.5px; }
.aact { display: flex; gap: 6px; justify-content: flex-end; }
.aact button { background: none; border: 1px solid var(--line); border-radius: 5px; color: var(--snow-dim); font-size: 11.5px; padding: 4px 10px; cursor: pointer; }
.aact button:hover { color: var(--snow); border-color: var(--mute); }

/* earn */
.earn-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.ecard { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.ecard .apr { font-size: 26px; font-weight: 700; }

.coin { border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; flex-shrink: 0; }
.spark-svg { overflow: visible; }
.pill { font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--mint); background: var(--mint-wash); padding: 3px 8px; border-radius: 999px; }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }

/* Identity verification card (Account) */
.kyc-card { transition: border-color var(--d-fast), transform var(--d-fast); }
.kyc-card:hover { border-color: var(--mint); }
.kyc-tiers { display: flex; flex-direction: column; gap: 8px; }
.kyc-tier { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; background: var(--elevated); border: 1px solid var(--line); }
.kyc-tier > div { flex: 1; display: flex; flex-direction: column; }
.kyc-tier strong { font-size: 13.5px; font-weight: 600; }
.kyc-tier small { font-size: 12px; }
.kyc-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--mute); background: var(--surface); border: 1.5px solid var(--line); }
.kyc-tier.done .kyc-dot { color: var(--bg); background: var(--mint); border-color: var(--mint); }
.kyc-tier.cur { border-color: var(--mint); background: var(--mint-wash); }
.kyc-tier.cur .kyc-dot { color: var(--mint); border-color: var(--mint); }
.kyc-go { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--mint); white-space: nowrap; }

/* sheet / picker / sheets shared with toast */
.toast-host { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--elevated); border: 1px solid var(--line); border-radius: 7px; padding: 10px 18px; font-size: 13px; font-weight: 500; box-shadow: var(--e-3); animation: tin 0.2s; }
@keyframes tin { from { opacity: 0; transform: translateY(-10px); } }
.toast.ok { border-color: color-mix(in srgb, var(--mint) 40%, transparent); }

.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; animation: oin 0.2s; }
@keyframes oin { from { opacity: 0; } }
.modal { width: 460px; max-width: 92vw; max-height: 80vh; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--e-4); display: flex; flex-direction: column; overflow: hidden; animation: min 0.2s; }
@keyframes min { from { transform: translateY(-12px); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-head button { background: none; border: none; color: var(--mute); font-size: 17px; cursor: pointer; }
.modal-search { display: flex; align-items: center; gap: 8px; margin: 0 16px 8px; padding: 9px 12px; background: var(--surface); border-radius: 7px; }
.modal-search svg { width: 15px; height: 15px; color: var(--mute); }
.modal-search input { flex: 1; background: none; border: none; color: var(--snow); font-size: 13px; }
.modal-search input:focus { outline: none; }
.modal-list { overflow-y: auto; }
.modal-opt { display: grid; grid-template-columns: auto 1.6fr 1fr 0.9fr; align-items: center; gap: 10px; padding: 10px 16px; cursor: pointer; }
.modal-opt:hover { background: var(--surface); }
.modal-opt > div { display: flex; flex-direction: column; }
.modal-opt strong { font-size: 13px; } .modal-opt small { font-size: 10.5px; color: var(--mute); }
.modal-opt .mono { text-align: right; }
.dep-modal { padding: 16px; gap: 14px; display: flex; flex-direction: column; }
.dep-field { display: flex; flex-direction: column; gap: 6px; }
.dep-field .fl { font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.05em; }
.dep-sel { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 11px 13px; cursor: pointer; }
.dep-sel .coin-sel { display: flex; align-items: center; gap: 9px; } .dep-sel strong { font-size: 14px; }
.dep-warn { font-size: 11.5px; line-height: 1.4; color: var(--snow-dim); background: var(--mint-wash); border-radius: 7px; padding: 10px 12px; }
.dep-warn.amber { background: color-mix(in srgb, var(--warn) 11%, transparent); }
.dep-qr { display: flex; gap: 14px; align-items: flex-start; }
.dep-qr .q { background: #fff; padding: 8px; border-radius: 7px; line-height: 0; }
.dep-addr { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.dep-addr .ac { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; }
.dep-addr code { flex: 1; font-size: 11px; word-break: break-all; color: var(--snow-dim); font-family: var(--mono); }
.dep-addr .cp { background: var(--mint); color: var(--ink); border: none; border-radius: 5px; padding: 6px 12px; font-weight: 700; font-size: 12px; cursor: pointer; }
.inforows { background: var(--surface); border-radius: 7px; padding: 2px 13px; }
.inforows > div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.inforows > div:last-child { border-bottom: none; } .inforows .k { color: var(--mute); }
.fullbtn { width: 100%; border: none; border-radius: 8px; padding: 13px; font-size: 14px; font-weight: 700; cursor: pointer; background: var(--mint); color: var(--ink); }

/* leverage modal */
.lev-modal { padding: 16px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.lev-top { display: flex; align-items: center; justify-content: space-between; }
.lev-top .ll { font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.06em; }
.lev-big { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--mint); }
.lev-big.hot { color: var(--down); }
.lev-stepper { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.lev-stepper button { background: none; border: none; color: var(--snow); font-size: 20px; width: 44px; height: 40px; cursor: pointer; }
.lev-stepper .lv { flex: 1; text-align: center; font-family: var(--mono); font-size: 16px; font-weight: 700; }
.lev-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: var(--surface); }
.lev-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--mint); border: 3px solid var(--bg); cursor: pointer; }
.lev-stops { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--mute); }
.lev-stops button { background: none; border: none; color: var(--mute); font-family: var(--mono); font-size: 11px; cursor: pointer; padding: 0; }
.lev-stops button.on { color: var(--mint); font-weight: 600; }
.lev-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; background: var(--surface); border-radius: 8px; padding: 14px; }
.lev-stats > div span { font-size: 9.5px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 4px; }
.lev-stats strong { font-family: var(--mono); font-size: 15px; }
.lev-warn { display: flex; gap: 10px; font-size: 12px; line-height: 1.45; color: var(--snow-dim); background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: 8px; padding: 11px 13px; }
.lev-warn .wi { color: var(--warn); font-weight: 700; }
.lev-tiers { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lev-trow { display: grid; grid-template-columns: 1.5fr 1fr 1fr; padding: 9px 12px; font-family: var(--mono); font-size: 12px; border-bottom: 1px solid var(--line-soft); }
.lev-trow:last-child { border-bottom: none; }
.lev-trow.head { color: var(--mute); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.05em; background: var(--surface); }
.lev-trow.cur { background: var(--mint-wash); color: var(--mint); }
.lev-trow span:not(:first-child) { text-align: right; }
.lev-secn { font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.06em; }

/* empty */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px; color: var(--mute); }

/* ===== Tablet (10"+) ===== */
@media (max-width: 1180px) {
  .term, .term.wl-collapsed { grid-template-columns: 1fr 230px 270px; }
  .wl-pane { display: none; }
  .pair-strip { grid-column: 1 / 4; }
  .term-center { grid-column: 1; grid-row: 2; }
  .book-col { grid-column: 2; grid-row: 2; }
  .book-col .trades-pane { display: none; }
  .form-pane { grid-column: 3; grid-row: 2; }
  .mrow { grid-template-columns: 2fr 1.3fr 1.2fr 1.4fr 1fr; }
  .mcol.hidecol { display: none; }
  .earn-grid { grid-template-columns: repeat(2,1fr); }
  .dash, .dash-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .nav { display: none; }
}

/* ── P1/P1b/P2 additions: auth gating, margin mode, order flags, real wallet ── */
.auth-zone { display:flex; align-items:center; gap:8px; }
.tbtn.ghost { background:transparent; border:1px solid var(--line); color:var(--snow); }
.tbtn.ghost:hover { border-color:var(--mint); color:var(--mint); }

/* Sign-in gate (logged-out protected views) */
.signin-gate-page { display:flex; align-items:center; justify-content:center; min-height:60vh; }
.signin-gate { max-width:440px; margin:48px auto; text-align:center; background:var(--card,#11151B);
  border:1px solid var(--line); border-radius:16px; padding:40px 32px; display:flex; flex-direction:column; align-items:center; gap:14px; }
.signin-gate .sg-mesh { opacity:.85; }
.signin-gate h2 { margin:4px 0 0; font-size:22px; }
.signin-gate p { margin:0; color:var(--mute,#8B95A3); font-size:14px; line-height:1.6; }
.signin-gate .sg-cta { display:flex; gap:10px; margin-top:8px; }
.signin-gate .sg-cta .tbtn { min-width:120px; }
.signin-gate .sg-browse { background:none; border:none; color:var(--mint); cursor:pointer; font-size:13px; margin-top:4px; }
.opane-empty.signin-inline, .signin-inline { display:flex; flex-direction:column; align-items:center; gap:6px; padding:28px 16px; color:var(--mute); }

/* Margin-mode + order-flag controls */
.fflags { display:flex; gap:14px; flex-wrap:wrap; padding:8px 0 4px; }
.fcheck { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--mute); cursor:pointer; user-select:none; }
.fcheck-box { width:14px; height:14px; border:1.5px solid var(--line); border-radius:4px; display:inline-block; position:relative; transition:.12s; }
.fcheck-box.on { background:var(--mint); border-color:var(--mint); }
.fcheck-box.on::after { content:"✓"; position:absolute; inset:0; color:#06210f; font-size:10px; line-height:11px; text-align:center; font-weight:800; }
.ftpsl { display:flex; gap:8px; }
.ftpsl input { flex:1; background:var(--elevated,#0E1218); border:1px solid var(--line); color:var(--snow); border-radius:8px; padding:8px 10px; font-size:13px; }

/* Margin-mode modal */
.margin-modal .mm-opts { display:flex; flex-direction:column; gap:10px; margin-bottom:14px; }
.mm-opt { text-align:left; background:var(--elevated,#0E1218); border:1.5px solid var(--line); border-radius:10px; padding:12px 14px; cursor:pointer; display:flex; flex-direction:column; gap:4px; }
.mm-opt.on { border-color:var(--mint); }
.mm-opt small { line-height:1.5; }

/* deposit address pending/error states */
.dep-addr-state { background:var(--elevated,#0E1218); border:1px dashed var(--line); border-radius:10px; padding:18px 14px; text-align:center; color:var(--mute); font-size:13px; line-height:1.5; }
.dep-addr-state.error { color:var(--down); border-color:var(--down); }
.dep-addr-state.kyc { color:var(--warn,#F0B90B); }

/* transfer swap button */
.xfer-swap-d { display:flex; justify-content:center; padding:4px 0; }
.xfer-swap-d span { width:30px; height:30px; display:flex; align-items:center; justify-content:center; border:1px solid var(--line); border-radius:50%; cursor:pointer; color:var(--mint); }
.xfer-swap-d span:hover { border-color:var(--mint); }

/* transfer coin row — fixed (non-clickable) USDT identity, polished */
.xfer-coin { display:flex; align-items:center; gap:11px; background:var(--surface); border:1px solid var(--line); border-radius:9px; padding:11px 13px; }
.xfer-coin-meta { display:flex; flex-direction:column; gap:1px; line-height:1.15; }
.xfer-coin-meta strong { font-size:14px; letter-spacing:.01em; }
.xfer-coin-meta small { font-size:11px; }
.xfer-coin-pill { margin-left:auto; font-size:11px; font-weight:600; color:var(--mint); background:color-mix(in srgb, var(--mint) 13%, transparent); border:1px solid color-mix(in srgb, var(--mint) 30%, transparent); border-radius:999px; padding:3px 10px; white-space:nowrap; }

/* position row actions */
.pos-row-acts { display:flex; gap:6px; justify-content:flex-end; }
.cancel.ghost { background:transparent; }

/* ── P3: Lite/Pro chart toggle ── */
.chart-mode-toggle { display:flex; gap:4px; margin-left:auto; }
.chart-mode { background:transparent; border:1px solid var(--line); color:var(--mute); border-radius:6px; padding:3px 12px; font-size:12px; cursor:pointer; }
.chart-mode.active { background:var(--mint); border-color:var(--mint); color:#06210f; font-weight:600; }
.chart-pane .tv-stage { flex:1; min-height:0; }
/* graceful "chart unavailable / retry" panel (Pro-only chart fail state) */
.chart-fail { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; width:100%; height:100%; min-height:240px; color:var(--mute); text-align:center; padding:24px; }
.chart-fail p { margin:0; font-size:13px; }
.chart-pane { display:flex; flex-direction:column; }

/* ---------- notification inbox (bell) ---------- */
.ntf-wrap { position: relative; display: inline-grid; }
.ntf-bell { position: relative; }
.ntf-badge { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--down, #f6465d); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 16px; }
.ntf-panel { position: absolute; top: 42px; right: 0; width: 360px; max-width: 92vw; background: var(--card, var(--surface)); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,.45); z-index: 200; display: none; overflow: hidden; }
.ntf-panel.open { display: block; }
.ntf-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ntf-head strong { font-size: 14px; }
.ntf-allread { background: none; border: none; color: var(--mint); font-size: 12px; font-weight: 600; cursor: pointer; }
.ntf-list { max-height: 420px; overflow-y: auto; }
.ntf-empty { padding: 32px 18px; text-align: center; color: var(--snow-dim); font-size: 13px; line-height: 1.5; }
.ntf-row { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft, var(--line)); cursor: pointer; }
.ntf-row:hover { background: var(--elevated); }
.ntf-row.unread { background: color-mix(in srgb, var(--mint) 7%, transparent); }
.ntf-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); margin-top: 6px; flex-shrink: 0; }
.ntf-dot.r { background: transparent; }
.ntf-body { flex: 1; min-width: 0; }
.ntf-t { font-size: 13px; font-weight: 600; color: var(--snow); }
.ntf-m { font-size: 12.5px; color: var(--snow-dim); margin-top: 2px; line-height: 1.45; }
.ntf-ts { font-size: 11px; color: var(--mute, var(--snow-dim)); margin-top: 4px; }

/* ---- Assets menu (top-bar live balance dropdown) ---- */
.am-wrap { position: relative; display: inline-grid; }
.assets-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; height: auto; width: auto; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); color: var(--snow); cursor: pointer; font-size: 13px; font-weight: 600; }
.assets-btn:hover { border-color: var(--mint); }
.assets-btn .assets-ic { width: 16px; height: 16px; display: inline-flex; color: var(--mint); }
.assets-btn .assets-ic svg { width: 16px; height: 16px; }
.assets-btn .assets-car { width: 12px; height: 12px; display: inline-flex; color: var(--mute); }
.assets-btn .assets-car svg { width: 12px; height: 12px; }
.am-panel { position: absolute; top: 42px; right: 0; width: 300px; max-width: 92vw; background: var(--card, var(--surface)); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,.45); z-index: 200; display: none; overflow: hidden; }
.am-panel.open { display: block; }
.am-head { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.am-head .am-total { font-size: 22px; }
.am-rows { padding: 8px 6px; }
.am-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; }
.am-row .am-k { display: flex; flex-direction: column; }
.am-row .am-k span { font-size: 13px; color: var(--snow); }
.am-row .am-k small { font-size: 11px; }
.am-row strong { font-size: 13px; }
.am-acts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 8px 12px 4px; border-top: 1px solid var(--line); }
.am-act { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--snow); font-size: 11.5px; font-weight: 600; cursor: pointer; }
.am-act:hover { border-color: var(--mint); color: var(--mint); }
.am-act svg { width: 17px; height: 17px; }
.am-wallet { width: calc(100% - 24px); margin: 8px 12px 12px; padding: 9px; background: none; border: none; color: var(--mint); font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: center; }
.am-wallet:hover { text-decoration: underline; }
.link { color: var(--mint); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.promo-ref { border-radius: 10px; transition: background .15s; }
.promo-ref:hover { background: var(--elevated); }

/* ── Position-row Share button + PnL share card ───────────────────────── */
.pos-share { display: inline-flex; align-items: center; gap: 5px; color: var(--mint) !important; border-color: var(--mint-25, rgba(0,214,143,.25)) !important; }
.pos-share .pos-share-ico { display: inline-flex; }
.pos-share .pos-share-ico svg { width: 13px; height: 13px; display: block; }
.pos-share:hover { background: var(--mint-wash, rgba(0,214,143,.08)); }

.pnl-share-ov { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.66); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 24px; animation: oin .18s; }
.pnl-share-sheet { width: 460px; max-width: 100%; max-height: 92vh; overflow-y: auto; background: var(--surface, #11161C); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.6); padding: 18px 20px 22px; }
.pnl-share-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pnl-share-head h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--snow); }
.pnl-share-x { background: none; border: none; color: var(--snow-dim); font-size: 15px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.pnl-share-x:hover { background: var(--elevated); color: var(--snow); }

.pnl-share-stage { position: relative; display: flex; align-items: center; justify-content: center; }
.pnl-share-canvas { width: 100%; max-width: 360px; height: auto; border-radius: 18px; display: block; box-shadow: 0 12px 36px rgba(0,0,0,.4); }
.pnl-carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.5); border: 1px solid var(--line); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; transition: background .15s, transform .1s; }
.pnl-carousel-arrow:hover { background: var(--mint); color: var(--ink); }
.pnl-carousel-arrow:active { transform: translateY(-50%) scale(.92); }
.pnl-carousel-arrow.left { left: -6px; }
.pnl-carousel-arrow.right { right: -6px; }

.pnl-bg-dots { display: flex; gap: 8px; justify-content: center; margin: 14px 0 4px; }
.pnl-bg-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: var(--line); cursor: pointer; padding: 0; transition: transform .12s, background .15s; }
.pnl-bg-dot:hover { background: var(--snow-dim); }
.pnl-bg-dot.on { background: var(--mint); transform: scale(1.25); }
.pnl-bg-name { text-align: center; font-size: 12px; color: var(--snow-dim); margin-bottom: 14px; }

.pnl-toggle-wrap { margin-bottom: 16px; }
.pnl-toggle-label { display: block; font-size: 12px; color: var(--snow-dim); margin-bottom: 7px; }
.pnl-mode-toggle { display: flex; gap: 6px; background: var(--elevated); border-radius: 10px; padding: 4px; }
.pnl-mode-toggle button { flex: 1; background: none; border: none; color: var(--snow-dim); font-size: 12.5px; font-weight: 600; padding: 8px 6px; border-radius: 7px; cursor: pointer; transition: background .15s, color .15s; }
.pnl-mode-toggle button:hover { color: var(--snow); }
.pnl-mode-toggle button.on { background: var(--mint); color: var(--ink); }

.pnl-share-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pnl-act { display: flex; flex-direction: column; align-items: center; gap: 5px; background: var(--elevated); border: 1px solid var(--line); border-radius: 11px; color: var(--snow); font-size: 11.5px; font-weight: 500; padding: 11px 4px; cursor: pointer; transition: background .15s, border-color .15s, transform .08s; }
.pnl-act:hover { background: var(--mint-wash, rgba(0,214,143,.08)); border-color: var(--mint); }
.pnl-act:active { transform: scale(.96); }
.pnl-act-ico { color: var(--mint); display: flex; }
.pnl-act-ico svg { display: block; }
