:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --text: #1c1d1f;
  --muted: #686f78;
  --border: #e1e6ed;
  --accent: #066cee;
  --accent-strong: #1071f3;
  --code-bg: #111827;
  --code-text: #e5e7eb;
  --ring: rgba(6, 108, 238, 0.18);
  --highlight-bg: rgba(6, 108, 238, 0.16);
  --shadow: 0 10px 28px rgba(29, 29, 29, 0.08);
  --header-bg: #066cee;
  --header-text: #ffffff;
  --header-muted: rgba(255, 255, 255, 0.72);
  --header-border: rgba(255, 255, 255, 0.16);
  --header-control-bg: rgba(255, 255, 255, 0.04);
  --sidebar-width: clamp(288px, 18vw, 380px);
  --sidebar-padding-x: 8px;
  --content-width: 90vw;
  --document-gap: clamp(36px, 4vw, 72px);
  --toc-width: clamp(180px, 14vw, 300px);
  --nav-indent: 18px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1d1d1d;
  --surface: #222223;
  --surface-soft: #2b2c2c;
  --text: #ffffff;
  --muted: #c0c2c4;
  --border: #434445;
  --accent: #5b99ba;
  --accent-strong: #adc4d2;
  --code-bg: #080b10;
  --code-text: #f3f4f6;
  --ring: rgba(91, 153, 186, 0.28);
  --highlight-bg: rgba(91, 153, 186, 0.3);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  --header-bg: #155f7a;
  --header-text: #ffffff;
  --header-muted: rgba(255, 255, 255, 0.72);
  --header-border: rgba(255, 255, 255, 0.16);
  --header-control-bg: rgba(255, 255, 255, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #1d1d1d;
    --surface: #222223;
    --surface-soft: #2b2c2c;
    --text: #ffffff;
    --muted: #c0c2c4;
    --border: #434445;
    --accent: #5b99ba;
    --accent-strong: #adc4d2;
    --code-bg: #080b10;
    --code-text: #f3f4f6;
    --ring: rgba(91, 153, 186, 0.28);
    --highlight-bg: rgba(91, 153, 186, 0.3);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    --header-bg: #155f7a;
    --header-text: #ffffff;
    --header-muted: rgba(255, 255, 255, 0.72);
    --header-border: rgba(255, 255, 255, 0.16);
    --header-control-bg: rgba(255, 255, 255, 0.05);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.625;
}

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

a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

a[href="#broken-link"] {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: line-through;
  text-decoration-style: dotted;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  column-gap: clamp(32px, 3.2vw, 64px);
  width: var(--content-width);
  min-height: calc(100vh - 64px);
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  background: transparent;
  padding: 24px var(--sidebar-padding-x) 16px 0;
}

