:root {
  --bg: #0a0a0a;
  --bg-elev: #111111;
  --bg-card: #0f0f0f;
  --bg-card-hover: #131313;
  --border: #1d1d1d;
  --border-soft: #161616;
  --border-strong: #262626;
  --fg: #f5f5f5;
  --fg-dim: #999999;
  --fg-mute: #6b6b6b;
  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-soft: #6ee7b7;
  --warning: #fcd34d;
  --danger: #fda4af;
  --purple: #c084fc;
  --blue: #93c5fd;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-glow: 0 0 40px -18px rgba(16, 185, 129, 0.8);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.011em;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

code,
pre,
.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

code {
  color: var(--emerald-soft);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.16);
  border-radius: 6px;
  padding: 0.1rem 0.32rem;
  font-size: 0.92em;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at top, black 0%, transparent 70%);
  pointer-events: none;
}

.hero-glow {
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  z-index: -2;
  width: min(1100px, 120vw);
  height: 720px;
  background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.11) 0%, transparent 62%);
  pointer-events: none;
}

/* NAV */

.top-nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  z-index: 50;
  width: calc(100% - 2rem);
  max-width: 1180px;
  transform: translateX(-50%);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 15, 15, 0.74);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: max-content;
}

.brand-name {
  font-weight: 700;
  letter-spacing: -0.03em;
}

.version-pill {
  color: var(--fg-mute);
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
  background: var(--bg-elev);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.nav-links a {
  color: var(--fg-dim);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--fg);
}

.logo-mark {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 22px;
  flex: 0 0 auto;
}

.logo-mark svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 18px rgba(16, 185, 129, 0.25));
}

.logo-mark .facet {
  stroke: #000;
  stroke-width: 0.8;
  stroke-linejoin: round;
  transform-origin: center;
  animation: facet-in 0.45s ease-out forwards;
  opacity: 0;
}

.logo-mark .facet.t1 { fill: #6ee7b7; }
.logo-mark .facet.t2 { fill: #34d399; }
.logo-mark .facet.t3 { fill: #10b981; }
.logo-mark .facet.t4 { fill: #059669; }

.logo-mark .facet:nth-child(1) { animation-delay: 0.00s; }
.logo-mark .facet:nth-child(2) { animation-delay: 0.05s; }
.logo-mark .facet:nth-child(3) { animation-delay: 0.10s; }
.logo-mark .facet:nth-child(4) { animation-delay: 0.15s; }
.logo-mark .facet:nth-child(5) { animation-delay: 0.20s; }
.logo-mark .facet:nth-child(6) { animation-delay: 0.25s; }
.logo-mark .facet:nth-child(7) { animation-delay: 0.30s; }
.logo-mark .facet:nth-child(8) { animation-delay: 0.35s; }
.logo-mark .facet:nth-child(9) { animation-delay: 0.40s; }

@keyframes facet-in {
  from {
    opacity: 0;
    transform: scale(0.5);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* BUTTONS */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  padding: 0.72rem 1.2rem;
  color: #0a0a0a;
  background: var(--fg);
  border: 1px solid var(--fg);
}

.btn-primary.small {
  padding: 0.45rem 0.95rem;
  font-size: 0.84rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: #ffffff;
}

.btn-secondary {
  padding: 0.72rem 1.2rem;
  color: var(--fg);
  background: var(--bg-elev);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: #181818;
}

/* LAYOUT */

.site-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 2.5rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding-top: 7.2rem;
}

.content-shell {
  min-width: 0;
}

.docs-sidebar {
  position: sticky;
  top: 6.4rem;
  align-self: start;
  height: calc(100vh - 7.5rem);
}

.sidebar-card {
  height: 100%;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15, 15, 15, 0.64);
  overflow: auto;
}

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 42px;
  padding: 0 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--fg-mute);
}

.sidebar-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--fg);
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
}

.sidebar-search input::placeholder {
  color: var(--fg-mute);
}

.sidebar-nav {
  margin-top: 1.15rem;
}

.nav-group {
  margin-bottom: 1.45rem;
}

.nav-group-title {
  margin-bottom: 0.55rem;
  padding: 0 0.65rem;
  color: var(--fg-mute);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-link {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 0.2rem;
  padding: 0.42rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--fg-dim);
  font-size: 0.9rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
  color: var(--fg);
  background: var(--bg-elev);
  border-color: var(--border);
}

.sidebar-link.active {
  color: var(--emerald-bright);
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.18);
}

/* HERO */

.hero {
  position: relative;
  padding: 3.4rem 0 2rem;
}

.docs-hero {
  max-width: 900px;
}

.sprint-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.4rem;
  padding: 0.42rem 0.9rem 0.42rem 0.42rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-dim);
  background: var(--bg-elev);
  font-size: 0.84rem;
}

