@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #090b10;
  --bg-2: #10131b;
  --elev: rgba(255, 255, 255, 0.028);
  --elev-2: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1f7;
  --muted: #a3adbf;
  --faint: #737d90;
  --indigo: #8b7cff;
  --indigo-2: #6366f1;
  --cyan: #3ee0c5;
  --amber: #f5c16c;
  --rose: #fb7185;
  --green: #4ade80;
  --violet: #c4b5fd;
  --grad: linear-gradient(120deg, #6366f1 0%, #8b5cf6 46%, #22d3ee 100%);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  --font: Manrope, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --top: 64px;
  --side: 276px;
  --toc: 210px;
  --radius: 16px;
  color-scheme: dark;
  --accent-rgb: 34, 211, 238;
  --accent: rgb(var(--accent-rgb));
}
[data-section="start-here"] { --accent-rgb: 74, 222, 128; }
[data-section="tradingview"] { --accent-rgb: 226, 232, 240; }
[data-section="webapp"] { --accent-rgb: 139, 92, 246; }
[data-section="api"] { --accent-rgb: 251, 191, 36; }
[data-section="discord"] { --accent-rgb: 88, 101, 242; }
[data-section="learn"] { --accent-rgb: 244, 114, 182; }
[data-section="support"] { --accent-rgb: 248, 113, 113; }
body[data-section] { --accent: rgb(var(--accent-rgb)); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 92% -12%, rgba(var(--accent-rgb), 0.13), transparent 58%),
    radial-gradient(900px 420px at -10% 0%, rgba(99, 102, 241, 0.16), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
}
body::after {
  content: attr(data-section-label);
  position: fixed;
  right: 0.9rem;
  bottom: 1.4rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 6.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(var(--accent-rgb), 0.13);
  pointer-events: none;
  user-select: none;
  z-index: -1;
}
a { color: #d6d2ff; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: white; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
::selection { background: rgba(99, 102, 241, 0.45); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.1rem;
  background: rgba(9, 11, 16, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.75) 30%, rgba(var(--accent-rgb), 0.75) 70%, transparent);
  pointer-events: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: white;
  text-decoration: none;
  min-width: max-content;
}
.brand-logo { display: block; width: 44px; height: 44px; }
.topnav { display: flex; gap: 0.15rem; min-width: 0; flex: 1; overflow: auto; }
.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 650;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.topnav a:hover { color: white; background: rgba(255,255,255,0.04); }
.topnav a.on { color: white; background: rgba(var(--accent-rgb), 0.16); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35); }
.search-wrap { margin-left: auto; position: relative; width: min(320px, 34vw); }
.search-wrap input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: white;
  border-radius: 999px;
  padding: 0.48rem 0.9rem 0.48rem 2.2rem;
  font: inherit;
  font-size: 0.88rem;
}
.search-wrap input::placeholder { color: var(--faint); }
.search-wrap svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); opacity: 0.6; }
.search-hits {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(420px, 80vw);
  background: #161a24;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  max-height: 420px;
  overflow: auto;
  padding: 0.35rem;
}
.search-hits.open { display: block; }
.search-hits a {
  display: block;
  text-decoration: none;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
}
.search-hits a:hover, .search-hits a.active { background: rgba(99,102,241,0.16); }
.search-hits small { display: block; color: var(--faint); font-size: 0.75rem; }
.top-actions { display: flex; align-items: center; gap: 0.35rem; flex: none; }
.top-link, .top-trial { text-decoration: none; white-space: nowrap; border-radius: 999px; }
.top-link {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.55rem;
}
.top-link:hover { color: white; background: rgba(255,255,255,0.04); }
.top-trial {
  display: inline-block;
  color: #0b1020;
  background: var(--grad);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.42rem 0.75rem;
}
.top-trial:hover { color: #0b1020; filter: brightness(1.08); }
.side-actions { display: none; margin: 0 0 0.85rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.side-actions a { font-size: 0.88rem; }
.side-trial { color: #0b1020 !important; background: var(--grad); text-align: center; }
.trial-box {
  margin-top: 2rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
}
.trial-box p { margin: 0 0 0.7rem; color: var(--muted); font-size: 0.92rem; }
.trial-box strong { color: var(--text); }
.menu-btn, .toc-btn {
  display: none;
  border: 1px solid var(--line);
  background: transparent;
  color: white;
  border-radius: 10px;
  padding: 0.4rem 0.65rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
}

.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.sidebar {
  position: sticky;
  top: var(--top);
  height: calc(100vh - var(--top));
  overflow: auto;
  padding: 1.15rem 0.85rem 2rem;
  border-right: 1px solid var(--line);
  background: rgba(8, 10, 15, 0.45);
}
.sidebar a.side-section {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0.45rem 0.7rem;
  margin-top: 0.1rem;
}
.sidebar a.side-section.open { color: white; background: rgba(var(--accent-rgb), 0.14); border-left-color: var(--accent); }
.side-pages { margin: 0.2rem 0 0.9rem 0.55rem; padding-left: 0.35rem; border-left: 1px solid rgba(var(--accent-rgb), 0.28); }
.sidebar a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.32rem 0.7rem;
  border-radius: 8px;
  border-left: 2px solid transparent;
}
.sidebar a:hover { color: white; background: rgba(255,255,255,0.03); }
.sidebar a.on { color: white; background: rgba(var(--accent-rgb), 0.1); border-left-color: var(--accent); }
.group-label {
  margin: 0.95rem 0.7rem 0.28rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  cursor: default;
  pointer-events: none;
}
.side-pages .group-label:first-child { margin-top: 0.35rem; }

.main { min-width: 0; display: grid; grid-template-columns: minmax(0, 860px) var(--toc); gap: 1.5rem; justify-content: center; padding: 1.6rem 1.6rem 4rem; }
.article { min-width: 0; }
.toc { position: sticky; top: calc(var(--top) + 1.2rem); align-self: start; padding-top: 0.4rem; }
.toc p { margin: 0 0 0.4rem; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.toc a { display: block; text-decoration: none; color: var(--faint); font-size: 0.8rem; line-height: 1.35; padding: 0.22rem 0 0.22rem 0.7rem; border-left: 1px solid var(--line); }
.toc a.h3 { padding-left: 1.15rem; }
.toc a:hover, .toc a.on { color: white; border-left-color: var(--accent); }

.crumbs { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; color: var(--faint); font-size: 0.82rem; margin: 0 0 0.85rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: white; }
.crumbs [aria-current="page"] { color: var(--text); }
.kicker { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.14); }
h1 { font-size: clamp(2rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: -0.035em; margin: 0.35rem 0 0.7rem; }
.lede { font-size: 1.08rem; color: var(--muted); margin: 0 0 1.3rem; max-width: 68ch; }
h2 { font-size: 1.45rem; letter-spacing: -0.03em; margin: 2.2rem 0 0.7rem; scroll-margin-top: 84px; }
h3 { font-size: 1.08rem; margin: 1.5rem 0 0.45rem; scroll-margin-top: 84px; }
p { margin: 0.55rem 0 0.8rem; }
.article ul, .article ol { margin: 0.4rem 0 1rem; padding-left: 1.2rem; }
.article li { margin: 0.28rem 0; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
p code, li code, td code {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.22);
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  color: #ddd8ff;
}
p code, li code { overflow-wrap: anywhere; }
.article code.lv {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.22);
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  color: #ddd8ff;
  font-family: var(--mono);
  font-size: 0.86em;
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  overflow-wrap: normal;
}
.article h1 code.lv { font-size: 0.48em; }
.article h2 code.lv { font-size: 0.68em; }
.article h3 code.lv { font-size: 0.8em; }
.article a code.lv,
.article strong code.lv { color: #ddd8ff; text-decoration: none; }

.hero-grid, .card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin: 1rem 0 1.4rem; }
.card-grid.card-grid--2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card, .callout, .endpoint-head, .ident {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card { padding: 1rem 1.05rem 1.05rem; text-decoration: none; color: inherit; display: block; transition: transform .18s ease, border-color .18s ease; }
.card:hover { transform: translateY(-3px); border-color: rgba(139, 124, 255, 0.55); color: inherit; }
.card strong { display: block; margin-bottom: 0.25rem; }
.card span { color: var(--muted); font-size: 0.92rem; }
.card em { font-style: normal; color: var(--accent); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

.api-intro-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
  margin: 1.25rem 0 1.55rem;
}
.api-intro-card {
  --api-accent: #38bdf8;
  --api-tint: 56, 189, 248;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.15rem 1.15rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--api-accent);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(var(--api-tint), 0.16), transparent 72%),
    linear-gradient(155deg, #182032, #101624);
  color: var(--text);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.api-intro-card--cyan { --api-accent: #38bdf8; --api-tint: 56, 189, 248; }
.api-intro-card--violet { --api-accent: #a78bfa; --api-tint: 167, 139, 250; }
.api-intro-card--gold { --api-accent: #f5c16c; --api-tint: 245, 193, 108; }
.api-intro-card:hover {
  transform: translateY(-3px);
  border-color: var(--api-accent);
  box-shadow: 0 14px 28px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(var(--api-tint), 0.2);
  color: #fff;
}
.api-intro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.api-intro-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(var(--api-tint), 0.13);
  border: 1px solid rgba(var(--api-tint), 0.35);
  color: var(--api-accent);
}
.api-intro-icon svg { width: 20px; height: 20px; }
.api-intro-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--api-accent);
  background: rgba(var(--api-tint), 0.1);
  border: 1px solid rgba(var(--api-tint), 0.28);
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
}
.api-intro-card strong {
  display: block;
  font-size: 1.08rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #f8fafc;
  margin-bottom: 0.35rem;
}
.api-intro-route {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: #cbd5e1;
  background: rgba(9, 13, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.12rem 0.48rem;
  margin-bottom: 0.65rem;
}
.api-intro-desc {
  flex: 1;
  color: #b4bfd3;
  font-size: 0.86rem;
  line-height: 1.58;
  margin-bottom: 0.95rem;
}
.api-intro-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--api-accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.api-intro-cta svg { width: 16px; height: 16px; transition: transform 0.18s ease; }
.api-intro-card:hover .api-intro-cta svg { transform: translateX(3px); }
.api-arch-diagram {
  padding: 0.95rem 0.95rem 0.55rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border-color: rgba(255, 255, 255, 0.1);
}
@media (max-width: 820px) {
  .api-intro-cards { grid-template-columns: 1fr; }
}

.callout { padding: 0.9rem 1rem; margin: 1rem 0; }
.callout .ct { font-weight: 800; margin-bottom: 0.2rem; }
.callout.help { border-color: rgba(99, 102, 241, 0.4); background: rgba(99, 102, 241, 0.1); }
.callout.required { border-color: rgba(245, 193, 108, 0.45); background: rgba(120, 84, 20, 0.28); }
.callout.tip { border-color: rgba(62, 224, 197, 0.35); background: rgba(16, 80, 72, 0.28); }
.callout.note { border-color: rgba(196, 181, 253, 0.35); background: rgba(70, 50, 120, 0.25); }
.callout.warn { border-color: rgba(251, 113, 133, 0.4); background: rgba(120, 30, 50, 0.22); }

.endpoint {
  position: relative;
  margin: 3.2rem 0 0;
  padding: 0 1.25rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-top: 3px solid rgba(var(--accent-rgb), 0.7);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.045), rgba(255, 255, 255, 0.012) 260px);
}
.endpoint + .endpoint { margin-top: 3.6rem; }
.endpoint-bar {
  position: sticky;
  top: var(--top);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin: 0 -1.25rem 1rem;
  padding: 0.75rem 1.25rem;
  background: rgba(16, 19, 27, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) - 3px) calc(var(--radius) - 3px) 0 0;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.8);
}
.endpoint-bar h2 { margin: 0; font-size: 1.32rem; line-height: 1.2; scroll-margin-top: calc(var(--top) + 16px); }
.endpoint-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  white-space: nowrap;
}
.endpoint-route { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; }
.endpoint-route .path { font-size: 0.86rem; }
.endpoint-tool { margin-left: auto; font-size: 0.74rem; font-weight: 700; color: var(--faint); white-space: nowrap; }
.endpoint-tool code { margin-left: 0.25rem; background: rgba(var(--accent-rgb), 0.1); border: 1px solid rgba(var(--accent-rgb), 0.28); padding: 0.05rem 0.4rem; border-radius: 6px; color: var(--text); }
.endpoint h3 { padding-top: 0.9rem; border-top: 1px dashed var(--line); }
.h3-of { color: var(--faint); font-weight: 600; font-size: 0.86em; }
@media (max-width: 600px) {
  .endpoint { padding: 0 0.8rem 0.4rem; }
  .endpoint-bar { margin: 0 -0.8rem 0.9rem; padding: 0.6rem 0.8rem; }
  .endpoint-bar h2 { font-size: 1.12rem; }
  .endpoint-tool { display: none; }
}

