:root {
  --bg: #ffffff;
  --surface: #f5f5f5;
  --surface-soft: #ebebeb;
  --ink: #111111;
  --muted: #555555;
  --border: #e0e0e0;
  --border-strong: #cccccc;
  --accent: #225cff;
  --accent-soft: rgba(34, 92, 255, 0.12);
  --green: #1a8f46;
  --green-soft: rgba(26, 143, 70, 0.12);
  --orange: #ef7d57;
  --orange-soft: rgba(239, 125, 87, 0.12);
  --code-bg: #f6f6f6;
  --code-text: #111111;
  --code-muted: #666666;
  --code-border: #e0e0e0;
  --code-title-border: rgba(0, 0, 0, 0.08);
  --code-btn-bg: rgba(0, 0, 0, 0.05);
  --code-btn-border: rgba(0, 0, 0, 0.12);
  --code-btn-bg-hover: rgba(0, 0, 0, 0.1);
  --code-btn-focus-outline: rgba(0, 0, 0, 0.2);
  --code-panel-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  --scrollbar-thumb: rgba(0, 0, 0, 0.18);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.28);
  --scrollbar-pre: rgba(0, 0, 0, 0.15);
  --method-bg: #f4f4f4;
  --method-color: #111111;
  --flow-box-stroke: rgba(34, 92, 255, 0.28);
  --flow-box-green-stroke: rgba(22, 132, 91, 0.32);
  --flow-box-orange-stroke: rgba(200, 109, 50, 0.34);
  --shadow: 0 24px 70px rgba(33, 26, 11, 0.1);
}

body.theme-dark {
  --bg: #101010;
  --surface: #171717;
  --surface-soft: #222222;
  --ink: #f4f4f4;
  --muted: #b7b7b7;
  --border: #343434;
  --border-strong: #555555;
  --accent: #86a6ff;
  --accent-soft: rgba(134, 166, 255, 0.14);
  --green: #66d19e;
  --green-soft: rgba(102, 209, 158, 0.12);
  --orange: #ffb47f;
  --orange-soft: rgba(255, 180, 127, 0.12);
  --code-bg: #050505;
  --code-text: #fafafa;
  --code-muted: #d0d0d0;
  --code-border: #242424;
  --code-title-border: rgba(255, 255, 255, 0.1);
  --code-btn-bg: rgba(255, 255, 255, 0.08);
  --code-btn-border: rgba(255, 255, 255, 0.14);
  --code-btn-bg-hover: rgba(255, 255, 255, 0.16);
  --code-btn-focus-outline: rgba(255, 255, 255, 0.35);
  --code-panel-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  --scrollbar-thumb: rgba(255, 255, 255, 0.18);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.28);
  --scrollbar-pre: rgba(255, 255, 255, 0.15);
  --method-bg: #111111;
  --method-color: #f4f4f4;
  --flow-box-stroke: rgba(125, 162, 255, 0.32);
  --flow-box-green-stroke: rgba(102, 209, 158, 0.32);
  --flow-box-orange-stroke: rgba(255, 180, 127, 0.32);
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

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

a.link {
  color: var(--accent);
  font-size: 0.92em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

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

code {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

pre code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.docs-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.docs-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: 4px 4px;
  padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  max-width: 225px;
}

.docs-sidebar .brand {
  margin: 6px 6px 18px;
  color: var(--ink);
}

.docs-nav {
  display: grid;
}

.docs-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.docs-nav a:hover,
.docs-nav a:focus-visible {
  background: var(--surface-soft);
  color: var(--ink);
  outline: 0;
}

.docs-nav svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.sidebar-bottom,
.docs-sidebar-bottom {
  display: grid;
  gap: 8px;
  margin: 6px 6px 0;
  padding-top: 0;
  background: var(--surface);
}

.docs-main {
  min-width: 0;
  padding: 0 36px 64px;
  overflow-x: hidden;
}

.docs-topbar {
  display: flex;
  min-height: 72px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: 100%;
}

.copy-page-button,
.copy-code-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-weight: 700;
}

.copy-page-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.05);
}

.copy-page-button:hover,
.copy-page-button:focus-visible {
  border-color: var(--border-strong);
  background: var(--surface-soft);
  outline: 0;
}

.copy-code-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--code-btn-border);
  background: var(--code-btn-bg);
  color: var(--code-text);
  font-size: 12px;
}

.copy-code-button:hover,
.copy-code-button:focus-visible {
  background: var(--code-btn-bg-hover);
  outline: 0;
}