.sprint-badge {
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  color: #0a0a0a;
  background: var(--emerald);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hero-headline {
  margin: 0;
  font-size: clamp(3rem, 7vw, 5.8rem);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.word-clarity {
  display: inline-block;
  background: linear-gradient(180deg, var(--emerald-soft) 0%, var(--emerald) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy {
  max-width: 720px;
  margin: 1.55rem 0 0;
  color: var(--fg-dim);
  font-size: 1.12rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.hero-code-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 1rem;
  margin-top: 3rem;
}

.learning-path-card {
  padding: 1.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-glow);
}

.learning-path-card h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.learning-path-card ol {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learning-path-card li {
  display: flex;
  gap: 0.75rem;
  color: var(--fg-dim);
  font-size: 0.94rem;
}

.learning-path-card li span {
  color: var(--emerald-bright);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

/* ARTICLE */

.article {
  max-width: 840px;
  padding-bottom: 2rem;
}

.article-header {
  padding: 3.4rem 0 2rem;
  border-bottom: 1px solid var(--border-soft);
}

.article-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}

.article-eyebrow span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(16, 185, 129, 0.16);
  border-radius: 999px;
  color: var(--emerald-bright);
  background: rgba(16, 185, 129, 0.06);
  font-size: 0.75rem;
  font-weight: 700;
}

.article-header h1 {
  margin: 0;
  font-size: clamp(2.35rem, 5vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.article-header p {
  max-width: 720px;
  margin: 1.25rem 0 0;
  color: var(--fg-dim);
  font-size: 1.08rem;
  line-height: 1.75;
}

.article-section {
  padding: 3.1rem 0;
  border-bottom: 1px solid var(--border-soft);
  scroll-margin-top: 7rem;
}

.article-section h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.article-section h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.article-section p {
  color: var(--fg-dim);
  font-size: 1rem;
  line-height: 1.82;
}

.article-section p + p {
  margin-top: 1rem;
}

/* CARDS */

.feature-grid {
  display: grid;
  gap: 1rem;
  padding: 2rem 0 4rem;
}

.feature-grid.wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 900px;
}

.feature-card,
.mini-card,
.reference-card,
.example-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.feature-card::before,
.mini-card::before,
.reference-card::before,
.example-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--emerald), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.feature-card:hover,
.mini-card:hover,
.reference-card:hover,
.example-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.feature-card:hover::before,
.mini-card:hover::before,
.reference-card:hover::before,
.example-card:hover::before {
  opacity: 0.45;
}

.feature-card {
  padding: 1.65rem;
}

.feature-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  margin-bottom: 1.2rem;
  padding: 0 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--emerald);
  background: var(--bg-elev);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  font-weight: 700;
}

.feature-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.06rem;
}

.feature-card p,
.mini-card p,
.example-card p {
  margin: 0;
  color: var(--fg-dim);
  font-size: 0.92rem;
  line-height: 1.65;
}

.mini-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.3rem;
}

.mini-card {
  padding: 1.15rem;
}

.callout {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.06);
}

.callout strong {
  color: var(--emerald-bright);
}

.callout p {
  margin: 0.35rem 0 0;
}

/* CODE */

.code-card {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 42px;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--border);
  color: var(--fg-mute);
  background: var(--bg-elev);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.code-dots {
  display: flex;
  gap: 0.38rem;
  margin-right: 0.25rem;
}

.code-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #242424;
}

.copy-code {
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--fg-mute);
  background: var(--bg-card);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0.22rem 0.5rem;
}

.copy-code:hover,
.copy-code.copied {
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.35);
}

.code-block {
  margin: 0;
  padding: 1.35rem 1.5rem;
  color: var(--fg);
  font-size: 0.88rem;
  line-height: 1.75;
  overflow-x: auto;
}

.code-block code,
.reference-card code {
  display: block;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  border-radius: 0;
  white-space: pre;
}

.output-bar {
  padding: 0.8rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--emerald-bright);
  background: rgba(8, 12, 10, 0.4);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.84rem;
}

/* TABLES */

.table-wrap {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

th,
td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

th {
  color: var(--fg);
  background: var(--bg-elev);
  font-weight: 700;
}

td {
  color: var(--fg-dim);
}

tr:last-child td {
  border-bottom: 0;
}

/* PIPELINE */

.pipeline-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  gap: 0;
  margin-top: 1.4rem;
  padding: 1.8rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
}

.pipeline-stage {
  position: relative;
  z-index: 2;
  min-width: 92px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--fg-dim);
  background: var(--bg-elev);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.84rem;
  text-align: center;
}

.pipeline-stage.accent {
  color: var(--emerald-bright);
  border-color: var(--border-strong);
}

.pipeline-connector {
  position: relative;
  height: 2px;
  background: var(--border);
  overflow: hidden;
}

.pipeline-connector::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -40%;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--emerald-bright), var(--emerald), transparent);
  box-shadow: 0 0 8px var(--emerald);
  animation: flow-slide 2.4s linear infinite;
}

@keyframes flow-slide {
  from { left: -40%; }
  to { left: 100%; }
}

/* EXAMPLES + REFERENCE */

.example-grid {
  display: grid;
  gap: 1rem;
}

.example-card {
  padding: 1.25rem;
}

.example-card h2,
.reference-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-bottom: 2rem;
}

.reference-card {
  padding: 1.2rem;
}

.reference-card pre {
  margin: 0.85rem 0 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--fg-dim);
  background: var(--bg-elev);
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.65;
}

/* PAGER */

.page-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 840px;
  padding: 2rem 0 4rem;
}

.pager-card {
  display: grid;
  gap: 0.3rem;
  min-height: 86px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.pager-card.next {
  text-align: right;
}

.pager-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.28);
}

.pager-card span {
  color: var(--fg-mute);
  font-size: 0.8rem;
}

.pager-card strong {
  color: var(--fg);
}

/* FOOTER */

.site-footer {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border-soft);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  color: var(--fg-mute);
  font-size: 0.88rem;
}

.footer-brand,
.footer-links {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.footer-brand {
  color: var(--fg);
  font-weight: 700;
}

.footer-muted {
  color: var(--fg-mute);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--emerald);
}

/* RESPONSIVE */

@media (max-width: 1020px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: relative;
    top: 0;
    height: auto;
    order: 2;
  }

  .sidebar-card {
    max-height: none;
  }

  .content-shell {
    order: 1;
  }

  .feature-grid.wide,
  .hero-code-grid,
  .reference-grid,
  .mini-card-grid,
  .page-pager {
    grid-template-columns: 1fr;
  }

  .pager-card.next {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .top-nav {
    top: 0.7rem;
    width: calc(100% - 1rem);
  }

  .nav-inner {
    padding: 0.62rem;
  }

  .nav-links {
    display: none;
  }

  .site-shell {
    width: min(100% - 1rem, 1180px);
    padding-top: 5.6rem;
  }

  .hero {
    padding-top: 2rem;
  }

  .hero-headline {
    font-size: clamp(2.4rem, 14vw, 4rem);
  }

  .article-header {
    padding-top: 2rem;
  }

  .pipeline-wrap {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .pipeline-connector {
    width: 2px;
    height: 26px;
    justify-self: center;
  }

  .pipeline-connector::before {
    inset: -40% 0 auto 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(180deg, transparent, var(--emerald), transparent);
    animation: flow-slide-vertical 2.4s linear infinite;
  }

  @keyframes flow-slide-vertical {
    from { top: -40%; }
    to { top: 100%; }
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* ==========================================================
   Emerald Docs v2 — sidebar categories + right scrollspy TOC
   ========================================================== */

:root {
  --cyan: #22d3ee;
  --amber: #fbbf24;
  --rose: #fb7185;
  --sidebar-width: 292px;
  --toc-width: 246px;
  --content-width: 820px;
}

.emerald-orb {
  position: fixed;
  z-index: -2;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(40px);
  opacity: 0.18;
}

.orb-one {
  top: 14rem;
  left: -8rem;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.9), transparent 64%);
}

.orb-two {
  right: -10rem;
  bottom: 10rem;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.45), transparent 66%);
}