.doc-section {
  margin: 2.6rem 0 0;
  padding: 0 1.15rem 0.5rem;
  border: 1px solid var(--line);
  border-left: 3px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.014);
}
.doc-section + .doc-section, .endpoint + .doc-section, .doc-section + .endpoint { margin-top: 3rem; }
.doc-bar {
  position: sticky;
  top: var(--top);
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.7rem;
  margin: 0 -1.15rem 0.85rem;
  padding: 0.65rem 1.15rem;
  background: rgba(16, 19, 27, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  border-radius: 0 11px 0 0;
  box-shadow: 0 10px 22px -16px rgba(0, 0, 0, 0.8);
}
.doc-bar h2 { margin: 0; font-size: 1.28rem; line-height: 1.25; scroll-margin-top: calc(var(--top) + 16px); }
.doc-bar-sub { color: var(--accent); font-size: 0.86rem; font-weight: 700; }
.doc-bar-sub:empty { display: none; }
.doc-bar-sub::before { content: "› "; color: var(--faint); }
.doc-sub {
  margin: 1.2rem 0;
  padding: 0.8rem 1rem 0.35rem;
  border: 1px solid var(--line);
  border-left: 3px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
}
.doc-sub > h3:first-child { margin-top: 0; }
.doc-sub > h3 { scroll-margin-top: calc(var(--top) + 64px); }
@media (max-width: 600px) {
  .doc-section { padding: 0 0.75rem 0.4rem; }
  .doc-bar { margin: 0 -0.75rem 0.8rem; padding: 0.55rem 0.75rem; }
  .doc-bar h2 { font-size: 1.1rem; }
  .doc-sub { padding: 0.7rem 0.7rem 0.3rem; }
}

.endpoint-head { padding: 0.9rem 1rem; display: flex; flex-wrap: wrap; gap: 0.55rem 0.8rem; align-items: center; margin-bottom: 1rem; }
.path { font-family: var(--mono); font-size: 0.92rem; color: #e7e9ff; word-break: break-all; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 0.12rem 0.5rem; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; }
.pill.get { background: rgba(62, 224, 197, 0.15); color: #9cf6e8; }
.pill.post { background: rgba(139, 124, 255, 0.18); color: #ddd6ff; }
.pill.stable { background: rgba(74, 222, 128, 0.12); color: #b6f5cb; }
.pill.open { background: rgba(245, 193, 108, 0.14); color: #f8dcab; }
.ident { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; overflow: hidden; margin: 0.8rem 0 1.1rem; }
.ident div { padding: 0.75rem 0.9rem; }
.ident div + div { border-left: 1px solid var(--line); }
.ident small { display: block; color: var(--faint); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.ident code { background: none; border: 0; padding: 0; color: white; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; margin: 0.7rem 0 1.1rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.62rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th + th, td + td { border-left: 1px solid var(--line-strong); }
th { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); background: rgba(255,255,255,0.025); }
tr:last-child td { border-bottom: 0; }

.tabs, .codeblock { margin: 0.8rem 0 1.2rem; border: 1px solid rgba(99, 102, 241, 0.22); border-radius: 14px; overflow: hidden; background: rgba(99, 102, 241, 0.12); }
.tabbar { display: flex; gap: 0.2rem; padding: 0.4rem; background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--line); }
.tabbar button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.82rem; font-weight: 800;
  padding: 0.35rem 0.7rem; border-radius: 8px; cursor: pointer;
}
.tabbar button.on { background: rgba(99,102,241,0.2); color: white; }
.panel { display: none; }
.panel.on { display: block; }
pre {
  margin: 0;
  padding: 0.95rem 1rem 1.05rem;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  color: #d7dcec;
}
pre .c-key { color: #d8a7ff; font-weight: 700; }
pre .c-str { color: #a7f3a1; }
pre .c-num { color: #ffad7a; }
pre .c-com { color: #7c879f; font-style: italic; }
pre .c-fn { color: #7dd3fc; }
pre .c-punc { color: #67e8f9; }
.codehead { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0.45rem 0 0.95rem; color: var(--faint); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.copy {
  border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 8px;
  font: inherit; font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.5rem; cursor: pointer;
}
.copy:hover { color: white; }
.diagram { margin: 0.8rem 0 1.2rem; background: rgba(255,255,255,0.02); border: 1px solid var(--line); border-radius: 16px; padding: 0.8rem 0.8rem 0.4rem; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram figcaption { color: var(--faint); font-size: 0.8rem; padding: 0.15rem 0.4rem 0.45rem; }
@media (max-width: 600px) {
  .pillar-diagram { overflow-x: auto; }
  .pillar-diagram svg { width: 760px; max-width: none; }
  .pillar-diagram figcaption { min-width: 520px; }
}

.pager { display: flex; justify-content: space-between; gap: 0.8rem; margin-top: 2.4rem; }
.pager a { flex: 1; text-decoration: none; border: 1px solid var(--line); border-radius: 14px; padding: 0.8rem 0.95rem; color: inherit; }
.pager a:hover { border-color: rgba(139,124,255,0.5); }
.pager small { display: block; color: var(--faint); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.pager .next { text-align: right; }
.foot { margin-top: 2rem; color: var(--faint); font-size: 0.82rem; }
.foot a { color: var(--muted); }
.backdrop { display: none; }

@media (max-width: 1100px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .toc.open {
    display: block; position: fixed; right: 12px; top: calc(var(--top) + 10px); z-index: 45;
    width: min(280px, calc(100vw - 24px)); background: #161a24; border: 1px solid var(--line-strong);
    border-radius: 14px; padding: 0.8rem; box-shadow: var(--shadow);
  }
  .toc-btn { display: inline-flex; }
  body::after { display: none; }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .top-actions { display: none; }
  .side-actions { display: block; }
  .topnav { display: none; }
  .search-wrap { width: min(220px, 46vw); }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 50; left: 0; transform: translateX(-105%);
    width: min(320px, 88vw); transition: transform .2s ease; background: #0e1118;
  }
  .sidebar.open { transform: none; }
  .backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 45; }
  .hero-grid, .card-grid, .card-grid.card-grid--2x2, .ident { grid-template-columns: 1fr; }
  .ident div + div { border-left: 0; border-top: 1px solid var(--line); }
  .main { padding: 1.1rem 1rem 3rem; }
  h1 { font-size: 1.85rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .sidebar { transition: none; }
}
