:root {
  color-scheme: dark;
  --bg: #151516;
  --header: #1b1c1f;
  --sidebar: #202124;
  --content: #17181a;
  --text: #f3f4f6;
  --muted: #aab2bf;
  --line: #363940;
  --link: #61a8ff;
  --accent: #21a366;
  --accent-strong: #15803d;
  --code: #101113;
  --code-text: #e8edf2;
  --font: "GitLab Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: "GitLab Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sidebar-width: 312px;
  --sidebar-collapsed-width: 76px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  width: 100%;
  max-width: 100%;
  padding-left: var(--sidebar-width);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.62;
  overflow-x: hidden;
  transition: padding-left .18s ease;
}

body.sidebar-collapsed {
  padding-left: var(--sidebar-collapsed-width);
}

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

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--mono);
  font-size: .92em;
  overflow-wrap: anywhere;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  height: 58px;
  padding: 0 32px;
  background: color-mix(in srgb, var(--header) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

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

.search {
  position: relative;
  width: 320px;
  max-width: 34vw;
}

.search span {
  position: absolute;
  top: 50%;
  left: 11px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .82rem;
}

.search input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--content);
  color: var(--text);
  padding: 0 12px 0 62px;
  font: inherit;
  outline: none;
}

.search input:focus {
  border-color: var(--accent);
}

.menu-toggle,
.copy,
.sidebar-collapse {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--content);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  padding: 8px;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  transition: width .18s ease, transform .18s ease;
}

.sidebar-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 14px 140px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 4px 8px 16px;
  color: var(--text);
}

.sidebar-brand:hover {
  text-decoration: none;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: 46px;
  height: 36px;
  object-fit: contain;
}

.sidebar-brand span {
  display: grid;
  gap: 1px;
  min-width: 0;
  transition: opacity .12s ease;
}

.sidebar-brand strong {
  font-size: 1rem;
  line-height: 1.1;
}

.sidebar-brand em {
  color: var(--muted);
  font-size: .8rem;
  font-style: normal;
  line-height: 1.1;
}

.nav-title {
  padding: 8px 8px 10px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav-group summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 30px 0 10px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: "";
  position: absolute;
  top: 13px;
  right: 12px;
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform .14s ease;
}

.nav-group[open] summary::after {
  top: 16px;
  transform: rotate(-135deg);
}

.nav-icon,
.footer-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
}

.nav-items {
  display: grid;
  padding: 1px 0 6px 26px;
}

.nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--text);
  font-size: .91rem;
  line-height: 1.25;
}

.nav a.active,
.nav a:hover {
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
}

.sidebar-footer {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 66px;
  display: grid;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 4px;
  color: var(--text);
  font-size: .9rem;
}

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

.sidebar-collapse {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 12px;
  background: var(--header);
  color: var(--text);
}

.collapse-icon {
  display: block;
  width: 10px;
  height: 10px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(135deg);
  transition: transform .18s ease;
}