.top-nav {
  max-width: 1560px;
}

.site-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width));
  gap: 2.5rem;
  align-items: start;
  width: min(1560px, calc(100% - 2rem));
  padding-top: 6.85rem;
}

.site-shell.has-page-toc {
  grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width)) var(--toc-width);
}

.content-shell {
  width: 100%;
  min-width: 0;
}

.docs-sidebar {
  top: 6rem;
  height: calc(100vh - 7.1rem);
}

.sidebar-card {
  padding: 0.85rem;
  border-color: rgba(255, 255, 255, 0.075);
  background:
    linear-gradient(180deg, rgba(17, 17, 17, 0.92), rgba(10, 10, 10, 0.72)),
    radial-gradient(circle at 12% 0%, rgba(16, 185, 129, 0.12), transparent 36%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035), 0 24px 80px -52px rgba(16, 185, 129, 0.9);
}

.sidebar-headline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.15rem 0 0.85rem;
  padding: 0.25rem 0.35rem;
  color: var(--fg);
  font-size: 0.82rem;
  font-weight: 700;
}

.sidebar-headline-icon {
  color: var(--emerald-bright);
  font-size: 0.9rem;
}

.sidebar-search {
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.sidebar-search:focus-within {
  border-color: rgba(16, 185, 129, 0.38);
  background: rgba(16, 185, 129, 0.055);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.nav-group {
  position: relative;
  margin-bottom: 0.75rem;
  padding: 0.62rem 0.55rem 0.62rem 0.72rem;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.nav-group::before {
  content: "";
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  left: 0.62rem;
  width: 1px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.14), transparent);
}

.nav-group.open,
.nav-group:hover {
  border-color: rgba(255,255,255,0.065);
  background: rgba(255,255,255,0.025);
}

.nav-group-title {
  display: flex;
  align-items: flex-start;
  gap: 0.68rem;
  margin: 0 0 0.55rem;
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
}

.nav-group-kicker {
  position: relative;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  border: 1px solid rgba(16, 185, 129, 0.26);
  border-radius: 10px;
  color: var(--emerald-bright);
  background: rgba(16, 185, 129, 0.08);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.nav-group-copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.nav-group-copy strong {
  color: var(--fg);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-group-copy small {
  color: var(--fg-mute);
  font-size: 0.72rem;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: 0;
}

.nav-group-items {
  display: grid;
  gap: 0.16rem;
  margin-left: 0.45rem;
  padding-left: 0.7rem;
}

.sidebar-link {
  position: relative;
  gap: 0.58rem;
  min-height: 34px;
  margin: 0;
  padding: 0.42rem 0.46rem 0.42rem 0.52rem;
  border-radius: 10px;
  font-size: 0.875rem;
}

.sidebar-link-dot {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.sidebar-link-label {
  min-width: 0;
  flex: 1;
}

.sidebar-link-tag {
  padding: 0.1rem 0.38rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  color: var(--fg-mute);
  background: rgba(255,255,255,0.035);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
}

.sidebar-link:hover .sidebar-link-dot,
.sidebar-link.active .sidebar-link-dot {
  transform: scale(1.2);
  background: var(--emerald-bright);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.75);
}

.sidebar-link.active {
  color: var(--fg);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.045));
  border-color: rgba(16, 185, 129, 0.23);
}

.nav-group.accent-blue .nav-group-kicker,
.nav-group.accent-blue .sidebar-link.active {
  border-color: rgba(34, 211, 238, 0.24);
  background: rgba(34, 211, 238, 0.075);
}

.nav-group.accent-blue .nav-group-kicker,
.nav-group.accent-blue .sidebar-link.active .sidebar-link-dot {
  color: var(--cyan);
  background: var(--cyan);
}

.nav-group.accent-blue .sidebar-link.active .sidebar-link-dot {
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.7);
}

.nav-group.accent-purple .nav-group-kicker,
.nav-group.accent-purple .sidebar-link.active {
  border-color: rgba(192, 132, 252, 0.24);
  background: rgba(192, 132, 252, 0.075);
}

.nav-group.accent-purple .nav-group-kicker {
  color: var(--purple);
}

.nav-group.accent-purple .sidebar-link.active .sidebar-link-dot {
  background: var(--purple);
  box-shadow: 0 0 14px rgba(192, 132, 252, 0.72);
}

.nav-group.accent-amber .nav-group-kicker,
.nav-group.accent-amber .sidebar-link.active {
  border-color: rgba(251, 191, 36, 0.24);
  background: rgba(251, 191, 36, 0.075);
}

.nav-group.accent-amber .nav-group-kicker {
  color: var(--amber);
}

.nav-group.accent-amber .sidebar-link.active .sidebar-link-dot {
  background: var(--amber);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.7);
}

.nav-group.accent-rose .nav-group-kicker,
.nav-group.accent-rose .sidebar-link.active {
  border-color: rgba(251, 113, 133, 0.24);
  background: rgba(251, 113, 133, 0.075);
}

.nav-group.accent-rose .nav-group-kicker {
  color: var(--rose);
}

.nav-group.accent-rose .sidebar-link.active .sidebar-link-dot {
  background: var(--rose);
  box-shadow: 0 0 14px rgba(251, 113, 133, 0.68);
}

/* Right side page TOC */

