/* ChainCapital — premium glass UI.
   No frameworks, no webfonts, no external requests. Everything animates on
   transform/opacity only, so the rail and cards stay on the compositor. */

:root {
  /* Palette sampled straight off the brand sheet: near-black ground, the
     logo green as the single accent. */
  --bg:        #000408;
  --bg-2:      #030c0e;
  --text:      #e9f6ee;
  --dim:       #8ea79a;
  --faint:     #5d7568;

  --accent:    #3ee977;
  --accent-2:  #6bf49a;
  --accent-dk: #1ea855;
  --up:        #3ee977;
  --down:      #ff5f6d;

  /* Glass tokens — one place to retune the whole surface language. */
  --glass-bg:     rgba(255, 255, 255, .045);
  --glass-bg-2:   rgba(255, 255, 255, .075);
  --glass-line:   rgba(255, 255, 255, .10);
  --glass-line-2: rgba(255, 255, 255, .18);
  --glass-blur:   22px;
  --shadow:       0 18px 50px -18px rgba(0, 0, 0, .85);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --item-w: 124px;   /* rail item pitch — JS reads this to centre the track */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
button { font: inherit; color: inherit; }

/* ── Ambient background ───────────────────────────────────────────────── */

.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  will-change: transform;
}
.b1 { width: 620px; height: 620px; top: -260px; left: -180px;  background: #1c8f52; opacity: .16; }
.b2 { width: 520px; height: 520px; top: 18%;   right: -220px;  background: #3ee977; opacity: .10; }
.b3 { width: 700px; height: 700px; bottom: -380px; left: 32%;  background: #0a4a2a; opacity: .24; }

/* Vignette: keeps the glow local instead of lifting the whole page off black. */
.ambient::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 100% 80% at 50% 30%, transparent 35%, rgba(0, 4, 8, .82) 100%);
}

.grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(120, 230, 170, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 230, 170, .055) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 35%, #000 30%, transparent 100%);
}

/* ── Glass primitives ─────────────────────────────────────────────────── */

.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .10);
}

/* Specular sheen along the top edge — what sells the "premium glass" read. */
.glass::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .13), transparent 42%);
  pointer-events: none;
  opacity: .9;
}

.glass-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-line-2);
  background: var(--glass-bg-2);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 6px 20px -10px rgba(0, 0, 0, .9);
  font-size: 14px; font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.glass-btn:hover  { background: rgba(255, 255, 255, .12); transform: translateY(-1px); }
.glass-btn:active { transform: translateY(0) scale(.98); }
.glass-btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.glass-btn.ghost { background: rgba(255, 255, 255, .03); font-size: 13px; padding: 7px 13px; }
.glass-btn.lg    { padding: 13px 26px; font-size: 15px; }