.sidebar-search {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

.brand-link {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--header-text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
}

.brand-link:hover {
  color: var(--header-text);
  text-decoration: none;
}

.topbar-brand,
.topbar-brand:visited,
.topbar-brand:hover,
.topbar-brand:focus,
.topbar-brand:active {
  color: var(--header-text);
}

.brand-mark,
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

.brand-mark {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #ffffff;
}

.brand-logo {
  object-fit: contain;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  padding: 3px;
}

.search-box {
  display: block;
  margin-bottom: 20px;
}

.search-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

.nav-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-tree .nav-tree {
  display: none;
  margin: 2px 0 8px calc(var(--nav-indent) + 4px);
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.nav-item.is-expanded > .nav-tree {
  display: block;
}

.nav-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 4px;
  align-items: start;
  min-height: 32px;
  margin: 1px 0;
}

.nav-toggle,
.nav-spacer {
  width: 24px;
  height: 32px;
}

.nav-toggle {
  position: relative;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.nav-toggle::before {
  position: absolute;
  top: 11px;
  left: 8px;
  width: 7px;
  height: 7px;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  content: "";
  transform: rotate(-45deg);
  transition: transform 140ms ease, color 140ms ease;
}

.nav-item.is-expanded > .nav-row .nav-toggle::before {
  transform: rotate(45deg);
}

.nav-toggle:hover {
  background: rgba(6, 108, 238, 0.08);
  color: var(--accent);
}

.nav-link,
.nav-group {
  display: block;
  min-width: 0;
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  padding: 6px 6px 6px 8px;
  overflow-wrap: anywhere;
}

.nav-group {
  color: var(--muted);
  font-weight: 400;
}

.nav-link:hover {
  background: color-mix(in srgb, var(--accent), transparent 92%);
  color: var(--text);
  text-decoration: none;
}

.nav-item.is-current-branch > .nav-row .nav-group,
.nav-item.is-current-branch > .nav-row .nav-link:not(.is-active) {
  color: var(--muted);
}

.nav-link.is-active {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  box-shadow: inset 2px 0 0 var(--accent);
}

.nav-item.is-current-page > .nav-row .nav-toggle {
  color: var(--muted);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  height: 64px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  padding: 0 clamp(20px, 3vw, 44px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.topbar-title {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button,
.theme-toggle,
.topbar-action,
.language-picker select,
.topbar-search input,
.code-copy,
.search-panel button {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.topbar-brand {
  width: fit-content;
  font-size: 18px;
  font-weight: 650;
}

.topbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  border: 0;
  background: transparent;
  color: var(--header-text);
  white-space: nowrap;
  padding: 0;
}

.topbar-action:hover {
  color: var(--header-muted);
  text-decoration: none;
}

.language-picker {
  width: auto;
  min-width: 130px;
}

.language-picker span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.language-picker select {
  width: 100%;
  min-height: 20px;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--header-text);
  padding: 0 18px 0 0;
}

.language-picker {
  position: relative;
}

.language-picker::after {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 7px;
  height: 7px;
  border-right: 1.7px solid var(--header-muted);
  border-bottom: 1.7px solid var(--header-muted);
  content: "";
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}

.topbar-search {
  width: 224px;
  min-width: 0;
}

.topbar-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.topbar-search input {
  width: 100%;
  min-height: 39px;
  border-color: var(--header-border);
  border-radius: 12px;
  background: var(--header-control-bg);
  color: var(--header-text);
  padding: 8px 12px;
}

.topbar-search input::placeholder {
  color: var(--header-muted);
}

.icon-button {
  display: none;
  width: 40px;
  height: 40px;
  padding: 9px;
}

.icon-button span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--header-text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  min-width: 96px;
  border-color: var(--header-border);
  border-radius: 12px;
  background: var(--header-control-bg);
  color: var(--header-text);
  padding: 7px 12px;
}

.theme-toggle:hover {
  border-color: var(--header-text);
  color: var(--header-text);
}

.theme-toggle__icon {
  position: relative;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.theme-toggle__icon::after {
  position: absolute;
  inset: 2px 0 2px 6px;
  border-radius: 0 10px 10px 0;
  background: currentColor;
  content: "";
}

.document {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) var(--toc-width);
  gap: var(--document-gap);
  width: 100%;
  margin: 0;
  padding: 32px 0 70px;
}

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

.doc-content h1,
.doc-content h2,
.doc-content h3,
.doc-content h4 {
  line-height: 1.22;
}

.doc-content h1 {
  margin: 0 0 28px;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.doc-content h1 + .page-description {
  margin-top: -10px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 16px;
}

.doc-content h2 {
  margin-top: 42px;
  font-size: 26px;
}

.doc-content h3 {
  margin-top: 30px;
  font-size: 22px;
}

.doc-content p,
.doc-content li {
  color: var(--muted);
}

.doc-content ul,
.doc-content ol {
  padding-left: 24px;
}

.doc-content blockquote {
  border-left: 4px solid var(--accent);
  margin: 24px 0;
  padding: 12px 18px;
  background: var(--surface);
  color: var(--muted);
}

.doc-content figure {
  margin: 24px 0;
}

.doc-content div[align="left"] figure,
.doc-content div[align="center"] figure,
.doc-content div[align="right"] figure {
  display: inline-block;
  max-width: 100%;
}

.doc-content div[align="left"] {
  text-align: left;
}

.doc-content div[align="center"] {
  text-align: center;
}

.doc-content div[align="right"] {
  text-align: right;
}

.doc-content figure img {
  display: block;
  margin: 0 auto;
}

.doc-content figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.doc-content img {
  max-width: 100%;
  border-radius: 4px;
  box-shadow: none;
}

.doc-content img.image-zoomable {
  cursor: zoom-in;
}

.doc-content img.image-zoomable:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

body.has-image-lightbox {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(3, 10, 26, 0.92);
  cursor: zoom-out;
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 64px);
  max-height: calc(100vh - 64px);
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.image-lightbox__close {
  position: fixed;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(3, 10, 26, 0.82);
  color: #ffffff;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox__close:hover,
.image-lightbox__close:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  outline: none;
}

@media (max-width: 640px) {
  .image-lightbox {
    padding: 16px;
  }

  .image-lightbox__image {
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
  }
}

.doc-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 34px 0;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 4px;
  background: var(--accent);
  color: #ffffff;
  padding: 8px 14px;
  font-weight: 700;
}

.button-link:hover {
  background: var(--accent-strong);
  color: #ffffff;
  text-decoration: none;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}

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

.doc-content table[data-view="cards"] {
  display: block;
  min-width: 0;
  border-collapse: separate;
}

.doc-content table[data-view="cards"] thead {
  display: none;
}

.doc-content table[data-view="cards"] tbody {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.doc-content table[data-view="cards"] tr {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  padding: 12px 20px;
  transition: border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.doc-content table[data-view="cards"] tr:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.doc-content table[data-view="cards"] td {
  display: block;
  border: 0;
  padding: 0;
}

.doc-content table[data-view="cards"] td[data-hidden],
.doc-content table[data-view="cards"] th[data-hidden] {
  display: none;
}

.doc-content table[data-view="cards"] td:first-child {
  color: var(--text);
  font-weight: 500;
  text-align: left;
}

.doc-content table[data-view="cards"] td:first-child::first-letter {
  color: var(--accent);
}

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

th {
  background: var(--surface-soft);
  color: var(--text);
}

.code-block {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--code-bg);
  margin: 24px 0;
}

.code-block__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #b7c1cf;
  font-size: 12px;
  padding: 8px 10px;
}

.code-copy {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  padding: 4px 8px;
}

.code-block pre {
  overflow-x: auto;
  margin: 0;
  padding: 16px;
}

.code-block code {
  color: var(--code-text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.gitbook-hint {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 4px;
  background: var(--surface);
  margin: 24px 0;
  padding: 14px 16px;
}

.gitbook-hint__label {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.gitbook-hint__content > :first-child {
  margin-top: 0;
}

.gitbook-hint__content > :last-child {
  margin-bottom: 0;
}

.gitbook-hint--info {
  border-left-color: #787878;
  background: color-mix(in srgb, #787878, var(--surface) 94%);
}

.gitbook-hint--warning {
  border-left-color: #f59e0b;
  background: color-mix(in srgb, #f59e0b, var(--surface) 92%);
}

.gitbook-hint--danger {
  border-left-color: #ef4444;
  background: color-mix(in srgb, #ef4444, var(--surface) 92%);
}

.gitbook-hint--success {
  border-left-color: #10b981;
  background: color-mix(in srgb, #10b981, var(--surface) 92%);
}

.gitbook-content-ref,
.gitbook-embed--link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  margin: 18px 0;
  padding: 12px 20px;
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.gitbook-content-ref:hover,
.gitbook-embed--link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  text-decoration: none;
}

.gitbook-content-ref span,
.gitbook-embed--link span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.gitbook-content-ref strong,
.gitbook-embed--link strong {
  display: block;
  margin-top: 3px;
}

.gitbook-embed--video {
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  margin: 24px 0;
  overflow: hidden;
  background: var(--code-bg);
}

.gitbook-embed--video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.content-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 28px 0;
}

.content-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 12px 20px;
  transition: border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.content-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
  color: var(--accent);
  text-decoration: none;
}

.content-card svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 160ms ease;
}

.content-card:hover svg {
  transform: translateX(2px);
}

.section-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 32px;
}

.section-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: 0 0 0 1px var(--border);
  color: var(--text);
  padding: 12px 20px;
  text-decoration: none;
  transition: box-shadow 160ms ease, color 160ms ease;
}

.section-card:hover {
  box-shadow: 0 0 0 1px var(--accent);
  color: var(--text);
  text-decoration: none;
}

.section-card strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.625;
}

.section-card__eyebrow,
.section-card__meta {
  display: none;
}

.section-card svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  fill: none;
  padding: 0;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 160ms ease, color 160ms ease;
}

.section-card:hover svg {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  transform: translateX(2px);
}

.page-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 36px;
}

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

.page-link {
  display: block;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  padding: 16px;
}

.page-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.page-link--next {
  text-align: right;
}

.page-link span {
  display: block;
  font-size: 12px;
}

.page-link strong {
  display: block;
  color: var(--text);
  font-weight: 500;
  margin-top: 2px;
}

.page-toc {
  position: sticky;
  top: 82px;
  height: max-content;
  border-left: 0;
  padding-left: 18px;
}

.page-toc h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 13px;
  text-transform: uppercase;
}

