:root {
  color-scheme: dark;
  --bg: #0b0f19;
  --card: rgba(255, 255, 255, 0.045);
  --card-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent-from: #22d3ee;
  --accent-to: #3b82f6;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --glow: 0 8px 28px rgba(34, 211, 238, 0.38), 0 0 48px rgba(59, 130, 246, 0.18);
  --header-h: 4.15rem;
  --sidebar-w: 17.5rem;
  --ease-io: cubic-bezier(0.42, 0, 0.58, 1);
  --dur: 0.35s;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: Outfit, system-ui, sans-serif;
}

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

button, input {
  font-family: inherit;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 50% -18%, rgba(34, 211, 238, 0.2), transparent 58%),
    radial-gradient(ellipse 70% 45% at 108% 8%, rgba(59, 130, 246, 0.16), transparent 52%),
    radial-gradient(ellipse 55% 40% at -8% 88%, rgba(14, 165, 233, 0.1), transparent 48%),
    radial-gradient(ellipse 40% 28% at 80% 75%, rgba(99, 102, 241, 0.08), transparent 50%),
    #0b0f19;
}

.app-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.45;
  mix-blend-mode: overlay;
}

.glass {
  position: relative;
  background: rgba(16, 24, 40, 0.82);
  border: 1px solid var(--border);
  border-radius: 1.35rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
  .glass {
    background: var(--card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07) 0%, transparent 42%);
}

.glass > * {
  position: relative;
  z-index: 1;
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 25, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.docs-header-inner {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 1;
  min-width: 0;
}

.brand-logo {
  display: block;
  height: 2.15rem;
  width: auto;
  max-width: 11rem;
  object-fit: contain;
}

.icon-btn {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 32rem;
  margin-left: auto;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 2.65rem;
  padding: 0 3.4rem 0 2.55rem;
  border-radius: 0.95rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
  transition: border-color var(--dur) var(--ease-io), box-shadow var(--dur) var(--ease-io);
}

.search-wrap input:focus {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.search-kbd {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.12rem 0.38rem;
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  padding: 0.45rem;
  border-radius: 1.05rem;
  border: 1px solid var(--border);
  background: rgba(12, 18, 32, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  z-index: 50;
}

.search-hit {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-radius: 0.8rem;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
}

.search-hit:hover,
.search-hit.is-active {
  background: rgba(34, 211, 238, 0.1);
}

.search-hit strong {
  display: block;
  font-size: 0.92rem;
}

.search-hit span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-empty {
  padding: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.docs-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 88rem;
  margin: 0 auto;
  min-height: calc(100dvh - var(--header-h));
}

.docs-sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100dvh - var(--header-h));
  overflow: auto;
  padding: 1.15rem 0.85rem 2rem 1.15rem;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

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

.nav-group-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.nav-link {
  display: block;
  padding: 0.48rem 0.7rem;
  margin: 0.12rem 0;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.is-active {
  color: #ecfeff;
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.28);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.08);
}

.docs-main {
  min-width: 0;
  padding: 1.5rem 1.25rem 4rem;
}

.docs-stage {
  max-width: 52rem;
}

.docs-stage.is-leaving {
  animation: articleOut 0.18s ease forwards;
}

.docs-stage.is-entering {
  animation: articleIn 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes articleIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes articleOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-8px); }
}

.hero {
  margin-bottom: 1.6rem;
}

.eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #67e8f9;
}

.hero h1,
.article-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.docs-hero-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
}

.hero-logo {
  display: block;
  height: clamp(2.2rem, 5.5vw, 3.15rem);
  width: auto;
  max-width: min(22rem, 100%);
  object-fit: contain;
}

.lead {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 40rem;
}

.docs-home-cta {
  margin: 1rem 0 0;
}

.docs-home-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: #67e8f9;
}

.docs-home-link:hover {
  text-decoration: underline;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 0.85rem;
  margin: 1.5rem 0 2rem;
}

.cat-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.15rem 1.1rem 1.2rem;
  border-radius: 1.2rem;
  cursor: pointer;
  transition: transform 0.28s var(--ease-io), border-color 0.28s, box-shadow 0.28s;
}

.cat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.32);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28), 0 0 28px rgba(34, 211, 238, 0.12);
}

.cat-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.28);
}

.cat-card h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.cat-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.section-label {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.popular-list {
  display: grid;
  gap: 0.65rem;
}

.pop-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.05rem;
  border-radius: 1.05rem;
}

.pop-link:hover {
  border-color: rgba(34, 211, 238, 0.28);
}