.glass-btn.primary {
  border-color: rgba(62, 233, 119, .55);
  background: linear-gradient(180deg, rgba(62, 233, 119, .95), rgba(24, 168, 84, .95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 10px 30px -10px rgba(30, 168, 85, .8);
  color: #fff;
}
.glass-btn.primary:hover { background: linear-gradient(180deg, #57f08d, #1ea855); }

.glass-btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.dot.live { background: var(--up); box-shadow: 0 0 8px var(--up); }

/* ── Top bar ──────────────────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 22px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: linear-gradient(180deg, rgba(0, 4, 8, .82), rgba(0, 4, 8, .35));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
/* Sprite host: holds the <symbol>, never renders itself. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark {
  width: 25px; height: 29px;
  color: var(--accent);
  filter: drop-shadow(0 0 12px rgba(62, 233, 119, .45));
}
/* Wordmark: CHAIN in white, CAPITAL in the brand green, as on the brand sheet. */
.wordmark { font-size: 17px; font-weight: 600; letter-spacing: .11em; }
.wordmark b { font-weight: 600; color: var(--accent); }

.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav-link {
  padding: 7px 14px; border-radius: 999px;
  color: var(--dim); text-decoration: none; font-size: 14px;
  transition: color .16s, background .16s;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.nav-link.is-active { color: var(--text); background: rgba(255, 255, 255, .09); }

.topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

main { max-width: 1180px; margin: 0 auto; padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 44px) 60px; }

.section-head h1 { font-size: clamp(28px, 4.4vw, 42px); font-weight: 650; }
.section-head h2 { font-size: 19px; font-weight: 600; }
.section-head p  { margin: 8px 0 0; color: var(--dim); font-size: 15px; }
.section-head.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ── Search ───────────────────────────────────────────────────────────── */

.search-wrap {
  display: flex; align-items: center; gap: 12px;
  margin: 26px 0 30px;
  padding: 0 16px;
  height: 56px;
  border-radius: 999px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search-wrap:focus-within {
  border-color: rgba(62, 233, 119, .5);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 4px rgba(62, 233, 119, .13);
}
.search-icon { width: 20px; height: 20px; color: var(--faint); flex: none; }
#search {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: none;
  color: var(--text); font: 16px var(--sans);
}
#search::placeholder { color: var(--faint); }
#search::-webkit-search-cancel-button { -webkit-appearance: none; }
.hint {
  font: 12px var(--mono); color: var(--faint);
  border: 1px solid var(--glass-line); border-radius: 6px;
  padding: 2px 7px; flex: none;
}

/* ── Rail ─────────────────────────────────────────────────────────────── */

.rail { position: relative; display: flex; align-items: center; }

.rail-view {
  flex: 1; min-width: 0;
  overflow: hidden;
  padding: 12px 0 4px;
  cursor: grab;
  touch-action: pan-y;
  /* Edges fade to transparent rather than to a flat colour — the ambient
     blobs show through, so no opaque slab sits over the background. */
  mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
}
.rail-view.is-dragging { cursor: grabbing; }

.rail-track {
  display: flex;
  will-change: transform;
  transition: transform .55s var(--ease);
}
.rail-track.no-anim { transition: none; }

.rail-item {
  flex: 0 0 var(--item-w);
  width: var(--item-w);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 6px 0;
  background: none; border: 0; cursor: pointer;
  /* Idle items sit back; the active one comes forward. */
  opacity: .38;
  transform: scale(.76);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.rail-item.near { opacity: .62; transform: scale(.86); }
.rail-item.is-active { opacity: 1; transform: scale(1); }
.rail-item:focus-visible { outline: none; }
.rail-item:focus-visible .icon-ring { outline: 2px solid var(--accent-2); outline-offset: 4px; }

.icon-ring {
  position: relative;
  width: 76px; height: 76px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--glass-line);
  background: var(--glass-bg-2);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 10px 26px -14px rgba(0, 0, 0, .9);
  transition: box-shadow .45s var(--ease), border-color .45s var(--ease);
}
.is-active .icon-ring {
  border-color: rgba(62, 233, 119, .6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    0 0 0 6px rgba(62, 233, 119, .10),
    0 0 42px rgba(62, 233, 119, .45);
}
/* Orbit ring, drawn only around the active item. */
.is-active .icon-ring::after {
  content: "";
  position: absolute; inset: -14px;
  border-radius: 50%;
  border: 1px solid rgba(62, 233, 119, .22);
}

.icon-ring svg { width: 38px; height: 38px; }
.icon-ring .mono { font: 700 20px var(--sans); letter-spacing: -.02em; }

/* Trailing placeholder: reads as an empty slot waiting to be filled, so it
   never competes with a real market for attention. */
.is-more .icon-ring {
  border-style: dashed;
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .02);
  color: var(--faint);
  box-shadow: none;
}
.is-more.is-active .icon-ring {
  border-color: rgba(62, 233, 119, .35);
  color: var(--accent);
  box-shadow: 0 0 0 6px rgba(62, 233, 119, .06), 0 0 30px rgba(62, 233, 119, .18);
}
.is-more.is-active .icon-ring::after { border-color: rgba(62, 233, 119, .12); }
.is-more .icon-ring svg { width: 26px; height: 26px; }
.is-more .label { color: var(--dim); font-weight: 500; }

.rail-item .label { font-size: 13px; font-weight: 600; text-align: center; line-height: 1.25; }
.rail-item .sub   { font: 11px var(--mono); color: var(--faint); letter-spacing: .04em; }

/* Holds the tile's ticker or its "trading soon" badge. Both are written after
   the vault API answers, so the line is reserved at its full height up front —
   otherwise every tile jumps vertically the moment the first vault row lands. */
.rail-state { display: grid; place-items: center; min-height: 18px; }

.soon-badge {
  font: 600 9.5px var(--sans);
  text-transform: uppercase; letter-spacing: .07em;
  color: #ffd9a3;
  background: rgba(255, 176, 74, .13);
  border: 1px solid rgba(255, 176, 74, .32);
  border-radius: 999px;
  padding: 2px 8px;
}
.soon-badge.lg { font-size: 12px; padding: 5px 14px; }

.rail-arrow {
  flex: none; width: 42px; height: 42px; padding: 0; border-radius: 50%;
  z-index: 3;
}
.rail-arrow svg { width: 20px; height: 20px; }

.rail-dots { display: flex; justify-content: center; gap: 7px; margin-top: 18px; }
.rail-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  transition: width .3s var(--ease), background .3s var(--ease);
}
.rail-dots i.on { width: 20px; border-radius: 3px; background: var(--accent); }

/* ── Detail ───────────────────────────────────────────────────────────── */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 46px;
}

.card { border-radius: var(--r-lg); padding: 22px; }

.card-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; }
/* Bottom glow, echoing the reference card. */
.card-hero::after {
  content: "";
  position: absolute; left: 8%; right: 8%; bottom: -70px; height: 130px;
  background: radial-gradient(ellipse at center, rgba(62, 233, 119, .75), transparent 70%);
  filter: blur(28px);
  pointer-events: none;
}

.card-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.asset-id { display: flex; align-items: center; gap: 13px; }
.asset-id h2 { font-size: 19px; font-weight: 620; }
.asset-id .ticker { font: 11px var(--mono); color: var(--faint); letter-spacing: .08em; }

.asset-chip {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  border: 1px solid var(--glass-line-2);
  background: var(--glass-bg-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.asset-chip svg { width: 24px; height: 24px; }
.asset-chip .mono { font: 700 14px var(--sans); }

.range-switch, .filter-switch {
  display: flex; gap: 2px; padding: 3px; border-radius: 999px;
}
.range, .filter {
  border: 0; background: none; cursor: pointer;
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; color: var(--dim);
  transition: background .16s, color .16s;
}
.range:hover, .filter:hover { color: var(--text); }
.range.is-active, .filter.is-active { background: rgba(255, 255, 255, .13); color: var(--text); }

.chart-wrap { margin: 14px -6px 0; }
.chart { display: block; width: 100%; height: 200px; overflow: visible; }
.chart-line { fill: none; stroke: var(--accent-2); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-fill { fill: url(#fillGrad); stroke: none; }
.chart-dot  { fill: #fff; filter: drop-shadow(0 0 10px var(--accent-2)); }

.hero-readout { margin-top: 18px; text-align: center; }
.readout-label { font-size: 13px; color: var(--dim); }
.readout-value { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin-top: 2px; }
#heroPrice { font-size: clamp(38px, 6vw, 58px); font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.delta { font-size: 15px; font-weight: 600; }
.delta.up   { color: var(--up); }
.delta.down { color: var(--down); }
.readout-sub { font: 11px var(--mono); color: var(--faint); }

.hero-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }

.soon-veil {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 30px; text-align: center;
  background: rgba(0, 5, 9, .58);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}
.soon-veil[hidden] { display: none; }
.soon-veil p { margin: 0; max-width: 300px; color: var(--dim); font-size: 14px; }

/* ── Stats ────────────────────────────────────────────────────────────── */

.stat-column { display: flex; flex-direction: column; gap: 18px; }
.stat { display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.stat-label { font-size: 13px; color: var(--dim); }
.stat-value { font-size: 30px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat.sm .stat-value { font-size: 22px; }
.stat-foot { font-size: 12.5px; }
.stat-foot.up { color: var(--up); }
.stat-foot.dim { color: var(--faint); }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vault-pill {
  font: 600 10px var(--sans); text-transform: uppercase; letter-spacing: .07em;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--glass-line-2); color: var(--dim);
}
.vault-pill.ok  { color: var(--accent); border-color: rgba(62, 233, 119, .4); background: rgba(62, 233, 119, .08); }
.vault-pill.bad { color: var(--down);   border-color: rgba(255, 95, 109, .4); background: rgba(255, 95, 109, .08); }

/* Vault detail rows: label left, value right, monospaced so digits line up. */
.kv {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 14px;
  margin: 16px 0 0; font-size: 12.5px;
}
.kv dt { color: var(--dim); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-size: 12px; }

.glass-btn.wide { width: 100%; margin-top: 16px; }
.pos-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* ── Toast ────────────────────────────────────────────────────────────── */

.toast {
  position: fixed; z-index: 60;
  left: 50%; bottom: 26px; transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--glass-line-2);
  background: rgba(6, 14, 11, .93);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .9);
  color: var(--text); font-size: 13.5px; text-align: center;
  animation: toast-in .22s var(--ease);
}
.toast[hidden] { display: none; }
.toast.bad { border-color: rgba(255, 95, 109, .45); color: #ffc9ce; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ── Wallet picker ────────────────────────────────────────────────────── */

.wallet-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.wallet-opt {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--glass-line); background: rgba(255, 255, 255, .04);
  color: var(--text); font-size: 14px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.wallet-opt:hover { background: rgba(62, 233, 119, .10); border-color: rgba(62, 233, 119, .4); }
.wallet-opt img { border-radius: 6px; }
.wallet-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--glass-bg-2); border: 1px solid var(--glass-line); }

/* ── Deposit dialog ───────────────────────────────────────────────────── */

.deposit-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 26px;
  border: 1px solid var(--glass-line-2);
  border-radius: var(--r-lg);
  background: rgba(6, 14, 11, .92);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9);
  color: var(--text);
}
.deposit-dialog::backdrop { background: rgba(0, 4, 8, .72); backdrop-filter: blur(3px); }
.deposit-dialog h3 { font-size: 19px; font-weight: 620; }
.dep-vault { margin: 4px 0 20px; color: var(--dim); font-size: 13px; }

.dep-close-form { float: right; margin: -8px -8px 0 0; }
.dep-close {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--glass-line); background: none;
  color: var(--dim); font-size: 17px; line-height: 1; cursor: pointer;
}
.dep-close:hover { color: var(--text); background: rgba(255, 255, 255, .07); }

.dep-field > span { display: block; font-size: 12.5px; color: var(--dim); margin-bottom: 7px; }
.dep-input {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px 0 16px; height: 54px; border-radius: 14px;
}
.dep-input input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none;
  color: var(--text); font: 20px var(--sans); font-variant-numeric: tabular-nums;
}
.dep-asset { font: 13px var(--mono); color: var(--dim); }
.dep-max {
  border: 1px solid var(--glass-line-2); background: rgba(255, 255, 255, .06);
  color: var(--accent); font: 600 11px var(--sans); letter-spacing: .05em;
  padding: 5px 10px; border-radius: 8px; cursor: pointer;
}
.dep-max:hover { background: rgba(62, 233, 119, .12); }