.toc-empty,
.toc-list {
  color: var(--muted);
  font-size: 13px;
}

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

.toc-list li {
  margin: 6px 0;
}

.toc-level-3 {
  padding-left: 12px;
}

.search-panel {
  position: fixed;
  top: 72px;
  right: 24px;
  bottom: auto;
  z-index: 50;
  width: min(520px, calc(100vw - 48px));
}

.search-panel__inner {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
}

.search-panel button {
  padding: 6px 10px;
}

.search-results {
  max-height: 440px;
  overflow: auto;
  padding: 8px;
}

.search-result {
  display: block;
  border-radius: 4px;
  padding: 10px;
}

.search-result:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

.search-result strong,
.search-result span {
  display: block;
}

.search-result span,
.empty-state {
  color: var(--muted);
  font-size: 13px;
}

.search-highlight {
  border-radius: 2px;
  background: var(--highlight-bg);
  color: inherit;
  padding: 0 1px;
}

@media (max-width: 1280px) {
  :root {
    --sidebar-width: clamp(280px, 25vw, 340px);
    --content-width: min(100% - 40px, 1180px);
    --document-gap: 40px;
    --toc-width: 200px;
  }

  .topbar-search {
    width: 224px;
  }
}

@media (max-width: 1080px) {
  :root {
    --sidebar-width: 280px;
    --content-width: min(100% - 36px, 920px);
    --document-gap: 0;
  }

  .app-shell {
    column-gap: 32px;
  }

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

  .page-toc {
    display: none;
  }
}

