:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e3e8ef;
  --line-2: #eef2f6;
  --brand: #0d7c72;
  --brand-2: #0a5f57;
  --brand-soft: #e2f4f1;
  --ok: #15803d; --ok-soft: #e6f6ec;
  --warn: #b45309; --warn-soft: #fdf3e2;
  --bad: #c62828; --bad-soft: #fdecec;
  --info: #1d4ed8; --info-soft: #e8efff;
  --violet: #6d28d9; --violet-soft: #f1eafe;
  --zain: #19a79b;
  --asia: #e52b2e;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
  --shadow-lg: 0 18px 50px -12px rgba(15, 23, 42, .25);
  --radius: 14px;
  --radius-sm: 9px;
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1018; --surface: #121924; --surface-2: #0f1620; --ink: #e6edf5; --ink-2: #c4cfdc; --muted: #8b99ab; --faint: #5f6d80;
    --line: #223043; --line-2: #1a2535; --brand: #2bb3a5; --brand-2: #5fd0c3; --brand-soft: #10302d;
    --ok: #4ade80; --ok-soft: #10291a; --warn: #fbbf24; --warn-soft: #2e2410; --bad: #f87171; --bad-soft: #321616;
    --info: #7aa2ff; --info-soft: #152240; --violet: #b69bff; --violet-soft: #241a3e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 18px 50px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--brand); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.mono { font-family: var(--mono); font-size: 12.5px; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