.dep-kv { margin-top: 18px; }

.dep-note { margin: 12px 0 0; font-size: 12px; color: var(--dim); line-height: 1.5; }
.dep-note:empty { display: none; }

.dep-steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 9px; }
/* Only the steps belonging to the current mode are shown. */
.dep-steps[data-mode="deposit"]  li[data-step="withdraw"] { display: none; }
.dep-steps[data-mode="withdraw"] li[data-step="approve"],
.dep-steps[data-mode="withdraw"] li[data-step="deposit"]  { display: none; }
.dep-steps li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--faint); }
.step-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  border: 1px solid var(--glass-line-2);
}
.dep-steps li.is-active { color: var(--text); }
.dep-steps li.is-active .step-dot { background: var(--accent); border-color: var(--accent); animation: pulse 1.3s infinite; }
.dep-steps li.is-done { color: var(--dim); }
.dep-steps li.is-done .step-dot { background: var(--accent); border-color: var(--accent); }
@keyframes pulse { 50% { opacity: .35; } }

.dep-msg { min-height: 20px; margin: 16px 0 0; font-size: 13px; color: var(--dim); }
.dep-msg.bad { color: var(--down); }

.dep-actions { display: flex; gap: 10px; margin-top: 18px; }
.dep-actions .glass-btn { flex: 1; }
.dep-fine { margin: 16px 0 0; font-size: 11.5px; color: var(--faint); line-height: 1.5; }

