/* ─────────────────────────────────────────────────────────────
   B20Fold — design tokens + components
   Dark, premium, financial. One warm accent (amber) for the fold.
   ───────────────────────────────────────────────────────────── */
:root {
  /* type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.5rem);

  /* spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* surfaces — near-black with a cool cast */
  --color-bg: #0b0d10;
  --color-surface: #10131a;
  --color-surface-2: #151922;
  --color-surface-offset: #1a1f29;
  --color-surface-dynamic: #222836;
  --color-divider: rgb(255 255 255 / 0.06);
  --color-border: rgb(255 255 255 / 0.1);
  --color-border-strong: rgb(255 255 255 / 0.18);

  /* text — cool slate */
  --color-text: #e7eaf0;
  --color-text-muted: #8f98a8;
  --color-text-faint: #5c6473;
  --color-text-inverse: #0b0d10;

  /* accent — amber/gold, the "fold" */
  --color-accent: #e9b44c;
  --color-accent-hover: #f2c46a;
  --color-accent-active: #d9a233;
  --color-accent-soft: rgb(233 180 76 / 0.12);
  --color-accent-line: rgb(233 180 76 / 0.35);

  /* semantic */
  --color-success: #62b88a;
  --color-success-soft: rgb(98 184 138 / 0.12);
  --color-error: #e0716e;
  --color-error-soft: rgb(224 113 110 / 0.12);
  --color-info: #7fa6d9;
  --color-info-soft: rgb(127 166 217 / 0.12);

  /* radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 8px 24px rgb(0 0 0 / 0.45);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / 0.55);

  --content-narrow: 680px;
  --content-default: 1040px;
  --content-wide: 1200px;

  --font-display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Geist', 'Inter Tight', 'Helvetica Neue', sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ───────── layout ───────── */
.container {
  width: min(100% - 2 * var(--space-5), var(--content-wide));
  margin-inline: auto;
}
.container--narrow {
  width: min(100% - 2 * var(--space-5), var(--content-narrow));
}
.container--default {
  width: min(100% - 2 * var(--space-5), var(--content-default));
}
main {
  padding-block: clamp(var(--space-8), 5vw, var(--space-16));
}
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: var(--color-text-inverse);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.skip-link:focus {
  top: var(--space-4);
}

.num,
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.01em;
}
.tabular {
  font-variant-numeric: tabular-nums lining-nums;
}
.muted {
  color: var(--color-text-muted);
}
.faint {
  color: var(--color-text-faint);
}
.accent {
  color: var(--color-accent);
}
.pos {
  color: var(--color-success);
}
.neg {
  color: var(--color-error);
}
.small {
  font-size: var(--text-sm);
}
.xs {
  font-size: var(--text-xs);
}
.right {
  text-align: right;
}
.nowrap {
  white-space: nowrap;
}
.hide {
  display: none !important;
}