svg { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-inline-start: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.brand b { display: block; font-size: 15px; }
.brand small { display: block; color: var(--muted); font-size: 11.5px; direction: ltr; text-align: right; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: url(/img/favicon.svg) center/cover; flex: none; }
.brand-lg .brand-mark { width: 44px; height: 44px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--brand-soft); color: var(--brand-2); }
.nav a.active svg { color: var(--brand); }
.nav svg { color: var(--faint); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.who { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12.5px; padding: 0 6px; }
.link { background: none; border: 0; color: var(--brand); padding: 0; }
.link:hover { text-decoration: underline; }

.live-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 12.5px; color: var(--muted); width: fit-content; }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live-pill.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.live-pill.on i { background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 1.8s infinite; }
.live-pill.lost { color: var(--warn); background: var(--warn-soft); }
.live-pill.lost i { background: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.main { padding: 26px 30px 60px; min-width: 0; max-width: 1360px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.crumb:hover { color: var(--brand); }

/* ---------- buttons / inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { padding: 6px; width: 32px; height: 32px; }
.btn-block { width: 100%; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
.input, .field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; outline: none; width: 100%; transition: border-color .15s, box-shadow .15s; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.field input.ltr, .input.ltr { direction: ltr; text-align: left; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-error { color: var(--bad); background: var(--bad-soft); border-radius: 9px; padding: 8px 12px; margin: 0; font-size: 13px; }
.form-note { color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 9px; padding: 8px 12px; margin: 0; font-size: 12.5px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg img { width: 20px; height: 20px; border-radius: 6px; }
.seg .count { font-size: 11px; background: var(--line-2); border-radius: 999px; padding: 0 7px; color: var(--muted); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.card-body { padding: 16px 18px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; }
.kpi .value small { font-size: 12px; color: var(--muted); font-weight: 500; margin-inline-start: 4px; }
.kpi .foot { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- status chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.chip.plain::before { display: none; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.chip.brand { background: var(--brand-soft); color: var(--brand-2); }
.chip.spin::before { border: 2px solid currentColor; border-top-color: transparent; background: none; width: 8px; height: 8px; animation: spin .8s linear infinite; }

/* ---------- routing strip ---------- */
.route-strip { display: flex; align-items: center; gap: 8px; padding: 12px 16px; overflow-x: auto; margin-bottom: 14px; }
.route-strip .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; margin-inline-end: 4px; }
.route-node { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px 4px 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--muted); background: var(--surface-2); }
.route-node b { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--line); color: var(--ink-2); font-size: 11px; }
.route-node.target { border-color: var(--brand); color: var(--brand-2); background: var(--brand-soft); }
.route-node.target b { background: var(--brand); color: #fff; }
.route-node.full { text-decoration: line-through; opacity: .75; }
.route-node.off { opacity: .45; }
.route-arrow { color: var(--faint); font-size: 12px; }

/* ---------- wallet list ---------- */
.wallet-list { display: flex; flex-direction: column; gap: 10px; }
.wallet { display: grid; grid-template-columns: 34px 44px minmax(170px, 1.1fr) minmax(220px, 1.6fr) auto; align-items: center; gap: 14px; padding: 14px 16px; position: relative; transition: border-color .2s, box-shadow .2s, transform .15s; }
.wallet:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.wallet.is-target { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.wallet.is-off { opacity: .62; }
.wallet.dragging { opacity: .4; }
.wallet.drop-before { box-shadow: 0 -3px 0 0 var(--brand); }
.wallet.drop-after { box-shadow: 0 3px 0 0 var(--brand); }
.order { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.order .n { width: 28px; height: 28px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.wallet.is-target .order .n { background: var(--brand); border-color: var(--brand); color: #fff; }
.order .grip { cursor: grab; color: var(--faint); display: flex; padding: 2px; border: 0; background: none; }
.order .arrows { display: none; gap: 2px; }
.order .arrows button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; width: 22px; height: 20px; display: grid; place-items: center; padding: 0; font-size: 11px; color: var(--muted); }
.logo { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.w-id b { display: block; font-size: 15px; }
.w-id .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.w-bal .amount { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }
.w-bal .amount b { font-size: 20px; font-weight: 700; letter-spacing: -.01em; transition: color .4s; }
.w-bal .amount b.flash-up { color: var(--ok); }
.w-bal .amount b.flash-down { color: var(--bad); }
.w-bal .amount span { font-size: 12px; color: var(--muted); }
.w-actions { display: flex; gap: 6px; align-items: center; }

.meter { position: relative; height: 9px; background: var(--line-2); border-radius: 999px; margin: 8px 0 6px; overflow: visible; }
.meter .fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #7ee0d4)); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.meter .fill.full { background: linear-gradient(90deg, var(--warn), color-mix(in srgb, var(--warn) 70%, #fde68a)); }
.meter .fill.over { background: var(--bad); }
.meter .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink-2); border-radius: 2px; opacity: .55; }
.meter-legend { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.meter-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-inline-end: 4px; vertical-align: middle; }

.updated { font-size: 11.5px; color: var(--faint); display: inline-flex; align-items: center; gap: 5px; }
.updated.stale { color: var(--warn); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty img { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 12px; }
.empty h3 { color: var(--ink); margin: 0 0 6px; font-size: 16px; }
.empty p { margin: 0 auto 16px; max-width: 460px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: start; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; }
.t tbody tr { transition: background .15s; }
.t tbody tr.clickable { cursor: pointer; }
.t tbody tr.clickable:hover { background: var(--surface-2); }
.t tbody tr.new { animation: rowin 1.6s ease-out; }
@keyframes rowin { from { background: var(--brand-soft); } to { background: transparent; } }
.t .pos { color: var(--ok); }
.t .neg { color: var(--bad); }
.t .code { font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; direction: ltr; unicode-bidi: isolate; }
.arrow-lr { color: var(--faint); margin: 0 4px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line-2); align-items: center; }
.filters .input { width: auto; min-width: 150px; padding: 7px 11px; }
.filters .grow { flex: 1; min-width: 220px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; color: var(--muted); font-size: 12.5px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- wallet detail ---------- */
.hero { padding: 20px 22px; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
.hero .logo { width: 58px; height: 58px; border-radius: 16px; }
.hero h2 { margin: 0; font-size: 19px; }
.hero .meta { color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: 13px; }
.hero-bal { text-align: left; }
.hero-bal .big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.hero-bal .big small { font-size: 14px; color: var(--muted); font-weight: 500; }
.hero-meter { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; text-align: left; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tabs button { border: 0; background: none; padding: 12px 12px 10px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { color: var(--brand-2); border-bottom-color: var(--brand); }
.tabs .count { background: var(--line-2); border-radius: 999px; padding: 0 7px; font-size: 11px; color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin: 12px 16px 0; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.info { background: var(--info-soft); color: var(--info); }

/* ---------- timeline / events ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line-2); font-size: 13px; align-items: start; }
.timeline li:last-child { border-bottom: 0; }
.timeline .lv { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--info); }
.timeline .lv.warn { background: var(--warn); }
.timeline .lv.error { background: var(--bad); }
.timeline .lv.ok { background: var(--ok); }
.timeline time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.timeline .type { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* ---------- modal / drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 16px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-start; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.overlay.drawer { place-items: stretch end; padding: 0; }
.overlay.drawer .modal { width: min(620px, 100%); max-height: none; height: 100vh; border-radius: 0; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(-30px); opacity: 0; } }
.x { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.x:hover { background: var(--surface-2); }

.compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.compare > div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; }
.compare .l { color: var(--muted); font-size: 12px; }
.compare .v { font-size: 18px; font-weight: 700; }
.section-title { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 4px 0 -4px; text-transform: none; }
pre.code-block { background: #0d1520; color: #d6e2ee; border-radius: 12px; padding: 14px 16px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; margin: 0; direction: ltr; text-align: left; white-space: pre; position: relative; }
.code-wrap { position: relative; }
.code-wrap pre.code-block { padding-top: 44px; }
.code-wrap .copy { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, .1); color: #d6e2ee; border: 1px solid rgba(255, 255, 255, .18); }
.code-wrap .copy:hover { background: rgba(255, 255, 255, .18); }
.tok-k { color: #7dd3fc; } .tok-s { color: #a7f3d0; } .tok-n { color: #fcd34d; } .tok-c { color: #64748b; }

.key-reveal { display: flex; gap: 8px; align-items: center; background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); padding: 10px 12px; border-radius: 10px; }
.key-reveal code { flex: 1; font-family: var(--mono); font-size: 12.5px; direction: ltr; word-break: break-all; }

.doc h4 { margin: 18px 0 8px; font-size: 14px; }
.doc p { margin: 6px 0; color: var(--ink-2); }
.doc table.t td { white-space: normal; }
.endpoint { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; direction: ltr; font-family: var(--mono); font-size: 13px; }
.method { font-weight: 700; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; }
.method.post { background: var(--ok-soft); color: var(--ok); }
.method.get { background: var(--info-soft); color: var(--info); }

.route-row { display: grid; grid-template-columns: 26px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.route-row:last-child { border-bottom: 0; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 18px; left: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--info); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow-lg); font-size: 13px; animation: pop .2s ease-out; }
.toast b { display: block; margin-bottom: 2px; }
.toast.ok { border-inline-start-color: var(--ok); }
.toast.warn { border-inline-start-color: var(--warn); }
.toast.bad { border-inline-start-color: var(--bad); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 500px at 80% -10%, var(--brand-soft), transparent), var(--bg); }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-lg); }

.skeleton { background: linear-gradient(90deg, var(--line-2), var(--surface-2), var(--line-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; height: 80px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .wallet { grid-template-columns: 34px 44px 1fr auto; }
  .wallet .w-bal { grid-column: 3 / -1; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 8px; z-index: 20; border-inline-start: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .sidebar .brand small, .sidebar .brand b { display: none; }
  .nav { flex-direction: row; }
  .nav a { padding: 8px 10px; }
  .nav a span { display: none; }
  .sidebar-foot { margin: 0; margin-inline-start: auto; flex-direction: row; align-items: center; }
  .who span { display: none; }
  .sidebar .live-pill span { display: none; }
  .sidebar .live-pill { padding: 8px; }
  .main { padding: 18px 16px 50px; }
  .wallet { grid-template-columns: 34px 1fr auto; }
  .wallet .logo { display: none; }
  .wallet .w-bal { grid-column: 1 / -1; }
  .order .grip { display: none; }
  .order .arrows { display: flex; }
  .hero { grid-template-columns: auto 1fr; }
  .hero-bal { grid-column: 1 / -1; text-align: right; }
  .form-grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr 1fr; }
}