.page-toc {
  position: sticky;
  top: 6.35rem;
  align-self: start;
  height: calc(100vh - 7.4rem);
  padding-top: 0.25rem;
}

.page-toc-card {
  position: relative;
  padding: 0.65rem 0 0.65rem 0.15rem;
  color: var(--fg-mute);
}

.page-toc-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  color: var(--fg-dim);
  font-size: 0.82rem;
  font-weight: 600;
}

.page-toc-icon {
  color: var(--emerald);
  font-size: 0.85rem;
}

.page-toc-list {
  position: relative;
  display: grid;
  gap: 0.08rem;
  padding-left: 0.72rem;
}

.page-toc-list::before {
  content: "";
  position: absolute;
  top: 0.18rem;
  bottom: 0.18rem;
  left: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.11), rgba(255,255,255,0.03), rgba(255,255,255,0.11));
}

.page-toc-link {
  position: relative;
  display: flex;
  min-height: 31px;
  align-items: center;
  padding: 0.32rem 0 0.32rem 0.5rem;
  border-radius: 7px;
  color: var(--fg-mute);
  font-size: 0.82rem;
  line-height: 1.3;
  transition: color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.page-toc-link::before {
  content: "";
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  left: -0.74rem;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  transform: scaleY(0.3);
  transition: background 0.16s ease, transform 0.2s ease, box-shadow 0.16s ease;
}

.page-toc-link:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.025);
}

.page-toc-link.active {
  color: #04c8ff;
  transform: translateX(4px);
}

.page-toc-link.active::before {
  background: linear-gradient(180deg, #04c8ff, var(--emerald-bright));
  box-shadow: 0 0 14px rgba(4, 200, 255, 0.42);
  transform: scaleY(1);
}

.page-toc-link.depth-2 {
  padding-left: 1.25rem;
  font-size: 0.78rem;
}

/* Article polish */

.article {
  max-width: var(--content-width);
}

.article-header {
  position: relative;
  overflow: hidden;
  margin-bottom: 0.4rem;
  padding: 3.4rem 0 2.2rem;
}

.article-header::before {
  content: "";
  position: absolute;
  top: 1.2rem;
  right: 0;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.13), transparent 68%);
  pointer-events: none;
}

.article-header h1 {
  position: relative;
  max-width: 820px;
}

.article-header p {
  position: relative;
}

.article-eyebrow span:nth-child(2) {
  border-color: rgba(34, 211, 238, 0.18);
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.055);
}

.article-eyebrow span:nth-child(3) {
  border-color: rgba(192, 132, 252, 0.18);
  color: var(--purple);
  background: rgba(192, 132, 252, 0.055);
}

.article-section {
  position: relative;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.48s ease, transform 0.48s ease;
}

.article-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.article-section::after {
  content: "";
  position: absolute;
  left: 0;
  right: auto;
  bottom: -1px;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.48), transparent);
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.section-kicker span:first-child {
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 1.6rem;
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 8px;
  color: var(--emerald-bright);
  background: rgba(16, 185, 129, 0.08);
}

.section-kicker span:last-child {
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.article-section h2 {
  color: var(--fg);
}

.article-section p a,
.article a {
  color: var(--emerald-bright);
}

.callout {
  position: relative;
  overflow: hidden;
  border-color: rgba(16, 185, 129, 0.26);
  background:
    linear-gradient(90deg, rgba(16, 185, 129, 0.09), rgba(34, 211, 238, 0.035)),
    rgba(16, 185, 129, 0.03);
}

.callout::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--emerald-soft), var(--cyan));
}

.mini-card:nth-child(2n)::before,
.feature-card:nth-child(2n)::before,
.reference-card:nth-child(2n)::before,
.example-card:nth-child(2n)::before {
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.mini-card:nth-child(3n)::before,
.feature-card:nth-child(3n)::before,
.reference-card:nth-child(3n)::before,
.example-card:nth-child(3n)::before {
  background: linear-gradient(90deg, transparent, var(--purple), transparent);
}

.mini-card:hover {
  border-color: rgba(16, 185, 129, 0.24);
}

.table-wrap {
  box-shadow: 0 18px 70px -54px rgba(16, 185, 129, 0.9);
}

th {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.022)),
    var(--bg-elev);
}

td code {
  color: var(--fg);
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
}

.site-footer {
  width: min(1560px, calc(100% - 2rem));
}

@media (max-width: 1320px) {
  :root {
    --sidebar-width: 280px;
    --content-width: 780px;
  }

  .site-shell.has-page-toc {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .page-toc {
    display: none;
  }
}

@media (max-width: 1020px) {
  .site-shell,
  .site-shell.has-page-toc {
    grid-template-columns: 1fr;
    width: min(100% - 1.25rem, 1180px);
  }

  .docs-sidebar {
    position: relative;
    top: 0;
    height: auto;
    order: 2;
  }

  .sidebar-card {
    max-height: 560px;
  }

  .content-shell {
    order: 1;
  }

  .article {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .site-shell,
  .site-shell.has-page-toc {
    width: min(100% - 1rem, 1180px);
    padding-top: 5.65rem;
  }

  .sidebar-card {
    padding: 0.75rem;
  }

  .nav-group {
    padding-right: 0.45rem;
  }

  .sidebar-link-tag {
    display: none;
  }

  .article-section {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-section,
  .page-toc-link,
  .page-toc-link::before,
  .sidebar-link,
  .sidebar-link-dot {
    transition: none;
  }
}


.nav-group.accent-blue .nav-group-kicker {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.075);
}

.nav-group.accent-blue .sidebar-link.active .sidebar-link-dot {
  background: var(--cyan);
}



/* ==========================================================
   Emerald Docs v3 — fixed clean docs shell
   ========================================================== */

:root {
  --sidebar-width: 250px;
  --toc-width: 230px;
  --content-width: 820px;
  --shell-edge: clamp(0.75rem, 2vw, 2rem);
  --shell-top: 6.05rem;
  --shell-bottom: 0;
}

html,
body {
  height: 100%;
}

body {
  overflow: hidden;
}

.top-nav {
  max-width: none;
  width: auto;
  left: var(--shell-edge);
  right: var(--shell-edge);
  transform: none;
}

.nav-inner {
  max-width: none;
  min-height: 54px;
  background: rgba(12, 12, 12, 0.82);
}

.hero-glow {
  opacity: 0.75;
}

.emerald-orb {
  opacity: 0.1;
}

.site-shell,
.site-shell.has-page-toc {
  position: fixed;
  top: var(--shell-top);
  right: var(--shell-edge);
  bottom: var(--shell-bottom);
  left: var(--shell-edge);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width)) var(--toc-width);
  gap: 2rem;
  align-items: stretch;
  width: auto;
  margin: 0;
  padding: 0 0 1.1rem;
  overflow: hidden;
}

