:root {
  --theme-bg: #16181c;
  --theme-bg-rgb: 22 24 28;
  --theme-bg-secondary: #1a1d21;
  --theme-bg-secondary-rgb: 26 29 33;
  --theme-bg-tertiary: #1e2126;
  --theme-bg-tertiary-rgb: 30 33 38;
  --theme-surface: #22262b;
  --theme-surface-rgb: 34 38 43;
  --theme-highlight-rgb: 48 52 58;
  --theme-border: 38 42 48;
  --theme-border-light: 48 52 58;
  --theme-scrollbar-track: #1a1d21;
  --theme-scrollbar-thumb: #2a2e33;
  --theme-text: #d5d5d5;
  --theme-text-rgb: 213 213 213;
  --theme-text-secondary: #a1a1aa;
  --theme-text-secondary-rgb: 161 161 170;
  --theme-text-muted: #8b8f98;
  --theme-text-muted-rgb: 139 143 152;
  --theme-text-dim: #8b8f98;
  --theme-text-dim-rgb: 139 143 152;
  --docs-accent: var(--theme-text-secondary);
  --docs-accent-foreground: var(--theme-bg);
  --font-sans: var(--font-ibm-plex-sans, "IBM Plex Sans", system-ui, -apple-system, sans-serif);
  --font-mono: var(--font-ibm-plex-mono, "IBM Plex Mono", monospace);
  --default-font-family: var(--font-sans);
  --default-mono-font-family: var(--font-mono);
  --background: var(--theme-bg);
  --foreground: var(--theme-text);
  --card: var(--theme-bg-secondary);
  --card-foreground: var(--theme-text);
  --popover: var(--theme-bg-secondary);
  --popover-foreground: var(--theme-text);
  --primary: var(--theme-text);
  --primary-foreground: var(--theme-bg);
  --secondary: var(--theme-bg-tertiary);
  --secondary-foreground: var(--theme-text-secondary);
  --muted: var(--theme-surface);
  --muted-foreground: var(--theme-text-muted);
  --accent: var(--docs-accent);
  --accent-foreground: var(--docs-accent-foreground);
  --destructive: rgb(239 68 68);
  --destructive-foreground: #ffffff;
  --border: rgb(var(--theme-border));
  --input: var(--theme-surface);
  --ring: rgb(var(--theme-border-light));
  --sidebar: var(--theme-bg-secondary);
  --sidebar-foreground: var(--theme-text);
  --sidebar-primary: var(--docs-accent);
  --sidebar-primary-foreground: var(--docs-accent-foreground);
  --sidebar-accent: var(--theme-bg-tertiary);
  --sidebar-accent-foreground: var(--theme-text);
  --sidebar-border: rgb(var(--theme-border));
  --sidebar-ring: rgb(var(--theme-border-light));
}

:root.theme-midnight {
  --theme-bg: #09090b;
  --theme-bg-rgb: 9 9 11;
  --theme-bg-secondary: #0c0c0e;
  --theme-bg-secondary-rgb: 12 12 14;
  --theme-bg-tertiary: #111113;
  --theme-bg-tertiary-rgb: 17 17 19;
  --theme-surface: #161618;
  --theme-surface-rgb: 22 22 24;
  --theme-highlight-rgb: 36 36 40;
  --theme-border: 28 28 32;
  --theme-border-light: 36 36 40;
  --theme-scrollbar-track: #0c0c0e;
  --theme-scrollbar-thumb: #1f1f23;
}

:root.theme-deep-dark {
  --theme-bg: #101217;
  --theme-bg-rgb: 16 18 23;
  --theme-bg-secondary: #13161b;
  --theme-bg-secondary-rgb: 19 22 27;
  --theme-bg-tertiary: #171a20;
  --theme-bg-tertiary-rgb: 23 26 32;
  --theme-surface: #1c1f26;
  --theme-surface-rgb: 28 31 38;
  --theme-highlight-rgb: 40 45 54;
  --theme-border: 32 36 44;
  --theme-border-light: 40 45 54;
  --theme-scrollbar-track: #13161b;
  --theme-scrollbar-thumb: #252a33;
}