/* ───────── header ───────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--color-bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--color-divider);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  letter-spacing: -0.01em;
  font-size: var(--text-base);
}
.brand svg {
  width: 28px;
  height: 28px;
  color: var(--color-accent);
}
.brand__name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0;
  color: var(--color-text);
}
.brand__name b {
  font-weight: 400;
  color: var(--color-accent);
}
.site-nav {
  display: none;
  gap: var(--space-1);
  margin-left: var(--space-2);
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}
.site-nav a:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}
.site-nav a[aria-current='page'] {
  color: var(--color-text);
}
.site-nav a[aria-current='page']::after {
  content: '';
  display: block;
  position: absolute;
  inset-inline: var(--space-3);
  bottom: -14px;
  height: 1px;
  background: var(--color-accent);
}
.site-nav a {
  position: relative;
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.net-pill {
  display: none;
  align-items: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}
.net-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-text-faint);
}
.net-pill[data-state='ok'] .dot {
  background: var(--color-success);
  box-shadow: 0 0 0 3px var(--color-success-soft);
}
.net-pill[data-state='err'] .dot {
  background: var(--color-error);
}
.net-pill[data-state='dev'] {
  border-color: var(--color-accent-line);
  color: var(--color-accent);
}
.net-pill[data-state='dev'] .dot {
  background: var(--color-accent);
}
.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
}
.menu-btn:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}
.mobile-nav {
  display: none;
  border-top: 1px solid var(--color-divider);
  background: var(--color-bg);
}
.mobile-nav[data-open='true'] {
  display: block;
}
.mobile-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 var(--space-1);
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-sm);
}
.mobile-nav a[aria-current='page'] {
  color: var(--color-accent);
}
.mobile-nav .container {
  padding-block: var(--space-2);
}
.mobile-nav .net-pill {
  display: inline-flex;
  margin: var(--space-3) 0 var(--space-2);
}
@media (min-width: 900px) {
  .site-nav {
    display: flex;
  }
  .net-pill {
    display: inline-flex;
  }
  .menu-btn {
    display: none;
  }
  .mobile-nav {
    display: none !important;
  }
}

/* ───────── buttons ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1;
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
}
.btn-primary:active:not(:disabled) {
  background: var(--color-accent-active);
}
.btn-outline {
  border-color: var(--color-border-strong);
  color: var(--color-text);
  background: transparent;
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--color-accent-line);
  background: var(--color-surface-2);
}
.btn-ghost {
  color: var(--color-text-muted);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--color-text);
  background: var(--color-surface-2);
}
.btn-danger {
  border-color: rgb(224 113 110 / 0.35);
  color: var(--color-error);
}
.btn-danger:hover:not(:disabled) {
  background: var(--color-error-soft);
}
.btn-sm {
  min-height: 36px;
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
}
.btn-block {
  width: 100%;
}
.btn .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.wallet-btn .addr {
  font-family: var(--font-mono);
  font-weight: 400;
}
.wallet-btn .avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), #7a5a1c);
}

/* ───────── badges ───────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  white-space: nowrap;
  line-height: 1;
}
.badge--accent {
  border-color: var(--color-accent-line);
  color: var(--color-accent);
  background: var(--color-accent-soft);
}
.badge--ok {
  border-color: rgb(98 184 138 / 0.35);
  color: var(--color-success);
  background: var(--color-success-soft);
}
.badge--err {
  border-color: rgb(224 113 110 / 0.35);
  color: var(--color-error);
  background: var(--color-error-soft);
}
.badge--info {
  border-color: rgb(127 166 217 / 0.35);
  color: var(--color-info);
  background: var(--color-info-soft);
}
.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ───────── cards & panels ───────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-divider);
}
.card__head h2,
.card__head h3 {
  font-size: var(--text-base);
  font-weight: 500;
}
.card__body {
  padding: var(--space-5);
}
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
}
.page-head p {
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

/* KPI */
.kpis {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
}
.kpi {
  padding: var(--space-5);
  border-bottom: 1px solid var(--color-divider);
}
.kpi:last-child {
  border-bottom: 0;
}
.kpi__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.kpi__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-xl);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--color-text);
}
.kpi__sub {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
@media (min-width: 700px) {
  .kpis {
    grid-template-columns: repeat(3, 1fr);
  }
  .kpi {
    border-bottom: 0;
    border-right: 1px solid var(--color-divider);
  }
  .kpi:last-child {
    border-right: 0;
  }
}
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--color-divider);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat {
  background: var(--color-surface);
  padding: var(--space-4) var(--space-5);
}
.stat__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}
.stat__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.stat__sub {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-1);
}
@media (min-width: 900px) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ───────── tables ───────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.table {
  min-width: 720px;
  font-size: var(--text-sm);
}
.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}
.table th {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}
.table td {
  border-bottom: 1px solid var(--color-divider);
  font-variant-numeric: tabular-nums;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table .num {
  text-align: right;
}
.table th.num {
  text-align: right;
}
.table tbody tr.row-link {
  cursor: pointer;
}
.table tbody tr.row-link:hover td {
  background: var(--color-surface-2);
}
.table tbody tr.row-link:focus-within td {
  background: var(--color-surface-2);
}
.pair {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.pair__icons {
  display: flex;
}
.coin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  background: var(--color-surface-dynamic);
  color: var(--color-text);
  border: 2px solid var(--color-surface);
  font-family: var(--font-mono);
}
.coin + .coin {
  margin-left: -8px;
}
.coin--usdc {
  background: #2775ca;
  color: #fff;
}
.coin--weth {
  background: #4d5468;
  color: #fff;
}
.coin--fold {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}
.coin--stock {
  background: #1f4d3f;
  color: #cfeee0;
}
.pair__label {
  font-weight: 500;
  color: var(--color-text);
}
.pair__label a {
  text-decoration: none;
  color: inherit;
}
.pair__sub {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* kv list */
.kv {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.kv > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-sm);
}
.kv > div:last-child {
  border-bottom: 0;
}
.kv dt {
  color: var(--color-text-muted);
}
.kv dd {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* address chip */
.addr-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.addr-chip a {
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px dotted var(--color-border-strong);
}
.addr-chip a:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent-line);
}
.copy-btn {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-faint);
}
.copy-btn:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}
.copy-btn[data-copied='true'] {
  color: var(--color-success);
}
.copy-btn svg {
  width: 14px;
  height: 14px;
}