.site-shell:not(.has-page-toc) {
  grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width));
}

.content-shell {
  width: 100%;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.55rem 5rem 0;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.36) rgba(255, 255, 255, 0.04);
}

.content-shell::-webkit-scrollbar,
.sidebar-card::-webkit-scrollbar {
  width: 8px;
}

.content-shell::-webkit-scrollbar-track,
.sidebar-card::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.035);
  border-radius: 999px;
}

.content-shell::-webkit-scrollbar-thumb,
.sidebar-card::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.34);
  border-radius: 999px;
}

.docs-sidebar {
  position: static;
  top: auto;
  align-self: stretch;
  height: 100%;
  min-height: 0;
}

.sidebar-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 0.35rem 0.25rem 0.35rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.sidebar-search {
  flex: 0 0 auto;
  height: 38px;
  margin: 0 0.2rem 1rem 0;
  border-color: rgba(255, 255, 255, 0.075);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.032);
}

.sidebar-search:focus-within {
  border-color: rgba(16, 185, 129, 0.32);
  background: rgba(16, 185, 129, 0.045);
  box-shadow: none;
}

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  padding: 0 0.35rem 1.5rem 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.nav-group {
  margin: 0 0 1.3rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.nav-group::before {
  display: none;
}

.nav-group.open,
.nav-group:hover {
  border-color: transparent;
  background: transparent;
}

.nav-group-title {
  display: block;
  margin: 0 0 0.45rem;
  padding: 0;
  color: var(--fg);
  font-size: 0.73rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: none;
}

.nav-group-items {
  display: grid;
  gap: 0.06rem;
  margin: 0;
  padding: 0;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 31px;
  margin: 0;
  padding: 0.36rem 0.65rem 0.36rem 0.72rem;
  border: 0;
  border-radius: 8px;
  color: var(--fg-mute);
  font-size: 0.87rem;
  line-height: 1.25;
  background: transparent;
  transition: color 0.12s ease, background 0.12s ease;
}

.sidebar-link::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  bottom: 0.45rem;
  left: 0;
  width: 2px;
  border-radius: 999px;
  background: transparent;
}

.sidebar-link:hover {
  color: var(--fg-dim);
  background: rgba(255, 255, 255, 0.035);
  border-color: transparent;
}

.sidebar-link.active {
  color: var(--fg);
  border-color: transparent;
  background: rgba(16, 185, 129, 0.075);
}

.sidebar-link.active::before {
  background: var(--emerald);
}

.sidebar-link-dot,
.sidebar-link-tag,
.nav-group-kicker,
.nav-group-copy,
.sidebar-headline {
  display: none !important;
}

.docs-hero {
  padding-top: 2.25rem;
}

.sprint-pill {
  display: none !important;
}

.article-header {
  padding-top: 2.25rem;
}

.article-header::before {
  opacity: 0.55;
}

.article-section {
  scroll-margin-top: 2rem;
}

.page-toc {
  position: static;
  top: auto;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  padding-top: 0.4rem;
  overflow: hidden;
}

.page-toc-card {
  height: 100%;
  padding: 0;
  color: var(--fg-mute);
}

.page-toc-title {
  margin-bottom: 0.75rem;
  color: var(--fg-dim);
  font-size: 0.8rem;
  font-weight: 650;
}

.page-toc-icon {
  color: var(--fg-mute);
}

.page-toc-list {
  position: relative;
  display: grid;
  gap: 0.02rem;
  padding-left: 0.72rem;
}

.page-toc-list::before {
  top: 0.22rem;
  bottom: 0.22rem;
  background: rgba(255, 255, 255, 0.1);
}

.page-toc-link {
  min-height: 30px;
  padding: 0.3rem 0 0.3rem 0.55rem;
  color: var(--fg-mute);
  font-size: 0.82rem;
  background: transparent;
  transform: none;
  transition: color 0.14s ease, background 0.14s ease;
}

.page-toc-link::before {
  top: 0.38rem;
  bottom: 0.38rem;
  left: -0.74rem;
  width: 2px;
  transform: scaleY(0.2);
  transition: background 0.14s ease, transform 0.18s ease;
}

.page-toc-link:hover {
  color: var(--fg-dim);
  background: transparent;
}

.page-toc-link.active {
  color: var(--emerald-bright);
  transform: none;
}

.page-toc-link.active::before {
  background: var(--emerald);
  box-shadow: none;
  transform: scaleY(1);
}

.site-footer {
  display: none;
}

@media (max-width: 1320px) {
  :root {
    --sidebar-width: 238px;
    --content-width: 1fr;
    --toc-width: 212px;
  }

  .site-shell.has-page-toc {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width);
  }

  .page-toc {
    display: block;
  }
}