.collapse-text {
  white-space: nowrap;
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-main {
  overflow: hidden;
  padding-right: 10px;
  padding-left: 10px;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding-right: 0;
  padding-left: 0;
}

body.sidebar-collapsed .brand-logo {
  width: 42px;
}

body.sidebar-collapsed .sidebar-brand span,
body.sidebar-collapsed .sidebar-footer span:not(.footer-icon),
body.sidebar-collapsed .nav-title,
body.sidebar-collapsed .nav {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.sidebar-collapsed .sidebar-collapse {
  right: 14px;
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .sidebar-footer {
  align-items: center;
  justify-items: center;
}

body.sidebar-collapsed .footer-link {
  justify-content: center;
  width: 42px;
  padding: 0;
}

body.sidebar-collapsed .collapse-icon {
  transform: rotate(-45deg);
}

body.sidebar-collapsed .collapse-text {
  display: none;
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(0, 860px) 230px;
  gap: 34px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 32px;
}

.content {
  min-width: 0;
  padding: 20px 0 86px;
  overflow-wrap: break-word;
}

.doc-section {
  padding: 0 0 72px;
  margin: 0 0 42px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 84px;
}

.doc-section.hidden {
  display: none;
}

.breadcrumb {
  margin-top: 2px;
  padding-top: 4px;
  color: var(--muted);
  font-size: .95rem;
}

.updated {
  margin-top: -8px;
  color: var(--muted);
  font-size: .92rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin-top: 0;
}

h1 {
  margin: 62px 0 16px;
  font-size: 2.25rem;
  line-height: 1.18;
}

.doc-section:first-child h1 {
  margin-top: 62px;
}

h2 {
  margin: 44px 0 14px;
  font-size: 1.55rem;
  line-height: 1.28;
}

h3 {
  margin: 28px 0 10px;
  font-size: 1.1rem;
}

p,
li {
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

li + li {
  margin-top: 10px;
}

blockquote {
  margin: 24px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  background: transparent;
  color: var(--muted);
}

pre {
  position: relative;
  overflow: auto;
  max-width: 100%;
  margin: 18px 0 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--code);
  color: var(--code-text);
  line-height: 1.55;
}

pre code {
  color: inherit;
}

.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  font-size: .78rem;
}

table {
  width: 100%;
  margin: 18px 0 28px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: .95rem;
}

th,
td {
  padding: 11px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  background: var(--sidebar);
  color: var(--text);
  font-weight: 700;
}

.toc {
  position: sticky;
  top: 82px;
  height: calc(100vh - 82px);
  padding-top: 22px;
  overflow-y: auto;
}

.toc-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.toc a {
  display: block;
  padding: 6px 0;
  color: var(--text);
  font-size: .9rem;
}

.toc a.active {
  color: var(--link);
}

.search-results {
  position: absolute;
  top: 44px;
  right: 0;
  left: 0;
  z-index: 40;
  overflow: auto;
  max-height: min(420px, calc(100vh - 80px));
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--content);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
}

.search-results a {
  display: block;
  min-height: 58px;
  padding: 9px 11px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: .92rem;
}

.search-results a:last-child {
  border-bottom: 0;
}

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

.search-results strong {
  overflow: hidden;
  font-size: .9rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-results span {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-empty {
  padding: 10px 11px;
  color: var(--muted);
  font-size: .9rem;
}

.search-results a:hover {
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
}

.search-results a:hover span {
  color: #ffffff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(20px);
  z-index: 70;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--header);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

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

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

  .toc {
    display: none;
  }
}

@media (max-width: 760px) {
  body,
  body.sidebar-collapsed {
    padding-left: 0;
  }

  .site-header {
    justify-content: space-between;
    width: 100vw;
    max-width: 100vw;
    padding: 0 12px;
  }

  .header-actions {
    justify-self: end;
    min-width: 0;
  }

  .search {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    width: min(316px, 86vw);
    transform: translateX(-105%);
  }

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

  body.sidebar-collapsed .sidebar-main {
    overflow-y: auto;
    padding: 18px 14px 86px;
  }

  body.sidebar-collapsed .sidebar-brand {
    justify-content: flex-start;
    padding: 4px 8px 16px;
  }

  body.sidebar-collapsed .sidebar-brand span,
  body.sidebar-collapsed .sidebar-footer span:not(.footer-icon),
  body.sidebar-collapsed .nav-title,
  body.sidebar-collapsed .nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar-collapse {
    display: none;
  }

  .sidebar-footer {
    bottom: 14px;
  }

  .docs-layout {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0 36px 0 16px;
    overflow-x: hidden;
  }

  .content {
    width: auto;
    max-width: 100%;
    padding: 12px 0 70px;
  }

  h1 {
    margin-top: 42px;
    font-size: 2rem;
  }

  h2 {
    margin-top: 34px;
    font-size: 1.35rem;
  }

  .section-head {
    display: block;
  }

  th,
  td {
    padding: 9px;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  pre code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}