.dot.paper { background: var(--dim); }

/* ── Table ────────────────────────────────────────────────────────────── */

.table-section { margin-top: 56px; }
.table-card { padding: 6px 8px; border-radius: var(--r-md); overflow-x: auto; margin-top: 16px; }
.markets { width: 100%; border-collapse: collapse; font-size: 14px; }
.markets th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--faint);
  padding: 12px 14px; white-space: nowrap;
}
.markets td { padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .06); white-space: nowrap; }
.markets tbody tr { cursor: pointer; transition: background .14s; }
.markets tbody tr:hover { background: rgba(255, 255, 255, .045); }
.markets tbody tr.is-active { background: rgba(62, 233, 119, .12); }
.markets .num { text-align: right; font-variant-numeric: tabular-nums; }
.markets .m-name { display: flex; align-items: center; gap: 10px; }
.markets .m-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
                   background: var(--glass-bg-2); border: 1px solid var(--glass-line); }
.markets .m-icon svg { width: 17px; height: 17px; }
.markets .m-icon .mono { font: 700 10px var(--sans); }
.markets .m-sub { font: 11px var(--mono); color: var(--faint); }
.up-txt { color: var(--up); } .down-txt { color: var(--down); }
.live-tag { color: var(--up); font-size: 12px; font-weight: 600; }

