:root {
  color-scheme: light;
  --page-bg: #f7f6f3;
  --surface: #ffffff;
  --surface-muted: #f7f5f1;
  --border: #e7e2d9;
  --text: #1e2230;
  --text-muted: #6a7285;
  --accent: #635bff;
  --accent-soft: #f0eeff;
  --shadow: 0 12px 32px rgba(34, 40, 56, 0.06);
  --radius: 14px;
  --max-width: 1480px;
  --sidebar-width: 304px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 14px;
  background: #0f1720;
  color: #e8edf2;
}

code {
  font-size: 0.94em;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

th,
td {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.hidden {
  display: none;
}

.workspace-shell {
  display: grid;
  grid-template-columns: minmax(280px, var(--sidebar-width)) minmax(0, 1fr);
  min-height: 100vh;
}

.site-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.site-shell--wide {
  max-width: 1480px;
}

.content-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.content-shell--full {
  padding: 1.5rem;
}

.doc-layout-shell {
  width: min(calc(100% - 2rem), 1240px);
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.page-header {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.page-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-hero {
  padding: 1.75rem 1.9rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(99, 91, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 244, 0.98));
  box-shadow: var(--shadow);
}

.page-hero h1 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.page-lead {
  margin: 0.7rem 0 0;
  max-width: 72ch;
  color: var(--text-muted);
}

.page-meta-row,
.page-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.page-meta-pill,
.page-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  color: #515b70;
  font-size: 0.86rem;
  font-weight: 500;
}

.page-meta-inline {
  display: inline-flex;
  align-items: center;
}

.page-action:hover {
  background: rgba(99, 91, 255, 0.08);
  text-decoration: none;
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 1.5rem;
  align-items: start;
}

.page-layout--single {
  grid-template-columns: minmax(0, 1fr);
}

.page-panel {
  overflow: hidden;
}

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 1.5rem;
  align-items: start;
}

.workspace-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 1rem 0.9rem 1.4rem;
  background:
    radial-gradient(circle at top left, rgba(99, 91, 255, 0.08), transparent 28%),
    #fbfaf7;
  border-right: 1px solid var(--border);
}

.workspace-main {
  min-width: 0;
}

.workspace-wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0 0.65rem;
  border: 1px solid rgba(99, 91, 255, 0.14);
  border-radius: 999px;
  background: rgba(99, 91, 255, 0.08);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workspace-wordmark:hover {
  text-decoration: none;
}

.search-shell--sidebar {
  margin-top: 1.35rem;
}

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

.sidebar-section + .sidebar-section {
  margin-top: 1.15rem;
}