/* ───────── forms ───────── */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.field label,
.field .label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}
.field label button {
  color: var(--color-accent);
  font-size: var(--text-xs);
}
.input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.input:focus-within {
  border-color: var(--color-accent-line);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}
.input input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}
.input input::placeholder {
  color: var(--color-text-faint);
}
.input .unit {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}
.seg button {
  min-height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.seg button[aria-pressed='true'] {
  background: var(--color-surface-dynamic);
  color: var(--color-text);
}
.preview {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.preview > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}
.preview dt {
  color: var(--color-text-muted);
}
.preview dd {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
input[type='range'] {
  width: 100%;
  accent-color: var(--color-accent);
  height: 32px;
}
.notice {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--color-surface-2);
}
.notice--warn {
  border-color: var(--color-accent-line);
  background: var(--color-accent-soft);
  color: var(--color-text);
}
.notice--err {
  border-color: rgb(224 113 110 / 0.35);
  background: var(--color-error-soft);
  color: var(--color-text);
}
.notice svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-divider);
  padding: 0 var(--space-5);
}
.tabs button {
  position: relative;
  min-height: 48px;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.tabs button[aria-selected='true'] {
  color: var(--color-text);
}
.tabs button[aria-selected='true']::after {
  content: '';
  position: absolute;
  inset-inline: var(--space-3);
  bottom: -1px;
  height: 1px;
  background: var(--color-accent);
}

/* ───────── skeletons / states ───────── */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
.skeleton {
  display: block;
  background: linear-gradient(90deg, var(--color-surface-offset) 25%, var(--color-surface-dynamic) 50%, var(--color-surface-offset) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  height: 1em;
  color: transparent !important;
}
.skeleton.w-40 {
  width: 40%;
}
.skeleton.w-60 {
  width: 60%;
}
.skeleton.w-80 {
  width: 80%;
}
.skeleton.lg {
  height: 1.6em;
}
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--color-text-muted);
  gap: var(--space-3);
}
.state svg {
  width: 44px;
  height: 44px;
  color: var(--color-text-faint);
  margin-bottom: var(--space-2);
}
.state h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-lg);
  color: var(--color-text);
}
.state p {
  max-width: 40ch;
  font-size: var(--text-sm);
}
.state--error svg {
  color: var(--color-error);
}
.state .mono {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  max-width: 60ch;
  overflow-wrap: anywhere;
}

/* ───────── toasts ───────── */
.toasts {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  left: var(--space-4);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}
@media (min-width: 600px) {
  .toasts {
    left: auto;
    width: 380px;
  }
}
.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  animation: toast-in 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast[data-leaving='true'] {
  animation: toast-out 200ms ease forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}