.pop-link b {
  display: block;
  font-size: 0.95rem;
}

.pop-link span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pop-arrow {
  color: #67e8f9;
  font-size: 1.1rem;
}

.support-cta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.05rem;
  margin: 0 0 1.2rem;
  border-radius: 1.15rem;
  transition: transform 0.28s var(--ease-io), border-color 0.28s, box-shadow 0.28s;
}

.support-cta:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.32);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28), 0 0 28px rgba(34, 211, 238, 0.12);
}

.support-cta:active {
  transform: scale(0.97);
}

.support-cta-orb {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.28);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.16);
}

.support-cta-copy {
  flex: 1;
  min-width: 0;
}

.support-cta-copy b {
  display: block;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.support-cta-copy span {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.support-cta .pop-arrow {
  flex-shrink: 0;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.9rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.crumbs a:hover {
  color: #67e8f9;
}

.article-head {
  margin-bottom: 1.5rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.28);
}

.prose {
  color: #cbd5e1;
  font-size: 0.98rem;
  line-height: 1.7;
}

.prose p {
  margin: 0 0 1rem;
}

.prose h2 {
  margin: 1.8rem 0 0.7rem;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.prose h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 700;
}

.prose ul {
  margin: 0 0 1rem 1.15rem;
  padding: 0;
}

.prose li {
  margin: 0.3rem 0;
}

.steps {
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.step {
  display: grid;
  grid-template-columns: 2.15rem minmax(0, 1fr);
  gap: 0.85rem;
  padding: 1rem 1.05rem;
  border-radius: 1.15rem;
}

.step-num {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.8rem;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #031525;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  box-shadow: var(--glow);
}

.step-body {
  min-width: 0;
}

.step-text {
  margin-top: 0.35rem;
  color: var(--text-muted);
}

.step-text p:last-child {
  margin-bottom: 0;
}

.callout {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.95rem 1.05rem;
  margin: 0 0 1.2rem;
  border-radius: 1.05rem;
  border: 1px solid var(--border);
}

.callout-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.callout p {
  margin: 0;
  color: var(--text-muted);
}

.callout-info {
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.28);
}

.callout-warn {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.32);
}

.callout-danger {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.3);
}

.callout-tip {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.28);
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.72rem 1.05rem;
  border-radius: 0.95rem;
  font-weight: 700;
  font-size: 0.9rem;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
  color: #031525;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  box-shadow: var(--glow);
}

.btn-primary:hover {
  filter: brightness(1.07);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: rgba(34, 211, 238, 0.35);
}

.copy-block {
  margin: 0 0 1.2rem;
  padding: 0.85rem 0.95rem 0.95rem;
  border-radius: 1.05rem;
  overflow: hidden;
}

.copy-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.copy-btn {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.1);
  color: #67e8f9;
  cursor: pointer;
}

.copy-btn.is-copied {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.12);
}

.copy-block code {
  display: block;
  overflow-x: auto;
  padding: 0.75rem 0.8rem;
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  color: #a5f3fc;
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-all;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 2rem;
}

.pager a {
  padding: 0.9rem 1rem;
  border-radius: 1.05rem;
}

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

.pager small {
  display: block;
  color: var(--text-dim);
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%) translateY(120%);
  z-index: 80;
  padding: 0.7rem 1.05rem;
  border-radius: 0.9rem;
  background: rgba(16, 24, 40, 0.95);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: #e2e8f0;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  transition: transform 0.28s var(--ease-io), opacity 0.28s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.sidebar-open {
  overflow: hidden;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(3, 6, 14, 0.62);
  backdrop-filter: blur(4px);
}

.lg-hidden {
  display: none;
}

@media (max-width: 980px) {
  .lg-hidden {
    display: grid;
  }

  .search-kbd {
    display: none;
  }

  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 45;
    width: min(20rem, 88vw);
    height: 100dvh;
    padding-top: 1rem;
    background: rgba(11, 15, 25, 0.96);
    transform: translateX(-105%);
    transition: transform 0.28s var(--ease-io);
    border-right: 1px solid var(--border);
  }

  body.sidebar-open .docs-sidebar {
    transform: none;
  }

  .docs-main {
    padding: 1.15rem 1rem 3.5rem;
  }

  .pager {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .search-wrap {
    max-width: none;
  }

  .brand-logo {
    height: 1.85rem;
    max-width: 8.5rem;
  }

  .hero h1,
  .article-head h1 {
    font-size: 1.55rem;
  }
}