@media (max-width: 1120px) {
  .site-shell,
  .site-shell.has-page-toc {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .page-toc {
    display: none;
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .top-nav {
    left: 0.75rem;
    right: 0.75rem;
  }

  .site-shell,
  .site-shell.has-page-toc {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    grid-template-columns: 1fr;
    width: min(100% - 1rem, 1180px);
    margin: 0 auto;
    padding-top: 5.65rem;
    overflow: visible;
  }

  .docs-sidebar {
    order: 2;
    height: auto;
  }

  .sidebar-card {
    max-height: 520px;
    padding: 0;
  }

  .content-shell {
    order: 1;
    height: auto;
    overflow: visible;
    padding-right: 0;
  }
}


/* ==========================================================
   Emerald Docs v4 — fixed shell, left-anchored sidebar,
   footer drawer inside the sidebar, improved scrollspy
   ========================================================== */

:root {
  --sidebar-width: 252px;
  --toc-width: 236px;
  --content-width: 840px;
  --shell-edge: 0.7rem;
  --shell-top: 5.9rem;
  --shell-bottom: 0;
  --shell-gap: clamp(1.25rem, 2.2vw, 2.4rem);
}

@media (min-width: 1500px) {
  :root {
    --shell-edge: 0.85rem;
    --shell-gap: 2.6rem;
  }
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
}

body {
  overscroll-behavior: none;
}

.top-nav {
  left: var(--shell-edge) !important;
  right: var(--shell-edge) !important;
  width: auto !important;
}

.site-shell,
.site-shell.has-page-toc {
  position: fixed !important;
  inset: var(--shell-top) var(--shell-edge) var(--shell-bottom) var(--shell-edge) !important;
  display: grid !important;
  grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width)) var(--toc-width) !important;
  gap: var(--shell-gap) !important;
  align-items: stretch !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 0 1rem !important;
  overflow: hidden !important;
}

.site-shell:not(.has-page-toc) {
  grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width)) !important;
}

.docs-sidebar,
.page-toc {
  position: relative !important;
  top: auto !important;
  align-self: stretch !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  transform: none !important;
}

.docs-sidebar {
  justify-self: stretch;
}

.content-shell {
  position: relative !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0 0.7rem 6rem 0 !important;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.content-shell > .site-footer,
.site-footer {
  display: none !important;
}

.sidebar-card {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 0.25rem 0.15rem 0.4rem 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.sidebar-search {
  flex: 0 0 auto !important;
  height: 37px !important;
  margin: 0 0.15rem 0.95rem 0 !important;
  border-color: rgba(255, 255, 255, 0.07) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.028) !important;
  box-shadow: none !important;
}

.sidebar-search:focus-within {
  border-color: rgba(16, 185, 129, 0.32) !important;
  background: rgba(16, 185, 129, 0.04) !important;
  box-shadow: none !important;
}

.sidebar-nav {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 0.3rem 0.8rem 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.nav-group {
  margin: 0 0 1.25rem !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.nav-group::before,
.nav-group-kicker,
.nav-group-copy,
.sidebar-link-dot,
.sidebar-link-tag,
.sidebar-headline {
  display: none !important;
}

.nav-group-title {
  display: block !important;
  margin: 0 0 0.42rem !important;
  padding: 0 !important;
  color: rgba(245, 245, 245, 0.86) !important;
  font-size: 0.72rem !important;
  font-weight: 760 !important;
  letter-spacing: 0.015em !important;
  text-transform: none !important;
}

.nav-group-items {
  display: grid !important;
  gap: 0.04rem !important;
  margin: 0 !important;
  padding: 0 !important;
}

.sidebar-link {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  min-height: 30px !important;
  margin: 0 !important;
  padding: 0.35rem 0.55rem 0.35rem 0.68rem !important;
  border: 0 !important;
  border-radius: 7px !important;
  color: var(--fg-mute) !important;
  background: transparent !important;
  font-size: 0.86rem !important;
  line-height: 1.25 !important;
  transition: color 0.12s ease, background 0.12s ease !important;
}

.sidebar-link::before {
  content: "" !important;
  position: absolute !important;
  top: 0.48rem !important;
  bottom: 0.48rem !important;
  left: 0 !important;
  width: 2px !important;
  border-radius: 999px !important;
  background: transparent !important;
}

.sidebar-link:hover {
  color: var(--fg-dim) !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

.sidebar-link.active {
  color: var(--fg) !important;
  background: rgba(16, 185, 129, 0.065) !important;
}

.sidebar-link.active::before {
  background: var(--emerald) !important;
}

.sidebar-footer-drawer {
  flex: 0 0 auto;
  margin: 0.55rem 0.25rem 0 0;
  padding: 0.85rem;
  border: 1px solid rgba(16, 185, 129, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.025)),
    rgba(255, 255, 255, 0.025);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}

.content-at-end .sidebar-footer-drawer {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  border-color: rgba(16, 185, 129, 0.28);
}

.sidebar-footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg);
  font-size: 0.86rem;
  font-weight: 760;
}

.sidebar-footer-brand .logo-mark {
  width: 20px;
  height: 17px;
}

.sidebar-footer-brand small {
  color: var(--fg-mute);
  font-size: 0.72rem;
  font-weight: 600;
}

.sidebar-footer-drawer p {
  margin: 0.58rem 0 0.7rem;
  color: var(--fg-mute);
  font-size: 0.76rem;
  line-height: 1.5;
}

.sidebar-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sidebar-footer-links a {
  padding: 0.22rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  color: var(--fg-dim);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.72rem;
}

.sidebar-footer-links a:hover {
  color: var(--emerald-bright);
  border-color: rgba(16, 185, 129, 0.25);
}

.page-toc {
  padding-top: 0.35rem !important;
}

.page-toc-card {
  height: 100% !important;
  padding: 0 !important;
  background: transparent !important;
  overflow: hidden !important;
}

.page-toc-title {
  margin-bottom: 0.76rem !important;
  color: var(--fg-dim) !important;
  font-size: 0.8rem !important;
  font-weight: 640 !important;
}

.page-toc-icon {
  color: var(--fg-mute) !important;
}

.page-toc-list {
  position: relative !important;
  display: grid !important;
  gap: 0.02rem !important;
  padding-left: 0.72rem !important;
}

.page-toc-list::before {
  top: 0.22rem !important;
  bottom: 0.22rem !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.page-toc-link {
  min-height: 30px !important;
  padding: 0.3rem 0 0.3rem 0.55rem !important;
  color: var(--fg-mute) !important;
  background: transparent !important;
  font-size: 0.82rem !important;
  transform: none !important;
  transition: color 0.14s ease !important;
}

.page-toc-link::before {
  top: 0.38rem !important;
  bottom: 0.38rem !important;
  left: -0.74rem !important;
  width: 2px !important;
  transform: scaleY(0.2) !important;
  transition: background 0.14s ease, transform 0.18s ease !important;
}

.page-toc-link:hover {
  color: var(--fg-dim) !important;
  background: transparent !important;
}

.page-toc-link.active {
  color: var(--emerald-bright) !important;
  transform: none !important;
}

.page-toc-link.active::before {
  background: var(--emerald) !important;
  box-shadow: none !important;
  transform: scaleY(1) !important;
}

.docs-hero,
.article-header {
  padding-top: 2rem !important;
}

.article-section {
  scroll-margin-top: 1.75rem;
}

@media (max-width: 1320px) {
  :root {
    --sidebar-width: 238px;
    --toc-width: 214px;
    --content-width: 1fr;
    --shell-gap: 1.55rem;
    --shell-edge: 0.65rem;
  }

  .site-shell.has-page-toc {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width) !important;
  }

  .page-toc {
    display: block !important;
  }
}

@media (max-width: 1120px) {
  .site-shell,
  .site-shell.has-page-toc {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) !important;
  }

  .page-toc {
    display: none !important;
  }
}