:root.theme-abyss {
  --theme-bg: #0d1117;
  --theme-bg-rgb: 13 17 23;
  --theme-bg-secondary: #10161e;
  --theme-bg-secondary-rgb: 16 22 30;
  --theme-bg-tertiary: #131c24;
  --theme-bg-tertiary-rgb: 19 28 36;
  --theme-surface: #171f2b;
  --theme-surface-rgb: 23 31 43;
  --theme-highlight-rgb: 36 48 64;
  --theme-border: 28 38 52;
  --theme-border-light: 36 48 64;
  --theme-scrollbar-track: #10161e;
  --theme-scrollbar-thumb: #1e2c3e;
}

:root.theme-dusk {
  --theme-bg: #1d1c1b;
  --theme-bg-rgb: 29 28 27;
  --theme-bg-secondary: #222120;
  --theme-bg-secondary-rgb: 34 33 32;
  --theme-bg-tertiary: #272524;
  --theme-bg-tertiary-rgb: 39 37 36;
  --theme-surface: #2d2b29;
  --theme-surface-rgb: 45 43 41;
  --theme-highlight-rgb: 60 56 52;
  --theme-border: 48 45 42;
  --theme-border-light: 60 56 52;
  --theme-scrollbar-track: #222120;
  --theme-scrollbar-thumb: #3a3733;
}

:root.theme-stone {
  --theme-bg: #f0f2f4;
  --theme-bg-rgb: 240 242 244;
  --theme-bg-secondary: #e8eaec;
  --theme-bg-secondary-rgb: 232 234 236;
  --theme-bg-tertiary: #e0e3e6;
  --theme-bg-tertiary-rgb: 224 227 230;
  --theme-surface: #d8dce0;
  --theme-surface-rgb: 216 220 224;
  --theme-highlight-rgb: 196 202 208;
  --theme-border: 196 202 208;
  --theme-border-light: 180 186 194;
  --theme-scrollbar-track: #e8eaec;
  --theme-scrollbar-thumb: #b0b8c2;
  --theme-text: #111318;
  --theme-text-rgb: 17 19 24;
  --theme-text-secondary: #374151;
  --theme-text-secondary-rgb: 55 65 81;
  --theme-text-muted: #4b5563;
  --theme-text-muted-rgb: 75 85 99;
  --theme-text-dim: #4b5563;
  --theme-text-dim-rgb: 75 85 99;
  --docs-accent: var(--theme-text-muted);
  --docs-accent-foreground: #ffffff;
  color-scheme: light;
}

html,
body {
  background: var(--theme-bg) !important;
  color: var(--theme-text) !important;
  font-family: var(--font-sans) !important;
  scrollbar-color: var(--theme-scrollbar-thumb) var(--theme-scrollbar-track) !important;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

::selection {
  background: rgb(var(--theme-text-secondary-rgb) / 0.52) !important;
  color: var(--docs-accent-foreground) !important;
}

::-moz-selection {
  background: rgb(var(--theme-text-secondary-rgb) / 0.52) !important;
  color: var(--docs-accent-foreground) !important;
}

.font-sans {
  font-family: var(--font-sans) !important;
}

.font-mono {
  font-family: var(--font-mono) !important;
}

.grid-bg {
  background-image:
    linear-gradient(90deg, rgb(var(--theme-text-secondary-rgb) / 0.10) 1px, transparent 1px),
    linear-gradient(rgb(var(--theme-text-secondary-rgb) / 0.10) 1px, transparent 1px) !important;
  background-size: 60px 60px !important;
}

:root.theme-stone .grid-bg {
  background-image:
    linear-gradient(90deg, rgb(17 19 24 / 0.08) 1px, transparent 1px),
    linear-gradient(rgb(17 19 24 / 0.08) 1px, transparent 1px) !important;
}

header a[href="/"] {
  --docs-back-icon-color: var(--theme-text);
  width: 2.5rem;
  height: 1.5rem;
  border-radius: 0.75rem;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: var(--theme-text) !important;
  line-height: 1 !important;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

header a[href="/"]:hover {
  --docs-back-icon-color: var(--accent);
  background: rgb(var(--theme-surface-rgb) / 0.72);
  color: var(--accent) !important;
  transform: translateX(-2px);
}

header a[href="/"] span {
  position: relative;
  display: block;
  width: 1.8rem;
  height: 1rem;
  min-width: 1.8rem;
  min-height: 1rem;
  overflow: visible;
  white-space: nowrap;
  color: transparent !important;
  font-size: 0 !important;
  letter-spacing: 0 !important;
}

header a[href="/"] span::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 50%;
  width: 1.45rem;
  height: 2px;
  border-radius: 999px;
  background: var(--docs-back-icon-color);
  transform: translateY(-50%);
}

header a[href="/"] span::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 50%;
  width: 0.68rem;
  height: 0.68rem;
  border-left: 2px solid var(--docs-back-icon-color);
  border-bottom: 2px solid var(--docs-back-icon-color);
  transform: translateY(-50%) rotate(45deg);
  transform-origin: center;
}