.toast__icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.toast--pending .toast__icon {
  border: 2px solid var(--color-accent);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.toast--success .toast__icon {
  color: var(--color-success);
}
.toast--error .toast__icon {
  color: var(--color-error);
}
.toast__title {
  font-weight: 500;
  color: var(--color-text);
}
.toast__msg {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.toast__msg a {
  color: var(--color-accent);
}
.toast__close {
  color: var(--color-text-faint);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  margin: -4px -6px 0 0;
}
.toast__close:hover {
  color: var(--color-text);
  background: var(--color-surface-dynamic);
}

/* ───────── distribution bars ───────── */
.dist {
  display: grid;
  gap: var(--space-3);
}
.dist__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-1);
  font-size: var(--text-xs);
}
.dist__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.dist__track {
  position: relative;
  height: 10px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dist__fill {
  position: absolute;
  inset-block: 0;
  background: var(--color-accent);
  opacity: 0.85;
  border-radius: var(--radius-sm);
}
.dist__marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--color-text);
}
.dist__axis {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}
.dist__legend {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.dist__legend span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
  background: var(--color-accent);
}
.dist__legend span.cur::before {
  background: var(--color-text);
  width: 2px;
  border-radius: 0;
}

/* ───────── landing ───────── */
.hero {
  position: relative;
  padding-block: clamp(var(--space-12), 8vw, var(--space-24)) clamp(var(--space-10), 6vw, var(--space-16));
  border-bottom: 1px solid var(--color-divider);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 60%, var(--color-bg)),
    repeating-linear-gradient(90deg, var(--color-divider) 0 1px, transparent 1px 120px),
    repeating-linear-gradient(0deg, var(--color-divider) 0 1px, transparent 1px 120px);
  mask-image: radial-gradient(ellipse at 30% 20%, black 20%, transparent 70%);
  pointer-events: none;
}
.hero .container {
  position: relative;
  display: grid;
  gap: var(--space-10);
}
.hero__copy {
  max-width: 720px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin-top: var(--space-4);
}
.hero h1 em {
  font-style: italic;
  color: var(--color-accent);
}
.hero p {
  margin-top: var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--text-base);
  max-width: 56ch;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}
.hero__mark {
  display: none;
}
@media (min-width: 900px) {
  .hero .container {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
  }
  .hero__mark {
    display: block;
    justify-self: end;
    width: min(100%, 340px);
    color: var(--color-accent);
    opacity: 0.9;
  }
}
.kpi-band {
  margin-top: var(--space-10);
}
.steps {
  display: grid;
  gap: var(--space-4);
  counter-reset: step;
}
.step {
  position: relative;
  padding: var(--space-6) var(--space-5) var(--space-6) var(--space-12);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: var(--space-5);
  top: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-accent);
}
.step h3 {
  font-size: var(--text-base);
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.step p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
@media (min-width: 900px) {
  .steps {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
  .step:first-child {
    background: linear-gradient(160deg, var(--color-surface) 0%, var(--color-surface-2) 100%);
  }
}
.section {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
}
.section + .section {
  border-top: 1px solid var(--color-divider);
}
.section--tight {
  padding-block: clamp(var(--space-8), 4vw, var(--space-12));
}
.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-8);
  border: 1px solid var(--color-accent-line);
  border-radius: var(--radius-xl);
  background: linear-gradient(120deg, var(--color-accent-soft), transparent 60%);
}
.cta-band h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-xl);
}
.cta-band p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}
.pool-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
.two-col {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .two-col {
    grid-template-columns: 1.3fr 1fr;
    align-items: start;
  }
}
.three-col {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .three-col {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ───────── prose (docs / contracts) ───────── */
.prose {
  font-size: var(--text-base);
}
.prose h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-xl);
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-divider);
}
.prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.prose h3 {
  font-size: var(--text-base);
  font-weight: 500;
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}
.prose p,
.prose li {
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  max-width: 68ch;
}
.prose li {
  margin-bottom: var(--space-2);
}
.prose ul,
.prose ol {
  padding-left: var(--space-5);
  margin-bottom: var(--space-4);
}
.prose a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid var(--color-accent-line);
}
.prose a:hover {
  border-bottom-color: var(--color-accent);
}
.prose strong {
  color: var(--color-text);
  font-weight: 500;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--color-text);
  background: var(--color-surface-2);
  padding: 1px 6px;
  border-radius: 4px;
}
.prose table {
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}
.prose th,
.prose td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-divider);
}
.prose th {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-faint);
  font-weight: 500;
}
.prose td {
  color: var(--color-text-muted);
}
.prose td:first-child {
  color: var(--color-text);
}
.faq details {
  border-bottom: 1px solid var(--color-divider);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: var(--space-4) 0;
  font-weight: 500;
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  color: var(--color-accent);
  font-family: var(--font-mono);
}
.faq details[open] summary::after {
  content: '−';
}
.faq details p {
  padding-bottom: var(--space-4);
}
.toc {
  position: sticky;
  top: 88px;
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
}
.toc a {
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-1) 0;
}
.toc a:hover {
  color: var(--color-text);
}
.docs-layout {
  display: grid;
  gap: var(--space-8);
}
@media (min-width: 900px) {
  .docs-layout {
    grid-template-columns: 200px 1fr;
  }
  .toc {
    display: flex;
  }
}