@media (max-width: 860px) {
  html,
  body {
    overflow: auto !important;
    height: auto;
  }

  body {
    overscroll-behavior: auto;
  }

  .top-nav {
    left: 0.75rem !important;
    right: 0.75rem !important;
  }

  .site-shell,
  .site-shell.has-page-toc {
    position: relative !important;
    inset: auto !important;
    grid-template-columns: 1fr !important;
    width: min(100% - 1rem, 1180px) !important;
    margin: 0 auto !important;
    padding-top: 5.65rem !important;
    overflow: visible !important;
  }

  .docs-sidebar {
    order: 2;
    height: auto !important;
  }

  .sidebar-card {
    height: auto !important;
    max-height: 560px;
  }

  .sidebar-footer-drawer {
    display: none;
  }

  .content-shell {
    order: 1;
    height: auto !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }
}


/* v4.1 — footer drawer overlays the sidebar instead of reserving space */
.sidebar-footer-drawer {
  position: absolute !important;
  left: 0 !important;
  right: 0.35rem !important;
  bottom: 0.35rem !important;
  z-index: 6 !important;
  margin: 0 !important;
  box-shadow: 0 -18px 42px -30px rgba(16, 185, 129, 0.75) !important;
}

.content-at-end .sidebar-nav {
  padding-bottom: 7.2rem !important;
}


/* ==========================================================
   Emerald Docs v5 — wider reading plane, compact header,
   global footer reveal instead of sidebar-only drawer
   ========================================================== */

@media (min-width: 1021px) {
  :root {
    --sidebar-width: 252px;
    --toc-width: 238px;
    --shell-edge: 0.5rem;
    --shell-top: 4.7rem;
    --shell-gap: clamp(1.45rem, 1.8vw, 2rem);
    --content-width: min(1100px, calc(100vw - 252px - 238px - 5.8rem));
  }

  .top-nav {
    top: 0.65rem !important;
    left: var(--shell-edge) !important;
    right: var(--shell-edge) !important;
    width: auto !important;
    max-width: none !important;
  }

  .nav-inner {
    min-height: 44px !important;
    padding: 6px 13px !important;
    border-radius: 12px !important;
  }

  .brand-link {
    gap: 0.55rem !important;
  }

  .brand-name {
    font-size: 0.88rem !important;
  }

  .version-pill {
    padding: 0.08rem 0.36rem !important;
    font-size: 0.67rem !important;
  }

  .nav-links {
    gap: 1.35rem !important;
  }

  .nav-links a {
    font-size: 0.78rem !important;
  }

  .btn-primary.small {
    padding: 0.34rem 0.72rem !important;
    border-radius: 8px !important;
    font-size: 0.74rem !important;
  }

  .site-shell,
  .site-shell.has-page-toc {
    inset: var(--shell-top) var(--shell-edge) 0 var(--shell-edge) !important;
    grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width)) var(--toc-width) !important;
    gap: var(--shell-gap) !important;
    padding-bottom: 0.85rem !important;
  }

  .site-shell:not(.has-page-toc) {
    grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width)) !important;
  }

  .content-shell {
    padding: 0 0.8rem 8rem 0 !important;
  }

  .article {
    max-width: var(--content-width) !important;
  }

  .article-header {
    padding: 2.35rem 0 1.55rem !important;
  }

  .article-header h1 {
    max-width: 900px !important;
    font-size: clamp(2.05rem, 3.15vw, 3.35rem) !important;
    line-height: 1.05 !important;
  }

  .article-header p {
    max-width: 820px !important;
    margin-top: 0.95rem !important;
    font-size: 1rem !important;
    line-height: 1.7 !important;
  }

  .article-section {
    padding: 2.65rem 0 !important;
    scroll-margin-top: 3rem !important;
  }

  .article-section h2 {
    font-size: clamp(1.45rem, 2.15vw, 2.02rem) !important;
  }

  .feature-grid.wide,
  .reference-grid {
    max-width: 100% !important;
  }

  .code-card,
  .data-table-wrap {
    max-width: 100% !important;
  }

  .sidebar-footer-drawer {
    display: none !important;
  }

  .content-at-end .sidebar-nav {
    padding-bottom: 0.8rem !important;
  }

  .site-footer {
    display: block !important;
    position: fixed !important;
    left: var(--shell-edge) !important;
    right: var(--shell-edge) !important;
    bottom: 0.72rem !important;
    z-index: 70 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    transform: translateY(calc(100% + 1rem)) !important;
    pointer-events: none !important;
    transition:
      opacity 0.28s ease,
      transform 0.34s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .content-at-end .site-footer {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  .footer-inner {
    min-height: 82px !important;
    padding: 1rem 1.15rem !important;
    border: 1px solid rgba(16, 185, 129, 0.18) !important;
    border-radius: 16px !important;
    background:
      linear-gradient(90deg, rgba(16, 185, 129, 0.12), rgba(34, 211, 238, 0.035) 44%, rgba(10, 10, 10, 0.86)),
      rgba(15, 15, 15, 0.88) !important;
    box-shadow:
      0 -24px 70px -42px rgba(16, 185, 129, 0.9),
      inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(18px) saturate(1.25) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.25) !important;
  }

  .footer-brand {
    min-width: 185px !important;
  }

  .footer-brand .logo-mark {
    width: 22px !important;
    height: 18px !important;
  }

  .footer-inner p {
    max-width: 760px !important;
    margin: 0 !important;
    color: var(--fg-dim) !important;
    line-height: 1.55 !important;
  }

  .footer-links {
    gap: 0.5rem !important;
  }

  .footer-links a {
    padding: 0.4rem 0.64rem !important;
    border: 1px solid rgba(255, 255, 255, 0.075) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.035) !important;
    color: var(--fg-dim) !important;
    font-size: 0.78rem !important;
  }

  .footer-links a:hover {
    color: var(--emerald-bright) !important;
    border-color: rgba(16, 185, 129, 0.28) !important;
    background: rgba(16, 185, 129, 0.065) !important;
  }
}