header a[href="/"][data-docs-home-logo="true"] {
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0;
  background: transparent !important;
  border-radius: 0;
  transform: none;
  opacity: 0.92;
  transition: opacity 160ms ease, transform 160ms ease;
}

header a[href="/"][data-docs-home-logo="true"]:hover {
  background: transparent !important;
  color: inherit !important;
  transform: none;
  opacity: 1;
}

header a[href="/"][data-docs-home-logo="true"] span,
header a[href="/"][data-docs-home-logo="true"] span::before,
header a[href="/"][data-docs-home-logo="true"] span::after {
  display: none !important;
}

header[data-docs-header="true"] {
  overflow: visible !important;
}

main section[id],
.doc-content section[id] {
  scroll-margin-top: 7rem;
}

[data-docs-scroll-progress="true"] {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
  background: rgb(var(--theme-border-light) / 0.28);
}

[data-docs-scroll-progress-indicator="true"] {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgb(var(--theme-text-rgb) / 0.92), var(--accent));
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 90ms linear;
}

button[data-docs-back-to-top="true"] {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 60;
  width: 2.75rem;
  height: 2.75rem;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(var(--theme-border-light) / 0.72);
  border-radius: 999px;
  background: rgb(var(--theme-bg-secondary-rgb) / 0.82);
  color: var(--theme-text);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.96);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

button[data-docs-back-to-top="true"][data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

button[data-docs-back-to-top="true"]:hover {
  border-color: rgb(var(--theme-text-rgb) / 0.62);
  background: rgb(var(--theme-surface-rgb) / 0.92);
  color: var(--accent);
  transform: translateY(-2px) scale(1);
}

button[data-docs-back-to-top="true"] span {
  position: relative;
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0 auto;
  color: currentColor;
  font-size: 0;
}

button[data-docs-back-to-top="true"] span::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.18rem;
  width: 0.68rem;
  height: 0.68rem;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}

button[data-docs-back-to-top="true"] span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.28rem;
  width: 2px;
  height: 0.9rem;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

:root.theme-stone button[data-docs-back-to-top="true"] {
  box-shadow: 0 18px 40px rgb(17 19 24 / 0.16);
}

@media (min-width: 1024px) {
  aside[data-docs-sidebar="true"],
  aside[class*="w-64"][class*="shrink-0"] {
    position: relative !important;
    align-self: flex-start !important;
    width: 16rem !important;
    min-width: 16rem !important;
  }

  aside[data-docs-sidebar="true"] > [data-docs-sidebar-panel="true"],
  aside[class*="w-64"][class*="shrink-0"] > .sticky {
    position: fixed !important;
    top: 7rem !important;
    left: max(1.5rem, calc((100vw - 80rem) / 2 + 1.5rem)) !important;
    width: 16rem !important;
    max-height: calc(100dvh - 8rem) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--theme-scrollbar-thumb) transparent;
  }

  aside[data-docs-sidebar="true"] > [data-docs-sidebar-panel="true"]::-webkit-scrollbar,
  aside[class*="w-64"][class*="shrink-0"] > .sticky::-webkit-scrollbar {
    width: 6px;
  }

  aside[data-docs-sidebar="true"] > [data-docs-sidebar-panel="true"]::-webkit-scrollbar-track,
  aside[class*="w-64"][class*="shrink-0"] > .sticky::-webkit-scrollbar-track {
    background: transparent;
  }

  aside[data-docs-sidebar="true"] > [data-docs-sidebar-panel="true"]::-webkit-scrollbar-thumb,
  aside[class*="w-64"][class*="shrink-0"] > .sticky::-webkit-scrollbar-thumb {
    background: rgb(var(--theme-border-light) / 0.7);
    border-radius: 999px;
  }

  aside[data-docs-sidebar="true"] nav a[data-docs-active="true"] {
    background-color: rgb(var(--theme-surface-rgb) / 0.42) !important;
    box-shadow: inset 2px 0 0 rgb(var(--theme-text-rgb) / 0.82) !important;
    color: var(--theme-text) !important;
  }

  aside[data-docs-sidebar="true"] nav a[data-docs-active="true"] span {
    color: inherit !important;
  }

  aside[data-docs-sidebar="true"] nav a[data-docs-active="false"] {
    background-color: transparent !important;
    box-shadow: inset 2px 0 0 transparent !important;
    color: var(--theme-text-muted) !important;
  }

  aside[data-docs-sidebar="true"] nav a[data-docs-active="false"]:hover {
    background-color: rgb(var(--theme-surface-rgb) / 0.18) !important;
    color: var(--theme-text) !important;
  }

  :root.theme-stone aside[data-docs-sidebar="true"] nav a[data-docs-active="true"] {
    background-color: rgb(17 19 24 / 0.08) !important;
  }
}