/* ── Activity tabs ────────────────────────────────────────────────────── */

.tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: 16px 0 0;
}
.tab {
  border: 1px solid var(--glass-line); border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: var(--dim); font-size: 13px;
  padding: 7px 15px; cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.tab.is-active {
  color: var(--accent); border-color: rgba(62, 233, 119, .4);
  background: rgba(62, 233, 119, .10);
}
.tab-note { margin: 12px 0 0; font-size: 12.5px; color: var(--faint); }

.scope-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); cursor: pointer; }
.scope-toggle input { accent-color: var(--accent); width: 15px; height: 15px; }

.activity-table { font-size: 13px; }
.activity-table th, .activity-table td { padding: 10px 13px; }

.table-empty {
  margin: 0; padding: 34px 16px; text-align: center;
  color: var(--faint); font-size: 13.5px;
}

.tag {
  font: 600 10.5px var(--sans); text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--glass-line-2); color: var(--dim);
}
.tag-filled, .tag-approve, .tag-approved, .tag-match, .tag-ok {
  color: var(--accent); border-color: rgba(62, 233, 119, .4); background: rgba(62, 233, 119, .08);
}
.tag-rejected, .tag-reject, .tag-failed, .tag-mismatch, .tag-cancelled {
  color: var(--down); border-color: rgba(255, 95, 109, .4); background: rgba(255, 95, 109, .08);
}
.tag-open, .tag-pending, .tag-partial, .tag-reduced {
  color: #ffd9a3; border-color: rgba(255, 176, 74, .32); background: rgba(255, 176, 74, .1);
}

/* Wallet-scoped tab: visually separated so it reads as "yours", not the vault's. */
.tab-wallet { margin-left: auto; }
.tab-wallet.is-active { color: var(--accent-2); }
.scope-toggle[hidden] { display: none; }

.txlink { color: var(--accent); font-family: var(--mono); font-size: 12px; text-decoration: none; }
.txlink:hover { text-decoration: underline; }
.mono-sm { font-family: var(--mono); font-size: 12px; color: var(--dim); }

.chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.chips i {
  font-style: normal; font-size: 11px;
  padding: 2px 7px; border-radius: 6px;
  background: rgba(255, 255, 255, .06); color: var(--dim);
}

.foot {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 56px; padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  font-size: 13px; color: var(--dim);
}
.dim { color: var(--faint); }

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 940px) {
  .detail { grid-template-columns: 1fr; }
  .nav { display: none; }
}
@media (max-width: 620px) {
  :root { --item-w: 104px; }
  .icon-ring { width: 66px; height: 66px; }
  .icon-ring svg { width: 32px; height: 32px; }
  .rail-arrow { display: none; }
  .hide-sm { display: none; }
  .hint { display: none; }
  .brand span { font-size: 15px; }
  .topbar { gap: 12px; }
  .topbar-right { gap: 8px; }
  .glass-btn { font-size: 13px; padding: 8px 13px; }
  .stat-pair { grid-template-columns: 1fr; }
}
/* Below ~400px the mode pill is the first thing that can go. */
@media (max-width: 400px) {
  #modePill { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
