:root {
  --bg: #161a26;
  --bg-deep: #10131c;
  --panel: #1d2232;
  --panel-2: #252b3e;
  --panel-3: #2d344a;
  --border: #2b3247;
  --text: #dde3f0;
  --text-2: #a8b1c7;
  --muted: #6f7a93;
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --green: #2fb24c;
  --green-hi: #38c95a;
  --red: #e5383b;
  --red-hi: #f04b4e;
  --amber: #f5a524;
  --radius: 8px;
  --sidebar: 76px;
  --header: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 Inter, "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.up { color: var(--green-hi); }
.down { color: var(--red-hi); }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--panel-3); font-weight: 600; letter-spacing: .01em; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { color: var(--text-2); font-size: 13px; }
.input, select.input, textarea.input {
  height: 42px; width: 100%; padding: 0 14px; border-radius: var(--radius);
  background: var(--bg-deep); border: 1px solid var(--border); outline: none; transition: border-color .15s;
}
textarea.input { height: auto; padding: 10px 14px; resize: vertical; }
.input:focus { border-color: var(--accent); }
.error-text { color: var(--red-hi); font-size: 13px; min-height: 18px; }

/* ---------- auth page ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 440px; align-items: stretch;
  background: radial-gradient(1100px 700px at 90% -10%, #1e3a6b66, transparent), radial-gradient(900px 500px at -10% 110%, #12305e55, transparent), var(--bg); }
.auth-hero { padding: 56px clamp(32px, 5vw, 84px); display: flex; flex-direction: column; justify-content: center; gap: 8px;
  border-right: 1px solid var(--border); background: linear-gradient(135deg, #141b2e 0%, #0f1420 100%); position: relative; overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; inset: 0; background:
  repeating-linear-gradient(90deg, #ffffff06 0 1px, transparent 1px 64px), repeating-linear-gradient(0deg, #ffffff06 0 1px, transparent 1px 64px); pointer-events: none; }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 650; letter-spacing: -.02em; margin: 26px 0 0; line-height: 1.1; }
.auth-hero .hero-sub { color: var(--text-2); font-size: 16px; max-width: 460px; margin: 10px 0 22px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; max-width: 460px; }
.hero-points li { display: flex; gap: 14px; align-items: flex-start; }
.hero-points li > span { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 18px;
  background: linear-gradient(135deg, #2563eb33, #60a5fa22); border: 1px solid #3b82f655; color: var(--accent-2); }
.hero-points li b { display: block; font-size: 14px; }
.hero-points li div { color: var(--muted); font-size: 13px; line-height: 1.4; }
.hero-points li b + :not(b) { color: var(--text-2); }
.hero-foot { margin-top: 30px; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.auth-card { width: 100%; max-width: 440px; background: var(--panel); border-left: 1px solid var(--border); padding: clamp(28px, 4vw, 48px) clamp(24px, 4vw, 44px);
  display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 880px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-card { max-width: 440px; margin: 0 auto; border-left: 0; border-radius: 14px; border: 1px solid var(--border); min-height: 100vh; }
}
.auth-card h1 { font-size: 22px; margin: 18px 0 4px; }
.tabs { display: flex; gap: 4px; background: var(--bg-deep); border-radius: var(--radius); padding: 4px; margin: 20px 0; }
.tabs button { flex: 1; height: 36px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-weight: 600; }
.tabs button.active { background: var(--panel-3); color: var(--text); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.risk-note { font-size: 12px; color: var(--muted); margin-top: 18px; line-height: 1.5; }
.auth-foot { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; align-items: center; }
.auth-foot a { color: var(--text-2); } .auth-foot a:hover { color: var(--accent-2); } .auth-foot span { color: var(--muted); }
.hero-foot a { color: var(--accent-2); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; grid-template-rows: var(--header) 1fr; height: 100vh; }
.header { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 16px 0 18px; border-bottom: 1px solid var(--border); background: var(--bg); }
.header .spacer { flex: 1; }
.promo-chip { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px 0 10px; border-radius: var(--radius);
  background: linear-gradient(135deg, #1e3f73, #1b2a4a); border: 1px solid #2a4a80; font-size: 12px; line-height: 1.2; }
.promo-chip b { display: block; font-size: 13px; color: #fff; }
.promo-chip span { color: #9fb4d9; }
.promo-chip svg { color: var(--accent-2); width: 26px; height: 26px; }
.balance-box { display: flex; flex-direction: column; justify-content: center; height: 44px; padding: 0 14px; min-width: 120px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.balance-box small { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; }
.balance-box strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.btn-topup { height: 44px; padding: 0 18px; background: var(--green); color: #fff; border: 0; border-radius: var(--radius); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.btn-topup:hover { filter: brightness(1.1); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--panel-3); border: 2px solid var(--green); display: grid; place-items: center; font-weight: 700; color: var(--text-2); position: relative; }

.sidebar { background: var(--bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 4px; overflow-y: auto; }
.nav-item { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 0; border-radius: var(--radius);
  color: var(--text-2); font-size: 11px; border: 0; background: transparent; }
.nav-item:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--panel-2); color: var(--text); }
.nav-item svg { width: 22px; height: 22px; }
.sidebar .grow { flex: 1; }

.main { overflow: auto; position: relative; min-width: 0; }

/* finance flyout (like the reference's Finance menu) */
.flyout { position: absolute; top: var(--header); left: var(--sidebar); bottom: 0; width: 320px; padding: 12px; background: #1a1f2dee;
  backdrop-filter: blur(6px); border-right: 1px solid var(--border); z-index: 30; display: flex; flex-direction: column; gap: 8px; }
.flyout a { display: flex; align-items: center; gap: 14px; height: 54px; padding: 0 18px; border-radius: var(--radius); background: var(--panel-2); color: var(--text); font-size: 15px; }
.flyout a:hover { background: var(--panel-3); text-decoration: none; }
.flyout a svg { color: var(--text-2); }

