:root {
  --bg: #000;
  --card: #0c0912;
  --line: #22182e;
  --text: #f6f3ff;
  --muted: #9b8fb0;
  --dim: #6b5f80;
  --accent: #8b5cf6;
  --accent-2: #c084fc;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.brand img { width: 28px; height: 28px; }
.nav a, .nav-soon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #cfc4e4;
  margin-bottom: 2px;
}
.nav a:hover, .nav a.active {
  background: #161022;
  color: #fff;
}
.nav a.active { box-shadow: inset 0 0 0 1px #2a1d40; }
.nav svg, .nav-soon svg { width: 18px; height: 18px; opacity: 0.85; }
.nav-soon { color: var(--dim); cursor: default; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(0,0,0,0.86);
  backdrop-filter: blur(12px);
  z-index: 5;
}
.top-note {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
.live {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.live[data-state="live"] { color: #c4f5c8; border-color: #2a4a30; }
.live[data-state="err"] { color: #f5c4e0; border-color: #4a2038; }
.live[data-state="live"]::before,
.live[data-state="connecting"]::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  background: currentColor;
  animation: pulse 1.4s ease-in-out infinite;
}
.live[data-state="live"]::before { background: #7dff9a; }
.top-left, .top-actions { display: flex; align-items: center; gap: 10px; }
.mobile-brand {
  display: none;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.mobile-brand img { width: 22px; height: 22px; }
.btn {
  border: 1px solid var(--line);
  background: #110d18;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
}
.btn:hover { background: #1a1426; }
.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-accent:hover { background: #7c4fe8; }

.page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}
.page-home {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px 80px;
  max-width: none;
}
.promo { width: min(980px, 100%); margin: 0 auto; }
.hero {
  text-align: center;
  width: min(760px, 100%);
  margin: 0 auto 40px;
}
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(40px, 5.8vw, 68px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.98;
}
.hero p {
  margin: 18px auto 0;
  max-width: 540px;
  color: var(--muted);
  font-size: 16px;
}
.hero p a { color: #fff; border-bottom: 1px solid #3a2a55; }

.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 0 36px;
}
.strip div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 16px;
  background: var(--card);
}
.strip b {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-2);
  margin-bottom: 6px;
}
.strip span { font-size: 14px; }

.board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.board-head h2 { margin-bottom: 4px; }
.board-head .muted { max-width: 560px; }
.count {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--accent-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

.pair-list { display: grid; gap: 10px; }
.tcard {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  min-height: 88px;
  animation: cardIn 0.5s ease both;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.tcard:hover {
  border-color: #3d2a5c;
  background: #100c18;
  transform: translateY(-2px);
}
.tcard-skel {
  animation: shimmer 1.2s ease-in-out infinite;
  background: linear-gradient(90deg, #0c0912 0%, #1a1228 50%, #0c0912 100%);
  background-size: 200% 100%;
  pointer-events: none;
}
.loading-cards { display: grid; gap: 10px; }
.tcard-av {
  position: relative;
  width: 56px;
  height: 56px;
}
.tcard-av > img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a1226;
}
.tcard-quote {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 22px !important;
  height: 22px !important;
  border-radius: 50%;
  border: 2px solid #000;
  background: #1a1226;
}
.tcard-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tcard-title b { font-size: 16px; letter-spacing: -0.03em; }
.tcard-title span { color: var(--muted); font-size: 13px; }
.tcard-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.tcard-pair img {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: cover;
}
.tcard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.tcard-meta span {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
}
.tcard-stats {
  text-align: right;
  font-family: var(--sans);
  font-size: 13px;
  display: grid;
  gap: 6px;
}
.tcard-stats em {
  display: block;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--dim);
}
.tcard-stats b { font-weight: 500; }
.empty, .loading, .error {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
}
.error { color: #e8a0ff; }

.muted { color: var(--muted); }
.dim { color: var(--dim); }
h2 { font-size: 28px; letter-spacing: -0.04em; margin-bottom: 10px; }
h3 { font-size: 18px; letter-spacing: -0.03em; }

.docs-page .page { max-width: 1100px; }
.docs-head { margin-bottom: 36px; }
.docs-head h1 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 10px;
}
.docs-head p { color: var(--muted); max-width: 680px; font-size: 14px; }
.docs-wrap { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc {
  position: sticky;
  top: 84px;
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.35;
}
.toc .toc-label {
  color: var(--dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.toc a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  color: #8d7ea8;
  padding: 6px 0;
  border-left: 1px solid #2a1d40;
  padding-left: 12px;
}
.toc a:hover, .toc a:focus { color: #fff; }
.toc a span { color: #4a3d60; }
.doc { font-size: 14.5px; }
.doc section { padding: 28px 0 8px; border-top: 1px solid #1a1226; }
.doc section:first-child { border-top: 0; padding-top: 0; }
.doc h2 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 14px;
  color: #fff;
}
.doc p, .doc li { color: #c4b7d8; margin: 10px 0; }
.doc a { color: #fff; border-bottom: 1px solid #3a2a55; }
.spec {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 18px;
  font-size: 13px;
}
.spec th, .spec td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border: 1px solid #2a1d40;
}
.spec th {
  width: 168px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a8ab4;
  background: #0a0710;
}
.spec td { color: #d8ceea; }
.ol-spec { list-style: none; padding: 0; margin: 14px 0; }
.ol-spec li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #1a1226;
  margin: 0;
}
.ol-spec li:last-child { border-bottom: 0; }
.ol-spec b { font-family: var(--sans); font-size: 11px; font-weight: 500; color: var(--accent-2); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (max-width: 980px) {
  .sidebar { display: none; }
  .mobile-brand { display: flex; }
  .strip, .docs-wrap, .tcard { grid-template-columns: 1fr; }
  .tcard-stats { text-align: left; grid-template-columns: repeat(2, auto); justify-content: start; gap: 16px; }
  .page { padding: 28px 18px 60px; }
  .top-note { display: none; }
}