@media (max-width: 820px) {
  :root {
    --content-width: min(100% - 32px, 820px);
  }

  body.has-sidebar-open {
    overflow: hidden;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 64px auto 0 0;
    z-index: 60;
    width: min(360px, 88vw);
    border-right: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 22px 0 48px rgba(0, 0, 0, 0.18);
    padding: 16px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar-search {
    display: block;
    margin-bottom: 14px;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 64px 0 0;
    z-index: 55;
    display: block;
    background: rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(2px);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .search-panel {
    top: 76px;
    right: 16px;
    left: 16px;
    z-index: 90;
    width: auto;
  }

  .search-results {
    max-height: calc(100vh - 160px);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .icon-button {
    display: block;
  }

  .topbar {
    z-index: 70;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    height: 64px;
    min-height: 64px;
    padding: 0 16px;
  }

  .topbar-brand {
    width: auto;
    min-width: 0;
  }

  .topbar-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    grid-column: auto;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }

  .topbar-main-link,
  .topbar-search {
    display: none;
  }

  .language-picker {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    overflow: hidden;
  }

  .language-picker select {
    width: 44px;
    min-height: 38px;
    border: 1px solid var(--header-border);
    border-radius: 12px;
    background: var(--header-control-bg);
    font-size: 18px;
    line-height: 1;
    padding: 7px 4px 7px 8px;
    text-overflow: clip;
  }

  .language-picker::after {
    display: none;
  }

  .theme-toggle {
    min-width: 0;
    width: 38px;
    padding: 0;
  }

  .theme-toggle__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .document {
    width: var(--content-width);
    margin: 0 auto;
    padding-top: 28px;
  }

  .content-card-grid,
  .section-card-grid,
  .page-links {
    grid-template-columns: 1fr;
  }

  .page-link--next {
    text-align: left;
  }

  .doc-content h1 {
    font-size: 27px;
    line-height: 1.14;
  }

  .doc-content h1 a {
    word-break: break-all;
  }

  .doc-content h2 {
    font-size: 24px;
  }
}

/* SitiosHispanos 2026 brand skin */
:root {
  --sh-navy: #071226;
  --sh-navy-2: #0a1933;
  --sh-panel: #0e203f;
  --sh-blue: #3978ff;
  --sh-cyan: #35d8ff;
  --sh-violet: #8057ff;
  --sh-mint: #a9ffcb;
  --sh-ink: #0a1830;
  --sh-muted: #61708a;
  --sh-paper: #f4f7fb;
  --sh-line: #dfe6ef;
  --bg: var(--sh-paper);
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --text: var(--sh-ink);
  --muted: var(--sh-muted);
  --border: var(--sh-line);
  --accent: var(--sh-blue);
  --accent-strong: #255fe4;
  --code-bg: #08152c;
  --code-text: #eaf2ff;
  --ring: rgba(53, 216, 255, 0.28);
  --highlight-bg: rgba(53, 216, 255, 0.28);
  --shadow: 0 26px 70px rgba(18, 44, 78, 0.13);
  --header-bg: rgba(7, 18, 38, 0.96);
  --header-text: #ffffff;
  --header-muted: #aab7cc;
  --header-border: rgba(255, 255, 255, 0.16);
  --header-control-bg: rgba(255, 255, 255, 0.06);
  --sidebar-width: clamp(292px, 22vw, 380px);
  --content-width: min(100% - 64px, 1550px);
  --document-gap: clamp(42px, 4vw, 72px);
  --toc-width: clamp(180px, 14vw, 250px);
}

[data-theme="dark"] {
  --bg: var(--sh-navy);
  --surface: #0b1a35;
  --surface-soft: #102346;
  --text: #eef4ff;
  --muted: #aab7cc;
  --border: rgba(255, 255, 255, 0.12);
  --accent: var(--sh-cyan);
  --accent-strong: #77e9ff;
  --code-bg: #050b18;
  --code-text: #eff6ff;
  --ring: rgba(53, 216, 255, 0.34);
  --highlight-bg: rgba(53, 216, 255, 0.24);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
  --header-bg: rgba(7, 18, 38, 0.97);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: var(--sh-navy);
    --surface: #0b1a35;
    --surface-soft: #102346;
    --text: #eef4ff;
    --muted: #aab7cc;
    --border: rgba(255, 255, 255, 0.12);
    --accent: var(--sh-cyan);
    --accent-strong: #77e9ff;
    --code-bg: #050b18;
    --code-text: #eff6ff;
    --ring: rgba(53, 216, 255, 0.34);
    --highlight-bg: rgba(53, 216, 255, 0.24);
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
    --header-bg: rgba(7, 18, 38, 0.97);
  }
}

body {
  background:
    var(--bg);
  font-family: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.topbar {
  height: 82px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: var(--header-bg);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
  padding: 0 max(32px, calc((100vw - 1550px) / 2));
}

.topbar::after {
  display: none;
  content: none;
}

.brand-link {
  grid-template-columns: 188px;
  gap: 0;
}

.brand-logo {
  width: 188px;
  height: 44px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.brand-logo-mobile {
  display: none;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--sh-blue), var(--sh-cyan));
  color: var(--sh-navy);
  font-weight: 800;
}

.topbar-brand > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.topbar-actions {
  gap: 14px;
}

.language-picker {
  position: relative;
  min-width: 132px;
}

.language-picker select,
.topbar-search input,
.theme-toggle {
  border-color: var(--header-border);
  border-radius: 8px;
  background: var(--header-control-bg);
  color: var(--header-text);
}

.language-picker select {
  min-height: 38px;
  padding: 0 34px 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.language-picker select option {
  color: var(--sh-ink);
  background: #ffffff;
}

.language-picker__flag {
  display: none;
}

.language-picker::after {
  right: 14px;
  border-color: var(--header-muted);
}

.topbar-search {
  width: clamp(220px, 20vw, 320px);
}

.topbar-search input {
  min-height: 42px;
  padding: 9px 14px;
}

.theme-toggle {
  min-height: 42px;
  min-width: 108px;
  font-size: 12px;
  font-weight: 700;
}

.theme-toggle__icon {
  width: 15px;
  height: 15px;
}

.app-shell {
  min-height: calc(100vh - 82px);
}

.sidebar {
  top: 82px;
  height: calc(100vh - 82px);
  padding-top: 28px;
  scrollbar-color: rgba(97, 112, 138, 0.38) transparent;
}

.search-box input {
  min-height: 44px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(18, 44, 78, 0.05);
}

.nav-tree .nav-tree {
  border-left-color: color-mix(in srgb, var(--accent), var(--border) 70%);
}

.nav-toggle {
  border-radius: 8px;
}

.nav-toggle:hover {
  background: color-mix(in srgb, var(--accent), transparent 88%);
}

.nav-link,
.nav-group {
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
}

.nav-link:hover {
  background: color-mix(in srgb, var(--accent), transparent 90%);
  color: var(--text);
}

.nav-link.is-active {
  background: color-mix(in srgb, var(--accent), transparent 88%);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.document {
  grid-template-columns: minmax(0, 760px) var(--toc-width);
  padding-top: 44px;
}

.doc-content {
  max-width: 760px;
}

.doc-content h1,
.doc-content h2,
.doc-content h3,
.doc-content h4,
.page-toc h2 {
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

/*
 * Escala de encabezados.
 *
 * El h1 se dimensiona contra el ancho de la columna de lectura, no contra el
 * ancho de la ventana. La columna está limitada a 760px, así que un h1 que
 * sigue creciendo con el viewport se despega del texto que encabeza: en una
 * pantalla de 1920px llegaba a 60px contra un cuerpo de 17px, más de tres
 * veces su tamaño, mientras h2 y h3 se quedaban fijos. El resultado no era un
 * título grande sino una escala rota.
 *
 * El término fluido se mantiene para que los anchos intermedios no salten, pero
 * el techo baja a 42px: con el cuerpo en 17px la relación queda en 2.4, que es
 * la proporción habitual en documentación y la que conserva la jerarquía
 * h1 > h2 > h3 en todos los tamaños.
 */
.doc-content h1 {
  max-width: 760px;
  margin-bottom: 24px;
  color: var(--text);
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 800;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.doc-content h1 a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.doc-content h1::after {
  display: block;
  width: 72px;
  height: 4px;
  margin-top: 22px;
  border-radius: 999px;
  content: "";
  background: linear-gradient(90deg, var(--sh-cyan), var(--sh-blue), var(--sh-violet));
}

.doc-content h1 + .page-description {
  max-width: 760px;
  margin-top: -4px;
  font-size: 17px;
  line-height: 1.75;
}

.doc-content h2 {
  margin-top: 48px;
  font-size: 28px;
  letter-spacing: 0;
}

.doc-content h3 {
  font-size: 22px;
  letter-spacing: 0;
}

.doc-content p,
.doc-content li {
  color: var(--muted);
}

/*
 * Párrafos justificados.
 *
 * La justificación sin partición de palabras reparte el sobrante en los
 * espacios de la línea, y en español —con palabras largas y frecuentes— eso
 * abre huecos que el ojo lee como columnas blancas verticales. `hyphens: auto`
 * es lo que lo evita: el navegador parte la última palabra usando el
 * diccionario del idioma declarado en <html lang>, que acá es español.
 *
 * No se fija `hyphenate-limit-chars`. Se probó `8 4 4` para evitar particiones
 * en palabras cortas y el resultado medido fue idéntico a no tener guiones:
 * el umbral es tan alto que ninguna palabra califica. Con el valor por defecto
 * del navegador, sobre una columna de 319px, el sobrante que la justificación
 * tiene que repartir baja de 64.5px a 27.1px en la peor línea y de 32.1px a
 * 11.4px en promedio. Si se vuelve a tocar, medir antes y después.
 *
 * Solo alcanza a los párrafos. Las listas, las tablas y los bloques de código
 * quedan alineados a la izquierda: sus líneas son cortas y justificarlas
 * exagera los espacios en lugar de disimularlos.
 */
.doc-content p {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* En una celda la medida es angosta y variable: justificar ahí abre huecos. */
.doc-content td p,
.doc-content th p {
  text-align: left;
}

.doc-content strong,
.doc-content h2,
.doc-content h3,
.doc-content h4 {
  color: var(--text);
}

.doc-content a {
  font-weight: 700;
}

.doc-content img,
.table-wrap,
.code-block,
.gitbook-hint,
.gitbook-content-ref,
.gitbook-embed--link,
.gitbook-embed--video,
.content-card,
.section-card,
.page-link,
.search-panel__inner {
  border-radius: 8px;
}

.doc-content img {
  border: 1px solid var(--border);
  background: var(--surface);
}

.table-wrap,
.gitbook-hint,
.gitbook-content-ref,
.gitbook-embed--link,
.content-card,
.section-card,
.page-link {
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(18, 44, 78, 0.055);
}

.button-link {
  min-height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--sh-blue), #255fe4);
  box-shadow: 0 14px 34px rgba(57, 120, 255, 0.2);
}

.button-link:hover {
  background: linear-gradient(135deg, #255fe4, var(--sh-blue));
}

th {
  background: var(--surface-soft);
}

.code-block {
  border-color: rgba(53, 216, 255, 0.18);
  box-shadow: 0 18px 45px rgba(8, 21, 44, 0.18);
}

.code-copy {
  border-radius: 6px;
}

.gitbook-hint {
  border-left-color: var(--accent);
}

.gitbook-hint__label {
  color: var(--accent);
  letter-spacing: 0;
}

.gitbook-hint--info {
  border-left-color: var(--sh-cyan);
}

.gitbook-hint--warning {
  border-left-color: #f5a524;
}

.gitbook-hint--danger {
  border-left-color: #ef4444;
}

.gitbook-hint--success {
  border-left-color: #16a36d;
}

.section-card {
  min-height: 72px;
}

.section-card:hover,
.content-card:hover,
.gitbook-content-ref:hover,
.gitbook-embed--link:hover {
  border-color: color-mix(in srgb, var(--accent), var(--border) 35%);
  box-shadow: 0 0 0 3px var(--ring), 0 16px 40px rgba(18, 44, 78, 0.08);
}

.page-toc {
  top: 110px;
  border-left: 1px solid var(--border);
}

.page-toc h2 {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.toc-list a {
  color: var(--muted);
}

.toc-list a:hover {
  color: var(--accent);
}

.search-panel {
  top: 96px;
}

.search-panel__inner {
  border-color: color-mix(in srgb, var(--accent), var(--border) 74%);
}

.search-panel__header {
  background: var(--surface-soft);
}

.search-result:hover {
  background: color-mix(in srgb, var(--accent), transparent 92%);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--sh-mint);
  outline-offset: 3px;
}

@media (min-width: 1600px) {
  :root {
    --content-width: min(100% - 48px, 2200px);
    --sidebar-width: clamp(320px, 18vw, 400px);
    --document-gap: clamp(48px, 3.5vw, 72px);
    --toc-width: clamp(200px, 13vw, 260px);
  }

  .document {
    grid-template-columns: minmax(760px, 1fr) var(--toc-width);
  }

  .doc-content {
    max-width: none;
  }

  .doc-content h1,
  .doc-content h1 + .page-description {
    max-width: 920px;
  }
}

@media (max-width: 1280px) {
  :root {
    --content-width: min(100% - 48px, 1180px);
    --sidebar-width: clamp(280px, 26vw, 330px);
    --document-gap: 36px;
    --toc-width: 180px;
  }

  .topbar {
    padding: 0 24px;
  }

  .document {
    grid-template-columns: minmax(0, 720px) var(--toc-width);
  }

  .doc-content {
    max-width: 720px;
  }

  .doc-content h1 {
    max-width: 720px;
    font-size: clamp(30px, 3.4vw, 40px);
  }
}

@media (max-width: 1080px) {
  :root {
    --content-width: min(100% - 40px, 920px);
    --sidebar-width: 280px;
    --document-gap: 30px;
  }

  .app-shell {
    column-gap: var(--document-gap);
  }

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

  .doc-content {
    max-width: 100%;
  }

  .doc-content h1 {
    max-width: 100%;
    font-size: clamp(29px, 3.8vw, 38px);
  }
}

@media (max-width: 820px) {
  :root {
    --content-width: min(100% - 32px, 820px);
  }

  .topbar {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    height: 72px;
    min-height: 72px;
    gap: 12px;
    padding: 0 16px;
  }

  .topbar::after {
    display: none;
  }

  .icon-button {
    width: 42px;
    height: 42px;
    border-color: var(--header-border);
    border-radius: 8px;
    background: var(--header-control-bg);
  }

  .topbar-brand {
    min-width: 0;
  }

  .brand-link {
    grid-template-columns: minmax(0, 172px);
  }

  .brand-logo {
    width: min(172px, 100%);
    height: 40px;
  }

  .brand-logo-mobile {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
    min-width: max-content;
  }

  .language-picker {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    border: 1px solid var(--header-border);
    border-radius: 8px;
    background: var(--header-control-bg);
  }

  .language-picker .language-picker__flag {
    display: grid;
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    clip-path: none;
    place-items: center;
    font-size: 20px;
    pointer-events: none;
  }

  .language-picker select {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: 0;
    opacity: 0;
    cursor: pointer;
  }

  .theme-toggle {
    width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 8px;
  }

  .sidebar {
    inset: 72px auto 0 0;
    width: min(380px, 88vw);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    background:
      radial-gradient(circle at 30% 0, rgba(53, 216, 255, 0.12), transparent 240px),
      var(--surface);
    box-shadow: 26px 0 70px rgba(0, 0, 0, 0.32);
    padding: 18px 16px 28px;
  }

  .sidebar-backdrop {
    inset: 72px 0 0;
  }

  .sidebar-search input {
    min-height: 46px;
  }

  .nav-row {
    min-height: 38px;
  }

  .nav-toggle,
  .nav-spacer {
    height: 38px;
  }

  .nav-link,
  .nav-group {
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 14px;
  }

  .document {
    width: var(--content-width);
    padding-top: 34px;
  }

  .doc-content h1 {
    font-size: clamp(29px, 5.2vw, 34px);
  }

  .doc-content h2 {
    font-size: 23px;
  }

  .doc-content h3 {
    font-size: 20px;
  }

  .search-panel {
    top: 84px;
  }
}

@media (max-width: 460px) {
  :root {
    --content-width: min(100% - 28px, 460px);
  }

  .topbar {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 0 12px;
  }

  .brand-link {
    grid-template-columns: 42px;
  }

  .brand-logo {
    display: none;
  }

  .brand-logo-mobile {
    display: block;
  }

  .doc-content h1 {
    font-size: 28px;
  }

  .doc-content h2 {
    font-size: 22px;
  }

  .doc-content h3 {
    font-size: 19px;
  }

  .page-links {
    gap: 10px;
  }
}

@media (max-width: 600px) {
  .brand-link {
    grid-template-columns: 42px;
  }

  .brand-logo {
    display: none;
  }

  .brand-logo-mobile {
    display: block;
  }

  .doc-content h1 a {
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
  }
}

.guide-reference {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