/* contracts */
.addr-table td:first-child {
  color: var(--color-text);
  font-weight: 500;
}
.flags {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--color-divider);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (min-width: 700px) {
  .flags {
    grid-template-columns: repeat(2, 1fr);
  }
}
.flag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
}
.flag[data-on='true'] {
  color: var(--color-text);
}
.flag[data-on='false'] {
  color: var(--color-text-faint);
}

/* ───────── footer ───────── */
.site-footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-12) var(--space-8);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.site-footer .container {
  display: grid;
  gap: var(--space-8);
}
.footer__brand p {
  margin-top: var(--space-3);
  max-width: 34ch;
  font-size: var(--text-sm);
}
.footer__cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
.footer__cols h4 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  font-weight: 500;
  margin-bottom: var(--space-3);
}
.footer__cols a {
  display: block;
  padding: var(--space-1) 0;
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer__cols a:hover {
  color: var(--color-text);
}
.footer__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.footer__meta .mono {
  font-size: var(--text-xs);
}
@media (min-width: 900px) {
  .site-footer .container {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
  .footer__meta {
    grid-column: 1 / -1;
  }
  .footer__cols {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* utilities */
.stack > * + * {
  margin-top: var(--space-4);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.grow {
  flex: 1;
}
.mt-2 {
  margin-top: var(--space-2);
}
.mt-4 {
  margin-top: var(--space-4);
}
.mt-6 {
  margin-top: var(--space-6);
}
.mt-8 {
  margin-top: var(--space-8);
}
.mb-4 {
  margin-bottom: var(--space-4);
}
.mb-6 {
  margin-bottom: var(--space-6);
}
[hidden] {
  display: none !important;
}

/* ───────── contracts / stake additions ───────── */
.stack--lg > * + * {
  margin-top: var(--space-8);
}
.sec-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .sec-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1100px) {
  .sec-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.sec-grid .notice {
  flex-direction: column;
  gap: var(--space-2);
  color: var(--color-text-muted);
}
.sec-grid .notice b {
  color: var(--color-text);
  font-weight: 500;
}
.kv dd.text {
  font-family: var(--font-sans);
  font-variant-numeric: normal;
  color: var(--color-text-muted);
  max-width: 60%;
}
.card .table-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.card .table {
  min-width: 560px;
}
.btn-wrap {
  flex-wrap: wrap;
  gap: var(--space-2);
}
@media (min-width: 900px) {
  .stats--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* grid children must be allowed to shrink so wide tables scroll inside .table-wrap instead of widening the page */
.docs-layout > * {
  min-width: 0;
}
.addr-table .role {
  white-space: normal;
  min-width: 26ch;
  max-width: 40ch;
  line-height: 1.4;
}
.kv dd {
  flex-shrink: 0;
}
.kv dd .addr-chip {
  white-space: nowrap;
}

.prose .table-scroll {
  overflow-x: auto;
  margin-bottom: var(--space-6);
}
.prose .table-scroll table {
  min-width: 480px;
  margin-bottom: 0;
}
