/* =============================================================================
   Xchangepairs design system  ·  dark-first, exchange-grade
   Tokens → base → layout shells → components → utilities
   ========================================================================== */

:root {
  --bg: #0B0E11;
  --s1: #161A1F;
  --s2: #1E232A;
  --s3: #262C35;
  --s4: #2F3742;
  --line: #262C35;
  --line-2: #343C48;
  --text: #EAECEF;
  --text-2: #A6ADBA;
  --text-3: #6F7887;
  --brand: #E0173F;
  --brand-hover: #F42B52;
  --brand-soft: rgba(224, 23, 63, .14);
  --up: #0ECB81;
  --up-soft: rgba(14, 203, 129, .14);
  --down: #F6465D;
  --down-soft: rgba(246, 70, 93, .14);
  --gold: #F0B90B;
  --gold-soft: rgba(240, 185, 11, .14);
  --info: #4D7CFE;
  --info-soft: rgba(77, 124, 254, .14);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --topbar-h: 60px;
  --tabbar-h: 62px;
  --sidebar-w: 240px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); overflow-x: clip;
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
h1, .h1 { font-size: 26px; }
h2, .h2 { font-size: 20px; }
h3, .h3 { font-size: 16px; }
h4, .h4 { font-size: 14px; }
p { margin: 0; }
p + p { margin-top: 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
small, .text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.text-lg { font-size: 16px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.strong { font-weight: 600; color: var(--text); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.gold { color: var(--gold) !important; }
.brand { color: var(--brand) !important; }
/* inline-block, not block: a block SVG breaks the line inside a text link */
.ic { display: inline-block; flex: none; vertical-align: middle; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--s4); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- layout primitives */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 14px; }
.container--narrow { max-width: 760px; }
.container--mid { max-width: 980px; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); min-width: 0; }
.stack > *, .grid > *, .layout-main > *, .trade-layout > * { min-width: 0; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 10px); }
.split { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.grid { display: grid; gap: var(--gap, 16px); grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); }
.grid-2, .grid-3, .grid-4 { --cols: 1; }
.grid-2.keep-2, .grid-3.keep-2, .grid-4.keep-2 { --cols: 2; }
.layout-main { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 601px) { .grid-2, .grid-3, .grid-4 { --cols: 2; } }
@media (min-width: 961px) { .grid-3 { --cols: 3; } .grid-4 { --cols: 4; } .layout-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }
.page { padding: 16px 0 32px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
@media (min-width: 601px) { .page-head h1 { font-size: 24px; } }
.page-head .sub { color: var(--text-2); margin-top: 4px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title h3 { font-size: 15px; }
.section-title a { color: var(--text-2); font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex: none; }
.section-title a:hover { color: var(--text); }

/* ---------------------------------------------------------------- app shell (user) */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  background: rgba(11, 14, 17, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .container { height: 100%; display: flex; align-items: center; gap: 22px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.logo img { height: 28px; width: auto; }
.logo b { color: var(--brand); }
.nav-links { display: none; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: 13.5px; }
.nav-links a:hover { color: var(--text); background: var(--s2); }
.nav-links a.is-active { color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); }
.icon-btn:hover { background: var(--s2); color: var(--text); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; }
.tabbar {
  display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: var(--tabbar-h);
  background: rgba(22, 26, 31, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; color: var(--text-3); font-weight: 500; }
.tabbar a.is-active { color: var(--brand); }
.tabbar a.is-active .ic { color: var(--brand); }
.tabbar .tab-primary .ic-wrap { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; margin-top: -18px; box-shadow: 0 6px 16px rgba(224, 23, 63, .35); }
.tabbar a.tab-primary .ic-wrap .ic { color: #fff; }
.app-main { padding-bottom: calc(var(--tabbar-h) + 16px); }
/* the one desktop-first rule: hiding must not override an element's own display type on desktop */
@media (max-width: 860px) { .hide-mobile { display: none !important; } }
@media (min-width: 861px) {
  .nav-links { display: flex; }
  .hide-desktop { display: none !important; }
  .tabbar { display: none; }
  .app-main { padding-bottom: 0; }
  .page { padding: 24px 0 40px; }
  .container { padding: 0 20px; }
}

/* ---------------------------------------------------------------- admin shell */
.admin { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); z-index: 60; transform: translateX(-100%); transition: transform .25s var(--ease); overflow-y: auto; background: var(--s1); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar.is-open { transform: none; }
.sidebar .logo { padding: 4px 10px 18px; }
.sidebar .logo small { font-size: 9.5px; letter-spacing: .12em; color: var(--text-3); font-weight: 600; margin-left: 4px; text-transform: uppercase; }
.sidebar a.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: 13.5px; }
.sidebar a.nav:hover { background: var(--s2); color: var(--text); }
.sidebar a.nav.is-active { background: var(--s3); color: var(--text); }
.sidebar a.nav .count { margin-left: auto; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.sidebar .sidebar-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.sidebar-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; font-weight: 600; }
.admin-main { min-width: 0; }
.admin-top { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 40; }
.admin-top .crumbs { color: var(--text-2); font-size: 13px; }
.admin-top .crumbs b { color: var(--text); font-weight: 600; }
.admin-body { padding: 16px; }
.sidebar-backdrop { display: none; }
.sidebar-backdrop.is-open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 55; }
@media (min-width: 961px) {
  .admin { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar { position: sticky; height: 100vh; transform: none; transition: none; z-index: auto; }
  .sidebar-backdrop.is-open { display: none; }
  .admin-body { padding: 24px; }
  .admin-top { padding: 0 24px; }
}

/* ---------------------------------------------------------------- auth shell */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
.auth-brand { display: none; position: relative; overflow: hidden; padding: 40px 48px; border-right: 1px solid var(--line); background: radial-gradient(1200px 600px at -10% -10%, rgba(224, 23, 63, .16), transparent 60%), linear-gradient(165deg, #12161B 0%, #0B0E11 65%); flex-direction: column; justify-content: space-between; }
.auth-brand h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 600; max-width: 18ch; margin-top: 56px; }
.auth-brand p.lede { color: var(--text-2); max-width: 40ch; margin-top: 12px; font-size: 15px; }
.auth-brand .grid-lines { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px); background-size: 40px 40px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); pointer-events: none; }
.auth-brand > * { position: relative; }
.ticker-list { display: grid; gap: 8px; margin-top: 28px; max-width: 420px; }
.ticker-row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 10px 14px; background: rgba(22, 26, 31, .8); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; }
.ticker-row .coin { font-weight: 600; }
.auth-form { display: flex; align-items: flex-start; justify-content: center; padding: 32px 18px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-2); margin-bottom: 24px; }
.auth-foot { text-align: center; color: var(--text-2); margin-top: 22px; font-size: 13px; }
.auth-foot a { color: var(--gold); font-weight: 600; }
.auth-brand .foot { color: var(--text-3); font-size: 12px; }
.auth-mobile-logo { display: flex; margin-bottom: 28px; }
@media (min-width: 861px) {
  .auth { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .auth-brand { display: flex; }
  .auth-form { padding: 40px 24px; align-items: center; }
  .auth-mobile-logo { display: none; }
}

/* ---------------------------------------------------------------- cards & stats */
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.card-head > a, .card-head .link, .section-title > a, a.link { white-space: nowrap; }
.card-head > a, .section-title > a { flex: none; }
.card-head h3 { min-width: 0; }
.card-head h3 { font-size: 14.5px; }
.card-body { padding: 14px; }
.card-body--flush { padding: 0; }
.card--accent { border-color: rgba(224, 23, 63, .35); background: linear-gradient(180deg, rgba(224, 23, 63, .06), transparent 60%), var(--s1); }
.card--gold { border-color: rgba(240, 185, 11, .35); }
.card--soft { background: var(--s2); border-color: transparent; }
@media (min-width: 601px) { .card-body { padding: 18px; } .card-head { padding: 14px 18px; } }
.stat { padding: 16px 18px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--radius); }
.stat .label { font-size: 12px; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; }
.stat .value { font-size: 22px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .delta { font-size: 12px; margin-top: 4px; }
.stat .value small { font-size: 12px; color: var(--text-2); font-weight: 400; margin-left: 4px; }
.balance-hero .label { font-size: 12.5px; color: var(--text-2); }
.balance-hero .total { font-size: 28px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.balance-hero .total small { font-size: 13px; color: var(--text-2); font-weight: 400; letter-spacing: 0; }
@media (min-width: 601px) { .balance-hero .total { font-size: 32px; } }
.balance-hero .pnl { font-size: 13px; font-weight: 500; }
.alloc { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--s3); margin: 14px 0 8px; }
.alloc i { display: block; height: 100%; transition: width .4s var(--ease); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13.5px; white-space: nowrap; border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s, transform .05s; user-select: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); color: #fff; }
.btn--secondary { background: var(--s3); color: var(--text); }
.btn--secondary:hover { background: var(--s4); }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--text-2); }
.btn--ghost:hover { color: var(--text); border-color: var(--text-3); }
.btn--success { background: var(--up); color: #04120B; }
.btn--success:hover { background: #12E08F; color: #04120B; }
.btn--danger { background: var(--down-soft); color: var(--down); border-color: rgba(246, 70, 93, .3); }
.btn--danger:hover { background: var(--down); color: #fff; }
.btn--gold { background: var(--gold); color: #1B1400; }
.btn--gold:hover { background: #FFC826; color: #1B1400; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn--xs { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 5px; }
.btn--lg { height: 46px; padding: 0 22px; font-size: 14.5px; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; padding: 0; }
.btn--icon.btn--sm { width: 32px; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn .ic { width: 16px; height: 16px; }
.link { color: var(--info); font-weight: 500; }
.link:hover { text-decoration: underline; color: var(--info); }
.link--gold { color: var(--gold); }
.link--gold:hover { color: var(--gold); }

/* ---------------------------------------------------------------- forms */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 12.5px; font-weight: 500; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.label .req { color: var(--brand); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--radius-sm);
  background: var(--s2); border: 1px solid var(--line-2); color: var(--text); font-size: 14px;
  transition: border-color .15s, box-shadow .15s; outline: none; appearance: none; -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input[readonly] { color: var(--text-2); background: var(--s1); }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.select { padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A6ADBA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.select option { background: var(--s2); color: var(--text); }
.input--lg { height: 48px; font-size: 16px; }
.input--mono { font-family: var(--mono); }
.input-group { position: relative; display: flex; align-items: stretch; }
.input-group .input { flex: 1; min-width: 0; }
.input-group .prefix, .input-group .suffix { display: inline-flex; align-items: center; padding: 0 12px; background: var(--s3); border: 1px solid var(--line-2); color: var(--text-2); font-size: 13px; white-space: nowrap; }
.input-group .prefix { border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .suffix { border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .prefix + .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .input:has(+ .suffix) { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .prefix + .input:has(+ .suffix) { border-radius: 0; }
.input-group .inside { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 4px; }
.input-group .inside .btn { height: 28px; }
.input-group.has-inside .input { padding-right: 84px; }
.input-group .icon-left { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-group.has-icon .input { padding-left: 38px; }
.help { font-size: 12px; color: var(--text-3); }
.error { font-size: 12px; color: var(--down); display: flex; align-items: center; gap: 5px; }
.field.is-error .input, .field.is-error .select { border-color: var(--down); }
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.check input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; flex: none; margin-top: 1px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--s2); display: grid; place-content: center; cursor: pointer; }
.check input::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: #fff; transform: scale(0); transition: transform .12s; }
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::before { transform: scale(1); }
.switch { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--s4); transition: background .15s; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s var(--ease); }
.switch input:checked ~ i { transform: translateX(18px); }
.switch:has(input:checked) { background: var(--up); }
.radio-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.radio-card { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s; }
.radio-card input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.radio-card:hover { border-color: var(--text-3); }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio-card .rc-title { font-weight: 600; font-size: 13.5px; }
.radio-card .rc-sub { font-size: 11.5px; color: var(--text-2); }
.otp { display: flex; gap: 8px; justify-content: space-between; }
.otp input { width: 100%; height: 54px; text-align: center; font-size: 22px; font-family: var(--mono); font-weight: 600; background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); color: var(--text); outline: none; caret-color: var(--brand); }
.otp input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.strength { display: flex; gap: 4px; margin-top: 4px; }
.strength i { flex: 1; height: 4px; border-radius: 2px; background: var(--s3); }
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--down); }
.strength[data-level="2"] i:nth-child(-n+2) { background: var(--gold); }
.strength[data-level="3"] i:nth-child(-n+3) { background: var(--up); }
.strength[data-level="4"] i { background: var(--up); }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 22px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--s2); color: var(--text-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .dz-preview { max-height: 160px; border-radius: 6px; margin-top: 6px; }
.dropzone .dz-name { font-size: 12px; color: var(--text); }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button { height: 28px; padding: 0 10px; border-radius: 5px; background: var(--s3); color: var(--text-2); font-size: 12px; font-weight: 500; }
.presets button:hover, .presets button.is-active { background: var(--s4); color: var(--text); }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--text-2); margin: 0; }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv--stack { grid-template-columns: 1fr; gap: 2px 0; }
.kv--stack dd { text-align: left; margin-bottom: 8px; }
.summary { background: var(--s2); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 8px; font-size: 13px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; }
.summary .total { border-top: 1px solid var(--line-2); padding-top: 8px; font-weight: 600; color: var(--text); }
.address-box { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px; background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.address-box .btn { margin-left: auto; flex: none; }
.qr { background: #fff; padding: 10px; border-radius: 8px; width: fit-content; }
.qr img { width: 160px; height: 160px; }

/* ---------------------------------------------------------------- chips / badges */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip--ok { background: var(--up-soft); color: var(--up); }
.chip--warn { background: var(--gold-soft); color: var(--gold); }
.chip--bad { background: var(--down-soft); color: var(--down); }
.chip--info { background: var(--info-soft); color: var(--info); }
.chip--muted { background: var(--s3); color: var(--text-2); }
.chip--brand { background: var(--brand-soft); color: var(--brand); }
.chip .ic { width: 12px; height: 12px; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--s3); color: var(--text-2); font-size: 12px; font-weight: 500; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.table th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; letter-spacing: .02em; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table--hover tbody tr:hover td { background: rgba(255, 255, 255, .02); }
.table .num, .table td.num, .table th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table th.num { font-family: var(--font); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn { margin-left: 6px; }
.table--compact td { padding: 8px 12px; }
.table--full { min-width: 0; }
.table .sub { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.coin { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }
.coin small { font-weight: 400; color: var(--text-3); }
.coin-ic { width: 24px; height: 24px; border-radius: 50%; flex: none; object-fit: cover; }
.coin-ic--txt { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; }
.spark { width: 84px; height: 26px; display: block; }
.row-list { display: flex; flex-direction: column; }
.row-list > * { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row-list > *:last-child { border-bottom: 0; }
.row-list .grow { flex: 1; min-width: 0; }
.row-list .title { font-weight: 500; font-size: 13.5px; }
.row-list .sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.row-list .end { text-align: right; flex: none; }
.row-list--card > * { padding: 12px 18px; }

/* ---------------------------------------------------------------- tabs / pills / filters */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--text-2); font-weight: 500; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .is-active { color: var(--text); border-bottom-color: var(--brand); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters a, .filters button { height: 32px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); color: var(--text-2); font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.filters a:hover, .filters button:hover { color: var(--text); border-color: var(--text-3); }
.filters .is-active { background: var(--s3); color: var(--text); border-color: var(--s3); }
.filters .count { font-size: 11px; background: var(--s4); padding: 1px 6px; border-radius: 999px; }
.seg { display: inline-flex; background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 4px; font-weight: 600; font-size: 13px; color: var(--text-2); flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.is-active { background: var(--s4); color: var(--text); }
.seg--side button.is-active[data-side="buy"] { background: var(--up); color: #04120B; }
.seg--side button.is-active[data-side="sell"] { background: var(--down); color: #fff; }

/* ---------------------------------------------------------------- modal / sheet / dropdown */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.modal { width: 100%; max-width: none; background: var(--s1); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 16px 16px 0 0; box-shadow: var(--shadow); max-height: 92vh; display: flex; flex-direction: column; animation: slideup .22s var(--ease); }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal--wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15.5px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (min-width: 601px) {
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { max-width: 460px; border-bottom: 1px solid var(--line-2); border-radius: var(--radius-lg); max-height: calc(100vh - 40px); animation: pop .18s var(--ease); }
  .modal--wide { max-width: 720px; }
}
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 80; animation: pop .15s var(--ease); }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 6px; font-size: 13px; color: var(--text-2); text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--s3); color: var(--text); }
.dropdown-menu .sep { height: 1px; background: var(--line); margin: 6px 0; }
.dropdown-menu .head { padding: 8px 10px 6px; font-size: 12px; color: var(--text-3); }
.dropdown-menu--notifs { min-width: 340px; max-width: 92vw; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 10px; border-radius: 6px; }
.notif:hover { background: var(--s3); }
.notif .n-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--s3); display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.notif.is-unread .n-ic { background: var(--brand-soft); color: var(--brand); }
.notif .n-title { font-size: 13px; font-weight: 500; }
.notif .n-body { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.notif .n-time { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* ---------------------------------------------------------------- toasts / alerts / empty */
/* top on phones: bottom sheets and the tab bar own the lower edge */
.toasts { position: fixed; top: calc(var(--topbar-h) + 10px); left: 12px; right: 12px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--s2); border: 1px solid var(--line-2); border-left: 3px solid var(--info); border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 13px; animation: pop .18s var(--ease); }
.toast--success { border-left-color: var(--up); }
.toast--error { border-left-color: var(--down); }
.toast--warning { border-left-color: var(--gold); }
.toast .ic { margin-top: 1px; }
.toast--success .ic { color: var(--up); } .toast--error .ic { color: var(--down); } .toast--warning .ic { color: var(--gold); } .toast--info .ic { color: var(--info); }
.toast button { margin-left: auto; color: var(--text-3); }
@media (min-width: 601px) { .toasts { top: 16px; left: auto; right: 16px; width: min(380px, calc(100vw - 32px)); } }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--s2); border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); }
.alert .ic { flex: none; margin-top: 1px; }
.alert b { color: var(--text); }
.alert--warn { background: var(--gold-soft); border-color: rgba(240, 185, 11, .3); color: #F5D27A; }
.alert--warn .ic { color: var(--gold); }
.alert--bad { background: var(--down-soft); border-color: rgba(246, 70, 93, .3); color: #FFB3BD; }
.alert--bad .ic { color: var(--down); }
.alert--ok { background: var(--up-soft); border-color: rgba(14, 203, 129, .3); color: #A6F0D2; }
.alert--ok .ic { color: var(--up); }
.alert--info { background: var(--info-soft); border-color: rgba(77, 124, 254, .3); color: #C2D2FF; }
.alert--info .ic { color: var(--info); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 36px 20px; color: var(--text-2); }
.empty .ic { color: var(--text-3); width: 34px; height: 34px; }
.empty h4 { color: var(--text); }
.empty p { max-width: 36ch; font-size: 13px; }

/* ---------------------------------------------------------------- avatars / steps / timeline / pager */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--s3); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; color: var(--text); flex: none; overflow: hidden; }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--lg { width: 56px; height: 56px; font-size: 20px; }
.avatar--xl { width: 84px; height: 84px; font-size: 28px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.steps { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.steps span { display: inline-flex; align-items: center; gap: 6px; }
.steps i { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; font-weight: 600; background: var(--s3); color: var(--text-2); }
.steps .is-done i { background: var(--up); color: #04120B; }
.steps .is-current { color: var(--text); }
.steps .is-current i { background: var(--brand); color: #fff; }
.steps .line { flex: 1; height: 1px; background: var(--line-2); min-width: 14px; }
.timeline { display: grid; gap: 0; }
.timeline > div { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.timeline .t-dot { display: flex; flex-direction: column; align-items: center; }
.timeline .t-dot i { width: 10px; height: 10px; border-radius: 50%; background: var(--s4); margin-top: 5px; }
.timeline .t-dot::after { content: ""; flex: 1; width: 1px; background: var(--line-2); margin-top: 4px; }
.timeline > div:last-child .t-dot::after { display: none; }
.timeline .is-done i { background: var(--up); } .timeline .is-current i { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); } .timeline .is-bad i { background: var(--down); }
.timeline .t-body { padding-bottom: 16px; font-size: 13px; }
.timeline .t-body .t-time { color: var(--text-3); font-size: 11.5px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 0; font-size: 12.5px; color: var(--text-2); }
.pager .pages { display: flex; gap: 4px; }
.pager a, .pager span.cur { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.pager a:hover { background: var(--s2); color: var(--text); }
.pager span.cur { background: var(--s3); color: var(--text); font-weight: 600; }
.skel { background: linear-gradient(90deg, var(--s2), var(--s3), var(--s2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--s3); border: 1px solid var(--line-2); }

/* ---------------------------------------------------------------- page-specific: quick actions, trade, wallet */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 601px) { .quick { gap: 10px; } }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text-2); font-size: 12px; font-weight: 500; text-align: center; transition: border-color .15s, background .15s; }
.quick a:hover { border-color: var(--line-2); background: var(--s2); color: var(--text); }
.quick a .q-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--s3); display: flex; align-items: center; justify-content: center; color: var(--text); }
.quick a.is-primary .q-ic { background: var(--brand); color: #fff; }
.promo { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-radius: var(--radius); background: linear-gradient(135deg, #1B1F26, #12161B); border: 1px solid var(--line); }
.promo h3 { font-size: 15px; } .promo p { color: var(--text-2); font-size: 12.5px; margin-top: 3px; }
.trade-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.chart-box { height: 340px; border-radius: var(--radius); overflow: hidden; background: var(--s1); border: 1px solid var(--line); }
@media (min-width: 601px) { .chart-box { height: 460px; } }
@media (min-width: 1001px) { .trade-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
.pair-head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; min-width: 0; }
.pair-head .price { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.countdown { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.asset-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info amt" "actions actions"; gap: 10px 12px; align-items: start; padding: 14px; border-bottom: 1px solid var(--line); }
.asset-row .ar-info { grid-area: info; min-width: 0; }
.asset-row .amt { grid-area: amt; }
.asset-row .ar-actions { grid-area: actions; }
@media (min-width: 601px) { .asset-row { grid-template-areas: "info amt" "actions ."; padding: 14px 18px; } }
.asset-row:last-child { border-bottom: 0; }
.asset-row .amt { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.asset-row .amt small { display: block; color: var(--text-3); font-family: var(--font); }
.trader-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s; }
.trader-card:hover { border-color: var(--line-2); }
.trader-card .roi { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.trader-card .mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-size: 11.5px; color: var(--text-3); }
.trader-card .mini b { display: block; font-size: 13px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.trader-card .curve { height: 48px; }
.kyc-img { border-radius: 8px; border: 1px solid var(--line-2); background: var(--s2); max-height: 260px; object-fit: contain; width: 100%; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 961px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }
.gate-panel { text-align: center; padding: 8px 4px 0; }
.gate-panel .g-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--gold-soft); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.gate-panel h3 { font-size: 17px; margin-bottom: 6px; }
.gate-panel p { color: var(--text-2); max-width: 36ch; margin: 0 auto; }
.pin-input { letter-spacing: .5em; text-align: center; font-family: var(--mono); font-size: 20px; }

/* ---------------------------------------------------------------- utilities */
.flex { display: flex; } .inline-flex { display: inline-flex; } .block { display: block; } .hidden { display: none !important; }
.items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; } .items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; } .justify-end { justify-content: flex-end; }
.flex-col { flex-direction: column; } .flex-wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .shrink-0 { flex: none; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; } .mx-auto { margin-left: auto; margin-right: auto; }
.p-0 { padding: 0; } .pt-0 { padding-top: 0; }
.w-full { width: 100%; } .max-w-sm { max-width: 440px; } .max-w-md { max-width: 560px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break { word-break: break-all; }
.uppercase { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
[x-cloak], [hidden] { display: none !important; }
.blur { filter: blur(7px); user-select: none; }
.cursor-pointer { cursor: pointer; }
.divide > * + * { border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* price flash */
@keyframes flashUp { from { color: var(--up); } to { color: inherit; } }
@keyframes flashDown { from { color: var(--down); } to { color: inherit; } }
.flash-up { animation: flashUp 1.2s var(--ease); }
.flash-down { animation: flashDown 1.2s var(--ease); }

/* ---------------------------------------------------------------- shared motion */
@keyframes shimmer-x { from { transform: translateX(-100%); } to { transform: translateX(200%); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.btn--primary { position: relative; overflow: hidden; }
.btn--primary::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .18) 50%, transparent 70%); transform: translateX(-120%); pointer-events: none; }
.btn--primary:hover::before { animation: shimmer-x .9s var(--ease); }
.btn.is-busy::before, .btn.is-ok::before { display: none; }
.topbar .logo img { transition: transform .3s var(--ease); }
.topbar .logo:hover img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- wallet balance card (distinct from the dashboard hero) */
.wallet-hero { background: linear-gradient(135deg, rgba(38, 161, 123, .10), transparent 42%), linear-gradient(305deg, rgba(77, 124, 254, .10), transparent 46%), var(--s1); border-color: var(--line-2); }
.wallet-hero-grid { display: grid; gap: 20px; }
.wh-figures .label { font-size: 12.5px; color: var(--text-2); }
.wh-total { font-size: 30px; font-weight: 600; letter-spacing: -.03em; margin-top: 4px; line-height: 1.1; }
.wh-sub { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12.5px; color: var(--text-2); }
.wh-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.wh-split > div { padding: 10px 12px; background: var(--s2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.wh-split b { font-size: 15px; margin-top: 2px; }
.wh-chart { display: flex; align-items: center; gap: 18px; }
.donut { position: relative; width: 116px; height: 116px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 3.4; }
.donut .donut-track { stroke: var(--s3); }
.donut .donut-seg { transition: stroke-dasharray .6s var(--ease); }
.donut-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.donut-mid b { font-size: 20px; font-weight: 600; }
.donut-mid span { font-size: 10.5px; color: var(--text-3); }
.wh-legend { display: grid; gap: 8px; flex: 1; min-width: 0; font-size: 13px; }
.wh-legend > div { display: flex; align-items: center; gap: 9px; }
.wh-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.wh-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 0; color: var(--text-3); width: 100%; }
.wh-empty p { max-width: 30ch; margin-top: 8px; }
@media (min-width: 601px) {
  .wallet-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 28px; align-items: center; }
  .wh-total { font-size: 34px; }
  .wh-chart { border-left: 1px solid var(--line); padding-left: 28px; }
  .wh-legend { min-width: 130px; flex: none; }
}

/* ---------------------------------------------------------------- small-screen ergonomics */
.stat .value { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  /* comfortable tap targets: 26px pills are too small for a thumb */
  .btn--xs { height: 32px; padding: 0 12px; font-size: 12px; }
  .btn--sm { height: 36px; }
  .presets button { height: 32px; padding: 0 12px; }
  /* let a narrow table use the width it has instead of forcing a scroll */
  .table { min-width: 0; }
  .table th, .table td { padding: 10px 10px; }
  /* three primary actions fit on one line */
  .balance-hero .cluster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .balance-hero .cluster .btn { width: 100%; padding: 0 6px; }
  .input-group .inside .btn { height: 32px; }
  .input-group.has-inside .input { padding-right: 88px; }
  .icon-btn { width: 40px; height: 40px; }
  .table .actions .btn + .btn { margin-left: 8px; }
  /* hint that a tab strip scrolls sideways */
  .tabs, .filters { mask-image: linear-gradient(90deg, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); }
}
@media (max-width: 400px) {
  .stat .value { font-size: 20px; }
  .kpis { gap: 8px; }
  .stat { padding: 14px; }
}

/* ---------------------------------------------------------------- compact pickers (withdraw, deposit) */
.pick-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; scroll-snap-type: x proximity; }
.pick-row::-webkit-scrollbar { display: none; }
.pick { flex: none; scroll-snap-align: start; display: flex; align-items: center; gap: 8px; padding: 9px 12px; min-height: 46px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--s2); cursor: pointer; transition: border-color .15s, background .15s; text-align: left; }
.pick:hover { border-color: var(--text-3); }
.pick.is-on { border-color: var(--brand); background: var(--brand-soft); }
.pick .p-sym { font-weight: 600; font-size: 13px; line-height: 1.15; display: block; }
.pick .p-sub { font-size: 11px; color: var(--text-3); font-family: var(--mono); display: block; }
.pick--net { min-height: 38px; padding: 8px 14px; font-weight: 600; font-size: 12.5px; }
.pick--net.is-on { color: var(--text); }
@media (min-width: 601px) { .pick-row { flex-wrap: wrap; overflow: visible; } }

/* ---------------------------------------------------------------- admin: deposit network rows */
.net-group { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--s2); }
.net-group + .net-group { margin-top: 10px; }
.net-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.net-row + .net-row { margin-top: 8px; }
.net-row .input:first-child { grid-column: 1 / -1; }
@media (min-width: 761px) { .net-row { grid-template-columns: 150px minmax(0, 1fr) auto; } .net-row .input:first-child { grid-column: auto; } }

/* ---------------------------------------------------------------- button working / done states */
@keyframes xp-spin { to { transform: rotate(360deg); } }
@keyframes xp-tick { from { opacity: 0; transform: rotate(-45deg) scale(.6); } to { opacity: 1; transform: rotate(-45deg) scale(1); } }
.btn.is-busy, .btn.is-ok { pointer-events: none; position: relative; color: transparent !important; overflow: hidden; }
.btn.is-busy > *, .btn.is-ok > * { visibility: hidden; }
.btn.is-busy::after {
  content: ""; position: absolute; top: 50%; left: 50%; right: auto; bottom: auto;
  width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px; padding: 0; background: none;
  border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%;
  transform-origin: 50% 50%; will-change: transform;
  animation: xp-spin .6s linear infinite;
}
.btn--secondary.is-busy::after, .btn--ghost.is-busy::after { border-color: var(--line-2); border-top-color: var(--text); }
.btn--success.is-busy::after, .btn--gold.is-busy::after { border-color: rgba(0, 0, 0, .25); border-top-color: #04120B; }
.btn.is-ok { background: var(--up) !important; border-color: var(--up) !important; }
.btn.is-ok::after {
  content: ""; position: absolute; top: 50%; left: 50%; right: auto; bottom: auto;
  width: 15px; height: 8px; margin: -6px 0 0 -7.5px; padding: 0; background: none; border: 0; border-radius: 0;
  border-left: 2.5px solid #04120B; border-bottom: 2.5px solid #04120B; transform: rotate(-45deg);
  animation: xp-tick .22s var(--ease) both;
}
.btn.is-fail { background: var(--down) !important; border-color: var(--down) !important; color: #fff !important; }
@media (prefers-reduced-motion: reduce) { .btn.is-busy::after { animation-duration: 1.4s; } .btn.is-ok::after { animation: none; } }

/* spinner and tick scale down on the compact buttons */
.btn--sm.is-busy::after, .btn--xs.is-busy::after { width: 14px; height: 14px; margin: -7px 0 0 -7px; border-width: 1.6px; }
.btn--sm.is-ok::after, .btn--xs.is-ok::after { width: 12px; height: 6px; margin: -5px 0 0 -6px; border-left-width: 2px; border-bottom-width: 2px; }