/* ---------- trade view ---------- */
.trade { display: grid; grid-template-columns: minmax(0, 1fr) 216px 300px; height: 100%; }
.chart-area { position: relative; display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); background: var(--bg-deep); }
.chart-toolbar { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; gap: 8px; z-index: 5; align-items: center; pointer-events: none; }
.chart-toolbar > * { pointer-events: auto; }
.asset-btn { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--border); font-weight: 600; }
.asset-btn .pay { font-size: 12px; color: var(--green-hi); background: #2fb24c22; padding: 2px 6px; border-radius: 4px; }
.asset-btn .ab-name { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.asset-btn .ab-px { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; transition: color .35s; }
.asset-btn .ab-px.up { color: var(--green-hi); } .asset-btn .ab-px.down { color: var(--red-hi); }
.asset-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; }
.tf { display: flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; }
.tf button { border: 0; background: transparent; color: var(--text-2); height: 32px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.tf button.active { background: var(--panel-3); color: var(--text); }
.feed-badge { margin-left: auto; font-size: 11px; color: var(--amber); background: #f5a52418; border: 1px solid #f5a52455; padding: 4px 8px; border-radius: 6px; }
.feed-badge.live { color: var(--green-hi); background: #2fb24c15; border-color: #2fb24c55; }
.feed-badge.closed { color: var(--red-hi); background: #e5383b15; border-color: #e5383b55; }
#chart-mode button { display: inline-grid; place-items: center; width: 34px; padding: 0; }
#chart-mode svg { width: 17px; height: 17px; }
#chart { flex: 1; width: 100%; min-height: 300px; display: block; }

.asset-menu { position: absolute; top: 60px; left: 16px; width: 340px; max-height: 60vh; overflow: auto; z-index: 20;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 6px; box-shadow: 0 16px 40px #0008; }
.asset-row { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 10px; align-items: center; width: 100%; padding: 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; }
.asset-row:hover { background: var(--panel-2); }
.asset-row.disabled { opacity: .4; cursor: not-allowed; }
.asset-row .px { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12px; }

.order { padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--border); background: var(--bg); overflow-y: auto; }
.order label { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.stepper { display: flex; align-items: center; background: var(--bg-deep); border: 1px solid var(--border); border-radius: var(--radius); height: 44px; }
.stepper input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0 10px; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; outline: none; }
.stepper button { width: 30px; height: 100%; border: 0; background: transparent; color: var(--text-2); font-size: 18px; }
.stepper button:hover { color: var(--text); }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.presets button { height: 26px; border: 1px solid var(--border); background: var(--panel); border-radius: 5px; font-size: 11px; color: var(--text-2); }
.presets button:hover { color: var(--text); border-color: var(--accent); }
.payout-box { background: var(--bg-deep); border: 1px dashed var(--border); border-radius: var(--radius); padding: 8px; text-align: center; }
.payout-box .pct { color: var(--green-hi); font-size: 18px; font-weight: 700; }
.payout-box .amt { color: var(--green-hi); font-size: 13px; }
.trade-btn { height: 56px; border: 0; border-radius: var(--radius); color: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; padding: 0 16px; margin-top: 4px; transition: filter .15s, transform .05s; }
.trade-btn:active { transform: scale(.98); }
.trade-btn:hover { filter: brightness(1.1); }
.trade-btn:disabled { opacity: .45; cursor: not-allowed; }
.trade-btn.buy { background: var(--green); }
.trade-btn.sell { background: var(--red); }
.trade-btn .arr { width: 24px; height: 24px; border-radius: 50%; background: #ffffff2a; display: grid; place-items: center; }
.gate { background: linear-gradient(160deg, #1e3a6a, #1a2440); border: 1px solid #2d4f8a; border-radius: var(--radius); padding: 14px 12px; margin-top: 8px; text-align: center; font-size: 13px; }
.gate b { display: block; font-size: 14px; margin-bottom: 4px; }
.gate .btn { margin-top: 10px; }

.trades-panel { display: flex; flex-direction: column; background: var(--bg); min-width: 0; }
.trades-panel h3 { margin: 0; padding: 16px; font-size: 16px; text-align: center; border-bottom: 1px solid var(--border); }
.subtabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }
.subtabs button { height: 42px; border: 0; background: transparent; color: var(--text-2); border-bottom: 2px solid transparent; }
.subtabs button.active { color: var(--text); background: var(--panel); border-bottom-color: var(--accent); }
.trade-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.empty { color: var(--text-2); text-align: center; padding: 30px 10px; }
.tcard { background: var(--panel); border-radius: var(--radius); padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; border-left: 3px solid var(--border); }
.tcard.dir-up { border-left-color: var(--green); }
.tcard.dir-down { border-left-color: var(--red); }
.tcard .t-asset { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tcard .t-right { text-align: right; font-variant-numeric: tabular-nums; }
.tcard .t-sub { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tcard .bar { grid-column: 1 / -1; height: 3px; background: var(--panel-3); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.tcard .bar i { display: block; height: 100%; background: var(--accent); }

/* ---------- pages (finance/profile) ---------- */
.page { padding: 22px 24px 40px; max-width: 1240px; }
.page-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.page-tabs a { height: 36px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 6px; background: var(--panel); color: var(--text-2); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.page-tabs a:hover { text-decoration: none; color: var(--text); }
.page-tabs a.active { background: var(--panel-3); color: var(--text); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 28px 32px; }
.card h2 { margin: 0 0 22px; font-size: 26px; font-weight: 500; }
.card h3 { margin: 0 0 12px; font-size: 16px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.step { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; position: relative; }
.step .n { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; font-size: 13px; flex: none; }
.step::after { content: ""; flex: 1; height: 1px; background: var(--border); margin-left: 6px; }
.step:last-child::after { display: none; }
.step.active { color: var(--text); }
.step.active .n { background: var(--panel-3); border-color: var(--panel-3); }
.step.done .n { background: var(--green); border-color: var(--green); color: #fff; }

.dep-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
.banner { display: flex; gap: 18px; align-items: center; padding: 18px 22px; border-radius: 10px; margin-bottom: 12px;
  background: linear-gradient(100deg, #1e4c8f 0%, #22304d 45%, var(--panel-2) 100%); }
.banner svg { width: 54px; height: 54px; color: #8cc0ff; flex: none; }
.banner b { font-size: 17px; display: block; margin-bottom: 4px; }
.perks { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 10px; }
.perks li { display: flex; gap: 12px; align-items: center; }
.perks li .tag { width: 30px; height: 18px; border: 1px solid var(--accent); border-radius: 4px; color: var(--accent-2); font-size: 9px; display: grid; place-items: center; }

.section-title { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 600; margin: 24px 0 12px; }
.section-title::after { content: ""; flex: 1; border-top: 1px dashed var(--border); }
.methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.method { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-deep); text-align: left; padding: 0; overflow: hidden; transition: border-color .15s; }
.method:hover { border-color: var(--accent); }
.method .top { display: flex; gap: 12px; align-items: center; padding: 14px; min-height: 64px; }
.method .top b { font-size: 13px; line-height: 1.25; }
.method .top small { display: block; color: var(--muted); font-weight: 400; }
.method .meta { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }
.method .meta span { padding: 6px 10px; }
.method .meta span + span { border-left: 1px solid var(--border); }
.coin { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 10px; flex: none; }

.amount-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.amount-presets button { height: 38px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-deep); font-weight: 600; }
.amount-presets button.active, .amount-presets button:hover { border-color: var(--accent); color: var(--accent-2); }
.summary { background: var(--bg-deep); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.summary .row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--text-2); }
.summary .row b { color: var(--text); }
.addr { display: flex; gap: 8px; align-items: center; background: var(--bg-deep); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; word-break: break-all; }
.addr code { flex: 1; font-size: 14px; }
.warn { background: #f5a52412; border: 1px solid #f5a52444; color: #f7c46a; border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin: 14px 0; }
.status-big { text-align: center; padding: 30px 10px; }
.status-big .ring { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; }
.status-big .ring svg { width: 34px; height: 34px; }
.ring.pending { background: #f5a5241c; color: var(--amber); }
.ring.ok { background: #2fb24c22; color: var(--green-hi); }
.ring.bad { background: #e5383b22; color: var(--red-hi); }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; text-transform: capitalize; background: var(--panel-3); color: var(--text-2); }
.pill.approved, .pill.won, .pill.paid { background: #2fb24c22; color: var(--green-hi); }
.pill.pending, .pill.awaiting_payment, .pill.open { background: #f5a5241c; color: var(--amber); }
.pill.rejected, .pill.lost, .pill.cancelled { background: #e5383b1c; color: var(--red-hi); }
.two-col { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 32px; }

/* ---------- payment locks / KYC ---------- */
.method.locked { opacity: .82; }
.method.locked:hover { border-color: var(--amber); }
.method .top { position: relative; }
.lock-badge { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 700; letter-spacing: .02em; padding: 2px 7px; border-radius: 10px;
  background: #f5a5241f; color: var(--amber); border: 1px solid #f5a52455; }
.lock-badge.bad { background: #e5383b1a; color: var(--red-hi); border-color: #e5383b55; }
.lock-note { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 10px; margin: 6px 0 14px;
  background: #f5a52412; border: 1px solid #f5a52455; color: var(--text-2); font-size: 13px; line-height: 1.55; }
.lock-note b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.lock-note > svg { color: var(--amber); width: 26px; height: 26px; margin-top: 2px; }
.lock-note.bad { background: #e5383b12; border-color: #e5383b55; }
.lock-note.bad > svg { color: var(--red-hi); }
.lock-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.kyc-levels { display: grid; gap: 8px; margin-bottom: 24px; }
.kyc-level { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; border-radius: 10px; background: var(--bg-deep); border: 1px solid var(--border); }
.kyc-level.current { border-color: var(--accent); }
.kyc-level.done .kyc-badge { background: var(--green); color: #fff; }
.kyc-level.blocked { opacity: .7; }
.kyc-badge { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-3); font-weight: 800; }
.kyc-badge svg { width: 18px; height: 18px; }
.kyc-form { max-width: 760px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.kyc-step { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--border); }
.kyc-step > .n { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-3); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.cam-box { margin-top: 10px; width: 100%; max-width: 360px; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--bg-deep); border: 1px dashed var(--border); display: grid; place-items: center; }
.cam-box video, .cam-box img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-box img { transform: none; }
.cam-empty svg { width: 64px; height: 64px; color: var(--panel-3); }
.file-in { margin-top: 10px; padding: 8px 10px; height: auto; }
.file-ok { margin-top: 6px; font-size: 13px; display: flex; gap: 6px; align-items: center; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } .kyc-level { grid-template-columns: 36px 1fr; } .kyc-level .pill { grid-column: 2; justify-self: start; } }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { min-width: 260px; max-width: 360px; padding: 12px 16px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); box-shadow: 0 10px 30px #0007; animation: tin .2s ease-out; }
.toast.ok { border-color: #2fb24c88; }
.toast.bad { border-color: #e5383b88; }
.toast b { display: block; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .trade { grid-template-columns: minmax(0, 1fr) 216px; }
  .trades-panel { display: none; }
  .promo-chip { display: none; }
}
@media (max-width: 900px) {
  .dep-grid, .two-col { grid-template-columns: 1fr; gap: 20px; }
  .methods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps .step span.lbl { display: none; }
}
@media (max-width: 860px) {
  :root { --sidebar: 0px; --header: 58px; --navbar: 62px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: var(--header) 1fr calc(var(--navbar) + env(safe-area-inset-bottom, 0px)); height: 100dvh; }
  .sidebar { grid-row: 3; flex-direction: row; justify-content: space-around; align-items: stretch; border-right: 0; border-top: 1px solid var(--border);
    padding: 0 2px env(safe-area-inset-bottom, 0px); overflow: visible; background: #11151f; }
  .sidebar .grow, .sidebar .nav-item:not(.mnav) { display: none; }
  .nav-item { width: auto; flex: 1; padding: 8px 0 6px; gap: 3px; font-size: 10.5px; border-radius: 0; position: relative; }
  .nav-item svg { width: 23px; height: 23px; }
  .nav-item.active { background: transparent; color: var(--accent-2); }
  .nav-item.active::before { content: ""; position: absolute; top: 0; left: 24%; right: 24%; height: 2.5px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .nav-item.active svg { filter: drop-shadow(0 0 6px #3b82f688); }
  .flyout { left: 0; width: 100%; bottom: calc(var(--navbar) + env(safe-area-inset-bottom, 0px)); }

  .header { padding: 0 12px; gap: 10px; }
  .header .brand span { display: none; }
  .header .spacer { display: none; }
  .promo-chip { display: none; }
  .balance-box { min-width: 0; margin-left: auto; height: 40px; padding: 0 12px; justify-content: center; background: var(--bg-deep); }
  .balance-box small { display: none; }
  .balance-box strong { font-size: 18px; }
  .btn-topup { padding: 0 14px; height: 40px; }
  .btn-topup .lbl { display: none; }
  .avatar { width: 38px; height: 38px; }

  .trade { display: flex; flex-direction: column; height: auto; min-height: 100%; }
  .chart-area { border-right: 0; flex: none; height: 42vh; min-height: 240px; }
  #chart { min-height: 0; }
  .chart-toolbar { top: 10px; left: 10px; right: 10px; gap: 6px; flex-wrap: wrap; }
  .asset-btn { height: 38px; padding: 0 10px; }
  #chart-mode { display: none; }
  .tf button[data-m="30"], .tf button[data-m="60"] { display: none; }
  .order { border-right: 0; border-top: 1px solid var(--border); flex: none; max-height: none; overflow: visible;
    display: flex; flex-direction: column; gap: 7px; padding: 10px 12px 16px; }
  .order label { margin-top: 2px; }
  .order #dur-presets, .order #amt-presets, .order #ai-amt-presets { grid-template-columns: repeat(6, 1fr); }
  .order #dur-presets button, .order #amt-presets button, .order #ai-amt-presets button { height: 32px; font-size: 11px; }
  .order .trade-btn { height: 52px; font-size: 17px; }

  .page { padding: 14px; }
  .card { padding: 18px 15px; border-radius: 12px; }
  .card h2 { font-size: 22px; }
  .methods { grid-template-columns: 1fr; }
  .asset-menu { width: calc(100% - 20px); left: 10px; max-height: 70vh; }
  .page-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
}

/* ---------- nav unread badge ---------- */
.nav-item { position: relative; }
.nav-badge { position: absolute; top: 4px; right: 12px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--bg); }
@media (max-width: 860px) { .nav-badge { top: 4px; right: 50%; transform: translateX(16px); } }

/* ---------- inbox ---------- */
.inbox-list { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.msg { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; border-left: 3px solid var(--border); }
.msg.unread { border-left-color: var(--accent); background: var(--panel-2); }
.msg .msg-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.msg .msg-head b { font-size: 15px; }
.msg .msg-head .tag-b { font-size: 10px; font-weight: 700; color: var(--accent-2); background: #3b82f622; padding: 2px 7px; border-radius: 8px; }
.msg .body { color: var(--text-2); white-space: pre-wrap; line-height: 1.55; }

/* ---------- chat / tickets ---------- */
.ticket-layout { display: grid; grid-template-columns: 320px 1fr; gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-height: 540px; }
.ticket-list { border-right: 1px solid var(--border); overflow-y: auto; background: var(--bg); max-height: 70vh; }
.ticket-item { width: 100%; text-align: left; border: 0; background: transparent; border-bottom: 1px solid var(--border); padding: 12px 14px; display: block; color: var(--text); }
.ticket-item:hover { background: var(--panel); }
.ticket-item.active { background: var(--panel-2); border-left: 3px solid var(--accent); }
.ticket-item .ti-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ticket-item .ti-subj { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-item .ti-meta { color: var(--muted); font-size: 12px; margin-top: 3px; display: flex; justify-content: space-between; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }
.chat { display: flex; flex-direction: column; min-width: 0; background: var(--bg-deep); }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--bg); }
.chat-head b { font-size: 15px; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; max-height: 56vh; }
.bubble { max-width: 76%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.bubble .who { font-size: 11px; opacity: .7; margin-bottom: 3px; }
.bubble.them { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.system { align-self: center; background: transparent; border: 1px dashed var(--border); color: var(--muted); font-size: 12px; max-width: 90%; text-align: center; }
.bubble .t { font-size: 10px; opacity: .6; margin-top: 4px; text-align: right; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--bg); }
.chat-input textarea { flex: 1; resize: none; height: 46px; max-height: 140px; padding: 12px 14px; border-radius: 10px; background: var(--bg-deep); border: 1px solid var(--border); color: var(--text); outline: none; font: inherit; }
.chat-input textarea:focus { border-color: var(--accent); }
.chat-empty { flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 30px; }
@media (max-width: 820px) {
  .ticket-layout { grid-template-columns: 1fr; }
  .ticket-layout.viewing .ticket-list { display: none; }
  .ticket-layout:not(.viewing) .chat { display: none; }
  .chat-body { max-height: none; }
}

.mobile-back { display: none; color: var(--text-2); }
@media (max-width: 820px) { .mobile-back { display: inline-flex; } }

.quick-amts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- CTA band ---------- */
.cta-band { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; margin: 14px 0;
  background: linear-gradient(100deg, #1e4c8f, #22304d); border: 1px solid #2d4f8a; }
.cta-band > svg { width: 28px; height: 28px; color: var(--amber); flex: none; }
.cta-band b { display: block; } .cta-band div { flex: 1; font-size: 13px; color: var(--text-2); }

/* ---------- signals ---------- */
.sig-list { display: flex; flex-direction: column; gap: 8px; }
.sig-row { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.sig-mid { flex: 1; min-width: 0; }
.sig-top { display: flex; align-items: center; gap: 8px; }
.sig-top b { font-size: 14px; } .sig-mid small { color: var(--muted); font-size: 11px; }
.sig-tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 8px; background: var(--panel-3); color: var(--muted); }
.sig-tag.up { background: #2fb24c22; color: var(--green-hi); } .sig-tag.down { background: #e5383b22; color: var(--red-hi); }
.sig-row button { flex: none; }
.sig-meter { height: 4px; background: var(--panel-3); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.sig-meter i { display: block; height: 100%; border-radius: 2px; }

/* ---------- leaderboard ---------- */
.lb { display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.lb-row.you { border-color: var(--accent); background: var(--panel-2); }
.lb-rank { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; background: var(--panel-3); color: var(--text-2); }
.lb-rank.r1 { background: linear-gradient(135deg,#f5c518,#b8860b); color: #1a1500; }
.lb-rank.r2 { background: linear-gradient(135deg,#cfd6e0,#8b93a1); color: #10131c; }
.lb-rank.r3 { background: linear-gradient(135deg,#cd7f32,#7a4a1e); color: #170e03; }
.lb-name b { display: block; } .lb-name small { color: var(--muted); font-size: 12px; }
.lb-pnl { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- account hub ---------- */
.acct-hero { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(135deg, #1b2440, #141a28); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; }
.acct-bal small { color: var(--text-2); font-size: 13px; } .acct-bal b { display: block; font-size: 34px; font-weight: 650; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.acct-pnl { font-size: 13px; font-weight: 600; } .acct-pnl.up { color: var(--green-hi); } .acct-pnl.down { color: var(--red-hi); }
.acct-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 14px; }
.astat { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.astat small { color: var(--muted); display: block; font-size: 11px; margin-bottom: 3px; } .astat b { font-size: 16px; font-variant-numeric: tabular-nums; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 18px; }
.hub-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); color: var(--text); font-weight: 500; }
.hub-item:hover { border-color: var(--accent); text-decoration: none; background: var(--panel-2); }
.hub-item svg { width: 20px; height: 20px; color: var(--accent-2); }
.hub-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); position: absolute; top: 12px; right: 12px; }
@media (max-width: 760px) { .acct-stats { grid-template-columns: repeat(3, 1fr); } .acct-bal b { font-size: 30px; } .hub-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- promo ---------- */
.promo-box { display: flex; gap: 8px; margin: 10px 0 6px; }
.promo-box .input { flex: 1; letter-spacing: .12em; font-size: 16px; text-align: center; }
.promo-box .btn { height: 42px; }

/* ---------- Trade with AI ---------- */
.ai-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, #1a2440, #141a28); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.ai-hero.on { border-color: #2fb24c66; background: linear-gradient(135deg, #15301f, #141f1a); }
.ai-status { display: flex; align-items: center; gap: 14px; }
.ai-status b { display: block; } .ai-status small { color: var(--muted); }
.ai-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px #ffffff10; }
.ai-dot.on { background: var(--green-hi); box-shadow: 0 0 0 4px #2fb24c33; animation: aipulse 1.6s infinite; }
@keyframes aipulse { 0%,100% { box-shadow: 0 0 0 4px #2fb24c33; } 50% { box-shadow: 0 0 0 9px #2fb24c11; } }

/* ---------- premium polish (v2) ---------- */
.btn-primary { background-image: linear-gradient(135deg, #4a8dfb, #2563eb); box-shadow: 0 2px 14px -4px #2563ebaa; }
.btn-green { background-image: linear-gradient(135deg, #37c758, #1f9f43); }
.trade-btn.buy { background-image: linear-gradient(135deg, #37c758, #1f9f43); }
.trade-btn.sell { background-image: linear-gradient(135deg, #f0565a, #cf2f33); }
.card { box-shadow: 0 1px 0 #ffffff05 inset, 0 10px 30px -24px #000a; }
.balance-box { background-image: linear-gradient(135deg, #1f2638, #171c29); }
.btn-topup { box-shadow: 0 4px 16px -6px #2fb24ccc; }
.stat, .astat, .hub-item, .msg, .sig-row, .lb-row, .method { transition: border-color .15s, transform .12s, background .15s; }
.hub-item:hover, .method:hover { transform: translateY(-1px); }
.lb-rank { box-shadow: 0 4px 12px -6px #0008; }

/* ---- categorized asset picker ---- */
.asset-menu { position: absolute; z-index: 60; top: 56px; left: 12px; width: min(460px, 94vw);
  max-height: 72vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 28px 70px -20px #000c; }
.asset-menu.hidden { display: none; }
.am-head { padding: 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.am-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.am-tabs button { border: 1px solid var(--border); background: transparent; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .12s; }
.am-tabs button:hover { color: var(--text); }
.am-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.am-search { display: flex; align-items: center; gap: 8px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 10px; background: #0003; }
.am-search svg { width: 16px; height: 16px; opacity: .55; flex: none; }
.am-search input { flex: 1; border: 0; background: transparent; color: var(--text); padding: 9px 0; outline: none; font-size: 14px; }
.am-colhead { display: flex; justify-content: space-between; padding: 8px 16px 4px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.am-list { overflow-y: auto; padding: 4px; }
.asset-menu .asset-row { display: grid; grid-template-columns: 22px 30px 1fr auto; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px; border-radius: 10px; cursor: pointer; background: transparent; border: 0; }
.asset-menu .asset-row:hover { background: #ffffff0d; }
.asset-menu .asset-row.disabled { opacity: .45; cursor: not-allowed; }
.asset-row .star { font-size: 15px; color: #3a475e; cursor: pointer; line-height: 1; text-align: center; }
.asset-row .star.on { color: var(--amber); }
.ar-name { color: var(--text); font-weight: 600; font-size: 14px; display: flex; flex-direction: column; line-height: 1.25; }
.ar-name small { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: capitalize; }
.ar-name .otc { display: inline-block; font-size: 9px; font-weight: 700; color: var(--amber);
  border: 1px solid #f5a52455; padding: 0 4px; border-radius: 4px; margin-left: 5px; }
.ar-pay { color: var(--green-hi); font-weight: 700; font-size: 13px; }
.am-tabrow { display: flex; align-items: flex-start; gap: 8px; }
.am-tabrow .am-tabs { flex: 1; }
.am-close { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; }
.am-close:hover { color: var(--text); background: #ffffff0d; }

/* ---- asset visuals (flags / coins / badges) ---- */
.flag { display: inline-block; width: 20px; height: 20px; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 1px #0005 inset; background: #1b2536; vertical-align: middle; }
.flag svg { width: 100%; height: 100%; display: block; }
.flag.fallback { display: inline-flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 800; color: #cfd8e8; }
.duoflag { position: relative; display: inline-block; width: 30px; height: 22px; vertical-align: middle; }
.duoflag .flag { position: absolute; width: 17px; height: 17px; top: 3px; }
.duoflag .flag:first-child { left: 0; z-index: 2; }
.duoflag .flag:last-child { right: 0; }
.duoflag.single { width: 24px; }
.duoflag.single .flag { position: static; width: 22px; height: 22px; top: 0; }
.coin, .cbadge, .sbadge { display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; font-weight: 800; vertical-align: middle; }
.coin { font-size: 13px; }
.cbadge { font-size: 9px; letter-spacing: .02em; }
.sbadge { width: 30px; height: 20px; border-radius: 6px; color: #fff; font-size: 8.5px; font-weight: 800; letter-spacing: .02em; }
.asset-row .duoflag, .asset-row .coin, .asset-row .cbadge, .asset-row .sbadge,
.asset-row .flag { justify-self: center; }

/* ---- welcome offer banner ---- */
.promo-offer { position: relative; margin: 0 0 14px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(110deg, #6d28d9 0%, #2563eb 45%, #0ea5e9 100%);
  box-shadow: 0 14px 34px -14px #2563ebcc, 0 0 0 1px #ffffff1f inset; }
.promo-offer .po-link { display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden;
  padding: 14px 54px 14px 18px; text-decoration: none; color: #fff; }
.promo-offer .po-close { position: absolute; top: 8px; right: 10px; z-index: 3; width: 26px; height: 26px;
  border-radius: 8px; border: 0; background: #ffffff22; color: #fff; cursor: pointer; font-size: 13px; line-height: 1; }
.promo-offer .po-close:hover { background: #ffffff38; }
.promo-offer .po-shine { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, #ffffff55 38%, #ffffff00 55%);
  transform: translateX(-120%); animation: poshine 3.6s ease-in-out infinite; }
@keyframes poshine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(220%); } }
.promo-offer .po-gift { flex: none; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: #ffffff26; box-shadow: 0 0 0 1px #ffffff33 inset; }
.promo-offer .po-gift svg { width: 24px; height: 24px; }
.promo-offer .po-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; z-index: 1; }
.promo-offer .po-badge { font-size: 10px; font-weight: 800; letter-spacing: .09em; color: #ffe8a3; }
.promo-offer .po-title { font-size: 17px; font-weight: 700; line-height: 1.2; }
.promo-offer .po-title b { color: #ffdf6b; }
.promo-offer .po-sub { font-size: 12px; color: #eaf1ff; opacity: .92; }
.promo-offer .po-cta { flex: none; margin-left: auto; z-index: 1; padding: 10px 18px; border-radius: 999px;
  background: #fff; color: #1b2a6b; font-weight: 800; font-size: 14px; white-space: nowrap;
  box-shadow: 0 6px 16px -6px #0007; transition: transform .12s; }
.promo-offer:hover .po-cta { transform: translateY(-1px) scale(1.03); }
@media (max-width: 640px) { .promo-offer .po-link { flex-wrap: wrap; padding-right: 48px; } .promo-offer .po-cta { margin-left: 0; width: 100%; text-align: center; } }

/* ---- market-closed overlay on the chart ---- */
.chart-area { position: relative; }
.chart-closed { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); z-index: 6;
  display: flex; flex-direction: column; align-items: center; gap: 5px; max-width: 320px; padding: 16px 24px;
  border-radius: 14px; text-align: center; pointer-events: none;
  background: #0b0f1ad9; border: 1px solid var(--border); box-shadow: 0 14px 40px -12px #000c; }
.chart-closed.hidden { display: none; }
.chart-closed span { font-weight: 700; font-size: 16px; color: var(--text); }
.chart-closed small { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ---- order tabs (Classic / AI) ---- */
.otabs { display: flex; gap: 6px; background: var(--bg-deep); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 4px; }
.otabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.otabs button svg { width: 15px; height: 15px; }
.otabs button.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 4px -1px #0007; }

/* ---- buy/sell sentiment ---- */
.sentiment { margin: 2px 0; }
.sent-head { display: flex; justify-content: space-between; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.sent-bar { display: flex; height: 8px; border-radius: 5px; overflow: hidden; background: #0006; }
.sent-bar .sb-buy { background: linear-gradient(90deg, #1f9f43, #37c758); transition: width .8s ease; }
.sent-bar .sb-sell { background: linear-gradient(90deg, #cf2f33, #f0565a); transition: width .8s ease; }
.sent-vals { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-top: 3px; }

/* ---- traders online ---- */
.traders-online { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--text-2);
  background: #0b0f1aaa; border: 1px solid var(--border); padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.traders-online .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-hi); animation: tpulse 1.8s infinite; }
@keyframes tpulse { 0% { box-shadow: 0 0 0 0 #2fb24c88; } 70% { box-shadow: 0 0 0 6px #2fb24c00; } 100% { box-shadow: 0 0 0 0 #2fb24c00; } }

/* ---- AI order panel ---- */
.ai-head { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.ai-desc { font-size: 12px; color: var(--muted); margin: 2px 0 6px; line-height: 1.45; }
.ai-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ai-stat { background: var(--bg-deep); border: 1px solid var(--border); border-radius: 9px; padding: 8px 4px; text-align: center; }
.ai-stat b { display: block; font-size: 15px; color: var(--accent-2); }
.ai-stat span { font-size: 10px; color: var(--muted); }
.ai-scan { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--green-hi); background: #2fb24c12; border: 1px solid #2fb24c40; border-radius: 8px; padding: 9px 12px; }
.ai-scan .scan-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-hi); animation: tpulse 1.2s infinite; }
.ai-disc { font-size: 10.5px; color: var(--muted); line-height: 1.4; margin: 4px 0 0; }

/* ---- top-trader message button + modal ---- */
.lb-row { display: flex; align-items: center; gap: 12px; }
.lb-msg { flex: none; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.lb-msg svg { width: 17px; height: 17px; }
.lb-msg:hover { color: var(--accent); border-color: var(--accent); }
.modal-bg { position: fixed; inset: 0; z-index: 200; background: #060a12b0; display: grid; place-items: center; padding: 18px; }
.modal { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: 0 30px 70px -20px #000d; }
.modal.sm { max-width: 400px; }

/* ===== 2026 mobile trading terminal refresh ===== */
.chart-area { background: radial-gradient(circle at 50% 35%, #121b2c 0, var(--bg-deep) 55%); }
.chart-toolbar { align-items: flex-start; }
#chart { touch-action: pan-y; }
.asset-btn { border-radius: 10px; background: rgba(20,27,42,.94); box-shadow: 0 8px 30px #0003; }
.tf { background: rgba(20,27,42,.9); border-radius: 9px; padding: 3px; }
.tf button { border-radius: 7px; }
.order { background: linear-gradient(180deg, var(--bg), #111722); }

@media (max-width: 860px) {
  .main { overflow-y: auto; overflow-x: hidden; }
  #promo-slot { display: none; }
  .trade { min-height: 100%; background: var(--bg-deep); }
  .chart-area { height: clamp(330px, 52dvh, 470px); min-height: 330px; border-bottom: 1px solid var(--border); }
  .chart-toolbar { top: 10px; left: 10px; right: 8px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; align-items: start; }
  .asset-btn { grid-column: 1; width: max-content; max-width: 100%; height: 44px; padding: 0 11px; }
  .asset-btn .ab-name { max-width: 170px; overflow: hidden; }
  .asset-btn .ab-name > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #tf { grid-column: 1 / -1; width: max-content; max-width: calc(100vw - 82px); overflow-x: auto; scrollbar-width: none; }
  #tf::-webkit-scrollbar { display:none; }
  #tf button { min-width: 38px; height: 29px; font-size: 11px; }
  .tf button[data-m="30"], .tf button[data-m="60"] { display: inline-flex; }
  .feed-badge, .traders-online { grid-column: 2; grid-row: 1; justify-self: end; }
  .traders-online { margin-top: 24px; }
  #chart { width: 100%; height: 100%; min-height: 0; }
  .chart-closed { top: 54%; width: calc(100% - 48px); }
  .asset-menu { top: 62px; left: 8px; width: calc(100% - 16px); max-height: min(68dvh, 560px); border-radius: 14px; }

  .order { padding: 10px 12px 14px; gap: 8px; border-top: 0; }
  .otabs { margin-bottom: 2px; }
  .order label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
  .order .stepper { height: 46px; border-radius: 10px; }
  .order .stepper input { font-size: 17px; font-weight: 700; }
  .order #dur-presets, .order #amt-presets, .order #ai-amt-presets { display:none; }
  .sentiment { margin: 2px 0; }
  .payout-box { display:flex; align-items:center; justify-content:space-between; min-height:48px; padding:8px 12px; }
  .payout-box .pct { font-size:16px; }
  .order .trade-btn { height: 54px; border-radius: 11px; justify-content:center; margin-top: 1px; box-shadow: 0 8px 22px #0002; }
  .order .trade-btn.buy, .order .trade-btn.sell { width: calc(50% - 4px); display:inline-flex; }
  .order .trade-btn.buy { align-self:flex-start; margin-bottom:-55px; }
  .order .trade-btn.sell { align-self:flex-end; }
}

/* ========================================================================== */
/* 2026 UI refresh — finance, account, verification and mobile history         */
/* ========================================================================== */
:root {
  --surface-glass: rgba(26,32,48,.86);
  --surface-soft: rgba(255,255,255,.035);
  --line-soft: rgba(151,166,195,.14);
  --shadow-card: 0 18px 55px rgba(0,0,0,.22);
}

/* Give non-trading pages a product-like canvas instead of a flat form page. */
.main { min-width: 0; overflow-x: hidden; }
.page {
  width: 100%; max-width: 1280px; margin: 0 auto;
  padding: clamp(18px, 2.5vw, 34px) clamp(16px, 3vw, 38px) 56px;
}
.page > .card {
  position: relative; overflow: hidden;
  background: linear-gradient(145deg, rgba(31,38,57,.96), rgba(23,28,43,.98));
  border-color: rgba(123,145,183,.18);
  border-radius: 18px;
  box-shadow: var(--shadow-card), inset 0 1px rgba(255,255,255,.035);
}
.page > .card::before {
  content:""; position:absolute; inset:0 0 auto; height:1px;
  background:linear-gradient(90deg,transparent,rgba(96,165,250,.48),transparent);
  pointer-events:none;
}
.card h2 { font-size: clamp(22px,2.2vw,30px); font-weight: 720; letter-spacing: -.025em; }
.card h3 { font-size: 15px; font-weight: 700; color: #eef3ff; }

.page-tabs {
  padding: 5px; width: fit-content; max-width: 100%; border: 1px solid var(--line-soft);
  border-radius: 12px; background: rgba(12,16,26,.58); gap: 4px;
}
.page-tabs a { background: transparent; border-radius: 8px; text-transform: none; letter-spacing: 0; }
.page-tabs a.active { background: linear-gradient(180deg,#33415e,#28344d); color:#fff; box-shadow:0 4px 14px #0003; }

/* Steps now read as a compact progress tracker. */
.steps { gap: 0; margin: 2px 0 30px; padding: 15px 16px; background: rgba(10,14,23,.42); border:1px solid var(--line-soft); border-radius:14px; }
.step { font-size: 12px; font-weight: 650; min-width:0; }
.step .n { width: 30px; height: 30px; background:#151b2a; }
.step.active .n { background:linear-gradient(135deg,#2563eb,#60a5fa); box-shadow:0 0 0 4px rgba(59,130,246,.12); }
.step.done .n { box-shadow:0 0 0 4px rgba(47,178,76,.10); }
.step::after { background: linear-gradient(90deg,var(--border),rgba(59,130,246,.28)); }

.banner { border:1px solid rgba(96,165,250,.24); border-radius:14px; background:radial-gradient(600px 180px at 0 0,rgba(59,130,246,.24),transparent),linear-gradient(110deg,#172a49,#1b2335); }
.perks li { color:var(--text-2); }
.section-title { font-size:13px; text-transform:uppercase; letter-spacing:.06em; }

.methods { gap: 12px; }
.method { border-radius: 13px; background: linear-gradient(145deg,rgba(15,20,31,.96),rgba(21,27,42,.96)); border-color:rgba(128,146,177,.18); box-shadow: inset 0 1px rgba(255,255,255,.025); }
.method:hover { border-color:rgba(96,165,250,.65); background:#192237; }
.method .top { min-height:72px; padding:15px; }
.method .top b { font-size:14px; color:#f1f5ff; }
.method .top small { margin-top:3px; }
.method .meta { background:rgba(255,255,255,.018); }
.coin { width:36px; height:36px; font-size:11px; box-shadow:0 5px 16px #0005, inset 0 0 0 1px #ffffff18; }

.input, select.input, textarea.input { border-radius:10px; background:#111724; border-color:rgba(130,148,181,.2); min-height:44px; }
.input:hover { border-color:rgba(130,148,181,.38); }
.input:focus { border-color:#4f8ff7; box-shadow:0 0 0 3px rgba(59,130,246,.10); }
.field > label { font-weight:600; color:#aeb8cd; }
.btn { border-radius:10px; }
.btn-primary { background:linear-gradient(180deg,#438cf8,#2871e4); box-shadow:0 8px 22px rgba(37,99,235,.18); }
.btn-green { background:linear-gradient(180deg,#39c85b,#28a947); }
.amount-presets button { border-radius:9px; background:#121826; }
.amount-presets button.active,.amount-presets button:hover { background:rgba(59,130,246,.1); }

.summary { border-radius:13px; background:rgba(11,15,24,.55); border-color:var(--line-soft); }
.summary .row { gap:18px; border-bottom:1px solid rgba(255,255,255,.035); padding:9px 0; }
.summary .row:last-child { border-bottom:0; }
.addr { border-radius:11px; background:#0f1521; border-color:rgba(96,165,250,.22); padding:12px 13px; }
.addr code { min-width:0; overflow-wrap:anywhere; word-break:break-word; }
.warn { border-radius:11px; line-height:1.55; }

/* KYC / account */
.kyc-level { border-radius:13px; padding:14px 16px; background:rgba(11,15,24,.52); }
.kyc-level.current { border-color:rgba(96,165,250,.6); box-shadow:inset 3px 0 #3b82f6; }
.kyc-badge { border-radius:11px; }
.kyc-step { margin-top:8px; padding:19px 0; }
.cam-box { border-radius:16px; }
.two-col { gap:clamp(22px,4vw,48px); }

/* Desktop tables */
.table-wrap { max-width:100%; border:1px solid var(--line-soft); border-radius:13px; background:rgba(10,14,23,.38); }
table.tbl { min-width:680px; }
.tbl th { background:rgba(255,255,255,.025); text-transform:uppercase; letter-spacing:.045em; font-size:10px; padding:12px 14px; }
.tbl td { padding:13px 14px; }
.tbl tbody tr { transition:background .12s; }
.tbl tbody tr:hover { background:rgba(255,255,255,.025); }
.pill { padding:4px 9px; border-radius:999px; }

@media (max-width: 720px) {
  html, body { width:100%; max-width:100%; overflow-x:hidden; }
  .main { width:100%; min-width:0; padding-bottom:calc(72px + env(safe-area-inset-bottom)); }
  .page { width:100%; max-width:100%; padding:12px 10px 26px; overflow:hidden; }
  .page > .card { padding:18px 13px 20px; border-radius:16px; }
  .card h2 { font-size:22px; margin-bottom:18px; }
  .card h3 { line-height:1.35; }

  /* Navigation tabs scroll instead of clipping the final item. */
  .page-tabs, .tabs {
    width:100%; max-width:100% !important; overflow-x:auto; overflow-y:hidden;
    flex-wrap:nowrap; justify-content:flex-start; scrollbar-width:none;
    -webkit-overflow-scrolling:touch; scroll-snap-type:x proximity;
  }
  .page-tabs::-webkit-scrollbar,.tabs::-webkit-scrollbar { display:none; }
  .page-tabs a,.tabs button { flex:0 0 auto; white-space:nowrap; scroll-snap-align:start; }
  .tabs { padding:4px; margin-bottom:16px; }
  .tabs button { min-width:max-content; padding:0 13px; }

  /* Deposit progress is horizontal, compact and never wider than viewport. */
  .steps { display:flex; width:100%; padding:12px 10px; margin-bottom:20px; overflow:hidden; }
  .step { flex:1; gap:5px; font-size:0; }
  .step .n { width:27px; height:27px; font-size:11px; }
  .step::after { min-width:6px; margin-left:4px; }
  .dep-grid,.two-col { display:grid; grid-template-columns:minmax(0,1fr); gap:20px; }
  .banner { padding:14px; gap:12px; }
  .banner svg { width:38px; height:38px; }
  .banner b { font-size:15px; }
  .perks { margin-bottom:18px; }
  .methods { grid-template-columns:minmax(0,1fr); }
  .method .top { min-height:66px; }
  .amount-presets { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
  .amount-presets button { width:100%; padding:0 8px; }
  .addr { align-items:flex-start; }
  .addr .btn { flex:none; }
  .summary .row { align-items:flex-start; }
  .summary .row b { text-align:right; overflow-wrap:anywhere; }
  .lock-actions { display:grid; grid-template-columns:1fr; }
  .lock-actions .btn { width:100%; }
  .kyc-step { gap:10px; }
  .kyc-step > .n { width:26px; height:26px; }
  .cam-box { max-width:100%; }

  /* Every history/withdrawal/AI table becomes a native mobile card list. */
  .table-wrap { border:0; background:transparent; border-radius:0; overflow:visible; width:100%; }
  table.tbl { min-width:0; width:100%; display:block; }
  .tbl thead { display:none; }
  .tbl tbody { display:grid; gap:10px; width:100%; }
  .tbl tr { display:block; width:100%; padding:12px 13px; border:1px solid var(--line-soft); border-radius:13px; background:rgba(11,15,24,.58); box-shadow:inset 0 1px rgba(255,255,255,.025); }
  .tbl td { display:flex; width:100%; min-width:0; align-items:flex-start; justify-content:space-between; gap:14px; padding:7px 0; border:0; white-space:normal; text-align:right; overflow-wrap:anywhere; }
  .tbl td + td { border-top:1px solid rgba(255,255,255,.035); }
  .tbl td::before { content:attr(data-label); flex:0 0 42%; color:var(--muted); font-size:11px; font-weight:650; text-transform:uppercase; letter-spacing:.035em; text-align:left; }
  .tbl td[data-label=""]::before { display:none; }
  .tbl td a { margin-left:auto; }
  .tbl td .pill { flex:none; }

  #toasts { left:10px; right:10px; bottom:calc(76px + env(safe-area-inset-bottom)); }
  .toast { min-width:0; width:100%; max-width:none; }
}

@media (max-width: 380px) {
  .page { padding-left:8px; padding-right:8px; }
  .page > .card { padding-left:11px; padding-right:11px; }
  .amount-presets { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .summary { padding:13px; }
}


/* Local deposit QR — safe, responsive, no third-party service */
.deposit-qr-wrap { display:flex; align-items:center; gap:16px; margin:12px 0; padding:14px; border:1px solid rgba(96,165,250,.2); border-radius:14px; background:rgba(10,15,25,.5); }
.deposit-qr { width:154px; height:154px; flex:0 0 154px; padding:8px; border-radius:12px; background:#fff; box-shadow:0 12px 30px rgba(0,0,0,.25); }
.deposit-qr svg { display:block; width:100%; height:100%; }
.deposit-qr-meta { display:flex; flex-direction:column; gap:6px; min-width:0; }
.deposit-qr-meta b { color:#f4f7ff; font-size:15px; }
.deposit-qr-meta span { color:var(--muted); font-size:12px; line-height:1.5; }
@media (max-width:430px){ .deposit-qr-wrap{flex-direction:column;text-align:center}.deposit-qr{width:min(190px,68vw);height:min(190px,68vw);flex-basis:auto}.deposit-qr-meta{align-items:center} }


/* ========================================================================== */
/* Trade terminal V8 — geometry is measured by app.js, CSS only paints it.   */
/* ========================================================================== */
.trade-control-grid{display:grid;grid-template-columns:1fr;gap:8px}
.trade-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.trade-actions .trade-btn{width:100%;margin:0;justify-content:center}
.payout-label{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}

@media (max-width:860px){
  #promo-slot{display:none!important}
  .main{overflow:hidden!important;padding:0!important;min-width:0}
  .trade.js-mobile-trade{--ui-scale:1;--order-h:250px;position:relative!important;display:block!important;width:100%!important;min-height:320px!important;overflow:hidden!important;background:#0b111c}
  .trade.js-mobile-trade .chart-area{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important;border:0!important;overflow:hidden!important;background:radial-gradient(120% 72% at 45% 38%,rgba(31,46,72,.72),rgba(13,20,33,.96) 58%,#0a101a 100%)!important;isolation:isolate}
  .trade.js-mobile-trade .chart-area::before{content:"";position:absolute;z-index:0;inset:13% 52px 16% 0;opacity:.16;pointer-events:none;background:linear-gradient(145deg,transparent 0 17%,rgba(112,128,157,.18) 17.3% 23%,transparent 23.3% 31%,rgba(92,108,139,.21) 31.3% 43%,transparent 43.3% 51%,rgba(112,127,157,.15) 51.3% 66%,transparent 66.3%);clip-path:polygon(0 74%,9% 59%,18% 68%,28% 39%,38% 57%,48% 31%,59% 54%,69% 35%,80% 61%,91% 44%,100% 58%,100% 100%,0 100%)}
  .trade.js-mobile-trade #chart{position:absolute!important;inset:0!important;z-index:1;width:100%!important;height:100%!important;min-height:0!important;display:block;touch-action:none}
  .trade.js-mobile-trade .chart-toolbar{position:absolute!important;z-index:5!important;top:calc(9px * var(--ui-scale))!important;left:calc(9px * var(--ui-scale))!important;right:calc(9px * var(--ui-scale))!important;display:flex!important;align-items:flex-start!important;gap:6px!important;flex-wrap:nowrap!important;pointer-events:none}
  .trade.js-mobile-trade .chart-toolbar>*{pointer-events:auto}
  .trade.js-mobile-trade .asset-btn{height:calc(43px * var(--ui-scale))!important;max-width:calc(100% - 56px)!important;padding:0 calc(11px * var(--ui-scale))!important;border-radius:10px!important;background:rgba(29,38,57,.94)!important;border:1px solid rgba(255,255,255,.055)!important;box-shadow:0 8px 22px rgba(0,0,0,.18)!important;backdrop-filter:blur(12px)}
  .trade.js-mobile-trade .asset-btn .asset-icon{width:calc(27px * var(--ui-scale))!important;height:calc(27px * var(--ui-scale))!important}.trade.js-mobile-trade .asset-btn .ab-name{font-size:calc(14px * var(--ui-scale))!important;max-width:180px!important}.trade.js-mobile-trade .asset-btn .ab-px,.trade.js-mobile-trade .asset-btn .pay{font-size:calc(11px * var(--ui-scale))!important}
  .trade.js-mobile-trade #tf{position:absolute!important;top:calc(49px * var(--ui-scale))!important;left:0!important;display:flex!important;width:auto!important;padding:0!important;border:1px solid rgba(255,255,255,.055)!important;border-radius:8px!important;background:rgba(29,38,57,.92)!important;backdrop-filter:blur(10px)}
  .trade.js-mobile-trade #tf button{display:none!important}.trade.js-mobile-trade #tf button.active{display:inline-flex!important;align-items:center;justify-content:center;height:calc(34px * var(--ui-scale))!important;min-width:calc(47px * var(--ui-scale))!important;padding:0 9px!important;font-size:calc(12px * var(--ui-scale))!important;background:transparent!important}
  .trade.js-mobile-trade .feed-badge,.trade.js-mobile-trade .traders-online{display:none!important}
  .trade.js-mobile-trade .asset-menu{top:58px!important;left:8px!important;width:calc(100% - 16px)!important;max-height:min(58dvh,520px)!important}
  .trade.js-mobile-trade .chart-closed{z-index:12}

  .trade.js-mobile-trade .order{position:absolute!important;z-index:10!important;left:calc(9px * var(--ui-scale))!important;right:calc(9px * var(--ui-scale))!important;bottom:calc(8px * var(--ui-scale))!important;width:auto!important;max-height:none!important;padding:calc(9px * var(--ui-scale))!important;gap:calc(6px * var(--ui-scale))!important;overflow:visible!important;border:1px solid rgba(142,157,187,.13)!important;border-radius:calc(13px * var(--ui-scale))!important;background:rgba(24,32,49,.94)!important;backdrop-filter:blur(15px);box-shadow:0 14px 34px rgba(0,0,0,.28)!important}
  .trade.js-mobile-trade .order .otabs{display:none!important}
  .trade.js-mobile-trade .order .trade-control-grid{grid-template-columns:1fr 1fr!important;gap:calc(7px * var(--ui-scale))!important}
  .trade.js-mobile-trade .order .trade-field label{display:block!important;margin:0 0 4px!important;font-size:calc(9px * var(--ui-scale))!important;line-height:1!important;text-transform:uppercase!important;letter-spacing:.06em!important;color:#9aa7bd!important}
  .trade.js-mobile-trade .order .stepper{height:calc(41px * var(--ui-scale))!important;border-radius:9px!important;background:#0f1623!important;border:1px solid rgba(139,154,184,.12)!important}
  .trade.js-mobile-trade .order .stepper input{font-size:calc(14px * var(--ui-scale))!important;font-weight:700!important;text-align:center!important;padding:0 2px!important}.trade.js-mobile-trade .order .stepper button{width:calc(30px * var(--ui-scale))!important;font-size:calc(17px * var(--ui-scale))!important}
  .trade.js-mobile-trade .order #dur-presets,.trade.js-mobile-trade .order #amt-presets,.trade.js-mobile-trade .order #ai-amt-presets{display:none!important}
  .trade.js-mobile-trade .order .sentiment{min-height:calc(31px * var(--ui-scale))!important;margin:0!important}.trade.js-mobile-trade .order .sent-head{font-size:calc(8px * var(--ui-scale))!important;margin-bottom:3px!important}.trade.js-mobile-trade .order .sent-bar{height:5px!important}.trade.js-mobile-trade .order .sent-vals{font-size:calc(10px * var(--ui-scale))!important;margin-top:3px!important}
  .trade.js-mobile-trade .order .payout-box{min-height:calc(35px * var(--ui-scale))!important;padding:4px 8px!important;border:0!important;border-radius:8px!important;background:#0f1623!important;display:grid!important;grid-template-columns:1fr auto 1fr!important;gap:6px!important;align-items:center!important}.trade.js-mobile-trade .order .payout-box .payout-label{font-size:calc(9px * var(--ui-scale))!important}.trade.js-mobile-trade .order .payout-box .pct{font-size:calc(16px * var(--ui-scale))!important}.trade.js-mobile-trade .order .payout-box .amt{font-size:calc(11px * var(--ui-scale))!important;text-align:right!important;white-space:nowrap}
  .trade.js-mobile-trade .order .trade-actions{grid-template-columns:1fr 1fr!important;gap:calc(7px * var(--ui-scale))!important}.trade.js-mobile-trade .order .trade-btn,.trade.js-mobile-trade .order .trade-btn.buy,.trade.js-mobile-trade .order .trade-btn.sell{width:100%!important;height:calc(48px * var(--ui-scale))!important;margin:0!important;align-self:auto!important;border-radius:9px!important;font-size:calc(15px * var(--ui-scale))!important;font-weight:800!important;box-shadow:0 7px 17px rgba(0,0,0,.16)!important}.trade.js-mobile-trade .order .trade-btn .arr{width:calc(21px * var(--ui-scale))!important;height:calc(21px * var(--ui-scale))!important}
  .trade.js-mobile-trade .order .gate{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;column-gap:7px!important;min-height:calc(31px * var(--ui-scale))!important;padding:5px 7px!important;margin:0!important;border-radius:7px!important;text-align:left!important;font-size:0!important;background:#152746!important}.trade.js-mobile-trade .order .gate.hidden{display:none!important}.trade.js-mobile-trade .order .gate b{display:block!important;margin:0!important;font-size:calc(9px * var(--ui-scale))!important;line-height:1.15!important}.trade.js-mobile-trade .order .gate .btn{grid-column:2!important;grid-row:1!important;margin:0!important;padding:5px 8px!important;min-height:0!important;height:calc(26px * var(--ui-scale))!important;font-size:calc(9px * var(--ui-scale))!important;white-space:nowrap!important}
  .trade.js-mobile-trade .trades-panel{display:none!important}
}

@media (min-width:861px){.trade-control-grid{grid-template-columns:1fr;gap:6px}.trade-actions{grid-template-columns:1fr;gap:2px}}

/* V9 asset picker + mobile performance fixes */
@media (max-width:860px){
  .trade.js-mobile-trade .asset-menu{
    z-index:30!important;
    top:var(--picker-top,58px)!important;
    bottom:var(--picker-bottom,8px)!important;
    max-height:none!important;
    overflow:hidden!important;
    display:flex;
    flex-direction:column;
    overscroll-behavior:contain;
    contain:layout paint;
  }
  .trade.js-mobile-trade .asset-menu.hidden{display:none!important}
  .trade.js-mobile-trade .asset-menu .am-head,
  .trade.js-mobile-trade .asset-menu .am-colhead{flex:0 0 auto}
  .trade.js-mobile-trade .asset-menu .am-list{flex:1 1 auto;min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  /* While choosing an asset, don't let BUY/SELL fight the picker for space. */
  .trade.js-mobile-trade.asset-picker-open .order{opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:none!important;transition:none!important}
  .trade.js-mobile-trade .order{transition:opacity .14s ease,transform .14s ease,visibility 0s linear .14s}
  .trade.js-mobile-trade:not(.asset-picker-open) .order{transition:opacity .14s ease,transform .14s ease}
  /* Expensive backdrop blur on several full-width layers caused jank on phones. */
  .trade.js-mobile-trade .order,.trade.js-mobile-trade .asset-btn,.trade.js-mobile-trade #tf{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
}

/* V9.5 — restore document scrolling and harden compact trade controls */
@media (max-width:860px){
  /* V8/V9 accidentally locked every app view because .main is shared by all pages. */
  .main{
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:auto!important;
    touch-action:pan-y!important;
  }
  /* The chart itself remains a contained terminal; only the shared page scroller is restored. */
  .trade.js-mobile-trade{overflow:hidden!important;max-width:100%!important}
  .trade.js-mobile-trade .order{box-sizing:border-box!important;max-width:calc(100% - (18px * var(--ui-scale)))!important}
  .trade.js-mobile-trade .order .trade-control-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;width:100%!important;min-width:0!important}
  .trade.js-mobile-trade .order .trade-field,
  .trade.js-mobile-trade .order .stepper,
  .trade.js-mobile-trade .order .stepper input{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
  .trade.js-mobile-trade .order .stepper{width:100%!important;overflow:hidden!important}
  .trade.js-mobile-trade .order .stepper input{width:0!important;flex:1 1 0!important;padding-left:1px!important;padding-right:1px!important}
  .trade.js-mobile-trade .order .stepper button{flex:0 0 calc(28px * var(--ui-scale))!important;width:calc(28px * var(--ui-scale))!important;padding:0!important}
}


/* History has six sections; allow tabs to wrap cleanly on narrow screens. */
.history-tabs { flex-wrap: wrap; }
.history-tabs button { flex: 1 1 110px; }


/* APEX AI Demo account summary — isolated visual identity for demo funds */
.demo-account-card{position:relative;overflow:hidden;margin:18px 0 16px;padding:20px;border:1px solid rgba(96,165,250,.18);border-radius:18px;background:linear-gradient(145deg,rgba(20,31,51,.98),rgba(12,20,34,.98));box-shadow:0 18px 50px rgba(0,0,0,.18)}
.demo-account-card:before{content:"";position:absolute;width:260px;height:260px;right:-110px;top:-150px;border-radius:50%;background:radial-gradient(circle,rgba(59,130,246,.18),transparent 68%);pointer-events:none}
.demo-account-head{position:relative;display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:18px}.demo-account-head h3{margin:3px 0 0;font-size:20px;letter-spacing:-.02em}.demo-kicker{font-size:10px;font-weight:800;letter-spacing:.16em;color:#7dd3fc}.demo-badge{padding:6px 10px;border:1px solid rgba(96,165,250,.28);border-radius:999px;background:rgba(37,99,235,.12);color:#93c5fd;font-size:10px;font-weight:900;letter-spacing:.12em}
.demo-account-stats{position:relative;display:grid;grid-template-columns:1.35fr 1fr 1fr;gap:10px}.demo-stat{min-width:0;padding:15px 16px;border:1px solid rgba(148,163,184,.11);border-radius:14px;background:rgba(255,255,255,.025)}.demo-stat>span{display:block;margin-bottom:7px;color:#94a3b8;font-size:11px;font-weight:650}.demo-stat strong{display:block;overflow:hidden;text-overflow:ellipsis;color:#f8fafc;font-size:24px;line-height:1.15;letter-spacing:-.03em;white-space:nowrap}.demo-stat-balance strong{font-size:29px}.demo-stat strong em{color:#64748b;font-size:14px;font-style:normal;font-weight:650}.demo-stat small{display:block;margin-top:7px;color:#64748b;font-size:10px;line-height:1.35}.demo-stat-balance{background:linear-gradient(135deg,rgba(37,99,235,.11),rgba(14,165,233,.035));border-color:rgba(96,165,250,.17)}
@media(max-width:700px){.demo-account-card{margin-top:14px;padding:15px;border-radius:15px}.demo-account-head{margin-bottom:13px}.demo-account-head h3{font-size:17px}.demo-account-stats{grid-template-columns:1fr 1fr}.demo-stat{padding:13px}.demo-stat-balance{grid-column:1/-1}.demo-stat-balance strong{font-size:27px}.demo-stat strong{font-size:21px}}