@media (min-width: 1760px) {
  :root {
    --content-width: 1160px;
    --shell-gap: 2.15rem;
  }

  .article-header h1 {
    max-width: 960px !important;
  }
}

@media (max-width: 1380px) and (min-width: 1021px) {
  :root {
    --sidebar-width: 238px;
    --toc-width: 214px;
    --shell-gap: 1.35rem;
    --content-width: calc(100vw - 238px - 214px - 4.4rem);
  }

  .nav-links {
    gap: 1rem !important;
  }

  .footer-inner {
    min-height: 78px !important;
  }

  .footer-inner p {
    max-width: 520px !important;
  }
}

@media (max-width: 1020px) {
  .site-footer {
    display: block !important;
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}


/* ==========================================================
   Emerald Docs v6 — wider reading column, compact right TOC
   ========================================================== */

@media (min-width: 1021px) {
  :root {
    --sidebar-width: clamp(224px, 12.5vw, 248px);
    --toc-width: clamp(132px, 7.6vw, 164px);
    --shell-edge: 0.5rem;
    --shell-gap: clamp(0.8rem, 1vw, 1.25rem);
    --shell-top: 4.7rem;
  }

  .site-shell,
  .site-shell.has-page-toc {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width) !important;
    gap: var(--shell-gap) !important;
  }

  .site-shell:not(.has-page-toc) {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) !important;
  }

  .content-shell {
    padding-right: 0.45rem !important;
  }

  .article {
    width: 100% !important;
    max-width: min(1360px, 100%) !important;
  }

  .article-header h1 {
    max-width: 1000px !important;
  }

  .article-header p {
    max-width: 960px !important;
  }

  .article-section {
    width: 100% !important;
  }

  .article-section > p,
  .article-section > .callout {
    max-width: 1040px !important;
  }

  .feature-grid.wide,
  .mini-card-grid,
  .reference-grid,
  .hero-code-grid,
  .table-wrap,
  .code-card,
  .pipeline-wrap,
  .page-pager {
    width: 100% !important;
    max-width: 100% !important;
  }

  .mini-card-grid,
  .feature-grid.wide,
  .reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .page-toc {
    width: var(--toc-width) !important;
    max-width: var(--toc-width) !important;
    padding-top: 0.35rem !important;
  }

  .page-toc-card {
    width: 100% !important;
    padding: 0.15rem 0 0.15rem 0 !important;
    background: transparent !important;
    border: 0 !important;
  }

  .page-toc-title {
    gap: 0.38rem !important;
    margin-bottom: 0.55rem !important;
    color: rgba(153, 153, 153, 0.72) !important;
    font-size: 0.68rem !important;
    font-weight: 650 !important;
    letter-spacing: -0.01em !important;
  }

  .page-toc-icon {
    font-size: 0.68rem !important;
    color: rgba(153, 153, 153, 0.72) !important;
  }

  .page-toc-list {
    gap: 0 !important;
    padding-left: 0.48rem !important;
  }

  .page-toc-list::before {
    left: 0 !important;
    background: rgba(255, 255, 255, 0.08) !important;
  }

  .page-toc-link {
    min-height: 24px !important;
    padding: 0.22rem 0 0.22rem 0.45rem !important;
    border-radius: 5px !important;
    color: rgba(153, 153, 153, 0.62) !important;
    font-size: 0.68rem !important;
    line-height: 1.2 !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .page-toc-link::before {
    left: -0.48rem !important;
    top: 0.28rem !important;
    bottom: 0.28rem !important;
    width: 1px !important;
    box-shadow: none !important;
  }

  .page-toc-link:hover {
    color: rgba(245, 245, 245, 0.78) !important;
    background: transparent !important;
  }

  .page-toc-link.active {
    color: var(--emerald-bright) !important;
    background: transparent !important;
    transform: none !important;
  }

  .page-toc-link.active::before {
    background: var(--emerald) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.55) !important;
  }
}

@media (min-width: 1500px) {
  :root {
    --sidebar-width: 248px;
    --toc-width: 158px;
    --shell-gap: 1.15rem;
  }

  .article {
    max-width: min(1440px, 100%) !important;
  }
}

@media (min-width: 1900px) {
  :root {
    --sidebar-width: 252px;
    --toc-width: 162px;
    --shell-gap: 1.25rem;
  }

  .article {
    max-width: min(1520px, 100%) !important;
  }
}

@media (max-width: 1380px) and (min-width: 1021px) {
  :root {
    --sidebar-width: 228px;
    --toc-width: 132px;
    --shell-gap: 0.75rem;
  }

  .article-section > p,
  .article-section > .callout {
    max-width: 100% !important;
  }

  .page-toc-title {
    font-size: 0.64rem !important;
  }

  .page-toc-link {
    font-size: 0.64rem !important;
  }
}
