/* mixxing.io — public DEX. Light institutional theme.
   Trust-coded for non-custodial finance. Inspired by Aave, Coinbase, Stripe,
   CoinMarketCap (markets), TradingView (data density), CoinDesk (typography). */

:root {
  --bg:          #fcfcfd;
  --bg-elev:     #f5f6f8;
  --surface:     #ffffff;
  --surface-2:   #f9fafb;
  --border:      rgba(15,17,21,0.08);
  --border-strong: rgba(15,17,21,0.16);
  --text:        #0d0f14;
  --text-soft:   #2d323b;
  --muted:       rgba(13,15,20,0.55);
  --muted-2:     rgba(13,15,20,0.32);
  --accent:      #0066ff;
  --accent-soft: rgba(0,102,255,0.08);
  --accent-hover: #0052d4;
  --positive:    #00a86b;
  --positive-bg: rgba(0,168,107,0.08);
  --negative:    #d4252e;
  --negative-bg: rgba(212,37,46,0.08);
  --warning:     #b45309;
  --radius:      12px;
  --radius-sm:   8px;
  --font-body:   'Inter', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  --max-w:       1280px;
  --shadow-sm:   0 1px 2px rgba(15,17,21,0.04);
  --shadow:      0 1px 3px rgba(15,17,21,0.06), 0 4px 12px rgba(15,17,21,0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background: var(--bg); }
body {
  font-family: var(--font-body);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
.mono { font-family: var(--font-mono); font-feature-settings: "tnum", "zero"; }

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(252,252,253,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex; align-items: center; gap: 32px;
  padding: 14px 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 15px; letter-spacing: -0.3px;
}
.brand-mark {
  width: 26px; height: 26px;
  background: var(--accent); color: #fff;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
}
.brand-text .dot { color: var(--accent); }

.nav {
  display: flex; gap: 4px;
  list-style: none; padding: 0; margin: 0;
}
.nav a {
  display: block; padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13px; font-weight: 500;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--bg-elev); }
.nav a.active { color: var(--text); background: var(--bg-elev); }
.nav-sep {
  width: 1px; height: 16px;
  background: var(--border);
  margin: 0 6px;
  align-self: center;
}

.topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
}
.badge-noncustodial {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
  color: var(--positive);
  background: var(--positive-bg);
  border: 1px solid rgba(0,168,107,0.24);
  border-radius: 999px;
}
.badge-noncustodial::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--positive);
}
.wallet-btn {
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  color: #fff; background: var(--accent);
  padding: 8px 16px; border: none; border-radius: var(--radius-sm);
  transition: background .15s;
}
.wallet-btn:hover { background: var(--accent-hover); }
.wallet-btn.connected {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono); font-weight: 500;
}

/* ── Page container ─────────────────────────────────────────────── */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* Sidebar layout — mixxing-sidebar + main content side-by-side */
.layout {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  padding: 0 24px;
}
.layout > main {
  padding: 32px 0 80px 28px;
  min-width: 0;
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 32px 20px 32px 0;
  position: sticky;
  top: 56px;
  align-self: start;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
}
.sb-section { margin-bottom: 28px; }
.sb-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
}
.sb-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--muted);
}
.sb-all { font-size: 11px; color: var(--accent); font-weight: 500; }
.sb-all:hover { text-decoration: underline; }
.sb-list { list-style: none; padding: 0; }
.sb-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  padding: 8px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.sb-row:last-child { border-bottom: none; }
.sb-row .sb-asset { font-weight: 500; }
.sb-row .sb-price { font-family: var(--font-mono); color: var(--text); }
.sb-row .sb-delta { font-family: var(--font-mono); font-size: 11px; }
.sb-empty {
  padding: 12px 0; font-size: 12px; color: var(--muted-2);
  font-style: italic;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 0 20px; }
  .sidebar { display: none; }
  .layout > main { padding: 24px 0 60px; }
}
.page-header { margin-bottom: 24px; }
.page-header h1 {
  font-size: 22px; font-weight: 600; letter-spacing: -0.4px;
  margin-bottom: 4px;
}
.page-header p {
  color: var(--muted); font-size: 13px;
}

/* ── Tables (CoinMarketCap-stil) ────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table.markets {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
table.markets thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  text-align: right;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
table.markets thead th:first-child,
table.markets thead th:nth-child(2) { text-align: left; }
table.markets tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
}
table.markets tbody td:first-child,
table.markets tbody td:nth-child(2) {
  text-align: left;
  font-family: var(--font-body);
  font-weight: 500;
}
table.markets tbody tr:last-child td { border-bottom: none; }
table.markets tbody tr:hover { background: var(--surface-2); }
.delta-pos { color: var(--positive); }
.delta-neg { color: var(--negative); }

/* ── Empty state ────────────────────────────────────────────────── */
.empty {
  padding: 64px 32px;
  text-align: center;
}
.empty .empty-title {
  font-size: 16px; font-weight: 600; margin-bottom: 6px;
}
.empty .empty-note {
  color: var(--muted); font-size: 13px; max-width: 460px;
  margin: 0 auto; line-height: 1.6;
}

/* ── Swap card (Uniswap-stil) ───────────────────────────────────── */
.swap-card {
  max-width: 460px; margin: 32px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.swap-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.swap-card-head h2 {
  font-size: 15px; font-weight: 600;
}
.swap-card-head .icon-btn {
  width: 32px; height: 32px;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted);
}
.swap-input {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 14px 12px;
}
.swap-input + .swap-input { margin-top: 6px; }
.swap-input .label {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
}
.swap-input .row {
  display: flex; align-items: center; gap: 12px;
}
.swap-input input {
  flex: 1; min-width: 0;
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 500;
  background: transparent; border: none; outline: none;
  color: var(--text);
}
.swap-input input::placeholder { color: var(--muted-2); }
.token-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  color: var(--text);
}
.swap-flip {
  display: flex; justify-content: center;
  margin: -6px 0;
}
.swap-flip-btn {
  width: 28px; height: 28px;
  background: var(--surface);
  border: 3px solid var(--bg);
  border-radius: 8px;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.swap-meta {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted); margin: 14px 4px 16px;
}
.btn-primary {
  width: 100%; padding: 14px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled {
  background: var(--bg-elev); color: var(--muted);
  cursor: not-allowed;
}

/* ── Definition list (chain status, portfolio key/values) ───────── */
.dl {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 0;
  box-shadow: var(--shadow-sm);
}
.dl-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.dl-row:last-child { border-bottom: none; }
.dl-row .k { color: var(--muted); }
.dl-row .v { font-family: var(--font-mono); }
.dl-row .v.ok { color: var(--positive); }
.dl-row .v.warn { color: var(--warning); }
.dl-row .v.err { color: var(--negative); }

/* ── Footer ─────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 20px 24px;
  font-size: 12px; color: var(--muted-2);
  text-align: center;
}
.footer .accent { color: var(--accent); }