.copy-code-button svg {
  width: 16px;
  height: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.code-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.code-select {
  min-height: 32px;
  max-width: 220px;
  padding: 0 34px 0 10px;
  border: 1px solid var(--code-btn-border);
  border-radius: 8px;
  background: var(--code-btn-bg);
  color: var(--code-text);
  font-size: 12px;
  font-weight: 800;
}

.code-select:focus-visible {
  outline: 2px solid var(--code-btn-focus-outline);
  outline-offset: 2px;
}

.code-select option {
  color: var(--ink);
  background: var(--surface);
}

.docs-section {
  padding: 46px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 90px;
}

.intro-section {
  padding-top: 30px;
  border-top: 0;
}

.section-heading {
  min-width: 0;
  max-width: 920px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

h1 {
  max-width: 1080px;
  font-size: 56px;
}

h2 {
  font-size: 40px;
}

h3 {
  font-size: 21px;
}

.lead,
.section-heading p,
.detail-panel p,
.plain-list,
td {
  color: var(--muted);
}

.lead {
  max-width: 780px;
  margin: 20px 0 0;
  font-size: 18px;
}

.section-heading p {
  margin: 14px 0 0;
  font-size: 16px;
}

.two-column,
.code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.code-grid {
  align-items: start;
}

.detail-panel {
  min-width: 0;
  margin-top: 18px;
  padding: 18px 0 0;
  border-top: 1px solid var(--border);
}

.detail-panel h3 {
  margin-bottom: 10px;
}

.detail-panel p {
  margin: 10px 0 0;
}

.plain-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.plain-list.compact {
  gap: 8px;
}

.plain-list strong {
  color: var(--ink);
}

.doc-columns .plain-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 32px;
}

.doc-underline {
  color: var(--ink);
  font-weight: 700;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
}

.code-panel {
  min-width: 0;
  max-width: 100%;
  margin-top: 18px;
  border: 1px solid var(--code-border);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-text);
  overflow: hidden;
  box-shadow: var(--code-panel-shadow);
}

.code-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-width: 0;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--code-title-border);
  color: var(--code-muted);
  font-size: 13px;
  font-weight: 800;
}

pre {
  max-width: 100%;
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-pre) transparent;
}


body::-webkit-scrollbar {
  width: 8px;
  background: transparent;
}

body::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.docs-nav {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-pre) transparent;
}

.table-wrap {
  width: 100%;
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--method-color);
  background: var(--method-bg);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

td code {
  white-space: nowrap;
  overflow-wrap: normal;
}


.flow-diagram {
  max-width: 100%;
  margin: 22px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow-x: auto;
  overflow-y: hidden;
}

.flow-diagram svg {
  width: 100%;
  height: auto;
}

.flow-box {
  fill: var(--accent-soft);
  stroke: var(--flow-box-stroke);
}

.flow-box.green {
  fill: var(--green-soft);
  stroke: var(--flow-box-green-stroke);
}

.flow-box.orange {
  fill: var(--orange-soft);
  stroke: var(--flow-box-orange-stroke);
}

.flow-arrow {
  stroke: var(--border-strong);
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
}

.flow-arrow-fill {
  fill: var(--border-strong);
}

.flow-diagram text {
  fill: var(--ink);
  font: 700 18px "IBM Plex Sans", sans-serif;
}

.flow-diagram .svg-muted {
  fill: var(--muted);
  font: 500 16px "IBM Plex Sans", sans-serif;
}

.flow-diagram .svg-caption {
  fill: var(--muted);
  font: 700 14px "IBM Plex Sans", sans-serif;
}


.theme-toggle {
  display: inline-flex;
  align-items: center;
  margin-left: -5px;
}

.theme-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-toggle-ui {
  position: relative;
  width: 45px;
  height: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(24, 23, 20, 0.12);
}

body.theme-dark .theme-toggle-ui {
  background: rgba(242, 238, 232, 0.2);
}

.theme-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--ink);
  opacity: 0.7;
  position: relative;
  z-index: 1;
}

.theme-toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #111111;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

body.theme-dark .theme-toggle-knob {
  background: #f2eee8;
}

#docsThemeToggle:checked+.theme-toggle-ui .theme-toggle-knob {
  transform: translateX(20px);
}

#docsThemeToggle:checked+.theme-toggle-ui .theme-toggle-icon-sun {
  order: 2;
}

#docsThemeToggle:checked+.theme-toggle-ui .theme-toggle-icon-moon {
  order: -1;
}


@media (max-width: 1180px) {
  .docs-shell {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  .docs-main {
    padding: 0 24px 56px;
  }

  h1 {
    font-size: 50px;
  }

  h2 {
    font-size: 34px;
  }
}

@media (max-width: 900px) {

  .two-column,
  .code-grid {
    grid-template-columns: 1fr;
  }

  .docs-main {
    width: 100%;
    max-width: calc(100vw - var(--docs-sidebar-collapsed-width, 68px));
  }

  .docs-sidebar {
    max-width: none;
  }

  h1 {
    font-size: 40px;
  }
}

@media (max-width: 640px) {
  .docs-main {
    --docs-content-width: min(calc(100vw - var(--docs-sidebar-collapsed-width, 58px) - 24px), 308px);
    padding: 0 12px 44px;
  }

  .docs-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    width: var(--docs-content-width);
    max-width: var(--docs-content-width);
    padding: 12px 0;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .code-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .code-select {
    flex: 1 1 178px;
    min-width: 0;
    max-width: min(220px, 100%);
  }

  .copy-page-button {
    min-width: 132px;
    padding: 0 14px;
  }

  h1 {
    font-size: 26px;
    line-height: 1.14;
  }

  h1 code {
    display: inline-block;
    margin-top: 5px;
  }

  h2 {
    font-size: 21px;
  }

  .lead {
    font-size: 16px;
  }

  .docs-section {
    width: var(--docs-content-width);
    max-width: var(--docs-content-width);
    padding: 32px 0;
  }

  pre {
    padding: 14px;
    font-size: 12px;
  }

}