aside[data-docs-sidebar="true"] nav {
  position: relative;
  padding-left: 22px;
  isolation: isolate;
}

aside[data-docs-sidebar="true"] nav::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 11px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgb(var(--theme-text-rgb) / 0.18) 12%,
    rgb(var(--theme-text-rgb) / 0.28) 50%,
    rgb(var(--theme-text-rgb) / 0.18) 88%,
    transparent
  );
  pointer-events: none;
}

aside[data-docs-sidebar="true"] nav a {
  position: relative;
}

aside[data-docs-sidebar="true"] nav a::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgb(255 255 255 / 0.45);
  transform: translateY(-50%);
  transition: background-color 220ms ease, border-color 220ms ease,
    box-shadow 220ms ease, transform 220ms ease;
  pointer-events: none;
  z-index: 1;
}

aside[data-docs-sidebar="true"] nav a::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  width: 7px;
  height: 1px;
  background: rgb(255 255 255 / 0.25);
  transform: translateY(-50%) scaleX(0.4);
  transform-origin: left center;
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease, background-color 220ms ease;
  pointer-events: none;
}

aside[data-docs-sidebar="true"] nav a:hover::before {
  border-color: rgb(255 255 255 / 0.85);
  background: transparent;
}

aside[data-docs-sidebar="true"] nav a:hover::after {
  opacity: 0.7;
  transform: translateY(-50%) scaleX(1);
}

aside[data-docs-sidebar="true"] nav a[data-docs-active="true"]::before {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 4px 0 rgb(255 255 255 / 0.55);
  transform: translateY(-50%) scale(1.2);
}

aside[data-docs-sidebar="true"] nav a[data-docs-active="true"]::after {
  opacity: 1;
  transform: translateY(-50%) scaleX(1);
  background: rgb(255 255 255 / 0.6);
}

@media (prefers-reduced-motion: reduce) {
  aside[data-docs-sidebar="true"] nav a::before,
  aside[data-docs-sidebar="true"] nav a::after {
    transition: none;
  }
}

.bg-white\/5,
.hover\:bg-white\/5:hover {
  background-color: rgb(var(--theme-surface-rgb) / 0.05) !important;
}

:root.theme-stone .bg-white\/5,
:root.theme-stone .hover\:bg-white\/5:hover {
  background-color: rgb(17 19 24 / 0.04) !important;
}

:root.theme-stone .text-yellow-400 {
  color: #854d0e !important;
}

:root.theme-stone .text-red-400 {
  color: #b91c1c !important;
}

:root.theme-stone .text-green-400 {
  color: #166534 !important;
}

:root.theme-stone .bg-yellow-500\/5 {
  background-color: rgb(234 179 8 / 0.12) !important;
}

:root.theme-stone .bg-red-500\/5 {
  background-color: rgb(239 68 68 / 0.10) !important;
}

:root.theme-stone .border-yellow-500\/30 {
  border-color: rgb(202 138 4 / 0.45) !important;
}

:root.theme-stone .border-red-500\/30 {
  border-color: rgb(185 28 28 / 0.45) !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 10px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: var(--theme-scrollbar-track);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: var(--theme-scrollbar-thumb);
  border-radius: 999px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: var(--theme-text-secondary);
}