.sidebar-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sidebar-heading {
  margin: 0 0 0.45rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-count {
  color: #98a2b3;
  font-size: 0.78rem;
  font-weight: 600;
}

.sidebar-list {
  display: grid;
  gap: 0.15rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar-list a,
.sidebar-empty {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  color: #4b5568;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

.sidebar-list--anchors a.is-active,
.toc-list a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-list a:hover {
  background: rgba(99, 91, 255, 0.07);
  text-decoration: none;
}

.sidebar-empty {
  color: var(--text-muted);
  padding-left: 0.2rem;
}

.workspace-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem 2.2rem 1.35rem;
  background: rgba(247, 246, 243, 0.9);
  border-bottom: 1px solid rgba(231, 226, 217, 0.9);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.workspace-topbar-copy {
  min-width: 0;
}

.workspace-title {
  margin: 0.2rem 0 0;
  font-size: 1.9rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.search-shell {
  display: grid;
  gap: 0.25rem;
  min-width: min(360px, 100%);
}

.search-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.search-input {
  width: 100%;
  min-height: 2.8rem;
  padding: 0 0.95rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 1px rgba(20, 25, 35, 0.02);
}

.workspace-summary {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.3rem;
  padding: 0 0.9rem;
  border: 1px solid rgba(99, 91, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #515b70;
}

.top-nav a:hover {
  background: rgba(99, 91, 255, 0.08);
  text-decoration: none;
}

.workspace-content {
  width: min(calc(100% - 3.6rem), 1040px);
  padding: 1.8rem 0 4rem;
  margin: 0 auto;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 1.5rem;
  align-items: start;
}

.doc-pane {
  display: grid;
  gap: 2.5rem;
}

.content-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.9rem 1.9rem 1.7rem;
}

.content-header {
  margin-bottom: 1.15rem;
}

.content-header h2,
.doc-article h1,
.api-header h1 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.resource-list {
  display: grid;
  gap: 1.5rem;
}

.resource-group {
  display: grid;
  gap: 0.5rem;
}

.resource-group-title {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.resource-group-list {
  display: grid;
}

.resource-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.resource-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.resource-copy {
  min-width: 0;
}

.resource-copy h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.resource-copy p,
.doc-meta,
.panel-copy {
  margin: 0;
  color: var(--text-muted);
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: flex-start;
}

.resource-actions--single {
  flex: 0 0 9.5rem;
  justify-content: flex-end;
}

.resource-link {
  white-space: nowrap;
  font-weight: 600;
}

.api-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
  padding: 1.5rem;
}

.api-picker {
  display: grid;
  gap: 0.45rem;
  min-width: 240px;
  color: var(--text-muted);
}

.api-picker select {
  min-height: 2.75rem;
  padding: 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.scalar-container {
  min-height: 65vh;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid rgba(216, 224, 234, 0.9);
  box-shadow: var(--shadow);
}

.doc-article {
  padding: 2rem;
}

.doc-article--embedded {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.doc-article--page {
  padding: 2.15rem;
}

.doc-article > :first-child {
  margin-top: 0;
}

.doc-article img {
  max-width: 100%;
}

.doc-article h1,
.doc-article h2,
.doc-article h3,
.doc-article h4,
.doc-article h5,
.doc-article h6 {
  scroll-margin-top: 7.5rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0;
  margin: 1rem 0 1.25rem;
  list-style: none;
}

.tag-list li {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.callout {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 14px;
  background: #fcfbf8;
}

.callout--info {
  border-left-color: #4f7cff;
  background: #f5f8ff;
}

.callout--warning {
  border-left-color: #d97706;
  background: #fff7ed;
}

.callout--danger {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.callout--success {
  border-left-color: #16a34a;
  background: #f0fdf4;
}

.callout-title {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.callout-body > :first-child {
  margin-top: 0;
}

.callout-body > :last-child {
  margin-bottom: 0;
}

.schema-section + .schema-section {
  margin-top: 2rem;
}

.schema-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.schema-section h2,
.schema-node-title {
  margin: 0;
  line-height: 1.2;
}

.schema-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.schema-summary-card {
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 245, 240, 0.95)),
    var(--surface-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.schema-summary-label,
.schema-fact-label,
.schema-subheading {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.schema-summary-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.schema-fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.schema-fact {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fcfbf8;
}

.schema-fact code {
  display: block;
  margin-top: 0.3rem;
  white-space: pre-wrap;
}

.schema-table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fffdfa;
}

.schema-table {
  min-width: 700px;
}

.schema-table thead {
  background: #f5f1ea;
}

.schema-table th {
  color: #536076;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.schema-table tbody tr:nth-child(even) {
  background: rgba(248, 245, 240, 0.6);
}

.schema-table tbody tr:hover {
  background: rgba(99, 91, 255, 0.04);
}

.schema-table td:first-child {
  width: 24%;
}

.schema-table code {
  font-size: 0.9em;
}

.schema-node-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.schema-node-list--nested {
  margin-top: 0.7rem;
}

.schema-node {
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 249, 244, 0.98)),
    #fffdfa;
}

.schema-node-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.schema-badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.schema-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0 0.65rem;
  border-radius: 999px;
  background: #f3f0eb;
  color: #5c667a;
  font-size: 0.8rem;
  font-weight: 600;
}

.schema-badge--type {
  background: #eef2f8;
}

.schema-badge--required {
  background: var(--accent-soft);
  color: var(--accent);
}

.schema-node-copy,
.schema-reference {
  margin: 0.6rem 0 0;
  color: var(--text-muted);
}

.schema-reference {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(99, 91, 255, 0.12);
  border-radius: 999px;
  background: rgba(99, 91, 255, 0.05);
}

.schema-reference a {
  font-weight: 600;
}

.schema-enum-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.schema-enum-list code {
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #faf7f2;
}

.schema-enum-wrap {
  margin-top: 0.85rem;
}

.schema-nested-block {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

.schema-subheading {
  margin-bottom: 0.55rem;
}

.schema-composition-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.schema-composition-block {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fcfbf8;
}

.schema-nested-block,
.schema-composition-block,
.schema-raw-panel {
  overflow: hidden;
}

.schema-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  color: #475167;
  font-size: 0.9rem;
  font-weight: 700;
  list-style: none;
  background: rgba(245, 241, 234, 0.7);
}

.schema-toggle::-webkit-details-marker {
  display: none;
}

.schema-toggle::after {
  content: '';
  flex: none;
  width: 0.48rem;
  height: 0.48rem;
  border-right: 1.5px solid #98a2b3;
  border-bottom: 1.5px solid #98a2b3;
  transform: rotate(-45deg);
  transition: transform 0.16s ease;
}

.schema-toggle:hover {
  background: rgba(99, 91, 255, 0.06);
}

.schema-nested-block[open] > .schema-toggle::after,
.schema-composition-block[open] > .schema-toggle::after,
.schema-raw-panel[open] > .schema-toggle::after {
  transform: rotate(45deg);
}

.schema-nested-block[open] > .schema-toggle,
.schema-composition-block[open] > .schema-toggle,
.schema-raw-panel[open] > .schema-toggle {
  border-bottom: 1px solid var(--border);
}

.schema-nested-block > .schema-node-list,
.schema-composition-block > .schema-node-list,
.schema-raw-panel-body {
  padding: 0 1rem 1rem;
}

.schema-raw-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fcfbf8;
}

.schema-raw-panel .schema-section-header {
  margin: 0 0 0.75rem;
}

.toc-panel {
  position: sticky;
  top: 5.75rem;
  width: 100%;
  max-width: 100%;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toc-panel--home {
  align-self: start;
  position: static;
}

.toc-list,
.sidebar-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-list {
  display: grid;
  gap: 0.35rem;
}

.toc-item a {
  display: block;
  color: var(--text-muted);
}

.toc-item--level-3 {
  padding-left: 0.75rem;
}

.sidebar-group + .sidebar-group {
  margin-top: 0.15rem;
}

.sidebar-group-label {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.48rem 0.6rem;
  border-radius: 10px;
  color: #4b5568;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.sidebar-group-label:hover {
  background: rgba(99, 91, 255, 0.06);
}

.sidebar-group-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.sidebar-group-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-group-count {
  flex: none;
  min-width: 1.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #f3f0eb;
  color: #667085;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.sidebar-disclosure > summary {
  list-style: none;
}

.sidebar-disclosure > summary::-webkit-details-marker {
  display: none;
}

.sidebar-group-chevron {
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid #98a2b3;
  border-bottom: 1.5px solid #98a2b3;
  transform: rotate(-45deg);
  transition: transform 0.16s ease;
  margin-top: -1px;
}

.sidebar-disclosure[open] .sidebar-group-chevron {
  transform: rotate(45deg);
}

.sidebar-sublist {
  display: grid;
  gap: 0.12rem;
  margin-top: 0.12rem;
  padding-left: 0.9rem;
  border-left: 1px solid #ece6dd;
}

.sidebar-sublist a {
  position: relative;
  padding: 0.45rem 0.6rem 0.45rem 0.95rem;
  color: #5e687c;
}

.sidebar-sublist a::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 50%;
  width: 0.26rem;
  height: 0.26rem;
  border-radius: 999px;
  background: #c7d0dd;
  transform: translateY(-50%);
}

.empty-state {
  padding: 1rem 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

  .workspace-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .workspace-topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 1.1rem 1rem 1rem;
  }

  .workspace-content {
    width: min(calc(100% - 2rem), 980px);
    padding: 1rem 0 3rem;
  }

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

  .toc-panel--home {
    position: static;
  }

  .doc-layout {
    grid-template-columns: 1fr;
  }

  .page-layout {
    grid-template-columns: 1fr;
  }

  .api-header {
    flex-direction: column;
    align-items: stretch;
  }

  .api-picker {
    min-width: 0;
  }

  .workspace-title {
    font-size: 1.45rem;
  }
}

@media (max-width: 640px) {
  .workspace-topbar,
  .content-section,
  .workspace-sidebar {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .api-header {
    padding: 1.25rem;
  }

  .resource-row {
    flex-direction: column;
  }

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

  .page-hero,
  .doc-article--page {
    padding: 1.35rem;
  }

  .schema-node,
  .schema-composition-block,
  .schema-summary-card,
  .schema-fact {
    padding: 0.95rem;
  }
}
